@wirecat/tg-cli 0.134.0 → 0.135.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-Y4IXTXAG.js → adapter-OHJF6PB5.js} +67 -67
- package/dist/bundle/agent-QPF2KU4I.js +37 -0
- package/dist/bundle/{all-profiles-SUGID6CX.js → all-profiles-LQ73BIFB.js} +10 -10
- package/dist/bundle/{anthropic-4QKTXT4B.js → anthropic-YYBMT2HD.js} +5 -5
- package/dist/bundle/{app-server-TPOD6LIJ.js → app-server-HV4C4CSA.js} +61 -61
- package/dist/bundle/{bot-api-KBESP422.js → bot-api-URQXWMVR.js} +67 -67
- package/dist/bundle/{bot-history-3EORA23G.js → bot-history-FRLCHPDQ.js} +23 -23
- package/dist/bundle/{bun-FL76M4M2.js → bun-J3ML43BO.js} +2 -2
- package/dist/bundle/{bun-sqlite-H37OSTAJ.js → bun-sqlite-ZNB2B2DL.js} +6 -6
- package/dist/bundle/{chunk-JXEO5EIN.js → chunk-24G3SEXH.js} +2 -2
- package/dist/bundle/{chunk-JWLODUN3.js → chunk-27F6QBPY.js} +14 -14
- package/dist/bundle/{chunk-XVRLD3LN.js → chunk-2OFCIF2W.js} +2 -2
- package/dist/bundle/{chunk-4S2DHHJM.js → chunk-2U7XA4IH.js} +1 -1
- package/dist/bundle/{chunk-HD7DV5B2.js → chunk-4CLSIEWN.js} +35 -35
- package/dist/bundle/{chunk-PRM7GKBV.js → chunk-5CEKH6R6.js} +7 -7
- package/dist/bundle/{chunk-Z77R76S2.js → chunk-5WEEK65F.js} +1 -1
- package/dist/bundle/{chunk-3O25FAPA.js → chunk-6VWVYPH2.js} +1 -1
- package/dist/bundle/{chunk-CNGNR4CY.js → chunk-6WS474NQ.js} +6 -6
- package/dist/bundle/{chunk-L4PNDW4S.js → chunk-7GWOGEWJ.js} +6 -6
- package/dist/bundle/{chunk-HETHFOHC.js → chunk-AMRMU23L.js} +16 -3
- package/dist/bundle/{chunk-M323L5SG.js → chunk-B2UXNYCD.js} +13 -13
- package/dist/bundle/{chunk-2GT563YH.js → chunk-B4ZMFU5I.js} +2 -2
- package/dist/bundle/{chunk-JWNSG5GI.js → chunk-BFKPMG5T.js} +1 -1
- package/dist/bundle/{chunk-ZC7OEYDX.js → chunk-BQSODAU3.js} +1 -1
- package/dist/bundle/{chunk-YHTSJMZ5.js → chunk-BXUMZWMN.js} +565 -477
- package/dist/bundle/{chunk-DG35TQ6P.js → chunk-E2VIO7RY.js} +3 -3
- package/dist/bundle/{chunk-H3TLAYGY.js → chunk-F5FOS64B.js} +4 -4
- package/dist/bundle/{chunk-PK5WEGPJ.js → chunk-GCUFGDKE.js} +2 -2
- package/dist/bundle/{chunk-YPJCURT6.js → chunk-GUERS64O.js} +2 -2
- package/dist/bundle/{chunk-ZW2N2GI2.js → chunk-HILS2UL7.js} +12 -12
- package/dist/bundle/{chunk-XS4EE7MO.js → chunk-IOJOLV25.js} +14 -14
- package/dist/bundle/{chunk-XLNV3U6N.js → chunk-JBS4VPAX.js} +3 -3
- package/dist/bundle/{chunk-2JWY7CXJ.js → chunk-K5QGBYDL.js} +4 -4
- package/dist/bundle/{chunk-ANBI3OXK.js → chunk-KKXF6TSS.js} +1 -1
- package/dist/bundle/{chunk-UTTEAOJ3.js → chunk-L2ZQDTDU.js} +1 -1
- package/dist/bundle/{chunk-XZ6XEAJP.js → chunk-LFPUW7DR.js} +15 -15
- package/dist/bundle/{chunk-L47PFECD.js → chunk-LGYATGQI.js} +7 -7
- package/dist/bundle/{chunk-JCDD5T3A.js → chunk-MA27675E.js} +2 -2
- package/dist/bundle/{chunk-NUD4CBHK.js → chunk-MDI7554C.js} +3 -3
- package/dist/bundle/{chunk-VH4J7IIS.js → chunk-MMZ4QAKJ.js} +1 -1
- package/dist/bundle/{chunk-FR4Y5CGW.js → chunk-MOPBEBVS.js} +4 -4
- package/dist/bundle/{chunk-TZCFJJEU.js → chunk-MPRXUTIK.js} +2 -2
- package/dist/bundle/{chunk-K5FK6WWN.js → chunk-N7F5KT6U.js} +1 -1
- package/dist/bundle/{chunk-CSXCCK6J.js → chunk-NBP6LXSY.js} +2 -2
- package/dist/bundle/{chunk-PCBVSHKD.js → chunk-NP46ZKQW.js} +4 -4
- package/dist/bundle/{chunk-TI5U6AUT.js → chunk-NRSJXUUO.js} +26 -26
- package/dist/bundle/{chunk-4R2ZJGFF.js → chunk-NVWZ7S3I.js} +578 -451
- package/dist/bundle/{chunk-W2QSDPG6.js → chunk-OBIMTRA7.js} +3 -3
- package/dist/bundle/{chunk-O3QBO6NW.js → chunk-OQJURSRL.js} +17 -17
- package/dist/bundle/{chunk-V6G4LTXU.js → chunk-OU3WN4YH.js} +3 -3
- package/dist/bundle/{chunk-VNJRWFHP.js → chunk-PBK2ECXT.js} +1 -1
- package/dist/bundle/{chunk-3ZNO27UE.js → chunk-PHAFT2BO.js} +1 -1
- package/dist/bundle/{chunk-3QQWTP77.js → chunk-PKIGE4NE.js} +2 -2
- package/dist/bundle/{chunk-CA7DY2YU.js → chunk-QBRQLOZA.js} +3 -3
- package/dist/bundle/{chunk-NYEVPAF2.js → chunk-QD4MTOI7.js} +61 -61
- package/dist/bundle/{chunk-WGGUKQE7.js → chunk-QHQ52UMF.js} +75 -31
- package/dist/bundle/{chunk-6UNLEQA5.js → chunk-R2G3MWEF.js} +19 -19
- package/dist/bundle/{chunk-TKWYXM7L.js → chunk-RCEP5OXD.js} +7 -7
- package/dist/bundle/{chunk-7GGDCQJ5.js → chunk-RHJ2VGHV.js} +8 -8
- package/dist/bundle/{chunk-SPXNI53Z.js → chunk-RXBKVNOK.js} +23 -10
- package/dist/bundle/{chunk-WPXVJGSL.js → chunk-RZ7POTFA.js} +3 -3
- package/dist/bundle/{chunk-OJSPB4LA.js → chunk-S7PIM4GG.js} +2 -2
- package/dist/bundle/{chunk-JHZJBNDO.js → chunk-SIDGH56R.js} +2 -2
- package/dist/bundle/{chunk-RVA3CRSY.js → chunk-SRMELB6Q.js} +12 -12
- package/dist/bundle/{chunk-IJ7R2WMK.js → chunk-SVPNU7PD.js} +4 -4
- package/dist/bundle/{chunk-GIGZTI74.js → chunk-TB2MG6PE.js} +938 -710
- package/dist/bundle/{chunk-J5RB4ASI.js → chunk-UN5TH2CG.js} +28 -13
- package/dist/bundle/{chunk-PZ2ZFPGO.js → chunk-V3ZWYMXT.js} +1 -1
- package/dist/bundle/{chunk-ITJ7DGNA.js → chunk-VFU25P57.js} +4 -4
- package/dist/bundle/{chunk-AYWST6NA.js → chunk-VJEMCJPL.js} +35 -35
- package/dist/bundle/{chunk-AHVWZDXO.js → chunk-VK2NDTBS.js} +72 -57
- package/dist/bundle/{chunk-CDKXZLMP.js → chunk-W6A2OZ3C.js} +164 -158
- package/dist/bundle/{chunk-EXMAWEHC.js → chunk-WDI6LA4X.js} +2 -2
- package/dist/bundle/{chunk-O4ZOQJ6W.js → chunk-WTGRQGQL.js} +15 -8
- package/dist/bundle/{chunk-JAL443BH.js → chunk-WUCTF2XE.js} +9 -9
- package/dist/bundle/{chunk-HEZK4W3U.js → chunk-WZCRCCOZ.js} +6 -6
- package/dist/bundle/{chunk-4X6BX3XP.js → chunk-XB6O445X.js} +6 -6
- package/dist/bundle/{chunk-PRI2XTM7.js → chunk-XKFES4EM.js} +8 -8
- package/dist/bundle/{chunk-6DJJVFSG.js → chunk-YBUX6EAK.js} +6 -6
- package/dist/bundle/{chunk-77E7Q4EQ.js → chunk-YMRL7MYS.js} +7 -7
- package/dist/bundle/{chunk-6MEHKUN6.js → chunk-Z6M6NZUX.js} +1 -1
- package/dist/bundle/{chunk-QYRK4XXH.js → chunk-ZCDRXKCR.js} +13 -13
- package/dist/bundle/{chunk-MMDFPBFZ.js → chunk-ZJ3S4S6H.js} +6 -6
- package/dist/bundle/{chunk-3PG6QVQZ.js → chunk-ZL7TJXFL.js} +10 -10
- package/dist/bundle/{chunk-MXA3FU2R.js → chunk-ZMBVZWUW.js} +1 -1
- package/dist/bundle/{chunk-MUV73B5A.js → chunk-ZMTASSIB.js} +7 -7
- package/dist/bundle/{chunk-6DGVK5KS.js → chunk-ZQ5ERQHO.js} +2 -2
- package/dist/bundle/{chunk-FR3ATU5I.js → chunk-ZWVDXVG3.js} +4 -4
- package/dist/bundle/command-contract-K4MU32K6.js +37 -0
- package/dist/bundle/{command-server-entry-WQAE5UGU.js → command-server-entry-XP6BVJIK.js} +27 -27
- package/dist/bundle/{decode-2J2DOVGV.js → decode-TUB45ALX.js} +5 -5
- package/dist/bundle/{dispatch-IZ2TP5GW.js → dispatch-ICPUKMEG.js} +8 -8
- package/dist/bundle/{echarts-GFIIHZ4U.js → echarts-HJ7D7XTM.js} +2 -2
- package/dist/bundle/{embed-AGOXADHW.js → embed-4QDN36YF.js} +6 -6
- package/dist/bundle/{embedder-PCIXGM2Y.js → embedder-Q7ID2LEG.js} +9 -9
- package/dist/bundle/{entry-HUQXUV52.js → entry-Z6VRZP7F.js} +9 -9
- package/dist/bundle/{failure-JSRHZ2S6.js → failure-PEPNEEK7.js} +2 -2
- package/dist/bundle/{first-run-2LXN7B33.js → first-run-GKBEHAAX.js} +12 -12
- package/dist/bundle/first-screen-IA3ONZ75.js +37 -0
- package/dist/bundle/{instructions-RSLTJVFJ.js → instructions-26ZXYYMY.js} +1 -1
- package/dist/bundle/{mcp-MMENCB7I.js → mcp-KGWT6TGO.js} +2 -2
- package/dist/bundle/meeting-combined-KUV2HP52.js +23 -0
- package/dist/bundle/{meeting-model-SI77WMMK.js → meeting-model-JB7X4CA3.js} +11 -11
- package/dist/bundle/{meeting-semantic-WRXWUR4M.js → meeting-semantic-MQNUVG33.js} +6 -6
- package/dist/bundle/{node-5XGMCUGQ.js → node-RIANITAT.js} +2 -2
- package/dist/bundle/{node-sqlite-ES7SQSIC.js → node-sqlite-I2P26Z3S.js} +7 -7
- package/dist/bundle/{oauth-QFM4Y6N7.js → oauth-GFMJL2ZZ.js} +7 -7
- package/dist/bundle/{open-2MD2DKGQ.js → open-CWVYEFNN.js} +5 -5
- package/dist/bundle/{openai-6TMKJKYO.js → openai-PQLK7YTJ.js} +15 -15
- package/dist/bundle/{process-VA2DP7MY.js → process-P4D4KFWE.js} +1 -1
- package/dist/bundle/{program-K3SLEA42.js → program-MF4QZJKH.js} +70 -70
- package/dist/bundle/{prompt-VZSPCE6E.js → prompt-JWIOYU53.js} +5 -5
- package/dist/bundle/{proxy-transport-OJU2EOOC.js → proxy-transport-DWY6ABVT.js} +5 -5
- package/dist/bundle/{recognize-LH3ZZEIL.js → recognize-IPJL4CQZ.js} +4 -4
- package/dist/bundle/{remote-JNW5HN2I.js → remote-DVY6F6YO.js} +9 -9
- package/dist/bundle/{rerank-P23UJMII.js → rerank-XSPWLBIO.js} +7 -7
- package/dist/bundle/{serve-VSLLMILH.js → serve-AJAVEH2M.js} +9 -9
- package/dist/bundle/server-GGXUR5BZ.js +78 -0
- package/dist/bundle/{server-FBRRRKCS.js → server-GII7NIKF.js} +53 -53
- package/dist/bundle/{sqlite-runtime-LWATDAAU.js → sqlite-runtime-KFDYJTUO.js} +6 -6
- package/dist/bundle/{state-3AFJL2EL.js → state-76OJSCQC.js} +6 -6
- package/dist/bundle/{store-6TLYL2VU.js → store-2KJS4YMH.js} +18 -18
- package/dist/bundle/{store-PEXV5DNA.js → store-FBP2J23G.js} +20 -20
- package/dist/bundle/store-maintenance-command-NUWOUZ62.js +65 -0
- package/dist/bundle/surface-EGSHCISG.js +64 -0
- package/dist/bundle/tg.js +13 -13
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +3 -3
- package/skills/tg-cli/SKILL.md +5 -4
- package/skills/tg-cli/references/search.md +2 -2
- package/dist/bundle/agent-G7VHOJMS.js +0 -37
- package/dist/bundle/command-contract-LEFXJAA3.js +0 -37
- package/dist/bundle/first-screen-VUE6RCSF.js +0 -37
- package/dist/bundle/meeting-combined-PBNPHOM3.js +0 -23
- package/dist/bundle/server-TA4QP7PG.js +0 -78
- package/dist/bundle/store-maintenance-command-IYJLUQ5X.js +0 -65
- package/dist/bundle/surface-L4VY4WFG.js +0 -64
|
@@ -10,8 +10,9 @@ import {
|
|
|
10
10
|
parseBytes,
|
|
11
11
|
plainQuery,
|
|
12
12
|
searchError,
|
|
13
|
+
sqliteLimit,
|
|
13
14
|
tooWideTerm
|
|
14
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-WTGRQGQL.js";
|
|
15
16
|
import {
|
|
16
17
|
DEFAULT_STEMMERS,
|
|
17
18
|
DEFAULT_STEMMERS_VERSION,
|
|
@@ -22,16 +23,16 @@ import {
|
|
|
22
23
|
analyzerIdentity,
|
|
23
24
|
createStemmer,
|
|
24
25
|
parseStemmers
|
|
25
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-XKFES4EM.js";
|
|
26
27
|
import {
|
|
27
28
|
NORMALIZER_VERSION,
|
|
28
29
|
fold,
|
|
29
30
|
normalize
|
|
30
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-PHAFT2BO.js";
|
|
31
32
|
import {
|
|
32
33
|
calendarMoment,
|
|
33
34
|
dayIn
|
|
34
|
-
} from "./chunk-
|
|
35
|
+
} from "./chunk-OBIMTRA7.js";
|
|
35
36
|
import {
|
|
36
37
|
SQLiteTable,
|
|
37
38
|
TableAliasProxyHandler,
|
|
@@ -56,17 +57,17 @@ import {
|
|
|
56
57
|
sql,
|
|
57
58
|
sqliteTable,
|
|
58
59
|
text
|
|
59
|
-
} from "./chunk-
|
|
60
|
+
} from "./chunk-PBK2ECXT.js";
|
|
60
61
|
import {
|
|
61
62
|
quietSqliteWarning,
|
|
62
63
|
storeCapable
|
|
63
|
-
} from "./chunk-
|
|
64
|
+
} from "./chunk-7GWOGEWJ.js";
|
|
64
65
|
import {
|
|
65
66
|
PRAGMAS,
|
|
66
67
|
TIME_LIMIT_FUNCTION,
|
|
67
68
|
TimeLimitReached,
|
|
68
69
|
isQueryOnly
|
|
69
|
-
} from "./chunk-
|
|
70
|
+
} from "./chunk-MMZ4QAKJ.js";
|
|
70
71
|
import {
|
|
71
72
|
ACCOUNT_GROUPS,
|
|
72
73
|
ADDED_ACCOUNT,
|
|
@@ -192,20 +193,20 @@ import {
|
|
|
192
193
|
usableLinkSql,
|
|
193
194
|
useStoredProviders,
|
|
194
195
|
walletLine
|
|
195
|
-
} from "./chunk-
|
|
196
|
+
} from "./chunk-4CLSIEWN.js";
|
|
196
197
|
import {
|
|
197
198
|
sqliteCode
|
|
198
|
-
} from "./chunk-
|
|
199
|
+
} from "./chunk-RZ7POTFA.js";
|
|
199
200
|
import {
|
|
200
201
|
normalizeTag,
|
|
201
202
|
tagOf
|
|
202
|
-
} from "./chunk-
|
|
203
|
+
} from "./chunk-MA27675E.js";
|
|
203
204
|
import {
|
|
204
205
|
DEFAULT_TASK_CATEGORIES,
|
|
205
206
|
sharedConfigPath,
|
|
206
207
|
storedTaskCategories,
|
|
207
208
|
taskCategoriesReader
|
|
208
|
-
} from "./chunk-
|
|
209
|
+
} from "./chunk-YMRL7MYS.js";
|
|
209
210
|
import {
|
|
210
211
|
CHAT_MESSAGES_READ,
|
|
211
212
|
FACT_TYPES,
|
|
@@ -261,11 +262,11 @@ import {
|
|
|
261
262
|
validateQuery,
|
|
262
263
|
walkQuery,
|
|
263
264
|
zonedMoment
|
|
264
|
-
} from "./chunk-
|
|
265
|
+
} from "./chunk-QD4MTOI7.js";
|
|
265
266
|
import {
|
|
266
267
|
refuseOwnerStoreInTests,
|
|
267
268
|
storePath
|
|
268
|
-
} from "./chunk-
|
|
269
|
+
} from "./chunk-2OFCIF2W.js";
|
|
269
270
|
import {
|
|
270
271
|
array,
|
|
271
272
|
boolean,
|
|
@@ -283,7 +284,7 @@ import {
|
|
|
283
284
|
safeParse,
|
|
284
285
|
strictObject,
|
|
285
286
|
string
|
|
286
|
-
} from "./chunk-
|
|
287
|
+
} from "./chunk-RXBKVNOK.js";
|
|
287
288
|
import {
|
|
288
289
|
resolveFrom
|
|
289
290
|
} from "./chunk-Y5E2WNWB.js";
|
|
@@ -291,7 +292,7 @@ import {
|
|
|
291
292
|
CliError,
|
|
292
293
|
isCliError,
|
|
293
294
|
singleLine
|
|
294
|
-
} from "./chunk-
|
|
295
|
+
} from "./chunk-GCUFGDKE.js";
|
|
295
296
|
import {
|
|
296
297
|
__commonJS,
|
|
297
298
|
__name,
|
|
@@ -10035,7 +10036,7 @@ var require_cjs = __commonJS({
|
|
|
10035
10036
|
}
|
|
10036
10037
|
});
|
|
10037
10038
|
|
|
10038
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
10039
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/account-store.js
|
|
10039
10040
|
var bindArea = /* @__PURE__ */ __name(({ keyed, whole }, account) => {
|
|
10040
10041
|
const methods = whole;
|
|
10041
10042
|
return Object.fromEntries(Object.keys(keyed).map((name) => [
|
|
@@ -10163,7 +10164,7 @@ var bindAccount = /* @__PURE__ */ __name((store, account, areas, owners) => {
|
|
|
10163
10164
|
};
|
|
10164
10165
|
}, "bindAccount");
|
|
10165
10166
|
|
|
10166
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
10167
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/drizzle/core.js
|
|
10167
10168
|
var IndexBuilderOn = class {
|
|
10168
10169
|
static {
|
|
10169
10170
|
__name(this, "IndexBuilderOn");
|
|
@@ -10358,7 +10359,7 @@ function alias(table, alias2) {
|
|
|
10358
10359
|
}
|
|
10359
10360
|
__name(alias, "alias");
|
|
10360
10361
|
|
|
10361
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
10362
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/domain/record-fields.js
|
|
10362
10363
|
var DECIMAL_PATTERN = "^[0-9]{1,16}(\\.[0-9]{1,6})?$";
|
|
10363
10364
|
var SIGNED_DECIMAL = "^-?[0-9]{1,16}(\\.[0-9]{1,6})?$";
|
|
10364
10365
|
var DAY = "^[0-9]{4}-[0-9]{2}-[0-9]{2}$";
|
|
@@ -10408,7 +10409,7 @@ var arrayOf = /* @__PURE__ */ __name((item, maxItems, description) => ({
|
|
|
10408
10409
|
}), "arrayOf");
|
|
10409
10410
|
var isObject = /* @__PURE__ */ __name((value) => typeof value === "object" && value !== null && !Array.isArray(value), "isObject");
|
|
10410
10411
|
|
|
10411
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
10412
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/domain/record-types.js
|
|
10412
10413
|
var kept = /* @__PURE__ */ __name((description) => ({ description }), "kept");
|
|
10413
10414
|
var PARTY = ["person", "organization"];
|
|
10414
10415
|
var ORGANIZATION = ["organization"];
|
|
@@ -10803,7 +10804,7 @@ var hasV1Roles = /* @__PURE__ */ __name((type) => rolesOf2(type).some(([, role])
|
|
|
10803
10804
|
var IDENTITY_TYPES = RECORD_ENTITY_TYPES.filter((type) => RECORD_TYPES[type].review === "identity");
|
|
10804
10805
|
var article = /* @__PURE__ */ __name((word2) => /^[aeiou]/.test(word2) ? "an" : "a", "article");
|
|
10805
10806
|
|
|
10806
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
10807
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/entity-types.js
|
|
10807
10808
|
var ENTITY_TABLES = {
|
|
10808
10809
|
...RECORD_TABLES,
|
|
10809
10810
|
account: "accounts",
|
|
@@ -10843,7 +10844,7 @@ var orphanPointers = /* @__PURE__ */ __name((database) => pointerPairs(database)
|
|
|
10843
10844
|
return { table, pointer, type, count: count2, known: known2 };
|
|
10844
10845
|
}).filter(({ count: count2 }) => count2 > 0)), "orphanPointers");
|
|
10845
10846
|
|
|
10846
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
10847
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/identity-links.js
|
|
10847
10848
|
var IDENTITY_LINK_KIND = "identity_link";
|
|
10848
10849
|
var IDENTITY_LINK_SIGNALS = ["agent", "phone", "email", "guest-email", "name", "account"];
|
|
10849
10850
|
var LINK_WEAKNESSES = [
|
|
@@ -10856,7 +10857,7 @@ var LINK_WEAKNESSES = [
|
|
|
10856
10857
|
"not-own-number"
|
|
10857
10858
|
];
|
|
10858
10859
|
|
|
10859
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
10860
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/merged-persons.js
|
|
10860
10861
|
var SEPARATIONS = ["unlink", "split", "undo-merge"];
|
|
10861
10862
|
var mergeSql = /* @__PURE__ */ __name((event2) => `(${event2}.from_person_id IS NOT NULL AND ${event2}.from_person_id <> ${event2}.to_person_id AND ${event2}.method NOT IN (${SEPARATIONS.map((method) => `'${method}'`).join(", ")}) AND NOT EXISTS (SELECT 1 FROM identity_link_events stay WHERE stay.to_person_id = ${event2}.from_person_id AND stay.identity_id <> ${event2}.identity_id AND stay.id < ${event2}.id AND stay.id = (SELECT max(s.id) FROM identity_link_events s WHERE s.identity_id = stay.identity_id AND s.id < ${event2}.id) AND NOT EXISTS (SELECT 1 FROM identity_link_events went WHERE went.identity_id = stay.identity_id AND went.from_person_id = ${event2}.from_person_id AND went.to_person_id = ${event2}.to_person_id AND went.id = (SELECT min(w.id) FROM identity_link_events w WHERE w.identity_id = stay.identity_id AND w.id > ${event2}.id))))`, "mergeSql");
|
|
10862
10863
|
var mergedAwaySql = /* @__PURE__ */ __name((person2) => `(${person2}.owner = 0 AND NOT EXISTS (SELECT 1 FROM identity_links ml WHERE ml.person_id = ${person2}.id) AND EXISTS (SELECT 1 FROM identity_link_events me WHERE me.from_person_id = ${person2}.id AND ${mergeSql("me")}))`, "mergedAwaySql");
|
|
@@ -10888,7 +10889,7 @@ var samePersons = /* @__PURE__ */ __name((database, pk) => {
|
|
|
10888
10889
|
}, "samePersons");
|
|
10889
10890
|
var idsOf = /* @__PURE__ */ __name((database, type, id2) => JSON.stringify(type === "person" ? samePersons(database, id2) : [id2]), "idsOf");
|
|
10890
10891
|
|
|
10891
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
10892
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/identity-link-rows.js
|
|
10892
10893
|
var pairOf = /* @__PURE__ */ __name((a, b) => [Number(a), Number(b)].sort((x, y) => x - y).join("-"), "pairOf");
|
|
10893
10894
|
var pkOf = /* @__PURE__ */ __name((database, ref3) => {
|
|
10894
10895
|
const at2 = ref3.indexOf(":");
|
|
@@ -10995,13 +10996,13 @@ var forgetErasedLinks = /* @__PURE__ */ __name((database) => {
|
|
|
10995
10996
|
database.prepare("DELETE FROM proposed_actions WHERE id = ?").run(Number(row2.id));
|
|
10996
10997
|
}, "forgetErasedLinks");
|
|
10997
10998
|
|
|
10998
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
10999
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/identity-splits.js
|
|
10999
11000
|
var IDENTITY_SPLIT_KIND = "identity_split";
|
|
11000
11001
|
|
|
11001
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
11002
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/mail-findings.js
|
|
11002
11003
|
var MAIL_FINDINGS_KIND = "mail_findings";
|
|
11003
11004
|
|
|
11004
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
11005
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/decisions.js
|
|
11005
11006
|
var TASK_CLOSE_KIND = "task_close";
|
|
11006
11007
|
var DEFAULT_DECISION_POLICY = { agentDecisions: false, ruleProposalsOwnerOnly: true };
|
|
11007
11008
|
var isOwnerOnlyKind = /* @__PURE__ */ __name((kind3) => kind3 === MAIL_FINDINGS_KIND || kind3 === MEETING_FINDINGS_KIND || kind3 === TASK_CLOSE_KIND || kind3 === SOURCE_REVIEW_KIND || kind3 === IDENTITY_LINK_KIND || kind3 === IDENTITY_SPLIT_KIND, "isOwnerOnlyKind");
|
|
@@ -11049,7 +11050,7 @@ var assertMayDecide = /* @__PURE__ */ __name((row2, by, policy = DEFAULT_DECISIO
|
|
|
11049
11050
|
}, "assertMayDecide");
|
|
11050
11051
|
var deciderAuthor = /* @__PURE__ */ __name((by) => by === "owner" ? "owner" : { bot: by.bot, ...by.model === void 0 ? {} : { model: by.model } }, "deciderAuthor");
|
|
11051
11052
|
|
|
11052
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
11053
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/domain/addresses.js
|
|
11053
11054
|
var EMAIL_ADDRESS = /^[^\s@]+@[^\s@]+\.[^\s@]+$/u;
|
|
11054
11055
|
var isEmailAddress = /* @__PURE__ */ __name((value) => EMAIL_ADDRESS.test(value), "isEmailAddress");
|
|
11055
11056
|
var ROLE_ADDRESS_WORDS = {
|
|
@@ -11111,7 +11112,7 @@ var PERSON_LIKE = /* @__PURE__ */ new Set(["hr"]);
|
|
|
11111
11112
|
var isPersonLikeRoleAddress = /* @__PURE__ */ __name((address) => PERSON_LIKE.has(localWord(address)), "isPersonLikeRoleAddress");
|
|
11112
11113
|
var isNoReplyAddress = /* @__PURE__ */ __name((address) => NO_REPLY.has(localWord(address)), "isNoReplyAddress");
|
|
11113
11114
|
|
|
11114
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
11115
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/mail/score.js
|
|
11115
11116
|
var import_disposable_email_domains_js = __toESM(require_dist(), 1);
|
|
11116
11117
|
var import_tldts = __toESM(require_cjs(), 1);
|
|
11117
11118
|
var FREE_MAIL = /* @__PURE__ */ new Set([
|
|
@@ -11141,7 +11142,7 @@ var FREE_MAIL = /* @__PURE__ */ new Set([
|
|
|
11141
11142
|
]);
|
|
11142
11143
|
var DAY_MS = 24 * 60 * 60 * 1e3;
|
|
11143
11144
|
|
|
11144
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
11145
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/address-organization.js
|
|
11145
11146
|
var BY_ADDRESS = "SELECT DISTINCT o.id FROM organizations o JOIN organization_identities oi ON oi.organization_id = o.id JOIN identities i ON i.id = oi.identity_id WHERE o.deleted_at IS NULL AND i.provider = 'email' AND ";
|
|
11146
11147
|
var idsOf2 = /* @__PURE__ */ __name((rows) => rows.map((row2) => Number(row2.id)), "idsOf");
|
|
11147
11148
|
var holdAddress = /* @__PURE__ */ __name(({ database, now: now2 }, organization2, email, { method, author }) => {
|
|
@@ -11166,7 +11167,7 @@ var organizationOfAddress = /* @__PURE__ */ __name((context, { name, email, meth
|
|
|
11166
11167
|
return id2;
|
|
11167
11168
|
}, "organizationOfAddress");
|
|
11168
11169
|
|
|
11169
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
11170
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/domain/phone-plans.generated.js
|
|
11170
11171
|
var PHONE_PLANS = [
|
|
11171
11172
|
{
|
|
11172
11173
|
country: "us",
|
|
@@ -11546,7 +11547,7 @@ var PHONE_PLANS = [
|
|
|
11546
11547
|
}
|
|
11547
11548
|
];
|
|
11548
11549
|
|
|
11549
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
11550
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/domain/phones.js
|
|
11550
11551
|
var PHONE_COUNTRIES = PHONE_PLANS.map((plan) => plan.country);
|
|
11551
11552
|
var DEFAULT_PHONE_COUNTRIES = ["ru"];
|
|
11552
11553
|
var parsePhoneCountries = /* @__PURE__ */ __name((value) => {
|
|
@@ -11621,10 +11622,10 @@ var storedPhone = /* @__PURE__ */ __name((raw, provider) => {
|
|
|
11621
11622
|
return found2 ? `+${found2[1]}` : void 0;
|
|
11622
11623
|
}, "storedPhone");
|
|
11623
11624
|
|
|
11624
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
11625
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/transaction.js
|
|
11625
11626
|
import { AsyncLocalStorage } from "node:async_hooks";
|
|
11626
11627
|
|
|
11627
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
11628
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/journal.js
|
|
11628
11629
|
import { existsSync, statSync } from "node:fs";
|
|
11629
11630
|
var watched = /* @__PURE__ */ new WeakMap();
|
|
11630
11631
|
var walInode = /* @__PURE__ */ __name((store) => statSync(`${store}-wal`, { throwIfNoEntry: false })?.ino, "walInode");
|
|
@@ -11650,7 +11651,7 @@ var checkJournal = /* @__PURE__ */ __name((database) => {
|
|
|
11650
11651
|
throw new CliError("conflict", "the store's journal file was deleted or replaced by another program while this command had the store open, so nothing more is written; `store recover` says what to do", { reason: "store.journal-replaced" });
|
|
11651
11652
|
}, "checkJournal");
|
|
11652
11653
|
|
|
11653
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
11654
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/write-events.js
|
|
11654
11655
|
var WRITE = /^\s*(?:WITH\b[\s\S]*?\)\s*)?(INSERT|REPLACE|UPDATE|DELETE)\b(?:\s+OR\s+[A-Za-z]+)?\s+(?:INTO\s+|FROM\s+)?(?:("?)(\w+)\2\.)?["`[]?(\w+)/i;
|
|
11655
11656
|
var writeTarget = /* @__PURE__ */ __name((sql2) => {
|
|
11656
11657
|
const match = WRITE.exec(sql2);
|
|
@@ -11730,7 +11731,7 @@ var committedWrites = /* @__PURE__ */ __name((database) => {
|
|
|
11730
11731
|
}, "committedWrites");
|
|
11731
11732
|
var droppedWrites = /* @__PURE__ */ __name((database) => tallies.get(database)?.pending.clear(), "droppedWrites");
|
|
11732
11733
|
|
|
11733
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
11734
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/involvement-queue.js
|
|
11734
11735
|
var ARMS = [
|
|
11735
11736
|
[
|
|
11736
11737
|
"message",
|
|
@@ -11858,7 +11859,7 @@ var drainInvolvementQueue = /* @__PURE__ */ __name((database, cap = QUEUE_CAP) =
|
|
|
11858
11859
|
return recomputed;
|
|
11859
11860
|
}, "drainInvolvementQueue");
|
|
11860
11861
|
|
|
11861
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
11862
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/domain/mentions.js
|
|
11862
11863
|
import { domainToUnicode } from "node:url";
|
|
11863
11864
|
|
|
11864
11865
|
// node_modules/.pnpm/psl@1.15.0/node_modules/psl/dist/psl.mjs
|
|
@@ -21880,7 +21881,7 @@ var oa = /* @__PURE__ */ __name((e) => {
|
|
|
21880
21881
|
}, "oa");
|
|
21881
21882
|
var na = { parse: O, get: aa, isValid: oa };
|
|
21882
21883
|
|
|
21883
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
21884
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/domain/google-documents.js
|
|
21884
21885
|
var LINK = /https?:\/\/(?:(?:docs|drive|sheets|slides)\.google\.com|forms\.gle)(?:[/?#][^\s<>"'`]*)?/gi;
|
|
21885
21886
|
var ID = /^[\w-]{10,}$/;
|
|
21886
21887
|
var trimUrl = /* @__PURE__ */ __name((url) => {
|
|
@@ -21922,7 +21923,7 @@ var googleDocumentLinks = /* @__PURE__ */ __name((text9) => [...text9.matchAll(L
|
|
|
21922
21923
|
return { url, documentId: googleDocumentId(url) };
|
|
21923
21924
|
}), "googleDocumentLinks");
|
|
21924
21925
|
|
|
21925
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
21926
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/domain/places.js
|
|
21926
21927
|
var BEFORE = [
|
|
21927
21928
|
[/^(?:ул\.?|улиц[аеыу]|улицей)$/iu, "\u0443\u043B\u0438\u0446\u0430"],
|
|
21928
21929
|
[/^(?:пр-т|просп\.?|проспект[аеу]?)$/iu, "\u043F\u0440\u043E\u0441\u043F\u0435\u043A\u0442"],
|
|
@@ -22182,7 +22183,7 @@ var findPlaces = /* @__PURE__ */ __name((text9) => {
|
|
|
22182
22183
|
return found2.sort((a, b) => a.start - b.start);
|
|
22183
22184
|
}, "findPlaces");
|
|
22184
22185
|
|
|
22185
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
22186
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/domain/mentions.js
|
|
22186
22187
|
var MENTION_KINDS = ["phone", "email", "url", "document", "person-name", "place"];
|
|
22187
22188
|
var MENTION_VERSIONS = {
|
|
22188
22189
|
phone: 1,
|
|
@@ -22358,7 +22359,7 @@ var exactlyOne = /* @__PURE__ */ __name((text9, options) => {
|
|
|
22358
22359
|
return one2 && one2.start === 0 && one2.end === text9.length ? one2.value : void 0;
|
|
22359
22360
|
}, "exactlyOne");
|
|
22360
22361
|
|
|
22361
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
22362
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/domain/first-names.js
|
|
22362
22363
|
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";
|
|
22363
22364
|
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";
|
|
22364
22365
|
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";
|
|
@@ -22366,7 +22367,7 @@ var NOT_NAMES = ["\u0436\u0435\u043D\u0430", "\u0436\u0435\u043D\u044B", "\u0436
|
|
|
22366
22367
|
var FIRST_NAMES = [...new Set(`${RUSSIAN} ${EUROPEAN}`.split(" "))];
|
|
22367
22368
|
var NAME_WORDS = WORDS.split(" ");
|
|
22368
22369
|
|
|
22369
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
22370
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/domain/person-names.js
|
|
22370
22371
|
var LATIN_TO_CYRILLIC = {
|
|
22371
22372
|
shch: "\u0449",
|
|
22372
22373
|
sch: "\u0449",
|
|
@@ -22574,7 +22575,7 @@ var findUnknownNames = /* @__PURE__ */ __name((text9, stem, taken) => {
|
|
|
22574
22575
|
return found2;
|
|
22575
22576
|
}, "findUnknownNames");
|
|
22576
22577
|
|
|
22577
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
22578
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/domain/attachments.js
|
|
22578
22579
|
var NOT_FILES = /* @__PURE__ */ new Set([
|
|
22579
22580
|
"webpage",
|
|
22580
22581
|
"share",
|
|
@@ -22615,7 +22616,7 @@ var matchDownloads = /* @__PURE__ */ __name((stored4, files2) => {
|
|
|
22615
22616
|
});
|
|
22616
22617
|
}, "matchDownloads");
|
|
22617
22618
|
|
|
22618
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
22619
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/search/lucene/automaton.js
|
|
22619
22620
|
var any = { kind: "char", ranges: [[0, 1114111]], negate: false };
|
|
22620
22621
|
var literal2 = /* @__PURE__ */ __name((c) => ({
|
|
22621
22622
|
kind: "char",
|
|
@@ -23015,7 +23016,7 @@ var foldRegex = /* @__PURE__ */ __name((pattern, span) => {
|
|
|
23015
23016
|
return out;
|
|
23016
23017
|
}, "foldRegex");
|
|
23017
23018
|
|
|
23018
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
23019
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/search/lucene/presets.js
|
|
23019
23020
|
var PRESET_VERSION = 1;
|
|
23020
23021
|
var PRESETS = {
|
|
23021
23022
|
password: {
|
|
@@ -23069,12 +23070,12 @@ var PRESETS = {
|
|
|
23069
23070
|
}
|
|
23070
23071
|
};
|
|
23071
23072
|
|
|
23072
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
23073
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/search/lucene/resolved.js
|
|
23073
23074
|
var hasText = /* @__PURE__ */ __name((node) => node.kind === "predicate" ? node.field === "text" || node.field === "exact" : node.clauses.some(({ node: node2 }) => hasText(node2)), "hasText");
|
|
23074
23075
|
var isStemmed = /* @__PURE__ */ __name((node) => node.field === "text" && (node.operator === "term" || node.operator === "phrase") && node.value !== "", "isStemmed");
|
|
23075
23076
|
var hasStems = /* @__PURE__ */ __name((node) => node.kind === "predicate" ? isStemmed(node) : node.clauses.some(({ node: node2 }) => hasStems(node2)), "hasStems");
|
|
23076
23077
|
|
|
23077
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
23078
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/mention-links.js
|
|
23078
23079
|
var LIVE = "mn.kind = 'url' AND mn.status <> 'dismissed'";
|
|
23079
23080
|
var MAIL_ROWS = `SELECT mn.source_id FROM mentions mn WHERE mn.source_type = 'email' AND ${LIVE}`;
|
|
23080
23081
|
var linkMatch = /* @__PURE__ */ __name((field4, typed, mail, mentioned2) => {
|
|
@@ -23098,7 +23099,7 @@ var linkMatch = /* @__PURE__ */ __name((field4, typed, mail, mentioned2) => {
|
|
|
23098
23099
|
};
|
|
23099
23100
|
}, "linkMatch");
|
|
23100
23101
|
|
|
23101
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
23102
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/phone-countries.js
|
|
23102
23103
|
var SETTING = "phoneCountries";
|
|
23103
23104
|
var savedPhoneCountries = /* @__PURE__ */ __name((database) => {
|
|
23104
23105
|
const row2 = database.prepare("SELECT value FROM store_settings WHERE key = ?").get(SETTING);
|
|
@@ -23129,7 +23130,7 @@ var valueMatch = /* @__PURE__ */ __name((database, typed) => {
|
|
|
23129
23130
|
return { sql: "mn.value = ?", params: [phone?.value ?? normalizedValue(typed, { phoneCountries })] };
|
|
23130
23131
|
}, "valueMatch");
|
|
23131
23132
|
|
|
23132
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
23133
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/domain/vocabulary.js
|
|
23133
23134
|
var normalizeVocabularyName = /* @__PURE__ */ __name((input) => {
|
|
23134
23135
|
if (typeof input !== "string" || input.length > 200 || /[\p{Cc}\p{Cf}]/u.test(input))
|
|
23135
23136
|
throw new CliError("validation_error", "a vocabulary name takes 1\u2013200 characters without control characters");
|
|
@@ -23157,7 +23158,7 @@ var vocabularySimilarity = /* @__PURE__ */ __name((left, right) => {
|
|
|
23157
23158
|
return 2 * intersection2 / (aa2.size + bb.size);
|
|
23158
23159
|
}, "vocabularySimilarity");
|
|
23159
23160
|
|
|
23160
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
23161
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/tag-creation.js
|
|
23161
23162
|
import { createHash } from "node:crypto";
|
|
23162
23163
|
var folded2 = /* @__PURE__ */ __name((name) => {
|
|
23163
23164
|
try {
|
|
@@ -23223,7 +23224,7 @@ var guardTagCreation = /* @__PURE__ */ __name((context, name, kind3, by, options
|
|
|
23223
23224
|
});
|
|
23224
23225
|
}, "guardTagCreation");
|
|
23225
23226
|
|
|
23226
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
23227
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/domain/tag-redirects.js
|
|
23227
23228
|
var invalid = /* @__PURE__ */ __name((message3) => {
|
|
23228
23229
|
throw new CliError("validation_error", message3);
|
|
23229
23230
|
}, "invalid");
|
|
@@ -23300,7 +23301,7 @@ var createTagRedirectIndex = /* @__PURE__ */ __name((snapshot2) => {
|
|
|
23300
23301
|
};
|
|
23301
23302
|
}, "createTagRedirectIndex");
|
|
23302
23303
|
|
|
23303
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
23304
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/tag-resolution.js
|
|
23304
23305
|
var tagCanonicalId = /* @__PURE__ */ __name((database, id2) => {
|
|
23305
23306
|
const row2 = database.prepare("SELECT canonical_id FROM resolved_tags WHERE id=?").get(id2);
|
|
23306
23307
|
if (!row2)
|
|
@@ -23328,7 +23329,7 @@ var tagRedirectSnapshot = /* @__PURE__ */ __name((database) => {
|
|
|
23328
23329
|
return snapshot2;
|
|
23329
23330
|
}, "tagRedirectSnapshot");
|
|
23330
23331
|
|
|
23331
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
23332
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/task-keys.js
|
|
23332
23333
|
import { createHash as createHash2 } from "node:crypto";
|
|
23333
23334
|
var TASK_KEY_PREFIXES = {
|
|
23334
23335
|
question: "Q",
|
|
@@ -23356,7 +23357,7 @@ var taskAccountOf = /* @__PURE__ */ __name((database, rowId) => {
|
|
|
23356
23357
|
return row2 && String(row2.key) === inboxKey(String(row2.name)) ? String(row2.name) : void 0;
|
|
23357
23358
|
}, "taskAccountOf");
|
|
23358
23359
|
|
|
23359
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
23360
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/things.js
|
|
23360
23361
|
var storedThing = /* @__PURE__ */ __name((type, id2) => ({ type: String(type), id: Number(id2) }), "storedThing");
|
|
23361
23362
|
var REFERABLE = {
|
|
23362
23363
|
...Object.fromEntries(Object.entries(RECORD_TYPES).map(([type, { tombstone: tombstone2 }]) => [type, { tombstone: tombstone2 }])),
|
|
@@ -23520,7 +23521,7 @@ var taskIdOf = /* @__PURE__ */ __name((database, rowId) => {
|
|
|
23520
23521
|
return row2 ? String(row2.id ?? row2.key) : void 0;
|
|
23521
23522
|
}, "taskIdOf");
|
|
23522
23523
|
|
|
23523
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
23524
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/values.js
|
|
23524
23525
|
var toMs = /* @__PURE__ */ __name((iso17) => {
|
|
23525
23526
|
if (iso17 === null || iso17 === void 0)
|
|
23526
23527
|
return null;
|
|
@@ -23534,7 +23535,7 @@ var present = /* @__PURE__ */ __name((entries) => Object.fromEntries(Object.entr
|
|
|
23534
23535
|
var DELIVERY = { delivered: 1, read: 2 };
|
|
23535
23536
|
var deliveryOf = /* @__PURE__ */ __name((stored4) => stored4 === DELIVERY.read ? "read" : stored4 === DELIVERY.delivered ? "delivered" : void 0, "deliveryOf");
|
|
23536
23537
|
|
|
23537
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
23538
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/tags.js
|
|
23538
23539
|
var TAG_KINDS = ["tag", "topic"];
|
|
23539
23540
|
var TAGGABLE = { chat: "chat", contact: "identity", message: "message", task: "task" };
|
|
23540
23541
|
var TAG_TYPE = {
|
|
@@ -23737,7 +23738,7 @@ var tagsOf = /* @__PURE__ */ __name(({ database }, key2, filter) => {
|
|
|
23737
23738
|
return result;
|
|
23738
23739
|
}, "tagsOf");
|
|
23739
23740
|
|
|
23740
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
23741
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/trigram-match.js
|
|
23741
23742
|
var MOST_YO_SPELLINGS = 64;
|
|
23742
23743
|
var yoSpellings = /* @__PURE__ */ __name((run) => {
|
|
23743
23744
|
let spellings2 = [""];
|
|
@@ -23759,7 +23760,27 @@ var anyCaseGlob = /* @__PURE__ */ __name((word2) => `*${[...word2.normalize("NFC
|
|
|
23759
23760
|
return forms2.size === 1 ? c : `[${[...forms2].join("")}]`;
|
|
23760
23761
|
}).join("")}*`, "anyCaseGlob");
|
|
23761
23762
|
|
|
23762
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
23763
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/lucene-fields.js
|
|
23764
|
+
var MESSAGES = {
|
|
23765
|
+
rows: "messages",
|
|
23766
|
+
threads: "chats",
|
|
23767
|
+
words: "message_words",
|
|
23768
|
+
stems: "message_stems",
|
|
23769
|
+
vocab: "message_words_vocab",
|
|
23770
|
+
item: "message",
|
|
23771
|
+
thread: "chat"
|
|
23772
|
+
};
|
|
23773
|
+
var MAIL = {
|
|
23774
|
+
rows: `(SELECT id, account_id, email_thread_id AS chat_id, external_id, deleted_at, from_identity_id AS sender_identity_id,
|
|
23775
|
+
outgoing, read, flagged, coalesce(sent_at, received_at) AS sent_at,
|
|
23776
|
+
coalesce(subject, '') || char(10, 10) || coalesce(body_text, '') AS text FROM emails)`,
|
|
23777
|
+
threads: "(SELECT id, account_id, external_id, subject AS title, 1 AS searchable FROM email_threads)",
|
|
23778
|
+
words: "email_words",
|
|
23779
|
+
stems: "email_stems",
|
|
23780
|
+
vocab: "email_words_vocab",
|
|
23781
|
+
item: "email",
|
|
23782
|
+
thread: "email_thread"
|
|
23783
|
+
};
|
|
23763
23784
|
var speech = /* @__PURE__ */ __name((alias2) => `(coalesce(${alias2}.extractor,'') LIKE 'speech:%' OR ${alias2}.kind IN ('voice','video_note') OR coalesce(${alias2}.mime,'')='audio/ogg')`, "speech");
|
|
23764
23785
|
var SPEECH = speech("att");
|
|
23765
23786
|
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");
|
|
@@ -24247,7 +24268,7 @@ var FIELD_COMPILERS = {
|
|
|
24247
24268
|
subject
|
|
24248
24269
|
};
|
|
24249
24270
|
|
|
24250
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
24271
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/place-key.js
|
|
24251
24272
|
var placeOf = /* @__PURE__ */ __name((database) => {
|
|
24252
24273
|
const exact = database.prepare("SELECT id FROM places WHERE folded = ?");
|
|
24253
24274
|
const onStreet = database.prepare("SELECT id FROM places WHERE substr(folded, 1, ?) = ? LIMIT 2");
|
|
@@ -24263,7 +24284,7 @@ var placeOf = /* @__PURE__ */ __name((database) => {
|
|
|
24263
24284
|
};
|
|
24264
24285
|
}, "placeOf");
|
|
24265
24286
|
|
|
24266
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
24287
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/mention-drain.js
|
|
24267
24288
|
var DRAIN_ON_WRITE = 500;
|
|
24268
24289
|
var METHOD = "rules";
|
|
24269
24290
|
var telegramLink = /* @__PURE__ */ __name((database) => {
|
|
@@ -24429,7 +24450,7 @@ var drainMentions = /* @__PURE__ */ __name((database, now2, limit = DRAIN_ON_WRI
|
|
|
24429
24450
|
return queued.length;
|
|
24430
24451
|
}, "drainMentions");
|
|
24431
24452
|
|
|
24432
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
24453
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/index-state.js
|
|
24433
24454
|
var indexRow = /* @__PURE__ */ __name((database, name) => {
|
|
24434
24455
|
const exists2 = database.prepare("SELECT 1 FROM sqlite_master WHERE name = 'search_index_state'").get();
|
|
24435
24456
|
if (!exists2)
|
|
@@ -24437,7 +24458,7 @@ var indexRow = /* @__PURE__ */ __name((database, name) => {
|
|
|
24437
24458
|
return database.prepare("SELECT * FROM search_index_state WHERE name = ?").get(name);
|
|
24438
24459
|
}, "indexRow");
|
|
24439
24460
|
|
|
24440
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
24461
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/stems.js
|
|
24441
24462
|
var INDEX = "message_stems";
|
|
24442
24463
|
var SETTING2 = "searchStemmers";
|
|
24443
24464
|
var DRAIN_ON_WRITE2 = 500;
|
|
@@ -24563,7 +24584,7 @@ var stemmerCache = /* @__PURE__ */ __name(() => {
|
|
|
24563
24584
|
};
|
|
24564
24585
|
}, "stemmerCache");
|
|
24565
24586
|
|
|
24566
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
24587
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/transaction.js
|
|
24567
24588
|
var rehearsal = new AsyncLocalStorage();
|
|
24568
24589
|
var SQLITE_BUSY = 5;
|
|
24569
24590
|
var pause = new Int32Array(new SharedArrayBuffer(4));
|
|
@@ -24706,7 +24727,7 @@ var read = /* @__PURE__ */ __name((database, body2) => {
|
|
|
24706
24727
|
}
|
|
24707
24728
|
}, "read");
|
|
24708
24729
|
|
|
24709
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
24730
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/folded.js
|
|
24710
24731
|
var FOLDED = [
|
|
24711
24732
|
{ table: "tasks", column: "title" },
|
|
24712
24733
|
{ table: "tasks", column: "close_reason" },
|
|
@@ -24743,7 +24764,7 @@ var fillFolded = /* @__PURE__ */ __name((database, { batch = 2e3 } = {}) => {
|
|
|
24743
24764
|
return filled;
|
|
24744
24765
|
}, "fillFolded");
|
|
24745
24766
|
|
|
24746
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
24767
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/conversations/chunks.js
|
|
24747
24768
|
import { createHash as createHash3 } from "node:crypto";
|
|
24748
24769
|
var CHUNK_CHARS = 1200;
|
|
24749
24770
|
var CHUNK_OVERLAP = 150;
|
|
@@ -24848,7 +24869,7 @@ var cutChunks = /* @__PURE__ */ __name((members2, limit = CHUNK_CHARS, check3, c
|
|
|
24848
24869
|
return chunks2;
|
|
24849
24870
|
}, "cutChunks");
|
|
24850
24871
|
|
|
24851
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
24872
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/search/task-signature.js
|
|
24852
24873
|
var DAY2 = 864e5;
|
|
24853
24874
|
var CURRENCY = [
|
|
24854
24875
|
[/^(₽|руб.*|р\.?|rub)$/u, "RUB"],
|
|
@@ -24974,7 +24995,7 @@ var dueDayOf = /* @__PURE__ */ __name((text9, createdMs) => {
|
|
|
24974
24995
|
return best?.day ?? null;
|
|
24975
24996
|
}, "dueDayOf");
|
|
24976
24997
|
|
|
24977
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
24998
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/search/task-similarity.js
|
|
24978
24999
|
var DAY3 = 864e5;
|
|
24979
25000
|
var STOP_WORDS = new Set([
|
|
24980
25001
|
// Russian and English as the test set ran them, already folded (пожалуйста → пожалуиста).
|
|
@@ -25129,7 +25150,7 @@ var rankCandidates = /* @__PURE__ */ __name((views, candidates) => candidates.ma
|
|
|
25129
25150
|
...compareViews(subjectViews ?? views, candidate, replyChain === void 0 ? {} : { replyChain })
|
|
25130
25151
|
})).sort((a, b) => b.score - a.score), "rankCandidates");
|
|
25131
25152
|
|
|
25132
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
25153
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/vector-index.js
|
|
25133
25154
|
var source = /* @__PURE__ */ __name((model, dims) => `SELECT k.id, k.chunkable_type,
|
|
25134
25155
|
coalesce(CASE k.chunkable_type
|
|
25135
25156
|
WHEN 'image' THEN (SELECT ch.account_id FROM attachments a JOIN messages m ON m.id = a.attachable_id
|
|
@@ -25223,11 +25244,11 @@ var knn = /* @__PURE__ */ __name((database, index2, filter, query, k) => databas
|
|
|
25223
25244
|
BigInt(filter.account),
|
|
25224
25245
|
...[filter.chat, filter.since, filter.before].flatMap((value) => value === void 0 ? [] : [BigInt(value)])
|
|
25225
25246
|
), "knn");
|
|
25226
|
-
var searchIndex = /* @__PURE__ */ __name((database, model, filter, query, limit, survivors) => {
|
|
25247
|
+
var searchIndex = /* @__PURE__ */ __name((database, model, filter, query, limit, survivors, nearestOnly = false) => {
|
|
25227
25248
|
const index2 = vectorIndexOf(database, model);
|
|
25228
25249
|
if (!index2?.ready || index2.dims !== query.length)
|
|
25229
25250
|
return void 0;
|
|
25230
|
-
let k = Math.min(MAX_K, Math.max(100, limit * 4));
|
|
25251
|
+
let k = nearestOnly ? MAX_K : Math.min(MAX_K, Math.max(100, limit * 4));
|
|
25231
25252
|
for (; ; ) {
|
|
25232
25253
|
const candidates = knn(database, index2, filter, query, k);
|
|
25233
25254
|
const { results, best } = survivors(candidates);
|
|
@@ -25239,7 +25260,7 @@ var searchIndex = /* @__PURE__ */ __name((database, model, filter, query, limit,
|
|
|
25239
25260
|
if (best.length >= limit && best.every(nearer))
|
|
25240
25261
|
return results;
|
|
25241
25262
|
if (k === MAX_K)
|
|
25242
|
-
return void 0;
|
|
25263
|
+
return nearestOnly ? results : void 0;
|
|
25243
25264
|
k = Math.min(MAX_K, k * 4);
|
|
25244
25265
|
}
|
|
25245
25266
|
}, "searchIndex");
|
|
@@ -25271,7 +25292,7 @@ var dropUnusedVectors = /* @__PURE__ */ __name((database, hashes) => {
|
|
|
25271
25292
|
}, "dropUnusedVectors");
|
|
25272
25293
|
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");
|
|
25273
25294
|
|
|
25274
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
25295
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/vectors.js
|
|
25275
25296
|
var currentChunks = /* @__PURE__ */ __name((chatKey) => sql`SELECT k.content_hash, k.chunkable_id AS conversation_id, r.first_message_id,
|
|
25276
25297
|
r.last_message_id, r.text_start, r.text_end FROM conversations c
|
|
25277
25298
|
CROSS JOIN chunks k ON k.chunkable_type = 'conversation' AND k.chunkable_id = c.id
|
|
@@ -25466,19 +25487,23 @@ var nearestChunks = /* @__PURE__ */ __name((context, accountPk2, filter) => {
|
|
|
25466
25487
|
keepBest(best2, row2);
|
|
25467
25488
|
const results = ranked([...best2.values()]);
|
|
25468
25489
|
return { results, best: results.map(({ id: id2 }) => id2) };
|
|
25469
|
-
});
|
|
25490
|
+
}, chatKey === void 0);
|
|
25470
25491
|
if (indexed)
|
|
25471
25492
|
return plain2(indexed);
|
|
25472
25493
|
if (fromOwner) {
|
|
25473
|
-
const
|
|
25474
|
-
|
|
25475
|
-
|
|
25476
|
-
|
|
25477
|
-
|
|
25478
|
-
|
|
25479
|
-
|
|
25480
|
-
|
|
25481
|
-
|
|
25494
|
+
const owned = /* @__PURE__ */ __name((byIdentity) => orm.all(sql`SELECT DISTINCT k.id FROM messages m
|
|
25495
|
+
CROSS JOIN conversation_messages om ON om.message_id = m.id
|
|
25496
|
+
CROSS JOIN conversations c ON c.id = om.conversation_id
|
|
25497
|
+
JOIN conversation_state s ON s.chat_id = c.chat_id AND s.current_build = c.build
|
|
25498
|
+
JOIN chats ch ON ch.id = c.chat_id
|
|
25499
|
+
CROSS JOIN chunks k ON k.chunkable_type = 'conversation' AND k.chunkable_id = c.id
|
|
25500
|
+
CROSS JOIN chunk_messages r ON r.chunk_id = k.id AND m.id BETWEEN r.first_message_id AND r.last_message_id
|
|
25501
|
+
WHERE m.outgoing = 1 AND ch.account_id = ${accountPk2}
|
|
25502
|
+
${byIdentity ? sql`AND m.sender_identity_id IN (SELECT i.id FROM identities i JOIN accounts a
|
|
25503
|
+
ON a.provider = i.provider AND a.external_id = i.external_id WHERE a.id = ${accountPk2})` : sql``}
|
|
25504
|
+
${chatKey === void 0 ? sql`AND ch.searchable = 1` : sql`AND c.chat_id = ${chatKey}`}`).map(({ id: id2 }) => id2), "owned");
|
|
25505
|
+
const found2 = owned(true);
|
|
25506
|
+
const ids3 = found2.length ? found2 : owned(false);
|
|
25482
25507
|
const best2 = /* @__PURE__ */ new Map();
|
|
25483
25508
|
for (const row2 of rows({ ids: ids3 }))
|
|
25484
25509
|
keepBest(best2, row2);
|
|
@@ -25616,7 +25641,7 @@ var vectorCounts = /* @__PURE__ */ __name(({ orm }, models) => new Map(models.ma
|
|
|
25616
25641
|
Number(orm.get(sql`SELECT count(*) AS n FROM embeddings WHERE model = ${model}`)?.n ?? 0)
|
|
25617
25642
|
])), "vectorCounts");
|
|
25618
25643
|
|
|
25619
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
25644
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/document-pictures.js
|
|
25620
25645
|
var DOCUMENT_PICTURE = "document_picture";
|
|
25621
25646
|
var SCAN_PAGE2 = 5e3;
|
|
25622
25647
|
var idOf = /* @__PURE__ */ __name((ref3) => {
|
|
@@ -25679,12 +25704,12 @@ var documentPicturesOver = /* @__PURE__ */ __name(({ database, now: now2 }) => (
|
|
|
25679
25704
|
}, "nearestPictures")
|
|
25680
25705
|
}), "documentPicturesOver");
|
|
25681
25706
|
|
|
25682
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
25707
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/index-text.js
|
|
25683
25708
|
var noteIndexText = /* @__PURE__ */ __name((title2, text9) => title2 ? `${title2}
|
|
25684
25709
|
|
|
25685
25710
|
${text9}` : text9, "noteIndexText");
|
|
25686
25711
|
|
|
25687
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
25712
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/enrichments.js
|
|
25688
25713
|
var ENRICHMENT_SUBJECTS = ["document", "note", "email"];
|
|
25689
25714
|
var ENRICHMENT_POSITION = 1e6;
|
|
25690
25715
|
var EMAIL_ENRICHMENT = "email_enrichment";
|
|
@@ -25778,7 +25803,7 @@ var enrichmentsOver = /* @__PURE__ */ __name(({ database, now: now2 }) => ({
|
|
|
25778
25803
|
}), "clear")
|
|
25779
25804
|
}), "enrichmentsOver");
|
|
25780
25805
|
|
|
25781
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
25806
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/query-filter.js
|
|
25782
25807
|
var glob = /* @__PURE__ */ __name((value) => [...fold(value).matchAll(/\\(.)|([*?])|(.)/gsu)].map(([, escaped2, wildcard, plain2]) => {
|
|
25783
25808
|
const literal5 = escaped2 ?? plain2 ?? "";
|
|
25784
25809
|
return wildcard ?? (/[*?[]/u.test(literal5) ? `[${literal5}]` : literal5);
|
|
@@ -25854,7 +25879,7 @@ var compile = /* @__PURE__ */ __name((node, columns2, options) => {
|
|
|
25854
25879
|
var queryFilter = /* @__PURE__ */ __name((ast, columns2, options) => compile(ast.root, columns2, options), "queryFilter");
|
|
25855
25880
|
var bound2 = /* @__PURE__ */ __name(({ sql: text9, params }) => sql.join(text9.split("?").map((part2, at2) => at2 < params.length ? sql`${sql.raw(part2)}${params[at2]}` : sql.raw(part2)), sql``), "bound");
|
|
25856
25881
|
|
|
25857
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
25882
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/events.js
|
|
25858
25883
|
var toJson = /* @__PURE__ */ __name((value) => value === null || value === void 0 ? null : JSON.stringify(value), "toJson");
|
|
25859
25884
|
var fromJson = /* @__PURE__ */ __name((value) => value === null || value === void 0 ? null : JSON.parse(String(value)), "fromJson");
|
|
25860
25885
|
var int = /* @__PURE__ */ __name((value) => value === null || value === void 0 ? null : Number(value), "int");
|
|
@@ -25944,7 +25969,7 @@ var linkMeeting = /* @__PURE__ */ __name((database, id2, eventId, now2, mode = "
|
|
|
25944
25969
|
});
|
|
25945
25970
|
}, "linkMeeting");
|
|
25946
25971
|
|
|
25947
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
25972
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/task-titles.js
|
|
25948
25973
|
var MAX_TITLE = 120;
|
|
25949
25974
|
var placeholderTitleOf = /* @__PURE__ */ __name((row2) => `${String(row2.type)} \u2014 ${String(row2.source_locator ?? "")}`, "placeholderTitleOf");
|
|
25950
25975
|
var PLACEHOLDER_TITLE_SQL = "title = type || ' \u2014 ' || coalesce(source_locator, '')";
|
|
@@ -26006,7 +26031,7 @@ var fillFoundTaskTitles = /* @__PURE__ */ __name((database, warn, { batch = 500
|
|
|
26006
26031
|
}
|
|
26007
26032
|
}, "fillFoundTaskTitles");
|
|
26008
26033
|
|
|
26009
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
26034
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/note-index.js
|
|
26010
26035
|
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), ''))";
|
|
26011
26036
|
var UNSEARCHED_EVENT_TYPES = [
|
|
26012
26037
|
"working-location",
|
|
@@ -26253,7 +26278,7 @@ var resetNoteIndex = /* @__PURE__ */ __name((database) => {
|
|
|
26253
26278
|
return true;
|
|
26254
26279
|
}, "resetNoteIndex");
|
|
26255
26280
|
|
|
26256
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
26281
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/person-resolution.js
|
|
26257
26282
|
var keyOf2 = /* @__PURE__ */ __name((name) => fold(name).trim().replace(/^@/, ""), "keyOf");
|
|
26258
26283
|
var resolvePersonLinks = /* @__PURE__ */ __name((database, names) => {
|
|
26259
26284
|
for (const key2 of new Set(names.filter((name) => !!name?.trim()).map(keyOf2))) {
|
|
@@ -26272,7 +26297,7 @@ var resolvePersonLinks = /* @__PURE__ */ __name((database, names) => {
|
|
|
26272
26297
|
}
|
|
26273
26298
|
}, "resolvePersonLinks");
|
|
26274
26299
|
|
|
26275
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
26300
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/schema/canonical-tags.js
|
|
26276
26301
|
var canonicalTags = sqliteTable("canonical_tags", {
|
|
26277
26302
|
id: integer("id").primaryKey(),
|
|
26278
26303
|
name: text("name").notNull().unique(),
|
|
@@ -26281,7 +26306,7 @@ var canonicalTags = sqliteTable("canonical_tags", {
|
|
|
26281
26306
|
updatedAt: integer("updated_at").notNull()
|
|
26282
26307
|
});
|
|
26283
26308
|
|
|
26284
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
26309
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/schema/link-revisions.js
|
|
26285
26310
|
var linkRevisions = sqliteTable("link_revisions", {
|
|
26286
26311
|
id: integer("id").primaryKey(),
|
|
26287
26312
|
linkId: integer("link_id").notNull(),
|
|
@@ -26293,7 +26318,7 @@ var linkRevisions = sqliteTable("link_revisions", {
|
|
|
26293
26318
|
createdAt: integer("created_at").notNull()
|
|
26294
26319
|
}, (table) => [index("link_revisions_by_link_id_created_at").on(table.linkId, table.createdAt)]);
|
|
26295
26320
|
|
|
26296
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
26321
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/schema/document-transfers.js
|
|
26297
26322
|
var documentAnnotationTransfers = sqliteTable("document_annotation_transfers", {
|
|
26298
26323
|
sourceKey: text("source_key").notNull(),
|
|
26299
26324
|
collection: text("collection").notNull(),
|
|
@@ -26303,13 +26328,13 @@ var documentAnnotationTransfers = sqliteTable("document_annotation_transfers", {
|
|
|
26303
26328
|
createdAt: integer("created_at").notNull()
|
|
26304
26329
|
}, (table) => [primaryKey({ columns: [table.sourceKey, table.collection] })]);
|
|
26305
26330
|
|
|
26306
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
26331
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/schema/document-index-pending.js
|
|
26307
26332
|
var documentIndexPending = sqliteTable("document_index_pending", {
|
|
26308
26333
|
id: integer("id").notNull(),
|
|
26309
26334
|
indexableType: text("indexable_type").notNull()
|
|
26310
26335
|
}, (table) => [primaryKey({ columns: [table.indexableType, table.id] })]);
|
|
26311
26336
|
|
|
26312
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
26337
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/schema/decision-requests.js
|
|
26313
26338
|
var decisionRequests = sqliteTable("decision_requests", {
|
|
26314
26339
|
id: integer("id").primaryKey(),
|
|
26315
26340
|
tokenDigest: text("token_digest").notNull().unique(),
|
|
@@ -26329,7 +26354,7 @@ var decisionRequests = sqliteTable("decision_requests", {
|
|
|
26329
26354
|
index("decision_requests_by_channel_bot_profile_chat_id_message_id").on(table.channel, table.botProfile, table.chatId, table.messageId)
|
|
26330
26355
|
]);
|
|
26331
26356
|
|
|
26332
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
26357
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/schema/enrichments.js
|
|
26333
26358
|
var enrichments = sqliteTable("enrichments", {
|
|
26334
26359
|
subjectType: text("subject_type").notNull(),
|
|
26335
26360
|
subjectId: integer("subject_id").notNull(),
|
|
@@ -26341,7 +26366,7 @@ var enrichments = sqliteTable("enrichments", {
|
|
|
26341
26366
|
createdAt: integer("created_at").notNull()
|
|
26342
26367
|
}, (table) => [primaryKey({ columns: [table.subjectType, table.subjectId] })]);
|
|
26343
26368
|
|
|
26344
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
26369
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/schema/templates.js
|
|
26345
26370
|
var templates = sqliteTable("templates", {
|
|
26346
26371
|
key: text("key").notNull(),
|
|
26347
26372
|
channel: text("channel").notNull(),
|
|
@@ -26363,7 +26388,7 @@ var templatesHistory = sqliteTable("templates_history", {
|
|
|
26363
26388
|
index("templates_history_by_key_channel_language_id").on(table.key, table.channel, table.language, table.id)
|
|
26364
26389
|
]);
|
|
26365
26390
|
|
|
26366
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
26391
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/schema/links.js
|
|
26367
26392
|
var links = sqliteTable("links", {
|
|
26368
26393
|
id: integer("id").primaryKey(),
|
|
26369
26394
|
fromType: text("from_type").notNull(),
|
|
@@ -26394,7 +26419,7 @@ var links = sqliteTable("links", {
|
|
|
26394
26419
|
index("links_by_to_type_to_id").on(table.toType, table.toId)
|
|
26395
26420
|
]);
|
|
26396
26421
|
|
|
26397
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
26422
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/schema/tag-consolidations.js
|
|
26398
26423
|
var tagRedirects = sqliteTable("tag_redirects", {
|
|
26399
26424
|
sourceId: integer("source_id").primaryKey().references(() => canonicalTags.id),
|
|
26400
26425
|
survivorId: integer("survivor_id").notNull().references(() => canonicalTags.id),
|
|
@@ -26420,7 +26445,7 @@ var tagConsolidations = sqliteTable("tag_consolidations", {
|
|
|
26420
26445
|
index("tag_consolidations_by_actor_type_actor_id").on(table.actorType, table.actorId)
|
|
26421
26446
|
]);
|
|
26422
26447
|
|
|
26423
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
26448
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/schema.js
|
|
26424
26449
|
var accounts = sqliteTable("accounts", {
|
|
26425
26450
|
id: integer("id").primaryKey(),
|
|
26426
26451
|
provider: text("provider").notNull(),
|
|
@@ -28587,7 +28612,7 @@ var storeSettings = sqliteTable("store_settings", {
|
|
|
28587
28612
|
at: integer("at").notNull()
|
|
28588
28613
|
});
|
|
28589
28614
|
|
|
28590
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
28615
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/identities.js
|
|
28591
28616
|
var contactsOf = /* @__PURE__ */ __name(({ phones: phones2, emails: emails3 }) => {
|
|
28592
28617
|
if (phones2 === void 0 && emails3 === void 0)
|
|
28593
28618
|
return void 0;
|
|
@@ -28833,7 +28858,7 @@ var meetingIdentityPk = /* @__PURE__ */ __name((context, accountId, identity) =>
|
|
|
28833
28858
|
}, "meetingIdentityPk");
|
|
28834
28859
|
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");
|
|
28835
28860
|
|
|
28836
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
28861
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/domain/ref-arguments.js
|
|
28837
28862
|
var TAKES = {
|
|
28838
28863
|
chat: "a chat: chat:<provider>/<account>/<chat>, its id or its title",
|
|
28839
28864
|
message: "a message: msg:<provider>/<account>/<chat>/<message>, or a chat and the message's id"
|
|
@@ -28893,7 +28918,7 @@ var ensureAccount = /* @__PURE__ */ __name(async (reference2, scope3, profilesOn
|
|
|
28893
28918
|
throw wrongAccount(reference2, scope3, profiles);
|
|
28894
28919
|
}, "ensureAccount");
|
|
28895
28920
|
|
|
28896
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
28921
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/search/trigrams.js
|
|
28897
28922
|
var trigrams = /* @__PURE__ */ __name((term) => {
|
|
28898
28923
|
const padded = ` ${term} `;
|
|
28899
28924
|
const pieces = /* @__PURE__ */ new Set();
|
|
@@ -28902,7 +28927,7 @@ var trigrams = /* @__PURE__ */ __name((term) => {
|
|
|
28902
28927
|
return [...pieces];
|
|
28903
28928
|
}, "trigrams");
|
|
28904
28929
|
|
|
28905
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
28930
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/resolve.js
|
|
28906
28931
|
var isId = /* @__PURE__ */ __name((reference2) => /^-?\d+$/.test(reference2.trim()), "isId");
|
|
28907
28932
|
var foldName = /* @__PURE__ */ __name((name) => name.normalize("NFC").replace(/[\uFE0E\uFE0F\u200D]/g, "").toLowerCase().replaceAll("\u0451", "\u0435"), "foldName");
|
|
28908
28933
|
var pickChat = /* @__PURE__ */ __name((reference2, chats2) => {
|
|
@@ -28973,7 +28998,7 @@ ${lines}`, { candidates });
|
|
|
28973
28998
|
}, "ambiguous");
|
|
28974
28999
|
var isPresent = /* @__PURE__ */ __name((value) => value !== null && value !== void 0, "isPresent");
|
|
28975
29000
|
|
|
28976
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
29001
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/domain/display-names.js
|
|
28977
29002
|
var QUOTES = [
|
|
28978
29003
|
['"', '"'],
|
|
28979
29004
|
["'", "'"],
|
|
@@ -29031,7 +29056,7 @@ var nameKey = /* @__PURE__ */ __name((name) => {
|
|
|
29031
29056
|
}, "nameKey");
|
|
29032
29057
|
var isReadable = /* @__PURE__ */ __name((shown2) => shown2 !== null && READABLE.test(shown2), "isReadable");
|
|
29033
29058
|
|
|
29034
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
29059
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/person-separation.js
|
|
29035
29060
|
var identitiesOf = /* @__PURE__ */ __name(({ database }, person2) => database.prepare("SELECT identity_id AS pk FROM identity_links WHERE person_id = ?").all(person2).map(({ pk }) => Number(pk)), "identitiesOf");
|
|
29036
29061
|
var MOVED_AWAY = `moved.identity_id IN (SELECT value FROM json_each(?))
|
|
29037
29062
|
AND (moved.from_person_id IN (SELECT value FROM json_each(?))
|
|
@@ -29046,7 +29071,7 @@ var apart = /* @__PURE__ */ __name(({ database }, one2, other) => {
|
|
|
29046
29071
|
var separated = /* @__PURE__ */ __name((context, one2, other) => one2 !== other && apart(context, { identities: identitiesOf(context, one2), person: one2 }, { identities: identitiesOf(context, other), person: other }), "separated");
|
|
29047
29072
|
var identitySeparated = /* @__PURE__ */ __name((context, identity, person2) => apart(context, { identities: [identity] }, { identities: identitiesOf(context, person2).filter((pk) => pk !== identity), person: person2 }), "identitySeparated");
|
|
29048
29073
|
|
|
29049
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
29074
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/reads.js
|
|
29050
29075
|
var MESSAGE_FIELDS = {
|
|
29051
29076
|
pk: messages.id,
|
|
29052
29077
|
nativeId: messages.externalId,
|
|
@@ -29226,7 +29251,7 @@ var chatActivity = /* @__PURE__ */ __name(({ database }, accountKey, since, wher
|
|
|
29226
29251
|
storedAt: toIso(Number(database.prepare("SELECT max(created_at) AS at FROM messages WHERE account_id = ?").get(accountKey)?.at) || null)
|
|
29227
29252
|
}), "chatActivity");
|
|
29228
29253
|
|
|
29229
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
29254
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/search.js
|
|
29230
29255
|
var HIT_FIELDS = {
|
|
29231
29256
|
...MESSAGE_FIELDS,
|
|
29232
29257
|
chatTitle: sql`${chats.title}`.as("chat_title"),
|
|
@@ -29327,7 +29352,7 @@ var directReplies = /* @__PURE__ */ __name((context, parents, limit) => {
|
|
|
29327
29352
|
};
|
|
29328
29353
|
}, "directReplies");
|
|
29329
29354
|
|
|
29330
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
29355
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/person-links.js
|
|
29331
29356
|
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");
|
|
29332
29357
|
var required = /* @__PURE__ */ __name((context, ref3) => {
|
|
29333
29358
|
const found2 = identityRow(context, ref3);
|
|
@@ -29540,7 +29565,7 @@ var mentioning = /* @__PURE__ */ __name((context, accountKey, { id: id2, usernam
|
|
|
29540
29565
|
}, "mentioning");
|
|
29541
29566
|
var escaped = /* @__PURE__ */ __name((text9) => text9.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), "escaped");
|
|
29542
29567
|
|
|
29543
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
29568
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/actors.js
|
|
29544
29569
|
var BOT_KINDS = ["agent", "rule", "script", "integration"];
|
|
29545
29570
|
var ownerPerson = /* @__PURE__ */ __name((database) => {
|
|
29546
29571
|
const found2 = database.prepare("SELECT id FROM persons WHERE owner = 1 ORDER BY id LIMIT 1").get();
|
|
@@ -29597,7 +29622,7 @@ var proposedBySql = /* @__PURE__ */ __name((type, id2, by) => {
|
|
|
29597
29622
|
return { sql: bot("pb.name = ?"), params: [by.bot] };
|
|
29598
29623
|
}, "proposedBySql");
|
|
29599
29624
|
|
|
29600
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
29625
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/source-review-marks.js
|
|
29601
29626
|
var TABLES = { memory: "memories", fact: "facts" };
|
|
29602
29627
|
var HOLDING = { memory: ["proposed", "confirmed"], fact: ["proposed", "accepted"] };
|
|
29603
29628
|
var KEPT = 20;
|
|
@@ -29692,7 +29717,7 @@ var scrubSourceReviews = /* @__PURE__ */ __name((database, erased, { refs }) =>
|
|
|
29692
29717
|
return scrubbed;
|
|
29693
29718
|
}, "scrubSourceReviews");
|
|
29694
29719
|
|
|
29695
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
29720
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/evidence-signature.js
|
|
29696
29721
|
var QUOTE_LIMIT = 500;
|
|
29697
29722
|
var GONE = { sig: "gone", rev: null, deleted: true, changedAt: null };
|
|
29698
29723
|
var part = /* @__PURE__ */ __name((value) => value == null ? "" : String(value), "part");
|
|
@@ -29971,11 +29996,11 @@ var deleteDocumentRow = /* @__PURE__ */ __name((database, id2, at2) => {
|
|
|
29971
29996
|
database.prepare("DELETE FROM documents WHERE id = ?").run(id2);
|
|
29972
29997
|
}, "deleteDocumentRow");
|
|
29973
29998
|
|
|
29974
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
29999
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/domain/ref-summaries.js
|
|
29975
30000
|
var profilesOn = /* @__PURE__ */ __name((profiles, app, key2) => Object.entries(profiles[app] ?? {}).filter(([, saved]) => saved.provider === key2.provider && saved.account === key2.account).map(([name]) => name), "profilesOn");
|
|
29976
30001
|
var oneLine = /* @__PURE__ */ __name((text9) => singleLine(text9.replace(/\s+/g, " ").trim()), "oneLine");
|
|
29977
30002
|
|
|
29978
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
30003
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/ref-accounts.js
|
|
29979
30004
|
var accountKeys = /* @__PURE__ */ __name((database, ids3) => {
|
|
29980
30005
|
const unique2 = [...new Set(ids3)];
|
|
29981
30006
|
if (unique2.length === 0)
|
|
@@ -30064,7 +30089,7 @@ var refEndsOf = /* @__PURE__ */ __name((database, text9) => {
|
|
|
30064
30089
|
}, "refEndsOf");
|
|
30065
30090
|
var refAccountsOf = /* @__PURE__ */ __name((database, text9) => refEndsOf(database, text9)?.flat(), "refAccountsOf");
|
|
30066
30091
|
|
|
30067
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
30092
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/ref-summaries.js
|
|
30068
30093
|
var EXCERPT_CHARS = 280;
|
|
30069
30094
|
var TITLE_CHARS = 120;
|
|
30070
30095
|
var MEMORY_TITLE_CHARS = 80;
|
|
@@ -30488,7 +30513,7 @@ var refsStoreOver = /* @__PURE__ */ __name((context) => ({
|
|
|
30488
30513
|
ends: /* @__PURE__ */ __name(async (text9) => refEndsOf(context.database, text9), "ends")
|
|
30489
30514
|
}), "refsStoreOver");
|
|
30490
30515
|
|
|
30491
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
30516
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/evidence-sources.js
|
|
30492
30517
|
var sourceOf3 = /* @__PURE__ */ __name((read2, ref3) => ({
|
|
30493
30518
|
ref: ref3,
|
|
30494
30519
|
kind: read2.kind,
|
|
@@ -30526,7 +30551,7 @@ var evidenceSourcesOf = /* @__PURE__ */ __name((database, from2) => {
|
|
|
30526
30551
|
});
|
|
30527
30552
|
}, "evidenceSourcesOf");
|
|
30528
30553
|
|
|
30529
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
30554
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/attachments/limits.js
|
|
30530
30555
|
var MAX_FILE_BYTES = 50 * 1024 * 1024;
|
|
30531
30556
|
var MAX_TEXT_CHARS = 2e6;
|
|
30532
30557
|
var ATTACHMENT_LIMIT_ENV = [
|
|
@@ -30552,7 +30577,7 @@ var pdfPreviewLimits = /* @__PURE__ */ __name((env = process.env) => {
|
|
|
30552
30577
|
return { pixels, bytes: positive(env, "MESSAGING_PDF_PREVIEW_MAX_MIB", 8 * 1024 * 1024, 1024 * 1024) };
|
|
30553
30578
|
}, "pdfPreviewLimits");
|
|
30554
30579
|
|
|
30555
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
30580
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/ulid.js
|
|
30556
30581
|
import { randomBytes } from "node:crypto";
|
|
30557
30582
|
var CROCKFORD = "0123456789ABCDEFGHJKMNPQRSTVWXYZ";
|
|
30558
30583
|
var ulid = /* @__PURE__ */ __name((now2 = Date.now()) => {
|
|
@@ -30565,7 +30590,7 @@ var ulid = /* @__PURE__ */ __name((now2 = Date.now()) => {
|
|
|
30565
30590
|
return time3 + random;
|
|
30566
30591
|
}, "ulid");
|
|
30567
30592
|
|
|
30568
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
30593
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/document-metadata.js
|
|
30569
30594
|
var FOLDED_FIELDS = ["title", "site", "language", "author"];
|
|
30570
30595
|
var encodeDocumentMetadata = /* @__PURE__ */ __name((meta, sections) => {
|
|
30571
30596
|
if (!meta && !sections?.length)
|
|
@@ -30586,11 +30611,11 @@ var languageOf = /* @__PURE__ */ __name((meta) => {
|
|
|
30586
30611
|
return typeof language === "string" && language !== "" ? language : null;
|
|
30587
30612
|
}, "languageOf");
|
|
30588
30613
|
|
|
30589
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
30614
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/file-note.js
|
|
30590
30615
|
var LIVE3 = "f.deleted_at IS NULL AND d.deleted_at IS NULL AND coalesce(json_extract(d.metadata, '$.catalog.active'), 1)=1";
|
|
30591
30616
|
var fileNoteRow = /* @__PURE__ */ __name((database, account, local, path) => database.prepare(local ? `SELECT d.*, f.account_id AS account_id, f.external_id AS external_id, coalesce(f.external_updated_at, d.external_updated_at) AS external_updated_at FROM files f JOIN documents d ON d.id = f.document_id WHERE f.account_id = ? AND f.external_id = ? AND ${LIVE3} ORDER BY d.created_at, d.id LIMIT 1` : `SELECT d.*, f.account_id AS account_id, coalesce(f.external_updated_at, d.external_updated_at) AS external_updated_at FROM documents d JOIN files f ON f.document_id = d.id AND f.account_id = d.account_id WHERE d.account_id = ? AND d.external_id = ? AND ${LIVE3} LIMIT 1`).get(account, path), "fileNoteRow");
|
|
30592
30617
|
|
|
30593
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
30618
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/files.js
|
|
30594
30619
|
var isObject2 = /* @__PURE__ */ __name((value) => value !== null && typeof value === "object" && !Array.isArray(value), "isObject");
|
|
30595
30620
|
var objectOf2 = /* @__PURE__ */ __name((value) => {
|
|
30596
30621
|
if (isObject2(value))
|
|
@@ -30837,7 +30862,7 @@ var filesStoreOver = /* @__PURE__ */ __name(({ database, now: now2 }) => {
|
|
|
30837
30862
|
};
|
|
30838
30863
|
}, "filesStoreOver");
|
|
30839
30864
|
|
|
30840
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
30865
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/imported-documents.js
|
|
30841
30866
|
var IMPORTED_DOCUMENT_QUERY = defineQuery({
|
|
30842
30867
|
entity: "document",
|
|
30843
30868
|
backend: "sql",
|
|
@@ -30883,7 +30908,7 @@ var importedDocumentWhere = /* @__PURE__ */ __name((database, query) => {
|
|
|
30883
30908
|
return queryFilter(validateQuery(query, IMPORTED_DOCUMENT_QUERY), columns2, { zone: timezoneOf() });
|
|
30884
30909
|
}, "importedDocumentWhere");
|
|
30885
30910
|
|
|
30886
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
30911
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/link-reviews.js
|
|
30887
30912
|
var reviewLink = /* @__PURE__ */ __name((database, linkable, entity, candidates, reason, now2) => {
|
|
30888
30913
|
database.prepare(`INSERT INTO link_reviews (linkable_type, linkable_id, entity_type, candidates, reason, status, created_at, updated_at)
|
|
30889
30914
|
VALUES (?, ?, ?, ?, ?, 'open', ?, ?)
|
|
@@ -30891,7 +30916,7 @@ var reviewLink = /* @__PURE__ */ __name((database, linkable, entity, candidates,
|
|
|
30891
30916
|
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);
|
|
30892
30917
|
}, "reviewLink");
|
|
30893
30918
|
|
|
30894
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
30919
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/link-row.js
|
|
30895
30920
|
var iso3 = /* @__PURE__ */ __name((value) => new Date(Number(value)).toISOString(), "iso");
|
|
30896
30921
|
var thingRef = /* @__PURE__ */ __name((database, type, id2) => type == null || id2 == null ? null : referenceOfThing(database, storedThing(type, id2)) ?? null, "thingRef");
|
|
30897
30922
|
var hasBothEnds = /* @__PURE__ */ __name((link3) => link3.from !== null && link3.to !== null, "hasBothEnds");
|
|
@@ -30925,7 +30950,7 @@ var linkOf = /* @__PURE__ */ __name((database, row2) => {
|
|
|
30925
30950
|
};
|
|
30926
30951
|
}, "linkOf");
|
|
30927
30952
|
|
|
30928
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
30953
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/note-dates.js
|
|
30929
30954
|
var dateFileNotes = /* @__PURE__ */ __name((database, folder, dates) => {
|
|
30930
30955
|
const fileAt = database.prepare("SELECT id, document_id FROM files WHERE account_id = ? AND external_id = ? AND kind <> 'folder' AND deleted_at IS NULL");
|
|
30931
30956
|
const legacy = database.prepare("SELECT id FROM documents WHERE account_id = ? AND external_id = ? AND deleted_at IS NULL");
|
|
@@ -30946,7 +30971,7 @@ var dateFileNotes = /* @__PURE__ */ __name((database, folder, dates) => {
|
|
|
30946
30971
|
return changed;
|
|
30947
30972
|
}, "dateFileNotes");
|
|
30948
30973
|
|
|
30949
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
30974
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/text-input.js
|
|
30950
30975
|
var textOf2 = /* @__PURE__ */ __name((text9, what, max = 1e5, allowEmpty = false) => {
|
|
30951
30976
|
const value = text9.trim();
|
|
30952
30977
|
if (!value && !allowEmpty || value.length > max)
|
|
@@ -30959,7 +30984,7 @@ var oneOf = /* @__PURE__ */ __name((value, allowed, what) => {
|
|
|
30959
30984
|
return value;
|
|
30960
30985
|
}, "oneOf");
|
|
30961
30986
|
|
|
30962
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
30987
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/notes.js
|
|
30963
30988
|
var NOTE_FORMATS = ["obsidian", "markdown"];
|
|
30964
30989
|
var RELATIONSHIPS = RELATION_KINDS.map(linkKind).join(", ");
|
|
30965
30990
|
var iso4 = /* @__PURE__ */ __name((value) => new Date(Number(value)).toISOString(), "iso");
|
|
@@ -31481,10 +31506,10 @@ var notesStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
31481
31506
|
};
|
|
31482
31507
|
}, "notesStoreOver");
|
|
31483
31508
|
|
|
31484
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
31509
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/rows-page.js
|
|
31485
31510
|
var pageOfRows = /* @__PURE__ */ __name((rows, limit, offset = 0) => rows.length > limit ? { items: rows.slice(0, limit), hasMore: true, nextOffset: offset + limit } : { items: rows, hasMore: false }, "pageOfRows");
|
|
31486
31511
|
|
|
31487
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
31512
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/memories.js
|
|
31488
31513
|
var NAMED = "SELECT m.*, b.name AS author_name, b.kind AS author_kind FROM memories m LEFT JOIN bots b ON m.author_type = 'bot' AND b.id = m.author_id";
|
|
31489
31514
|
var iso5 = /* @__PURE__ */ __name((value) => new Date(Number(value)).toISOString(), "iso");
|
|
31490
31515
|
var oneOf2 = /* @__PURE__ */ __name((value, allowed, what) => {
|
|
@@ -31749,7 +31774,7 @@ var memoriesStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
31749
31774
|
};
|
|
31750
31775
|
}, "memoriesStoreOver");
|
|
31751
31776
|
|
|
31752
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
31777
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/reviewed.js
|
|
31753
31778
|
var prefixesText = /* @__PURE__ */ __name((types) => `${article(types[0] ?? "")} ${types.map((type) => `${type}:`).join(" or ")}`, "prefixesText");
|
|
31754
31779
|
var refuse = /* @__PURE__ */ __name((message3, reason, code = "validation_error") => {
|
|
31755
31780
|
throw new CliError(code, message3, { reason });
|
|
@@ -31897,7 +31922,7 @@ var reviewedRowsOver = /* @__PURE__ */ __name((context) => {
|
|
|
31897
31922
|
return { partyOf, partyThing, reviewedOf, written, keepEvidence, ownerOnly: ownerOnly2, linkedId, ...decisionsOver(context) };
|
|
31898
31923
|
}, "reviewedRowsOver");
|
|
31899
31924
|
|
|
31900
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
31925
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/money-lines.js
|
|
31901
31926
|
var MAX_LINES = 500;
|
|
31902
31927
|
var PARENTS = {
|
|
31903
31928
|
invoice: {
|
|
@@ -31997,7 +32022,7 @@ var moneyLinesOver = /* @__PURE__ */ __name(({ database }) => {
|
|
|
31997
32022
|
return { linesOf, insertLines, shownLines, appendLine, deleteLine, sumOf, retotal };
|
|
31998
32023
|
}, "moneyLinesOver");
|
|
31999
32024
|
|
|
32000
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
32025
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/refunds.js
|
|
32001
32026
|
var COUNTED = {
|
|
32002
32027
|
confirmed: "np.review = 'confirmed' AND np.deleted_at IS NULL",
|
|
32003
32028
|
// A proposed refund promises nothing back yet, so it must not free room an import could then fill.
|
|
@@ -32072,7 +32097,7 @@ var refundRulesOver = /* @__PURE__ */ __name((context) => {
|
|
|
32072
32097
|
return { originalFor, refundShare, confirmable, keepsRefunded, keepsShare, keepsInvoice };
|
|
32073
32098
|
}, "refundRulesOver");
|
|
32074
32099
|
|
|
32075
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
32100
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/finance.js
|
|
32076
32101
|
var FINANCE_TYPES = ["invoice", "payment"];
|
|
32077
32102
|
var isFinanceType = /* @__PURE__ */ __name((type) => FINANCE_TYPES.includes(type), "isFinanceType");
|
|
32078
32103
|
var PAID = netPaidSql("i.id");
|
|
@@ -32476,7 +32501,7 @@ var financeStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
32476
32501
|
};
|
|
32477
32502
|
}, "financeStoreOver");
|
|
32478
32503
|
|
|
32479
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
32504
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/payment-entries.js
|
|
32480
32505
|
var refuse2 = /* @__PURE__ */ __name((message3, reason) => {
|
|
32481
32506
|
throw new CliError("validation_error", message3, { reason });
|
|
32482
32507
|
}, "refuse");
|
|
@@ -32554,7 +32579,7 @@ var paymentEntriesOver = /* @__PURE__ */ __name((context) => {
|
|
|
32554
32579
|
};
|
|
32555
32580
|
}, "paymentEntriesOver");
|
|
32556
32581
|
|
|
32557
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
32582
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/evidence-findings.js
|
|
32558
32583
|
var EVIDENCE_FINDINGS_KIND = "evidence_findings";
|
|
32559
32584
|
var reference = /* @__PURE__ */ __name((raw) => {
|
|
32560
32585
|
if (/^(document|note):[1-9]\d*$/.test(raw))
|
|
@@ -32581,7 +32606,7 @@ var validateEvidenceFindings = /* @__PURE__ */ __name((input) => {
|
|
|
32581
32606
|
return valid;
|
|
32582
32607
|
}, "validateEvidenceFindings");
|
|
32583
32608
|
|
|
32584
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
32609
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/proposed-actions.js
|
|
32585
32610
|
var PROPOSAL_STATUSES = ["proposed", "approved", "rejected", "executed", "failed"];
|
|
32586
32611
|
var PROPOSAL_VERDICTS = ["useful", "not_useful"];
|
|
32587
32612
|
var iso7 = /* @__PURE__ */ __name((value) => value == null ? null : new Date(Number(value)).toISOString(), "iso");
|
|
@@ -32775,7 +32800,7 @@ var proposedActionsStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
32775
32800
|
};
|
|
32776
32801
|
}, "proposedActionsStoreOver");
|
|
32777
32802
|
|
|
32778
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
32803
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/identity-proposals.js
|
|
32779
32804
|
var CONFIRMED = "proposal";
|
|
32780
32805
|
var refOf = /* @__PURE__ */ __name(({ database }, pk) => {
|
|
32781
32806
|
const row2 = database.prepare("SELECT provider, external_id FROM identities WHERE id = ?").get(pk);
|
|
@@ -33127,7 +33152,7 @@ var identityLinkRows = /* @__PURE__ */ __name((context, { person: person2, statu
|
|
|
33127
33152
|
return { items, hasMore: rows.length > limit };
|
|
33128
33153
|
}, "identityLinkRows");
|
|
33129
33154
|
|
|
33130
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
33155
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/person-merges.js
|
|
33131
33156
|
var mergeId = /* @__PURE__ */ __name((to, from2) => `merge:${to}-${from2}`, "mergeId");
|
|
33132
33157
|
var parseMergeId = /* @__PURE__ */ __name((id2) => {
|
|
33133
33158
|
const found2 = /^merge:([1-9]\d*)-([1-9]\d*)$/.exec(id2.trim());
|
|
@@ -33230,7 +33255,7 @@ var split = /* @__PURE__ */ __name((context, uid, refs, by) => {
|
|
|
33230
33255
|
return recordOf(context, alone);
|
|
33231
33256
|
}, "split");
|
|
33232
33257
|
|
|
33233
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
33258
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/identity-split-proposals.js
|
|
33234
33259
|
var refOf2 = /* @__PURE__ */ __name(({ provider, id: id2 }) => `${provider}:${id2}`, "refOf");
|
|
33235
33260
|
var keyOf3 = /* @__PURE__ */ __name((split2, person2, identities2) => `${split2} ${person2} ${[...identities2].sort().join(" ")}`, "keyOf");
|
|
33236
33261
|
var planOf = /* @__PURE__ */ __name((context, input) => {
|
|
@@ -33407,7 +33432,7 @@ var forgetErasedSplits = /* @__PURE__ */ __name((database) => {
|
|
|
33407
33432
|
database.prepare("DELETE FROM proposed_actions WHERE id = ?").run(Number(row2.id));
|
|
33408
33433
|
}, "forgetErasedSplits");
|
|
33409
33434
|
|
|
33410
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
33435
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/domain/test-data.js
|
|
33411
33436
|
var SEED_PEOPLE = [
|
|
33412
33437
|
{ name: "Owner", username: "owner" },
|
|
33413
33438
|
{ name: "Ann Lee", username: "ann" },
|
|
@@ -33424,7 +33449,7 @@ var RESERVED_ADDRESS_GLOBS = [
|
|
|
33424
33449
|
];
|
|
33425
33450
|
var SEED_ID_GLOBS = ["person-[0-9]*"];
|
|
33426
33451
|
|
|
33427
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
33452
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/test-people.js
|
|
33428
33453
|
var TEST_DATA_KIND = "test_data";
|
|
33429
33454
|
var globs = /* @__PURE__ */ __name((column2, patterns) => patterns.map((pattern) => `${column2} GLOB '${pattern}'`).join(" OR "), "globs");
|
|
33430
33455
|
var SURE = `(${globs("i.external_id", SEED_ID_GLOBS)} OR ${globs("lower(i.email)", RESERVED_ADDRESS_GLOBS)})`;
|
|
@@ -33493,7 +33518,7 @@ var forgetErasedTestData = /* @__PURE__ */ __name((database) => {
|
|
|
33493
33518
|
database.prepare("DELETE FROM proposed_actions WHERE id = ?").run(Number(row2.id));
|
|
33494
33519
|
}, "forgetErasedTestData");
|
|
33495
33520
|
|
|
33496
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
33521
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/accounts.js
|
|
33497
33522
|
var accountPk = /* @__PURE__ */ __name(({ orm, now: now2 }, { provider, account, scope: scope3 }, name = null, startScope) => Number(orm.insert(accounts).values({
|
|
33498
33523
|
provider,
|
|
33499
33524
|
externalId: account,
|
|
@@ -33587,7 +33612,7 @@ var dropOrphanPeople = /* @__PURE__ */ __name((database, unseenBefore) => {
|
|
|
33587
33612
|
AND id NOT IN (SELECT id FROM (${referencesTo(database, "persons", /* @__PURE__ */ new Set(["identity_links"]))}) WHERE id IS NOT NULL)`).run(JSON.stringify(persons2));
|
|
33588
33613
|
}, "dropOrphanPeople");
|
|
33589
33614
|
|
|
33590
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
33615
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/history-skips.js
|
|
33591
33616
|
var HISTORY_KEY = "$history";
|
|
33592
33617
|
var objectOf3 = /* @__PURE__ */ __name((text9) => {
|
|
33593
33618
|
if (typeof text9 !== "string")
|
|
@@ -33663,7 +33688,7 @@ var withoutHistory = /* @__PURE__ */ __name((metadata3) => {
|
|
|
33663
33688
|
return rest;
|
|
33664
33689
|
}, "withoutHistory");
|
|
33665
33690
|
|
|
33666
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
33691
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/chats.js
|
|
33667
33692
|
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");
|
|
33668
33693
|
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");
|
|
33669
33694
|
var setChatScope = /* @__PURE__ */ __name((context, accountKey, chatId, scope3) => {
|
|
@@ -33961,7 +33986,7 @@ var replaceAutoTags = /* @__PURE__ */ __name((context, key2, chatId, algorithm,
|
|
|
33961
33986
|
}
|
|
33962
33987
|
}, "replaceAutoTags");
|
|
33963
33988
|
|
|
33964
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
33989
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/domain/counters.js
|
|
33965
33990
|
var COUNTER_FIELDS = ["views", "reactions", "comments"];
|
|
33966
33991
|
var validCounter = /* @__PURE__ */ __name((value) => typeof value === "number" && Number.isFinite(value) && value >= 0, "validCounter");
|
|
33967
33992
|
var counterValue = /* @__PURE__ */ __name((message3, field4) => {
|
|
@@ -33998,7 +34023,7 @@ var counterFreshness = /* @__PURE__ */ __name((states) => {
|
|
|
33998
34023
|
return states.some((one2) => one2.freshness === "stale") ? "stale" : "fresh";
|
|
33999
34024
|
}, "counterFreshness");
|
|
34000
34025
|
|
|
34001
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34026
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/bot-tokens.js
|
|
34002
34027
|
var BOT_TOKEN = /(?<!\d)(\d{6,12}):[A-Za-z0-9_-]{30,40}(?![A-Za-z0-9_-])/g;
|
|
34003
34028
|
var MAY_HOLD = "*[0-9][0-9][0-9][0-9][0-9][0-9]:*";
|
|
34004
34029
|
var MASKED_THROUGH = "bot_tokens_masked_through";
|
|
@@ -34038,7 +34063,7 @@ var maskStoredBotTokens = /* @__PURE__ */ __name((context) => {
|
|
|
34038
34063
|
}, "maskStoredBotTokens");
|
|
34039
34064
|
var masks = /* @__PURE__ */ __name((value) => value != null && withoutBotTokens(String(value)) !== value, "masks");
|
|
34040
34065
|
|
|
34041
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34066
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/context/evidence.js
|
|
34042
34067
|
import { createHash as createHash4 } from "node:crypto";
|
|
34043
34068
|
var CONTEXT_MAX_READ_BYTES = 262144;
|
|
34044
34069
|
var CONTEXT_SOURCE_KINDS = ["message", "mail", "document", "meeting"];
|
|
@@ -34136,7 +34161,7 @@ var contextEvidenceRequest = /* @__PURE__ */ __name((input) => {
|
|
|
34136
34161
|
return { source: source2, query, chat: chat2, senders, words: words4, after: after2, before: before2, limit, maxReadBytes, cursor, signal: input.signal };
|
|
34137
34162
|
}, "contextEvidenceRequest");
|
|
34138
34163
|
|
|
34139
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34164
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/email-activity.js
|
|
34140
34165
|
var MAIL_AGENDA_COLUMNS = { chat_kind: { type: "enum", sql: "'dialog'" } };
|
|
34141
34166
|
var ACTIVITY = `
|
|
34142
34167
|
SELECT t.external_id AS thread, t.subject, t.last_email_at, t.emails_count,
|
|
@@ -34266,7 +34291,7 @@ var mailActivity = /* @__PURE__ */ __name((database) => ({
|
|
|
34266
34291
|
threadActivity: /* @__PURE__ */ __name(async (accountId, since, where) => threadActivity(database, accountId, since, where), "threadActivity")
|
|
34267
34292
|
}), "mailActivity");
|
|
34268
34293
|
|
|
34269
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34294
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/conversations/mail-text.js
|
|
34270
34295
|
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");
|
|
34271
34296
|
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;
|
|
34272
34297
|
var ATTRIBUTION = /(wrote|написал[аи]?|escribió|a écrit|schrieb)\s*:\s*$/iu;
|
|
@@ -34347,7 +34372,7 @@ var mailCore = /* @__PURE__ */ __name((body2, earlier) => {
|
|
|
34347
34372
|
return withoutSignOff(withoutGreeting(kept2)).join("\n").trim();
|
|
34348
34373
|
}, "mailCore");
|
|
34349
34374
|
|
|
34350
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34375
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/email-index.js
|
|
34351
34376
|
var titleOf2 = /* @__PURE__ */ __name((subject2) => subject2?.replace(/^\s*((re|fwd?|aw|wg)\s*:\s*)+/i, "").trim() || null, "titleOf");
|
|
34352
34377
|
var MAIL_PIECES = `(SELECT k.id, k.content_hash, k.chunkable_type AS type, k.chunkable_id AS owner, k.position,
|
|
34353
34378
|
k.start_offset, k.end_offset, k.account_id, k.occurred_at,
|
|
@@ -34460,7 +34485,7 @@ var drainEmailIndex = /* @__PURE__ */ __name((database, stemmerFor2) => {
|
|
|
34460
34485
|
return emails3 + threads;
|
|
34461
34486
|
}, "drainEmailIndex");
|
|
34462
34487
|
|
|
34463
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34488
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/email-locations.js
|
|
34464
34489
|
var locate = /* @__PURE__ */ __name((database, accountId, emailId, where) => database.prepare(`INSERT OR REPLACE INTO email_locations (mailbox_id, uidvalidity, uid, email_id)
|
|
34465
34490
|
SELECT id, ?, ?, ? FROM mailboxes WHERE account_id = ? AND external_id = ?`).run(where.uidvalidity, where.uid, emailId, accountId, where.folder), "locate");
|
|
34466
34491
|
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,
|
|
@@ -34558,7 +34583,7 @@ var forgetLocations = /* @__PURE__ */ __name((database, accountId, folder, uidva
|
|
|
34558
34583
|
var backfillSentAt = /* @__PURE__ */ __name((database, accountId, limit) => Number(database.prepare(`UPDATE emails SET sent_at = received_at WHERE id IN (
|
|
34559
34584
|
SELECT id FROM emails WHERE account_id = ? AND sent_at IS NULL AND received_at IS NOT NULL LIMIT ?)`).run(accountId, limit).changes), "backfillSentAt");
|
|
34560
34585
|
|
|
34561
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34586
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/email-state.js
|
|
34562
34587
|
var recountEmailThread = /* @__PURE__ */ __name((database, threadId, now2) => database.prepare(`UPDATE email_threads SET
|
|
34563
34588
|
emails_count = (SELECT count(*) FROM emails WHERE email_thread_id = ? AND deleted_at IS NULL),
|
|
34564
34589
|
last_email_at = (SELECT max(coalesce(sent_at, received_at)) FROM emails
|
|
@@ -34608,7 +34633,7 @@ var markEmailsRestored = /* @__PURE__ */ __name((database, accountId, externalId
|
|
|
34608
34633
|
return threads.length;
|
|
34609
34634
|
}, "markEmailsRestored");
|
|
34610
34635
|
|
|
34611
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34636
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/mail-nearest.js
|
|
34612
34637
|
var MAIL_PIECE_ROWS = `SELECT p.id, p.content_hash AS hash, p.type, p.owner, p.position, p.email_id AS email, v.vector
|
|
34613
34638
|
FROM ${MAIL_PIECES} JOIN embeddings v ON v.model = ? AND v.content_hash = p.content_hash
|
|
34614
34639
|
WHERE p.account_id = ?
|
|
@@ -34668,7 +34693,7 @@ var indexedMailPieces = /* @__PURE__ */ __name((database, model, query, filter,
|
|
|
34668
34693
|
}, "indexedMailPieces");
|
|
34669
34694
|
var nearestMailPieces = /* @__PURE__ */ __name((database, model, query, filter, depth) => (filter.threadExternalId === void 0 ? indexedMailPieces(database, model, query, filter, depth) : void 0) ?? scannedMailPieces(database, model, query, filter), "nearestMailPieces");
|
|
34670
34695
|
|
|
34671
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34696
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/mail-rules.js
|
|
34672
34697
|
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");
|
|
34673
34698
|
var conditionsKey = /* @__PURE__ */ __name((conditions) => JSON.stringify(sorted(conditions)), "conditionsKey");
|
|
34674
34699
|
var ruleOf = /* @__PURE__ */ __name((row2) => ({
|
|
@@ -34735,7 +34760,7 @@ var mailRulesOver = /* @__PURE__ */ __name((database) => ({
|
|
|
34735
34760
|
}
|
|
34736
34761
|
}), "mailRulesOver");
|
|
34737
34762
|
|
|
34738
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34763
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-operation.js
|
|
34739
34764
|
function checkMeetingCancelled(signal) {
|
|
34740
34765
|
if (!signal?.aborted)
|
|
34741
34766
|
return;
|
|
@@ -34746,7 +34771,7 @@ function checkMeetingCancelled(signal) {
|
|
|
34746
34771
|
}
|
|
34747
34772
|
__name(checkMeetingCancelled, "checkMeetingCancelled");
|
|
34748
34773
|
|
|
34749
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34774
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-values.js
|
|
34750
34775
|
var managerOf = /* @__PURE__ */ __name((database, meetingId) => {
|
|
34751
34776
|
const found2 = database.prepare("SELECT p.display_name, i.name, l.person_id FROM meeting_participants p JOIN identities i ON i.id = p.identity_id LEFT JOIN identity_links l ON l.identity_id = p.identity_id WHERE p.meeting_id = ? AND p.role = 'manager' ORDER BY p.id LIMIT 1").get(meetingId);
|
|
34752
34777
|
if (!found2)
|
|
@@ -34811,7 +34836,7 @@ var transcriptRowOf = /* @__PURE__ */ __name((row2) => ({
|
|
|
34811
34836
|
createdAt: Number(row2.created_at)
|
|
34812
34837
|
}), "transcriptRowOf");
|
|
34813
34838
|
|
|
34814
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34839
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-reads.js
|
|
34815
34840
|
var MEETING_TEXT = ["external_id", "title", "description", "location", "join_url", "timezone", "metadata"];
|
|
34816
34841
|
var TRANSCRIPT_TEXT = ["source", "format", "language", "content_hash", "metadata"];
|
|
34817
34842
|
var ROW_TEXT = ["speaker_name", "text", "normalized_text", "metadata"];
|
|
@@ -34978,7 +35003,7 @@ var meetingReadsOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
|
34978
35003
|
}
|
|
34979
35004
|
}), "meetingReadsOver");
|
|
34980
35005
|
|
|
34981
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
35006
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-selection.js
|
|
34982
35007
|
var meetingSelectionSql = /* @__PURE__ */ __name((input) => {
|
|
34983
35008
|
const clauses = ["m.account_id=?", "m.deleted_at IS NULL"];
|
|
34984
35009
|
const params = [input.accountId];
|
|
@@ -35021,7 +35046,7 @@ var meetingSelectionSql = /* @__PURE__ */ __name((input) => {
|
|
|
35021
35046
|
return { clauses, params };
|
|
35022
35047
|
}, "meetingSelectionSql");
|
|
35023
35048
|
|
|
35024
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
35049
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-calls.js
|
|
35025
35050
|
var MOST_CALLS = 2e5;
|
|
35026
35051
|
var parsed3 = /* @__PURE__ */ __name((value) => {
|
|
35027
35052
|
if (typeof value !== "string")
|
|
@@ -35076,7 +35101,7 @@ var meetingCallsOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
|
35076
35101
|
}
|
|
35077
35102
|
}), "meetingCallsOver");
|
|
35078
35103
|
|
|
35079
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
35104
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-chat-lines.js
|
|
35080
35105
|
var meetingChatLinesOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
35081
35106
|
async meetingChatLines(input) {
|
|
35082
35107
|
checkMeetingCancelled(input.signal);
|
|
@@ -35104,7 +35129,7 @@ var meetingChatLinesOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
|
35104
35129
|
}
|
|
35105
35130
|
}), "meetingChatLinesOver");
|
|
35106
35131
|
|
|
35107
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
35132
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-context-links.js
|
|
35108
35133
|
var missing2 = /* @__PURE__ */ __name(() => {
|
|
35109
35134
|
throw new CliError("not_found", "Meeting, participant or selected target not found");
|
|
35110
35135
|
}, "missing");
|
|
@@ -35227,7 +35252,7 @@ function meetingContextLinksOver(context) {
|
|
|
35227
35252
|
}
|
|
35228
35253
|
__name(meetingContextLinksOver, "meetingContextLinksOver");
|
|
35229
35254
|
|
|
35230
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
35255
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-documents.js
|
|
35231
35256
|
var TRANSCRIPT_ROLE = "transcript";
|
|
35232
35257
|
var roleOf3 = /* @__PURE__ */ __name((value) => MEETING_DOCUMENT_ROLES.find((role) => role === value), "roleOf");
|
|
35233
35258
|
var attach = /* @__PURE__ */ __name((database, meetingId, fileId, role, metadata3, listed, now2) => {
|
|
@@ -35301,7 +35326,7 @@ var meetingTranscriptDocumentsOver = /* @__PURE__ */ __name(({ database }) => {
|
|
|
35301
35326
|
};
|
|
35302
35327
|
}, "meetingTranscriptDocumentsOver");
|
|
35303
35328
|
|
|
35304
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
35329
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-index-values.js
|
|
35305
35330
|
var INDEX_CODES = { meeting_transcript_row: 1, meeting_chat_message: 2, meeting_summary: 3 };
|
|
35306
35331
|
var meetingRowid = /* @__PURE__ */ __name((type, id2) => id2 * 4 + INDEX_CODES[type], "meetingRowid");
|
|
35307
35332
|
var summaryOf2 = /* @__PURE__ */ __name((row2) => ({
|
|
@@ -35330,7 +35355,7 @@ var indexedText = /* @__PURE__ */ __name((database, type, id2) => {
|
|
|
35330
35355
|
return row2 ? summaryText(summaryOf2(row2)) : null;
|
|
35331
35356
|
}, "indexedText");
|
|
35332
35357
|
|
|
35333
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
35358
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-stem-state.js
|
|
35334
35359
|
var summaryBytes = ["title", "overview", "sections", "next_steps", "content"].map((key2) => `coalesce(length(CAST(s.${key2} AS BLOB)),0)`).join("+");
|
|
35335
35360
|
var meetingCurrentIndexRows = `
|
|
35336
35361
|
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
|
|
@@ -35361,7 +35386,7 @@ var invalidateMeetingStems = /* @__PURE__ */ __name((database, type, id2) => {
|
|
|
35361
35386
|
}, "invalidateMeetingStems");
|
|
35362
35387
|
var meetingStemmableText = /* @__PURE__ */ __name((text9) => text9.replace(/[\p{L}\p{N}\p{M}\p{Co}]+/gu, (token) => token.length <= 1024 ? token : ""), "meetingStemmableText");
|
|
35363
35388
|
|
|
35364
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
35389
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-hit-index.js
|
|
35365
35390
|
function meetingHitIndexOver({ database, now: now2 }) {
|
|
35366
35391
|
return {
|
|
35367
35392
|
async indexSearch(original) {
|
|
@@ -35429,10 +35454,10 @@ function meetingHitIndexOver({ database, now: now2 }) {
|
|
|
35429
35454
|
}
|
|
35430
35455
|
__name(meetingHitIndexOver, "meetingHitIndexOver");
|
|
35431
35456
|
|
|
35432
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
35457
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-hit-search.js
|
|
35433
35458
|
import { createHash as createHash5 } from "node:crypto";
|
|
35434
35459
|
|
|
35435
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
35460
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/search/correct.js
|
|
35436
35461
|
var SHORTEST_CORRECTION = 3;
|
|
35437
35462
|
var maxEdits = /* @__PURE__ */ __name((word2) => word2.length <= 4 ? 1 : 2, "maxEdits");
|
|
35438
35463
|
var editDistance = /* @__PURE__ */ __name((a, b, max) => {
|
|
@@ -35479,7 +35504,7 @@ var correctWords = /* @__PURE__ */ __name(async (vocabulary, words4) => {
|
|
|
35479
35504
|
return corrections;
|
|
35480
35505
|
}, "correctWords");
|
|
35481
35506
|
|
|
35482
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
35507
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/search/garbled.js
|
|
35483
35508
|
var SHORTEST_GARBLED = 4;
|
|
35484
35509
|
var MOST_WIDENED = 64;
|
|
35485
35510
|
var plain = /* @__PURE__ */ __name((word2) => word2.replaceAll("\u044D", "\u0435"), "plain");
|
|
@@ -35571,7 +35596,7 @@ var widenWords = /* @__PURE__ */ __name((probes, vocabulary, stem, known2) => {
|
|
|
35571
35596
|
return found2.map((words4) => words4.sort((a, b) => a.distance - b.distance || b.docs - a.docs || a.term.localeCompare(b.term)).slice(0, MOST_WIDENED).map((word2) => word2.term));
|
|
35572
35597
|
}, "widenWords");
|
|
35573
35598
|
|
|
35574
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
35599
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/search/russian-dictionary.js
|
|
35575
35600
|
import { readFileSync } from "node:fs";
|
|
35576
35601
|
var loaded;
|
|
35577
35602
|
var dictionary = /* @__PURE__ */ __name(() => {
|
|
@@ -35630,7 +35655,7 @@ var knownRussianWord = /* @__PURE__ */ __name((word2) => {
|
|
|
35630
35655
|
return false;
|
|
35631
35656
|
}, "knownRussianWord");
|
|
35632
35657
|
|
|
35633
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
35658
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-hit-query.js
|
|
35634
35659
|
var WORD2 = /[\p{L}\p{N}\p{M}]+/gu;
|
|
35635
35660
|
var MOST_WORDS = 128;
|
|
35636
35661
|
var quote = /* @__PURE__ */ __name((word2) => `"${word2.replaceAll('"', '""')}"`, "quote");
|
|
@@ -35886,7 +35911,7 @@ var matchedMeetingWords = /* @__PURE__ */ __name((tree, text9, stemmer2) => {
|
|
|
35886
35911
|
return [...found2];
|
|
35887
35912
|
}, "matchedMeetingWords");
|
|
35888
35913
|
|
|
35889
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
35914
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-hit-search.js
|
|
35890
35915
|
var fail = /* @__PURE__ */ __name((message3) => {
|
|
35891
35916
|
throw new CliError("validation_error", message3);
|
|
35892
35917
|
}, "fail");
|
|
@@ -36070,7 +36095,7 @@ function meetingHitSearchOver({ database }) {
|
|
|
36070
36095
|
}
|
|
36071
36096
|
__name(meetingHitSearchOver, "meetingHitSearchOver");
|
|
36072
36097
|
|
|
36073
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
36098
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-languages.js
|
|
36074
36099
|
var meetingLanguagesOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
36075
36100
|
async fillTranscriptLanguages({ accountId, apply, now: now2 }) {
|
|
36076
36101
|
positiveReadInteger(accountId, "accountId");
|
|
@@ -36102,7 +36127,7 @@ var meetingLanguagesOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
|
36102
36127
|
}
|
|
36103
36128
|
}), "meetingLanguagesOver");
|
|
36104
36129
|
|
|
36105
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
36130
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-participant-search.js
|
|
36106
36131
|
import { createHash as createHash6 } from "node:crypto";
|
|
36107
36132
|
var cursorOf2 = /* @__PURE__ */ __name((value, key2) => {
|
|
36108
36133
|
if (value === void 0)
|
|
@@ -36195,7 +36220,7 @@ var meetingParticipantSearchOver = /* @__PURE__ */ __name((context) => ({
|
|
|
36195
36220
|
}
|
|
36196
36221
|
}), "meetingParticipantSearchOver");
|
|
36197
36222
|
|
|
36198
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
36223
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/preparation-context-queries.js
|
|
36199
36224
|
var preparationQueries = {
|
|
36200
36225
|
participants: {
|
|
36201
36226
|
fields: "p.id, p.identity_id, p.display_name, l.person_id",
|
|
@@ -36245,7 +36270,7 @@ var preparationQueries = {
|
|
|
36245
36270
|
}
|
|
36246
36271
|
};
|
|
36247
36272
|
|
|
36248
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
36273
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-preparation-context.js
|
|
36249
36274
|
var meetingPreparationContextOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
36250
36275
|
async preparationContext(original) {
|
|
36251
36276
|
const input = validateMeetingPreparationContext(original);
|
|
@@ -36286,7 +36311,7 @@ var meetingPreparationContextOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
|
36286
36311
|
}
|
|
36287
36312
|
}), "meetingPreparationContextOver");
|
|
36288
36313
|
|
|
36289
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
36314
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/preparation-subjects.js
|
|
36290
36315
|
var preparationSubjects = /* @__PURE__ */ __name((anchors) => `WITH anchors AS (
|
|
36291
36316
|
SELECT m.id FROM meetings m JOIN meeting_series s ON s.id=m.meeting_series_id
|
|
36292
36317
|
WHERE m.id IN (${Array.from({ length: anchors }, () => "?").join(",")}) AND m.account_id=? AND s.account_id=?
|
|
@@ -36300,7 +36325,7 @@ var preparationSubjects = /* @__PURE__ */ __name((anchors) => `WITH anchors AS (
|
|
|
36300
36325
|
JOIN main.projects p ON p.id=l.to_id WHERE p.account_id IS NULL AND p.deleted_at IS NULL
|
|
36301
36326
|
)`, "preparationSubjects");
|
|
36302
36327
|
|
|
36303
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
36328
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-preparation-knowledge.js
|
|
36304
36329
|
var meetingPreparationKnowledgeOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
36305
36330
|
async preparationKnowledge(original) {
|
|
36306
36331
|
const { accountId, seriesId, anchorIds, after: after2, before: before2, limit, maxReadBytes, signal } = validateMeetingRelatedHistory(original);
|
|
@@ -36345,7 +36370,7 @@ var meetingPreparationKnowledgeOver = /* @__PURE__ */ __name(({ database }) => (
|
|
|
36345
36370
|
}
|
|
36346
36371
|
}), "meetingPreparationKnowledgeOver");
|
|
36347
36372
|
|
|
36348
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
36373
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-preparation-notes.js
|
|
36349
36374
|
var meetingPreparationNotesOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
36350
36375
|
async preparationNotes(original) {
|
|
36351
36376
|
const { accountId, seriesId, anchorIds, after: after2, before: before2, limit, maxReadBytes, signal } = validateMeetingRelatedHistory(original);
|
|
@@ -36398,7 +36423,7 @@ var meetingPreparationNotesOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
|
36398
36423
|
}
|
|
36399
36424
|
}), "meetingPreparationNotesOver");
|
|
36400
36425
|
|
|
36401
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
36426
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-related-history.js
|
|
36402
36427
|
var meetingRelatedHistoryOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
36403
36428
|
async relatedHistory(original) {
|
|
36404
36429
|
const input = validateMeetingRelatedHistory(original);
|
|
@@ -36469,7 +36494,7 @@ var meetingRelatedHistoryOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
|
36469
36494
|
}
|
|
36470
36495
|
}), "meetingRelatedHistoryOver");
|
|
36471
36496
|
|
|
36472
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
36497
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-review.js
|
|
36473
36498
|
var number2 = /* @__PURE__ */ __name((value) => value === null || value === void 0 ? null : Number(value), "number");
|
|
36474
36499
|
var text4 = /* @__PURE__ */ __name((value) => value === null || value === void 0 ? null : String(value), "text");
|
|
36475
36500
|
var meetingReviewOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
@@ -36550,7 +36575,7 @@ var meetingReviewOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
|
36550
36575
|
}
|
|
36551
36576
|
}), "meetingReviewOver");
|
|
36552
36577
|
|
|
36553
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
36578
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-series-history.js
|
|
36554
36579
|
var bytes2 = "length(CAST(external_id AS BLOB)) + coalesce(length(CAST(title AS BLOB)), 0)";
|
|
36555
36580
|
var ensureBytes2 = /* @__PURE__ */ __name((size2, budget) => {
|
|
36556
36581
|
if (!Number.isSafeInteger(size2) || size2 < 0 || size2 > budget)
|
|
@@ -36604,7 +36629,7 @@ var meetingSeriesHistoryOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
|
36604
36629
|
}
|
|
36605
36630
|
}), "meetingSeriesHistoryOver");
|
|
36606
36631
|
|
|
36607
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
36632
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-stats.js
|
|
36608
36633
|
var MOST_ROWS = 5e5;
|
|
36609
36634
|
var meetingCountsSql = /* @__PURE__ */ __name((where) => `SELECT m.started_at, coalesce(m.duration_ms, m.ended_at - m.started_at) AS duration_ms,
|
|
36610
36635
|
EXISTS (SELECT 1 FROM meeting_transcripts t WHERE t.meeting_id = m.id AND t.deleted_at IS NULL
|
|
@@ -36673,7 +36698,7 @@ var meetingStatsOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
|
36673
36698
|
}
|
|
36674
36699
|
}), "meetingStatsOver");
|
|
36675
36700
|
|
|
36676
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
36701
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/domain/name-variants.js
|
|
36677
36702
|
var CYRILLIC_TO_LATIN = {
|
|
36678
36703
|
\u0430: "a",
|
|
36679
36704
|
\u0431: "b",
|
|
@@ -36895,7 +36920,7 @@ for (const [full, short] of Object.entries(SHORT_FORMS))
|
|
|
36895
36920
|
}
|
|
36896
36921
|
var fullNames = /* @__PURE__ */ __name((skeleton) => [skeleton, ...FULL_NAMES.get(skeleton) ?? []], "fullNames");
|
|
36897
36922
|
|
|
36898
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
36923
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/name-traces.js
|
|
36899
36924
|
var peopleByNameKey = /* @__PURE__ */ __name((database) => {
|
|
36900
36925
|
const found2 = /* @__PURE__ */ new Map();
|
|
36901
36926
|
for (const row2 of database.prepare("SELECT p.id, p.name FROM persons p WHERE p.owner = 0 AND p.name IS NOT NULL AND EXISTS (SELECT 1 FROM identity_links l WHERE l.person_id = p.id) ORDER BY p.id").all()) {
|
|
@@ -37011,7 +37036,7 @@ function* sharedTraces(database, a, b, name, except) {
|
|
|
37011
37036
|
}
|
|
37012
37037
|
__name(sharedTraces, "sharedTraces");
|
|
37013
37038
|
|
|
37014
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
37039
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/person-matcher.js
|
|
37015
37040
|
var spellingsOf = /* @__PURE__ */ __name((value) => [value, value.slice(1)], "spellingsOf");
|
|
37016
37041
|
var PERSON_BY = {
|
|
37017
37042
|
// UNION, not OR: each branch reads its own index.
|
|
@@ -37034,7 +37059,7 @@ var personsByIdentifiers = /* @__PURE__ */ __name((database, ids3) => {
|
|
|
37034
37059
|
return [...found2].sort((a, b) => a - b);
|
|
37035
37060
|
}, "personsByIdentifiers");
|
|
37036
37061
|
|
|
37037
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
37062
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/person-match-scan.js
|
|
37038
37063
|
var BY = "rule";
|
|
37039
37064
|
var RULE = { bot: "rule", kind: "rule" };
|
|
37040
37065
|
var MOST_SHARING = 6;
|
|
@@ -37483,7 +37508,7 @@ var linkPhones = /* @__PURE__ */ __name((context, identities2) => {
|
|
|
37483
37508
|
return pass.result;
|
|
37484
37509
|
}, "linkPhones");
|
|
37485
37510
|
|
|
37486
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
37511
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/meetings.js
|
|
37487
37512
|
var CURSOR_KEY = "meetings";
|
|
37488
37513
|
var seriesOf2 = /* @__PURE__ */ __name((row2) => ({
|
|
37489
37514
|
id: Number(row2.id),
|
|
@@ -37563,7 +37588,7 @@ var details = /* @__PURE__ */ __name((database, id2) => {
|
|
|
37563
37588
|
return null;
|
|
37564
37589
|
const meeting = meetingOf(database, row2);
|
|
37565
37590
|
const series = meeting.meetingSeriesId === null ? null : seriesOf2(database.prepare("SELECT * FROM meeting_series WHERE id = ?").get(meeting.meetingSeriesId));
|
|
37566
|
-
const
|
|
37591
|
+
const rowsOf3 = database.prepare("SELECT * FROM meeting_transcript_rows WHERE meeting_transcript_id = ? ORDER BY position");
|
|
37567
37592
|
return {
|
|
37568
37593
|
meeting,
|
|
37569
37594
|
series,
|
|
@@ -37571,7 +37596,7 @@ var details = /* @__PURE__ */ __name((database, id2) => {
|
|
|
37571
37596
|
...participantOf(row3),
|
|
37572
37597
|
...row3.person_uid == null ? {} : { person: { uid: String(row3.person_uid), name: str(row3.person_name) } }
|
|
37573
37598
|
})),
|
|
37574
|
-
transcripts: database.prepare("SELECT * FROM meeting_transcripts WHERE meeting_id = ? ORDER BY id").all(id2).map((t) => ({ transcript: transcriptOf(t), rows:
|
|
37599
|
+
transcripts: database.prepare("SELECT * FROM meeting_transcripts WHERE meeting_id = ? ORDER BY id").all(id2).map((t) => ({ transcript: transcriptOf(t), rows: rowsOf3.all(Number(t.id)).map(transcriptRowOf) })),
|
|
37575
37600
|
chat: database.prepare("SELECT * FROM meeting_chat_messages WHERE meeting_id = ? ORDER BY id").all(id2).map(chatOf2),
|
|
37576
37601
|
summaries: database.prepare("SELECT * FROM meeting_summaries WHERE meeting_id = ? ORDER BY id").all(id2).map(summaryOf2),
|
|
37577
37602
|
attachments: database.prepare("SELECT * FROM attachments WHERE attachable_type = 'meeting' AND attachable_id = ? ORDER BY position").all(id2).map(attachmentOf),
|
|
@@ -38090,7 +38115,7 @@ var meetingStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
38090
38115
|
};
|
|
38091
38116
|
}, "meetingStoreOver");
|
|
38092
38117
|
|
|
38093
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
38118
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/sync.js
|
|
38094
38119
|
var syncStateOf = /* @__PURE__ */ __name(({ orm }, accountKey, name) => {
|
|
38095
38120
|
const row2 = orm.select({ value: syncCursors.value, at: syncCursors.updatedAt }).from(syncCursors).where(and(eq(syncCursors.accountId, accountKey), eq(syncCursors.key, name))).get();
|
|
38096
38121
|
return row2 ? { value: row2.value, at: toIso(row2.at) } : void 0;
|
|
@@ -38116,7 +38141,7 @@ var release = /* @__PURE__ */ __name(({ orm }, chatKey, anchor, holder2) => {
|
|
|
38116
38141
|
orm.delete(fetchLeases).where(and(eq(fetchLeases.chatId, chatKey), eq(fetchLeases.anchor, anchor), eq(fetchLeases.holder, holder2))).run();
|
|
38117
38142
|
}, "release");
|
|
38118
38143
|
|
|
38119
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
38144
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/thread-columns.js
|
|
38120
38145
|
var THREAD_COLUMNS = {
|
|
38121
38146
|
subject: {
|
|
38122
38147
|
where: /* @__PURE__ */ __name(({ value }) => ({
|
|
@@ -38133,7 +38158,7 @@ var threadRows = /* @__PURE__ */ __name((database, filter) => {
|
|
|
38133
38158
|
AND (${filter.where?.sql ?? "1"}) ORDER BY coalesce(last_email_at, 0) DESC, id DESC LIMIT ? OFFSET ?`).all(filter.accountId ?? null, filter.accountId ?? null, filter.includeDeleted ? 1 : 0, ...filter.where?.params ?? [], limit, offset);
|
|
38134
38159
|
}, "threadRows");
|
|
38135
38160
|
|
|
38136
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
38161
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/emails.js
|
|
38137
38162
|
var threadConversation = /* @__PURE__ */ __name((place, builtAt) => ({
|
|
38138
38163
|
id: `email:${place.emailId}`,
|
|
38139
38164
|
chatId: place.threadExternalId,
|
|
@@ -38675,7 +38700,7 @@ var mailStoreOver = /* @__PURE__ */ __name(({ database, orm, now: now2 }, stemme
|
|
|
38675
38700
|
}
|
|
38676
38701
|
}), "mailStoreOver");
|
|
38677
38702
|
|
|
38678
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
38703
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/search/dictionary.js
|
|
38679
38704
|
import { readFileSync as readFileSync2 } from "node:fs";
|
|
38680
38705
|
var DICTIONARIES = Object.fromEntries(LANGUAGES.map(({ name, dictionary: dictionary3 }) => [name, dictionary3]));
|
|
38681
38706
|
var folded5 = /* @__PURE__ */ __name((word2) => /^[а-яё'-]*$/.test(word2) ? word2.replaceAll("\u0451", "\u0435").replaceAll("\u0439", "\u0438") : fold(word2), "folded");
|
|
@@ -38765,7 +38790,7 @@ var knownWord = /* @__PURE__ */ __name((languages) => {
|
|
|
38765
38790
|
}, "knownWord");
|
|
38766
38791
|
var dictionaryLanguages = /* @__PURE__ */ __name((stemmers) => [stemmers.cyrillic, ...stemmers.latin.split(",")].filter((name) => Object.hasOwn(DICTIONARIES, name)), "dictionaryLanguages");
|
|
38767
38792
|
|
|
38768
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
38793
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/transcript-query.js
|
|
38769
38794
|
var predicates = /* @__PURE__ */ __name((node) => node.kind === "predicate" ? [node] : node.clauses.flatMap(({ node: node2 }) => predicates(node2)), "predicates");
|
|
38770
38795
|
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");
|
|
38771
38796
|
var LATIN_NUMBERS = new Set(`zero one two three four five six seven eight nine ten eleven twelve twenty thirty forty fifty sixty seventy
|
|
@@ -38851,7 +38876,7 @@ var spokenTranscripts = /* @__PURE__ */ __name((database, item, speaking, keys)
|
|
|
38851
38876
|
return found2;
|
|
38852
38877
|
}, "spokenTranscripts");
|
|
38853
38878
|
|
|
38854
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
38879
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/hit-places.js
|
|
38855
38880
|
var startOf = /* @__PURE__ */ __name((node) => node.operator === "wildcard" && node.implicit ? /^([\p{L}\p{N}]+)\*$/u.exec(normalize(node.value))?.[1] : void 0, "startOf");
|
|
38856
38881
|
var matchOf = /* @__PURE__ */ __name((node) => {
|
|
38857
38882
|
const start = startOf(node);
|
|
@@ -38909,7 +38934,7 @@ var placeHits = /* @__PURE__ */ __name((database, corpus, leaves, transcripts, f
|
|
|
38909
38934
|
});
|
|
38910
38935
|
}, "placeHits");
|
|
38911
38936
|
|
|
38912
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
38937
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/lucene-groups.js
|
|
38913
38938
|
var GROUPS = {
|
|
38914
38939
|
chat: {
|
|
38915
38940
|
key: "m.chat_id",
|
|
@@ -38931,27 +38956,24 @@ var GROUPS = {
|
|
|
38931
38956
|
}
|
|
38932
38957
|
};
|
|
38933
38958
|
|
|
38934
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
38935
|
-
var
|
|
38936
|
-
|
|
38937
|
-
|
|
38938
|
-
|
|
38939
|
-
|
|
38940
|
-
|
|
38941
|
-
|
|
38942
|
-
|
|
38943
|
-
|
|
38944
|
-
|
|
38945
|
-
|
|
38946
|
-
|
|
38947
|
-
|
|
38948
|
-
|
|
38949
|
-
|
|
38950
|
-
|
|
38951
|
-
|
|
38952
|
-
item: "email",
|
|
38953
|
-
thread: "email_thread"
|
|
38954
|
-
};
|
|
38959
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/word-rarity.js
|
|
38960
|
+
var withRarity = /* @__PURE__ */ __name((database, words4, leaves, ranked) => {
|
|
38961
|
+
const matches2 = [...new Set(leaves.flatMap(({ fragment }) => fragment.fts ?? []))];
|
|
38962
|
+
if (!matches2.length)
|
|
38963
|
+
return false;
|
|
38964
|
+
const total = Number(database.prepare(`SELECT count(*) AS n FROM ${words4}_docsize`).get()?.n ?? 0);
|
|
38965
|
+
const sets = matches2.map((fts) => {
|
|
38966
|
+
const match = `normalized_text : (${fts})`;
|
|
38967
|
+
const df = Number(database.prepare(`SELECT count(*) AS n FROM ${words4} WHERE ${words4} MATCH ?`).get(match)?.n ?? 0);
|
|
38968
|
+
ranked.params.push(match);
|
|
38969
|
+
return `SELECT rowid AS id, ${df ? Math.log(total / df) : 0} AS w FROM ${words4} WHERE ${words4} MATCH ?`;
|
|
38970
|
+
});
|
|
38971
|
+
ranked.sql.push(`rarity(id, score) AS MATERIALIZED (SELECT id, sum(w) FROM (${sets.join(" UNION ALL ")}) GROUP BY id)`);
|
|
38972
|
+
return true;
|
|
38973
|
+
}, "withRarity");
|
|
38974
|
+
var RARITY_ORDER = "coalesce(rarity.score, 0) - 0.2 * coalesce(f.rank, 0) DESC, ";
|
|
38975
|
+
|
|
38976
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/lucene.js
|
|
38955
38977
|
var matchQuery = /* @__PURE__ */ __name((context, execution) => runQuery(context, execution), "matchQuery");
|
|
38956
38978
|
var countQuery = /* @__PURE__ */ __name((context, execution, by) => runQuery(context, execution, by), "countQuery");
|
|
38957
38979
|
var queryMessagePks = /* @__PURE__ */ __name((context, execution) => runQuery(context, execution, "pks"), "queryMessagePks");
|
|
@@ -38970,7 +38992,7 @@ var matchingPks = /* @__PURE__ */ __name((context, execution, cap) => inTime(()
|
|
|
38970
38992
|
var timeLimited = /* @__PURE__ */ __name((limitMs) => (error) => {
|
|
38971
38993
|
if (error instanceof TimeLimitReached)
|
|
38972
38994
|
outOfTime(limitMs);
|
|
38973
|
-
throw error;
|
|
38995
|
+
throw sqliteLimit(error);
|
|
38974
38996
|
}, "timeLimited");
|
|
38975
38997
|
var inTime = /* @__PURE__ */ __name((work, limitMs) => {
|
|
38976
38998
|
try {
|
|
@@ -39140,17 +39162,18 @@ var compileQuery = /* @__PURE__ */ __name((context, execution, boundedAttachment
|
|
|
39140
39162
|
const rowsFrom = `FROM ${corpus.rows} m`;
|
|
39141
39163
|
const joinedFrom = `${rowsFrom} JOIN ${corpus.threads} c ON c.id=m.chat_id JOIN accounts ac ON ac.id=m.account_id LEFT JOIN identities i ON i.id=m.sender_identity_id`;
|
|
39142
39164
|
let baseFrom = joinedFrom;
|
|
39143
|
-
const requiredText = /* @__PURE__ */ __name((node, index2 = "fts") => {
|
|
39165
|
+
const requiredText = /* @__PURE__ */ __name((node, index2 = "fts", partial = false) => {
|
|
39144
39166
|
if (node.kind === "predicate")
|
|
39145
39167
|
return fragments.get(node)?.fragment[index2];
|
|
39146
39168
|
const required3 = node.clauses.filter(({ occur }) => occur === "must");
|
|
39147
39169
|
const optional3 = node.clauses.filter(({ occur }) => occur === "should");
|
|
39148
39170
|
if (required3.length) {
|
|
39149
|
-
const parts2 = required3.flatMap(({ node: node2 }) => requiredText(node2, index2) ?? []);
|
|
39171
|
+
const parts2 = required3.flatMap(({ node: node2 }) => requiredText(node2, index2, partial) ?? []);
|
|
39150
39172
|
return parts2.length ? parts2.map((part2) => `(${part2})`).join(" AND ") : void 0;
|
|
39151
39173
|
}
|
|
39152
|
-
const parts = optional3.
|
|
39153
|
-
|
|
39174
|
+
const parts = optional3.flatMap(({ node: node2 }) => requiredText(node2, index2, partial) ?? []);
|
|
39175
|
+
const whole = partial || parts.length === optional3.length;
|
|
39176
|
+
return parts.length && whole ? parts.map((part2) => `(${part2})`).join(" OR ") : void 0;
|
|
39154
39177
|
}, "requiredText");
|
|
39155
39178
|
const stemmed = [...fragments.keys()].some(isStemmed);
|
|
39156
39179
|
const elsewhere = [...fragments.values()].some(({ fragment }) => fragment.elsewhere);
|
|
@@ -39196,8 +39219,9 @@ var compileQuery = /* @__PURE__ */ __name((context, execution, boundedAttachment
|
|
|
39196
39219
|
},
|
|
39197
39220
|
where
|
|
39198
39221
|
], "AND");
|
|
39199
|
-
const
|
|
39200
|
-
const
|
|
39222
|
+
const byStems = stemmed ? requiredText(execution.root, "stems") : void 0;
|
|
39223
|
+
const ranking = byStems ?? (stemmed || elsewhere ? requiredText(execution.root, "fts", true) : void 0);
|
|
39224
|
+
const rankIndex = { table: byStems ? corpus.stems : corpus.words, column: byStems ? "stems" : "normalized_text" };
|
|
39201
39225
|
const exactTier = stemmed ? requiredText(execution.root) : void 0;
|
|
39202
39226
|
const ranked = driver ? { sql: [`d(id) AS MATERIALIZED (${driver.sql})`], params: [...driver.params] } : { sql: [], params: [] };
|
|
39203
39227
|
if (ranking && !execution.newest) {
|
|
@@ -39216,16 +39240,19 @@ var compileQuery = /* @__PURE__ */ __name((context, execution, boundedAttachment
|
|
|
39216
39240
|
ranked.params.push(places2.join(" OR "), places2.join(" OR "), ...parts.flatMap(({ params }) => params));
|
|
39217
39241
|
}
|
|
39218
39242
|
const placeTier = places2.length && !execution.newest ? "coalesce((SELECT min(tier) FROM s WHERE s.id=m.id), 6)," : "";
|
|
39243
|
+
const rarity = execution.rareWordsFirst && !execution.newest && !mail && withRarity(database, corpus.words, [...fragments.values()], ranked);
|
|
39219
39244
|
if (exactTier) {
|
|
39220
39245
|
ranked.sql.push(`x(id) AS MATERIALIZED (SELECT rowid FROM ${corpus.words} WHERE ${corpus.words} MATCH ?)`);
|
|
39221
39246
|
ranked.params.push(`normalized_text : (${exactTier})`);
|
|
39222
39247
|
}
|
|
39223
39248
|
const withRanking = ranked.sql.length ? `WITH ${ranked.sql.join(", ")} ` : "";
|
|
39224
|
-
const rankedFrom = ranking && !execution.newest ? `${from2} LEFT JOIN f ON f.id=m.id` : from2
|
|
39249
|
+
const rankedFrom = `${ranking && !execution.newest ? `${from2} LEFT JOIN f ON f.id=m.id` : from2}${rarity ? " LEFT JOIN rarity ON rarity.id=m.id" : ""}`;
|
|
39225
39250
|
const exactColumn = exactTier ? ", m.id IN (SELECT id FROM x) AS exact" : "";
|
|
39226
39251
|
const relevance = rankMatch ? "f.rank" : ranking && !execution.newest ? "f.rank" : "NULL";
|
|
39227
|
-
const tiers = execution.newest ? "" : rankMatch ?
|
|
39228
|
-
const
|
|
39252
|
+
const tiers = /* @__PURE__ */ __name((rare) => execution.newest ? "" : rankMatch ? `${rare}f.rank,` : `${exactTier ? "m.id IN (SELECT id FROM x) DESC," : ""}${ranking ? `f.rank IS NULL, ${placeTier}${rare}f.rank,` : `${placeTier}${rare}`}`, "tiers");
|
|
39253
|
+
const ties = "m.sent_at DESC, ac.provider, ac.external_id, c.external_id, m.external_id DESC";
|
|
39254
|
+
const order = `${tiers(rarity ? RARITY_ORDER : "")}${ties}`;
|
|
39255
|
+
const acrossChats = `${tiers("")}${ties}`;
|
|
39229
39256
|
const leaves = [...fragments.values()];
|
|
39230
39257
|
const exact = leaves.filter(({ test }) => test === void 0);
|
|
39231
39258
|
const projection = exact.map(({ fragment }, index2) => `coalesce(${fragment.sql},0) AS q${index2}`).join(",");
|
|
@@ -39274,6 +39301,7 @@ var compileQuery = /* @__PURE__ */ __name((context, execution, boundedAttachment
|
|
|
39274
39301
|
rankedFrom,
|
|
39275
39302
|
exactColumn,
|
|
39276
39303
|
order,
|
|
39304
|
+
acrossChats,
|
|
39277
39305
|
placeTier,
|
|
39278
39306
|
projection,
|
|
39279
39307
|
projectionParams,
|
|
@@ -39330,7 +39358,7 @@ var runQuery = /* @__PURE__ */ __name((context, execution, by) => {
|
|
|
39330
39358
|
}
|
|
39331
39359
|
}, "runQuery");
|
|
39332
39360
|
var runCompiled = /* @__PURE__ */ __name(async (context, execution, by) => {
|
|
39333
|
-
const { corpus, rowsFrom, hits, database, check: check3, grouped, where, from: from2, withRanking, ranked, leaves, stemmed, exactTier, driver, baseFrom, filtered: filtered2, ranking, relevance, rankedFrom, exactColumn, order, placeTier, projection, projectionParams, joinedFrom, evaluate: evaluate2 } = compileQuery(context, execution);
|
|
39361
|
+
const { corpus, rowsFrom, hits, database, check: check3, grouped, where, from: from2, withRanking, ranked, leaves, stemmed, exactTier, driver, baseFrom, filtered: filtered2, ranking, relevance, rankedFrom, exactColumn, order, acrossChats, placeTier, projection, projectionParams, joinedFrom, evaluate: evaluate2 } = compileQuery(context, execution);
|
|
39334
39362
|
if (by === "pks" && leaves.every(({ test }) => !test)) {
|
|
39335
39363
|
const rows = database.prepare(`${withRanking}SELECT m.id AS id ${from2} WHERE ${where.sql}`).all(...ranked.params, ...where.params);
|
|
39336
39364
|
await new Promise((resolve) => setImmediate(resolve));
|
|
@@ -39339,8 +39367,8 @@ var runCompiled = /* @__PURE__ */ __name(async (context, execution, by) => {
|
|
|
39339
39367
|
}
|
|
39340
39368
|
if (by && by !== "pks" && leaves.every(({ test }) => !test))
|
|
39341
39369
|
return grouped(by, where.sql, [...ranked.params, ...where.params], from2, withRanking);
|
|
39342
|
-
const { newest, perChat } = execution;
|
|
39343
|
-
if (stemmed && exactTier && driver && !newest && !perChat && leaves.every(({ test }) => !test)) {
|
|
39370
|
+
const { newest, perChat, rareWordsFirst } = execution;
|
|
39371
|
+
if (stemmed && exactTier && driver && !newest && !perChat && !rareWordsFirst && leaves.every(({ test }) => !test)) {
|
|
39344
39372
|
const exactRows = database.prepare(`SELECT m.id AS id, w.rank AS relevance ${baseFrom.replace(rowsFrom, `FROM ${corpus.words} w CROSS JOIN ${corpus.rows} m`)} WHERE ${corpus.words} MATCH ? AND w.rank MATCH 'bm25(1.0, 0.0)' AND m.id=w.rowid AND ${filtered2.sql} ORDER BY w.rank, m.sent_at DESC, ac.provider, ac.external_id, c.external_id, m.external_id DESC LIMIT ?`).all(`normalized_text : (${exactTier})`, ...filtered2.params, execution.limit + 1);
|
|
39345
39373
|
await new Promise((resolve) => setImmediate(resolve));
|
|
39346
39374
|
check3();
|
|
@@ -39362,7 +39390,7 @@ var runCompiled = /* @__PURE__ */ __name(async (context, execution, by) => {
|
|
|
39362
39390
|
};
|
|
39363
39391
|
}
|
|
39364
39392
|
if (leaves.every(({ test }) => !test)) {
|
|
39365
|
-
const rows = database.prepare(perChat === void 0 ? `${withRanking}SELECT m.id AS id, ${relevance} AS relevance${exactColumn} ${rankedFrom} WHERE ${where.sql} ORDER BY ${order} LIMIT ?` : `${withRanking}SELECT id, relevance${exactColumn ? ", exact" : ""} FROM (SELECT m.id AS id, ${relevance} AS relevance${exactColumn}, ROW_NUMBER() OVER (PARTITION BY m.chat_id ORDER BY ${order}) AS in_chat, ROW_NUMBER() OVER (ORDER BY ${
|
|
39393
|
+
const rows = database.prepare(perChat === void 0 ? `${withRanking}SELECT m.id AS id, ${relevance} AS relevance${exactColumn} ${rankedFrom} WHERE ${where.sql} ORDER BY ${order} LIMIT ?` : `${withRanking}SELECT id, relevance${exactColumn ? ", exact" : ""} FROM (SELECT m.id AS id, ${relevance} AS relevance${exactColumn}, ROW_NUMBER() OVER (PARTITION BY m.chat_id ORDER BY ${order}) AS in_chat, ROW_NUMBER() OVER (ORDER BY ${acrossChats}) AS place ${rankedFrom} WHERE ${where.sql}) WHERE in_chat <= ${perChat} ORDER BY place LIMIT ?`).all(...ranked.params, ...where.params, execution.limit + 1);
|
|
39366
39394
|
await new Promise((resolve) => setImmediate(resolve));
|
|
39367
39395
|
check3();
|
|
39368
39396
|
return {
|
|
@@ -39427,7 +39455,7 @@ var runCompiled = /* @__PURE__ */ __name(async (context, execution, by) => {
|
|
|
39427
39455
|
};
|
|
39428
39456
|
}, "runCompiled");
|
|
39429
39457
|
|
|
39430
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
39458
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/counters.js
|
|
39431
39459
|
function invalidMetadata() {
|
|
39432
39460
|
throw new CliError("validation_error", "stored counter metadata is malformed \u2014 check the store before refreshing");
|
|
39433
39461
|
}
|
|
@@ -39529,7 +39557,7 @@ var counterTargets = /* @__PURE__ */ __name((context, execution, options) => wit
|
|
|
39529
39557
|
};
|
|
39530
39558
|
}), "counterTargets");
|
|
39531
39559
|
|
|
39532
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
39560
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/attachment-texts.js
|
|
39533
39561
|
var NOT_FILE_LIST = [...NOT_FILES].map((kind3) => `'${kind3}'`).join(",");
|
|
39534
39562
|
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,
|
|
39535
39563
|
att.size, att.local_path, att.extraction AS origin, att.size AS read_bytes, att.extraction_error AS error, att.content_sha256, att.extractor
|
|
@@ -39648,7 +39676,7 @@ var attachmentViews = /* @__PURE__ */ __name(({ database }, accountKey, { chatKe
|
|
|
39648
39676
|
}));
|
|
39649
39677
|
}, "attachmentViews");
|
|
39650
39678
|
|
|
39651
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
39679
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/transcripts.js
|
|
39652
39680
|
var transcript2 = /* @__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");
|
|
39653
39681
|
var keepTranscript = /* @__PURE__ */ __name((context, chatKey, messageId, text9, source2) => {
|
|
39654
39682
|
const { orm, database, now: now2 } = context;
|
|
@@ -39686,7 +39714,7 @@ var intoVoiceAttachment = /* @__PURE__ */ __name((context, messagePk) => {
|
|
|
39686
39714
|
keepText(context, Number(row2.id), { text: String(row2.text), origin: "extracted", extractor: `speech:${row2.source}` });
|
|
39687
39715
|
}, "intoVoiceAttachment");
|
|
39688
39716
|
|
|
39689
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
39717
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/messages.js
|
|
39690
39718
|
var FIELDS = [
|
|
39691
39719
|
"threadExternalId",
|
|
39692
39720
|
"senderIdentityId",
|
|
@@ -40010,7 +40038,7 @@ var writeDerivedReactions = /* @__PURE__ */ __name((context, chatKey, messageId)
|
|
|
40010
40038
|
reactionStatementsOf(context.database).total.run(JSON.stringify(derived), chatKey, messageId);
|
|
40011
40039
|
}, "writeDerivedReactions");
|
|
40012
40040
|
|
|
40013
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
40041
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/keys.js
|
|
40014
40042
|
var keysOver = /* @__PURE__ */ __name((context) => {
|
|
40015
40043
|
const findAccountPk2 = /* @__PURE__ */ __name((key2) => findAccountPk(context, key2), "findAccountPk");
|
|
40016
40044
|
const findChatPk2 = /* @__PURE__ */ __name((accountKey, chatId) => findChatPk(context, accountKey, chatId), "findChatPk");
|
|
@@ -40031,7 +40059,16 @@ var keysOver = /* @__PURE__ */ __name((context) => {
|
|
|
40031
40059
|
};
|
|
40032
40060
|
}, "keysOver");
|
|
40033
40061
|
|
|
40034
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
40062
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/account-groups.js
|
|
40063
|
+
var unquoted3 = /* @__PURE__ */ __name((value) => {
|
|
40064
|
+
if (typeof value !== "string")
|
|
40065
|
+
return value;
|
|
40066
|
+
try {
|
|
40067
|
+
return JSON.parse(value);
|
|
40068
|
+
} catch {
|
|
40069
|
+
return value;
|
|
40070
|
+
}
|
|
40071
|
+
}, "unquoted");
|
|
40035
40072
|
var accountGroupsOf = /* @__PURE__ */ __name((database) => {
|
|
40036
40073
|
const row2 = database.prepare("SELECT value FROM store_settings WHERE key = ?").get(ACCOUNT_GROUPS);
|
|
40037
40074
|
if (!row2)
|
|
@@ -40040,7 +40077,7 @@ var accountGroupsOf = /* @__PURE__ */ __name((database) => {
|
|
|
40040
40077
|
const value = JSON.parse(String(row2.value));
|
|
40041
40078
|
if (typeof value !== "object" || value === null || Array.isArray(value))
|
|
40042
40079
|
return {};
|
|
40043
|
-
return Object.fromEntries(Object.entries(value).filter((entry2) => Array.isArray(entry2[1]) && entry2[1].every((member) => typeof member === "string")));
|
|
40080
|
+
return Object.fromEntries(Object.entries(value).map(([name, members2]) => [name, unquoted3(members2)]).filter((entry2) => Array.isArray(entry2[1]) && entry2[1].every((member) => typeof member === "string")));
|
|
40044
40081
|
} catch {
|
|
40045
40082
|
return {};
|
|
40046
40083
|
}
|
|
@@ -40052,7 +40089,9 @@ var profilesOf = /* @__PURE__ */ __name((database) => {
|
|
|
40052
40089
|
return {};
|
|
40053
40090
|
try {
|
|
40054
40091
|
const value = JSON.parse(String(row2.value));
|
|
40055
|
-
|
|
40092
|
+
if (typeof value !== "object" || value === null || Array.isArray(value))
|
|
40093
|
+
return {};
|
|
40094
|
+
return Object.fromEntries(Object.entries(value).map(([app, own]) => [app, unquoted3(own)]));
|
|
40056
40095
|
} catch {
|
|
40057
40096
|
return {};
|
|
40058
40097
|
}
|
|
@@ -40078,7 +40117,7 @@ var forgetProfile = /* @__PURE__ */ __name((database, app, profile, now2) => {
|
|
|
40078
40117
|
database.prepare("INSERT OR REPLACE INTO store_settings (key, value, at) VALUES (?, ?, ?)").run(PROFILES, JSON.stringify(profiles), now2);
|
|
40079
40118
|
}, "forgetProfile");
|
|
40080
40119
|
|
|
40081
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
40120
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/calendar-events.js
|
|
40082
40121
|
var DAY4 = 864e5;
|
|
40083
40122
|
var COUNTERPART_LINK = `EXISTS (SELECT 1 FROM links l WHERE l.from_type = 'event' AND l.from_id = e.id AND l.to_type = 'person' AND l.to_id = ? AND l.kind = ${linkKind("related-to")} AND l.role = '${COUNTERPART_ROLE}')`;
|
|
40084
40123
|
var accountsOf = /* @__PURE__ */ __name((filter) => {
|
|
@@ -40194,7 +40233,7 @@ var listEvents = /* @__PURE__ */ __name((database, filter) => {
|
|
|
40194
40233
|
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);
|
|
40195
40234
|
}, "listEvents");
|
|
40196
40235
|
|
|
40197
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
40236
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/calendar-forget.js
|
|
40198
40237
|
var distinctIds = /* @__PURE__ */ __name((rows) => [...new Set(rows.map((row2) => Number(row2.id)))], "distinctIds");
|
|
40199
40238
|
var forgetCalendarRows = /* @__PURE__ */ __name((database, { calendarId, accountId, cursorKey, now: now2 }, refresh) => {
|
|
40200
40239
|
const unseenBefore = unreferenced(database, "identities");
|
|
@@ -40251,7 +40290,7 @@ var forgetCalendarRows = /* @__PURE__ */ __name((database, { calendarId, account
|
|
|
40251
40290
|
return { entries: entryIds.length, events: goneEvents.length };
|
|
40252
40291
|
}, "forgetCalendarRows");
|
|
40253
40292
|
|
|
40254
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
40293
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/calendar.js
|
|
40255
40294
|
var calendarOf = /* @__PURE__ */ __name((row2) => ({
|
|
40256
40295
|
id: Number(row2.id),
|
|
40257
40296
|
accountId: Number(row2.account_id),
|
|
@@ -40854,7 +40893,7 @@ var eventStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
40854
40893
|
};
|
|
40855
40894
|
}, "eventStoreOver");
|
|
40856
40895
|
|
|
40857
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
40896
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/account-purge.js
|
|
40858
40897
|
var purgeAccount = /* @__PURE__ */ __name((context, accountKey) => {
|
|
40859
40898
|
const { orm, database, now: now2 } = context;
|
|
40860
40899
|
const unseenBefore = unreferenced(database, "identities");
|
|
@@ -40978,7 +41017,7 @@ var purgeCrmCopies = /* @__PURE__ */ __name((database, accountKey) => {
|
|
|
40978
41017
|
run("DELETE FROM pipelines WHERE account_id = ?", accountKey);
|
|
40979
41018
|
}, "purgeCrmCopies");
|
|
40980
41019
|
|
|
40981
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
41020
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/own-identities.js
|
|
40982
41021
|
var ACCOUNT_REASON = "an account you connected, under another name: a mailbox or messenger you read may be someone else's";
|
|
40983
41022
|
var ownerNames = /* @__PURE__ */ __name(({ database }, owner) => database.prepare("SELECT i.name FROM identity_links l JOIN identities i ON i.id = l.identity_id WHERE l.person_id = ?").all(owner).map(({ name }) => new Set(nameSkeletons(displayName(typeof name === "string" ? name : null)))).filter((words4) => words4.size > 0), "ownerNames");
|
|
40984
41023
|
var ownersName = /* @__PURE__ */ __name((name, owner, alone) => {
|
|
@@ -41037,7 +41076,7 @@ var linkToOwner = /* @__PURE__ */ __name((context, ref3) => {
|
|
|
41037
41076
|
return personOf2(context, ref3);
|
|
41038
41077
|
}, "linkToOwner");
|
|
41039
41078
|
|
|
41040
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
41079
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/providers.js
|
|
41041
41080
|
var PROVIDERS_SETTING = "providers";
|
|
41042
41081
|
var storedProvidersOf = /* @__PURE__ */ __name((database) => {
|
|
41043
41082
|
const row2 = database.prepare("SELECT value FROM store_settings WHERE key = ?").get(PROVIDERS_SETTING);
|
|
@@ -41085,7 +41124,7 @@ var registerProvider = /* @__PURE__ */ __name((database, value, now2) => {
|
|
|
41085
41124
|
});
|
|
41086
41125
|
}, "registerProvider");
|
|
41087
41126
|
|
|
41088
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
41127
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/task-candidates.js
|
|
41089
41128
|
var DAY5 = 864e5;
|
|
41090
41129
|
var RECENTLY_CLOSED_MS = 14 * DAY5;
|
|
41091
41130
|
var TEXT_LIMIT = 20;
|
|
@@ -41283,7 +41322,7 @@ var taskSimilarityOver = /* @__PURE__ */ __name((context) => {
|
|
|
41283
41322
|
};
|
|
41284
41323
|
}, "taskSimilarityOver");
|
|
41285
41324
|
|
|
41286
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
41325
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/task-category-settings.js
|
|
41287
41326
|
var SETTING3 = "taskCategories";
|
|
41288
41327
|
var savedTaskCategories = /* @__PURE__ */ __name((database) => {
|
|
41289
41328
|
const row2 = database.prepare("SELECT value FROM store_settings WHERE key = ?").get(SETTING3);
|
|
@@ -41302,7 +41341,7 @@ var saveTaskCategories = /* @__PURE__ */ __name((database, categories, now2) =>
|
|
|
41302
41341
|
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);
|
|
41303
41342
|
}, "saveTaskCategories");
|
|
41304
41343
|
|
|
41305
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
41344
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/task-close.js
|
|
41306
41345
|
var DEFAULT_AGENT_CLOSE = { allowed: true, min: 0.8 };
|
|
41307
41346
|
var ALLOWED = "taskAgentClose";
|
|
41308
41347
|
var MIN = "taskAgentCloseMin";
|
|
@@ -41358,7 +41397,7 @@ var SUGGESTION_COLUMNS = [
|
|
|
41358
41397
|
];
|
|
41359
41398
|
var CLEAR_SUGGESTION = SUGGESTION_COLUMNS.map((column2) => `${column2} = NULL`).join(", ");
|
|
41360
41399
|
|
|
41361
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
41400
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/task-first-pass.js
|
|
41362
41401
|
var DEFAULT_FIRST_PASS_PER_CHAT = 0;
|
|
41363
41402
|
var KEY = "taskFirstPassPerChat";
|
|
41364
41403
|
var firstPassPerChatOf = /* @__PURE__ */ __name((value, setting = "task_first_pass_per_chat") => {
|
|
@@ -41378,7 +41417,7 @@ var saveFirstPassPerChat = /* @__PURE__ */ __name((database, value, now2) => {
|
|
|
41378
41417
|
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);
|
|
41379
41418
|
}, "saveFirstPassPerChat");
|
|
41380
41419
|
|
|
41381
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
41420
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/domain/external-links.js
|
|
41382
41421
|
var EXTERNAL_SERVICE = /^[a-z][a-z0-9-]{0,31}$/;
|
|
41383
41422
|
var EXTERNAL_ID_CHARS = 200;
|
|
41384
41423
|
var SOURCE_URL_CHARS = 2e3;
|
|
@@ -41405,7 +41444,7 @@ var sourceUrlOf = /* @__PURE__ */ __name((value, reason = "task.source-url") =>
|
|
|
41405
41444
|
return text9;
|
|
41406
41445
|
}, "sourceUrlOf");
|
|
41407
41446
|
|
|
41408
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
41447
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/task-board.js
|
|
41409
41448
|
var TASK_SORTS = ["priority", "due", "created", "updated", "key", "state"];
|
|
41410
41449
|
var field = /* @__PURE__ */ __name((name, type, example, more = {}) => ({
|
|
41411
41450
|
name,
|
|
@@ -41657,7 +41696,7 @@ var withoutField = /* @__PURE__ */ __name((query, name) => {
|
|
|
41657
41696
|
var TASK_PEOPLE = `WITH merged AS (SELECT json_extract(value, '$[0]') AS id, json_extract(value, '$[1]') AS now FROM json_each(?)), counts AS (SELECT coalesce(m.now, a.assignee_id) AS person, count(DISTINCT t.id) AS n FROM task_assignments a JOIN tasks t ON t.id = a.task_id AND t.deleted_at IS NULL LEFT JOIN merged m ON m.id = a.assignee_id WHERE a.assignee_type = 'person' GROUP BY 1) SELECT p.id, p.name, p.owner, coalesce(c.n, 0) AS n FROM persons p LEFT JOIN counts c ON c.person = p.id WHERE NOT ${mergedAwaySql("p")} ORDER BY p.owner DESC, n DESC, p.name IS NULL, p.name COLLATE NOCASE, p.id LIMIT ?`;
|
|
41658
41697
|
var mergedAssignees = /* @__PURE__ */ __name((database) => JSON.stringify(database.prepare(`SELECT DISTINCT a.assignee_id AS id FROM task_assignments a JOIN persons p ON p.id = a.assignee_id WHERE a.assignee_type = 'person' AND ${mergedAwaySql("p")}`).all().map(({ id: id2 }) => [Number(id2), currentPerson(database, Number(id2))])), "mergedAssignees");
|
|
41659
41698
|
|
|
41660
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
41699
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/task-comments.js
|
|
41661
41700
|
var authorNamed = /* @__PURE__ */ __name((database, row2) => {
|
|
41662
41701
|
if (row2.author_type == null)
|
|
41663
41702
|
return null;
|
|
@@ -41685,7 +41724,7 @@ var addComment = /* @__PURE__ */ __name((context, task, body2, by) => {
|
|
|
41685
41724
|
return commentsOf(database, task).find((one2) => one2.ref === `note:${made}`);
|
|
41686
41725
|
}, "addComment");
|
|
41687
41726
|
|
|
41688
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
41727
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/task-relations.js
|
|
41689
41728
|
var TASK_RELATION_KINDS = [
|
|
41690
41729
|
"blocked-by",
|
|
41691
41730
|
"follow-up-of",
|
|
@@ -41815,7 +41854,7 @@ var taskRelationsStoreOver = /* @__PURE__ */ __name((context, record3) => {
|
|
|
41815
41854
|
};
|
|
41816
41855
|
}, "taskRelationsStoreOver");
|
|
41817
41856
|
|
|
41818
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
41857
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/work-tasks.js
|
|
41819
41858
|
var TASK_ROLES = ["assignee", "reviewer", "watcher"];
|
|
41820
41859
|
var TASK_EVENT_KINDS = [
|
|
41821
41860
|
"created",
|
|
@@ -42374,7 +42413,7 @@ var workTasksOver = /* @__PURE__ */ __name((context) => {
|
|
|
42374
42413
|
};
|
|
42375
42414
|
}, "workTasksOver");
|
|
42376
42415
|
|
|
42377
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
42416
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/task-close-store.js
|
|
42378
42417
|
var taskCloseOver = /* @__PURE__ */ __name((context) => {
|
|
42379
42418
|
const { database, now: now2 } = context;
|
|
42380
42419
|
const liveRow = /* @__PURE__ */ __name((id2) => {
|
|
@@ -42423,7 +42462,7 @@ var taskCloseOver = /* @__PURE__ */ __name((context) => {
|
|
|
42423
42462
|
};
|
|
42424
42463
|
}, "taskCloseOver");
|
|
42425
42464
|
|
|
42426
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
42465
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/task-pairs.js
|
|
42427
42466
|
var TASK_PAIR_DECISIONS = ["review", "unsure", "merged", "rejected", "unmerged", "attached", "new"];
|
|
42428
42467
|
var taskPairsOver = /* @__PURE__ */ __name((context, similarity) => {
|
|
42429
42468
|
const { database, now: now2 } = context;
|
|
@@ -42642,7 +42681,7 @@ var taskPairsOver = /* @__PURE__ */ __name((context, similarity) => {
|
|
|
42642
42681
|
};
|
|
42643
42682
|
}, "taskPairsOver");
|
|
42644
42683
|
|
|
42645
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
42684
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/task-stats.js
|
|
42646
42685
|
var ACCOUNT_SCOPE = "t.package_id IS NOT NULL AND t.deleted_at IS NULL AND t.project_id = ?";
|
|
42647
42686
|
var TASK_STATS_SQL = {
|
|
42648
42687
|
rows: /* @__PURE__ */ __name((board, filter) => `SELECT t.source_group, t.source_kind, t.project_id, t.status, t.created_at, t.closed_at FROM tasks t WHERE ${board ? PROJECT_SCOPE : ACCOUNT_SCOPE}${filter} ORDER BY t.created_at, t.id`, "rows"),
|
|
@@ -42681,7 +42720,7 @@ var taskStatsOver = /* @__PURE__ */ __name(({ database }, inbox) => ({
|
|
|
42681
42720
|
}, "statNames")
|
|
42682
42721
|
}), "taskStatsOver");
|
|
42683
42722
|
|
|
42684
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
42723
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/tasks.js
|
|
42685
42724
|
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";
|
|
42686
42725
|
var inboxProject = /* @__PURE__ */ __name(({ database, now: now2 }, account, create) => {
|
|
42687
42726
|
const key2 = inboxKey(account);
|
|
@@ -42897,7 +42936,7 @@ var oneOf4 = /* @__PURE__ */ __name((values, value, column2) => {
|
|
|
42897
42936
|
throw new CliError("configuration_error", `the store holds a task with an unknown ${column2} "${String(value)}"`);
|
|
42898
42937
|
}, "oneOf");
|
|
42899
42938
|
|
|
42900
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
42939
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/accounts.js
|
|
42901
42940
|
var accountAccountsOver = /* @__PURE__ */ __name((context) => {
|
|
42902
42941
|
const { database } = context;
|
|
42903
42942
|
const { accountPk: accountPk2, findAccountPk: findAccountPk2 } = keysOver(context);
|
|
@@ -42967,7 +43006,7 @@ var accountsStoreOver = /* @__PURE__ */ __name((context, keyed) => {
|
|
|
42967
43006
|
};
|
|
42968
43007
|
}, "accountsStoreOver");
|
|
42969
43008
|
|
|
42970
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
43009
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/attachments.js
|
|
42971
43010
|
var refColumn = /* @__PURE__ */ __name((ref3) => ref3 && Object.keys(ref3).length > 0 ? { providerRef: JSON.stringify(ref3) } : {}, "refColumn");
|
|
42972
43011
|
var updatePlaced = /* @__PURE__ */ __name(({ orm }, chatKey, messageId, files2, change) => {
|
|
42973
43012
|
const message3 = orm.select({ pk: messages.id }).from(messages).where(and(eq(messages.chatId, chatKey), eq(messages.externalId, messageId))).get();
|
|
@@ -42991,7 +43030,7 @@ var keepDownloads = /* @__PURE__ */ __name((context, chatKey, messageId, files2)
|
|
|
42991
43030
|
})), "keepDownloads");
|
|
42992
43031
|
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");
|
|
42993
43032
|
|
|
42994
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
43033
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/attachments.js
|
|
42995
43034
|
var accountAttachmentsOver = /* @__PURE__ */ __name((context) => {
|
|
42996
43035
|
const { database } = context;
|
|
42997
43036
|
const { findAccountPk: findAccountPk2, findChatPk: findChatPk2, chatKeyOf } = keysOver(context);
|
|
@@ -43048,7 +43087,7 @@ var attachmentsStoreOver = /* @__PURE__ */ __name((context, keyed) => ({
|
|
|
43048
43087
|
}, "keepAttachmentText")
|
|
43049
43088
|
}), "attachmentsStoreOver");
|
|
43050
43089
|
|
|
43051
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
43090
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/chat-rekey.js
|
|
43052
43091
|
var chatRow = /* @__PURE__ */ __name((context, accountKey, chatId) => context.database.prepare("SELECT * FROM chats WHERE account_id = ? AND external_id = ?").get(accountKey, chatId), "chatRow");
|
|
43053
43092
|
var pointerMover = /* @__PURE__ */ __name((context, type) => {
|
|
43054
43093
|
const statements = pointerPairs(context.database).filter(({ table }) => table !== "involvements").map(({ table, pointer }) => {
|
|
@@ -43233,7 +43272,7 @@ var rekeyChats = /* @__PURE__ */ __name((context, key2, accountKey, pairs, lockM
|
|
|
43233
43272
|
return done;
|
|
43234
43273
|
}, "rekeyChats");
|
|
43235
43274
|
|
|
43236
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
43275
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/completeness.js
|
|
43237
43276
|
var historyStartKey = /* @__PURE__ */ __name((chatId) => `history_start:${chatId}`, "historyStartKey");
|
|
43238
43277
|
var fetchedKey = /* @__PURE__ */ __name((chatId) => `fetched:${chatId}`, "fetchedKey");
|
|
43239
43278
|
var CHAT_LIST_KEY = "chat_list_complete";
|
|
@@ -43291,7 +43330,7 @@ var chatCoverage = /* @__PURE__ */ __name(({ database }, accountKey) => {
|
|
|
43291
43330
|
return { ...coverage, oldestMessageAt: toIso(oldest) };
|
|
43292
43331
|
}, "chatCoverage");
|
|
43293
43332
|
|
|
43294
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
43333
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/chats.js
|
|
43295
43334
|
var chatsStoreOver = /* @__PURE__ */ __name((context) => {
|
|
43296
43335
|
const { database } = context;
|
|
43297
43336
|
const { accountPk: accountPk2, findAccountPk: findAccountPk2, writeState: writeState2 } = keysOver(context);
|
|
@@ -43440,7 +43479,7 @@ var chatsStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
43440
43479
|
};
|
|
43441
43480
|
}, "chatsStoreOver");
|
|
43442
43481
|
|
|
43443
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
43482
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/batches.js
|
|
43444
43483
|
import { createHash as createHash7 } from "node:crypto";
|
|
43445
43484
|
var BATCH_CONTEXT = 50;
|
|
43446
43485
|
var replied = /* @__PURE__ */ __name((m) => sql`EXISTS (SELECT 1 FROM messages p WHERE p.chat_id = ${m}.chat_id
|
|
@@ -43580,7 +43619,7 @@ var saveAnswers = /* @__PURE__ */ __name((context, id2, answer) => {
|
|
|
43580
43619
|
var clearAnswers = /* @__PURE__ */ __name(({ orm }, chatKey, model) => Number(orm.all(sql`DELETE FROM message_links WHERE chat_id = ${chatKey} AND source = 'agent'
|
|
43581
43620
|
${model === void 0 ? sql`` : sql`AND method = ${model}`} RETURNING 1 AS n`).length), "clearAnswers");
|
|
43582
43621
|
|
|
43583
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
43622
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/conversations.js
|
|
43584
43623
|
import { setTimeout } from "node:timers/promises";
|
|
43585
43624
|
var position = /* @__PURE__ */ __name((sentAt, pk) => `${sentAt}:${pk}`, "position");
|
|
43586
43625
|
var linkInputs = /* @__PURE__ */ __name(({ orm }, chatKey, { after: after2, limit }) => {
|
|
@@ -43844,6 +43883,49 @@ var conversationOf = /* @__PURE__ */ __name(({ orm }, chatKey, messageId) => {
|
|
|
43844
43883
|
const found2 = orm.select({ pk: conversationMessages.conversationId }).from(conversationMessages).innerJoin(messages, eq(messages.id, conversationMessages.messageId)).innerJoin(conversations, eq(conversations.id, conversationMessages.conversationId)).where(and(eq(messages.chatId, chatKey), eq(messages.externalId, messageId), isCurrent)).get();
|
|
43845
43884
|
return found2 ? String(found2.pk) : void 0;
|
|
43846
43885
|
}, "conversationOf");
|
|
43886
|
+
var chunkMessagesOf = /* @__PURE__ */ __name(({ orm }, accountPk2, conversationPk, first, last, limit) => orm.all(sql`SELECT m.external_id AS id, m.sender_name AS sender, m.text, m.outgoing
|
|
43887
|
+
FROM conversations c
|
|
43888
|
+
JOIN chats ch ON ch.id = c.chat_id AND ch.account_id = ${accountPk2}
|
|
43889
|
+
JOIN messages f ON f.chat_id = c.chat_id AND f.external_id = ${first}
|
|
43890
|
+
JOIN messages l ON l.chat_id = c.chat_id AND l.external_id = ${last}
|
|
43891
|
+
JOIN conversation_messages cm ON cm.conversation_id = c.id
|
|
43892
|
+
JOIN messages m ON m.id = cm.message_id
|
|
43893
|
+
WHERE c.id = ${conversationPk} AND m.deleted_at IS NULL AND m.text != ''
|
|
43894
|
+
AND (m.sent_at, m.id) >= (f.sent_at, f.id) AND (m.sent_at, m.id) <= (l.sent_at, l.id)
|
|
43895
|
+
ORDER BY m.sent_at, m.id LIMIT ${limit}`).map(({ outgoing, ...line }) => ({ ...line, outgoing: Boolean(outgoing) })), "chunkMessagesOf");
|
|
43896
|
+
var chunkRepliesOf = /* @__PURE__ */ __name(({ orm }, accountPk2, chunks2, limit) => {
|
|
43897
|
+
const found2 = chunks2.map(() => []);
|
|
43898
|
+
const wanted = chunks2.map(({ conversationId, firstMessageId, lastMessageId }) => ({
|
|
43899
|
+
c: Number(conversationId),
|
|
43900
|
+
f: firstMessageId,
|
|
43901
|
+
l: lastMessageId
|
|
43902
|
+
}));
|
|
43903
|
+
if (!wanted.length)
|
|
43904
|
+
return found2;
|
|
43905
|
+
const rows = orm.all(sql`WITH want(n, conv, first, last) AS (SELECT key, json_extract(value, '$.c'), json_extract(value, '$.f'),
|
|
43906
|
+
json_extract(value, '$.l') FROM json_each(${JSON.stringify(wanted)})),
|
|
43907
|
+
inside(n, id) AS MATERIALIZED (SELECT w.n, m.id
|
|
43908
|
+
FROM want w
|
|
43909
|
+
JOIN conversations c ON c.id = w.conv
|
|
43910
|
+
JOIN chats ch ON ch.id = c.chat_id AND ch.account_id = ${accountPk2}
|
|
43911
|
+
JOIN messages f ON f.chat_id = c.chat_id AND f.external_id = w.first
|
|
43912
|
+
JOIN messages l ON l.chat_id = c.chat_id AND l.external_id = w.last
|
|
43913
|
+
JOIN conversation_messages cm ON cm.conversation_id = c.id
|
|
43914
|
+
JOIN messages m ON m.id = cm.message_id
|
|
43915
|
+
WHERE (m.sent_at, m.id) >= (f.sent_at, f.id) AND (m.sent_at, m.id) <= (l.sent_at, l.id))
|
|
43916
|
+
SELECT DISTINCT i.n, r.external_id AS id, r.sender_name AS sender, r.text, r.outgoing, r.sent_at, r.id AS pk
|
|
43917
|
+
FROM inside i
|
|
43918
|
+
JOIN message_links k ON k.parent_id = i.id AND k.kind = 'reply' AND k.stale_at IS NULL
|
|
43919
|
+
JOIN messages r ON r.id = k.message_id
|
|
43920
|
+
WHERE r.deleted_at IS NULL AND r.text != '' AND NOT EXISTS (SELECT 1 FROM inside o WHERE o.n = i.n AND o.id = r.id)
|
|
43921
|
+
ORDER BY i.n, r.sent_at, r.id`);
|
|
43922
|
+
for (const { n, id: id2, sender, text: text9, outgoing } of rows) {
|
|
43923
|
+
const list2 = found2[n];
|
|
43924
|
+
if (list2 && list2.length < limit)
|
|
43925
|
+
list2.push({ id: id2, sender, text: text9, outgoing: Boolean(outgoing) });
|
|
43926
|
+
}
|
|
43927
|
+
return found2;
|
|
43928
|
+
}, "chunkRepliesOf");
|
|
43847
43929
|
var staleLink = /* @__PURE__ */ __name((chatKey) => sql`(${messageLinks.staleAt} IS NOT NULL
|
|
43848
43930
|
OR EXISTS (SELECT 1 FROM message_revisions r WHERE r.message_id IN (${messageLinks.messageId}, ${messageLinks.parentId})
|
|
43849
43931
|
AND r.created_at >= ${messageLinks.createdAt})
|
|
@@ -43892,7 +43974,7 @@ var agentAnswers = /* @__PURE__ */ __name(({ orm }, chatKey) => new Map(orm.all(
|
|
|
43892
43974
|
AND NOT EXISTS (SELECT 1 FROM messages d
|
|
43893
43975
|
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");
|
|
43894
43976
|
|
|
43895
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
43977
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/conversations.js
|
|
43896
43978
|
var conversationsStoreOver = /* @__PURE__ */ __name((context) => {
|
|
43897
43979
|
const { database } = context;
|
|
43898
43980
|
const { findAccountPk: findAccountPk2, findChatPk: findChatPk2, chatKeyOf } = keysOver(context);
|
|
@@ -43936,6 +44018,15 @@ var conversationsStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
43936
44018
|
const found2 = summariesOf(context, accountPk2, pks.filter((pk) => pk !== void 0));
|
|
43937
44019
|
return pks.map((pk) => pk === void 0 ? void 0 : found2.get(pk));
|
|
43938
44020
|
}, "conversationsOfMessages"),
|
|
44021
|
+
chunkMessages: /* @__PURE__ */ __name(async (key2, conversationId, { firstMessageId, lastMessageId }, limit) => {
|
|
44022
|
+
const accountPk2 = findAccountPk2(key2);
|
|
44023
|
+
const pk = Number(conversationId);
|
|
44024
|
+
return accountPk2 === void 0 || !Number.isSafeInteger(pk) ? [] : chunkMessagesOf(context, accountPk2, pk, firstMessageId, lastMessageId, limit);
|
|
44025
|
+
}, "chunkMessages"),
|
|
44026
|
+
chunkReplies: /* @__PURE__ */ __name(async (key2, chunks2, limit) => {
|
|
44027
|
+
const accountPk2 = findAccountPk2(key2);
|
|
44028
|
+
return accountPk2 === void 0 ? chunks2.map(() => []) : chunkRepliesOf(context, accountPk2, chunks2, limit);
|
|
44029
|
+
}, "chunkReplies"),
|
|
43939
44030
|
links: /* @__PURE__ */ __name(async (key2, chatId, messageId, options) => {
|
|
43940
44031
|
const chatKey = chatKeyOf(key2, chatId);
|
|
43941
44032
|
return chatKey === void 0 ? [] : linksOf(context, chatKey, messageId, options?.limit);
|
|
@@ -43999,7 +44090,7 @@ var conversationsStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
43999
44090
|
};
|
|
44000
44091
|
}, "conversationsStoreOver");
|
|
44001
44092
|
|
|
44002
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
44093
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/counters.js
|
|
44003
44094
|
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";
|
|
44004
44095
|
var accountCountersOver = /* @__PURE__ */ __name((context) => {
|
|
44005
44096
|
const { database } = context;
|
|
@@ -44024,7 +44115,7 @@ var countersStoreOver = /* @__PURE__ */ __name((context, keyed) => ({
|
|
|
44024
44115
|
counterTargets: /* @__PURE__ */ __name(async (execution, options) => counterTargets(context, execution, options), "counterTargets")
|
|
44025
44116
|
}), "countersStoreOver");
|
|
44026
44117
|
|
|
44027
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
44118
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/mentions.js
|
|
44028
44119
|
var MENTION_STATUSES = ["found", "linked", "proposed", "dismissed"];
|
|
44029
44120
|
var MENTION_QUERY = defineQuery({
|
|
44030
44121
|
entity: "mention",
|
|
@@ -44243,7 +44334,7 @@ var listPlaces = /* @__PURE__ */ __name((database, { limit, offset }) => {
|
|
|
44243
44334
|
return { items: hasMore ? rows.slice(0, limit) : rows, hasMore };
|
|
44244
44335
|
}, "listPlaces");
|
|
44245
44336
|
|
|
44246
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
44337
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/mentions.js
|
|
44247
44338
|
var accountMentionsOver = /* @__PURE__ */ __name((context) => {
|
|
44248
44339
|
const { database } = context;
|
|
44249
44340
|
const { findAccountPk: findAccountPk2 } = keysOver(context);
|
|
@@ -44278,7 +44369,7 @@ var mentionsStoreOver = /* @__PURE__ */ __name((context, keyed) => ({
|
|
|
44278
44369
|
places: /* @__PURE__ */ __name(async (window) => listPlaces(context.database, window), "places")
|
|
44279
44370
|
}), "mentionsStoreOver");
|
|
44280
44371
|
|
|
44281
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
44372
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/reply-times.js
|
|
44282
44373
|
var FAR = Number.MAX_SAFE_INTEGER;
|
|
44283
44374
|
var MUTED_NOW = "(coalesce(c.muted,0)=1 AND (c.muted_until IS NULL OR c.muted_until>?))";
|
|
44284
44375
|
var chatsIn = /* @__PURE__ */ __name((scope3, kinds2, now2) => {
|
|
@@ -44377,7 +44468,7 @@ var waitingChats = /* @__PURE__ */ __name((context, scope3, waits, cap) => {
|
|
|
44377
44468
|
});
|
|
44378
44469
|
}, "waitingChats");
|
|
44379
44470
|
|
|
44380
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
44471
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/chat-activity-counts.js
|
|
44381
44472
|
var SQL = `SELECT coalesce(nullif(trim(c.title), ''), (SELECT sender_name FROM messages WHERE chat_id = c.id AND outgoing = 0 AND deleted_at IS NULL ORDER BY sent_at DESC LIMIT 1)) AS title, ${MUTED_NOW} AS muted, w.messages, w.sent, (SELECT max(sent_at) FROM messages WHERE chat_id = c.id AND deleted_at IS NULL AND sent_at < ?) AS last FROM chats c, (SELECT count(*) AS messages, coalesce(sum(outgoing = 1), 0) AS sent FROM messages WHERE chat_id = ? AND deleted_at IS NULL AND sent_at >= ? AND sent_at < ?) w WHERE c.id = ?`;
|
|
44382
44473
|
var chatActivityCounts = /* @__PURE__ */ __name(({ database }, chatKeys, { since, until, now: now2 }) => {
|
|
44383
44474
|
const statement = database.prepare(SQL);
|
|
@@ -44397,7 +44488,7 @@ var chatActivityCounts = /* @__PURE__ */ __name(({ database }, chatKeys, { since
|
|
|
44397
44488
|
return found2;
|
|
44398
44489
|
}, "chatActivityCounts");
|
|
44399
44490
|
|
|
44400
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
44491
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/document-links.js
|
|
44401
44492
|
var documentLinkMessages = /* @__PURE__ */ __name(({ database }, chatKey, messageId) => {
|
|
44402
44493
|
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");
|
|
44403
44494
|
const rows = messageId === void 0 ? read2.all(chatKey) : read2.all(chatKey, messageId);
|
|
@@ -44412,7 +44503,7 @@ var documentLinkMessages = /* @__PURE__ */ __name(({ database }, chatKey, messag
|
|
|
44412
44503
|
}));
|
|
44413
44504
|
}, "documentLinkMessages");
|
|
44414
44505
|
|
|
44415
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
44506
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/follow-ups.js
|
|
44416
44507
|
var stemmerFor = stemmerCache();
|
|
44417
44508
|
var laterSharingRare = /* @__PURE__ */ __name((context, wanted, { rareAt, limit }) => {
|
|
44418
44509
|
if (wanted.length > 50 || !Number.isInteger(limit) || limit < 1 || limit > 100)
|
|
@@ -44456,7 +44547,7 @@ var laterSharingRare = /* @__PURE__ */ __name((context, wanted, { rareAt, limit
|
|
|
44456
44547
|
});
|
|
44457
44548
|
}, "laterSharingRare");
|
|
44458
44549
|
|
|
44459
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
44550
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/messages.js
|
|
44460
44551
|
var accountMessagesOver = /* @__PURE__ */ __name((context) => {
|
|
44461
44552
|
const { database } = context;
|
|
44462
44553
|
const { accountPk: accountPk2, findAccountPk: findAccountPk2, findChatPk: findChatPk2, chatKeyOf, chatPkFor: chatPkFor2, answeredChatPk: answeredChatPk2, upsertMessage: upsertMessage2 } = keysOver(context);
|
|
@@ -44597,7 +44688,7 @@ var messagesStoreOver = /* @__PURE__ */ __name((context, keyed) => ({
|
|
|
44597
44688
|
laterSharingRare: /* @__PURE__ */ __name(async (wanted, options) => laterSharingRare(context, wanted, options), "laterSharingRare")
|
|
44598
44689
|
}), "messagesStoreOver");
|
|
44599
44690
|
|
|
44600
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
44691
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/agent-links.js
|
|
44601
44692
|
var AGENT_METHOD = "agent";
|
|
44602
44693
|
var personsOf = /* @__PURE__ */ __name(({ database }) => new Map(database.prepare("SELECT identity_id, person_id FROM identity_links").all().map((row2) => [Number(row2.identity_id), Number(row2.person_id)])), "personsOf");
|
|
44603
44694
|
var weaknessOf = /* @__PURE__ */ __name((context, kind3, value, holders, sides, others) => {
|
|
@@ -44741,7 +44832,7 @@ var agentMerges = /* @__PURE__ */ __name((context, { limit, offset }) => {
|
|
|
44741
44832
|
return { items: found2.slice(offset, offset + limit), hasMore: found2.length > offset + limit };
|
|
44742
44833
|
}, "agentMerges");
|
|
44743
44834
|
|
|
44744
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
44835
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/identity-rekey.js
|
|
44745
44836
|
var quoted2 = /* @__PURE__ */ __name((name) => `"${name.replace(/"/g, '""')}"`, "quoted");
|
|
44746
44837
|
var columnsOf3 = /* @__PURE__ */ __name((database, table) => database.prepare("SELECT name, pk, type FROM pragma_table_info(?)").all(table), "columnsOf");
|
|
44747
44838
|
var foreignKeysTo = /* @__PURE__ */ __name((database, table) => database.prepare(`SELECT m.name AS tbl, f."from" AS col FROM sqlite_master m JOIN pragma_foreign_key_list(m.name) f
|
|
@@ -44885,7 +44976,7 @@ var rekeyIdentities = /* @__PURE__ */ __name((context, provider, pairs, { lockMs
|
|
|
44885
44976
|
return done;
|
|
44886
44977
|
}, "rekeyIdentities");
|
|
44887
44978
|
|
|
44888
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
44979
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/domain/person-kinds.js
|
|
44889
44980
|
var PERSON_KINDS = ["person", "organization", "automated", "stranger", "unsorted", "test"];
|
|
44890
44981
|
var AUTOMATED_WORDS = /* @__PURE__ */ new Set([
|
|
44891
44982
|
"noreply",
|
|
@@ -44948,7 +45039,7 @@ var isCompanyName = /* @__PURE__ */ __name((name) => {
|
|
|
44948
45039
|
return wordsOf3(name.replaceAll(".", "")).some((word2) => LEGAL_FORMS.has(word2) || COMPANY_WORDS.has(word2));
|
|
44949
45040
|
}, "isCompanyName");
|
|
44950
45041
|
|
|
44951
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
45042
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/person-ties.js
|
|
44952
45043
|
var SMALL_GROUP_MEMBERS = 10;
|
|
44953
45044
|
var PERSON_TIES = ["chat", "small-group", "mail", "meeting", "crm", "phone-book"];
|
|
44954
45045
|
var ALWAYS_SHOWN = ["owner", "added", "task"];
|
|
@@ -45003,7 +45094,7 @@ var shownReasons = /* @__PURE__ */ __name((database, people2) => {
|
|
|
45003
45094
|
return new Map([...found2].map(([person2, reasons]) => [person2, ORDER.filter((one2) => reasons.has(one2))]));
|
|
45004
45095
|
}, "shownReasons");
|
|
45005
45096
|
|
|
45006
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
45097
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/people-list.js
|
|
45007
45098
|
var PEOPLE_SORTS = ["interactions", "recent", "name", "tasks"];
|
|
45008
45099
|
var MIN_QUERY = 3;
|
|
45009
45100
|
var matching2 = /* @__PURE__ */ __name((query) => {
|
|
@@ -45348,7 +45439,7 @@ var similarPeople = /* @__PURE__ */ __name((database, typed, limit) => {
|
|
|
45348
45439
|
return withLastContact(database, rows).map((person2, at2) => ({ ...person2, sameName: same[at2] === true }));
|
|
45349
45440
|
}, "similarPeople");
|
|
45350
45441
|
|
|
45351
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
45442
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/person-doubts.js
|
|
45352
45443
|
var DOUBT_REASONS = ["owner-other-name", "test-data", "shared-address", "mixed-names"];
|
|
45353
45444
|
var COLUMNS5 = "l.person_id AS person, p.owner, p.name AS person_name, i.id AS pk, i.provider, i.external_id, i.name, i.phone, i.email, i.username, l.method, l.author, l.created_at, EXISTS (SELECT 1 FROM accounts a WHERE a.provider = i.provider AND a.external_id = i.external_id) AS account FROM identity_links l JOIN identities i ON i.id = l.identity_id JOIN persons p ON p.id = l.person_id";
|
|
45354
45445
|
var text5 = /* @__PURE__ */ __name((value) => typeof value === "string" && value.trim() !== "" ? value : null, "text");
|
|
@@ -45604,7 +45695,7 @@ var markTestData = /* @__PURE__ */ __name((context, uid, by) => {
|
|
|
45604
45695
|
return { person: `person:${person2}`, identities: identities2 };
|
|
45605
45696
|
}, "markTestData");
|
|
45606
45697
|
|
|
45607
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
45698
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/person-preparation.js
|
|
45608
45699
|
var GLOBAL_PROJECT = "SELECT id FROM main.projects WHERE account_id IS NULL AND deleted_at IS NULL";
|
|
45609
45700
|
var IN_SCOPES = "IN (SELECT value FROM json_each(?))";
|
|
45610
45701
|
var projectScope = /* @__PURE__ */ __name((id2) => `(SELECT p.scope FROM main.projects p WHERE p.id=${id2})`, "projectScope");
|
|
@@ -45673,7 +45764,7 @@ var personPreparation = /* @__PURE__ */ __name(({ database, now: now2 }, uid, {
|
|
|
45673
45764
|
});
|
|
45674
45765
|
}, "personPreparation");
|
|
45675
45766
|
|
|
45676
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
45767
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/person-scope.js
|
|
45677
45768
|
var personSeenInAccounts = /* @__PURE__ */ __name(({ database }, uid, accountIds) => {
|
|
45678
45769
|
const id2 = Number(uid);
|
|
45679
45770
|
if (!/^[1-9]\d*$/.test(uid) || !Number.isSafeInteger(id2) || !accountIds.length || accountIds.length > 1e3 || accountIds.some((account) => !Number.isSafeInteger(account) || account <= 0))
|
|
@@ -45681,7 +45772,7 @@ var personSeenInAccounts = /* @__PURE__ */ __name(({ database }, uid, accountIds
|
|
|
45681
45772
|
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(currentPerson(database, id2), JSON.stringify(accountIds)));
|
|
45682
45773
|
}, "personSeenInAccounts");
|
|
45683
45774
|
|
|
45684
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
45775
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/private-people.js
|
|
45685
45776
|
var required2 = /* @__PURE__ */ __name(({ database }, key2, personId) => {
|
|
45686
45777
|
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);
|
|
45687
45778
|
if (!row2)
|
|
@@ -45748,7 +45839,7 @@ var removeNote = /* @__PURE__ */ __name((context, key2, personId, id2) => {
|
|
|
45748
45839
|
return { id: id2, personId, removed: true };
|
|
45749
45840
|
}, "removeNote");
|
|
45750
45841
|
|
|
45751
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
45842
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/people.js
|
|
45752
45843
|
var accountPeopleOver = /* @__PURE__ */ __name((context) => {
|
|
45753
45844
|
const { database } = context;
|
|
45754
45845
|
const { accountPk: accountPk2, findAccountPk: findAccountPk2, identityPk: identityPk2 } = keysOver(context);
|
|
@@ -45891,13 +45982,13 @@ var peopleStoreOver = /* @__PURE__ */ __name((context, keyed) => {
|
|
|
45891
45982
|
};
|
|
45892
45983
|
}, "peopleStoreOver");
|
|
45893
45984
|
|
|
45894
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
45985
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/admin-statistics.js
|
|
45895
45986
|
import { createHash as createHash9 } from "node:crypto";
|
|
45896
45987
|
|
|
45897
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
45988
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/domain/admin-statistics.js
|
|
45898
45989
|
import { createHash as createHash8 } from "node:crypto";
|
|
45899
45990
|
|
|
45900
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
45991
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/domain/rankings-options.js
|
|
45901
45992
|
var MESSAGE_MEASURES = ["views", "reactions", "forwards", "comments", "replies", "thread-size"];
|
|
45902
45993
|
var AUTHOR_MEASURES = [
|
|
45903
45994
|
"messages",
|
|
@@ -46037,7 +46128,7 @@ var withoutUrls = /* @__PURE__ */ __name((text9) => text9.replace(/\S+/gu, (toke
|
|
|
46037
46128
|
var rankingWords = /* @__PURE__ */ __name((text9) => withoutUrls(text9).match(/[\p{L}\p{N}]+/gu)?.length ?? 0, "rankingWords");
|
|
46038
46129
|
var rankingQuestion = /* @__PURE__ */ __name((text9) => withoutUrls(text9).includes("?"), "rankingQuestion");
|
|
46039
46130
|
|
|
46040
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
46131
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/domain/rankings-graph.js
|
|
46041
46132
|
var RANKING_GRAPH_LIMITS = { nodes: 5e4, depth: 256, work: 1e7, bytes: 8388608 };
|
|
46042
46133
|
var exhausted2 = /* @__PURE__ */ __name((budget) => {
|
|
46043
46134
|
throw new CliError("validation_error", `ranking exceeded ${budget} \u2014 narrow its chat or date scope`, {
|
|
@@ -46259,7 +46350,7 @@ var rankReplyGraph = /* @__PURE__ */ __name((nodes, check3 = () => {
|
|
|
46259
46350
|
};
|
|
46260
46351
|
}, "rankReplyGraph");
|
|
46261
46352
|
|
|
46262
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
46353
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/domain/admin-statistics.js
|
|
46263
46354
|
var adminEntityKey = /* @__PURE__ */ __name((row2) => JSON.stringify([row2.account.provider, row2.account.account, row2.id]), "adminEntityKey");
|
|
46264
46355
|
var personKey = /* @__PURE__ */ __name((node) => JSON.stringify([node.account.provider, node.account.account, node.sender]), "personKey");
|
|
46265
46356
|
var locator = /* @__PURE__ */ __name((node) => formatLocator({ ...node.account, chat: node.chatId, message: node.id }), "locator");
|
|
@@ -46433,7 +46524,7 @@ var calculateAdminStatistics = /* @__PURE__ */ __name((nodes, stays, options, in
|
|
|
46433
46524
|
return { items, evidence, summary, graph: graph.quality };
|
|
46434
46525
|
}, "calculateAdminStatistics");
|
|
46435
46526
|
|
|
46436
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
46527
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/domain/rankings-range.js
|
|
46437
46528
|
var rankingContextRange = /* @__PURE__ */ __name((root) => {
|
|
46438
46529
|
const dates = [];
|
|
46439
46530
|
const visit = /* @__PURE__ */ __name((node, required3) => {
|
|
@@ -46455,7 +46546,7 @@ var rankingContextRange = /* @__PURE__ */ __name((root) => {
|
|
|
46455
46546
|
return dates[0].node.resolution.date;
|
|
46456
46547
|
}, "rankingContextRange");
|
|
46457
46548
|
|
|
46458
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
46549
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/rankings.js
|
|
46459
46550
|
var reactionCounts = /* @__PURE__ */ __name((stored4) => {
|
|
46460
46551
|
let counts;
|
|
46461
46552
|
try {
|
|
@@ -46750,14 +46841,14 @@ var rankQuery = /* @__PURE__ */ __name((context, execution, request, inspect) =>
|
|
|
46750
46841
|
});
|
|
46751
46842
|
}, "rankQuery");
|
|
46752
46843
|
|
|
46753
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
46844
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/admin-statistics.js
|
|
46754
46845
|
function fail2(message3, reason = "query.too-large") {
|
|
46755
46846
|
throw new CliError("validation_error", message3, { reason, complete: false });
|
|
46756
46847
|
}
|
|
46757
46848
|
__name(fail2, "fail");
|
|
46758
46849
|
var joined2 = "FROM messages m JOIN chats c ON c.id=m.chat_id JOIN accounts ac ON ac.id=m.account_id LEFT JOIN identities i ON i.id=m.sender_identity_id";
|
|
46759
|
-
var attachmentSnapshot = `(SELECT json_group_array(json_object('position',position,'kind',kind,'mime',mime,'name',name,'title',title,'url',url,'size',size,'width',width,'height',height,'duration',duration,'localPath',local_path)) FROM attachments WHERE attachable_type='message' AND attachable_id=m.id)`;
|
|
46760
|
-
var snapshot = `json_object('edited',m.edited_at,'senderName',m.sender_name,'reply',m.reply_to,'forward',m.forward,'reactions',m.reactions,'outgoing',m.outgoing,'thread',m.thread_external_id,'attachments',${attachmentSnapshot},'counterObservations',(SELECT json_group_array(json_object('counter',counter,'value',value,'at',created_at,'source',source)) FROM message_counter_observations WHERE message_id=m.id))`;
|
|
46850
|
+
var attachmentSnapshot = `json((SELECT json_group_array(json_object('position',position,'kind',kind,'mime',mime,'name',name,'title',title,'url',url,'size',size,'width',width,'height',height,'duration',duration,'localPath',local_path)) FROM attachments WHERE attachable_type='message' AND attachable_id=m.id))`;
|
|
46851
|
+
var snapshot = `json_object('edited',m.edited_at,'senderName',m.sender_name,'reply',m.reply_to,'forward',m.forward,'reactions',m.reactions,'outgoing',m.outgoing,'thread',m.thread_external_id,'attachments',${attachmentSnapshot},'counterObservations',json((SELECT json_group_array(json_object('counter',counter,'value',value,'at',created_at,'source',source)) FROM message_counter_observations WHERE message_id=m.id)))`;
|
|
46761
46852
|
var adminStatisticsQuery = /* @__PURE__ */ __name((context, execution, request) => withQuerySelection(context, execution, (selection, check3) => {
|
|
46762
46853
|
const { database } = context, { options } = request;
|
|
46763
46854
|
const prefix = `WITH selected AS (${selection.sql}) `;
|
|
@@ -46927,7 +47018,7 @@ var adminStatisticsQuery = /* @__PURE__ */ __name((context, execution, request)
|
|
|
46927
47018
|
return result;
|
|
46928
47019
|
}), "adminStatisticsQuery");
|
|
46929
47020
|
|
|
46930
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
47021
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/conversation-eligibility.js
|
|
46931
47022
|
var conversationEligibility = /* @__PURE__ */ __name(async (context, execution) => {
|
|
46932
47023
|
if (!execution.accounts.length)
|
|
46933
47024
|
return { conversations: [], chats: [] };
|
|
@@ -46945,7 +47036,7 @@ var conversationEligibility = /* @__PURE__ */ __name(async (context, execution)
|
|
|
46945
47036
|
return { conversations: conversations2, chats: chats2 };
|
|
46946
47037
|
}, "conversationEligibility");
|
|
46947
47038
|
|
|
46948
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
47039
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/ranking-evidence.js
|
|
46949
47040
|
import { createHash as createHash10 } from "node:crypto";
|
|
46950
47041
|
var EVIDENCE_BYTES = 64 * 1024;
|
|
46951
47042
|
var FINGERPRINT_BYTES = 8 * 1024 * 1024;
|
|
@@ -47095,7 +47186,7 @@ var rankingEvidence = /* @__PURE__ */ __name((context, execution, request) => {
|
|
|
47095
47186
|
return result;
|
|
47096
47187
|
}, "rankingEvidence");
|
|
47097
47188
|
|
|
47098
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
47189
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/queries.js
|
|
47099
47190
|
var queriesStoreOver = /* @__PURE__ */ __name((context, stemmerFor2) => {
|
|
47100
47191
|
const mailIndexed = /* @__PURE__ */ __name((execution) => {
|
|
47101
47192
|
if (execution.corpus === "mail")
|
|
@@ -47116,7 +47207,7 @@ var queriesStoreOver = /* @__PURE__ */ __name((context, stemmerFor2) => {
|
|
|
47116
47207
|
};
|
|
47117
47208
|
}, "queriesStoreOver");
|
|
47118
47209
|
|
|
47119
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
47210
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/chat-events.js
|
|
47120
47211
|
var saveChatEvents = /* @__PURE__ */ __name((context, accountKey, provider, chatKey, events3) => {
|
|
47121
47212
|
const { database, now: now2 } = context;
|
|
47122
47213
|
const insert = database.prepare(`INSERT INTO chat_events (chat_id, source_id, action, actor_identity_id, title, happened_at, created_at, updated_at)
|
|
@@ -47155,10 +47246,10 @@ var chatEventsOf = /* @__PURE__ */ __name(({ database }, chatKey, { since = 0, l
|
|
|
47155
47246
|
}));
|
|
47156
47247
|
}, "chatEventsOf");
|
|
47157
47248
|
|
|
47158
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
47249
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/retention.js
|
|
47159
47250
|
import { createHash as createHash11 } from "node:crypto";
|
|
47160
47251
|
|
|
47161
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
47252
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/domain/calendar.js
|
|
47162
47253
|
var calendarKey = /* @__PURE__ */ __name((zone, by) => {
|
|
47163
47254
|
const format = new Intl.DateTimeFormat("en-CA", {
|
|
47164
47255
|
timeZone: zone,
|
|
@@ -47178,7 +47269,7 @@ var weekKey = /* @__PURE__ */ __name((day3) => {
|
|
|
47178
47269
|
return date3.toISOString().slice(0, 10);
|
|
47179
47270
|
}, "weekKey");
|
|
47180
47271
|
|
|
47181
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
47272
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/domain/retention.js
|
|
47182
47273
|
var RETENTION_TOLERANCE = 864e5;
|
|
47183
47274
|
var validateRetentionOptions = /* @__PURE__ */ __name((options) => {
|
|
47184
47275
|
const { since, until, cutoff, checkpoints, within, limit, by } = options;
|
|
@@ -47232,7 +47323,7 @@ var retentionCohorts = /* @__PURE__ */ __name((stays, options) => {
|
|
|
47232
47323
|
return [...groups.values()].sort((a, b) => a.cohort.localeCompare(b.cohort));
|
|
47233
47324
|
}, "retentionCohorts");
|
|
47234
47325
|
|
|
47235
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
47326
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/retention.js
|
|
47236
47327
|
var iso10 = /* @__PURE__ */ __name((at2) => new Date(at2).toISOString(), "iso");
|
|
47237
47328
|
var retentionQuery = /* @__PURE__ */ __name((context, accountPk2, chatPk, chatId, options, evidence) => {
|
|
47238
47329
|
validateRetentionOptions(options);
|
|
@@ -47363,7 +47454,7 @@ var retentionQuery = /* @__PURE__ */ __name((context, accountPk2, chatPk, chatId
|
|
|
47363
47454
|
};
|
|
47364
47455
|
}, "retentionQuery");
|
|
47365
47456
|
|
|
47366
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
47457
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/roster.js
|
|
47367
47458
|
var iso11 = /* @__PURE__ */ __name((ms) => ms === null ? null : new Date(ms).toISOString(), "iso");
|
|
47368
47459
|
var marksOf = /* @__PURE__ */ __name(({ isBot: isBot2, flagged, deleted, hasPhoto }) => ({
|
|
47369
47460
|
...isBot2 === void 0 ? {} : { bot: isBot2 },
|
|
@@ -47492,7 +47583,7 @@ var trackedChats = /* @__PURE__ */ __name((context, accountKey, where) => contex
|
|
|
47492
47583
|
lastCount: memberCountsOf(context, pk).at(-1) ?? null
|
|
47493
47584
|
})), "trackedChats");
|
|
47494
47585
|
|
|
47495
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
47586
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/roster.js
|
|
47496
47587
|
var rosterStoreOver = /* @__PURE__ */ __name((context) => {
|
|
47497
47588
|
const { database } = context;
|
|
47498
47589
|
const { accountPk: accountPk2, findAccountPk: findAccountPk2, chatKeyOf, chatPkFor: chatPkFor2, writeMembers: writeMembers2 } = keysOver(context);
|
|
@@ -47548,7 +47639,7 @@ var rosterStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
47548
47639
|
};
|
|
47549
47640
|
}, "rosterStoreOver");
|
|
47550
47641
|
|
|
47551
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
47642
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/backfill.js
|
|
47552
47643
|
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");
|
|
47553
47644
|
var backfillNormalized = /* @__PURE__ */ __name((database, { batch = 5e3, onBatch, until = /* @__PURE__ */ __name(() => false, "until") } = {}) => {
|
|
47554
47645
|
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 ?`);
|
|
@@ -47572,7 +47663,7 @@ var backfillNormalized = /* @__PURE__ */ __name((database, { batch = 5e3, onBatc
|
|
|
47572
47663
|
}
|
|
47573
47664
|
}, "backfillNormalized");
|
|
47574
47665
|
|
|
47575
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
47666
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/search-index.js
|
|
47576
47667
|
var INDEX2 = "message_words";
|
|
47577
47668
|
var searchIndexState2 = /* @__PURE__ */ __name((database) => {
|
|
47578
47669
|
const row2 = indexRow(database, INDEX2);
|
|
@@ -47699,7 +47790,7 @@ var resetSearchIndex = /* @__PURE__ */ __name((database) => {
|
|
|
47699
47790
|
});
|
|
47700
47791
|
}, "resetSearchIndex");
|
|
47701
47792
|
|
|
47702
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
47793
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/stems-fill.js
|
|
47703
47794
|
var fillStems = /* @__PURE__ */ __name((database, { batch = 5e3, until = /* @__PURE__ */ __name(() => false, "until"), onBatch, now: now2 = Date.now } = {}) => {
|
|
47704
47795
|
const filled = { stemmed: 0, drained: 0 };
|
|
47705
47796
|
const before2 = stemsState(database);
|
|
@@ -47794,7 +47885,7 @@ var followDefaultStemmers = /* @__PURE__ */ __name((database, now2 = Date.now) =
|
|
|
47794
47885
|
return resetStems(database, { now: now2 });
|
|
47795
47886
|
}, "followDefaultStemmers");
|
|
47796
47887
|
|
|
47797
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
47888
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/words.js
|
|
47798
47889
|
var VOCABULARY = "SELECT term, doc FROM message_words_vocab WHERE col = 'normalized_text'";
|
|
47799
47890
|
var knownTerms = /* @__PURE__ */ __name(({ database }, terms) => {
|
|
47800
47891
|
const lookup = database.prepare(`${VOCABULARY} AND term >= ? AND term <= ? LIMIT 1`);
|
|
@@ -47816,7 +47907,7 @@ var termCandidates = /* @__PURE__ */ __name(({ database }, pieces, { shortest, l
|
|
|
47816
47907
|
});
|
|
47817
47908
|
}, "termCandidates");
|
|
47818
47909
|
|
|
47819
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
47910
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/search-index.js
|
|
47820
47911
|
var searchIndexStoreOver = /* @__PURE__ */ __name((context) => {
|
|
47821
47912
|
const { database } = context;
|
|
47822
47913
|
const stemmerFor2 = stemmerCache();
|
|
@@ -47841,7 +47932,7 @@ var searchIndexStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
47841
47932
|
};
|
|
47842
47933
|
}, "searchIndexStoreOver");
|
|
47843
47934
|
|
|
47844
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
47935
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/searches.js
|
|
47845
47936
|
var HISTORY_KEPT = 1e3;
|
|
47846
47937
|
var commandFilter = /* @__PURE__ */ __name((commands) => commands ? { sql: ` AND command IN (${commands.map(() => "?").join(", ")})`, values: [...commands] } : { sql: "", values: [] }, "commandFilter");
|
|
47847
47938
|
var COLUMNS6 = "id, name, command, params, language, version, fields_version, created_at, updated_at, last_run_at, runs";
|
|
@@ -47911,7 +48002,7 @@ var clearHistory = /* @__PURE__ */ __name(({ database }, commands) => {
|
|
|
47911
48002
|
return database.prepare(`DELETE FROM searches WHERE name IS NULL${only.sql}`).run(...only.values).changes;
|
|
47912
48003
|
}, "clearHistory");
|
|
47913
48004
|
|
|
47914
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
48005
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/searches.js
|
|
47915
48006
|
var searchesStoreOver = /* @__PURE__ */ __name((context) => {
|
|
47916
48007
|
const { database } = context;
|
|
47917
48008
|
return {
|
|
@@ -47935,7 +48026,7 @@ var searchesStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
47935
48026
|
};
|
|
47936
48027
|
}, "searchesStoreOver");
|
|
47937
48028
|
|
|
47938
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
48029
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/added-sources.js
|
|
47939
48030
|
import { createHash as createHash12 } from "node:crypto";
|
|
47940
48031
|
var ADDED_KINDS = ["text", "file", "page"];
|
|
47941
48032
|
var TEXT_COLUMNS = "kind = ?, title = ?, file_name = ?, extension = ?, url = ?, mime = ?, size = ?, content_hash = ?, body = ?, extraction = ?, metadata = ?, language = ?";
|
|
@@ -48177,7 +48268,7 @@ var addedSourcesOver = /* @__PURE__ */ __name((context) => {
|
|
|
48177
48268
|
};
|
|
48178
48269
|
}, "addedSourcesOver");
|
|
48179
48270
|
|
|
48180
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
48271
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/agent-actions.js
|
|
48181
48272
|
var ACTION_TIERS = ["read", "draft", "write-private", "write-public", "destructive", "admin"];
|
|
48182
48273
|
var ACTION_OUTCOMES = ["ok", "refused", "failed"];
|
|
48183
48274
|
var CODE = /^[a-z][a-z0-9_]{0,63}$/;
|
|
@@ -48225,7 +48316,7 @@ var agentActionsStoreOver = /* @__PURE__ */ __name((context, afterRecord = () =>
|
|
|
48225
48316
|
};
|
|
48226
48317
|
}, "agentActionsStoreOver");
|
|
48227
48318
|
|
|
48228
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
48319
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/base-suggest.js
|
|
48229
48320
|
var baseSettingKey = /* @__PURE__ */ __name((kind3) => `stages.base.${kind3}`, "baseSettingKey");
|
|
48230
48321
|
var storedPipeline = /* @__PURE__ */ __name((value) => {
|
|
48231
48322
|
if (typeof value !== "string")
|
|
@@ -48271,11 +48362,11 @@ var suggestBaseStages = /* @__PURE__ */ __name((database, kind3, pipelines2, { o
|
|
|
48271
48362
|
}
|
|
48272
48363
|
}, "suggestBaseStages");
|
|
48273
48364
|
|
|
48274
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
48365
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/copy-viewer.js
|
|
48275
48366
|
var viewerSql = /* @__PURE__ */ __name((alias2, viewer) => viewer === void 0 ? { sql: "1", params: [] } : viewer.assignee === null ? { sql: "0", params: [] } : { sql: `json_extract(${alias2}.metadata, '$.assignee') = ?`, params: [viewer.assignee] }, "viewerSql");
|
|
48276
48367
|
var seenBy = /* @__PURE__ */ __name((viewer, row2) => viewer === void 0 || row2.provider !== viewer.account.provider || row2.account !== viewer.account.account || viewer.assignee !== null && row2.assignee === viewer.assignee, "seenBy");
|
|
48277
48368
|
|
|
48278
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
48369
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/domain/records.js
|
|
48279
48370
|
import { createHash as createHash13 } from "node:crypto";
|
|
48280
48371
|
var RECORDS_SCHEMA_VERSION = 1;
|
|
48281
48372
|
var RECORD_OPERATIONS = ["upsert", "delete"];
|
|
@@ -48416,7 +48507,7 @@ var fieldReferences = /* @__PURE__ */ __name((record3, options = {}) => {
|
|
|
48416
48507
|
return found2;
|
|
48417
48508
|
}, "fieldReferences");
|
|
48418
48509
|
|
|
48419
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
48510
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/crm-rows.js
|
|
48420
48511
|
var TABLES2 = { deal: "deals", lead: "leads" };
|
|
48421
48512
|
var MONEY_REFUSALS = ["money.currency", "money.amount"];
|
|
48422
48513
|
var amountFault = /* @__PURE__ */ __name((item, code) => {
|
|
@@ -48588,7 +48679,7 @@ var crmRowsOver = /* @__PURE__ */ __name((context) => {
|
|
|
48588
48679
|
return { savePipeline, saveItemRow };
|
|
48589
48680
|
}, "crmRowsOver");
|
|
48590
48681
|
|
|
48591
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
48682
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/crm-activities.js
|
|
48592
48683
|
var ACTIVITY_RECORD = "crm.activity";
|
|
48593
48684
|
var forgetActivitiesOn = /* @__PURE__ */ __name((database, accountId, kind3, externalIds, at2) => {
|
|
48594
48685
|
const removed = "rr.target_type = ? AND rr.target_external_id IN (SELECT value FROM json_each(?))";
|
|
@@ -48776,7 +48867,7 @@ var seenSql = /* @__PURE__ */ __name((viewer) => {
|
|
|
48776
48867
|
};
|
|
48777
48868
|
}, "seenSql");
|
|
48778
48869
|
|
|
48779
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
48870
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/crm-stage-entries.js
|
|
48780
48871
|
var STAGE_ENTRY_RECORD = "crm.stage-entry";
|
|
48781
48872
|
var STAGE_ENTRY_DAYS = 90;
|
|
48782
48873
|
var STAGE_TASK_DAYS = 7;
|
|
@@ -48844,7 +48935,7 @@ var crmStageEntriesOver = /* @__PURE__ */ __name((context) => {
|
|
|
48844
48935
|
return { save: save2, pending, handled, expire };
|
|
48845
48936
|
}, "crmStageEntriesOver");
|
|
48846
48937
|
|
|
48847
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
48938
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/stage-amounts.js
|
|
48848
48939
|
var TABLES3 = { deal: "deals", lead: "leads" };
|
|
48849
48940
|
var stageAmountsOf = /* @__PURE__ */ __name(({ database }, kind3, stageIds, { since, until }, viewer) => {
|
|
48850
48941
|
const seen = viewerSql("d", viewer);
|
|
@@ -48862,7 +48953,7 @@ var stageAmountsOf = /* @__PURE__ */ __name(({ database }, kind3, stageIds, { si
|
|
|
48862
48953
|
});
|
|
48863
48954
|
}, "stageAmountsOf");
|
|
48864
48955
|
|
|
48865
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
48956
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/pipeline-period.js
|
|
48866
48957
|
var TABLES4 = { deal: "deals", lead: "leads" };
|
|
48867
48958
|
var DAY7 = 864e5;
|
|
48868
48959
|
var LOST_REASONS = 10;
|
|
@@ -49019,7 +49110,7 @@ var pipelinePeriod = /* @__PURE__ */ __name((context, pipeline, window, zone, vi
|
|
|
49019
49110
|
};
|
|
49020
49111
|
}, "pipelinePeriod");
|
|
49021
49112
|
|
|
49022
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
49113
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/deals.js
|
|
49023
49114
|
var TABLES5 = { deal: "deals", lead: "leads" };
|
|
49024
49115
|
var itemsSql = /* @__PURE__ */ __name((kind3) => `SELECT d.*, s.name AS stage_name, s.pipeline_id, p.name AS pipeline_name, b.name AS author_name, b.kind AS author_kind, a.provider AS account_provider, a.external_id AS account_external_id, bs.id AS base_stage_ref_id, bs.name AS base_stage_name FROM ${TABLES5[kind3]} d JOIN pipeline_stages s ON s.id = d.stage_id JOIN pipelines p ON p.id = s.pipeline_id LEFT JOIN bots b ON d.author_type = 'bot' AND b.id = d.author_id LEFT JOIN accounts a ON a.id = d.account_id LEFT JOIN pipeline_stages bs ON s.base_confirmed = 1 AND bs.id = s.base_stage_id`, "itemsSql");
|
|
49025
49116
|
var MAX_STAGES = 30;
|
|
@@ -49492,7 +49583,7 @@ var dealsStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
49492
49583
|
};
|
|
49493
49584
|
}, "dealsStoreOver");
|
|
49494
49585
|
|
|
49495
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
49586
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/owner-languages.js
|
|
49496
49587
|
var KEY2 = "ownerLanguages";
|
|
49497
49588
|
var ISO_639_1 = new Set("aa ab ae af ak am an ar as av ay az ba be bg bi bm bn bo br bs ca ce ch co cr cs cu cv cy da de dv dz ee el en eo es et eu fa ff fi fj fo fr fy ga gd gl gn gu gv ha he hi ho hr ht hu hy hz ia id ie ig ii ik io is it iu ja jv ka kg ki kj kk kl km kn ko kr ks ku kv kw ky la lb lg li ln lo lt lu lv mg mh mi mk ml mn mr ms mt my na nb nd ne ng nl nn no nr nv ny oc oj om or os pa pi pl ps pt qu rm rn ro ru rw sa sc sd se sg si sk sl sm sn so sq sr ss st su sv sw ta te tg th ti tk tl tn to tr ts tt tw ty ug uk ur uz ve vi vo wa wo xh yi yo za zh zu".split(" "));
|
|
49498
49589
|
var DEFAULT_OWNER_LANGUAGES = ["ru"];
|
|
@@ -49522,7 +49613,7 @@ var saveOwnerLanguages = /* @__PURE__ */ __name((database, languages, now2) => {
|
|
|
49522
49613
|
database.prepare("INSERT INTO store_settings (key, value, at) VALUES (?, ?, ?) ON CONFLICT (key) DO UPDATE SET value = excluded.value, at = excluded.at").run(KEY2, JSON.stringify(languages), now2);
|
|
49523
49614
|
}, "saveOwnerLanguages");
|
|
49524
49615
|
|
|
49525
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
49616
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/base-stages.js
|
|
49526
49617
|
var OUTCOMES = {
|
|
49527
49618
|
lead: ["open", "open", "open", "won", "lost"],
|
|
49528
49619
|
deal: ["open", "open", "open", "open", "won", "lost"]
|
|
@@ -49855,7 +49946,7 @@ var baseStagesStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
49855
49946
|
};
|
|
49856
49947
|
}, "baseStagesStoreOver");
|
|
49857
49948
|
|
|
49858
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
49949
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/bot-updates.js
|
|
49859
49950
|
var botUpdateStoreOver = /* @__PURE__ */ __name((context, afterSave = () => {
|
|
49860
49951
|
}) => {
|
|
49861
49952
|
const { database, now: now2 } = context;
|
|
@@ -49914,7 +50005,7 @@ var botUpdateStoreOver = /* @__PURE__ */ __name((context, afterSave = () => {
|
|
|
49914
50005
|
};
|
|
49915
50006
|
}, "botUpdateStoreOver");
|
|
49916
50007
|
|
|
49917
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
50008
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/record-projection.js
|
|
49918
50009
|
var IMPORTER = { bot: "import" };
|
|
49919
50010
|
var importersProposal = /* @__PURE__ */ __name((entity) => entity.review === "proposed" && entity.author.type === "bot" && entity.author.name === IMPORTER.bot, "importersProposal");
|
|
49920
50011
|
var codeOf = /* @__PURE__ */ __name((error) => {
|
|
@@ -49959,7 +50050,7 @@ var moneyLinesOf = /* @__PURE__ */ __name((projection, list2) => (Array.isArray(
|
|
|
49959
50050
|
};
|
|
49960
50051
|
}), "moneyLinesOf");
|
|
49961
50052
|
|
|
49962
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
50053
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/domain/relation-role-labels.js
|
|
49963
50054
|
var label = /* @__PURE__ */ __name((en, ru, es) => ({ en, ru, es }), "label");
|
|
49964
50055
|
var ROLE_LABELS = {
|
|
49965
50056
|
organization: {
|
|
@@ -50000,7 +50091,7 @@ var ROLE_LABELS = {
|
|
|
50000
50091
|
}
|
|
50001
50092
|
};
|
|
50002
50093
|
|
|
50003
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
50094
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/relation-roles.js
|
|
50004
50095
|
var settingOf = /* @__PURE__ */ __name((list2) => `relationships.roles.${list2}`, "settingOf");
|
|
50005
50096
|
var isList = /* @__PURE__ */ __name((list2) => Object.hasOwn(ROLE_LISTS, list2), "isList");
|
|
50006
50097
|
var listOf2 = /* @__PURE__ */ __name((list2) => {
|
|
@@ -50084,7 +50175,7 @@ var relationRolesOver = /* @__PURE__ */ __name(({ database, now: now2 }) => {
|
|
|
50084
50175
|
};
|
|
50085
50176
|
}, "relationRolesOver");
|
|
50086
50177
|
|
|
50087
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
50178
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/crm-settings.js
|
|
50088
50179
|
var CRM_LINK_MODES = ["reported", "review"];
|
|
50089
50180
|
var COMPANY_TYPE_MEANINGS = ["customer-of", "supplier", "partner-of"];
|
|
50090
50181
|
var CRM_SCOPES = ["mine", "all"];
|
|
@@ -50315,7 +50406,7 @@ var crmSettingsOf = /* @__PURE__ */ __name((database) => database.prepare("SELEC
|
|
|
50315
50406
|
return [{ setting: String(row2.key), value: settingValue(database, parsed5.key, parsed5.name) }];
|
|
50316
50407
|
}), "crmSettingsOf");
|
|
50317
50408
|
|
|
50318
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
50409
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/relation-proposals.js
|
|
50319
50410
|
var isoOf = /* @__PURE__ */ __name((ms) => ms === void 0 ? null : new Date(ms).toISOString(), "isoOf");
|
|
50320
50411
|
var relationOf = /* @__PURE__ */ __name((link3, now2) => ({
|
|
50321
50412
|
id: link3.id,
|
|
@@ -50675,7 +50766,7 @@ var decidedOrigin = /* @__PURE__ */ __name((by) => by === "owner" ? { origin: "o
|
|
|
50675
50766
|
provenance: `agent:${by.bot} for the owner: ${by.reason.trim()}`
|
|
50676
50767
|
}, "decidedOrigin");
|
|
50677
50768
|
|
|
50678
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
50769
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/reported-relations.js
|
|
50679
50770
|
var keyOf4 = /* @__PURE__ */ __name((kind3, fromType, fromId, toType, toId, role) => `${String(kind3)}|${String(fromType)}:${String(fromId)}|${String(toType)}:${String(toId)}|${role == null ? "" : String(role)}`, "keyOf");
|
|
50680
50771
|
var metadataOf = /* @__PURE__ */ __name((relation) => relation.metadata && Object.keys(relation.metadata).length ? JSON.stringify(relation.metadata) : null, "metadataOf");
|
|
50681
50772
|
var syncReportedIn = /* @__PURE__ */ __name((context, key2, relationships, scope3, { source: source2 = "import", by = { bot: key2.provider, kind: "rule" }, onOutcome } = {}) => {
|
|
@@ -50813,7 +50904,7 @@ var relationsStoreOver = /* @__PURE__ */ __name((context) => ({
|
|
|
50813
50904
|
syncReported: /* @__PURE__ */ __name(async (key2, relationships, scope3, options) => write(context.database, () => syncReportedIn(context, key2, relationships, scope3, options)), "syncReported")
|
|
50814
50905
|
}), "relationsStoreOver");
|
|
50815
50906
|
|
|
50816
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
50907
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/record-relationships.js
|
|
50817
50908
|
var importSource = /* @__PURE__ */ __name((provider) => `import:${provider}`, "importSource");
|
|
50818
50909
|
var noRelationships = /* @__PURE__ */ __name(() => ({
|
|
50819
50910
|
added: 0,
|
|
@@ -51003,7 +51094,7 @@ var recordRelationshipsOver = /* @__PURE__ */ __name((context) => {
|
|
|
51003
51094
|
return { report, placeOf: placeOf2, withdrawFrom };
|
|
51004
51095
|
}, "recordRelationshipsOver");
|
|
51005
51096
|
|
|
51006
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
51097
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/business-contracts.js
|
|
51007
51098
|
var CONTRACTS = "SELECT k.*, b.name AS author_name, b.kind AS author_kind FROM contracts k LEFT JOIN bots b ON k.author_type = 'bot' AND b.id = k.author_id";
|
|
51008
51099
|
var DAY_MS2 = 864e5;
|
|
51009
51100
|
var deadlineOf = /* @__PURE__ */ __name((expiration, days) => expiration === null || days === null ? null : new Date(Date.parse(`${expiration}T00:00:00Z`) - days * DAY_MS2).toISOString().slice(0, 10), "deadlineOf");
|
|
@@ -51162,7 +51253,7 @@ var contractsStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
51162
51253
|
};
|
|
51163
51254
|
}, "contractsStoreOver");
|
|
51164
51255
|
|
|
51165
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
51256
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/business-search.js
|
|
51166
51257
|
var BUSINESS_FIND_MAX = 2001;
|
|
51167
51258
|
var party2 = /* @__PURE__ */ __name((kind3, id2, as) => `LEFT JOIN persons ${as}p ON ${kind3} = 'person' AND ${as}p.id = ${id2} AND ${as}p.owner = 0 LEFT JOIN organizations ${as}o ON ${kind3} = 'organization' AND ${as}o.id = ${id2} LEFT JOIN projects ${as}j ON ${kind3} = 'project' AND ${as}j.id = ${id2}`, "party");
|
|
51168
51259
|
var partyName = /* @__PURE__ */ __name((as) => `coalesce(${as}p.name, ${as}o.name, ${as}j.name)`, "partyName");
|
|
@@ -51267,7 +51358,7 @@ var businessSearchOver = /* @__PURE__ */ __name(({ database }) => {
|
|
|
51267
51358
|
};
|
|
51268
51359
|
}, "businessSearchOver");
|
|
51269
51360
|
|
|
51270
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
51361
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/catalog.js
|
|
51271
51362
|
var CATALOG_QUERY = defineQuery({
|
|
51272
51363
|
entity: "document",
|
|
51273
51364
|
backend: "sql",
|
|
@@ -51500,10 +51591,10 @@ var catalogStoreOver = /* @__PURE__ */ __name(({ database, now: now2 }) => {
|
|
|
51500
51591
|
};
|
|
51501
51592
|
}, "catalogStoreOver");
|
|
51502
51593
|
|
|
51503
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
51594
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/content.js
|
|
51504
51595
|
import { createHash as createHash14 } from "node:crypto";
|
|
51505
51596
|
|
|
51506
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
51597
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/crm-files.js
|
|
51507
51598
|
import { sep } from "node:path";
|
|
51508
51599
|
var MOST = 500;
|
|
51509
51600
|
var CURRENTLY = /* @__PURE__ */ __name((table) => `EXISTS (SELECT 1 FROM ${table} r WHERE r.account_id = f.account_id AND r.external_id = f.owner_id AND r.deleted_at IS NULL AND json_extract(r.metadata, '$.assignee') = ?)`, "CURRENTLY");
|
|
@@ -51564,7 +51655,7 @@ var crmFilesOver = /* @__PURE__ */ __name((context) => {
|
|
|
51564
51655
|
const accountId = accountPk(context, key2);
|
|
51565
51656
|
database.prepare("INSERT INTO crm_files (account_id, external_id, owner_kind, owner_id, owner_assignee, source, name, name_folded, mime, size, external_created_at, local_path, content_sha256, text, normalized_text, extraction, extraction_error, downloaded_by, downloaded_at) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) ON CONFLICT (account_id, external_id) DO UPDATE SET owner_assignee = excluded.owner_assignee, source = excluded.source, name = excluded.name, name_folded = excluded.name_folded, mime = excluded.mime, size = excluded.size, external_created_at = excluded.external_created_at, local_path = excluded.local_path, content_sha256 = excluded.content_sha256, text = excluded.text, normalized_text = excluded.normalized_text, extraction = excluded.extraction, extraction_error = excluded.extraction_error, downloaded_by = excluded.downloaded_by, downloaded_at = excluded.downloaded_at").run(accountId, file.externalId, file.ownerKind, file.ownerId, file.ownerAssignee, file.source, file.name, fold(file.name), file.mime, file.size, file.externalCreatedAt, file.localPath, file.contentSha256, file.text, file.text === null ? null : normalize(file.text), file.extraction, file.extractionError, file.downloadedBy, file.downloadedAt);
|
|
51566
51657
|
}), "save");
|
|
51567
|
-
const
|
|
51658
|
+
const rowsOf3 = /* @__PURE__ */ __name((key2, columns2, where, ...params) => {
|
|
51568
51659
|
const accountId = findAccountPk(context, key2);
|
|
51569
51660
|
if (accountId === void 0)
|
|
51570
51661
|
return [];
|
|
@@ -51610,13 +51701,13 @@ var crmFilesOver = /* @__PURE__ */ __name((context) => {
|
|
|
51610
51701
|
return {
|
|
51611
51702
|
save: /* @__PURE__ */ __name(async (key2, file) => save2(key2, file), "save"),
|
|
51612
51703
|
get: /* @__PURE__ */ __name(async (key2, externalId) => {
|
|
51613
|
-
const [row2] =
|
|
51704
|
+
const [row2] = rowsOf3(key2, `${COLUMNS7}, f.text`, "f.external_id = ?", externalId);
|
|
51614
51705
|
return row2 ? { ...rowOf2(row2), text: text6(row2.text) } : void 0;
|
|
51615
51706
|
}, "get"),
|
|
51616
|
-
ofOwner: /* @__PURE__ */ __name(async (key2, kind3, id2) =>
|
|
51617
|
-
storedBytes: /* @__PURE__ */ __name(async (key2, folder) =>
|
|
51618
|
-
droppable: /* @__PURE__ */ __name(async (key2, folder) =>
|
|
51619
|
-
savedPaths: /* @__PURE__ */ __name(async (key2) =>
|
|
51707
|
+
ofOwner: /* @__PURE__ */ __name(async (key2, kind3, id2) => rowsOf3(key2, COLUMNS7, "f.owner_kind = ? AND f.owner_id = ? ORDER BY f.downloaded_at DESC, f.id DESC", kind3, id2).map(rowOf2), "ofOwner"),
|
|
51708
|
+
storedBytes: /* @__PURE__ */ __name(async (key2, folder) => rowsOf3(key2, "coalesce(sum(f.size), 0) AS bytes", `f.local_path IS NOT NULL AND ${under}`, inside(folder), inside(folder)).reduce((sum, row2) => sum + Number(row2.bytes), 0), "storedBytes"),
|
|
51709
|
+
droppable: /* @__PURE__ */ __name(async (key2, folder) => rowsOf3(key2, COLUMNS7, `f.local_path IS NOT NULL AND ${under} AND coalesce(f.text, '') <> '' ORDER BY f.downloaded_at, f.id`, inside(folder), inside(folder)).map(rowOf2), "droppable"),
|
|
51710
|
+
savedPaths: /* @__PURE__ */ __name(async (key2) => rowsOf3(key2, "f.local_path", "f.local_path IS NOT NULL ORDER BY f.id").map((row2) => String(row2.local_path)), "savedPaths"),
|
|
51620
51711
|
forgetFile: /* @__PURE__ */ __name(async (key2, externalId) => {
|
|
51621
51712
|
const accountId = findAccountPk(context, key2);
|
|
51622
51713
|
if (accountId === void 0)
|
|
@@ -51628,7 +51719,7 @@ var crmFilesOver = /* @__PURE__ */ __name((context) => {
|
|
|
51628
51719
|
};
|
|
51629
51720
|
}, "crmFilesOver");
|
|
51630
51721
|
|
|
51631
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
51722
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/content.js
|
|
51632
51723
|
var MOST2 = 500;
|
|
51633
51724
|
var TABLE = {
|
|
51634
51725
|
author: "content_authors",
|
|
@@ -51907,7 +51998,7 @@ var contentStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
51907
51998
|
};
|
|
51908
51999
|
}, "contentStoreOver");
|
|
51909
52000
|
|
|
51910
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
52001
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/context-document-source.js
|
|
51911
52002
|
var remote = /* @__PURE__ */ __name(() => `CASE WHEN json_valid(n.front_matter) THEN json_extract(n.front_matter,'$.source') IN (${documentAccountProvidersSql()}) ELSE 0 END`, "remote");
|
|
51912
52003
|
var field3 = /* @__PURE__ */ __name((name) => `CASE WHEN (${remote()}) THEN
|
|
51913
52004
|
CASE WHEN json_type(n.front_matter,'$.${name}')='text' THEN json_extract(n.front_matter,'$.${name}') END END`, "field");
|
|
@@ -51920,7 +52011,7 @@ var contextDocumentTimeKind = /* @__PURE__ */ __name(() => `CASE WHEN (${remoteT
|
|
|
51920
52011
|
THEN 'source-modified' ELSE 'stored-update' END`, "contextDocumentTimeKind");
|
|
51921
52012
|
var contextDocumentUrl = /* @__PURE__ */ __name(() => `coalesce(${preferred("url")},n.url,${field3("sourceUrl")})`, "contextDocumentUrl");
|
|
51922
52013
|
|
|
51923
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
52014
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/context-meeting-source.js
|
|
51924
52015
|
var readMeetingContextEvidence = /* @__PURE__ */ __name((database, request) => {
|
|
51925
52016
|
const { source: source2, words: words4, after: after2, before: before2, limit, maxReadBytes, cursor, signal } = request;
|
|
51926
52017
|
signal?.throwIfAborted();
|
|
@@ -52019,7 +52110,7 @@ var readMeetingContextEvidence = /* @__PURE__ */ __name((database, request) => {
|
|
|
52019
52110
|
});
|
|
52020
52111
|
}, "readMeetingContextEvidence");
|
|
52021
52112
|
|
|
52022
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
52113
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/context-evidence.js
|
|
52023
52114
|
var corpora = {
|
|
52024
52115
|
message: {
|
|
52025
52116
|
table: "messages",
|
|
@@ -52264,7 +52355,7 @@ var contextRecordsOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
|
52264
52355
|
}
|
|
52265
52356
|
}), "contextRecordsOver");
|
|
52266
52357
|
|
|
52267
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
52358
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/crm-changes.js
|
|
52268
52359
|
var CRM_CHANGES = [
|
|
52269
52360
|
"created",
|
|
52270
52361
|
"moved",
|
|
@@ -52407,7 +52498,7 @@ var crmReadsOver = /* @__PURE__ */ __name((context) => {
|
|
|
52407
52498
|
};
|
|
52408
52499
|
}, "crmReadsOver");
|
|
52409
52500
|
|
|
52410
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
52501
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/crm-contacts.js
|
|
52411
52502
|
var PLACEHOLDER = /(?:^|\s)null(?:\s+#\d+)?(?=\s|$)/gi;
|
|
52412
52503
|
var withoutPlaceholder = /* @__PURE__ */ __name((name) => name.replace(PLACEHOLDER, " ").replace(/\s+/g, " ").trim() || null, "withoutPlaceholder");
|
|
52413
52504
|
var DryRun = class extends Error {
|
|
@@ -52486,7 +52577,7 @@ var removeCrmContacts = /* @__PURE__ */ __name((context, key2, { users, before:
|
|
|
52486
52577
|
}
|
|
52487
52578
|
}, "removeCrmContacts");
|
|
52488
52579
|
|
|
52489
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
52580
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/crm.js
|
|
52490
52581
|
var PENDING = "crm:pending-relations";
|
|
52491
52582
|
var PENDING_DAYS = 30;
|
|
52492
52583
|
var PENDING_MOST = 5e3;
|
|
@@ -53041,10 +53132,10 @@ var crmCopiesOver = /* @__PURE__ */ __name((context, people2) => {
|
|
|
53041
53132
|
};
|
|
53042
53133
|
}, "crmCopiesOver");
|
|
53043
53134
|
|
|
53044
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
53135
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/decision-requests.js
|
|
53045
53136
|
import { createHash as createHash15, randomBytes as randomBytes2 } from "node:crypto";
|
|
53046
53137
|
|
|
53047
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
53138
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/decision-requests.js
|
|
53048
53139
|
var DECISION_ACTIONS = ["confirm", "reject", "ask-confirm", "ask-reject", "back", "later"];
|
|
53049
53140
|
var DECISION_TTL_MS = 72 * 60 * 60 * 1e3;
|
|
53050
53141
|
var CALLBACK_PREFIX = "wcr1:";
|
|
@@ -53058,7 +53149,7 @@ var callbackDataOf = /* @__PURE__ */ __name((token) => {
|
|
|
53058
53149
|
}, "callbackDataOf");
|
|
53059
53150
|
var parseCallbackData = /* @__PURE__ */ __name((data) => typeof data === "string" ? CALLBACK.exec(data)?.[1] : void 0, "parseCallbackData");
|
|
53060
53151
|
|
|
53061
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
53152
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/decision-requests.js
|
|
53062
53153
|
var digestOf = /* @__PURE__ */ __name((token) => createHash15("sha256").update(token).digest("hex"), "digestOf");
|
|
53063
53154
|
var newToken = /* @__PURE__ */ __name(() => randomBytes2(16).toString("base64url"), "newToken");
|
|
53064
53155
|
var requestOf = /* @__PURE__ */ __name((row2) => ({
|
|
@@ -53157,7 +53248,7 @@ var decisionRequestStoreOver = /* @__PURE__ */ __name(({ database, now: now2 })
|
|
|
53157
53248
|
};
|
|
53158
53249
|
}, "decisionRequestStoreOver");
|
|
53159
53250
|
|
|
53160
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
53251
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-listing.js
|
|
53161
53252
|
var MEETING_ROW_KINDS = ["meeting", "call", "event"];
|
|
53162
53253
|
var DAY9 = 864e5;
|
|
53163
53254
|
var JOINED = `(SELECT ce.event_id FROM calendar_entries ce JOIN events je ON je.id = ce.event_id
|
|
@@ -53544,7 +53635,7 @@ var meetingListingOver = /* @__PURE__ */ __name((context) => {
|
|
|
53544
53635
|
};
|
|
53545
53636
|
}, "meetingListingOver");
|
|
53546
53637
|
|
|
53547
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
53638
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/document-listing.js
|
|
53548
53639
|
var DOCUMENT_KINDS = [
|
|
53549
53640
|
"transcript",
|
|
53550
53641
|
"doc",
|
|
@@ -53781,7 +53872,7 @@ var documentListingOver = /* @__PURE__ */ __name((context) => {
|
|
|
53781
53872
|
};
|
|
53782
53873
|
}, "documentListingOver");
|
|
53783
53874
|
|
|
53784
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
53875
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/note-search.js
|
|
53785
53876
|
var NOTE_FIELDS = [
|
|
53786
53877
|
"text",
|
|
53787
53878
|
"exact",
|
|
@@ -54278,7 +54369,7 @@ var noteSearchOver = /* @__PURE__ */ __name((context) => {
|
|
|
54278
54369
|
};
|
|
54279
54370
|
}, "noteSearchOver");
|
|
54280
54371
|
|
|
54281
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
54372
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/event-search.js
|
|
54282
54373
|
var EVENT_FIELDS = ["text", "exact", "body", "title", "date", "in"];
|
|
54283
54374
|
var inEventAccounts = /* @__PURE__ */ __name((event2) => searchableCopy(event2, "c.account_id IN (SELECT CAST(value AS INTEGER) FROM json_each(?))"), "inEventAccounts");
|
|
54284
54375
|
var EVENT_CORPUS = {
|
|
@@ -54418,7 +54509,7 @@ var eventSearchOver = /* @__PURE__ */ __name((context) => {
|
|
|
54418
54509
|
};
|
|
54419
54510
|
}, "eventSearchOver");
|
|
54420
54511
|
|
|
54421
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
54512
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/facts.js
|
|
54422
54513
|
var NAMED4 = "SELECT f.*, b.name AS author_name, b.kind AS author_kind FROM facts f LEFT JOIN bots b ON f.author_type = 'bot' AND b.id = f.author_id";
|
|
54423
54514
|
var iso13 = /* @__PURE__ */ __name((value) => new Date(Number(value)).toISOString(), "iso");
|
|
54424
54515
|
var oneOf5 = /* @__PURE__ */ __name((value, allowed, what) => {
|
|
@@ -54681,7 +54772,7 @@ var factsStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
54681
54772
|
};
|
|
54682
54773
|
}, "factsStoreOver");
|
|
54683
54774
|
|
|
54684
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
54775
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/findings-core.js
|
|
54685
54776
|
var invalid5 = /* @__PURE__ */ __name((message3) => {
|
|
54686
54777
|
throw new CliError("validation_error", message3);
|
|
54687
54778
|
}, "invalid");
|
|
@@ -54849,7 +54940,7 @@ var findingsCoreOver = /* @__PURE__ */ __name((context, kind3) => {
|
|
|
54849
54940
|
return { snapshot: snapshot2, snapshotParts, previous, settle, keepWaiting, named: named2, sameDecision, create };
|
|
54850
54941
|
}, "findingsCoreOver");
|
|
54851
54942
|
|
|
54852
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
54943
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/evidence-findings.js
|
|
54853
54944
|
var stale = /* @__PURE__ */ __name(() => {
|
|
54854
54945
|
throw new CliError("validation_error", "evidence findings changed since they were read; stage a new batch", {
|
|
54855
54946
|
reason: "evidence-findings.stale"
|
|
@@ -55113,7 +55204,7 @@ var evidenceFindingsStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
55113
55204
|
};
|
|
55114
55205
|
}, "evidenceFindingsStoreOver");
|
|
55115
55206
|
|
|
55116
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
55207
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/involvements.js
|
|
55117
55208
|
var pendingInvolvements = /* @__PURE__ */ __name((database) => Number(database.prepare("SELECT count(*) AS n FROM involvement_pending").get()?.n ?? 0), "pendingInvolvements");
|
|
55118
55209
|
var involvementStoreOver = /* @__PURE__ */ __name(({ database, now: now2 }) => ({
|
|
55119
55210
|
rebuild: /* @__PURE__ */ __name((personId) => write(database, () => {
|
|
@@ -55167,7 +55258,7 @@ var involvementStoreOver = /* @__PURE__ */ __name(({ database, now: now2 }) => (
|
|
|
55167
55258
|
}, "forPerson")
|
|
55168
55259
|
}), "involvementStoreOver");
|
|
55169
55260
|
|
|
55170
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
55261
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/labelled.js
|
|
55171
55262
|
var LABELLED = {
|
|
55172
55263
|
note: "note",
|
|
55173
55264
|
document: "document",
|
|
@@ -55180,7 +55271,7 @@ var LABELLED = {
|
|
|
55180
55271
|
};
|
|
55181
55272
|
var accountMeetingTagging = /* @__PURE__ */ __name((alias2) => `(${alias2}.taggable_type <> 'meeting' OR EXISTS (SELECT 1 FROM meetings mt WHERE mt.id = ${alias2}.taggable_id AND mt.deleted_at IS NULL AND (? IS NULL OR mt.account_id = ?)))`, "accountMeetingTagging");
|
|
55182
55273
|
|
|
55183
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
55274
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-projects.js
|
|
55184
55275
|
import { createHash as createHash16 } from "node:crypto";
|
|
55185
55276
|
var fields3 = "id,from_id,to_id,source,confirmed,updated_at,length(evidence) AS evidenceLength,substr(evidence,1,2000) AS evidence";
|
|
55186
55277
|
var id = /* @__PURE__ */ __name((value) => {
|
|
@@ -55266,7 +55357,7 @@ var meetingProjectsStoreOver = /* @__PURE__ */ __name(({ database, now: now2 })
|
|
|
55266
55357
|
};
|
|
55267
55358
|
}, "meetingProjectsStoreOver");
|
|
55268
55359
|
|
|
55269
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
55360
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/knowledge-query.js
|
|
55270
55361
|
var ORGANIZATIONS_QUERY = {
|
|
55271
55362
|
entity: "organization",
|
|
55272
55363
|
backend: "sql",
|
|
@@ -55307,7 +55398,7 @@ var REMINDERS_QUERY = {
|
|
|
55307
55398
|
})
|
|
55308
55399
|
};
|
|
55309
55400
|
|
|
55310
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
55401
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/organization-categories.js
|
|
55311
55402
|
var OWN2 = "(SELECT id FROM organizations WHERE deleted_at IS NULL AND json_extract(metadata, '$.own') = 1)";
|
|
55312
55403
|
var EMPLOYED = "('employee', 'contractor', 'founder')";
|
|
55313
55404
|
var categorySql = /* @__PURE__ */ __name(({ category, accounts: accounts2 }, now2) => {
|
|
@@ -55328,7 +55419,7 @@ var categorySql = /* @__PURE__ */ __name(({ category, accounts: accounts2 }, now
|
|
|
55328
55419
|
return { sql: `EXISTS (SELECT 1 FROM links l WHERE ${where} AND ${usable})`, params: keys };
|
|
55329
55420
|
}, "categorySql");
|
|
55330
55421
|
|
|
55331
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
55422
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/organizations.js
|
|
55332
55423
|
var organizationOf = /* @__PURE__ */ __name((row2) => ({
|
|
55333
55424
|
id: String(row2.id),
|
|
55334
55425
|
ref: `organization:${row2.id}`,
|
|
@@ -55373,7 +55464,7 @@ var organizationsStoreOver = /* @__PURE__ */ __name(({ database, now: now2 }) =>
|
|
|
55373
55464
|
}), "setOwnOrganization")
|
|
55374
55465
|
}), "organizationsStoreOver");
|
|
55375
55466
|
|
|
55376
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
55467
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/relation-list.js
|
|
55377
55468
|
var KINDS = RELATION_KINDS.map(linkKind).join(", ");
|
|
55378
55469
|
var ACCOUNT_ENDS = [
|
|
55379
55470
|
["deal", "deals"],
|
|
@@ -55536,13 +55627,13 @@ var relationListOver = /* @__PURE__ */ __name((context) => {
|
|
|
55536
55627
|
__name(proposalItem, "proposalItem");
|
|
55537
55628
|
}, "relationListOver");
|
|
55538
55629
|
|
|
55539
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
55630
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/relation-reads.js
|
|
55540
55631
|
var relationReadsOver = /* @__PURE__ */ __name((context) => ({
|
|
55541
55632
|
...relationListOver(context),
|
|
55542
55633
|
...relationRolesOver(context)
|
|
55543
55634
|
}), "relationReadsOver");
|
|
55544
55635
|
|
|
55545
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
55636
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/source-review.js
|
|
55546
55637
|
var TABLES6 = { memory: "memories", fact: "facts" };
|
|
55547
55638
|
var RETIRED = /* @__PURE__ */ new Set(["superseded", "reversed", "rejected", "stale"]);
|
|
55548
55639
|
var DEFAULT_LIMIT = 500;
|
|
@@ -55785,16 +55876,16 @@ var sourceReviewStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
55785
55876
|
};
|
|
55786
55877
|
}, "sourceReviewStoreOver");
|
|
55787
55878
|
|
|
55788
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
55879
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/vocabulary.js
|
|
55789
55880
|
import { createHash as createHash19 } from "node:crypto";
|
|
55790
55881
|
|
|
55791
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
55882
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/tag-consolidation.js
|
|
55792
55883
|
import { createHash as createHash18 } from "node:crypto";
|
|
55793
55884
|
|
|
55794
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
55885
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/tag-consolidation-apply.js
|
|
55795
55886
|
import { createHash as createHash17 } from "node:crypto";
|
|
55796
55887
|
|
|
55797
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
55888
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/tag-consolidation-input.js
|
|
55798
55889
|
var consolidationId = /* @__PURE__ */ __name((value, field4) => {
|
|
55799
55890
|
if (typeof value !== "string" || !/^[1-9]\d*$/.test(value) || !Number.isSafeInteger(Number(value)))
|
|
55800
55891
|
throw new CliError("validation_error", `${field4} must be a positive canonical tag id`);
|
|
@@ -55845,7 +55936,7 @@ var consolidationApplyInput = /* @__PURE__ */ __name((options) => {
|
|
|
55845
55936
|
return input;
|
|
55846
55937
|
}, "consolidationApplyInput");
|
|
55847
55938
|
|
|
55848
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
55939
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/tag-consolidation-apply.js
|
|
55849
55940
|
var receiptOf = /* @__PURE__ */ __name((row2) => ({
|
|
55850
55941
|
id: String(row2.id),
|
|
55851
55942
|
sourceId: String(row2.source_id),
|
|
@@ -55920,7 +56011,7 @@ var applyTagConsolidation = /* @__PURE__ */ __name((context, preview, options) =
|
|
|
55920
56011
|
}, { beforeCommit: check3 });
|
|
55921
56012
|
}, "applyTagConsolidation");
|
|
55922
56013
|
|
|
55923
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
56014
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/tag-consolidation.js
|
|
55924
56015
|
var selections = [
|
|
55925
56016
|
["taggings", "tag_id IN (SELECT value FROM json_each(?))"],
|
|
55926
56017
|
["aliases", "aliasable_type='tag' AND aliasable_id IN (SELECT value FROM json_each(?))"],
|
|
@@ -56064,7 +56155,7 @@ var previewRows = /* @__PURE__ */ __name((context, options, source2, survivor, m
|
|
|
56064
56155
|
};
|
|
56065
56156
|
}, "previewRows");
|
|
56066
56157
|
|
|
56067
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
56158
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/vocabulary.js
|
|
56068
56159
|
var kinds = ["project", "tag", "topic"];
|
|
56069
56160
|
var cancelled2 = /* @__PURE__ */ __name((signal) => {
|
|
56070
56161
|
if (signal?.aborted)
|
|
@@ -56328,7 +56419,7 @@ var vocabularyStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
56328
56419
|
};
|
|
56329
56420
|
}, "vocabularyStoreOver");
|
|
56330
56421
|
|
|
56331
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
56422
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/knowledge.js
|
|
56332
56423
|
var TYPED_KEY_PREFIXES = new Set(Object.values(TASK_KEY_PREFIXES));
|
|
56333
56424
|
var ORGANIZATION_KINDS = ["company", "team", "family", "community"];
|
|
56334
56425
|
var PROJECT_TYPES = ["work", "client", "personal", "oss", "other"];
|
|
@@ -56882,7 +56973,7 @@ var projectKey = /* @__PURE__ */ __name((name) => {
|
|
|
56882
56973
|
return key2.padEnd(3, "X");
|
|
56883
56974
|
}, "projectKey");
|
|
56884
56975
|
|
|
56885
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
56976
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/log-pruning.js
|
|
56886
56977
|
var DAY10 = 864e5;
|
|
56887
56978
|
var SETTING5 = "logs_pruned_at";
|
|
56888
56979
|
var LOG_RETENTION = { agentActionsMs: 90 * DAY10, botUpdatePayloadsMs: 30 * DAY10 };
|
|
@@ -56909,7 +57000,7 @@ var logPruner = /* @__PURE__ */ __name((database, now2) => {
|
|
|
56909
57000
|
};
|
|
56910
57001
|
}, "logPruner");
|
|
56911
57002
|
|
|
56912
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
57003
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/mail/findings.js
|
|
56913
57004
|
var MAIL_FINDINGS_PER_RUN = 30;
|
|
56914
57005
|
var MAIL_FINDINGS_PER_SENDER = 5;
|
|
56915
57006
|
var invalid7 = /* @__PURE__ */ __name((message3) => {
|
|
@@ -57268,7 +57359,7 @@ var checkMailFindings = /* @__PURE__ */ __name((input) => {
|
|
|
57268
57359
|
}, "checkMailFindings");
|
|
57269
57360
|
var mailFindingFingerprint = /* @__PURE__ */ __name(({ id: _id, ...finding }) => findingHash(finding), "mailFindingFingerprint");
|
|
57270
57361
|
|
|
57271
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
57362
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/orders.js
|
|
57272
57363
|
var ORDERS = "SELECT o.*, b.name AS author_name, b.kind AS author_kind FROM orders o LEFT JOIN bots b ON o.author_type = 'bot' AND b.id = o.author_id";
|
|
57273
57364
|
var orderOperationsOver = /* @__PURE__ */ __name((context) => {
|
|
57274
57365
|
const { database, now: now2 } = context;
|
|
@@ -57483,7 +57574,7 @@ var ordersStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
57483
57574
|
};
|
|
57484
57575
|
}, "ordersStoreOver");
|
|
57485
57576
|
|
|
57486
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
57577
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/mail-findings.js
|
|
57487
57578
|
var MAIL_EDITS = {
|
|
57488
57579
|
task: ["title", "type", "reason", "commitment", "project", "dueAt", "dueEvidence", "assignee", "assigneeEvidence"],
|
|
57489
57580
|
fact: ["statement", "type", "reason", "subject", "project"],
|
|
@@ -57972,7 +58063,7 @@ ${evidence.join("\n")}`, agent);
|
|
|
57972
58063
|
};
|
|
57973
58064
|
}, "mailFindingsStoreOver");
|
|
57974
58065
|
|
|
57975
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
58066
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-findings.js
|
|
57976
58067
|
var stale3 = /* @__PURE__ */ __name(() => {
|
|
57977
58068
|
throw new CliError("validation_error", "meeting findings changed since they were read; stage a new batch", {
|
|
57978
58069
|
reason: "meeting-findings.stale"
|
|
@@ -58185,7 +58276,7 @@ var meetingFindingsStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
58185
58276
|
};
|
|
58186
58277
|
}, "meetingFindingsStoreOver");
|
|
58187
58278
|
|
|
58188
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
58279
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-vectors.js
|
|
58189
58280
|
var RANK_BATCH = 512;
|
|
58190
58281
|
var LIVE6 = "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";
|
|
58191
58282
|
var limitOf2 = /* @__PURE__ */ __name((value, name, max = 1e3) => {
|
|
@@ -58456,7 +58547,7 @@ var meetingVectorsOver = /* @__PURE__ */ __name((context) => ({
|
|
|
58456
58547
|
}
|
|
58457
58548
|
}), "meetingVectorsOver");
|
|
58458
58549
|
|
|
58459
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
58550
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/mention-sources.js
|
|
58460
58551
|
var OTHER_SOURCES = ["document", "note", "email"];
|
|
58461
58552
|
var TEXTS = {
|
|
58462
58553
|
document: "JOIN documents s ON mn.source_type = 'document' AND s.id = mn.source_id AND s.deleted_at IS NULL WHERE 1 ",
|
|
@@ -58557,7 +58648,7 @@ var sourceMentionStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
58557
58648
|
};
|
|
58558
58649
|
}, "sourceMentionStoreOver");
|
|
58559
58650
|
|
|
58560
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
58651
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/money-transactions.js
|
|
58561
58652
|
var TRANSACTIONS = "SELECT t.*, w.name AS wallet_name, b.name AS author_name, b.kind AS author_kind, (SELECT coalesce(sum(amount), 0) FROM transaction_splits WHERE transaction_id = t.id) AS split FROM financial_transactions t JOIN financial_accounts w ON w.id = t.financial_account_id LEFT JOIN bots b ON t.author_type = 'bot' AND b.id = t.author_id";
|
|
58562
58653
|
var MAX_SPLITS = 100;
|
|
58563
58654
|
var transactionOperationsOver = /* @__PURE__ */ __name((context) => {
|
|
@@ -58791,11 +58882,11 @@ var transactionsStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
58791
58882
|
};
|
|
58792
58883
|
}, "transactionsStoreOver");
|
|
58793
58884
|
|
|
58794
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
58885
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/open-store.js
|
|
58795
58886
|
import { accessSync, constants, existsSync as existsSync2, mkdirSync as mkdirSync2, statSync as statSync2, writeFileSync as writeFileSync2 } from "node:fs";
|
|
58796
58887
|
import { dirname as dirname2 } from "node:path";
|
|
58797
58888
|
|
|
58798
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
58889
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/clients.js
|
|
58799
58890
|
import { readFileSync as readFileSync3 } from "node:fs";
|
|
58800
58891
|
var CLIENTS_SETTING = "clients";
|
|
58801
58892
|
var coreVersion = (() => {
|
|
@@ -58856,7 +58947,7 @@ var refusalAdvice = /* @__PURE__ */ __name((clients, command, schema) => {
|
|
|
58856
58947
|
return mover ? `${own} (${mover.command} ${mover.version} moved the store to schema ${schema})` : own;
|
|
58857
58948
|
}, "refusalAdvice");
|
|
58858
58949
|
|
|
58859
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
58950
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/migrations.generated.js
|
|
58860
58951
|
var GENERATED = [
|
|
58861
58952
|
{
|
|
58862
58953
|
"name": "20261010184427_initial",
|
|
@@ -59533,8 +59624,8 @@ WHERE json_type(params, '$.selection') = 'object';`
|
|
|
59533
59624
|
"UPDATE mention_pending SET source_id = (SELECT account_id FROM temp.drive_moves WHERE folder_id = mention_pending.source_id)\nWHERE source_type = 'account' AND source_id IN (SELECT folder_id FROM temp.drive_moves);",
|
|
59534
59625
|
"UPDATE mentions SET source_id = (SELECT account_id FROM temp.drive_moves WHERE folder_id = mentions.source_id)\nWHERE source_type = 'account' AND source_id IN (SELECT folder_id FROM temp.drive_moves);",
|
|
59535
59626
|
"UPDATE mentions SET target_id = (SELECT account_id FROM temp.drive_moves WHERE folder_id = mentions.target_id)\nWHERE target_type = 'account' AND target_id IN (SELECT folder_id FROM temp.drive_moves);",
|
|
59536
|
-
"-- A profile that named the folder names the account: `{ provider: \"google-drive\", account: <principal> }`.\nUPDATE store_settings SET value = (\n SELECT json_group_object(app.key, CASE WHEN app.type = 'object' THEN (\n SELECT json_group_object(profile.key, CASE\n WHEN profile.type = 'object' AND json_extract(profile.value, '$.provider') = 'folder'\n AND json_extract(profile.value, '$.account') IN (SELECT 'google-drive:' || principal FROM temp.drive_moves)\n THEN json_set(profile.value, '$.provider', 'google-drive', '$.account', substr(json_extract(profile.value, '$.account'), 14))\n WHEN profile.type IN ('object', 'array') THEN json(profile.value)\n ELSE profile.value END)\n FROM json_each(app.value) profile\n ) WHEN app.type = 'array' THEN json(app.value) ELSE app.value END)\n FROM json_each(store_settings.value) app\n)\nWHERE key = 'profiles' AND json_valid(value) AND json_type(value) = 'object'\n AND EXISTS (SELECT 1 FROM temp.drive_moves);",
|
|
59537
|
-
"-- A group member `notes:<folder id>` follows the documents to `notes:<account id>`.\nUPDATE store_settings SET value = (\n SELECT json_group_object(grp.key, CASE WHEN grp.type = 'array' THEN (\n SELECT json_group_array(coalesce(\n (SELECT 'notes:' || m.account_id FROM temp.drive_moves m WHERE 'notes:' || m.folder_id = member.value),\n member.value))\n FROM json_each(grp.value) member\n ) WHEN grp.type = 'object' THEN json(grp.value) ELSE grp.value END)\n FROM json_each(store_settings.value) grp\n)\nWHERE key = 'accountGroups' AND json_valid(value) AND json_type(value) = 'object'\n AND EXISTS (SELECT 1 FROM temp.drive_moves);",
|
|
59627
|
+
"-- A profile that named the folder names the account: `{ provider: \"google-drive\", account: <principal> }`.\n-- json() keeps the inner object an object: SQLite 3.54 (Node 24.22) no longer passes a subquery's JSON subtype up.\nUPDATE store_settings SET value = (\n SELECT json_group_object(app.key, CASE WHEN app.type = 'object' THEN json((\n SELECT json_group_object(profile.key, CASE\n WHEN profile.type = 'object' AND json_extract(profile.value, '$.provider') = 'folder'\n AND json_extract(profile.value, '$.account') IN (SELECT 'google-drive:' || principal FROM temp.drive_moves)\n THEN json_set(profile.value, '$.provider', 'google-drive', '$.account', substr(json_extract(profile.value, '$.account'), 14))\n WHEN profile.type IN ('object', 'array') THEN json(profile.value)\n ELSE profile.value END)\n FROM json_each(app.value) profile\n )) WHEN app.type = 'array' THEN json(app.value) ELSE app.value END)\n FROM json_each(store_settings.value) app\n)\nWHERE key = 'profiles' AND json_valid(value) AND json_type(value) = 'object'\n AND EXISTS (SELECT 1 FROM temp.drive_moves);",
|
|
59628
|
+
"-- A group member `notes:<folder id>` follows the documents to `notes:<account id>`.\nUPDATE store_settings SET value = (\n SELECT json_group_object(grp.key, CASE WHEN grp.type = 'array' THEN json((\n SELECT json_group_array(coalesce(\n (SELECT 'notes:' || m.account_id FROM temp.drive_moves m WHERE 'notes:' || m.folder_id = member.value),\n member.value))\n FROM json_each(grp.value) member\n )) WHEN grp.type = 'object' THEN json(grp.value) ELSE grp.value END)\n FROM json_each(store_settings.value) grp\n)\nWHERE key = 'accountGroups' AND json_valid(value) AND json_type(value) = 'object'\n AND EXISTS (SELECT 1 FROM temp.drive_moves);",
|
|
59538
59629
|
"DELETE FROM accounts WHERE id IN (SELECT folder_id FROM temp.drive_moves);",
|
|
59539
59630
|
"DROP TABLE temp.drive_moves;"
|
|
59540
59631
|
]
|
|
@@ -60299,7 +60390,7 @@ WHERE json_type(params, '$.selection') = 'object';`
|
|
|
60299
60390
|
}
|
|
60300
60391
|
];
|
|
60301
60392
|
|
|
60302
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
60393
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/rollback-copy.js
|
|
60303
60394
|
import { mkdirSync, rmSync, statfsSync, writeFileSync } from "node:fs";
|
|
60304
60395
|
import { basename, dirname, join as join3, parse } from "node:path";
|
|
60305
60396
|
var DERIVED = /(_fts|_words|_stems|_trigrams|_pending)$|^(embeddings|chunks|chunk_messages|mentions|involvements|search_terms)$|^vector_index/;
|
|
@@ -60532,7 +60623,7 @@ var rollBack2 = /* @__PURE__ */ __name((database, path) => {
|
|
|
60532
60623
|
return { ...result, foreignKeyViolations };
|
|
60533
60624
|
}, "rollBack");
|
|
60534
60625
|
|
|
60535
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
60626
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/manifest.js
|
|
60536
60627
|
var V31_TABLES = [
|
|
60537
60628
|
"accounts",
|
|
60538
60629
|
"account_identities",
|
|
@@ -60706,7 +60797,7 @@ var generatedMigrations = /* @__PURE__ */ __name((manifest = MANIFEST, generated
|
|
|
60706
60797
|
return migrations;
|
|
60707
60798
|
}, "generatedMigrations");
|
|
60708
60799
|
|
|
60709
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
60800
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/migrations.js
|
|
60710
60801
|
var MIGRATIONS = generatedMigrations();
|
|
60711
60802
|
var HISTORY = `CREATE TABLE IF NOT EXISTS schema_migrations (
|
|
60712
60803
|
version INTEGER PRIMARY KEY,
|
|
@@ -60803,7 +60894,7 @@ var migrate = /* @__PURE__ */ __name((database, { migrations = MIGRATIONS, now:
|
|
|
60803
60894
|
}
|
|
60804
60895
|
}, "migrate");
|
|
60805
60896
|
|
|
60806
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
60897
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/join-keys.js
|
|
60807
60898
|
var fillJoinKeys = /* @__PURE__ */ __name((database, { batch = 2e3 } = {}) => {
|
|
60808
60899
|
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 ?");
|
|
60809
60900
|
if (pending.get(0, 1) === void 0)
|
|
@@ -60825,7 +60916,41 @@ var fillJoinKeys = /* @__PURE__ */ __name((database, { batch = 2e3 } = {}) => {
|
|
|
60825
60916
|
}
|
|
60826
60917
|
}, "fillJoinKeys");
|
|
60827
60918
|
|
|
60828
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
60919
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/slow-queries.js
|
|
60920
|
+
var queryShape = /* @__PURE__ */ __name((sql2) => sql2.replace(/'(?:[^']|'')*'/g, "?").replace(/\b\d+(?:\.\d+)?\b/g, "?").replace(/\s+/g, " ").trim().slice(0, 400), "queryShape");
|
|
60921
|
+
var rowsOf2 = /* @__PURE__ */ __name((result) => Array.isArray(result) ? result.length : result && typeof result === "object" && "changes" in result ? Number(result.changes) : result === void 0 || result === null ? 0 : 1, "rowsOf");
|
|
60922
|
+
var timeQueries = /* @__PURE__ */ __name((client, methods) => {
|
|
60923
|
+
const threshold = Number(process.env.WIRECAT_SQL_SLOW_MS);
|
|
60924
|
+
if (!process.env.WIRECAT_SQL_SLOW_MS || !Number.isFinite(threshold))
|
|
60925
|
+
return client;
|
|
60926
|
+
const target = client;
|
|
60927
|
+
for (const name of methods) {
|
|
60928
|
+
const prepare3 = target[name];
|
|
60929
|
+
if (typeof prepare3 !== "function")
|
|
60930
|
+
continue;
|
|
60931
|
+
target[name] = (sql2, ...rest) => {
|
|
60932
|
+
const statement = prepare3.call(client, sql2, ...rest);
|
|
60933
|
+
if (typeof sql2 !== "string")
|
|
60934
|
+
return statement;
|
|
60935
|
+
for (const method of ["run", "all", "get"]) {
|
|
60936
|
+
const original = statement[method];
|
|
60937
|
+
statement[method] = (...parameters) => {
|
|
60938
|
+
const started = performance.now();
|
|
60939
|
+
const result = original.apply(statement, parameters);
|
|
60940
|
+
const took = performance.now() - started;
|
|
60941
|
+
if (took >= threshold)
|
|
60942
|
+
process.stderr.write(`sql ${took.toFixed(0)} ms, ${rowsOf2(result)} rows: ${queryShape(sql2)}
|
|
60943
|
+
`);
|
|
60944
|
+
return result;
|
|
60945
|
+
};
|
|
60946
|
+
}
|
|
60947
|
+
return statement;
|
|
60948
|
+
};
|
|
60949
|
+
}
|
|
60950
|
+
return client;
|
|
60951
|
+
}, "timeQueries");
|
|
60952
|
+
|
|
60953
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/open.js
|
|
60829
60954
|
var openSqlite = /* @__PURE__ */ __name(async (path, { readOnly = false } = {}) => {
|
|
60830
60955
|
refuseOwnerStoreInTests(path);
|
|
60831
60956
|
const opened = "Bun" in globalThis ? await openUnderBun(path, readOnly) : await openUnderNode(path, readOnly);
|
|
@@ -60839,12 +60964,13 @@ var openSqlite = /* @__PURE__ */ __name(async (path, { readOnly = false } = {})
|
|
|
60839
60964
|
}, "openSqlite");
|
|
60840
60965
|
var openUnderNode = /* @__PURE__ */ __name(async (path, readOnly) => {
|
|
60841
60966
|
quietSqliteWarning();
|
|
60842
|
-
const { drizzle } = await import("./node-
|
|
60843
|
-
const { cacheOverNodeSqlite, nodeClient } = await import("./node-sqlite-
|
|
60967
|
+
const { drizzle } = await import("./node-RIANITAT.js");
|
|
60968
|
+
const { cacheOverNodeSqlite, nodeClient } = await import("./node-sqlite-I2P26Z3S.js");
|
|
60844
60969
|
const client = await nodeClient(path, { readOnly });
|
|
60845
60970
|
try {
|
|
60846
60971
|
if (!readOnly)
|
|
60847
60972
|
countWrites(client, ["prepare"], () => client.isTransaction);
|
|
60973
|
+
timeQueries(client, ["prepare"]);
|
|
60848
60974
|
const database = cacheOverNodeSqlite(client);
|
|
60849
60975
|
shareCounts(client, database);
|
|
60850
60976
|
return { database, orm: drizzle({ client }) };
|
|
@@ -60854,12 +60980,13 @@ var openUnderNode = /* @__PURE__ */ __name(async (path, readOnly) => {
|
|
|
60854
60980
|
}
|
|
60855
60981
|
}, "openUnderNode");
|
|
60856
60982
|
var openUnderBun = /* @__PURE__ */ __name(async (path, readOnly) => {
|
|
60857
|
-
const { bunClient, cacheOverBunSqlite } = await import("./bun-sqlite-
|
|
60858
|
-
const { drizzle } = await import("./bun-
|
|
60983
|
+
const { bunClient, cacheOverBunSqlite } = await import("./bun-sqlite-ZNB2B2DL.js");
|
|
60984
|
+
const { drizzle } = await import("./bun-J3ML43BO.js");
|
|
60859
60985
|
const client = await bunClient(path, readOnly ? { readonly: true, create: false } : void 0);
|
|
60860
60986
|
try {
|
|
60861
60987
|
if (!readOnly)
|
|
60862
60988
|
countWrites(client, ["prepare", "query"], () => client.inTransaction);
|
|
60989
|
+
timeQueries(client, ["prepare", "query"]);
|
|
60863
60990
|
const database = cacheOverBunSqlite(client);
|
|
60864
60991
|
shareCounts(client, database);
|
|
60865
60992
|
return { database, orm: drizzle({ client }) };
|
|
@@ -60869,7 +60996,7 @@ var openUnderBun = /* @__PURE__ */ __name(async (path, readOnly) => {
|
|
|
60869
60996
|
}
|
|
60870
60997
|
}, "openUnderBun");
|
|
60871
60998
|
|
|
60872
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
60999
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/payment-facts.js
|
|
60873
61000
|
var PAYMENT_FACTS_TO_MOVE = "payment_facts_to_move";
|
|
60874
61001
|
var paymentOf = /* @__PURE__ */ __name((metadata3) => {
|
|
60875
61002
|
try {
|
|
@@ -60937,7 +61064,7 @@ var movePaymentFacts = /* @__PURE__ */ __name((context) => {
|
|
|
60937
61064
|
});
|
|
60938
61065
|
}, "movePaymentFacts");
|
|
60939
61066
|
|
|
60940
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
61067
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/read-compatibility.js
|
|
60941
61068
|
var readCompatibility = /* @__PURE__ */ __name((database, command) => {
|
|
60942
61069
|
const ours = MIGRATIONS.at(-1)?.version ?? 0;
|
|
60943
61070
|
if (!database.prepare("SELECT 1 FROM sqlite_master WHERE type='table' AND name='schema_migrations'").get())
|
|
@@ -60955,7 +61082,7 @@ var assertReadCompatible = /* @__PURE__ */ __name((database, command) => {
|
|
|
60955
61082
|
throw new CliError("configuration_error", `The store needs schema ${MIGRATIONS.at(-1)?.version ?? 0} maintenance before a read-only open`);
|
|
60956
61083
|
}, "assertReadCompatible");
|
|
60957
61084
|
|
|
60958
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
61085
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/suggested-links.js
|
|
60959
61086
|
var SUGGESTED_LINKS_TO_MOVE = "suggested_links_to_move";
|
|
60960
61087
|
var proposerOf2 = /* @__PURE__ */ __name((provenance2) => {
|
|
60961
61088
|
if (provenance2?.startsWith("rule:"))
|
|
@@ -61001,7 +61128,7 @@ var moveSuggestedLinks = /* @__PURE__ */ __name((database, now2) => {
|
|
|
61001
61128
|
});
|
|
61002
61129
|
}, "moveSuggestedLinks");
|
|
61003
61130
|
|
|
61004
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
61131
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/test-accounts.js
|
|
61005
61132
|
var TEST_ACCOUNTS_TO_PURGE = "test_accounts_to_purge";
|
|
61006
61133
|
var TEST_PROVIDER = "chat";
|
|
61007
61134
|
var purgeTestAccounts = /* @__PURE__ */ __name((context, warn) => {
|
|
@@ -61022,7 +61149,7 @@ var purgeTestAccounts = /* @__PURE__ */ __name((context, warn) => {
|
|
|
61022
61149
|
}
|
|
61023
61150
|
}, "purgeTestAccounts");
|
|
61024
61151
|
|
|
61025
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
61152
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/open-store.js
|
|
61026
61153
|
var BACKFILL_ON_OPEN = 5e3;
|
|
61027
61154
|
var NOT_WRITABLE = /* @__PURE__ */ new Set(["EACCES", "EPERM", "EROFS"]);
|
|
61028
61155
|
var createWritable = /* @__PURE__ */ __name((file) => {
|
|
@@ -61134,7 +61261,7 @@ var openStoreContext = /* @__PURE__ */ __name(async (options = {}) => {
|
|
|
61134
61261
|
}
|
|
61135
61262
|
}, "openStoreContext");
|
|
61136
61263
|
|
|
61137
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
61264
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/products.js
|
|
61138
61265
|
var PRODUCTS = "SELECT c.*, b.name AS author_name, b.kind AS author_kind FROM catalog_items c LEFT JOIN bots b ON c.author_type = 'bot' AND b.id = c.author_id";
|
|
61139
61266
|
var productOperationsOver = /* @__PURE__ */ __name((context) => {
|
|
61140
61267
|
const { database, now: now2 } = context;
|
|
@@ -61242,13 +61369,13 @@ var productsStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
61242
61369
|
};
|
|
61243
61370
|
}, "productsStoreOver");
|
|
61244
61371
|
|
|
61245
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
61372
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/project-transfer/plan.js
|
|
61246
61373
|
import { createHash as createHash21 } from "node:crypto";
|
|
61247
61374
|
|
|
61248
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
61375
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/project-transfer/manifest.js
|
|
61249
61376
|
import { createHash as createHash20 } from "node:crypto";
|
|
61250
61377
|
|
|
61251
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
61378
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/project-transfer/schema.js
|
|
61252
61379
|
var text7 = /* @__PURE__ */ __name((max) => pipe(string(), minLength(1), maxLength(max)), "text");
|
|
61253
61380
|
var ref = text7(2048);
|
|
61254
61381
|
var timestamp2 = pipe(number(), safeInteger(), minValue(0));
|
|
@@ -61318,7 +61445,7 @@ var projectAnnotationsSchema = strictObject({
|
|
|
61318
61445
|
}))
|
|
61319
61446
|
});
|
|
61320
61447
|
|
|
61321
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
61448
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/project-transfer/manifest.js
|
|
61322
61449
|
var PROJECT_ANNOTATIONS_MAX_BYTES = 4 * 1024 * 1024;
|
|
61323
61450
|
var invalid10 = /* @__PURE__ */ __name((field4) => {
|
|
61324
61451
|
throw new CliError("validation_error", `invalid project annotations.${field4}`);
|
|
@@ -61451,7 +61578,7 @@ var projectAnnotationsFingerprint = /* @__PURE__ */ __name((json3) => {
|
|
|
61451
61578
|
return createHash20("sha256").update(JSON.stringify(normalized)).digest("hex");
|
|
61452
61579
|
}, "projectAnnotationsFingerprint");
|
|
61453
61580
|
|
|
61454
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
61581
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/project-transfer/plan.js
|
|
61455
61582
|
var hash = pipe(string(), regex(/^[a-f0-9]{64}$/));
|
|
61456
61583
|
var ref2 = pipe(string(), minLength(1), maxLength(2048));
|
|
61457
61584
|
var targetSchema = strictObject({
|
|
@@ -61558,7 +61685,7 @@ var planBoundProjectAnnotations = /* @__PURE__ */ __name((manifest, manifest_fin
|
|
|
61558
61685
|
}, "planBoundProjectAnnotations");
|
|
61559
61686
|
var planProjectAnnotations = /* @__PURE__ */ __name((json3, target, bindings) => planBoundProjectAnnotations(decodeProjectAnnotations(json3), projectAnnotationsFingerprint(json3), target, bindings), "planProjectAnnotations");
|
|
61560
61687
|
|
|
61561
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
61688
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/project-transfer/snapshot-model.js
|
|
61562
61689
|
import { createHash as createHash22 } from "node:crypto";
|
|
61563
61690
|
var text8 = /* @__PURE__ */ __name((max) => pipe(string(), minLength(1), maxLength(max)), "text");
|
|
61564
61691
|
var timestamp3 = pipe(number(), safeInteger(), minValue(0));
|
|
@@ -61652,7 +61779,7 @@ var projectAnnotationSnapshotFingerprint = /* @__PURE__ */ __name((json3) => {
|
|
|
61652
61779
|
})).digest("hex");
|
|
61653
61780
|
}, "projectAnnotationSnapshotFingerprint");
|
|
61654
61781
|
|
|
61655
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
61782
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/project-transfer/request.js
|
|
61656
61783
|
var projectAnnotationRequest = /* @__PURE__ */ __name((request, restore = false) => {
|
|
61657
61784
|
if (!request || typeof request !== "object" || Array.isArray(request))
|
|
61658
61785
|
throw new CliError("validation_error", "project annotation request is required");
|
|
@@ -61669,7 +61796,7 @@ var projectAnnotationRequest = /* @__PURE__ */ __name((request, restore = false)
|
|
|
61669
61796
|
return { snapshot: snapshot2, projectId: Number(request.project.slice(8)) };
|
|
61670
61797
|
}, "projectAnnotationRequest");
|
|
61671
61798
|
|
|
61672
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
61799
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/project-transfer/budget.js
|
|
61673
61800
|
var SnapshotBudget = class {
|
|
61674
61801
|
static {
|
|
61675
61802
|
__name(this, "SnapshotBudget");
|
|
@@ -61695,13 +61822,13 @@ var SnapshotBudget = class {
|
|
|
61695
61822
|
}
|
|
61696
61823
|
};
|
|
61697
61824
|
|
|
61698
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
61825
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/project-transfer/preview.js
|
|
61699
61826
|
import { createHash as createHash24 } from "node:crypto";
|
|
61700
61827
|
|
|
61701
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
61828
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/project-transfer/snapshot-plan.js
|
|
61702
61829
|
var planProjectAnnotationSnapshot = /* @__PURE__ */ __name((json3, target, bindings) => planBoundProjectAnnotations(decodeProjectAnnotationSnapshot(json3), projectAnnotationSnapshotFingerprint(json3), target, bindings), "planProjectAnnotationSnapshot");
|
|
61703
61830
|
|
|
61704
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
61831
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/project-transfer/sources.js
|
|
61705
61832
|
import { createHash as createHash23 } from "node:crypto";
|
|
61706
61833
|
var invalid12 = /* @__PURE__ */ __name(() => {
|
|
61707
61834
|
throw new CliError("configuration_error", "project snapshot has an unavailable or unsupported dependency");
|
|
@@ -61844,7 +61971,7 @@ var ProjectSnapshotSources = class {
|
|
|
61844
61971
|
}
|
|
61845
61972
|
};
|
|
61846
61973
|
|
|
61847
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
61974
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/project-transfer/snapshot.js
|
|
61848
61975
|
var unsupported = /* @__PURE__ */ __name(() => {
|
|
61849
61976
|
throw new CliError("configuration_error", "project snapshot has unsupported metadata, deletion or account scope");
|
|
61850
61977
|
}, "unsupported");
|
|
@@ -62022,7 +62149,7 @@ var projectAnnotationSnapshot = /* @__PURE__ */ __name((database, projectId2, bu
|
|
|
62022
62149
|
return { snapshot: snapshot2, read_bytes: budget.bytes, records: budget.records };
|
|
62023
62150
|
}), "projectAnnotationSnapshot");
|
|
62024
62151
|
|
|
62025
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
62152
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/project-transfer/preview.js
|
|
62026
62153
|
var previewAnnotationSnapshot = /* @__PURE__ */ __name((database, projectId2, manifest, bindings, budget) => read(database, () => {
|
|
62027
62154
|
const current2 = projectAnnotationSnapshot(database, projectId2, budget).snapshot;
|
|
62028
62155
|
const sources = new ProjectSnapshotSources(database, budget);
|
|
@@ -62084,7 +62211,7 @@ var previewAnnotationSnapshot = /* @__PURE__ */ __name((database, projectId2, ma
|
|
|
62084
62211
|
};
|
|
62085
62212
|
}), "previewAnnotationSnapshot");
|
|
62086
62213
|
|
|
62087
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
62214
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/project-transfer/records.js
|
|
62088
62215
|
var metadataOf2 = /* @__PURE__ */ __name((database, link3, to) => {
|
|
62089
62216
|
const provenance2 = link3.provenance === null ? {} : { provenance: link3.provenance };
|
|
62090
62217
|
if (link3.kind === "evidence" && to)
|
|
@@ -62151,7 +62278,7 @@ var restoreAnnotationRecords = /* @__PURE__ */ __name((database, projectId2, sna
|
|
|
62151
62278
|
return mappings;
|
|
62152
62279
|
}, "restoreAnnotationRecords");
|
|
62153
62280
|
|
|
62154
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
62281
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/project-transfer/store.js
|
|
62155
62282
|
var projectAnnotationStoreOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
62156
62283
|
async preview(request) {
|
|
62157
62284
|
const { snapshot: snapshot2, projectId: projectId2 } = projectAnnotationRequest(request);
|
|
@@ -62181,7 +62308,7 @@ var projectAnnotationStoreOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
|
62181
62308
|
}
|
|
62182
62309
|
}), "projectAnnotationStoreOver");
|
|
62183
62310
|
|
|
62184
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
62311
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/record-relations.js
|
|
62185
62312
|
var isDerived = /* @__PURE__ */ __name((role) => role.startsWith("fields."), "isDerived");
|
|
62186
62313
|
var recordRelationsOver = /* @__PURE__ */ __name(({ database }) => {
|
|
62187
62314
|
const sql2 = /* @__PURE__ */ __name((text9) => database.prepare(text9), "sql");
|
|
@@ -62252,7 +62379,7 @@ var recordRelationsOver = /* @__PURE__ */ __name(({ database }) => {
|
|
|
62252
62379
|
return { entityRef, relatedOf, storedRelations, relate, missingOf };
|
|
62253
62380
|
}, "recordRelationsOver");
|
|
62254
62381
|
|
|
62255
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
62382
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/record-remap.js
|
|
62256
62383
|
var recordRemapOver = /* @__PURE__ */ __name(({ database, now: now2 }) => {
|
|
62257
62384
|
const pointedAt = /* @__PURE__ */ __name((type, id2) => {
|
|
62258
62385
|
for (const { table, pointer } of pointerPairs(database))
|
|
@@ -62306,7 +62433,7 @@ var recordRemapOver = /* @__PURE__ */ __name(({ database, now: now2 }) => {
|
|
|
62306
62433
|
return { pointedAt, remap };
|
|
62307
62434
|
}, "recordRemapOver");
|
|
62308
62435
|
|
|
62309
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
62436
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/record-run.js
|
|
62310
62437
|
var runs = 0;
|
|
62311
62438
|
var PAGE = 500;
|
|
62312
62439
|
var recordRunOver = /* @__PURE__ */ __name((context, writes) => {
|
|
@@ -62519,7 +62646,7 @@ var waitingPointer = /* @__PURE__ */ __name((index2, missing4) => {
|
|
|
62519
62646
|
return pointerOf("records", index2, "fields", key2);
|
|
62520
62647
|
}, "waitingPointer");
|
|
62521
62648
|
|
|
62522
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
62649
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/record-matching.js
|
|
62523
62650
|
var valuesOf = /* @__PURE__ */ __name((value) => (Array.isArray(value) ? value : [value]).filter((one2) => typeof one2 === "string"), "valuesOf");
|
|
62524
62651
|
var SCHEME = /^(email|domain|tax-id:[a-z]{2}|registration:[a-z]{2})$/;
|
|
62525
62652
|
var ORG_EMAIL = "org-email";
|
|
@@ -62685,7 +62812,7 @@ var renameMade = /* @__PURE__ */ __name(({ database, now: now2 }, type, id2, nam
|
|
|
62685
62812
|
]);
|
|
62686
62813
|
}, "renameMade");
|
|
62687
62814
|
|
|
62688
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
62815
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/record-projectors-direct.js
|
|
62689
62816
|
var productFields = /* @__PURE__ */ __name((fields4) => ({
|
|
62690
62817
|
name: given2(fields4, "name"),
|
|
62691
62818
|
unit: given2(fields4, "unit"),
|
|
@@ -62808,7 +62935,7 @@ var DIRECT_PROJECTORS = {
|
|
|
62808
62935
|
lead: dealProjector("lead")
|
|
62809
62936
|
};
|
|
62810
62937
|
|
|
62811
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
62938
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/record-projectors-document.js
|
|
62812
62939
|
var TEXT_ONLY = { storage: "text", localPath: null };
|
|
62813
62940
|
var textOf7 = /* @__PURE__ */ __name(({ fields: fields4, externalId }) => {
|
|
62814
62941
|
const text9 = String(fields4.text ?? "");
|
|
@@ -62877,7 +63004,7 @@ var DOCUMENT_PROJECTORS = {
|
|
|
62877
63004
|
}
|
|
62878
63005
|
};
|
|
62879
63006
|
|
|
62880
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
63007
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/record-projectors-money.js
|
|
62881
63008
|
var allocatedByOthers = /* @__PURE__ */ __name((context, paymentId) => {
|
|
62882
63009
|
const importer = authorActor(context, IMPORTER).actor;
|
|
62883
63010
|
return context.database.prepare("SELECT 1 FROM payment_allocations WHERE payment_id = ? AND NOT (author_type = ? AND author_id = ?) LIMIT 1").get(paymentId, importer.type, importer.id) !== void 0;
|
|
@@ -63087,7 +63214,7 @@ var MONEY_PROJECTORS = {
|
|
|
63087
63214
|
}
|
|
63088
63215
|
};
|
|
63089
63216
|
|
|
63090
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
63217
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/record-projectors-phone.js
|
|
63091
63218
|
var CALLS_CALENDAR = "calls";
|
|
63092
63219
|
var importOnly = /* @__PURE__ */ __name((source2, type) => {
|
|
63093
63220
|
if (!isImportedProvider(source2.provider))
|
|
@@ -63262,7 +63389,7 @@ var PHONE_PROJECTORS = {
|
|
|
63262
63389
|
}
|
|
63263
63390
|
};
|
|
63264
63391
|
|
|
63265
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
63392
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/record-projectors.js
|
|
63266
63393
|
var RECORD_PROJECTORS = {
|
|
63267
63394
|
...MONEY_PROJECTORS,
|
|
63268
63395
|
...DIRECT_PROJECTORS,
|
|
@@ -63273,7 +63400,7 @@ var RECORD_PROJECTORS = {
|
|
|
63273
63400
|
project: null
|
|
63274
63401
|
};
|
|
63275
63402
|
|
|
63276
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
63403
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/record-settling.js
|
|
63277
63404
|
var recordSettlingOver = /* @__PURE__ */ __name(({ database }, finance) => {
|
|
63278
63405
|
const sql2 = /* @__PURE__ */ __name((text9) => database.prepare(text9), "sql");
|
|
63279
63406
|
const freeOn = /* @__PURE__ */ __name((invoice, payment) => {
|
|
@@ -63335,7 +63462,7 @@ var recordSettlingOver = /* @__PURE__ */ __name(({ database }, finance) => {
|
|
|
63335
63462
|
return { settle, checkShares };
|
|
63336
63463
|
}, "recordSettlingOver");
|
|
63337
63464
|
|
|
63338
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
63465
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/record-stamps.js
|
|
63339
63466
|
import { createHash as createHash25 } from "node:crypto";
|
|
63340
63467
|
var VOLATILE = /* @__PURE__ */ new Set(["id", "created_at", "updated_at", "metadata"]);
|
|
63341
63468
|
var content = /* @__PURE__ */ __name((row2) => row2 === void 0 ? null : Object.fromEntries(Object.entries(row2).filter(([column2]) => !VOLATILE.has(column2))), "content");
|
|
@@ -63351,7 +63478,7 @@ var importStampsOver = /* @__PURE__ */ __name(({ database }) => {
|
|
|
63351
63478
|
return { stamp, untouched };
|
|
63352
63479
|
}, "importStampsOver");
|
|
63353
63480
|
|
|
63354
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
63481
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/subscriptions.js
|
|
63355
63482
|
var SUBSCRIPTIONS = "SELECT s.*, b.name AS author_name, b.kind AS author_kind FROM subscriptions s LEFT JOIN bots b ON s.author_type = 'bot' AND b.id = s.author_id";
|
|
63356
63483
|
var PRICES = "SELECT p.*, b.name AS author_name, b.kind AS author_kind FROM subscription_prices p LEFT JOIN bots b ON p.author_type = 'bot' AND b.id = p.author_id";
|
|
63357
63484
|
var PRICE_REF = /^subscription_price:([1-9]\d{0,15})$/;
|
|
@@ -63588,7 +63715,7 @@ var subscriptionsStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
63588
63715
|
};
|
|
63589
63716
|
}, "subscriptionsStoreOver");
|
|
63590
63717
|
|
|
63591
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
63718
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/wallets.js
|
|
63592
63719
|
var WALLETS = "SELECT w.*, b.name AS author_name, b.kind AS author_kind FROM financial_accounts w LEFT JOIN bots b ON w.author_type = 'bot' AND b.id = w.author_id";
|
|
63593
63720
|
var SIGNED = "CASE t.direction WHEN 'in' THEN t.amount ELSE -t.amount END";
|
|
63594
63721
|
var walletOperationsOver = /* @__PURE__ */ __name((context) => {
|
|
@@ -63713,7 +63840,7 @@ var walletsStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
63713
63840
|
};
|
|
63714
63841
|
}, "walletsStoreOver");
|
|
63715
63842
|
|
|
63716
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
63843
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/record-writes.js
|
|
63717
63844
|
var specOf = /* @__PURE__ */ __name((type) => RECORD_TYPES[type], "specOf");
|
|
63718
63845
|
var unsettled = /* @__PURE__ */ __name((fields4, relations) => recordFingerprint(fields4, relations.filter((relation) => !AMOUNT_ROLES.includes(relation.role))), "unsettled");
|
|
63719
63846
|
var tableOf2 = /* @__PURE__ */ __name((type) => typeof type === "string" && Object.hasOwn(DECIDED_TABLES, type) ? DECIDED_TABLES[type] : void 0, "tableOf");
|
|
@@ -63972,7 +64099,7 @@ var recordWritesOver = /* @__PURE__ */ __name((context) => {
|
|
|
63972
64099
|
return { writeOne, project: project2, completeDependents, entityRef, missingOf: relations.missingOf };
|
|
63973
64100
|
}, "recordWritesOver");
|
|
63974
64101
|
|
|
63975
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
64102
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/records.js
|
|
63976
64103
|
var LIMIT = 1e3;
|
|
63977
64104
|
var iso16 = /* @__PURE__ */ __name((value) => new Date(Number(value)).toISOString(), "iso");
|
|
63978
64105
|
var checkLimit = /* @__PURE__ */ __name((limit) => {
|
|
@@ -64196,7 +64323,7 @@ var recordStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
64196
64323
|
};
|
|
64197
64324
|
}, "recordStoreOver");
|
|
64198
64325
|
|
|
64199
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
64326
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/templates.js
|
|
64200
64327
|
var templateOf = /* @__PURE__ */ __name((row2) => ({
|
|
64201
64328
|
key: row2.key,
|
|
64202
64329
|
channel: row2.channel,
|
|
@@ -64251,12 +64378,12 @@ var storedTemplateBodies = /* @__PURE__ */ __name((database, key2, language) =>
|
|
|
64251
64378
|
return Object.fromEntries(rows.map((row2) => [row2.channel, row2.body]));
|
|
64252
64379
|
}, "storedTemplateBodies");
|
|
64253
64380
|
|
|
64254
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
64381
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/domain/tracker.js
|
|
64255
64382
|
var trackerTitleOf = /* @__PURE__ */ __name((kind3, record3) => kind3 === "issue" ? record3.title : kind3 === "comment" ? record3.body.split("\n")[0]?.slice(0, 120) || "(comment)" : record3.name, "trackerTitleOf");
|
|
64256
64383
|
var trackerBodyOf = /* @__PURE__ */ __name((kind3, record3) => kind3 === "comment" ? record3.body : kind3 === "issue" || kind3 === "project" ? record3.description : null, "trackerBodyOf");
|
|
64257
64384
|
var trackerParentOf = /* @__PURE__ */ __name((kind3, record3) => kind3 === "comment" ? record3.issue : kind3 === "state" || kind3 === "label" ? record3.team : kind3 === "issue" ? record3.team : null, "trackerParentOf");
|
|
64258
64385
|
|
|
64259
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
64386
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/tracker.js
|
|
64260
64387
|
var MOST3 = 500;
|
|
64261
64388
|
var itemOf2 = /* @__PURE__ */ __name((row2) => ({
|
|
64262
64389
|
kind: String(row2.kind),
|
|
@@ -64426,7 +64553,7 @@ var trackerStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
64426
64553
|
};
|
|
64427
64554
|
}, "trackerStoreOver");
|
|
64428
64555
|
|
|
64429
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
64556
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/store-errors.js
|
|
64430
64557
|
var refusalOf2 = /* @__PURE__ */ __name((error) => error instanceof Error && error.name === "DrizzleQueryError" && error.cause instanceof CliError ? error.cause : error, "refusalOf");
|
|
64431
64558
|
var wrapped2 = /* @__PURE__ */ new WeakMap();
|
|
64432
64559
|
var storeErrors = /* @__PURE__ */ __name((area) => {
|
|
@@ -64461,7 +64588,7 @@ var storeErrors = /* @__PURE__ */ __name((area) => {
|
|
|
64461
64588
|
return proxy;
|
|
64462
64589
|
}, "storeErrors");
|
|
64463
64590
|
|
|
64464
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
64591
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/ranges.js
|
|
64465
64592
|
var markRange = /* @__PURE__ */ __name(({ orm, now: now2 }, chatKey, from2, to) => {
|
|
64466
64593
|
const touching = and(eq(syncRanges.chatId, chatKey), lte(syncRanges.fromKey, to + 1), gte(syncRanges.toKey, from2 - 1));
|
|
64467
64594
|
let merged2 = { from: from2, to };
|
|
@@ -64474,7 +64601,7 @@ var markRange = /* @__PURE__ */ __name(({ orm, now: now2 }, chatKey, from2, to)
|
|
|
64474
64601
|
}, "markRange");
|
|
64475
64602
|
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");
|
|
64476
64603
|
|
|
64477
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
64604
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/task-analysis-marks.js
|
|
64478
64605
|
var prefixOf2 = /* @__PURE__ */ __name(({ provider, account }) => `task_analysis:${provider}:${account}:`, "prefixOf");
|
|
64479
64606
|
var markOf = /* @__PURE__ */ __name((prefix, row2) => ({
|
|
64480
64607
|
chatId: String(row2.key).slice(prefix.length),
|
|
@@ -64495,7 +64622,7 @@ var setTaskAnalysisMark = /* @__PURE__ */ __name((database, account, { chatId, c
|
|
|
64495
64622
|
database.prepare("INSERT INTO store_settings (key, value, at) VALUES (?, ?, ?) ON CONFLICT (key) DO UPDATE SET value = excluded.value, at = excluded.at").run(prefixOf2(account) + chatId, JSON.stringify({ ...saved, checkedAt: checkedAt ?? new Date(now2).toISOString() }), now2);
|
|
64496
64623
|
}, "setTaskAnalysisMark");
|
|
64497
64624
|
|
|
64498
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
64625
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/task-rule-stops.js
|
|
64499
64626
|
var keyOf6 = /* @__PURE__ */ __name(({ provider, account }) => `task_rules_until:${provider}:${account}`, "keyOf");
|
|
64500
64627
|
var taskRulesStop = /* @__PURE__ */ __name((database, account) => {
|
|
64501
64628
|
const row2 = database.prepare("SELECT value FROM store_settings WHERE key = ?").get(keyOf6(account));
|
|
@@ -64505,7 +64632,7 @@ var setTaskRulesStop = /* @__PURE__ */ __name((database, account, until, now2) =
|
|
|
64505
64632
|
database.prepare("INSERT INTO store_settings (key, value, at) VALUES (?, ?, ?) ON CONFLICT (key) DO UPDATE SET value = excluded.value, at = excluded.at").run(keyOf6(account), JSON.stringify(until), now2);
|
|
64506
64633
|
}, "setTaskRulesStop");
|
|
64507
64634
|
|
|
64508
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
64635
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sync.js
|
|
64509
64636
|
var syncStoreOver = /* @__PURE__ */ __name((context) => {
|
|
64510
64637
|
const { database } = context;
|
|
64511
64638
|
const { accountPk: accountPk2, findAccountPk: findAccountPk2, chatKeyOf, chatPkFor: chatPkFor2, identityPk: identityPk2, writeMembers: writeMembers2, writeState: writeState2 } = keysOver(context);
|
|
@@ -64564,7 +64691,7 @@ var syncStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
64564
64691
|
};
|
|
64565
64692
|
}, "syncStoreOver");
|
|
64566
64693
|
|
|
64567
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
64694
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/tags.js
|
|
64568
64695
|
var tagsStoreOver = /* @__PURE__ */ __name((context) => {
|
|
64569
64696
|
const { database } = context;
|
|
64570
64697
|
return {
|
|
@@ -64586,7 +64713,7 @@ var tagsStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
64586
64713
|
};
|
|
64587
64714
|
}, "tagsStoreOver");
|
|
64588
64715
|
|
|
64589
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
64716
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/image-chunks.js
|
|
64590
64717
|
var IS_IMAGE = sql`(a.kind = 'photo' OR a.mime LIKE 'image/%')`;
|
|
64591
64718
|
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
|
|
64592
64719
|
WHERE chat_id = ${chatKey} AND deleted_at IS NULL AND trim(text) <> '' AND id <> ${messagePk}
|
|
@@ -64713,7 +64840,7 @@ var savePictureChunks = /* @__PURE__ */ __name(({ orm, now: now2, database }, ac
|
|
|
64713
64840
|
dropUnusedVectors(database, released.map(({ hash: hash2 }) => hash2));
|
|
64714
64841
|
}, "savePictureChunks");
|
|
64715
64842
|
|
|
64716
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
64843
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/message-chunks.js
|
|
64717
64844
|
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,
|
|
64718
64845
|
EXISTS (SELECT 1 FROM embeddings v WHERE v.model = ${model} AND v.content_hash = k.content_hash) AS embedded
|
|
64719
64846
|
FROM messages m
|
|
@@ -64802,7 +64929,7 @@ var nearestMessages = /* @__PURE__ */ __name((context, accountPk2, { limit, quer
|
|
|
64802
64929
|
return plain2(best(found2));
|
|
64803
64930
|
}, "nearestMessages");
|
|
64804
64931
|
|
|
64805
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
64932
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/vectors.js
|
|
64806
64933
|
var accountVectorsOver = /* @__PURE__ */ __name((context, mail) => {
|
|
64807
64934
|
const { database } = context;
|
|
64808
64935
|
const { findAccountPk: findAccountPk2, findChatPk: findChatPk2, chatKeyOf } = keysOver(context);
|
|
@@ -65066,7 +65193,7 @@ var vectorsStoreOver = /* @__PURE__ */ __name((context, keyed) => ({
|
|
|
65066
65193
|
vectorCounts: /* @__PURE__ */ __name(async (models) => vectorCounts(context, models), "vectorCounts")
|
|
65067
65194
|
}), "vectorsStoreOver");
|
|
65068
65195
|
|
|
65069
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
65196
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/store-tables.js
|
|
65070
65197
|
import { existsSync as existsSync3, readFileSync as readFileSync4 } from "node:fs";
|
|
65071
65198
|
import { dirname as dirname3, join as join4 } from "node:path";
|
|
65072
65199
|
var BOOKKEEPING2 = ["schema_migrations", "store_settings"];
|
|
@@ -65154,10 +65281,10 @@ var lastBackup = /* @__PURE__ */ __name((path) => {
|
|
|
65154
65281
|
}
|
|
65155
65282
|
}, "lastBackup");
|
|
65156
65283
|
|
|
65157
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
65284
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/providers.js
|
|
65158
65285
|
var registerProvider2 = /* @__PURE__ */ __name((store, entry2) => store.accounts.registerProvider(entry2), "registerProvider");
|
|
65159
65286
|
|
|
65160
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
65287
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/sqlite/store-contents.js
|
|
65161
65288
|
var COUNTED_TABLES = [
|
|
65162
65289
|
"accounts",
|
|
65163
65290
|
"chats",
|
|
@@ -65242,7 +65369,7 @@ var storeContents = /* @__PURE__ */ __name((database) => {
|
|
|
65242
65369
|
};
|
|
65243
65370
|
}, "storeContents");
|
|
65244
65371
|
|
|
65245
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
65372
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/store/store.js
|
|
65246
65373
|
var openStore = /* @__PURE__ */ __name(async (options = {}) => {
|
|
65247
65374
|
const context = await openStoreContext(options);
|
|
65248
65375
|
try {
|