@wirecat/tg-cli 0.108.0 → 0.109.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-YFWRJWL5.js → adapter-6JLFYFL5.js} +45 -44
- package/dist/bundle/{all-profiles-GQIZSF4W.js → all-profiles-X7Y3T5S4.js} +8 -8
- package/dist/bundle/{anthropic-BKWEDKPU.js → anthropic-LGVXAADT.js} +5 -5
- package/dist/bundle/{app-server-RJV7ICLH.js → app-server-UI3AFSJX.js} +40 -39
- package/dist/bundle/{bot-api-2PAH2JZ3.js → bot-api-TQYRNYJQ.js} +46 -45
- package/dist/bundle/{bot-history-DPPZ43F4.js → bot-history-DDNTNMNB.js} +15 -15
- package/dist/bundle/{bun-Q7COX3Z5.js → bun-WXGS6HML.js} +2 -2
- package/dist/bundle/{bun-sqlite-YI4AYZXO.js → bun-sqlite-M6JEXKRT.js} +4 -4
- package/dist/bundle/{chunk-PQHYM2XC.js → chunk-25VC6U3A.js} +1 -1
- package/dist/bundle/{chunk-DNOJKQXQ.js → chunk-2ILQYCBY.js} +377 -286
- package/dist/bundle/{chunk-EWL3ZFOI.js → chunk-3PEZWXKO.js} +6 -6
- package/dist/bundle/{chunk-LY2LFJMU.js → chunk-4R4AH6FM.js} +117 -94
- package/dist/bundle/{chunk-CVWF3BFK.js → chunk-5SUFMBU5.js} +44 -44
- package/dist/bundle/chunk-76C5SSMR.js +379 -0
- package/dist/bundle/{chunk-5HPXENE5.js → chunk-7AJ2IESO.js} +1 -1
- package/dist/bundle/{chunk-PCMW3PW6.js → chunk-7T7ILNCU.js} +2 -2
- package/dist/bundle/{chunk-ZYBDAZFO.js → chunk-AD3QPYI3.js} +2 -2
- package/dist/bundle/{chunk-ON67U6WV.js → chunk-AGVKIJB7.js} +6 -6
- package/dist/bundle/{chunk-YJ6GFFEE.js → chunk-BESIMQ5U.js} +1 -1
- package/dist/bundle/{chunk-76OSISA3.js → chunk-BHPCZCX7.js} +2 -2
- package/dist/bundle/{chunk-3GXKJKIC.js → chunk-BZIZLEJN.js} +4 -4
- package/dist/bundle/{chunk-BOSMBW4I.js → chunk-C3RX3UOE.js} +11 -11
- package/dist/bundle/{chunk-KQFR7ZAA.js → chunk-CH2ESVV5.js} +22 -22
- package/dist/bundle/{chunk-WUF64WOG.js → chunk-CHI6D4D6.js} +4 -4
- package/dist/bundle/{chunk-DUWTG2GE.js → chunk-CVLDXFRP.js} +8 -8
- package/dist/bundle/{chunk-MFS52LTZ.js → chunk-DLAFGSTN.js} +1 -1
- package/dist/bundle/{chunk-XZXOGHU5.js → chunk-DO33KAMM.js} +71 -60
- package/dist/bundle/{chunk-77OOX2OE.js → chunk-DZVYGBZB.js} +79 -56
- package/dist/bundle/{chunk-WAGDZB62.js → chunk-GUFM5RLW.js} +2 -2
- package/dist/bundle/{chunk-REI5TPS3.js → chunk-IGIPIO4J.js} +11 -11
- package/dist/bundle/{chunk-LYLGLFWY.js → chunk-INYO2QFW.js} +3 -3
- package/dist/bundle/{chunk-3HYDKCXB.js → chunk-IULYECPC.js} +12 -12
- package/dist/bundle/{chunk-6MZ2ZBX4.js → chunk-IV2QWSPG.js} +2 -2
- package/dist/bundle/{chunk-6QTUYMGX.js → chunk-KHKC236O.js} +2 -2
- package/dist/bundle/{chunk-QVIT6SQ5.js → chunk-M62LF3QE.js} +613 -381
- package/dist/bundle/{chunk-KZPZFPGB.js → chunk-MF6NKU3Z.js} +81 -30
- package/dist/bundle/{chunk-WEDWIXIC.js → chunk-N56WXUCW.js} +2 -2
- package/dist/bundle/{chunk-T4SDOYPY.js → chunk-N5FSRC6H.js} +117 -70
- package/dist/bundle/{chunk-FG2QTYEF.js → chunk-NAVNCM5K.js} +1 -1
- package/dist/bundle/{chunk-F67VPIJL.js → chunk-OHLMHBDI.js} +28 -28
- package/dist/bundle/{chunk-SONKULUF.js → chunk-P55L4S6N.js} +3 -3
- package/dist/bundle/{chunk-OB5PPPXH.js → chunk-P57R2P75.js} +7 -7
- package/dist/bundle/{chunk-5P27JGGA.js → chunk-P5ILJ7MN.js} +5 -5
- package/dist/bundle/{chunk-AS2BVZU3.js → chunk-QQF7RDLR.js} +49 -24
- package/dist/bundle/{chunk-WKSLGPZQ.js → chunk-RD2NLJSU.js} +16 -4
- package/dist/bundle/{chunk-NCXCBVHO.js → chunk-S7B6MTXX.js} +6 -6
- package/dist/bundle/{chunk-CZANI3DM.js → chunk-SH63Q4QR.js} +22 -22
- package/dist/bundle/{chunk-BT6PWDM6.js → chunk-TMXNMO66.js} +3 -3
- package/dist/bundle/{chunk-4RDMNNVO.js → chunk-UIPBAT2T.js} +26 -14
- package/dist/bundle/{chunk-EBB7RFCW.js → chunk-UUQ3BH2Z.js} +2 -2
- package/dist/bundle/{chunk-VMU4SGCE.js → chunk-VFVMB3NV.js} +8 -6
- package/dist/bundle/{chunk-B7TFWNKJ.js → chunk-VYR2IIWW.js} +1 -1
- package/dist/bundle/{chunk-AOUB2QFP.js → chunk-WHYS6OSG.js} +2 -2
- package/dist/bundle/{chunk-ZHHVNTBJ.js → chunk-WNTXIQMB.js} +2 -2
- package/dist/bundle/{chunk-26PWIQPP.js → chunk-XJVGCCQE.js} +666 -782
- package/dist/bundle/{chunk-67SRVSPU.js → chunk-XMMWKHNY.js} +26 -9
- package/dist/bundle/{chunk-BL72ZIBV.js → chunk-YXCQ4DLZ.js} +1 -1
- package/dist/bundle/{chunk-3562DVQ7.js → chunk-YYOIULA2.js} +8 -8
- package/dist/bundle/{chunk-TVA3NXXO.js → chunk-ZFMS5G4H.js} +2 -2
- package/dist/bundle/{chunk-D6DBVPES.js → chunk-ZHP44EML.js} +3 -3
- package/dist/bundle/{chunk-VK2YLSK7.js → chunk-ZMZKZL3Y.js} +1 -1
- package/dist/bundle/{chunk-R5YOKYTE.js → chunk-ZUOS7QUB.js} +11 -11
- package/dist/bundle/command-contract-E2MWR3T3.js +32 -0
- package/dist/bundle/{decode-ZFAFVFWX.js → decode-RKPOGPBE.js} +19 -17
- package/dist/bundle/{echarts-SVXNTKGV.js → echarts-H5QQRBHI.js} +2 -2
- package/dist/bundle/{embed-V755YE7O.js → embed-7TVAPNP7.js} +5 -5
- package/dist/bundle/{embedder-MQAPNQBH.js → embedder-YOOHWWN6.js} +8 -8
- package/dist/bundle/{entry-ULQ3VOMQ.js → entry-SAKW5HEZ.js} +5 -5
- package/dist/bundle/{first-run-64BTWXDR.js → first-run-C744N572.js} +9 -9
- package/dist/bundle/first-screen-7GKUEIWS.js +30 -0
- package/dist/bundle/{identity-PW45VBUU.js → identity-NRWTZIQ4.js} +3 -3
- package/dist/bundle/{instructions-G3ZUIRRH.js → instructions-6LWRAW47.js} +1 -1
- package/dist/bundle/{mcp-OQBZXELQ.js → mcp-WSGVVZWI.js} +2 -2
- package/dist/bundle/{node-IDJXLZSX.js → node-XN4PIVWW.js} +2 -2
- package/dist/bundle/{node-sqlite-W22J37MG.js → node-sqlite-PCBGROGQ.js} +4 -4
- package/dist/bundle/{oauth-Q52LBXDE.js → oauth-PX6NGHUV.js} +6 -6
- package/dist/bundle/{open-YLD7VHEC.js → open-BKJGJ6GX.js} +3 -3
- package/dist/bundle/openai-MJP7CZXP.js +250 -0
- package/dist/bundle/{process-OBESF2XG.js → process-4PRR3MLT.js} +1 -1
- package/dist/bundle/{program-EBMWHOKQ.js → program-7YZUO42B.js} +48 -47
- package/dist/bundle/{prompt-FHHQF3MG.js → prompt-CILSZC2R.js} +4 -4
- package/dist/bundle/{proxy-transport-YSBYG26I.js → proxy-transport-FWGKTYBL.js} +4 -4
- package/dist/bundle/{recognize-QNHKHGKM.js → recognize-AVFDJAIL.js} +5 -3
- package/dist/bundle/{remote-RVZWRCCT.js → remote-2VYXGOM4.js} +6 -6
- package/dist/bundle/{rerank-KG2USEME.js → rerank-6FU2JPCD.js} +6 -6
- package/dist/bundle/{serve-I4MJKEQ4.js → serve-3YQOHBR6.js} +8 -8
- package/dist/bundle/server-S2K4YDDG.js +56 -0
- package/dist/bundle/{server-GV7SV3L6.js → server-TPK3LNEX.js} +32 -31
- package/dist/bundle/{state-AJKHWFBU.js → state-LLUNBLZE.js} +5 -5
- package/dist/bundle/{store-L3HFSSGJ.js → store-27FQ743G.js} +10 -10
- package/dist/bundle/store-maintenance-command-AFJMKEBK.js +45 -0
- package/dist/bundle/tg.js +4 -4
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +3 -3
- package/dist/bundle/command-contract-5GJV6EHG.js +0 -32
- package/dist/bundle/first-screen-YZCH4TEV.js +0 -30
- package/dist/bundle/server-AXMWFPNT.js +0 -55
- package/dist/bundle/store-maintenance-command-Y22ARSDR.js +0 -44
- /package/dist/bundle/{chunk-O5EHUB2V.js → chunk-62EDJKGP.js} +0 -0
|
@@ -52,7 +52,7 @@ import {
|
|
|
52
52
|
validateQuery,
|
|
53
53
|
walkQuery,
|
|
54
54
|
zonedMoment
|
|
55
|
-
} from "./chunk-
|
|
55
|
+
} from "./chunk-DO33KAMM.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-YYOIULA2.js";
|
|
69
69
|
import {
|
|
70
70
|
DEFAULT_TASK_CATEGORIES,
|
|
71
71
|
sharedConfigPath,
|
|
72
72
|
storedTaskCategories,
|
|
73
73
|
taskCategoriesReader
|
|
74
|
-
} from "./chunk-
|
|
74
|
+
} from "./chunk-AGVKIJB7.js";
|
|
75
75
|
import {
|
|
76
76
|
storePath
|
|
77
|
-
} from "./chunk-
|
|
77
|
+
} from "./chunk-UUQ3BH2Z.js";
|
|
78
78
|
import {
|
|
79
79
|
PRAGMAS,
|
|
80
80
|
quietSqliteWarning,
|
|
81
81
|
storeCapable
|
|
82
|
-
} from "./chunk-
|
|
82
|
+
} from "./chunk-S7B6MTXX.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-ZMZKZL3Y.js";
|
|
108
108
|
import {
|
|
109
109
|
singleLine
|
|
110
|
-
} from "./chunk-
|
|
110
|
+
} from "./chunk-N5FSRC6H.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-XMMWKHNY.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.501.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.67.0_commander@15._175d7b0a70ee7b08949f50032917d93e/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.501.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.67.0_commander@15._175d7b0a70ee7b08949f50032917d93e/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.501.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.67.0_commander@15._175d7b0a70ee7b08949f50032917d93e/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.501.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.67.0_commander@15._175d7b0a70ee7b08949f50032917d93e/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.501.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.67.0_commander@15._175d7b0a70ee7b08949f50032917d93e/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.501.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.67.0_commander@15._175d7b0a70ee7b08949f50032917d93e/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.501.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.67.0_commander@15._175d7b0a70ee7b08949f50032917d93e/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.501.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.67.0_commander@15._175d7b0a70ee7b08949f50032917d93e/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.501.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.67.0_commander@15._175d7b0a70ee7b08949f50032917d93e/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.501.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.67.0_commander@15._175d7b0a70ee7b08949f50032917d93e/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.501.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.67.0_commander@15._175d7b0a70ee7b08949f50032917d93e/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.501.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.67.0_commander@15._175d7b0a70ee7b08949f50032917d93e/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.501.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.67.0_commander@15._175d7b0a70ee7b08949f50032917d93e/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.501.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.67.0_commander@15._175d7b0a70ee7b08949f50032917d93e/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.501.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.67.0_commander@15._175d7b0a70ee7b08949f50032917d93e/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.501.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.67.0_commander@15._175d7b0a70ee7b08949f50032917d93e/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.501.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.67.0_commander@15._175d7b0a70ee7b08949f50032917d93e/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.501.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.67.0_commander@15._175d7b0a70ee7b08949f50032917d93e/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.501.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.67.0_commander@15._175d7b0a70ee7b08949f50032917d93e/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.501.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.67.0_commander@15._175d7b0a70ee7b08949f50032917d93e/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.501.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.67.0_commander@15._175d7b0a70ee7b08949f50032917d93e/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.501.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.67.0_commander@15._175d7b0a70ee7b08949f50032917d93e/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.501.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.67.0_commander@15._175d7b0a70ee7b08949f50032917d93e/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.501.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.67.0_commander@15._175d7b0a70ee7b08949f50032917d93e/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.501.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.67.0_commander@15._175d7b0a70ee7b08949f50032917d93e/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.501.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.67.0_commander@15._175d7b0a70ee7b08949f50032917d93e/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.501.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.67.0_commander@15._175d7b0a70ee7b08949f50032917d93e/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.501.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.67.0_commander@15._175d7b0a70ee7b08949f50032917d93e/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.501.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.67.0_commander@15._175d7b0a70ee7b08949f50032917d93e/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.501.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.67.0_commander@15._175d7b0a70ee7b08949f50032917d93e/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.501.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.67.0_commander@15._175d7b0a70ee7b08949f50032917d93e/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.501.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.67.0_commander@15._175d7b0a70ee7b08949f50032917d93e/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.501.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.67.0_commander@15._175d7b0a70ee7b08949f50032917d93e/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.501.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.67.0_commander@15._175d7b0a70ee7b08949f50032917d93e/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.501.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.67.0_commander@15._175d7b0a70ee7b08949f50032917d93e/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.501.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.67.0_commander@15._175d7b0a70ee7b08949f50032917d93e/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,11 +15118,11 @@ 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.
|
|
15122
|
-
var toMs = /* @__PURE__ */ __name((
|
|
15123
|
-
if (
|
|
15121
|
+
// 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/sqlite/values.js
|
|
15122
|
+
var toMs = /* @__PURE__ */ __name((iso11) => {
|
|
15123
|
+
if (iso11 === null || iso11 === void 0)
|
|
15124
15124
|
return null;
|
|
15125
|
-
const ms = Date.parse(
|
|
15125
|
+
const ms = Date.parse(iso11);
|
|
15126
15126
|
return Number.isNaN(ms) ? null : ms;
|
|
15127
15127
|
}, "toMs");
|
|
15128
15128
|
var toIso = /* @__PURE__ */ __name((ms) => typeof ms === "number" ? new Date(ms).toISOString() : null, "toIso");
|
|
@@ -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.501.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.67.0_commander@15._175d7b0a70ee7b08949f50032917d93e/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.501.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.67.0_commander@15._175d7b0a70ee7b08949f50032917d93e/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.501.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.67.0_commander@15._175d7b0a70ee7b08949f50032917d93e/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.501.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.67.0_commander@15._175d7b0a70ee7b08949f50032917d93e/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.501.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.67.0_commander@15._175d7b0a70ee7b08949f50032917d93e/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.501.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.67.0_commander@15._175d7b0a70ee7b08949f50032917d93e/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;
|
|
@@ -15968,14 +15968,14 @@ var stemWriter = /* @__PURE__ */ __name((database, stemmer) => {
|
|
|
15968
15968
|
};
|
|
15969
15969
|
}, "stemWriter");
|
|
15970
15970
|
var nextQueued = /* @__PURE__ */ __name((database, limit) => database.prepare("SELECT id AS pk FROM message_stems_pending ORDER BY id LIMIT ?").all(limit).map((row2) => Number(row2.pk)), "nextQueued");
|
|
15971
|
-
var drainStems = /* @__PURE__ */ __name((database,
|
|
15971
|
+
var drainStems = /* @__PURE__ */ __name((database, stemmerFor2, limit = DRAIN_ON_WRITE2) => {
|
|
15972
15972
|
const pks = nextQueued(database, limit);
|
|
15973
15973
|
if (pks.length === 0)
|
|
15974
15974
|
return 0;
|
|
15975
15975
|
const stemmers = storeStemmers(database);
|
|
15976
15976
|
if (!stemmers)
|
|
15977
15977
|
return 0;
|
|
15978
|
-
const stemmer =
|
|
15978
|
+
const stemmer = stemmerFor2(stemmers);
|
|
15979
15979
|
return claim(database, stemmer.identity) ? stemWriter(database, stemmer).queued(pks) : 0;
|
|
15980
15980
|
}, "drainStems");
|
|
15981
15981
|
var stemmerCache = /* @__PURE__ */ __name(() => {
|
|
@@ -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.501.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.67.0_commander@15._175d7b0a70ee7b08949f50032917d93e/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) => {
|
|
@@ -16075,7 +16075,7 @@ var read = /* @__PURE__ */ __name((database, body2) => {
|
|
|
16075
16075
|
}
|
|
16076
16076
|
}, "read");
|
|
16077
16077
|
|
|
16078
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
16078
|
+
// 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/sqlite/vector-index.js
|
|
16079
16079
|
var source = /* @__PURE__ */ __name((model, dims) => `SELECT k.id, k.chunkable_type,
|
|
16080
16080
|
coalesce(CASE k.chunkable_type
|
|
16081
16081
|
WHEN 'image' THEN (SELECT ch.account_id FROM attachments a JOIN messages m ON m.id = a.attachable_id
|
|
@@ -16217,7 +16217,7 @@ var dropUnusedVectors = /* @__PURE__ */ __name((database, hashes) => {
|
|
|
16217
16217
|
}, "dropUnusedVectors");
|
|
16218
16218
|
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
16219
|
|
|
16220
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
16220
|
+
// 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/sqlite/accounts.js
|
|
16221
16221
|
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
16222
|
target: [accounts.provider, accounts.externalId],
|
|
16223
16223
|
set: {
|
|
@@ -16323,7 +16323,7 @@ var dropOrphanPeople = /* @__PURE__ */ __name((database, unseenBefore) => {
|
|
|
16323
16323
|
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
16324
|
}, "dropOrphanPeople");
|
|
16325
16325
|
|
|
16326
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
16326
|
+
// 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/sqlite/folded.js
|
|
16327
16327
|
var FOLDED = [
|
|
16328
16328
|
{ table: "tasks", column: "title" },
|
|
16329
16329
|
{ table: "tasks", column: "close_reason" },
|
|
@@ -16360,7 +16360,7 @@ var fillFolded = /* @__PURE__ */ __name((database, { batch = 2e3 } = {}) => {
|
|
|
16360
16360
|
return filled2;
|
|
16361
16361
|
}, "fillFolded");
|
|
16362
16362
|
|
|
16363
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
16363
|
+
// 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/conversations/chunks.js
|
|
16364
16364
|
import { createHash as createHash3 } from "node:crypto";
|
|
16365
16365
|
var CHUNK_CHARS = 1200;
|
|
16366
16366
|
var CHUNK_OVERLAP = 150;
|
|
@@ -16465,7 +16465,7 @@ var cutChunks = /* @__PURE__ */ __name((members2, limit = CHUNK_CHARS, check3, c
|
|
|
16465
16465
|
return chunks2;
|
|
16466
16466
|
}, "cutChunks");
|
|
16467
16467
|
|
|
16468
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
16468
|
+
// 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/search/task-signature.js
|
|
16469
16469
|
var DAY = 864e5;
|
|
16470
16470
|
var CURRENCY = [
|
|
16471
16471
|
[/^(₽|руб.*|р\.?|rub)$/u, "RUB"],
|
|
@@ -16582,7 +16582,7 @@ var dueDayOf = /* @__PURE__ */ __name((text5, createdMs) => {
|
|
|
16582
16582
|
return best?.day ?? null;
|
|
16583
16583
|
}, "dueDayOf");
|
|
16584
16584
|
|
|
16585
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
16585
|
+
// 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/search/task-similarity.js
|
|
16586
16586
|
var DAY2 = 864e5;
|
|
16587
16587
|
var STOP_WORDS = new Set([
|
|
16588
16588
|
// Russian and English as the test set ran them, already folded (пожалуйста → пожалуиста).
|
|
@@ -16737,7 +16737,7 @@ var rankCandidates = /* @__PURE__ */ __name((views, candidates) => candidates.ma
|
|
|
16737
16737
|
...compareViews(subjectViews ?? views, candidate, replyChain === void 0 ? {} : { replyChain })
|
|
16738
16738
|
})).sort((a, b) => b.score - a.score), "rankCandidates");
|
|
16739
16739
|
|
|
16740
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
16740
|
+
// 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/sqlite/vectors.js
|
|
16741
16741
|
var currentChunks = /* @__PURE__ */ __name((chatKey) => sql`SELECT k.content_hash, k.chunkable_id AS conversation_id, r.first_message_id,
|
|
16742
16742
|
r.last_message_id, r.text_start, r.text_end FROM chunks k JOIN chunk_messages r ON r.chunk_id = k.id
|
|
16743
16743
|
JOIN conversations c ON k.chunkable_type = 'conversation' AND c.id = k.chunkable_id
|
|
@@ -17008,7 +17008,7 @@ var readiness = /* @__PURE__ */ __name(({ orm }, chatKey, model) => {
|
|
|
17008
17008
|
};
|
|
17009
17009
|
}, "readiness");
|
|
17010
17010
|
|
|
17011
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
17011
|
+
// 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/sqlite/document-pictures.js
|
|
17012
17012
|
var DOCUMENT_PICTURE = "document_picture";
|
|
17013
17013
|
var SCAN_PAGE2 = 5e3;
|
|
17014
17014
|
var idOf = /* @__PURE__ */ __name((ref3) => {
|
|
@@ -17071,7 +17071,7 @@ var documentPicturesOver = /* @__PURE__ */ __name(({ database, now: now2 }) => (
|
|
|
17071
17071
|
}, "nearestPictures")
|
|
17072
17072
|
}), "documentPicturesOver");
|
|
17073
17073
|
|
|
17074
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
17074
|
+
// 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/sqlite/query-filter.js
|
|
17075
17075
|
var glob = /* @__PURE__ */ __name((value) => [...fold(value).matchAll(/\\(.)|([*?])|(.)/gsu)].map(([, escaped2, wildcard, plain2]) => {
|
|
17076
17076
|
const literal4 = escaped2 ?? plain2 ?? "";
|
|
17077
17077
|
return wildcard ?? (/[*?[]/u.test(literal4) ? `[${literal4}]` : literal4);
|
|
@@ -17136,7 +17136,7 @@ var compile = /* @__PURE__ */ __name((node, columns, options) => {
|
|
|
17136
17136
|
var queryFilter = /* @__PURE__ */ __name((ast, columns, options = {}) => compile(ast.root, columns, options), "queryFilter");
|
|
17137
17137
|
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
17138
|
|
|
17139
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
17139
|
+
// 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/sqlite/events.js
|
|
17140
17140
|
var toJson = /* @__PURE__ */ __name((value) => value === null || value === void 0 ? null : JSON.stringify(value), "toJson");
|
|
17141
17141
|
var fromJson = /* @__PURE__ */ __name((value) => value === null || value === void 0 ? null : JSON.parse(String(value)), "fromJson");
|
|
17142
17142
|
var int = /* @__PURE__ */ __name((value) => value === null || value === void 0 ? null : Number(value), "int");
|
|
@@ -17226,7 +17226,7 @@ var linkMeeting = /* @__PURE__ */ __name((database, id2, eventId, now2, mode = "
|
|
|
17226
17226
|
});
|
|
17227
17227
|
}, "linkMeeting");
|
|
17228
17228
|
|
|
17229
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
17229
|
+
// 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/sqlite/note-index.js
|
|
17230
17230
|
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
17231
|
var UNSEARCHED_EVENT_TYPES = [
|
|
17232
17232
|
"working-location",
|
|
@@ -17410,7 +17410,7 @@ var writer2 = /* @__PURE__ */ __name((database, corpus, stemmer) => {
|
|
|
17410
17410
|
statements.dequeue.run(queuedAs(corpus), id2);
|
|
17411
17411
|
};
|
|
17412
17412
|
}, "writer");
|
|
17413
|
-
var drainCorpus = /* @__PURE__ */ __name((database, corpus,
|
|
17413
|
+
var drainCorpus = /* @__PURE__ */ __name((database, corpus, stemmerFor2, { batch = 200, until = /* @__PURE__ */ __name(() => false, "until") } = {}) => {
|
|
17414
17414
|
if (corpus.type === "email" || corpus.type === "document")
|
|
17415
17415
|
database.prepare(`UPDATE chunks SET account_id = (SELECT account_id FROM ${corpus.table} WHERE id = chunks.chunkable_id)
|
|
17416
17416
|
WHERE chunkable_type = ? AND account_id IS NULL`).run(corpus.type);
|
|
@@ -17418,7 +17418,7 @@ var drainCorpus = /* @__PURE__ */ __name((database, corpus, stemmerFor, { batch
|
|
|
17418
17418
|
const state = corpusIndexState(database, corpus);
|
|
17419
17419
|
if (state.wanted === null)
|
|
17420
17420
|
return 0;
|
|
17421
|
-
const stemmer =
|
|
17421
|
+
const stemmer = stemmerFor2(savedStemmers(database) ?? DEFAULT_STEMMERS);
|
|
17422
17422
|
const queue = `${corpus.type}_index_pending`;
|
|
17423
17423
|
if (state.built !== stemmer.identity) {
|
|
17424
17424
|
write(database, () => {
|
|
@@ -17447,7 +17447,7 @@ var drainCorpus = /* @__PURE__ */ __name((database, corpus, stemmerFor, { batch
|
|
|
17447
17447
|
}
|
|
17448
17448
|
return done;
|
|
17449
17449
|
}, "drainCorpus");
|
|
17450
|
-
var drainNoteIndex = /* @__PURE__ */ __name((database,
|
|
17450
|
+
var drainNoteIndex = /* @__PURE__ */ __name((database, stemmerFor2, options = {}) => drainCorpus(database, CORPORA.document, stemmerFor2, options) + drainCorpus(database, CORPORA.note, stemmerFor2, options) + fillTrigrams(database, options), "drainNoteIndex");
|
|
17451
17451
|
var resetNoteIndex = /* @__PURE__ */ __name((database) => {
|
|
17452
17452
|
write(database, () => {
|
|
17453
17453
|
for (const corpus of Object.values(CORPORA))
|
|
@@ -17456,7 +17456,7 @@ var resetNoteIndex = /* @__PURE__ */ __name((database) => {
|
|
|
17456
17456
|
return true;
|
|
17457
17457
|
}, "resetNoteIndex");
|
|
17458
17458
|
|
|
17459
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
17459
|
+
// 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/sqlite/person-resolution.js
|
|
17460
17460
|
var keyOf3 = /* @__PURE__ */ __name((name) => fold(name).trim().replace(/^@/, ""), "keyOf");
|
|
17461
17461
|
var resolvePersonLinks = /* @__PURE__ */ __name((database, names) => {
|
|
17462
17462
|
for (const key2 of new Set(names.filter((name) => !!name?.trim()).map(keyOf3))) {
|
|
@@ -17475,7 +17475,7 @@ var resolvePersonLinks = /* @__PURE__ */ __name((database, names) => {
|
|
|
17475
17475
|
}
|
|
17476
17476
|
}, "resolvePersonLinks");
|
|
17477
17477
|
|
|
17478
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
17478
|
+
// 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/sqlite/identities.js
|
|
17479
17479
|
var flag2 = /* @__PURE__ */ __name((value) => value === void 0 || value === null ? null : Number(value), "flag");
|
|
17480
17480
|
var prepare = /* @__PURE__ */ __name((orm) => ({
|
|
17481
17481
|
find: orm.select({
|
|
@@ -17700,7 +17700,7 @@ var meetingIdentityPk = /* @__PURE__ */ __name((context, accountId, identity) =>
|
|
|
17700
17700
|
}, "meetingIdentityPk");
|
|
17701
17701
|
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
17702
|
|
|
17703
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
17703
|
+
// 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/sqlite/chats.js
|
|
17704
17704
|
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
17705
|
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
17706
|
var chatPkFor = /* @__PURE__ */ __name((context, accountKey, chatId) => findChatPk(context, accountKey, chatId) ?? Number(context.orm.insert(chats).values({
|
|
@@ -17980,7 +17980,7 @@ var replaceAutoTags = /* @__PURE__ */ __name((context, key2, chatId, algorithm,
|
|
|
17980
17980
|
}
|
|
17981
17981
|
}, "replaceAutoTags");
|
|
17982
17982
|
|
|
17983
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
17983
|
+
// 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/domain/counters.js
|
|
17984
17984
|
var COUNTER_FIELDS = ["views", "reactions", "comments"];
|
|
17985
17985
|
var validCounter = /* @__PURE__ */ __name((value) => typeof value === "number" && Number.isFinite(value) && value >= 0, "validCounter");
|
|
17986
17986
|
var counterValue = /* @__PURE__ */ __name((message2, field3) => {
|
|
@@ -18017,7 +18017,7 @@ var counterFreshness = /* @__PURE__ */ __name((states) => {
|
|
|
18017
18017
|
return states.some((one) => one.freshness === "stale") ? "stale" : "fresh";
|
|
18018
18018
|
}, "counterFreshness");
|
|
18019
18019
|
|
|
18020
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
18020
|
+
// 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/conversations/mail-text.js
|
|
18021
18021
|
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
18022
|
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
18023
|
var ATTRIBUTION = /(wrote|написал[аи]?|escribió|a écrit|schrieb)\s*:\s*$/iu;
|
|
@@ -18098,7 +18098,7 @@ var mailCore = /* @__PURE__ */ __name((body2, earlier) => {
|
|
|
18098
18098
|
return withoutSignOff(withoutGreeting(kept)).join("\n").trim();
|
|
18099
18099
|
}, "mailCore");
|
|
18100
18100
|
|
|
18101
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
18101
|
+
// 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/sqlite/email-index.js
|
|
18102
18102
|
var titleOf = /* @__PURE__ */ __name((subject2) => subject2?.replace(/^\s*((re|fwd?|aw|wg)\s*:\s*)+/i, "").trim() || null, "titleOf");
|
|
18103
18103
|
var MAIL_PIECES = `(SELECT k.id, k.content_hash, k.chunkable_type AS type, k.chunkable_id AS owner, k.position,
|
|
18104
18104
|
k.start_offset, k.end_offset, k.account_id, k.occurred_at, a.attachable_id AS email_id,
|
|
@@ -18165,7 +18165,7 @@ var chunkAttachments = /* @__PURE__ */ __name((database, accountId, emailId, now
|
|
|
18165
18165
|
}, "chunkAttachments");
|
|
18166
18166
|
var MAIL_CUT = "mail_pieces_cut";
|
|
18167
18167
|
var CUT = "email";
|
|
18168
|
-
var drainEmailIndex = /* @__PURE__ */ __name((database,
|
|
18168
|
+
var drainEmailIndex = /* @__PURE__ */ __name((database, stemmerFor2) => {
|
|
18169
18169
|
if (database.prepare("SELECT value FROM store_settings WHERE key = ?").get(MAIL_CUT)?.value !== CUT)
|
|
18170
18170
|
write(database, () => {
|
|
18171
18171
|
const single = database.prepare("SELECT DISTINCT content_hash AS hash FROM chunks WHERE chunkable_type = 'email'").all().map(({ hash: hash2 }) => String(hash2));
|
|
@@ -18188,7 +18188,7 @@ var drainEmailIndex = /* @__PURE__ */ __name((database, stemmerFor) => {
|
|
|
18188
18188
|
dropUnusedVectors(database, before2);
|
|
18189
18189
|
}
|
|
18190
18190
|
});
|
|
18191
|
-
const emails3 = drainCorpus(database, CORPORA.email,
|
|
18191
|
+
const emails3 = drainCorpus(database, CORPORA.email, stemmerFor2);
|
|
18192
18192
|
const next = database.prepare("SELECT id FROM email_index_pending WHERE indexable_type = 'email_thread' ORDER BY id LIMIT 50");
|
|
18193
18193
|
const done = database.prepare("DELETE FROM email_index_pending WHERE indexable_type = 'email_thread' AND id = ?");
|
|
18194
18194
|
let threads = 0;
|
|
@@ -18208,7 +18208,7 @@ var drainEmailIndex = /* @__PURE__ */ __name((database, stemmerFor) => {
|
|
|
18208
18208
|
return emails3 + threads;
|
|
18209
18209
|
}, "drainEmailIndex");
|
|
18210
18210
|
|
|
18211
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
18211
|
+
// 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/sqlite/email-locations.js
|
|
18212
18212
|
var locate = /* @__PURE__ */ __name((database, accountId, emailId, where) => database.prepare(`INSERT OR REPLACE INTO email_locations (mailbox_id, uidvalidity, uid, email_id)
|
|
18213
18213
|
SELECT id, ?, ?, ? FROM mailboxes WHERE account_id = ? AND external_id = ?`).run(where.uidvalidity, where.uid, emailId, accountId, where.folder), "locate");
|
|
18214
18214
|
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 +18254,7 @@ var forgetLocations = /* @__PURE__ */ __name((database, accountId, folder, uidva
|
|
|
18254
18254
|
leave.run(emailId, Number(box.id), emailId, Number(box.id));
|
|
18255
18255
|
}, "forgetLocations");
|
|
18256
18256
|
|
|
18257
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
18257
|
+
// 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/sqlite/email-state.js
|
|
18258
18258
|
var recountEmailThread = /* @__PURE__ */ __name((database, threadId, now2) => database.prepare(`UPDATE email_threads SET
|
|
18259
18259
|
emails_count = (SELECT count(*) FROM emails WHERE email_thread_id = ? AND deleted_at IS NULL),
|
|
18260
18260
|
last_email_at = (SELECT max(coalesce(sent_at, received_at)) FROM emails
|
|
@@ -18304,7 +18304,7 @@ var markEmailsRestored = /* @__PURE__ */ __name((database, accountId, externalId
|
|
|
18304
18304
|
return threads.length;
|
|
18305
18305
|
}, "markEmailsRestored");
|
|
18306
18306
|
|
|
18307
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
18307
|
+
// 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/sqlite/mail-rules.js
|
|
18308
18308
|
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
18309
|
var conditionsKey = /* @__PURE__ */ __name((conditions) => JSON.stringify(sorted(conditions)), "conditionsKey");
|
|
18310
18310
|
var ruleOf = /* @__PURE__ */ __name((row2) => ({
|
|
@@ -18371,7 +18371,7 @@ var mailRulesOver = /* @__PURE__ */ __name((database) => ({
|
|
|
18371
18371
|
}
|
|
18372
18372
|
}), "mailRulesOver");
|
|
18373
18373
|
|
|
18374
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
18374
|
+
// 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/sqlite/link-reviews.js
|
|
18375
18375
|
var reviewLink = /* @__PURE__ */ __name((database, linkable, entity, candidates, reason, now2) => {
|
|
18376
18376
|
database.prepare(`INSERT INTO link_reviews (linkable_type, linkable_id, entity_type, candidates, reason, status, created_at, updated_at)
|
|
18377
18377
|
VALUES (?, ?, ?, ?, ?, 'open', ?, ?)
|
|
@@ -18379,7 +18379,7 @@ var reviewLink = /* @__PURE__ */ __name((database, linkable, entity, candidates,
|
|
|
18379
18379
|
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
18380
|
}, "reviewLink");
|
|
18381
18381
|
|
|
18382
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
18382
|
+
// 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/sqlite/meeting-operation.js
|
|
18383
18383
|
function checkMeetingCancelled(signal) {
|
|
18384
18384
|
if (!signal?.aborted)
|
|
18385
18385
|
return;
|
|
@@ -18390,7 +18390,7 @@ function checkMeetingCancelled(signal) {
|
|
|
18390
18390
|
}
|
|
18391
18391
|
__name(checkMeetingCancelled, "checkMeetingCancelled");
|
|
18392
18392
|
|
|
18393
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
18393
|
+
// 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/sqlite/meeting-values.js
|
|
18394
18394
|
var meetingOf = /* @__PURE__ */ __name((row2) => ({
|
|
18395
18395
|
id: Number(row2.id),
|
|
18396
18396
|
accountId: Number(row2.account_id),
|
|
@@ -18440,7 +18440,7 @@ var transcriptRowOf = /* @__PURE__ */ __name((row2) => ({
|
|
|
18440
18440
|
createdAt: Number(row2.created_at)
|
|
18441
18441
|
}), "transcriptRowOf");
|
|
18442
18442
|
|
|
18443
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
18443
|
+
// 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/sqlite/meeting-reads.js
|
|
18444
18444
|
var MEETING_TEXT = ["external_id", "title", "description", "location", "join_url", "timezone", "metadata"];
|
|
18445
18445
|
var TRANSCRIPT_TEXT = ["source", "format", "language", "content_hash", "metadata"];
|
|
18446
18446
|
var ROW_TEXT = ["speaker_name", "text", "normalized_text", "metadata"];
|
|
@@ -18607,7 +18607,7 @@ var meetingReadsOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
|
18607
18607
|
}
|
|
18608
18608
|
}), "meetingReadsOver");
|
|
18609
18609
|
|
|
18610
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
18610
|
+
// 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/sqlite/meeting-selection.js
|
|
18611
18611
|
var meetingSelectionSql = /* @__PURE__ */ __name((input) => {
|
|
18612
18612
|
const clauses = ["m.account_id=?", "m.deleted_at IS NULL"];
|
|
18613
18613
|
const params = [input.accountId];
|
|
@@ -18650,7 +18650,7 @@ var meetingSelectionSql = /* @__PURE__ */ __name((input) => {
|
|
|
18650
18650
|
return { clauses, params };
|
|
18651
18651
|
}, "meetingSelectionSql");
|
|
18652
18652
|
|
|
18653
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
18653
|
+
// 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/sqlite/meeting-chat-lines.js
|
|
18654
18654
|
var meetingChatLinesOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
18655
18655
|
async meetingChatLines(input) {
|
|
18656
18656
|
checkMeetingCancelled(input.signal);
|
|
@@ -18678,7 +18678,7 @@ var meetingChatLinesOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
|
18678
18678
|
}
|
|
18679
18679
|
}), "meetingChatLinesOver");
|
|
18680
18680
|
|
|
18681
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
18681
|
+
// 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/sqlite/reads.js
|
|
18682
18682
|
var MESSAGE_FIELDS = {
|
|
18683
18683
|
pk: messages.id,
|
|
18684
18684
|
nativeId: messages.externalId,
|
|
@@ -18845,7 +18845,7 @@ var chatActivity = /* @__PURE__ */ __name(({ database }, accountKey, since, wher
|
|
|
18845
18845
|
storedAt: toIso(Number(database.prepare("SELECT max(created_at) AS at FROM messages WHERE account_id = ?").get(accountKey)?.at) || null)
|
|
18846
18846
|
}), "chatActivity");
|
|
18847
18847
|
|
|
18848
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
18848
|
+
// 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/sqlite/search.js
|
|
18849
18849
|
var HIT_FIELDS = {
|
|
18850
18850
|
...MESSAGE_FIELDS,
|
|
18851
18851
|
chatTitle: sql`${chats.title}`.as("chat_title"),
|
|
@@ -18944,7 +18944,7 @@ var directReplies = /* @__PURE__ */ __name((context, parents, limit) => {
|
|
|
18944
18944
|
};
|
|
18945
18945
|
}, "directReplies");
|
|
18946
18946
|
|
|
18947
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
18947
|
+
// 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/sqlite/person-links.js
|
|
18948
18948
|
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
18949
|
var required = /* @__PURE__ */ __name((context, ref3) => {
|
|
18950
18950
|
const found2 = identityRow(context, ref3);
|
|
@@ -19075,7 +19075,7 @@ var mentioning = /* @__PURE__ */ __name((context, accountKey, { id: id2, usernam
|
|
|
19075
19075
|
}, "mentioning");
|
|
19076
19076
|
var escaped = /* @__PURE__ */ __name((text5) => text5.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), "escaped");
|
|
19077
19077
|
|
|
19078
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
19078
|
+
// 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/sqlite/meeting-context-links.js
|
|
19079
19079
|
var missing2 = /* @__PURE__ */ __name(() => {
|
|
19080
19080
|
throw new CliError("not_found", "Meeting, participant or selected target not found");
|
|
19081
19081
|
}, "missing");
|
|
@@ -19197,7 +19197,7 @@ function meetingContextLinksOver(context) {
|
|
|
19197
19197
|
}
|
|
19198
19198
|
__name(meetingContextLinksOver, "meetingContextLinksOver");
|
|
19199
19199
|
|
|
19200
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
19200
|
+
// 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/sqlite/meeting-index-values.js
|
|
19201
19201
|
var INDEX_CODES = { meeting_transcript_row: 1, meeting_chat_message: 2, meeting_summary: 3 };
|
|
19202
19202
|
var meetingRowid = /* @__PURE__ */ __name((type, id2) => id2 * 4 + INDEX_CODES[type], "meetingRowid");
|
|
19203
19203
|
var summaryOf = /* @__PURE__ */ __name((row2) => ({
|
|
@@ -19226,7 +19226,7 @@ var indexedText = /* @__PURE__ */ __name((database, type, id2) => {
|
|
|
19226
19226
|
return row2 ? summaryText(summaryOf(row2)) : null;
|
|
19227
19227
|
}, "indexedText");
|
|
19228
19228
|
|
|
19229
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
19229
|
+
// 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/sqlite/meeting-stem-state.js
|
|
19230
19230
|
var summaryBytes = ["title", "overview", "sections", "next_steps", "content"].map((key2) => `coalesce(length(CAST(s.${key2} AS BLOB)),0)`).join("+");
|
|
19231
19231
|
var meetingCurrentIndexRows = `
|
|
19232
19232
|
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 +19257,7 @@ var invalidateMeetingStems = /* @__PURE__ */ __name((database, type, id2) => {
|
|
|
19257
19257
|
}, "invalidateMeetingStems");
|
|
19258
19258
|
var meetingStemmableText = /* @__PURE__ */ __name((text5) => text5.replace(/[\p{L}\p{N}\p{M}\p{Co}]+/gu, (token) => token.length <= 1024 ? token : ""), "meetingStemmableText");
|
|
19259
19259
|
|
|
19260
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
19260
|
+
// 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/sqlite/meeting-hit-index.js
|
|
19261
19261
|
function meetingHitIndexOver({ database, now: now2 }) {
|
|
19262
19262
|
return {
|
|
19263
19263
|
async indexSearch(original) {
|
|
@@ -19325,10 +19325,10 @@ function meetingHitIndexOver({ database, now: now2 }) {
|
|
|
19325
19325
|
}
|
|
19326
19326
|
__name(meetingHitIndexOver, "meetingHitIndexOver");
|
|
19327
19327
|
|
|
19328
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
19328
|
+
// 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/sqlite/meeting-hit-search.js
|
|
19329
19329
|
import { createHash as createHash4 } from "node:crypto";
|
|
19330
19330
|
|
|
19331
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
19331
|
+
// 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/search/trigrams.js
|
|
19332
19332
|
var trigrams = /* @__PURE__ */ __name((term) => {
|
|
19333
19333
|
const padded = ` ${term} `;
|
|
19334
19334
|
const pieces = /* @__PURE__ */ new Set();
|
|
@@ -19337,7 +19337,7 @@ var trigrams = /* @__PURE__ */ __name((term) => {
|
|
|
19337
19337
|
return [...pieces];
|
|
19338
19338
|
}, "trigrams");
|
|
19339
19339
|
|
|
19340
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
19340
|
+
// 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/search/correct.js
|
|
19341
19341
|
var SHORTEST_CORRECTION = 3;
|
|
19342
19342
|
var maxEdits = /* @__PURE__ */ __name((word) => word.length <= 4 ? 1 : 2, "maxEdits");
|
|
19343
19343
|
var editDistance = /* @__PURE__ */ __name((a, b, max) => {
|
|
@@ -19384,7 +19384,7 @@ var correctWords = /* @__PURE__ */ __name(async (vocabulary, words3) => {
|
|
|
19384
19384
|
return corrections;
|
|
19385
19385
|
}, "correctWords");
|
|
19386
19386
|
|
|
19387
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
19387
|
+
// 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/search/garbled.js
|
|
19388
19388
|
var SHORTEST_GARBLED = 4;
|
|
19389
19389
|
var MOST_WIDENED = 64;
|
|
19390
19390
|
var plain = /* @__PURE__ */ __name((word) => word.replaceAll("\u044D", "\u0435"), "plain");
|
|
@@ -19476,7 +19476,7 @@ var widenWords = /* @__PURE__ */ __name((probes, vocabulary, stem, known2) => {
|
|
|
19476
19476
|
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
19477
|
}, "widenWords");
|
|
19478
19478
|
|
|
19479
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
19479
|
+
// 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/search/russian-dictionary.js
|
|
19480
19480
|
import { readFileSync } from "node:fs";
|
|
19481
19481
|
var loaded;
|
|
19482
19482
|
var dictionary = /* @__PURE__ */ __name(() => {
|
|
@@ -19535,7 +19535,7 @@ var knownRussianWord = /* @__PURE__ */ __name((word) => {
|
|
|
19535
19535
|
return false;
|
|
19536
19536
|
}, "knownRussianWord");
|
|
19537
19537
|
|
|
19538
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
19538
|
+
// 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/sqlite/meeting-hit-query.js
|
|
19539
19539
|
var WORD3 = /[\p{L}\p{N}\p{M}]+/gu;
|
|
19540
19540
|
var MOST_WORDS = 128;
|
|
19541
19541
|
var quote = /* @__PURE__ */ __name((word) => `"${word.replaceAll('"', '""')}"`, "quote");
|
|
@@ -19762,7 +19762,7 @@ var matchMeetingText = /* @__PURE__ */ __name((tree, text5, stemmer) => {
|
|
|
19762
19762
|
return check3(tree);
|
|
19763
19763
|
}, "matchMeetingText");
|
|
19764
19764
|
|
|
19765
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
19765
|
+
// 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/sqlite/meeting-hit-search.js
|
|
19766
19766
|
var fail3 = /* @__PURE__ */ __name((message2) => {
|
|
19767
19767
|
throw new CliError("validation_error", message2);
|
|
19768
19768
|
}, "fail");
|
|
@@ -19939,7 +19939,7 @@ function meetingHitSearchOver({ database }) {
|
|
|
19939
19939
|
}
|
|
19940
19940
|
__name(meetingHitSearchOver, "meetingHitSearchOver");
|
|
19941
19941
|
|
|
19942
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
19942
|
+
// 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/sqlite/meeting-participant-search.js
|
|
19943
19943
|
import { createHash as createHash5 } from "node:crypto";
|
|
19944
19944
|
var cursorOf2 = /* @__PURE__ */ __name((value, key2) => {
|
|
19945
19945
|
if (value === void 0)
|
|
@@ -20029,7 +20029,7 @@ var meetingParticipantSearchOver = /* @__PURE__ */ __name((context) => ({
|
|
|
20029
20029
|
}
|
|
20030
20030
|
}), "meetingParticipantSearchOver");
|
|
20031
20031
|
|
|
20032
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
20032
|
+
// 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/sqlite/preparation-context-queries.js
|
|
20033
20033
|
var preparationQueries = {
|
|
20034
20034
|
participants: {
|
|
20035
20035
|
fields: "p.id, p.identity_id, p.display_name, l.person_id",
|
|
@@ -20079,7 +20079,7 @@ var preparationQueries = {
|
|
|
20079
20079
|
}
|
|
20080
20080
|
};
|
|
20081
20081
|
|
|
20082
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
20082
|
+
// 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/sqlite/meeting-preparation-context.js
|
|
20083
20083
|
var meetingPreparationContextOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
20084
20084
|
async preparationContext(original) {
|
|
20085
20085
|
const input = validateMeetingPreparationContext(original);
|
|
@@ -20120,7 +20120,7 @@ var meetingPreparationContextOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
|
20120
20120
|
}
|
|
20121
20121
|
}), "meetingPreparationContextOver");
|
|
20122
20122
|
|
|
20123
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
20123
|
+
// 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/sqlite/preparation-subjects.js
|
|
20124
20124
|
var preparationSubjects = /* @__PURE__ */ __name((anchors) => `WITH anchors AS (
|
|
20125
20125
|
SELECT m.id FROM meetings m JOIN meeting_series s ON s.id=m.meeting_series_id
|
|
20126
20126
|
WHERE m.id IN (${Array.from({ length: anchors }, () => "?").join(",")}) AND m.account_id=? AND s.account_id=?
|
|
@@ -20134,7 +20134,7 @@ var preparationSubjects = /* @__PURE__ */ __name((anchors) => `WITH anchors AS (
|
|
|
20134
20134
|
JOIN main.projects p ON p.id=l.to_id WHERE p.account_id IS NULL AND p.deleted_at IS NULL
|
|
20135
20135
|
)`, "preparationSubjects");
|
|
20136
20136
|
|
|
20137
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
20137
|
+
// 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/sqlite/meeting-preparation-knowledge.js
|
|
20138
20138
|
var meetingPreparationKnowledgeOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
20139
20139
|
async preparationKnowledge(original) {
|
|
20140
20140
|
const { accountId, seriesId, anchorIds, after: after2, before: before2, limit, maxReadBytes, signal } = validateMeetingRelatedHistory(original);
|
|
@@ -20179,7 +20179,7 @@ var meetingPreparationKnowledgeOver = /* @__PURE__ */ __name(({ database }) => (
|
|
|
20179
20179
|
}
|
|
20180
20180
|
}), "meetingPreparationKnowledgeOver");
|
|
20181
20181
|
|
|
20182
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
20182
|
+
// 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/sqlite/meeting-preparation-notes.js
|
|
20183
20183
|
var meetingPreparationNotesOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
20184
20184
|
async preparationNotes(original) {
|
|
20185
20185
|
const { accountId, seriesId, anchorIds, after: after2, before: before2, limit, maxReadBytes, signal } = validateMeetingRelatedHistory(original);
|
|
@@ -20232,7 +20232,7 @@ var meetingPreparationNotesOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
|
20232
20232
|
}
|
|
20233
20233
|
}), "meetingPreparationNotesOver");
|
|
20234
20234
|
|
|
20235
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
20235
|
+
// 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/sqlite/meeting-related-history.js
|
|
20236
20236
|
var meetingRelatedHistoryOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
20237
20237
|
async relatedHistory(original) {
|
|
20238
20238
|
const input = validateMeetingRelatedHistory(original);
|
|
@@ -20303,7 +20303,7 @@ var meetingRelatedHistoryOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
|
20303
20303
|
}
|
|
20304
20304
|
}), "meetingRelatedHistoryOver");
|
|
20305
20305
|
|
|
20306
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
20306
|
+
// 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/sqlite/meeting-review.js
|
|
20307
20307
|
var number2 = /* @__PURE__ */ __name((value) => value === null || value === void 0 ? null : Number(value), "number");
|
|
20308
20308
|
var text2 = /* @__PURE__ */ __name((value) => value === null || value === void 0 ? null : String(value), "text");
|
|
20309
20309
|
var meetingReviewOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
@@ -20384,7 +20384,7 @@ var meetingReviewOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
|
20384
20384
|
}
|
|
20385
20385
|
}), "meetingReviewOver");
|
|
20386
20386
|
|
|
20387
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
20387
|
+
// 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/sqlite/meeting-series-history.js
|
|
20388
20388
|
var bytes2 = "length(CAST(external_id AS BLOB)) + coalesce(length(CAST(title AS BLOB)), 0)";
|
|
20389
20389
|
var ensureBytes2 = /* @__PURE__ */ __name((size2, budget) => {
|
|
20390
20390
|
if (!Number.isSafeInteger(size2) || size2 < 0 || size2 > budget)
|
|
@@ -20438,7 +20438,7 @@ var meetingSeriesHistoryOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
|
20438
20438
|
}
|
|
20439
20439
|
}), "meetingSeriesHistoryOver");
|
|
20440
20440
|
|
|
20441
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
20441
|
+
// 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/sqlite/meeting-stats.js
|
|
20442
20442
|
var MOST_ROWS = 5e5;
|
|
20443
20443
|
var meetingStatsOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
20444
20444
|
async meetingStats(input) {
|
|
@@ -20485,7 +20485,7 @@ var meetingStatsOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
|
20485
20485
|
}
|
|
20486
20486
|
}), "meetingStatsOver");
|
|
20487
20487
|
|
|
20488
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
20488
|
+
// 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/sqlite/meetings.js
|
|
20489
20489
|
var CURSOR_KEY = "meetings";
|
|
20490
20490
|
var seriesOf2 = /* @__PURE__ */ __name((row2) => ({
|
|
20491
20491
|
id: Number(row2.id),
|
|
@@ -21037,7 +21037,7 @@ var meetingStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
21037
21037
|
};
|
|
21038
21038
|
}, "meetingStoreOver");
|
|
21039
21039
|
|
|
21040
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
21040
|
+
// 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/sqlite/emails.js
|
|
21041
21041
|
var threadConversation = /* @__PURE__ */ __name((place, builtAt) => ({
|
|
21042
21042
|
id: `email:${place.emailId}`,
|
|
21043
21043
|
chatId: place.threadExternalId,
|
|
@@ -21370,7 +21370,7 @@ var emailHitsByPk = /* @__PURE__ */ __name((database, pks) => {
|
|
|
21370
21370
|
];
|
|
21371
21371
|
});
|
|
21372
21372
|
}, "emailHitsByPk");
|
|
21373
|
-
var mailStoreOver = /* @__PURE__ */ __name(({ database, orm },
|
|
21373
|
+
var mailStoreOver = /* @__PURE__ */ __name(({ database, orm }, stemmerFor2 = stemmerCache()) => ({
|
|
21374
21374
|
rules: mailRulesOver(database),
|
|
21375
21375
|
async saveThread(input) {
|
|
21376
21376
|
const id2 = write(database, () => saveThread(database, orm, input));
|
|
@@ -21492,7 +21492,7 @@ var mailStoreOver = /* @__PURE__ */ __name(({ database, orm }, stemmerFor = stem
|
|
|
21492
21492
|
markDeleted: /* @__PURE__ */ __name(async (accountId, externalIds, now2) => write(database, () => markEmailsDeleted(database, accountId, externalIds, now2)), "markDeleted"),
|
|
21493
21493
|
markRestored: /* @__PURE__ */ __name(async (accountId, externalIds, now2) => write(database, () => markEmailsRestored(database, accountId, externalIds, now2)), "markRestored"),
|
|
21494
21494
|
async chunksToEmbed(model, { after: after2, limit }) {
|
|
21495
|
-
drainEmailIndex(database,
|
|
21495
|
+
drainEmailIndex(database, stemmerFor2);
|
|
21496
21496
|
const file = database.prepare("SELECT text FROM attachments WHERE id = ?");
|
|
21497
21497
|
const threads = /* @__PURE__ */ new Map();
|
|
21498
21498
|
return database.prepare(`SELECT p.content_hash AS hash, min(p.type || ':' || p.owner) AS owner, p.position, p.start_offset AS start,
|
|
@@ -21514,7 +21514,7 @@ var mailStoreOver = /* @__PURE__ */ __name(({ database, orm }, stemmerFor = stem
|
|
|
21514
21514
|
});
|
|
21515
21515
|
},
|
|
21516
21516
|
async nearest(model, query, { accountId, limit, threadExternalId, since }) {
|
|
21517
|
-
drainEmailIndex(database,
|
|
21517
|
+
drainEmailIndex(database, stemmerFor2);
|
|
21518
21518
|
const page3 = database.prepare(`SELECT p.id, p.type, p.owner, p.position, p.email_id AS email, v.vector FROM ${MAIL_PIECES}
|
|
21519
21519
|
JOIN embeddings v ON v.model = ? AND v.content_hash = p.content_hash
|
|
21520
21520
|
WHERE p.id > ? AND p.account_id = ?
|
|
@@ -21577,7 +21577,7 @@ var mailStoreOver = /* @__PURE__ */ __name(({ database, orm }, stemmerFor = stem
|
|
|
21577
21577
|
if (match === null)
|
|
21578
21578
|
return [];
|
|
21579
21579
|
const [limit, offset] = page(filter);
|
|
21580
|
-
drainEmailIndex(database,
|
|
21580
|
+
drainEmailIndex(database, stemmerFor2);
|
|
21581
21581
|
const [where, params] = emailWhere({ ...filter, includeDeleted: false });
|
|
21582
21582
|
return database.prepare(`SELECT e.* FROM email_words w JOIN emails e ON e.id = w.rowid
|
|
21583
21583
|
WHERE email_words MATCH ? AND ${where}
|
|
@@ -21585,7 +21585,7 @@ var mailStoreOver = /* @__PURE__ */ __name(({ database, orm }, stemmerFor = stem
|
|
|
21585
21585
|
}
|
|
21586
21586
|
}), "mailStoreOver");
|
|
21587
21587
|
|
|
21588
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
21588
|
+
// 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/search/dictionary.js
|
|
21589
21589
|
import { readFileSync as readFileSync2 } from "node:fs";
|
|
21590
21590
|
var DICTIONARIES = Object.fromEntries(LANGUAGES.map(({ name, dictionary: dictionary3 }) => [name, dictionary3]));
|
|
21591
21591
|
var folded4 = /* @__PURE__ */ __name((word) => /^[а-яё'-]*$/.test(word) ? word.replaceAll("\u0451", "\u0435").replaceAll("\u0439", "\u0438") : fold(word), "folded");
|
|
@@ -21675,7 +21675,7 @@ var knownWord = /* @__PURE__ */ __name((languages) => {
|
|
|
21675
21675
|
}, "knownWord");
|
|
21676
21676
|
var dictionaryLanguages = /* @__PURE__ */ __name((stemmers) => [stemmers.cyrillic, ...stemmers.latin.split(",")].filter((name) => Object.hasOwn(DICTIONARIES, name)), "dictionaryLanguages");
|
|
21677
21677
|
|
|
21678
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
21678
|
+
// 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/sqlite/transcript-query.js
|
|
21679
21679
|
var predicates = /* @__PURE__ */ __name((node) => node.kind === "predicate" ? [node] : node.clauses.flatMap(({ node: node2 }) => predicates(node2)), "predicates");
|
|
21680
21680
|
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
21681
|
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 +21761,7 @@ var spokenTranscripts = /* @__PURE__ */ __name((database, item, speaking, keys)
|
|
|
21761
21761
|
return found2;
|
|
21762
21762
|
}, "spokenTranscripts");
|
|
21763
21763
|
|
|
21764
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
21764
|
+
// 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/sqlite/hit-places.js
|
|
21765
21765
|
var placeHits = /* @__PURE__ */ __name((database, corpus, leaves, transcripts, found2, pks) => {
|
|
21766
21766
|
const placeLeaves = leaves.filter(({ node }) => (node.operator === "term" || node.operator === "phrase") && (node.implicit || node.field === "content" || node.field === "transcript"));
|
|
21767
21767
|
if (!placeLeaves.length || !pks.length || found2.length !== pks.length)
|
|
@@ -21808,7 +21808,7 @@ var placeHits = /* @__PURE__ */ __name((database, corpus, leaves, transcripts, f
|
|
|
21808
21808
|
});
|
|
21809
21809
|
}, "placeHits");
|
|
21810
21810
|
|
|
21811
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
21811
|
+
// 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/sqlite/lucene.js
|
|
21812
21812
|
var MESSAGES2 = {
|
|
21813
21813
|
rows: "messages",
|
|
21814
21814
|
threads: "chats",
|
|
@@ -21844,6 +21844,17 @@ var GROUPS = {
|
|
|
21844
21844
|
var matchQuery = /* @__PURE__ */ __name((context, execution) => runQuery(context, execution), "matchQuery");
|
|
21845
21845
|
var countQuery = /* @__PURE__ */ __name((context, execution, by) => runQuery(context, execution, by), "countQuery");
|
|
21846
21846
|
var queryMessagePks = /* @__PURE__ */ __name((context, execution) => runQuery(context, execution, "pks"), "queryMessagePks");
|
|
21847
|
+
var countMatches = /* @__PURE__ */ __name((context, execution, cap) => {
|
|
21848
|
+
const { database, check: check3, where, from: from2, withRanking, ranked, leaves } = compileQuery(context, {
|
|
21849
|
+
...execution,
|
|
21850
|
+
newest: true
|
|
21851
|
+
});
|
|
21852
|
+
if (leaves.some(({ test }) => test))
|
|
21853
|
+
return void 0;
|
|
21854
|
+
const row2 = database.prepare(`SELECT count(*) AS n FROM (${withRanking}SELECT m.id ${from2} WHERE ${where.sql} LIMIT ?)`).get(...ranked.params, ...where.params, cap + 1);
|
|
21855
|
+
check3();
|
|
21856
|
+
return Number(row2?.n ?? 0);
|
|
21857
|
+
}, "countMatches");
|
|
21847
21858
|
var compileQuery = /* @__PURE__ */ __name((context, execution, boundedAttachments = false) => {
|
|
21848
21859
|
const { database } = context;
|
|
21849
21860
|
const corpus = execution.corpus === "mail" ? MAIL : MESSAGES2;
|
|
@@ -22270,7 +22281,7 @@ var runQuery = /* @__PURE__ */ __name(async (context, execution, by) => {
|
|
|
22270
22281
|
};
|
|
22271
22282
|
}, "runQuery");
|
|
22272
22283
|
|
|
22273
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
22284
|
+
// 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/sqlite/counters.js
|
|
22274
22285
|
function invalidMetadata() {
|
|
22275
22286
|
throw new CliError("validation_error", "stored counter metadata is malformed \u2014 check the store before refreshing");
|
|
22276
22287
|
}
|
|
@@ -22372,7 +22383,7 @@ var counterTargets = /* @__PURE__ */ __name((context, execution, options) => wit
|
|
|
22372
22383
|
};
|
|
22373
22384
|
}), "counterTargets");
|
|
22374
22385
|
|
|
22375
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
22386
|
+
// 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/sqlite/attachment-texts.js
|
|
22376
22387
|
var NOT_FILE_LIST = [...NOT_FILES].map((kind3) => `'${kind3}'`).join(",");
|
|
22377
22388
|
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,
|
|
22378
22389
|
att.size, att.local_path, att.extraction AS origin, att.size AS read_bytes, att.extraction_error AS error, att.content_sha256, att.extractor
|
|
@@ -22491,7 +22502,7 @@ var attachmentViews = /* @__PURE__ */ __name(({ database }, accountKey, { chatKe
|
|
|
22491
22502
|
}));
|
|
22492
22503
|
}, "attachmentViews");
|
|
22493
22504
|
|
|
22494
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
22505
|
+
// 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/sqlite/transcripts.js
|
|
22495
22506
|
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");
|
|
22496
22507
|
var keepTranscript = /* @__PURE__ */ __name((context, chatKey, messageId, text5, source2) => {
|
|
22497
22508
|
const { orm, database, now: now2 } = context;
|
|
@@ -22529,7 +22540,7 @@ var intoVoiceAttachment = /* @__PURE__ */ __name((context, messagePk) => {
|
|
|
22529
22540
|
keepText(context, Number(row2.id), { text: String(row2.text), origin: "extracted", extractor: `speech:${row2.source}` });
|
|
22530
22541
|
}, "intoVoiceAttachment");
|
|
22531
22542
|
|
|
22532
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
22543
|
+
// 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/sqlite/messages.js
|
|
22533
22544
|
var FIELDS = [
|
|
22534
22545
|
"threadExternalId",
|
|
22535
22546
|
"senderIdentityId",
|
|
@@ -22846,7 +22857,7 @@ var writeDerivedReactions = /* @__PURE__ */ __name((context, chatKey, messageId)
|
|
|
22846
22857
|
reactionStatementsOf(context.database).total.run(JSON.stringify(derived), chatKey, messageId);
|
|
22847
22858
|
}, "writeDerivedReactions");
|
|
22848
22859
|
|
|
22849
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
22860
|
+
// 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/sqlite/sync.js
|
|
22850
22861
|
var syncStateOf = /* @__PURE__ */ __name(({ orm }, accountKey, name) => {
|
|
22851
22862
|
const row2 = orm.select({ value: syncCursors.value, at: syncCursors.updatedAt }).from(syncCursors).where(and(eq(syncCursors.accountId, accountKey), eq(syncCursors.key, name))).get();
|
|
22852
22863
|
return row2 ? { value: row2.value, at: toIso(row2.at) } : void 0;
|
|
@@ -22872,7 +22883,7 @@ var release = /* @__PURE__ */ __name(({ orm }, chatKey, anchor, holder) => {
|
|
|
22872
22883
|
orm.delete(fetchLeases).where(and(eq(fetchLeases.chatId, chatKey), eq(fetchLeases.anchor, anchor), eq(fetchLeases.holder, holder))).run();
|
|
22873
22884
|
}, "release");
|
|
22874
22885
|
|
|
22875
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
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
|
|
22876
22887
|
var keysOver = /* @__PURE__ */ __name((context) => {
|
|
22877
22888
|
const findAccountPk2 = /* @__PURE__ */ __name((key2) => findAccountPk(context, key2), "findAccountPk");
|
|
22878
22889
|
const findChatPk2 = /* @__PURE__ */ __name((accountKey, chatId) => findChatPk(context, accountKey, chatId), "findChatPk");
|
|
@@ -22893,7 +22904,7 @@ var keysOver = /* @__PURE__ */ __name((context) => {
|
|
|
22893
22904
|
};
|
|
22894
22905
|
}, "keysOver");
|
|
22895
22906
|
|
|
22896
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
22907
|
+
// 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/sqlite/account-groups.js
|
|
22897
22908
|
var accountGroupsOf = /* @__PURE__ */ __name((database) => {
|
|
22898
22909
|
const row2 = database.prepare("SELECT value FROM store_settings WHERE key = ?").get(ACCOUNT_GROUPS);
|
|
22899
22910
|
if (!row2)
|
|
@@ -22928,7 +22939,7 @@ var saveProfile = /* @__PURE__ */ __name((database, app, profile, key2, now2) =>
|
|
|
22928
22939
|
database.prepare("INSERT OR REPLACE INTO store_settings (key, value, at) VALUES (?, ?, ?)").run(PROFILES, JSON.stringify(profiles), now2);
|
|
22929
22940
|
}, "saveProfile");
|
|
22930
22941
|
|
|
22931
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
22942
|
+
// 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/sqlite/actors.js
|
|
22932
22943
|
var BOT_KINDS = ["agent", "script", "integration"];
|
|
22933
22944
|
var ownerPerson = /* @__PURE__ */ __name((database) => {
|
|
22934
22945
|
const found2 = database.prepare("SELECT id FROM persons WHERE owner = 1 ORDER BY id LIMIT 1").get();
|
|
@@ -22964,7 +22975,7 @@ var originOfActor = /* @__PURE__ */ __name((database, type, id2) => {
|
|
|
22964
22975
|
return database.prepare("SELECT name FROM bots WHERE id = ?").get(Number(id2))?.name === "rule" ? "rule" : "agent";
|
|
22965
22976
|
}, "originOfActor");
|
|
22966
22977
|
|
|
22967
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
22978
|
+
// 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/sqlite/own-identities.js
|
|
22968
22979
|
var linkOwnIdentities = /* @__PURE__ */ __name((context) => {
|
|
22969
22980
|
const owner = ownerPerson(context.database).id;
|
|
22970
22981
|
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);
|
|
@@ -22985,7 +22996,7 @@ var linkToOwner = /* @__PURE__ */ __name((context, ref3) => {
|
|
|
22985
22996
|
return personOf(context, ref3);
|
|
22986
22997
|
}, "linkToOwner");
|
|
22987
22998
|
|
|
22988
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
22999
|
+
// 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/sqlite/providers.js
|
|
22989
23000
|
var PROVIDERS_SETTING = "providers";
|
|
22990
23001
|
var storedProvidersOf = /* @__PURE__ */ __name((database) => {
|
|
22991
23002
|
const row2 = database.prepare("SELECT value FROM store_settings WHERE key = ?").get(PROVIDERS_SETTING);
|
|
@@ -23020,7 +23031,7 @@ var registerProvider = /* @__PURE__ */ __name((database, value, now2) => {
|
|
|
23020
23031
|
});
|
|
23021
23032
|
}, "registerProvider");
|
|
23022
23033
|
|
|
23023
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
23034
|
+
// 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/sqlite/task-candidates.js
|
|
23024
23035
|
var DAY3 = 864e5;
|
|
23025
23036
|
var RECENTLY_CLOSED_MS = 14 * DAY3;
|
|
23026
23037
|
var TEXT_LIMIT = 20;
|
|
@@ -23033,7 +23044,7 @@ var ABOUT_TASK = ["related-to", "evidence", "created-from"];
|
|
|
23033
23044
|
var PLACEHOLDER = /* @__PURE__ */ __name((row2) => `${String(row2.type)} \u2014 ${String(row2.source_locator ?? "")}`, "PLACEHOLDER");
|
|
23034
23045
|
var taskSimilarityOver = /* @__PURE__ */ __name((context) => {
|
|
23035
23046
|
const { database, now: now2 } = context;
|
|
23036
|
-
const
|
|
23047
|
+
const stemmerFor2 = stemmerCache();
|
|
23037
23048
|
const MESSAGE = "SELECT m.id, m.text, m.sent_at, m.outgoing, p.id AS person, p.owner FROM messages m LEFT JOIN identity_links il ON il.identity_id = m.sender_identity_id LEFT JOIN persons p ON p.id = il.person_id";
|
|
23038
23049
|
const messageOf = /* @__PURE__ */ __name((row2) => {
|
|
23039
23050
|
const own = Number(row2.outgoing) === 1 || Number(row2.owner) === 1;
|
|
@@ -23107,7 +23118,7 @@ var taskSimilarityOver = /* @__PURE__ */ __name((context) => {
|
|
|
23107
23118
|
}, "replyChain");
|
|
23108
23119
|
const COLUMNS7 = "t.id, t.project_id, t.key, t.package_id, t.title, t.description, t.type, t.status, t.source_locator, t.created_at, t.due_at, t.category";
|
|
23109
23120
|
const rowOf = /* @__PURE__ */ __name((id2) => database.prepare(`SELECT ${COLUMNS7} FROM tasks t WHERE t.id = ? AND t.deleted_at IS NULL`).get(id2), "rowOf");
|
|
23110
|
-
const
|
|
23121
|
+
const subjectOf2 = /* @__PURE__ */ __name((subject2) => {
|
|
23111
23122
|
if ("task" in subject2) {
|
|
23112
23123
|
const bare = subject2.task.startsWith("task:") ? subject2.task.slice("task:".length) : subject2.task;
|
|
23113
23124
|
const id2 = taskRowOf(database, bare);
|
|
@@ -23136,12 +23147,12 @@ var taskSimilarityOver = /* @__PURE__ */ __name((context) => {
|
|
|
23136
23147
|
}, "subjectOf");
|
|
23137
23148
|
return {
|
|
23138
23149
|
compare: /* @__PURE__ */ __name(async (subject2, other) => {
|
|
23139
|
-
const side =
|
|
23150
|
+
const side = subjectOf2(subject2);
|
|
23140
23151
|
const id2 = taskRowOf(database, other.startsWith("task:") ? other.slice("task:".length) : other);
|
|
23141
23152
|
const row2 = id2 === void 0 ? void 0 : rowOf(id2);
|
|
23142
23153
|
if (!side || !row2)
|
|
23143
23154
|
throw new CliError("not_found", `no task ${other}`);
|
|
23144
|
-
const stemmer =
|
|
23155
|
+
const stemmer = stemmerFor2(storeStemmers(database) ?? DEFAULT_STEMMERS);
|
|
23145
23156
|
const one = linkedOf(side);
|
|
23146
23157
|
const otherSide = linkedOf(sideOf(row2));
|
|
23147
23158
|
const chain = chainOf(one);
|
|
@@ -23152,12 +23163,12 @@ var taskSimilarityOver = /* @__PURE__ */ __name((context) => {
|
|
|
23152
23163
|
});
|
|
23153
23164
|
}, "compare"),
|
|
23154
23165
|
similar: /* @__PURE__ */ __name(async (subject2, { limit = 10 } = {}) => {
|
|
23155
|
-
const named2 =
|
|
23166
|
+
const named2 = subjectOf2(subject2);
|
|
23156
23167
|
if (!named2)
|
|
23157
23168
|
return [];
|
|
23158
23169
|
const side = linkedOf(named2);
|
|
23159
|
-
drainCorpus(database, CORPORA.task,
|
|
23160
|
-
const stemmer =
|
|
23170
|
+
drainCorpus(database, CORPORA.task, stemmerFor2);
|
|
23171
|
+
const stemmer = stemmerFor2(storeStemmers(database) ?? DEFAULT_STEMMERS);
|
|
23161
23172
|
const since = now2() - RECENTLY_CLOSED_MS;
|
|
23162
23173
|
const live2 = "t.project_id = ? AND t.deleted_at IS NULL AND t.id <> ? AND (t.status = 'open' OR t.closed_at >= ?)";
|
|
23163
23174
|
const scope3 = [side.project, side.row ?? -1, since];
|
|
@@ -23219,7 +23230,7 @@ var taskSimilarityOver = /* @__PURE__ */ __name((context) => {
|
|
|
23219
23230
|
};
|
|
23220
23231
|
}, "taskSimilarityOver");
|
|
23221
23232
|
|
|
23222
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
23233
|
+
// 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/sqlite/task-category-settings.js
|
|
23223
23234
|
var SETTING3 = "taskCategories";
|
|
23224
23235
|
var savedTaskCategories = /* @__PURE__ */ __name((database) => {
|
|
23225
23236
|
const row2 = database.prepare("SELECT value FROM store_settings WHERE key = ?").get(SETTING3);
|
|
@@ -23238,7 +23249,7 @@ var saveTaskCategories = /* @__PURE__ */ __name((database, categories, now2) =>
|
|
|
23238
23249
|
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);
|
|
23239
23250
|
}, "saveTaskCategories");
|
|
23240
23251
|
|
|
23241
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
23252
|
+
// 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/sqlite/task-close.js
|
|
23242
23253
|
var DEFAULT_AGENT_CLOSE = { allowed: true, min: 0.8 };
|
|
23243
23254
|
var ALLOWED = "taskAgentClose";
|
|
23244
23255
|
var MIN = "taskAgentCloseMin";
|
|
@@ -23294,7 +23305,50 @@ var SUGGESTION_COLUMNS = [
|
|
|
23294
23305
|
];
|
|
23295
23306
|
var CLEAR_SUGGESTION = SUGGESTION_COLUMNS.map((column2) => `${column2} = NULL`).join(", ");
|
|
23296
23307
|
|
|
23297
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
23308
|
+
// 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/sqlite/evidence-sources.js
|
|
23309
|
+
var EXCERPT_CHARS = 280;
|
|
23310
|
+
var excerptOf = /* @__PURE__ */ __name((text5) => {
|
|
23311
|
+
if (text5 == null)
|
|
23312
|
+
return null;
|
|
23313
|
+
const flat2 = String(text5).replace(/\s+/g, " ").trim();
|
|
23314
|
+
if (!flat2)
|
|
23315
|
+
return null;
|
|
23316
|
+
return flat2.length > EXCERPT_CHARS ? `${flat2.slice(0, EXCERPT_CHARS - 1)}\u2026` : flat2;
|
|
23317
|
+
}, "excerptOf");
|
|
23318
|
+
var iso = /* @__PURE__ */ __name((value) => value == null ? null : new Date(Number(value)).toISOString(), "iso");
|
|
23319
|
+
var textOf = /* @__PURE__ */ __name((value) => value == null || String(value).trim() === "" ? null : String(value), "textOf");
|
|
23320
|
+
var READS2 = {
|
|
23321
|
+
message: "SELECT c.title, coalesce(m.sender_name, i.name) AS sender, m.sent_at AS at, m.text AS body, a.provider AS tool FROM messages m JOIN chats c ON c.id = m.chat_id JOIN accounts a ON a.id = c.account_id LEFT JOIN identities i ON i.id = m.sender_identity_id WHERE m.id = ?",
|
|
23322
|
+
email: "SELECT e.subject AS title, coalesce(e.from_name, e.from_address) AS sender, e.sent_at AS at, coalesce(e.body_text, e.snippet) AS body, 'email' AS tool FROM emails e WHERE e.id = ?",
|
|
23323
|
+
note: "SELECT title, NULL AS sender, updated_at AS at, body, 'notes' AS tool FROM notes WHERE id = ?",
|
|
23324
|
+
document: "SELECT d.title, NULL AS sender, coalesce(d.external_updated_at, d.updated_at) AS at, d.body, a.provider AS tool FROM documents d JOIN accounts a ON a.id = d.account_id WHERE d.id = ?",
|
|
23325
|
+
meeting: "SELECT m.title, NULL AS sender, m.started_at AS at, m.description AS body, a.provider AS tool FROM meetings m JOIN accounts a ON a.id = m.account_id WHERE m.id = ?",
|
|
23326
|
+
meeting_transcript: "SELECT m.title, NULL AS sender, m.started_at AS at, NULL AS body, a.provider AS tool FROM meeting_transcripts t JOIN meetings m ON m.id = t.meeting_id JOIN accounts a ON a.id = m.account_id WHERE t.id = ?",
|
|
23327
|
+
meeting_transcript_row: "SELECT m.title, r.speaker_name AS sender, m.started_at + coalesce(r.start_ms, 0) AS at, r.text AS body, a.provider AS tool 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 JOIN accounts a ON a.id = m.account_id WHERE r.id = ?"
|
|
23328
|
+
};
|
|
23329
|
+
var KIND = {
|
|
23330
|
+
meeting_transcript: "meeting",
|
|
23331
|
+
meeting_transcript_row: "meeting"
|
|
23332
|
+
};
|
|
23333
|
+
var evidenceSourcesOf = /* @__PURE__ */ __name((database, from2) => database.prepare(`SELECT to_type, to_id FROM links WHERE from_type = ? AND from_id = ? AND kind = ${linkKind("evidence")} AND to_id IS NOT NULL ORDER BY id`).all(from2.type, from2.id).map((link3) => {
|
|
23334
|
+
const thing = storedThing(link3.to_type, link3.to_id);
|
|
23335
|
+
const state = stateOfThing(database, thing);
|
|
23336
|
+
const read2 = READS2[thing.type];
|
|
23337
|
+
const row2 = read2 === void 0 || state === "unavailable" ? void 0 : database.prepare(read2).get(thing.id);
|
|
23338
|
+
const gone = state !== "available";
|
|
23339
|
+
return {
|
|
23340
|
+
ref: referenceOfThing(database, thing) ?? null,
|
|
23341
|
+
kind: KIND[thing.type] ?? thing.type,
|
|
23342
|
+
title: textOf(row2?.title),
|
|
23343
|
+
sender: textOf(row2?.sender),
|
|
23344
|
+
at: iso(row2?.at),
|
|
23345
|
+
excerpt: gone ? null : excerptOf(row2?.body),
|
|
23346
|
+
tool: textOf(row2?.tool),
|
|
23347
|
+
missing: gone
|
|
23348
|
+
};
|
|
23349
|
+
}), "evidenceSourcesOf");
|
|
23350
|
+
|
|
23351
|
+
// 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/attachments/limits.js
|
|
23298
23352
|
var MAX_FILE_BYTES = 50 * 1024 * 1024;
|
|
23299
23353
|
var MAX_TEXT_CHARS = 2e6;
|
|
23300
23354
|
var ATTACHMENT_LIMIT_ENV = [
|
|
@@ -23320,7 +23374,7 @@ var pdfPreviewLimits = /* @__PURE__ */ __name((env = process.env) => {
|
|
|
23320
23374
|
return { pixels, bytes: positive(env, "MESSAGING_PDF_PREVIEW_MAX_MIB", 8 * 1024 * 1024, 1024 * 1024) };
|
|
23321
23375
|
}, "pdfPreviewLimits");
|
|
23322
23376
|
|
|
23323
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
23377
|
+
// 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/ulid.js
|
|
23324
23378
|
import { randomBytes } from "node:crypto";
|
|
23325
23379
|
var CROCKFORD = "0123456789ABCDEFGHJKMNPQRSTVWXYZ";
|
|
23326
23380
|
var ulid = /* @__PURE__ */ __name((now2 = Date.now()) => {
|
|
@@ -23333,7 +23387,7 @@ var ulid = /* @__PURE__ */ __name((now2 = Date.now()) => {
|
|
|
23333
23387
|
return time3 + random;
|
|
23334
23388
|
}, "ulid");
|
|
23335
23389
|
|
|
23336
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
23390
|
+
// 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/sqlite/document-metadata.js
|
|
23337
23391
|
var FOLDED_FIELDS = ["title", "site", "language", "author"];
|
|
23338
23392
|
var encodeDocumentMetadata = /* @__PURE__ */ __name((meta, sections) => {
|
|
23339
23393
|
if (!meta && !sections?.length)
|
|
@@ -23354,7 +23408,7 @@ var languageOf = /* @__PURE__ */ __name((meta) => {
|
|
|
23354
23408
|
return typeof language === "string" && language !== "" ? language : null;
|
|
23355
23409
|
}, "languageOf");
|
|
23356
23410
|
|
|
23357
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
23411
|
+
// 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/sqlite/files.js
|
|
23358
23412
|
var isObject = /* @__PURE__ */ __name((value) => value !== null && typeof value === "object" && !Array.isArray(value), "isObject");
|
|
23359
23413
|
var objectOf = /* @__PURE__ */ __name((value) => {
|
|
23360
23414
|
if (isObject(value))
|
|
@@ -23597,7 +23651,7 @@ var filesStoreOver = /* @__PURE__ */ __name(({ database, now: now2 }) => {
|
|
|
23597
23651
|
};
|
|
23598
23652
|
}, "filesStoreOver");
|
|
23599
23653
|
|
|
23600
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
23654
|
+
// 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/sqlite/imported-documents.js
|
|
23601
23655
|
var IMPORTED_DOCUMENT_QUERY = defineQuery({
|
|
23602
23656
|
entity: "document",
|
|
23603
23657
|
backend: "sql",
|
|
@@ -23643,11 +23697,11 @@ var importedDocumentWhere = /* @__PURE__ */ __name((database, query) => {
|
|
|
23643
23697
|
return queryFilter(validateQuery(query, IMPORTED_DOCUMENT_QUERY), columns);
|
|
23644
23698
|
}, "importedDocumentWhere");
|
|
23645
23699
|
|
|
23646
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
23700
|
+
// 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/sqlite/notes.js
|
|
23647
23701
|
var NOTE_FORMATS = ["obsidian", "markdown"];
|
|
23648
|
-
var
|
|
23649
|
-
var optionalIso = /* @__PURE__ */ __name((value) => value == null ? null :
|
|
23650
|
-
var
|
|
23702
|
+
var iso2 = /* @__PURE__ */ __name((value) => new Date(Number(value)).toISOString(), "iso");
|
|
23703
|
+
var optionalIso = /* @__PURE__ */ __name((value) => value == null ? null : iso2(value), "optionalIso");
|
|
23704
|
+
var textOf2 = /* @__PURE__ */ __name((text5, what, max = 1e5, allowEmpty = false) => {
|
|
23651
23705
|
const value = text5.trim();
|
|
23652
23706
|
if (!value && !allowEmpty || value.length > max)
|
|
23653
23707
|
throw new CliError("validation_error", `${what} takes ${allowEmpty ? 0 : 1}\u2013${max} characters`);
|
|
@@ -23671,8 +23725,8 @@ var documentOf = /* @__PURE__ */ __name((row2) => ({
|
|
|
23671
23725
|
contentHash: row2.content_hash == null ? null : String(row2.content_hash),
|
|
23672
23726
|
revision: Number(row2.revision),
|
|
23673
23727
|
exportPath: row2.export_path == null ? null : String(row2.export_path),
|
|
23674
|
-
createdAt:
|
|
23675
|
-
updatedAt:
|
|
23728
|
+
createdAt: iso2(row2.created_at),
|
|
23729
|
+
updatedAt: iso2(row2.updated_at),
|
|
23676
23730
|
deletedAt: optionalIso(row2.deleted_at)
|
|
23677
23731
|
}), "documentOf");
|
|
23678
23732
|
var noteOf = /* @__PURE__ */ __name((row2) => ({
|
|
@@ -23687,8 +23741,8 @@ var noteOf = /* @__PURE__ */ __name((row2) => ({
|
|
|
23687
23741
|
contentHash: null,
|
|
23688
23742
|
revision: Number(row2.revision),
|
|
23689
23743
|
exportPath: null,
|
|
23690
|
-
createdAt:
|
|
23691
|
-
updatedAt:
|
|
23744
|
+
createdAt: iso2(row2.created_at),
|
|
23745
|
+
updatedAt: iso2(row2.updated_at),
|
|
23692
23746
|
deletedAt: optionalIso(row2.deleted_at)
|
|
23693
23747
|
}), "noteOf");
|
|
23694
23748
|
var noteRowOf = /* @__PURE__ */ __name((database, reference2) => {
|
|
@@ -23714,7 +23768,7 @@ var linkOf = /* @__PURE__ */ __name((database, row2) => {
|
|
|
23714
23768
|
evidence: row2.evidence == null ? null : String(row2.evidence),
|
|
23715
23769
|
provenance: metadata3.provenance ?? null,
|
|
23716
23770
|
confirmed: Number(row2.confirmed) === 1,
|
|
23717
|
-
createdAt:
|
|
23771
|
+
createdAt: iso2(row2.created_at)
|
|
23718
23772
|
};
|
|
23719
23773
|
}, "linkOf");
|
|
23720
23774
|
var requiredThing = /* @__PURE__ */ __name((database, reference2, what = "the target") => {
|
|
@@ -23753,7 +23807,7 @@ var insertLink = /* @__PURE__ */ __name((context, input) => {
|
|
|
23753
23807
|
const origin = oneOf(input.origin ?? "owner", LINK_ORIGINS, "a link's origin");
|
|
23754
23808
|
const from2 = requiredThing(database, input.from, "a link's source");
|
|
23755
23809
|
const to = input.to === void 0 ? null : requiredThing(database, input.to, "a link's target");
|
|
23756
|
-
const targetText = input.targetText === void 0 ? null :
|
|
23810
|
+
const targetText = input.targetText === void 0 ? null : textOf2(input.targetText, "a link's target", 500);
|
|
23757
23811
|
if (to === null && targetText === null)
|
|
23758
23812
|
throw new CliError("validation_error", "a link needs a target");
|
|
23759
23813
|
if (to !== null) {
|
|
@@ -23762,8 +23816,8 @@ var insertLink = /* @__PURE__ */ __name((context, input) => {
|
|
|
23762
23816
|
return linkOf(database, existing);
|
|
23763
23817
|
}
|
|
23764
23818
|
const at = now2();
|
|
23765
|
-
const provenance2 = input.provenance === void 0 ? void 0 :
|
|
23766
|
-
const row2 = database.prepare("INSERT INTO links (from_type, from_id, to_type, to_id, kind, anchor, source, target_text, target_folded, role, evidence, metadata, confirmed, created_at, author, updated_at) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) RETURNING id").get(from2.type, from2.id, to?.type ?? null, to?.id ?? null, kind3, input.anchor ?? null, origin, targetText, targetText === null ? null : targetKey(targetText), input.role === void 0 ? null :
|
|
23819
|
+
const provenance2 = input.provenance === void 0 ? void 0 : textOf2(input.provenance, "provenance", 2e3);
|
|
23820
|
+
const row2 = database.prepare("INSERT INTO links (from_type, from_id, to_type, to_id, kind, anchor, source, target_text, target_folded, role, evidence, metadata, confirmed, created_at, author, updated_at) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) RETURNING id").get(from2.type, from2.id, to?.type ?? null, to?.id ?? null, kind3, input.anchor ?? null, origin, targetText, targetText === null ? null : targetKey(targetText), input.role === void 0 ? null : textOf2(input.role, "a role", 200), input.evidence === void 0 ? null : textOf2(input.evidence, "evidence", 2e3), provenance2 === void 0 ? null : JSON.stringify({ provenance: provenance2 }), input.confirmed === false ? 0 : 1, at, origin === "owner" ? "owner" : null, at);
|
|
23767
23821
|
if (to === null && targetText !== null)
|
|
23768
23822
|
resolveKey(database, targetKey(targetText));
|
|
23769
23823
|
return linkOf(database, database.prepare("SELECT * FROM links WHERE id = ?").get(Number(row2?.id)));
|
|
@@ -23776,7 +23830,7 @@ var folderOf = /* @__PURE__ */ __name((row2) => {
|
|
|
23776
23830
|
name: folder ? String(row2.name) : `${String(row2.provider)}:${String(row2.external_id)}`,
|
|
23777
23831
|
provider: String(row2.provider),
|
|
23778
23832
|
format: settings.format ?? (folder ? "obsidian" : "markdown"),
|
|
23779
|
-
createdAt:
|
|
23833
|
+
createdAt: iso2(row2.created_at),
|
|
23780
23834
|
...folder ? {} : { account: { provider: String(row2.provider), account: String(row2.external_id) } }
|
|
23781
23835
|
};
|
|
23782
23836
|
}, "folderOf");
|
|
@@ -23881,7 +23935,7 @@ var notesStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
23881
23935
|
addFolder: /* @__PURE__ */ __name(async ({ name, format = "obsidian" }) => {
|
|
23882
23936
|
const at = now2();
|
|
23883
23937
|
const checked = oneOf(format, NOTE_FORMATS, "a folder's format");
|
|
23884
|
-
const row2 = database.prepare("INSERT INTO accounts (provider, external_id, name, settings, created_at, updated_at) VALUES (?, ?, ?, ?, ?, ?) RETURNING id").get(folderProviderOf(checked), ulid(at),
|
|
23938
|
+
const row2 = database.prepare("INSERT INTO accounts (provider, external_id, name, settings, created_at, updated_at) VALUES (?, ?, ?, ?, ?, ?) RETURNING id").get(folderProviderOf(checked), ulid(at), textOf2(name, "a folder's name", 200), JSON.stringify({ format: checked }), at, at);
|
|
23885
23939
|
return folderOf(folderRow(String(row2?.id)));
|
|
23886
23940
|
}, "addFolder"),
|
|
23887
23941
|
folders: /* @__PURE__ */ __name(async () => database.prepare(`SELECT * FROM accounts WHERE ${folderProviderSql()} ORDER BY name, id`).all().map(folderOf), "folders"),
|
|
@@ -23893,14 +23947,14 @@ var notesStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
23893
23947
|
if (found2 || !create)
|
|
23894
23948
|
return found2 ? folderOf(found2) : void 0;
|
|
23895
23949
|
const at = now2();
|
|
23896
|
-
database.prepare("INSERT OR IGNORE INTO accounts (provider, external_id, name, settings, created_at, updated_at) VALUES (?, ?, NULL, ?, ?, ?)").run(provider,
|
|
23950
|
+
database.prepare("INSERT OR IGNORE INTO accounts (provider, external_id, name, settings, created_at, updated_at) VALUES (?, ?, NULL, ?, ?, ?)").run(provider, textOf2(account, "an account's id", 200), JSON.stringify({ format: "markdown" }), at, at);
|
|
23897
23951
|
return folderOf(find2());
|
|
23898
23952
|
}, "documentsAccount"),
|
|
23899
23953
|
documentsAccounts: /* @__PURE__ */ __name(async () => database.prepare(`SELECT * FROM accounts WHERE provider IN (${DOCUMENT_ACCOUNT_PROVIDERS.map(() => "?").join(", ")}) ORDER BY provider, external_id`).all(...DOCUMENT_ACCOUNT_PROVIDERS).map(folderOf), "documentsAccounts"),
|
|
23900
23954
|
saveFileNote: /* @__PURE__ */ __name(async (input) => write(database, () => {
|
|
23901
23955
|
const folder = Number(folderRow(input.folderId).id);
|
|
23902
|
-
const path =
|
|
23903
|
-
const text5 =
|
|
23956
|
+
const path = textOf2(input.path, "a note's path", 4096);
|
|
23957
|
+
const text5 = textOf2(input.text, "a note's text", MAX_TEXT_CHARS, true);
|
|
23904
23958
|
const frontMatter = input.frontMatter == null ? null : JSON.stringify(input.frontMatter);
|
|
23905
23959
|
let metadata3 = encodeDocumentMetadata(input.metadata, input.sections);
|
|
23906
23960
|
const language = languageOf(input.metadata);
|
|
@@ -23951,7 +24005,7 @@ var notesStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
23951
24005
|
}), "saveFileNote"),
|
|
23952
24006
|
renameFileNote: /* @__PURE__ */ __name(async (folderId, from2, to) => write(database, () => {
|
|
23953
24007
|
const folder = Number(folderRow(folderId).id);
|
|
23954
|
-
const target =
|
|
24008
|
+
const target = textOf2(to, "a note's path", 4096);
|
|
23955
24009
|
const at = now2();
|
|
23956
24010
|
const place = fileAt(folder, from2, true);
|
|
23957
24011
|
const legacy = database.prepare("SELECT id FROM documents WHERE account_id = ? AND external_id = ? AND deleted_at IS NULL").get(folder, from2);
|
|
@@ -24018,7 +24072,7 @@ var notesStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
24018
24072
|
const owner = ownerPerson(database);
|
|
24019
24073
|
const [subject2] = about.map((reference2) => requiredThing(database, reference2));
|
|
24020
24074
|
const notable = subject2 ?? owner;
|
|
24021
|
-
const row2 = database.prepare("INSERT INTO notes (notable_type, notable_id, title, body, author_type, author_id, revision, created_at, updated_at) VALUES (?, ?, ?, ?, ?, ?, 1, ?, ?) RETURNING id").get(notable.type, notable.id, title === void 0 ? null :
|
|
24075
|
+
const row2 = database.prepare("INSERT INTO notes (notable_type, notable_id, title, body, author_type, author_id, revision, created_at, updated_at) VALUES (?, ?, ?, ?, ?, ?, 1, ?, ?) RETURNING id").get(notable.type, notable.id, title === void 0 ? null : textOf2(title, "a title", 500), textOf2(text5, "a note"), owner.type, owner.id, at, at);
|
|
24022
24076
|
const id2 = Number(row2?.id);
|
|
24023
24077
|
for (const reference2 of about.slice(1))
|
|
24024
24078
|
insertLink(context, { from: `note:${id2}`, to: reference2, kind: "about", origin: "owner" });
|
|
@@ -24063,7 +24117,7 @@ var notesStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
24063
24117
|
throw new CliError("validation_error", "a file note is edited in its file; the next import reads it");
|
|
24064
24118
|
const bare = id2.replace(/^note:/, "");
|
|
24065
24119
|
const found2 = noteRow(bare);
|
|
24066
|
-
const changed = database.prepare("UPDATE notes SET body = ?, revision = revision + 1, updated_at = ? WHERE id = ? AND revision = ? AND deleted_at IS NULL").run(
|
|
24120
|
+
const changed = database.prepare("UPDATE notes SET body = ?, revision = revision + 1, updated_at = ? WHERE id = ? AND revision = ? AND deleted_at IS NULL").run(textOf2(text5, "a note"), now2(), Number(bare), revision2).changes;
|
|
24067
24121
|
if (!changed)
|
|
24068
24122
|
throw new CliError("validation_error", "the note changed; read its current revision before editing");
|
|
24069
24123
|
database.prepare("INSERT INTO note_revisions (note_id, body, revision, created_at) VALUES (?, ?, ?, ?)").run(Number(bare), String(found2.body), revision2, now2());
|
|
@@ -24153,9 +24207,9 @@ var notesStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
24153
24207
|
};
|
|
24154
24208
|
}, "notesStoreOver");
|
|
24155
24209
|
|
|
24156
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
24210
|
+
// 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/sqlite/memories.js
|
|
24157
24211
|
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";
|
|
24158
|
-
var
|
|
24212
|
+
var iso3 = /* @__PURE__ */ __name((value) => new Date(Number(value)).toISOString(), "iso");
|
|
24159
24213
|
var oneOf2 = /* @__PURE__ */ __name((value, allowed, what) => {
|
|
24160
24214
|
if (typeof value !== "string" || !allowed.includes(value))
|
|
24161
24215
|
throw new CliError("validation_error", `${what} is one of ${allowed.join(", ")}`);
|
|
@@ -24183,15 +24237,52 @@ var linkEvidence = /* @__PURE__ */ __name((context, from2, references, author) =
|
|
|
24183
24237
|
}
|
|
24184
24238
|
}, "linkEvidence");
|
|
24185
24239
|
var evidenceOf = /* @__PURE__ */ __name((context, from2) => context.database.prepare(`SELECT to_type, to_id FROM links WHERE from_type = ? AND from_id = ? AND kind = ${linkKind("evidence")} AND to_id IS NOT NULL ORDER BY id`).all(from2.type, from2.id).flatMap((row2) => referenceOfThing(context.database, storedThing(row2.to_type, row2.to_id)) ?? []), "evidenceOf");
|
|
24240
|
+
var SUBJECT_NAMES = {
|
|
24241
|
+
person: "SELECT p.owner, coalesce(p.name, (SELECT a.name FROM aliases a WHERE a.aliasable_type = 'person' AND a.aliasable_id = p.id ORDER BY a.display DESC, a.id LIMIT 1), (SELECT i.name FROM identity_links l JOIN identities i ON i.id = l.identity_id WHERE l.person_id = p.id AND i.name IS NOT NULL ORDER BY i.id LIMIT 1)) AS name FROM persons p WHERE p.id = ?",
|
|
24242
|
+
project: "SELECT 0 AS owner, name FROM projects WHERE id = ?",
|
|
24243
|
+
organization: "SELECT 0 AS owner, name FROM organizations WHERE id = ?"
|
|
24244
|
+
};
|
|
24245
|
+
var subjectOf = /* @__PURE__ */ __name((database, row2) => {
|
|
24246
|
+
if (row2.subject_type == null)
|
|
24247
|
+
return { subject: null, subjectName: null, subjectIsOwner: false };
|
|
24248
|
+
const thing = storedThing(row2.subject_type, row2.subject_id);
|
|
24249
|
+
const read2 = SUBJECT_NAMES[thing.type];
|
|
24250
|
+
const named2 = read2 === void 0 ? void 0 : database.prepare(read2).get(thing.id);
|
|
24251
|
+
return {
|
|
24252
|
+
subject: referenceOfThing(database, thing) ?? null,
|
|
24253
|
+
subjectName: named2?.name == null ? null : String(named2.name),
|
|
24254
|
+
subjectIsOwner: Number(named2?.owner) === 1
|
|
24255
|
+
};
|
|
24256
|
+
}, "subjectOf");
|
|
24257
|
+
var dropLinksOf = /* @__PURE__ */ __name((database, thing) => {
|
|
24258
|
+
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
|
+
database.prepare("DELETE FROM links WHERE to_type = ? AND to_id = ?").run(thing.type, thing.id);
|
|
24260
|
+
return count;
|
|
24261
|
+
}, "dropLinksOf");
|
|
24262
|
+
var erase = /* @__PURE__ */ __name((database, work) => {
|
|
24263
|
+
database.exec("PRAGMA secure_delete = ON");
|
|
24264
|
+
try {
|
|
24265
|
+
const done = write(database, () => {
|
|
24266
|
+
const result = work();
|
|
24267
|
+
for (const index2 of ["memory_words", "memory_stems"])
|
|
24268
|
+
database.prepare(`INSERT INTO ${index2} (${index2}) VALUES ('optimize')`).run();
|
|
24269
|
+
return result;
|
|
24270
|
+
});
|
|
24271
|
+
database.exec("PRAGMA wal_checkpoint(TRUNCATE)");
|
|
24272
|
+
return done;
|
|
24273
|
+
} finally {
|
|
24274
|
+
database.exec("PRAGMA secure_delete = OFF");
|
|
24275
|
+
}
|
|
24276
|
+
}, "erase");
|
|
24186
24277
|
var memoriesStoreOver = /* @__PURE__ */ __name((context) => {
|
|
24187
24278
|
const { database, now: now2 } = context;
|
|
24188
|
-
const
|
|
24279
|
+
const stemmerFor2 = stemmerCache();
|
|
24189
24280
|
const memoryOf = /* @__PURE__ */ __name((row2) => ({
|
|
24190
24281
|
id: String(row2.id),
|
|
24191
24282
|
ref: `memory:${row2.id}`,
|
|
24192
24283
|
kind: row2.kind,
|
|
24193
24284
|
body: String(row2.body),
|
|
24194
|
-
|
|
24285
|
+
...subjectOf(database, row2),
|
|
24195
24286
|
author: authorOf(row2),
|
|
24196
24287
|
model: row2.model == null ? null : String(row2.model),
|
|
24197
24288
|
confidence: row2.confidence == null ? null : Number(row2.confidence),
|
|
@@ -24199,9 +24290,9 @@ var memoriesStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
24199
24290
|
scope: row2.scope,
|
|
24200
24291
|
supersedes: row2.supersedes_id == null ? null : `memory:${row2.supersedes_id}`,
|
|
24201
24292
|
evidence: evidenceOf(context, { type: "memory", id: Number(row2.id) }),
|
|
24202
|
-
lastVerifiedAt: row2.last_verified_at == null ? null :
|
|
24203
|
-
createdAt:
|
|
24204
|
-
updatedAt:
|
|
24293
|
+
lastVerifiedAt: row2.last_verified_at == null ? null : iso3(row2.last_verified_at),
|
|
24294
|
+
createdAt: iso3(row2.created_at),
|
|
24295
|
+
updatedAt: iso3(row2.updated_at)
|
|
24205
24296
|
}), "memoryOf");
|
|
24206
24297
|
const rowOf = /* @__PURE__ */ __name((reference2) => {
|
|
24207
24298
|
const thing = requiredThing(database, reference2.includes(":") ? reference2 : `memory:${reference2}`, "the memory");
|
|
@@ -24256,9 +24347,20 @@ var memoriesStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
24256
24347
|
}, "list"),
|
|
24257
24348
|
confirm: /* @__PURE__ */ __name(async (reference2) => setStatus(reference2, "confirmed", true), "confirm"),
|
|
24258
24349
|
markStale: /* @__PURE__ */ __name(async (reference2) => setStatus(reference2, "stale", false), "markStale"),
|
|
24350
|
+
remove: /* @__PURE__ */ __name(async (reference2) => {
|
|
24351
|
+
const id2 = Number(rowOf(reference2).id);
|
|
24352
|
+
const links2 = erase(database, () => {
|
|
24353
|
+
database.prepare("UPDATE memories SET supersedes_id = NULL WHERE supersedes_id = ?").run(id2);
|
|
24354
|
+
const count = dropLinksOf(database, { type: "memory", id: id2 });
|
|
24355
|
+
database.prepare("DELETE FROM memories WHERE id = ?").run(id2);
|
|
24356
|
+
return count;
|
|
24357
|
+
});
|
|
24358
|
+
return { ref: `memory:${id2}`, removed: true, links: links2 };
|
|
24359
|
+
}, "remove"),
|
|
24360
|
+
sources: /* @__PURE__ */ __name(async (reference2) => evidenceSourcesOf(database, { type: "memory", id: Number(rowOf(reference2).id) }), "sources"),
|
|
24259
24361
|
search: /* @__PURE__ */ __name(async (text5, { subject: subjectRef, scope: scope3, limit = 20 } = {}) => {
|
|
24260
24362
|
const subject2 = subjectRef === void 0 ? void 0 : requiredThing(database, subjectRef);
|
|
24261
|
-
drainCorpus(database, CORPORA.memory,
|
|
24363
|
+
drainCorpus(database, CORPORA.memory, stemmerFor2);
|
|
24262
24364
|
const words3 = normalize(text5).split(/\s+/).filter((word) => /[\p{L}\p{N}]/u.test(word));
|
|
24263
24365
|
if (words3.length === 0)
|
|
24264
24366
|
throw new CliError("validation_error", "say what to find in the memories");
|
|
@@ -24269,7 +24371,7 @@ var memoriesStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
24269
24371
|
};
|
|
24270
24372
|
}, "memoriesStoreOver");
|
|
24271
24373
|
|
|
24272
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
24374
|
+
// 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/sqlite/task-first-pass.js
|
|
24273
24375
|
var DEFAULT_FIRST_PASS_PER_CHAT = 0;
|
|
24274
24376
|
var KEY = "taskFirstPassPerChat";
|
|
24275
24377
|
var firstPassPerChatOf = /* @__PURE__ */ __name((value, setting = "task_first_pass_per_chat") => {
|
|
@@ -24289,7 +24391,7 @@ var saveFirstPassPerChat = /* @__PURE__ */ __name((database, value, now2) => {
|
|
|
24289
24391
|
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);
|
|
24290
24392
|
}, "saveFirstPassPerChat");
|
|
24291
24393
|
|
|
24292
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
24394
|
+
// 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/sqlite/task-relations.js
|
|
24293
24395
|
var TASK_RELATION_KINDS = [
|
|
24294
24396
|
"blocked-by",
|
|
24295
24397
|
"follow-up-of",
|
|
@@ -24419,19 +24521,19 @@ var taskRelationsStoreOver = /* @__PURE__ */ __name((context, record4) => {
|
|
|
24419
24521
|
};
|
|
24420
24522
|
}, "taskRelationsStoreOver");
|
|
24421
24523
|
|
|
24422
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
24524
|
+
// 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/sqlite/work-tasks.js
|
|
24423
24525
|
var TASK_ROLES = ["assignee", "reviewer", "watcher"];
|
|
24424
|
-
var
|
|
24526
|
+
var iso4 = /* @__PURE__ */ __name((value) => value == null ? null : new Date(Number(value)).toISOString(), "iso");
|
|
24425
24527
|
var recordTaskEvent = /* @__PURE__ */ __name((database, task, actor, kind3, changes, at) => {
|
|
24426
24528
|
database.prepare("INSERT INTO task_events (task_id, actor_type, actor_id, kind, changes, created_at) VALUES (?, ?, ?, ?, ?, ?)").run(task, actor?.type ?? null, actor?.id ?? null, kind3, changes === null ? null : JSON.stringify(changes), at);
|
|
24427
24529
|
}, "recordTaskEvent");
|
|
24428
|
-
var
|
|
24530
|
+
var textOf3 = /* @__PURE__ */ __name((value, what, max) => {
|
|
24429
24531
|
const text5 = value.trim();
|
|
24430
24532
|
if (!text5 || text5.length > max)
|
|
24431
24533
|
throw new CliError("validation_error", `${what} takes 1\u2013${max} characters`);
|
|
24432
24534
|
return text5;
|
|
24433
24535
|
}, "textOf");
|
|
24434
|
-
var claimOf = /* @__PURE__ */ __name((row2, at) => row2.claimed_by != null && Number(row2.claimed_until) >= at ? { claimedBy: String(row2.claimed_by), claimedUntil:
|
|
24536
|
+
var claimOf = /* @__PURE__ */ __name((row2, at) => row2.claimed_by != null && Number(row2.claimed_until) >= at ? { claimedBy: String(row2.claimed_by), claimedUntil: iso4(row2.claimed_until) } : { claimedBy: null, claimedUntil: null }, "claimOf");
|
|
24435
24537
|
var priorityOf = /* @__PURE__ */ __name((value) => {
|
|
24436
24538
|
if (value !== null && !(Number.isInteger(value) && value >= 0 && value <= 4))
|
|
24437
24539
|
throw new CliError("validation_error", "a priority is 0 (urgent) to 4 (low)");
|
|
@@ -24492,9 +24594,9 @@ var workTaskOperationsOver = /* @__PURE__ */ __name((context) => {
|
|
|
24492
24594
|
priority: row2.priority == null ? null : Number(row2.priority),
|
|
24493
24595
|
parent: row2.parent_id == null ? null : reference2(Number(row2.parent_id)),
|
|
24494
24596
|
source: row2.source_locator == null ? null : String(row2.source_locator),
|
|
24495
|
-
dueAt:
|
|
24496
|
-
nextCheckAt:
|
|
24497
|
-
closedAt:
|
|
24597
|
+
dueAt: iso4(row2.due_at),
|
|
24598
|
+
nextCheckAt: iso4(row2.next_check_at),
|
|
24599
|
+
closedAt: iso4(row2.closed_at),
|
|
24498
24600
|
reason: row2.close_reason == null ? null : String(row2.close_reason),
|
|
24499
24601
|
verdict: row2.verdict == null ? null : row2.verdict,
|
|
24500
24602
|
category: row2.category == null ? null : String(row2.category),
|
|
@@ -24502,8 +24604,8 @@ var workTaskOperationsOver = /* @__PURE__ */ __name((context) => {
|
|
|
24502
24604
|
closeCertainty: row2.close_certainty == null ? null : Number(row2.close_certainty),
|
|
24503
24605
|
closeSuggestion: closeSuggestionOf(database, row2),
|
|
24504
24606
|
assignments: database.prepare("SELECT assignee_id, role FROM task_assignments WHERE task_id = ? AND assignee_type = 'person' ORDER BY id").all(id2).map((assigned) => ({ to: `person:${assigned.assignee_id}`, role: assigned.role })),
|
|
24505
|
-
createdAt:
|
|
24506
|
-
updatedAt:
|
|
24607
|
+
createdAt: iso4(row2.created_at),
|
|
24608
|
+
updatedAt: iso4(row2.updated_at)
|
|
24507
24609
|
};
|
|
24508
24610
|
}, "detailsOf");
|
|
24509
24611
|
const rowById = /* @__PURE__ */ __name((id2) => database.prepare("SELECT * FROM tasks WHERE id = ?").get(id2), "rowById");
|
|
@@ -24522,12 +24624,12 @@ var workTaskOperationsOver = /* @__PURE__ */ __name((context) => {
|
|
|
24522
24624
|
recordTaskEvent(database, task, actor, event, { [column2]: [before2[column2] ?? null, value] }, at);
|
|
24523
24625
|
}, "change");
|
|
24524
24626
|
if (fields4.title !== void 0) {
|
|
24525
|
-
const title =
|
|
24627
|
+
const title = textOf3(fields4.title, "a task's title", 300);
|
|
24526
24628
|
change("title", title, created ? void 0 : "title");
|
|
24527
24629
|
change("title_folded", folded3(title));
|
|
24528
24630
|
}
|
|
24529
24631
|
if (fields4.description !== void 0)
|
|
24530
|
-
change("description", fields4.description === null ? null :
|
|
24632
|
+
change("description", fields4.description === null ? null : textOf3(fields4.description, "a description", 2e4), created ? void 0 : "description");
|
|
24531
24633
|
if (fields4.priority !== void 0)
|
|
24532
24634
|
change("priority", priorityOf(fields4.priority), "priority");
|
|
24533
24635
|
if (fields4.parent !== void 0)
|
|
@@ -24555,7 +24657,7 @@ var workTaskOperationsOver = /* @__PURE__ */ __name((context) => {
|
|
|
24555
24657
|
}
|
|
24556
24658
|
}
|
|
24557
24659
|
if (fields4.reason !== void 0) {
|
|
24558
|
-
const reason = fields4.reason === null ? null :
|
|
24660
|
+
const reason = fields4.reason === null ? null : textOf3(fields4.reason, "a reason", 500);
|
|
24559
24661
|
change("close_reason", reason);
|
|
24560
24662
|
change("close_reason_folded", folded3(reason));
|
|
24561
24663
|
}
|
|
@@ -24578,7 +24680,7 @@ var workTaskOperationsOver = /* @__PURE__ */ __name((context) => {
|
|
|
24578
24680
|
const number3 = Number(counted.tasks_count);
|
|
24579
24681
|
if (!Number.isSafeInteger(number3) || number3 < 1)
|
|
24580
24682
|
throw new CliError("configuration_error", "the project task counter exceeds the safe numbering range");
|
|
24581
|
-
const id2 = Number(database.prepare("INSERT INTO tasks (project_id, number, key, title, title_folded, type, status, author_type, author_id, source, created_at, updated_at) VALUES (?, ?, ?, ?, ?, ?, 'open', ?, ?, ?, ?, ?) RETURNING id").get(project, number3, `${String(counted.key)}-${number3}`,
|
|
24683
|
+
const id2 = Number(database.prepare("INSERT INTO tasks (project_id, number, key, title, title_folded, type, status, author_type, author_id, source, created_at, updated_at) VALUES (?, ?, ?, ?, ?, ?, 'open', ?, ?, ?, ?, ?) RETURNING id").get(project, number3, `${String(counted.key)}-${number3}`, textOf3(input.title, "a task's title", 300), folded3(textOf3(input.title, "a task's title", 300)), input.type, actor.type, actor.id, by === "owner" ? "owner" : "agent", at, at)?.id);
|
|
24582
24684
|
recordTaskEvent(database, id2, actor, "created", null, at);
|
|
24583
24685
|
const { title: _title, project: _project, type: _type, ...fields4 } = input;
|
|
24584
24686
|
edit(id2, fields4, actor, true);
|
|
@@ -24657,7 +24759,7 @@ var workTaskOperationsOver = /* @__PURE__ */ __name((context) => {
|
|
|
24657
24759
|
const row2 = rowById(task);
|
|
24658
24760
|
if (row2.status !== "open")
|
|
24659
24761
|
throw new CliError("validation_error", `task ${String(row2.key)} is ${String(row2.status)}; only an open task is claimed`);
|
|
24660
|
-
throw new CliError("validation_error", `${String(row2.claimed_by)} holds task ${String(row2.key)} until ${
|
|
24762
|
+
throw new CliError("validation_error", `${String(row2.claimed_by)} holds task ${String(row2.key)} until ${iso4(row2.claimed_until)}; wait for it, or ask them to release it`, { reason: "task.claimed", holder: String(row2.claimed_by), until: iso4(row2.claimed_until) });
|
|
24661
24763
|
}
|
|
24662
24764
|
return details2(task);
|
|
24663
24765
|
}, "claim"),
|
|
@@ -24678,7 +24780,7 @@ var workTaskOperationsOver = /* @__PURE__ */ __name((context) => {
|
|
|
24678
24780
|
kind: row2.kind,
|
|
24679
24781
|
actor: row2.actor_type == null ? null : { type: row2.actor_type, id: Number(row2.actor_id) },
|
|
24680
24782
|
changes: row2.changes == null ? null : JSON.parse(String(row2.changes)),
|
|
24681
|
-
at:
|
|
24783
|
+
at: iso4(row2.created_at)
|
|
24682
24784
|
})), "events")
|
|
24683
24785
|
};
|
|
24684
24786
|
}, "workTaskOperationsOver");
|
|
@@ -24691,7 +24793,7 @@ var workTasksOver = /* @__PURE__ */ __name((context) => {
|
|
|
24691
24793
|
};
|
|
24692
24794
|
}, "workTasksOver");
|
|
24693
24795
|
|
|
24694
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
24796
|
+
// 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/sqlite/task-close-store.js
|
|
24695
24797
|
var taskCloseOver = /* @__PURE__ */ __name((context) => {
|
|
24696
24798
|
const { database, now: now2 } = context;
|
|
24697
24799
|
const liveRow = /* @__PURE__ */ __name((id2) => {
|
|
@@ -24737,7 +24839,7 @@ var taskCloseOver = /* @__PURE__ */ __name((context) => {
|
|
|
24737
24839
|
};
|
|
24738
24840
|
}, "taskCloseOver");
|
|
24739
24841
|
|
|
24740
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
24842
|
+
// 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/sqlite/task-pairs.js
|
|
24741
24843
|
var taskPairsOver = /* @__PURE__ */ __name((context, similarity) => {
|
|
24742
24844
|
const { database, now: now2 } = context;
|
|
24743
24845
|
const required3 = /* @__PURE__ */ __name((id2) => {
|
|
@@ -24955,7 +25057,7 @@ var taskPairsOver = /* @__PURE__ */ __name((context, similarity) => {
|
|
|
24955
25057
|
};
|
|
24956
25058
|
}, "taskPairsOver");
|
|
24957
25059
|
|
|
24958
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
25060
|
+
// 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/sqlite/tasks.js
|
|
24959
25061
|
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";
|
|
24960
25062
|
var taskStoreOver = /* @__PURE__ */ __name((context) => {
|
|
24961
25063
|
const { database, now: now2 } = context;
|
|
@@ -25150,7 +25252,7 @@ var oneOf3 = /* @__PURE__ */ __name((values, value, column2) => {
|
|
|
25150
25252
|
throw new CliError("configuration_error", `the store holds a task with an unknown ${column2} "${String(value)}"`);
|
|
25151
25253
|
}, "oneOf");
|
|
25152
25254
|
|
|
25153
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
25255
|
+
// 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/accounts.js
|
|
25154
25256
|
var accountAccountsOver = /* @__PURE__ */ __name((context) => {
|
|
25155
25257
|
const { database } = context;
|
|
25156
25258
|
const { accountPk: accountPk2, findAccountPk: findAccountPk2 } = keysOver(context);
|
|
@@ -25195,7 +25297,7 @@ var accountsStoreOver = /* @__PURE__ */ __name((context, keyed) => {
|
|
|
25195
25297
|
};
|
|
25196
25298
|
}, "accountsStoreOver");
|
|
25197
25299
|
|
|
25198
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
25300
|
+
// 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/sqlite/attachments.js
|
|
25199
25301
|
var refColumn = /* @__PURE__ */ __name((ref3) => ref3 && Object.keys(ref3).length > 0 ? { providerRef: JSON.stringify(ref3) } : {}, "refColumn");
|
|
25200
25302
|
var updatePlaced = /* @__PURE__ */ __name(({ orm }, chatKey, messageId, files2, change) => {
|
|
25201
25303
|
const message2 = orm.select({ pk: messages.id }).from(messages).where(and(eq(messages.chatId, chatKey), eq(messages.externalId, messageId))).get();
|
|
@@ -25219,7 +25321,7 @@ var keepDownloads = /* @__PURE__ */ __name((context, chatKey, messageId, files2)
|
|
|
25219
25321
|
})), "keepDownloads");
|
|
25220
25322
|
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");
|
|
25221
25323
|
|
|
25222
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
25324
|
+
// 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/attachments.js
|
|
25223
25325
|
var accountAttachmentsOver = /* @__PURE__ */ __name((context) => {
|
|
25224
25326
|
const { database } = context;
|
|
25225
25327
|
const { findAccountPk: findAccountPk2, findChatPk: findChatPk2, chatKeyOf } = keysOver(context);
|
|
@@ -25276,7 +25378,7 @@ var attachmentsStoreOver = /* @__PURE__ */ __name((context, keyed) => ({
|
|
|
25276
25378
|
}, "keepAttachmentText")
|
|
25277
25379
|
}), "attachmentsStoreOver");
|
|
25278
25380
|
|
|
25279
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
25381
|
+
// 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/sqlite/chat-rekey.js
|
|
25280
25382
|
var chatRow = /* @__PURE__ */ __name((context, accountKey, chatId) => context.database.prepare("SELECT * FROM chats WHERE account_id = ? AND external_id = ?").get(accountKey, chatId), "chatRow");
|
|
25281
25383
|
var pointerMover = /* @__PURE__ */ __name((context, type) => {
|
|
25282
25384
|
const statements = pointerPairs(context.database).filter(({ table }) => table !== "involvements").map(({ table, pointer }) => {
|
|
@@ -25456,7 +25558,7 @@ var rekeyChats = /* @__PURE__ */ __name((context, key2, accountKey, pairs, lockM
|
|
|
25456
25558
|
return done;
|
|
25457
25559
|
}, "rekeyChats");
|
|
25458
25560
|
|
|
25459
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
25561
|
+
// 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/sqlite/completeness.js
|
|
25460
25562
|
var historyStartKey = /* @__PURE__ */ __name((chatId) => `history_start:${chatId}`, "historyStartKey");
|
|
25461
25563
|
var fetchedKey = /* @__PURE__ */ __name((chatId) => `fetched:${chatId}`, "fetchedKey");
|
|
25462
25564
|
var CHAT_LIST_KEY = "chat_list_complete";
|
|
@@ -25488,7 +25590,7 @@ var chatCompleteness = /* @__PURE__ */ __name(({ database }, accountKey, chatIds
|
|
|
25488
25590
|
});
|
|
25489
25591
|
}, "chatCompleteness");
|
|
25490
25592
|
|
|
25491
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
25593
|
+
// 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/chats.js
|
|
25492
25594
|
var chatsStoreOver = /* @__PURE__ */ __name((context) => {
|
|
25493
25595
|
const { database } = context;
|
|
25494
25596
|
const { accountPk: accountPk2, findAccountPk: findAccountPk2, writeState: writeState2 } = keysOver(context);
|
|
@@ -25572,6 +25674,13 @@ var chatsStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
25572
25674
|
const row2 = context.database.prepare("SELECT kind FROM chats WHERE account_id = ? AND external_id = ?").get(accountKey, chatId);
|
|
25573
25675
|
return row2 ? String(row2.kind) : void 0;
|
|
25574
25676
|
}, "chatKind"),
|
|
25677
|
+
chatTitle: /* @__PURE__ */ __name(async (key2, chatId) => {
|
|
25678
|
+
const accountKey = findAccountPk2(key2);
|
|
25679
|
+
if (accountKey === void 0)
|
|
25680
|
+
return null;
|
|
25681
|
+
const row2 = context.database.prepare("SELECT title FROM chats WHERE account_id = ? AND external_id = ?").get(accountKey, chatId);
|
|
25682
|
+
return row2?.title == null ? null : String(row2.title);
|
|
25683
|
+
}, "chatTitle"),
|
|
25575
25684
|
chatActivity: /* @__PURE__ */ __name(async (key2, since, where) => {
|
|
25576
25685
|
const accountKey = findAccountPk2(key2);
|
|
25577
25686
|
return accountKey === void 0 ? { chats: [], storedAt: null } : chatActivity(context, accountKey, since, where);
|
|
@@ -25588,7 +25697,7 @@ var chatsStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
25588
25697
|
};
|
|
25589
25698
|
}, "chatsStoreOver");
|
|
25590
25699
|
|
|
25591
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
25700
|
+
// 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/sqlite/batches.js
|
|
25592
25701
|
import { createHash as createHash6 } from "node:crypto";
|
|
25593
25702
|
var BATCH_CONTEXT = 50;
|
|
25594
25703
|
var replied = /* @__PURE__ */ __name((m) => sql`EXISTS (SELECT 1 FROM messages p WHERE p.chat_id = ${m}.chat_id
|
|
@@ -25726,7 +25835,7 @@ var saveAnswers = /* @__PURE__ */ __name((context, id2, answer) => {
|
|
|
25726
25835
|
var clearAnswers = /* @__PURE__ */ __name(({ orm }, chatKey, model) => Number(orm.all(sql`DELETE FROM message_links WHERE chat_id = ${chatKey} AND source = 'agent'
|
|
25727
25836
|
${model === void 0 ? sql`` : sql`AND method = ${model}`} RETURNING 1 AS n`).length), "clearAnswers");
|
|
25728
25837
|
|
|
25729
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
25838
|
+
// 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/sqlite/conversations.js
|
|
25730
25839
|
import { setTimeout } from "node:timers/promises";
|
|
25731
25840
|
var position = /* @__PURE__ */ __name((sentAt, pk) => `${sentAt}:${pk}`, "position");
|
|
25732
25841
|
var linkInputs = /* @__PURE__ */ __name(({ orm }, chatKey, { after: after2, limit }) => {
|
|
@@ -26038,7 +26147,7 @@ var agentAnswers = /* @__PURE__ */ __name(({ orm }, chatKey) => new Map(orm.all(
|
|
|
26038
26147
|
AND NOT EXISTS (SELECT 1 FROM messages d
|
|
26039
26148
|
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");
|
|
26040
26149
|
|
|
26041
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
26150
|
+
// 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/conversations.js
|
|
26042
26151
|
var conversationsStoreOver = /* @__PURE__ */ __name((context) => {
|
|
26043
26152
|
const { database } = context;
|
|
26044
26153
|
const { findAccountPk: findAccountPk2, findChatPk: findChatPk2, chatKeyOf } = keysOver(context);
|
|
@@ -26145,7 +26254,7 @@ var conversationsStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
26145
26254
|
};
|
|
26146
26255
|
}, "conversationsStoreOver");
|
|
26147
26256
|
|
|
26148
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
26257
|
+
// 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/counters.js
|
|
26149
26258
|
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";
|
|
26150
26259
|
var accountCountersOver = /* @__PURE__ */ __name((context) => {
|
|
26151
26260
|
const { database } = context;
|
|
@@ -26170,7 +26279,7 @@ var countersStoreOver = /* @__PURE__ */ __name((context, keyed) => ({
|
|
|
26170
26279
|
counterTargets: /* @__PURE__ */ __name(async (execution, options) => counterTargets(context, execution, options), "counterTargets")
|
|
26171
26280
|
}), "countersStoreOver");
|
|
26172
26281
|
|
|
26173
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
26282
|
+
// 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/sqlite/mentions.js
|
|
26174
26283
|
var MENTION_STATUSES = ["found", "linked", "dismissed"];
|
|
26175
26284
|
var MENTION_QUERY = defineQuery({
|
|
26176
26285
|
entity: "mention",
|
|
@@ -26386,7 +26495,7 @@ var listPlaces = /* @__PURE__ */ __name((database, { limit, offset }) => {
|
|
|
26386
26495
|
return { items: hasMore ? rows.slice(0, limit) : rows, hasMore };
|
|
26387
26496
|
}, "listPlaces");
|
|
26388
26497
|
|
|
26389
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
26498
|
+
// 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/mentions.js
|
|
26390
26499
|
var accountMentionsOver = /* @__PURE__ */ __name((context) => {
|
|
26391
26500
|
const { database } = context;
|
|
26392
26501
|
const { findAccountPk: findAccountPk2 } = keysOver(context);
|
|
@@ -26421,7 +26530,7 @@ var mentionsStoreOver = /* @__PURE__ */ __name((context, keyed) => ({
|
|
|
26421
26530
|
places: /* @__PURE__ */ __name(async (window) => listPlaces(context.database, window), "places")
|
|
26422
26531
|
}), "mentionsStoreOver");
|
|
26423
26532
|
|
|
26424
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
26533
|
+
// 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/sqlite/document-links.js
|
|
26425
26534
|
var documentLinkMessages = /* @__PURE__ */ __name(({ database }, chatKey, messageId) => {
|
|
26426
26535
|
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");
|
|
26427
26536
|
const rows = messageId === void 0 ? read2.all(chatKey) : read2.all(chatKey, messageId);
|
|
@@ -26436,7 +26545,52 @@ var documentLinkMessages = /* @__PURE__ */ __name(({ database }, chatKey, messag
|
|
|
26436
26545
|
}));
|
|
26437
26546
|
}, "documentLinkMessages");
|
|
26438
26547
|
|
|
26439
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
26548
|
+
// 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/sqlite/follow-ups.js
|
|
26549
|
+
var stemmerFor = stemmerCache();
|
|
26550
|
+
var laterSharingRare = /* @__PURE__ */ __name((context, wanted, { rareAt, limit }) => {
|
|
26551
|
+
if (wanted.length > 50 || !Number.isInteger(limit) || limit < 1 || limit > 100)
|
|
26552
|
+
throw new CliError("validation_error", "a follow-up lookup takes at most 50 messages and 1\u2013100 results each");
|
|
26553
|
+
const { database } = context;
|
|
26554
|
+
const stemmers = storeStemmers(database);
|
|
26555
|
+
if (!wanted.length || !stemmers || !stemsState(database)?.ready)
|
|
26556
|
+
return wanted.map(() => []);
|
|
26557
|
+
const stemmer = stemmerFor(stemmers);
|
|
26558
|
+
database.exec("CREATE VIRTUAL TABLE IF NOT EXISTS temp.message_stem_counts USING fts5vocab(main, message_stems, col)");
|
|
26559
|
+
const count = database.prepare("SELECT doc FROM temp.message_stem_counts WHERE term = ? AND col = 'stems'");
|
|
26560
|
+
const counts = /* @__PURE__ */ new Map();
|
|
26561
|
+
const countOf = /* @__PURE__ */ __name((stem) => {
|
|
26562
|
+
let found2 = counts.get(stem);
|
|
26563
|
+
if (found2 === void 0) {
|
|
26564
|
+
found2 = Number(count.get(stem)?.doc ?? 0);
|
|
26565
|
+
counts.set(stem, found2);
|
|
26566
|
+
}
|
|
26567
|
+
return found2;
|
|
26568
|
+
}, "countOf");
|
|
26569
|
+
const message2 = database.prepare(`
|
|
26570
|
+
SELECT m.text, m.sent_at FROM accounts ac
|
|
26571
|
+
JOIN chats c ON c.account_id = ac.id AND c.external_id = ?
|
|
26572
|
+
JOIN messages m ON m.chat_id = c.id AND m.external_id = ?
|
|
26573
|
+
WHERE ac.provider = ? AND ac.external_id = ? AND m.deleted_at IS NULL
|
|
26574
|
+
`);
|
|
26575
|
+
const later = database.prepare(`
|
|
26576
|
+
SELECT m.id FROM message_stems s JOIN messages m ON m.id = s.rowid
|
|
26577
|
+
WHERE message_stems MATCH ? AND m.deleted_at IS NULL AND m.sent_at > ?
|
|
26578
|
+
ORDER BY m.sent_at DESC, m.id DESC LIMIT ?
|
|
26579
|
+
`);
|
|
26580
|
+
return wanted.map(({ account, chatId, id: id2 }) => {
|
|
26581
|
+
const row2 = message2.get(chatId, id2, account.provider, account.account);
|
|
26582
|
+
if (!row2)
|
|
26583
|
+
return [];
|
|
26584
|
+
const stems = new Set(stemmer.explain(String(row2.text)).filter(({ word }) => new RegExp("^\\p{L}{3,}$", "u").test(word)).map(({ word }) => stemmer.stemToken(word)).filter(Boolean));
|
|
26585
|
+
const rare = [...stems].filter((stem) => countOf(stem) <= rareAt);
|
|
26586
|
+
if (!rare.length)
|
|
26587
|
+
return [];
|
|
26588
|
+
const match = `stems : (${rare.map((stem) => `"${stem.replaceAll('"', '""')}"`).join(" OR ")})`;
|
|
26589
|
+
return hitsByPk(context, later.all(match, Number(row2.sent_at), limit).map((one) => Number(one.id)));
|
|
26590
|
+
});
|
|
26591
|
+
}, "laterSharingRare");
|
|
26592
|
+
|
|
26593
|
+
// 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/messages.js
|
|
26440
26594
|
var accountMessagesOver = /* @__PURE__ */ __name((context) => {
|
|
26441
26595
|
const { database } = context;
|
|
26442
26596
|
const { accountPk: accountPk2, findAccountPk: findAccountPk2, findChatPk: findChatPk2, chatKeyOf, chatPkFor: chatPkFor2, answeredChatPk: answeredChatPk2, upsertMessage: upsertMessage2 } = keysOver(context);
|
|
@@ -26567,12 +26721,13 @@ var messagesStoreOver = /* @__PURE__ */ __name((context, keyed) => ({
|
|
|
26567
26721
|
...keyed,
|
|
26568
26722
|
search: /* @__PURE__ */ __name(async (query, { limit, account }) => find(context, { text: query, limit, ...account ? { account } : {} }), "search"),
|
|
26569
26723
|
find: /* @__PURE__ */ __name(async (filter) => find(context, filter), "find"),
|
|
26570
|
-
directReplies: /* @__PURE__ */ __name(async (parents, limit) => directReplies(context, parents, limit), "directReplies")
|
|
26724
|
+
directReplies: /* @__PURE__ */ __name(async (parents, limit) => directReplies(context, parents, limit), "directReplies"),
|
|
26725
|
+
laterSharingRare: /* @__PURE__ */ __name(async (wanted, options) => laterSharingRare(context, wanted, options), "laterSharingRare")
|
|
26571
26726
|
}), "messagesStoreOver");
|
|
26572
26727
|
|
|
26573
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
26728
|
+
// 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/sqlite/person-preparation.js
|
|
26574
26729
|
var GLOBAL_PROJECT = "SELECT id FROM main.projects WHERE account_id IS NULL AND deleted_at IS NULL";
|
|
26575
|
-
var
|
|
26730
|
+
var iso5 = /* @__PURE__ */ __name((value) => value == null ? null : new Date(Number(value)).toISOString(), "iso");
|
|
26576
26731
|
var personPreparation = /* @__PURE__ */ __name(({ database }, uid, { accounts: accounts2, limit }) => {
|
|
26577
26732
|
const person2 = Number(uid);
|
|
26578
26733
|
if (!/^[1-9]\d*$/.test(uid) || !Number.isSafeInteger(person2) || !Number.isSafeInteger(limit) || limit < 1)
|
|
@@ -26593,7 +26748,7 @@ var personPreparation = /* @__PURE__ */ __name(({ database }, uid, { accounts: a
|
|
|
26593
26748
|
statement: String(row2.statement),
|
|
26594
26749
|
subject: row2.subject_type == null ? null : `${row2.subject_type}:${row2.subject_id}`,
|
|
26595
26750
|
project: row2.project_id == null ? null : `project:${row2.project_id}`,
|
|
26596
|
-
updatedAt:
|
|
26751
|
+
updatedAt: iso5(row2.updated_at)
|
|
26597
26752
|
}));
|
|
26598
26753
|
const notes2 = database.prepare(`SELECT n.id,n.title,n.body,n.revision,n.updated_at FROM notes n
|
|
26599
26754
|
JOIN persons owner ON n.author_type='person' AND n.author_id=owner.id AND owner.owner=1
|
|
@@ -26606,7 +26761,7 @@ var personPreparation = /* @__PURE__ */ __name(({ database }, uid, { accounts: a
|
|
|
26606
26761
|
title: row2.title == null ? null : String(row2.title),
|
|
26607
26762
|
text: String(row2.body),
|
|
26608
26763
|
revision: Number(row2.revision),
|
|
26609
|
-
updatedAt:
|
|
26764
|
+
updatedAt: iso5(row2.updated_at)
|
|
26610
26765
|
}));
|
|
26611
26766
|
const tasks2 = database.prepare(`SELECT t.id,t.title,t.due_at,t.project_id,t.source_locator,t.created_at,group_concat(DISTINCT ta.role) AS role
|
|
26612
26767
|
FROM task_assignments ta JOIN tasks t ON t.id=ta.task_id JOIN main.projects p ON p.id=t.project_id
|
|
@@ -26618,16 +26773,16 @@ var personPreparation = /* @__PURE__ */ __name(({ database }, uid, { accounts: a
|
|
|
26618
26773
|
ref: `task:${taskIdOf(database, Number(row2.id))}`,
|
|
26619
26774
|
title: String(row2.title),
|
|
26620
26775
|
role: String(row2.role),
|
|
26621
|
-
dueAt:
|
|
26776
|
+
dueAt: iso5(row2.due_at),
|
|
26622
26777
|
project: `project:${row2.project_id}`,
|
|
26623
26778
|
source: row2.source_locator == null ? null : String(row2.source_locator),
|
|
26624
|
-
createdAt:
|
|
26779
|
+
createdAt: iso5(row2.created_at)
|
|
26625
26780
|
}));
|
|
26626
26781
|
return { facts: page3(facts2), notes: page3(notes2), tasks: page3(tasks2) };
|
|
26627
26782
|
});
|
|
26628
26783
|
}, "personPreparation");
|
|
26629
26784
|
|
|
26630
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
26785
|
+
// 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/sqlite/person-scope.js
|
|
26631
26786
|
var personSeenInAccounts = /* @__PURE__ */ __name(({ database }, uid, accountIds) => {
|
|
26632
26787
|
const id2 = Number(uid);
|
|
26633
26788
|
if (!/^[1-9]\d*$/.test(uid) || !Number.isSafeInteger(id2) || !accountIds.length || accountIds.length > 1e3 || accountIds.some((account) => !Number.isSafeInteger(account) || account <= 0))
|
|
@@ -26635,7 +26790,7 @@ var personSeenInAccounts = /* @__PURE__ */ __name(({ database }, uid, accountIds
|
|
|
26635
26790
|
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)));
|
|
26636
26791
|
}, "personSeenInAccounts");
|
|
26637
26792
|
|
|
26638
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
26793
|
+
// 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/sqlite/private-people.js
|
|
26639
26794
|
var required2 = /* @__PURE__ */ __name(({ database }, key2, personId) => {
|
|
26640
26795
|
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);
|
|
26641
26796
|
if (!row2)
|
|
@@ -26701,7 +26856,7 @@ var removeNote = /* @__PURE__ */ __name((context, key2, personId, id2) => {
|
|
|
26701
26856
|
return { id: id2, personId, removed: true };
|
|
26702
26857
|
}, "removeNote");
|
|
26703
26858
|
|
|
26704
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
26859
|
+
// 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/people.js
|
|
26705
26860
|
var accountPeopleOver = /* @__PURE__ */ __name((context) => {
|
|
26706
26861
|
const { database } = context;
|
|
26707
26862
|
const { accountPk: accountPk2, findAccountPk: findAccountPk2, identityPk: identityPk2 } = keysOver(context);
|
|
@@ -26776,13 +26931,13 @@ var peopleStoreOver = /* @__PURE__ */ __name((context, keyed) => {
|
|
|
26776
26931
|
};
|
|
26777
26932
|
}, "peopleStoreOver");
|
|
26778
26933
|
|
|
26779
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
26934
|
+
// 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/sqlite/admin-statistics.js
|
|
26780
26935
|
import { createHash as createHash8 } from "node:crypto";
|
|
26781
26936
|
|
|
26782
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
26937
|
+
// 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/domain/admin-statistics.js
|
|
26783
26938
|
import { createHash as createHash7 } from "node:crypto";
|
|
26784
26939
|
|
|
26785
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
26940
|
+
// 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/domain/rankings-options.js
|
|
26786
26941
|
var MESSAGE_MEASURES = ["views", "reactions", "forwards", "comments", "replies", "thread-size"];
|
|
26787
26942
|
var AUTHOR_MEASURES = [
|
|
26788
26943
|
"messages",
|
|
@@ -26922,7 +27077,7 @@ var withoutUrls = /* @__PURE__ */ __name((text5) => text5.replace(/\S+/gu, (toke
|
|
|
26922
27077
|
var rankingWords = /* @__PURE__ */ __name((text5) => withoutUrls(text5).match(/[\p{L}\p{N}]+/gu)?.length ?? 0, "rankingWords");
|
|
26923
27078
|
var rankingQuestion = /* @__PURE__ */ __name((text5) => withoutUrls(text5).includes("?"), "rankingQuestion");
|
|
26924
27079
|
|
|
26925
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
27080
|
+
// 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/domain/rankings-graph.js
|
|
26926
27081
|
var RANKING_GRAPH_LIMITS = { nodes: 5e4, depth: 256, work: 1e7, bytes: 8388608 };
|
|
26927
27082
|
var exhausted2 = /* @__PURE__ */ __name((budget) => {
|
|
26928
27083
|
throw new CliError("validation_error", `ranking exceeded ${budget} \u2014 narrow its chat or date scope`, {
|
|
@@ -27144,7 +27299,7 @@ var rankReplyGraph = /* @__PURE__ */ __name((nodes, check3 = () => {
|
|
|
27144
27299
|
};
|
|
27145
27300
|
}, "rankReplyGraph");
|
|
27146
27301
|
|
|
27147
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
27302
|
+
// 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/domain/admin-statistics.js
|
|
27148
27303
|
var adminEntityKey = /* @__PURE__ */ __name((row2) => JSON.stringify([row2.account.provider, row2.account.account, row2.id]), "adminEntityKey");
|
|
27149
27304
|
var personKey = /* @__PURE__ */ __name((node) => JSON.stringify([node.account.provider, node.account.account, node.sender]), "personKey");
|
|
27150
27305
|
var locator = /* @__PURE__ */ __name((node) => formatLocator({ ...node.account, chat: node.chatId, message: node.id }), "locator");
|
|
@@ -27318,7 +27473,7 @@ var calculateAdminStatistics = /* @__PURE__ */ __name((nodes, stays, options, in
|
|
|
27318
27473
|
return { items, evidence, summary, graph: graph.quality };
|
|
27319
27474
|
}, "calculateAdminStatistics");
|
|
27320
27475
|
|
|
27321
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
27476
|
+
// 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/domain/rankings-range.js
|
|
27322
27477
|
var rankingContextRange = /* @__PURE__ */ __name((root) => {
|
|
27323
27478
|
const dates = [];
|
|
27324
27479
|
const visit = /* @__PURE__ */ __name((node, required3) => {
|
|
@@ -27340,7 +27495,7 @@ var rankingContextRange = /* @__PURE__ */ __name((root) => {
|
|
|
27340
27495
|
return dates[0].node.resolution.date;
|
|
27341
27496
|
}, "rankingContextRange");
|
|
27342
27497
|
|
|
27343
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
27498
|
+
// 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/sqlite/rankings.js
|
|
27344
27499
|
var reactionCounts = /* @__PURE__ */ __name((stored3) => {
|
|
27345
27500
|
let counts;
|
|
27346
27501
|
try {
|
|
@@ -27635,7 +27790,7 @@ var rankQuery = /* @__PURE__ */ __name((context, execution, request, inspect) =>
|
|
|
27635
27790
|
});
|
|
27636
27791
|
}, "rankQuery");
|
|
27637
27792
|
|
|
27638
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
27793
|
+
// 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/sqlite/admin-statistics.js
|
|
27639
27794
|
function fail4(message2, reason = "query.too-large") {
|
|
27640
27795
|
throw new CliError("validation_error", message2, { reason, complete: false });
|
|
27641
27796
|
}
|
|
@@ -27812,7 +27967,7 @@ var adminStatisticsQuery = /* @__PURE__ */ __name((context, execution, request)
|
|
|
27812
27967
|
return result;
|
|
27813
27968
|
}), "adminStatisticsQuery");
|
|
27814
27969
|
|
|
27815
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
27970
|
+
// 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/sqlite/conversation-eligibility.js
|
|
27816
27971
|
var conversationEligibility = /* @__PURE__ */ __name(async (context, execution) => {
|
|
27817
27972
|
if (!execution.accounts.length)
|
|
27818
27973
|
return { conversations: [], chats: [] };
|
|
@@ -27830,7 +27985,7 @@ var conversationEligibility = /* @__PURE__ */ __name(async (context, execution)
|
|
|
27830
27985
|
return { conversations: conversations2, chats: chats2 };
|
|
27831
27986
|
}, "conversationEligibility");
|
|
27832
27987
|
|
|
27833
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
27988
|
+
// 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/sqlite/ranking-evidence.js
|
|
27834
27989
|
import { createHash as createHash9 } from "node:crypto";
|
|
27835
27990
|
var EVIDENCE_BYTES = 64 * 1024;
|
|
27836
27991
|
var FINGERPRINT_BYTES = 8 * 1024 * 1024;
|
|
@@ -27980,16 +28135,17 @@ var rankingEvidence = /* @__PURE__ */ __name((context, execution, request) => {
|
|
|
27980
28135
|
return result;
|
|
27981
28136
|
}, "rankingEvidence");
|
|
27982
28137
|
|
|
27983
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
27984
|
-
var queriesStoreOver = /* @__PURE__ */ __name((context,
|
|
28138
|
+
// 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/queries.js
|
|
28139
|
+
var queriesStoreOver = /* @__PURE__ */ __name((context, stemmerFor2) => {
|
|
27985
28140
|
const mailIndexed = /* @__PURE__ */ __name((execution) => {
|
|
27986
28141
|
if (execution.corpus === "mail")
|
|
27987
|
-
drainEmailIndex(context.database,
|
|
28142
|
+
drainEmailIndex(context.database, stemmerFor2);
|
|
27988
28143
|
return execution;
|
|
27989
28144
|
}, "mailIndexed");
|
|
27990
28145
|
return {
|
|
27991
28146
|
matchQuery: /* @__PURE__ */ __name(async (execution) => matchQuery(context, mailIndexed(execution)), "matchQuery"),
|
|
27992
28147
|
countQuery: /* @__PURE__ */ __name(async (execution, by) => countQuery(context, mailIndexed(execution), by), "countQuery"),
|
|
28148
|
+
countMatches: /* @__PURE__ */ __name(async (execution, cap) => countMatches(context, mailIndexed(execution), cap), "countMatches"),
|
|
27993
28149
|
conversationEligibility: /* @__PURE__ */ __name(async (execution) => conversationEligibility(context, execution), "conversationEligibility"),
|
|
27994
28150
|
rankQuery: /* @__PURE__ */ __name(async (execution, request) => rankQuery(context, execution, request), "rankQuery"),
|
|
27995
28151
|
rankingEvidence: /* @__PURE__ */ __name(async (execution, request) => rankingEvidence(context, execution, request), "rankingEvidence"),
|
|
@@ -27997,7 +28153,7 @@ var queriesStoreOver = /* @__PURE__ */ __name((context, stemmerFor) => {
|
|
|
27997
28153
|
};
|
|
27998
28154
|
}, "queriesStoreOver");
|
|
27999
28155
|
|
|
28000
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
28156
|
+
// 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/sqlite/chat-events.js
|
|
28001
28157
|
var saveChatEvents = /* @__PURE__ */ __name((context, accountKey, provider, chatKey, events3) => {
|
|
28002
28158
|
const { database, now: now2 } = context;
|
|
28003
28159
|
const insert = database.prepare(`INSERT INTO chat_events (chat_id, source_id, action, actor_identity_id, title, happened_at, created_at, updated_at)
|
|
@@ -28036,10 +28192,10 @@ var chatEventsOf = /* @__PURE__ */ __name(({ database }, chatKey, { since = 0, l
|
|
|
28036
28192
|
}));
|
|
28037
28193
|
}, "chatEventsOf");
|
|
28038
28194
|
|
|
28039
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
28195
|
+
// 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/sqlite/retention.js
|
|
28040
28196
|
import { createHash as createHash10 } from "node:crypto";
|
|
28041
28197
|
|
|
28042
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
28198
|
+
// 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/domain/calendar.js
|
|
28043
28199
|
var calendarKey = /* @__PURE__ */ __name((zone, by) => {
|
|
28044
28200
|
const format = new Intl.DateTimeFormat("en-CA", {
|
|
28045
28201
|
timeZone: zone,
|
|
@@ -28054,7 +28210,7 @@ var calendarKey = /* @__PURE__ */ __name((zone, by) => {
|
|
|
28054
28210
|
};
|
|
28055
28211
|
}, "calendarKey");
|
|
28056
28212
|
|
|
28057
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
28213
|
+
// 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/domain/retention.js
|
|
28058
28214
|
var RETENTION_TOLERANCE = 864e5;
|
|
28059
28215
|
var validateRetentionOptions = /* @__PURE__ */ __name((options) => {
|
|
28060
28216
|
const { since, until, cutoff, checkpoints, within, limit, by } = options;
|
|
@@ -28108,8 +28264,8 @@ var retentionCohorts = /* @__PURE__ */ __name((stays, options) => {
|
|
|
28108
28264
|
return [...groups.values()].sort((a, b) => a.cohort.localeCompare(b.cohort));
|
|
28109
28265
|
}, "retentionCohorts");
|
|
28110
28266
|
|
|
28111
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
28112
|
-
var
|
|
28267
|
+
// 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/sqlite/retention.js
|
|
28268
|
+
var iso6 = /* @__PURE__ */ __name((at) => new Date(at).toISOString(), "iso");
|
|
28113
28269
|
var week = /* @__PURE__ */ __name((day) => {
|
|
28114
28270
|
const date3 = /* @__PURE__ */ new Date(`${day}T00:00:00Z`);
|
|
28115
28271
|
date3.setUTCDate(date3.getUTCDate() - (date3.getUTCDay() + 6) % 7);
|
|
@@ -28146,14 +28302,14 @@ var retentionQuery = /* @__PURE__ */ __name((context, accountPk2, chatPk, chatId
|
|
|
28146
28302
|
return {
|
|
28147
28303
|
stay: pk,
|
|
28148
28304
|
person: String(row2.person),
|
|
28149
|
-
joinedAt:
|
|
28305
|
+
joinedAt: iso6(joinedAt),
|
|
28150
28306
|
cohort,
|
|
28151
28307
|
checkpoints: options.checkpoints.map((checkpoint) => {
|
|
28152
28308
|
const target = joinedAt + checkpoint;
|
|
28153
28309
|
if (target > options.cutoff)
|
|
28154
28310
|
return {
|
|
28155
28311
|
checkpoint,
|
|
28156
|
-
targetAt:
|
|
28312
|
+
targetAt: iso6(target),
|
|
28157
28313
|
state: "pending",
|
|
28158
28314
|
observedAt: null,
|
|
28159
28315
|
lagMilliseconds: null,
|
|
@@ -28162,22 +28318,22 @@ var retentionQuery = /* @__PURE__ */ __name((context, accountPk2, chatPk, chatId
|
|
|
28162
28318
|
const read2 = observationStatement.get(pk, chatPk, target, Math.min(target + RETENTION_TOLERANCE, options.cutoff));
|
|
28163
28319
|
return {
|
|
28164
28320
|
checkpoint,
|
|
28165
|
-
targetAt:
|
|
28321
|
+
targetAt: iso6(target),
|
|
28166
28322
|
state: !read2 ? "unknown" : Number(read2.present) === 1 ? "present" : Number(read2.complete) === 1 ? "absent" : "unknown",
|
|
28167
|
-
observedAt: read2 ?
|
|
28323
|
+
observedAt: read2 ? iso6(Number(read2.observed_at)) : null,
|
|
28168
28324
|
lagMilliseconds: read2 ? Number(read2.observed_at) - target : null,
|
|
28169
28325
|
complete: read2 ? Number(read2.complete) === 1 : null
|
|
28170
28326
|
};
|
|
28171
28327
|
}),
|
|
28172
28328
|
activity: {
|
|
28173
28329
|
state: first !== null && first !== void 0 ? "observed-message" : end > options.cutoff ? "pending" : "no-observed-message",
|
|
28174
|
-
firstMessageAt: first === null || first === void 0 ? null :
|
|
28175
|
-
windowEnd:
|
|
28330
|
+
firstMessageAt: first === null || first === void 0 ? null : iso6(Number(first)),
|
|
28331
|
+
windowEnd: iso6(end),
|
|
28176
28332
|
archiveCovered: covered === true
|
|
28177
28333
|
},
|
|
28178
28334
|
departure: {
|
|
28179
|
-
after: lower === null ? null :
|
|
28180
|
-
atOrBefore: upper === null ? null :
|
|
28335
|
+
after: lower === null ? null : iso6(lower),
|
|
28336
|
+
atOrBefore: upper === null ? null : iso6(upper),
|
|
28181
28337
|
early: upper !== null && upper <= end ? "observed" : lower !== null && lower >= end ? "not-observed" : end > options.cutoff ? "pending" : "unknown"
|
|
28182
28338
|
}
|
|
28183
28339
|
};
|
|
@@ -28221,7 +28377,7 @@ var retentionQuery = /* @__PURE__ */ __name((context, accountPk2, chatPk, chatId
|
|
|
28221
28377
|
const nextCursor = next < selected.length ? Buffer.from(JSON.stringify({ offset: next, fingerprint: fingerprint2, cohort: evidence?.cohort ?? null })).toString("base64url") : null;
|
|
28222
28378
|
return {
|
|
28223
28379
|
chatId,
|
|
28224
|
-
cutoff:
|
|
28380
|
+
cutoff: iso6(options.cutoff),
|
|
28225
28381
|
options,
|
|
28226
28382
|
items: cohorts.slice(0, options.limit),
|
|
28227
28383
|
total: cohorts.length,
|
|
@@ -28244,8 +28400,8 @@ var retentionQuery = /* @__PURE__ */ __name((context, accountPk2, chatPk, chatId
|
|
|
28244
28400
|
};
|
|
28245
28401
|
}, "retentionQuery");
|
|
28246
28402
|
|
|
28247
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
28248
|
-
var
|
|
28403
|
+
// 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/sqlite/roster.js
|
|
28404
|
+
var iso7 = /* @__PURE__ */ __name((ms) => ms === null ? null : new Date(ms).toISOString(), "iso");
|
|
28249
28405
|
var marksOf = /* @__PURE__ */ __name(({ isBot, flagged, deleted, hasPhoto }) => ({
|
|
28250
28406
|
...isBot === void 0 ? {} : { bot: isBot },
|
|
28251
28407
|
...flagged === void 0 ? {} : { [flagged]: true },
|
|
@@ -28339,10 +28495,10 @@ var memberStaysOf = /* @__PURE__ */ __name(({ orm }, chatKey, since) => orm.sele
|
|
|
28339
28495
|
goneAt: memberStays.leftAt
|
|
28340
28496
|
}).from(memberStays).innerJoin(identities, eq(identities.id, memberStays.identityId)).where(and(eq(memberStays.chatId, chatKey), since === void 0 ? void 0 : or(isNull(memberStays.leftAt), gte(memberStays.leftAt, since)))).orderBy(asc(memberStays.firstSeenAt), asc(memberStays.id)).all().map((row2) => ({
|
|
28341
28497
|
...row2,
|
|
28342
|
-
firstSeenAt:
|
|
28343
|
-
lastSeenAt:
|
|
28344
|
-
joinedAt:
|
|
28345
|
-
goneAt:
|
|
28498
|
+
firstSeenAt: iso7(row2.firstSeenAt),
|
|
28499
|
+
lastSeenAt: iso7(row2.lastSeenAt),
|
|
28500
|
+
joinedAt: iso7(row2.joinedAt),
|
|
28501
|
+
goneAt: iso7(row2.goneAt)
|
|
28346
28502
|
})), "memberStaysOf");
|
|
28347
28503
|
var memberCountsOf = /* @__PURE__ */ __name(({ orm }, chatKey, since) => orm.select({
|
|
28348
28504
|
day: memberCounts.date,
|
|
@@ -28362,7 +28518,7 @@ var profileRevisionsOf = /* @__PURE__ */ __name(({ orm }, chatKey, since) => {
|
|
|
28362
28518
|
}).from(identityRevisions).innerJoin(identities, eq(identities.id, identityRevisions.identityId)).where(and(inArray(identityRevisions.identityId, people2), since === void 0 ? void 0 : gte(identityRevisions.createdAt, since))).orderBy(asc(identityRevisions.createdAt), asc(identityRevisions.id)).all().map((row2) => ({
|
|
28363
28519
|
...row2,
|
|
28364
28520
|
marks: row2.marks ? JSON.parse(row2.marks) : {},
|
|
28365
|
-
capturedAt:
|
|
28521
|
+
capturedAt: iso7(row2.capturedAt)
|
|
28366
28522
|
}));
|
|
28367
28523
|
}, "profileRevisionsOf");
|
|
28368
28524
|
var setTracked = /* @__PURE__ */ __name(({ orm, now: now2 }, chatKey, tracked) => {
|
|
@@ -28371,11 +28527,11 @@ var setTracked = /* @__PURE__ */ __name(({ orm, now: now2 }, chatKey, tracked) =
|
|
|
28371
28527
|
var trackedChats = /* @__PURE__ */ __name((context, accountKey, where) => context.orm.select({ pk: chats.id, chatId: chats.externalId, title: chats.title, trackedAt: chats.membersTrackedAt }).from(chats).where(and(eq(chats.accountId, accountKey), isNotNull(chats.membersTrackedAt), where ? bound2(where) : void 0)).orderBy(asc(chats.membersTrackedAt)).all().map(({ pk, chatId, title, trackedAt }) => ({
|
|
28372
28528
|
chatId,
|
|
28373
28529
|
title,
|
|
28374
|
-
trackedAt:
|
|
28530
|
+
trackedAt: iso7(trackedAt),
|
|
28375
28531
|
lastCount: memberCountsOf(context, pk).at(-1) ?? null
|
|
28376
28532
|
})), "trackedChats");
|
|
28377
28533
|
|
|
28378
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
28534
|
+
// 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/roster.js
|
|
28379
28535
|
var rosterStoreOver = /* @__PURE__ */ __name((context) => {
|
|
28380
28536
|
const { database } = context;
|
|
28381
28537
|
const { accountPk: accountPk2, findAccountPk: findAccountPk2, chatKeyOf, chatPkFor: chatPkFor2, writeMembers: writeMembers2 } = keysOver(context);
|
|
@@ -28431,7 +28587,7 @@ var rosterStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
28431
28587
|
};
|
|
28432
28588
|
}, "rosterStoreOver");
|
|
28433
28589
|
|
|
28434
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
28590
|
+
// 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/sqlite/backfill.js
|
|
28435
28591
|
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");
|
|
28436
28592
|
var backfillNormalized = /* @__PURE__ */ __name((database, { batch = 5e3, onBatch, until = /* @__PURE__ */ __name(() => false, "until") } = {}) => {
|
|
28437
28593
|
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 ?`);
|
|
@@ -28455,7 +28611,7 @@ var backfillNormalized = /* @__PURE__ */ __name((database, { batch = 5e3, onBatc
|
|
|
28455
28611
|
}
|
|
28456
28612
|
}, "backfillNormalized");
|
|
28457
28613
|
|
|
28458
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
28614
|
+
// 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/sqlite/search-index.js
|
|
28459
28615
|
var INDEX2 = "message_words";
|
|
28460
28616
|
var searchIndexState2 = /* @__PURE__ */ __name((database) => {
|
|
28461
28617
|
const row2 = indexRow(database, INDEX2);
|
|
@@ -28582,7 +28738,7 @@ var resetSearchIndex = /* @__PURE__ */ __name((database) => {
|
|
|
28582
28738
|
});
|
|
28583
28739
|
}, "resetSearchIndex");
|
|
28584
28740
|
|
|
28585
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
28741
|
+
// 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/sqlite/stems-fill.js
|
|
28586
28742
|
var fillStems = /* @__PURE__ */ __name((database, { batch = 5e3, until = /* @__PURE__ */ __name(() => false, "until"), onBatch, now: now2 = Date.now } = {}) => {
|
|
28587
28743
|
const filled2 = { stemmed: 0, drained: 0 };
|
|
28588
28744
|
const before2 = stemsState(database);
|
|
@@ -28677,7 +28833,7 @@ var followDefaultStemmers = /* @__PURE__ */ __name((database, now2 = Date.now) =
|
|
|
28677
28833
|
return resetStems(database, { now: now2 });
|
|
28678
28834
|
}, "followDefaultStemmers");
|
|
28679
28835
|
|
|
28680
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
28836
|
+
// 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/sqlite/words.js
|
|
28681
28837
|
var VOCABULARY = "SELECT term, doc FROM message_words_vocab WHERE col = 'normalized_text'";
|
|
28682
28838
|
var knownTerms = /* @__PURE__ */ __name(({ database }, terms2) => {
|
|
28683
28839
|
const lookup = database.prepare(`${VOCABULARY} AND term >= ? AND term <= ? LIMIT 1`);
|
|
@@ -28699,10 +28855,10 @@ var termCandidates = /* @__PURE__ */ __name(({ database }, pieces, { shortest, l
|
|
|
28699
28855
|
});
|
|
28700
28856
|
}, "termCandidates");
|
|
28701
28857
|
|
|
28702
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
28858
|
+
// 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/search-index.js
|
|
28703
28859
|
var searchIndexStoreOver = /* @__PURE__ */ __name((context) => {
|
|
28704
28860
|
const { database } = context;
|
|
28705
|
-
const
|
|
28861
|
+
const stemmerFor2 = stemmerCache();
|
|
28706
28862
|
return {
|
|
28707
28863
|
knownTerms: /* @__PURE__ */ __name(async (terms2) => knownTerms(context, terms2), "knownTerms"),
|
|
28708
28864
|
termCandidates: /* @__PURE__ */ __name(async (trigrams2, lengths) => termCandidates(context, trigrams2, lengths), "termCandidates"),
|
|
@@ -28713,7 +28869,7 @@ var searchIndexStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
28713
28869
|
const filled2 = fillStems(database, { now: context.now, ...until ? { until } : {} });
|
|
28714
28870
|
const transcripts = corpusIndexState(database, CORPORA.transcript);
|
|
28715
28871
|
if (transcripts.wanted !== null && (transcripts.pending > 0 || transcripts.built !== transcripts.wanted))
|
|
28716
|
-
drainCorpus(database, CORPORA.transcript,
|
|
28872
|
+
drainCorpus(database, CORPORA.transcript, stemmerFor2, until ? { until } : {});
|
|
28717
28873
|
return filled2;
|
|
28718
28874
|
}, "fillStems"),
|
|
28719
28875
|
stemmers: /* @__PURE__ */ __name(async () => savedStemmers(database), "stemmers"),
|
|
@@ -28721,7 +28877,7 @@ var searchIndexStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
28721
28877
|
};
|
|
28722
28878
|
}, "searchIndexStoreOver");
|
|
28723
28879
|
|
|
28724
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
28880
|
+
// 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/sqlite/searches.js
|
|
28725
28881
|
var HISTORY_KEPT = 1e3;
|
|
28726
28882
|
var commandFilter = /* @__PURE__ */ __name((commands) => commands ? { sql: ` AND command IN (${commands.map(() => "?").join(", ")})`, values: [...commands] } : { sql: "", values: [] }, "commandFilter");
|
|
28727
28883
|
var COLUMNS5 = "id, name, command, params, language, version, fields_version, created_at, updated_at, last_run_at, runs";
|
|
@@ -28790,7 +28946,7 @@ var clearHistory = /* @__PURE__ */ __name(({ database }, commands) => {
|
|
|
28790
28946
|
return database.prepare(`DELETE FROM searches WHERE name IS NULL${only.sql}`).run(...only.values).changes;
|
|
28791
28947
|
}, "clearHistory");
|
|
28792
28948
|
|
|
28793
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
28949
|
+
// 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/searches.js
|
|
28794
28950
|
var searchesStoreOver = /* @__PURE__ */ __name((context) => {
|
|
28795
28951
|
const { database } = context;
|
|
28796
28952
|
return {
|
|
@@ -28814,7 +28970,7 @@ var searchesStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
28814
28970
|
};
|
|
28815
28971
|
}, "searchesStoreOver");
|
|
28816
28972
|
|
|
28817
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
28973
|
+
// 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/sqlite/agent-actions.js
|
|
28818
28974
|
var ACTION_TIERS = ["read", "draft", "write-private", "write-public", "destructive", "admin"];
|
|
28819
28975
|
var ACTION_OUTCOMES = ["ok", "refused", "failed"];
|
|
28820
28976
|
var CODE = /^[a-z][a-z0-9_]{0,63}$/;
|
|
@@ -28857,7 +29013,7 @@ var agentActionsStoreOver = /* @__PURE__ */ __name((context, afterRecord = () =>
|
|
|
28857
29013
|
};
|
|
28858
29014
|
}, "agentActionsStoreOver");
|
|
28859
29015
|
|
|
28860
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
29016
|
+
// 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/sqlite/bot-updates.js
|
|
28861
29017
|
var botUpdateStoreOver = /* @__PURE__ */ __name((context, afterSave = () => {
|
|
28862
29018
|
}) => {
|
|
28863
29019
|
const { database, now: now2 } = context;
|
|
@@ -28916,7 +29072,7 @@ var botUpdateStoreOver = /* @__PURE__ */ __name((context, afterSave = () => {
|
|
|
28916
29072
|
};
|
|
28917
29073
|
}, "botUpdateStoreOver");
|
|
28918
29074
|
|
|
28919
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
29075
|
+
// 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/sqlite/calendar-events.js
|
|
28920
29076
|
var DAY4 = 864e5;
|
|
28921
29077
|
var listEvents = /* @__PURE__ */ __name((database, filter) => {
|
|
28922
29078
|
const clauses = ["e.deleted_at IS NULL"];
|
|
@@ -28996,7 +29152,7 @@ var listEvents = /* @__PURE__ */ __name((database, filter) => {
|
|
|
28996
29152
|
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);
|
|
28997
29153
|
}, "listEvents");
|
|
28998
29154
|
|
|
28999
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
29155
|
+
// 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/sqlite/calendar.js
|
|
29000
29156
|
var calendarOf = /* @__PURE__ */ __name((row2) => ({
|
|
29001
29157
|
id: Number(row2.id),
|
|
29002
29158
|
accountId: Number(row2.account_id),
|
|
@@ -29576,7 +29732,7 @@ var eventStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
29576
29732
|
};
|
|
29577
29733
|
}, "eventStoreOver");
|
|
29578
29734
|
|
|
29579
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
29735
|
+
// 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/sqlite/catalog.js
|
|
29580
29736
|
var CATALOG_QUERY = defineQuery({
|
|
29581
29737
|
entity: "document",
|
|
29582
29738
|
backend: "sql",
|
|
@@ -29818,7 +29974,7 @@ var catalogStoreOver = /* @__PURE__ */ __name(({ database, now: now2 }) => {
|
|
|
29818
29974
|
};
|
|
29819
29975
|
}, "catalogStoreOver");
|
|
29820
29976
|
|
|
29821
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
29977
|
+
// 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/context/evidence.js
|
|
29822
29978
|
import { createHash as createHash11 } from "node:crypto";
|
|
29823
29979
|
var CONTEXT_MAX_READ_BYTES = 262144;
|
|
29824
29980
|
var CONTEXT_SOURCE_KINDS = ["message", "mail", "document", "meeting"];
|
|
@@ -29916,7 +30072,7 @@ var contextEvidenceRequest = /* @__PURE__ */ __name((input) => {
|
|
|
29916
30072
|
return { source: source2, query, chat: chat2, senders, words: words3, after: after2, before: before2, limit, maxReadBytes, cursor, signal: input.signal };
|
|
29917
30073
|
}, "contextEvidenceRequest");
|
|
29918
30074
|
|
|
29919
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
30075
|
+
// 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/sqlite/context-document-source.js
|
|
29920
30076
|
var drive = "CASE WHEN json_valid(n.front_matter) THEN json_extract(n.front_matter,'$.source')='google-drive' ELSE 0 END";
|
|
29921
30077
|
var field2 = /* @__PURE__ */ __name((name) => `CASE WHEN (${drive}) THEN
|
|
29922
30078
|
CASE WHEN json_type(n.front_matter,'$.${name}')='text' THEN json_extract(n.front_matter,'$.${name}') END END`, "field");
|
|
@@ -29929,7 +30085,7 @@ var contextDocumentTimeKind = `CASE WHEN (${remoteTime}) IS NOT NULL
|
|
|
29929
30085
|
THEN 'source-modified' ELSE 'stored-update' END`;
|
|
29930
30086
|
var contextDocumentUrl = `coalesce(${preferred("url")},n.url,${field2("sourceUrl")})`;
|
|
29931
30087
|
|
|
29932
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
30088
|
+
// 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/sqlite/context-meeting-source.js
|
|
29933
30089
|
var readMeetingContextEvidence = /* @__PURE__ */ __name((database, request) => {
|
|
29934
30090
|
const { source: source2, words: words3, after: after2, before: before2, limit, maxReadBytes, cursor, signal } = request;
|
|
29935
30091
|
signal?.throwIfAborted();
|
|
@@ -30028,7 +30184,7 @@ var readMeetingContextEvidence = /* @__PURE__ */ __name((database, request) => {
|
|
|
30028
30184
|
});
|
|
30029
30185
|
}, "readMeetingContextEvidence");
|
|
30030
30186
|
|
|
30031
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
30187
|
+
// 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/sqlite/context-evidence.js
|
|
30032
30188
|
var corpora = {
|
|
30033
30189
|
message: {
|
|
30034
30190
|
table: "messages",
|
|
@@ -30215,12 +30371,12 @@ var contextEvidenceOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
|
30215
30371
|
});
|
|
30216
30372
|
}
|
|
30217
30373
|
}), "contextEvidenceOver");
|
|
30218
|
-
var contextIndexOver = /* @__PURE__ */ __name(({ database },
|
|
30374
|
+
var contextIndexOver = /* @__PURE__ */ __name(({ database }, stemmerFor2) => ({
|
|
30219
30375
|
async catchUp({ kinds: kinds2, signal }) {
|
|
30220
30376
|
signal?.throwIfAborted();
|
|
30221
|
-
const mail = kinds2.includes("mail") ? drainEmailIndex(database,
|
|
30377
|
+
const mail = kinds2.includes("mail") ? drainEmailIndex(database, stemmerFor2) : 0;
|
|
30222
30378
|
signal?.throwIfAborted();
|
|
30223
|
-
const documents2 = kinds2.includes("document") ? drainNoteIndex(database,
|
|
30379
|
+
const documents2 = kinds2.includes("document") ? drainNoteIndex(database, stemmerFor2) : 0;
|
|
30224
30380
|
return { mail, documents: documents2 };
|
|
30225
30381
|
}
|
|
30226
30382
|
}), "contextIndexOver");
|
|
@@ -30257,7 +30413,7 @@ var contextRecordsOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
|
30257
30413
|
}
|
|
30258
30414
|
}), "contextRecordsOver");
|
|
30259
30415
|
|
|
30260
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
30416
|
+
// 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/sqlite/note-search.js
|
|
30261
30417
|
var NOTE_FIELDS = [
|
|
30262
30418
|
"text",
|
|
30263
30419
|
"exact",
|
|
@@ -30285,7 +30441,7 @@ var CORPORA2 = [
|
|
|
30285
30441
|
type: "document",
|
|
30286
30442
|
noun: "note",
|
|
30287
30443
|
fields: NOTE_FIELDS,
|
|
30288
|
-
view:
|
|
30444
|
+
view: `(SELECT n.id, n.account_id AS folder_id, n.external_id AS path, n.title, coalesce(n.body, '') AS text, n.metadata, ${contextDocumentTime} AS at, n.deleted_at FROM documents n)`,
|
|
30289
30445
|
words: "document_words",
|
|
30290
30446
|
stems: "document_stems",
|
|
30291
30447
|
live: "coalesce(json_extract(n.metadata, '$.catalog.active'), 1)=1",
|
|
@@ -30302,12 +30458,22 @@ var CORPORA2 = [
|
|
|
30302
30458
|
tagged: /* @__PURE__ */ __name((tag2) => bound3("n.id IN (SELECT g.taggable_id FROM taggings g JOIN resolved_tags t ON t.id=g.tag_id WHERE t.name = ? AND g.taggable_type = 'note')", tag2), "tagged")
|
|
30303
30459
|
}
|
|
30304
30460
|
];
|
|
30305
|
-
var
|
|
30306
|
-
const offset = query.offset ?? 0;
|
|
30461
|
+
var matchedRows = /* @__PURE__ */ __name((context, query) => {
|
|
30307
30462
|
const chosen = CORPORA2.filter(({ type }) => (query.source === void 0 || query.source === "file" === (type === "document")) && (!query.folderIds?.length || query.withInternal === true || type === "document"));
|
|
30308
|
-
const
|
|
30463
|
+
const idsOf = /* @__PURE__ */ __name((type) => query.refs?.flatMap((ref3) => ref3.startsWith(`${type}:`) ? [Number(ref3.slice(type.length + 1))] : []), "idsOf");
|
|
30464
|
+
const rows = chosen.flatMap((corpus) => {
|
|
30465
|
+
const ids = idsOf(corpus.type);
|
|
30466
|
+
if (ids?.length === 0)
|
|
30467
|
+
return [];
|
|
30468
|
+
return searchCorpus(context, { ...query, ...query.folderIds ? { accountIds: query.folderIds } : {}, ...ids ? { ids } : {} }, corpus);
|
|
30469
|
+
});
|
|
30309
30470
|
const exactFirst = rows.some((row2) => row2.exact !== void 0);
|
|
30310
30471
|
rows.sort((a, b) => query.newest ? (b.at ?? 0) - (a.at ?? 0) || a.id - b.id : (exactFirst ? Number(b.exact === true) - Number(a.exact === true) : 0) || Number(a.relevance === null) - Number(b.relevance === null) || (a.relevance ?? 0) - (b.relevance ?? 0) || (b.at ?? 0) - (a.at ?? 0) || a.id - b.id);
|
|
30472
|
+
return rows;
|
|
30473
|
+
}, "matchedRows");
|
|
30474
|
+
var searchNotes = /* @__PURE__ */ __name((context, query) => {
|
|
30475
|
+
const offset = query.offset ?? 0;
|
|
30476
|
+
const rows = matchedRows(context, query);
|
|
30311
30477
|
const read2 = {
|
|
30312
30478
|
document: context.database.prepare("SELECT * FROM documents WHERE id = ?"),
|
|
30313
30479
|
note: context.database.prepare("SELECT * FROM notes WHERE id = ?")
|
|
@@ -30320,12 +30486,17 @@ var searchNotes = /* @__PURE__ */ __name((context, query) => {
|
|
|
30320
30486
|
ref: note2.ref,
|
|
30321
30487
|
note: note2,
|
|
30322
30488
|
relevance: row2.relevance,
|
|
30323
|
-
...row2.exact === void 0 ? {} : { exact: row2.exact }
|
|
30489
|
+
...row2.exact === void 0 ? {} : { exact: row2.exact },
|
|
30490
|
+
at: new Date(row2.at ?? 0).toISOString()
|
|
30324
30491
|
};
|
|
30325
30492
|
}),
|
|
30326
30493
|
hasMore: rows.length > offset + query.limit
|
|
30327
30494
|
};
|
|
30328
30495
|
}, "searchNotes");
|
|
30496
|
+
var matchingNoteRefs = /* @__PURE__ */ __name((context, query) => {
|
|
30497
|
+
const rows = matchedRows(context, { ...query, newest: true });
|
|
30498
|
+
return { refs: rows.slice(0, query.limit).map(({ type, id: id2 }) => `${type}:${id2}`), hasMore: rows.length > query.limit };
|
|
30499
|
+
}, "matchingNoteRefs");
|
|
30329
30500
|
var searchCorpus = /* @__PURE__ */ __name((context, query, corpus) => {
|
|
30330
30501
|
const { database } = context;
|
|
30331
30502
|
const wordMatch2 = /* @__PURE__ */ __name((match) => ({
|
|
@@ -30466,7 +30637,8 @@ var searchCorpus = /* @__PURE__ */ __name((context, query, corpus) => {
|
|
|
30466
30637
|
const scope3 = combine2([
|
|
30467
30638
|
bound3("n.deleted_at IS NULL"),
|
|
30468
30639
|
...corpus.live ? [bound3(corpus.live)] : [],
|
|
30469
|
-
...query.accountIds?.length && corpus.inAccounts ? [corpus.inAccounts(JSON.stringify(query.accountIds))] : []
|
|
30640
|
+
...query.accountIds?.length && corpus.inAccounts ? [corpus.inAccounts(JSON.stringify(query.accountIds))] : [],
|
|
30641
|
+
...query.ids ? [bound3("n.id IN (SELECT value FROM json_each(?))", JSON.stringify(query.ids))] : []
|
|
30470
30642
|
], "AND");
|
|
30471
30643
|
const where = combine2([scope3, expression], "AND");
|
|
30472
30644
|
const ranking = query.newest ? void 0 : required3(query.root, stemmed ? "stems" : "fts");
|
|
@@ -30487,7 +30659,7 @@ var searchCorpus = /* @__PURE__ */ __name((context, query, corpus) => {
|
|
|
30487
30659
|
const leaves = [...fragments.entries()].filter(([node]) => !tests.has(node));
|
|
30488
30660
|
const projection = tests.size ? leaves.map(([, fragment], index2) => `, coalesce(${fragment.sql}, 0) AS q${index2}`).join("") : "";
|
|
30489
30661
|
const window = tests.size ? QUERY_LIMITS2.candidates + 1 : query.limit + offset + 1;
|
|
30490
|
-
const rows = database.prepare(`${ctes.length ? `WITH ${ctes.join(", ")} ` : ""}SELECT n
|
|
30662
|
+
const rows = database.prepare(`${ctes.length ? `WITH ${ctes.join(", ")} ` : ""}SELECT ${tests.size ? "n.*" : "n.id, n.at"}, ${ranking ? "f.rank" : "NULL"} AS relevance${exactTier ? ", n.id IN (SELECT id FROM x) AS exact" : ""}${projection}
|
|
30491
30663
|
FROM ${corpus.view} n${ranking ? " LEFT JOIN f ON f.id = n.id" : ""} WHERE ${where.sql} ORDER BY ${order} LIMIT ?`).all(...cteParams, ...leaves.flatMap(([, fragment]) => tests.size ? fragment.params : []), ...where.params, window);
|
|
30492
30664
|
if (tests.size && rows.length > QUERY_LIMITS2.candidates)
|
|
30493
30665
|
exhausted("candidates");
|
|
@@ -30522,8 +30694,8 @@ var SCAN_PAGE3 = 5e3;
|
|
|
30522
30694
|
var LIVE2 = "((k.chunkable_type = 'document' AND EXISTS (SELECT 1 FROM documents d WHERE d.id = k.chunkable_id AND d.deleted_at IS NULL AND coalesce(json_extract(d.metadata, '$.catalog.active'), 1)=1 AND (? IS NULL OR d.account_id IN (SELECT CAST(value AS INTEGER) FROM json_each(?))))) OR (k.chunkable_type = 'note' AND ? IS NULL AND EXISTS (SELECT 1 FROM notes n WHERE n.id = k.chunkable_id AND n.deleted_at IS NULL)))";
|
|
30523
30695
|
var noteSearchOver = /* @__PURE__ */ __name((context) => {
|
|
30524
30696
|
const { database } = context;
|
|
30525
|
-
const
|
|
30526
|
-
const drain = /* @__PURE__ */ __name(() => drainNoteIndex(database,
|
|
30697
|
+
const stemmerFor2 = stemmerCache();
|
|
30698
|
+
const drain = /* @__PURE__ */ __name(() => drainNoteIndex(database, stemmerFor2), "drain");
|
|
30527
30699
|
const read2 = /* @__PURE__ */ __name((type, id2) => {
|
|
30528
30700
|
const row2 = database.prepare(`SELECT * FROM ${type === "document" ? "documents" : "notes"} WHERE id = ?`).get(id2);
|
|
30529
30701
|
return row2 ? type === "document" ? documentOf(row2) : noteOf(row2) : void 0;
|
|
@@ -30542,12 +30714,16 @@ var noteSearchOver = /* @__PURE__ */ __name((context) => {
|
|
|
30542
30714
|
drain();
|
|
30543
30715
|
return searchNotes(context, query);
|
|
30544
30716
|
}, "search"),
|
|
30717
|
+
matchingRefs: /* @__PURE__ */ __name(async (query) => {
|
|
30718
|
+
drain();
|
|
30719
|
+
return matchingNoteRefs(context, query);
|
|
30720
|
+
}, "matchingRefs"),
|
|
30545
30721
|
indexState: /* @__PURE__ */ __name(async () => noteIndexState(database), "indexState"),
|
|
30546
30722
|
chunksToEmbed: /* @__PURE__ */ __name(async (model, { after: after2, limit }) => {
|
|
30547
30723
|
drain();
|
|
30548
30724
|
const scope3 = live2(void 0, void 0);
|
|
30549
30725
|
const texts2 = /* @__PURE__ */ new Map();
|
|
30550
|
-
const
|
|
30726
|
+
const textOf6 = /* @__PURE__ */ __name((owner) => {
|
|
30551
30727
|
if (!texts2.has(owner)) {
|
|
30552
30728
|
const [type, id2] = owner.split(":");
|
|
30553
30729
|
const note2 = read2(String(type), Number(id2));
|
|
@@ -30560,7 +30736,7 @@ var noteSearchOver = /* @__PURE__ */ __name((context) => {
|
|
|
30560
30736
|
WHERE k.content_hash > ?${scope3.sql}
|
|
30561
30737
|
AND NOT EXISTS (SELECT 1 FROM embeddings v WHERE v.model = ? AND v.content_hash = k.content_hash)
|
|
30562
30738
|
GROUP BY k.content_hash ORDER BY k.content_hash LIMIT ?`).all(after2 ?? "", ...scope3.params, model, limit).flatMap((row2) => {
|
|
30563
|
-
const text5 =
|
|
30739
|
+
const text5 = textOf6(String(row2.owner));
|
|
30564
30740
|
return text5 === void 0 ? [] : [{ hash: String(row2.hash), text: text5.slice(Number(row2.start), Number(row2.end)) }];
|
|
30565
30741
|
});
|
|
30566
30742
|
}, "chunksToEmbed"),
|
|
@@ -30642,11 +30818,32 @@ var noteSearchOver = /* @__PURE__ */ __name((context) => {
|
|
|
30642
30818
|
const note2 = read2(String(type), Number(id2));
|
|
30643
30819
|
return note2 ? [{ ref: note2.ref, note: note2, score, range: { start, end } }] : [];
|
|
30644
30820
|
});
|
|
30645
|
-
}, "nearest")
|
|
30821
|
+
}, "nearest"),
|
|
30822
|
+
scoreNotes: /* @__PURE__ */ __name(async (model, query, refs) => {
|
|
30823
|
+
drain();
|
|
30824
|
+
const scope3 = live2(void 0, void 0, true);
|
|
30825
|
+
const owned = database.prepare(`SELECT k.chunkable_type AS type, k.chunkable_id AS owner, v.vector
|
|
30826
|
+
FROM chunks k JOIN embeddings v ON v.model = ? AND v.content_hash = k.content_hash
|
|
30827
|
+
WHERE k.chunkable_type = ? AND k.chunkable_id IN (SELECT value FROM json_each(?))${scope3.sql}`);
|
|
30828
|
+
const best = /* @__PURE__ */ new Map();
|
|
30829
|
+
for (const type of ["document", "note"]) {
|
|
30830
|
+
const ids = refs.flatMap((ref3) => ref3.startsWith(`${type}:`) ? [Number(ref3.slice(type.length + 1))] : []);
|
|
30831
|
+
if (!ids.length)
|
|
30832
|
+
continue;
|
|
30833
|
+
for (const row2 of owned.all(model, type, JSON.stringify(ids), ...scope3.params)) {
|
|
30834
|
+
const key2 = `${row2.type}:${row2.owner}`;
|
|
30835
|
+
const score = dot(query, row2.vector);
|
|
30836
|
+
if (score > (best.get(key2) ?? Number.NEGATIVE_INFINITY))
|
|
30837
|
+
best.set(key2, score);
|
|
30838
|
+
}
|
|
30839
|
+
}
|
|
30840
|
+
const order = new Map(refs.map((ref3, index2) => [ref3, index2]));
|
|
30841
|
+
return [...best].map(([ref3, score]) => ({ ref: ref3, score })).sort((a, b) => b.score - a.score || (order.get(a.ref) ?? 0) - (order.get(b.ref) ?? 0));
|
|
30842
|
+
}, "scoreNotes")
|
|
30646
30843
|
};
|
|
30647
30844
|
}, "noteSearchOver");
|
|
30648
30845
|
|
|
30649
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
30846
|
+
// 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/sqlite/event-search.js
|
|
30650
30847
|
var EVENT_FIELDS = ["text", "exact", "body", "title", "date", "in"];
|
|
30651
30848
|
var inEventAccounts = /* @__PURE__ */ __name((event) => searchableCopy(event, "c.account_id IN (SELECT CAST(value AS INTEGER) FROM json_each(?))"), "inEventAccounts");
|
|
30652
30849
|
var EVENT_CORPUS = {
|
|
@@ -30666,8 +30863,8 @@ var EVENT_CORPUS = {
|
|
|
30666
30863
|
var SCAN_PAGE4 = 5e3;
|
|
30667
30864
|
var eventSearchOver = /* @__PURE__ */ __name((context) => {
|
|
30668
30865
|
const { database } = context;
|
|
30669
|
-
const
|
|
30670
|
-
const drain = /* @__PURE__ */ __name(() => drainCorpus(database, CORPORA.event,
|
|
30866
|
+
const stemmerFor2 = stemmerCache();
|
|
30867
|
+
const drain = /* @__PURE__ */ __name(() => drainCorpus(database, CORPORA.event, stemmerFor2), "drain");
|
|
30671
30868
|
const live2 = /* @__PURE__ */ __name((accountIds) => {
|
|
30672
30869
|
const sql2 = ` AND k.chunkable_type = 'event' AND EXISTS (SELECT 1 FROM events e WHERE e.id = k.chunkable_id AND ${EVENT_LIVE})`;
|
|
30673
30870
|
return accountIds?.length ? { sql: `${sql2} AND ${inEventAccounts("k.chunkable_id")}`, params: [JSON.stringify(accountIds)] } : { sql: sql2, params: [] };
|
|
@@ -30778,7 +30975,7 @@ var eventSearchOver = /* @__PURE__ */ __name((context) => {
|
|
|
30778
30975
|
};
|
|
30779
30976
|
}, "eventSearchOver");
|
|
30780
30977
|
|
|
30781
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
30978
|
+
// 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/evidence-findings.js
|
|
30782
30979
|
var EVIDENCE_FINDINGS_KIND = "evidence_findings";
|
|
30783
30980
|
var reference = /* @__PURE__ */ __name((raw) => {
|
|
30784
30981
|
if (/^document:[1-9]\d*$/.test(raw))
|
|
@@ -30791,7 +30988,7 @@ var reference = /* @__PURE__ */ __name((raw) => {
|
|
|
30791
30988
|
}, "reference");
|
|
30792
30989
|
var validateEvidenceFindings = /* @__PURE__ */ __name((input) => validateFindings(input, { plural: "evidence findings", singular: "evidence finding", cited: "reference", reference }), "validateEvidenceFindings");
|
|
30793
30990
|
|
|
30794
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
30991
|
+
// 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/domain/moment.js
|
|
30795
30992
|
var calendarMoment = /* @__PURE__ */ __name((wanted, flag6, { zone, end = false } = {}) => {
|
|
30796
30993
|
try {
|
|
30797
30994
|
return zonedMoment(wanted, timezoneOf(zone), { start: 0, end: wanted.length }, { end });
|
|
@@ -30803,9 +31000,9 @@ var calendarMoment = /* @__PURE__ */ __name((wanted, flag6, { zone, end = false
|
|
|
30803
31000
|
}
|
|
30804
31001
|
}, "calendarMoment");
|
|
30805
31002
|
|
|
30806
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
31003
|
+
// 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/sqlite/facts.js
|
|
30807
31004
|
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";
|
|
30808
|
-
var
|
|
31005
|
+
var iso8 = /* @__PURE__ */ __name((value) => new Date(Number(value)).toISOString(), "iso");
|
|
30809
31006
|
var oneOf4 = /* @__PURE__ */ __name((value, allowed, what) => {
|
|
30810
31007
|
if (typeof value !== "string" || !allowed.includes(value))
|
|
30811
31008
|
throw new CliError("validation_error", `${what} is one of ${allowed.join(", ")}`);
|
|
@@ -30820,8 +31017,8 @@ var factOperationsOver = /* @__PURE__ */ __name((context) => {
|
|
|
30820
31017
|
statement: String(row2.statement),
|
|
30821
31018
|
status: row2.status,
|
|
30822
31019
|
project: row2.project_id == null ? null : `project:${row2.project_id}`,
|
|
30823
|
-
|
|
30824
|
-
occurredAt: row2.occurred_at == null ? null :
|
|
31020
|
+
...subjectOf(database, row2),
|
|
31021
|
+
occurredAt: row2.occurred_at == null ? null : iso8(row2.occurred_at),
|
|
30825
31022
|
supersedes: row2.supersedes_id == null ? null : `fact:${row2.supersedes_id}`,
|
|
30826
31023
|
author: authorOf(row2),
|
|
30827
31024
|
model: row2.model == null ? null : String(row2.model),
|
|
@@ -30829,8 +31026,8 @@ var factOperationsOver = /* @__PURE__ */ __name((context) => {
|
|
|
30829
31026
|
scope: row2.scope == null ? null : row2.scope,
|
|
30830
31027
|
source: String(row2.source),
|
|
30831
31028
|
evidence: evidenceOf(context, { type: "fact", id: Number(row2.id) }),
|
|
30832
|
-
createdAt:
|
|
30833
|
-
updatedAt:
|
|
31029
|
+
createdAt: iso8(row2.created_at),
|
|
31030
|
+
updatedAt: iso8(row2.updated_at)
|
|
30834
31031
|
}), "factOf");
|
|
30835
31032
|
const rowOf = /* @__PURE__ */ __name((reference2) => {
|
|
30836
31033
|
const thing = requiredThing(database, reference2.includes(":") ? reference2 : `fact:${reference2}`, "the fact");
|
|
@@ -30902,9 +31099,41 @@ var factOperationsOver = /* @__PURE__ */ __name((context) => {
|
|
|
30902
31099
|
throw new CliError("validation_error", "only an accepted decision can be reversed");
|
|
30903
31100
|
database.prepare("UPDATE facts SET status = 'reversed', updated_at = ? WHERE id = ?").run(now2(), Number(row2.id));
|
|
30904
31101
|
return factOf(rowOf(reference2));
|
|
30905
|
-
}, "reverse")
|
|
31102
|
+
}, "reverse"),
|
|
31103
|
+
reject: /* @__PURE__ */ __name((reference2) => {
|
|
31104
|
+
const row2 = rowOf(reference2);
|
|
31105
|
+
if (row2.status !== "proposed")
|
|
31106
|
+
throw new CliError("validation_error", `only a proposed fact can be rejected; this one is ${String(row2.status)}`);
|
|
31107
|
+
database.prepare("UPDATE facts SET status = 'rejected', updated_at = ? WHERE id = ?").run(now2(), Number(row2.id));
|
|
31108
|
+
return factOf(rowOf(reference2));
|
|
31109
|
+
}, "reject"),
|
|
31110
|
+
remove: /* @__PURE__ */ __name((reference2) => {
|
|
31111
|
+
const row2 = rowOf(reference2);
|
|
31112
|
+
const id2 = Number(row2.id);
|
|
31113
|
+
const twin = row2.source === "memory" && row2.metadata != null ? migratedFrom(String(row2.metadata)) : void 0;
|
|
31114
|
+
const links2 = erase(database, () => {
|
|
31115
|
+
database.prepare("UPDATE facts SET supersedes_id = NULL WHERE supersedes_id = ?").run(id2);
|
|
31116
|
+
const count = dropLinksOf(database, { type: "fact", id: id2 });
|
|
31117
|
+
database.prepare("DELETE FROM links WHERE from_type = 'fact' AND from_id = ?").run(id2);
|
|
31118
|
+
database.prepare("DELETE FROM taggings WHERE taggable_type = 'fact' AND taggable_id = ?").run(id2);
|
|
31119
|
+
database.prepare("DELETE FROM facts WHERE id = ?").run(id2);
|
|
31120
|
+
if (twin !== void 0)
|
|
31121
|
+
database.prepare("DELETE FROM memories WHERE id = ? AND deleted_at IS NOT NULL").run(twin);
|
|
31122
|
+
return count;
|
|
31123
|
+
});
|
|
31124
|
+
return { ref: `fact:${id2}`, removed: true, links: links2 };
|
|
31125
|
+
}, "remove"),
|
|
31126
|
+
sources: /* @__PURE__ */ __name((reference2) => evidenceSourcesOf(database, { type: "fact", id: Number(rowOf(reference2).id) }), "sources")
|
|
30906
31127
|
};
|
|
30907
31128
|
}, "factOperationsOver");
|
|
31129
|
+
var migratedFrom = /* @__PURE__ */ __name((metadata3) => {
|
|
31130
|
+
try {
|
|
31131
|
+
const { memory } = JSON.parse(metadata3);
|
|
31132
|
+
return Number.isInteger(memory) ? Number(memory) : void 0;
|
|
31133
|
+
} catch {
|
|
31134
|
+
return void 0;
|
|
31135
|
+
}
|
|
31136
|
+
}, "migratedFrom");
|
|
30908
31137
|
var factsStoreOver = /* @__PURE__ */ __name((context) => {
|
|
30909
31138
|
const operations = factOperationsOver(context);
|
|
30910
31139
|
return {
|
|
@@ -30912,11 +31141,14 @@ var factsStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
30912
31141
|
get: /* @__PURE__ */ __name(async (reference2) => operations.get(reference2), "get"),
|
|
30913
31142
|
list: /* @__PURE__ */ __name(async (options) => operations.list(options), "list"),
|
|
30914
31143
|
accept: /* @__PURE__ */ __name(async (reference2) => operations.accept(reference2), "accept"),
|
|
30915
|
-
reverse: /* @__PURE__ */ __name(async (reference2) => operations.reverse(reference2), "reverse")
|
|
31144
|
+
reverse: /* @__PURE__ */ __name(async (reference2) => operations.reverse(reference2), "reverse"),
|
|
31145
|
+
reject: /* @__PURE__ */ __name(async (reference2) => operations.reject(reference2), "reject"),
|
|
31146
|
+
remove: /* @__PURE__ */ __name(async (reference2) => operations.remove(reference2), "remove"),
|
|
31147
|
+
sources: /* @__PURE__ */ __name(async (reference2) => operations.sources(reference2), "sources")
|
|
30916
31148
|
};
|
|
30917
31149
|
}, "factsStoreOver");
|
|
30918
31150
|
|
|
30919
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
31151
|
+
// 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/sqlite/findings-core.js
|
|
30920
31152
|
var invalid4 = /* @__PURE__ */ __name((message2) => {
|
|
30921
31153
|
throw new CliError("validation_error", message2);
|
|
30922
31154
|
}, "invalid");
|
|
@@ -31006,10 +31238,10 @@ var findingsCoreOver = /* @__PURE__ */ __name((context, kind3) => {
|
|
|
31006
31238
|
return { snapshot: snapshot2, snapshotParts, previous, outcomes };
|
|
31007
31239
|
}, "findingsCoreOver");
|
|
31008
31240
|
|
|
31009
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
31241
|
+
// 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/sqlite/proposed-actions.js
|
|
31010
31242
|
var PROPOSAL_STATUSES = ["proposed", "approved", "rejected", "executed", "failed"];
|
|
31011
31243
|
var PROPOSAL_VERDICTS = ["useful", "not_useful"];
|
|
31012
|
-
var
|
|
31244
|
+
var iso9 = /* @__PURE__ */ __name((value) => value == null ? null : new Date(Number(value)).toISOString(), "iso");
|
|
31013
31245
|
var NAMED4 = "SELECT p.*, b.name AS proposer_name FROM proposed_actions p LEFT JOIN bots b ON p.proposed_by_type = 'bot' AND b.id = p.proposed_by_id";
|
|
31014
31246
|
var json2 = /* @__PURE__ */ __name((value) => value == null ? null : JSON.parse(String(value)), "json");
|
|
31015
31247
|
var proposalOperationsOver = /* @__PURE__ */ __name((context) => {
|
|
@@ -31030,12 +31262,12 @@ var proposalOperationsOver = /* @__PURE__ */ __name((context) => {
|
|
|
31030
31262
|
name: row2.proposer_name == null ? null : String(row2.proposer_name)
|
|
31031
31263
|
},
|
|
31032
31264
|
decidedBy: row2.decided_by_type == null ? null : { type: row2.decided_by_type, id: String(row2.decided_by_id) },
|
|
31033
|
-
decidedAt:
|
|
31034
|
-
executedAt:
|
|
31265
|
+
decidedAt: iso9(row2.decided_at),
|
|
31266
|
+
executedAt: iso9(row2.executed_at),
|
|
31035
31267
|
result: json2(row2.result),
|
|
31036
31268
|
error: row2.error == null ? null : String(row2.error),
|
|
31037
31269
|
verdict: row2.verdict ?? null,
|
|
31038
|
-
createdAt:
|
|
31270
|
+
createdAt: iso9(row2.created_at)
|
|
31039
31271
|
};
|
|
31040
31272
|
}, "actionOf");
|
|
31041
31273
|
const rowOf = /* @__PURE__ */ __name((id2) => {
|
|
@@ -31152,7 +31384,7 @@ var proposedActionsStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
31152
31384
|
};
|
|
31153
31385
|
}, "proposedActionsStoreOver");
|
|
31154
31386
|
|
|
31155
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
31387
|
+
// 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/sqlite/evidence-findings.js
|
|
31156
31388
|
var stale = /* @__PURE__ */ __name(() => {
|
|
31157
31389
|
throw new CliError("validation_error", "evidence findings changed since they were read; stage a new batch", {
|
|
31158
31390
|
reason: "evidence-findings.stale"
|
|
@@ -31318,7 +31550,7 @@ var evidenceFindingsStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
31318
31550
|
};
|
|
31319
31551
|
}, "evidenceFindingsStoreOver");
|
|
31320
31552
|
|
|
31321
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
31553
|
+
// 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/sqlite/involvements.js
|
|
31322
31554
|
var pendingInvolvements = /* @__PURE__ */ __name((database) => Number(database.prepare("SELECT count(*) AS n FROM involvement_pending").get()?.n ?? 0), "pendingInvolvements");
|
|
31323
31555
|
var involvementStoreOver = /* @__PURE__ */ __name(({ database, now: now2 }) => ({
|
|
31324
31556
|
rebuild: /* @__PURE__ */ __name((personId) => write(database, () => {
|
|
@@ -31371,7 +31603,7 @@ var involvementStoreOver = /* @__PURE__ */ __name(({ database, now: now2 }) => (
|
|
|
31371
31603
|
}, "forPerson")
|
|
31372
31604
|
}), "involvementStoreOver");
|
|
31373
31605
|
|
|
31374
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
31606
|
+
// 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/sqlite/meeting-projects.js
|
|
31375
31607
|
import { createHash as createHash12 } from "node:crypto";
|
|
31376
31608
|
var fields3 = "id,from_id,to_id,source,confirmed,updated_at,length(evidence) AS evidenceLength,substr(evidence,1,2000) AS evidence";
|
|
31377
31609
|
var id = /* @__PURE__ */ __name((value) => {
|
|
@@ -31457,16 +31689,16 @@ var meetingProjectsStoreOver = /* @__PURE__ */ __name(({ database, now: now2 })
|
|
|
31457
31689
|
};
|
|
31458
31690
|
}, "meetingProjectsStoreOver");
|
|
31459
31691
|
|
|
31460
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
31692
|
+
// 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/sqlite/vocabulary.js
|
|
31461
31693
|
import { createHash as createHash15 } from "node:crypto";
|
|
31462
31694
|
|
|
31463
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
31695
|
+
// 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/sqlite/tag-consolidation.js
|
|
31464
31696
|
import { createHash as createHash14 } from "node:crypto";
|
|
31465
31697
|
|
|
31466
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
31698
|
+
// 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/sqlite/tag-consolidation-apply.js
|
|
31467
31699
|
import { createHash as createHash13 } from "node:crypto";
|
|
31468
31700
|
|
|
31469
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
31701
|
+
// 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/sqlite/tag-consolidation-input.js
|
|
31470
31702
|
var consolidationId = /* @__PURE__ */ __name((value, field3) => {
|
|
31471
31703
|
if (typeof value !== "string" || !/^[1-9]\d*$/.test(value) || !Number.isSafeInteger(Number(value)))
|
|
31472
31704
|
throw new CliError("validation_error", `${field3} must be a positive canonical tag id`);
|
|
@@ -31517,7 +31749,7 @@ var consolidationApplyInput = /* @__PURE__ */ __name((options) => {
|
|
|
31517
31749
|
return input;
|
|
31518
31750
|
}, "consolidationApplyInput");
|
|
31519
31751
|
|
|
31520
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
31752
|
+
// 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/sqlite/tag-consolidation-apply.js
|
|
31521
31753
|
var receiptOf = /* @__PURE__ */ __name((row2) => ({
|
|
31522
31754
|
id: String(row2.id),
|
|
31523
31755
|
sourceId: String(row2.source_id),
|
|
@@ -31592,7 +31824,7 @@ var applyTagConsolidation = /* @__PURE__ */ __name((context, preview, options) =
|
|
|
31592
31824
|
}, { beforeCommit: check3 });
|
|
31593
31825
|
}, "applyTagConsolidation");
|
|
31594
31826
|
|
|
31595
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
31827
|
+
// 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/sqlite/tag-consolidation.js
|
|
31596
31828
|
var selections = [
|
|
31597
31829
|
["taggings", "tag_id IN (SELECT value FROM json_each(?))"],
|
|
31598
31830
|
["aliases", "aliasable_type='tag' AND aliasable_id IN (SELECT value FROM json_each(?))"],
|
|
@@ -31736,7 +31968,7 @@ var previewRows = /* @__PURE__ */ __name((context, options, source2, survivor, m
|
|
|
31736
31968
|
};
|
|
31737
31969
|
}, "previewRows");
|
|
31738
31970
|
|
|
31739
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
31971
|
+
// 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/sqlite/vocabulary.js
|
|
31740
31972
|
var kinds = ["project", "tag", "topic"];
|
|
31741
31973
|
var cancelled2 = /* @__PURE__ */ __name((signal) => {
|
|
31742
31974
|
if (signal?.aborted)
|
|
@@ -32000,18 +32232,18 @@ var vocabularyStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
32000
32232
|
};
|
|
32001
32233
|
}, "vocabularyStoreOver");
|
|
32002
32234
|
|
|
32003
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
32235
|
+
// 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/sqlite/knowledge.js
|
|
32004
32236
|
var TYPED_KEY_PREFIXES = new Set(Object.values(TASK_KEY_PREFIXES));
|
|
32005
32237
|
var ORGANIZATION_KINDS = ["company", "team", "family", "community"];
|
|
32006
32238
|
var PROJECT_TYPES = ["work", "client", "personal", "oss", "other"];
|
|
32007
32239
|
var SCOPES = ["personal", "work"];
|
|
32008
|
-
var
|
|
32240
|
+
var iso10 = /* @__PURE__ */ __name((value) => new Date(Number(value)).toISOString(), "iso");
|
|
32009
32241
|
var bounded2 = /* @__PURE__ */ __name((limit = 100, offset = 0) => {
|
|
32010
32242
|
if (!Number.isInteger(limit) || limit < 1 || limit > 500 || !Number.isInteger(offset) || offset < 0 || offset > 1e5)
|
|
32011
32243
|
throw new CliError("validation_error", "limit takes 1\u2013500 and offset takes 0\u2013100000");
|
|
32012
32244
|
return { limit, offset };
|
|
32013
32245
|
}, "bounded");
|
|
32014
|
-
var
|
|
32246
|
+
var textOf4 = /* @__PURE__ */ __name((text5, max = 1e5) => {
|
|
32015
32247
|
const value = text5.trim();
|
|
32016
32248
|
if (!value || value.length > max)
|
|
32017
32249
|
throw new CliError("validation_error", `text takes 1\u2013${max} characters`);
|
|
@@ -32138,8 +32370,8 @@ var knowledgeStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
32138
32370
|
text: String(row2.body),
|
|
32139
32371
|
revision: Number(row2.revision),
|
|
32140
32372
|
authoredBy: "owner",
|
|
32141
|
-
createdAt:
|
|
32142
|
-
updatedAt:
|
|
32373
|
+
createdAt: iso10(row2.created_at),
|
|
32374
|
+
updatedAt: iso10(row2.updated_at)
|
|
32143
32375
|
};
|
|
32144
32376
|
}, "annotationOf");
|
|
32145
32377
|
const noteRow = /* @__PURE__ */ __name((id2) => /^\d+$/.test(id2) ? database.prepare("SELECT * FROM notes WHERE id = ? AND deleted_at IS NULL").get(Number(id2)) : void 0, "noteRow");
|
|
@@ -32157,7 +32389,7 @@ var knowledgeStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
32157
32389
|
kind: row2.kind,
|
|
32158
32390
|
name: String(row2.name),
|
|
32159
32391
|
scope: row2.scope,
|
|
32160
|
-
createdAt:
|
|
32392
|
+
createdAt: iso10(row2.created_at)
|
|
32161
32393
|
}), "organizationOf");
|
|
32162
32394
|
const projectOf = /* @__PURE__ */ __name((row2) => ({
|
|
32163
32395
|
id: String(row2.id),
|
|
@@ -32168,7 +32400,7 @@ var knowledgeStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
32168
32400
|
type: row2.type,
|
|
32169
32401
|
organizationId: row2.organization_id == null ? null : String(row2.organization_id),
|
|
32170
32402
|
scope: row2.scope,
|
|
32171
|
-
createdAt:
|
|
32403
|
+
createdAt: iso10(row2.created_at)
|
|
32172
32404
|
}), "projectOf");
|
|
32173
32405
|
const relationOf = /* @__PURE__ */ __name((link3) => ({
|
|
32174
32406
|
id: link3.id,
|
|
@@ -32205,7 +32437,7 @@ var knowledgeStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
32205
32437
|
const reminderOf = /* @__PURE__ */ __name((row2) => ({
|
|
32206
32438
|
id: String(row2.id),
|
|
32207
32439
|
task: taskIdOf(database, Number(row2.task_id)) ?? String(row2.task_id),
|
|
32208
|
-
dueAt:
|
|
32440
|
+
dueAt: iso10(row2.due_at),
|
|
32209
32441
|
timezone: String(row2.timezone),
|
|
32210
32442
|
state: row2.state,
|
|
32211
32443
|
revision: Number(row2.revision),
|
|
@@ -32247,7 +32479,7 @@ var knowledgeStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
32247
32479
|
return { items: rows.slice(0, limit).map((row2) => String(row2.id ?? row2.key)), hasMore: rows.length > limit };
|
|
32248
32480
|
}, "taskIds"),
|
|
32249
32481
|
addAnnotation: /* @__PURE__ */ __name(async (key2, target, text5) => {
|
|
32250
|
-
const body2 =
|
|
32482
|
+
const body2 = textOf4(text5);
|
|
32251
32483
|
if (subfolder(target) !== null)
|
|
32252
32484
|
throw new CliError("validation_error", "annotate a folder, not one of its subfolders");
|
|
32253
32485
|
const thing = available(key2, target);
|
|
@@ -32272,7 +32504,7 @@ var knowledgeStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
32272
32504
|
annotation: /* @__PURE__ */ __name(async (key2, id2) => annotation(key2, id2), "annotation"),
|
|
32273
32505
|
editAnnotation: /* @__PURE__ */ __name(async (key2, id2, text5, revision2) => {
|
|
32274
32506
|
const held = annotation(key2, id2);
|
|
32275
|
-
const changed = database.prepare("UPDATE notes SET body=?, revision=revision+1, updated_at=? WHERE id=? AND revision=?").run(
|
|
32507
|
+
const changed = database.prepare("UPDATE notes SET body=?, revision=revision+1, updated_at=? WHERE id=? AND revision=?").run(textOf4(text5), now2(), Number(id2), revision2).changes;
|
|
32276
32508
|
if (!changed)
|
|
32277
32509
|
throw new CliError("validation_error", "annotation changed; read the current revision before editing");
|
|
32278
32510
|
database.prepare("INSERT INTO note_revisions (note_id, body, revision, created_at) VALUES (?, ?, ?, ?)").run(Number(id2), held.text, held.revision, now2());
|
|
@@ -32345,7 +32577,7 @@ var knowledgeStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
32345
32577
|
}, "labelled"),
|
|
32346
32578
|
addOrganization: /* @__PURE__ */ __name(async ({ kind: kind3, name, scope: scope3 = "personal" }) => {
|
|
32347
32579
|
const at = now2();
|
|
32348
|
-
const row2 = database.prepare("INSERT INTO organizations (kind, name, scope, created_at, updated_at) VALUES (?, ?, ?, ?, ?) RETURNING *").get(oneOf5(kind3, ORGANIZATION_KINDS, "an organization's kind"),
|
|
32580
|
+
const row2 = database.prepare("INSERT INTO organizations (kind, name, scope, created_at, updated_at) VALUES (?, ?, ?, ?, ?) RETURNING *").get(oneOf5(kind3, ORGANIZATION_KINDS, "an organization's kind"), textOf4(name, 200), oneOf5(scope3, SCOPES, "a scope"), at, at);
|
|
32349
32581
|
return organizationOf(row2);
|
|
32350
32582
|
}, "addOrganization"),
|
|
32351
32583
|
organizations: /* @__PURE__ */ __name(async (query) => {
|
|
@@ -32358,7 +32590,7 @@ var knowledgeStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
32358
32590
|
return database.prepare(`SELECT * FROM organizations WHERE deleted_at IS NULL${where ? ` AND (${where.sql})` : ""} ORDER BY name, id LIMIT 500`).all(...where?.params ?? []).map(organizationOf);
|
|
32359
32591
|
}, "organizations"),
|
|
32360
32592
|
addProject: /* @__PURE__ */ __name(async ({ name, key: key2, type = "other", organization, scope: scope3 = "personal", description }) => write(database, () => {
|
|
32361
|
-
const title =
|
|
32593
|
+
const title = textOf4(name, 200);
|
|
32362
32594
|
const organizationId = organization === void 0 ? null : (() => {
|
|
32363
32595
|
const thing = thingOf(database, organization);
|
|
32364
32596
|
if (thing?.type !== "organization")
|
|
@@ -32393,7 +32625,7 @@ var knowledgeStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
32393
32625
|
chosen = `${wanted.slice(0, 4 - suffix.length)}${suffix}`;
|
|
32394
32626
|
}
|
|
32395
32627
|
const at = now2();
|
|
32396
|
-
const row2 = database.prepare("INSERT INTO projects (key, name, name_folded, description, type, organization_id, scope, tasks_count, status, created_at, updated_at) VALUES (?, ?, ?, ?, ?, ?, ?, 0, 'active', ?, ?) RETURNING *").get(chosen, title, fold(title), description === void 0 ? null :
|
|
32628
|
+
const row2 = database.prepare("INSERT INTO projects (key, name, name_folded, description, type, organization_id, scope, tasks_count, status, created_at, updated_at) VALUES (?, ?, ?, ?, ?, ?, ?, 0, 'active', ?, ?) RETURNING *").get(chosen, title, fold(title), description === void 0 ? null : textOf4(description, 2e3), oneOf5(type, PROJECT_TYPES, "a project's type"), organizationId, oneOf5(scope3, SCOPES, "a scope"), at, at);
|
|
32397
32629
|
return projectOf(row2);
|
|
32398
32630
|
}), "addProject"),
|
|
32399
32631
|
projects: /* @__PURE__ */ __name(async (query) => {
|
|
@@ -32522,7 +32754,7 @@ var projectKey = /* @__PURE__ */ __name((name) => {
|
|
|
32522
32754
|
return key2.padEnd(3, "X");
|
|
32523
32755
|
}, "projectKey");
|
|
32524
32756
|
|
|
32525
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
32757
|
+
// 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/sqlite/log-pruning.js
|
|
32526
32758
|
var DAY5 = 864e5;
|
|
32527
32759
|
var SETTING4 = "logs_pruned_at";
|
|
32528
32760
|
var LOG_RETENTION = { agentActionsMs: 90 * DAY5, botUpdatePayloadsMs: 30 * DAY5 };
|
|
@@ -32549,7 +32781,7 @@ var logPruner = /* @__PURE__ */ __name((database, now2) => {
|
|
|
32549
32781
|
};
|
|
32550
32782
|
}, "logPruner");
|
|
32551
32783
|
|
|
32552
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
32784
|
+
// 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/sqlite/meeting-findings.js
|
|
32553
32785
|
var stale2 = /* @__PURE__ */ __name(() => {
|
|
32554
32786
|
throw new CliError("validation_error", "meeting findings changed since they were read; stage a new batch", {
|
|
32555
32787
|
reason: "meeting-findings.stale"
|
|
@@ -32718,7 +32950,7 @@ var meetingFindingsStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
32718
32950
|
};
|
|
32719
32951
|
}, "meetingFindingsStoreOver");
|
|
32720
32952
|
|
|
32721
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
32953
|
+
// 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/sqlite/meeting-vectors.js
|
|
32722
32954
|
var RANK_BATCH = 512;
|
|
32723
32955
|
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";
|
|
32724
32956
|
var limitOf = /* @__PURE__ */ __name((value, name, max = 1e3) => {
|
|
@@ -32738,7 +32970,7 @@ var modelOf = /* @__PURE__ */ __name((model) => {
|
|
|
32738
32970
|
var missing3 = /* @__PURE__ */ __name(() => {
|
|
32739
32971
|
throw new CliError("not_found", "Current transcript not found");
|
|
32740
32972
|
}, "missing");
|
|
32741
|
-
var
|
|
32973
|
+
var textOf5 = /* @__PURE__ */ __name((context, accountId, transcriptId, budget, signal) => {
|
|
32742
32974
|
const maxRows = limitOf(budget.maxRows ?? 1e4, "maxRows", 1e5);
|
|
32743
32975
|
const maxBytes = limitOf(budget.maxTextBytes ?? 4 * 1024 * 1024, "maxTextBytes", 64 * 1024 * 1024);
|
|
32744
32976
|
const parent2 = context.database.prepare("SELECT m.id AS meeting_id FROM meeting_transcripts t JOIN meetings m ON m.id=t.meeting_id WHERE t.id=? AND m.account_id=? AND m.deleted_at IS NULL AND t.deleted_at IS NULL AND t.superseded_at IS NULL").get(transcriptId, accountId) ?? missing3();
|
|
@@ -32772,14 +33004,14 @@ var textLoader = /* @__PURE__ */ __name((context, input) => {
|
|
|
32772
33004
|
return existing;
|
|
32773
33005
|
if (remaining <= 0)
|
|
32774
33006
|
throw new CliError("validation_error", "Vector operation exceeds its aggregate text read budget");
|
|
32775
|
-
const document =
|
|
33007
|
+
const document = textOf5(context, input.accountId, id2, { ...input, maxTextBytes: remaining }, input.signal);
|
|
32776
33008
|
remaining -= document.readBytes;
|
|
32777
33009
|
loaded3.set(id2, document);
|
|
32778
33010
|
return document;
|
|
32779
33011
|
};
|
|
32780
33012
|
}, "textLoader");
|
|
32781
33013
|
var chunkText = /* @__PURE__ */ __name((context, accountId, row2, budget, signal, loaded3) => {
|
|
32782
|
-
const document = loaded3 ??
|
|
33014
|
+
const document = loaded3 ?? textOf5(context, accountId, Number(row2.chunkable_id), budget, signal);
|
|
32783
33015
|
const start = Number(row2.start_offset), end = Number(row2.end_offset);
|
|
32784
33016
|
const text5 = document.text.slice(start, end);
|
|
32785
33017
|
if (chunkHash(text5) !== String(row2.content_hash))
|
|
@@ -32989,7 +33221,7 @@ var meetingVectorsOver = /* @__PURE__ */ __name((context) => ({
|
|
|
32989
33221
|
}
|
|
32990
33222
|
}), "meetingVectorsOver");
|
|
32991
33223
|
|
|
32992
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
33224
|
+
// 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/sqlite/mention-sources.js
|
|
32993
33225
|
var OTHER_SOURCES = ["document", "note", "email"];
|
|
32994
33226
|
var TEXTS = {
|
|
32995
33227
|
document: "JOIN documents s ON mn.source_type = 'document' AND s.id = mn.source_id AND s.deleted_at IS NULL WHERE 1 ",
|
|
@@ -33090,11 +33322,11 @@ var sourceMentionStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
33090
33322
|
};
|
|
33091
33323
|
}, "sourceMentionStoreOver");
|
|
33092
33324
|
|
|
33093
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
33325
|
+
// 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/sqlite/open-store.js
|
|
33094
33326
|
import { mkdirSync, statSync, writeFileSync } from "node:fs";
|
|
33095
33327
|
import { dirname } from "node:path";
|
|
33096
33328
|
|
|
33097
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
33329
|
+
// 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/sqlite/clients.js
|
|
33098
33330
|
import { readFileSync as readFileSync3 } from "node:fs";
|
|
33099
33331
|
var CLIENTS_SETTING = "clients";
|
|
33100
33332
|
var coreVersion = (() => {
|
|
@@ -33152,7 +33384,7 @@ var refusalAdvice = /* @__PURE__ */ __name((clients, command, schema) => {
|
|
|
33152
33384
|
return mover ? `${own} (${mover.command} ${mover.version} moved the store to schema ${schema})` : own;
|
|
33153
33385
|
}, "refusalAdvice");
|
|
33154
33386
|
|
|
33155
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
33387
|
+
// 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/sqlite/migrations.generated.js
|
|
33156
33388
|
var GENERATED = [
|
|
33157
33389
|
{
|
|
33158
33390
|
"name": "20261010184427_initial",
|
|
@@ -34018,7 +34250,7 @@ WHERE json_type(params, '$.selection') = 'object';`
|
|
|
34018
34250
|
}
|
|
34019
34251
|
];
|
|
34020
34252
|
|
|
34021
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34253
|
+
// 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/sqlite/manifest.js
|
|
34022
34254
|
var MANIFEST = [
|
|
34023
34255
|
{ name: "20261010184427_initial", version: 1, minCompatible: 1 },
|
|
34024
34256
|
{ name: "20261011035353_version-2-facts", version: 2, minCompatible: 1 },
|
|
@@ -34096,7 +34328,7 @@ var generatedMigrations = /* @__PURE__ */ __name((manifest = MANIFEST, generated
|
|
|
34096
34328
|
return migrations;
|
|
34097
34329
|
}, "generatedMigrations");
|
|
34098
34330
|
|
|
34099
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34331
|
+
// 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/migrations.js
|
|
34100
34332
|
var MIGRATIONS = generatedMigrations();
|
|
34101
34333
|
var HISTORY = `CREATE TABLE IF NOT EXISTS schema_migrations (
|
|
34102
34334
|
version INTEGER PRIMARY KEY,
|
|
@@ -34149,7 +34381,7 @@ var migrate = /* @__PURE__ */ __name((database, { migrations = MIGRATIONS, now:
|
|
|
34149
34381
|
}
|
|
34150
34382
|
}, "migrate");
|
|
34151
34383
|
|
|
34152
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34384
|
+
// 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/sqlite/join-keys.js
|
|
34153
34385
|
var fillJoinKeys = /* @__PURE__ */ __name((database, { batch = 2e3 } = {}) => {
|
|
34154
34386
|
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 ?");
|
|
34155
34387
|
if (pending.get(0, 1) === void 0)
|
|
@@ -34171,7 +34403,7 @@ var fillJoinKeys = /* @__PURE__ */ __name((database, { batch = 2e3 } = {}) => {
|
|
|
34171
34403
|
}
|
|
34172
34404
|
}, "fillJoinKeys");
|
|
34173
34405
|
|
|
34174
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34406
|
+
// 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/sqlite/open.js
|
|
34175
34407
|
var openSqlite = /* @__PURE__ */ __name(async (path, { readOnly = false } = {}) => {
|
|
34176
34408
|
const opened = "Bun" in globalThis ? await openUnderBun(path, readOnly) : await openUnderNode(path, readOnly);
|
|
34177
34409
|
try {
|
|
@@ -34184,8 +34416,8 @@ var openSqlite = /* @__PURE__ */ __name(async (path, { readOnly = false } = {})
|
|
|
34184
34416
|
}, "openSqlite");
|
|
34185
34417
|
var openUnderNode = /* @__PURE__ */ __name(async (path, readOnly) => {
|
|
34186
34418
|
quietSqliteWarning();
|
|
34187
|
-
const { drizzle } = await import("./node-
|
|
34188
|
-
const { cacheOverNodeSqlite, nodeClient } = await import("./node-sqlite-
|
|
34419
|
+
const { drizzle } = await import("./node-XN4PIVWW.js");
|
|
34420
|
+
const { cacheOverNodeSqlite, nodeClient } = await import("./node-sqlite-PCBGROGQ.js");
|
|
34189
34421
|
const client = await nodeClient(path, { readOnly });
|
|
34190
34422
|
try {
|
|
34191
34423
|
return { database: cacheOverNodeSqlite(client), orm: drizzle({ client }) };
|
|
@@ -34195,8 +34427,8 @@ var openUnderNode = /* @__PURE__ */ __name(async (path, readOnly) => {
|
|
|
34195
34427
|
}
|
|
34196
34428
|
}, "openUnderNode");
|
|
34197
34429
|
var openUnderBun = /* @__PURE__ */ __name(async (path, readOnly) => {
|
|
34198
|
-
const { bunClient, cacheOverBunSqlite } = await import("./bun-sqlite-
|
|
34199
|
-
const { drizzle } = await import("./bun-
|
|
34430
|
+
const { bunClient, cacheOverBunSqlite } = await import("./bun-sqlite-M6JEXKRT.js");
|
|
34431
|
+
const { drizzle } = await import("./bun-WXGS6HML.js");
|
|
34200
34432
|
const client = await bunClient(path, readOnly ? { readonly: true, create: false } : void 0);
|
|
34201
34433
|
try {
|
|
34202
34434
|
return { database: cacheOverBunSqlite(client), orm: drizzle({ client }) };
|
|
@@ -34206,7 +34438,7 @@ var openUnderBun = /* @__PURE__ */ __name(async (path, readOnly) => {
|
|
|
34206
34438
|
}
|
|
34207
34439
|
}, "openUnderBun");
|
|
34208
34440
|
|
|
34209
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34441
|
+
// 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/sqlite/read-compatibility.js
|
|
34210
34442
|
var assertReadCompatible = /* @__PURE__ */ __name((database, command) => {
|
|
34211
34443
|
const ours = MIGRATIONS.at(-1)?.version ?? 0;
|
|
34212
34444
|
if (!database.prepare("SELECT 1 FROM sqlite_master WHERE type='table' AND name='schema_migrations'").get())
|
|
@@ -34221,7 +34453,7 @@ var assertReadCompatible = /* @__PURE__ */ __name((database, command) => {
|
|
|
34221
34453
|
throw new CliError("configuration_error", `The store requires schema ${minCompatible}, but this tool supports ${ours}; ${refusalAdvice(storeClients(database), command, version)}`);
|
|
34222
34454
|
}, "assertReadCompatible");
|
|
34223
34455
|
|
|
34224
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34456
|
+
// 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/sqlite/open-store.js
|
|
34225
34457
|
var BACKFILL_ON_OPEN = 5e3;
|
|
34226
34458
|
var NOT_WRITABLE = /* @__PURE__ */ new Set(["EACCES", "EPERM", "EROFS"]);
|
|
34227
34459
|
var createWritable = /* @__PURE__ */ __name((file) => {
|
|
@@ -34277,10 +34509,10 @@ var openStoreContext = /* @__PURE__ */ __name(async ({ path, env, now: now2 = Da
|
|
|
34277
34509
|
}
|
|
34278
34510
|
}, "openStoreContext");
|
|
34279
34511
|
|
|
34280
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34512
|
+
// 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/project-transfer/plan.js
|
|
34281
34513
|
import { createHash as createHash16 } from "node:crypto";
|
|
34282
34514
|
|
|
34283
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34515
|
+
// 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/project-transfer/schema.js
|
|
34284
34516
|
var text3 = /* @__PURE__ */ __name((max) => pipe(string(), minLength(1), maxLength(max)), "text");
|
|
34285
34517
|
var ref = text3(2048);
|
|
34286
34518
|
var timestamp2 = pipe(number(), safeInteger(), minValue(0));
|
|
@@ -34346,7 +34578,7 @@ var projectAnnotationsSchema = strictObject({
|
|
|
34346
34578
|
}))
|
|
34347
34579
|
});
|
|
34348
34580
|
|
|
34349
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34581
|
+
// 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/project-transfer/manifest.js
|
|
34350
34582
|
var PROJECT_ANNOTATIONS_MAX_BYTES = 4 * 1024 * 1024;
|
|
34351
34583
|
var invalid7 = /* @__PURE__ */ __name((field3) => {
|
|
34352
34584
|
throw new CliError("validation_error", `invalid project annotations.${field3}`);
|
|
@@ -34450,7 +34682,7 @@ var validateProjectAnnotationsGraph = /* @__PURE__ */ __name((manifest, addition
|
|
|
34450
34682
|
invalid7("external.unused");
|
|
34451
34683
|
}, "validateProjectAnnotationsGraph");
|
|
34452
34684
|
|
|
34453
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34685
|
+
// 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/project-transfer/plan.js
|
|
34454
34686
|
var hash = pipe(string(), regex(/^[a-f0-9]{64}$/));
|
|
34455
34687
|
var ref2 = pipe(string(), minLength(1), maxLength(2048));
|
|
34456
34688
|
var targetSchema = strictObject({
|
|
@@ -34556,7 +34788,7 @@ var planBoundProjectAnnotations = /* @__PURE__ */ __name((manifest, manifest_fin
|
|
|
34556
34788
|
};
|
|
34557
34789
|
}, "planBoundProjectAnnotations");
|
|
34558
34790
|
|
|
34559
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34791
|
+
// 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/project-transfer/snapshot-model.js
|
|
34560
34792
|
import { createHash as createHash17 } from "node:crypto";
|
|
34561
34793
|
var text4 = /* @__PURE__ */ __name((max) => pipe(string(), minLength(1), maxLength(max)), "text");
|
|
34562
34794
|
var timestamp3 = pipe(number(), safeInteger(), minValue(0));
|
|
@@ -34650,7 +34882,7 @@ var projectAnnotationSnapshotFingerprint = /* @__PURE__ */ __name((json3) => {
|
|
|
34650
34882
|
})).digest("hex");
|
|
34651
34883
|
}, "projectAnnotationSnapshotFingerprint");
|
|
34652
34884
|
|
|
34653
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34885
|
+
// 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/project-transfer/request.js
|
|
34654
34886
|
var projectAnnotationRequest = /* @__PURE__ */ __name((request, restore = false) => {
|
|
34655
34887
|
if (!request || typeof request !== "object" || Array.isArray(request))
|
|
34656
34888
|
throw new CliError("validation_error", "project annotation request is required");
|
|
@@ -34667,7 +34899,7 @@ var projectAnnotationRequest = /* @__PURE__ */ __name((request, restore = false)
|
|
|
34667
34899
|
return { snapshot: snapshot2, projectId: Number(request.project.slice(8)) };
|
|
34668
34900
|
}, "projectAnnotationRequest");
|
|
34669
34901
|
|
|
34670
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34902
|
+
// 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/sqlite/project-transfer/budget.js
|
|
34671
34903
|
var SnapshotBudget = class {
|
|
34672
34904
|
static {
|
|
34673
34905
|
__name(this, "SnapshotBudget");
|
|
@@ -34693,13 +34925,13 @@ var SnapshotBudget = class {
|
|
|
34693
34925
|
}
|
|
34694
34926
|
};
|
|
34695
34927
|
|
|
34696
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34928
|
+
// 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/sqlite/project-transfer/preview.js
|
|
34697
34929
|
import { createHash as createHash19 } from "node:crypto";
|
|
34698
34930
|
|
|
34699
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34931
|
+
// 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/project-transfer/snapshot-plan.js
|
|
34700
34932
|
var planProjectAnnotationSnapshot = /* @__PURE__ */ __name((json3, target, bindings) => planBoundProjectAnnotations(decodeProjectAnnotationSnapshot(json3), projectAnnotationSnapshotFingerprint(json3), target, bindings), "planProjectAnnotationSnapshot");
|
|
34701
34933
|
|
|
34702
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34934
|
+
// 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/sqlite/project-transfer/sources.js
|
|
34703
34935
|
import { createHash as createHash18 } from "node:crypto";
|
|
34704
34936
|
var invalid9 = /* @__PURE__ */ __name(() => {
|
|
34705
34937
|
throw new CliError("configuration_error", "project snapshot has an unavailable or unsupported dependency");
|
|
@@ -34842,7 +35074,7 @@ var ProjectSnapshotSources = class {
|
|
|
34842
35074
|
}
|
|
34843
35075
|
};
|
|
34844
35076
|
|
|
34845
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
35077
|
+
// 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/sqlite/project-transfer/snapshot.js
|
|
34846
35078
|
var unsupported = /* @__PURE__ */ __name(() => {
|
|
34847
35079
|
throw new CliError("configuration_error", "project snapshot has unsupported metadata, deletion or account scope");
|
|
34848
35080
|
}, "unsupported");
|
|
@@ -35013,7 +35245,7 @@ var projectAnnotationSnapshot = /* @__PURE__ */ __name((database, projectId, bud
|
|
|
35013
35245
|
return { snapshot: snapshot2, read_bytes: budget.bytes, records: budget.records };
|
|
35014
35246
|
}), "projectAnnotationSnapshot");
|
|
35015
35247
|
|
|
35016
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
35248
|
+
// 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/sqlite/project-transfer/preview.js
|
|
35017
35249
|
var previewAnnotationSnapshot = /* @__PURE__ */ __name((database, projectId, manifest, bindings, budget) => read(database, () => {
|
|
35018
35250
|
const current = projectAnnotationSnapshot(database, projectId, budget).snapshot;
|
|
35019
35251
|
const sources = new ProjectSnapshotSources(database, budget);
|
|
@@ -35075,7 +35307,7 @@ var previewAnnotationSnapshot = /* @__PURE__ */ __name((database, projectId, man
|
|
|
35075
35307
|
};
|
|
35076
35308
|
}), "previewAnnotationSnapshot");
|
|
35077
35309
|
|
|
35078
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
35310
|
+
// 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/sqlite/project-transfer/records.js
|
|
35079
35311
|
var restoreAnnotationRecords = /* @__PURE__ */ __name((database, projectId, snapshot2, bindings) => {
|
|
35080
35312
|
const mappings = { ...bindings };
|
|
35081
35313
|
const resolve = /* @__PURE__ */ __name((ref3) => {
|
|
@@ -35117,7 +35349,7 @@ var restoreAnnotationRecords = /* @__PURE__ */ __name((database, projectId, snap
|
|
|
35117
35349
|
return mappings;
|
|
35118
35350
|
}, "restoreAnnotationRecords");
|
|
35119
35351
|
|
|
35120
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
35352
|
+
// 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/sqlite/project-transfer/store.js
|
|
35121
35353
|
var projectAnnotationStoreOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
35122
35354
|
async preview(request) {
|
|
35123
35355
|
const { snapshot: snapshot2, projectId } = projectAnnotationRequest(request);
|
|
@@ -35147,7 +35379,7 @@ var projectAnnotationStoreOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
|
35147
35379
|
}
|
|
35148
35380
|
}), "projectAnnotationStoreOver");
|
|
35149
35381
|
|
|
35150
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
35382
|
+
// 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/sqlite/ranges.js
|
|
35151
35383
|
var markRange = /* @__PURE__ */ __name(({ orm, now: now2 }, chatKey, from2, to) => {
|
|
35152
35384
|
const touching = and(eq(syncRanges.chatId, chatKey), lte(syncRanges.fromKey, to + 1), gte(syncRanges.toKey, from2 - 1));
|
|
35153
35385
|
let merged = { from: from2, to };
|
|
@@ -35160,7 +35392,7 @@ var markRange = /* @__PURE__ */ __name(({ orm, now: now2 }, chatKey, from2, to)
|
|
|
35160
35392
|
}, "markRange");
|
|
35161
35393
|
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");
|
|
35162
35394
|
|
|
35163
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
35395
|
+
// 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/sqlite/task-rule-stops.js
|
|
35164
35396
|
var keyOf4 = /* @__PURE__ */ __name(({ provider, account }) => `task_rules_until:${provider}:${account}`, "keyOf");
|
|
35165
35397
|
var taskRulesStop = /* @__PURE__ */ __name((database, account) => {
|
|
35166
35398
|
const row2 = database.prepare("SELECT value FROM store_settings WHERE key = ?").get(keyOf4(account));
|
|
@@ -35170,7 +35402,7 @@ var setTaskRulesStop = /* @__PURE__ */ __name((database, account, until, now2) =
|
|
|
35170
35402
|
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);
|
|
35171
35403
|
}, "setTaskRulesStop");
|
|
35172
35404
|
|
|
35173
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
35405
|
+
// 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/sync.js
|
|
35174
35406
|
var syncStoreOver = /* @__PURE__ */ __name((context) => {
|
|
35175
35407
|
const { database } = context;
|
|
35176
35408
|
const { accountPk: accountPk2, findAccountPk: findAccountPk2, chatKeyOf, chatPkFor: chatPkFor2, identityPk: identityPk2, writeMembers: writeMembers2, writeState: writeState2 } = keysOver(context);
|
|
@@ -35226,7 +35458,7 @@ var syncStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
35226
35458
|
};
|
|
35227
35459
|
}, "syncStoreOver");
|
|
35228
35460
|
|
|
35229
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
35461
|
+
// 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/tags.js
|
|
35230
35462
|
var tagsStoreOver = /* @__PURE__ */ __name((context) => {
|
|
35231
35463
|
const { database } = context;
|
|
35232
35464
|
return {
|
|
@@ -35248,7 +35480,7 @@ var tagsStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
35248
35480
|
};
|
|
35249
35481
|
}, "tagsStoreOver");
|
|
35250
35482
|
|
|
35251
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
35483
|
+
// 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/sqlite/image-chunks.js
|
|
35252
35484
|
var IS_IMAGE = sql`(a.kind = 'photo' OR a.mime LIKE 'image/%')`;
|
|
35253
35485
|
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
|
|
35254
35486
|
WHERE chat_id = ${chatKey} AND deleted_at IS NULL AND trim(text) <> '' AND id <> ${messagePk}
|
|
@@ -35375,7 +35607,7 @@ var savePictureChunks = /* @__PURE__ */ __name(({ orm, now: now2, database }, ac
|
|
|
35375
35607
|
dropUnusedVectors(database, released.map(({ hash: hash2 }) => hash2));
|
|
35376
35608
|
}, "savePictureChunks");
|
|
35377
35609
|
|
|
35378
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
35610
|
+
// 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/sqlite/message-chunks.js
|
|
35379
35611
|
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,
|
|
35380
35612
|
EXISTS (SELECT 1 FROM embeddings v WHERE v.model = ${model} AND v.content_hash = k.content_hash) AS embedded
|
|
35381
35613
|
FROM messages m
|
|
@@ -35458,7 +35690,7 @@ var nearestMessages = /* @__PURE__ */ __name((context, accountPk2, { limit, quer
|
|
|
35458
35690
|
return plain2(best(found2));
|
|
35459
35691
|
}, "nearestMessages");
|
|
35460
35692
|
|
|
35461
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
35693
|
+
// 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/vectors.js
|
|
35462
35694
|
var accountVectorsOver = /* @__PURE__ */ __name((context, mail) => {
|
|
35463
35695
|
const { database } = context;
|
|
35464
35696
|
const { findAccountPk: findAccountPk2, findChatPk: findChatPk2, chatKeyOf } = keysOver(context);
|
|
@@ -35712,7 +35944,7 @@ var vectorsStoreOver = /* @__PURE__ */ __name((context, keyed) => ({
|
|
|
35712
35944
|
embeddedHashes: /* @__PURE__ */ __name(async (model, hashes) => embeddedHashes(context, model, hashes), "embeddedHashes")
|
|
35713
35945
|
}), "vectorsStoreOver");
|
|
35714
35946
|
|
|
35715
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
35947
|
+
// 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/sqlite/store-tables.js
|
|
35716
35948
|
import { existsSync, readFileSync as readFileSync4 } from "node:fs";
|
|
35717
35949
|
import { dirname as dirname2, join as join2 } from "node:path";
|
|
35718
35950
|
var BOOKKEEPING = ["schema_migrations", "store_settings"];
|
|
@@ -35800,10 +36032,10 @@ var lastBackup = /* @__PURE__ */ __name((path) => {
|
|
|
35800
36032
|
}
|
|
35801
36033
|
}, "lastBackup");
|
|
35802
36034
|
|
|
35803
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
36035
|
+
// 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/providers.js
|
|
35804
36036
|
var registerProvider2 = /* @__PURE__ */ __name((store, entry2) => store.accounts.registerProvider(entry2), "registerProvider");
|
|
35805
36037
|
|
|
35806
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
36038
|
+
// 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/sqlite/store-contents.js
|
|
35807
36039
|
var COUNTED_TABLES = [
|
|
35808
36040
|
"accounts",
|
|
35809
36041
|
"chats",
|
|
@@ -35888,7 +36120,7 @@ var storeContents = /* @__PURE__ */ __name((database) => {
|
|
|
35888
36120
|
};
|
|
35889
36121
|
}, "storeContents");
|
|
35890
36122
|
|
|
35891
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
36123
|
+
// 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/store.js
|
|
35892
36124
|
var openStore = /* @__PURE__ */ __name(async (options = {}) => {
|
|
35893
36125
|
const context = await openStoreContext(options);
|
|
35894
36126
|
try {
|
|
@@ -35911,10 +36143,10 @@ var areaOf = /* @__PURE__ */ __name((keyed, whole) => once3(() => {
|
|
|
35911
36143
|
}), "areaOf");
|
|
35912
36144
|
var storeOver = /* @__PURE__ */ __name((context) => {
|
|
35913
36145
|
const { database } = context;
|
|
35914
|
-
const
|
|
36146
|
+
const stemmerFor2 = stemmerCache();
|
|
35915
36147
|
const pruneLogsWhenDue = logPruner(database, context.now);
|
|
35916
36148
|
const own = /* @__PURE__ */ __name((keyed) => ({ ...keyed }), "own");
|
|
35917
|
-
const mail = once3(() => mailStoreOver(context,
|
|
36149
|
+
const mail = once3(() => mailStoreOver(context, stemmerFor2));
|
|
35918
36150
|
const areas = {
|
|
35919
36151
|
accounts: areaOf(() => accountAccountsOver(context), (keyed) => accountsStoreOver(context, keyed)),
|
|
35920
36152
|
chats: areaOf(() => chatsStoreOver(context), own),
|
|
@@ -35931,10 +36163,10 @@ var storeOver = /* @__PURE__ */ __name((context) => {
|
|
|
35931
36163
|
};
|
|
35932
36164
|
const contextEvidence = once3(() => contextEvidenceOver(context));
|
|
35933
36165
|
const projectAnnotations = once3(() => projectAnnotationStoreOver(context));
|
|
35934
|
-
const contextIndex = once3(() => contextIndexOver(context,
|
|
36166
|
+
const contextIndex = once3(() => contextIndexOver(context, stemmerFor2));
|
|
35935
36167
|
const contextRecords = once3(() => contextRecordsOver(context));
|
|
35936
36168
|
const searches2 = once3(() => searchesStoreOver(context));
|
|
35937
|
-
const queries = once3(() => queriesStoreOver(context,
|
|
36169
|
+
const queries = once3(() => queriesStoreOver(context, stemmerFor2));
|
|
35938
36170
|
const searchIndex2 = once3(() => searchIndexStoreOver(context));
|
|
35939
36171
|
const botUpdates2 = once3(() => botUpdateStoreOver(context, pruneLogsWhenDue));
|
|
35940
36172
|
const involvements2 = once3(() => involvementStoreOver(context));
|