@wirecat/hubspot-cli 0.3.2 → 0.5.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/CHANGELOG.md +34 -0
- package/README.md +6 -5
- package/dist/bin/hubspot.js +2 -2
- package/dist/bundle/agent-RBQMA24N.js +40 -0
- package/dist/bundle/{all-profiles-6452VSJB.js → all-profiles-PGFXLOKN.js} +11 -11
- package/dist/bundle/{anthropic-VQUOVYOW.js → anthropic-LPOJ3TYF.js} +5 -5
- package/dist/bundle/{app-server-EQZUP4H4.js → app-server-EYWGCSRY.js} +68 -68
- package/dist/bundle/{bun-AJPJ4ZUN.js → bun-ZJOOKIIW.js} +2 -2
- package/dist/bundle/{bun-sqlite-AGXGSF6D.js → bun-sqlite-Y6KKH2OW.js} +6 -6
- package/dist/bundle/{chunk-2A64XS22.js → chunk-23CLSKY7.js} +3 -3
- package/dist/bundle/{chunk-GZZR5U3K.js → chunk-34HDRZIL.js} +14 -14
- package/dist/bundle/{chunk-NZGI74GS.js → chunk-3CHJYWA2.js} +6 -6
- package/dist/bundle/{chunk-PMP37KLR.js → chunk-4RZ4DUQT.js} +3 -3
- package/dist/bundle/{chunk-LT5KE44Q.js → chunk-5ENY4POG.js} +61 -61
- package/dist/bundle/{chunk-QBEDVMLZ.js → chunk-5HGS65I3.js} +2 -2
- package/dist/bundle/{chunk-KVXEEKBB.js → chunk-5UPNDUAA.js} +2 -2
- package/dist/bundle/{chunk-YIF5M5R6.js → chunk-5WADRBQG.js} +3 -3
- package/dist/bundle/{chunk-KO4VR5NK.js → chunk-6PWRJGX4.js} +4 -4
- package/dist/bundle/{chunk-TKK3ECDS.js → chunk-6S422S22.js} +7 -7
- package/dist/bundle/{chunk-5AYKCKSE.js → chunk-7Q64D56R.js} +11 -11
- package/dist/bundle/{chunk-PHXOL5HZ.js → chunk-7RIE3DAW.js} +174 -161
- package/dist/bundle/{chunk-RVWGFD32.js → chunk-A5UTNGI4.js} +13 -13
- package/dist/bundle/{chunk-NTQBS2JL.js → chunk-ABPZOI3C.js} +4 -4
- package/dist/bundle/{chunk-L433IDOX.js → chunk-AHZQMSXW.js} +10 -10
- package/dist/bundle/{chunk-X5S5KUSU.js → chunk-AIQT2GGK.js} +19 -19
- package/dist/bundle/{chunk-3R4KRNUZ.js → chunk-AVBKXCEY.js} +8 -8
- package/dist/bundle/{chunk-TIHDBKA7.js → chunk-BCW7DAVV.js} +2 -2
- package/dist/bundle/{chunk-7UEL65GQ.js → chunk-BGUGTMTS.js} +8 -8
- package/dist/bundle/{chunk-BN22EKQQ.js → chunk-BH5FEFZB.js} +2 -2
- package/dist/bundle/{chunk-DJ2GJ77D.js → chunk-BVK4GUUI.js} +1352 -838
- package/dist/bundle/{chunk-3TEFE6YU.js → chunk-BW7NPFVC.js} +18 -8
- package/dist/bundle/{chunk-WRCKE5ND.js → chunk-CWCJEAHZ.js} +3 -3
- package/dist/bundle/{chunk-DW23LM47.js → chunk-DDMBPYHP.js} +2 -2
- package/dist/bundle/{chunk-WGBVRDY3.js → chunk-DEUCWBBH.js} +103 -5
- package/dist/bundle/{chunk-SEELWPRD.js → chunk-DJUUQG6Y.js} +8 -8
- package/dist/bundle/{chunk-VW5F6FK3.js → chunk-EGR3YUWD.js} +4 -4
- package/dist/bundle/{chunk-M763RNWP.js → chunk-EPBHJMF6.js} +20 -14
- package/dist/bundle/{chunk-7NZT7Y55.js → chunk-GZJP3KQQ.js} +3 -4
- package/dist/bundle/{chunk-BHZUPOQY.js → chunk-HBFSGL5E.js} +26 -26
- package/dist/bundle/{chunk-O3VM5PTJ.js → chunk-HPRGUUHY.js} +1 -1
- package/dist/bundle/{chunk-DSRXCLPO.js → chunk-HPSESLOZ.js} +1 -1
- package/dist/bundle/{chunk-Q27QAB4X.js → chunk-I334AT2H.js} +7 -7
- package/dist/bundle/{chunk-BAUK2MD5.js → chunk-K3WCBNH4.js} +43 -64
- package/dist/bundle/{chunk-JK2SNLU5.js → chunk-K5S7MKBB.js} +17 -17
- package/dist/bundle/{chunk-J5P5VSRG.js → chunk-KAW5VEER.js} +21 -8
- package/dist/bundle/{chunk-NNMU2TDU.js → chunk-KC4ILAKO.js} +1 -1
- package/dist/bundle/{chunk-K4X5ZHI2.js → chunk-KRTXJMCD.js} +16 -16
- package/dist/bundle/{chunk-DQB5JMTY.js → chunk-KXWRVLSU.js} +1 -1
- package/dist/bundle/{chunk-VQEAZXTV.js → chunk-L4SVHQ7H.js} +7 -7
- package/dist/bundle/{chunk-ARTJLL7W.js → chunk-L6WSFVTD.js} +8 -8
- package/dist/bundle/{chunk-OJIJVOOA.js → chunk-LWS5AO3H.js} +17 -17
- package/dist/bundle/{chunk-E4X7JAFC.js → chunk-LXLXF2OE.js} +3 -3
- package/dist/bundle/{chunk-ODPU3II6.js → chunk-MENMD5Y5.js} +8 -8
- package/dist/bundle/{chunk-5ZV7REBE.js → chunk-MFWECOO3.js} +82 -64
- package/dist/bundle/{chunk-HPZRUY6S.js → chunk-MGMLSPIY.js} +1 -1
- package/dist/bundle/{chunk-B3EH22CO.js → chunk-MKBQFD37.js} +1 -1
- package/dist/bundle/{chunk-E4FAMU2S.js → chunk-MPNMEWHA.js} +417 -320
- package/dist/bundle/{chunk-2HYGCLKN.js → chunk-MPQ4SPZG.js} +93 -40
- package/dist/bundle/{chunk-ITGNDZRR.js → chunk-MW4ROXQ6.js} +3 -3
- package/dist/bundle/{chunk-JP2HJXFO.js → chunk-NEDV6RCQ.js} +10 -3
- package/dist/bundle/{chunk-PLRUUXK7.js → chunk-NEP67GLY.js} +6 -6
- package/dist/bundle/{chunk-6MFP47XC.js → chunk-NKIKMG33.js} +35 -35
- package/dist/bundle/{chunk-GC6FLHZF.js → chunk-NLPGUYCG.js} +12 -12
- package/dist/bundle/{chunk-AF7DANIR.js → chunk-OCISQFMW.js} +1 -1
- package/dist/bundle/{chunk-AVUMH42T.js → chunk-ODRF47VS.js} +8 -8
- package/dist/bundle/{chunk-EE4JSYGZ.js → chunk-OFOA6VJ2.js} +3 -3
- package/dist/bundle/{chunk-BUGROVF3.js → chunk-PMGAU6AP.js} +2 -2
- package/dist/bundle/{chunk-IQ2XZ62J.js → chunk-POTS24SH.js} +18 -18
- package/dist/bundle/{chunk-B2W3C4N6.js → chunk-PPQRWFJZ.js} +5 -5
- package/dist/bundle/{chunk-GRFICQTZ.js → chunk-QCHW7R7L.js} +1 -1
- package/dist/bundle/{chunk-5K3FGXZH.js → chunk-QDNYJOWJ.js} +1 -1
- package/dist/bundle/{chunk-WCQW4GYO.js → chunk-QIHJKE4K.js} +24 -8
- package/dist/bundle/{chunk-7LQRXVQ3.js → chunk-QLFD3MOL.js} +1002 -560
- package/dist/bundle/{chunk-7VHBS5BJ.js → chunk-QPTHEZZ5.js} +2 -2
- package/dist/bundle/{chunk-IXZLMFPO.js → chunk-R7ZOCDNG.js} +1 -1
- package/dist/bundle/{chunk-FIVD4HM4.js → chunk-RJBKDZGV.js} +8 -8
- package/dist/bundle/{chunk-4DNHXRCJ.js → chunk-RZS7N3OZ.js} +7 -7
- package/dist/bundle/{chunk-A6UFH3QU.js → chunk-SBNZYRVZ.js} +4 -4
- package/dist/bundle/{chunk-EMOVVERN.js → chunk-STTHRJBX.js} +5 -5
- package/dist/bundle/{chunk-2NCO4E4T.js → chunk-V5VMAHDQ.js} +6 -6
- package/dist/bundle/{chunk-LA3YU4K7.js → chunk-VCYUYFIV.js} +1 -1
- package/dist/bundle/{chunk-3I2FGNWO.js → chunk-VIJV474N.js} +1 -1
- package/dist/bundle/{chunk-ABXVU5O4.js → chunk-WDR77HPO.js} +22 -1
- package/dist/bundle/{chunk-3PEKYGZ3.js → chunk-WEM4FZPM.js} +2 -2
- package/dist/bundle/{chunk-5PPG73G6.js → chunk-WQZENAPE.js} +3 -3
- package/dist/bundle/{chunk-5YNAVVCW.js → chunk-WXEN6AXQ.js} +16 -3
- package/dist/bundle/{chunk-IBTMK5KD.js → chunk-YJLJZMEA.js} +25 -25
- package/dist/bundle/{chunk-2PRVWEJC.js → chunk-YQBGPBYN.js} +2 -2
- package/dist/bundle/{chunk-3DIXAEGH.js → chunk-YZ5MULJM.js} +3 -3
- package/dist/bundle/{chunk-JUKAIXKY.js → chunk-Z7FC6VVM.js} +1 -1
- package/dist/bundle/{chunk-LKSNISYV.js → chunk-ZKPM53YG.js} +4 -4
- package/dist/bundle/{chunk-U6XA3OOM.js → chunk-ZLWQPUPB.js} +2 -2
- package/dist/bundle/{chunk-CBCEMFCF.js → chunk-ZMHD76RE.js} +2 -2
- package/dist/bundle/command-contract-O2UKYHLD.js +40 -0
- package/dist/bundle/{command-server-entry-GJSMDSNE.js → command-server-entry-B7S5AUE6.js} +28 -28
- package/dist/bundle/{decode-6PLXHVHW.js → decode-7L33C5UJ.js} +5 -5
- package/dist/bundle/{dispatch-TAQ7635E.js → dispatch-BIGHHSXV.js} +8 -8
- package/dist/bundle/{echarts-UZ7QLRE2.js → echarts-CWR3QH55.js} +2 -2
- package/dist/bundle/{embed-AWLL4EBF.js → embed-GXQ3HOQ6.js} +6 -6
- package/dist/bundle/{embedder-MM225YJ6.js → embedder-47OYXGLS.js} +9 -9
- package/dist/bundle/{failure-MR2XVHFP.js → failure-VMZOU5GZ.js} +2 -2
- package/dist/bundle/{first-run-KCZVNFJ7.js → first-run-YVQQOUQG.js} +12 -12
- package/dist/bundle/first-screen-TU3KE2B5.js +40 -0
- package/dist/bundle/hubspot.js +27 -25
- package/dist/bundle/{instructions-ZJ7U3QUE.js → instructions-QFS2MPK3.js} +1 -1
- package/dist/bundle/{mcp-CNV7F2XZ.js → mcp-Z2KZNCXB.js} +2 -2
- package/dist/bundle/meeting-combined-WBEOLQMP.js +25 -0
- package/dist/bundle/{meeting-model-OYXB2NOE.js → meeting-model-GLF2HVJG.js} +11 -11
- package/dist/bundle/{meeting-semantic-S3DBB7XD.js → meeting-semantic-RG56F4YX.js} +6 -6
- package/dist/bundle/{node-HGCZGZ4R.js → node-3TSWTXGI.js} +2 -2
- package/dist/bundle/{node-sqlite-RKYSRKEB.js → node-sqlite-UPQCG7DJ.js} +7 -7
- package/dist/bundle/{oauth-PYDCAQ7Y.js → oauth-MCVEENW3.js} +7 -7
- package/dist/bundle/{open-UCDSQUN2.js → open-JMUTKUYJ.js} +5 -5
- package/dist/bundle/{openai-Y4F5ZC7O.js → openai-HT7YDOK7.js} +15 -15
- package/dist/bundle/{process-P7FB7YO7.js → process-7RC6DAGM.js} +1 -1
- package/dist/bundle/{program-VKYZXANH.js → program-3DLBMOEJ.js} +174 -120
- package/dist/bundle/{prompt-E5TKZ37Q.js → prompt-7EROPXPF.js} +5 -5
- package/dist/bundle/{recognize-5NYPTSLT.js → recognize-B232GXD2.js} +4 -4
- package/dist/bundle/{remote-U4LUAHF2.js → remote-HGV64VRC.js} +9 -9
- package/dist/bundle/{rerank-AJAVKK5L.js → rerank-5S6TDXHD.js} +7 -7
- package/dist/bundle/{schemas-QLQ2K6DL.js → schemas-SB42IXEX.js} +1 -1
- package/dist/bundle/{serve-4UJ3R5IP.js → serve-D2WFCV6Z.js} +9 -9
- package/dist/bundle/{server-DUKWJUKD.js → server-4AXPTJPV.js} +60 -60
- package/dist/bundle/server-FFHVNABP.js +86 -0
- package/dist/bundle/{source-LJG4BWRU.js → source-DF63EC2B.js} +114 -86
- package/dist/bundle/{sqlite-runtime-KLEA4XAU.js → sqlite-runtime-DAFMZNLI.js} +6 -6
- package/dist/bundle/{state-COGSYMVH.js → state-7OEBDXVV.js} +6 -6
- package/dist/bundle/{store-BJXCSP26.js → store-2ZWSWF76.js} +24 -24
- package/dist/bundle/{store-V5UMSWK4.js → store-KC6US326.js} +26 -22
- package/dist/bundle/store-Q3ZKD4FJ.js +34 -0
- package/dist/bundle/store-maintenance-command-24A4GBRP.js +73 -0
- package/dist/bundle/surface-SPTM57EP.js +72 -0
- package/dist/bundle/writer-EQQ55HOS.js +86 -0
- package/dist/config.d.ts +1 -0
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +59 -10
- package/dist/config.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +4 -4
- package/skills/hubspot-cli/references/api/api-basic.md +34 -6
- package/skills/hubspot-cli/references/api/api-batch.md +19 -9
- package/skills/hubspot-cli/references/api/api-search.md +9 -0
- package/dist/bundle/agent-A7ARC3QB.js +0 -40
- package/dist/bundle/command-contract-R2FGN7CQ.js +0 -40
- package/dist/bundle/first-screen-SCDV7TXT.js +0 -40
- package/dist/bundle/meeting-combined-EL5XZIJ5.js +0 -25
- package/dist/bundle/server-UQVV2PPX.js +0 -86
- package/dist/bundle/store-7DQGZH64.js +0 -32
- package/dist/bundle/store-maintenance-command-DQUBBWMD.js +0 -73
- package/dist/bundle/surface-IGBQUYE5.js +0 -72
- package/dist/bundle/writer-QOEJONAD.js +0 -86
|
@@ -10,18 +10,18 @@ import {
|
|
|
10
10
|
analyzerIdentity,
|
|
11
11
|
createStemmer,
|
|
12
12
|
parseStemmers
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-BGUGTMTS.js";
|
|
14
14
|
import {
|
|
15
15
|
calendarMoment,
|
|
16
16
|
dayIn
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-CWCJEAHZ.js";
|
|
18
18
|
import {
|
|
19
19
|
PRESENCE,
|
|
20
20
|
fuseRanked,
|
|
21
21
|
isPresence,
|
|
22
22
|
parseBytes,
|
|
23
23
|
plainQuery
|
|
24
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-I334AT2H.js";
|
|
25
25
|
import {
|
|
26
26
|
ACCOUNT_GROUPS,
|
|
27
27
|
CATEGORIES,
|
|
@@ -59,16 +59,10 @@ import {
|
|
|
59
59
|
runEvent,
|
|
60
60
|
severity,
|
|
61
61
|
sourceOf2 as sourceOf
|
|
62
|
-
} from "./chunk-
|
|
62
|
+
} from "./chunk-YJLJZMEA.js";
|
|
63
63
|
import {
|
|
64
64
|
sqliteCode
|
|
65
|
-
} from "./chunk-
|
|
66
|
-
import {
|
|
67
|
-
DEFAULT_TASK_CATEGORIES,
|
|
68
|
-
sharedConfigPath,
|
|
69
|
-
storedTaskCategories,
|
|
70
|
-
taskCategoriesReader
|
|
71
|
-
} from "./chunk-4DNHXRCJ.js";
|
|
65
|
+
} from "./chunk-DDMBPYHP.js";
|
|
72
66
|
import {
|
|
73
67
|
AMOUNT_ROLES,
|
|
74
68
|
BARE_INTERNATIONAL_PROVIDERS,
|
|
@@ -119,19 +113,20 @@ import {
|
|
|
119
113
|
typedPhone,
|
|
120
114
|
validCounter,
|
|
121
115
|
wildcardPattern
|
|
122
|
-
} from "./chunk-
|
|
116
|
+
} from "./chunk-POTS24SH.js";
|
|
123
117
|
import {
|
|
124
118
|
QUERY_LIMITS,
|
|
125
119
|
exhausted,
|
|
126
120
|
outOfTime,
|
|
127
121
|
searchError,
|
|
122
|
+
sqliteLimit,
|
|
128
123
|
tooWideTerm
|
|
129
|
-
} from "./chunk-
|
|
124
|
+
} from "./chunk-NEDV6RCQ.js";
|
|
130
125
|
import {
|
|
131
126
|
NORMALIZER_VERSION,
|
|
132
127
|
fold,
|
|
133
128
|
normalize
|
|
134
|
-
} from "./chunk-
|
|
129
|
+
} from "./chunk-KXWRVLSU.js";
|
|
135
130
|
import {
|
|
136
131
|
ADDED_ACCOUNT,
|
|
137
132
|
ADDED_PROVIDER,
|
|
@@ -220,11 +215,11 @@ import {
|
|
|
220
215
|
usableLinkSql,
|
|
221
216
|
useStoredProviders,
|
|
222
217
|
walletLine
|
|
223
|
-
} from "./chunk-
|
|
218
|
+
} from "./chunk-NLPGUYCG.js";
|
|
224
219
|
import {
|
|
225
220
|
normalizeTag,
|
|
226
221
|
tagOf
|
|
227
|
-
} from "./chunk-
|
|
222
|
+
} from "./chunk-ZMHD76RE.js";
|
|
228
223
|
import {
|
|
229
224
|
CHAT_MESSAGES_READ,
|
|
230
225
|
FACT_TYPES,
|
|
@@ -280,21 +275,27 @@ import {
|
|
|
280
275
|
validateQuery,
|
|
281
276
|
walkQuery,
|
|
282
277
|
zonedMoment
|
|
283
|
-
} from "./chunk-
|
|
278
|
+
} from "./chunk-5ENY4POG.js";
|
|
279
|
+
import {
|
|
280
|
+
DEFAULT_TASK_CATEGORIES,
|
|
281
|
+
sharedConfigPath,
|
|
282
|
+
storedTaskCategories,
|
|
283
|
+
taskCategoriesReader
|
|
284
|
+
} from "./chunk-RZS7N3OZ.js";
|
|
284
285
|
import {
|
|
285
286
|
refuseOwnerStoreInTests,
|
|
286
287
|
storePath
|
|
287
|
-
} from "./chunk-
|
|
288
|
+
} from "./chunk-WEM4FZPM.js";
|
|
288
289
|
import {
|
|
289
290
|
quietSqliteWarning,
|
|
290
291
|
storeCapable
|
|
291
|
-
} from "./chunk-
|
|
292
|
+
} from "./chunk-3CHJYWA2.js";
|
|
292
293
|
import {
|
|
293
294
|
PRAGMAS,
|
|
294
295
|
TIME_LIMIT_FUNCTION,
|
|
295
296
|
TimeLimitReached,
|
|
296
297
|
isQueryOnly
|
|
297
|
-
} from "./chunk-
|
|
298
|
+
} from "./chunk-Z7FC6VVM.js";
|
|
298
299
|
import {
|
|
299
300
|
array,
|
|
300
301
|
boolean,
|
|
@@ -320,7 +321,7 @@ import {
|
|
|
320
321
|
CliError,
|
|
321
322
|
isCliError,
|
|
322
323
|
singleLine
|
|
323
|
-
} from "./chunk-
|
|
324
|
+
} from "./chunk-PMGAU6AP.js";
|
|
324
325
|
import {
|
|
325
326
|
SQLiteTable,
|
|
326
327
|
TableAliasProxyHandler,
|
|
@@ -345,7 +346,7 @@ import {
|
|
|
345
346
|
sql,
|
|
346
347
|
sqliteTable,
|
|
347
348
|
text
|
|
348
|
-
} from "./chunk-
|
|
349
|
+
} from "./chunk-QCHW7R7L.js";
|
|
349
350
|
import {
|
|
350
351
|
__commonJS,
|
|
351
352
|
__name,
|
|
@@ -10089,7 +10090,7 @@ var require_cjs = __commonJS({
|
|
|
10089
10090
|
}
|
|
10090
10091
|
});
|
|
10091
10092
|
|
|
10092
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
10093
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/account-store.js
|
|
10093
10094
|
var bindArea = /* @__PURE__ */ __name(({ keyed, whole }, account) => {
|
|
10094
10095
|
const methods = whole;
|
|
10095
10096
|
return Object.fromEntries(Object.keys(keyed).map((name) => [
|
|
@@ -10217,7 +10218,7 @@ var bindAccount = /* @__PURE__ */ __name((store, account, areas, owners) => {
|
|
|
10217
10218
|
};
|
|
10218
10219
|
}, "bindAccount");
|
|
10219
10220
|
|
|
10220
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
10221
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/drizzle/core.js
|
|
10221
10222
|
var IndexBuilderOn = class {
|
|
10222
10223
|
static {
|
|
10223
10224
|
__name(this, "IndexBuilderOn");
|
|
@@ -10412,7 +10413,7 @@ function alias(table, alias2) {
|
|
|
10412
10413
|
}
|
|
10413
10414
|
__name(alias, "alias");
|
|
10414
10415
|
|
|
10415
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
10416
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/entity-types.js
|
|
10416
10417
|
var ENTITY_TABLES = {
|
|
10417
10418
|
...RECORD_TABLES,
|
|
10418
10419
|
account: "accounts",
|
|
@@ -10439,6 +10440,7 @@ var ENTITY_TABLES = {
|
|
|
10439
10440
|
message: "messages",
|
|
10440
10441
|
note: "notes",
|
|
10441
10442
|
place: "places",
|
|
10443
|
+
post: "content_posts",
|
|
10442
10444
|
tag: "canonical_tags",
|
|
10443
10445
|
task: "tasks"
|
|
10444
10446
|
};
|
|
@@ -10451,7 +10453,7 @@ var orphanPointers = /* @__PURE__ */ __name((database) => pointerPairs(database)
|
|
|
10451
10453
|
return { table, pointer, type, count: count2, known: known2 };
|
|
10452
10454
|
}).filter(({ count: count2 }) => count2 > 0)), "orphanPointers");
|
|
10453
10455
|
|
|
10454
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
10456
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/identity-links.js
|
|
10455
10457
|
var IDENTITY_LINK_KIND = "identity_link";
|
|
10456
10458
|
var IDENTITY_LINK_SIGNALS = ["agent", "phone", "email", "guest-email", "name", "account"];
|
|
10457
10459
|
var LINK_WEAKNESSES = [
|
|
@@ -10464,7 +10466,7 @@ var LINK_WEAKNESSES = [
|
|
|
10464
10466
|
"not-own-number"
|
|
10465
10467
|
];
|
|
10466
10468
|
|
|
10467
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
10469
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/merged-persons.js
|
|
10468
10470
|
var SEPARATIONS = ["unlink", "split", "undo-merge"];
|
|
10469
10471
|
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");
|
|
10470
10472
|
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");
|
|
@@ -10496,7 +10498,7 @@ var samePersons = /* @__PURE__ */ __name((database, pk) => {
|
|
|
10496
10498
|
}, "samePersons");
|
|
10497
10499
|
var idsOf = /* @__PURE__ */ __name((database, type, id2) => JSON.stringify(type === "person" ? samePersons(database, id2) : [id2]), "idsOf");
|
|
10498
10500
|
|
|
10499
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
10501
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/identity-link-rows.js
|
|
10500
10502
|
var pairOf = /* @__PURE__ */ __name((a, b) => [Number(a), Number(b)].sort((x, y) => x - y).join("-"), "pairOf");
|
|
10501
10503
|
var pkOf = /* @__PURE__ */ __name((database, ref3) => {
|
|
10502
10504
|
const at2 = ref3.indexOf(":");
|
|
@@ -10603,13 +10605,13 @@ var forgetErasedLinks = /* @__PURE__ */ __name((database) => {
|
|
|
10603
10605
|
database.prepare("DELETE FROM proposed_actions WHERE id = ?").run(Number(row2.id));
|
|
10604
10606
|
}, "forgetErasedLinks");
|
|
10605
10607
|
|
|
10606
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
10608
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/identity-splits.js
|
|
10607
10609
|
var IDENTITY_SPLIT_KIND = "identity_split";
|
|
10608
10610
|
|
|
10609
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
10611
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/mail-findings.js
|
|
10610
10612
|
var MAIL_FINDINGS_KIND = "mail_findings";
|
|
10611
10613
|
|
|
10612
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
10614
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/decisions.js
|
|
10613
10615
|
var TASK_CLOSE_KIND = "task_close";
|
|
10614
10616
|
var DEFAULT_DECISION_POLICY = { agentDecisions: false, ruleProposalsOwnerOnly: true };
|
|
10615
10617
|
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");
|
|
@@ -10657,7 +10659,7 @@ var assertMayDecide = /* @__PURE__ */ __name((row2, by, policy = DEFAULT_DECISIO
|
|
|
10657
10659
|
}, "assertMayDecide");
|
|
10658
10660
|
var deciderAuthor = /* @__PURE__ */ __name((by) => by === "owner" ? "owner" : { bot: by.bot, ...by.model === void 0 ? {} : { model: by.model } }, "deciderAuthor");
|
|
10659
10661
|
|
|
10660
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
10662
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/mail/score.js
|
|
10661
10663
|
var import_disposable_email_domains_js = __toESM(require_dist(), 1);
|
|
10662
10664
|
var import_tldts = __toESM(require_cjs(), 1);
|
|
10663
10665
|
var FREE_MAIL = /* @__PURE__ */ new Set([
|
|
@@ -10687,7 +10689,7 @@ var FREE_MAIL = /* @__PURE__ */ new Set([
|
|
|
10687
10689
|
]);
|
|
10688
10690
|
var DAY_MS = 24 * 60 * 60 * 1e3;
|
|
10689
10691
|
|
|
10690
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
10692
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/address-organization.js
|
|
10691
10693
|
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 ";
|
|
10692
10694
|
var idsOf2 = /* @__PURE__ */ __name((rows) => rows.map((row2) => Number(row2.id)), "idsOf");
|
|
10693
10695
|
var holdAddress = /* @__PURE__ */ __name(({ database, now: now2 }, organization2, email, { method, author }) => {
|
|
@@ -10712,10 +10714,10 @@ var organizationOfAddress = /* @__PURE__ */ __name((context, { name, email, meth
|
|
|
10712
10714
|
return id2;
|
|
10713
10715
|
}, "organizationOfAddress");
|
|
10714
10716
|
|
|
10715
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
10717
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/transaction.js
|
|
10716
10718
|
import { AsyncLocalStorage } from "node:async_hooks";
|
|
10717
10719
|
|
|
10718
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
10720
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/journal.js
|
|
10719
10721
|
import { existsSync, statSync } from "node:fs";
|
|
10720
10722
|
var watched = /* @__PURE__ */ new WeakMap();
|
|
10721
10723
|
var walInode = /* @__PURE__ */ __name((store) => statSync(`${store}-wal`, { throwIfNoEntry: false })?.ino, "walInode");
|
|
@@ -10741,7 +10743,7 @@ var checkJournal = /* @__PURE__ */ __name((database) => {
|
|
|
10741
10743
|
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" });
|
|
10742
10744
|
}, "checkJournal");
|
|
10743
10745
|
|
|
10744
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
10746
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/write-events.js
|
|
10745
10747
|
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;
|
|
10746
10748
|
var writeTarget = /* @__PURE__ */ __name((sql2) => {
|
|
10747
10749
|
const match = WRITE.exec(sql2);
|
|
@@ -10821,7 +10823,7 @@ var committedWrites = /* @__PURE__ */ __name((database) => {
|
|
|
10821
10823
|
}, "committedWrites");
|
|
10822
10824
|
var droppedWrites = /* @__PURE__ */ __name((database) => tallies.get(database)?.pending.clear(), "droppedWrites");
|
|
10823
10825
|
|
|
10824
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
10826
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/involvement-queue.js
|
|
10825
10827
|
var ARMS = [
|
|
10826
10828
|
[
|
|
10827
10829
|
"message",
|
|
@@ -10949,7 +10951,7 @@ var drainInvolvementQueue = /* @__PURE__ */ __name((database, cap = QUEUE_CAP) =
|
|
|
10949
10951
|
return recomputed;
|
|
10950
10952
|
}, "drainInvolvementQueue");
|
|
10951
10953
|
|
|
10952
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
10954
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/domain/mentions.js
|
|
10953
10955
|
import { domainToUnicode } from "node:url";
|
|
10954
10956
|
|
|
10955
10957
|
// node_modules/.pnpm/psl@1.15.0/node_modules/psl/dist/psl.mjs
|
|
@@ -20971,7 +20973,7 @@ var oa = /* @__PURE__ */ __name((e) => {
|
|
|
20971
20973
|
}, "oa");
|
|
20972
20974
|
var na = { parse: O, get: aa, isValid: oa };
|
|
20973
20975
|
|
|
20974
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
20976
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/domain/google-documents.js
|
|
20975
20977
|
var LINK = /https?:\/\/(?:(?:docs|drive|sheets|slides)\.google\.com|forms\.gle)(?:[/?#][^\s<>"'`]*)?/gi;
|
|
20976
20978
|
var ID = /^[\w-]{10,}$/;
|
|
20977
20979
|
var trimUrl = /* @__PURE__ */ __name((url) => {
|
|
@@ -21013,7 +21015,7 @@ var googleDocumentLinks = /* @__PURE__ */ __name((text8) => [...text8.matchAll(L
|
|
|
21013
21015
|
return { url, documentId: googleDocumentId(url) };
|
|
21014
21016
|
}), "googleDocumentLinks");
|
|
21015
21017
|
|
|
21016
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
21018
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/domain/places.js
|
|
21017
21019
|
var BEFORE = [
|
|
21018
21020
|
[/^(?:ул\.?|улиц[аеыу]|улицей)$/iu, "\u0443\u043B\u0438\u0446\u0430"],
|
|
21019
21021
|
[/^(?:пр-т|просп\.?|проспект[аеу]?)$/iu, "\u043F\u0440\u043E\u0441\u043F\u0435\u043A\u0442"],
|
|
@@ -21273,7 +21275,7 @@ var findPlaces = /* @__PURE__ */ __name((text8) => {
|
|
|
21273
21275
|
return found2.sort((a, b) => a.start - b.start);
|
|
21274
21276
|
}, "findPlaces");
|
|
21275
21277
|
|
|
21276
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
21278
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/domain/mentions.js
|
|
21277
21279
|
var MENTION_KINDS = ["phone", "email", "url", "document", "person-name", "place"];
|
|
21278
21280
|
var MENTION_VERSIONS = {
|
|
21279
21281
|
phone: 1,
|
|
@@ -21449,7 +21451,7 @@ var exactlyOne = /* @__PURE__ */ __name((text8, options) => {
|
|
|
21449
21451
|
return one2 && one2.start === 0 && one2.end === text8.length ? one2.value : void 0;
|
|
21450
21452
|
}, "exactlyOne");
|
|
21451
21453
|
|
|
21452
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
21454
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/domain/first-names.js
|
|
21453
21455
|
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";
|
|
21454
21456
|
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";
|
|
21455
21457
|
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";
|
|
@@ -21457,7 +21459,7 @@ var NOT_NAMES = ["\u0436\u0435\u043D\u0430", "\u0436\u0435\u043D\u044B", "\u0436
|
|
|
21457
21459
|
var FIRST_NAMES = [...new Set(`${RUSSIAN} ${EUROPEAN}`.split(" "))];
|
|
21458
21460
|
var NAME_WORDS = WORDS.split(" ");
|
|
21459
21461
|
|
|
21460
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
21462
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/domain/person-names.js
|
|
21461
21463
|
var LATIN_TO_CYRILLIC = {
|
|
21462
21464
|
shch: "\u0449",
|
|
21463
21465
|
sch: "\u0449",
|
|
@@ -21665,7 +21667,7 @@ var findUnknownNames = /* @__PURE__ */ __name((text8, stem, taken) => {
|
|
|
21665
21667
|
return found2;
|
|
21666
21668
|
}, "findUnknownNames");
|
|
21667
21669
|
|
|
21668
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
21670
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/domain/attachments.js
|
|
21669
21671
|
var NOT_FILES = /* @__PURE__ */ new Set([
|
|
21670
21672
|
"webpage",
|
|
21671
21673
|
"share",
|
|
@@ -21706,7 +21708,7 @@ var matchDownloads = /* @__PURE__ */ __name((stored4, files2) => {
|
|
|
21706
21708
|
});
|
|
21707
21709
|
}, "matchDownloads");
|
|
21708
21710
|
|
|
21709
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
21711
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/search/lucene/presets.js
|
|
21710
21712
|
var PRESET_VERSION = 1;
|
|
21711
21713
|
var PRESETS = {
|
|
21712
21714
|
password: {
|
|
@@ -21760,12 +21762,12 @@ var PRESETS = {
|
|
|
21760
21762
|
}
|
|
21761
21763
|
};
|
|
21762
21764
|
|
|
21763
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
21765
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/search/lucene/resolved.js
|
|
21764
21766
|
var hasText = /* @__PURE__ */ __name((node) => node.kind === "predicate" ? node.field === "text" || node.field === "exact" : node.clauses.some(({ node: node2 }) => hasText(node2)), "hasText");
|
|
21765
21767
|
var isStemmed = /* @__PURE__ */ __name((node) => node.field === "text" && (node.operator === "term" || node.operator === "phrase") && node.value !== "", "isStemmed");
|
|
21766
21768
|
var hasStems = /* @__PURE__ */ __name((node) => node.kind === "predicate" ? isStemmed(node) : node.clauses.some(({ node: node2 }) => hasStems(node2)), "hasStems");
|
|
21767
21769
|
|
|
21768
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
21770
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/mention-links.js
|
|
21769
21771
|
var LIVE = "mn.kind = 'url' AND mn.status <> 'dismissed'";
|
|
21770
21772
|
var MAIL_ROWS = `SELECT mn.source_id FROM mentions mn WHERE mn.source_type = 'email' AND ${LIVE}`;
|
|
21771
21773
|
var linkMatch = /* @__PURE__ */ __name((field4, typed, mail, mentioned2) => {
|
|
@@ -21789,7 +21791,7 @@ var linkMatch = /* @__PURE__ */ __name((field4, typed, mail, mentioned2) => {
|
|
|
21789
21791
|
};
|
|
21790
21792
|
}, "linkMatch");
|
|
21791
21793
|
|
|
21792
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
21794
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/phone-countries.js
|
|
21793
21795
|
var SETTING = "phoneCountries";
|
|
21794
21796
|
var savedPhoneCountries = /* @__PURE__ */ __name((database) => {
|
|
21795
21797
|
const row2 = database.prepare("SELECT value FROM store_settings WHERE key = ?").get(SETTING);
|
|
@@ -21820,7 +21822,7 @@ var valueMatch = /* @__PURE__ */ __name((database, typed) => {
|
|
|
21820
21822
|
return { sql: "mn.value = ?", params: [phone?.value ?? normalizedValue(typed, { phoneCountries })] };
|
|
21821
21823
|
}, "valueMatch");
|
|
21822
21824
|
|
|
21823
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
21825
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/domain/vocabulary.js
|
|
21824
21826
|
var normalizeVocabularyName = /* @__PURE__ */ __name((input) => {
|
|
21825
21827
|
if (typeof input !== "string" || input.length > 200 || /[\p{Cc}\p{Cf}]/u.test(input))
|
|
21826
21828
|
throw new CliError("validation_error", "a vocabulary name takes 1\u2013200 characters without control characters");
|
|
@@ -21848,7 +21850,7 @@ var vocabularySimilarity = /* @__PURE__ */ __name((left, right) => {
|
|
|
21848
21850
|
return 2 * intersection2 / (aa2.size + bb.size);
|
|
21849
21851
|
}, "vocabularySimilarity");
|
|
21850
21852
|
|
|
21851
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
21853
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/tag-creation.js
|
|
21852
21854
|
import { createHash } from "node:crypto";
|
|
21853
21855
|
var folded2 = /* @__PURE__ */ __name((name) => {
|
|
21854
21856
|
try {
|
|
@@ -21914,7 +21916,7 @@ var guardTagCreation = /* @__PURE__ */ __name((context, name, kind3, by, options
|
|
|
21914
21916
|
});
|
|
21915
21917
|
}, "guardTagCreation");
|
|
21916
21918
|
|
|
21917
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
21919
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/domain/tag-redirects.js
|
|
21918
21920
|
var invalid = /* @__PURE__ */ __name((message3) => {
|
|
21919
21921
|
throw new CliError("validation_error", message3);
|
|
21920
21922
|
}, "invalid");
|
|
@@ -21991,7 +21993,7 @@ var createTagRedirectIndex = /* @__PURE__ */ __name((snapshot2) => {
|
|
|
21991
21993
|
};
|
|
21992
21994
|
}, "createTagRedirectIndex");
|
|
21993
21995
|
|
|
21994
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
21996
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/tag-resolution.js
|
|
21995
21997
|
var tagCanonicalId = /* @__PURE__ */ __name((database, id2) => {
|
|
21996
21998
|
const row2 = database.prepare("SELECT canonical_id FROM resolved_tags WHERE id=?").get(id2);
|
|
21997
21999
|
if (!row2)
|
|
@@ -22019,7 +22021,7 @@ var tagRedirectSnapshot = /* @__PURE__ */ __name((database) => {
|
|
|
22019
22021
|
return snapshot2;
|
|
22020
22022
|
}, "tagRedirectSnapshot");
|
|
22021
22023
|
|
|
22022
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
22024
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/task-keys.js
|
|
22023
22025
|
import { createHash as createHash2 } from "node:crypto";
|
|
22024
22026
|
var TASK_KEY_PREFIXES = {
|
|
22025
22027
|
question: "Q",
|
|
@@ -22047,7 +22049,7 @@ var taskAccountOf = /* @__PURE__ */ __name((database, rowId) => {
|
|
|
22047
22049
|
return row2 && String(row2.key) === inboxKey(String(row2.name)) ? String(row2.name) : void 0;
|
|
22048
22050
|
}, "taskAccountOf");
|
|
22049
22051
|
|
|
22050
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
22052
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/things.js
|
|
22051
22053
|
var storedThing = /* @__PURE__ */ __name((type, id2) => ({ type: String(type), id: Number(id2) }), "storedThing");
|
|
22052
22054
|
var REFERABLE = {
|
|
22053
22055
|
...Object.fromEntries(Object.entries(RECORD_TYPES).map(([type, { tombstone: tombstone2 }]) => [type, { tombstone: tombstone2 }])),
|
|
@@ -22211,7 +22213,7 @@ var taskIdOf = /* @__PURE__ */ __name((database, rowId) => {
|
|
|
22211
22213
|
return row2 ? String(row2.id ?? row2.key) : void 0;
|
|
22212
22214
|
}, "taskIdOf");
|
|
22213
22215
|
|
|
22214
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
22216
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/values.js
|
|
22215
22217
|
var toMs = /* @__PURE__ */ __name((iso17) => {
|
|
22216
22218
|
if (iso17 === null || iso17 === void 0)
|
|
22217
22219
|
return null;
|
|
@@ -22225,7 +22227,7 @@ var present = /* @__PURE__ */ __name((entries) => Object.fromEntries(Object.entr
|
|
|
22225
22227
|
var DELIVERY = { delivered: 1, read: 2 };
|
|
22226
22228
|
var deliveryOf = /* @__PURE__ */ __name((stored4) => stored4 === DELIVERY.read ? "read" : stored4 === DELIVERY.delivered ? "delivered" : void 0, "deliveryOf");
|
|
22227
22229
|
|
|
22228
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
22230
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/tags.js
|
|
22229
22231
|
var TAG_KINDS = ["tag", "topic"];
|
|
22230
22232
|
var TAGGABLE = { chat: "chat", contact: "identity", message: "message", task: "task" };
|
|
22231
22233
|
var TAG_TYPE = {
|
|
@@ -22428,7 +22430,7 @@ var tagsOf = /* @__PURE__ */ __name(({ database }, key2, filter) => {
|
|
|
22428
22430
|
return result;
|
|
22429
22431
|
}, "tagsOf");
|
|
22430
22432
|
|
|
22431
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
22433
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/trigram-match.js
|
|
22432
22434
|
var MOST_YO_SPELLINGS = 64;
|
|
22433
22435
|
var yoSpellings = /* @__PURE__ */ __name((run) => {
|
|
22434
22436
|
let spellings2 = [""];
|
|
@@ -22450,7 +22452,7 @@ var anyCaseGlob = /* @__PURE__ */ __name((word2) => `*${[...word2.normalize("NFC
|
|
|
22450
22452
|
return forms2.size === 1 ? c : `[${[...forms2].join("")}]`;
|
|
22451
22453
|
}).join("")}*`, "anyCaseGlob");
|
|
22452
22454
|
|
|
22453
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
22455
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/lucene-fields.js
|
|
22454
22456
|
var speech = /* @__PURE__ */ __name((alias2) => `(coalesce(${alias2}.extractor,'') LIKE 'speech:%' OR ${alias2}.kind IN ('voice','video_note') OR coalesce(${alias2}.mime,'')='audio/ogg')`, "speech");
|
|
22455
22457
|
var SPEECH = speech("att");
|
|
22456
22458
|
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");
|
|
@@ -22938,7 +22940,7 @@ var FIELD_COMPILERS = {
|
|
|
22938
22940
|
subject
|
|
22939
22941
|
};
|
|
22940
22942
|
|
|
22941
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
22943
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/place-key.js
|
|
22942
22944
|
var placeOf = /* @__PURE__ */ __name((database) => {
|
|
22943
22945
|
const exact = database.prepare("SELECT id FROM places WHERE folded = ?");
|
|
22944
22946
|
const onStreet = database.prepare("SELECT id FROM places WHERE substr(folded, 1, ?) = ? LIMIT 2");
|
|
@@ -22954,7 +22956,7 @@ var placeOf = /* @__PURE__ */ __name((database) => {
|
|
|
22954
22956
|
};
|
|
22955
22957
|
}, "placeOf");
|
|
22956
22958
|
|
|
22957
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
22959
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/mention-drain.js
|
|
22958
22960
|
var DRAIN_ON_WRITE = 500;
|
|
22959
22961
|
var METHOD = "rules";
|
|
22960
22962
|
var telegramLink = /* @__PURE__ */ __name((database) => {
|
|
@@ -23120,7 +23122,7 @@ var drainMentions = /* @__PURE__ */ __name((database, now2, limit = DRAIN_ON_WRI
|
|
|
23120
23122
|
return queued.length;
|
|
23121
23123
|
}, "drainMentions");
|
|
23122
23124
|
|
|
23123
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
23125
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/index-state.js
|
|
23124
23126
|
var indexRow = /* @__PURE__ */ __name((database, name) => {
|
|
23125
23127
|
const exists2 = database.prepare("SELECT 1 FROM sqlite_master WHERE name = 'search_index_state'").get();
|
|
23126
23128
|
if (!exists2)
|
|
@@ -23128,7 +23130,7 @@ var indexRow = /* @__PURE__ */ __name((database, name) => {
|
|
|
23128
23130
|
return database.prepare("SELECT * FROM search_index_state WHERE name = ?").get(name);
|
|
23129
23131
|
}, "indexRow");
|
|
23130
23132
|
|
|
23131
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
23133
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/stems.js
|
|
23132
23134
|
var INDEX = "message_stems";
|
|
23133
23135
|
var SETTING2 = "searchStemmers";
|
|
23134
23136
|
var DRAIN_ON_WRITE2 = 500;
|
|
@@ -23254,7 +23256,7 @@ var stemmerCache = /* @__PURE__ */ __name(() => {
|
|
|
23254
23256
|
};
|
|
23255
23257
|
}, "stemmerCache");
|
|
23256
23258
|
|
|
23257
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
23259
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/transaction.js
|
|
23258
23260
|
var rehearsal = new AsyncLocalStorage();
|
|
23259
23261
|
var SQLITE_BUSY = 5;
|
|
23260
23262
|
var pause = new Int32Array(new SharedArrayBuffer(4));
|
|
@@ -23397,7 +23399,7 @@ var read = /* @__PURE__ */ __name((database, body2) => {
|
|
|
23397
23399
|
}
|
|
23398
23400
|
}, "read");
|
|
23399
23401
|
|
|
23400
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
23402
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/folded.js
|
|
23401
23403
|
var FOLDED = [
|
|
23402
23404
|
{ table: "tasks", column: "title" },
|
|
23403
23405
|
{ table: "tasks", column: "close_reason" },
|
|
@@ -23434,7 +23436,7 @@ var fillFolded = /* @__PURE__ */ __name((database, { batch = 2e3 } = {}) => {
|
|
|
23434
23436
|
return filled;
|
|
23435
23437
|
}, "fillFolded");
|
|
23436
23438
|
|
|
23437
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
23439
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/conversations/chunks.js
|
|
23438
23440
|
import { createHash as createHash3 } from "node:crypto";
|
|
23439
23441
|
var CHUNK_CHARS = 1200;
|
|
23440
23442
|
var CHUNK_OVERLAP = 150;
|
|
@@ -23539,7 +23541,7 @@ var cutChunks = /* @__PURE__ */ __name((members2, limit = CHUNK_CHARS, check3, c
|
|
|
23539
23541
|
return chunks2;
|
|
23540
23542
|
}, "cutChunks");
|
|
23541
23543
|
|
|
23542
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
23544
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/search/task-signature.js
|
|
23543
23545
|
var DAY = 864e5;
|
|
23544
23546
|
var CURRENCY = [
|
|
23545
23547
|
[/^(₽|руб.*|р\.?|rub)$/u, "RUB"],
|
|
@@ -23665,7 +23667,7 @@ var dueDayOf = /* @__PURE__ */ __name((text8, createdMs) => {
|
|
|
23665
23667
|
return best?.day ?? null;
|
|
23666
23668
|
}, "dueDayOf");
|
|
23667
23669
|
|
|
23668
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
23670
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/search/task-similarity.js
|
|
23669
23671
|
var DAY2 = 864e5;
|
|
23670
23672
|
var STOP_WORDS = new Set([
|
|
23671
23673
|
// Russian and English as the test set ran them, already folded (пожалуйста → пожалуиста).
|
|
@@ -23820,7 +23822,7 @@ var rankCandidates = /* @__PURE__ */ __name((views, candidates) => candidates.ma
|
|
|
23820
23822
|
...compareViews(subjectViews ?? views, candidate, replyChain === void 0 ? {} : { replyChain })
|
|
23821
23823
|
})).sort((a, b) => b.score - a.score), "rankCandidates");
|
|
23822
23824
|
|
|
23823
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
23825
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/vector-index.js
|
|
23824
23826
|
var source = /* @__PURE__ */ __name((model, dims) => `SELECT k.id, k.chunkable_type,
|
|
23825
23827
|
coalesce(CASE k.chunkable_type
|
|
23826
23828
|
WHEN 'image' THEN (SELECT ch.account_id FROM attachments a JOIN messages m ON m.id = a.attachable_id
|
|
@@ -23962,7 +23964,7 @@ var dropUnusedVectors = /* @__PURE__ */ __name((database, hashes) => {
|
|
|
23962
23964
|
}, "dropUnusedVectors");
|
|
23963
23965
|
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");
|
|
23964
23966
|
|
|
23965
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
23967
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/vectors.js
|
|
23966
23968
|
var currentChunks = /* @__PURE__ */ __name((chatKey) => sql`SELECT k.content_hash, k.chunkable_id AS conversation_id, r.first_message_id,
|
|
23967
23969
|
r.last_message_id, r.text_start, r.text_end FROM conversations c
|
|
23968
23970
|
CROSS JOIN chunks k ON k.chunkable_type = 'conversation' AND k.chunkable_id = c.id
|
|
@@ -24000,14 +24002,18 @@ var chunkFreshness = /* @__PURE__ */ __name(({ orm }, { conversationPk, firstMes
|
|
|
24000
24002
|
}, "chunkFreshness");
|
|
24001
24003
|
var purgeVectorHashes = /* @__PURE__ */ __name((context, hashes) => {
|
|
24002
24004
|
const { orm } = context;
|
|
24003
|
-
|
|
24005
|
+
const unique2 = new Set(hashes);
|
|
24006
|
+
if (unique2.size === 0)
|
|
24007
|
+
return;
|
|
24008
|
+
const models = orm.all(sql`SELECT DISTINCT model FROM embeddings`).map(({ model }) => model);
|
|
24009
|
+
for (const hash2 of unique2) {
|
|
24004
24010
|
let offset = 0;
|
|
24005
24011
|
let valid = false;
|
|
24006
24012
|
for (; ; ) {
|
|
24007
24013
|
const candidates = orm.all(sql`SELECT k.chunkable_id AS conversation, r.first_message_id AS first,
|
|
24008
24014
|
r.last_message_id AS last, r.text_start AS start, r.text_end AS end
|
|
24009
24015
|
FROM chunks k JOIN chunk_messages r ON r.chunk_id = k.id
|
|
24010
|
-
JOIN conversations c ON k.chunkable_type = 'conversation' AND c.id = k.chunkable_id
|
|
24016
|
+
JOIN conversations c ON +k.chunkable_type = 'conversation' AND c.id = k.chunkable_id
|
|
24011
24017
|
JOIN conversation_state s ON s.chat_id = c.chat_id AND s.current_build = c.build
|
|
24012
24018
|
WHERE k.content_hash = ${hash2} ORDER BY k.chunkable_id, k.position LIMIT 100 OFFSET ${offset}`);
|
|
24013
24019
|
valid = candidates.some(({ conversation: conversation2, first, last, start, end }) => {
|
|
@@ -24023,8 +24029,9 @@ var purgeVectorHashes = /* @__PURE__ */ __name((context, hashes) => {
|
|
|
24023
24029
|
}
|
|
24024
24030
|
}
|
|
24025
24031
|
if (!valid)
|
|
24026
|
-
|
|
24027
|
-
|
|
24032
|
+
for (const model of models)
|
|
24033
|
+
orm.run(sql`DELETE FROM embeddings WHERE model = ${model} AND content_hash = ${hash2}
|
|
24034
|
+
AND NOT EXISTS (SELECT 1 FROM chunks WHERE content_hash = ${hash2} AND chunkable_type <> 'conversation')`);
|
|
24028
24035
|
}
|
|
24029
24036
|
}, "purgeVectorHashes");
|
|
24030
24037
|
var purgeVectorsOf = /* @__PURE__ */ __name((context, messagePk) => {
|
|
@@ -24094,7 +24101,7 @@ var dot = /* @__PURE__ */ __name((query, blob2) => {
|
|
|
24094
24101
|
}, "dot");
|
|
24095
24102
|
var nearestChunks = /* @__PURE__ */ __name((context, accountPk2, filter) => {
|
|
24096
24103
|
const { orm } = context;
|
|
24097
|
-
const { chatKey, model, since, limit, query, exclude, conversations: conversations2, scope: scope3, projectId: projectId2, before: before2, personId } = filter;
|
|
24104
|
+
const { chatKey, model, since, limit, query, exclude, conversations: conversations2, scope: scope3, projectId: projectId2, before: before2, personId, fromOwner } = filter;
|
|
24098
24105
|
const rows = /* @__PURE__ */ __name((page3) => orm.all(
|
|
24099
24106
|
// CROSS JOIN keeps the chunks first, so each page walks their key; led by the vectors, SQLite re-read and
|
|
24100
24107
|
// sorted every one of them per page — 1.3 s against 140 ms at 42k chunks (bench/embeddings/README.md).
|
|
@@ -24110,6 +24117,7 @@ var nearestChunks = /* @__PURE__ */ __name((context, accountPk2, filter) => {
|
|
|
24110
24117
|
${projectId2 === void 0 ? sql`` : sql`AND k.project_id=${projectId2}`}
|
|
24111
24118
|
${before2 === void 0 ? sql`` : sql`AND k.occurred_at < ${before2}`}
|
|
24112
24119
|
${personId === void 0 ? sql`` : sql`AND EXISTS (SELECT 1 FROM conversation_messages pcm JOIN messages pm ON pm.id=pcm.message_id JOIN identity_links pil ON pil.identity_id=pm.sender_identity_id WHERE pcm.conversation_id=c.id AND pil.person_id=${personId})`}
|
|
24120
|
+
${fromOwner ? sql`AND EXISTS (SELECT 1 FROM conversation_messages om JOIN messages m ON m.id = om.message_id WHERE om.conversation_id = c.id AND m.outgoing = 1 AND m.id BETWEEN r.first_message_id AND r.last_message_id)` : sql``}
|
|
24113
24121
|
${chatKey === void 0 ? sql`AND ch.searchable = 1` : sql`AND c.chat_id = ${chatKey}`}
|
|
24114
24122
|
${since === void 0 ? sql`` : sql`AND k.occurred_at >= ${since}`}
|
|
24115
24123
|
${exclude === void 0 ? sql`` : sql`AND c.id <> ${exclude}`}
|
|
@@ -24136,7 +24144,7 @@ var nearestChunks = /* @__PURE__ */ __name((context, accountPk2, filter) => {
|
|
|
24136
24144
|
}, "keepBest");
|
|
24137
24145
|
const ranked = /* @__PURE__ */ __name((found2) => found2.sort((a, b) => b.score - a.score).slice(0, limit), "ranked");
|
|
24138
24146
|
const plain2 = /* @__PURE__ */ __name((found2) => found2.map(({ id: _, ...chunk }) => chunk), "plain");
|
|
24139
|
-
const indexable = personId === void 0 && projectId2 === void 0 && scope3 === void 0 && conversations2 === void 0;
|
|
24147
|
+
const indexable = personId === void 0 && projectId2 === void 0 && scope3 === void 0 && conversations2 === void 0 && !fromOwner;
|
|
24140
24148
|
const indexed = indexable && searchIndex(context.database, model, {
|
|
24141
24149
|
kind: "conversation",
|
|
24142
24150
|
account: accountPk2,
|
|
@@ -24154,6 +24162,21 @@ var nearestChunks = /* @__PURE__ */ __name((context, accountPk2, filter) => {
|
|
|
24154
24162
|
});
|
|
24155
24163
|
if (indexed)
|
|
24156
24164
|
return plain2(indexed);
|
|
24165
|
+
if (fromOwner) {
|
|
24166
|
+
const ids3 = orm.all(sql`SELECT DISTINCT k.id FROM messages m
|
|
24167
|
+
JOIN conversation_messages om ON om.message_id = m.id
|
|
24168
|
+
JOIN conversations c ON c.id = om.conversation_id
|
|
24169
|
+
JOIN conversation_state s ON s.chat_id = c.chat_id AND s.current_build = c.build
|
|
24170
|
+
JOIN chats ch ON ch.id = c.chat_id
|
|
24171
|
+
JOIN chunks k ON k.chunkable_type = 'conversation' AND k.chunkable_id = c.id
|
|
24172
|
+
JOIN chunk_messages r ON r.chunk_id = k.id AND m.id BETWEEN r.first_message_id AND r.last_message_id
|
|
24173
|
+
WHERE m.outgoing = 1 AND ch.account_id = ${accountPk2}
|
|
24174
|
+
${chatKey === void 0 ? sql`AND ch.searchable = 1` : sql`AND c.chat_id = ${chatKey}`}`).map(({ id: id2 }) => id2);
|
|
24175
|
+
const best2 = /* @__PURE__ */ new Map();
|
|
24176
|
+
for (const row2 of rows({ ids: ids3 }))
|
|
24177
|
+
keepBest(best2, row2);
|
|
24178
|
+
return plain2(ranked([...best2.values()]));
|
|
24179
|
+
}
|
|
24157
24180
|
const best = /* @__PURE__ */ new Map();
|
|
24158
24181
|
let after2 = { conversation: 0, ordinal: -1 };
|
|
24159
24182
|
for (; ; ) {
|
|
@@ -24286,7 +24309,7 @@ var vectorCounts = /* @__PURE__ */ __name(({ orm }, models) => new Map(models.ma
|
|
|
24286
24309
|
Number(orm.get(sql`SELECT count(*) AS n FROM embeddings WHERE model = ${model}`)?.n ?? 0)
|
|
24287
24310
|
])), "vectorCounts");
|
|
24288
24311
|
|
|
24289
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
24312
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/document-pictures.js
|
|
24290
24313
|
var DOCUMENT_PICTURE = "document_picture";
|
|
24291
24314
|
var SCAN_PAGE2 = 5e3;
|
|
24292
24315
|
var idOf = /* @__PURE__ */ __name((ref3) => {
|
|
@@ -24349,12 +24372,12 @@ var documentPicturesOver = /* @__PURE__ */ __name(({ database, now: now2 }) => (
|
|
|
24349
24372
|
}, "nearestPictures")
|
|
24350
24373
|
}), "documentPicturesOver");
|
|
24351
24374
|
|
|
24352
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
24375
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/index-text.js
|
|
24353
24376
|
var noteIndexText = /* @__PURE__ */ __name((title2, text8) => title2 ? `${title2}
|
|
24354
24377
|
|
|
24355
24378
|
${text8}` : text8, "noteIndexText");
|
|
24356
24379
|
|
|
24357
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
24380
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/enrichments.js
|
|
24358
24381
|
var ENRICHMENT_SUBJECTS = ["document", "note", "email"];
|
|
24359
24382
|
var ENRICHMENT_POSITION = 1e6;
|
|
24360
24383
|
var EMAIL_ENRICHMENT = "email_enrichment";
|
|
@@ -24448,7 +24471,7 @@ var enrichmentsOver = /* @__PURE__ */ __name(({ database, now: now2 }) => ({
|
|
|
24448
24471
|
}), "clear")
|
|
24449
24472
|
}), "enrichmentsOver");
|
|
24450
24473
|
|
|
24451
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
24474
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/query-filter.js
|
|
24452
24475
|
var glob = /* @__PURE__ */ __name((value) => [...fold(value).matchAll(/\\(.)|([*?])|(.)/gsu)].map(([, escaped2, wildcard, plain2]) => {
|
|
24453
24476
|
const literal4 = escaped2 ?? plain2 ?? "";
|
|
24454
24477
|
return wildcard ?? (/[*?[]/u.test(literal4) ? `[${literal4}]` : literal4);
|
|
@@ -24524,7 +24547,7 @@ var compile = /* @__PURE__ */ __name((node, columns2, options) => {
|
|
|
24524
24547
|
var queryFilter = /* @__PURE__ */ __name((ast, columns2, options) => compile(ast.root, columns2, options), "queryFilter");
|
|
24525
24548
|
var bound2 = /* @__PURE__ */ __name(({ sql: text8, params }) => sql.join(text8.split("?").map((part2, at2) => at2 < params.length ? sql`${sql.raw(part2)}${params[at2]}` : sql.raw(part2)), sql``), "bound");
|
|
24526
24549
|
|
|
24527
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
24550
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/events.js
|
|
24528
24551
|
var toJson = /* @__PURE__ */ __name((value) => value === null || value === void 0 ? null : JSON.stringify(value), "toJson");
|
|
24529
24552
|
var fromJson = /* @__PURE__ */ __name((value) => value === null || value === void 0 ? null : JSON.parse(String(value)), "fromJson");
|
|
24530
24553
|
var int = /* @__PURE__ */ __name((value) => value === null || value === void 0 ? null : Number(value), "int");
|
|
@@ -24614,7 +24637,7 @@ var linkMeeting = /* @__PURE__ */ __name((database, id2, eventId, now2, mode = "
|
|
|
24614
24637
|
});
|
|
24615
24638
|
}, "linkMeeting");
|
|
24616
24639
|
|
|
24617
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
24640
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/task-titles.js
|
|
24618
24641
|
var MAX_TITLE = 120;
|
|
24619
24642
|
var placeholderTitleOf = /* @__PURE__ */ __name((row2) => `${String(row2.type)} \u2014 ${String(row2.source_locator ?? "")}`, "placeholderTitleOf");
|
|
24620
24643
|
var PLACEHOLDER_TITLE_SQL = "title = type || ' \u2014 ' || coalesce(source_locator, '')";
|
|
@@ -24676,7 +24699,7 @@ var fillFoundTaskTitles = /* @__PURE__ */ __name((database, warn, { batch = 500
|
|
|
24676
24699
|
}
|
|
24677
24700
|
}, "fillFoundTaskTitles");
|
|
24678
24701
|
|
|
24679
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
24702
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/note-index.js
|
|
24680
24703
|
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), ''))";
|
|
24681
24704
|
var UNSEARCHED_EVENT_TYPES = [
|
|
24682
24705
|
"working-location",
|
|
@@ -24923,7 +24946,7 @@ var resetNoteIndex = /* @__PURE__ */ __name((database) => {
|
|
|
24923
24946
|
return true;
|
|
24924
24947
|
}, "resetNoteIndex");
|
|
24925
24948
|
|
|
24926
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
24949
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/person-resolution.js
|
|
24927
24950
|
var keyOf2 = /* @__PURE__ */ __name((name) => fold(name).trim().replace(/^@/, ""), "keyOf");
|
|
24928
24951
|
var resolvePersonLinks = /* @__PURE__ */ __name((database, names) => {
|
|
24929
24952
|
for (const key2 of new Set(names.filter((name) => !!name?.trim()).map(keyOf2))) {
|
|
@@ -24942,7 +24965,7 @@ var resolvePersonLinks = /* @__PURE__ */ __name((database, names) => {
|
|
|
24942
24965
|
}
|
|
24943
24966
|
}, "resolvePersonLinks");
|
|
24944
24967
|
|
|
24945
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
24968
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/schema/canonical-tags.js
|
|
24946
24969
|
var canonicalTags = sqliteTable("canonical_tags", {
|
|
24947
24970
|
id: integer("id").primaryKey(),
|
|
24948
24971
|
name: text("name").notNull().unique(),
|
|
@@ -24951,7 +24974,7 @@ var canonicalTags = sqliteTable("canonical_tags", {
|
|
|
24951
24974
|
updatedAt: integer("updated_at").notNull()
|
|
24952
24975
|
});
|
|
24953
24976
|
|
|
24954
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
24977
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/schema/link-revisions.js
|
|
24955
24978
|
var linkRevisions = sqliteTable("link_revisions", {
|
|
24956
24979
|
id: integer("id").primaryKey(),
|
|
24957
24980
|
linkId: integer("link_id").notNull(),
|
|
@@ -24963,7 +24986,7 @@ var linkRevisions = sqliteTable("link_revisions", {
|
|
|
24963
24986
|
createdAt: integer("created_at").notNull()
|
|
24964
24987
|
}, (table) => [index("link_revisions_by_link_id_created_at").on(table.linkId, table.createdAt)]);
|
|
24965
24988
|
|
|
24966
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
24989
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/schema/document-transfers.js
|
|
24967
24990
|
var documentAnnotationTransfers = sqliteTable("document_annotation_transfers", {
|
|
24968
24991
|
sourceKey: text("source_key").notNull(),
|
|
24969
24992
|
collection: text("collection").notNull(),
|
|
@@ -24973,13 +24996,13 @@ var documentAnnotationTransfers = sqliteTable("document_annotation_transfers", {
|
|
|
24973
24996
|
createdAt: integer("created_at").notNull()
|
|
24974
24997
|
}, (table) => [primaryKey({ columns: [table.sourceKey, table.collection] })]);
|
|
24975
24998
|
|
|
24976
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
24999
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/schema/document-index-pending.js
|
|
24977
25000
|
var documentIndexPending = sqliteTable("document_index_pending", {
|
|
24978
25001
|
id: integer("id").notNull(),
|
|
24979
25002
|
indexableType: text("indexable_type").notNull()
|
|
24980
25003
|
}, (table) => [primaryKey({ columns: [table.indexableType, table.id] })]);
|
|
24981
25004
|
|
|
24982
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
25005
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/schema/decision-requests.js
|
|
24983
25006
|
var decisionRequests = sqliteTable("decision_requests", {
|
|
24984
25007
|
id: integer("id").primaryKey(),
|
|
24985
25008
|
tokenDigest: text("token_digest").notNull().unique(),
|
|
@@ -24999,7 +25022,7 @@ var decisionRequests = sqliteTable("decision_requests", {
|
|
|
24999
25022
|
index("decision_requests_by_channel_bot_profile_chat_id_message_id").on(table.channel, table.botProfile, table.chatId, table.messageId)
|
|
25000
25023
|
]);
|
|
25001
25024
|
|
|
25002
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
25025
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/schema/enrichments.js
|
|
25003
25026
|
var enrichments = sqliteTable("enrichments", {
|
|
25004
25027
|
subjectType: text("subject_type").notNull(),
|
|
25005
25028
|
subjectId: integer("subject_id").notNull(),
|
|
@@ -25011,7 +25034,7 @@ var enrichments = sqliteTable("enrichments", {
|
|
|
25011
25034
|
createdAt: integer("created_at").notNull()
|
|
25012
25035
|
}, (table) => [primaryKey({ columns: [table.subjectType, table.subjectId] })]);
|
|
25013
25036
|
|
|
25014
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
25037
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/schema/templates.js
|
|
25015
25038
|
var templates = sqliteTable("templates", {
|
|
25016
25039
|
key: text("key").notNull(),
|
|
25017
25040
|
channel: text("channel").notNull(),
|
|
@@ -25033,7 +25056,7 @@ var templatesHistory = sqliteTable("templates_history", {
|
|
|
25033
25056
|
index("templates_history_by_key_channel_language_id").on(table.key, table.channel, table.language, table.id)
|
|
25034
25057
|
]);
|
|
25035
25058
|
|
|
25036
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
25059
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/schema/links.js
|
|
25037
25060
|
var links = sqliteTable("links", {
|
|
25038
25061
|
id: integer("id").primaryKey(),
|
|
25039
25062
|
fromType: text("from_type").notNull(),
|
|
@@ -25064,7 +25087,7 @@ var links = sqliteTable("links", {
|
|
|
25064
25087
|
index("links_by_to_type_to_id").on(table.toType, table.toId)
|
|
25065
25088
|
]);
|
|
25066
25089
|
|
|
25067
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
25090
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/schema/tag-consolidations.js
|
|
25068
25091
|
var tagRedirects = sqliteTable("tag_redirects", {
|
|
25069
25092
|
sourceId: integer("source_id").primaryKey().references(() => canonicalTags.id),
|
|
25070
25093
|
survivorId: integer("survivor_id").notNull().references(() => canonicalTags.id),
|
|
@@ -25090,7 +25113,7 @@ var tagConsolidations = sqliteTable("tag_consolidations", {
|
|
|
25090
25113
|
index("tag_consolidations_by_actor_type_actor_id").on(table.actorType, table.actorId)
|
|
25091
25114
|
]);
|
|
25092
25115
|
|
|
25093
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
25116
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/schema.js
|
|
25094
25117
|
var accounts = sqliteTable("accounts", {
|
|
25095
25118
|
id: integer("id").primaryKey(),
|
|
25096
25119
|
provider: text("provider").notNull(),
|
|
@@ -27167,13 +27190,97 @@ var trackerItems = sqliteTable("tracker_items", {
|
|
|
27167
27190
|
unique().on(table.accountId, table.kind, table.externalId),
|
|
27168
27191
|
index("tracker_items_by_account_id_kind_parent_id").on(table.accountId, table.kind, table.parentId)
|
|
27169
27192
|
]);
|
|
27193
|
+
var contentChannels = sqliteTable("content_channels", {
|
|
27194
|
+
id: integer("id").primaryKey(),
|
|
27195
|
+
accountId: integer("account_id").notNull().references(() => accounts.id),
|
|
27196
|
+
externalId: text("external_id").notNull(),
|
|
27197
|
+
kind: text("kind").notNull(),
|
|
27198
|
+
network: text("network").notNull(),
|
|
27199
|
+
name: text("name").notNull(),
|
|
27200
|
+
url: text("url"),
|
|
27201
|
+
handle: text("handle"),
|
|
27202
|
+
deletedAt: integer("deleted_at"),
|
|
27203
|
+
syncedAt: integer("synced_at").notNull()
|
|
27204
|
+
}, (table) => [unique().on(table.accountId, table.externalId)]);
|
|
27205
|
+
var contentAuthors = sqliteTable("content_authors", {
|
|
27206
|
+
id: integer("id").primaryKey(),
|
|
27207
|
+
accountId: integer("account_id").notNull().references(() => accounts.id),
|
|
27208
|
+
externalId: text("external_id").notNull(),
|
|
27209
|
+
name: text("name").notNull(),
|
|
27210
|
+
email: text("email"),
|
|
27211
|
+
data: text("data").notNull(),
|
|
27212
|
+
sourceUpdatedAt: integer("source_updated_at"),
|
|
27213
|
+
deletedAt: integer("deleted_at"),
|
|
27214
|
+
syncedAt: integer("synced_at").notNull()
|
|
27215
|
+
}, (table) => [unique().on(table.accountId, table.externalId)]);
|
|
27216
|
+
var contentTerms = sqliteTable("content_terms", {
|
|
27217
|
+
id: integer("id").primaryKey(),
|
|
27218
|
+
accountId: integer("account_id").notNull().references(() => accounts.id),
|
|
27219
|
+
externalId: text("external_id").notNull(),
|
|
27220
|
+
kind: text("kind").notNull(),
|
|
27221
|
+
name: text("name").notNull(),
|
|
27222
|
+
slug: text("slug"),
|
|
27223
|
+
parentId: text("parent_id"),
|
|
27224
|
+
tagId: integer("tag_id").references(() => canonicalTags.id),
|
|
27225
|
+
data: text("data").notNull(),
|
|
27226
|
+
sourceUpdatedAt: integer("source_updated_at"),
|
|
27227
|
+
deletedAt: integer("deleted_at"),
|
|
27228
|
+
syncedAt: integer("synced_at").notNull()
|
|
27229
|
+
}, (table) => [unique().on(table.accountId, table.externalId), index("content_terms_by_tag_id").on(table.tagId)]);
|
|
27230
|
+
var contentPosts = sqliteTable("content_posts", {
|
|
27231
|
+
id: integer("id").primaryKey(),
|
|
27232
|
+
accountId: integer("account_id").notNull().references(() => accounts.id),
|
|
27233
|
+
externalId: text("external_id").notNull(),
|
|
27234
|
+
channelId: text("channel_id"),
|
|
27235
|
+
type: text("type").notNull(),
|
|
27236
|
+
title: text("title"),
|
|
27237
|
+
titleFolded: text("title_folded").notNull(),
|
|
27238
|
+
body: text("body"),
|
|
27239
|
+
contentHash: text("content_hash").notNull(),
|
|
27240
|
+
status: text("status").notNull(),
|
|
27241
|
+
publishedAt: integer("published_at"),
|
|
27242
|
+
scheduledFor: integer("scheduled_for"),
|
|
27243
|
+
sourceCreatedAt: integer("source_created_at"),
|
|
27244
|
+
sourceUpdatedAt: integer("source_updated_at"),
|
|
27245
|
+
version: text("version"),
|
|
27246
|
+
normalizedText: text("normalized_text").notNull(),
|
|
27247
|
+
data: text("data").notNull(),
|
|
27248
|
+
deletedAt: integer("deleted_at"),
|
|
27249
|
+
syncedAt: integer("synced_at").notNull()
|
|
27250
|
+
}, (table) => [
|
|
27251
|
+
unique().on(table.accountId, table.externalId),
|
|
27252
|
+
index("content_posts_by_account_id_status").on(table.accountId, table.status),
|
|
27253
|
+
index("content_posts_by_account_id_published_at").on(table.accountId, table.publishedAt)
|
|
27254
|
+
]);
|
|
27255
|
+
var contentPostRevisions = sqliteTable("content_post_revisions", {
|
|
27256
|
+
id: integer("id").primaryKey(),
|
|
27257
|
+
postId: integer("post_id").notNull().references(() => contentPosts.id),
|
|
27258
|
+
title: text("title"),
|
|
27259
|
+
body: text("body"),
|
|
27260
|
+
status: text("status").notNull(),
|
|
27261
|
+
contentHash: text("content_hash").notNull(),
|
|
27262
|
+
version: text("version"),
|
|
27263
|
+
reason: text("reason").notNull(),
|
|
27264
|
+
createdAt: integer("created_at").notNull()
|
|
27265
|
+
}, (table) => [index("content_post_revisions_by_post_id_created_at").on(table.postId, table.createdAt)]);
|
|
27266
|
+
var contentMetrics = sqliteTable("content_metrics", {
|
|
27267
|
+
id: integer("id").primaryKey(),
|
|
27268
|
+
postId: integer("post_id").notNull().references(() => contentPosts.id),
|
|
27269
|
+
at: integer("at").notNull(),
|
|
27270
|
+
views: integer("views"),
|
|
27271
|
+
reactions: integer("reactions"),
|
|
27272
|
+
comments: integer("comments"),
|
|
27273
|
+
shares: integer("shares"),
|
|
27274
|
+
clicks: integer("clicks"),
|
|
27275
|
+
raw: text("raw")
|
|
27276
|
+
}, (table) => [index("content_metrics_by_post_id_at").on(table.postId, table.at)]);
|
|
27170
27277
|
var storeSettings = sqliteTable("store_settings", {
|
|
27171
27278
|
key: text("key").primaryKey(),
|
|
27172
27279
|
value: text("value").notNull(),
|
|
27173
27280
|
at: integer("at").notNull()
|
|
27174
27281
|
});
|
|
27175
27282
|
|
|
27176
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
27283
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/identities.js
|
|
27177
27284
|
var contactsOf = /* @__PURE__ */ __name(({ phones: phones2, emails: emails3 }) => {
|
|
27178
27285
|
if (phones2 === void 0 && emails3 === void 0)
|
|
27179
27286
|
return void 0;
|
|
@@ -27419,7 +27526,7 @@ var meetingIdentityPk = /* @__PURE__ */ __name((context, accountId, identity) =>
|
|
|
27419
27526
|
}, "meetingIdentityPk");
|
|
27420
27527
|
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");
|
|
27421
27528
|
|
|
27422
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
27529
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/person-separation.js
|
|
27423
27530
|
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");
|
|
27424
27531
|
var MOVED_AWAY = `moved.identity_id IN (SELECT value FROM json_each(?))
|
|
27425
27532
|
AND (moved.from_person_id IN (SELECT value FROM json_each(?))
|
|
@@ -27434,7 +27541,7 @@ var apart = /* @__PURE__ */ __name(({ database }, one2, other) => {
|
|
|
27434
27541
|
var separated = /* @__PURE__ */ __name((context, one2, other) => one2 !== other && apart(context, { identities: identitiesOf(context, one2), person: one2 }, { identities: identitiesOf(context, other), person: other }), "separated");
|
|
27435
27542
|
var identitySeparated = /* @__PURE__ */ __name((context, identity, person2) => apart(context, { identities: [identity] }, { identities: identitiesOf(context, person2).filter((pk) => pk !== identity), person: person2 }), "identitySeparated");
|
|
27436
27543
|
|
|
27437
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
27544
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/reads.js
|
|
27438
27545
|
var MESSAGE_FIELDS = {
|
|
27439
27546
|
pk: messages.id,
|
|
27440
27547
|
nativeId: messages.externalId,
|
|
@@ -27614,7 +27721,7 @@ var chatActivity = /* @__PURE__ */ __name(({ database }, accountKey, since, wher
|
|
|
27614
27721
|
storedAt: toIso(Number(database.prepare("SELECT max(created_at) AS at FROM messages WHERE account_id = ?").get(accountKey)?.at) || null)
|
|
27615
27722
|
}), "chatActivity");
|
|
27616
27723
|
|
|
27617
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
27724
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/search.js
|
|
27618
27725
|
var HIT_FIELDS = {
|
|
27619
27726
|
...MESSAGE_FIELDS,
|
|
27620
27727
|
chatTitle: sql`${chats.title}`.as("chat_title"),
|
|
@@ -27715,7 +27822,7 @@ var directReplies = /* @__PURE__ */ __name((context, parents, limit) => {
|
|
|
27715
27822
|
};
|
|
27716
27823
|
}, "directReplies");
|
|
27717
27824
|
|
|
27718
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
27825
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/person-links.js
|
|
27719
27826
|
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");
|
|
27720
27827
|
var required = /* @__PURE__ */ __name((context, ref3) => {
|
|
27721
27828
|
const found2 = identityRow(context, ref3);
|
|
@@ -27928,7 +28035,7 @@ var mentioning = /* @__PURE__ */ __name((context, accountKey, { id: id2, usernam
|
|
|
27928
28035
|
}, "mentioning");
|
|
27929
28036
|
var escaped = /* @__PURE__ */ __name((text8) => text8.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), "escaped");
|
|
27930
28037
|
|
|
27931
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
28038
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/actors.js
|
|
27932
28039
|
var BOT_KINDS = ["agent", "rule", "script", "integration"];
|
|
27933
28040
|
var ownerPerson = /* @__PURE__ */ __name((database) => {
|
|
27934
28041
|
const found2 = database.prepare("SELECT id FROM persons WHERE owner = 1 ORDER BY id LIMIT 1").get();
|
|
@@ -27985,7 +28092,7 @@ var proposedBySql = /* @__PURE__ */ __name((type, id2, by) => {
|
|
|
27985
28092
|
return { sql: bot("pb.name = ?"), params: [by.bot] };
|
|
27986
28093
|
}, "proposedBySql");
|
|
27987
28094
|
|
|
27988
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
28095
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/source-review-marks.js
|
|
27989
28096
|
var TABLES = { memory: "memories", fact: "facts" };
|
|
27990
28097
|
var HOLDING = { memory: ["proposed", "confirmed"], fact: ["proposed", "accepted"] };
|
|
27991
28098
|
var KEPT = 20;
|
|
@@ -28080,7 +28187,7 @@ var scrubSourceReviews = /* @__PURE__ */ __name((database, erased, { refs }) =>
|
|
|
28080
28187
|
return scrubbed;
|
|
28081
28188
|
}, "scrubSourceReviews");
|
|
28082
28189
|
|
|
28083
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
28190
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/evidence-signature.js
|
|
28084
28191
|
var QUOTE_LIMIT = 500;
|
|
28085
28192
|
var GONE = { sig: "gone", rev: null, deleted: true, changedAt: null };
|
|
28086
28193
|
var part = /* @__PURE__ */ __name((value) => value == null ? "" : String(value), "part");
|
|
@@ -28359,11 +28466,11 @@ var deleteDocumentRow = /* @__PURE__ */ __name((database, id2, at2) => {
|
|
|
28359
28466
|
database.prepare("DELETE FROM documents WHERE id = ?").run(id2);
|
|
28360
28467
|
}, "deleteDocumentRow");
|
|
28361
28468
|
|
|
28362
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
28469
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/domain/ref-summaries.js
|
|
28363
28470
|
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");
|
|
28364
28471
|
var oneLine = /* @__PURE__ */ __name((text8) => singleLine(text8.replace(/\s+/g, " ").trim()), "oneLine");
|
|
28365
28472
|
|
|
28366
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
28473
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/ref-accounts.js
|
|
28367
28474
|
var accountKeys = /* @__PURE__ */ __name((database, ids3) => {
|
|
28368
28475
|
const unique2 = [...new Set(ids3)];
|
|
28369
28476
|
if (unique2.length === 0)
|
|
@@ -28452,7 +28559,7 @@ var refEndsOf = /* @__PURE__ */ __name((database, text8) => {
|
|
|
28452
28559
|
}, "refEndsOf");
|
|
28453
28560
|
var refAccountsOf = /* @__PURE__ */ __name((database, text8) => refEndsOf(database, text8)?.flat(), "refAccountsOf");
|
|
28454
28561
|
|
|
28455
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
28562
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/ref-summaries.js
|
|
28456
28563
|
var EXCERPT_CHARS = 280;
|
|
28457
28564
|
var TITLE_CHARS = 120;
|
|
28458
28565
|
var MEMORY_TITLE_CHARS = 80;
|
|
@@ -28876,7 +28983,7 @@ var refsStoreOver = /* @__PURE__ */ __name((context) => ({
|
|
|
28876
28983
|
ends: /* @__PURE__ */ __name(async (text8) => refEndsOf(context.database, text8), "ends")
|
|
28877
28984
|
}), "refsStoreOver");
|
|
28878
28985
|
|
|
28879
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
28986
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/evidence-sources.js
|
|
28880
28987
|
var sourceOf3 = /* @__PURE__ */ __name((read2, ref3) => ({
|
|
28881
28988
|
ref: ref3,
|
|
28882
28989
|
kind: read2.kind,
|
|
@@ -28914,7 +29021,7 @@ var evidenceSourcesOf = /* @__PURE__ */ __name((database, from2) => {
|
|
|
28914
29021
|
});
|
|
28915
29022
|
}, "evidenceSourcesOf");
|
|
28916
29023
|
|
|
28917
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
29024
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/attachments/limits.js
|
|
28918
29025
|
var MAX_FILE_BYTES = 50 * 1024 * 1024;
|
|
28919
29026
|
var MAX_TEXT_CHARS = 2e6;
|
|
28920
29027
|
var ATTACHMENT_LIMIT_ENV = [
|
|
@@ -28940,7 +29047,7 @@ var pdfPreviewLimits = /* @__PURE__ */ __name((env = process.env) => {
|
|
|
28940
29047
|
return { pixels, bytes: positive(env, "MESSAGING_PDF_PREVIEW_MAX_MIB", 8 * 1024 * 1024, 1024 * 1024) };
|
|
28941
29048
|
}, "pdfPreviewLimits");
|
|
28942
29049
|
|
|
28943
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
29050
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/ulid.js
|
|
28944
29051
|
import { randomBytes } from "node:crypto";
|
|
28945
29052
|
var CROCKFORD = "0123456789ABCDEFGHJKMNPQRSTVWXYZ";
|
|
28946
29053
|
var ulid = /* @__PURE__ */ __name((now2 = Date.now()) => {
|
|
@@ -28953,7 +29060,7 @@ var ulid = /* @__PURE__ */ __name((now2 = Date.now()) => {
|
|
|
28953
29060
|
return time3 + random;
|
|
28954
29061
|
}, "ulid");
|
|
28955
29062
|
|
|
28956
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
29063
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/document-metadata.js
|
|
28957
29064
|
var FOLDED_FIELDS = ["title", "site", "language", "author"];
|
|
28958
29065
|
var encodeDocumentMetadata = /* @__PURE__ */ __name((meta, sections) => {
|
|
28959
29066
|
if (!meta && !sections?.length)
|
|
@@ -28974,11 +29081,11 @@ var languageOf = /* @__PURE__ */ __name((meta) => {
|
|
|
28974
29081
|
return typeof language === "string" && language !== "" ? language : null;
|
|
28975
29082
|
}, "languageOf");
|
|
28976
29083
|
|
|
28977
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
29084
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/file-note.js
|
|
28978
29085
|
var LIVE3 = "f.deleted_at IS NULL AND d.deleted_at IS NULL AND coalesce(json_extract(d.metadata, '$.catalog.active'), 1)=1";
|
|
28979
29086
|
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");
|
|
28980
29087
|
|
|
28981
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
29088
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/files.js
|
|
28982
29089
|
var isObject2 = /* @__PURE__ */ __name((value) => value !== null && typeof value === "object" && !Array.isArray(value), "isObject");
|
|
28983
29090
|
var objectOf = /* @__PURE__ */ __name((value) => {
|
|
28984
29091
|
if (isObject2(value))
|
|
@@ -29225,7 +29332,7 @@ var filesStoreOver = /* @__PURE__ */ __name(({ database, now: now2 }) => {
|
|
|
29225
29332
|
};
|
|
29226
29333
|
}, "filesStoreOver");
|
|
29227
29334
|
|
|
29228
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
29335
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/imported-documents.js
|
|
29229
29336
|
var IMPORTED_DOCUMENT_QUERY = defineQuery({
|
|
29230
29337
|
entity: "document",
|
|
29231
29338
|
backend: "sql",
|
|
@@ -29271,7 +29378,7 @@ var importedDocumentWhere = /* @__PURE__ */ __name((database, query) => {
|
|
|
29271
29378
|
return queryFilter(validateQuery(query, IMPORTED_DOCUMENT_QUERY), columns2, { zone: timezoneOf() });
|
|
29272
29379
|
}, "importedDocumentWhere");
|
|
29273
29380
|
|
|
29274
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
29381
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/link-reviews.js
|
|
29275
29382
|
var reviewLink = /* @__PURE__ */ __name((database, linkable, entity, candidates, reason, now2) => {
|
|
29276
29383
|
database.prepare(`INSERT INTO link_reviews (linkable_type, linkable_id, entity_type, candidates, reason, status, created_at, updated_at)
|
|
29277
29384
|
VALUES (?, ?, ?, ?, ?, 'open', ?, ?)
|
|
@@ -29279,7 +29386,7 @@ var reviewLink = /* @__PURE__ */ __name((database, linkable, entity, candidates,
|
|
|
29279
29386
|
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);
|
|
29280
29387
|
}, "reviewLink");
|
|
29281
29388
|
|
|
29282
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
29389
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/link-row.js
|
|
29283
29390
|
var iso3 = /* @__PURE__ */ __name((value) => new Date(Number(value)).toISOString(), "iso");
|
|
29284
29391
|
var thingRef = /* @__PURE__ */ __name((database, type, id2) => type == null || id2 == null ? null : referenceOfThing(database, storedThing(type, id2)) ?? null, "thingRef");
|
|
29285
29392
|
var hasBothEnds = /* @__PURE__ */ __name((link3) => link3.from !== null && link3.to !== null, "hasBothEnds");
|
|
@@ -29313,7 +29420,7 @@ var linkOf = /* @__PURE__ */ __name((database, row2) => {
|
|
|
29313
29420
|
};
|
|
29314
29421
|
}, "linkOf");
|
|
29315
29422
|
|
|
29316
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
29423
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/note-dates.js
|
|
29317
29424
|
var dateFileNotes = /* @__PURE__ */ __name((database, folder, dates) => {
|
|
29318
29425
|
const fileAt = database.prepare("SELECT id, document_id FROM files WHERE account_id = ? AND external_id = ? AND kind <> 'folder' AND deleted_at IS NULL");
|
|
29319
29426
|
const legacy = database.prepare("SELECT id FROM documents WHERE account_id = ? AND external_id = ? AND deleted_at IS NULL");
|
|
@@ -29334,7 +29441,7 @@ var dateFileNotes = /* @__PURE__ */ __name((database, folder, dates) => {
|
|
|
29334
29441
|
return changed;
|
|
29335
29442
|
}, "dateFileNotes");
|
|
29336
29443
|
|
|
29337
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
29444
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/text-input.js
|
|
29338
29445
|
var textOf2 = /* @__PURE__ */ __name((text8, what, max = 1e5, allowEmpty = false) => {
|
|
29339
29446
|
const value = text8.trim();
|
|
29340
29447
|
if (!value && !allowEmpty || value.length > max)
|
|
@@ -29347,7 +29454,7 @@ var oneOf = /* @__PURE__ */ __name((value, allowed, what) => {
|
|
|
29347
29454
|
return value;
|
|
29348
29455
|
}, "oneOf");
|
|
29349
29456
|
|
|
29350
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
29457
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/notes.js
|
|
29351
29458
|
var NOTE_FORMATS = ["obsidian", "markdown"];
|
|
29352
29459
|
var RELATIONSHIPS = RELATION_KINDS.map(linkKind).join(", ");
|
|
29353
29460
|
var iso4 = /* @__PURE__ */ __name((value) => new Date(Number(value)).toISOString(), "iso");
|
|
@@ -29869,10 +29976,10 @@ var notesStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
29869
29976
|
};
|
|
29870
29977
|
}, "notesStoreOver");
|
|
29871
29978
|
|
|
29872
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
29979
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/rows-page.js
|
|
29873
29980
|
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");
|
|
29874
29981
|
|
|
29875
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
29982
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/memories.js
|
|
29876
29983
|
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";
|
|
29877
29984
|
var iso5 = /* @__PURE__ */ __name((value) => new Date(Number(value)).toISOString(), "iso");
|
|
29878
29985
|
var oneOf2 = /* @__PURE__ */ __name((value, allowed, what) => {
|
|
@@ -30137,7 +30244,7 @@ var memoriesStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
30137
30244
|
};
|
|
30138
30245
|
}, "memoriesStoreOver");
|
|
30139
30246
|
|
|
30140
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
30247
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/reviewed.js
|
|
30141
30248
|
var prefixesText = /* @__PURE__ */ __name((types) => `${article(types[0] ?? "")} ${types.map((type) => `${type}:`).join(" or ")}`, "prefixesText");
|
|
30142
30249
|
var refuse = /* @__PURE__ */ __name((message3, reason, code = "validation_error") => {
|
|
30143
30250
|
throw new CliError(code, message3, { reason });
|
|
@@ -30285,7 +30392,7 @@ var reviewedRowsOver = /* @__PURE__ */ __name((context) => {
|
|
|
30285
30392
|
return { partyOf, partyThing, reviewedOf, written, keepEvidence, ownerOnly: ownerOnly2, linkedId, ...decisionsOver(context) };
|
|
30286
30393
|
}, "reviewedRowsOver");
|
|
30287
30394
|
|
|
30288
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
30395
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/money-lines.js
|
|
30289
30396
|
var MAX_LINES = 500;
|
|
30290
30397
|
var PARENTS = {
|
|
30291
30398
|
invoice: {
|
|
@@ -30385,7 +30492,7 @@ var moneyLinesOver = /* @__PURE__ */ __name(({ database }) => {
|
|
|
30385
30492
|
return { linesOf, insertLines, shownLines, appendLine, deleteLine, sumOf, retotal };
|
|
30386
30493
|
}, "moneyLinesOver");
|
|
30387
30494
|
|
|
30388
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
30495
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/refunds.js
|
|
30389
30496
|
var COUNTED = {
|
|
30390
30497
|
confirmed: "np.review = 'confirmed' AND np.deleted_at IS NULL",
|
|
30391
30498
|
// A proposed refund promises nothing back yet, so it must not free room an import could then fill.
|
|
@@ -30460,7 +30567,7 @@ var refundRulesOver = /* @__PURE__ */ __name((context) => {
|
|
|
30460
30567
|
return { originalFor, refundShare, confirmable, keepsRefunded, keepsShare, keepsInvoice };
|
|
30461
30568
|
}, "refundRulesOver");
|
|
30462
30569
|
|
|
30463
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
30570
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/finance.js
|
|
30464
30571
|
var FINANCE_TYPES = ["invoice", "payment"];
|
|
30465
30572
|
var isFinanceType = /* @__PURE__ */ __name((type) => FINANCE_TYPES.includes(type), "isFinanceType");
|
|
30466
30573
|
var PAID = netPaidSql("i.id");
|
|
@@ -30864,7 +30971,7 @@ var financeStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
30864
30971
|
};
|
|
30865
30972
|
}, "financeStoreOver");
|
|
30866
30973
|
|
|
30867
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
30974
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/payment-entries.js
|
|
30868
30975
|
var refuse2 = /* @__PURE__ */ __name((message3, reason) => {
|
|
30869
30976
|
throw new CliError("validation_error", message3, { reason });
|
|
30870
30977
|
}, "refuse");
|
|
@@ -30942,7 +31049,7 @@ var paymentEntriesOver = /* @__PURE__ */ __name((context) => {
|
|
|
30942
31049
|
};
|
|
30943
31050
|
}, "paymentEntriesOver");
|
|
30944
31051
|
|
|
30945
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
31052
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/evidence-findings.js
|
|
30946
31053
|
var EVIDENCE_FINDINGS_KIND = "evidence_findings";
|
|
30947
31054
|
var reference = /* @__PURE__ */ __name((raw) => {
|
|
30948
31055
|
if (/^(document|note):[1-9]\d*$/.test(raw))
|
|
@@ -30969,7 +31076,7 @@ var validateEvidenceFindings = /* @__PURE__ */ __name((input) => {
|
|
|
30969
31076
|
return valid;
|
|
30970
31077
|
}, "validateEvidenceFindings");
|
|
30971
31078
|
|
|
30972
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
31079
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/proposed-actions.js
|
|
30973
31080
|
var PROPOSAL_STATUSES = ["proposed", "approved", "rejected", "executed", "failed"];
|
|
30974
31081
|
var PROPOSAL_VERDICTS = ["useful", "not_useful"];
|
|
30975
31082
|
var iso7 = /* @__PURE__ */ __name((value) => value == null ? null : new Date(Number(value)).toISOString(), "iso");
|
|
@@ -31163,7 +31270,7 @@ var proposedActionsStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
31163
31270
|
};
|
|
31164
31271
|
}, "proposedActionsStoreOver");
|
|
31165
31272
|
|
|
31166
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
31273
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/identity-proposals.js
|
|
31167
31274
|
var CONFIRMED = "proposal";
|
|
31168
31275
|
var refOf = /* @__PURE__ */ __name(({ database }, pk) => {
|
|
31169
31276
|
const row2 = database.prepare("SELECT provider, external_id FROM identities WHERE id = ?").get(pk);
|
|
@@ -31515,7 +31622,7 @@ var identityLinkRows = /* @__PURE__ */ __name((context, { person: person2, statu
|
|
|
31515
31622
|
return { items, hasMore: rows.length > limit };
|
|
31516
31623
|
}, "identityLinkRows");
|
|
31517
31624
|
|
|
31518
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
31625
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/person-merges.js
|
|
31519
31626
|
var mergeId = /* @__PURE__ */ __name((to, from2) => `merge:${to}-${from2}`, "mergeId");
|
|
31520
31627
|
var parseMergeId = /* @__PURE__ */ __name((id2) => {
|
|
31521
31628
|
const found2 = /^merge:([1-9]\d*)-([1-9]\d*)$/.exec(id2.trim());
|
|
@@ -31618,7 +31725,7 @@ var split = /* @__PURE__ */ __name((context, uid, refs, by) => {
|
|
|
31618
31725
|
return recordOf(context, alone);
|
|
31619
31726
|
}, "split");
|
|
31620
31727
|
|
|
31621
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
31728
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/identity-split-proposals.js
|
|
31622
31729
|
var refOf2 = /* @__PURE__ */ __name(({ provider, id: id2 }) => `${provider}:${id2}`, "refOf");
|
|
31623
31730
|
var keyOf3 = /* @__PURE__ */ __name((split2, person2, identities2) => `${split2} ${person2} ${[...identities2].sort().join(" ")}`, "keyOf");
|
|
31624
31731
|
var planOf = /* @__PURE__ */ __name((context, input) => {
|
|
@@ -31795,7 +31902,7 @@ var forgetErasedSplits = /* @__PURE__ */ __name((database) => {
|
|
|
31795
31902
|
database.prepare("DELETE FROM proposed_actions WHERE id = ?").run(Number(row2.id));
|
|
31796
31903
|
}, "forgetErasedSplits");
|
|
31797
31904
|
|
|
31798
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
31905
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/domain/test-data.js
|
|
31799
31906
|
var SEED_PEOPLE = [
|
|
31800
31907
|
{ name: "Owner", username: "owner" },
|
|
31801
31908
|
{ name: "Ann Lee", username: "ann" },
|
|
@@ -31812,7 +31919,7 @@ var RESERVED_ADDRESS_GLOBS = [
|
|
|
31812
31919
|
];
|
|
31813
31920
|
var SEED_ID_GLOBS = ["person-[0-9]*"];
|
|
31814
31921
|
|
|
31815
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
31922
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/test-people.js
|
|
31816
31923
|
var TEST_DATA_KIND = "test_data";
|
|
31817
31924
|
var globs = /* @__PURE__ */ __name((column2, patterns) => patterns.map((pattern) => `${column2} GLOB '${pattern}'`).join(" OR "), "globs");
|
|
31818
31925
|
var SURE = `(${globs("i.external_id", SEED_ID_GLOBS)} OR ${globs("lower(i.email)", RESERVED_ADDRESS_GLOBS)})`;
|
|
@@ -31881,7 +31988,7 @@ var forgetErasedTestData = /* @__PURE__ */ __name((database) => {
|
|
|
31881
31988
|
database.prepare("DELETE FROM proposed_actions WHERE id = ?").run(Number(row2.id));
|
|
31882
31989
|
}, "forgetErasedTestData");
|
|
31883
31990
|
|
|
31884
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
31991
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/accounts.js
|
|
31885
31992
|
var accountPk = /* @__PURE__ */ __name(({ orm, now: now2 }, { provider, account, scope: scope3 }, name = null, startScope) => Number(orm.insert(accounts).values({
|
|
31886
31993
|
provider,
|
|
31887
31994
|
externalId: account,
|
|
@@ -31975,7 +32082,7 @@ var dropOrphanPeople = /* @__PURE__ */ __name((database, unseenBefore) => {
|
|
|
31975
32082
|
AND id NOT IN (SELECT id FROM (${referencesTo(database, "persons", /* @__PURE__ */ new Set(["identity_links"]))}) WHERE id IS NOT NULL)`).run(JSON.stringify(persons2));
|
|
31976
32083
|
}, "dropOrphanPeople");
|
|
31977
32084
|
|
|
31978
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
32085
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/history-skips.js
|
|
31979
32086
|
var HISTORY_KEY = "$history";
|
|
31980
32087
|
var objectOf2 = /* @__PURE__ */ __name((text8) => {
|
|
31981
32088
|
if (typeof text8 !== "string")
|
|
@@ -32051,7 +32158,7 @@ var withoutHistory = /* @__PURE__ */ __name((metadata3) => {
|
|
|
32051
32158
|
return rest;
|
|
32052
32159
|
}, "withoutHistory");
|
|
32053
32160
|
|
|
32054
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
32161
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/chats.js
|
|
32055
32162
|
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");
|
|
32056
32163
|
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");
|
|
32057
32164
|
var setChatScope = /* @__PURE__ */ __name((context, accountKey, chatId, scope3) => {
|
|
@@ -32349,7 +32456,7 @@ var replaceAutoTags = /* @__PURE__ */ __name((context, key2, chatId, algorithm,
|
|
|
32349
32456
|
}
|
|
32350
32457
|
}, "replaceAutoTags");
|
|
32351
32458
|
|
|
32352
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
32459
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/bot-tokens.js
|
|
32353
32460
|
var BOT_TOKEN = /(?<!\d)(\d{6,12}):[A-Za-z0-9_-]{30,40}(?![A-Za-z0-9_-])/g;
|
|
32354
32461
|
var MAY_HOLD = "*[0-9][0-9][0-9][0-9][0-9][0-9]:*";
|
|
32355
32462
|
var MASKED_THROUGH = "bot_tokens_masked_through";
|
|
@@ -32389,7 +32496,7 @@ var maskStoredBotTokens = /* @__PURE__ */ __name((context) => {
|
|
|
32389
32496
|
}, "maskStoredBotTokens");
|
|
32390
32497
|
var masks = /* @__PURE__ */ __name((value) => value != null && withoutBotTokens(String(value)) !== value, "masks");
|
|
32391
32498
|
|
|
32392
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
32499
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/context/evidence.js
|
|
32393
32500
|
import { createHash as createHash4 } from "node:crypto";
|
|
32394
32501
|
var CONTEXT_MAX_READ_BYTES = 262144;
|
|
32395
32502
|
var CONTEXT_SOURCE_KINDS = ["message", "mail", "document", "meeting"];
|
|
@@ -32487,7 +32594,7 @@ var contextEvidenceRequest = /* @__PURE__ */ __name((input) => {
|
|
|
32487
32594
|
return { source: source2, query, chat: chat2, senders, words: words4, after: after2, before: before2, limit, maxReadBytes, cursor, signal: input.signal };
|
|
32488
32595
|
}, "contextEvidenceRequest");
|
|
32489
32596
|
|
|
32490
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
32597
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/email-activity.js
|
|
32491
32598
|
var MAIL_AGENDA_COLUMNS = { chat_kind: { type: "enum", sql: "'dialog'" } };
|
|
32492
32599
|
var ACTIVITY = `
|
|
32493
32600
|
SELECT t.external_id AS thread, t.subject, t.last_email_at, t.emails_count,
|
|
@@ -32617,7 +32724,7 @@ var mailActivity = /* @__PURE__ */ __name((database) => ({
|
|
|
32617
32724
|
threadActivity: /* @__PURE__ */ __name(async (accountId, since, where) => threadActivity(database, accountId, since, where), "threadActivity")
|
|
32618
32725
|
}), "mailActivity");
|
|
32619
32726
|
|
|
32620
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
32727
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/conversations/mail-text.js
|
|
32621
32728
|
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");
|
|
32622
32729
|
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;
|
|
32623
32730
|
var ATTRIBUTION = /(wrote|написал[аи]?|escribió|a écrit|schrieb)\s*:\s*$/iu;
|
|
@@ -32698,7 +32805,7 @@ var mailCore = /* @__PURE__ */ __name((body2, earlier) => {
|
|
|
32698
32805
|
return withoutSignOff(withoutGreeting(kept)).join("\n").trim();
|
|
32699
32806
|
}, "mailCore");
|
|
32700
32807
|
|
|
32701
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
32808
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/email-index.js
|
|
32702
32809
|
var titleOf2 = /* @__PURE__ */ __name((subject2) => subject2?.replace(/^\s*((re|fwd?|aw|wg)\s*:\s*)+/i, "").trim() || null, "titleOf");
|
|
32703
32810
|
var MAIL_PIECES = `(SELECT k.id, k.content_hash, k.chunkable_type AS type, k.chunkable_id AS owner, k.position,
|
|
32704
32811
|
k.start_offset, k.end_offset, k.account_id, k.occurred_at,
|
|
@@ -32811,7 +32918,7 @@ var drainEmailIndex = /* @__PURE__ */ __name((database, stemmerFor2) => {
|
|
|
32811
32918
|
return emails3 + threads;
|
|
32812
32919
|
}, "drainEmailIndex");
|
|
32813
32920
|
|
|
32814
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
32921
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/email-locations.js
|
|
32815
32922
|
var locate = /* @__PURE__ */ __name((database, accountId, emailId, where) => database.prepare(`INSERT OR REPLACE INTO email_locations (mailbox_id, uidvalidity, uid, email_id)
|
|
32816
32923
|
SELECT id, ?, ?, ? FROM mailboxes WHERE account_id = ? AND external_id = ?`).run(where.uidvalidity, where.uid, emailId, accountId, where.folder), "locate");
|
|
32817
32924
|
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,
|
|
@@ -32909,7 +33016,7 @@ var forgetLocations = /* @__PURE__ */ __name((database, accountId, folder, uidva
|
|
|
32909
33016
|
var backfillSentAt = /* @__PURE__ */ __name((database, accountId, limit) => Number(database.prepare(`UPDATE emails SET sent_at = received_at WHERE id IN (
|
|
32910
33017
|
SELECT id FROM emails WHERE account_id = ? AND sent_at IS NULL AND received_at IS NOT NULL LIMIT ?)`).run(accountId, limit).changes), "backfillSentAt");
|
|
32911
33018
|
|
|
32912
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
33019
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/email-state.js
|
|
32913
33020
|
var recountEmailThread = /* @__PURE__ */ __name((database, threadId, now2) => database.prepare(`UPDATE email_threads SET
|
|
32914
33021
|
emails_count = (SELECT count(*) FROM emails WHERE email_thread_id = ? AND deleted_at IS NULL),
|
|
32915
33022
|
last_email_at = (SELECT max(coalesce(sent_at, received_at)) FROM emails
|
|
@@ -32959,7 +33066,7 @@ var markEmailsRestored = /* @__PURE__ */ __name((database, accountId, externalId
|
|
|
32959
33066
|
return threads.length;
|
|
32960
33067
|
}, "markEmailsRestored");
|
|
32961
33068
|
|
|
32962
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
33069
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/mail-nearest.js
|
|
32963
33070
|
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
|
|
32964
33071
|
FROM ${MAIL_PIECES} JOIN embeddings v ON v.model = ? AND v.content_hash = p.content_hash
|
|
32965
33072
|
WHERE p.account_id = ?
|
|
@@ -33019,7 +33126,7 @@ var indexedMailPieces = /* @__PURE__ */ __name((database, model, query, filter,
|
|
|
33019
33126
|
}, "indexedMailPieces");
|
|
33020
33127
|
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");
|
|
33021
33128
|
|
|
33022
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
33129
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/mail-rules.js
|
|
33023
33130
|
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");
|
|
33024
33131
|
var conditionsKey = /* @__PURE__ */ __name((conditions) => JSON.stringify(sorted(conditions)), "conditionsKey");
|
|
33025
33132
|
var ruleOf = /* @__PURE__ */ __name((row2) => ({
|
|
@@ -33086,7 +33193,7 @@ var mailRulesOver = /* @__PURE__ */ __name((database) => ({
|
|
|
33086
33193
|
}
|
|
33087
33194
|
}), "mailRulesOver");
|
|
33088
33195
|
|
|
33089
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
33196
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-operation.js
|
|
33090
33197
|
function checkMeetingCancelled(signal) {
|
|
33091
33198
|
if (!signal?.aborted)
|
|
33092
33199
|
return;
|
|
@@ -33097,7 +33204,7 @@ function checkMeetingCancelled(signal) {
|
|
|
33097
33204
|
}
|
|
33098
33205
|
__name(checkMeetingCancelled, "checkMeetingCancelled");
|
|
33099
33206
|
|
|
33100
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
33207
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-values.js
|
|
33101
33208
|
var managerOf = /* @__PURE__ */ __name((database, meetingId) => {
|
|
33102
33209
|
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);
|
|
33103
33210
|
if (!found2)
|
|
@@ -33162,7 +33269,7 @@ var transcriptRowOf = /* @__PURE__ */ __name((row2) => ({
|
|
|
33162
33269
|
createdAt: Number(row2.created_at)
|
|
33163
33270
|
}), "transcriptRowOf");
|
|
33164
33271
|
|
|
33165
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
33272
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-reads.js
|
|
33166
33273
|
var MEETING_TEXT = ["external_id", "title", "description", "location", "join_url", "timezone", "metadata"];
|
|
33167
33274
|
var TRANSCRIPT_TEXT = ["source", "format", "language", "content_hash", "metadata"];
|
|
33168
33275
|
var ROW_TEXT = ["speaker_name", "text", "normalized_text", "metadata"];
|
|
@@ -33329,7 +33436,7 @@ var meetingReadsOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
|
33329
33436
|
}
|
|
33330
33437
|
}), "meetingReadsOver");
|
|
33331
33438
|
|
|
33332
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
33439
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-selection.js
|
|
33333
33440
|
var meetingSelectionSql = /* @__PURE__ */ __name((input) => {
|
|
33334
33441
|
const clauses = ["m.account_id=?", "m.deleted_at IS NULL"];
|
|
33335
33442
|
const params = [input.accountId];
|
|
@@ -33372,7 +33479,7 @@ var meetingSelectionSql = /* @__PURE__ */ __name((input) => {
|
|
|
33372
33479
|
return { clauses, params };
|
|
33373
33480
|
}, "meetingSelectionSql");
|
|
33374
33481
|
|
|
33375
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
33482
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-calls.js
|
|
33376
33483
|
var MOST_CALLS = 2e5;
|
|
33377
33484
|
var parsed3 = /* @__PURE__ */ __name((value) => {
|
|
33378
33485
|
if (typeof value !== "string")
|
|
@@ -33427,7 +33534,7 @@ var meetingCallsOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
|
33427
33534
|
}
|
|
33428
33535
|
}), "meetingCallsOver");
|
|
33429
33536
|
|
|
33430
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
33537
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-chat-lines.js
|
|
33431
33538
|
var meetingChatLinesOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
33432
33539
|
async meetingChatLines(input) {
|
|
33433
33540
|
checkMeetingCancelled(input.signal);
|
|
@@ -33455,7 +33562,7 @@ var meetingChatLinesOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
|
33455
33562
|
}
|
|
33456
33563
|
}), "meetingChatLinesOver");
|
|
33457
33564
|
|
|
33458
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
33565
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-context-links.js
|
|
33459
33566
|
var missing2 = /* @__PURE__ */ __name(() => {
|
|
33460
33567
|
throw new CliError("not_found", "Meeting, participant or selected target not found");
|
|
33461
33568
|
}, "missing");
|
|
@@ -33578,7 +33685,7 @@ function meetingContextLinksOver(context) {
|
|
|
33578
33685
|
}
|
|
33579
33686
|
__name(meetingContextLinksOver, "meetingContextLinksOver");
|
|
33580
33687
|
|
|
33581
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
33688
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-documents.js
|
|
33582
33689
|
var TRANSCRIPT_ROLE = "transcript";
|
|
33583
33690
|
var roleOf3 = /* @__PURE__ */ __name((value) => MEETING_DOCUMENT_ROLES.find((role) => role === value), "roleOf");
|
|
33584
33691
|
var attach = /* @__PURE__ */ __name((database, meetingId, fileId, role, metadata3, listed, now2) => {
|
|
@@ -33652,7 +33759,7 @@ var meetingTranscriptDocumentsOver = /* @__PURE__ */ __name(({ database }) => {
|
|
|
33652
33759
|
};
|
|
33653
33760
|
}, "meetingTranscriptDocumentsOver");
|
|
33654
33761
|
|
|
33655
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
33762
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-index-values.js
|
|
33656
33763
|
var INDEX_CODES = { meeting_transcript_row: 1, meeting_chat_message: 2, meeting_summary: 3 };
|
|
33657
33764
|
var meetingRowid = /* @__PURE__ */ __name((type, id2) => id2 * 4 + INDEX_CODES[type], "meetingRowid");
|
|
33658
33765
|
var summaryOf2 = /* @__PURE__ */ __name((row2) => ({
|
|
@@ -33681,7 +33788,7 @@ var indexedText = /* @__PURE__ */ __name((database, type, id2) => {
|
|
|
33681
33788
|
return row2 ? summaryText(summaryOf2(row2)) : null;
|
|
33682
33789
|
}, "indexedText");
|
|
33683
33790
|
|
|
33684
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
33791
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-stem-state.js
|
|
33685
33792
|
var summaryBytes = ["title", "overview", "sections", "next_steps", "content"].map((key2) => `coalesce(length(CAST(s.${key2} AS BLOB)),0)`).join("+");
|
|
33686
33793
|
var meetingCurrentIndexRows = `
|
|
33687
33794
|
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
|
|
@@ -33712,7 +33819,7 @@ var invalidateMeetingStems = /* @__PURE__ */ __name((database, type, id2) => {
|
|
|
33712
33819
|
}, "invalidateMeetingStems");
|
|
33713
33820
|
var meetingStemmableText = /* @__PURE__ */ __name((text8) => text8.replace(/[\p{L}\p{N}\p{M}\p{Co}]+/gu, (token) => token.length <= 1024 ? token : ""), "meetingStemmableText");
|
|
33714
33821
|
|
|
33715
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
33822
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-hit-index.js
|
|
33716
33823
|
function meetingHitIndexOver({ database, now: now2 }) {
|
|
33717
33824
|
return {
|
|
33718
33825
|
async indexSearch(original) {
|
|
@@ -33780,10 +33887,10 @@ function meetingHitIndexOver({ database, now: now2 }) {
|
|
|
33780
33887
|
}
|
|
33781
33888
|
__name(meetingHitIndexOver, "meetingHitIndexOver");
|
|
33782
33889
|
|
|
33783
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
33890
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-hit-search.js
|
|
33784
33891
|
import { createHash as createHash5 } from "node:crypto";
|
|
33785
33892
|
|
|
33786
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
33893
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/search/correct.js
|
|
33787
33894
|
var SHORTEST_CORRECTION = 3;
|
|
33788
33895
|
var maxEdits = /* @__PURE__ */ __name((word2) => word2.length <= 4 ? 1 : 2, "maxEdits");
|
|
33789
33896
|
var editDistance = /* @__PURE__ */ __name((a, b, max) => {
|
|
@@ -33830,7 +33937,7 @@ var correctWords = /* @__PURE__ */ __name(async (vocabulary, words4) => {
|
|
|
33830
33937
|
return corrections;
|
|
33831
33938
|
}, "correctWords");
|
|
33832
33939
|
|
|
33833
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
33940
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/search/garbled.js
|
|
33834
33941
|
var SHORTEST_GARBLED = 4;
|
|
33835
33942
|
var MOST_WIDENED = 64;
|
|
33836
33943
|
var plain = /* @__PURE__ */ __name((word2) => word2.replaceAll("\u044D", "\u0435"), "plain");
|
|
@@ -33922,7 +34029,7 @@ var widenWords = /* @__PURE__ */ __name((probes, vocabulary, stem, known2) => {
|
|
|
33922
34029
|
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));
|
|
33923
34030
|
}, "widenWords");
|
|
33924
34031
|
|
|
33925
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34032
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/search/russian-dictionary.js
|
|
33926
34033
|
import { readFileSync } from "node:fs";
|
|
33927
34034
|
var loaded;
|
|
33928
34035
|
var dictionary = /* @__PURE__ */ __name(() => {
|
|
@@ -33981,7 +34088,7 @@ var knownRussianWord = /* @__PURE__ */ __name((word2) => {
|
|
|
33981
34088
|
return false;
|
|
33982
34089
|
}, "knownRussianWord");
|
|
33983
34090
|
|
|
33984
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34091
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-hit-query.js
|
|
33985
34092
|
var WORD2 = /[\p{L}\p{N}\p{M}]+/gu;
|
|
33986
34093
|
var MOST_WORDS = 128;
|
|
33987
34094
|
var quote = /* @__PURE__ */ __name((word2) => `"${word2.replaceAll('"', '""')}"`, "quote");
|
|
@@ -34237,7 +34344,7 @@ var matchedMeetingWords = /* @__PURE__ */ __name((tree, text8, stemmer2) => {
|
|
|
34237
34344
|
return [...found2];
|
|
34238
34345
|
}, "matchedMeetingWords");
|
|
34239
34346
|
|
|
34240
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34347
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-hit-search.js
|
|
34241
34348
|
var fail = /* @__PURE__ */ __name((message3) => {
|
|
34242
34349
|
throw new CliError("validation_error", message3);
|
|
34243
34350
|
}, "fail");
|
|
@@ -34421,7 +34528,7 @@ function meetingHitSearchOver({ database }) {
|
|
|
34421
34528
|
}
|
|
34422
34529
|
__name(meetingHitSearchOver, "meetingHitSearchOver");
|
|
34423
34530
|
|
|
34424
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34531
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-languages.js
|
|
34425
34532
|
var meetingLanguagesOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
34426
34533
|
async fillTranscriptLanguages({ accountId, apply, now: now2 }) {
|
|
34427
34534
|
positiveReadInteger(accountId, "accountId");
|
|
@@ -34453,7 +34560,7 @@ var meetingLanguagesOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
|
34453
34560
|
}
|
|
34454
34561
|
}), "meetingLanguagesOver");
|
|
34455
34562
|
|
|
34456
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34563
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-participant-search.js
|
|
34457
34564
|
import { createHash as createHash6 } from "node:crypto";
|
|
34458
34565
|
var cursorOf2 = /* @__PURE__ */ __name((value, key2) => {
|
|
34459
34566
|
if (value === void 0)
|
|
@@ -34546,7 +34653,7 @@ var meetingParticipantSearchOver = /* @__PURE__ */ __name((context) => ({
|
|
|
34546
34653
|
}
|
|
34547
34654
|
}), "meetingParticipantSearchOver");
|
|
34548
34655
|
|
|
34549
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34656
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/preparation-context-queries.js
|
|
34550
34657
|
var preparationQueries = {
|
|
34551
34658
|
participants: {
|
|
34552
34659
|
fields: "p.id, p.identity_id, p.display_name, l.person_id",
|
|
@@ -34596,7 +34703,7 @@ var preparationQueries = {
|
|
|
34596
34703
|
}
|
|
34597
34704
|
};
|
|
34598
34705
|
|
|
34599
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34706
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-preparation-context.js
|
|
34600
34707
|
var meetingPreparationContextOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
34601
34708
|
async preparationContext(original) {
|
|
34602
34709
|
const input = validateMeetingPreparationContext(original);
|
|
@@ -34637,7 +34744,7 @@ var meetingPreparationContextOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
|
34637
34744
|
}
|
|
34638
34745
|
}), "meetingPreparationContextOver");
|
|
34639
34746
|
|
|
34640
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34747
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/preparation-subjects.js
|
|
34641
34748
|
var preparationSubjects = /* @__PURE__ */ __name((anchors) => `WITH anchors AS (
|
|
34642
34749
|
SELECT m.id FROM meetings m JOIN meeting_series s ON s.id=m.meeting_series_id
|
|
34643
34750
|
WHERE m.id IN (${Array.from({ length: anchors }, () => "?").join(",")}) AND m.account_id=? AND s.account_id=?
|
|
@@ -34651,7 +34758,7 @@ var preparationSubjects = /* @__PURE__ */ __name((anchors) => `WITH anchors AS (
|
|
|
34651
34758
|
JOIN main.projects p ON p.id=l.to_id WHERE p.account_id IS NULL AND p.deleted_at IS NULL
|
|
34652
34759
|
)`, "preparationSubjects");
|
|
34653
34760
|
|
|
34654
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34761
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-preparation-knowledge.js
|
|
34655
34762
|
var meetingPreparationKnowledgeOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
34656
34763
|
async preparationKnowledge(original) {
|
|
34657
34764
|
const { accountId, seriesId, anchorIds, after: after2, before: before2, limit, maxReadBytes, signal } = validateMeetingRelatedHistory(original);
|
|
@@ -34696,7 +34803,7 @@ var meetingPreparationKnowledgeOver = /* @__PURE__ */ __name(({ database }) => (
|
|
|
34696
34803
|
}
|
|
34697
34804
|
}), "meetingPreparationKnowledgeOver");
|
|
34698
34805
|
|
|
34699
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34806
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-preparation-notes.js
|
|
34700
34807
|
var meetingPreparationNotesOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
34701
34808
|
async preparationNotes(original) {
|
|
34702
34809
|
const { accountId, seriesId, anchorIds, after: after2, before: before2, limit, maxReadBytes, signal } = validateMeetingRelatedHistory(original);
|
|
@@ -34749,7 +34856,7 @@ var meetingPreparationNotesOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
|
34749
34856
|
}
|
|
34750
34857
|
}), "meetingPreparationNotesOver");
|
|
34751
34858
|
|
|
34752
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34859
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-related-history.js
|
|
34753
34860
|
var meetingRelatedHistoryOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
34754
34861
|
async relatedHistory(original) {
|
|
34755
34862
|
const input = validateMeetingRelatedHistory(original);
|
|
@@ -34820,7 +34927,7 @@ var meetingRelatedHistoryOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
|
34820
34927
|
}
|
|
34821
34928
|
}), "meetingRelatedHistoryOver");
|
|
34822
34929
|
|
|
34823
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34930
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-review.js
|
|
34824
34931
|
var number2 = /* @__PURE__ */ __name((value) => value === null || value === void 0 ? null : Number(value), "number");
|
|
34825
34932
|
var text3 = /* @__PURE__ */ __name((value) => value === null || value === void 0 ? null : String(value), "text");
|
|
34826
34933
|
var meetingReviewOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
@@ -34901,7 +35008,7 @@ var meetingReviewOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
|
34901
35008
|
}
|
|
34902
35009
|
}), "meetingReviewOver");
|
|
34903
35010
|
|
|
34904
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
35011
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-series-history.js
|
|
34905
35012
|
var bytes2 = "length(CAST(external_id AS BLOB)) + coalesce(length(CAST(title AS BLOB)), 0)";
|
|
34906
35013
|
var ensureBytes2 = /* @__PURE__ */ __name((size2, budget) => {
|
|
34907
35014
|
if (!Number.isSafeInteger(size2) || size2 < 0 || size2 > budget)
|
|
@@ -34955,7 +35062,7 @@ var meetingSeriesHistoryOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
|
34955
35062
|
}
|
|
34956
35063
|
}), "meetingSeriesHistoryOver");
|
|
34957
35064
|
|
|
34958
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
35065
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-stats.js
|
|
34959
35066
|
var MOST_ROWS = 5e5;
|
|
34960
35067
|
var meetingCountsSql = /* @__PURE__ */ __name((where) => `SELECT m.started_at, coalesce(m.duration_ms, m.ended_at - m.started_at) AS duration_ms,
|
|
34961
35068
|
EXISTS (SELECT 1 FROM meeting_transcripts t WHERE t.meeting_id = m.id AND t.deleted_at IS NULL
|
|
@@ -35024,7 +35131,7 @@ var meetingStatsOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
|
35024
35131
|
}
|
|
35025
35132
|
}), "meetingStatsOver");
|
|
35026
35133
|
|
|
35027
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
35134
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/domain/name-variants.js
|
|
35028
35135
|
var CYRILLIC_TO_LATIN = {
|
|
35029
35136
|
\u0430: "a",
|
|
35030
35137
|
\u0431: "b",
|
|
@@ -35246,7 +35353,7 @@ for (const [full, short] of Object.entries(SHORT_FORMS))
|
|
|
35246
35353
|
}
|
|
35247
35354
|
var fullNames = /* @__PURE__ */ __name((skeleton) => [skeleton, ...FULL_NAMES.get(skeleton) ?? []], "fullNames");
|
|
35248
35355
|
|
|
35249
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
35356
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/name-traces.js
|
|
35250
35357
|
var peopleByNameKey = /* @__PURE__ */ __name((database) => {
|
|
35251
35358
|
const found2 = /* @__PURE__ */ new Map();
|
|
35252
35359
|
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()) {
|
|
@@ -35362,7 +35469,7 @@ function* sharedTraces(database, a, b, name, except) {
|
|
|
35362
35469
|
}
|
|
35363
35470
|
__name(sharedTraces, "sharedTraces");
|
|
35364
35471
|
|
|
35365
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
35472
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/person-matcher.js
|
|
35366
35473
|
var spellingsOf = /* @__PURE__ */ __name((value) => [value, value.slice(1)], "spellingsOf");
|
|
35367
35474
|
var PERSON_BY = {
|
|
35368
35475
|
// UNION, not OR: each branch reads its own index.
|
|
@@ -35385,7 +35492,7 @@ var personsByIdentifiers = /* @__PURE__ */ __name((database, ids3) => {
|
|
|
35385
35492
|
return [...found2].sort((a, b) => a - b);
|
|
35386
35493
|
}, "personsByIdentifiers");
|
|
35387
35494
|
|
|
35388
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
35495
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/person-match-scan.js
|
|
35389
35496
|
var BY = "rule";
|
|
35390
35497
|
var RULE = { bot: "rule", kind: "rule" };
|
|
35391
35498
|
var MOST_SHARING = 6;
|
|
@@ -35834,7 +35941,7 @@ var linkPhones = /* @__PURE__ */ __name((context, identities2) => {
|
|
|
35834
35941
|
return pass.result;
|
|
35835
35942
|
}, "linkPhones");
|
|
35836
35943
|
|
|
35837
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
35944
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/meetings.js
|
|
35838
35945
|
var CURSOR_KEY = "meetings";
|
|
35839
35946
|
var seriesOf2 = /* @__PURE__ */ __name((row2) => ({
|
|
35840
35947
|
id: Number(row2.id),
|
|
@@ -36441,7 +36548,7 @@ var meetingStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
36441
36548
|
};
|
|
36442
36549
|
}, "meetingStoreOver");
|
|
36443
36550
|
|
|
36444
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
36551
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/sync.js
|
|
36445
36552
|
var syncStateOf = /* @__PURE__ */ __name(({ orm }, accountKey, name) => {
|
|
36446
36553
|
const row2 = orm.select({ value: syncCursors.value, at: syncCursors.updatedAt }).from(syncCursors).where(and(eq(syncCursors.accountId, accountKey), eq(syncCursors.key, name))).get();
|
|
36447
36554
|
return row2 ? { value: row2.value, at: toIso(row2.at) } : void 0;
|
|
@@ -36467,7 +36574,7 @@ var release = /* @__PURE__ */ __name(({ orm }, chatKey, anchor, holder2) => {
|
|
|
36467
36574
|
orm.delete(fetchLeases).where(and(eq(fetchLeases.chatId, chatKey), eq(fetchLeases.anchor, anchor), eq(fetchLeases.holder, holder2))).run();
|
|
36468
36575
|
}, "release");
|
|
36469
36576
|
|
|
36470
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
36577
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/thread-columns.js
|
|
36471
36578
|
var THREAD_COLUMNS = {
|
|
36472
36579
|
subject: {
|
|
36473
36580
|
where: /* @__PURE__ */ __name(({ value }) => ({
|
|
@@ -36484,7 +36591,7 @@ var threadRows = /* @__PURE__ */ __name((database, filter) => {
|
|
|
36484
36591
|
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);
|
|
36485
36592
|
}, "threadRows");
|
|
36486
36593
|
|
|
36487
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
36594
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/emails.js
|
|
36488
36595
|
var threadConversation = /* @__PURE__ */ __name((place, builtAt) => ({
|
|
36489
36596
|
id: `email:${place.emailId}`,
|
|
36490
36597
|
chatId: place.threadExternalId,
|
|
@@ -37026,7 +37133,7 @@ var mailStoreOver = /* @__PURE__ */ __name(({ database, orm, now: now2 }, stemme
|
|
|
37026
37133
|
}
|
|
37027
37134
|
}), "mailStoreOver");
|
|
37028
37135
|
|
|
37029
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
37136
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/search/dictionary.js
|
|
37030
37137
|
import { readFileSync as readFileSync2 } from "node:fs";
|
|
37031
37138
|
var DICTIONARIES = Object.fromEntries(LANGUAGES.map(({ name, dictionary: dictionary3 }) => [name, dictionary3]));
|
|
37032
37139
|
var folded5 = /* @__PURE__ */ __name((word2) => /^[а-яё'-]*$/.test(word2) ? word2.replaceAll("\u0451", "\u0435").replaceAll("\u0439", "\u0438") : fold(word2), "folded");
|
|
@@ -37116,7 +37223,7 @@ var knownWord = /* @__PURE__ */ __name((languages) => {
|
|
|
37116
37223
|
}, "knownWord");
|
|
37117
37224
|
var dictionaryLanguages = /* @__PURE__ */ __name((stemmers) => [stemmers.cyrillic, ...stemmers.latin.split(",")].filter((name) => Object.hasOwn(DICTIONARIES, name)), "dictionaryLanguages");
|
|
37118
37225
|
|
|
37119
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
37226
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/transcript-query.js
|
|
37120
37227
|
var predicates = /* @__PURE__ */ __name((node) => node.kind === "predicate" ? [node] : node.clauses.flatMap(({ node: node2 }) => predicates(node2)), "predicates");
|
|
37121
37228
|
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");
|
|
37122
37229
|
var LATIN_NUMBERS = new Set(`zero one two three four five six seven eight nine ten eleven twelve twenty thirty forty fifty sixty seventy
|
|
@@ -37202,7 +37309,7 @@ var spokenTranscripts = /* @__PURE__ */ __name((database, item, speaking, keys)
|
|
|
37202
37309
|
return found2;
|
|
37203
37310
|
}, "spokenTranscripts");
|
|
37204
37311
|
|
|
37205
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
37312
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/hit-places.js
|
|
37206
37313
|
var startOf = /* @__PURE__ */ __name((node) => node.operator === "wildcard" && node.implicit ? /^([\p{L}\p{N}]+)\*$/u.exec(normalize(node.value))?.[1] : void 0, "startOf");
|
|
37207
37314
|
var matchOf = /* @__PURE__ */ __name((node) => {
|
|
37208
37315
|
const start = startOf(node);
|
|
@@ -37260,7 +37367,7 @@ var placeHits = /* @__PURE__ */ __name((database, corpus, leaves, transcripts, f
|
|
|
37260
37367
|
});
|
|
37261
37368
|
}, "placeHits");
|
|
37262
37369
|
|
|
37263
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
37370
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/lucene-groups.js
|
|
37264
37371
|
var GROUPS = {
|
|
37265
37372
|
chat: {
|
|
37266
37373
|
key: "m.chat_id",
|
|
@@ -37282,7 +37389,7 @@ var GROUPS = {
|
|
|
37282
37389
|
}
|
|
37283
37390
|
};
|
|
37284
37391
|
|
|
37285
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
37392
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/lucene.js
|
|
37286
37393
|
var MESSAGES = {
|
|
37287
37394
|
rows: "messages",
|
|
37288
37395
|
threads: "chats",
|
|
@@ -37321,7 +37428,7 @@ var matchingPks = /* @__PURE__ */ __name((context, execution, cap) => inTime(()
|
|
|
37321
37428
|
var timeLimited = /* @__PURE__ */ __name((limitMs) => (error) => {
|
|
37322
37429
|
if (error instanceof TimeLimitReached)
|
|
37323
37430
|
outOfTime(limitMs);
|
|
37324
|
-
throw error;
|
|
37431
|
+
throw sqliteLimit(error);
|
|
37325
37432
|
}, "timeLimited");
|
|
37326
37433
|
var inTime = /* @__PURE__ */ __name((work, limitMs) => {
|
|
37327
37434
|
try {
|
|
@@ -37778,7 +37885,7 @@ var runCompiled = /* @__PURE__ */ __name(async (context, execution, by) => {
|
|
|
37778
37885
|
};
|
|
37779
37886
|
}, "runCompiled");
|
|
37780
37887
|
|
|
37781
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
37888
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/counters.js
|
|
37782
37889
|
function invalidMetadata() {
|
|
37783
37890
|
throw new CliError("validation_error", "stored counter metadata is malformed \u2014 check the store before refreshing");
|
|
37784
37891
|
}
|
|
@@ -37880,7 +37987,7 @@ var counterTargets = /* @__PURE__ */ __name((context, execution, options) => wit
|
|
|
37880
37987
|
};
|
|
37881
37988
|
}), "counterTargets");
|
|
37882
37989
|
|
|
37883
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
37990
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/attachment-texts.js
|
|
37884
37991
|
var NOT_FILE_LIST = [...NOT_FILES].map((kind3) => `'${kind3}'`).join(",");
|
|
37885
37992
|
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,
|
|
37886
37993
|
att.size, att.local_path, att.extraction AS origin, att.size AS read_bytes, att.extraction_error AS error, att.content_sha256, att.extractor
|
|
@@ -37999,7 +38106,7 @@ var attachmentViews = /* @__PURE__ */ __name(({ database }, accountKey, { chatKe
|
|
|
37999
38106
|
}));
|
|
38000
38107
|
}, "attachmentViews");
|
|
38001
38108
|
|
|
38002
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
38109
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/transcripts.js
|
|
38003
38110
|
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");
|
|
38004
38111
|
var keepTranscript = /* @__PURE__ */ __name((context, chatKey, messageId, text8, source2) => {
|
|
38005
38112
|
const { orm, database, now: now2 } = context;
|
|
@@ -38037,7 +38144,7 @@ var intoVoiceAttachment = /* @__PURE__ */ __name((context, messagePk) => {
|
|
|
38037
38144
|
keepText(context, Number(row2.id), { text: String(row2.text), origin: "extracted", extractor: `speech:${row2.source}` });
|
|
38038
38145
|
}, "intoVoiceAttachment");
|
|
38039
38146
|
|
|
38040
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
38147
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/messages.js
|
|
38041
38148
|
var FIELDS = [
|
|
38042
38149
|
"threadExternalId",
|
|
38043
38150
|
"senderIdentityId",
|
|
@@ -38361,7 +38468,7 @@ var writeDerivedReactions = /* @__PURE__ */ __name((context, chatKey, messageId)
|
|
|
38361
38468
|
reactionStatementsOf(context.database).total.run(JSON.stringify(derived), chatKey, messageId);
|
|
38362
38469
|
}, "writeDerivedReactions");
|
|
38363
38470
|
|
|
38364
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
38471
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/keys.js
|
|
38365
38472
|
var keysOver = /* @__PURE__ */ __name((context) => {
|
|
38366
38473
|
const findAccountPk2 = /* @__PURE__ */ __name((key2) => findAccountPk(context, key2), "findAccountPk");
|
|
38367
38474
|
const findChatPk2 = /* @__PURE__ */ __name((accountKey, chatId) => findChatPk(context, accountKey, chatId), "findChatPk");
|
|
@@ -38382,7 +38489,16 @@ var keysOver = /* @__PURE__ */ __name((context) => {
|
|
|
38382
38489
|
};
|
|
38383
38490
|
}, "keysOver");
|
|
38384
38491
|
|
|
38385
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
38492
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/account-groups.js
|
|
38493
|
+
var unquoted2 = /* @__PURE__ */ __name((value) => {
|
|
38494
|
+
if (typeof value !== "string")
|
|
38495
|
+
return value;
|
|
38496
|
+
try {
|
|
38497
|
+
return JSON.parse(value);
|
|
38498
|
+
} catch {
|
|
38499
|
+
return value;
|
|
38500
|
+
}
|
|
38501
|
+
}, "unquoted");
|
|
38386
38502
|
var accountGroupsOf = /* @__PURE__ */ __name((database) => {
|
|
38387
38503
|
const row2 = database.prepare("SELECT value FROM store_settings WHERE key = ?").get(ACCOUNT_GROUPS);
|
|
38388
38504
|
if (!row2)
|
|
@@ -38391,7 +38507,7 @@ var accountGroupsOf = /* @__PURE__ */ __name((database) => {
|
|
|
38391
38507
|
const value = JSON.parse(String(row2.value));
|
|
38392
38508
|
if (typeof value !== "object" || value === null || Array.isArray(value))
|
|
38393
38509
|
return {};
|
|
38394
|
-
return Object.fromEntries(Object.entries(value).filter((entry2) => Array.isArray(entry2[1]) && entry2[1].every((member) => typeof member === "string")));
|
|
38510
|
+
return Object.fromEntries(Object.entries(value).map(([name, members2]) => [name, unquoted2(members2)]).filter((entry2) => Array.isArray(entry2[1]) && entry2[1].every((member) => typeof member === "string")));
|
|
38395
38511
|
} catch {
|
|
38396
38512
|
return {};
|
|
38397
38513
|
}
|
|
@@ -38403,7 +38519,9 @@ var profilesOf = /* @__PURE__ */ __name((database) => {
|
|
|
38403
38519
|
return {};
|
|
38404
38520
|
try {
|
|
38405
38521
|
const value = JSON.parse(String(row2.value));
|
|
38406
|
-
|
|
38522
|
+
if (typeof value !== "object" || value === null || Array.isArray(value))
|
|
38523
|
+
return {};
|
|
38524
|
+
return Object.fromEntries(Object.entries(value).map(([app, own]) => [app, unquoted2(own)]));
|
|
38407
38525
|
} catch {
|
|
38408
38526
|
return {};
|
|
38409
38527
|
}
|
|
@@ -38429,7 +38547,7 @@ var forgetProfile = /* @__PURE__ */ __name((database, app, profile, now2) => {
|
|
|
38429
38547
|
database.prepare("INSERT OR REPLACE INTO store_settings (key, value, at) VALUES (?, ?, ?)").run(PROFILES, JSON.stringify(profiles), now2);
|
|
38430
38548
|
}, "forgetProfile");
|
|
38431
38549
|
|
|
38432
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
38550
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/calendar-events.js
|
|
38433
38551
|
var DAY3 = 864e5;
|
|
38434
38552
|
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}')`;
|
|
38435
38553
|
var accountsOf = /* @__PURE__ */ __name((filter) => {
|
|
@@ -38545,7 +38663,7 @@ var listEvents = /* @__PURE__ */ __name((database, filter) => {
|
|
|
38545
38663
|
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);
|
|
38546
38664
|
}, "listEvents");
|
|
38547
38665
|
|
|
38548
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
38666
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/calendar-forget.js
|
|
38549
38667
|
var distinctIds = /* @__PURE__ */ __name((rows) => [...new Set(rows.map((row2) => Number(row2.id)))], "distinctIds");
|
|
38550
38668
|
var forgetCalendarRows = /* @__PURE__ */ __name((database, { calendarId, accountId, cursorKey, now: now2 }, refresh) => {
|
|
38551
38669
|
const unseenBefore = unreferenced(database, "identities");
|
|
@@ -38602,7 +38720,7 @@ var forgetCalendarRows = /* @__PURE__ */ __name((database, { calendarId, account
|
|
|
38602
38720
|
return { entries: entryIds.length, events: goneEvents.length };
|
|
38603
38721
|
}, "forgetCalendarRows");
|
|
38604
38722
|
|
|
38605
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
38723
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/calendar.js
|
|
38606
38724
|
var calendarOf = /* @__PURE__ */ __name((row2) => ({
|
|
38607
38725
|
id: Number(row2.id),
|
|
38608
38726
|
accountId: Number(row2.account_id),
|
|
@@ -39205,7 +39323,7 @@ var eventStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
39205
39323
|
};
|
|
39206
39324
|
}, "eventStoreOver");
|
|
39207
39325
|
|
|
39208
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
39326
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/account-purge.js
|
|
39209
39327
|
var purgeAccount = /* @__PURE__ */ __name((context, accountKey) => {
|
|
39210
39328
|
const { orm, database, now: now2 } = context;
|
|
39211
39329
|
const unseenBefore = unreferenced(database, "identities");
|
|
@@ -39282,6 +39400,13 @@ var purgeAccount = /* @__PURE__ */ __name((context, accountKey) => {
|
|
|
39282
39400
|
orm.run(sql`DELETE FROM crm_fields WHERE account_id = ${accountKey}`);
|
|
39283
39401
|
orm.run(sql`DELETE FROM crm_files WHERE account_id = ${accountKey}`);
|
|
39284
39402
|
orm.run(sql`DELETE FROM tracker_items WHERE account_id = ${accountKey}`);
|
|
39403
|
+
const postsOf = sql`(SELECT id FROM content_posts WHERE account_id = ${accountKey})`;
|
|
39404
|
+
orm.run(sql`DELETE FROM content_post_revisions WHERE post_id IN ${postsOf}`);
|
|
39405
|
+
orm.run(sql`DELETE FROM content_metrics WHERE post_id IN ${postsOf}`);
|
|
39406
|
+
orm.run(sql`DELETE FROM content_posts WHERE account_id = ${accountKey}`);
|
|
39407
|
+
orm.run(sql`DELETE FROM content_terms WHERE account_id = ${accountKey}`);
|
|
39408
|
+
orm.run(sql`DELETE FROM content_authors WHERE account_id = ${accountKey}`);
|
|
39409
|
+
orm.run(sql`DELETE FROM content_channels WHERE account_id = ${accountKey}`);
|
|
39285
39410
|
const recordsOf = sql`(SELECT id FROM records WHERE account_id = ${accountKey})`;
|
|
39286
39411
|
orm.run(sql`DELETE FROM record_relations WHERE record_id IN ${recordsOf} OR target_id IN ${recordsOf}`);
|
|
39287
39412
|
orm.run(sql`DELETE FROM records WHERE account_id = ${accountKey}`);
|
|
@@ -39322,7 +39447,7 @@ var purgeCrmCopies = /* @__PURE__ */ __name((database, accountKey) => {
|
|
|
39322
39447
|
run("DELETE FROM pipelines WHERE account_id = ?", accountKey);
|
|
39323
39448
|
}, "purgeCrmCopies");
|
|
39324
39449
|
|
|
39325
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
39450
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/own-identities.js
|
|
39326
39451
|
var ACCOUNT_REASON = "an account you connected, under another name: a mailbox or messenger you read may be someone else's";
|
|
39327
39452
|
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");
|
|
39328
39453
|
var ownersName = /* @__PURE__ */ __name((name, owner, alone) => {
|
|
@@ -39381,7 +39506,7 @@ var linkToOwner = /* @__PURE__ */ __name((context, ref3) => {
|
|
|
39381
39506
|
return personOf2(context, ref3);
|
|
39382
39507
|
}, "linkToOwner");
|
|
39383
39508
|
|
|
39384
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
39509
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/providers.js
|
|
39385
39510
|
var PROVIDERS_SETTING = "providers";
|
|
39386
39511
|
var storedProvidersOf = /* @__PURE__ */ __name((database) => {
|
|
39387
39512
|
const row2 = database.prepare("SELECT value FROM store_settings WHERE key = ?").get(PROVIDERS_SETTING);
|
|
@@ -39429,7 +39554,7 @@ var registerProvider = /* @__PURE__ */ __name((database, value, now2) => {
|
|
|
39429
39554
|
});
|
|
39430
39555
|
}, "registerProvider");
|
|
39431
39556
|
|
|
39432
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
39557
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/task-candidates.js
|
|
39433
39558
|
var DAY4 = 864e5;
|
|
39434
39559
|
var RECENTLY_CLOSED_MS = 14 * DAY4;
|
|
39435
39560
|
var TEXT_LIMIT = 20;
|
|
@@ -39627,7 +39752,7 @@ var taskSimilarityOver = /* @__PURE__ */ __name((context) => {
|
|
|
39627
39752
|
};
|
|
39628
39753
|
}, "taskSimilarityOver");
|
|
39629
39754
|
|
|
39630
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
39755
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/task-category-settings.js
|
|
39631
39756
|
var SETTING3 = "taskCategories";
|
|
39632
39757
|
var savedTaskCategories = /* @__PURE__ */ __name((database) => {
|
|
39633
39758
|
const row2 = database.prepare("SELECT value FROM store_settings WHERE key = ?").get(SETTING3);
|
|
@@ -39646,7 +39771,7 @@ var saveTaskCategories = /* @__PURE__ */ __name((database, categories, now2) =>
|
|
|
39646
39771
|
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);
|
|
39647
39772
|
}, "saveTaskCategories");
|
|
39648
39773
|
|
|
39649
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
39774
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/task-close.js
|
|
39650
39775
|
var DEFAULT_AGENT_CLOSE = { allowed: true, min: 0.8 };
|
|
39651
39776
|
var ALLOWED = "taskAgentClose";
|
|
39652
39777
|
var MIN = "taskAgentCloseMin";
|
|
@@ -39702,7 +39827,7 @@ var SUGGESTION_COLUMNS = [
|
|
|
39702
39827
|
];
|
|
39703
39828
|
var CLEAR_SUGGESTION = SUGGESTION_COLUMNS.map((column2) => `${column2} = NULL`).join(", ");
|
|
39704
39829
|
|
|
39705
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
39830
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/task-first-pass.js
|
|
39706
39831
|
var DEFAULT_FIRST_PASS_PER_CHAT = 0;
|
|
39707
39832
|
var KEY = "taskFirstPassPerChat";
|
|
39708
39833
|
var firstPassPerChatOf = /* @__PURE__ */ __name((value, setting = "task_first_pass_per_chat") => {
|
|
@@ -39722,7 +39847,7 @@ var saveFirstPassPerChat = /* @__PURE__ */ __name((database, value, now2) => {
|
|
|
39722
39847
|
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);
|
|
39723
39848
|
}, "saveFirstPassPerChat");
|
|
39724
39849
|
|
|
39725
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
39850
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/domain/external-links.js
|
|
39726
39851
|
var EXTERNAL_SERVICE = /^[a-z][a-z0-9-]{0,31}$/;
|
|
39727
39852
|
var EXTERNAL_ID_CHARS = 200;
|
|
39728
39853
|
var SOURCE_URL_CHARS = 2e3;
|
|
@@ -39749,7 +39874,7 @@ var sourceUrlOf = /* @__PURE__ */ __name((value, reason = "task.source-url") =>
|
|
|
39749
39874
|
return text8;
|
|
39750
39875
|
}, "sourceUrlOf");
|
|
39751
39876
|
|
|
39752
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
39877
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/task-board.js
|
|
39753
39878
|
var TASK_SORTS = ["priority", "due", "created", "updated", "key", "state"];
|
|
39754
39879
|
var field = /* @__PURE__ */ __name((name, type, example, more = {}) => ({
|
|
39755
39880
|
name,
|
|
@@ -40001,7 +40126,7 @@ var withoutField = /* @__PURE__ */ __name((query, name) => {
|
|
|
40001
40126
|
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 ?`;
|
|
40002
40127
|
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");
|
|
40003
40128
|
|
|
40004
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
40129
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/task-comments.js
|
|
40005
40130
|
var authorNamed = /* @__PURE__ */ __name((database, row2) => {
|
|
40006
40131
|
if (row2.author_type == null)
|
|
40007
40132
|
return null;
|
|
@@ -40029,7 +40154,7 @@ var addComment = /* @__PURE__ */ __name((context, task, body2, by) => {
|
|
|
40029
40154
|
return commentsOf(database, task).find((one2) => one2.ref === `note:${made}`);
|
|
40030
40155
|
}, "addComment");
|
|
40031
40156
|
|
|
40032
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
40157
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/task-relations.js
|
|
40033
40158
|
var TASK_RELATION_KINDS = [
|
|
40034
40159
|
"blocked-by",
|
|
40035
40160
|
"follow-up-of",
|
|
@@ -40159,7 +40284,7 @@ var taskRelationsStoreOver = /* @__PURE__ */ __name((context, record3) => {
|
|
|
40159
40284
|
};
|
|
40160
40285
|
}, "taskRelationsStoreOver");
|
|
40161
40286
|
|
|
40162
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
40287
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/work-tasks.js
|
|
40163
40288
|
var TASK_ROLES = ["assignee", "reviewer", "watcher"];
|
|
40164
40289
|
var TASK_EVENT_KINDS = [
|
|
40165
40290
|
"created",
|
|
@@ -40718,7 +40843,7 @@ var workTasksOver = /* @__PURE__ */ __name((context) => {
|
|
|
40718
40843
|
};
|
|
40719
40844
|
}, "workTasksOver");
|
|
40720
40845
|
|
|
40721
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
40846
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/task-close-store.js
|
|
40722
40847
|
var taskCloseOver = /* @__PURE__ */ __name((context) => {
|
|
40723
40848
|
const { database, now: now2 } = context;
|
|
40724
40849
|
const liveRow = /* @__PURE__ */ __name((id2) => {
|
|
@@ -40767,7 +40892,7 @@ var taskCloseOver = /* @__PURE__ */ __name((context) => {
|
|
|
40767
40892
|
};
|
|
40768
40893
|
}, "taskCloseOver");
|
|
40769
40894
|
|
|
40770
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
40895
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/task-pairs.js
|
|
40771
40896
|
var TASK_PAIR_DECISIONS = ["review", "unsure", "merged", "rejected", "unmerged", "attached", "new"];
|
|
40772
40897
|
var taskPairsOver = /* @__PURE__ */ __name((context, similarity) => {
|
|
40773
40898
|
const { database, now: now2 } = context;
|
|
@@ -40986,7 +41111,7 @@ var taskPairsOver = /* @__PURE__ */ __name((context, similarity) => {
|
|
|
40986
41111
|
};
|
|
40987
41112
|
}, "taskPairsOver");
|
|
40988
41113
|
|
|
40989
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
41114
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/task-stats.js
|
|
40990
41115
|
var ACCOUNT_SCOPE = "t.package_id IS NOT NULL AND t.deleted_at IS NULL AND t.project_id = ?";
|
|
40991
41116
|
var TASK_STATS_SQL = {
|
|
40992
41117
|
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"),
|
|
@@ -41025,7 +41150,7 @@ var taskStatsOver = /* @__PURE__ */ __name(({ database }, inbox) => ({
|
|
|
41025
41150
|
}, "statNames")
|
|
41026
41151
|
}), "taskStatsOver");
|
|
41027
41152
|
|
|
41028
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
41153
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/tasks.js
|
|
41029
41154
|
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";
|
|
41030
41155
|
var inboxProject = /* @__PURE__ */ __name(({ database, now: now2 }, account, create) => {
|
|
41031
41156
|
const key2 = inboxKey(account);
|
|
@@ -41241,7 +41366,7 @@ var oneOf4 = /* @__PURE__ */ __name((values, value, column2) => {
|
|
|
41241
41366
|
throw new CliError("configuration_error", `the store holds a task with an unknown ${column2} "${String(value)}"`);
|
|
41242
41367
|
}, "oneOf");
|
|
41243
41368
|
|
|
41244
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
41369
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/accounts.js
|
|
41245
41370
|
var accountAccountsOver = /* @__PURE__ */ __name((context) => {
|
|
41246
41371
|
const { database } = context;
|
|
41247
41372
|
const { accountPk: accountPk2, findAccountPk: findAccountPk2 } = keysOver(context);
|
|
@@ -41311,7 +41436,7 @@ var accountsStoreOver = /* @__PURE__ */ __name((context, keyed) => {
|
|
|
41311
41436
|
};
|
|
41312
41437
|
}, "accountsStoreOver");
|
|
41313
41438
|
|
|
41314
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
41439
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/attachments.js
|
|
41315
41440
|
var refColumn = /* @__PURE__ */ __name((ref3) => ref3 && Object.keys(ref3).length > 0 ? { providerRef: JSON.stringify(ref3) } : {}, "refColumn");
|
|
41316
41441
|
var updatePlaced = /* @__PURE__ */ __name(({ orm }, chatKey, messageId, files2, change) => {
|
|
41317
41442
|
const message3 = orm.select({ pk: messages.id }).from(messages).where(and(eq(messages.chatId, chatKey), eq(messages.externalId, messageId))).get();
|
|
@@ -41335,7 +41460,7 @@ var keepDownloads = /* @__PURE__ */ __name((context, chatKey, messageId, files2)
|
|
|
41335
41460
|
})), "keepDownloads");
|
|
41336
41461
|
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");
|
|
41337
41462
|
|
|
41338
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
41463
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/attachments.js
|
|
41339
41464
|
var accountAttachmentsOver = /* @__PURE__ */ __name((context) => {
|
|
41340
41465
|
const { database } = context;
|
|
41341
41466
|
const { findAccountPk: findAccountPk2, findChatPk: findChatPk2, chatKeyOf } = keysOver(context);
|
|
@@ -41392,7 +41517,7 @@ var attachmentsStoreOver = /* @__PURE__ */ __name((context, keyed) => ({
|
|
|
41392
41517
|
}, "keepAttachmentText")
|
|
41393
41518
|
}), "attachmentsStoreOver");
|
|
41394
41519
|
|
|
41395
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
41520
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/chat-rekey.js
|
|
41396
41521
|
var chatRow = /* @__PURE__ */ __name((context, accountKey, chatId) => context.database.prepare("SELECT * FROM chats WHERE account_id = ? AND external_id = ?").get(accountKey, chatId), "chatRow");
|
|
41397
41522
|
var pointerMover = /* @__PURE__ */ __name((context, type) => {
|
|
41398
41523
|
const statements = pointerPairs(context.database).filter(({ table }) => table !== "involvements").map(({ table, pointer }) => {
|
|
@@ -41577,7 +41702,7 @@ var rekeyChats = /* @__PURE__ */ __name((context, key2, accountKey, pairs, lockM
|
|
|
41577
41702
|
return done;
|
|
41578
41703
|
}, "rekeyChats");
|
|
41579
41704
|
|
|
41580
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
41705
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/completeness.js
|
|
41581
41706
|
var historyStartKey = /* @__PURE__ */ __name((chatId) => `history_start:${chatId}`, "historyStartKey");
|
|
41582
41707
|
var fetchedKey = /* @__PURE__ */ __name((chatId) => `fetched:${chatId}`, "fetchedKey");
|
|
41583
41708
|
var CHAT_LIST_KEY = "chat_list_complete";
|
|
@@ -41635,7 +41760,7 @@ var chatCoverage = /* @__PURE__ */ __name(({ database }, accountKey) => {
|
|
|
41635
41760
|
return { ...coverage, oldestMessageAt: toIso(oldest) };
|
|
41636
41761
|
}, "chatCoverage");
|
|
41637
41762
|
|
|
41638
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
41763
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/chats.js
|
|
41639
41764
|
var chatsStoreOver = /* @__PURE__ */ __name((context) => {
|
|
41640
41765
|
const { database } = context;
|
|
41641
41766
|
const { accountPk: accountPk2, findAccountPk: findAccountPk2, writeState: writeState2 } = keysOver(context);
|
|
@@ -41784,7 +41909,7 @@ var chatsStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
41784
41909
|
};
|
|
41785
41910
|
}, "chatsStoreOver");
|
|
41786
41911
|
|
|
41787
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
41912
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/batches.js
|
|
41788
41913
|
import { createHash as createHash7 } from "node:crypto";
|
|
41789
41914
|
var BATCH_CONTEXT = 50;
|
|
41790
41915
|
var replied = /* @__PURE__ */ __name((m) => sql`EXISTS (SELECT 1 FROM messages p WHERE p.chat_id = ${m}.chat_id
|
|
@@ -41924,7 +42049,7 @@ var saveAnswers = /* @__PURE__ */ __name((context, id2, answer) => {
|
|
|
41924
42049
|
var clearAnswers = /* @__PURE__ */ __name(({ orm }, chatKey, model) => Number(orm.all(sql`DELETE FROM message_links WHERE chat_id = ${chatKey} AND source = 'agent'
|
|
41925
42050
|
${model === void 0 ? sql`` : sql`AND method = ${model}`} RETURNING 1 AS n`).length), "clearAnswers");
|
|
41926
42051
|
|
|
41927
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
42052
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/conversations.js
|
|
41928
42053
|
import { setTimeout } from "node:timers/promises";
|
|
41929
42054
|
var position = /* @__PURE__ */ __name((sentAt, pk) => `${sentAt}:${pk}`, "position");
|
|
41930
42055
|
var linkInputs = /* @__PURE__ */ __name(({ orm }, chatKey, { after: after2, limit }) => {
|
|
@@ -42236,7 +42361,7 @@ var agentAnswers = /* @__PURE__ */ __name(({ orm }, chatKey) => new Map(orm.all(
|
|
|
42236
42361
|
AND NOT EXISTS (SELECT 1 FROM messages d
|
|
42237
42362
|
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");
|
|
42238
42363
|
|
|
42239
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
42364
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/conversations.js
|
|
42240
42365
|
var conversationsStoreOver = /* @__PURE__ */ __name((context) => {
|
|
42241
42366
|
const { database } = context;
|
|
42242
42367
|
const { findAccountPk: findAccountPk2, findChatPk: findChatPk2, chatKeyOf } = keysOver(context);
|
|
@@ -42343,7 +42468,7 @@ var conversationsStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
42343
42468
|
};
|
|
42344
42469
|
}, "conversationsStoreOver");
|
|
42345
42470
|
|
|
42346
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
42471
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/counters.js
|
|
42347
42472
|
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";
|
|
42348
42473
|
var accountCountersOver = /* @__PURE__ */ __name((context) => {
|
|
42349
42474
|
const { database } = context;
|
|
@@ -42368,7 +42493,7 @@ var countersStoreOver = /* @__PURE__ */ __name((context, keyed) => ({
|
|
|
42368
42493
|
counterTargets: /* @__PURE__ */ __name(async (execution, options) => counterTargets(context, execution, options), "counterTargets")
|
|
42369
42494
|
}), "countersStoreOver");
|
|
42370
42495
|
|
|
42371
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
42496
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/mentions.js
|
|
42372
42497
|
var MENTION_STATUSES = ["found", "linked", "proposed", "dismissed"];
|
|
42373
42498
|
var MENTION_QUERY = defineQuery({
|
|
42374
42499
|
entity: "mention",
|
|
@@ -42587,7 +42712,7 @@ var listPlaces = /* @__PURE__ */ __name((database, { limit, offset }) => {
|
|
|
42587
42712
|
return { items: hasMore ? rows.slice(0, limit) : rows, hasMore };
|
|
42588
42713
|
}, "listPlaces");
|
|
42589
42714
|
|
|
42590
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
42715
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/mentions.js
|
|
42591
42716
|
var accountMentionsOver = /* @__PURE__ */ __name((context) => {
|
|
42592
42717
|
const { database } = context;
|
|
42593
42718
|
const { findAccountPk: findAccountPk2 } = keysOver(context);
|
|
@@ -42622,7 +42747,7 @@ var mentionsStoreOver = /* @__PURE__ */ __name((context, keyed) => ({
|
|
|
42622
42747
|
places: /* @__PURE__ */ __name(async (window) => listPlaces(context.database, window), "places")
|
|
42623
42748
|
}), "mentionsStoreOver");
|
|
42624
42749
|
|
|
42625
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
42750
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/reply-times.js
|
|
42626
42751
|
var FAR = Number.MAX_SAFE_INTEGER;
|
|
42627
42752
|
var MUTED_NOW = "(coalesce(c.muted,0)=1 AND (c.muted_until IS NULL OR c.muted_until>?))";
|
|
42628
42753
|
var chatsIn = /* @__PURE__ */ __name((scope3, kinds2, now2) => {
|
|
@@ -42721,7 +42846,7 @@ var waitingChats = /* @__PURE__ */ __name((context, scope3, waits, cap) => {
|
|
|
42721
42846
|
});
|
|
42722
42847
|
}, "waitingChats");
|
|
42723
42848
|
|
|
42724
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
42849
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/chat-activity-counts.js
|
|
42725
42850
|
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 = ?`;
|
|
42726
42851
|
var chatActivityCounts = /* @__PURE__ */ __name(({ database }, chatKeys, { since, until, now: now2 }) => {
|
|
42727
42852
|
const statement = database.prepare(SQL);
|
|
@@ -42741,7 +42866,7 @@ var chatActivityCounts = /* @__PURE__ */ __name(({ database }, chatKeys, { since
|
|
|
42741
42866
|
return found2;
|
|
42742
42867
|
}, "chatActivityCounts");
|
|
42743
42868
|
|
|
42744
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
42869
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/document-links.js
|
|
42745
42870
|
var documentLinkMessages = /* @__PURE__ */ __name(({ database }, chatKey, messageId) => {
|
|
42746
42871
|
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");
|
|
42747
42872
|
const rows = messageId === void 0 ? read2.all(chatKey) : read2.all(chatKey, messageId);
|
|
@@ -42756,7 +42881,7 @@ var documentLinkMessages = /* @__PURE__ */ __name(({ database }, chatKey, messag
|
|
|
42756
42881
|
}));
|
|
42757
42882
|
}, "documentLinkMessages");
|
|
42758
42883
|
|
|
42759
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
42884
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/follow-ups.js
|
|
42760
42885
|
var stemmerFor = stemmerCache();
|
|
42761
42886
|
var laterSharingRare = /* @__PURE__ */ __name((context, wanted, { rareAt, limit }) => {
|
|
42762
42887
|
if (wanted.length > 50 || !Number.isInteger(limit) || limit < 1 || limit > 100)
|
|
@@ -42800,7 +42925,7 @@ var laterSharingRare = /* @__PURE__ */ __name((context, wanted, { rareAt, limit
|
|
|
42800
42925
|
});
|
|
42801
42926
|
}, "laterSharingRare");
|
|
42802
42927
|
|
|
42803
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
42928
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/messages.js
|
|
42804
42929
|
var accountMessagesOver = /* @__PURE__ */ __name((context) => {
|
|
42805
42930
|
const { database } = context;
|
|
42806
42931
|
const { accountPk: accountPk2, findAccountPk: findAccountPk2, findChatPk: findChatPk2, chatKeyOf, chatPkFor: chatPkFor2, answeredChatPk: answeredChatPk2, upsertMessage: upsertMessage2 } = keysOver(context);
|
|
@@ -42941,7 +43066,7 @@ var messagesStoreOver = /* @__PURE__ */ __name((context, keyed) => ({
|
|
|
42941
43066
|
laterSharingRare: /* @__PURE__ */ __name(async (wanted, options) => laterSharingRare(context, wanted, options), "laterSharingRare")
|
|
42942
43067
|
}), "messagesStoreOver");
|
|
42943
43068
|
|
|
42944
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
43069
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/agent-links.js
|
|
42945
43070
|
var AGENT_METHOD = "agent";
|
|
42946
43071
|
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");
|
|
42947
43072
|
var weaknessOf = /* @__PURE__ */ __name((context, kind3, value, holders, sides, others) => {
|
|
@@ -43085,7 +43210,7 @@ var agentMerges = /* @__PURE__ */ __name((context, { limit, offset }) => {
|
|
|
43085
43210
|
return { items: found2.slice(offset, offset + limit), hasMore: found2.length > offset + limit };
|
|
43086
43211
|
}, "agentMerges");
|
|
43087
43212
|
|
|
43088
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
43213
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/identity-rekey.js
|
|
43089
43214
|
var quoted2 = /* @__PURE__ */ __name((name) => `"${name.replace(/"/g, '""')}"`, "quoted");
|
|
43090
43215
|
var columnsOf3 = /* @__PURE__ */ __name((database, table) => database.prepare("SELECT name, pk, type FROM pragma_table_info(?)").all(table), "columnsOf");
|
|
43091
43216
|
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
|
|
@@ -43229,7 +43354,7 @@ var rekeyIdentities = /* @__PURE__ */ __name((context, provider, pairs, { lockMs
|
|
|
43229
43354
|
return done;
|
|
43230
43355
|
}, "rekeyIdentities");
|
|
43231
43356
|
|
|
43232
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
43357
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/domain/person-kinds.js
|
|
43233
43358
|
var PERSON_KINDS = ["person", "organization", "automated", "stranger", "unsorted", "test"];
|
|
43234
43359
|
var AUTOMATED_WORDS = /* @__PURE__ */ new Set([
|
|
43235
43360
|
"noreply",
|
|
@@ -43292,7 +43417,7 @@ var isCompanyName = /* @__PURE__ */ __name((name) => {
|
|
|
43292
43417
|
return wordsOf3(name.replaceAll(".", "")).some((word2) => LEGAL_FORMS.has(word2) || COMPANY_WORDS.has(word2));
|
|
43293
43418
|
}, "isCompanyName");
|
|
43294
43419
|
|
|
43295
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
43420
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/person-ties.js
|
|
43296
43421
|
var SMALL_GROUP_MEMBERS = 10;
|
|
43297
43422
|
var PERSON_TIES = ["chat", "small-group", "mail", "meeting", "crm", "phone-book"];
|
|
43298
43423
|
var ALWAYS_SHOWN = ["owner", "added", "task"];
|
|
@@ -43347,7 +43472,7 @@ var shownReasons = /* @__PURE__ */ __name((database, people2) => {
|
|
|
43347
43472
|
return new Map([...found2].map(([person2, reasons]) => [person2, ORDER.filter((one2) => reasons.has(one2))]));
|
|
43348
43473
|
}, "shownReasons");
|
|
43349
43474
|
|
|
43350
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
43475
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/people-list.js
|
|
43351
43476
|
var PEOPLE_SORTS = ["interactions", "recent", "name", "tasks"];
|
|
43352
43477
|
var MIN_QUERY = 3;
|
|
43353
43478
|
var matching2 = /* @__PURE__ */ __name((query) => {
|
|
@@ -43692,7 +43817,7 @@ var similarPeople = /* @__PURE__ */ __name((database, typed, limit) => {
|
|
|
43692
43817
|
return withLastContact(database, rows).map((person2, at2) => ({ ...person2, sameName: same[at2] === true }));
|
|
43693
43818
|
}, "similarPeople");
|
|
43694
43819
|
|
|
43695
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
43820
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/person-doubts.js
|
|
43696
43821
|
var DOUBT_REASONS = ["owner-other-name", "test-data", "shared-address", "mixed-names"];
|
|
43697
43822
|
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";
|
|
43698
43823
|
var text4 = /* @__PURE__ */ __name((value) => typeof value === "string" && value.trim() !== "" ? value : null, "text");
|
|
@@ -43948,7 +44073,7 @@ var markTestData = /* @__PURE__ */ __name((context, uid, by) => {
|
|
|
43948
44073
|
return { person: `person:${person2}`, identities: identities2 };
|
|
43949
44074
|
}, "markTestData");
|
|
43950
44075
|
|
|
43951
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
44076
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/person-preparation.js
|
|
43952
44077
|
var GLOBAL_PROJECT = "SELECT id FROM main.projects WHERE account_id IS NULL AND deleted_at IS NULL";
|
|
43953
44078
|
var IN_SCOPES = "IN (SELECT value FROM json_each(?))";
|
|
43954
44079
|
var projectScope = /* @__PURE__ */ __name((id2) => `(SELECT p.scope FROM main.projects p WHERE p.id=${id2})`, "projectScope");
|
|
@@ -44017,7 +44142,7 @@ var personPreparation = /* @__PURE__ */ __name(({ database, now: now2 }, uid, {
|
|
|
44017
44142
|
});
|
|
44018
44143
|
}, "personPreparation");
|
|
44019
44144
|
|
|
44020
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
44145
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/person-scope.js
|
|
44021
44146
|
var personSeenInAccounts = /* @__PURE__ */ __name(({ database }, uid, accountIds) => {
|
|
44022
44147
|
const id2 = Number(uid);
|
|
44023
44148
|
if (!/^[1-9]\d*$/.test(uid) || !Number.isSafeInteger(id2) || !accountIds.length || accountIds.length > 1e3 || accountIds.some((account) => !Number.isSafeInteger(account) || account <= 0))
|
|
@@ -44025,7 +44150,7 @@ var personSeenInAccounts = /* @__PURE__ */ __name(({ database }, uid, accountIds
|
|
|
44025
44150
|
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)));
|
|
44026
44151
|
}, "personSeenInAccounts");
|
|
44027
44152
|
|
|
44028
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
44153
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/private-people.js
|
|
44029
44154
|
var required2 = /* @__PURE__ */ __name(({ database }, key2, personId) => {
|
|
44030
44155
|
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);
|
|
44031
44156
|
if (!row2)
|
|
@@ -44092,7 +44217,7 @@ var removeNote = /* @__PURE__ */ __name((context, key2, personId, id2) => {
|
|
|
44092
44217
|
return { id: id2, personId, removed: true };
|
|
44093
44218
|
}, "removeNote");
|
|
44094
44219
|
|
|
44095
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
44220
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/people.js
|
|
44096
44221
|
var accountPeopleOver = /* @__PURE__ */ __name((context) => {
|
|
44097
44222
|
const { database } = context;
|
|
44098
44223
|
const { accountPk: accountPk2, findAccountPk: findAccountPk2, identityPk: identityPk2 } = keysOver(context);
|
|
@@ -44235,13 +44360,13 @@ var peopleStoreOver = /* @__PURE__ */ __name((context, keyed) => {
|
|
|
44235
44360
|
};
|
|
44236
44361
|
}, "peopleStoreOver");
|
|
44237
44362
|
|
|
44238
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
44363
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/admin-statistics.js
|
|
44239
44364
|
import { createHash as createHash9 } from "node:crypto";
|
|
44240
44365
|
|
|
44241
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
44366
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/domain/admin-statistics.js
|
|
44242
44367
|
import { createHash as createHash8 } from "node:crypto";
|
|
44243
44368
|
|
|
44244
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
44369
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/domain/rankings-graph.js
|
|
44245
44370
|
var RANKING_GRAPH_LIMITS = { nodes: 5e4, depth: 256, work: 1e7, bytes: 8388608 };
|
|
44246
44371
|
var exhausted2 = /* @__PURE__ */ __name((budget) => {
|
|
44247
44372
|
throw new CliError("validation_error", `ranking exceeded ${budget} \u2014 narrow its chat or date scope`, {
|
|
@@ -44463,7 +44588,7 @@ var rankReplyGraph = /* @__PURE__ */ __name((nodes, check3 = () => {
|
|
|
44463
44588
|
};
|
|
44464
44589
|
}, "rankReplyGraph");
|
|
44465
44590
|
|
|
44466
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
44591
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/domain/admin-statistics.js
|
|
44467
44592
|
var adminEntityKey = /* @__PURE__ */ __name((row2) => JSON.stringify([row2.account.provider, row2.account.account, row2.id]), "adminEntityKey");
|
|
44468
44593
|
var personKey = /* @__PURE__ */ __name((node) => JSON.stringify([node.account.provider, node.account.account, node.sender]), "personKey");
|
|
44469
44594
|
var locator = /* @__PURE__ */ __name((node) => formatLocator({ ...node.account, chat: node.chatId, message: node.id }), "locator");
|
|
@@ -44637,7 +44762,7 @@ var calculateAdminStatistics = /* @__PURE__ */ __name((nodes, stays, options, in
|
|
|
44637
44762
|
return { items, evidence, summary, graph: graph.quality };
|
|
44638
44763
|
}, "calculateAdminStatistics");
|
|
44639
44764
|
|
|
44640
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
44765
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/domain/rankings-range.js
|
|
44641
44766
|
var rankingContextRange = /* @__PURE__ */ __name((root) => {
|
|
44642
44767
|
const dates = [];
|
|
44643
44768
|
const visit = /* @__PURE__ */ __name((node, required3) => {
|
|
@@ -44659,7 +44784,7 @@ var rankingContextRange = /* @__PURE__ */ __name((root) => {
|
|
|
44659
44784
|
return dates[0].node.resolution.date;
|
|
44660
44785
|
}, "rankingContextRange");
|
|
44661
44786
|
|
|
44662
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
44787
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/rankings.js
|
|
44663
44788
|
var reactionCounts = /* @__PURE__ */ __name((stored4) => {
|
|
44664
44789
|
let counts;
|
|
44665
44790
|
try {
|
|
@@ -44954,14 +45079,14 @@ var rankQuery = /* @__PURE__ */ __name((context, execution, request, inspect) =>
|
|
|
44954
45079
|
});
|
|
44955
45080
|
}, "rankQuery");
|
|
44956
45081
|
|
|
44957
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
45082
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/admin-statistics.js
|
|
44958
45083
|
function fail2(message3, reason = "query.too-large") {
|
|
44959
45084
|
throw new CliError("validation_error", message3, { reason, complete: false });
|
|
44960
45085
|
}
|
|
44961
45086
|
__name(fail2, "fail");
|
|
44962
45087
|
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";
|
|
44963
|
-
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)`;
|
|
44964
|
-
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))`;
|
|
45088
|
+
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))`;
|
|
45089
|
+
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)))`;
|
|
44965
45090
|
var adminStatisticsQuery = /* @__PURE__ */ __name((context, execution, request) => withQuerySelection(context, execution, (selection, check3) => {
|
|
44966
45091
|
const { database } = context, { options } = request;
|
|
44967
45092
|
const prefix = `WITH selected AS (${selection.sql}) `;
|
|
@@ -45131,7 +45256,7 @@ var adminStatisticsQuery = /* @__PURE__ */ __name((context, execution, request)
|
|
|
45131
45256
|
return result;
|
|
45132
45257
|
}), "adminStatisticsQuery");
|
|
45133
45258
|
|
|
45134
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
45259
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/conversation-eligibility.js
|
|
45135
45260
|
var conversationEligibility = /* @__PURE__ */ __name(async (context, execution) => {
|
|
45136
45261
|
if (!execution.accounts.length)
|
|
45137
45262
|
return { conversations: [], chats: [] };
|
|
@@ -45149,7 +45274,7 @@ var conversationEligibility = /* @__PURE__ */ __name(async (context, execution)
|
|
|
45149
45274
|
return { conversations: conversations2, chats: chats2 };
|
|
45150
45275
|
}, "conversationEligibility");
|
|
45151
45276
|
|
|
45152
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
45277
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/ranking-evidence.js
|
|
45153
45278
|
import { createHash as createHash10 } from "node:crypto";
|
|
45154
45279
|
var EVIDENCE_BYTES = 64 * 1024;
|
|
45155
45280
|
var FINGERPRINT_BYTES = 8 * 1024 * 1024;
|
|
@@ -45299,7 +45424,7 @@ var rankingEvidence = /* @__PURE__ */ __name((context, execution, request) => {
|
|
|
45299
45424
|
return result;
|
|
45300
45425
|
}, "rankingEvidence");
|
|
45301
45426
|
|
|
45302
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
45427
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/queries.js
|
|
45303
45428
|
var queriesStoreOver = /* @__PURE__ */ __name((context, stemmerFor2) => {
|
|
45304
45429
|
const mailIndexed = /* @__PURE__ */ __name((execution) => {
|
|
45305
45430
|
if (execution.corpus === "mail")
|
|
@@ -45320,7 +45445,7 @@ var queriesStoreOver = /* @__PURE__ */ __name((context, stemmerFor2) => {
|
|
|
45320
45445
|
};
|
|
45321
45446
|
}, "queriesStoreOver");
|
|
45322
45447
|
|
|
45323
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
45448
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/chat-events.js
|
|
45324
45449
|
var saveChatEvents = /* @__PURE__ */ __name((context, accountKey, provider, chatKey, events3) => {
|
|
45325
45450
|
const { database, now: now2 } = context;
|
|
45326
45451
|
const insert = database.prepare(`INSERT INTO chat_events (chat_id, source_id, action, actor_identity_id, title, happened_at, created_at, updated_at)
|
|
@@ -45359,10 +45484,10 @@ var chatEventsOf = /* @__PURE__ */ __name(({ database }, chatKey, { since = 0, l
|
|
|
45359
45484
|
}));
|
|
45360
45485
|
}, "chatEventsOf");
|
|
45361
45486
|
|
|
45362
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
45487
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/retention.js
|
|
45363
45488
|
import { createHash as createHash11 } from "node:crypto";
|
|
45364
45489
|
|
|
45365
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
45490
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/domain/calendar.js
|
|
45366
45491
|
var calendarKey = /* @__PURE__ */ __name((zone, by) => {
|
|
45367
45492
|
const format = new Intl.DateTimeFormat("en-CA", {
|
|
45368
45493
|
timeZone: zone,
|
|
@@ -45382,7 +45507,7 @@ var weekKey = /* @__PURE__ */ __name((day2) => {
|
|
|
45382
45507
|
return date3.toISOString().slice(0, 10);
|
|
45383
45508
|
}, "weekKey");
|
|
45384
45509
|
|
|
45385
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
45510
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/domain/retention.js
|
|
45386
45511
|
var RETENTION_TOLERANCE = 864e5;
|
|
45387
45512
|
var validateRetentionOptions = /* @__PURE__ */ __name((options) => {
|
|
45388
45513
|
const { since, until, cutoff, checkpoints, within, limit, by } = options;
|
|
@@ -45436,7 +45561,7 @@ var retentionCohorts = /* @__PURE__ */ __name((stays, options) => {
|
|
|
45436
45561
|
return [...groups.values()].sort((a, b) => a.cohort.localeCompare(b.cohort));
|
|
45437
45562
|
}, "retentionCohorts");
|
|
45438
45563
|
|
|
45439
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
45564
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/retention.js
|
|
45440
45565
|
var iso10 = /* @__PURE__ */ __name((at2) => new Date(at2).toISOString(), "iso");
|
|
45441
45566
|
var retentionQuery = /* @__PURE__ */ __name((context, accountPk2, chatPk, chatId, options, evidence) => {
|
|
45442
45567
|
validateRetentionOptions(options);
|
|
@@ -45567,7 +45692,7 @@ var retentionQuery = /* @__PURE__ */ __name((context, accountPk2, chatPk, chatId
|
|
|
45567
45692
|
};
|
|
45568
45693
|
}, "retentionQuery");
|
|
45569
45694
|
|
|
45570
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
45695
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/roster.js
|
|
45571
45696
|
var iso11 = /* @__PURE__ */ __name((ms) => ms === null ? null : new Date(ms).toISOString(), "iso");
|
|
45572
45697
|
var marksOf = /* @__PURE__ */ __name(({ isBot: isBot2, flagged, deleted, hasPhoto }) => ({
|
|
45573
45698
|
...isBot2 === void 0 ? {} : { bot: isBot2 },
|
|
@@ -45696,7 +45821,7 @@ var trackedChats = /* @__PURE__ */ __name((context, accountKey, where) => contex
|
|
|
45696
45821
|
lastCount: memberCountsOf(context, pk).at(-1) ?? null
|
|
45697
45822
|
})), "trackedChats");
|
|
45698
45823
|
|
|
45699
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
45824
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/roster.js
|
|
45700
45825
|
var rosterStoreOver = /* @__PURE__ */ __name((context) => {
|
|
45701
45826
|
const { database } = context;
|
|
45702
45827
|
const { accountPk: accountPk2, findAccountPk: findAccountPk2, chatKeyOf, chatPkFor: chatPkFor2, writeMembers: writeMembers2 } = keysOver(context);
|
|
@@ -45752,7 +45877,7 @@ var rosterStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
45752
45877
|
};
|
|
45753
45878
|
}, "rosterStoreOver");
|
|
45754
45879
|
|
|
45755
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
45880
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/backfill.js
|
|
45756
45881
|
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");
|
|
45757
45882
|
var backfillNormalized = /* @__PURE__ */ __name((database, { batch = 5e3, onBatch, until = /* @__PURE__ */ __name(() => false, "until") } = {}) => {
|
|
45758
45883
|
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 ?`);
|
|
@@ -45776,7 +45901,7 @@ var backfillNormalized = /* @__PURE__ */ __name((database, { batch = 5e3, onBatc
|
|
|
45776
45901
|
}
|
|
45777
45902
|
}, "backfillNormalized");
|
|
45778
45903
|
|
|
45779
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
45904
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/search-index.js
|
|
45780
45905
|
var INDEX2 = "message_words";
|
|
45781
45906
|
var searchIndexState2 = /* @__PURE__ */ __name((database) => {
|
|
45782
45907
|
const row2 = indexRow(database, INDEX2);
|
|
@@ -45903,7 +46028,7 @@ var resetSearchIndex = /* @__PURE__ */ __name((database) => {
|
|
|
45903
46028
|
});
|
|
45904
46029
|
}, "resetSearchIndex");
|
|
45905
46030
|
|
|
45906
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
46031
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/stems-fill.js
|
|
45907
46032
|
var fillStems = /* @__PURE__ */ __name((database, { batch = 5e3, until = /* @__PURE__ */ __name(() => false, "until"), onBatch, now: now2 = Date.now } = {}) => {
|
|
45908
46033
|
const filled = { stemmed: 0, drained: 0 };
|
|
45909
46034
|
const before2 = stemsState(database);
|
|
@@ -45998,7 +46123,7 @@ var followDefaultStemmers = /* @__PURE__ */ __name((database, now2 = Date.now) =
|
|
|
45998
46123
|
return resetStems(database, { now: now2 });
|
|
45999
46124
|
}, "followDefaultStemmers");
|
|
46000
46125
|
|
|
46001
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
46126
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/words.js
|
|
46002
46127
|
var VOCABULARY = "SELECT term, doc FROM message_words_vocab WHERE col = 'normalized_text'";
|
|
46003
46128
|
var knownTerms = /* @__PURE__ */ __name(({ database }, terms) => {
|
|
46004
46129
|
const lookup = database.prepare(`${VOCABULARY} AND term >= ? AND term <= ? LIMIT 1`);
|
|
@@ -46020,7 +46145,7 @@ var termCandidates = /* @__PURE__ */ __name(({ database }, pieces, { shortest, l
|
|
|
46020
46145
|
});
|
|
46021
46146
|
}, "termCandidates");
|
|
46022
46147
|
|
|
46023
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
46148
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/search-index.js
|
|
46024
46149
|
var searchIndexStoreOver = /* @__PURE__ */ __name((context) => {
|
|
46025
46150
|
const { database } = context;
|
|
46026
46151
|
const stemmerFor2 = stemmerCache();
|
|
@@ -46045,7 +46170,7 @@ var searchIndexStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
46045
46170
|
};
|
|
46046
46171
|
}, "searchIndexStoreOver");
|
|
46047
46172
|
|
|
46048
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
46173
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/searches.js
|
|
46049
46174
|
var HISTORY_KEPT = 1e3;
|
|
46050
46175
|
var commandFilter = /* @__PURE__ */ __name((commands) => commands ? { sql: ` AND command IN (${commands.map(() => "?").join(", ")})`, values: [...commands] } : { sql: "", values: [] }, "commandFilter");
|
|
46051
46176
|
var COLUMNS6 = "id, name, command, params, language, version, fields_version, created_at, updated_at, last_run_at, runs";
|
|
@@ -46115,7 +46240,7 @@ var clearHistory = /* @__PURE__ */ __name(({ database }, commands) => {
|
|
|
46115
46240
|
return database.prepare(`DELETE FROM searches WHERE name IS NULL${only.sql}`).run(...only.values).changes;
|
|
46116
46241
|
}, "clearHistory");
|
|
46117
46242
|
|
|
46118
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
46243
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/searches.js
|
|
46119
46244
|
var searchesStoreOver = /* @__PURE__ */ __name((context) => {
|
|
46120
46245
|
const { database } = context;
|
|
46121
46246
|
return {
|
|
@@ -46139,7 +46264,7 @@ var searchesStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
46139
46264
|
};
|
|
46140
46265
|
}, "searchesStoreOver");
|
|
46141
46266
|
|
|
46142
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
46267
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/added-sources.js
|
|
46143
46268
|
import { createHash as createHash12 } from "node:crypto";
|
|
46144
46269
|
var ADDED_KINDS = ["text", "file", "page"];
|
|
46145
46270
|
var TEXT_COLUMNS = "kind = ?, title = ?, file_name = ?, extension = ?, url = ?, mime = ?, size = ?, content_hash = ?, body = ?, extraction = ?, metadata = ?, language = ?";
|
|
@@ -46381,7 +46506,7 @@ var addedSourcesOver = /* @__PURE__ */ __name((context) => {
|
|
|
46381
46506
|
};
|
|
46382
46507
|
}, "addedSourcesOver");
|
|
46383
46508
|
|
|
46384
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
46509
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/agent-actions.js
|
|
46385
46510
|
var ACTION_TIERS = ["read", "draft", "write-private", "write-public", "destructive", "admin"];
|
|
46386
46511
|
var ACTION_OUTCOMES = ["ok", "refused", "failed"];
|
|
46387
46512
|
var CODE = /^[a-z][a-z0-9_]{0,63}$/;
|
|
@@ -46429,7 +46554,7 @@ var agentActionsStoreOver = /* @__PURE__ */ __name((context, afterRecord = () =>
|
|
|
46429
46554
|
};
|
|
46430
46555
|
}, "agentActionsStoreOver");
|
|
46431
46556
|
|
|
46432
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
46557
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/base-suggest.js
|
|
46433
46558
|
var baseSettingKey = /* @__PURE__ */ __name((kind3) => `stages.base.${kind3}`, "baseSettingKey");
|
|
46434
46559
|
var storedPipeline = /* @__PURE__ */ __name((value) => {
|
|
46435
46560
|
if (typeof value !== "string")
|
|
@@ -46475,11 +46600,11 @@ var suggestBaseStages = /* @__PURE__ */ __name((database, kind3, pipelines2, { o
|
|
|
46475
46600
|
}
|
|
46476
46601
|
}, "suggestBaseStages");
|
|
46477
46602
|
|
|
46478
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
46603
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/copy-viewer.js
|
|
46479
46604
|
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");
|
|
46480
46605
|
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");
|
|
46481
46606
|
|
|
46482
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
46607
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/crm-rows.js
|
|
46483
46608
|
var TABLES2 = { deal: "deals", lead: "leads" };
|
|
46484
46609
|
var MONEY_REFUSALS = ["money.currency", "money.amount"];
|
|
46485
46610
|
var amountFault = /* @__PURE__ */ __name((item, code) => {
|
|
@@ -46651,7 +46776,7 @@ var crmRowsOver = /* @__PURE__ */ __name((context) => {
|
|
|
46651
46776
|
return { savePipeline, saveItemRow };
|
|
46652
46777
|
}, "crmRowsOver");
|
|
46653
46778
|
|
|
46654
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
46779
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/crm-activities.js
|
|
46655
46780
|
var ACTIVITY_RECORD = "crm.activity";
|
|
46656
46781
|
var forgetActivitiesOn = /* @__PURE__ */ __name((database, accountId, kind3, externalIds, at2) => {
|
|
46657
46782
|
const removed = "rr.target_type = ? AND rr.target_external_id IN (SELECT value FROM json_each(?))";
|
|
@@ -46839,7 +46964,7 @@ var seenSql = /* @__PURE__ */ __name((viewer) => {
|
|
|
46839
46964
|
};
|
|
46840
46965
|
}, "seenSql");
|
|
46841
46966
|
|
|
46842
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
46967
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/crm-stage-entries.js
|
|
46843
46968
|
var STAGE_ENTRY_RECORD = "crm.stage-entry";
|
|
46844
46969
|
var STAGE_ENTRY_DAYS = 90;
|
|
46845
46970
|
var STAGE_TASK_DAYS = 7;
|
|
@@ -46907,7 +47032,7 @@ var crmStageEntriesOver = /* @__PURE__ */ __name((context) => {
|
|
|
46907
47032
|
return { save: save2, pending, handled, expire };
|
|
46908
47033
|
}, "crmStageEntriesOver");
|
|
46909
47034
|
|
|
46910
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
47035
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/stage-amounts.js
|
|
46911
47036
|
var TABLES3 = { deal: "deals", lead: "leads" };
|
|
46912
47037
|
var stageAmountsOf = /* @__PURE__ */ __name(({ database }, kind3, stageIds, { since, until }, viewer) => {
|
|
46913
47038
|
const seen = viewerSql("d", viewer);
|
|
@@ -46925,7 +47050,7 @@ var stageAmountsOf = /* @__PURE__ */ __name(({ database }, kind3, stageIds, { si
|
|
|
46925
47050
|
});
|
|
46926
47051
|
}, "stageAmountsOf");
|
|
46927
47052
|
|
|
46928
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
47053
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/pipeline-period.js
|
|
46929
47054
|
var TABLES4 = { deal: "deals", lead: "leads" };
|
|
46930
47055
|
var DAY6 = 864e5;
|
|
46931
47056
|
var LOST_REASONS = 10;
|
|
@@ -47082,7 +47207,7 @@ var pipelinePeriod = /* @__PURE__ */ __name((context, pipeline, window, zone, vi
|
|
|
47082
47207
|
};
|
|
47083
47208
|
}, "pipelinePeriod");
|
|
47084
47209
|
|
|
47085
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
47210
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/deals.js
|
|
47086
47211
|
var TABLES5 = { deal: "deals", lead: "leads" };
|
|
47087
47212
|
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");
|
|
47088
47213
|
var MAX_STAGES = 30;
|
|
@@ -47144,7 +47269,7 @@ var dealOperationsOver = /* @__PURE__ */ __name((context) => {
|
|
|
47144
47269
|
const { partyOf, partyThing } = reviewedRowsOver(context);
|
|
47145
47270
|
const today = /* @__PURE__ */ __name(() => new Date(now2()).toISOString().slice(0, 10), "today");
|
|
47146
47271
|
const peopleOf2 = /* @__PURE__ */ __name((kind3, id2) => database.prepare(`SELECT to_id, role FROM links WHERE from_type = ? AND from_id = ? AND kind = ${linkKind("related-to")} AND to_type = 'person' AND to_id IS NOT NULL AND deleted_at IS NULL AND ${notOverriddenSql("links")} ORDER BY id`).all(kind3, id2).map((row2) => ({ ...partyOf("person", row2.to_id), role: row2.role })), "peopleOf");
|
|
47147
|
-
const
|
|
47272
|
+
const itemOf3 = /* @__PURE__ */ __name((kind3) => (row2) => {
|
|
47148
47273
|
const currency = row2.currency == null ? null : String(row2.currency);
|
|
47149
47274
|
const amount = row2.amount == null || currency === null ? null : Number(row2.amount);
|
|
47150
47275
|
const fields4 = {
|
|
@@ -47199,7 +47324,7 @@ var dealOperationsOver = /* @__PURE__ */ __name((context) => {
|
|
|
47199
47324
|
}, "rowOf");
|
|
47200
47325
|
const read2 = /* @__PURE__ */ __name((reference2) => {
|
|
47201
47326
|
const { kind: kind3, row: row2 } = rowOf4(reference2);
|
|
47202
|
-
return
|
|
47327
|
+
return itemOf3(kind3)(row2);
|
|
47203
47328
|
}, "read");
|
|
47204
47329
|
const inScope = /* @__PURE__ */ __name((scope3, row2) => scope3 === void 0 || (scope3 === "own" ? row2.account_id == null : row2.account_provider === scope3.provider && row2.account_external_id === scope3.account), "inScope");
|
|
47205
47330
|
const kindOf4 = /* @__PURE__ */ __name((kind3) => kind3 === void 0 ? "deal" : oneOf3(kind3, DEAL_KINDS, "a kind"), "kindOf");
|
|
@@ -47409,7 +47534,7 @@ var dealOperationsOver = /* @__PURE__ */ __name((context) => {
|
|
|
47409
47534
|
filter.owner === null ? { sql: "json_extract(d.metadata, '$.assignee') IS NULL", params: [] } : { sql: "json_extract(d.metadata, '$.assignee') = ?", params: [filter.owner] }
|
|
47410
47535
|
]
|
|
47411
47536
|
];
|
|
47412
|
-
const rows = database.prepare(`${itemsSql(kind3)} WHERE d.deleted_at IS NULL ${within.map(({ sql: sql2 }) => `AND ${sql2} `).join("")}AND (? IS NULL OR d.status = ?) AND (? IS NULL OR d.project_id = ?) AND (? IS NULL OR s.name_folded = ?) AND (? IS NULL OR p.id = ?) AND (? IS NULL OR d.organization_id = ?) AND (? = 0 OR d.account_id IS NULL) AND (? IS NULL OR (a.provider = ? AND a.external_id = ?)) ${inAccounts}AND ${by.sql} ORDER BY d.created_at DESC, d.id DESC LIMIT ? OFFSET ?`).all(...within.flatMap(({ params }) => params), status2, status2, project2, project2, stage, stage, pipeline, pipeline, organization2?.id ?? null, organization2?.id ?? null, own, provider, provider, account, ...keys ?? [], ...by.params, limit + 1, offset).map(
|
|
47537
|
+
const rows = database.prepare(`${itemsSql(kind3)} WHERE d.deleted_at IS NULL ${within.map(({ sql: sql2 }) => `AND ${sql2} `).join("")}AND (? IS NULL OR d.status = ?) AND (? IS NULL OR d.project_id = ?) AND (? IS NULL OR s.name_folded = ?) AND (? IS NULL OR p.id = ?) AND (? IS NULL OR d.organization_id = ?) AND (? = 0 OR d.account_id IS NULL) AND (? IS NULL OR (a.provider = ? AND a.external_id = ?)) ${inAccounts}AND ${by.sql} ORDER BY d.created_at DESC, d.id DESC LIMIT ? OFFSET ?`).all(...within.flatMap(({ params }) => params), status2, status2, project2, project2, stage, stage, pipeline, pipeline, organization2?.id ?? null, organization2?.id ?? null, own, provider, provider, account, ...keys ?? [], ...by.params, limit + 1, offset).map(itemOf3(kind3));
|
|
47413
47538
|
return pageOfRows(rows, limit, offset);
|
|
47414
47539
|
}, "list"),
|
|
47415
47540
|
find: /* @__PURE__ */ __name(async (wanted) => {
|
|
@@ -47555,7 +47680,7 @@ var dealsStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
47555
47680
|
};
|
|
47556
47681
|
}, "dealsStoreOver");
|
|
47557
47682
|
|
|
47558
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
47683
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/owner-languages.js
|
|
47559
47684
|
var KEY2 = "ownerLanguages";
|
|
47560
47685
|
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(" "));
|
|
47561
47686
|
var DEFAULT_OWNER_LANGUAGES = ["ru"];
|
|
@@ -47585,7 +47710,7 @@ var saveOwnerLanguages = /* @__PURE__ */ __name((database, languages, now2) => {
|
|
|
47585
47710
|
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);
|
|
47586
47711
|
}, "saveOwnerLanguages");
|
|
47587
47712
|
|
|
47588
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
47713
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/base-stages.js
|
|
47589
47714
|
var OUTCOMES = {
|
|
47590
47715
|
lead: ["open", "open", "open", "won", "lost"],
|
|
47591
47716
|
deal: ["open", "open", "open", "open", "won", "lost"]
|
|
@@ -47918,7 +48043,7 @@ var baseStagesStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
47918
48043
|
};
|
|
47919
48044
|
}, "baseStagesStoreOver");
|
|
47920
48045
|
|
|
47921
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
48046
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/bot-updates.js
|
|
47922
48047
|
var botUpdateStoreOver = /* @__PURE__ */ __name((context, afterSave = () => {
|
|
47923
48048
|
}) => {
|
|
47924
48049
|
const { database, now: now2 } = context;
|
|
@@ -47977,7 +48102,7 @@ var botUpdateStoreOver = /* @__PURE__ */ __name((context, afterSave = () => {
|
|
|
47977
48102
|
};
|
|
47978
48103
|
}, "botUpdateStoreOver");
|
|
47979
48104
|
|
|
47980
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
48105
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/record-projection.js
|
|
47981
48106
|
var IMPORTER = { bot: "import" };
|
|
47982
48107
|
var importersProposal = /* @__PURE__ */ __name((entity) => entity.review === "proposed" && entity.author.type === "bot" && entity.author.name === IMPORTER.bot, "importersProposal");
|
|
47983
48108
|
var codeOf = /* @__PURE__ */ __name((error) => {
|
|
@@ -48022,7 +48147,7 @@ var moneyLinesOf = /* @__PURE__ */ __name((projection, list2) => (Array.isArray(
|
|
|
48022
48147
|
};
|
|
48023
48148
|
}), "moneyLinesOf");
|
|
48024
48149
|
|
|
48025
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
48150
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/relation-roles.js
|
|
48026
48151
|
var settingOf = /* @__PURE__ */ __name((list2) => `relationships.roles.${list2}`, "settingOf");
|
|
48027
48152
|
var isList = /* @__PURE__ */ __name((list2) => Object.hasOwn(ROLE_LISTS, list2), "isList");
|
|
48028
48153
|
var listOf2 = /* @__PURE__ */ __name((list2) => {
|
|
@@ -48106,7 +48231,7 @@ var relationRolesOver = /* @__PURE__ */ __name(({ database, now: now2 }) => {
|
|
|
48106
48231
|
};
|
|
48107
48232
|
}, "relationRolesOver");
|
|
48108
48233
|
|
|
48109
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
48234
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/crm-settings.js
|
|
48110
48235
|
var CRM_LINK_MODES = ["reported", "review"];
|
|
48111
48236
|
var COMPANY_TYPE_MEANINGS = ["customer-of", "supplier", "partner-of"];
|
|
48112
48237
|
var CRM_SCOPES = ["mine", "all"];
|
|
@@ -48337,7 +48462,7 @@ var crmSettingsOf = /* @__PURE__ */ __name((database) => database.prepare("SELEC
|
|
|
48337
48462
|
return [{ setting: String(row2.key), value: settingValue(database, parsed5.key, parsed5.name) }];
|
|
48338
48463
|
}), "crmSettingsOf");
|
|
48339
48464
|
|
|
48340
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
48465
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/relation-proposals.js
|
|
48341
48466
|
var isoOf = /* @__PURE__ */ __name((ms) => ms === void 0 ? null : new Date(ms).toISOString(), "isoOf");
|
|
48342
48467
|
var relationOf = /* @__PURE__ */ __name((link3, now2) => ({
|
|
48343
48468
|
id: link3.id,
|
|
@@ -48697,7 +48822,7 @@ var decidedOrigin = /* @__PURE__ */ __name((by) => by === "owner" ? { origin: "o
|
|
|
48697
48822
|
provenance: `agent:${by.bot} for the owner: ${by.reason.trim()}`
|
|
48698
48823
|
}, "decidedOrigin");
|
|
48699
48824
|
|
|
48700
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
48825
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/reported-relations.js
|
|
48701
48826
|
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");
|
|
48702
48827
|
var metadataOf = /* @__PURE__ */ __name((relation) => relation.metadata && Object.keys(relation.metadata).length ? JSON.stringify(relation.metadata) : null, "metadataOf");
|
|
48703
48828
|
var syncReportedIn = /* @__PURE__ */ __name((context, key2, relationships, scope3, { source: source2 = "import", by = { bot: key2.provider, kind: "rule" }, onOutcome } = {}) => {
|
|
@@ -48835,7 +48960,7 @@ var relationsStoreOver = /* @__PURE__ */ __name((context) => ({
|
|
|
48835
48960
|
syncReported: /* @__PURE__ */ __name(async (key2, relationships, scope3, options) => write(context.database, () => syncReportedIn(context, key2, relationships, scope3, options)), "syncReported")
|
|
48836
48961
|
}), "relationsStoreOver");
|
|
48837
48962
|
|
|
48838
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
48963
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/record-relationships.js
|
|
48839
48964
|
var importSource = /* @__PURE__ */ __name((provider) => `import:${provider}`, "importSource");
|
|
48840
48965
|
var noRelationships = /* @__PURE__ */ __name(() => ({
|
|
48841
48966
|
added: 0,
|
|
@@ -49025,7 +49150,7 @@ var recordRelationshipsOver = /* @__PURE__ */ __name((context) => {
|
|
|
49025
49150
|
return { report, placeOf: placeOf2, withdrawFrom };
|
|
49026
49151
|
}, "recordRelationshipsOver");
|
|
49027
49152
|
|
|
49028
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
49153
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/business-contracts.js
|
|
49029
49154
|
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";
|
|
49030
49155
|
var DAY_MS2 = 864e5;
|
|
49031
49156
|
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");
|
|
@@ -49184,7 +49309,7 @@ var contractsStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
49184
49309
|
};
|
|
49185
49310
|
}, "contractsStoreOver");
|
|
49186
49311
|
|
|
49187
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
49312
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/business-search.js
|
|
49188
49313
|
var BUSINESS_FIND_MAX = 2001;
|
|
49189
49314
|
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");
|
|
49190
49315
|
var partyName = /* @__PURE__ */ __name((as) => `coalesce(${as}p.name, ${as}o.name, ${as}j.name)`, "partyName");
|
|
@@ -49289,7 +49414,7 @@ var businessSearchOver = /* @__PURE__ */ __name(({ database }) => {
|
|
|
49289
49414
|
};
|
|
49290
49415
|
}, "businessSearchOver");
|
|
49291
49416
|
|
|
49292
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
49417
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/catalog.js
|
|
49293
49418
|
var CATALOG_QUERY = defineQuery({
|
|
49294
49419
|
entity: "document",
|
|
49295
49420
|
backend: "sql",
|
|
@@ -49522,7 +49647,414 @@ var catalogStoreOver = /* @__PURE__ */ __name(({ database, now: now2 }) => {
|
|
|
49522
49647
|
};
|
|
49523
49648
|
}, "catalogStoreOver");
|
|
49524
49649
|
|
|
49525
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
49650
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/content.js
|
|
49651
|
+
import { createHash as createHash13 } from "node:crypto";
|
|
49652
|
+
|
|
49653
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/crm-files.js
|
|
49654
|
+
import { sep } from "node:path";
|
|
49655
|
+
var MOST = 500;
|
|
49656
|
+
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");
|
|
49657
|
+
var EXCERPT = 240;
|
|
49658
|
+
var COLUMNS7 = "f.external_id, f.owner_kind, f.owner_id, f.owner_assignee, f.source, f.name, f.mime, f.size, f.external_created_at, f.local_path, f.content_sha256, f.extraction, f.extraction_error, f.downloaded_by, f.downloaded_at";
|
|
49659
|
+
var text5 = /* @__PURE__ */ __name((value) => value === null || value === void 0 ? null : String(value), "text");
|
|
49660
|
+
var number3 = /* @__PURE__ */ __name((value) => value === null || value === void 0 ? null : Number(value), "number");
|
|
49661
|
+
var rowOf2 = /* @__PURE__ */ __name((row2) => ({
|
|
49662
|
+
externalId: String(row2.external_id),
|
|
49663
|
+
ownerKind: String(row2.owner_kind),
|
|
49664
|
+
ownerId: String(row2.owner_id),
|
|
49665
|
+
ownerAssignee: text5(row2.owner_assignee),
|
|
49666
|
+
source: String(row2.source),
|
|
49667
|
+
name: String(row2.name),
|
|
49668
|
+
mime: text5(row2.mime),
|
|
49669
|
+
size: number3(row2.size),
|
|
49670
|
+
externalCreatedAt: number3(row2.external_created_at),
|
|
49671
|
+
localPath: text5(row2.local_path),
|
|
49672
|
+
contentSha256: text5(row2.content_sha256),
|
|
49673
|
+
extraction: text5(row2.extraction),
|
|
49674
|
+
extractionError: text5(row2.extraction_error),
|
|
49675
|
+
downloadedBy: text5(row2.downloaded_by),
|
|
49676
|
+
downloadedAt: Number(row2.downloaded_at)
|
|
49677
|
+
}), "rowOf");
|
|
49678
|
+
var matchOf2 = /* @__PURE__ */ __name((words4, anyWord, exact) => {
|
|
49679
|
+
const phrases = words4.map((word2) => normalize(word2).trim()).filter(Boolean).map((word2) => {
|
|
49680
|
+
const quoted6 = `"${word2.replaceAll('"', '""')}"`;
|
|
49681
|
+
return exact || /\s/u.test(word2) || word2.length < 3 ? quoted6 : `${quoted6}*`;
|
|
49682
|
+
});
|
|
49683
|
+
return phrases.length ? [...new Set(phrases)].join(anyWord ? " OR " : " AND ") : void 0;
|
|
49684
|
+
}, "matchOf");
|
|
49685
|
+
var excerptOf = /* @__PURE__ */ __name((body2, words4) => {
|
|
49686
|
+
const folded6 = fold(body2);
|
|
49687
|
+
const at2 = words4.map((word2) => folded6.indexOf(fold(word2).trim())).filter((index2) => index2 >= 0).sort((a, b) => a - b)[0];
|
|
49688
|
+
const start = Math.max(0, (at2 ?? 0) - EXCERPT / 4);
|
|
49689
|
+
return body2.slice(start, start + EXCERPT).replace(/\s+/gu, " ").trim();
|
|
49690
|
+
}, "excerptOf");
|
|
49691
|
+
var resetCrmFileWords = /* @__PURE__ */ __name((database) => {
|
|
49692
|
+
if (!database.prepare("SELECT 1 FROM sqlite_master WHERE name = 'crm_file_words'").get())
|
|
49693
|
+
return 0;
|
|
49694
|
+
return write(database, () => {
|
|
49695
|
+
const update2 = database.prepare("UPDATE crm_files SET normalized_text = ? WHERE id = ?");
|
|
49696
|
+
for (const row2 of database.prepare("SELECT id, text, normalized_text FROM crm_files WHERE text IS NOT NULL").all()) {
|
|
49697
|
+
const normalized = normalize(String(row2.text));
|
|
49698
|
+
if (normalized !== row2.normalized_text)
|
|
49699
|
+
update2.run(normalized, Number(row2.id));
|
|
49700
|
+
}
|
|
49701
|
+
database.exec("INSERT INTO crm_file_words (crm_file_words) VALUES ('delete-all')");
|
|
49702
|
+
const { changes } = database.prepare("INSERT INTO crm_file_words (rowid, normalized_text) SELECT id, normalized_text FROM crm_files WHERE normalized_text <> ''").run();
|
|
49703
|
+
return Number(changes);
|
|
49704
|
+
});
|
|
49705
|
+
}, "resetCrmFileWords");
|
|
49706
|
+
var crmFilesOver = /* @__PURE__ */ __name((context) => {
|
|
49707
|
+
const { database } = context;
|
|
49708
|
+
const under = "substr(f.local_path, 1, length(?)) = ?";
|
|
49709
|
+
const inside = /* @__PURE__ */ __name((folder) => folder.endsWith(sep) ? folder : `${folder}${sep}`, "inside");
|
|
49710
|
+
const save2 = /* @__PURE__ */ __name((key2, file) => write(database, () => {
|
|
49711
|
+
const accountId = accountPk(context, key2);
|
|
49712
|
+
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);
|
|
49713
|
+
}), "save");
|
|
49714
|
+
const rowsOf2 = /* @__PURE__ */ __name((key2, columns2, where, ...params) => {
|
|
49715
|
+
const accountId = findAccountPk(context, key2);
|
|
49716
|
+
if (accountId === void 0)
|
|
49717
|
+
return [];
|
|
49718
|
+
return database.prepare(`SELECT ${columns2} FROM crm_files f WHERE f.account_id = ? AND ${where}`).all(accountId, ...params);
|
|
49719
|
+
}, "rowsOf");
|
|
49720
|
+
const find2 = /* @__PURE__ */ __name(({ words: words4, anyWord = false, exact = false, accounts: accounts2, viewers = [], limit }) => {
|
|
49721
|
+
const match = matchOf2(words4, anyWord, exact);
|
|
49722
|
+
if (!match)
|
|
49723
|
+
return { items: [], hasMore: false };
|
|
49724
|
+
const most = Math.min(Math.max(limit ?? 100, 1), MOST);
|
|
49725
|
+
const scoped2 = accounts2?.map((one2) => findAccountPk(context, one2)).filter((one2) => one2 !== void 0) ?? [];
|
|
49726
|
+
if (accounts2 !== void 0 && !scoped2.length)
|
|
49727
|
+
return { items: [], hasMore: false };
|
|
49728
|
+
const limits = viewers.flatMap((viewer) => {
|
|
49729
|
+
const id2 = findAccountPk(context, viewer.account);
|
|
49730
|
+
return id2 === void 0 ? [] : [{ id: id2, assignee: viewer.assignee }];
|
|
49731
|
+
});
|
|
49732
|
+
const params = [match];
|
|
49733
|
+
let sql2 = `SELECT ${COLUMNS7}, f.text, a.provider, a.external_id AS account FROM crm_files f JOIN accounts a ON a.id = f.account_id JOIN (SELECT rowid, rank FROM crm_file_words WHERE crm_file_words MATCH ?) w ON w.rowid = f.id WHERE 1`;
|
|
49734
|
+
if (accounts2 !== void 0) {
|
|
49735
|
+
sql2 += ` AND f.account_id IN (${scoped2.map(() => "?").join(", ")})`;
|
|
49736
|
+
for (const id2 of scoped2)
|
|
49737
|
+
params.push(id2);
|
|
49738
|
+
}
|
|
49739
|
+
for (const one2 of limits) {
|
|
49740
|
+
if (one2.assignee === null) {
|
|
49741
|
+
sql2 += " AND f.account_id <> ?";
|
|
49742
|
+
params.push(one2.id);
|
|
49743
|
+
continue;
|
|
49744
|
+
}
|
|
49745
|
+
sql2 += ` AND (f.account_id <> ? OR CASE f.owner_kind WHEN 'deal' THEN ${CURRENTLY("deals")} WHEN 'lead' THEN ${CURRENTLY("leads")} ELSE f.owner_assignee = ? END)`;
|
|
49746
|
+
params.push(one2.id, one2.assignee, one2.assignee, one2.assignee);
|
|
49747
|
+
}
|
|
49748
|
+
sql2 += " ORDER BY w.rank, f.downloaded_at DESC, f.id DESC LIMIT ?";
|
|
49749
|
+
params.push(most + 1);
|
|
49750
|
+
const hits = database.prepare(sql2).all(...params).map((row2) => ({
|
|
49751
|
+
account: { provider: String(row2.provider), account: String(row2.account) },
|
|
49752
|
+
file: rowOf2(row2),
|
|
49753
|
+
excerpt: excerptOf(String(row2.text ?? ""), words4)
|
|
49754
|
+
}));
|
|
49755
|
+
return pageOfRows(hits, most);
|
|
49756
|
+
}, "find");
|
|
49757
|
+
return {
|
|
49758
|
+
save: /* @__PURE__ */ __name(async (key2, file) => save2(key2, file), "save"),
|
|
49759
|
+
get: /* @__PURE__ */ __name(async (key2, externalId) => {
|
|
49760
|
+
const [row2] = rowsOf2(key2, `${COLUMNS7}, f.text`, "f.external_id = ?", externalId);
|
|
49761
|
+
return row2 ? { ...rowOf2(row2), text: text5(row2.text) } : void 0;
|
|
49762
|
+
}, "get"),
|
|
49763
|
+
ofOwner: /* @__PURE__ */ __name(async (key2, kind3, id2) => rowsOf2(key2, COLUMNS7, "f.owner_kind = ? AND f.owner_id = ? ORDER BY f.downloaded_at DESC, f.id DESC", kind3, id2).map(rowOf2), "ofOwner"),
|
|
49764
|
+
storedBytes: /* @__PURE__ */ __name(async (key2, folder) => rowsOf2(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"),
|
|
49765
|
+
droppable: /* @__PURE__ */ __name(async (key2, folder) => rowsOf2(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"),
|
|
49766
|
+
savedPaths: /* @__PURE__ */ __name(async (key2) => rowsOf2(key2, "f.local_path", "f.local_path IS NOT NULL ORDER BY f.id").map((row2) => String(row2.local_path)), "savedPaths"),
|
|
49767
|
+
forgetFile: /* @__PURE__ */ __name(async (key2, externalId) => {
|
|
49768
|
+
const accountId = findAccountPk(context, key2);
|
|
49769
|
+
if (accountId === void 0)
|
|
49770
|
+
return;
|
|
49771
|
+
write(database, () => database.prepare("UPDATE crm_files SET local_path = NULL WHERE account_id = ? AND external_id = ?").run(accountId, externalId));
|
|
49772
|
+
}, "forgetFile"),
|
|
49773
|
+
find: /* @__PURE__ */ __name(async (search2) => find2(search2), "find"),
|
|
49774
|
+
limits: /* @__PURE__ */ __name(async (key2) => crmFileLimits(database, key2), "limits")
|
|
49775
|
+
};
|
|
49776
|
+
}, "crmFilesOver");
|
|
49777
|
+
|
|
49778
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/content.js
|
|
49779
|
+
var MOST2 = 500;
|
|
49780
|
+
var TABLE = {
|
|
49781
|
+
author: "content_authors",
|
|
49782
|
+
term: "content_terms",
|
|
49783
|
+
post: "content_posts"
|
|
49784
|
+
};
|
|
49785
|
+
var definedOnly = /* @__PURE__ */ __name((record3) => Object.fromEntries(Object.entries(record3).filter(([, value]) => value !== void 0)), "definedOnly");
|
|
49786
|
+
var itemOf = /* @__PURE__ */ __name((kind3, row2) => ({
|
|
49787
|
+
kind: kind3,
|
|
49788
|
+
record: JSON.parse(String(row2.data)),
|
|
49789
|
+
deletedAt: row2.deleted_at == null ? null : Number(row2.deleted_at),
|
|
49790
|
+
syncedAt: Number(row2.synced_at)
|
|
49791
|
+
}), "itemOf");
|
|
49792
|
+
var contentHashOf = /* @__PURE__ */ __name((post) => createHash13("sha256").update(JSON.stringify([post.title ?? null, post.body ?? null])).digest("hex"), "contentHashOf");
|
|
49793
|
+
var resetContentPostWords = /* @__PURE__ */ __name((database) => {
|
|
49794
|
+
if (!database.prepare("SELECT 1 FROM sqlite_master WHERE name = 'content_post_words'").get())
|
|
49795
|
+
return 0;
|
|
49796
|
+
return write(database, () => {
|
|
49797
|
+
const update2 = database.prepare("UPDATE content_posts SET normalized_text = ? WHERE id = ?");
|
|
49798
|
+
for (const row2 of database.prepare("SELECT id, title, body, normalized_text FROM content_posts").all()) {
|
|
49799
|
+
const normalized = normalize([row2.title, row2.body].filter(Boolean).join("\n"));
|
|
49800
|
+
if (normalized !== row2.normalized_text)
|
|
49801
|
+
update2.run(normalized, Number(row2.id));
|
|
49802
|
+
}
|
|
49803
|
+
database.exec("INSERT INTO content_post_words (content_post_words) VALUES ('delete-all')");
|
|
49804
|
+
const { changes } = database.prepare("INSERT INTO content_post_words (rowid, normalized_text) SELECT id, normalized_text FROM content_posts WHERE normalized_text <> ''").run();
|
|
49805
|
+
return Number(changes);
|
|
49806
|
+
});
|
|
49807
|
+
}, "resetContentPostWords");
|
|
49808
|
+
var tagIdOf = /* @__PURE__ */ __name((context, term) => {
|
|
49809
|
+
const name = tagOf(term.slug ?? "") ?? tagOf(term.name);
|
|
49810
|
+
if (name === void 0)
|
|
49811
|
+
return null;
|
|
49812
|
+
try {
|
|
49813
|
+
return ensureTag(context, name).id;
|
|
49814
|
+
} catch (error) {
|
|
49815
|
+
if (isCliError(error))
|
|
49816
|
+
return null;
|
|
49817
|
+
throw error;
|
|
49818
|
+
}
|
|
49819
|
+
}, "tagIdOf");
|
|
49820
|
+
var contentStoreOver = /* @__PURE__ */ __name((context) => {
|
|
49821
|
+
const { database } = context;
|
|
49822
|
+
const keepRevision2 = /* @__PURE__ */ __name((postId2, row2, reason, now2) => database.prepare("INSERT INTO content_post_revisions (post_id, title, body, status, content_hash, version, reason, created_at) VALUES (?, ?, ?, ?, ?, ?, ?, ?)").run(postId2, row2.title ?? null, row2.body ?? null, String(row2.status), String(row2.content_hash), row2.version ?? null, reason, now2), "keepRevision");
|
|
49823
|
+
const tagPost = /* @__PURE__ */ __name((accountId, postId2, terms) => {
|
|
49824
|
+
const ids3 = terms.length ? database.prepare(`SELECT DISTINCT t.name FROM content_terms ct JOIN canonical_tags t ON t.id = ct.tag_id WHERE ct.account_id = ? AND ct.deleted_at IS NULL AND ct.external_id IN (${terms.map(() => "?").join(", ")})`).all(accountId, ...terms).map((row2) => String(row2.name)) : [];
|
|
49825
|
+
database.prepare("DELETE FROM taggings WHERE taggable_type = 'post' AND taggable_id = ? AND source = 'file' AND tag_id NOT IN (SELECT t.id FROM canonical_tags t JOIN json_each(?) j ON j.value = t.name)").run(postId2, JSON.stringify(ids3));
|
|
49826
|
+
if (ids3.length)
|
|
49827
|
+
addTags(context, { type: "post", id: postId2 }, ids3, "file");
|
|
49828
|
+
}, "tagPost");
|
|
49829
|
+
const savePost = /* @__PURE__ */ __name((accountId, record3, before2, now2, reason) => {
|
|
49830
|
+
const merged2 = {
|
|
49831
|
+
...before2 ? JSON.parse(String(before2.data)) : {},
|
|
49832
|
+
...definedOnly(record3)
|
|
49833
|
+
};
|
|
49834
|
+
const title2 = merged2.title ?? null;
|
|
49835
|
+
const body2 = merged2.body ?? null;
|
|
49836
|
+
const hash2 = contentHashOf(merged2);
|
|
49837
|
+
if (before2 && (before2.content_hash !== hash2 || before2.status !== merged2.status || before2.title !== title2))
|
|
49838
|
+
keepRevision2(Number(before2.id), before2, reason, now2);
|
|
49839
|
+
const row2 = database.prepare("INSERT INTO content_posts (account_id, external_id, channel_id, type, title, title_folded, body, content_hash, status, published_at, scheduled_for, source_created_at, source_updated_at, version, normalized_text, data, deleted_at, synced_at) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, NULL, ?) ON CONFLICT (account_id, external_id) DO UPDATE SET channel_id = excluded.channel_id, type = excluded.type, title = excluded.title, title_folded = excluded.title_folded, body = excluded.body, content_hash = excluded.content_hash, status = excluded.status, published_at = excluded.published_at, scheduled_for = excluded.scheduled_for, source_created_at = excluded.source_created_at, source_updated_at = excluded.source_updated_at, version = excluded.version, normalized_text = excluded.normalized_text, data = excluded.data, deleted_at = NULL, synced_at = excluded.synced_at RETURNING id").get(accountId, merged2.externalId, merged2.channel ?? null, merged2.type ?? "post", title2, fold(title2 ?? ""), body2, hash2, merged2.status, merged2.publishedAt ?? null, merged2.scheduledFor ?? null, merged2.createdAt ?? null, merged2.updatedAt ?? null, merged2.version ?? null, normalize([title2, body2].filter(Boolean).join("\n")), JSON.stringify(merged2), now2);
|
|
49840
|
+
tagPost(accountId, Number(row2?.id), merged2.terms ?? []);
|
|
49841
|
+
}, "savePost");
|
|
49842
|
+
const save2 = /* @__PURE__ */ __name((key2, kind3, records2, now2, reason) => write(database, () => {
|
|
49843
|
+
const accountId = accountPk(context, key2);
|
|
49844
|
+
const stored4 = database.prepare(`SELECT * FROM ${TABLE[kind3]} WHERE account_id = ? AND external_id = ?`);
|
|
49845
|
+
for (const record3 of records2) {
|
|
49846
|
+
const before2 = stored4.get(accountId, record3.externalId);
|
|
49847
|
+
if (kind3 === "post") {
|
|
49848
|
+
savePost(accountId, record3, before2, now2, reason);
|
|
49849
|
+
continue;
|
|
49850
|
+
}
|
|
49851
|
+
const merged2 = {
|
|
49852
|
+
...before2 ? JSON.parse(String(before2.data)) : {},
|
|
49853
|
+
...definedOnly(record3)
|
|
49854
|
+
};
|
|
49855
|
+
if (kind3 === "author")
|
|
49856
|
+
database.prepare("INSERT INTO content_authors (account_id, external_id, name, email, data, source_updated_at, deleted_at, synced_at) VALUES (?, ?, ?, ?, ?, ?, NULL, ?) ON CONFLICT (account_id, external_id) DO UPDATE SET name = excluded.name, email = excluded.email, data = excluded.data, source_updated_at = excluded.source_updated_at, deleted_at = NULL, synced_at = excluded.synced_at").run(accountId, merged2.externalId, merged2.name, merged2.email ?? null, JSON.stringify(merged2), merged2.updatedAt ?? null, now2);
|
|
49857
|
+
else
|
|
49858
|
+
database.prepare("INSERT INTO content_terms (account_id, external_id, kind, name, slug, parent_id, tag_id, data, source_updated_at, deleted_at, synced_at) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, NULL, ?) ON CONFLICT (account_id, external_id) DO UPDATE SET kind = excluded.kind, name = excluded.name, slug = excluded.slug, parent_id = excluded.parent_id, tag_id = excluded.tag_id, data = excluded.data, source_updated_at = excluded.source_updated_at, deleted_at = NULL, synced_at = excluded.synced_at").run(accountId, merged2.externalId, merged2.kind, merged2.name, merged2.slug ?? null, merged2.parent ?? null, tagIdOf(context, merged2), JSON.stringify(merged2), merged2.updatedAt ?? null, now2);
|
|
49859
|
+
}
|
|
49860
|
+
return records2.length;
|
|
49861
|
+
}), "save");
|
|
49862
|
+
const mark = /* @__PURE__ */ __name((accountId, kind3, row2, now2) => {
|
|
49863
|
+
if (kind3 === "post") {
|
|
49864
|
+
keepRevision2(Number(row2.id), row2, "deleted", now2);
|
|
49865
|
+
database.prepare("DELETE FROM taggings WHERE taggable_type = 'post' AND taggable_id = ? AND source = 'file'").run(Number(row2.id));
|
|
49866
|
+
}
|
|
49867
|
+
database.prepare(`UPDATE ${TABLE[kind3]} SET deleted_at = ? WHERE id = ? AND account_id = ?`).run(now2, Number(row2.id), accountId);
|
|
49868
|
+
}, "mark");
|
|
49869
|
+
const unlisted = /* @__PURE__ */ __name((key2, kind3, listed, before2) => {
|
|
49870
|
+
const accountId = findAccountPk(context, key2);
|
|
49871
|
+
if (accountId === void 0)
|
|
49872
|
+
return [];
|
|
49873
|
+
const keep2 = new Set(listed);
|
|
49874
|
+
return database.prepare(`SELECT external_id FROM ${TABLE[kind3]} WHERE account_id = ? AND deleted_at IS NULL AND synced_at < ?`).all(accountId, before2).map((row2) => String(row2.external_id)).filter((id2) => !keep2.has(id2));
|
|
49875
|
+
}, "unlisted");
|
|
49876
|
+
const list2 = /* @__PURE__ */ __name((key2, kind3, filter = {}) => {
|
|
49877
|
+
const accountId = findAccountPk(context, key2);
|
|
49878
|
+
if (accountId === void 0)
|
|
49879
|
+
return { items: [], hasMore: false };
|
|
49880
|
+
const limit = Math.min(Math.max(filter.limit ?? 100, 1), MOST2);
|
|
49881
|
+
const params = [accountId];
|
|
49882
|
+
let sql2 = `SELECT t.* FROM ${TABLE[kind3]} t WHERE t.account_id = ? AND t.deleted_at IS NULL`;
|
|
49883
|
+
if (kind3 === "post") {
|
|
49884
|
+
if (filter.channel !== void 0) {
|
|
49885
|
+
sql2 += " AND t.channel_id = ?";
|
|
49886
|
+
params.push(filter.channel);
|
|
49887
|
+
}
|
|
49888
|
+
if (filter.statuses?.length) {
|
|
49889
|
+
sql2 += ` AND t.status IN (${filter.statuses.map(() => "?").join(", ")})`;
|
|
49890
|
+
params.push(...filter.statuses);
|
|
49891
|
+
}
|
|
49892
|
+
if (filter.type !== void 0) {
|
|
49893
|
+
sql2 += " AND t.type = ?";
|
|
49894
|
+
params.push(filter.type);
|
|
49895
|
+
}
|
|
49896
|
+
for (const [field4, value] of [
|
|
49897
|
+
["terms", filter.term],
|
|
49898
|
+
["authors", filter.author]
|
|
49899
|
+
])
|
|
49900
|
+
if (value !== void 0) {
|
|
49901
|
+
sql2 += ` AND EXISTS (SELECT 1 FROM json_each(t.data, '$.${field4}') j WHERE j.value = ?)`;
|
|
49902
|
+
params.push(value);
|
|
49903
|
+
}
|
|
49904
|
+
if (filter.since !== void 0) {
|
|
49905
|
+
sql2 += " AND t.published_at >= ?";
|
|
49906
|
+
params.push(filter.since);
|
|
49907
|
+
}
|
|
49908
|
+
if (filter.until !== void 0) {
|
|
49909
|
+
sql2 += " AND t.published_at < ?";
|
|
49910
|
+
params.push(filter.until);
|
|
49911
|
+
}
|
|
49912
|
+
}
|
|
49913
|
+
sql2 += " ORDER BY coalesce(t.source_updated_at, t.synced_at) DESC, t.id DESC LIMIT ? OFFSET ?";
|
|
49914
|
+
params.push(limit + 1, filter.offset ?? 0);
|
|
49915
|
+
const rows = database.prepare(sql2).all(...params);
|
|
49916
|
+
return { items: rows.slice(0, limit).map((row2) => itemOf(kind3, row2)), hasMore: rows.length > limit };
|
|
49917
|
+
}, "list");
|
|
49918
|
+
const find2 = /* @__PURE__ */ __name(({ words: words4, anyWord = false, exact = false, accounts: accounts2, limit, offset = 0 }) => {
|
|
49919
|
+
const match = matchOf2(words4, anyWord, exact);
|
|
49920
|
+
if (!match)
|
|
49921
|
+
return { items: [], hasMore: false };
|
|
49922
|
+
const most = Math.min(Math.max(limit ?? 100, 1), MOST2);
|
|
49923
|
+
const scoped2 = accounts2?.map((one2) => findAccountPk(context, one2)).filter((one2) => one2 !== void 0) ?? [];
|
|
49924
|
+
if (accounts2 !== void 0 && !scoped2.length)
|
|
49925
|
+
return { items: [], hasMore: false };
|
|
49926
|
+
const params = [match];
|
|
49927
|
+
let sql2 = "SELECT t.*, a.provider, a.external_id AS account FROM content_posts t JOIN accounts a ON a.id = t.account_id JOIN (SELECT rowid, rank FROM content_post_words WHERE content_post_words MATCH ?) w ON w.rowid = t.id WHERE t.deleted_at IS NULL";
|
|
49928
|
+
if (accounts2 !== void 0) {
|
|
49929
|
+
sql2 += ` AND t.account_id IN (${scoped2.map(() => "?").join(", ")})`;
|
|
49930
|
+
params.push(...scoped2);
|
|
49931
|
+
}
|
|
49932
|
+
sql2 += " ORDER BY w.rank, t.source_updated_at DESC, t.id DESC LIMIT ? OFFSET ?";
|
|
49933
|
+
params.push(most + 1, offset);
|
|
49934
|
+
const rows = database.prepare(sql2).all(...params);
|
|
49935
|
+
return {
|
|
49936
|
+
items: rows.slice(0, most).map((row2) => ({
|
|
49937
|
+
account: { provider: String(row2.provider), account: String(row2.account) },
|
|
49938
|
+
item: itemOf("post", row2),
|
|
49939
|
+
excerpt: excerptOf([row2.title, row2.body].filter(Boolean).join("\n"), words4)
|
|
49940
|
+
})),
|
|
49941
|
+
hasMore: rows.length > most
|
|
49942
|
+
};
|
|
49943
|
+
}, "find");
|
|
49944
|
+
const postId = /* @__PURE__ */ __name((key2, post) => {
|
|
49945
|
+
const accountId = findAccountPk(context, key2);
|
|
49946
|
+
if (accountId === void 0)
|
|
49947
|
+
return void 0;
|
|
49948
|
+
const row2 = database.prepare("SELECT id FROM content_posts WHERE account_id = ? AND external_id = ?").get(accountId, post);
|
|
49949
|
+
return row2 ? Number(row2.id) : void 0;
|
|
49950
|
+
}, "postId");
|
|
49951
|
+
return {
|
|
49952
|
+
saveChannels: /* @__PURE__ */ __name(async (key2, channels, now2) => write(database, () => {
|
|
49953
|
+
const accountId = accountPk(context, key2);
|
|
49954
|
+
const upsert2 = database.prepare("INSERT INTO content_channels (account_id, external_id, kind, network, name, url, handle, deleted_at, synced_at) VALUES (?, ?, ?, ?, ?, ?, ?, NULL, ?) ON CONFLICT (account_id, external_id) DO UPDATE SET kind = excluded.kind, network = excluded.network, name = excluded.name, url = excluded.url, handle = excluded.handle, deleted_at = NULL, synced_at = excluded.synced_at");
|
|
49955
|
+
for (const one2 of channels)
|
|
49956
|
+
upsert2.run(accountId, one2.externalId, one2.kind, one2.network, one2.name, one2.url ?? null, one2.handle ?? null, now2);
|
|
49957
|
+
return channels.length;
|
|
49958
|
+
}), "saveChannels"),
|
|
49959
|
+
channels: /* @__PURE__ */ __name(async (key2) => {
|
|
49960
|
+
const accountId = findAccountPk(context, key2);
|
|
49961
|
+
if (accountId === void 0)
|
|
49962
|
+
return [];
|
|
49963
|
+
return database.prepare("SELECT * FROM content_channels WHERE account_id = ? AND deleted_at IS NULL ORDER BY id").all(accountId).map((row2) => ({
|
|
49964
|
+
externalId: String(row2.external_id),
|
|
49965
|
+
kind: String(row2.kind),
|
|
49966
|
+
network: String(row2.network),
|
|
49967
|
+
name: String(row2.name),
|
|
49968
|
+
url: row2.url == null ? null : String(row2.url),
|
|
49969
|
+
handle: row2.handle == null ? null : String(row2.handle)
|
|
49970
|
+
}));
|
|
49971
|
+
}, "channels"),
|
|
49972
|
+
save: /* @__PURE__ */ __name(async (key2, kind3, records2, now2, options) => save2(key2, kind3, records2, now2, options?.reason ?? "sync"), "save"),
|
|
49973
|
+
unlisted: /* @__PURE__ */ __name(async (key2, kind3, listed, before2) => unlisted(key2, kind3, listed, before2), "unlisted"),
|
|
49974
|
+
markDeleted: /* @__PURE__ */ __name(async (key2, kind3, externalId, now2) => {
|
|
49975
|
+
const accountId = findAccountPk(context, key2);
|
|
49976
|
+
if (accountId === void 0)
|
|
49977
|
+
return false;
|
|
49978
|
+
return write(database, () => {
|
|
49979
|
+
const row2 = database.prepare(`SELECT * FROM ${TABLE[kind3]} WHERE account_id = ? AND external_id = ? AND deleted_at IS NULL`).get(accountId, externalId);
|
|
49980
|
+
if (!row2)
|
|
49981
|
+
return false;
|
|
49982
|
+
mark(accountId, kind3, row2, now2);
|
|
49983
|
+
return true;
|
|
49984
|
+
});
|
|
49985
|
+
}, "markDeleted"),
|
|
49986
|
+
get: /* @__PURE__ */ __name(async (key2, kind3, externalId) => {
|
|
49987
|
+
const accountId = findAccountPk(context, key2);
|
|
49988
|
+
if (accountId === void 0)
|
|
49989
|
+
return void 0;
|
|
49990
|
+
const row2 = database.prepare(`SELECT * FROM ${TABLE[kind3]} WHERE account_id = ? AND external_id = ?`).get(accountId, externalId);
|
|
49991
|
+
return row2 ? itemOf(kind3, row2) : void 0;
|
|
49992
|
+
}, "get"),
|
|
49993
|
+
list: /* @__PURE__ */ __name(async (key2, kind3, filter) => list2(key2, kind3, filter), "list"),
|
|
49994
|
+
find: /* @__PURE__ */ __name(async (search2) => find2(search2), "find"),
|
|
49995
|
+
count: /* @__PURE__ */ __name(async (key2, kind3) => {
|
|
49996
|
+
const accountId = findAccountPk(context, key2);
|
|
49997
|
+
if (accountId === void 0)
|
|
49998
|
+
return 0;
|
|
49999
|
+
return Number(database.prepare(`SELECT count(*) AS n FROM ${TABLE[kind3]} WHERE account_id = ? AND deleted_at IS NULL`).get(accountId)?.n ?? 0);
|
|
50000
|
+
}, "count"),
|
|
50001
|
+
due: /* @__PURE__ */ __name(async (key2, now2) => {
|
|
50002
|
+
const accountId = findAccountPk(context, key2);
|
|
50003
|
+
if (accountId === void 0)
|
|
50004
|
+
return [];
|
|
50005
|
+
return database.prepare("SELECT external_id FROM content_posts WHERE account_id = ? AND deleted_at IS NULL AND status = 'scheduled' AND scheduled_for IS NOT NULL AND scheduled_for <= ? ORDER BY synced_at, scheduled_for, id").all(accountId, now2).map((row2) => String(row2.external_id));
|
|
50006
|
+
}, "due"),
|
|
50007
|
+
revisions: /* @__PURE__ */ __name(async (key2, post) => {
|
|
50008
|
+
const id2 = postId(key2, post);
|
|
50009
|
+
if (id2 === void 0)
|
|
50010
|
+
return [];
|
|
50011
|
+
return database.prepare("SELECT * FROM content_post_revisions WHERE post_id = ? ORDER BY created_at DESC, id DESC").all(id2).map((row2) => ({
|
|
50012
|
+
title: row2.title == null ? null : String(row2.title),
|
|
50013
|
+
body: row2.body == null ? null : String(row2.body),
|
|
50014
|
+
status: String(row2.status),
|
|
50015
|
+
contentHash: String(row2.content_hash),
|
|
50016
|
+
version: row2.version == null ? null : String(row2.version),
|
|
50017
|
+
reason: String(row2.reason),
|
|
50018
|
+
createdAt: Number(row2.created_at)
|
|
50019
|
+
}));
|
|
50020
|
+
}, "revisions"),
|
|
50021
|
+
saveMetrics: /* @__PURE__ */ __name(async (key2, metrics) => write(database, () => {
|
|
50022
|
+
const insert = database.prepare("INSERT INTO content_metrics (post_id, at, views, reactions, comments, shares, clicks, raw) VALUES (?, ?, ?, ?, ?, ?, ?, ?)");
|
|
50023
|
+
let saved = 0;
|
|
50024
|
+
for (const one2 of metrics) {
|
|
50025
|
+
const id2 = postId(key2, one2.post);
|
|
50026
|
+
if (id2 === void 0)
|
|
50027
|
+
continue;
|
|
50028
|
+
insert.run(id2, one2.at, one2.views ?? null, one2.reactions ?? null, one2.comments ?? null, one2.shares ?? null, one2.clicks ?? null, one2.raw === void 0 ? null : JSON.stringify(one2.raw));
|
|
50029
|
+
saved += 1;
|
|
50030
|
+
}
|
|
50031
|
+
return saved;
|
|
50032
|
+
}), "saveMetrics"),
|
|
50033
|
+
metrics: /* @__PURE__ */ __name(async (key2, post, limit = 100) => {
|
|
50034
|
+
const id2 = postId(key2, post);
|
|
50035
|
+
if (id2 === void 0)
|
|
50036
|
+
return [];
|
|
50037
|
+
return database.prepare("SELECT * FROM content_metrics WHERE post_id = ? ORDER BY at DESC, id DESC LIMIT ?").all(id2, Math.min(Math.max(limit, 1), MOST2)).map((row2) => ({
|
|
50038
|
+
post,
|
|
50039
|
+
at: Number(row2.at),
|
|
50040
|
+
...Object.fromEntries(["views", "reactions", "comments", "shares", "clicks"].flatMap((name) => row2[name] == null ? [] : [[name, Number(row2[name])]])),
|
|
50041
|
+
...row2.raw == null ? {} : { raw: JSON.parse(String(row2.raw)) }
|
|
50042
|
+
}));
|
|
50043
|
+
}, "metrics"),
|
|
50044
|
+
people: /* @__PURE__ */ __name(async (key2, authors) => {
|
|
50045
|
+
const accountId = findAccountPk(context, key2);
|
|
50046
|
+
if (accountId === void 0 || authors.length === 0)
|
|
50047
|
+
return [];
|
|
50048
|
+
return database.prepare(`SELECT u.external_id AS author, p.id AS person, p.name AS name FROM content_authors u JOIN identities i ON i.email IS NOT NULL AND lower(i.email) = lower(u.email) JOIN identity_links l ON l.identity_id = i.id JOIN persons p ON p.id = l.person_id WHERE u.account_id = ? AND u.external_id IN (${authors.map(() => "?").join(", ")}) GROUP BY u.external_id HAVING count(DISTINCT p.id) = 1 ORDER BY u.external_id`).all(accountId, ...authors).map((row2) => ({
|
|
50049
|
+
author: String(row2.author),
|
|
50050
|
+
person: `person:${String(row2.person)}`,
|
|
50051
|
+
name: row2.name == null ? null : String(row2.name)
|
|
50052
|
+
}));
|
|
50053
|
+
}, "people")
|
|
50054
|
+
};
|
|
50055
|
+
}, "contentStoreOver");
|
|
50056
|
+
|
|
50057
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/context-document-source.js
|
|
49526
50058
|
var remote = /* @__PURE__ */ __name(() => `CASE WHEN json_valid(n.front_matter) THEN json_extract(n.front_matter,'$.source') IN (${documentAccountProvidersSql()}) ELSE 0 END`, "remote");
|
|
49527
50059
|
var field3 = /* @__PURE__ */ __name((name) => `CASE WHEN (${remote()}) THEN
|
|
49528
50060
|
CASE WHEN json_type(n.front_matter,'$.${name}')='text' THEN json_extract(n.front_matter,'$.${name}') END END`, "field");
|
|
@@ -49535,7 +50067,7 @@ var contextDocumentTimeKind = /* @__PURE__ */ __name(() => `CASE WHEN (${remoteT
|
|
|
49535
50067
|
THEN 'source-modified' ELSE 'stored-update' END`, "contextDocumentTimeKind");
|
|
49536
50068
|
var contextDocumentUrl = /* @__PURE__ */ __name(() => `coalesce(${preferred("url")},n.url,${field3("sourceUrl")})`, "contextDocumentUrl");
|
|
49537
50069
|
|
|
49538
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
50070
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/context-meeting-source.js
|
|
49539
50071
|
var readMeetingContextEvidence = /* @__PURE__ */ __name((database, request) => {
|
|
49540
50072
|
const { source: source2, words: words4, after: after2, before: before2, limit, maxReadBytes, cursor, signal } = request;
|
|
49541
50073
|
signal?.throwIfAborted();
|
|
@@ -49634,7 +50166,7 @@ var readMeetingContextEvidence = /* @__PURE__ */ __name((database, request) => {
|
|
|
49634
50166
|
});
|
|
49635
50167
|
}, "readMeetingContextEvidence");
|
|
49636
50168
|
|
|
49637
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
50169
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/context-evidence.js
|
|
49638
50170
|
var corpora = {
|
|
49639
50171
|
message: {
|
|
49640
50172
|
table: "messages",
|
|
@@ -49879,7 +50411,7 @@ var contextRecordsOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
|
49879
50411
|
}
|
|
49880
50412
|
}), "contextRecordsOver");
|
|
49881
50413
|
|
|
49882
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
50414
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/crm-changes.js
|
|
49883
50415
|
var CRM_CHANGES = [
|
|
49884
50416
|
"created",
|
|
49885
50417
|
"moved",
|
|
@@ -49904,7 +50436,7 @@ var changesQuery = /* @__PURE__ */ __name((context, key2, filter) => {
|
|
|
49904
50436
|
const items = /* @__PURE__ */ __name((table, kind3) => `SELECT '${kind3}' AS kind, d.id, d.external_id, d.status, d.created_at, d.closed_date, json_extract(d.metadata, '$.assignee') AS owner, s.pipeline_id FROM ${table} d JOIN pipeline_stages s ON s.id = d.stage_id WHERE d.account_id = ?1 AND d.deleted_at IS NULL AND (?15 IS NULL OR json_extract(d.metadata, '$.assignee') = ?16)`, "items");
|
|
49905
50437
|
const entries = "SELECT r.id AS record, i.kind, i.id AS item, i.owner, i.pipeline_id, CAST(json_extract(r.fields, '$.at') AS INTEGER) AS at, CAST(json_extract(r.fields, '$.stage_id') AS INTEGER) AS stage, lag(CAST(json_extract(r.fields, '$.stage_id') AS INTEGER)) OVER (PARTITION BY i.kind, i.id ORDER BY json_extract(r.fields, '$.at'), r.id) AS before FROM records r JOIN record_relations rr ON rr.record_id = r.id AND rr.role = 'on' JOIN items i ON i.kind = rr.target_type AND i.external_id = rr.target_external_id WHERE r.account_id = ?1 AND r.type = ?2 AND r.deleted_at IS NULL";
|
|
49906
50438
|
const closing = "(SELECT outcome FROM pipeline_stages WHERE id = m.stage) IN ('won', 'lost')";
|
|
49907
|
-
const
|
|
50439
|
+
const itemOf3 = /* @__PURE__ */ __name((record3) => `(SELECT i.kind || ':' || i.id FROM record_relations rr JOIN items i ON i.kind = rr.target_type AND i.external_id = rr.target_external_id WHERE rr.record_id = ${record3} AND rr.role = 'on' LIMIT 1)`, "itemOf");
|
|
49908
50440
|
const closedAt = "(SELECT max(m.at) FROM entries m WHERE m.kind = i.kind AND m.item = i.id AND (SELECT outcome FROM pipeline_stages WHERE id = m.stage) = i.status)";
|
|
49909
50441
|
const onDealOrLead = "EXISTS (SELECT 1 FROM record_relations x WHERE x.record_id = a.id AND x.role = 'on' AND x.target_type IN ('deal', 'lead'))";
|
|
49910
50442
|
const linkedToSeen = "EXISTS (SELECT 1 FROM identities n JOIN identity_links l ON l.identity_id = n.id JOIN links k ON k.to_type = 'person' AND k.to_id = l.person_id AND k.deleted_at IS NULL JOIN items v ON v.kind = k.from_type AND v.id = k.from_id WHERE n.provider = ?17 AND n.external_id = ?18 || r.external_id)";
|
|
@@ -49915,7 +50447,7 @@ var changesQuery = /* @__PURE__ */ __name((context, key2, filter) => {
|
|
|
49915
50447
|
// The closed day only narrows the rows; the window is checked on `at`, so a deal is listed in one window only.
|
|
49916
50448
|
`SELECT i.status, coalesce(${closedAt}, CAST(strftime('%s', i.closed_date) AS INTEGER) * 1000 + ${HALF_DAY}), i.kind, i.id, NULL, NULL, NULL, ${closedAt} IS NOT NULL, i.owner, i.pipeline_id FROM items i WHERE i.status IN ('won', 'lost') AND i.closed_date BETWEEN ?8 AND ?9`,
|
|
49917
50449
|
"SELECT 'owner_changed', CAST(json_extract(r.fields, '$.at') AS INTEGER), i.kind, i.id, r.id, NULL, NULL, 0, json_extract(r.fields, '$.to'), i.pipeline_id FROM records r JOIN record_relations rr ON rr.record_id = r.id AND rr.role = 'on' JOIN items i ON i.kind = rr.target_type AND i.external_id = rr.target_external_id WHERE r.account_id = ?1 AND r.type = ?3 AND r.deleted_at IS NULL AND json_extract(r.fields, '$.at') BETWEEN ?6 AND ?7",
|
|
49918
|
-
...["created_at", "done_at"].map((field4) => `SELECT '${field4 === "created_at" ? "activity_added" : "activity_done"}', CAST(json_extract(a.fields, '$.${field4}') AS INTEGER), coalesce(substr(a.item, 1, instr(a.item, ':') - 1), a.target), CAST(substr(a.item, instr(a.item, ':') + 1) AS INTEGER), a.id, NULL, NULL, 0, coalesce((SELECT owner FROM items i WHERE i.kind || ':' || i.id = a.item), json_extract(a.fields, '$.assignee')), (SELECT pipeline_id FROM items i WHERE i.kind || ':' || i.id = a.item) FROM (SELECT r.id, r.fields, ${
|
|
50450
|
+
...["created_at", "done_at"].map((field4) => `SELECT '${field4 === "created_at" ? "activity_added" : "activity_done"}', CAST(json_extract(a.fields, '$.${field4}') AS INTEGER), coalesce(substr(a.item, 1, instr(a.item, ':') - 1), a.target), CAST(substr(a.item, instr(a.item, ':') + 1) AS INTEGER), a.id, NULL, NULL, 0, coalesce((SELECT owner FROM items i WHERE i.kind || ':' || i.id = a.item), json_extract(a.fields, '$.assignee')), (SELECT pipeline_id FROM items i WHERE i.kind || ':' || i.id = a.item) FROM (SELECT r.id, r.fields, ${itemOf3("r.id")} AS item, (SELECT target_type FROM record_relations WHERE record_id = r.id AND role = 'on' LIMIT 1) AS target FROM records r WHERE r.account_id = ?1 AND r.type = ?4 AND r.deleted_at IS NULL AND json_extract(r.fields, '$.${field4}') BETWEEN ?6 AND ?7` + // One that arrived done with no due date was done as it was made: its `activity_added` says it.
|
|
49919
50451
|
(field4 === "done_at" ? " AND NOT (json_extract(r.fields, '$.due_at') IS NULL AND json_extract(r.fields, '$.done_at') = json_extract(r.fields, '$.created_at'))" : "") + `) a WHERE ?15 IS NULL OR a.item IS NOT NULL OR (NOT ${onDealOrLead} AND json_extract(a.fields, '$.assignee') = ?16)`),
|
|
49920
50452
|
`SELECT 'person_added', CAST(json_extract(r.fields, '$.created_at') AS INTEGER), 'person', NULL, r.id, NULL, NULL, 0, json_extract(r.fields, '$.assignee'), NULL FROM records r WHERE r.account_id = ?1 AND r.type = ?5 AND r.deleted_at IS NULL AND json_extract(r.fields, '$.created_at') BETWEEN ?6 AND ?7 AND (?15 IS NULL OR json_extract(r.fields, '$.assignee') = ?16 OR ${linkedToSeen})`
|
|
49921
50453
|
];
|
|
@@ -50022,7 +50554,7 @@ var crmReadsOver = /* @__PURE__ */ __name((context) => {
|
|
|
50022
50554
|
};
|
|
50023
50555
|
}, "crmReadsOver");
|
|
50024
50556
|
|
|
50025
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
50557
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/crm-contacts.js
|
|
50026
50558
|
var PLACEHOLDER = /(?:^|\s)null(?:\s+#\d+)?(?=\s|$)/gi;
|
|
50027
50559
|
var withoutPlaceholder = /* @__PURE__ */ __name((name) => name.replace(PLACEHOLDER, " ").replace(/\s+/g, " ").trim() || null, "withoutPlaceholder");
|
|
50028
50560
|
var DryRun = class extends Error {
|
|
@@ -50101,7 +50633,7 @@ var removeCrmContacts = /* @__PURE__ */ __name((context, key2, { users, before:
|
|
|
50101
50633
|
}
|
|
50102
50634
|
}, "removeCrmContacts");
|
|
50103
50635
|
|
|
50104
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
50636
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/crm.js
|
|
50105
50637
|
var PENDING = "crm:pending-relations";
|
|
50106
50638
|
var PENDING_DAYS = 30;
|
|
50107
50639
|
var PENDING_MOST = 5e3;
|
|
@@ -50656,135 +51188,10 @@ var crmCopiesOver = /* @__PURE__ */ __name((context, people2) => {
|
|
|
50656
51188
|
};
|
|
50657
51189
|
}, "crmCopiesOver");
|
|
50658
51190
|
|
|
50659
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
50660
|
-
import {
|
|
50661
|
-
var MOST = 500;
|
|
50662
|
-
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");
|
|
50663
|
-
var EXCERPT = 240;
|
|
50664
|
-
var COLUMNS7 = "f.external_id, f.owner_kind, f.owner_id, f.owner_assignee, f.source, f.name, f.mime, f.size, f.external_created_at, f.local_path, f.content_sha256, f.extraction, f.extraction_error, f.downloaded_by, f.downloaded_at";
|
|
50665
|
-
var text5 = /* @__PURE__ */ __name((value) => value === null || value === void 0 ? null : String(value), "text");
|
|
50666
|
-
var number3 = /* @__PURE__ */ __name((value) => value === null || value === void 0 ? null : Number(value), "number");
|
|
50667
|
-
var rowOf2 = /* @__PURE__ */ __name((row2) => ({
|
|
50668
|
-
externalId: String(row2.external_id),
|
|
50669
|
-
ownerKind: String(row2.owner_kind),
|
|
50670
|
-
ownerId: String(row2.owner_id),
|
|
50671
|
-
ownerAssignee: text5(row2.owner_assignee),
|
|
50672
|
-
source: String(row2.source),
|
|
50673
|
-
name: String(row2.name),
|
|
50674
|
-
mime: text5(row2.mime),
|
|
50675
|
-
size: number3(row2.size),
|
|
50676
|
-
externalCreatedAt: number3(row2.external_created_at),
|
|
50677
|
-
localPath: text5(row2.local_path),
|
|
50678
|
-
contentSha256: text5(row2.content_sha256),
|
|
50679
|
-
extraction: text5(row2.extraction),
|
|
50680
|
-
extractionError: text5(row2.extraction_error),
|
|
50681
|
-
downloadedBy: text5(row2.downloaded_by),
|
|
50682
|
-
downloadedAt: Number(row2.downloaded_at)
|
|
50683
|
-
}), "rowOf");
|
|
50684
|
-
var matchOf2 = /* @__PURE__ */ __name((words4, anyWord, exact) => {
|
|
50685
|
-
const phrases = words4.map((word2) => normalize(word2).trim()).filter(Boolean).map((word2) => {
|
|
50686
|
-
const quoted6 = `"${word2.replaceAll('"', '""')}"`;
|
|
50687
|
-
return exact || /\s/u.test(word2) || word2.length < 3 ? quoted6 : `${quoted6}*`;
|
|
50688
|
-
});
|
|
50689
|
-
return phrases.length ? [...new Set(phrases)].join(anyWord ? " OR " : " AND ") : void 0;
|
|
50690
|
-
}, "matchOf");
|
|
50691
|
-
var excerptOf = /* @__PURE__ */ __name((body2, words4) => {
|
|
50692
|
-
const folded6 = fold(body2);
|
|
50693
|
-
const at2 = words4.map((word2) => folded6.indexOf(fold(word2).trim())).filter((index2) => index2 >= 0).sort((a, b) => a - b)[0];
|
|
50694
|
-
const start = Math.max(0, (at2 ?? 0) - EXCERPT / 4);
|
|
50695
|
-
return body2.slice(start, start + EXCERPT).replace(/\s+/gu, " ").trim();
|
|
50696
|
-
}, "excerptOf");
|
|
50697
|
-
var resetCrmFileWords = /* @__PURE__ */ __name((database) => {
|
|
50698
|
-
if (!database.prepare("SELECT 1 FROM sqlite_master WHERE name = 'crm_file_words'").get())
|
|
50699
|
-
return 0;
|
|
50700
|
-
return write(database, () => {
|
|
50701
|
-
const update2 = database.prepare("UPDATE crm_files SET normalized_text = ? WHERE id = ?");
|
|
50702
|
-
for (const row2 of database.prepare("SELECT id, text, normalized_text FROM crm_files WHERE text IS NOT NULL").all()) {
|
|
50703
|
-
const normalized = normalize(String(row2.text));
|
|
50704
|
-
if (normalized !== row2.normalized_text)
|
|
50705
|
-
update2.run(normalized, Number(row2.id));
|
|
50706
|
-
}
|
|
50707
|
-
database.exec("INSERT INTO crm_file_words (crm_file_words) VALUES ('delete-all')");
|
|
50708
|
-
const { changes } = database.prepare("INSERT INTO crm_file_words (rowid, normalized_text) SELECT id, normalized_text FROM crm_files WHERE normalized_text <> ''").run();
|
|
50709
|
-
return Number(changes);
|
|
50710
|
-
});
|
|
50711
|
-
}, "resetCrmFileWords");
|
|
50712
|
-
var crmFilesOver = /* @__PURE__ */ __name((context) => {
|
|
50713
|
-
const { database } = context;
|
|
50714
|
-
const under = "substr(f.local_path, 1, length(?)) = ?";
|
|
50715
|
-
const inside = /* @__PURE__ */ __name((folder) => folder.endsWith(sep) ? folder : `${folder}${sep}`, "inside");
|
|
50716
|
-
const save2 = /* @__PURE__ */ __name((key2, file) => write(database, () => {
|
|
50717
|
-
const accountId = accountPk(context, key2);
|
|
50718
|
-
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);
|
|
50719
|
-
}), "save");
|
|
50720
|
-
const rowsOf2 = /* @__PURE__ */ __name((key2, columns2, where, ...params) => {
|
|
50721
|
-
const accountId = findAccountPk(context, key2);
|
|
50722
|
-
if (accountId === void 0)
|
|
50723
|
-
return [];
|
|
50724
|
-
return database.prepare(`SELECT ${columns2} FROM crm_files f WHERE f.account_id = ? AND ${where}`).all(accountId, ...params);
|
|
50725
|
-
}, "rowsOf");
|
|
50726
|
-
const find2 = /* @__PURE__ */ __name(({ words: words4, anyWord = false, exact = false, accounts: accounts2, viewers = [], limit }) => {
|
|
50727
|
-
const match = matchOf2(words4, anyWord, exact);
|
|
50728
|
-
if (!match)
|
|
50729
|
-
return { items: [], hasMore: false };
|
|
50730
|
-
const most = Math.min(Math.max(limit ?? 100, 1), MOST);
|
|
50731
|
-
const scoped2 = accounts2?.map((one2) => findAccountPk(context, one2)).filter((one2) => one2 !== void 0) ?? [];
|
|
50732
|
-
if (accounts2 !== void 0 && !scoped2.length)
|
|
50733
|
-
return { items: [], hasMore: false };
|
|
50734
|
-
const limits = viewers.flatMap((viewer) => {
|
|
50735
|
-
const id2 = findAccountPk(context, viewer.account);
|
|
50736
|
-
return id2 === void 0 ? [] : [{ id: id2, assignee: viewer.assignee }];
|
|
50737
|
-
});
|
|
50738
|
-
const params = [match];
|
|
50739
|
-
let sql2 = `SELECT ${COLUMNS7}, f.text, a.provider, a.external_id AS account FROM crm_files f JOIN accounts a ON a.id = f.account_id JOIN (SELECT rowid, rank FROM crm_file_words WHERE crm_file_words MATCH ?) w ON w.rowid = f.id WHERE 1`;
|
|
50740
|
-
if (accounts2 !== void 0) {
|
|
50741
|
-
sql2 += ` AND f.account_id IN (${scoped2.map(() => "?").join(", ")})`;
|
|
50742
|
-
for (const id2 of scoped2)
|
|
50743
|
-
params.push(id2);
|
|
50744
|
-
}
|
|
50745
|
-
for (const one2 of limits) {
|
|
50746
|
-
if (one2.assignee === null) {
|
|
50747
|
-
sql2 += " AND f.account_id <> ?";
|
|
50748
|
-
params.push(one2.id);
|
|
50749
|
-
continue;
|
|
50750
|
-
}
|
|
50751
|
-
sql2 += ` AND (f.account_id <> ? OR CASE f.owner_kind WHEN 'deal' THEN ${CURRENTLY("deals")} WHEN 'lead' THEN ${CURRENTLY("leads")} ELSE f.owner_assignee = ? END)`;
|
|
50752
|
-
params.push(one2.id, one2.assignee, one2.assignee, one2.assignee);
|
|
50753
|
-
}
|
|
50754
|
-
sql2 += " ORDER BY w.rank, f.downloaded_at DESC, f.id DESC LIMIT ?";
|
|
50755
|
-
params.push(most + 1);
|
|
50756
|
-
const hits = database.prepare(sql2).all(...params).map((row2) => ({
|
|
50757
|
-
account: { provider: String(row2.provider), account: String(row2.account) },
|
|
50758
|
-
file: rowOf2(row2),
|
|
50759
|
-
excerpt: excerptOf(String(row2.text ?? ""), words4)
|
|
50760
|
-
}));
|
|
50761
|
-
return pageOfRows(hits, most);
|
|
50762
|
-
}, "find");
|
|
50763
|
-
return {
|
|
50764
|
-
save: /* @__PURE__ */ __name(async (key2, file) => save2(key2, file), "save"),
|
|
50765
|
-
get: /* @__PURE__ */ __name(async (key2, externalId) => {
|
|
50766
|
-
const [row2] = rowsOf2(key2, `${COLUMNS7}, f.text`, "f.external_id = ?", externalId);
|
|
50767
|
-
return row2 ? { ...rowOf2(row2), text: text5(row2.text) } : void 0;
|
|
50768
|
-
}, "get"),
|
|
50769
|
-
ofOwner: /* @__PURE__ */ __name(async (key2, kind3, id2) => rowsOf2(key2, COLUMNS7, "f.owner_kind = ? AND f.owner_id = ? ORDER BY f.downloaded_at DESC, f.id DESC", kind3, id2).map(rowOf2), "ofOwner"),
|
|
50770
|
-
storedBytes: /* @__PURE__ */ __name(async (key2, folder) => rowsOf2(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"),
|
|
50771
|
-
droppable: /* @__PURE__ */ __name(async (key2, folder) => rowsOf2(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"),
|
|
50772
|
-
savedPaths: /* @__PURE__ */ __name(async (key2) => rowsOf2(key2, "f.local_path", "f.local_path IS NOT NULL ORDER BY f.id").map((row2) => String(row2.local_path)), "savedPaths"),
|
|
50773
|
-
forgetFile: /* @__PURE__ */ __name(async (key2, externalId) => {
|
|
50774
|
-
const accountId = findAccountPk(context, key2);
|
|
50775
|
-
if (accountId === void 0)
|
|
50776
|
-
return;
|
|
50777
|
-
write(database, () => database.prepare("UPDATE crm_files SET local_path = NULL WHERE account_id = ? AND external_id = ?").run(accountId, externalId));
|
|
50778
|
-
}, "forgetFile"),
|
|
50779
|
-
find: /* @__PURE__ */ __name(async (search2) => find2(search2), "find"),
|
|
50780
|
-
limits: /* @__PURE__ */ __name(async (key2) => crmFileLimits(database, key2), "limits")
|
|
50781
|
-
};
|
|
50782
|
-
}, "crmFilesOver");
|
|
50783
|
-
|
|
50784
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.699.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_13ea275dd452fd1070c59d86b8d8c388/node_modules/@wirecat/cli-core/dist/store/sqlite/decision-requests.js
|
|
50785
|
-
import { createHash as createHash13, randomBytes as randomBytes2 } from "node:crypto";
|
|
51191
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/decision-requests.js
|
|
51192
|
+
import { createHash as createHash14, randomBytes as randomBytes2 } from "node:crypto";
|
|
50786
51193
|
|
|
50787
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
51194
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/decision-requests.js
|
|
50788
51195
|
var DECISION_ACTIONS = ["confirm", "reject", "ask-confirm", "ask-reject", "back", "later"];
|
|
50789
51196
|
var DECISION_TTL_MS = 72 * 60 * 60 * 1e3;
|
|
50790
51197
|
var CALLBACK_PREFIX = "wcr1:";
|
|
@@ -50798,8 +51205,8 @@ var callbackDataOf = /* @__PURE__ */ __name((token) => {
|
|
|
50798
51205
|
}, "callbackDataOf");
|
|
50799
51206
|
var parseCallbackData = /* @__PURE__ */ __name((data) => typeof data === "string" ? CALLBACK.exec(data)?.[1] : void 0, "parseCallbackData");
|
|
50800
51207
|
|
|
50801
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
50802
|
-
var digestOf = /* @__PURE__ */ __name((token) =>
|
|
51208
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/decision-requests.js
|
|
51209
|
+
var digestOf = /* @__PURE__ */ __name((token) => createHash14("sha256").update(token).digest("hex"), "digestOf");
|
|
50803
51210
|
var newToken = /* @__PURE__ */ __name(() => randomBytes2(16).toString("base64url"), "newToken");
|
|
50804
51211
|
var requestOf = /* @__PURE__ */ __name((row2) => ({
|
|
50805
51212
|
proposalId: row2.proposal_id,
|
|
@@ -50897,7 +51304,7 @@ var decisionRequestStoreOver = /* @__PURE__ */ __name(({ database, now: now2 })
|
|
|
50897
51304
|
};
|
|
50898
51305
|
}, "decisionRequestStoreOver");
|
|
50899
51306
|
|
|
50900
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
51307
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-listing.js
|
|
50901
51308
|
var MEETING_ROW_KINDS = ["meeting", "call", "event"];
|
|
50902
51309
|
var DAY8 = 864e5;
|
|
50903
51310
|
var JOINED = `(SELECT ce.event_id FROM calendar_entries ce JOIN events je ON je.id = ce.event_id
|
|
@@ -51284,7 +51691,7 @@ var meetingListingOver = /* @__PURE__ */ __name((context) => {
|
|
|
51284
51691
|
};
|
|
51285
51692
|
}, "meetingListingOver");
|
|
51286
51693
|
|
|
51287
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
51694
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/document-listing.js
|
|
51288
51695
|
var DOCUMENT_KINDS = [
|
|
51289
51696
|
"transcript",
|
|
51290
51697
|
"doc",
|
|
@@ -51521,7 +51928,7 @@ var documentListingOver = /* @__PURE__ */ __name((context) => {
|
|
|
51521
51928
|
};
|
|
51522
51929
|
}, "documentListingOver");
|
|
51523
51930
|
|
|
51524
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
51931
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/note-search.js
|
|
51525
51932
|
var NOTE_FIELDS = [
|
|
51526
51933
|
"text",
|
|
51527
51934
|
"exact",
|
|
@@ -52018,7 +52425,7 @@ var noteSearchOver = /* @__PURE__ */ __name((context) => {
|
|
|
52018
52425
|
};
|
|
52019
52426
|
}, "noteSearchOver");
|
|
52020
52427
|
|
|
52021
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
52428
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/event-search.js
|
|
52022
52429
|
var EVENT_FIELDS = ["text", "exact", "body", "title", "date", "in"];
|
|
52023
52430
|
var inEventAccounts = /* @__PURE__ */ __name((event2) => searchableCopy(event2, "c.account_id IN (SELECT CAST(value AS INTEGER) FROM json_each(?))"), "inEventAccounts");
|
|
52024
52431
|
var EVENT_CORPUS = {
|
|
@@ -52158,7 +52565,7 @@ var eventSearchOver = /* @__PURE__ */ __name((context) => {
|
|
|
52158
52565
|
};
|
|
52159
52566
|
}, "eventSearchOver");
|
|
52160
52567
|
|
|
52161
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
52568
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/facts.js
|
|
52162
52569
|
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";
|
|
52163
52570
|
var iso13 = /* @__PURE__ */ __name((value) => new Date(Number(value)).toISOString(), "iso");
|
|
52164
52571
|
var oneOf5 = /* @__PURE__ */ __name((value, allowed, what) => {
|
|
@@ -52421,7 +52828,7 @@ var factsStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
52421
52828
|
};
|
|
52422
52829
|
}, "factsStoreOver");
|
|
52423
52830
|
|
|
52424
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
52831
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/findings-core.js
|
|
52425
52832
|
var invalid4 = /* @__PURE__ */ __name((message3) => {
|
|
52426
52833
|
throw new CliError("validation_error", message3);
|
|
52427
52834
|
}, "invalid");
|
|
@@ -52589,7 +52996,7 @@ var findingsCoreOver = /* @__PURE__ */ __name((context, kind3) => {
|
|
|
52589
52996
|
return { snapshot: snapshot2, snapshotParts, previous, settle, keepWaiting, named: named2, sameDecision, create };
|
|
52590
52997
|
}, "findingsCoreOver");
|
|
52591
52998
|
|
|
52592
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
52999
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/evidence-findings.js
|
|
52593
53000
|
var stale = /* @__PURE__ */ __name(() => {
|
|
52594
53001
|
throw new CliError("validation_error", "evidence findings changed since they were read; stage a new batch", {
|
|
52595
53002
|
reason: "evidence-findings.stale"
|
|
@@ -52853,7 +53260,7 @@ var evidenceFindingsStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
52853
53260
|
};
|
|
52854
53261
|
}, "evidenceFindingsStoreOver");
|
|
52855
53262
|
|
|
52856
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
53263
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/involvements.js
|
|
52857
53264
|
var pendingInvolvements = /* @__PURE__ */ __name((database) => Number(database.prepare("SELECT count(*) AS n FROM involvement_pending").get()?.n ?? 0), "pendingInvolvements");
|
|
52858
53265
|
var involvementStoreOver = /* @__PURE__ */ __name(({ database, now: now2 }) => ({
|
|
52859
53266
|
rebuild: /* @__PURE__ */ __name((personId) => write(database, () => {
|
|
@@ -52907,7 +53314,7 @@ var involvementStoreOver = /* @__PURE__ */ __name(({ database, now: now2 }) => (
|
|
|
52907
53314
|
}, "forPerson")
|
|
52908
53315
|
}), "involvementStoreOver");
|
|
52909
53316
|
|
|
52910
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
53317
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/labelled.js
|
|
52911
53318
|
var LABELLED = {
|
|
52912
53319
|
note: "note",
|
|
52913
53320
|
document: "document",
|
|
@@ -52920,8 +53327,8 @@ var LABELLED = {
|
|
|
52920
53327
|
};
|
|
52921
53328
|
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");
|
|
52922
53329
|
|
|
52923
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
52924
|
-
import { createHash as
|
|
53330
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-projects.js
|
|
53331
|
+
import { createHash as createHash15 } from "node:crypto";
|
|
52925
53332
|
var fields3 = "id,from_id,to_id,source,confirmed,updated_at,length(evidence) AS evidenceLength,substr(evidence,1,2000) AS evidence";
|
|
52926
53333
|
var id = /* @__PURE__ */ __name((value) => {
|
|
52927
53334
|
if (typeof value !== "string" || !/^[1-9]\d*$/.test(value) || !Number.isSafeInteger(Number(value)))
|
|
@@ -52950,7 +53357,7 @@ var meetingProjectsStoreOver = /* @__PURE__ */ __name(({ database, now: now2 })
|
|
|
52950
53357
|
project: `project:${row2.to_id}`,
|
|
52951
53358
|
confirmed: Number(row2.confirmed) === 1,
|
|
52952
53359
|
provenance: row2.evidence == null ? null : String(row2.evidence),
|
|
52953
|
-
fingerprint:
|
|
53360
|
+
fingerprint: createHash15("sha256").update(JSON.stringify([row2.id, row2.from_id, row2.to_id, row2.source, row2.confirmed, row2.evidence, row2.updated_at])).digest("hex")
|
|
52954
53361
|
};
|
|
52955
53362
|
}, "linkOf");
|
|
52956
53363
|
return {
|
|
@@ -53006,7 +53413,7 @@ var meetingProjectsStoreOver = /* @__PURE__ */ __name(({ database, now: now2 })
|
|
|
53006
53413
|
};
|
|
53007
53414
|
}, "meetingProjectsStoreOver");
|
|
53008
53415
|
|
|
53009
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
53416
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/knowledge-query.js
|
|
53010
53417
|
var ORGANIZATIONS_QUERY = {
|
|
53011
53418
|
entity: "organization",
|
|
53012
53419
|
backend: "sql",
|
|
@@ -53047,7 +53454,7 @@ var REMINDERS_QUERY = {
|
|
|
53047
53454
|
})
|
|
53048
53455
|
};
|
|
53049
53456
|
|
|
53050
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
53457
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/organization-categories.js
|
|
53051
53458
|
var OWN2 = "(SELECT id FROM organizations WHERE deleted_at IS NULL AND json_extract(metadata, '$.own') = 1)";
|
|
53052
53459
|
var EMPLOYED = "('employee', 'contractor', 'founder')";
|
|
53053
53460
|
var categorySql = /* @__PURE__ */ __name(({ category, accounts: accounts2 }, now2) => {
|
|
@@ -53068,7 +53475,7 @@ var categorySql = /* @__PURE__ */ __name(({ category, accounts: accounts2 }, now
|
|
|
53068
53475
|
return { sql: `EXISTS (SELECT 1 FROM links l WHERE ${where} AND ${usable})`, params: keys };
|
|
53069
53476
|
}, "categorySql");
|
|
53070
53477
|
|
|
53071
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
53478
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/organizations.js
|
|
53072
53479
|
var organizationOf = /* @__PURE__ */ __name((row2) => ({
|
|
53073
53480
|
id: String(row2.id),
|
|
53074
53481
|
ref: `organization:${row2.id}`,
|
|
@@ -53113,7 +53520,7 @@ var organizationsStoreOver = /* @__PURE__ */ __name(({ database, now: now2 }) =>
|
|
|
53113
53520
|
}), "setOwnOrganization")
|
|
53114
53521
|
}), "organizationsStoreOver");
|
|
53115
53522
|
|
|
53116
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
53523
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/relation-list.js
|
|
53117
53524
|
var KINDS = RELATION_KINDS.map(linkKind).join(", ");
|
|
53118
53525
|
var ACCOUNT_ENDS = [
|
|
53119
53526
|
["deal", "deals"],
|
|
@@ -53276,13 +53683,13 @@ var relationListOver = /* @__PURE__ */ __name((context) => {
|
|
|
53276
53683
|
__name(proposalItem, "proposalItem");
|
|
53277
53684
|
}, "relationListOver");
|
|
53278
53685
|
|
|
53279
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
53686
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/relation-reads.js
|
|
53280
53687
|
var relationReadsOver = /* @__PURE__ */ __name((context) => ({
|
|
53281
53688
|
...relationListOver(context),
|
|
53282
53689
|
...relationRolesOver(context)
|
|
53283
53690
|
}), "relationReadsOver");
|
|
53284
53691
|
|
|
53285
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
53692
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/source-review.js
|
|
53286
53693
|
var TABLES6 = { memory: "memories", fact: "facts" };
|
|
53287
53694
|
var RETIRED = /* @__PURE__ */ new Set(["superseded", "reversed", "rejected", "stale"]);
|
|
53288
53695
|
var DEFAULT_LIMIT = 500;
|
|
@@ -53525,16 +53932,16 @@ var sourceReviewStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
53525
53932
|
};
|
|
53526
53933
|
}, "sourceReviewStoreOver");
|
|
53527
53934
|
|
|
53528
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
53935
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/vocabulary.js
|
|
53936
|
+
import { createHash as createHash18 } from "node:crypto";
|
|
53937
|
+
|
|
53938
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/tag-consolidation.js
|
|
53529
53939
|
import { createHash as createHash17 } from "node:crypto";
|
|
53530
53940
|
|
|
53531
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
53941
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/tag-consolidation-apply.js
|
|
53532
53942
|
import { createHash as createHash16 } from "node:crypto";
|
|
53533
53943
|
|
|
53534
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
53535
|
-
import { createHash as createHash15 } from "node:crypto";
|
|
53536
|
-
|
|
53537
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.699.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_13ea275dd452fd1070c59d86b8d8c388/node_modules/@wirecat/cli-core/dist/store/sqlite/tag-consolidation-input.js
|
|
53944
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/tag-consolidation-input.js
|
|
53538
53945
|
var consolidationId = /* @__PURE__ */ __name((value, field4) => {
|
|
53539
53946
|
if (typeof value !== "string" || !/^[1-9]\d*$/.test(value) || !Number.isSafeInteger(Number(value)))
|
|
53540
53947
|
throw new CliError("validation_error", `${field4} must be a positive canonical tag id`);
|
|
@@ -53585,7 +53992,7 @@ var consolidationApplyInput = /* @__PURE__ */ __name((options) => {
|
|
|
53585
53992
|
return input;
|
|
53586
53993
|
}, "consolidationApplyInput");
|
|
53587
53994
|
|
|
53588
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
53995
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/tag-consolidation-apply.js
|
|
53589
53996
|
var receiptOf = /* @__PURE__ */ __name((row2) => ({
|
|
53590
53997
|
id: String(row2.id),
|
|
53591
53998
|
sourceId: String(row2.source_id),
|
|
@@ -53609,7 +54016,7 @@ var applyTagConsolidation = /* @__PURE__ */ __name((context, preview, options) =
|
|
|
53609
54016
|
check3();
|
|
53610
54017
|
return write(database, () => {
|
|
53611
54018
|
const owner = ownerPerson(database);
|
|
53612
|
-
const request =
|
|
54019
|
+
const request = createHash16("sha256").update(JSON.stringify([
|
|
53613
54020
|
source2,
|
|
53614
54021
|
survivor,
|
|
53615
54022
|
owner.type,
|
|
@@ -53660,7 +54067,7 @@ var applyTagConsolidation = /* @__PURE__ */ __name((context, preview, options) =
|
|
|
53660
54067
|
}, { beforeCommit: check3 });
|
|
53661
54068
|
}, "applyTagConsolidation");
|
|
53662
54069
|
|
|
53663
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
54070
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/tag-consolidation.js
|
|
53664
54071
|
var selections = [
|
|
53665
54072
|
["taggings", "tag_id IN (SELECT value FROM json_each(?))"],
|
|
53666
54073
|
["aliases", "aliasable_type='tag' AND aliasable_id IN (SELECT value FROM json_each(?))"],
|
|
@@ -53706,7 +54113,7 @@ var previewRows = /* @__PURE__ */ __name((context, options, source2, survivor, m
|
|
|
53706
54113
|
const memberIds = JSON.stringify([...sourceMemberIds, ...survivorMemberIds].map(Number));
|
|
53707
54114
|
const captured = JSON.stringify(graph);
|
|
53708
54115
|
let readBytes = Buffer.byteLength(captured);
|
|
53709
|
-
const hash2 =
|
|
54116
|
+
const hash2 = createHash17("sha256").update(JSON.stringify([source2, survivor, catalog.fingerprint, graph]));
|
|
53710
54117
|
for (const [table, where] of selections) {
|
|
53711
54118
|
cancelled(options);
|
|
53712
54119
|
const parameters = table === "links" ? [memberIds, memberIds] : [memberIds];
|
|
@@ -53804,7 +54211,7 @@ var previewRows = /* @__PURE__ */ __name((context, options, source2, survivor, m
|
|
|
53804
54211
|
};
|
|
53805
54212
|
}, "previewRows");
|
|
53806
54213
|
|
|
53807
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
54214
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/vocabulary.js
|
|
53808
54215
|
var kinds = ["project", "tag", "topic"];
|
|
53809
54216
|
var cancelled2 = /* @__PURE__ */ __name((signal) => {
|
|
53810
54217
|
if (signal?.aborted)
|
|
@@ -53896,7 +54303,7 @@ var vocabularyStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
53896
54303
|
cancelled2(options.signal);
|
|
53897
54304
|
return {
|
|
53898
54305
|
entries,
|
|
53899
|
-
fingerprint: `v1:${options.kind ?? "all"}:${options.scope ?? "all"}:${
|
|
54306
|
+
fingerprint: `v1:${options.kind ?? "all"}:${options.scope ?? "all"}:${createHash18("sha256").update(JSON.stringify(entries)).digest("hex")}`,
|
|
53900
54307
|
coverage: { complete: true, maxEntries, maxReadBytes }
|
|
53901
54308
|
};
|
|
53902
54309
|
}), "catalog");
|
|
@@ -54068,7 +54475,7 @@ var vocabularyStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
54068
54475
|
};
|
|
54069
54476
|
}, "vocabularyStoreOver");
|
|
54070
54477
|
|
|
54071
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
54478
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/knowledge.js
|
|
54072
54479
|
var TYPED_KEY_PREFIXES = new Set(Object.values(TASK_KEY_PREFIXES));
|
|
54073
54480
|
var ORGANIZATION_KINDS = ["company", "team", "family", "community"];
|
|
54074
54481
|
var PROJECT_TYPES = ["work", "client", "personal", "oss", "other"];
|
|
@@ -54622,7 +55029,7 @@ var projectKey = /* @__PURE__ */ __name((name) => {
|
|
|
54622
55029
|
return key2.padEnd(3, "X");
|
|
54623
55030
|
}, "projectKey");
|
|
54624
55031
|
|
|
54625
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
55032
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/log-pruning.js
|
|
54626
55033
|
var DAY9 = 864e5;
|
|
54627
55034
|
var SETTING5 = "logs_pruned_at";
|
|
54628
55035
|
var LOG_RETENTION = { agentActionsMs: 90 * DAY9, botUpdatePayloadsMs: 30 * DAY9 };
|
|
@@ -54649,7 +55056,7 @@ var logPruner = /* @__PURE__ */ __name((database, now2) => {
|
|
|
54649
55056
|
};
|
|
54650
55057
|
}, "logPruner");
|
|
54651
55058
|
|
|
54652
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
55059
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/mail/findings.js
|
|
54653
55060
|
var MAIL_FINDINGS_PER_RUN = 30;
|
|
54654
55061
|
var MAIL_FINDINGS_PER_SENDER = 5;
|
|
54655
55062
|
var invalid6 = /* @__PURE__ */ __name((message3) => {
|
|
@@ -55008,7 +55415,7 @@ var checkMailFindings = /* @__PURE__ */ __name((input) => {
|
|
|
55008
55415
|
}, "checkMailFindings");
|
|
55009
55416
|
var mailFindingFingerprint = /* @__PURE__ */ __name(({ id: _id, ...finding }) => findingHash(finding), "mailFindingFingerprint");
|
|
55010
55417
|
|
|
55011
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
55418
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/orders.js
|
|
55012
55419
|
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";
|
|
55013
55420
|
var orderOperationsOver = /* @__PURE__ */ __name((context) => {
|
|
55014
55421
|
const { database, now: now2 } = context;
|
|
@@ -55223,7 +55630,7 @@ var ordersStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
55223
55630
|
};
|
|
55224
55631
|
}, "ordersStoreOver");
|
|
55225
55632
|
|
|
55226
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
55633
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/mail-findings.js
|
|
55227
55634
|
var MAIL_EDITS = {
|
|
55228
55635
|
task: ["title", "type", "reason", "commitment", "project", "dueAt", "dueEvidence", "assignee", "assigneeEvidence"],
|
|
55229
55636
|
fact: ["statement", "type", "reason", "subject", "project"],
|
|
@@ -55712,7 +56119,7 @@ ${evidence.join("\n")}`, agent);
|
|
|
55712
56119
|
};
|
|
55713
56120
|
}, "mailFindingsStoreOver");
|
|
55714
56121
|
|
|
55715
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
56122
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-findings.js
|
|
55716
56123
|
var stale3 = /* @__PURE__ */ __name(() => {
|
|
55717
56124
|
throw new CliError("validation_error", "meeting findings changed since they were read; stage a new batch", {
|
|
55718
56125
|
reason: "meeting-findings.stale"
|
|
@@ -55925,7 +56332,7 @@ var meetingFindingsStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
55925
56332
|
};
|
|
55926
56333
|
}, "meetingFindingsStoreOver");
|
|
55927
56334
|
|
|
55928
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
56335
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-vectors.js
|
|
55929
56336
|
var RANK_BATCH = 512;
|
|
55930
56337
|
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";
|
|
55931
56338
|
var limitOf2 = /* @__PURE__ */ __name((value, name, max = 1e3) => {
|
|
@@ -56196,7 +56603,7 @@ var meetingVectorsOver = /* @__PURE__ */ __name((context) => ({
|
|
|
56196
56603
|
}
|
|
56197
56604
|
}), "meetingVectorsOver");
|
|
56198
56605
|
|
|
56199
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
56606
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/mention-sources.js
|
|
56200
56607
|
var OTHER_SOURCES = ["document", "note", "email"];
|
|
56201
56608
|
var TEXTS = {
|
|
56202
56609
|
document: "JOIN documents s ON mn.source_type = 'document' AND s.id = mn.source_id AND s.deleted_at IS NULL WHERE 1 ",
|
|
@@ -56297,7 +56704,7 @@ var sourceMentionStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
56297
56704
|
};
|
|
56298
56705
|
}, "sourceMentionStoreOver");
|
|
56299
56706
|
|
|
56300
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
56707
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/money-transactions.js
|
|
56301
56708
|
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";
|
|
56302
56709
|
var MAX_SPLITS = 100;
|
|
56303
56710
|
var transactionOperationsOver = /* @__PURE__ */ __name((context) => {
|
|
@@ -56531,11 +56938,11 @@ var transactionsStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
56531
56938
|
};
|
|
56532
56939
|
}, "transactionsStoreOver");
|
|
56533
56940
|
|
|
56534
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
56941
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/open-store.js
|
|
56535
56942
|
import { accessSync, constants, existsSync as existsSync2, mkdirSync as mkdirSync2, statSync as statSync2, writeFileSync as writeFileSync2 } from "node:fs";
|
|
56536
56943
|
import { dirname as dirname2 } from "node:path";
|
|
56537
56944
|
|
|
56538
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
56945
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/clients.js
|
|
56539
56946
|
import { readFileSync as readFileSync3 } from "node:fs";
|
|
56540
56947
|
var CLIENTS_SETTING = "clients";
|
|
56541
56948
|
var coreVersion = (() => {
|
|
@@ -56596,7 +57003,7 @@ var refusalAdvice = /* @__PURE__ */ __name((clients, command, schema) => {
|
|
|
56596
57003
|
return mover ? `${own} (${mover.command} ${mover.version} moved the store to schema ${schema})` : own;
|
|
56597
57004
|
}, "refusalAdvice");
|
|
56598
57005
|
|
|
56599
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
57006
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/migrations.generated.js
|
|
56600
57007
|
var GENERATED = [
|
|
56601
57008
|
{
|
|
56602
57009
|
"name": "20261010184427_initial",
|
|
@@ -57273,8 +57680,8 @@ WHERE json_type(params, '$.selection') = 'object';`
|
|
|
57273
57680
|
"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);",
|
|
57274
57681
|
"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);",
|
|
57275
57682
|
"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);",
|
|
57276
|
-
"-- 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);",
|
|
57277
|
-
"-- 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);",
|
|
57683
|
+
"-- 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);",
|
|
57684
|
+
"-- 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);",
|
|
57278
57685
|
"DELETE FROM accounts WHERE id IN (SELECT folder_id FROM temp.drive_moves);",
|
|
57279
57686
|
"DROP TABLE temp.drive_moves;"
|
|
57280
57687
|
]
|
|
@@ -58010,10 +58417,36 @@ WHERE json_type(params, '$.selection') = 'object';`
|
|
|
58010
58417
|
"CREATE TRIGGER tracker_item_words_au AFTER UPDATE OF normalized_text ON tracker_items\n WHEN old.normalized_text IS NOT new.normalized_text BEGIN\n DELETE FROM tracker_item_words WHERE rowid = old.id;\n INSERT INTO tracker_item_words (rowid, normalized_text)\n SELECT new.id, new.normalized_text WHERE new.normalized_text <> '';\nEND;",
|
|
58011
58418
|
"CREATE TRIGGER tracker_item_words_ad AFTER DELETE ON tracker_items BEGIN\n DELETE FROM tracker_item_words WHERE rowid = old.id;\nEND;"
|
|
58012
58419
|
]
|
|
58420
|
+
},
|
|
58421
|
+
{
|
|
58422
|
+
"name": "20261118230213_version-71-content",
|
|
58423
|
+
"statements": [
|
|
58424
|
+
"CREATE TABLE `content_authors` (\n `id` integer PRIMARY KEY,\n `account_id` integer NOT NULL,\n `external_id` text NOT NULL,\n `name` text NOT NULL,\n `email` text,\n `data` text NOT NULL,\n `source_updated_at` integer,\n `deleted_at` integer,\n `synced_at` integer NOT NULL,\n CONSTRAINT `fk_content_authors_account_id_accounts_id_fk` FOREIGN KEY (`account_id`) REFERENCES `accounts`(`id`),\n CONSTRAINT `content_authors_account_id_external_id_unique` UNIQUE(`account_id`,`external_id`)\n);",
|
|
58425
|
+
"CREATE TABLE `content_channels` (\n `id` integer PRIMARY KEY,\n `account_id` integer NOT NULL,\n `external_id` text NOT NULL,\n `kind` text NOT NULL,\n `network` text NOT NULL,\n `name` text NOT NULL,\n `url` text,\n `handle` text,\n `deleted_at` integer,\n `synced_at` integer NOT NULL,\n CONSTRAINT `fk_content_channels_account_id_accounts_id_fk` FOREIGN KEY (`account_id`) REFERENCES `accounts`(`id`),\n CONSTRAINT `content_channels_account_id_external_id_unique` UNIQUE(`account_id`,`external_id`)\n);",
|
|
58426
|
+
"CREATE TABLE `content_metrics` (\n `id` integer PRIMARY KEY,\n `post_id` integer NOT NULL,\n `at` integer NOT NULL,\n `views` integer,\n `reactions` integer,\n `comments` integer,\n `shares` integer,\n `clicks` integer,\n `raw` text,\n CONSTRAINT `fk_content_metrics_post_id_content_posts_id_fk` FOREIGN KEY (`post_id`) REFERENCES `content_posts`(`id`)\n);",
|
|
58427
|
+
"CREATE TABLE `content_post_revisions` (\n `id` integer PRIMARY KEY,\n `post_id` integer NOT NULL,\n `title` text,\n `body` text,\n `status` text NOT NULL,\n `content_hash` text NOT NULL,\n `version` text,\n `reason` text NOT NULL,\n `created_at` integer NOT NULL,\n CONSTRAINT `fk_content_post_revisions_post_id_content_posts_id_fk` FOREIGN KEY (`post_id`) REFERENCES `content_posts`(`id`)\n);",
|
|
58428
|
+
"CREATE TABLE `content_posts` (\n `id` integer PRIMARY KEY,\n `account_id` integer NOT NULL,\n `external_id` text NOT NULL,\n `channel_id` text,\n `type` text NOT NULL,\n `title` text,\n `title_folded` text NOT NULL,\n `body` text,\n `content_hash` text NOT NULL,\n `status` text NOT NULL,\n `published_at` integer,\n `scheduled_for` integer,\n `source_created_at` integer,\n `source_updated_at` integer,\n `version` text,\n `normalized_text` text NOT NULL,\n `data` text NOT NULL,\n `deleted_at` integer,\n `synced_at` integer NOT NULL,\n CONSTRAINT `fk_content_posts_account_id_accounts_id_fk` FOREIGN KEY (`account_id`) REFERENCES `accounts`(`id`),\n CONSTRAINT `content_posts_account_id_external_id_unique` UNIQUE(`account_id`,`external_id`)\n);",
|
|
58429
|
+
"CREATE TABLE `content_terms` (\n `id` integer PRIMARY KEY,\n `account_id` integer NOT NULL,\n `external_id` text NOT NULL,\n `kind` text NOT NULL,\n `name` text NOT NULL,\n `slug` text,\n `parent_id` text,\n `tag_id` integer,\n `data` text NOT NULL,\n `source_updated_at` integer,\n `deleted_at` integer,\n `synced_at` integer NOT NULL,\n CONSTRAINT `fk_content_terms_account_id_accounts_id_fk` FOREIGN KEY (`account_id`) REFERENCES `accounts`(`id`),\n CONSTRAINT `fk_content_terms_tag_id_canonical_tags_id_fk` FOREIGN KEY (`tag_id`) REFERENCES `canonical_tags`(`id`),\n CONSTRAINT `content_terms_account_id_external_id_unique` UNIQUE(`account_id`,`external_id`)\n);",
|
|
58430
|
+
"CREATE INDEX `content_metrics_by_post_id_at` ON `content_metrics` (`post_id`,`at`);",
|
|
58431
|
+
"CREATE INDEX `content_post_revisions_by_post_id_created_at` ON `content_post_revisions` (`post_id`,`created_at`);",
|
|
58432
|
+
"CREATE INDEX `content_posts_by_account_id_status` ON `content_posts` (`account_id`,`status`);",
|
|
58433
|
+
"CREATE INDEX `content_posts_by_account_id_published_at` ON `content_posts` (`account_id`,`published_at`);",
|
|
58434
|
+
"CREATE INDEX `content_terms_by_tag_id` ON `content_terms` (`tag_id`);"
|
|
58435
|
+
]
|
|
58436
|
+
},
|
|
58437
|
+
{
|
|
58438
|
+
"name": "20261118230214_version-71-content-words",
|
|
58439
|
+
"statements": [
|
|
58440
|
+
"-- Words of a post's title and text, rowid = content_posts.id.\nCREATE VIRTUAL TABLE content_post_words USING fts5(\n normalized_text,\n content = '', contentless_delete = 1,\n tokenize = 'unicode61 remove_diacritics 2', prefix = '3');",
|
|
58441
|
+
"CREATE VIRTUAL TABLE content_post_words_vocab USING fts5vocab(content_post_words, 'col');",
|
|
58442
|
+
"CREATE TRIGGER content_post_words_ai AFTER INSERT ON content_posts WHEN new.normalized_text <> '' BEGIN\n INSERT INTO content_post_words (rowid, normalized_text) VALUES (new.id, new.normalized_text);\nEND;",
|
|
58443
|
+
"CREATE TRIGGER content_post_words_au AFTER UPDATE OF normalized_text ON content_posts\n WHEN old.normalized_text IS NOT new.normalized_text BEGIN\n DELETE FROM content_post_words WHERE rowid = old.id;\n INSERT INTO content_post_words (rowid, normalized_text)\n SELECT new.id, new.normalized_text WHERE new.normalized_text <> '';\nEND;",
|
|
58444
|
+
"-- Taggings are polymorphic, with no foreign key: a post row that goes takes its tags along.\nCREATE TRIGGER content_post_words_ad AFTER DELETE ON content_posts BEGIN\n DELETE FROM content_post_words WHERE rowid = old.id;\n DELETE FROM taggings WHERE taggable_type = 'post' AND taggable_id = old.id;\nEND;"
|
|
58445
|
+
]
|
|
58013
58446
|
}
|
|
58014
58447
|
];
|
|
58015
58448
|
|
|
58016
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
58449
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/rollback-copy.js
|
|
58017
58450
|
import { mkdirSync, rmSync, statfsSync, writeFileSync } from "node:fs";
|
|
58018
58451
|
import { basename, dirname, join as join3, parse } from "node:path";
|
|
58019
58452
|
var DERIVED = /(_fts|_words|_stems|_trigrams|_pending)$|^(embeddings|chunks|chunk_messages|mentions|involvements|search_terms)$|^vector_index/;
|
|
@@ -58246,7 +58679,7 @@ var rollBack2 = /* @__PURE__ */ __name((database, path) => {
|
|
|
58246
58679
|
return { ...result, foreignKeyViolations };
|
|
58247
58680
|
}, "rollBack");
|
|
58248
58681
|
|
|
58249
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
58682
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/manifest.js
|
|
58250
58683
|
var V31_TABLES = [
|
|
58251
58684
|
"accounts",
|
|
58252
58685
|
"account_identities",
|
|
@@ -58382,7 +58815,9 @@ var MANIFEST = [
|
|
|
58382
58815
|
{ name: "20261117015456_version-69-conversation-readiness", version: 69, minCompatible: 56 },
|
|
58383
58816
|
{ name: "20261117015457_version-69-conversation-readiness-triggers", version: 69, minCompatible: 56 },
|
|
58384
58817
|
{ name: "20261117211410_version-70-tracker-items", version: 70, minCompatible: 56 },
|
|
58385
|
-
{ name: "20261117211414_version-70-tracker-item-words", version: 70, minCompatible: 56 }
|
|
58818
|
+
{ name: "20261117211414_version-70-tracker-item-words", version: 70, minCompatible: 56 },
|
|
58819
|
+
{ name: "20261118230213_version-71-content", version: 71, minCompatible: 56 },
|
|
58820
|
+
{ name: "20261118230214_version-71-content-words", version: 71, minCompatible: 56 }
|
|
58386
58821
|
];
|
|
58387
58822
|
var generatedMigrations = /* @__PURE__ */ __name((manifest = MANIFEST, generated = GENERATED) => {
|
|
58388
58823
|
const migrations = [];
|
|
@@ -58418,7 +58853,7 @@ var generatedMigrations = /* @__PURE__ */ __name((manifest = MANIFEST, generated
|
|
|
58418
58853
|
return migrations;
|
|
58419
58854
|
}, "generatedMigrations");
|
|
58420
58855
|
|
|
58421
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
58856
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/migrations.js
|
|
58422
58857
|
var MIGRATIONS = generatedMigrations();
|
|
58423
58858
|
var HISTORY = `CREATE TABLE IF NOT EXISTS schema_migrations (
|
|
58424
58859
|
version INTEGER PRIMARY KEY,
|
|
@@ -58515,7 +58950,7 @@ var migrate = /* @__PURE__ */ __name((database, { migrations = MIGRATIONS, now:
|
|
|
58515
58950
|
}
|
|
58516
58951
|
}, "migrate");
|
|
58517
58952
|
|
|
58518
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
58953
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/join-keys.js
|
|
58519
58954
|
var fillJoinKeys = /* @__PURE__ */ __name((database, { batch = 2e3 } = {}) => {
|
|
58520
58955
|
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 ?");
|
|
58521
58956
|
if (pending.get(0, 1) === void 0)
|
|
@@ -58537,7 +58972,7 @@ var fillJoinKeys = /* @__PURE__ */ __name((database, { batch = 2e3 } = {}) => {
|
|
|
58537
58972
|
}
|
|
58538
58973
|
}, "fillJoinKeys");
|
|
58539
58974
|
|
|
58540
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
58975
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/open.js
|
|
58541
58976
|
var openSqlite = /* @__PURE__ */ __name(async (path, { readOnly = false } = {}) => {
|
|
58542
58977
|
refuseOwnerStoreInTests(path);
|
|
58543
58978
|
const opened = "Bun" in globalThis ? await openUnderBun(path, readOnly) : await openUnderNode(path, readOnly);
|
|
@@ -58551,8 +58986,8 @@ var openSqlite = /* @__PURE__ */ __name(async (path, { readOnly = false } = {})
|
|
|
58551
58986
|
}, "openSqlite");
|
|
58552
58987
|
var openUnderNode = /* @__PURE__ */ __name(async (path, readOnly) => {
|
|
58553
58988
|
quietSqliteWarning();
|
|
58554
|
-
const { drizzle } = await import("./node-
|
|
58555
|
-
const { cacheOverNodeSqlite, nodeClient } = await import("./node-sqlite-
|
|
58989
|
+
const { drizzle } = await import("./node-3TSWTXGI.js");
|
|
58990
|
+
const { cacheOverNodeSqlite, nodeClient } = await import("./node-sqlite-UPQCG7DJ.js");
|
|
58556
58991
|
const client = await nodeClient(path, { readOnly });
|
|
58557
58992
|
try {
|
|
58558
58993
|
if (!readOnly)
|
|
@@ -58566,8 +59001,8 @@ var openUnderNode = /* @__PURE__ */ __name(async (path, readOnly) => {
|
|
|
58566
59001
|
}
|
|
58567
59002
|
}, "openUnderNode");
|
|
58568
59003
|
var openUnderBun = /* @__PURE__ */ __name(async (path, readOnly) => {
|
|
58569
|
-
const { bunClient, cacheOverBunSqlite } = await import("./bun-sqlite-
|
|
58570
|
-
const { drizzle } = await import("./bun-
|
|
59004
|
+
const { bunClient, cacheOverBunSqlite } = await import("./bun-sqlite-Y6KKH2OW.js");
|
|
59005
|
+
const { drizzle } = await import("./bun-ZJOOKIIW.js");
|
|
58571
59006
|
const client = await bunClient(path, readOnly ? { readonly: true, create: false } : void 0);
|
|
58572
59007
|
try {
|
|
58573
59008
|
if (!readOnly)
|
|
@@ -58581,7 +59016,7 @@ var openUnderBun = /* @__PURE__ */ __name(async (path, readOnly) => {
|
|
|
58581
59016
|
}
|
|
58582
59017
|
}, "openUnderBun");
|
|
58583
59018
|
|
|
58584
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
59019
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/payment-facts.js
|
|
58585
59020
|
var PAYMENT_FACTS_TO_MOVE = "payment_facts_to_move";
|
|
58586
59021
|
var paymentOf = /* @__PURE__ */ __name((metadata3) => {
|
|
58587
59022
|
try {
|
|
@@ -58649,7 +59084,7 @@ var movePaymentFacts = /* @__PURE__ */ __name((context) => {
|
|
|
58649
59084
|
});
|
|
58650
59085
|
}, "movePaymentFacts");
|
|
58651
59086
|
|
|
58652
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
59087
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/read-compatibility.js
|
|
58653
59088
|
var readCompatibility = /* @__PURE__ */ __name((database, command) => {
|
|
58654
59089
|
const ours = MIGRATIONS.at(-1)?.version ?? 0;
|
|
58655
59090
|
if (!database.prepare("SELECT 1 FROM sqlite_master WHERE type='table' AND name='schema_migrations'").get())
|
|
@@ -58667,7 +59102,7 @@ var assertReadCompatible = /* @__PURE__ */ __name((database, command) => {
|
|
|
58667
59102
|
throw new CliError("configuration_error", `The store needs schema ${MIGRATIONS.at(-1)?.version ?? 0} maintenance before a read-only open`);
|
|
58668
59103
|
}, "assertReadCompatible");
|
|
58669
59104
|
|
|
58670
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
59105
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/suggested-links.js
|
|
58671
59106
|
var SUGGESTED_LINKS_TO_MOVE = "suggested_links_to_move";
|
|
58672
59107
|
var proposerOf2 = /* @__PURE__ */ __name((provenance2) => {
|
|
58673
59108
|
if (provenance2?.startsWith("rule:"))
|
|
@@ -58713,7 +59148,7 @@ var moveSuggestedLinks = /* @__PURE__ */ __name((database, now2) => {
|
|
|
58713
59148
|
});
|
|
58714
59149
|
}, "moveSuggestedLinks");
|
|
58715
59150
|
|
|
58716
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
59151
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/test-accounts.js
|
|
58717
59152
|
var TEST_ACCOUNTS_TO_PURGE = "test_accounts_to_purge";
|
|
58718
59153
|
var TEST_PROVIDER = "chat";
|
|
58719
59154
|
var purgeTestAccounts = /* @__PURE__ */ __name((context, warn) => {
|
|
@@ -58734,7 +59169,7 @@ var purgeTestAccounts = /* @__PURE__ */ __name((context, warn) => {
|
|
|
58734
59169
|
}
|
|
58735
59170
|
}, "purgeTestAccounts");
|
|
58736
59171
|
|
|
58737
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
59172
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/open-store.js
|
|
58738
59173
|
var BACKFILL_ON_OPEN = 5e3;
|
|
58739
59174
|
var NOT_WRITABLE = /* @__PURE__ */ new Set(["EACCES", "EPERM", "EROFS"]);
|
|
58740
59175
|
var createWritable = /* @__PURE__ */ __name((file) => {
|
|
@@ -58846,7 +59281,7 @@ var openStoreContext = /* @__PURE__ */ __name(async (options = {}) => {
|
|
|
58846
59281
|
}
|
|
58847
59282
|
}, "openStoreContext");
|
|
58848
59283
|
|
|
58849
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
59284
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/products.js
|
|
58850
59285
|
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";
|
|
58851
59286
|
var productOperationsOver = /* @__PURE__ */ __name((context) => {
|
|
58852
59287
|
const { database, now: now2 } = context;
|
|
@@ -58954,13 +59389,13 @@ var productsStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
58954
59389
|
};
|
|
58955
59390
|
}, "productsStoreOver");
|
|
58956
59391
|
|
|
58957
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
58958
|
-
import { createHash as
|
|
59392
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/project-transfer/plan.js
|
|
59393
|
+
import { createHash as createHash20 } from "node:crypto";
|
|
58959
59394
|
|
|
58960
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
58961
|
-
import { createHash as
|
|
59395
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/project-transfer/manifest.js
|
|
59396
|
+
import { createHash as createHash19 } from "node:crypto";
|
|
58962
59397
|
|
|
58963
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
59398
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/project-transfer/schema.js
|
|
58964
59399
|
var text6 = /* @__PURE__ */ __name((max) => pipe(string(), minLength(1), maxLength(max)), "text");
|
|
58965
59400
|
var ref = text6(2048);
|
|
58966
59401
|
var timestamp2 = pipe(number(), safeInteger(), minValue(0));
|
|
@@ -59030,7 +59465,7 @@ var projectAnnotationsSchema = strictObject({
|
|
|
59030
59465
|
}))
|
|
59031
59466
|
});
|
|
59032
59467
|
|
|
59033
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
59468
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/project-transfer/manifest.js
|
|
59034
59469
|
var PROJECT_ANNOTATIONS_MAX_BYTES = 4 * 1024 * 1024;
|
|
59035
59470
|
var invalid9 = /* @__PURE__ */ __name((field4) => {
|
|
59036
59471
|
throw new CliError("validation_error", `invalid project annotations.${field4}`);
|
|
@@ -59160,10 +59595,10 @@ var projectAnnotationsFingerprint = /* @__PURE__ */ __name((json3) => {
|
|
|
59160
59595
|
links: manifest.links.toSorted((a, b) => a.ref.localeCompare(b.ref)),
|
|
59161
59596
|
external: manifest.external.toSorted((a, b) => a.ref.localeCompare(b.ref))
|
|
59162
59597
|
};
|
|
59163
|
-
return
|
|
59598
|
+
return createHash19("sha256").update(JSON.stringify(normalized)).digest("hex");
|
|
59164
59599
|
}, "projectAnnotationsFingerprint");
|
|
59165
59600
|
|
|
59166
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
59601
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/project-transfer/plan.js
|
|
59167
59602
|
var hash = pipe(string(), regex(/^[a-f0-9]{64}$/));
|
|
59168
59603
|
var ref2 = pipe(string(), minLength(1), maxLength(2048));
|
|
59169
59604
|
var targetSchema = strictObject({
|
|
@@ -59251,7 +59686,7 @@ var planBoundProjectAnnotations = /* @__PURE__ */ __name((manifest, manifest_fin
|
|
|
59251
59686
|
}
|
|
59252
59687
|
if (target.annotation_count > 0)
|
|
59253
59688
|
conflicts.push({ reference: target.project, reason: "populated" });
|
|
59254
|
-
const fingerprint2 =
|
|
59689
|
+
const fingerprint2 = createHash20("sha256").update(JSON.stringify({
|
|
59255
59690
|
manifest_fingerprint,
|
|
59256
59691
|
target: {
|
|
59257
59692
|
...checked3.output,
|
|
@@ -59270,8 +59705,8 @@ var planBoundProjectAnnotations = /* @__PURE__ */ __name((manifest, manifest_fin
|
|
|
59270
59705
|
}, "planBoundProjectAnnotations");
|
|
59271
59706
|
var planProjectAnnotations = /* @__PURE__ */ __name((json3, target, bindings) => planBoundProjectAnnotations(decodeProjectAnnotations(json3), projectAnnotationsFingerprint(json3), target, bindings), "planProjectAnnotations");
|
|
59272
59707
|
|
|
59273
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
59274
|
-
import { createHash as
|
|
59708
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/project-transfer/snapshot-model.js
|
|
59709
|
+
import { createHash as createHash21 } from "node:crypto";
|
|
59275
59710
|
var text7 = /* @__PURE__ */ __name((max) => pipe(string(), minLength(1), maxLength(max)), "text");
|
|
59276
59711
|
var timestamp3 = pipe(number(), safeInteger(), minValue(0));
|
|
59277
59712
|
var projectAnnotationSnapshotSchema = strictObject({
|
|
@@ -59355,7 +59790,7 @@ var decodeProjectAnnotationSnapshot = /* @__PURE__ */ __name((json3) => {
|
|
|
59355
59790
|
var projectAnnotationSnapshotFingerprint = /* @__PURE__ */ __name((json3) => {
|
|
59356
59791
|
const snapshot2 = decodeProjectAnnotationSnapshot(json3);
|
|
59357
59792
|
const order = /* @__PURE__ */ __name((a, b) => a.ref < b.ref ? -1 : a.ref > b.ref ? 1 : 0, "order");
|
|
59358
|
-
return
|
|
59793
|
+
return createHash21("sha256").update(JSON.stringify({
|
|
59359
59794
|
...snapshot2,
|
|
59360
59795
|
aliases: snapshot2.aliases.toSorted((a, b) => a.name < b.name ? -1 : a.name > b.name ? 1 : 0),
|
|
59361
59796
|
facts: snapshot2.facts.toSorted(order),
|
|
@@ -59364,7 +59799,7 @@ var projectAnnotationSnapshotFingerprint = /* @__PURE__ */ __name((json3) => {
|
|
|
59364
59799
|
})).digest("hex");
|
|
59365
59800
|
}, "projectAnnotationSnapshotFingerprint");
|
|
59366
59801
|
|
|
59367
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
59802
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/project-transfer/request.js
|
|
59368
59803
|
var projectAnnotationRequest = /* @__PURE__ */ __name((request, restore = false) => {
|
|
59369
59804
|
if (!request || typeof request !== "object" || Array.isArray(request))
|
|
59370
59805
|
throw new CliError("validation_error", "project annotation request is required");
|
|
@@ -59381,7 +59816,7 @@ var projectAnnotationRequest = /* @__PURE__ */ __name((request, restore = false)
|
|
|
59381
59816
|
return { snapshot: snapshot2, projectId: Number(request.project.slice(8)) };
|
|
59382
59817
|
}, "projectAnnotationRequest");
|
|
59383
59818
|
|
|
59384
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
59819
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/project-transfer/budget.js
|
|
59385
59820
|
var SnapshotBudget = class {
|
|
59386
59821
|
static {
|
|
59387
59822
|
__name(this, "SnapshotBudget");
|
|
@@ -59407,14 +59842,14 @@ var SnapshotBudget = class {
|
|
|
59407
59842
|
}
|
|
59408
59843
|
};
|
|
59409
59844
|
|
|
59410
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
59411
|
-
import { createHash as
|
|
59845
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/project-transfer/preview.js
|
|
59846
|
+
import { createHash as createHash23 } from "node:crypto";
|
|
59412
59847
|
|
|
59413
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
59848
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/project-transfer/snapshot-plan.js
|
|
59414
59849
|
var planProjectAnnotationSnapshot = /* @__PURE__ */ __name((json3, target, bindings) => planBoundProjectAnnotations(decodeProjectAnnotationSnapshot(json3), projectAnnotationSnapshotFingerprint(json3), target, bindings), "planProjectAnnotationSnapshot");
|
|
59415
59850
|
|
|
59416
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
59417
|
-
import { createHash as
|
|
59851
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/project-transfer/sources.js
|
|
59852
|
+
import { createHash as createHash22 } from "node:crypto";
|
|
59418
59853
|
var invalid11 = /* @__PURE__ */ __name(() => {
|
|
59419
59854
|
throw new CliError("configuration_error", "project snapshot has an unavailable or unsupported dependency");
|
|
59420
59855
|
}, "invalid");
|
|
@@ -59552,11 +59987,11 @@ var ProjectSnapshotSources = class {
|
|
|
59552
59987
|
return this.digest("meeting_transcript", [header, cues]);
|
|
59553
59988
|
}
|
|
59554
59989
|
digest(kind3, content2) {
|
|
59555
|
-
return
|
|
59990
|
+
return createHash22("sha256").update(JSON.stringify(["wirecat.project-source", 1, kind3, content2])).digest("hex");
|
|
59556
59991
|
}
|
|
59557
59992
|
};
|
|
59558
59993
|
|
|
59559
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
59994
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/project-transfer/snapshot.js
|
|
59560
59995
|
var unsupported = /* @__PURE__ */ __name(() => {
|
|
59561
59996
|
throw new CliError("configuration_error", "project snapshot has unsupported metadata, deletion or account scope");
|
|
59562
59997
|
}, "unsupported");
|
|
@@ -59734,7 +60169,7 @@ var projectAnnotationSnapshot = /* @__PURE__ */ __name((database, projectId2, bu
|
|
|
59734
60169
|
return { snapshot: snapshot2, read_bytes: budget.bytes, records: budget.records };
|
|
59735
60170
|
}), "projectAnnotationSnapshot");
|
|
59736
60171
|
|
|
59737
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
60172
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/project-transfer/preview.js
|
|
59738
60173
|
var previewAnnotationSnapshot = /* @__PURE__ */ __name((database, projectId2, manifest, bindings, budget) => read(database, () => {
|
|
59739
60174
|
const current2 = projectAnnotationSnapshot(database, projectId2, budget).snapshot;
|
|
59740
60175
|
const sources = new ProjectSnapshotSources(database, budget);
|
|
@@ -59775,7 +60210,7 @@ var previewAnnotationSnapshot = /* @__PURE__ */ __name((database, projectId2, ma
|
|
|
59775
60210
|
const target = {
|
|
59776
60211
|
project: current2.project.ref,
|
|
59777
60212
|
annotation_count: current2.aliases.length + current2.facts.length + current2.links.length,
|
|
59778
|
-
revision_sha256:
|
|
60213
|
+
revision_sha256: createHash23("sha256").update(JSON.stringify({
|
|
59779
60214
|
snapshot: projectAnnotationSnapshotFingerprint(JSON.stringify(current2)),
|
|
59780
60215
|
projects: projects2,
|
|
59781
60216
|
aliases: aliases2,
|
|
@@ -59790,13 +60225,13 @@ var previewAnnotationSnapshot = /* @__PURE__ */ __name((database, projectId2, ma
|
|
|
59790
60225
|
descriptor_conflicts,
|
|
59791
60226
|
namespace_conflicts,
|
|
59792
60227
|
ready: plan.ready && descriptor_conflicts.length === 0 && namespace_conflicts.length === 0,
|
|
59793
|
-
fingerprint:
|
|
60228
|
+
fingerprint: createHash23("sha256").update(JSON.stringify({ plan: plan.fingerprint, descriptor_conflicts, namespace_conflicts })).digest("hex"),
|
|
59794
60229
|
read_bytes: budget.bytes,
|
|
59795
60230
|
records: budget.records
|
|
59796
60231
|
};
|
|
59797
60232
|
}), "previewAnnotationSnapshot");
|
|
59798
60233
|
|
|
59799
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
60234
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/project-transfer/records.js
|
|
59800
60235
|
var metadataOf2 = /* @__PURE__ */ __name((database, link3, to) => {
|
|
59801
60236
|
const provenance2 = link3.provenance === null ? {} : { provenance: link3.provenance };
|
|
59802
60237
|
if (link3.kind === "evidence" && to)
|
|
@@ -59863,7 +60298,7 @@ var restoreAnnotationRecords = /* @__PURE__ */ __name((database, projectId2, sna
|
|
|
59863
60298
|
return mappings;
|
|
59864
60299
|
}, "restoreAnnotationRecords");
|
|
59865
60300
|
|
|
59866
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
60301
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/project-transfer/store.js
|
|
59867
60302
|
var projectAnnotationStoreOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
59868
60303
|
async preview(request) {
|
|
59869
60304
|
const { snapshot: snapshot2, projectId: projectId2 } = projectAnnotationRequest(request);
|
|
@@ -59893,7 +60328,7 @@ var projectAnnotationStoreOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
|
59893
60328
|
}
|
|
59894
60329
|
}), "projectAnnotationStoreOver");
|
|
59895
60330
|
|
|
59896
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
60331
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/record-relations.js
|
|
59897
60332
|
var isDerived = /* @__PURE__ */ __name((role) => role.startsWith("fields."), "isDerived");
|
|
59898
60333
|
var recordRelationsOver = /* @__PURE__ */ __name(({ database }) => {
|
|
59899
60334
|
const sql2 = /* @__PURE__ */ __name((text8) => database.prepare(text8), "sql");
|
|
@@ -59964,7 +60399,7 @@ var recordRelationsOver = /* @__PURE__ */ __name(({ database }) => {
|
|
|
59964
60399
|
return { entityRef, relatedOf, storedRelations, relate, missingOf };
|
|
59965
60400
|
}, "recordRelationsOver");
|
|
59966
60401
|
|
|
59967
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
60402
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/record-remap.js
|
|
59968
60403
|
var recordRemapOver = /* @__PURE__ */ __name(({ database, now: now2 }) => {
|
|
59969
60404
|
const pointedAt = /* @__PURE__ */ __name((type, id2) => {
|
|
59970
60405
|
for (const { table, pointer } of pointerPairs(database))
|
|
@@ -60018,7 +60453,7 @@ var recordRemapOver = /* @__PURE__ */ __name(({ database, now: now2 }) => {
|
|
|
60018
60453
|
return { pointedAt, remap };
|
|
60019
60454
|
}, "recordRemapOver");
|
|
60020
60455
|
|
|
60021
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
60456
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/record-run.js
|
|
60022
60457
|
var runs = 0;
|
|
60023
60458
|
var PAGE = 500;
|
|
60024
60459
|
var recordRunOver = /* @__PURE__ */ __name((context, writes) => {
|
|
@@ -60231,7 +60666,7 @@ var waitingPointer = /* @__PURE__ */ __name((index2, missing4) => {
|
|
|
60231
60666
|
return pointerOf("records", index2, "fields", key2);
|
|
60232
60667
|
}, "waitingPointer");
|
|
60233
60668
|
|
|
60234
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
60669
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/record-matching.js
|
|
60235
60670
|
var valuesOf = /* @__PURE__ */ __name((value) => (Array.isArray(value) ? value : [value]).filter((one2) => typeof one2 === "string"), "valuesOf");
|
|
60236
60671
|
var SCHEME = /^(email|domain|tax-id:[a-z]{2}|registration:[a-z]{2})$/;
|
|
60237
60672
|
var ORG_EMAIL = "org-email";
|
|
@@ -60397,7 +60832,7 @@ var renameMade = /* @__PURE__ */ __name(({ database, now: now2 }, type, id2, nam
|
|
|
60397
60832
|
]);
|
|
60398
60833
|
}, "renameMade");
|
|
60399
60834
|
|
|
60400
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
60835
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/record-projectors-direct.js
|
|
60401
60836
|
var productFields = /* @__PURE__ */ __name((fields4) => ({
|
|
60402
60837
|
name: given(fields4, "name"),
|
|
60403
60838
|
unit: given(fields4, "unit"),
|
|
@@ -60520,7 +60955,7 @@ var DIRECT_PROJECTORS = {
|
|
|
60520
60955
|
lead: dealProjector("lead")
|
|
60521
60956
|
};
|
|
60522
60957
|
|
|
60523
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
60958
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/record-projectors-document.js
|
|
60524
60959
|
var TEXT_ONLY = { storage: "text", localPath: null };
|
|
60525
60960
|
var textOf7 = /* @__PURE__ */ __name(({ fields: fields4, externalId }) => {
|
|
60526
60961
|
const text8 = String(fields4.text ?? "");
|
|
@@ -60589,7 +61024,7 @@ var DOCUMENT_PROJECTORS = {
|
|
|
60589
61024
|
}
|
|
60590
61025
|
};
|
|
60591
61026
|
|
|
60592
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
61027
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/record-projectors-money.js
|
|
60593
61028
|
var allocatedByOthers = /* @__PURE__ */ __name((context, paymentId) => {
|
|
60594
61029
|
const importer = authorActor(context, IMPORTER).actor;
|
|
60595
61030
|
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;
|
|
@@ -60799,7 +61234,7 @@ var MONEY_PROJECTORS = {
|
|
|
60799
61234
|
}
|
|
60800
61235
|
};
|
|
60801
61236
|
|
|
60802
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
61237
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/record-projectors-phone.js
|
|
60803
61238
|
var CALLS_CALENDAR = "calls";
|
|
60804
61239
|
var importOnly = /* @__PURE__ */ __name((source2, type) => {
|
|
60805
61240
|
if (!isImportedProvider(source2.provider))
|
|
@@ -60974,7 +61409,7 @@ var PHONE_PROJECTORS = {
|
|
|
60974
61409
|
}
|
|
60975
61410
|
};
|
|
60976
61411
|
|
|
60977
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
61412
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/record-projectors.js
|
|
60978
61413
|
var RECORD_PROJECTORS = {
|
|
60979
61414
|
...MONEY_PROJECTORS,
|
|
60980
61415
|
...DIRECT_PROJECTORS,
|
|
@@ -60985,7 +61420,7 @@ var RECORD_PROJECTORS = {
|
|
|
60985
61420
|
project: null
|
|
60986
61421
|
};
|
|
60987
61422
|
|
|
60988
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
61423
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/record-settling.js
|
|
60989
61424
|
var recordSettlingOver = /* @__PURE__ */ __name(({ database }, finance) => {
|
|
60990
61425
|
const sql2 = /* @__PURE__ */ __name((text8) => database.prepare(text8), "sql");
|
|
60991
61426
|
const freeOn = /* @__PURE__ */ __name((invoice, payment) => {
|
|
@@ -61047,8 +61482,8 @@ var recordSettlingOver = /* @__PURE__ */ __name(({ database }, finance) => {
|
|
|
61047
61482
|
return { settle, checkShares };
|
|
61048
61483
|
}, "recordSettlingOver");
|
|
61049
61484
|
|
|
61050
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
61051
|
-
import { createHash as
|
|
61485
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/record-stamps.js
|
|
61486
|
+
import { createHash as createHash24 } from "node:crypto";
|
|
61052
61487
|
var VOLATILE = /* @__PURE__ */ new Set(["id", "created_at", "updated_at", "metadata"]);
|
|
61053
61488
|
var content = /* @__PURE__ */ __name((row2) => row2 === void 0 ? null : Object.fromEntries(Object.entries(row2).filter(([column2]) => !VOLATILE.has(column2))), "content");
|
|
61054
61489
|
var importStampsOver = /* @__PURE__ */ __name(({ database }) => {
|
|
@@ -61056,14 +61491,14 @@ var importStampsOver = /* @__PURE__ */ __name(({ database }) => {
|
|
|
61056
61491
|
const { table } = RECORD_TYPES[type];
|
|
61057
61492
|
const parts = nestedOf(type).map(([, nested]) => database.prepare(`SELECT * FROM ${nested.table} WHERE ${nested.parent} = ? ORDER BY id`).all(id2).map((row3) => content(row3)));
|
|
61058
61493
|
const row2 = database.prepare(`SELECT * FROM ${table} WHERE id = ?`).get(id2);
|
|
61059
|
-
return
|
|
61494
|
+
return createHash24("sha256").update(JSON.stringify([content(row2), parts])).digest("hex");
|
|
61060
61495
|
}, "stateOf");
|
|
61061
61496
|
const stamp = /* @__PURE__ */ __name((type, id2) => database.prepare(`UPDATE ${RECORD_TYPES[type].table} SET metadata = json_set(coalesce(metadata, '{}'), '$.imported', ?) WHERE id = ?`).run(stateOf3(type, id2), id2), "stamp");
|
|
61062
61497
|
const untouched = /* @__PURE__ */ __name((type, id2) => database.prepare(`SELECT json_extract(metadata, '$.imported') AS stamp FROM ${RECORD_TYPES[type].table} WHERE id = ?`).get(id2)?.stamp === stateOf3(type, id2), "untouched");
|
|
61063
61498
|
return { stamp, untouched };
|
|
61064
61499
|
}, "importStampsOver");
|
|
61065
61500
|
|
|
61066
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
61501
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/subscriptions.js
|
|
61067
61502
|
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";
|
|
61068
61503
|
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";
|
|
61069
61504
|
var PRICE_REF = /^subscription_price:([1-9]\d{0,15})$/;
|
|
@@ -61300,7 +61735,7 @@ var subscriptionsStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
61300
61735
|
};
|
|
61301
61736
|
}, "subscriptionsStoreOver");
|
|
61302
61737
|
|
|
61303
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
61738
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/wallets.js
|
|
61304
61739
|
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";
|
|
61305
61740
|
var SIGNED = "CASE t.direction WHEN 'in' THEN t.amount ELSE -t.amount END";
|
|
61306
61741
|
var walletOperationsOver = /* @__PURE__ */ __name((context) => {
|
|
@@ -61425,7 +61860,7 @@ var walletsStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
61425
61860
|
};
|
|
61426
61861
|
}, "walletsStoreOver");
|
|
61427
61862
|
|
|
61428
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
61863
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/record-writes.js
|
|
61429
61864
|
var specOf = /* @__PURE__ */ __name((type) => RECORD_TYPES[type], "specOf");
|
|
61430
61865
|
var unsettled = /* @__PURE__ */ __name((fields4, relations) => recordFingerprint(fields4, relations.filter((relation) => !AMOUNT_ROLES.includes(relation.role))), "unsettled");
|
|
61431
61866
|
var tableOf2 = /* @__PURE__ */ __name((type) => typeof type === "string" && Object.hasOwn(DECIDED_TABLES, type) ? DECIDED_TABLES[type] : void 0, "tableOf");
|
|
@@ -61684,7 +62119,7 @@ var recordWritesOver = /* @__PURE__ */ __name((context) => {
|
|
|
61684
62119
|
return { writeOne, project: project2, completeDependents, entityRef, missingOf: relations.missingOf };
|
|
61685
62120
|
}, "recordWritesOver");
|
|
61686
62121
|
|
|
61687
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
62122
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/records.js
|
|
61688
62123
|
var LIMIT = 1e3;
|
|
61689
62124
|
var iso16 = /* @__PURE__ */ __name((value) => new Date(Number(value)).toISOString(), "iso");
|
|
61690
62125
|
var checkLimit = /* @__PURE__ */ __name((limit) => {
|
|
@@ -61908,7 +62343,7 @@ var recordStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
61908
62343
|
};
|
|
61909
62344
|
}, "recordStoreOver");
|
|
61910
62345
|
|
|
61911
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
62346
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/templates.js
|
|
61912
62347
|
var templateOf = /* @__PURE__ */ __name((row2) => ({
|
|
61913
62348
|
key: row2.key,
|
|
61914
62349
|
channel: row2.channel,
|
|
@@ -61963,21 +62398,21 @@ var storedTemplateBodies = /* @__PURE__ */ __name((database, key2, language) =>
|
|
|
61963
62398
|
return Object.fromEntries(rows.map((row2) => [row2.channel, row2.body]));
|
|
61964
62399
|
}, "storedTemplateBodies");
|
|
61965
62400
|
|
|
61966
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
62401
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/domain/tracker.js
|
|
61967
62402
|
var trackerTitleOf = /* @__PURE__ */ __name((kind3, record3) => kind3 === "issue" ? record3.title : kind3 === "comment" ? record3.body.split("\n")[0]?.slice(0, 120) || "(comment)" : record3.name, "trackerTitleOf");
|
|
61968
62403
|
var trackerBodyOf = /* @__PURE__ */ __name((kind3, record3) => kind3 === "comment" ? record3.body : kind3 === "issue" || kind3 === "project" ? record3.description : null, "trackerBodyOf");
|
|
61969
62404
|
var trackerParentOf = /* @__PURE__ */ __name((kind3, record3) => kind3 === "comment" ? record3.issue : kind3 === "state" || kind3 === "label" ? record3.team : kind3 === "issue" ? record3.team : null, "trackerParentOf");
|
|
61970
62405
|
|
|
61971
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
61972
|
-
var
|
|
61973
|
-
var
|
|
62406
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/tracker.js
|
|
62407
|
+
var MOST3 = 500;
|
|
62408
|
+
var itemOf2 = /* @__PURE__ */ __name((row2) => ({
|
|
61974
62409
|
kind: String(row2.kind),
|
|
61975
62410
|
record: JSON.parse(String(row2.data)),
|
|
61976
62411
|
deletedAt: row2.deleted_at == null ? null : Number(row2.deleted_at),
|
|
61977
62412
|
syncedAt: Number(row2.synced_at)
|
|
61978
62413
|
}), "itemOf");
|
|
61979
62414
|
var COLUMNS10 = "t.kind, t.data, t.deleted_at, t.synced_at";
|
|
61980
|
-
var
|
|
62415
|
+
var definedOnly2 = /* @__PURE__ */ __name((record3) => Object.fromEntries(Object.entries(record3).filter(([, value]) => value !== void 0)), "definedOnly");
|
|
61981
62416
|
var resetTrackerItemWords = /* @__PURE__ */ __name((database) => {
|
|
61982
62417
|
if (!database.prepare("SELECT 1 FROM sqlite_master WHERE name = 'tracker_item_words'").get())
|
|
61983
62418
|
return 0;
|
|
@@ -62004,7 +62439,7 @@ var trackerStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
62004
62439
|
const before2 = stored4.get(accountId, kind3, record3.externalId);
|
|
62005
62440
|
const merged2 = {
|
|
62006
62441
|
...before2 ? JSON.parse(String(before2.data)) : {},
|
|
62007
|
-
...
|
|
62442
|
+
...definedOnly2(record3)
|
|
62008
62443
|
};
|
|
62009
62444
|
const title2 = trackerTitleOf(kind3, merged2);
|
|
62010
62445
|
const body2 = trackerBodyOf(kind3, merged2) ?? null;
|
|
@@ -62034,7 +62469,7 @@ var trackerStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
62034
62469
|
const accountId = findAccountPk(context, key2);
|
|
62035
62470
|
if (accountId === void 0)
|
|
62036
62471
|
return { items: [], hasMore: false };
|
|
62037
|
-
const limit = Math.min(Math.max(filter.limit ?? 100, 1),
|
|
62472
|
+
const limit = Math.min(Math.max(filter.limit ?? 100, 1), MOST3);
|
|
62038
62473
|
const params = [accountId, kind3];
|
|
62039
62474
|
let sql2 = `SELECT ${COLUMNS10} FROM tracker_items t WHERE t.account_id = ? AND t.kind = ? AND t.deleted_at IS NULL`;
|
|
62040
62475
|
if (!filter.archived)
|
|
@@ -62066,13 +62501,13 @@ var trackerStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
62066
62501
|
sql2 += " ORDER BY coalesce(t.source_updated_at, t.synced_at) DESC, t.id DESC LIMIT ? OFFSET ?";
|
|
62067
62502
|
params.push(limit + 1, filter.offset ?? 0);
|
|
62068
62503
|
const rows = database.prepare(sql2).all(...params);
|
|
62069
|
-
return { items: rows.slice(0, limit).map((row2) =>
|
|
62504
|
+
return { items: rows.slice(0, limit).map((row2) => itemOf2(row2)), hasMore: rows.length > limit };
|
|
62070
62505
|
}, "list");
|
|
62071
62506
|
const find2 = /* @__PURE__ */ __name(({ words: words4, anyWord = false, exact = false, accounts: accounts2, kinds: kinds2, limit, offset = 0 }) => {
|
|
62072
62507
|
const match = matchOf2(words4, anyWord, exact);
|
|
62073
62508
|
if (!match)
|
|
62074
62509
|
return { items: [], hasMore: false };
|
|
62075
|
-
const most = Math.min(Math.max(limit ?? 100, 1),
|
|
62510
|
+
const most = Math.min(Math.max(limit ?? 100, 1), MOST3);
|
|
62076
62511
|
const scoped2 = accounts2?.map((one2) => findAccountPk(context, one2)).filter((one2) => one2 !== void 0) ?? [];
|
|
62077
62512
|
if (accounts2 !== void 0 && !scoped2.length)
|
|
62078
62513
|
return { items: [], hasMore: false };
|
|
@@ -62094,7 +62529,7 @@ var trackerStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
62094
62529
|
return {
|
|
62095
62530
|
items: rows.slice(0, most).map((row2) => ({
|
|
62096
62531
|
account: { provider: String(row2.provider), account: String(row2.account) },
|
|
62097
|
-
item:
|
|
62532
|
+
item: itemOf2(row2),
|
|
62098
62533
|
excerpt: excerptOf([row2.title, row2.body].filter(Boolean).join("\n"), words4)
|
|
62099
62534
|
})),
|
|
62100
62535
|
hasMore: rows.length > most
|
|
@@ -62108,14 +62543,14 @@ var trackerStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
62108
62543
|
if (accountId === void 0)
|
|
62109
62544
|
return void 0;
|
|
62110
62545
|
const row2 = database.prepare(`SELECT ${COLUMNS10} FROM tracker_items t WHERE t.account_id = ? AND t.kind = ? AND t.external_id = ?`).get(accountId, kind3, externalId);
|
|
62111
|
-
return row2 ?
|
|
62546
|
+
return row2 ? itemOf2(row2) : void 0;
|
|
62112
62547
|
}, "get"),
|
|
62113
62548
|
issueByKey: /* @__PURE__ */ __name(async (key2, issueKey) => {
|
|
62114
62549
|
const accountId = findAccountPk(context, key2);
|
|
62115
62550
|
if (accountId === void 0)
|
|
62116
62551
|
return void 0;
|
|
62117
62552
|
const row2 = database.prepare(`SELECT ${COLUMNS10} FROM tracker_items t WHERE t.account_id = ? AND t.kind = 'issue' AND upper(json_extract(t.data, '$.key')) = upper(?) ORDER BY t.deleted_at IS NOT NULL LIMIT 1`).get(accountId, issueKey);
|
|
62118
|
-
return row2 ?
|
|
62553
|
+
return row2 ? itemOf2(row2) : void 0;
|
|
62119
62554
|
}, "issueByKey"),
|
|
62120
62555
|
list: /* @__PURE__ */ __name(async (key2, kind3, filter) => list2(key2, kind3, filter), "list"),
|
|
62121
62556
|
find: /* @__PURE__ */ __name(async (search2) => find2(search2), "find"),
|
|
@@ -62138,7 +62573,7 @@ var trackerStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
62138
62573
|
};
|
|
62139
62574
|
}, "trackerStoreOver");
|
|
62140
62575
|
|
|
62141
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
62576
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/store-errors.js
|
|
62142
62577
|
var refusalOf2 = /* @__PURE__ */ __name((error) => error instanceof Error && error.name === "DrizzleQueryError" && error.cause instanceof CliError ? error.cause : error, "refusalOf");
|
|
62143
62578
|
var wrapped2 = /* @__PURE__ */ new WeakMap();
|
|
62144
62579
|
var storeErrors = /* @__PURE__ */ __name((area) => {
|
|
@@ -62173,7 +62608,7 @@ var storeErrors = /* @__PURE__ */ __name((area) => {
|
|
|
62173
62608
|
return proxy;
|
|
62174
62609
|
}, "storeErrors");
|
|
62175
62610
|
|
|
62176
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
62611
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/ranges.js
|
|
62177
62612
|
var markRange = /* @__PURE__ */ __name(({ orm, now: now2 }, chatKey, from2, to) => {
|
|
62178
62613
|
const touching = and(eq(syncRanges.chatId, chatKey), lte(syncRanges.fromKey, to + 1), gte(syncRanges.toKey, from2 - 1));
|
|
62179
62614
|
let merged2 = { from: from2, to };
|
|
@@ -62186,7 +62621,7 @@ var markRange = /* @__PURE__ */ __name(({ orm, now: now2 }, chatKey, from2, to)
|
|
|
62186
62621
|
}, "markRange");
|
|
62187
62622
|
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");
|
|
62188
62623
|
|
|
62189
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
62624
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/task-analysis-marks.js
|
|
62190
62625
|
var prefixOf2 = /* @__PURE__ */ __name(({ provider, account }) => `task_analysis:${provider}:${account}:`, "prefixOf");
|
|
62191
62626
|
var markOf = /* @__PURE__ */ __name((prefix, row2) => ({
|
|
62192
62627
|
chatId: String(row2.key).slice(prefix.length),
|
|
@@ -62207,7 +62642,7 @@ var setTaskAnalysisMark = /* @__PURE__ */ __name((database, account, { chatId, c
|
|
|
62207
62642
|
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);
|
|
62208
62643
|
}, "setTaskAnalysisMark");
|
|
62209
62644
|
|
|
62210
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
62645
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/task-rule-stops.js
|
|
62211
62646
|
var keyOf6 = /* @__PURE__ */ __name(({ provider, account }) => `task_rules_until:${provider}:${account}`, "keyOf");
|
|
62212
62647
|
var taskRulesStop = /* @__PURE__ */ __name((database, account) => {
|
|
62213
62648
|
const row2 = database.prepare("SELECT value FROM store_settings WHERE key = ?").get(keyOf6(account));
|
|
@@ -62217,7 +62652,7 @@ var setTaskRulesStop = /* @__PURE__ */ __name((database, account, until, now2) =
|
|
|
62217
62652
|
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);
|
|
62218
62653
|
}, "setTaskRulesStop");
|
|
62219
62654
|
|
|
62220
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
62655
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sync.js
|
|
62221
62656
|
var syncStoreOver = /* @__PURE__ */ __name((context) => {
|
|
62222
62657
|
const { database } = context;
|
|
62223
62658
|
const { accountPk: accountPk2, findAccountPk: findAccountPk2, chatKeyOf, chatPkFor: chatPkFor2, identityPk: identityPk2, writeMembers: writeMembers2, writeState: writeState2 } = keysOver(context);
|
|
@@ -62276,7 +62711,7 @@ var syncStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
62276
62711
|
};
|
|
62277
62712
|
}, "syncStoreOver");
|
|
62278
62713
|
|
|
62279
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
62714
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/tags.js
|
|
62280
62715
|
var tagsStoreOver = /* @__PURE__ */ __name((context) => {
|
|
62281
62716
|
const { database } = context;
|
|
62282
62717
|
return {
|
|
@@ -62298,7 +62733,7 @@ var tagsStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
62298
62733
|
};
|
|
62299
62734
|
}, "tagsStoreOver");
|
|
62300
62735
|
|
|
62301
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
62736
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/image-chunks.js
|
|
62302
62737
|
var IS_IMAGE = sql`(a.kind = 'photo' OR a.mime LIKE 'image/%')`;
|
|
62303
62738
|
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
|
|
62304
62739
|
WHERE chat_id = ${chatKey} AND deleted_at IS NULL AND trim(text) <> '' AND id <> ${messagePk}
|
|
@@ -62425,7 +62860,7 @@ var savePictureChunks = /* @__PURE__ */ __name(({ orm, now: now2, database }, ac
|
|
|
62425
62860
|
dropUnusedVectors(database, released.map(({ hash: hash2 }) => hash2));
|
|
62426
62861
|
}, "savePictureChunks");
|
|
62427
62862
|
|
|
62428
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
62863
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/message-chunks.js
|
|
62429
62864
|
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,
|
|
62430
62865
|
EXISTS (SELECT 1 FROM embeddings v WHERE v.model = ${model} AND v.content_hash = k.content_hash) AS embedded
|
|
62431
62866
|
FROM messages m
|
|
@@ -62514,7 +62949,7 @@ var nearestMessages = /* @__PURE__ */ __name((context, accountPk2, { limit, quer
|
|
|
62514
62949
|
return plain2(best(found2));
|
|
62515
62950
|
}, "nearestMessages");
|
|
62516
62951
|
|
|
62517
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
62952
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/vectors.js
|
|
62518
62953
|
var accountVectorsOver = /* @__PURE__ */ __name((context, mail) => {
|
|
62519
62954
|
const { database } = context;
|
|
62520
62955
|
const { findAccountPk: findAccountPk2, findChatPk: findChatPk2, chatKeyOf } = keysOver(context);
|
|
@@ -62673,12 +63108,12 @@ var accountVectorsOver = /* @__PURE__ */ __name((context, mail) => {
|
|
|
62673
63108
|
});
|
|
62674
63109
|
return cleared;
|
|
62675
63110
|
}, "clearVectors"),
|
|
62676
|
-
nearestConversations: /* @__PURE__ */ __name(async (key2, { chatId, model, since, limit, query, exclude, conversations: conversations2, scope: scope3, projectId: projectId2, personId, before: before2 }) => {
|
|
63111
|
+
nearestConversations: /* @__PURE__ */ __name(async (key2, { chatId, model, since, limit, query, exclude, conversations: conversations2, scope: scope3, projectId: projectId2, personId, before: before2, fromOwner }) => {
|
|
62677
63112
|
const accountPk2 = findAccountPk2(key2);
|
|
62678
63113
|
if (accountPk2 === void 0)
|
|
62679
63114
|
return [];
|
|
62680
63115
|
const chatKey = chatId === void 0 ? void 0 : chatKeyOf(key2, chatId);
|
|
62681
|
-
const mailToo = key2.provider === "email" && conversations2 === void 0 && scope3 === void 0 && projectId2 === void 0 && personId === void 0 && before2 === void 0;
|
|
63116
|
+
const mailToo = key2.provider === "email" && conversations2 === void 0 && scope3 === void 0 && projectId2 === void 0 && personId === void 0 && before2 === void 0 && !fromOwner;
|
|
62682
63117
|
const mailHits = /* @__PURE__ */ __name(async () => mailToo ? (await mail().nearest(model, query, {
|
|
62683
63118
|
accountId: accountPk2,
|
|
62684
63119
|
limit,
|
|
@@ -62703,7 +63138,8 @@ var accountVectorsOver = /* @__PURE__ */ __name((context, mail) => {
|
|
|
62703
63138
|
...scope3 === void 0 ? {} : { scope: scope3 },
|
|
62704
63139
|
...projectId2 === void 0 ? {} : { projectId: Number(projectId2) },
|
|
62705
63140
|
...personId === void 0 ? {} : { personId: Number(personId) },
|
|
62706
|
-
...before2 === void 0 ? {} : { before: Date.parse(before2) }
|
|
63141
|
+
...before2 === void 0 ? {} : { before: Date.parse(before2) },
|
|
63142
|
+
...fromOwner ? { fromOwner } : {}
|
|
62707
63143
|
});
|
|
62708
63144
|
const found2 = summariesOf(context, accountPk2, nearest.map(({ conversationPk }) => conversationPk));
|
|
62709
63145
|
const ids3 = messageIds(context, nearest.flatMap(({ firstMessagePk, lastMessagePk }) => [firstMessagePk, lastMessagePk]));
|
|
@@ -62777,7 +63213,7 @@ var vectorsStoreOver = /* @__PURE__ */ __name((context, keyed) => ({
|
|
|
62777
63213
|
vectorCounts: /* @__PURE__ */ __name(async (models) => vectorCounts(context, models), "vectorCounts")
|
|
62778
63214
|
}), "vectorsStoreOver");
|
|
62779
63215
|
|
|
62780
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
63216
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/store-tables.js
|
|
62781
63217
|
import { existsSync as existsSync3, readFileSync as readFileSync4 } from "node:fs";
|
|
62782
63218
|
import { dirname as dirname3, join as join4 } from "node:path";
|
|
62783
63219
|
var BOOKKEEPING2 = ["schema_migrations", "store_settings"];
|
|
@@ -62865,10 +63301,10 @@ var lastBackup = /* @__PURE__ */ __name((path) => {
|
|
|
62865
63301
|
}
|
|
62866
63302
|
}, "lastBackup");
|
|
62867
63303
|
|
|
62868
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
63304
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/providers.js
|
|
62869
63305
|
var registerProvider2 = /* @__PURE__ */ __name((store, entry2) => store.accounts.registerProvider(entry2), "registerProvider");
|
|
62870
63306
|
|
|
62871
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
63307
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/sqlite/store-contents.js
|
|
62872
63308
|
var COUNTED_TABLES = [
|
|
62873
63309
|
"accounts",
|
|
62874
63310
|
"chats",
|
|
@@ -62953,7 +63389,7 @@ var storeContents = /* @__PURE__ */ __name((database) => {
|
|
|
62953
63389
|
};
|
|
62954
63390
|
}, "storeContents");
|
|
62955
63391
|
|
|
62956
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
63392
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.715.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_f3540c99972bb5f0aa92997a79a368b4/node_modules/@wirecat/cli-core/dist/store/store.js
|
|
62957
63393
|
var openStore = /* @__PURE__ */ __name(async (options = {}) => {
|
|
62958
63394
|
const context = await openStoreContext(options);
|
|
62959
63395
|
try {
|
|
@@ -63025,6 +63461,7 @@ var storeOver = /* @__PURE__ */ __name((context) => {
|
|
|
63025
63461
|
const crm = once3(() => crmCopiesOver(context, accountPeopleOver(context)));
|
|
63026
63462
|
const crmFiles2 = once3(() => crmFilesOver(context));
|
|
63027
63463
|
const tracker = once3(() => trackerStoreOver(context));
|
|
63464
|
+
const content2 = once3(() => contentStoreOver(context));
|
|
63028
63465
|
const relations = once3(() => relationsStoreOver(context));
|
|
63029
63466
|
const decisionRequests2 = once3(() => decisionRequestStoreOver(context));
|
|
63030
63467
|
const templates2 = once3(() => templateStoreOver(context));
|
|
@@ -63173,6 +63610,9 @@ var storeOver = /* @__PURE__ */ __name((context) => {
|
|
|
63173
63610
|
get tracker() {
|
|
63174
63611
|
return tracker();
|
|
63175
63612
|
},
|
|
63613
|
+
get content() {
|
|
63614
|
+
return content2();
|
|
63615
|
+
},
|
|
63176
63616
|
get crmFiles() {
|
|
63177
63617
|
return crmFiles2();
|
|
63178
63618
|
},
|
|
@@ -63366,8 +63806,10 @@ export {
|
|
|
63366
63806
|
crmSettingsOf,
|
|
63367
63807
|
BUSINESS_FIND_MAX,
|
|
63368
63808
|
CATALOG_QUERY,
|
|
63369
|
-
CRM_CHANGES,
|
|
63370
63809
|
resetCrmFileWords,
|
|
63810
|
+
contentHashOf,
|
|
63811
|
+
resetContentPostWords,
|
|
63812
|
+
CRM_CHANGES,
|
|
63371
63813
|
DECISION_ACTIONS,
|
|
63372
63814
|
DECISION_TTL_MS,
|
|
63373
63815
|
CALLBACK_PREFIX,
|