@wirecat/hubspot-cli 0.2.0 → 0.3.1
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 +27 -0
- package/README.md +2 -2
- package/contracts/wirecat.json +40 -2
- package/dist/bin/hubspot.js +2 -2
- package/dist/bundle/agent-A7ARC3QB.js +40 -0
- package/dist/bundle/{all-profiles-64JAUYW4.js → all-profiles-6452VSJB.js} +64 -22
- package/dist/bundle/{anthropic-VJOS4OUM.js → anthropic-VQUOVYOW.js} +6 -6
- package/dist/bundle/{app-server-GXV2OFML.js → app-server-EQZUP4H4.js} +79 -68
- package/dist/bundle/{bun-M3J2QTR3.js → bun-AJPJ4ZUN.js} +2 -2
- package/dist/bundle/{bun-sqlite-IX3XYA5F.js → bun-sqlite-AGXGSF6D.js} +7 -7
- package/dist/bundle/{chunk-N2XADGL4.js → chunk-2A64XS22.js} +4 -4
- package/dist/bundle/{chunk-Q2OLOMHL.js → chunk-2HYGCLKN.js} +93 -565
- package/dist/bundle/{chunk-FOZYMDRL.js → chunk-2NCO4E4T.js} +6 -6
- package/dist/bundle/{chunk-FBCCBCFH.js → chunk-2PRVWEJC.js} +3 -3
- package/dist/bundle/{chunk-LOBVOGOE.js → chunk-3DIXAEGH.js} +4 -4
- package/dist/bundle/{chunk-O3DYRCIT.js → chunk-3I2FGNWO.js} +1 -1
- package/dist/bundle/{chunk-65TWQ7BV.js → chunk-3PEKYGZ3.js} +2 -2
- package/dist/bundle/{chunk-DRWWJLI6.js → chunk-3R4KRNUZ.js} +8 -8
- package/dist/bundle/{chunk-2VGD63G6.js → chunk-3TEFE6YU.js} +7 -7
- package/dist/bundle/{chunk-TI46WQXQ.js → chunk-4DNHXRCJ.js} +7 -7
- package/dist/bundle/{chunk-QU25DA5N.js → chunk-5AYKCKSE.js} +11 -11
- package/dist/bundle/{chunk-CWXOXIWS.js → chunk-5K3FGXZH.js} +1 -1
- package/dist/bundle/{chunk-24ERVFJP.js → chunk-5YNAVVCW.js} +3 -3
- package/dist/bundle/{chunk-URX6YDUL.js → chunk-5ZV7REBE.js} +75 -66
- package/dist/bundle/{chunk-TLKEPUAV.js → chunk-6MFP47XC.js} +60 -50
- package/dist/bundle/{chunk-36ITRDYY.js → chunk-7LQRXVQ3.js} +783 -482
- package/dist/bundle/{chunk-E5WLE7BM.js → chunk-7NZT7Y55.js} +1 -1
- package/dist/bundle/{chunk-C32AKHTY.js → chunk-7UEL65GQ.js} +35 -12
- package/dist/bundle/chunk-7VHBS5BJ.js +108 -0
- package/dist/bundle/{chunk-O55RWNSH.js → chunk-A6UFH3QU.js} +4 -4
- package/dist/bundle/{chunk-WE4UFASG.js → chunk-ABXVU5O4.js} +8 -1
- package/dist/bundle/{chunk-4W6BMH45.js → chunk-AF7DANIR.js} +2 -100
- package/dist/bundle/{chunk-2VGZRYEH.js → chunk-ARTJLL7W.js} +6 -6
- package/dist/bundle/chunk-AVUMH42T.js +194 -0
- package/dist/bundle/{chunk-MFNMKHML.js → chunk-AWOJYRQW.js} +1024 -1639
- package/dist/bundle/chunk-B2W3C4N6.js +338 -0
- package/dist/bundle/{chunk-FKA7DOCK.js → chunk-B3EH22CO.js} +1 -1
- package/dist/bundle/{chunk-E52JAS35.js → chunk-BAUK2MD5.js} +6 -6
- package/dist/bundle/{chunk-LXZ66MCH.js → chunk-BHZUPOQY.js} +35 -29
- package/dist/bundle/{chunk-JLDBMEKZ.js → chunk-BN22EKQQ.js} +2 -2
- package/dist/bundle/{chunk-DB2XKHI4.js → chunk-BUGROVF3.js} +2 -2
- package/dist/bundle/{chunk-DSP36YHQ.js → chunk-CBCEMFCF.js} +2 -2
- package/dist/bundle/{chunk-HZRQLAHO.js → chunk-DQB5JMTY.js} +1 -1
- package/dist/bundle/{chunk-FPUGMDJV.js → chunk-DSRXCLPO.js} +1 -1
- package/dist/bundle/{chunk-UUMUL4L3.js → chunk-DW23LM47.js} +2 -2
- package/dist/bundle/{chunk-VOH7S5M4.js → chunk-E4FAMU2S.js} +3230 -3116
- package/dist/bundle/{chunk-TKVL2C3B.js → chunk-E4X7JAFC.js} +3 -3
- package/dist/bundle/{chunk-NUU4WZVL.js → chunk-EE4JSYGZ.js} +3 -3
- package/dist/bundle/{chunk-NWHEHV3K.js → chunk-EMOVVERN.js} +5 -5
- package/dist/bundle/{chunk-PVKF24ZW.js → chunk-FIVD4HM4.js} +8 -8
- package/dist/bundle/{chunk-QJW35N5V.js → chunk-GC6FLHZF.js} +12 -12
- package/dist/bundle/{chunk-TP7GDWVF.js → chunk-GRFICQTZ.js} +1 -1
- package/dist/bundle/{chunk-GPYCBYX5.js → chunk-GZZR5U3K.js} +12 -12
- package/dist/bundle/{chunk-X2M6NIQG.js → chunk-HPZRUY6S.js} +1 -1
- package/dist/bundle/{chunk-CLAN3FES.js → chunk-IBTMK5KD.js} +54 -34
- package/dist/bundle/{chunk-5A6ZYNAQ.js → chunk-IQ2XZ62J.js} +18 -18
- package/dist/bundle/{chunk-DBEQI5YM.js → chunk-ITGNDZRR.js} +3 -3
- package/dist/bundle/{chunk-W53EJOFQ.js → chunk-IXZLMFPO.js} +1 -1
- package/dist/bundle/{chunk-TOSCB4SO.js → chunk-J5P5VSRG.js} +16 -10
- package/dist/bundle/{chunk-RMIYKDUL.js → chunk-JK2SNLU5.js} +17 -17
- package/dist/bundle/{chunk-43EKCUBJ.js → chunk-JP2HJXFO.js} +3 -3
- package/dist/bundle/{chunk-DFCHHR5M.js → chunk-JUKAIXKY.js} +1 -1
- package/dist/bundle/{chunk-3WLYWRGG.js → chunk-K4X5ZHI2.js} +19 -17
- package/dist/bundle/{chunk-5GBUCHRU.js → chunk-KO4VR5NK.js} +4 -4
- package/dist/bundle/{chunk-PPHBRESD.js → chunk-KVXEEKBB.js} +2 -2
- package/dist/bundle/{chunk-SDQGB4KB.js → chunk-L433IDOX.js} +9 -9
- package/dist/bundle/chunk-LA3YU4K7.js +40 -0
- package/dist/bundle/{chunk-ECEZOLOD.js → chunk-LKSNISYV.js} +4 -4
- package/dist/bundle/{chunk-5K7QLJMM.js → chunk-LT5KE44Q.js} +226 -226
- package/dist/bundle/{chunk-YMCY7VRE.js → chunk-LTVYGXWT.js} +7 -7
- package/dist/bundle/chunk-M763RNWP.js +733 -0
- package/dist/bundle/{chunk-IMJQRPLN.js → chunk-NNMU2TDU.js} +1 -1
- package/dist/bundle/chunk-NTQBS2JL.js +52 -0
- package/dist/bundle/{chunk-HCAZV5NP.js → chunk-NZGI74GS.js} +6 -6
- package/dist/bundle/{chunk-W7HM2VGO.js → chunk-O3VM5PTJ.js} +1 -1
- package/dist/bundle/chunk-ODPU3II6.js +353 -0
- package/dist/bundle/chunk-OJIJVOOA.js +561 -0
- package/dist/bundle/{chunk-7ELMWE3P.js → chunk-PHXOL5HZ.js} +176 -160
- package/dist/bundle/{chunk-5D4AEUVA.js → chunk-PL5P7UKW.js} +434 -1
- package/dist/bundle/{chunk-B3MANLNK.js → chunk-PLRUUXK7.js} +19 -233
- package/dist/bundle/{chunk-RR5MX5TM.js → chunk-PMP37KLR.js} +4 -4
- package/dist/bundle/{chunk-FTFV3HFW.js → chunk-Q27QAB4X.js} +9 -9
- package/dist/bundle/{chunk-2QZK5BEP.js → chunk-RVWGFD32.js} +30 -15
- package/dist/bundle/{chunk-MVA5HVKL.js → chunk-S4UUN6LD.js} +18 -0
- package/dist/bundle/{chunk-QGFX5MXL.js → chunk-SEELWPRD.js} +9 -9
- package/dist/bundle/{chunk-HC5ZWE5X.js → chunk-TIHDBKA7.js} +2 -2
- package/dist/bundle/{chunk-NHHJHXMQ.js → chunk-U6XA3OOM.js} +2 -2
- package/dist/bundle/{chunk-IJADZW42.js → chunk-VNPC274V.js} +3 -3
- package/dist/bundle/{chunk-NXERIDPJ.js → chunk-VQEAZXTV.js} +7 -7
- package/dist/bundle/{chunk-P5BHKKBI.js → chunk-VW5F6FK3.js} +4 -4
- package/dist/bundle/{chunk-XRREFEIW.js → chunk-WCQW4GYO.js} +7 -7
- package/dist/bundle/{chunk-H3TNVEQX.js → chunk-WGBVRDY3.js} +29 -4
- package/dist/bundle/chunk-WRCKE5ND.js +80 -0
- package/dist/bundle/{chunk-TBJYLC5K.js → chunk-X5S5KUSU.js} +75 -75
- package/dist/bundle/{chunk-2UOJ7DLZ.js → chunk-XLDQTDF6.js} +3 -3
- package/dist/bundle/{chunk-Z73OL5HV.js → chunk-Z6ZQVYIE.js} +3 -3
- package/dist/bundle/command-contract-R2FGN7CQ.js +40 -0
- package/dist/bundle/{command-server-entry-DJKVVZCQ.js → command-server-entry-GJSMDSNE.js} +29 -29
- package/dist/bundle/{decode-FC65Y4IV.js → decode-6PLXHVHW.js} +6 -6
- package/dist/bundle/{dispatch-KOISQ5QJ.js → dispatch-TAQ7635E.js} +8 -8
- package/dist/bundle/dist-PAKDDIBT.js +191 -0
- package/dist/bundle/{echarts-FVTUDXDU.js → echarts-UZ7QLRE2.js} +2 -2
- package/dist/bundle/{embed-VNBZFPYH.js → embed-AWLL4EBF.js} +7 -7
- package/dist/bundle/{embedder-6U4NOFRO.js → embedder-MM225YJ6.js} +10 -10
- package/dist/bundle/{failure-FZ6VYKEQ.js → failure-MR2XVHFP.js} +3 -3
- package/dist/bundle/first-run-KCZVNFJ7.js +29 -0
- package/dist/bundle/first-screen-SCDV7TXT.js +40 -0
- package/dist/bundle/hubspot.js +26 -26
- package/dist/bundle/{instructions-HET7BCYK.js → instructions-ZJ7U3QUE.js} +1 -1
- package/dist/bundle/{mcp-RGNRW77S.js → mcp-CNV7F2XZ.js} +2 -2
- package/dist/bundle/meeting-combined-EL5XZIJ5.js +25 -0
- package/dist/bundle/meeting-model-OYXB2NOE.js +25 -0
- package/dist/bundle/{meeting-semantic-JY3OGCBS.js → meeting-semantic-S3DBB7XD.js} +7 -7
- package/dist/bundle/{node-CXZIFHZC.js → node-HGCZGZ4R.js} +2 -2
- package/dist/bundle/{node-sqlite-P3O7XN7Q.js → node-sqlite-RKYSRKEB.js} +8 -8
- package/dist/bundle/oauth-PYDCAQ7Y.js +20 -0
- package/dist/bundle/{open-F4P6YV54.js → open-UCDSQUN2.js} +6 -6
- package/dist/bundle/{openai-4AICLIK3.js → openai-Y4F5ZC7O.js} +16 -16
- package/dist/bundle/{process-5RUXWGYS.js → process-P7FB7YO7.js} +1 -1
- package/dist/bundle/{program-XA4C44Z4.js → program-O2A5L4S4.js} +683 -242
- package/dist/bundle/{prompt-NFMDVBZ4.js → prompt-E5TKZ37Q.js} +6 -6
- package/dist/bundle/{recognize-DKN3RY4V.js → recognize-5NYPTSLT.js} +5 -5
- package/dist/bundle/{remote-6QHAGQWY.js → remote-U4LUAHF2.js} +10 -10
- package/dist/bundle/{rerank-M4KHEHUZ.js → rerank-AJAVKK5L.js} +8 -8
- package/dist/bundle/{schemas-JRL3DLMP.js → schemas-QLQ2K6DL.js} +7 -33
- package/dist/bundle/{serve-DNU43ND6.js → serve-4UJ3R5IP.js} +11 -11
- package/dist/bundle/{server-ATG5KY7K.js → server-DUKWJUKD.js} +73 -61
- package/dist/bundle/server-UQVV2PPX.js +86 -0
- package/dist/bundle/{source-54HR4IWG.js → source-FCQDXCAD.js} +334 -78
- package/dist/bundle/{sqlite-runtime-EMQAC63N.js → sqlite-runtime-KLEA4XAU.js} +7 -7
- package/dist/bundle/{state-T45CX7VY.js → state-COGSYMVH.js} +7 -7
- package/dist/bundle/{store-6TZ2FCVA.js → store-BJXCSP26.js} +25 -24
- package/dist/bundle/store-CHH3G3SL.js +32 -0
- package/dist/bundle/{store-6LCEVBAZ.js → store-V5UMSWK4.js} +27 -22
- package/dist/bundle/store-maintenance-command-DQUBBWMD.js +73 -0
- package/dist/bundle/surface-IGBQUYE5.js +72 -0
- package/dist/bundle/writer-AQSEPEEN.js +86 -0
- package/dist/commands/session.js +2 -2
- package/dist/commands/session.js.map +1 -1
- package/dist/config.d.ts +1 -1
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +1 -5
- package/dist/config.js.map +1 -1
- package/dist/crm/activities.d.ts.map +1 -1
- package/dist/crm/activities.js +3 -13
- package/dist/crm/activities.js.map +1 -1
- package/dist/crm/records.d.ts +6 -0
- package/dist/crm/records.d.ts.map +1 -1
- package/dist/crm/records.js +6 -0
- package/dist/crm/records.js.map +1 -1
- package/dist/crm/source.d.ts +0 -6
- package/dist/crm/source.d.ts.map +1 -1
- package/dist/crm/source.js +1 -7
- package/dist/crm/source.js.map +1 -1
- package/dist/generated/manifest.d.ts.map +1 -1
- package/dist/generated/manifest.js +0 -115
- package/dist/generated/manifest.js.map +1 -1
- package/dist/generated/types.d.ts +160 -0
- package/dist/generated/types.d.ts.map +1 -1
- package/dist/hubspot/transport.js +1 -1
- package/dist/hubspot/transport.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +3 -3
- package/dist/bundle/command-contract-C6CBFXZF.js +0 -40
- package/dist/bundle/first-run-UWAFSINQ.js +0 -29
- package/dist/bundle/first-screen-RTVMGHAE.js +0 -40
- package/dist/bundle/meeting-combined-L5AGBPYX.js +0 -25
- package/dist/bundle/meeting-model-NTB4RK3F.js +0 -25
- package/dist/bundle/oauth-HNCY4B2S.js +0 -20
- package/dist/bundle/server-VNWVVH7A.js +0 -77
- package/dist/bundle/store-DXWYNVVB.js +0 -32
- package/dist/bundle/store-maintenance-command-J57HCJYY.js +0 -68
- package/dist/bundle/writer-NLLI5YRM.js +0 -79
|
@@ -5,18 +5,23 @@ import {
|
|
|
5
5
|
DEFAULT_STEMMERS_VERSION,
|
|
6
6
|
LANGUAGES,
|
|
7
7
|
SNOWBALL_VERSION,
|
|
8
|
+
START_LETTERS,
|
|
8
9
|
STEM_SEPARATOR,
|
|
9
10
|
analyzerIdentity,
|
|
10
11
|
createStemmer,
|
|
11
12
|
parseStemmers
|
|
12
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-7UEL65GQ.js";
|
|
14
|
+
import {
|
|
15
|
+
calendarMoment,
|
|
16
|
+
dayIn
|
|
17
|
+
} from "./chunk-WRCKE5ND.js";
|
|
13
18
|
import {
|
|
14
19
|
PRESENCE,
|
|
15
20
|
fuseRanked,
|
|
16
21
|
isPresence,
|
|
17
22
|
parseBytes,
|
|
18
23
|
plainQuery
|
|
19
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-Q27QAB4X.js";
|
|
20
25
|
import {
|
|
21
26
|
ACCOUNT_GROUPS,
|
|
22
27
|
CATEGORIES,
|
|
@@ -54,16 +59,16 @@ import {
|
|
|
54
59
|
runEvent,
|
|
55
60
|
severity,
|
|
56
61
|
sourceOf2 as sourceOf
|
|
57
|
-
} from "./chunk-
|
|
62
|
+
} from "./chunk-IBTMK5KD.js";
|
|
58
63
|
import {
|
|
59
64
|
sqliteCode
|
|
60
|
-
} from "./chunk-
|
|
65
|
+
} from "./chunk-DW23LM47.js";
|
|
61
66
|
import {
|
|
62
67
|
DEFAULT_TASK_CATEGORIES,
|
|
63
68
|
sharedConfigPath,
|
|
64
69
|
storedTaskCategories,
|
|
65
70
|
taskCategoriesReader
|
|
66
|
-
} from "./chunk-
|
|
71
|
+
} from "./chunk-4DNHXRCJ.js";
|
|
67
72
|
import {
|
|
68
73
|
AMOUNT_ROLES,
|
|
69
74
|
BARE_INTERNATIONAL_PROVIDERS,
|
|
@@ -114,19 +119,19 @@ import {
|
|
|
114
119
|
typedPhone,
|
|
115
120
|
validCounter,
|
|
116
121
|
wildcardPattern
|
|
117
|
-
} from "./chunk-
|
|
122
|
+
} from "./chunk-IQ2XZ62J.js";
|
|
118
123
|
import {
|
|
119
124
|
QUERY_LIMITS,
|
|
120
125
|
exhausted,
|
|
121
126
|
outOfTime,
|
|
122
127
|
searchError,
|
|
123
128
|
tooWideTerm
|
|
124
|
-
} from "./chunk-
|
|
129
|
+
} from "./chunk-JP2HJXFO.js";
|
|
125
130
|
import {
|
|
126
131
|
NORMALIZER_VERSION,
|
|
127
132
|
fold,
|
|
128
133
|
normalize
|
|
129
|
-
} from "./chunk-
|
|
134
|
+
} from "./chunk-DQB5JMTY.js";
|
|
130
135
|
import {
|
|
131
136
|
ADDED_ACCOUNT,
|
|
132
137
|
ADDED_PROVIDER,
|
|
@@ -215,11 +220,11 @@ import {
|
|
|
215
220
|
usableLinkSql,
|
|
216
221
|
useStoredProviders,
|
|
217
222
|
walletLine
|
|
218
|
-
} from "./chunk-
|
|
223
|
+
} from "./chunk-GC6FLHZF.js";
|
|
219
224
|
import {
|
|
220
225
|
normalizeTag,
|
|
221
226
|
tagOf
|
|
222
|
-
} from "./chunk-
|
|
227
|
+
} from "./chunk-CBCEMFCF.js";
|
|
223
228
|
import {
|
|
224
229
|
CHAT_MESSAGES_READ,
|
|
225
230
|
FACT_TYPES,
|
|
@@ -275,21 +280,21 @@ import {
|
|
|
275
280
|
validateQuery,
|
|
276
281
|
walkQuery,
|
|
277
282
|
zonedMoment
|
|
278
|
-
} from "./chunk-
|
|
283
|
+
} from "./chunk-LT5KE44Q.js";
|
|
279
284
|
import {
|
|
280
285
|
refuseOwnerStoreInTests,
|
|
281
286
|
storePath
|
|
282
|
-
} from "./chunk-
|
|
287
|
+
} from "./chunk-3PEKYGZ3.js";
|
|
283
288
|
import {
|
|
284
289
|
quietSqliteWarning,
|
|
285
290
|
storeCapable
|
|
286
|
-
} from "./chunk-
|
|
291
|
+
} from "./chunk-NZGI74GS.js";
|
|
287
292
|
import {
|
|
288
293
|
PRAGMAS,
|
|
289
294
|
TIME_LIMIT_FUNCTION,
|
|
290
295
|
TimeLimitReached,
|
|
291
296
|
isQueryOnly
|
|
292
|
-
} from "./chunk-
|
|
297
|
+
} from "./chunk-JUKAIXKY.js";
|
|
293
298
|
import {
|
|
294
299
|
array,
|
|
295
300
|
boolean,
|
|
@@ -307,7 +312,7 @@ import {
|
|
|
307
312
|
safeParse,
|
|
308
313
|
strictObject,
|
|
309
314
|
string
|
|
310
|
-
} from "./chunk-
|
|
315
|
+
} from "./chunk-S4UUN6LD.js";
|
|
311
316
|
import {
|
|
312
317
|
resolveFrom
|
|
313
318
|
} from "./chunk-Y5E2WNWB.js";
|
|
@@ -315,7 +320,7 @@ import {
|
|
|
315
320
|
CliError,
|
|
316
321
|
isCliError,
|
|
317
322
|
singleLine
|
|
318
|
-
} from "./chunk-
|
|
323
|
+
} from "./chunk-BUGROVF3.js";
|
|
319
324
|
import {
|
|
320
325
|
SQLiteTable,
|
|
321
326
|
TableAliasProxyHandler,
|
|
@@ -340,7 +345,7 @@ import {
|
|
|
340
345
|
sql,
|
|
341
346
|
sqliteTable,
|
|
342
347
|
text
|
|
343
|
-
} from "./chunk-
|
|
348
|
+
} from "./chunk-GRFICQTZ.js";
|
|
344
349
|
import {
|
|
345
350
|
__commonJS,
|
|
346
351
|
__name,
|
|
@@ -10084,7 +10089,7 @@ var require_cjs = __commonJS({
|
|
|
10084
10089
|
}
|
|
10085
10090
|
});
|
|
10086
10091
|
|
|
10087
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
10092
|
+
// 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/account-store.js
|
|
10088
10093
|
var bindArea = /* @__PURE__ */ __name(({ keyed, whole }, account) => {
|
|
10089
10094
|
const methods = whole;
|
|
10090
10095
|
return Object.fromEntries(Object.keys(keyed).map((name) => [
|
|
@@ -10212,7 +10217,7 @@ var bindAccount = /* @__PURE__ */ __name((store, account, areas, owners) => {
|
|
|
10212
10217
|
};
|
|
10213
10218
|
}, "bindAccount");
|
|
10214
10219
|
|
|
10215
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
10220
|
+
// 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/drizzle/core.js
|
|
10216
10221
|
var IndexBuilderOn = class {
|
|
10217
10222
|
static {
|
|
10218
10223
|
__name(this, "IndexBuilderOn");
|
|
@@ -10407,7 +10412,7 @@ function alias(table, alias2) {
|
|
|
10407
10412
|
}
|
|
10408
10413
|
__name(alias, "alias");
|
|
10409
10414
|
|
|
10410
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
10415
|
+
// 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/entity-types.js
|
|
10411
10416
|
var ENTITY_TABLES = {
|
|
10412
10417
|
...RECORD_TABLES,
|
|
10413
10418
|
account: "accounts",
|
|
@@ -10446,7 +10451,7 @@ var orphanPointers = /* @__PURE__ */ __name((database) => pointerPairs(database)
|
|
|
10446
10451
|
return { table, pointer, type, count: count2, known: known2 };
|
|
10447
10452
|
}).filter(({ count: count2 }) => count2 > 0)), "orphanPointers");
|
|
10448
10453
|
|
|
10449
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
10454
|
+
// 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/identity-links.js
|
|
10450
10455
|
var IDENTITY_LINK_KIND = "identity_link";
|
|
10451
10456
|
var IDENTITY_LINK_SIGNALS = ["agent", "phone", "email", "guest-email", "name", "account"];
|
|
10452
10457
|
var LINK_WEAKNESSES = [
|
|
@@ -10459,7 +10464,7 @@ var LINK_WEAKNESSES = [
|
|
|
10459
10464
|
"not-own-number"
|
|
10460
10465
|
];
|
|
10461
10466
|
|
|
10462
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
10467
|
+
// 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/merged-persons.js
|
|
10463
10468
|
var SEPARATIONS = ["unlink", "split", "undo-merge"];
|
|
10464
10469
|
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");
|
|
10465
10470
|
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");
|
|
@@ -10491,7 +10496,7 @@ var samePersons = /* @__PURE__ */ __name((database, pk) => {
|
|
|
10491
10496
|
}, "samePersons");
|
|
10492
10497
|
var idsOf = /* @__PURE__ */ __name((database, type, id2) => JSON.stringify(type === "person" ? samePersons(database, id2) : [id2]), "idsOf");
|
|
10493
10498
|
|
|
10494
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
10499
|
+
// 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/identity-link-rows.js
|
|
10495
10500
|
var pairOf = /* @__PURE__ */ __name((a, b) => [Number(a), Number(b)].sort((x, y) => x - y).join("-"), "pairOf");
|
|
10496
10501
|
var pkOf = /* @__PURE__ */ __name((database, ref3) => {
|
|
10497
10502
|
const at2 = ref3.indexOf(":");
|
|
@@ -10598,13 +10603,13 @@ var forgetErasedLinks = /* @__PURE__ */ __name((database) => {
|
|
|
10598
10603
|
database.prepare("DELETE FROM proposed_actions WHERE id = ?").run(Number(row2.id));
|
|
10599
10604
|
}, "forgetErasedLinks");
|
|
10600
10605
|
|
|
10601
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
10606
|
+
// 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/identity-splits.js
|
|
10602
10607
|
var IDENTITY_SPLIT_KIND = "identity_split";
|
|
10603
10608
|
|
|
10604
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
10609
|
+
// 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/mail-findings.js
|
|
10605
10610
|
var MAIL_FINDINGS_KIND = "mail_findings";
|
|
10606
10611
|
|
|
10607
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
10612
|
+
// 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/decisions.js
|
|
10608
10613
|
var TASK_CLOSE_KIND = "task_close";
|
|
10609
10614
|
var DEFAULT_DECISION_POLICY = { agentDecisions: false, ruleProposalsOwnerOnly: true };
|
|
10610
10615
|
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");
|
|
@@ -10652,7 +10657,7 @@ var assertMayDecide = /* @__PURE__ */ __name((row2, by, policy = DEFAULT_DECISIO
|
|
|
10652
10657
|
}, "assertMayDecide");
|
|
10653
10658
|
var deciderAuthor = /* @__PURE__ */ __name((by) => by === "owner" ? "owner" : { bot: by.bot, ...by.model === void 0 ? {} : { model: by.model } }, "deciderAuthor");
|
|
10654
10659
|
|
|
10655
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
10660
|
+
// 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/mail/score.js
|
|
10656
10661
|
var import_disposable_email_domains_js = __toESM(require_dist(), 1);
|
|
10657
10662
|
var import_tldts = __toESM(require_cjs(), 1);
|
|
10658
10663
|
var FREE_MAIL = /* @__PURE__ */ new Set([
|
|
@@ -10682,7 +10687,7 @@ var FREE_MAIL = /* @__PURE__ */ new Set([
|
|
|
10682
10687
|
]);
|
|
10683
10688
|
var DAY_MS = 24 * 60 * 60 * 1e3;
|
|
10684
10689
|
|
|
10685
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
10690
|
+
// 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/address-organization.js
|
|
10686
10691
|
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 ";
|
|
10687
10692
|
var idsOf2 = /* @__PURE__ */ __name((rows) => rows.map((row2) => Number(row2.id)), "idsOf");
|
|
10688
10693
|
var holdAddress = /* @__PURE__ */ __name(({ database, now: now2 }, organization2, email, { method, author }) => {
|
|
@@ -10707,10 +10712,10 @@ var organizationOfAddress = /* @__PURE__ */ __name((context, { name, email, meth
|
|
|
10707
10712
|
return id2;
|
|
10708
10713
|
}, "organizationOfAddress");
|
|
10709
10714
|
|
|
10710
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
10715
|
+
// 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/transaction.js
|
|
10711
10716
|
import { AsyncLocalStorage } from "node:async_hooks";
|
|
10712
10717
|
|
|
10713
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
10718
|
+
// 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/journal.js
|
|
10714
10719
|
import { existsSync, statSync } from "node:fs";
|
|
10715
10720
|
var watched = /* @__PURE__ */ new WeakMap();
|
|
10716
10721
|
var walInode = /* @__PURE__ */ __name((store) => statSync(`${store}-wal`, { throwIfNoEntry: false })?.ino, "walInode");
|
|
@@ -10736,7 +10741,7 @@ var checkJournal = /* @__PURE__ */ __name((database) => {
|
|
|
10736
10741
|
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" });
|
|
10737
10742
|
}, "checkJournal");
|
|
10738
10743
|
|
|
10739
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
10744
|
+
// 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/write-events.js
|
|
10740
10745
|
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;
|
|
10741
10746
|
var writeTarget = /* @__PURE__ */ __name((sql2) => {
|
|
10742
10747
|
const match = WRITE.exec(sql2);
|
|
@@ -10816,7 +10821,7 @@ var committedWrites = /* @__PURE__ */ __name((database) => {
|
|
|
10816
10821
|
}, "committedWrites");
|
|
10817
10822
|
var droppedWrites = /* @__PURE__ */ __name((database) => tallies.get(database)?.pending.clear(), "droppedWrites");
|
|
10818
10823
|
|
|
10819
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
10824
|
+
// 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/involvement-queue.js
|
|
10820
10825
|
var ARMS = [
|
|
10821
10826
|
[
|
|
10822
10827
|
"message",
|
|
@@ -10944,7 +10949,7 @@ var drainInvolvementQueue = /* @__PURE__ */ __name((database, cap = QUEUE_CAP) =
|
|
|
10944
10949
|
return recomputed;
|
|
10945
10950
|
}, "drainInvolvementQueue");
|
|
10946
10951
|
|
|
10947
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
10952
|
+
// 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/domain/mentions.js
|
|
10948
10953
|
import { domainToUnicode } from "node:url";
|
|
10949
10954
|
|
|
10950
10955
|
// node_modules/.pnpm/psl@1.15.0/node_modules/psl/dist/psl.mjs
|
|
@@ -20966,7 +20971,7 @@ var oa = /* @__PURE__ */ __name((e) => {
|
|
|
20966
20971
|
}, "oa");
|
|
20967
20972
|
var na = { parse: O, get: aa, isValid: oa };
|
|
20968
20973
|
|
|
20969
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
20974
|
+
// 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/domain/google-documents.js
|
|
20970
20975
|
var LINK = /https?:\/\/(?:(?:docs|drive|sheets|slides)\.google\.com|forms\.gle)(?:[/?#][^\s<>"'`]*)?/gi;
|
|
20971
20976
|
var ID = /^[\w-]{10,}$/;
|
|
20972
20977
|
var trimUrl = /* @__PURE__ */ __name((url) => {
|
|
@@ -21008,7 +21013,7 @@ var googleDocumentLinks = /* @__PURE__ */ __name((text8) => [...text8.matchAll(L
|
|
|
21008
21013
|
return { url, documentId: googleDocumentId(url) };
|
|
21009
21014
|
}), "googleDocumentLinks");
|
|
21010
21015
|
|
|
21011
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
21016
|
+
// 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/domain/places.js
|
|
21012
21017
|
var BEFORE = [
|
|
21013
21018
|
[/^(?:ул\.?|улиц[аеыу]|улицей)$/iu, "\u0443\u043B\u0438\u0446\u0430"],
|
|
21014
21019
|
[/^(?:пр-т|просп\.?|проспект[аеу]?)$/iu, "\u043F\u0440\u043E\u0441\u043F\u0435\u043A\u0442"],
|
|
@@ -21268,7 +21273,7 @@ var findPlaces = /* @__PURE__ */ __name((text8) => {
|
|
|
21268
21273
|
return found2.sort((a, b) => a.start - b.start);
|
|
21269
21274
|
}, "findPlaces");
|
|
21270
21275
|
|
|
21271
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
21276
|
+
// 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/domain/mentions.js
|
|
21272
21277
|
var MENTION_KINDS = ["phone", "email", "url", "document", "person-name", "place"];
|
|
21273
21278
|
var MENTION_VERSIONS = {
|
|
21274
21279
|
phone: 1,
|
|
@@ -21444,7 +21449,7 @@ var exactlyOne = /* @__PURE__ */ __name((text8, options) => {
|
|
|
21444
21449
|
return one2 && one2.start === 0 && one2.end === text8.length ? one2.value : void 0;
|
|
21445
21450
|
}, "exactlyOne");
|
|
21446
21451
|
|
|
21447
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
21452
|
+
// 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/domain/first-names.js
|
|
21448
21453
|
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";
|
|
21449
21454
|
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";
|
|
21450
21455
|
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";
|
|
@@ -21452,7 +21457,7 @@ var NOT_NAMES = ["\u0436\u0435\u043D\u0430", "\u0436\u0435\u043D\u044B", "\u0436
|
|
|
21452
21457
|
var FIRST_NAMES = [...new Set(`${RUSSIAN} ${EUROPEAN}`.split(" "))];
|
|
21453
21458
|
var NAME_WORDS = WORDS.split(" ");
|
|
21454
21459
|
|
|
21455
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
21460
|
+
// 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/domain/person-names.js
|
|
21456
21461
|
var LATIN_TO_CYRILLIC = {
|
|
21457
21462
|
shch: "\u0449",
|
|
21458
21463
|
sch: "\u0449",
|
|
@@ -21660,7 +21665,7 @@ var findUnknownNames = /* @__PURE__ */ __name((text8, stem, taken) => {
|
|
|
21660
21665
|
return found2;
|
|
21661
21666
|
}, "findUnknownNames");
|
|
21662
21667
|
|
|
21663
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
21668
|
+
// 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/domain/attachments.js
|
|
21664
21669
|
var NOT_FILES = /* @__PURE__ */ new Set([
|
|
21665
21670
|
"webpage",
|
|
21666
21671
|
"share",
|
|
@@ -21701,7 +21706,7 @@ var matchDownloads = /* @__PURE__ */ __name((stored4, files2) => {
|
|
|
21701
21706
|
});
|
|
21702
21707
|
}, "matchDownloads");
|
|
21703
21708
|
|
|
21704
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
21709
|
+
// 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/search/lucene/presets.js
|
|
21705
21710
|
var PRESET_VERSION = 1;
|
|
21706
21711
|
var PRESETS = {
|
|
21707
21712
|
password: {
|
|
@@ -21755,12 +21760,12 @@ var PRESETS = {
|
|
|
21755
21760
|
}
|
|
21756
21761
|
};
|
|
21757
21762
|
|
|
21758
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
21763
|
+
// 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/search/lucene/resolved.js
|
|
21759
21764
|
var hasText = /* @__PURE__ */ __name((node) => node.kind === "predicate" ? node.field === "text" || node.field === "exact" : node.clauses.some(({ node: node2 }) => hasText(node2)), "hasText");
|
|
21760
21765
|
var isStemmed = /* @__PURE__ */ __name((node) => node.field === "text" && (node.operator === "term" || node.operator === "phrase") && node.value !== "", "isStemmed");
|
|
21761
21766
|
var hasStems = /* @__PURE__ */ __name((node) => node.kind === "predicate" ? isStemmed(node) : node.clauses.some(({ node: node2 }) => hasStems(node2)), "hasStems");
|
|
21762
21767
|
|
|
21763
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
21768
|
+
// 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/mention-links.js
|
|
21764
21769
|
var LIVE = "mn.kind = 'url' AND mn.status <> 'dismissed'";
|
|
21765
21770
|
var MAIL_ROWS = `SELECT mn.source_id FROM mentions mn WHERE mn.source_type = 'email' AND ${LIVE}`;
|
|
21766
21771
|
var linkMatch = /* @__PURE__ */ __name((field4, typed, mail, mentioned2) => {
|
|
@@ -21784,7 +21789,7 @@ var linkMatch = /* @__PURE__ */ __name((field4, typed, mail, mentioned2) => {
|
|
|
21784
21789
|
};
|
|
21785
21790
|
}, "linkMatch");
|
|
21786
21791
|
|
|
21787
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
21792
|
+
// 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/phone-countries.js
|
|
21788
21793
|
var SETTING = "phoneCountries";
|
|
21789
21794
|
var savedPhoneCountries = /* @__PURE__ */ __name((database) => {
|
|
21790
21795
|
const row2 = database.prepare("SELECT value FROM store_settings WHERE key = ?").get(SETTING);
|
|
@@ -21815,7 +21820,7 @@ var valueMatch = /* @__PURE__ */ __name((database, typed) => {
|
|
|
21815
21820
|
return { sql: "mn.value = ?", params: [phone?.value ?? normalizedValue(typed, { phoneCountries })] };
|
|
21816
21821
|
}, "valueMatch");
|
|
21817
21822
|
|
|
21818
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
21823
|
+
// 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/domain/vocabulary.js
|
|
21819
21824
|
var normalizeVocabularyName = /* @__PURE__ */ __name((input) => {
|
|
21820
21825
|
if (typeof input !== "string" || input.length > 200 || /[\p{Cc}\p{Cf}]/u.test(input))
|
|
21821
21826
|
throw new CliError("validation_error", "a vocabulary name takes 1\u2013200 characters without control characters");
|
|
@@ -21843,7 +21848,7 @@ var vocabularySimilarity = /* @__PURE__ */ __name((left, right) => {
|
|
|
21843
21848
|
return 2 * intersection2 / (aa2.size + bb.size);
|
|
21844
21849
|
}, "vocabularySimilarity");
|
|
21845
21850
|
|
|
21846
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
21851
|
+
// 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-creation.js
|
|
21847
21852
|
import { createHash } from "node:crypto";
|
|
21848
21853
|
var folded2 = /* @__PURE__ */ __name((name) => {
|
|
21849
21854
|
try {
|
|
@@ -21909,7 +21914,7 @@ var guardTagCreation = /* @__PURE__ */ __name((context, name, kind3, by, options
|
|
|
21909
21914
|
});
|
|
21910
21915
|
}, "guardTagCreation");
|
|
21911
21916
|
|
|
21912
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
21917
|
+
// 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/domain/tag-redirects.js
|
|
21913
21918
|
var invalid = /* @__PURE__ */ __name((message3) => {
|
|
21914
21919
|
throw new CliError("validation_error", message3);
|
|
21915
21920
|
}, "invalid");
|
|
@@ -21986,7 +21991,7 @@ var createTagRedirectIndex = /* @__PURE__ */ __name((snapshot2) => {
|
|
|
21986
21991
|
};
|
|
21987
21992
|
}, "createTagRedirectIndex");
|
|
21988
21993
|
|
|
21989
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
21994
|
+
// 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-resolution.js
|
|
21990
21995
|
var tagCanonicalId = /* @__PURE__ */ __name((database, id2) => {
|
|
21991
21996
|
const row2 = database.prepare("SELECT canonical_id FROM resolved_tags WHERE id=?").get(id2);
|
|
21992
21997
|
if (!row2)
|
|
@@ -22014,7 +22019,7 @@ var tagRedirectSnapshot = /* @__PURE__ */ __name((database) => {
|
|
|
22014
22019
|
return snapshot2;
|
|
22015
22020
|
}, "tagRedirectSnapshot");
|
|
22016
22021
|
|
|
22017
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
22022
|
+
// 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/task-keys.js
|
|
22018
22023
|
import { createHash as createHash2 } from "node:crypto";
|
|
22019
22024
|
var TASK_KEY_PREFIXES = {
|
|
22020
22025
|
question: "Q",
|
|
@@ -22042,7 +22047,7 @@ var taskAccountOf = /* @__PURE__ */ __name((database, rowId) => {
|
|
|
22042
22047
|
return row2 && String(row2.key) === inboxKey(String(row2.name)) ? String(row2.name) : void 0;
|
|
22043
22048
|
}, "taskAccountOf");
|
|
22044
22049
|
|
|
22045
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
22050
|
+
// 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/things.js
|
|
22046
22051
|
var storedThing = /* @__PURE__ */ __name((type, id2) => ({ type: String(type), id: Number(id2) }), "storedThing");
|
|
22047
22052
|
var REFERABLE = {
|
|
22048
22053
|
...Object.fromEntries(Object.entries(RECORD_TYPES).map(([type, { tombstone: tombstone2 }]) => [type, { tombstone: tombstone2 }])),
|
|
@@ -22206,7 +22211,7 @@ var taskIdOf = /* @__PURE__ */ __name((database, rowId) => {
|
|
|
22206
22211
|
return row2 ? String(row2.id ?? row2.key) : void 0;
|
|
22207
22212
|
}, "taskIdOf");
|
|
22208
22213
|
|
|
22209
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
22214
|
+
// 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/values.js
|
|
22210
22215
|
var toMs = /* @__PURE__ */ __name((iso17) => {
|
|
22211
22216
|
if (iso17 === null || iso17 === void 0)
|
|
22212
22217
|
return null;
|
|
@@ -22220,7 +22225,7 @@ var present = /* @__PURE__ */ __name((entries) => Object.fromEntries(Object.entr
|
|
|
22220
22225
|
var DELIVERY = { delivered: 1, read: 2 };
|
|
22221
22226
|
var deliveryOf = /* @__PURE__ */ __name((stored4) => stored4 === DELIVERY.read ? "read" : stored4 === DELIVERY.delivered ? "delivered" : void 0, "deliveryOf");
|
|
22222
22227
|
|
|
22223
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
22228
|
+
// 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/tags.js
|
|
22224
22229
|
var TAG_KINDS = ["tag", "topic"];
|
|
22225
22230
|
var TAGGABLE = { chat: "chat", contact: "identity", message: "message", task: "task" };
|
|
22226
22231
|
var TAG_TYPE = {
|
|
@@ -22423,7 +22428,7 @@ var tagsOf = /* @__PURE__ */ __name(({ database }, key2, filter) => {
|
|
|
22423
22428
|
return result;
|
|
22424
22429
|
}, "tagsOf");
|
|
22425
22430
|
|
|
22426
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
22431
|
+
// 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/trigram-match.js
|
|
22427
22432
|
var MOST_YO_SPELLINGS = 64;
|
|
22428
22433
|
var yoSpellings = /* @__PURE__ */ __name((run) => {
|
|
22429
22434
|
let spellings2 = [""];
|
|
@@ -22445,7 +22450,7 @@ var anyCaseGlob = /* @__PURE__ */ __name((word2) => `*${[...word2.normalize("NFC
|
|
|
22445
22450
|
return forms2.size === 1 ? c : `[${[...forms2].join("")}]`;
|
|
22446
22451
|
}).join("")}*`, "anyCaseGlob");
|
|
22447
22452
|
|
|
22448
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
22453
|
+
// 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/lucene-fields.js
|
|
22449
22454
|
var speech = /* @__PURE__ */ __name((alias2) => `(coalesce(${alias2}.extractor,'') LIKE 'speech:%' OR ${alias2}.kind IN ('voice','video_note') OR coalesce(${alias2}.mime,'')='audio/ogg')`, "speech");
|
|
22450
22455
|
var SPEECH = speech("att");
|
|
22451
22456
|
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");
|
|
@@ -22546,13 +22551,15 @@ var stemmedText = /* @__PURE__ */ __name((node, scope3) => {
|
|
|
22546
22551
|
throw new Error("a stemmed leaf reached the compiler without the store's stemmer");
|
|
22547
22552
|
const text8 = normalize(node.value);
|
|
22548
22553
|
const match = ftsMatch(node);
|
|
22554
|
+
const start = node.operator === "term" && /^[\p{L}\p{N}]+$/u.test(text8) && [...text8].length >= START_LETTERS ? text8 : void 0;
|
|
22549
22555
|
const stems = stemsOf(scope3, node);
|
|
22550
22556
|
const byStems = stems && node.slop !== void 0 ? nearStems(scope3, node, stems) : stems ? bound(`m.id IN (SELECT rowid FROM ${corpus.stems} WHERE ${corpus.stems} MATCH ?)`, `stems : (${stems})`) : void 0;
|
|
22551
22557
|
return always(/[\p{L}\p{N}]/u.test(text8) ? scope3.everywhere(node, {
|
|
22552
22558
|
sql: `m.id IN (SELECT rowid FROM ${corpus.words} WHERE ${corpus.words} MATCH ?)${byStems ? ` OR ${byStems.sql}` : ""}`,
|
|
22553
|
-
params: [`normalized_text : (${match})`, ...byStems?.params ?? []],
|
|
22559
|
+
params: [`normalized_text : (${start ? `${match} *` : match})`, ...byStems?.params ?? []],
|
|
22554
22560
|
exact: true,
|
|
22555
22561
|
fts: match,
|
|
22562
|
+
...start ? { begins: `${match} *` } : {},
|
|
22556
22563
|
...stems ? { stems } : {}
|
|
22557
22564
|
}) : bound("0"));
|
|
22558
22565
|
}, "stemmedText");
|
|
@@ -22931,7 +22938,7 @@ var FIELD_COMPILERS = {
|
|
|
22931
22938
|
subject
|
|
22932
22939
|
};
|
|
22933
22940
|
|
|
22934
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
22941
|
+
// 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/place-key.js
|
|
22935
22942
|
var placeOf = /* @__PURE__ */ __name((database) => {
|
|
22936
22943
|
const exact = database.prepare("SELECT id FROM places WHERE folded = ?");
|
|
22937
22944
|
const onStreet = database.prepare("SELECT id FROM places WHERE substr(folded, 1, ?) = ? LIMIT 2");
|
|
@@ -22947,7 +22954,7 @@ var placeOf = /* @__PURE__ */ __name((database) => {
|
|
|
22947
22954
|
};
|
|
22948
22955
|
}, "placeOf");
|
|
22949
22956
|
|
|
22950
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
22957
|
+
// 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/mention-drain.js
|
|
22951
22958
|
var DRAIN_ON_WRITE = 500;
|
|
22952
22959
|
var METHOD = "rules";
|
|
22953
22960
|
var telegramLink = /* @__PURE__ */ __name((database) => {
|
|
@@ -23113,7 +23120,7 @@ var drainMentions = /* @__PURE__ */ __name((database, now2, limit = DRAIN_ON_WRI
|
|
|
23113
23120
|
return queued.length;
|
|
23114
23121
|
}, "drainMentions");
|
|
23115
23122
|
|
|
23116
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
23123
|
+
// 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/index-state.js
|
|
23117
23124
|
var indexRow = /* @__PURE__ */ __name((database, name) => {
|
|
23118
23125
|
const exists2 = database.prepare("SELECT 1 FROM sqlite_master WHERE name = 'search_index_state'").get();
|
|
23119
23126
|
if (!exists2)
|
|
@@ -23121,7 +23128,7 @@ var indexRow = /* @__PURE__ */ __name((database, name) => {
|
|
|
23121
23128
|
return database.prepare("SELECT * FROM search_index_state WHERE name = ?").get(name);
|
|
23122
23129
|
}, "indexRow");
|
|
23123
23130
|
|
|
23124
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
23131
|
+
// 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/stems.js
|
|
23125
23132
|
var INDEX = "message_stems";
|
|
23126
23133
|
var SETTING2 = "searchStemmers";
|
|
23127
23134
|
var DRAIN_ON_WRITE2 = 500;
|
|
@@ -23158,6 +23165,10 @@ var stemmersOrigin = /* @__PURE__ */ __name((database) => {
|
|
|
23158
23165
|
return { origin: "owner" };
|
|
23159
23166
|
}
|
|
23160
23167
|
}, "stemmersOrigin");
|
|
23168
|
+
var heldStems = /* @__PURE__ */ __name((database, stems) => {
|
|
23169
|
+
const lookup = database.prepare(`SELECT 1 FROM ${INDEX} WHERE ${INDEX} MATCH ? LIMIT 1`);
|
|
23170
|
+
return new Set(stems.filter((stem) => lookup.get(`stems : "${stem.replaceAll('"', '""')}"`) !== void 0));
|
|
23171
|
+
}, "heldStems");
|
|
23161
23172
|
var stemsState = /* @__PURE__ */ __name((database) => {
|
|
23162
23173
|
const row2 = indexRow(database, INDEX);
|
|
23163
23174
|
if (!row2)
|
|
@@ -23243,7 +23254,7 @@ var stemmerCache = /* @__PURE__ */ __name(() => {
|
|
|
23243
23254
|
};
|
|
23244
23255
|
}, "stemmerCache");
|
|
23245
23256
|
|
|
23246
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
23257
|
+
// 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/transaction.js
|
|
23247
23258
|
var rehearsal = new AsyncLocalStorage();
|
|
23248
23259
|
var SQLITE_BUSY = 5;
|
|
23249
23260
|
var pause = new Int32Array(new SharedArrayBuffer(4));
|
|
@@ -23386,7 +23397,7 @@ var read = /* @__PURE__ */ __name((database, body2) => {
|
|
|
23386
23397
|
}
|
|
23387
23398
|
}, "read");
|
|
23388
23399
|
|
|
23389
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
23400
|
+
// 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/folded.js
|
|
23390
23401
|
var FOLDED = [
|
|
23391
23402
|
{ table: "tasks", column: "title" },
|
|
23392
23403
|
{ table: "tasks", column: "close_reason" },
|
|
@@ -23423,7 +23434,7 @@ var fillFolded = /* @__PURE__ */ __name((database, { batch = 2e3 } = {}) => {
|
|
|
23423
23434
|
return filled;
|
|
23424
23435
|
}, "fillFolded");
|
|
23425
23436
|
|
|
23426
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
23437
|
+
// 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/conversations/chunks.js
|
|
23427
23438
|
import { createHash as createHash3 } from "node:crypto";
|
|
23428
23439
|
var CHUNK_CHARS = 1200;
|
|
23429
23440
|
var CHUNK_OVERLAP = 150;
|
|
@@ -23528,7 +23539,7 @@ var cutChunks = /* @__PURE__ */ __name((members2, limit = CHUNK_CHARS, check3, c
|
|
|
23528
23539
|
return chunks2;
|
|
23529
23540
|
}, "cutChunks");
|
|
23530
23541
|
|
|
23531
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
23542
|
+
// 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/search/task-signature.js
|
|
23532
23543
|
var DAY = 864e5;
|
|
23533
23544
|
var CURRENCY = [
|
|
23534
23545
|
[/^(₽|руб.*|р\.?|rub)$/u, "RUB"],
|
|
@@ -23654,7 +23665,7 @@ var dueDayOf = /* @__PURE__ */ __name((text8, createdMs) => {
|
|
|
23654
23665
|
return best?.day ?? null;
|
|
23655
23666
|
}, "dueDayOf");
|
|
23656
23667
|
|
|
23657
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
23668
|
+
// 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/search/task-similarity.js
|
|
23658
23669
|
var DAY2 = 864e5;
|
|
23659
23670
|
var STOP_WORDS = new Set([
|
|
23660
23671
|
// Russian and English as the test set ran them, already folded (пожалуйста → пожалуиста).
|
|
@@ -23809,7 +23820,7 @@ var rankCandidates = /* @__PURE__ */ __name((views, candidates) => candidates.ma
|
|
|
23809
23820
|
...compareViews(subjectViews ?? views, candidate, replyChain === void 0 ? {} : { replyChain })
|
|
23810
23821
|
})).sort((a, b) => b.score - a.score), "rankCandidates");
|
|
23811
23822
|
|
|
23812
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
23823
|
+
// 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/vector-index.js
|
|
23813
23824
|
var source = /* @__PURE__ */ __name((model, dims) => `SELECT k.id, k.chunkable_type,
|
|
23814
23825
|
coalesce(CASE k.chunkable_type
|
|
23815
23826
|
WHEN 'image' THEN (SELECT ch.account_id FROM attachments a JOIN messages m ON m.id = a.attachable_id
|
|
@@ -23951,7 +23962,7 @@ var dropUnusedVectors = /* @__PURE__ */ __name((database, hashes) => {
|
|
|
23951
23962
|
}, "dropUnusedVectors");
|
|
23952
23963
|
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");
|
|
23953
23964
|
|
|
23954
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
23965
|
+
// 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/vectors.js
|
|
23955
23966
|
var currentChunks = /* @__PURE__ */ __name((chatKey) => sql`SELECT k.content_hash, k.chunkable_id AS conversation_id, r.first_message_id,
|
|
23956
23967
|
r.last_message_id, r.text_start, r.text_end FROM conversations c
|
|
23957
23968
|
CROSS JOIN chunks k ON k.chunkable_type = 'conversation' AND k.chunkable_id = c.id
|
|
@@ -24179,12 +24190,64 @@ var unbuiltGroups = /* @__PURE__ */ __name(({ orm }, accountPk2) => orm.all(sql`
|
|
|
24179
24190
|
AND NOT EXISTS (SELECT 1 FROM conversation_state s WHERE s.chat_id = ch.id)
|
|
24180
24191
|
AND EXISTS (SELECT 1 FROM messages m WHERE m.chat_id = ch.id AND m.deleted_at IS NULL)
|
|
24181
24192
|
ORDER BY (SELECT max(m.sent_at) FROM messages m WHERE m.chat_id = ch.id) DESC, ch.external_id`).map(({ id: id2 }) => id2), "unbuiltGroups");
|
|
24182
|
-
var readiness = /* @__PURE__ */ __name((
|
|
24193
|
+
var readiness = /* @__PURE__ */ __name((context, chatKey, model, counted) => {
|
|
24194
|
+
const { orm } = context;
|
|
24183
24195
|
const state = orm.get(sql`SELECT built_at AS builtAt, algorithm_version AS algorithmVersion, current_build AS build
|
|
24184
24196
|
FROM conversation_state WHERE chat_id = ${chatKey}`);
|
|
24185
24197
|
if (!state || state.builtAt === null || state.build === null)
|
|
24186
24198
|
return void 0;
|
|
24187
24199
|
const { builtAt, build } = state;
|
|
24200
|
+
const saved = orm.get(sql`SELECT new_count AS new, edited_count AS edited, deleted_count AS deleted, chunks,
|
|
24201
|
+
embedded_count AS embedded, current, stale FROM conversation_readiness
|
|
24202
|
+
WHERE chat_id = ${chatKey} AND model = ${model}`);
|
|
24203
|
+
const counts = saved ?? countReadiness(context, chatKey, model, builtAt, build);
|
|
24204
|
+
if (!saved)
|
|
24205
|
+
counted.push({ chatKey, counts });
|
|
24206
|
+
return {
|
|
24207
|
+
builtAt,
|
|
24208
|
+
algorithmVersion: state.algorithmVersion,
|
|
24209
|
+
pending: { new: counts.new, edited: counts.edited, deleted: counts.deleted },
|
|
24210
|
+
vectors: {
|
|
24211
|
+
chunks: counts.chunks,
|
|
24212
|
+
embedded: counts.embedded,
|
|
24213
|
+
current: counts.current,
|
|
24214
|
+
stale: counts.stale,
|
|
24215
|
+
missing: counts.chunks - counts.current - counts.stale
|
|
24216
|
+
}
|
|
24217
|
+
};
|
|
24218
|
+
}, "readiness");
|
|
24219
|
+
var dataVersion = /* @__PURE__ */ __name(({ database }) => Number(Object.values(database.prepare("PRAGMA data_version").get() ?? {})[0]), "dataVersion");
|
|
24220
|
+
var saveReadiness = /* @__PURE__ */ __name((context, model, counted, since) => {
|
|
24221
|
+
const { database } = context;
|
|
24222
|
+
if (counted.length === 0 || isQueryOnly(database))
|
|
24223
|
+
return;
|
|
24224
|
+
const timeout = Number(database.prepare("PRAGMA busy_timeout").get()?.timeout ?? 0);
|
|
24225
|
+
database.exec("PRAGMA busy_timeout = 0");
|
|
24226
|
+
try {
|
|
24227
|
+
database.exec("BEGIN IMMEDIATE");
|
|
24228
|
+
} catch (error) {
|
|
24229
|
+
if (isBusy(error))
|
|
24230
|
+
return;
|
|
24231
|
+
throw error;
|
|
24232
|
+
} finally {
|
|
24233
|
+
database.exec(`PRAGMA busy_timeout = ${timeout}`);
|
|
24234
|
+
}
|
|
24235
|
+
try {
|
|
24236
|
+
if (dataVersion(context) === since) {
|
|
24237
|
+
const insert = database.prepare(`INSERT OR REPLACE INTO conversation_readiness
|
|
24238
|
+
(chat_id, model, new_count, edited_count, deleted_count, chunks, embedded_count, current, stale, counted_at)
|
|
24239
|
+
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)`);
|
|
24240
|
+
const at2 = Date.now();
|
|
24241
|
+
for (const { chatKey, counts: c } of counted)
|
|
24242
|
+
insert.run(chatKey, model, c.new, c.edited, c.deleted, c.chunks, c.embedded, c.current, c.stale, at2);
|
|
24243
|
+
}
|
|
24244
|
+
database.exec("COMMIT");
|
|
24245
|
+
} catch (error) {
|
|
24246
|
+
rollBack(database);
|
|
24247
|
+
throw error;
|
|
24248
|
+
}
|
|
24249
|
+
}, "saveReadiness");
|
|
24250
|
+
var countReadiness = /* @__PURE__ */ __name(({ orm }, chatKey, model, builtAt, build) => {
|
|
24188
24251
|
const member = /* @__PURE__ */ __name((pk) => sql`EXISTS (SELECT 1 FROM conversation_messages cm
|
|
24189
24252
|
JOIN conversations c ON c.id = cm.conversation_id WHERE cm.message_id = ${pk} AND c.build = ${build})`, "member");
|
|
24190
24253
|
const editedSince = /* @__PURE__ */ __name((pk) => sql`EXISTS (SELECT 1 FROM message_revisions r WHERE r.message_id = ${pk} AND r.created_at >= ${builtAt})`, "editedSince");
|
|
@@ -24208,26 +24271,22 @@ var readiness = /* @__PURE__ */ __name(({ orm }, chatKey, model) => {
|
|
|
24208
24271
|
FROM (${currentChunks(chatKey)}) h)
|
|
24209
24272
|
SELECT count(*) AS chunks, sum(vector) AS embedded, sum(vector AND NOT stale) AS current, sum(stale) AS stale
|
|
24210
24273
|
FROM hashes`);
|
|
24211
|
-
const chunks2 = Number(vectors?.chunks ?? 0);
|
|
24212
|
-
const current2 = Number(vectors?.current ?? 0);
|
|
24213
|
-
const stale4 = Number(vectors?.stale ?? 0);
|
|
24214
24274
|
return {
|
|
24215
|
-
|
|
24216
|
-
|
|
24217
|
-
|
|
24218
|
-
|
|
24219
|
-
|
|
24220
|
-
|
|
24221
|
-
|
|
24222
|
-
vectors: { chunks: chunks2, embedded: Number(vectors?.embedded ?? 0), current: current2, stale: stale4, missing: chunks2 - current2 - stale4 }
|
|
24275
|
+
new: Number(pending?.new ?? 0),
|
|
24276
|
+
edited: Number(pending?.edited ?? 0),
|
|
24277
|
+
deleted: Number(pending?.deleted ?? 0),
|
|
24278
|
+
chunks: Number(vectors?.chunks ?? 0),
|
|
24279
|
+
embedded: Number(vectors?.embedded ?? 0),
|
|
24280
|
+
current: Number(vectors?.current ?? 0),
|
|
24281
|
+
stale: Number(vectors?.stale ?? 0)
|
|
24223
24282
|
};
|
|
24224
|
-
}, "
|
|
24283
|
+
}, "countReadiness");
|
|
24225
24284
|
var vectorCounts = /* @__PURE__ */ __name(({ orm }, models) => new Map(models.map((model) => [
|
|
24226
24285
|
model,
|
|
24227
24286
|
Number(orm.get(sql`SELECT count(*) AS n FROM embeddings WHERE model = ${model}`)?.n ?? 0)
|
|
24228
24287
|
])), "vectorCounts");
|
|
24229
24288
|
|
|
24230
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
24289
|
+
// 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/document-pictures.js
|
|
24231
24290
|
var DOCUMENT_PICTURE = "document_picture";
|
|
24232
24291
|
var SCAN_PAGE2 = 5e3;
|
|
24233
24292
|
var idOf = /* @__PURE__ */ __name((ref3) => {
|
|
@@ -24290,12 +24349,12 @@ var documentPicturesOver = /* @__PURE__ */ __name(({ database, now: now2 }) => (
|
|
|
24290
24349
|
}, "nearestPictures")
|
|
24291
24350
|
}), "documentPicturesOver");
|
|
24292
24351
|
|
|
24293
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
24352
|
+
// 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/index-text.js
|
|
24294
24353
|
var noteIndexText = /* @__PURE__ */ __name((title2, text8) => title2 ? `${title2}
|
|
24295
24354
|
|
|
24296
24355
|
${text8}` : text8, "noteIndexText");
|
|
24297
24356
|
|
|
24298
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
24357
|
+
// 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/enrichments.js
|
|
24299
24358
|
var ENRICHMENT_SUBJECTS = ["document", "note", "email"];
|
|
24300
24359
|
var ENRICHMENT_POSITION = 1e6;
|
|
24301
24360
|
var EMAIL_ENRICHMENT = "email_enrichment";
|
|
@@ -24389,7 +24448,7 @@ var enrichmentsOver = /* @__PURE__ */ __name(({ database, now: now2 }) => ({
|
|
|
24389
24448
|
}), "clear")
|
|
24390
24449
|
}), "enrichmentsOver");
|
|
24391
24450
|
|
|
24392
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
24451
|
+
// 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/query-filter.js
|
|
24393
24452
|
var glob = /* @__PURE__ */ __name((value) => [...fold(value).matchAll(/\\(.)|([*?])|(.)/gsu)].map(([, escaped2, wildcard, plain2]) => {
|
|
24394
24453
|
const literal4 = escaped2 ?? plain2 ?? "";
|
|
24395
24454
|
return wildcard ?? (/[*?[]/u.test(literal4) ? `[${literal4}]` : literal4);
|
|
@@ -24465,7 +24524,7 @@ var compile = /* @__PURE__ */ __name((node, columns2, options) => {
|
|
|
24465
24524
|
var queryFilter = /* @__PURE__ */ __name((ast, columns2, options) => compile(ast.root, columns2, options), "queryFilter");
|
|
24466
24525
|
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");
|
|
24467
24526
|
|
|
24468
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
24527
|
+
// 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/events.js
|
|
24469
24528
|
var toJson = /* @__PURE__ */ __name((value) => value === null || value === void 0 ? null : JSON.stringify(value), "toJson");
|
|
24470
24529
|
var fromJson = /* @__PURE__ */ __name((value) => value === null || value === void 0 ? null : JSON.parse(String(value)), "fromJson");
|
|
24471
24530
|
var int = /* @__PURE__ */ __name((value) => value === null || value === void 0 ? null : Number(value), "int");
|
|
@@ -24555,7 +24614,7 @@ var linkMeeting = /* @__PURE__ */ __name((database, id2, eventId, now2, mode = "
|
|
|
24555
24614
|
});
|
|
24556
24615
|
}, "linkMeeting");
|
|
24557
24616
|
|
|
24558
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
24617
|
+
// 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/task-titles.js
|
|
24559
24618
|
var MAX_TITLE = 120;
|
|
24560
24619
|
var placeholderTitleOf = /* @__PURE__ */ __name((row2) => `${String(row2.type)} \u2014 ${String(row2.source_locator ?? "")}`, "placeholderTitleOf");
|
|
24561
24620
|
var PLACEHOLDER_TITLE_SQL = "title = type || ' \u2014 ' || coalesce(source_locator, '')";
|
|
@@ -24617,7 +24676,7 @@ var fillFoundTaskTitles = /* @__PURE__ */ __name((database, warn, { batch = 500
|
|
|
24617
24676
|
}
|
|
24618
24677
|
}, "fillFoundTaskTitles");
|
|
24619
24678
|
|
|
24620
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
24679
|
+
// 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/note-index.js
|
|
24621
24680
|
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), ''))";
|
|
24622
24681
|
var UNSEARCHED_EVENT_TYPES = [
|
|
24623
24682
|
"working-location",
|
|
@@ -24864,7 +24923,7 @@ var resetNoteIndex = /* @__PURE__ */ __name((database) => {
|
|
|
24864
24923
|
return true;
|
|
24865
24924
|
}, "resetNoteIndex");
|
|
24866
24925
|
|
|
24867
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
24926
|
+
// 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/person-resolution.js
|
|
24868
24927
|
var keyOf2 = /* @__PURE__ */ __name((name) => fold(name).trim().replace(/^@/, ""), "keyOf");
|
|
24869
24928
|
var resolvePersonLinks = /* @__PURE__ */ __name((database, names) => {
|
|
24870
24929
|
for (const key2 of new Set(names.filter((name) => !!name?.trim()).map(keyOf2))) {
|
|
@@ -24883,7 +24942,7 @@ var resolvePersonLinks = /* @__PURE__ */ __name((database, names) => {
|
|
|
24883
24942
|
}
|
|
24884
24943
|
}, "resolvePersonLinks");
|
|
24885
24944
|
|
|
24886
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
24945
|
+
// 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/schema/canonical-tags.js
|
|
24887
24946
|
var canonicalTags = sqliteTable("canonical_tags", {
|
|
24888
24947
|
id: integer("id").primaryKey(),
|
|
24889
24948
|
name: text("name").notNull().unique(),
|
|
@@ -24892,7 +24951,7 @@ var canonicalTags = sqliteTable("canonical_tags", {
|
|
|
24892
24951
|
updatedAt: integer("updated_at").notNull()
|
|
24893
24952
|
});
|
|
24894
24953
|
|
|
24895
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
24954
|
+
// 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/schema/link-revisions.js
|
|
24896
24955
|
var linkRevisions = sqliteTable("link_revisions", {
|
|
24897
24956
|
id: integer("id").primaryKey(),
|
|
24898
24957
|
linkId: integer("link_id").notNull(),
|
|
@@ -24904,7 +24963,7 @@ var linkRevisions = sqliteTable("link_revisions", {
|
|
|
24904
24963
|
createdAt: integer("created_at").notNull()
|
|
24905
24964
|
}, (table) => [index("link_revisions_by_link_id_created_at").on(table.linkId, table.createdAt)]);
|
|
24906
24965
|
|
|
24907
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
24966
|
+
// 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/schema/document-transfers.js
|
|
24908
24967
|
var documentAnnotationTransfers = sqliteTable("document_annotation_transfers", {
|
|
24909
24968
|
sourceKey: text("source_key").notNull(),
|
|
24910
24969
|
collection: text("collection").notNull(),
|
|
@@ -24914,13 +24973,13 @@ var documentAnnotationTransfers = sqliteTable("document_annotation_transfers", {
|
|
|
24914
24973
|
createdAt: integer("created_at").notNull()
|
|
24915
24974
|
}, (table) => [primaryKey({ columns: [table.sourceKey, table.collection] })]);
|
|
24916
24975
|
|
|
24917
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
24976
|
+
// 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/schema/document-index-pending.js
|
|
24918
24977
|
var documentIndexPending = sqliteTable("document_index_pending", {
|
|
24919
24978
|
id: integer("id").notNull(),
|
|
24920
24979
|
indexableType: text("indexable_type").notNull()
|
|
24921
24980
|
}, (table) => [primaryKey({ columns: [table.indexableType, table.id] })]);
|
|
24922
24981
|
|
|
24923
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
24982
|
+
// 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/schema/decision-requests.js
|
|
24924
24983
|
var decisionRequests = sqliteTable("decision_requests", {
|
|
24925
24984
|
id: integer("id").primaryKey(),
|
|
24926
24985
|
tokenDigest: text("token_digest").notNull().unique(),
|
|
@@ -24940,7 +24999,7 @@ var decisionRequests = sqliteTable("decision_requests", {
|
|
|
24940
24999
|
index("decision_requests_by_channel_bot_profile_chat_id_message_id").on(table.channel, table.botProfile, table.chatId, table.messageId)
|
|
24941
25000
|
]);
|
|
24942
25001
|
|
|
24943
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
25002
|
+
// 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/schema/enrichments.js
|
|
24944
25003
|
var enrichments = sqliteTable("enrichments", {
|
|
24945
25004
|
subjectType: text("subject_type").notNull(),
|
|
24946
25005
|
subjectId: integer("subject_id").notNull(),
|
|
@@ -24952,7 +25011,7 @@ var enrichments = sqliteTable("enrichments", {
|
|
|
24952
25011
|
createdAt: integer("created_at").notNull()
|
|
24953
25012
|
}, (table) => [primaryKey({ columns: [table.subjectType, table.subjectId] })]);
|
|
24954
25013
|
|
|
24955
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
25014
|
+
// 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/schema/templates.js
|
|
24956
25015
|
var templates = sqliteTable("templates", {
|
|
24957
25016
|
key: text("key").notNull(),
|
|
24958
25017
|
channel: text("channel").notNull(),
|
|
@@ -24974,7 +25033,7 @@ var templatesHistory = sqliteTable("templates_history", {
|
|
|
24974
25033
|
index("templates_history_by_key_channel_language_id").on(table.key, table.channel, table.language, table.id)
|
|
24975
25034
|
]);
|
|
24976
25035
|
|
|
24977
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
25036
|
+
// 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/schema/links.js
|
|
24978
25037
|
var links = sqliteTable("links", {
|
|
24979
25038
|
id: integer("id").primaryKey(),
|
|
24980
25039
|
fromType: text("from_type").notNull(),
|
|
@@ -25005,7 +25064,7 @@ var links = sqliteTable("links", {
|
|
|
25005
25064
|
index("links_by_to_type_to_id").on(table.toType, table.toId)
|
|
25006
25065
|
]);
|
|
25007
25066
|
|
|
25008
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
25067
|
+
// 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/schema/tag-consolidations.js
|
|
25009
25068
|
var tagRedirects = sqliteTable("tag_redirects", {
|
|
25010
25069
|
sourceId: integer("source_id").primaryKey().references(() => canonicalTags.id),
|
|
25011
25070
|
survivorId: integer("survivor_id").notNull().references(() => canonicalTags.id),
|
|
@@ -25031,7 +25090,7 @@ var tagConsolidations = sqliteTable("tag_consolidations", {
|
|
|
25031
25090
|
index("tag_consolidations_by_actor_type_actor_id").on(table.actorType, table.actorId)
|
|
25032
25091
|
]);
|
|
25033
25092
|
|
|
25034
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
25093
|
+
// 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/schema.js
|
|
25035
25094
|
var accounts = sqliteTable("accounts", {
|
|
25036
25095
|
id: integer("id").primaryKey(),
|
|
25037
25096
|
provider: text("provider").notNull(),
|
|
@@ -27071,13 +27130,50 @@ var vectorIndexes = sqliteTable("vector_indexes", {
|
|
|
27071
27130
|
var vectorIndexRedo = sqliteTable("vector_index_redo", {
|
|
27072
27131
|
chunkId: integer("chunk_id").notNull()
|
|
27073
27132
|
});
|
|
27133
|
+
var conversationReadiness = sqliteTable("conversation_readiness", {
|
|
27134
|
+
chatId: integer("chat_id").notNull().references(() => chats.id, { onDelete: "cascade" }),
|
|
27135
|
+
model: text("model").notNull(),
|
|
27136
|
+
newCount: integer("new_count").notNull(),
|
|
27137
|
+
editedCount: integer("edited_count").notNull(),
|
|
27138
|
+
deletedCount: integer("deleted_count").notNull(),
|
|
27139
|
+
chunks: integer("chunks").notNull(),
|
|
27140
|
+
embeddedCount: integer("embedded_count").notNull(),
|
|
27141
|
+
current: integer("current").notNull(),
|
|
27142
|
+
stale: integer("stale").notNull(),
|
|
27143
|
+
countedAt: integer("counted_at").notNull()
|
|
27144
|
+
}, (table) => [
|
|
27145
|
+
primaryKey({ columns: [table.chatId, table.model] }),
|
|
27146
|
+
index("conversation_readiness_by_model").on(table.model)
|
|
27147
|
+
]);
|
|
27148
|
+
var trackerItems = sqliteTable("tracker_items", {
|
|
27149
|
+
id: integer("id").primaryKey(),
|
|
27150
|
+
accountId: integer("account_id").notNull().references(() => accounts.id),
|
|
27151
|
+
kind: text("kind").notNull(),
|
|
27152
|
+
externalId: text("external_id").notNull(),
|
|
27153
|
+
/** A comment's issue, an issue's team, a state's or a label's team: the tracker's id. */
|
|
27154
|
+
parentId: text("parent_id"),
|
|
27155
|
+
title: text("title").notNull(),
|
|
27156
|
+
titleFolded: text("title_folded").notNull(),
|
|
27157
|
+
body: text("body"),
|
|
27158
|
+
normalizedText: text("normalized_text").notNull(),
|
|
27159
|
+
data: text("data").notNull(),
|
|
27160
|
+
sourceCreatedAt: integer("source_created_at"),
|
|
27161
|
+
sourceUpdatedAt: integer("source_updated_at"),
|
|
27162
|
+
archivedAt: integer("archived_at"),
|
|
27163
|
+
/** The tracker no longer lists it. */
|
|
27164
|
+
deletedAt: integer("deleted_at"),
|
|
27165
|
+
syncedAt: integer("synced_at").notNull()
|
|
27166
|
+
}, (table) => [
|
|
27167
|
+
unique().on(table.accountId, table.kind, table.externalId),
|
|
27168
|
+
index("tracker_items_by_account_id_kind_parent_id").on(table.accountId, table.kind, table.parentId)
|
|
27169
|
+
]);
|
|
27074
27170
|
var storeSettings = sqliteTable("store_settings", {
|
|
27075
27171
|
key: text("key").primaryKey(),
|
|
27076
27172
|
value: text("value").notNull(),
|
|
27077
27173
|
at: integer("at").notNull()
|
|
27078
27174
|
});
|
|
27079
27175
|
|
|
27080
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
27176
|
+
// 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/identities.js
|
|
27081
27177
|
var contactsOf = /* @__PURE__ */ __name(({ phones: phones2, emails: emails3 }) => {
|
|
27082
27178
|
if (phones2 === void 0 && emails3 === void 0)
|
|
27083
27179
|
return void 0;
|
|
@@ -27323,7 +27419,7 @@ var meetingIdentityPk = /* @__PURE__ */ __name((context, accountId, identity) =>
|
|
|
27323
27419
|
}, "meetingIdentityPk");
|
|
27324
27420
|
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");
|
|
27325
27421
|
|
|
27326
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
27422
|
+
// 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/person-separation.js
|
|
27327
27423
|
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");
|
|
27328
27424
|
var MOVED_AWAY = `moved.identity_id IN (SELECT value FROM json_each(?))
|
|
27329
27425
|
AND (moved.from_person_id IN (SELECT value FROM json_each(?))
|
|
@@ -27338,7 +27434,7 @@ var apart = /* @__PURE__ */ __name(({ database }, one2, other) => {
|
|
|
27338
27434
|
var separated = /* @__PURE__ */ __name((context, one2, other) => one2 !== other && apart(context, { identities: identitiesOf(context, one2), person: one2 }, { identities: identitiesOf(context, other), person: other }), "separated");
|
|
27339
27435
|
var identitySeparated = /* @__PURE__ */ __name((context, identity, person2) => apart(context, { identities: [identity] }, { identities: identitiesOf(context, person2).filter((pk) => pk !== identity), person: person2 }), "identitySeparated");
|
|
27340
27436
|
|
|
27341
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
27437
|
+
// 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/reads.js
|
|
27342
27438
|
var MESSAGE_FIELDS = {
|
|
27343
27439
|
pk: messages.id,
|
|
27344
27440
|
nativeId: messages.externalId,
|
|
@@ -27518,7 +27614,7 @@ var chatActivity = /* @__PURE__ */ __name(({ database }, accountKey, since, wher
|
|
|
27518
27614
|
storedAt: toIso(Number(database.prepare("SELECT max(created_at) AS at FROM messages WHERE account_id = ?").get(accountKey)?.at) || null)
|
|
27519
27615
|
}), "chatActivity");
|
|
27520
27616
|
|
|
27521
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
27617
|
+
// 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/search.js
|
|
27522
27618
|
var HIT_FIELDS = {
|
|
27523
27619
|
...MESSAGE_FIELDS,
|
|
27524
27620
|
chatTitle: sql`${chats.title}`.as("chat_title"),
|
|
@@ -27619,7 +27715,7 @@ var directReplies = /* @__PURE__ */ __name((context, parents, limit) => {
|
|
|
27619
27715
|
};
|
|
27620
27716
|
}, "directReplies");
|
|
27621
27717
|
|
|
27622
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
27718
|
+
// 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/person-links.js
|
|
27623
27719
|
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");
|
|
27624
27720
|
var required = /* @__PURE__ */ __name((context, ref3) => {
|
|
27625
27721
|
const found2 = identityRow(context, ref3);
|
|
@@ -27832,7 +27928,7 @@ var mentioning = /* @__PURE__ */ __name((context, accountKey, { id: id2, usernam
|
|
|
27832
27928
|
}, "mentioning");
|
|
27833
27929
|
var escaped = /* @__PURE__ */ __name((text8) => text8.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), "escaped");
|
|
27834
27930
|
|
|
27835
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
27931
|
+
// 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/actors.js
|
|
27836
27932
|
var BOT_KINDS = ["agent", "rule", "script", "integration"];
|
|
27837
27933
|
var ownerPerson = /* @__PURE__ */ __name((database) => {
|
|
27838
27934
|
const found2 = database.prepare("SELECT id FROM persons WHERE owner = 1 ORDER BY id LIMIT 1").get();
|
|
@@ -27889,7 +27985,7 @@ var proposedBySql = /* @__PURE__ */ __name((type, id2, by) => {
|
|
|
27889
27985
|
return { sql: bot("pb.name = ?"), params: [by.bot] };
|
|
27890
27986
|
}, "proposedBySql");
|
|
27891
27987
|
|
|
27892
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
27988
|
+
// 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/source-review-marks.js
|
|
27893
27989
|
var TABLES = { memory: "memories", fact: "facts" };
|
|
27894
27990
|
var HOLDING = { memory: ["proposed", "confirmed"], fact: ["proposed", "accepted"] };
|
|
27895
27991
|
var KEPT = 20;
|
|
@@ -27984,7 +28080,7 @@ var scrubSourceReviews = /* @__PURE__ */ __name((database, erased, { refs }) =>
|
|
|
27984
28080
|
return scrubbed;
|
|
27985
28081
|
}, "scrubSourceReviews");
|
|
27986
28082
|
|
|
27987
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
28083
|
+
// 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/evidence-signature.js
|
|
27988
28084
|
var QUOTE_LIMIT = 500;
|
|
27989
28085
|
var GONE = { sig: "gone", rev: null, deleted: true, changedAt: null };
|
|
27990
28086
|
var part = /* @__PURE__ */ __name((value) => value == null ? "" : String(value), "part");
|
|
@@ -28263,11 +28359,11 @@ var deleteDocumentRow = /* @__PURE__ */ __name((database, id2, at2) => {
|
|
|
28263
28359
|
database.prepare("DELETE FROM documents WHERE id = ?").run(id2);
|
|
28264
28360
|
}, "deleteDocumentRow");
|
|
28265
28361
|
|
|
28266
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
28362
|
+
// 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/domain/ref-summaries.js
|
|
28267
28363
|
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");
|
|
28268
28364
|
var oneLine = /* @__PURE__ */ __name((text8) => singleLine(text8.replace(/\s+/g, " ").trim()), "oneLine");
|
|
28269
28365
|
|
|
28270
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
28366
|
+
// 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/ref-accounts.js
|
|
28271
28367
|
var accountKeys = /* @__PURE__ */ __name((database, ids3) => {
|
|
28272
28368
|
const unique2 = [...new Set(ids3)];
|
|
28273
28369
|
if (unique2.length === 0)
|
|
@@ -28356,7 +28452,7 @@ var refEndsOf = /* @__PURE__ */ __name((database, text8) => {
|
|
|
28356
28452
|
}, "refEndsOf");
|
|
28357
28453
|
var refAccountsOf = /* @__PURE__ */ __name((database, text8) => refEndsOf(database, text8)?.flat(), "refAccountsOf");
|
|
28358
28454
|
|
|
28359
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
28455
|
+
// 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/ref-summaries.js
|
|
28360
28456
|
var EXCERPT_CHARS = 280;
|
|
28361
28457
|
var TITLE_CHARS = 120;
|
|
28362
28458
|
var MEMORY_TITLE_CHARS = 80;
|
|
@@ -28780,7 +28876,7 @@ var refsStoreOver = /* @__PURE__ */ __name((context) => ({
|
|
|
28780
28876
|
ends: /* @__PURE__ */ __name(async (text8) => refEndsOf(context.database, text8), "ends")
|
|
28781
28877
|
}), "refsStoreOver");
|
|
28782
28878
|
|
|
28783
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
28879
|
+
// 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/evidence-sources.js
|
|
28784
28880
|
var sourceOf3 = /* @__PURE__ */ __name((read2, ref3) => ({
|
|
28785
28881
|
ref: ref3,
|
|
28786
28882
|
kind: read2.kind,
|
|
@@ -28818,7 +28914,7 @@ var evidenceSourcesOf = /* @__PURE__ */ __name((database, from2) => {
|
|
|
28818
28914
|
});
|
|
28819
28915
|
}, "evidenceSourcesOf");
|
|
28820
28916
|
|
|
28821
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
28917
|
+
// 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/attachments/limits.js
|
|
28822
28918
|
var MAX_FILE_BYTES = 50 * 1024 * 1024;
|
|
28823
28919
|
var MAX_TEXT_CHARS = 2e6;
|
|
28824
28920
|
var ATTACHMENT_LIMIT_ENV = [
|
|
@@ -28844,7 +28940,7 @@ var pdfPreviewLimits = /* @__PURE__ */ __name((env = process.env) => {
|
|
|
28844
28940
|
return { pixels, bytes: positive(env, "MESSAGING_PDF_PREVIEW_MAX_MIB", 8 * 1024 * 1024, 1024 * 1024) };
|
|
28845
28941
|
}, "pdfPreviewLimits");
|
|
28846
28942
|
|
|
28847
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
28943
|
+
// 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/ulid.js
|
|
28848
28944
|
import { randomBytes } from "node:crypto";
|
|
28849
28945
|
var CROCKFORD = "0123456789ABCDEFGHJKMNPQRSTVWXYZ";
|
|
28850
28946
|
var ulid = /* @__PURE__ */ __name((now2 = Date.now()) => {
|
|
@@ -28857,7 +28953,7 @@ var ulid = /* @__PURE__ */ __name((now2 = Date.now()) => {
|
|
|
28857
28953
|
return time3 + random;
|
|
28858
28954
|
}, "ulid");
|
|
28859
28955
|
|
|
28860
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
28956
|
+
// 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/document-metadata.js
|
|
28861
28957
|
var FOLDED_FIELDS = ["title", "site", "language", "author"];
|
|
28862
28958
|
var encodeDocumentMetadata = /* @__PURE__ */ __name((meta, sections) => {
|
|
28863
28959
|
if (!meta && !sections?.length)
|
|
@@ -28878,11 +28974,11 @@ var languageOf = /* @__PURE__ */ __name((meta) => {
|
|
|
28878
28974
|
return typeof language === "string" && language !== "" ? language : null;
|
|
28879
28975
|
}, "languageOf");
|
|
28880
28976
|
|
|
28881
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
28977
|
+
// 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/file-note.js
|
|
28882
28978
|
var LIVE3 = "f.deleted_at IS NULL AND d.deleted_at IS NULL AND coalesce(json_extract(d.metadata, '$.catalog.active'), 1)=1";
|
|
28883
28979
|
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");
|
|
28884
28980
|
|
|
28885
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
28981
|
+
// 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/files.js
|
|
28886
28982
|
var isObject2 = /* @__PURE__ */ __name((value) => value !== null && typeof value === "object" && !Array.isArray(value), "isObject");
|
|
28887
28983
|
var objectOf = /* @__PURE__ */ __name((value) => {
|
|
28888
28984
|
if (isObject2(value))
|
|
@@ -29129,7 +29225,7 @@ var filesStoreOver = /* @__PURE__ */ __name(({ database, now: now2 }) => {
|
|
|
29129
29225
|
};
|
|
29130
29226
|
}, "filesStoreOver");
|
|
29131
29227
|
|
|
29132
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
29228
|
+
// 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/imported-documents.js
|
|
29133
29229
|
var IMPORTED_DOCUMENT_QUERY = defineQuery({
|
|
29134
29230
|
entity: "document",
|
|
29135
29231
|
backend: "sql",
|
|
@@ -29175,7 +29271,7 @@ var importedDocumentWhere = /* @__PURE__ */ __name((database, query) => {
|
|
|
29175
29271
|
return queryFilter(validateQuery(query, IMPORTED_DOCUMENT_QUERY), columns2, { zone: timezoneOf() });
|
|
29176
29272
|
}, "importedDocumentWhere");
|
|
29177
29273
|
|
|
29178
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
29274
|
+
// 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/link-reviews.js
|
|
29179
29275
|
var reviewLink = /* @__PURE__ */ __name((database, linkable, entity, candidates, reason, now2) => {
|
|
29180
29276
|
database.prepare(`INSERT INTO link_reviews (linkable_type, linkable_id, entity_type, candidates, reason, status, created_at, updated_at)
|
|
29181
29277
|
VALUES (?, ?, ?, ?, ?, 'open', ?, ?)
|
|
@@ -29183,7 +29279,7 @@ var reviewLink = /* @__PURE__ */ __name((database, linkable, entity, candidates,
|
|
|
29183
29279
|
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);
|
|
29184
29280
|
}, "reviewLink");
|
|
29185
29281
|
|
|
29186
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
29282
|
+
// 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/link-row.js
|
|
29187
29283
|
var iso3 = /* @__PURE__ */ __name((value) => new Date(Number(value)).toISOString(), "iso");
|
|
29188
29284
|
var thingRef = /* @__PURE__ */ __name((database, type, id2) => type == null || id2 == null ? null : referenceOfThing(database, storedThing(type, id2)) ?? null, "thingRef");
|
|
29189
29285
|
var hasBothEnds = /* @__PURE__ */ __name((link3) => link3.from !== null && link3.to !== null, "hasBothEnds");
|
|
@@ -29217,7 +29313,7 @@ var linkOf = /* @__PURE__ */ __name((database, row2) => {
|
|
|
29217
29313
|
};
|
|
29218
29314
|
}, "linkOf");
|
|
29219
29315
|
|
|
29220
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
29316
|
+
// 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/note-dates.js
|
|
29221
29317
|
var dateFileNotes = /* @__PURE__ */ __name((database, folder, dates) => {
|
|
29222
29318
|
const fileAt = database.prepare("SELECT id, document_id FROM files WHERE account_id = ? AND external_id = ? AND kind <> 'folder' AND deleted_at IS NULL");
|
|
29223
29319
|
const legacy = database.prepare("SELECT id FROM documents WHERE account_id = ? AND external_id = ? AND deleted_at IS NULL");
|
|
@@ -29238,7 +29334,7 @@ var dateFileNotes = /* @__PURE__ */ __name((database, folder, dates) => {
|
|
|
29238
29334
|
return changed;
|
|
29239
29335
|
}, "dateFileNotes");
|
|
29240
29336
|
|
|
29241
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
29337
|
+
// 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/text-input.js
|
|
29242
29338
|
var textOf2 = /* @__PURE__ */ __name((text8, what, max = 1e5, allowEmpty = false) => {
|
|
29243
29339
|
const value = text8.trim();
|
|
29244
29340
|
if (!value && !allowEmpty || value.length > max)
|
|
@@ -29251,7 +29347,7 @@ var oneOf = /* @__PURE__ */ __name((value, allowed, what) => {
|
|
|
29251
29347
|
return value;
|
|
29252
29348
|
}, "oneOf");
|
|
29253
29349
|
|
|
29254
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
29350
|
+
// 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/notes.js
|
|
29255
29351
|
var NOTE_FORMATS = ["obsidian", "markdown"];
|
|
29256
29352
|
var RELATIONSHIPS = RELATION_KINDS.map(linkKind).join(", ");
|
|
29257
29353
|
var iso4 = /* @__PURE__ */ __name((value) => new Date(Number(value)).toISOString(), "iso");
|
|
@@ -29773,10 +29869,10 @@ var notesStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
29773
29869
|
};
|
|
29774
29870
|
}, "notesStoreOver");
|
|
29775
29871
|
|
|
29776
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
29872
|
+
// 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/rows-page.js
|
|
29777
29873
|
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");
|
|
29778
29874
|
|
|
29779
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
29875
|
+
// 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/memories.js
|
|
29780
29876
|
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";
|
|
29781
29877
|
var iso5 = /* @__PURE__ */ __name((value) => new Date(Number(value)).toISOString(), "iso");
|
|
29782
29878
|
var oneOf2 = /* @__PURE__ */ __name((value, allowed, what) => {
|
|
@@ -30041,7 +30137,7 @@ var memoriesStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
30041
30137
|
};
|
|
30042
30138
|
}, "memoriesStoreOver");
|
|
30043
30139
|
|
|
30044
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
30140
|
+
// 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/reviewed.js
|
|
30045
30141
|
var prefixesText = /* @__PURE__ */ __name((types) => `${article(types[0] ?? "")} ${types.map((type) => `${type}:`).join(" or ")}`, "prefixesText");
|
|
30046
30142
|
var refuse = /* @__PURE__ */ __name((message3, reason, code = "validation_error") => {
|
|
30047
30143
|
throw new CliError(code, message3, { reason });
|
|
@@ -30189,7 +30285,7 @@ var reviewedRowsOver = /* @__PURE__ */ __name((context) => {
|
|
|
30189
30285
|
return { partyOf, partyThing, reviewedOf, written, keepEvidence, ownerOnly: ownerOnly2, linkedId, ...decisionsOver(context) };
|
|
30190
30286
|
}, "reviewedRowsOver");
|
|
30191
30287
|
|
|
30192
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
30288
|
+
// 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/money-lines.js
|
|
30193
30289
|
var MAX_LINES = 500;
|
|
30194
30290
|
var PARENTS = {
|
|
30195
30291
|
invoice: {
|
|
@@ -30289,7 +30385,7 @@ var moneyLinesOver = /* @__PURE__ */ __name(({ database }) => {
|
|
|
30289
30385
|
return { linesOf, insertLines, shownLines, appendLine, deleteLine, sumOf, retotal };
|
|
30290
30386
|
}, "moneyLinesOver");
|
|
30291
30387
|
|
|
30292
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
30388
|
+
// 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/refunds.js
|
|
30293
30389
|
var COUNTED = {
|
|
30294
30390
|
confirmed: "np.review = 'confirmed' AND np.deleted_at IS NULL",
|
|
30295
30391
|
// A proposed refund promises nothing back yet, so it must not free room an import could then fill.
|
|
@@ -30364,7 +30460,7 @@ var refundRulesOver = /* @__PURE__ */ __name((context) => {
|
|
|
30364
30460
|
return { originalFor, refundShare, confirmable, keepsRefunded, keepsShare, keepsInvoice };
|
|
30365
30461
|
}, "refundRulesOver");
|
|
30366
30462
|
|
|
30367
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
30463
|
+
// 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/finance.js
|
|
30368
30464
|
var FINANCE_TYPES = ["invoice", "payment"];
|
|
30369
30465
|
var isFinanceType = /* @__PURE__ */ __name((type) => FINANCE_TYPES.includes(type), "isFinanceType");
|
|
30370
30466
|
var PAID = netPaidSql("i.id");
|
|
@@ -30768,7 +30864,7 @@ var financeStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
30768
30864
|
};
|
|
30769
30865
|
}, "financeStoreOver");
|
|
30770
30866
|
|
|
30771
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
30867
|
+
// 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/payment-entries.js
|
|
30772
30868
|
var refuse2 = /* @__PURE__ */ __name((message3, reason) => {
|
|
30773
30869
|
throw new CliError("validation_error", message3, { reason });
|
|
30774
30870
|
}, "refuse");
|
|
@@ -30846,7 +30942,7 @@ var paymentEntriesOver = /* @__PURE__ */ __name((context) => {
|
|
|
30846
30942
|
};
|
|
30847
30943
|
}, "paymentEntriesOver");
|
|
30848
30944
|
|
|
30849
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
30945
|
+
// 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/evidence-findings.js
|
|
30850
30946
|
var EVIDENCE_FINDINGS_KIND = "evidence_findings";
|
|
30851
30947
|
var reference = /* @__PURE__ */ __name((raw) => {
|
|
30852
30948
|
if (/^(document|note):[1-9]\d*$/.test(raw))
|
|
@@ -30873,7 +30969,7 @@ var validateEvidenceFindings = /* @__PURE__ */ __name((input) => {
|
|
|
30873
30969
|
return valid;
|
|
30874
30970
|
}, "validateEvidenceFindings");
|
|
30875
30971
|
|
|
30876
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
30972
|
+
// 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/proposed-actions.js
|
|
30877
30973
|
var PROPOSAL_STATUSES = ["proposed", "approved", "rejected", "executed", "failed"];
|
|
30878
30974
|
var PROPOSAL_VERDICTS = ["useful", "not_useful"];
|
|
30879
30975
|
var iso7 = /* @__PURE__ */ __name((value) => value == null ? null : new Date(Number(value)).toISOString(), "iso");
|
|
@@ -31067,7 +31163,7 @@ var proposedActionsStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
31067
31163
|
};
|
|
31068
31164
|
}, "proposedActionsStoreOver");
|
|
31069
31165
|
|
|
31070
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
31166
|
+
// 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/identity-proposals.js
|
|
31071
31167
|
var CONFIRMED = "proposal";
|
|
31072
31168
|
var refOf = /* @__PURE__ */ __name(({ database }, pk) => {
|
|
31073
31169
|
const row2 = database.prepare("SELECT provider, external_id FROM identities WHERE id = ?").get(pk);
|
|
@@ -31419,7 +31515,7 @@ var identityLinkRows = /* @__PURE__ */ __name((context, { person: person2, statu
|
|
|
31419
31515
|
return { items, hasMore: rows.length > limit };
|
|
31420
31516
|
}, "identityLinkRows");
|
|
31421
31517
|
|
|
31422
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
31518
|
+
// 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/person-merges.js
|
|
31423
31519
|
var mergeId = /* @__PURE__ */ __name((to, from2) => `merge:${to}-${from2}`, "mergeId");
|
|
31424
31520
|
var parseMergeId = /* @__PURE__ */ __name((id2) => {
|
|
31425
31521
|
const found2 = /^merge:([1-9]\d*)-([1-9]\d*)$/.exec(id2.trim());
|
|
@@ -31522,7 +31618,7 @@ var split = /* @__PURE__ */ __name((context, uid, refs, by) => {
|
|
|
31522
31618
|
return recordOf(context, alone);
|
|
31523
31619
|
}, "split");
|
|
31524
31620
|
|
|
31525
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
31621
|
+
// 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/identity-split-proposals.js
|
|
31526
31622
|
var refOf2 = /* @__PURE__ */ __name(({ provider, id: id2 }) => `${provider}:${id2}`, "refOf");
|
|
31527
31623
|
var keyOf3 = /* @__PURE__ */ __name((split2, person2, identities2) => `${split2} ${person2} ${[...identities2].sort().join(" ")}`, "keyOf");
|
|
31528
31624
|
var planOf = /* @__PURE__ */ __name((context, input) => {
|
|
@@ -31699,7 +31795,7 @@ var forgetErasedSplits = /* @__PURE__ */ __name((database) => {
|
|
|
31699
31795
|
database.prepare("DELETE FROM proposed_actions WHERE id = ?").run(Number(row2.id));
|
|
31700
31796
|
}, "forgetErasedSplits");
|
|
31701
31797
|
|
|
31702
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
31798
|
+
// 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/domain/test-data.js
|
|
31703
31799
|
var SEED_PEOPLE = [
|
|
31704
31800
|
{ name: "Owner", username: "owner" },
|
|
31705
31801
|
{ name: "Ann Lee", username: "ann" },
|
|
@@ -31716,7 +31812,7 @@ var RESERVED_ADDRESS_GLOBS = [
|
|
|
31716
31812
|
];
|
|
31717
31813
|
var SEED_ID_GLOBS = ["person-[0-9]*"];
|
|
31718
31814
|
|
|
31719
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
31815
|
+
// 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/test-people.js
|
|
31720
31816
|
var TEST_DATA_KIND = "test_data";
|
|
31721
31817
|
var globs = /* @__PURE__ */ __name((column2, patterns) => patterns.map((pattern) => `${column2} GLOB '${pattern}'`).join(" OR "), "globs");
|
|
31722
31818
|
var SURE = `(${globs("i.external_id", SEED_ID_GLOBS)} OR ${globs("lower(i.email)", RESERVED_ADDRESS_GLOBS)})`;
|
|
@@ -31785,7 +31881,7 @@ var forgetErasedTestData = /* @__PURE__ */ __name((database) => {
|
|
|
31785
31881
|
database.prepare("DELETE FROM proposed_actions WHERE id = ?").run(Number(row2.id));
|
|
31786
31882
|
}, "forgetErasedTestData");
|
|
31787
31883
|
|
|
31788
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
31884
|
+
// 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/accounts.js
|
|
31789
31885
|
var accountPk = /* @__PURE__ */ __name(({ orm, now: now2 }, { provider, account, scope: scope3 }, name = null, startScope) => Number(orm.insert(accounts).values({
|
|
31790
31886
|
provider,
|
|
31791
31887
|
externalId: account,
|
|
@@ -31879,7 +31975,7 @@ var dropOrphanPeople = /* @__PURE__ */ __name((database, unseenBefore) => {
|
|
|
31879
31975
|
AND id NOT IN (SELECT id FROM (${referencesTo(database, "persons", /* @__PURE__ */ new Set(["identity_links"]))}) WHERE id IS NOT NULL)`).run(JSON.stringify(persons2));
|
|
31880
31976
|
}, "dropOrphanPeople");
|
|
31881
31977
|
|
|
31882
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
31978
|
+
// 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/history-skips.js
|
|
31883
31979
|
var HISTORY_KEY = "$history";
|
|
31884
31980
|
var objectOf2 = /* @__PURE__ */ __name((text8) => {
|
|
31885
31981
|
if (typeof text8 !== "string")
|
|
@@ -31955,7 +32051,7 @@ var withoutHistory = /* @__PURE__ */ __name((metadata3) => {
|
|
|
31955
32051
|
return rest;
|
|
31956
32052
|
}, "withoutHistory");
|
|
31957
32053
|
|
|
31958
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
32054
|
+
// 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/chats.js
|
|
31959
32055
|
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");
|
|
31960
32056
|
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");
|
|
31961
32057
|
var setChatScope = /* @__PURE__ */ __name((context, accountKey, chatId, scope3) => {
|
|
@@ -32253,7 +32349,7 @@ var replaceAutoTags = /* @__PURE__ */ __name((context, key2, chatId, algorithm,
|
|
|
32253
32349
|
}
|
|
32254
32350
|
}, "replaceAutoTags");
|
|
32255
32351
|
|
|
32256
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
32352
|
+
// 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/bot-tokens.js
|
|
32257
32353
|
var BOT_TOKEN = /(?<!\d)(\d{6,12}):[A-Za-z0-9_-]{30,40}(?![A-Za-z0-9_-])/g;
|
|
32258
32354
|
var MAY_HOLD = "*[0-9][0-9][0-9][0-9][0-9][0-9]:*";
|
|
32259
32355
|
var MASKED_THROUGH = "bot_tokens_masked_through";
|
|
@@ -32293,7 +32389,7 @@ var maskStoredBotTokens = /* @__PURE__ */ __name((context) => {
|
|
|
32293
32389
|
}, "maskStoredBotTokens");
|
|
32294
32390
|
var masks = /* @__PURE__ */ __name((value) => value != null && withoutBotTokens(String(value)) !== value, "masks");
|
|
32295
32391
|
|
|
32296
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
32392
|
+
// 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/context/evidence.js
|
|
32297
32393
|
import { createHash as createHash4 } from "node:crypto";
|
|
32298
32394
|
var CONTEXT_MAX_READ_BYTES = 262144;
|
|
32299
32395
|
var CONTEXT_SOURCE_KINDS = ["message", "mail", "document", "meeting"];
|
|
@@ -32391,7 +32487,7 @@ var contextEvidenceRequest = /* @__PURE__ */ __name((input) => {
|
|
|
32391
32487
|
return { source: source2, query, chat: chat2, senders, words: words4, after: after2, before: before2, limit, maxReadBytes, cursor, signal: input.signal };
|
|
32392
32488
|
}, "contextEvidenceRequest");
|
|
32393
32489
|
|
|
32394
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
32490
|
+
// 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/email-activity.js
|
|
32395
32491
|
var MAIL_AGENDA_COLUMNS = { chat_kind: { type: "enum", sql: "'dialog'" } };
|
|
32396
32492
|
var ACTIVITY = `
|
|
32397
32493
|
SELECT t.external_id AS thread, t.subject, t.last_email_at, t.emails_count,
|
|
@@ -32521,7 +32617,7 @@ var mailActivity = /* @__PURE__ */ __name((database) => ({
|
|
|
32521
32617
|
threadActivity: /* @__PURE__ */ __name(async (accountId, since, where) => threadActivity(database, accountId, since, where), "threadActivity")
|
|
32522
32618
|
}), "mailActivity");
|
|
32523
32619
|
|
|
32524
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
32620
|
+
// 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/conversations/mail-text.js
|
|
32525
32621
|
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");
|
|
32526
32622
|
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;
|
|
32527
32623
|
var ATTRIBUTION = /(wrote|написал[аи]?|escribió|a écrit|schrieb)\s*:\s*$/iu;
|
|
@@ -32602,7 +32698,7 @@ var mailCore = /* @__PURE__ */ __name((body2, earlier) => {
|
|
|
32602
32698
|
return withoutSignOff(withoutGreeting(kept)).join("\n").trim();
|
|
32603
32699
|
}, "mailCore");
|
|
32604
32700
|
|
|
32605
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
32701
|
+
// 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/email-index.js
|
|
32606
32702
|
var titleOf2 = /* @__PURE__ */ __name((subject2) => subject2?.replace(/^\s*((re|fwd?|aw|wg)\s*:\s*)+/i, "").trim() || null, "titleOf");
|
|
32607
32703
|
var MAIL_PIECES = `(SELECT k.id, k.content_hash, k.chunkable_type AS type, k.chunkable_id AS owner, k.position,
|
|
32608
32704
|
k.start_offset, k.end_offset, k.account_id, k.occurred_at,
|
|
@@ -32715,7 +32811,7 @@ var drainEmailIndex = /* @__PURE__ */ __name((database, stemmerFor2) => {
|
|
|
32715
32811
|
return emails3 + threads;
|
|
32716
32812
|
}, "drainEmailIndex");
|
|
32717
32813
|
|
|
32718
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
32814
|
+
// 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/email-locations.js
|
|
32719
32815
|
var locate = /* @__PURE__ */ __name((database, accountId, emailId, where) => database.prepare(`INSERT OR REPLACE INTO email_locations (mailbox_id, uidvalidity, uid, email_id)
|
|
32720
32816
|
SELECT id, ?, ?, ? FROM mailboxes WHERE account_id = ? AND external_id = ?`).run(where.uidvalidity, where.uid, emailId, accountId, where.folder), "locate");
|
|
32721
32817
|
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,
|
|
@@ -32813,7 +32909,7 @@ var forgetLocations = /* @__PURE__ */ __name((database, accountId, folder, uidva
|
|
|
32813
32909
|
var backfillSentAt = /* @__PURE__ */ __name((database, accountId, limit) => Number(database.prepare(`UPDATE emails SET sent_at = received_at WHERE id IN (
|
|
32814
32910
|
SELECT id FROM emails WHERE account_id = ? AND sent_at IS NULL AND received_at IS NOT NULL LIMIT ?)`).run(accountId, limit).changes), "backfillSentAt");
|
|
32815
32911
|
|
|
32816
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
32912
|
+
// 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/email-state.js
|
|
32817
32913
|
var recountEmailThread = /* @__PURE__ */ __name((database, threadId, now2) => database.prepare(`UPDATE email_threads SET
|
|
32818
32914
|
emails_count = (SELECT count(*) FROM emails WHERE email_thread_id = ? AND deleted_at IS NULL),
|
|
32819
32915
|
last_email_at = (SELECT max(coalesce(sent_at, received_at)) FROM emails
|
|
@@ -32863,7 +32959,7 @@ var markEmailsRestored = /* @__PURE__ */ __name((database, accountId, externalId
|
|
|
32863
32959
|
return threads.length;
|
|
32864
32960
|
}, "markEmailsRestored");
|
|
32865
32961
|
|
|
32866
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
32962
|
+
// 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/mail-nearest.js
|
|
32867
32963
|
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
|
|
32868
32964
|
FROM ${MAIL_PIECES} JOIN embeddings v ON v.model = ? AND v.content_hash = p.content_hash
|
|
32869
32965
|
WHERE p.account_id = ?
|
|
@@ -32923,7 +33019,7 @@ var indexedMailPieces = /* @__PURE__ */ __name((database, model, query, filter,
|
|
|
32923
33019
|
}, "indexedMailPieces");
|
|
32924
33020
|
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");
|
|
32925
33021
|
|
|
32926
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
33022
|
+
// 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/mail-rules.js
|
|
32927
33023
|
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");
|
|
32928
33024
|
var conditionsKey = /* @__PURE__ */ __name((conditions) => JSON.stringify(sorted(conditions)), "conditionsKey");
|
|
32929
33025
|
var ruleOf = /* @__PURE__ */ __name((row2) => ({
|
|
@@ -32990,7 +33086,7 @@ var mailRulesOver = /* @__PURE__ */ __name((database) => ({
|
|
|
32990
33086
|
}
|
|
32991
33087
|
}), "mailRulesOver");
|
|
32992
33088
|
|
|
32993
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
33089
|
+
// 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/meeting-operation.js
|
|
32994
33090
|
function checkMeetingCancelled(signal) {
|
|
32995
33091
|
if (!signal?.aborted)
|
|
32996
33092
|
return;
|
|
@@ -33001,7 +33097,7 @@ function checkMeetingCancelled(signal) {
|
|
|
33001
33097
|
}
|
|
33002
33098
|
__name(checkMeetingCancelled, "checkMeetingCancelled");
|
|
33003
33099
|
|
|
33004
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
33100
|
+
// 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/meeting-values.js
|
|
33005
33101
|
var managerOf = /* @__PURE__ */ __name((database, meetingId) => {
|
|
33006
33102
|
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);
|
|
33007
33103
|
if (!found2)
|
|
@@ -33066,7 +33162,7 @@ var transcriptRowOf = /* @__PURE__ */ __name((row2) => ({
|
|
|
33066
33162
|
createdAt: Number(row2.created_at)
|
|
33067
33163
|
}), "transcriptRowOf");
|
|
33068
33164
|
|
|
33069
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
33165
|
+
// 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/meeting-reads.js
|
|
33070
33166
|
var MEETING_TEXT = ["external_id", "title", "description", "location", "join_url", "timezone", "metadata"];
|
|
33071
33167
|
var TRANSCRIPT_TEXT = ["source", "format", "language", "content_hash", "metadata"];
|
|
33072
33168
|
var ROW_TEXT = ["speaker_name", "text", "normalized_text", "metadata"];
|
|
@@ -33233,7 +33329,7 @@ var meetingReadsOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
|
33233
33329
|
}
|
|
33234
33330
|
}), "meetingReadsOver");
|
|
33235
33331
|
|
|
33236
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
33332
|
+
// 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/meeting-selection.js
|
|
33237
33333
|
var meetingSelectionSql = /* @__PURE__ */ __name((input) => {
|
|
33238
33334
|
const clauses = ["m.account_id=?", "m.deleted_at IS NULL"];
|
|
33239
33335
|
const params = [input.accountId];
|
|
@@ -33276,7 +33372,7 @@ var meetingSelectionSql = /* @__PURE__ */ __name((input) => {
|
|
|
33276
33372
|
return { clauses, params };
|
|
33277
33373
|
}, "meetingSelectionSql");
|
|
33278
33374
|
|
|
33279
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
33375
|
+
// 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/meeting-calls.js
|
|
33280
33376
|
var MOST_CALLS = 2e5;
|
|
33281
33377
|
var parsed3 = /* @__PURE__ */ __name((value) => {
|
|
33282
33378
|
if (typeof value !== "string")
|
|
@@ -33331,7 +33427,7 @@ var meetingCallsOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
|
33331
33427
|
}
|
|
33332
33428
|
}), "meetingCallsOver");
|
|
33333
33429
|
|
|
33334
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
33430
|
+
// 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/meeting-chat-lines.js
|
|
33335
33431
|
var meetingChatLinesOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
33336
33432
|
async meetingChatLines(input) {
|
|
33337
33433
|
checkMeetingCancelled(input.signal);
|
|
@@ -33359,7 +33455,7 @@ var meetingChatLinesOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
|
33359
33455
|
}
|
|
33360
33456
|
}), "meetingChatLinesOver");
|
|
33361
33457
|
|
|
33362
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
33458
|
+
// 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/meeting-context-links.js
|
|
33363
33459
|
var missing2 = /* @__PURE__ */ __name(() => {
|
|
33364
33460
|
throw new CliError("not_found", "Meeting, participant or selected target not found");
|
|
33365
33461
|
}, "missing");
|
|
@@ -33482,7 +33578,7 @@ function meetingContextLinksOver(context) {
|
|
|
33482
33578
|
}
|
|
33483
33579
|
__name(meetingContextLinksOver, "meetingContextLinksOver");
|
|
33484
33580
|
|
|
33485
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
33581
|
+
// 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/meeting-documents.js
|
|
33486
33582
|
var TRANSCRIPT_ROLE = "transcript";
|
|
33487
33583
|
var roleOf3 = /* @__PURE__ */ __name((value) => MEETING_DOCUMENT_ROLES.find((role) => role === value), "roleOf");
|
|
33488
33584
|
var attach = /* @__PURE__ */ __name((database, meetingId, fileId, role, metadata3, listed, now2) => {
|
|
@@ -33556,7 +33652,7 @@ var meetingTranscriptDocumentsOver = /* @__PURE__ */ __name(({ database }) => {
|
|
|
33556
33652
|
};
|
|
33557
33653
|
}, "meetingTranscriptDocumentsOver");
|
|
33558
33654
|
|
|
33559
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
33655
|
+
// 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/meeting-index-values.js
|
|
33560
33656
|
var INDEX_CODES = { meeting_transcript_row: 1, meeting_chat_message: 2, meeting_summary: 3 };
|
|
33561
33657
|
var meetingRowid = /* @__PURE__ */ __name((type, id2) => id2 * 4 + INDEX_CODES[type], "meetingRowid");
|
|
33562
33658
|
var summaryOf2 = /* @__PURE__ */ __name((row2) => ({
|
|
@@ -33585,7 +33681,7 @@ var indexedText = /* @__PURE__ */ __name((database, type, id2) => {
|
|
|
33585
33681
|
return row2 ? summaryText(summaryOf2(row2)) : null;
|
|
33586
33682
|
}, "indexedText");
|
|
33587
33683
|
|
|
33588
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
33684
|
+
// 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/meeting-stem-state.js
|
|
33589
33685
|
var summaryBytes = ["title", "overview", "sections", "next_steps", "content"].map((key2) => `coalesce(length(CAST(s.${key2} AS BLOB)),0)`).join("+");
|
|
33590
33686
|
var meetingCurrentIndexRows = `
|
|
33591
33687
|
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
|
|
@@ -33616,7 +33712,7 @@ var invalidateMeetingStems = /* @__PURE__ */ __name((database, type, id2) => {
|
|
|
33616
33712
|
}, "invalidateMeetingStems");
|
|
33617
33713
|
var meetingStemmableText = /* @__PURE__ */ __name((text8) => text8.replace(/[\p{L}\p{N}\p{M}\p{Co}]+/gu, (token) => token.length <= 1024 ? token : ""), "meetingStemmableText");
|
|
33618
33714
|
|
|
33619
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
33715
|
+
// 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/meeting-hit-index.js
|
|
33620
33716
|
function meetingHitIndexOver({ database, now: now2 }) {
|
|
33621
33717
|
return {
|
|
33622
33718
|
async indexSearch(original) {
|
|
@@ -33684,10 +33780,10 @@ function meetingHitIndexOver({ database, now: now2 }) {
|
|
|
33684
33780
|
}
|
|
33685
33781
|
__name(meetingHitIndexOver, "meetingHitIndexOver");
|
|
33686
33782
|
|
|
33687
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
33783
|
+
// 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/meeting-hit-search.js
|
|
33688
33784
|
import { createHash as createHash5 } from "node:crypto";
|
|
33689
33785
|
|
|
33690
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
33786
|
+
// 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/search/correct.js
|
|
33691
33787
|
var SHORTEST_CORRECTION = 3;
|
|
33692
33788
|
var maxEdits = /* @__PURE__ */ __name((word2) => word2.length <= 4 ? 1 : 2, "maxEdits");
|
|
33693
33789
|
var editDistance = /* @__PURE__ */ __name((a, b, max) => {
|
|
@@ -33734,7 +33830,7 @@ var correctWords = /* @__PURE__ */ __name(async (vocabulary, words4) => {
|
|
|
33734
33830
|
return corrections;
|
|
33735
33831
|
}, "correctWords");
|
|
33736
33832
|
|
|
33737
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
33833
|
+
// 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/search/garbled.js
|
|
33738
33834
|
var SHORTEST_GARBLED = 4;
|
|
33739
33835
|
var MOST_WIDENED = 64;
|
|
33740
33836
|
var plain = /* @__PURE__ */ __name((word2) => word2.replaceAll("\u044D", "\u0435"), "plain");
|
|
@@ -33826,7 +33922,7 @@ var widenWords = /* @__PURE__ */ __name((probes, vocabulary, stem, known2) => {
|
|
|
33826
33922
|
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));
|
|
33827
33923
|
}, "widenWords");
|
|
33828
33924
|
|
|
33829
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
33925
|
+
// 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/search/russian-dictionary.js
|
|
33830
33926
|
import { readFileSync } from "node:fs";
|
|
33831
33927
|
var loaded;
|
|
33832
33928
|
var dictionary = /* @__PURE__ */ __name(() => {
|
|
@@ -33885,7 +33981,7 @@ var knownRussianWord = /* @__PURE__ */ __name((word2) => {
|
|
|
33885
33981
|
return false;
|
|
33886
33982
|
}, "knownRussianWord");
|
|
33887
33983
|
|
|
33888
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
33984
|
+
// 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/meeting-hit-query.js
|
|
33889
33985
|
var WORD2 = /[\p{L}\p{N}\p{M}]+/gu;
|
|
33890
33986
|
var MOST_WORDS = 128;
|
|
33891
33987
|
var quote = /* @__PURE__ */ __name((word2) => `"${word2.replaceAll('"', '""')}"`, "quote");
|
|
@@ -34141,7 +34237,7 @@ var matchedMeetingWords = /* @__PURE__ */ __name((tree, text8, stemmer2) => {
|
|
|
34141
34237
|
return [...found2];
|
|
34142
34238
|
}, "matchedMeetingWords");
|
|
34143
34239
|
|
|
34144
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34240
|
+
// 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/meeting-hit-search.js
|
|
34145
34241
|
var fail = /* @__PURE__ */ __name((message3) => {
|
|
34146
34242
|
throw new CliError("validation_error", message3);
|
|
34147
34243
|
}, "fail");
|
|
@@ -34325,7 +34421,7 @@ function meetingHitSearchOver({ database }) {
|
|
|
34325
34421
|
}
|
|
34326
34422
|
__name(meetingHitSearchOver, "meetingHitSearchOver");
|
|
34327
34423
|
|
|
34328
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34424
|
+
// 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/meeting-languages.js
|
|
34329
34425
|
var meetingLanguagesOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
34330
34426
|
async fillTranscriptLanguages({ accountId, apply, now: now2 }) {
|
|
34331
34427
|
positiveReadInteger(accountId, "accountId");
|
|
@@ -34357,7 +34453,7 @@ var meetingLanguagesOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
|
34357
34453
|
}
|
|
34358
34454
|
}), "meetingLanguagesOver");
|
|
34359
34455
|
|
|
34360
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34456
|
+
// 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/meeting-participant-search.js
|
|
34361
34457
|
import { createHash as createHash6 } from "node:crypto";
|
|
34362
34458
|
var cursorOf2 = /* @__PURE__ */ __name((value, key2) => {
|
|
34363
34459
|
if (value === void 0)
|
|
@@ -34450,7 +34546,7 @@ var meetingParticipantSearchOver = /* @__PURE__ */ __name((context) => ({
|
|
|
34450
34546
|
}
|
|
34451
34547
|
}), "meetingParticipantSearchOver");
|
|
34452
34548
|
|
|
34453
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34549
|
+
// 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/preparation-context-queries.js
|
|
34454
34550
|
var preparationQueries = {
|
|
34455
34551
|
participants: {
|
|
34456
34552
|
fields: "p.id, p.identity_id, p.display_name, l.person_id",
|
|
@@ -34500,7 +34596,7 @@ var preparationQueries = {
|
|
|
34500
34596
|
}
|
|
34501
34597
|
};
|
|
34502
34598
|
|
|
34503
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34599
|
+
// 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/meeting-preparation-context.js
|
|
34504
34600
|
var meetingPreparationContextOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
34505
34601
|
async preparationContext(original) {
|
|
34506
34602
|
const input = validateMeetingPreparationContext(original);
|
|
@@ -34541,7 +34637,7 @@ var meetingPreparationContextOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
|
34541
34637
|
}
|
|
34542
34638
|
}), "meetingPreparationContextOver");
|
|
34543
34639
|
|
|
34544
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34640
|
+
// 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/preparation-subjects.js
|
|
34545
34641
|
var preparationSubjects = /* @__PURE__ */ __name((anchors) => `WITH anchors AS (
|
|
34546
34642
|
SELECT m.id FROM meetings m JOIN meeting_series s ON s.id=m.meeting_series_id
|
|
34547
34643
|
WHERE m.id IN (${Array.from({ length: anchors }, () => "?").join(",")}) AND m.account_id=? AND s.account_id=?
|
|
@@ -34555,7 +34651,7 @@ var preparationSubjects = /* @__PURE__ */ __name((anchors) => `WITH anchors AS (
|
|
|
34555
34651
|
JOIN main.projects p ON p.id=l.to_id WHERE p.account_id IS NULL AND p.deleted_at IS NULL
|
|
34556
34652
|
)`, "preparationSubjects");
|
|
34557
34653
|
|
|
34558
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34654
|
+
// 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/meeting-preparation-knowledge.js
|
|
34559
34655
|
var meetingPreparationKnowledgeOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
34560
34656
|
async preparationKnowledge(original) {
|
|
34561
34657
|
const { accountId, seriesId, anchorIds, after: after2, before: before2, limit, maxReadBytes, signal } = validateMeetingRelatedHistory(original);
|
|
@@ -34600,7 +34696,7 @@ var meetingPreparationKnowledgeOver = /* @__PURE__ */ __name(({ database }) => (
|
|
|
34600
34696
|
}
|
|
34601
34697
|
}), "meetingPreparationKnowledgeOver");
|
|
34602
34698
|
|
|
34603
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34699
|
+
// 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/meeting-preparation-notes.js
|
|
34604
34700
|
var meetingPreparationNotesOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
34605
34701
|
async preparationNotes(original) {
|
|
34606
34702
|
const { accountId, seriesId, anchorIds, after: after2, before: before2, limit, maxReadBytes, signal } = validateMeetingRelatedHistory(original);
|
|
@@ -34653,7 +34749,7 @@ var meetingPreparationNotesOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
|
34653
34749
|
}
|
|
34654
34750
|
}), "meetingPreparationNotesOver");
|
|
34655
34751
|
|
|
34656
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34752
|
+
// 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/meeting-related-history.js
|
|
34657
34753
|
var meetingRelatedHistoryOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
34658
34754
|
async relatedHistory(original) {
|
|
34659
34755
|
const input = validateMeetingRelatedHistory(original);
|
|
@@ -34724,7 +34820,7 @@ var meetingRelatedHistoryOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
|
34724
34820
|
}
|
|
34725
34821
|
}), "meetingRelatedHistoryOver");
|
|
34726
34822
|
|
|
34727
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34823
|
+
// 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/meeting-review.js
|
|
34728
34824
|
var number2 = /* @__PURE__ */ __name((value) => value === null || value === void 0 ? null : Number(value), "number");
|
|
34729
34825
|
var text3 = /* @__PURE__ */ __name((value) => value === null || value === void 0 ? null : String(value), "text");
|
|
34730
34826
|
var meetingReviewOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
@@ -34805,7 +34901,7 @@ var meetingReviewOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
|
34805
34901
|
}
|
|
34806
34902
|
}), "meetingReviewOver");
|
|
34807
34903
|
|
|
34808
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34904
|
+
// 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/meeting-series-history.js
|
|
34809
34905
|
var bytes2 = "length(CAST(external_id AS BLOB)) + coalesce(length(CAST(title AS BLOB)), 0)";
|
|
34810
34906
|
var ensureBytes2 = /* @__PURE__ */ __name((size2, budget) => {
|
|
34811
34907
|
if (!Number.isSafeInteger(size2) || size2 < 0 || size2 > budget)
|
|
@@ -34859,7 +34955,7 @@ var meetingSeriesHistoryOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
|
34859
34955
|
}
|
|
34860
34956
|
}), "meetingSeriesHistoryOver");
|
|
34861
34957
|
|
|
34862
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34958
|
+
// 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/meeting-stats.js
|
|
34863
34959
|
var MOST_ROWS = 5e5;
|
|
34864
34960
|
var meetingCountsSql = /* @__PURE__ */ __name((where) => `SELECT m.started_at, coalesce(m.duration_ms, m.ended_at - m.started_at) AS duration_ms,
|
|
34865
34961
|
EXISTS (SELECT 1 FROM meeting_transcripts t WHERE t.meeting_id = m.id AND t.deleted_at IS NULL
|
|
@@ -34928,7 +35024,7 @@ var meetingStatsOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
|
34928
35024
|
}
|
|
34929
35025
|
}), "meetingStatsOver");
|
|
34930
35026
|
|
|
34931
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
35027
|
+
// 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/domain/name-variants.js
|
|
34932
35028
|
var CYRILLIC_TO_LATIN = {
|
|
34933
35029
|
\u0430: "a",
|
|
34934
35030
|
\u0431: "b",
|
|
@@ -35150,7 +35246,7 @@ for (const [full, short] of Object.entries(SHORT_FORMS))
|
|
|
35150
35246
|
}
|
|
35151
35247
|
var fullNames = /* @__PURE__ */ __name((skeleton) => [skeleton, ...FULL_NAMES.get(skeleton) ?? []], "fullNames");
|
|
35152
35248
|
|
|
35153
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
35249
|
+
// 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/name-traces.js
|
|
35154
35250
|
var peopleByNameKey = /* @__PURE__ */ __name((database) => {
|
|
35155
35251
|
const found2 = /* @__PURE__ */ new Map();
|
|
35156
35252
|
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()) {
|
|
@@ -35266,7 +35362,7 @@ function* sharedTraces(database, a, b, name, except) {
|
|
|
35266
35362
|
}
|
|
35267
35363
|
__name(sharedTraces, "sharedTraces");
|
|
35268
35364
|
|
|
35269
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
35365
|
+
// 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/person-matcher.js
|
|
35270
35366
|
var spellingsOf = /* @__PURE__ */ __name((value) => [value, value.slice(1)], "spellingsOf");
|
|
35271
35367
|
var PERSON_BY = {
|
|
35272
35368
|
// UNION, not OR: each branch reads its own index.
|
|
@@ -35289,7 +35385,7 @@ var personsByIdentifiers = /* @__PURE__ */ __name((database, ids3) => {
|
|
|
35289
35385
|
return [...found2].sort((a, b) => a - b);
|
|
35290
35386
|
}, "personsByIdentifiers");
|
|
35291
35387
|
|
|
35292
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
35388
|
+
// 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/person-match-scan.js
|
|
35293
35389
|
var BY = "rule";
|
|
35294
35390
|
var RULE = { bot: "rule", kind: "rule" };
|
|
35295
35391
|
var MOST_SHARING = 6;
|
|
@@ -35738,7 +35834,7 @@ var linkPhones = /* @__PURE__ */ __name((context, identities2) => {
|
|
|
35738
35834
|
return pass.result;
|
|
35739
35835
|
}, "linkPhones");
|
|
35740
35836
|
|
|
35741
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
35837
|
+
// 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/meetings.js
|
|
35742
35838
|
var CURSOR_KEY = "meetings";
|
|
35743
35839
|
var seriesOf2 = /* @__PURE__ */ __name((row2) => ({
|
|
35744
35840
|
id: Number(row2.id),
|
|
@@ -36345,7 +36441,7 @@ var meetingStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
36345
36441
|
};
|
|
36346
36442
|
}, "meetingStoreOver");
|
|
36347
36443
|
|
|
36348
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
36444
|
+
// 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/sync.js
|
|
36349
36445
|
var syncStateOf = /* @__PURE__ */ __name(({ orm }, accountKey, name) => {
|
|
36350
36446
|
const row2 = orm.select({ value: syncCursors.value, at: syncCursors.updatedAt }).from(syncCursors).where(and(eq(syncCursors.accountId, accountKey), eq(syncCursors.key, name))).get();
|
|
36351
36447
|
return row2 ? { value: row2.value, at: toIso(row2.at) } : void 0;
|
|
@@ -36371,7 +36467,7 @@ var release = /* @__PURE__ */ __name(({ orm }, chatKey, anchor, holder2) => {
|
|
|
36371
36467
|
orm.delete(fetchLeases).where(and(eq(fetchLeases.chatId, chatKey), eq(fetchLeases.anchor, anchor), eq(fetchLeases.holder, holder2))).run();
|
|
36372
36468
|
}, "release");
|
|
36373
36469
|
|
|
36374
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
36470
|
+
// 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/thread-columns.js
|
|
36375
36471
|
var THREAD_COLUMNS = {
|
|
36376
36472
|
subject: {
|
|
36377
36473
|
where: /* @__PURE__ */ __name(({ value }) => ({
|
|
@@ -36388,7 +36484,7 @@ var threadRows = /* @__PURE__ */ __name((database, filter) => {
|
|
|
36388
36484
|
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);
|
|
36389
36485
|
}, "threadRows");
|
|
36390
36486
|
|
|
36391
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
36487
|
+
// 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/emails.js
|
|
36392
36488
|
var threadConversation = /* @__PURE__ */ __name((place, builtAt) => ({
|
|
36393
36489
|
id: `email:${place.emailId}`,
|
|
36394
36490
|
chatId: place.threadExternalId,
|
|
@@ -36930,7 +37026,7 @@ var mailStoreOver = /* @__PURE__ */ __name(({ database, orm, now: now2 }, stemme
|
|
|
36930
37026
|
}
|
|
36931
37027
|
}), "mailStoreOver");
|
|
36932
37028
|
|
|
36933
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
37029
|
+
// 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/search/dictionary.js
|
|
36934
37030
|
import { readFileSync as readFileSync2 } from "node:fs";
|
|
36935
37031
|
var DICTIONARIES = Object.fromEntries(LANGUAGES.map(({ name, dictionary: dictionary3 }) => [name, dictionary3]));
|
|
36936
37032
|
var folded5 = /* @__PURE__ */ __name((word2) => /^[а-яё'-]*$/.test(word2) ? word2.replaceAll("\u0451", "\u0435").replaceAll("\u0439", "\u0438") : fold(word2), "folded");
|
|
@@ -37020,7 +37116,7 @@ var knownWord = /* @__PURE__ */ __name((languages) => {
|
|
|
37020
37116
|
}, "knownWord");
|
|
37021
37117
|
var dictionaryLanguages = /* @__PURE__ */ __name((stemmers) => [stemmers.cyrillic, ...stemmers.latin.split(",")].filter((name) => Object.hasOwn(DICTIONARIES, name)), "dictionaryLanguages");
|
|
37022
37118
|
|
|
37023
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
37119
|
+
// 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/transcript-query.js
|
|
37024
37120
|
var predicates = /* @__PURE__ */ __name((node) => node.kind === "predicate" ? [node] : node.clauses.flatMap(({ node: node2 }) => predicates(node2)), "predicates");
|
|
37025
37121
|
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");
|
|
37026
37122
|
var LATIN_NUMBERS = new Set(`zero one two three four five six seven eight nine ten eleven twelve twenty thirty forty fifty sixty seventy
|
|
@@ -37106,7 +37202,7 @@ var spokenTranscripts = /* @__PURE__ */ __name((database, item, speaking, keys)
|
|
|
37106
37202
|
return found2;
|
|
37107
37203
|
}, "spokenTranscripts");
|
|
37108
37204
|
|
|
37109
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
37205
|
+
// 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/hit-places.js
|
|
37110
37206
|
var startOf = /* @__PURE__ */ __name((node) => node.operator === "wildcard" && node.implicit ? /^([\p{L}\p{N}]+)\*$/u.exec(normalize(node.value))?.[1] : void 0, "startOf");
|
|
37111
37207
|
var matchOf = /* @__PURE__ */ __name((node) => {
|
|
37112
37208
|
const start = startOf(node);
|
|
@@ -37164,7 +37260,7 @@ var placeHits = /* @__PURE__ */ __name((database, corpus, leaves, transcripts, f
|
|
|
37164
37260
|
});
|
|
37165
37261
|
}, "placeHits");
|
|
37166
37262
|
|
|
37167
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
37263
|
+
// 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/lucene-groups.js
|
|
37168
37264
|
var GROUPS = {
|
|
37169
37265
|
chat: {
|
|
37170
37266
|
key: "m.chat_id",
|
|
@@ -37186,7 +37282,7 @@ var GROUPS = {
|
|
|
37186
37282
|
}
|
|
37187
37283
|
};
|
|
37188
37284
|
|
|
37189
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
37285
|
+
// 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/lucene.js
|
|
37190
37286
|
var MESSAGES = {
|
|
37191
37287
|
rows: "messages",
|
|
37192
37288
|
threads: "chats",
|
|
@@ -37416,13 +37512,13 @@ var compileQuery = /* @__PURE__ */ __name((context, execution, boundedAttachment
|
|
|
37416
37512
|
}
|
|
37417
37513
|
const driverOf = /* @__PURE__ */ __name((node) => {
|
|
37418
37514
|
if (node.kind === "predicate") {
|
|
37419
|
-
const { fts, stems, elsewhere: other } = fragments.get(node)?.fragment ?? {};
|
|
37515
|
+
const { fts, stems, elsewhere: other, begins } = fragments.get(node)?.fragment ?? {};
|
|
37420
37516
|
if (fts === void 0)
|
|
37421
37517
|
return void 0;
|
|
37422
37518
|
const words4 = `SELECT rowid AS id FROM ${corpus.words} WHERE ${corpus.words} MATCH ?`;
|
|
37423
37519
|
const own = isStemmed(node) && stems ? {
|
|
37424
37520
|
sql: `${words4} UNION SELECT rowid FROM ${corpus.stems} WHERE ${corpus.stems} MATCH ?`,
|
|
37425
|
-
params: [`normalized_text : (${fts})`, `stems : (${stems})`]
|
|
37521
|
+
params: [`normalized_text : (${begins ?? fts})`, `stems : (${stems})`]
|
|
37426
37522
|
} : { sql: words4, params: [`normalized_text : (${fts})`] };
|
|
37427
37523
|
return other ? { sql: `${own.sql} UNION ${other.sql}`, params: [...own.params, ...other.params] } : own;
|
|
37428
37524
|
}
|
|
@@ -37682,7 +37778,7 @@ var runCompiled = /* @__PURE__ */ __name(async (context, execution, by) => {
|
|
|
37682
37778
|
};
|
|
37683
37779
|
}, "runCompiled");
|
|
37684
37780
|
|
|
37685
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
37781
|
+
// 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/counters.js
|
|
37686
37782
|
function invalidMetadata() {
|
|
37687
37783
|
throw new CliError("validation_error", "stored counter metadata is malformed \u2014 check the store before refreshing");
|
|
37688
37784
|
}
|
|
@@ -37784,7 +37880,7 @@ var counterTargets = /* @__PURE__ */ __name((context, execution, options) => wit
|
|
|
37784
37880
|
};
|
|
37785
37881
|
}), "counterTargets");
|
|
37786
37882
|
|
|
37787
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
37883
|
+
// 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/attachment-texts.js
|
|
37788
37884
|
var NOT_FILE_LIST = [...NOT_FILES].map((kind3) => `'${kind3}'`).join(",");
|
|
37789
37885
|
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,
|
|
37790
37886
|
att.size, att.local_path, att.extraction AS origin, att.size AS read_bytes, att.extraction_error AS error, att.content_sha256, att.extractor
|
|
@@ -37903,7 +37999,7 @@ var attachmentViews = /* @__PURE__ */ __name(({ database }, accountKey, { chatKe
|
|
|
37903
37999
|
}));
|
|
37904
38000
|
}, "attachmentViews");
|
|
37905
38001
|
|
|
37906
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
38002
|
+
// 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/transcripts.js
|
|
37907
38003
|
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");
|
|
37908
38004
|
var keepTranscript = /* @__PURE__ */ __name((context, chatKey, messageId, text8, source2) => {
|
|
37909
38005
|
const { orm, database, now: now2 } = context;
|
|
@@ -37941,7 +38037,7 @@ var intoVoiceAttachment = /* @__PURE__ */ __name((context, messagePk) => {
|
|
|
37941
38037
|
keepText(context, Number(row2.id), { text: String(row2.text), origin: "extracted", extractor: `speech:${row2.source}` });
|
|
37942
38038
|
}, "intoVoiceAttachment");
|
|
37943
38039
|
|
|
37944
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
38040
|
+
// 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/messages.js
|
|
37945
38041
|
var FIELDS = [
|
|
37946
38042
|
"threadExternalId",
|
|
37947
38043
|
"senderIdentityId",
|
|
@@ -38265,7 +38361,7 @@ var writeDerivedReactions = /* @__PURE__ */ __name((context, chatKey, messageId)
|
|
|
38265
38361
|
reactionStatementsOf(context.database).total.run(JSON.stringify(derived), chatKey, messageId);
|
|
38266
38362
|
}, "writeDerivedReactions");
|
|
38267
38363
|
|
|
38268
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
38364
|
+
// 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/keys.js
|
|
38269
38365
|
var keysOver = /* @__PURE__ */ __name((context) => {
|
|
38270
38366
|
const findAccountPk2 = /* @__PURE__ */ __name((key2) => findAccountPk(context, key2), "findAccountPk");
|
|
38271
38367
|
const findChatPk2 = /* @__PURE__ */ __name((accountKey, chatId) => findChatPk(context, accountKey, chatId), "findChatPk");
|
|
@@ -38286,7 +38382,7 @@ var keysOver = /* @__PURE__ */ __name((context) => {
|
|
|
38286
38382
|
};
|
|
38287
38383
|
}, "keysOver");
|
|
38288
38384
|
|
|
38289
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
38385
|
+
// 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/account-groups.js
|
|
38290
38386
|
var accountGroupsOf = /* @__PURE__ */ __name((database) => {
|
|
38291
38387
|
const row2 = database.prepare("SELECT value FROM store_settings WHERE key = ?").get(ACCOUNT_GROUPS);
|
|
38292
38388
|
if (!row2)
|
|
@@ -38333,7 +38429,7 @@ var forgetProfile = /* @__PURE__ */ __name((database, app, profile, now2) => {
|
|
|
38333
38429
|
database.prepare("INSERT OR REPLACE INTO store_settings (key, value, at) VALUES (?, ?, ?)").run(PROFILES, JSON.stringify(profiles), now2);
|
|
38334
38430
|
}, "forgetProfile");
|
|
38335
38431
|
|
|
38336
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
38432
|
+
// 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/calendar-events.js
|
|
38337
38433
|
var DAY3 = 864e5;
|
|
38338
38434
|
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}')`;
|
|
38339
38435
|
var accountsOf = /* @__PURE__ */ __name((filter) => {
|
|
@@ -38449,7 +38545,7 @@ var listEvents = /* @__PURE__ */ __name((database, filter) => {
|
|
|
38449
38545
|
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);
|
|
38450
38546
|
}, "listEvents");
|
|
38451
38547
|
|
|
38452
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
38548
|
+
// 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/calendar-forget.js
|
|
38453
38549
|
var distinctIds = /* @__PURE__ */ __name((rows) => [...new Set(rows.map((row2) => Number(row2.id)))], "distinctIds");
|
|
38454
38550
|
var forgetCalendarRows = /* @__PURE__ */ __name((database, { calendarId, accountId, cursorKey, now: now2 }, refresh) => {
|
|
38455
38551
|
const unseenBefore = unreferenced(database, "identities");
|
|
@@ -38506,7 +38602,7 @@ var forgetCalendarRows = /* @__PURE__ */ __name((database, { calendarId, account
|
|
|
38506
38602
|
return { entries: entryIds.length, events: goneEvents.length };
|
|
38507
38603
|
}, "forgetCalendarRows");
|
|
38508
38604
|
|
|
38509
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
38605
|
+
// 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/calendar.js
|
|
38510
38606
|
var calendarOf = /* @__PURE__ */ __name((row2) => ({
|
|
38511
38607
|
id: Number(row2.id),
|
|
38512
38608
|
accountId: Number(row2.account_id),
|
|
@@ -39109,7 +39205,7 @@ var eventStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
39109
39205
|
};
|
|
39110
39206
|
}, "eventStoreOver");
|
|
39111
39207
|
|
|
39112
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
39208
|
+
// 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/account-purge.js
|
|
39113
39209
|
var purgeAccount = /* @__PURE__ */ __name((context, accountKey) => {
|
|
39114
39210
|
const { orm, database, now: now2 } = context;
|
|
39115
39211
|
const unseenBefore = unreferenced(database, "identities");
|
|
@@ -39185,6 +39281,7 @@ var purgeAccount = /* @__PURE__ */ __name((context, accountKey) => {
|
|
|
39185
39281
|
purgeCrmCopies(database, accountKey);
|
|
39186
39282
|
orm.run(sql`DELETE FROM crm_fields WHERE account_id = ${accountKey}`);
|
|
39187
39283
|
orm.run(sql`DELETE FROM crm_files WHERE account_id = ${accountKey}`);
|
|
39284
|
+
orm.run(sql`DELETE FROM tracker_items WHERE account_id = ${accountKey}`);
|
|
39188
39285
|
const recordsOf = sql`(SELECT id FROM records WHERE account_id = ${accountKey})`;
|
|
39189
39286
|
orm.run(sql`DELETE FROM record_relations WHERE record_id IN ${recordsOf} OR target_id IN ${recordsOf}`);
|
|
39190
39287
|
orm.run(sql`DELETE FROM records WHERE account_id = ${accountKey}`);
|
|
@@ -39225,7 +39322,7 @@ var purgeCrmCopies = /* @__PURE__ */ __name((database, accountKey) => {
|
|
|
39225
39322
|
run("DELETE FROM pipelines WHERE account_id = ?", accountKey);
|
|
39226
39323
|
}, "purgeCrmCopies");
|
|
39227
39324
|
|
|
39228
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
39325
|
+
// 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/own-identities.js
|
|
39229
39326
|
var ACCOUNT_REASON = "an account you connected, under another name: a mailbox or messenger you read may be someone else's";
|
|
39230
39327
|
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");
|
|
39231
39328
|
var ownersName = /* @__PURE__ */ __name((name, owner, alone) => {
|
|
@@ -39284,7 +39381,7 @@ var linkToOwner = /* @__PURE__ */ __name((context, ref3) => {
|
|
|
39284
39381
|
return personOf2(context, ref3);
|
|
39285
39382
|
}, "linkToOwner");
|
|
39286
39383
|
|
|
39287
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
39384
|
+
// 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/providers.js
|
|
39288
39385
|
var PROVIDERS_SETTING = "providers";
|
|
39289
39386
|
var storedProvidersOf = /* @__PURE__ */ __name((database) => {
|
|
39290
39387
|
const row2 = database.prepare("SELECT value FROM store_settings WHERE key = ?").get(PROVIDERS_SETTING);
|
|
@@ -39332,7 +39429,7 @@ var registerProvider = /* @__PURE__ */ __name((database, value, now2) => {
|
|
|
39332
39429
|
});
|
|
39333
39430
|
}, "registerProvider");
|
|
39334
39431
|
|
|
39335
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
39432
|
+
// 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/task-candidates.js
|
|
39336
39433
|
var DAY4 = 864e5;
|
|
39337
39434
|
var RECENTLY_CLOSED_MS = 14 * DAY4;
|
|
39338
39435
|
var TEXT_LIMIT = 20;
|
|
@@ -39416,8 +39513,8 @@ var taskSimilarityOver = /* @__PURE__ */ __name((context) => {
|
|
|
39416
39513
|
const down = database.prepare("WITH RECURSIVE down(id, chat_id, external_id, depth) AS (SELECT id, chat_id, external_id, 0 FROM messages WHERE id = ? UNION SELECT m.id, m.chat_id, m.external_id, down.depth + 1 FROM messages m JOIN down ON m.chat_id = down.chat_id AND m.reply_to_external_id = down.external_id WHERE m.deleted_at IS NULL AND down.depth < ?) SELECT id FROM down").all(message3, REPLY_DEPTH);
|
|
39417
39514
|
return new Set([...up, ...down].map((one2) => Number(one2.id)));
|
|
39418
39515
|
}, "replyChain");
|
|
39419
|
-
const
|
|
39420
|
-
const rowOf4 = /* @__PURE__ */ __name((id2) => database.prepare(`SELECT ${
|
|
39516
|
+
const COLUMNS11 = "t.id, t.project_id, t.key, t.package_id, t.title, t.description, t.type, t.status, t.source_locator, t.created_at, t.due_at, t.category";
|
|
39517
|
+
const rowOf4 = /* @__PURE__ */ __name((id2) => database.prepare(`SELECT ${COLUMNS11} FROM tasks t WHERE t.id = ? AND t.deleted_at IS NULL`).get(id2), "rowOf");
|
|
39421
39518
|
const subjectOf2 = /* @__PURE__ */ __name((subject2) => {
|
|
39422
39519
|
if ("task" in subject2) {
|
|
39423
39520
|
const bare2 = subject2.task.startsWith("task:") ? subject2.task.slice("task:".length) : subject2.task;
|
|
@@ -39481,7 +39578,7 @@ var taskSimilarityOver = /* @__PURE__ */ __name((context) => {
|
|
|
39481
39578
|
for (const one2 of database.prepare(`SELECT t.id FROM task_stems s JOIN tasks t ON t.id = s.rowid WHERE task_stems MATCH ? AND ${live2} ORDER BY bm25(task_stems) LIMIT ?`).all(match, ...scope3, TEXT_LIMIT))
|
|
39482
39579
|
add2(Number(one2.id), "text");
|
|
39483
39580
|
}
|
|
39484
|
-
const window = database.prepare(`SELECT ${
|
|
39581
|
+
const window = database.prepare(`SELECT ${COLUMNS11} FROM tasks t WHERE ${live2} ORDER BY t.created_at DESC, t.id DESC LIMIT ?`).all(...scope3, WINDOW_LIMIT);
|
|
39485
39582
|
const sides = new Map(window.map((row2) => [Number(row2.id), { row: row2, side: sideOf2(row2) }]));
|
|
39486
39583
|
const chain = chainOf(side);
|
|
39487
39584
|
const inChain = /* @__PURE__ */ __name((other) => messagesOf(other).some(({ message: message3 }) => chain.has(message3)), "inChain");
|
|
@@ -39530,7 +39627,7 @@ var taskSimilarityOver = /* @__PURE__ */ __name((context) => {
|
|
|
39530
39627
|
};
|
|
39531
39628
|
}, "taskSimilarityOver");
|
|
39532
39629
|
|
|
39533
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
39630
|
+
// 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/task-category-settings.js
|
|
39534
39631
|
var SETTING3 = "taskCategories";
|
|
39535
39632
|
var savedTaskCategories = /* @__PURE__ */ __name((database) => {
|
|
39536
39633
|
const row2 = database.prepare("SELECT value FROM store_settings WHERE key = ?").get(SETTING3);
|
|
@@ -39549,7 +39646,7 @@ var saveTaskCategories = /* @__PURE__ */ __name((database, categories, now2) =>
|
|
|
39549
39646
|
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);
|
|
39550
39647
|
}, "saveTaskCategories");
|
|
39551
39648
|
|
|
39552
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
39649
|
+
// 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/task-close.js
|
|
39553
39650
|
var DEFAULT_AGENT_CLOSE = { allowed: true, min: 0.8 };
|
|
39554
39651
|
var ALLOWED = "taskAgentClose";
|
|
39555
39652
|
var MIN = "taskAgentCloseMin";
|
|
@@ -39605,7 +39702,7 @@ var SUGGESTION_COLUMNS = [
|
|
|
39605
39702
|
];
|
|
39606
39703
|
var CLEAR_SUGGESTION = SUGGESTION_COLUMNS.map((column2) => `${column2} = NULL`).join(", ");
|
|
39607
39704
|
|
|
39608
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
39705
|
+
// 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/task-first-pass.js
|
|
39609
39706
|
var DEFAULT_FIRST_PASS_PER_CHAT = 0;
|
|
39610
39707
|
var KEY = "taskFirstPassPerChat";
|
|
39611
39708
|
var firstPassPerChatOf = /* @__PURE__ */ __name((value, setting = "task_first_pass_per_chat") => {
|
|
@@ -39625,7 +39722,7 @@ var saveFirstPassPerChat = /* @__PURE__ */ __name((database, value, now2) => {
|
|
|
39625
39722
|
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);
|
|
39626
39723
|
}, "saveFirstPassPerChat");
|
|
39627
39724
|
|
|
39628
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
39725
|
+
// 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/domain/external-links.js
|
|
39629
39726
|
var EXTERNAL_SERVICE = /^[a-z][a-z0-9-]{0,31}$/;
|
|
39630
39727
|
var EXTERNAL_ID_CHARS = 200;
|
|
39631
39728
|
var SOURCE_URL_CHARS = 2e3;
|
|
@@ -39652,7 +39749,7 @@ var sourceUrlOf = /* @__PURE__ */ __name((value, reason = "task.source-url") =>
|
|
|
39652
39749
|
return text8;
|
|
39653
39750
|
}, "sourceUrlOf");
|
|
39654
39751
|
|
|
39655
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
39752
|
+
// 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/task-board.js
|
|
39656
39753
|
var TASK_SORTS = ["priority", "due", "created", "updated", "key", "state"];
|
|
39657
39754
|
var field = /* @__PURE__ */ __name((name, type, example, more = {}) => ({
|
|
39658
39755
|
name,
|
|
@@ -39817,15 +39914,15 @@ var truth = /* @__PURE__ */ __name((node, sql2) => ({
|
|
|
39817
39914
|
}), "truth");
|
|
39818
39915
|
var SPAN = { start: 0, end: 0 };
|
|
39819
39916
|
var UPCOMING_DAYS = 7;
|
|
39820
|
-
var
|
|
39917
|
+
var dayIn2 = /* @__PURE__ */ __name((at2, zone, ahead) => {
|
|
39821
39918
|
const date3 = /* @__PURE__ */ new Date(`${new Intl.DateTimeFormat("en-CA", { timeZone: zone, year: "numeric", month: "2-digit", day: "2-digit" }).format(at2)}T00:00:00Z`);
|
|
39822
39919
|
date3.setUTCDate(date3.getUTCDate() + ahead);
|
|
39823
39920
|
return dayBoundary(date3.toISOString().slice(0, 10), zone, false, SPAN);
|
|
39824
39921
|
}, "dayIn");
|
|
39825
39922
|
var dueGroups = /* @__PURE__ */ __name((now2, zone) => {
|
|
39826
|
-
const today =
|
|
39827
|
-
const tomorrow =
|
|
39828
|
-
const after2 =
|
|
39923
|
+
const today = dayIn2(now2, zone, 0);
|
|
39924
|
+
const tomorrow = dayIn2(now2, zone, 1);
|
|
39925
|
+
const after2 = dayIn2(now2, zone, UPCOMING_DAYS + 1);
|
|
39829
39926
|
return {
|
|
39830
39927
|
overdue: `${OPEN} AND t.due_at IS NOT NULL AND t.due_at < ${today}`,
|
|
39831
39928
|
today: `t.due_at >= ${today} AND t.due_at < ${tomorrow}`,
|
|
@@ -39904,7 +40001,7 @@ var withoutField = /* @__PURE__ */ __name((query, name) => {
|
|
|
39904
40001
|
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 ?`;
|
|
39905
40002
|
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");
|
|
39906
40003
|
|
|
39907
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
40004
|
+
// 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/task-comments.js
|
|
39908
40005
|
var authorNamed = /* @__PURE__ */ __name((database, row2) => {
|
|
39909
40006
|
if (row2.author_type == null)
|
|
39910
40007
|
return null;
|
|
@@ -39932,7 +40029,7 @@ var addComment = /* @__PURE__ */ __name((context, task, body2, by) => {
|
|
|
39932
40029
|
return commentsOf(database, task).find((one2) => one2.ref === `note:${made}`);
|
|
39933
40030
|
}, "addComment");
|
|
39934
40031
|
|
|
39935
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
40032
|
+
// 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/task-relations.js
|
|
39936
40033
|
var TASK_RELATION_KINDS = [
|
|
39937
40034
|
"blocked-by",
|
|
39938
40035
|
"follow-up-of",
|
|
@@ -40062,7 +40159,7 @@ var taskRelationsStoreOver = /* @__PURE__ */ __name((context, record3) => {
|
|
|
40062
40159
|
};
|
|
40063
40160
|
}, "taskRelationsStoreOver");
|
|
40064
40161
|
|
|
40065
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
40162
|
+
// 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/work-tasks.js
|
|
40066
40163
|
var TASK_ROLES = ["assignee", "reviewer", "watcher"];
|
|
40067
40164
|
var TASK_EVENT_KINDS = [
|
|
40068
40165
|
"created",
|
|
@@ -40621,7 +40718,7 @@ var workTasksOver = /* @__PURE__ */ __name((context) => {
|
|
|
40621
40718
|
};
|
|
40622
40719
|
}, "workTasksOver");
|
|
40623
40720
|
|
|
40624
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
40721
|
+
// 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/task-close-store.js
|
|
40625
40722
|
var taskCloseOver = /* @__PURE__ */ __name((context) => {
|
|
40626
40723
|
const { database, now: now2 } = context;
|
|
40627
40724
|
const liveRow = /* @__PURE__ */ __name((id2) => {
|
|
@@ -40670,7 +40767,7 @@ var taskCloseOver = /* @__PURE__ */ __name((context) => {
|
|
|
40670
40767
|
};
|
|
40671
40768
|
}, "taskCloseOver");
|
|
40672
40769
|
|
|
40673
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
40770
|
+
// 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/task-pairs.js
|
|
40674
40771
|
var TASK_PAIR_DECISIONS = ["review", "unsure", "merged", "rejected", "unmerged", "attached", "new"];
|
|
40675
40772
|
var taskPairsOver = /* @__PURE__ */ __name((context, similarity) => {
|
|
40676
40773
|
const { database, now: now2 } = context;
|
|
@@ -40889,7 +40986,7 @@ var taskPairsOver = /* @__PURE__ */ __name((context, similarity) => {
|
|
|
40889
40986
|
};
|
|
40890
40987
|
}, "taskPairsOver");
|
|
40891
40988
|
|
|
40892
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
40989
|
+
// 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/task-stats.js
|
|
40893
40990
|
var ACCOUNT_SCOPE = "t.package_id IS NOT NULL AND t.deleted_at IS NULL AND t.project_id = ?";
|
|
40894
40991
|
var TASK_STATS_SQL = {
|
|
40895
40992
|
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"),
|
|
@@ -40928,7 +41025,7 @@ var taskStatsOver = /* @__PURE__ */ __name(({ database }, inbox) => ({
|
|
|
40928
41025
|
}, "statNames")
|
|
40929
41026
|
}), "taskStatsOver");
|
|
40930
41027
|
|
|
40931
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
41028
|
+
// 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/tasks.js
|
|
40932
41029
|
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";
|
|
40933
41030
|
var inboxProject = /* @__PURE__ */ __name(({ database, now: now2 }, account, create) => {
|
|
40934
41031
|
const key2 = inboxKey(account);
|
|
@@ -41144,7 +41241,7 @@ var oneOf4 = /* @__PURE__ */ __name((values, value, column2) => {
|
|
|
41144
41241
|
throw new CliError("configuration_error", `the store holds a task with an unknown ${column2} "${String(value)}"`);
|
|
41145
41242
|
}, "oneOf");
|
|
41146
41243
|
|
|
41147
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
41244
|
+
// 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/accounts.js
|
|
41148
41245
|
var accountAccountsOver = /* @__PURE__ */ __name((context) => {
|
|
41149
41246
|
const { database } = context;
|
|
41150
41247
|
const { accountPk: accountPk2, findAccountPk: findAccountPk2 } = keysOver(context);
|
|
@@ -41214,7 +41311,7 @@ var accountsStoreOver = /* @__PURE__ */ __name((context, keyed) => {
|
|
|
41214
41311
|
};
|
|
41215
41312
|
}, "accountsStoreOver");
|
|
41216
41313
|
|
|
41217
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
41314
|
+
// 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/attachments.js
|
|
41218
41315
|
var refColumn = /* @__PURE__ */ __name((ref3) => ref3 && Object.keys(ref3).length > 0 ? { providerRef: JSON.stringify(ref3) } : {}, "refColumn");
|
|
41219
41316
|
var updatePlaced = /* @__PURE__ */ __name(({ orm }, chatKey, messageId, files2, change) => {
|
|
41220
41317
|
const message3 = orm.select({ pk: messages.id }).from(messages).where(and(eq(messages.chatId, chatKey), eq(messages.externalId, messageId))).get();
|
|
@@ -41238,7 +41335,7 @@ var keepDownloads = /* @__PURE__ */ __name((context, chatKey, messageId, files2)
|
|
|
41238
41335
|
})), "keepDownloads");
|
|
41239
41336
|
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");
|
|
41240
41337
|
|
|
41241
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
41338
|
+
// 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/attachments.js
|
|
41242
41339
|
var accountAttachmentsOver = /* @__PURE__ */ __name((context) => {
|
|
41243
41340
|
const { database } = context;
|
|
41244
41341
|
const { findAccountPk: findAccountPk2, findChatPk: findChatPk2, chatKeyOf } = keysOver(context);
|
|
@@ -41295,7 +41392,7 @@ var attachmentsStoreOver = /* @__PURE__ */ __name((context, keyed) => ({
|
|
|
41295
41392
|
}, "keepAttachmentText")
|
|
41296
41393
|
}), "attachmentsStoreOver");
|
|
41297
41394
|
|
|
41298
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
41395
|
+
// 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/chat-rekey.js
|
|
41299
41396
|
var chatRow = /* @__PURE__ */ __name((context, accountKey, chatId) => context.database.prepare("SELECT * FROM chats WHERE account_id = ? AND external_id = ?").get(accountKey, chatId), "chatRow");
|
|
41300
41397
|
var pointerMover = /* @__PURE__ */ __name((context, type) => {
|
|
41301
41398
|
const statements = pointerPairs(context.database).filter(({ table }) => table !== "involvements").map(({ table, pointer }) => {
|
|
@@ -41480,7 +41577,7 @@ var rekeyChats = /* @__PURE__ */ __name((context, key2, accountKey, pairs, lockM
|
|
|
41480
41577
|
return done;
|
|
41481
41578
|
}, "rekeyChats");
|
|
41482
41579
|
|
|
41483
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
41580
|
+
// 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/completeness.js
|
|
41484
41581
|
var historyStartKey = /* @__PURE__ */ __name((chatId) => `history_start:${chatId}`, "historyStartKey");
|
|
41485
41582
|
var fetchedKey = /* @__PURE__ */ __name((chatId) => `fetched:${chatId}`, "fetchedKey");
|
|
41486
41583
|
var CHAT_LIST_KEY = "chat_list_complete";
|
|
@@ -41538,7 +41635,7 @@ var chatCoverage = /* @__PURE__ */ __name(({ database }, accountKey) => {
|
|
|
41538
41635
|
return { ...coverage, oldestMessageAt: toIso(oldest) };
|
|
41539
41636
|
}, "chatCoverage");
|
|
41540
41637
|
|
|
41541
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
41638
|
+
// 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/chats.js
|
|
41542
41639
|
var chatsStoreOver = /* @__PURE__ */ __name((context) => {
|
|
41543
41640
|
const { database } = context;
|
|
41544
41641
|
const { accountPk: accountPk2, findAccountPk: findAccountPk2, writeState: writeState2 } = keysOver(context);
|
|
@@ -41687,11 +41784,13 @@ var chatsStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
41687
41784
|
};
|
|
41688
41785
|
}, "chatsStoreOver");
|
|
41689
41786
|
|
|
41690
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
41787
|
+
// 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/batches.js
|
|
41691
41788
|
import { createHash as createHash7 } from "node:crypto";
|
|
41692
41789
|
var BATCH_CONTEXT = 50;
|
|
41693
41790
|
var replied = /* @__PURE__ */ __name((m) => sql`EXISTS (SELECT 1 FROM messages p WHERE p.chat_id = ${m}.chat_id
|
|
41694
|
-
AND p.external_id = ${m}.reply_to_external_id AND p.deleted_at IS NULL
|
|
41791
|
+
AND p.external_id = ${m}.reply_to_external_id AND p.deleted_at IS NULL
|
|
41792
|
+
AND (p.thread_external_id IS ${m}.thread_external_id
|
|
41793
|
+
OR (p.external_id = ${m}.thread_external_id AND trim(p.text) <> '')))`, "replied");
|
|
41695
41794
|
var needsAgent = /* @__PURE__ */ __name((m) => sql`(
|
|
41696
41795
|
NOT ${replied(m)}
|
|
41697
41796
|
AND NOT EXISTS (SELECT 1 FROM message_links l WHERE l.message_id = ${m}.id AND l.source = 'agent'
|
|
@@ -41825,7 +41924,7 @@ var saveAnswers = /* @__PURE__ */ __name((context, id2, answer) => {
|
|
|
41825
41924
|
var clearAnswers = /* @__PURE__ */ __name(({ orm }, chatKey, model) => Number(orm.all(sql`DELETE FROM message_links WHERE chat_id = ${chatKey} AND source = 'agent'
|
|
41826
41925
|
${model === void 0 ? sql`` : sql`AND method = ${model}`} RETURNING 1 AS n`).length), "clearAnswers");
|
|
41827
41926
|
|
|
41828
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
41927
|
+
// 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/conversations.js
|
|
41829
41928
|
import { setTimeout } from "node:timers/promises";
|
|
41830
41929
|
var position = /* @__PURE__ */ __name((sentAt, pk) => `${sentAt}:${pk}`, "position");
|
|
41831
41930
|
var linkInputs = /* @__PURE__ */ __name(({ orm }, chatKey, { after: after2, limit }) => {
|
|
@@ -42137,7 +42236,7 @@ var agentAnswers = /* @__PURE__ */ __name(({ orm }, chatKey) => new Map(orm.all(
|
|
|
42137
42236
|
AND NOT EXISTS (SELECT 1 FROM messages d
|
|
42138
42237
|
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");
|
|
42139
42238
|
|
|
42140
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
42239
|
+
// 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/conversations.js
|
|
42141
42240
|
var conversationsStoreOver = /* @__PURE__ */ __name((context) => {
|
|
42142
42241
|
const { database } = context;
|
|
42143
42242
|
const { findAccountPk: findAccountPk2, findChatPk: findChatPk2, chatKeyOf } = keysOver(context);
|
|
@@ -42244,7 +42343,7 @@ var conversationsStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
42244
42343
|
};
|
|
42245
42344
|
}, "conversationsStoreOver");
|
|
42246
42345
|
|
|
42247
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
42346
|
+
// 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/counters.js
|
|
42248
42347
|
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";
|
|
42249
42348
|
var accountCountersOver = /* @__PURE__ */ __name((context) => {
|
|
42250
42349
|
const { database } = context;
|
|
@@ -42269,7 +42368,7 @@ var countersStoreOver = /* @__PURE__ */ __name((context, keyed) => ({
|
|
|
42269
42368
|
counterTargets: /* @__PURE__ */ __name(async (execution, options) => counterTargets(context, execution, options), "counterTargets")
|
|
42270
42369
|
}), "countersStoreOver");
|
|
42271
42370
|
|
|
42272
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
42371
|
+
// 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/mentions.js
|
|
42273
42372
|
var MENTION_STATUSES = ["found", "linked", "proposed", "dismissed"];
|
|
42274
42373
|
var MENTION_QUERY = defineQuery({
|
|
42275
42374
|
entity: "mention",
|
|
@@ -42488,7 +42587,7 @@ var listPlaces = /* @__PURE__ */ __name((database, { limit, offset }) => {
|
|
|
42488
42587
|
return { items: hasMore ? rows.slice(0, limit) : rows, hasMore };
|
|
42489
42588
|
}, "listPlaces");
|
|
42490
42589
|
|
|
42491
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
42590
|
+
// 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/mentions.js
|
|
42492
42591
|
var accountMentionsOver = /* @__PURE__ */ __name((context) => {
|
|
42493
42592
|
const { database } = context;
|
|
42494
42593
|
const { findAccountPk: findAccountPk2 } = keysOver(context);
|
|
@@ -42523,7 +42622,7 @@ var mentionsStoreOver = /* @__PURE__ */ __name((context, keyed) => ({
|
|
|
42523
42622
|
places: /* @__PURE__ */ __name(async (window) => listPlaces(context.database, window), "places")
|
|
42524
42623
|
}), "mentionsStoreOver");
|
|
42525
42624
|
|
|
42526
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
42625
|
+
// 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/reply-times.js
|
|
42527
42626
|
var FAR = Number.MAX_SAFE_INTEGER;
|
|
42528
42627
|
var MUTED_NOW = "(coalesce(c.muted,0)=1 AND (c.muted_until IS NULL OR c.muted_until>?))";
|
|
42529
42628
|
var chatsIn = /* @__PURE__ */ __name((scope3, kinds2, now2) => {
|
|
@@ -42622,7 +42721,7 @@ var waitingChats = /* @__PURE__ */ __name((context, scope3, waits, cap) => {
|
|
|
42622
42721
|
});
|
|
42623
42722
|
}, "waitingChats");
|
|
42624
42723
|
|
|
42625
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
42724
|
+
// 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/chat-activity-counts.js
|
|
42626
42725
|
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 = ?`;
|
|
42627
42726
|
var chatActivityCounts = /* @__PURE__ */ __name(({ database }, chatKeys, { since, until, now: now2 }) => {
|
|
42628
42727
|
const statement = database.prepare(SQL);
|
|
@@ -42642,7 +42741,7 @@ var chatActivityCounts = /* @__PURE__ */ __name(({ database }, chatKeys, { since
|
|
|
42642
42741
|
return found2;
|
|
42643
42742
|
}, "chatActivityCounts");
|
|
42644
42743
|
|
|
42645
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
42744
|
+
// 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/document-links.js
|
|
42646
42745
|
var documentLinkMessages = /* @__PURE__ */ __name(({ database }, chatKey, messageId) => {
|
|
42647
42746
|
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");
|
|
42648
42747
|
const rows = messageId === void 0 ? read2.all(chatKey) : read2.all(chatKey, messageId);
|
|
@@ -42657,7 +42756,7 @@ var documentLinkMessages = /* @__PURE__ */ __name(({ database }, chatKey, messag
|
|
|
42657
42756
|
}));
|
|
42658
42757
|
}, "documentLinkMessages");
|
|
42659
42758
|
|
|
42660
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
42759
|
+
// 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/follow-ups.js
|
|
42661
42760
|
var stemmerFor = stemmerCache();
|
|
42662
42761
|
var laterSharingRare = /* @__PURE__ */ __name((context, wanted, { rareAt, limit }) => {
|
|
42663
42762
|
if (wanted.length > 50 || !Number.isInteger(limit) || limit < 1 || limit > 100)
|
|
@@ -42701,7 +42800,7 @@ var laterSharingRare = /* @__PURE__ */ __name((context, wanted, { rareAt, limit
|
|
|
42701
42800
|
});
|
|
42702
42801
|
}, "laterSharingRare");
|
|
42703
42802
|
|
|
42704
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
42803
|
+
// 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/messages.js
|
|
42705
42804
|
var accountMessagesOver = /* @__PURE__ */ __name((context) => {
|
|
42706
42805
|
const { database } = context;
|
|
42707
42806
|
const { accountPk: accountPk2, findAccountPk: findAccountPk2, findChatPk: findChatPk2, chatKeyOf, chatPkFor: chatPkFor2, answeredChatPk: answeredChatPk2, upsertMessage: upsertMessage2 } = keysOver(context);
|
|
@@ -42842,7 +42941,7 @@ var messagesStoreOver = /* @__PURE__ */ __name((context, keyed) => ({
|
|
|
42842
42941
|
laterSharingRare: /* @__PURE__ */ __name(async (wanted, options) => laterSharingRare(context, wanted, options), "laterSharingRare")
|
|
42843
42942
|
}), "messagesStoreOver");
|
|
42844
42943
|
|
|
42845
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
42944
|
+
// 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/agent-links.js
|
|
42846
42945
|
var AGENT_METHOD = "agent";
|
|
42847
42946
|
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");
|
|
42848
42947
|
var weaknessOf = /* @__PURE__ */ __name((context, kind3, value, holders, sides, others) => {
|
|
@@ -42986,7 +43085,7 @@ var agentMerges = /* @__PURE__ */ __name((context, { limit, offset }) => {
|
|
|
42986
43085
|
return { items: found2.slice(offset, offset + limit), hasMore: found2.length > offset + limit };
|
|
42987
43086
|
}, "agentMerges");
|
|
42988
43087
|
|
|
42989
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
43088
|
+
// 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/identity-rekey.js
|
|
42990
43089
|
var quoted2 = /* @__PURE__ */ __name((name) => `"${name.replace(/"/g, '""')}"`, "quoted");
|
|
42991
43090
|
var columnsOf3 = /* @__PURE__ */ __name((database, table) => database.prepare("SELECT name, pk, type FROM pragma_table_info(?)").all(table), "columnsOf");
|
|
42992
43091
|
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
|
|
@@ -43130,7 +43229,7 @@ var rekeyIdentities = /* @__PURE__ */ __name((context, provider, pairs, { lockMs
|
|
|
43130
43229
|
return done;
|
|
43131
43230
|
}, "rekeyIdentities");
|
|
43132
43231
|
|
|
43133
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
43232
|
+
// 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/domain/person-kinds.js
|
|
43134
43233
|
var PERSON_KINDS = ["person", "organization", "automated", "stranger", "unsorted", "test"];
|
|
43135
43234
|
var AUTOMATED_WORDS = /* @__PURE__ */ new Set([
|
|
43136
43235
|
"noreply",
|
|
@@ -43193,7 +43292,7 @@ var isCompanyName = /* @__PURE__ */ __name((name) => {
|
|
|
43193
43292
|
return wordsOf3(name.replaceAll(".", "")).some((word2) => LEGAL_FORMS.has(word2) || COMPANY_WORDS.has(word2));
|
|
43194
43293
|
}, "isCompanyName");
|
|
43195
43294
|
|
|
43196
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
43295
|
+
// 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/person-ties.js
|
|
43197
43296
|
var SMALL_GROUP_MEMBERS = 10;
|
|
43198
43297
|
var PERSON_TIES = ["chat", "small-group", "mail", "meeting", "crm", "phone-book"];
|
|
43199
43298
|
var ALWAYS_SHOWN = ["owner", "added", "task"];
|
|
@@ -43248,7 +43347,7 @@ var shownReasons = /* @__PURE__ */ __name((database, people2) => {
|
|
|
43248
43347
|
return new Map([...found2].map(([person2, reasons]) => [person2, ORDER.filter((one2) => reasons.has(one2))]));
|
|
43249
43348
|
}, "shownReasons");
|
|
43250
43349
|
|
|
43251
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
43350
|
+
// 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/people-list.js
|
|
43252
43351
|
var PEOPLE_SORTS = ["interactions", "recent", "name", "tasks"];
|
|
43253
43352
|
var MIN_QUERY = 3;
|
|
43254
43353
|
var matching2 = /* @__PURE__ */ __name((query) => {
|
|
@@ -43419,7 +43518,7 @@ var RULES_KEY = "people.kind_rules";
|
|
|
43419
43518
|
var WHOLE_PASS = 2e4;
|
|
43420
43519
|
var UNDER_LOCK = 5e3;
|
|
43421
43520
|
var TRIES = 3;
|
|
43422
|
-
var
|
|
43521
|
+
var dataVersion2 = /* @__PURE__ */ __name((database) => Number(Object.values(database.prepare("PRAGMA data_version").get() ?? {})[0]), "dataVersion");
|
|
43423
43522
|
var rulesOf = /* @__PURE__ */ __name((database) => {
|
|
43424
43523
|
const row2 = database.prepare("SELECT value FROM store_settings WHERE key = ?").get(RULES_KEY);
|
|
43425
43524
|
return row2 === void 0 ? void 0 : String(row2.value);
|
|
@@ -43468,12 +43567,12 @@ var storeKinds = /* @__PURE__ */ __name((database) => {
|
|
|
43468
43567
|
if (few)
|
|
43469
43568
|
return true;
|
|
43470
43569
|
for (let attempt = 0; attempt < TRIES; attempt++) {
|
|
43471
|
-
const before2 =
|
|
43570
|
+
const before2 = dataVersion2(database);
|
|
43472
43571
|
const worked = read(database, () => workOut(database, rulesOf(database) !== KIND_RULES));
|
|
43473
43572
|
if (worked === void 0)
|
|
43474
43573
|
return true;
|
|
43475
43574
|
const kept = writeBatch(database, () => {
|
|
43476
|
-
if (
|
|
43575
|
+
if (dataVersion2(database) !== before2)
|
|
43477
43576
|
return false;
|
|
43478
43577
|
keep(database, worked);
|
|
43479
43578
|
return true;
|
|
@@ -43593,7 +43692,7 @@ var similarPeople = /* @__PURE__ */ __name((database, typed, limit) => {
|
|
|
43593
43692
|
return withLastContact(database, rows).map((person2, at2) => ({ ...person2, sameName: same[at2] === true }));
|
|
43594
43693
|
}, "similarPeople");
|
|
43595
43694
|
|
|
43596
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
43695
|
+
// 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/person-doubts.js
|
|
43597
43696
|
var DOUBT_REASONS = ["owner-other-name", "test-data", "shared-address", "mixed-names"];
|
|
43598
43697
|
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";
|
|
43599
43698
|
var text4 = /* @__PURE__ */ __name((value) => typeof value === "string" && value.trim() !== "" ? value : null, "text");
|
|
@@ -43849,7 +43948,7 @@ var markTestData = /* @__PURE__ */ __name((context, uid, by) => {
|
|
|
43849
43948
|
return { person: `person:${person2}`, identities: identities2 };
|
|
43850
43949
|
}, "markTestData");
|
|
43851
43950
|
|
|
43852
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
43951
|
+
// 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/person-preparation.js
|
|
43853
43952
|
var GLOBAL_PROJECT = "SELECT id FROM main.projects WHERE account_id IS NULL AND deleted_at IS NULL";
|
|
43854
43953
|
var IN_SCOPES = "IN (SELECT value FROM json_each(?))";
|
|
43855
43954
|
var projectScope = /* @__PURE__ */ __name((id2) => `(SELECT p.scope FROM main.projects p WHERE p.id=${id2})`, "projectScope");
|
|
@@ -43918,7 +44017,7 @@ var personPreparation = /* @__PURE__ */ __name(({ database, now: now2 }, uid, {
|
|
|
43918
44017
|
});
|
|
43919
44018
|
}, "personPreparation");
|
|
43920
44019
|
|
|
43921
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
44020
|
+
// 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/person-scope.js
|
|
43922
44021
|
var personSeenInAccounts = /* @__PURE__ */ __name(({ database }, uid, accountIds) => {
|
|
43923
44022
|
const id2 = Number(uid);
|
|
43924
44023
|
if (!/^[1-9]\d*$/.test(uid) || !Number.isSafeInteger(id2) || !accountIds.length || accountIds.length > 1e3 || accountIds.some((account) => !Number.isSafeInteger(account) || account <= 0))
|
|
@@ -43926,7 +44025,7 @@ var personSeenInAccounts = /* @__PURE__ */ __name(({ database }, uid, accountIds
|
|
|
43926
44025
|
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)));
|
|
43927
44026
|
}, "personSeenInAccounts");
|
|
43928
44027
|
|
|
43929
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
44028
|
+
// 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/private-people.js
|
|
43930
44029
|
var required2 = /* @__PURE__ */ __name(({ database }, key2, personId) => {
|
|
43931
44030
|
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);
|
|
43932
44031
|
if (!row2)
|
|
@@ -43993,7 +44092,7 @@ var removeNote = /* @__PURE__ */ __name((context, key2, personId, id2) => {
|
|
|
43993
44092
|
return { id: id2, personId, removed: true };
|
|
43994
44093
|
}, "removeNote");
|
|
43995
44094
|
|
|
43996
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
44095
|
+
// 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/people.js
|
|
43997
44096
|
var accountPeopleOver = /* @__PURE__ */ __name((context) => {
|
|
43998
44097
|
const { database } = context;
|
|
43999
44098
|
const { accountPk: accountPk2, findAccountPk: findAccountPk2, identityPk: identityPk2 } = keysOver(context);
|
|
@@ -44136,13 +44235,13 @@ var peopleStoreOver = /* @__PURE__ */ __name((context, keyed) => {
|
|
|
44136
44235
|
};
|
|
44137
44236
|
}, "peopleStoreOver");
|
|
44138
44237
|
|
|
44139
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
44238
|
+
// 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/admin-statistics.js
|
|
44140
44239
|
import { createHash as createHash9 } from "node:crypto";
|
|
44141
44240
|
|
|
44142
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
44241
|
+
// 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/domain/admin-statistics.js
|
|
44143
44242
|
import { createHash as createHash8 } from "node:crypto";
|
|
44144
44243
|
|
|
44145
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
44244
|
+
// 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/domain/rankings-graph.js
|
|
44146
44245
|
var RANKING_GRAPH_LIMITS = { nodes: 5e4, depth: 256, work: 1e7, bytes: 8388608 };
|
|
44147
44246
|
var exhausted2 = /* @__PURE__ */ __name((budget) => {
|
|
44148
44247
|
throw new CliError("validation_error", `ranking exceeded ${budget} \u2014 narrow its chat or date scope`, {
|
|
@@ -44364,7 +44463,7 @@ var rankReplyGraph = /* @__PURE__ */ __name((nodes, check3 = () => {
|
|
|
44364
44463
|
};
|
|
44365
44464
|
}, "rankReplyGraph");
|
|
44366
44465
|
|
|
44367
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
44466
|
+
// 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/domain/admin-statistics.js
|
|
44368
44467
|
var adminEntityKey = /* @__PURE__ */ __name((row2) => JSON.stringify([row2.account.provider, row2.account.account, row2.id]), "adminEntityKey");
|
|
44369
44468
|
var personKey = /* @__PURE__ */ __name((node) => JSON.stringify([node.account.provider, node.account.account, node.sender]), "personKey");
|
|
44370
44469
|
var locator = /* @__PURE__ */ __name((node) => formatLocator({ ...node.account, chat: node.chatId, message: node.id }), "locator");
|
|
@@ -44538,7 +44637,7 @@ var calculateAdminStatistics = /* @__PURE__ */ __name((nodes, stays, options, in
|
|
|
44538
44637
|
return { items, evidence, summary, graph: graph.quality };
|
|
44539
44638
|
}, "calculateAdminStatistics");
|
|
44540
44639
|
|
|
44541
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
44640
|
+
// 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/domain/rankings-range.js
|
|
44542
44641
|
var rankingContextRange = /* @__PURE__ */ __name((root) => {
|
|
44543
44642
|
const dates = [];
|
|
44544
44643
|
const visit = /* @__PURE__ */ __name((node, required3) => {
|
|
@@ -44560,7 +44659,7 @@ var rankingContextRange = /* @__PURE__ */ __name((root) => {
|
|
|
44560
44659
|
return dates[0].node.resolution.date;
|
|
44561
44660
|
}, "rankingContextRange");
|
|
44562
44661
|
|
|
44563
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
44662
|
+
// 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/rankings.js
|
|
44564
44663
|
var reactionCounts = /* @__PURE__ */ __name((stored4) => {
|
|
44565
44664
|
let counts;
|
|
44566
44665
|
try {
|
|
@@ -44855,7 +44954,7 @@ var rankQuery = /* @__PURE__ */ __name((context, execution, request, inspect) =>
|
|
|
44855
44954
|
});
|
|
44856
44955
|
}, "rankQuery");
|
|
44857
44956
|
|
|
44858
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
44957
|
+
// 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/admin-statistics.js
|
|
44859
44958
|
function fail2(message3, reason = "query.too-large") {
|
|
44860
44959
|
throw new CliError("validation_error", message3, { reason, complete: false });
|
|
44861
44960
|
}
|
|
@@ -45032,7 +45131,7 @@ var adminStatisticsQuery = /* @__PURE__ */ __name((context, execution, request)
|
|
|
45032
45131
|
return result;
|
|
45033
45132
|
}), "adminStatisticsQuery");
|
|
45034
45133
|
|
|
45035
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
45134
|
+
// 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/conversation-eligibility.js
|
|
45036
45135
|
var conversationEligibility = /* @__PURE__ */ __name(async (context, execution) => {
|
|
45037
45136
|
if (!execution.accounts.length)
|
|
45038
45137
|
return { conversations: [], chats: [] };
|
|
@@ -45050,7 +45149,7 @@ var conversationEligibility = /* @__PURE__ */ __name(async (context, execution)
|
|
|
45050
45149
|
return { conversations: conversations2, chats: chats2 };
|
|
45051
45150
|
}, "conversationEligibility");
|
|
45052
45151
|
|
|
45053
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
45152
|
+
// 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/ranking-evidence.js
|
|
45054
45153
|
import { createHash as createHash10 } from "node:crypto";
|
|
45055
45154
|
var EVIDENCE_BYTES = 64 * 1024;
|
|
45056
45155
|
var FINGERPRINT_BYTES = 8 * 1024 * 1024;
|
|
@@ -45200,7 +45299,7 @@ var rankingEvidence = /* @__PURE__ */ __name((context, execution, request) => {
|
|
|
45200
45299
|
return result;
|
|
45201
45300
|
}, "rankingEvidence");
|
|
45202
45301
|
|
|
45203
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
45302
|
+
// 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/queries.js
|
|
45204
45303
|
var queriesStoreOver = /* @__PURE__ */ __name((context, stemmerFor2) => {
|
|
45205
45304
|
const mailIndexed = /* @__PURE__ */ __name((execution) => {
|
|
45206
45305
|
if (execution.corpus === "mail")
|
|
@@ -45221,7 +45320,7 @@ var queriesStoreOver = /* @__PURE__ */ __name((context, stemmerFor2) => {
|
|
|
45221
45320
|
};
|
|
45222
45321
|
}, "queriesStoreOver");
|
|
45223
45322
|
|
|
45224
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
45323
|
+
// 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/chat-events.js
|
|
45225
45324
|
var saveChatEvents = /* @__PURE__ */ __name((context, accountKey, provider, chatKey, events3) => {
|
|
45226
45325
|
const { database, now: now2 } = context;
|
|
45227
45326
|
const insert = database.prepare(`INSERT INTO chat_events (chat_id, source_id, action, actor_identity_id, title, happened_at, created_at, updated_at)
|
|
@@ -45260,10 +45359,10 @@ var chatEventsOf = /* @__PURE__ */ __name(({ database }, chatKey, { since = 0, l
|
|
|
45260
45359
|
}));
|
|
45261
45360
|
}, "chatEventsOf");
|
|
45262
45361
|
|
|
45263
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
45362
|
+
// 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/retention.js
|
|
45264
45363
|
import { createHash as createHash11 } from "node:crypto";
|
|
45265
45364
|
|
|
45266
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
45365
|
+
// 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/domain/calendar.js
|
|
45267
45366
|
var calendarKey = /* @__PURE__ */ __name((zone, by) => {
|
|
45268
45367
|
const format = new Intl.DateTimeFormat("en-CA", {
|
|
45269
45368
|
timeZone: zone,
|
|
@@ -45283,7 +45382,7 @@ var weekKey = /* @__PURE__ */ __name((day2) => {
|
|
|
45283
45382
|
return date3.toISOString().slice(0, 10);
|
|
45284
45383
|
}, "weekKey");
|
|
45285
45384
|
|
|
45286
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
45385
|
+
// 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/domain/retention.js
|
|
45287
45386
|
var RETENTION_TOLERANCE = 864e5;
|
|
45288
45387
|
var validateRetentionOptions = /* @__PURE__ */ __name((options) => {
|
|
45289
45388
|
const { since, until, cutoff, checkpoints, within, limit, by } = options;
|
|
@@ -45337,7 +45436,7 @@ var retentionCohorts = /* @__PURE__ */ __name((stays, options) => {
|
|
|
45337
45436
|
return [...groups.values()].sort((a, b) => a.cohort.localeCompare(b.cohort));
|
|
45338
45437
|
}, "retentionCohorts");
|
|
45339
45438
|
|
|
45340
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
45439
|
+
// 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/retention.js
|
|
45341
45440
|
var iso10 = /* @__PURE__ */ __name((at2) => new Date(at2).toISOString(), "iso");
|
|
45342
45441
|
var retentionQuery = /* @__PURE__ */ __name((context, accountPk2, chatPk, chatId, options, evidence) => {
|
|
45343
45442
|
validateRetentionOptions(options);
|
|
@@ -45468,7 +45567,7 @@ var retentionQuery = /* @__PURE__ */ __name((context, accountPk2, chatPk, chatId
|
|
|
45468
45567
|
};
|
|
45469
45568
|
}, "retentionQuery");
|
|
45470
45569
|
|
|
45471
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
45570
|
+
// 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/roster.js
|
|
45472
45571
|
var iso11 = /* @__PURE__ */ __name((ms) => ms === null ? null : new Date(ms).toISOString(), "iso");
|
|
45473
45572
|
var marksOf = /* @__PURE__ */ __name(({ isBot: isBot2, flagged, deleted, hasPhoto }) => ({
|
|
45474
45573
|
...isBot2 === void 0 ? {} : { bot: isBot2 },
|
|
@@ -45597,7 +45696,7 @@ var trackedChats = /* @__PURE__ */ __name((context, accountKey, where) => contex
|
|
|
45597
45696
|
lastCount: memberCountsOf(context, pk).at(-1) ?? null
|
|
45598
45697
|
})), "trackedChats");
|
|
45599
45698
|
|
|
45600
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
45699
|
+
// 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/roster.js
|
|
45601
45700
|
var rosterStoreOver = /* @__PURE__ */ __name((context) => {
|
|
45602
45701
|
const { database } = context;
|
|
45603
45702
|
const { accountPk: accountPk2, findAccountPk: findAccountPk2, chatKeyOf, chatPkFor: chatPkFor2, writeMembers: writeMembers2 } = keysOver(context);
|
|
@@ -45653,7 +45752,7 @@ var rosterStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
45653
45752
|
};
|
|
45654
45753
|
}, "rosterStoreOver");
|
|
45655
45754
|
|
|
45656
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
45755
|
+
// 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/backfill.js
|
|
45657
45756
|
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");
|
|
45658
45757
|
var backfillNormalized = /* @__PURE__ */ __name((database, { batch = 5e3, onBatch, until = /* @__PURE__ */ __name(() => false, "until") } = {}) => {
|
|
45659
45758
|
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 ?`);
|
|
@@ -45677,7 +45776,7 @@ var backfillNormalized = /* @__PURE__ */ __name((database, { batch = 5e3, onBatc
|
|
|
45677
45776
|
}
|
|
45678
45777
|
}, "backfillNormalized");
|
|
45679
45778
|
|
|
45680
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
45779
|
+
// 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/search-index.js
|
|
45681
45780
|
var INDEX2 = "message_words";
|
|
45682
45781
|
var searchIndexState2 = /* @__PURE__ */ __name((database) => {
|
|
45683
45782
|
const row2 = indexRow(database, INDEX2);
|
|
@@ -45804,7 +45903,7 @@ var resetSearchIndex = /* @__PURE__ */ __name((database) => {
|
|
|
45804
45903
|
});
|
|
45805
45904
|
}, "resetSearchIndex");
|
|
45806
45905
|
|
|
45807
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
45906
|
+
// 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/stems-fill.js
|
|
45808
45907
|
var fillStems = /* @__PURE__ */ __name((database, { batch = 5e3, until = /* @__PURE__ */ __name(() => false, "until"), onBatch, now: now2 = Date.now } = {}) => {
|
|
45809
45908
|
const filled = { stemmed: 0, drained: 0 };
|
|
45810
45909
|
const before2 = stemsState(database);
|
|
@@ -45899,7 +45998,7 @@ var followDefaultStemmers = /* @__PURE__ */ __name((database, now2 = Date.now) =
|
|
|
45899
45998
|
return resetStems(database, { now: now2 });
|
|
45900
45999
|
}, "followDefaultStemmers");
|
|
45901
46000
|
|
|
45902
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
46001
|
+
// 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/words.js
|
|
45903
46002
|
var VOCABULARY = "SELECT term, doc FROM message_words_vocab WHERE col = 'normalized_text'";
|
|
45904
46003
|
var knownTerms = /* @__PURE__ */ __name(({ database }, terms) => {
|
|
45905
46004
|
const lookup = database.prepare(`${VOCABULARY} AND term >= ? AND term <= ? LIMIT 1`);
|
|
@@ -45921,7 +46020,7 @@ var termCandidates = /* @__PURE__ */ __name(({ database }, pieces, { shortest, l
|
|
|
45921
46020
|
});
|
|
45922
46021
|
}, "termCandidates");
|
|
45923
46022
|
|
|
45924
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
46023
|
+
// 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/search-index.js
|
|
45925
46024
|
var searchIndexStoreOver = /* @__PURE__ */ __name((context) => {
|
|
45926
46025
|
const { database } = context;
|
|
45927
46026
|
const stemmerFor2 = stemmerCache();
|
|
@@ -45931,6 +46030,7 @@ var searchIndexStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
45931
46030
|
searchIndexState: /* @__PURE__ */ __name(async () => searchIndexState2(database), "searchIndexState"),
|
|
45932
46031
|
fillSearchIndex: /* @__PURE__ */ __name(async ({ until } = {}) => isQueryOnly(database) ? { normalized: 0, indexed: 0, terms: 0 } : fillSearchIndex(database, { now: context.now, ...until ? { until } : {} }), "fillSearchIndex"),
|
|
45933
46032
|
stemsState: /* @__PURE__ */ __name(async () => stemsState(database), "stemsState"),
|
|
46033
|
+
heldStems: /* @__PURE__ */ __name(async (held2) => heldStems(database, held2), "heldStems"),
|
|
45934
46034
|
fillStems: /* @__PURE__ */ __name(async ({ until } = {}) => {
|
|
45935
46035
|
if (isQueryOnly(database))
|
|
45936
46036
|
return { stemmed: 0, drained: 0 };
|
|
@@ -45945,7 +46045,7 @@ var searchIndexStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
45945
46045
|
};
|
|
45946
46046
|
}, "searchIndexStoreOver");
|
|
45947
46047
|
|
|
45948
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
46048
|
+
// 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/searches.js
|
|
45949
46049
|
var HISTORY_KEPT = 1e3;
|
|
45950
46050
|
var commandFilter = /* @__PURE__ */ __name((commands) => commands ? { sql: ` AND command IN (${commands.map(() => "?").join(", ")})`, values: [...commands] } : { sql: "", values: [] }, "commandFilter");
|
|
45951
46051
|
var COLUMNS6 = "id, name, command, params, language, version, fields_version, created_at, updated_at, last_run_at, runs";
|
|
@@ -46015,7 +46115,7 @@ var clearHistory = /* @__PURE__ */ __name(({ database }, commands) => {
|
|
|
46015
46115
|
return database.prepare(`DELETE FROM searches WHERE name IS NULL${only.sql}`).run(...only.values).changes;
|
|
46016
46116
|
}, "clearHistory");
|
|
46017
46117
|
|
|
46018
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
46118
|
+
// 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/searches.js
|
|
46019
46119
|
var searchesStoreOver = /* @__PURE__ */ __name((context) => {
|
|
46020
46120
|
const { database } = context;
|
|
46021
46121
|
return {
|
|
@@ -46039,7 +46139,7 @@ var searchesStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
46039
46139
|
};
|
|
46040
46140
|
}, "searchesStoreOver");
|
|
46041
46141
|
|
|
46042
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
46142
|
+
// 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/added-sources.js
|
|
46043
46143
|
import { createHash as createHash12 } from "node:crypto";
|
|
46044
46144
|
var ADDED_KINDS = ["text", "file", "page"];
|
|
46045
46145
|
var TEXT_COLUMNS = "kind = ?, title = ?, file_name = ?, extension = ?, url = ?, mime = ?, size = ?, content_hash = ?, body = ?, extraction = ?, metadata = ?, language = ?";
|
|
@@ -46281,7 +46381,7 @@ var addedSourcesOver = /* @__PURE__ */ __name((context) => {
|
|
|
46281
46381
|
};
|
|
46282
46382
|
}, "addedSourcesOver");
|
|
46283
46383
|
|
|
46284
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
46384
|
+
// 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/agent-actions.js
|
|
46285
46385
|
var ACTION_TIERS = ["read", "draft", "write-private", "write-public", "destructive", "admin"];
|
|
46286
46386
|
var ACTION_OUTCOMES = ["ok", "refused", "failed"];
|
|
46287
46387
|
var CODE = /^[a-z][a-z0-9_]{0,63}$/;
|
|
@@ -46329,7 +46429,7 @@ var agentActionsStoreOver = /* @__PURE__ */ __name((context, afterRecord = () =>
|
|
|
46329
46429
|
};
|
|
46330
46430
|
}, "agentActionsStoreOver");
|
|
46331
46431
|
|
|
46332
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
46432
|
+
// 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/base-suggest.js
|
|
46333
46433
|
var baseSettingKey = /* @__PURE__ */ __name((kind3) => `stages.base.${kind3}`, "baseSettingKey");
|
|
46334
46434
|
var storedPipeline = /* @__PURE__ */ __name((value) => {
|
|
46335
46435
|
if (typeof value !== "string")
|
|
@@ -46375,70 +46475,11 @@ var suggestBaseStages = /* @__PURE__ */ __name((database, kind3, pipelines2, { o
|
|
|
46375
46475
|
}
|
|
46376
46476
|
}, "suggestBaseStages");
|
|
46377
46477
|
|
|
46378
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
46379
|
-
var calendarMoment = /* @__PURE__ */ __name((wanted, flag6, { zone, end = false } = {}) => {
|
|
46380
|
-
try {
|
|
46381
|
-
return zonedMoment(wanted, timezoneOf(zone), { start: 0, end: wanted.length }, { end });
|
|
46382
|
-
} catch (error) {
|
|
46383
|
-
if (!(error instanceof CliError))
|
|
46384
|
-
throw error;
|
|
46385
|
-
const alternative = error.details?.alternative;
|
|
46386
|
-
throw new CliError("validation_error", `${flag6}: "${wanted}" is not a time${alternative ? ` \u2014 ${alternative}` : ""}`);
|
|
46387
|
-
}
|
|
46388
|
-
}, "calendarMoment");
|
|
46389
|
-
var dayIn2 = /* @__PURE__ */ __name((at2, zone) => new Intl.DateTimeFormat("en-CA", { timeZone: zone, year: "numeric", month: "2-digit", day: "2-digit" }).format(at2), "dayIn");
|
|
46390
|
-
var MINUTE = 6e4;
|
|
46391
|
-
var YEAR = 365 * 24 * 60 * MINUTE;
|
|
46392
|
-
var RELATIVE = /^(\d+)(m|h|d)$/;
|
|
46393
|
-
var RELATIVE_MS = { m: MINUTE, h: 60 * MINUTE, d: 24 * 60 * MINUTE };
|
|
46394
|
-
var DATE_ALONE = /^\d{4}-\d{2}-\d{2}$/;
|
|
46395
|
-
var ZONED = /(?:Z|[+-]\d{2}:?\d{2})$/i;
|
|
46396
|
-
var dayWord = /* @__PURE__ */ __name((word2, zone, now2) => {
|
|
46397
|
-
const today = new Intl.DateTimeFormat("en-CA", { timeZone: zone }).format(now2);
|
|
46398
|
-
if (word2 === "today")
|
|
46399
|
-
return today;
|
|
46400
|
-
const date3 = /* @__PURE__ */ new Date(`${today}T00:00:00Z`);
|
|
46401
|
-
date3.setUTCDate(date3.getUTCDate() - 1);
|
|
46402
|
-
return date3.toISOString().slice(0, 10);
|
|
46403
|
-
}, "dayWord");
|
|
46404
|
-
var readMoment = /* @__PURE__ */ __name((typed, flag6, { zone, end = false, now: now2 = Date.now(), direction = -1 } = {}) => {
|
|
46405
|
-
const wanted = typed.trim();
|
|
46406
|
-
const [, amount, unit] = RELATIVE.exec(wanted) ?? [];
|
|
46407
|
-
if (amount && unit)
|
|
46408
|
-
return { time: now2 + direction * Number(amount) * (RELATIVE_MS[unit] ?? 0), local: false, dateAlone: false };
|
|
46409
|
-
const word2 = wanted.toLowerCase();
|
|
46410
|
-
const date3 = word2 === "today" || word2 === "yesterday" ? dayWord(word2, timezoneOf(zone), now2) : wanted;
|
|
46411
|
-
if (!/^\d{4}-\d{2}-\d{2}/.test(date3))
|
|
46412
|
-
return void 0;
|
|
46413
|
-
const iso17 = date3.replace(/^(\d{4}-\d{2}-\d{2}) +(?=\d)/, "$1T");
|
|
46414
|
-
return {
|
|
46415
|
-
time: calendarMoment(iso17, flag6, { ...zone === void 0 ? {} : { zone }, end }),
|
|
46416
|
-
local: !ZONED.test(iso17),
|
|
46417
|
-
dateAlone: DATE_ALONE.test(iso17)
|
|
46418
|
-
};
|
|
46419
|
-
}, "readMoment");
|
|
46420
|
-
var lead = /* @__PURE__ */ __name((ms) => ms === MINUTE ? "a minute" : ms === YEAR ? "a year" : `${Math.ceil(ms / MINUTE)} minutes`, "lead");
|
|
46421
|
-
var aheadOf = /* @__PURE__ */ __name((reference2, flag6, now2 = Date.now(), options = {}) => {
|
|
46422
|
-
const { refuseDate = false, soonest, latest: latest4, ...at2 } = options;
|
|
46423
|
-
const read2 = readMoment(reference2, flag6, { ...at2, now: now2, direction: 1 });
|
|
46424
|
-
if (read2 === void 0)
|
|
46425
|
-
throw new CliError("validation_error", `${flag6} takes an ISO 8601 time, today, or 30m, 2h, 3d from now \u2014 not "${reference2.trim()}"`);
|
|
46426
|
-
if (refuseDate && read2.dateAlone)
|
|
46427
|
-
throw new CliError("validation_error", DATE_ALONE.test(reference2.trim()) ? `${flag6} needs a time of day as well: ${reference2.trim()}T09:00` : `${flag6} needs a time of day as well, like 2026-11-20T09:00`);
|
|
46428
|
-
if (soonest === 0 && read2.time <= now2)
|
|
46429
|
-
throw new CliError("validation_error", `${flag6} is in the past`);
|
|
46430
|
-
if (soonest !== void 0 && soonest > 0 && read2.time < now2 + soonest)
|
|
46431
|
-
throw new CliError("validation_error", `${flag6} has to be at least ${lead(soonest)} from now`);
|
|
46432
|
-
if (latest4 !== void 0 && read2.time > now2 + latest4)
|
|
46433
|
-
throw new CliError("validation_error", `${flag6} can be at most ${lead(latest4)} from now`);
|
|
46434
|
-
return read2.time;
|
|
46435
|
-
}, "aheadOf");
|
|
46436
|
-
|
|
46437
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.687.0_@wirecat+cli-base@0.109.0_commander@15.0.0_esbuild@0.28.2_typ_3e6248e31e5b79d53006284373ddef70/node_modules/@wirecat/cli-core/dist/store/sqlite/copy-viewer.js
|
|
46478
|
+
// 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/copy-viewer.js
|
|
46438
46479
|
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");
|
|
46439
46480
|
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");
|
|
46440
46481
|
|
|
46441
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
46482
|
+
// 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/crm-rows.js
|
|
46442
46483
|
var TABLES2 = { deal: "deals", lead: "leads" };
|
|
46443
46484
|
var MONEY_REFUSALS = ["money.currency", "money.amount"];
|
|
46444
46485
|
var amountFault = /* @__PURE__ */ __name((item, code) => {
|
|
@@ -46568,7 +46609,7 @@ var crmRowsOver = /* @__PURE__ */ __name((context) => {
|
|
|
46568
46609
|
const status2 = item.status ?? String(stage.outcome);
|
|
46569
46610
|
const table = TABLES2[kind3];
|
|
46570
46611
|
const held2 = database.prepare(`SELECT id, status, closed_date, json_extract(metadata, '$.assignee') AS assignee FROM ${table} WHERE account_id = ? AND external_id = ?`).get(accountId, item.externalId);
|
|
46571
|
-
const closed = status2 === "open" ? null : day(item.closedDate, "a closed day") ?? (held2 && held2.status === status2 && held2.closed_date != null ? String(held2.closed_date) :
|
|
46612
|
+
const closed = status2 === "open" ? null : day(item.closedDate, "a closed day") ?? (held2 && held2.status === status2 && held2.closed_date != null ? String(held2.closed_date) : dayIn(epoch(item.updatedAt, at2), timezoneOf()));
|
|
46572
46613
|
const deal = writer3.deal !== void 0 ? writer3.deal === null ? void 0 : { id: writer3.deal } : kind3 === "lead" && item.deal ? database.prepare("SELECT id FROM deals WHERE account_id = ? AND external_id = ?").get(accountId, item.deal) : void 0;
|
|
46573
46614
|
const metadata3 = {
|
|
46574
46615
|
...item.metadata ?? {},
|
|
@@ -46610,7 +46651,7 @@ var crmRowsOver = /* @__PURE__ */ __name((context) => {
|
|
|
46610
46651
|
return { savePipeline, saveItemRow };
|
|
46611
46652
|
}, "crmRowsOver");
|
|
46612
46653
|
|
|
46613
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
46654
|
+
// 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/crm-activities.js
|
|
46614
46655
|
var ACTIVITY_RECORD = "crm.activity";
|
|
46615
46656
|
var forgetActivitiesOn = /* @__PURE__ */ __name((database, accountId, kind3, externalIds, at2) => {
|
|
46616
46657
|
const removed = "rr.target_type = ? AND rr.target_external_id IN (SELECT value FROM json_each(?))";
|
|
@@ -46798,7 +46839,7 @@ var seenSql = /* @__PURE__ */ __name((viewer) => {
|
|
|
46798
46839
|
};
|
|
46799
46840
|
}, "seenSql");
|
|
46800
46841
|
|
|
46801
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
46842
|
+
// 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/crm-stage-entries.js
|
|
46802
46843
|
var STAGE_ENTRY_RECORD = "crm.stage-entry";
|
|
46803
46844
|
var STAGE_ENTRY_DAYS = 90;
|
|
46804
46845
|
var STAGE_TASK_DAYS = 7;
|
|
@@ -46866,7 +46907,7 @@ var crmStageEntriesOver = /* @__PURE__ */ __name((context) => {
|
|
|
46866
46907
|
return { save: save2, pending, handled, expire };
|
|
46867
46908
|
}, "crmStageEntriesOver");
|
|
46868
46909
|
|
|
46869
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
46910
|
+
// 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/stage-amounts.js
|
|
46870
46911
|
var TABLES3 = { deal: "deals", lead: "leads" };
|
|
46871
46912
|
var stageAmountsOf = /* @__PURE__ */ __name(({ database }, kind3, stageIds, { since, until }, viewer) => {
|
|
46872
46913
|
const seen = viewerSql("d", viewer);
|
|
@@ -46884,7 +46925,7 @@ var stageAmountsOf = /* @__PURE__ */ __name(({ database }, kind3, stageIds, { si
|
|
|
46884
46925
|
});
|
|
46885
46926
|
}, "stageAmountsOf");
|
|
46886
46927
|
|
|
46887
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
46928
|
+
// 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/pipeline-period.js
|
|
46888
46929
|
var TABLES4 = { deal: "deals", lead: "leads" };
|
|
46889
46930
|
var DAY6 = 864e5;
|
|
46890
46931
|
var LOST_REASONS = 10;
|
|
@@ -46944,8 +46985,8 @@ var pipelinePeriod = /* @__PURE__ */ __name((context, pipeline, window, zone, vi
|
|
|
46944
46985
|
const pipelineId = Number(pipeline.id);
|
|
46945
46986
|
const made = /* @__PURE__ */ __name((at2) => (window.since === null || at2 >= window.since) && (window.until === null || at2 <= window.until), "made");
|
|
46946
46987
|
const days = {
|
|
46947
|
-
since: window.since === null ? null :
|
|
46948
|
-
until: window.until === null ? null :
|
|
46988
|
+
since: window.since === null ? null : dayIn(window.since, zone),
|
|
46989
|
+
until: window.until === null ? null : dayIn(window.until, zone)
|
|
46949
46990
|
};
|
|
46950
46991
|
const closedIn = /* @__PURE__ */ __name((day2) => day2 !== null && (days.since === null || day2 >= days.since) && (days.until === null || day2 <= days.until), "closedIn");
|
|
46951
46992
|
const all2 = itemsOf(database, kind3, pipelineId, viewer);
|
|
@@ -47041,7 +47082,7 @@ var pipelinePeriod = /* @__PURE__ */ __name((context, pipeline, window, zone, vi
|
|
|
47041
47082
|
};
|
|
47042
47083
|
}, "pipelinePeriod");
|
|
47043
47084
|
|
|
47044
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
47085
|
+
// 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/deals.js
|
|
47045
47086
|
var TABLES5 = { deal: "deals", lead: "leads" };
|
|
47046
47087
|
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");
|
|
47047
47088
|
var MAX_STAGES = 30;
|
|
@@ -47103,7 +47144,7 @@ var dealOperationsOver = /* @__PURE__ */ __name((context) => {
|
|
|
47103
47144
|
const { partyOf, partyThing } = reviewedRowsOver(context);
|
|
47104
47145
|
const today = /* @__PURE__ */ __name(() => new Date(now2()).toISOString().slice(0, 10), "today");
|
|
47105
47146
|
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");
|
|
47106
|
-
const
|
|
47147
|
+
const itemOf2 = /* @__PURE__ */ __name((kind3) => (row2) => {
|
|
47107
47148
|
const currency = row2.currency == null ? null : String(row2.currency);
|
|
47108
47149
|
const amount = row2.amount == null || currency === null ? null : Number(row2.amount);
|
|
47109
47150
|
const fields4 = {
|
|
@@ -47158,7 +47199,7 @@ var dealOperationsOver = /* @__PURE__ */ __name((context) => {
|
|
|
47158
47199
|
}, "rowOf");
|
|
47159
47200
|
const read2 = /* @__PURE__ */ __name((reference2) => {
|
|
47160
47201
|
const { kind: kind3, row: row2 } = rowOf4(reference2);
|
|
47161
|
-
return
|
|
47202
|
+
return itemOf2(kind3)(row2);
|
|
47162
47203
|
}, "read");
|
|
47163
47204
|
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");
|
|
47164
47205
|
const kindOf4 = /* @__PURE__ */ __name((kind3) => kind3 === void 0 ? "deal" : oneOf3(kind3, DEAL_KINDS, "a kind"), "kindOf");
|
|
@@ -47356,8 +47397,8 @@ var dealOperationsOver = /* @__PURE__ */ __name((context) => {
|
|
|
47356
47397
|
const offset = Math.max(0, Math.trunc(filter.offset ?? 0));
|
|
47357
47398
|
const zone = filter.zone ?? timezoneOf();
|
|
47358
47399
|
const days = {
|
|
47359
|
-
since: filter.closed?.since === void 0 ? void 0 :
|
|
47360
|
-
until: filter.closed?.until === void 0 ? void 0 :
|
|
47400
|
+
since: filter.closed?.since === void 0 ? void 0 : dayIn(filter.closed.since, zone),
|
|
47401
|
+
until: filter.closed?.until === void 0 ? void 0 : dayIn(filter.closed.until, zone)
|
|
47361
47402
|
};
|
|
47362
47403
|
const within = [
|
|
47363
47404
|
...filter.viewer ? [viewerSql("d", filter.viewer)] : [],
|
|
@@ -47368,7 +47409,7 @@ var dealOperationsOver = /* @__PURE__ */ __name((context) => {
|
|
|
47368
47409
|
filter.owner === null ? { sql: "json_extract(d.metadata, '$.assignee') IS NULL", params: [] } : { sql: "json_extract(d.metadata, '$.assignee') = ?", params: [filter.owner] }
|
|
47369
47410
|
]
|
|
47370
47411
|
];
|
|
47371
|
-
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(
|
|
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(itemOf2(kind3));
|
|
47372
47413
|
return pageOfRows(rows, limit, offset);
|
|
47373
47414
|
}, "list"),
|
|
47374
47415
|
find: /* @__PURE__ */ __name(async (wanted) => {
|
|
@@ -47514,7 +47555,7 @@ var dealsStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
47514
47555
|
};
|
|
47515
47556
|
}, "dealsStoreOver");
|
|
47516
47557
|
|
|
47517
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
47558
|
+
// 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/owner-languages.js
|
|
47518
47559
|
var KEY2 = "ownerLanguages";
|
|
47519
47560
|
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(" "));
|
|
47520
47561
|
var DEFAULT_OWNER_LANGUAGES = ["ru"];
|
|
@@ -47544,7 +47585,7 @@ var saveOwnerLanguages = /* @__PURE__ */ __name((database, languages, now2) => {
|
|
|
47544
47585
|
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);
|
|
47545
47586
|
}, "saveOwnerLanguages");
|
|
47546
47587
|
|
|
47547
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
47588
|
+
// 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/base-stages.js
|
|
47548
47589
|
var OUTCOMES = {
|
|
47549
47590
|
lead: ["open", "open", "open", "won", "lost"],
|
|
47550
47591
|
deal: ["open", "open", "open", "open", "won", "lost"]
|
|
@@ -47877,7 +47918,7 @@ var baseStagesStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
47877
47918
|
};
|
|
47878
47919
|
}, "baseStagesStoreOver");
|
|
47879
47920
|
|
|
47880
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
47921
|
+
// 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/bot-updates.js
|
|
47881
47922
|
var botUpdateStoreOver = /* @__PURE__ */ __name((context, afterSave = () => {
|
|
47882
47923
|
}) => {
|
|
47883
47924
|
const { database, now: now2 } = context;
|
|
@@ -47936,7 +47977,7 @@ var botUpdateStoreOver = /* @__PURE__ */ __name((context, afterSave = () => {
|
|
|
47936
47977
|
};
|
|
47937
47978
|
}, "botUpdateStoreOver");
|
|
47938
47979
|
|
|
47939
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
47980
|
+
// 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/record-projection.js
|
|
47940
47981
|
var IMPORTER = { bot: "import" };
|
|
47941
47982
|
var importersProposal = /* @__PURE__ */ __name((entity) => entity.review === "proposed" && entity.author.type === "bot" && entity.author.name === IMPORTER.bot, "importersProposal");
|
|
47942
47983
|
var codeOf = /* @__PURE__ */ __name((error) => {
|
|
@@ -47981,7 +48022,7 @@ var moneyLinesOf = /* @__PURE__ */ __name((projection, list2) => (Array.isArray(
|
|
|
47981
48022
|
};
|
|
47982
48023
|
}), "moneyLinesOf");
|
|
47983
48024
|
|
|
47984
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
48025
|
+
// 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/relation-roles.js
|
|
47985
48026
|
var settingOf = /* @__PURE__ */ __name((list2) => `relationships.roles.${list2}`, "settingOf");
|
|
47986
48027
|
var isList = /* @__PURE__ */ __name((list2) => Object.hasOwn(ROLE_LISTS, list2), "isList");
|
|
47987
48028
|
var listOf2 = /* @__PURE__ */ __name((list2) => {
|
|
@@ -48065,13 +48106,31 @@ var relationRolesOver = /* @__PURE__ */ __name(({ database, now: now2 }) => {
|
|
|
48065
48106
|
};
|
|
48066
48107
|
}, "relationRolesOver");
|
|
48067
48108
|
|
|
48068
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
48109
|
+
// 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/crm-settings.js
|
|
48069
48110
|
var CRM_LINK_MODES = ["reported", "review"];
|
|
48070
48111
|
var COMPANY_TYPE_MEANINGS = ["customer-of", "supplier", "partner-of"];
|
|
48071
48112
|
var CRM_SCOPES = ["mine", "all"];
|
|
48072
48113
|
var CRM_ACTIVITIES = ["on", "off"];
|
|
48073
|
-
var
|
|
48074
|
-
|
|
48114
|
+
var CRM_FILE_LIMITS = {
|
|
48115
|
+
max_files: { default: 50, min: 1, max: 500 },
|
|
48116
|
+
max_file_mb: { default: 20, min: 1, max: 50 },
|
|
48117
|
+
max_run_mb: { default: 200, min: 10, max: 2e3 },
|
|
48118
|
+
run_minutes: { default: 10, min: 1, max: 60 },
|
|
48119
|
+
days: { default: 7, min: 1, max: 90 },
|
|
48120
|
+
max_total_mb: { default: 2e3, min: 100, max: 5e4 }
|
|
48121
|
+
};
|
|
48122
|
+
var FILE_LIMIT_NAMES = Object.keys(CRM_FILE_LIMITS).map((name) => `files.${name}`);
|
|
48123
|
+
var NAMES2 = [
|
|
48124
|
+
"links",
|
|
48125
|
+
"company-types",
|
|
48126
|
+
"scope",
|
|
48127
|
+
"unassigned",
|
|
48128
|
+
"self",
|
|
48129
|
+
"stage-tasks",
|
|
48130
|
+
"activities",
|
|
48131
|
+
...FILE_LIMIT_NAMES
|
|
48132
|
+
];
|
|
48133
|
+
var SETTING4 = new RegExp(`^crm\\.([a-z0-9-]+):(.+)\\.(${NAMES2.map((name) => name.replace(".", "\\.")).join("|")})$`);
|
|
48075
48134
|
var crmSettingKey = /* @__PURE__ */ __name((key2, name) => `crm.${key2.provider}:${key2.account}.${name}`, "crmSettingKey");
|
|
48076
48135
|
var parseCrmSetting = /* @__PURE__ */ __name((setting) => {
|
|
48077
48136
|
const match = SETTING4.exec(setting);
|
|
@@ -48194,8 +48253,25 @@ var crmStageTasksSince = /* @__PURE__ */ __name((database, key2) => {
|
|
|
48194
48253
|
var saveStageMovesMark = /* @__PURE__ */ __name((database, key2, through, now2) => {
|
|
48195
48254
|
database.prepare("INSERT INTO store_settings (key, value, at) VALUES (?, ?, ?) ON CONFLICT (key) DO UPDATE SET value = excluded.value").run(stageTasksMark(crmSettingKey(key2, "stage-tasks")), JSON.stringify(through), now2);
|
|
48196
48255
|
}, "saveStageMovesMark");
|
|
48256
|
+
var fileLimitOf = /* @__PURE__ */ __name((name) => name.startsWith("files.") ? name.slice("files.".length) : void 0, "fileLimitOf");
|
|
48257
|
+
var crmFileLimits = /* @__PURE__ */ __name((database, key2) => Object.fromEntries(Object.entries(CRM_FILE_LIMITS).map(([name, range]) => {
|
|
48258
|
+
const value = stored2(database, crmSettingKey(key2, `files.${name}`));
|
|
48259
|
+
const fits = Number.isSafeInteger(value) && value >= range.min && value <= range.max;
|
|
48260
|
+
return [name, fits ? value : range.default];
|
|
48261
|
+
})), "crmFileLimits");
|
|
48197
48262
|
var parseCrmSettingValue = /* @__PURE__ */ __name((name, value) => {
|
|
48198
48263
|
const text8 = value.trim();
|
|
48264
|
+
const limit = fileLimitOf(name);
|
|
48265
|
+
if (limit) {
|
|
48266
|
+
const { min, max } = CRM_FILE_LIMITS[limit];
|
|
48267
|
+
if (!/^\d+$/u.test(text8) || Number(text8) < min || Number(text8) > max)
|
|
48268
|
+
throw new CliError("validation_error", `${name} takes a whole number from ${min} to ${max}, not "${text8}"`, {
|
|
48269
|
+
reason: "crm.files-limit-range",
|
|
48270
|
+
min,
|
|
48271
|
+
max
|
|
48272
|
+
});
|
|
48273
|
+
return Number(text8);
|
|
48274
|
+
}
|
|
48199
48275
|
if (name === "stage-tasks")
|
|
48200
48276
|
return parseStageTasks(text8);
|
|
48201
48277
|
if (name === "links")
|
|
@@ -48249,6 +48325,9 @@ var settingValue = /* @__PURE__ */ __name((database, key2, name) => {
|
|
|
48249
48325
|
return stored2(database, crmSettingKey(key2, name)) ?? {};
|
|
48250
48326
|
if (name === "activities")
|
|
48251
48327
|
return crmActivitiesOn(database, key2) ? "on" : "off";
|
|
48328
|
+
const limit = fileLimitOf(name);
|
|
48329
|
+
if (limit)
|
|
48330
|
+
return crmFileLimits(database, key2)[limit];
|
|
48252
48331
|
return userIds(stored2(database, crmSettingKey(key2, name)));
|
|
48253
48332
|
}, "settingValue");
|
|
48254
48333
|
var crmSettingsOf = /* @__PURE__ */ __name((database) => database.prepare("SELECT key, value FROM store_settings WHERE key LIKE 'crm.%' ORDER BY key").all().flatMap((row2) => {
|
|
@@ -48258,7 +48337,7 @@ var crmSettingsOf = /* @__PURE__ */ __name((database) => database.prepare("SELEC
|
|
|
48258
48337
|
return [{ setting: String(row2.key), value: settingValue(database, parsed5.key, parsed5.name) }];
|
|
48259
48338
|
}), "crmSettingsOf");
|
|
48260
48339
|
|
|
48261
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
48340
|
+
// 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/relation-proposals.js
|
|
48262
48341
|
var isoOf = /* @__PURE__ */ __name((ms) => ms === void 0 ? null : new Date(ms).toISOString(), "isoOf");
|
|
48263
48342
|
var relationOf = /* @__PURE__ */ __name((link3, now2) => ({
|
|
48264
48343
|
id: link3.id,
|
|
@@ -48618,7 +48697,7 @@ var decidedOrigin = /* @__PURE__ */ __name((by) => by === "owner" ? { origin: "o
|
|
|
48618
48697
|
provenance: `agent:${by.bot} for the owner: ${by.reason.trim()}`
|
|
48619
48698
|
}, "decidedOrigin");
|
|
48620
48699
|
|
|
48621
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
48700
|
+
// 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/reported-relations.js
|
|
48622
48701
|
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");
|
|
48623
48702
|
var metadataOf = /* @__PURE__ */ __name((relation) => relation.metadata && Object.keys(relation.metadata).length ? JSON.stringify(relation.metadata) : null, "metadataOf");
|
|
48624
48703
|
var syncReportedIn = /* @__PURE__ */ __name((context, key2, relationships, scope3, { source: source2 = "import", by = { bot: key2.provider, kind: "rule" }, onOutcome } = {}) => {
|
|
@@ -48756,7 +48835,7 @@ var relationsStoreOver = /* @__PURE__ */ __name((context) => ({
|
|
|
48756
48835
|
syncReported: /* @__PURE__ */ __name(async (key2, relationships, scope3, options) => write(context.database, () => syncReportedIn(context, key2, relationships, scope3, options)), "syncReported")
|
|
48757
48836
|
}), "relationsStoreOver");
|
|
48758
48837
|
|
|
48759
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
48838
|
+
// 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/record-relationships.js
|
|
48760
48839
|
var importSource = /* @__PURE__ */ __name((provider) => `import:${provider}`, "importSource");
|
|
48761
48840
|
var noRelationships = /* @__PURE__ */ __name(() => ({
|
|
48762
48841
|
added: 0,
|
|
@@ -48946,7 +49025,7 @@ var recordRelationshipsOver = /* @__PURE__ */ __name((context) => {
|
|
|
48946
49025
|
return { report, placeOf: placeOf2, withdrawFrom };
|
|
48947
49026
|
}, "recordRelationshipsOver");
|
|
48948
49027
|
|
|
48949
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
49028
|
+
// 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/business-contracts.js
|
|
48950
49029
|
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";
|
|
48951
49030
|
var DAY_MS2 = 864e5;
|
|
48952
49031
|
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");
|
|
@@ -49105,7 +49184,7 @@ var contractsStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
49105
49184
|
};
|
|
49106
49185
|
}, "contractsStoreOver");
|
|
49107
49186
|
|
|
49108
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
49187
|
+
// 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/business-search.js
|
|
49109
49188
|
var BUSINESS_FIND_MAX = 2001;
|
|
49110
49189
|
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");
|
|
49111
49190
|
var partyName = /* @__PURE__ */ __name((as) => `coalesce(${as}p.name, ${as}o.name, ${as}j.name)`, "partyName");
|
|
@@ -49210,7 +49289,7 @@ var businessSearchOver = /* @__PURE__ */ __name(({ database }) => {
|
|
|
49210
49289
|
};
|
|
49211
49290
|
}, "businessSearchOver");
|
|
49212
49291
|
|
|
49213
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
49292
|
+
// 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/catalog.js
|
|
49214
49293
|
var CATALOG_QUERY = defineQuery({
|
|
49215
49294
|
entity: "document",
|
|
49216
49295
|
backend: "sql",
|
|
@@ -49443,7 +49522,7 @@ var catalogStoreOver = /* @__PURE__ */ __name(({ database, now: now2 }) => {
|
|
|
49443
49522
|
};
|
|
49444
49523
|
}, "catalogStoreOver");
|
|
49445
49524
|
|
|
49446
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
49525
|
+
// 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/context-document-source.js
|
|
49447
49526
|
var remote = /* @__PURE__ */ __name(() => `CASE WHEN json_valid(n.front_matter) THEN json_extract(n.front_matter,'$.source') IN (${documentAccountProvidersSql()}) ELSE 0 END`, "remote");
|
|
49448
49527
|
var field3 = /* @__PURE__ */ __name((name) => `CASE WHEN (${remote()}) THEN
|
|
49449
49528
|
CASE WHEN json_type(n.front_matter,'$.${name}')='text' THEN json_extract(n.front_matter,'$.${name}') END END`, "field");
|
|
@@ -49456,7 +49535,7 @@ var contextDocumentTimeKind = /* @__PURE__ */ __name(() => `CASE WHEN (${remoteT
|
|
|
49456
49535
|
THEN 'source-modified' ELSE 'stored-update' END`, "contextDocumentTimeKind");
|
|
49457
49536
|
var contextDocumentUrl = /* @__PURE__ */ __name(() => `coalesce(${preferred("url")},n.url,${field3("sourceUrl")})`, "contextDocumentUrl");
|
|
49458
49537
|
|
|
49459
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
49538
|
+
// 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/context-meeting-source.js
|
|
49460
49539
|
var readMeetingContextEvidence = /* @__PURE__ */ __name((database, request) => {
|
|
49461
49540
|
const { source: source2, words: words4, after: after2, before: before2, limit, maxReadBytes, cursor, signal } = request;
|
|
49462
49541
|
signal?.throwIfAborted();
|
|
@@ -49555,7 +49634,7 @@ var readMeetingContextEvidence = /* @__PURE__ */ __name((database, request) => {
|
|
|
49555
49634
|
});
|
|
49556
49635
|
}, "readMeetingContextEvidence");
|
|
49557
49636
|
|
|
49558
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
49637
|
+
// 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/context-evidence.js
|
|
49559
49638
|
var corpora = {
|
|
49560
49639
|
message: {
|
|
49561
49640
|
table: "messages",
|
|
@@ -49800,7 +49879,7 @@ var contextRecordsOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
|
49800
49879
|
}
|
|
49801
49880
|
}), "contextRecordsOver");
|
|
49802
49881
|
|
|
49803
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
49882
|
+
// 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/crm-changes.js
|
|
49804
49883
|
var CRM_CHANGES = [
|
|
49805
49884
|
"created",
|
|
49806
49885
|
"moved",
|
|
@@ -49825,7 +49904,7 @@ var changesQuery = /* @__PURE__ */ __name((context, key2, filter) => {
|
|
|
49825
49904
|
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");
|
|
49826
49905
|
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";
|
|
49827
49906
|
const closing = "(SELECT outcome FROM pipeline_stages WHERE id = m.stage) IN ('won', 'lost')";
|
|
49828
|
-
const
|
|
49907
|
+
const itemOf2 = /* @__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");
|
|
49829
49908
|
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)";
|
|
49830
49909
|
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'))";
|
|
49831
49910
|
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)";
|
|
@@ -49836,7 +49915,7 @@ var changesQuery = /* @__PURE__ */ __name((context, key2, filter) => {
|
|
|
49836
49915
|
// The closed day only narrows the rows; the window is checked on `at`, so a deal is listed in one window only.
|
|
49837
49916
|
`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`,
|
|
49838
49917
|
"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",
|
|
49839
|
-
...["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, ${
|
|
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, ${itemOf2("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.
|
|
49840
49919
|
(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)`),
|
|
49841
49920
|
`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})`
|
|
49842
49921
|
];
|
|
@@ -49943,7 +50022,7 @@ var crmReadsOver = /* @__PURE__ */ __name((context) => {
|
|
|
49943
50022
|
};
|
|
49944
50023
|
}, "crmReadsOver");
|
|
49945
50024
|
|
|
49946
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
50025
|
+
// 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/crm-contacts.js
|
|
49947
50026
|
var PLACEHOLDER = /(?:^|\s)null(?:\s+#\d+)?(?=\s|$)/gi;
|
|
49948
50027
|
var withoutPlaceholder = /* @__PURE__ */ __name((name) => name.replace(PLACEHOLDER, " ").replace(/\s+/g, " ").trim() || null, "withoutPlaceholder");
|
|
49949
50028
|
var DryRun = class extends Error {
|
|
@@ -50022,7 +50101,7 @@ var removeCrmContacts = /* @__PURE__ */ __name((context, key2, { users, before:
|
|
|
50022
50101
|
}
|
|
50023
50102
|
}, "removeCrmContacts");
|
|
50024
50103
|
|
|
50025
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
50104
|
+
// 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/crm.js
|
|
50026
50105
|
var PENDING = "crm:pending-relations";
|
|
50027
50106
|
var PENDING_DAYS = 30;
|
|
50028
50107
|
var PENDING_MOST = 5e3;
|
|
@@ -50577,7 +50656,7 @@ var crmCopiesOver = /* @__PURE__ */ __name((context, people2) => {
|
|
|
50577
50656
|
};
|
|
50578
50657
|
}, "crmCopiesOver");
|
|
50579
50658
|
|
|
50580
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
50659
|
+
// 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/crm-files.js
|
|
50581
50660
|
import { sep } from "node:path";
|
|
50582
50661
|
var MOST = 500;
|
|
50583
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");
|
|
@@ -50697,14 +50776,15 @@ var crmFilesOver = /* @__PURE__ */ __name((context) => {
|
|
|
50697
50776
|
return;
|
|
50698
50777
|
write(database, () => database.prepare("UPDATE crm_files SET local_path = NULL WHERE account_id = ? AND external_id = ?").run(accountId, externalId));
|
|
50699
50778
|
}, "forgetFile"),
|
|
50700
|
-
find: /* @__PURE__ */ __name(async (search2) => find2(search2), "find")
|
|
50779
|
+
find: /* @__PURE__ */ __name(async (search2) => find2(search2), "find"),
|
|
50780
|
+
limits: /* @__PURE__ */ __name(async (key2) => crmFileLimits(database, key2), "limits")
|
|
50701
50781
|
};
|
|
50702
50782
|
}, "crmFilesOver");
|
|
50703
50783
|
|
|
50704
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
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
|
|
50705
50785
|
import { createHash as createHash13, randomBytes as randomBytes2 } from "node:crypto";
|
|
50706
50786
|
|
|
50707
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
50787
|
+
// 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/decision-requests.js
|
|
50708
50788
|
var DECISION_ACTIONS = ["confirm", "reject", "ask-confirm", "ask-reject", "back", "later"];
|
|
50709
50789
|
var DECISION_TTL_MS = 72 * 60 * 60 * 1e3;
|
|
50710
50790
|
var CALLBACK_PREFIX = "wcr1:";
|
|
@@ -50718,7 +50798,7 @@ var callbackDataOf = /* @__PURE__ */ __name((token) => {
|
|
|
50718
50798
|
}, "callbackDataOf");
|
|
50719
50799
|
var parseCallbackData = /* @__PURE__ */ __name((data) => typeof data === "string" ? CALLBACK.exec(data)?.[1] : void 0, "parseCallbackData");
|
|
50720
50800
|
|
|
50721
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
50801
|
+
// 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
|
|
50722
50802
|
var digestOf = /* @__PURE__ */ __name((token) => createHash13("sha256").update(token).digest("hex"), "digestOf");
|
|
50723
50803
|
var newToken = /* @__PURE__ */ __name(() => randomBytes2(16).toString("base64url"), "newToken");
|
|
50724
50804
|
var requestOf = /* @__PURE__ */ __name((row2) => ({
|
|
@@ -50817,7 +50897,7 @@ var decisionRequestStoreOver = /* @__PURE__ */ __name(({ database, now: now2 })
|
|
|
50817
50897
|
};
|
|
50818
50898
|
}, "decisionRequestStoreOver");
|
|
50819
50899
|
|
|
50820
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
50900
|
+
// 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/meeting-listing.js
|
|
50821
50901
|
var MEETING_ROW_KINDS = ["meeting", "call", "event"];
|
|
50822
50902
|
var DAY8 = 864e5;
|
|
50823
50903
|
var JOINED = `(SELECT ce.event_id FROM calendar_entries ce JOIN events je ON je.id = ce.event_id
|
|
@@ -51204,7 +51284,7 @@ var meetingListingOver = /* @__PURE__ */ __name((context) => {
|
|
|
51204
51284
|
};
|
|
51205
51285
|
}, "meetingListingOver");
|
|
51206
51286
|
|
|
51207
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
51287
|
+
// 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/document-listing.js
|
|
51208
51288
|
var DOCUMENT_KINDS = [
|
|
51209
51289
|
"transcript",
|
|
51210
51290
|
"doc",
|
|
@@ -51441,7 +51521,7 @@ var documentListingOver = /* @__PURE__ */ __name((context) => {
|
|
|
51441
51521
|
};
|
|
51442
51522
|
}, "documentListingOver");
|
|
51443
51523
|
|
|
51444
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
51524
|
+
// 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/note-search.js
|
|
51445
51525
|
var NOTE_FIELDS = [
|
|
51446
51526
|
"text",
|
|
51447
51527
|
"exact",
|
|
@@ -51938,7 +52018,7 @@ var noteSearchOver = /* @__PURE__ */ __name((context) => {
|
|
|
51938
52018
|
};
|
|
51939
52019
|
}, "noteSearchOver");
|
|
51940
52020
|
|
|
51941
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
52021
|
+
// 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/event-search.js
|
|
51942
52022
|
var EVENT_FIELDS = ["text", "exact", "body", "title", "date", "in"];
|
|
51943
52023
|
var inEventAccounts = /* @__PURE__ */ __name((event2) => searchableCopy(event2, "c.account_id IN (SELECT CAST(value AS INTEGER) FROM json_each(?))"), "inEventAccounts");
|
|
51944
52024
|
var EVENT_CORPUS = {
|
|
@@ -52078,7 +52158,7 @@ var eventSearchOver = /* @__PURE__ */ __name((context) => {
|
|
|
52078
52158
|
};
|
|
52079
52159
|
}, "eventSearchOver");
|
|
52080
52160
|
|
|
52081
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
52161
|
+
// 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/facts.js
|
|
52082
52162
|
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";
|
|
52083
52163
|
var iso13 = /* @__PURE__ */ __name((value) => new Date(Number(value)).toISOString(), "iso");
|
|
52084
52164
|
var oneOf5 = /* @__PURE__ */ __name((value, allowed, what) => {
|
|
@@ -52341,7 +52421,7 @@ var factsStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
52341
52421
|
};
|
|
52342
52422
|
}, "factsStoreOver");
|
|
52343
52423
|
|
|
52344
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
52424
|
+
// 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/findings-core.js
|
|
52345
52425
|
var invalid4 = /* @__PURE__ */ __name((message3) => {
|
|
52346
52426
|
throw new CliError("validation_error", message3);
|
|
52347
52427
|
}, "invalid");
|
|
@@ -52509,7 +52589,7 @@ var findingsCoreOver = /* @__PURE__ */ __name((context, kind3) => {
|
|
|
52509
52589
|
return { snapshot: snapshot2, snapshotParts, previous, settle, keepWaiting, named: named2, sameDecision, create };
|
|
52510
52590
|
}, "findingsCoreOver");
|
|
52511
52591
|
|
|
52512
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
52592
|
+
// 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/evidence-findings.js
|
|
52513
52593
|
var stale = /* @__PURE__ */ __name(() => {
|
|
52514
52594
|
throw new CliError("validation_error", "evidence findings changed since they were read; stage a new batch", {
|
|
52515
52595
|
reason: "evidence-findings.stale"
|
|
@@ -52773,7 +52853,7 @@ var evidenceFindingsStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
52773
52853
|
};
|
|
52774
52854
|
}, "evidenceFindingsStoreOver");
|
|
52775
52855
|
|
|
52776
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
52856
|
+
// 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/involvements.js
|
|
52777
52857
|
var pendingInvolvements = /* @__PURE__ */ __name((database) => Number(database.prepare("SELECT count(*) AS n FROM involvement_pending").get()?.n ?? 0), "pendingInvolvements");
|
|
52778
52858
|
var involvementStoreOver = /* @__PURE__ */ __name(({ database, now: now2 }) => ({
|
|
52779
52859
|
rebuild: /* @__PURE__ */ __name((personId) => write(database, () => {
|
|
@@ -52827,7 +52907,7 @@ var involvementStoreOver = /* @__PURE__ */ __name(({ database, now: now2 }) => (
|
|
|
52827
52907
|
}, "forPerson")
|
|
52828
52908
|
}), "involvementStoreOver");
|
|
52829
52909
|
|
|
52830
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
52910
|
+
// 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/labelled.js
|
|
52831
52911
|
var LABELLED = {
|
|
52832
52912
|
note: "note",
|
|
52833
52913
|
document: "document",
|
|
@@ -52840,7 +52920,7 @@ var LABELLED = {
|
|
|
52840
52920
|
};
|
|
52841
52921
|
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");
|
|
52842
52922
|
|
|
52843
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
52923
|
+
// 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/meeting-projects.js
|
|
52844
52924
|
import { createHash as createHash14 } from "node:crypto";
|
|
52845
52925
|
var fields3 = "id,from_id,to_id,source,confirmed,updated_at,length(evidence) AS evidenceLength,substr(evidence,1,2000) AS evidence";
|
|
52846
52926
|
var id = /* @__PURE__ */ __name((value) => {
|
|
@@ -52926,7 +53006,7 @@ var meetingProjectsStoreOver = /* @__PURE__ */ __name(({ database, now: now2 })
|
|
|
52926
53006
|
};
|
|
52927
53007
|
}, "meetingProjectsStoreOver");
|
|
52928
53008
|
|
|
52929
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
53009
|
+
// 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/knowledge-query.js
|
|
52930
53010
|
var ORGANIZATIONS_QUERY = {
|
|
52931
53011
|
entity: "organization",
|
|
52932
53012
|
backend: "sql",
|
|
@@ -52967,7 +53047,7 @@ var REMINDERS_QUERY = {
|
|
|
52967
53047
|
})
|
|
52968
53048
|
};
|
|
52969
53049
|
|
|
52970
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
53050
|
+
// 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/organization-categories.js
|
|
52971
53051
|
var OWN2 = "(SELECT id FROM organizations WHERE deleted_at IS NULL AND json_extract(metadata, '$.own') = 1)";
|
|
52972
53052
|
var EMPLOYED = "('employee', 'contractor', 'founder')";
|
|
52973
53053
|
var categorySql = /* @__PURE__ */ __name(({ category, accounts: accounts2 }, now2) => {
|
|
@@ -52988,7 +53068,7 @@ var categorySql = /* @__PURE__ */ __name(({ category, accounts: accounts2 }, now
|
|
|
52988
53068
|
return { sql: `EXISTS (SELECT 1 FROM links l WHERE ${where} AND ${usable})`, params: keys };
|
|
52989
53069
|
}, "categorySql");
|
|
52990
53070
|
|
|
52991
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
53071
|
+
// 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/organizations.js
|
|
52992
53072
|
var organizationOf = /* @__PURE__ */ __name((row2) => ({
|
|
52993
53073
|
id: String(row2.id),
|
|
52994
53074
|
ref: `organization:${row2.id}`,
|
|
@@ -53033,7 +53113,7 @@ var organizationsStoreOver = /* @__PURE__ */ __name(({ database, now: now2 }) =>
|
|
|
53033
53113
|
}), "setOwnOrganization")
|
|
53034
53114
|
}), "organizationsStoreOver");
|
|
53035
53115
|
|
|
53036
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
53116
|
+
// 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/relation-list.js
|
|
53037
53117
|
var KINDS = RELATION_KINDS.map(linkKind).join(", ");
|
|
53038
53118
|
var ACCOUNT_ENDS = [
|
|
53039
53119
|
["deal", "deals"],
|
|
@@ -53196,13 +53276,13 @@ var relationListOver = /* @__PURE__ */ __name((context) => {
|
|
|
53196
53276
|
__name(proposalItem, "proposalItem");
|
|
53197
53277
|
}, "relationListOver");
|
|
53198
53278
|
|
|
53199
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
53279
|
+
// 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/relation-reads.js
|
|
53200
53280
|
var relationReadsOver = /* @__PURE__ */ __name((context) => ({
|
|
53201
53281
|
...relationListOver(context),
|
|
53202
53282
|
...relationRolesOver(context)
|
|
53203
53283
|
}), "relationReadsOver");
|
|
53204
53284
|
|
|
53205
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
53285
|
+
// 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/source-review.js
|
|
53206
53286
|
var TABLES6 = { memory: "memories", fact: "facts" };
|
|
53207
53287
|
var RETIRED = /* @__PURE__ */ new Set(["superseded", "reversed", "rejected", "stale"]);
|
|
53208
53288
|
var DEFAULT_LIMIT = 500;
|
|
@@ -53445,16 +53525,16 @@ var sourceReviewStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
53445
53525
|
};
|
|
53446
53526
|
}, "sourceReviewStoreOver");
|
|
53447
53527
|
|
|
53448
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
53528
|
+
// 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/vocabulary.js
|
|
53449
53529
|
import { createHash as createHash17 } from "node:crypto";
|
|
53450
53530
|
|
|
53451
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
53531
|
+
// 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.js
|
|
53452
53532
|
import { createHash as createHash16 } from "node:crypto";
|
|
53453
53533
|
|
|
53454
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
53534
|
+
// 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-apply.js
|
|
53455
53535
|
import { createHash as createHash15 } from "node:crypto";
|
|
53456
53536
|
|
|
53457
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
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
|
|
53458
53538
|
var consolidationId = /* @__PURE__ */ __name((value, field4) => {
|
|
53459
53539
|
if (typeof value !== "string" || !/^[1-9]\d*$/.test(value) || !Number.isSafeInteger(Number(value)))
|
|
53460
53540
|
throw new CliError("validation_error", `${field4} must be a positive canonical tag id`);
|
|
@@ -53505,7 +53585,7 @@ var consolidationApplyInput = /* @__PURE__ */ __name((options) => {
|
|
|
53505
53585
|
return input;
|
|
53506
53586
|
}, "consolidationApplyInput");
|
|
53507
53587
|
|
|
53508
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
53588
|
+
// 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-apply.js
|
|
53509
53589
|
var receiptOf = /* @__PURE__ */ __name((row2) => ({
|
|
53510
53590
|
id: String(row2.id),
|
|
53511
53591
|
sourceId: String(row2.source_id),
|
|
@@ -53580,7 +53660,7 @@ var applyTagConsolidation = /* @__PURE__ */ __name((context, preview, options) =
|
|
|
53580
53660
|
}, { beforeCommit: check3 });
|
|
53581
53661
|
}, "applyTagConsolidation");
|
|
53582
53662
|
|
|
53583
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
53663
|
+
// 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.js
|
|
53584
53664
|
var selections = [
|
|
53585
53665
|
["taggings", "tag_id IN (SELECT value FROM json_each(?))"],
|
|
53586
53666
|
["aliases", "aliasable_type='tag' AND aliasable_id IN (SELECT value FROM json_each(?))"],
|
|
@@ -53724,7 +53804,7 @@ var previewRows = /* @__PURE__ */ __name((context, options, source2, survivor, m
|
|
|
53724
53804
|
};
|
|
53725
53805
|
}, "previewRows");
|
|
53726
53806
|
|
|
53727
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
53807
|
+
// 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/vocabulary.js
|
|
53728
53808
|
var kinds = ["project", "tag", "topic"];
|
|
53729
53809
|
var cancelled2 = /* @__PURE__ */ __name((signal) => {
|
|
53730
53810
|
if (signal?.aborted)
|
|
@@ -53988,7 +54068,7 @@ var vocabularyStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
53988
54068
|
};
|
|
53989
54069
|
}, "vocabularyStoreOver");
|
|
53990
54070
|
|
|
53991
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
54071
|
+
// 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/knowledge.js
|
|
53992
54072
|
var TYPED_KEY_PREFIXES = new Set(Object.values(TASK_KEY_PREFIXES));
|
|
53993
54073
|
var ORGANIZATION_KINDS = ["company", "team", "family", "community"];
|
|
53994
54074
|
var PROJECT_TYPES = ["work", "client", "personal", "oss", "other"];
|
|
@@ -54542,7 +54622,7 @@ var projectKey = /* @__PURE__ */ __name((name) => {
|
|
|
54542
54622
|
return key2.padEnd(3, "X");
|
|
54543
54623
|
}, "projectKey");
|
|
54544
54624
|
|
|
54545
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
54625
|
+
// 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/log-pruning.js
|
|
54546
54626
|
var DAY9 = 864e5;
|
|
54547
54627
|
var SETTING5 = "logs_pruned_at";
|
|
54548
54628
|
var LOG_RETENTION = { agentActionsMs: 90 * DAY9, botUpdatePayloadsMs: 30 * DAY9 };
|
|
@@ -54569,7 +54649,7 @@ var logPruner = /* @__PURE__ */ __name((database, now2) => {
|
|
|
54569
54649
|
};
|
|
54570
54650
|
}, "logPruner");
|
|
54571
54651
|
|
|
54572
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
54652
|
+
// 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/mail/findings.js
|
|
54573
54653
|
var MAIL_FINDINGS_PER_RUN = 30;
|
|
54574
54654
|
var MAIL_FINDINGS_PER_SENDER = 5;
|
|
54575
54655
|
var invalid6 = /* @__PURE__ */ __name((message3) => {
|
|
@@ -54928,7 +55008,7 @@ var checkMailFindings = /* @__PURE__ */ __name((input) => {
|
|
|
54928
55008
|
}, "checkMailFindings");
|
|
54929
55009
|
var mailFindingFingerprint = /* @__PURE__ */ __name(({ id: _id, ...finding }) => findingHash(finding), "mailFindingFingerprint");
|
|
54930
55010
|
|
|
54931
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
55011
|
+
// 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/orders.js
|
|
54932
55012
|
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";
|
|
54933
55013
|
var orderOperationsOver = /* @__PURE__ */ __name((context) => {
|
|
54934
55014
|
const { database, now: now2 } = context;
|
|
@@ -55143,7 +55223,7 @@ var ordersStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
55143
55223
|
};
|
|
55144
55224
|
}, "ordersStoreOver");
|
|
55145
55225
|
|
|
55146
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
55226
|
+
// 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/mail-findings.js
|
|
55147
55227
|
var MAIL_EDITS = {
|
|
55148
55228
|
task: ["title", "type", "reason", "commitment", "project", "dueAt", "dueEvidence", "assignee", "assigneeEvidence"],
|
|
55149
55229
|
fact: ["statement", "type", "reason", "subject", "project"],
|
|
@@ -55632,7 +55712,7 @@ ${evidence.join("\n")}`, agent);
|
|
|
55632
55712
|
};
|
|
55633
55713
|
}, "mailFindingsStoreOver");
|
|
55634
55714
|
|
|
55635
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
55715
|
+
// 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/meeting-findings.js
|
|
55636
55716
|
var stale3 = /* @__PURE__ */ __name(() => {
|
|
55637
55717
|
throw new CliError("validation_error", "meeting findings changed since they were read; stage a new batch", {
|
|
55638
55718
|
reason: "meeting-findings.stale"
|
|
@@ -55845,7 +55925,7 @@ var meetingFindingsStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
55845
55925
|
};
|
|
55846
55926
|
}, "meetingFindingsStoreOver");
|
|
55847
55927
|
|
|
55848
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
55928
|
+
// 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/meeting-vectors.js
|
|
55849
55929
|
var RANK_BATCH = 512;
|
|
55850
55930
|
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";
|
|
55851
55931
|
var limitOf2 = /* @__PURE__ */ __name((value, name, max = 1e3) => {
|
|
@@ -56116,7 +56196,7 @@ var meetingVectorsOver = /* @__PURE__ */ __name((context) => ({
|
|
|
56116
56196
|
}
|
|
56117
56197
|
}), "meetingVectorsOver");
|
|
56118
56198
|
|
|
56119
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
56199
|
+
// 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/mention-sources.js
|
|
56120
56200
|
var OTHER_SOURCES = ["document", "note", "email"];
|
|
56121
56201
|
var TEXTS = {
|
|
56122
56202
|
document: "JOIN documents s ON mn.source_type = 'document' AND s.id = mn.source_id AND s.deleted_at IS NULL WHERE 1 ",
|
|
@@ -56217,7 +56297,7 @@ var sourceMentionStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
56217
56297
|
};
|
|
56218
56298
|
}, "sourceMentionStoreOver");
|
|
56219
56299
|
|
|
56220
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
56300
|
+
// 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/money-transactions.js
|
|
56221
56301
|
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";
|
|
56222
56302
|
var MAX_SPLITS = 100;
|
|
56223
56303
|
var transactionOperationsOver = /* @__PURE__ */ __name((context) => {
|
|
@@ -56451,11 +56531,11 @@ var transactionsStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
56451
56531
|
};
|
|
56452
56532
|
}, "transactionsStoreOver");
|
|
56453
56533
|
|
|
56454
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
56534
|
+
// 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/open-store.js
|
|
56455
56535
|
import { accessSync, constants, existsSync as existsSync2, mkdirSync as mkdirSync2, statSync as statSync2, writeFileSync as writeFileSync2 } from "node:fs";
|
|
56456
56536
|
import { dirname as dirname2 } from "node:path";
|
|
56457
56537
|
|
|
56458
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
56538
|
+
// 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/clients.js
|
|
56459
56539
|
import { readFileSync as readFileSync3 } from "node:fs";
|
|
56460
56540
|
var CLIENTS_SETTING = "clients";
|
|
56461
56541
|
var coreVersion = (() => {
|
|
@@ -56516,7 +56596,7 @@ var refusalAdvice = /* @__PURE__ */ __name((clients, command, schema) => {
|
|
|
56516
56596
|
return mover ? `${own} (${mover.command} ${mover.version} moved the store to schema ${schema})` : own;
|
|
56517
56597
|
}, "refusalAdvice");
|
|
56518
56598
|
|
|
56519
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
56599
|
+
// 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/migrations.generated.js
|
|
56520
56600
|
var GENERATED = [
|
|
56521
56601
|
{
|
|
56522
56602
|
"name": "20261010184427_initial",
|
|
@@ -57893,10 +57973,47 @@ WHERE json_type(params, '$.selection') = 'object';`
|
|
|
57893
57973
|
"CREATE TRIGGER crm_file_words_au AFTER UPDATE OF normalized_text ON crm_files\n WHEN old.normalized_text IS NOT new.normalized_text BEGIN\n DELETE FROM crm_file_words WHERE rowid = old.id;\n INSERT INTO crm_file_words (rowid, normalized_text)\n SELECT new.id, new.normalized_text WHERE new.normalized_text <> '';\nEND;",
|
|
57894
57974
|
"CREATE TRIGGER crm_file_words_ad AFTER DELETE ON crm_files BEGIN\n DELETE FROM crm_file_words WHERE rowid = old.id;\nEND;"
|
|
57895
57975
|
]
|
|
57976
|
+
},
|
|
57977
|
+
{
|
|
57978
|
+
"name": "20261117015456_version-69-conversation-readiness",
|
|
57979
|
+
"statements": [
|
|
57980
|
+
"CREATE TABLE `conversation_readiness` (\n `chat_id` integer NOT NULL,\n `model` text NOT NULL,\n `new_count` integer NOT NULL,\n `edited_count` integer NOT NULL,\n `deleted_count` integer NOT NULL,\n `chunks` integer NOT NULL,\n `embedded_count` integer NOT NULL,\n `current` integer NOT NULL,\n `stale` integer NOT NULL,\n `counted_at` integer NOT NULL,\n CONSTRAINT `conversation_readiness_pk` PRIMARY KEY(`chat_id`, `model`),\n CONSTRAINT `fk_conversation_readiness_chat_id_chats_id_fk` FOREIGN KEY (`chat_id`) REFERENCES `chats`(`id`) ON DELETE CASCADE\n);",
|
|
57981
|
+
"CREATE INDEX `conversation_readiness_by_model` ON `conversation_readiness` (`model`);"
|
|
57982
|
+
]
|
|
57983
|
+
},
|
|
57984
|
+
{
|
|
57985
|
+
"name": "20261117015457_version-69-conversation-readiness-triggers",
|
|
57986
|
+
"statements": [
|
|
57987
|
+
"-- A stored readiness row stays only while nothing it counts has changed; any such write drops it, and the next\n-- search counts that chat again.\nCREATE TRIGGER conversation_readiness_message_ai AFTER INSERT ON messages BEGIN\n DELETE FROM conversation_readiness WHERE chat_id = NEW.chat_id;\nEND;",
|
|
57988
|
+
"CREATE TRIGGER conversation_readiness_message_au AFTER UPDATE OF chat_id, deleted_at ON messages\nWHEN OLD.chat_id IS NOT NEW.chat_id OR OLD.deleted_at IS NOT NEW.deleted_at BEGIN\n DELETE FROM conversation_readiness WHERE chat_id IN (OLD.chat_id, NEW.chat_id);\nEND;",
|
|
57989
|
+
"CREATE TRIGGER conversation_readiness_message_ad AFTER DELETE ON messages BEGIN\n DELETE FROM conversation_readiness WHERE chat_id = OLD.chat_id;\nEND;",
|
|
57990
|
+
"CREATE TRIGGER conversation_readiness_revision_ai AFTER INSERT ON message_revisions BEGIN\n DELETE FROM conversation_readiness WHERE chat_id = (SELECT chat_id FROM messages WHERE id = NEW.message_id);\nEND;",
|
|
57991
|
+
"CREATE TRIGGER conversation_readiness_state_ai AFTER INSERT ON conversation_state BEGIN\n DELETE FROM conversation_readiness WHERE chat_id = NEW.chat_id;\nEND;",
|
|
57992
|
+
"CREATE TRIGGER conversation_readiness_state_au AFTER UPDATE ON conversation_state BEGIN\n DELETE FROM conversation_readiness WHERE chat_id IN (OLD.chat_id, NEW.chat_id);\nEND;",
|
|
57993
|
+
"-- A chat whose every chunk text already has a vector cannot gain from a new one: (model, content_hash) is unique.\nCREATE TRIGGER conversation_readiness_embedding_ai AFTER INSERT ON embeddings BEGIN\n DELETE FROM conversation_readiness WHERE model = NEW.model AND embedded_count < chunks;\nEND;",
|
|
57994
|
+
"CREATE TRIGGER conversation_readiness_embedding_ad AFTER DELETE ON embeddings BEGIN\n DELETE FROM conversation_readiness WHERE model = OLD.model AND embedded_count > 0;\nEND;"
|
|
57995
|
+
]
|
|
57996
|
+
},
|
|
57997
|
+
{
|
|
57998
|
+
"name": "20261117211410_version-70-tracker-items",
|
|
57999
|
+
"statements": [
|
|
58000
|
+
"CREATE TABLE `tracker_items` (\n `id` integer PRIMARY KEY,\n `account_id` integer NOT NULL,\n `kind` text NOT NULL,\n `external_id` text NOT NULL,\n `parent_id` text,\n `title` text NOT NULL,\n `title_folded` text NOT NULL,\n `body` text,\n `normalized_text` text NOT NULL,\n `data` text NOT NULL,\n `source_created_at` integer,\n `source_updated_at` integer,\n `archived_at` integer,\n `deleted_at` integer,\n `synced_at` integer NOT NULL,\n CONSTRAINT `fk_tracker_items_account_id_accounts_id_fk` FOREIGN KEY (`account_id`) REFERENCES `accounts`(`id`),\n CONSTRAINT `tracker_items_account_id_kind_external_id_unique` UNIQUE(`account_id`,`kind`,`external_id`)\n);",
|
|
58001
|
+
"CREATE INDEX `tracker_items_by_account_id_kind_parent_id` ON `tracker_items` (`account_id`,`kind`,`parent_id`);"
|
|
58002
|
+
]
|
|
58003
|
+
},
|
|
58004
|
+
{
|
|
58005
|
+
"name": "20261117211414_version-70-tracker-item-words",
|
|
58006
|
+
"statements": [
|
|
58007
|
+
"-- Words of a tracker item's title and text, rowid = tracker_items.id: issues, projects and comments found by any word.\nCREATE VIRTUAL TABLE tracker_item_words USING fts5(\n normalized_text,\n content = '', contentless_delete = 1,\n tokenize = 'unicode61 remove_diacritics 2', prefix = '3');",
|
|
58008
|
+
"CREATE VIRTUAL TABLE tracker_item_words_vocab USING fts5vocab(tracker_item_words, 'col');",
|
|
58009
|
+
"CREATE TRIGGER tracker_item_words_ai AFTER INSERT ON tracker_items WHEN new.normalized_text <> '' BEGIN\n INSERT INTO tracker_item_words (rowid, normalized_text) VALUES (new.id, new.normalized_text);\nEND;",
|
|
58010
|
+
"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
|
+
"CREATE TRIGGER tracker_item_words_ad AFTER DELETE ON tracker_items BEGIN\n DELETE FROM tracker_item_words WHERE rowid = old.id;\nEND;"
|
|
58012
|
+
]
|
|
57896
58013
|
}
|
|
57897
58014
|
];
|
|
57898
58015
|
|
|
57899
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
58016
|
+
// 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/rollback-copy.js
|
|
57900
58017
|
import { mkdirSync, rmSync, statfsSync, writeFileSync } from "node:fs";
|
|
57901
58018
|
import { basename, dirname, join as join3, parse } from "node:path";
|
|
57902
58019
|
var DERIVED = /(_fts|_words|_stems|_trigrams|_pending)$|^(embeddings|chunks|chunk_messages|mentions|involvements|search_terms)$|^vector_index/;
|
|
@@ -58129,7 +58246,7 @@ var rollBack2 = /* @__PURE__ */ __name((database, path) => {
|
|
|
58129
58246
|
return { ...result, foreignKeyViolations };
|
|
58130
58247
|
}, "rollBack");
|
|
58131
58248
|
|
|
58132
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
58249
|
+
// 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/manifest.js
|
|
58133
58250
|
var V31_TABLES = [
|
|
58134
58251
|
"accounts",
|
|
58135
58252
|
"account_identities",
|
|
@@ -58261,7 +58378,11 @@ var MANIFEST = [
|
|
|
58261
58378
|
{ name: "20261110233711_version-66-identity-name-trigger", version: 66, minCompatible: 56 },
|
|
58262
58379
|
{ name: "20261113154357_version-67-fact-removals-call-fields", version: 67, minCompatible: 56 },
|
|
58263
58380
|
{ name: "20261116204138_version-68-crm-files", version: 68, minCompatible: 56 },
|
|
58264
|
-
{ name: "20261116204204_version-68-crm-file-words", version: 68, minCompatible: 56 }
|
|
58381
|
+
{ name: "20261116204204_version-68-crm-file-words", version: 68, minCompatible: 56 },
|
|
58382
|
+
{ name: "20261117015456_version-69-conversation-readiness", version: 69, minCompatible: 56 },
|
|
58383
|
+
{ name: "20261117015457_version-69-conversation-readiness-triggers", version: 69, minCompatible: 56 },
|
|
58384
|
+
{ name: "20261117211410_version-70-tracker-items", version: 70, minCompatible: 56 },
|
|
58385
|
+
{ name: "20261117211414_version-70-tracker-item-words", version: 70, minCompatible: 56 }
|
|
58265
58386
|
];
|
|
58266
58387
|
var generatedMigrations = /* @__PURE__ */ __name((manifest = MANIFEST, generated = GENERATED) => {
|
|
58267
58388
|
const migrations = [];
|
|
@@ -58297,7 +58418,7 @@ var generatedMigrations = /* @__PURE__ */ __name((manifest = MANIFEST, generated
|
|
|
58297
58418
|
return migrations;
|
|
58298
58419
|
}, "generatedMigrations");
|
|
58299
58420
|
|
|
58300
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
58421
|
+
// 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/migrations.js
|
|
58301
58422
|
var MIGRATIONS = generatedMigrations();
|
|
58302
58423
|
var HISTORY = `CREATE TABLE IF NOT EXISTS schema_migrations (
|
|
58303
58424
|
version INTEGER PRIMARY KEY,
|
|
@@ -58394,7 +58515,7 @@ var migrate = /* @__PURE__ */ __name((database, { migrations = MIGRATIONS, now:
|
|
|
58394
58515
|
}
|
|
58395
58516
|
}, "migrate");
|
|
58396
58517
|
|
|
58397
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
58518
|
+
// 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/join-keys.js
|
|
58398
58519
|
var fillJoinKeys = /* @__PURE__ */ __name((database, { batch = 2e3 } = {}) => {
|
|
58399
58520
|
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 ?");
|
|
58400
58521
|
if (pending.get(0, 1) === void 0)
|
|
@@ -58416,7 +58537,7 @@ var fillJoinKeys = /* @__PURE__ */ __name((database, { batch = 2e3 } = {}) => {
|
|
|
58416
58537
|
}
|
|
58417
58538
|
}, "fillJoinKeys");
|
|
58418
58539
|
|
|
58419
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
58540
|
+
// 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/open.js
|
|
58420
58541
|
var openSqlite = /* @__PURE__ */ __name(async (path, { readOnly = false } = {}) => {
|
|
58421
58542
|
refuseOwnerStoreInTests(path);
|
|
58422
58543
|
const opened = "Bun" in globalThis ? await openUnderBun(path, readOnly) : await openUnderNode(path, readOnly);
|
|
@@ -58430,8 +58551,8 @@ var openSqlite = /* @__PURE__ */ __name(async (path, { readOnly = false } = {})
|
|
|
58430
58551
|
}, "openSqlite");
|
|
58431
58552
|
var openUnderNode = /* @__PURE__ */ __name(async (path, readOnly) => {
|
|
58432
58553
|
quietSqliteWarning();
|
|
58433
|
-
const { drizzle } = await import("./node-
|
|
58434
|
-
const { cacheOverNodeSqlite, nodeClient } = await import("./node-sqlite-
|
|
58554
|
+
const { drizzle } = await import("./node-HGCZGZ4R.js");
|
|
58555
|
+
const { cacheOverNodeSqlite, nodeClient } = await import("./node-sqlite-RKYSRKEB.js");
|
|
58435
58556
|
const client = await nodeClient(path, { readOnly });
|
|
58436
58557
|
try {
|
|
58437
58558
|
if (!readOnly)
|
|
@@ -58445,8 +58566,8 @@ var openUnderNode = /* @__PURE__ */ __name(async (path, readOnly) => {
|
|
|
58445
58566
|
}
|
|
58446
58567
|
}, "openUnderNode");
|
|
58447
58568
|
var openUnderBun = /* @__PURE__ */ __name(async (path, readOnly) => {
|
|
58448
|
-
const { bunClient, cacheOverBunSqlite } = await import("./bun-sqlite-
|
|
58449
|
-
const { drizzle } = await import("./bun-
|
|
58569
|
+
const { bunClient, cacheOverBunSqlite } = await import("./bun-sqlite-AGXGSF6D.js");
|
|
58570
|
+
const { drizzle } = await import("./bun-AJPJ4ZUN.js");
|
|
58450
58571
|
const client = await bunClient(path, readOnly ? { readonly: true, create: false } : void 0);
|
|
58451
58572
|
try {
|
|
58452
58573
|
if (!readOnly)
|
|
@@ -58460,7 +58581,7 @@ var openUnderBun = /* @__PURE__ */ __name(async (path, readOnly) => {
|
|
|
58460
58581
|
}
|
|
58461
58582
|
}, "openUnderBun");
|
|
58462
58583
|
|
|
58463
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
58584
|
+
// 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/payment-facts.js
|
|
58464
58585
|
var PAYMENT_FACTS_TO_MOVE = "payment_facts_to_move";
|
|
58465
58586
|
var paymentOf = /* @__PURE__ */ __name((metadata3) => {
|
|
58466
58587
|
try {
|
|
@@ -58528,7 +58649,7 @@ var movePaymentFacts = /* @__PURE__ */ __name((context) => {
|
|
|
58528
58649
|
});
|
|
58529
58650
|
}, "movePaymentFacts");
|
|
58530
58651
|
|
|
58531
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
58652
|
+
// 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/read-compatibility.js
|
|
58532
58653
|
var readCompatibility = /* @__PURE__ */ __name((database, command) => {
|
|
58533
58654
|
const ours = MIGRATIONS.at(-1)?.version ?? 0;
|
|
58534
58655
|
if (!database.prepare("SELECT 1 FROM sqlite_master WHERE type='table' AND name='schema_migrations'").get())
|
|
@@ -58546,7 +58667,7 @@ var assertReadCompatible = /* @__PURE__ */ __name((database, command) => {
|
|
|
58546
58667
|
throw new CliError("configuration_error", `The store needs schema ${MIGRATIONS.at(-1)?.version ?? 0} maintenance before a read-only open`);
|
|
58547
58668
|
}, "assertReadCompatible");
|
|
58548
58669
|
|
|
58549
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
58670
|
+
// 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/suggested-links.js
|
|
58550
58671
|
var SUGGESTED_LINKS_TO_MOVE = "suggested_links_to_move";
|
|
58551
58672
|
var proposerOf2 = /* @__PURE__ */ __name((provenance2) => {
|
|
58552
58673
|
if (provenance2?.startsWith("rule:"))
|
|
@@ -58592,7 +58713,7 @@ var moveSuggestedLinks = /* @__PURE__ */ __name((database, now2) => {
|
|
|
58592
58713
|
});
|
|
58593
58714
|
}, "moveSuggestedLinks");
|
|
58594
58715
|
|
|
58595
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
58716
|
+
// 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/test-accounts.js
|
|
58596
58717
|
var TEST_ACCOUNTS_TO_PURGE = "test_accounts_to_purge";
|
|
58597
58718
|
var TEST_PROVIDER = "chat";
|
|
58598
58719
|
var purgeTestAccounts = /* @__PURE__ */ __name((context, warn) => {
|
|
@@ -58613,7 +58734,7 @@ var purgeTestAccounts = /* @__PURE__ */ __name((context, warn) => {
|
|
|
58613
58734
|
}
|
|
58614
58735
|
}, "purgeTestAccounts");
|
|
58615
58736
|
|
|
58616
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
58737
|
+
// 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/open-store.js
|
|
58617
58738
|
var BACKFILL_ON_OPEN = 5e3;
|
|
58618
58739
|
var NOT_WRITABLE = /* @__PURE__ */ new Set(["EACCES", "EPERM", "EROFS"]);
|
|
58619
58740
|
var createWritable = /* @__PURE__ */ __name((file) => {
|
|
@@ -58725,7 +58846,7 @@ var openStoreContext = /* @__PURE__ */ __name(async (options = {}) => {
|
|
|
58725
58846
|
}
|
|
58726
58847
|
}, "openStoreContext");
|
|
58727
58848
|
|
|
58728
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
58849
|
+
// 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/products.js
|
|
58729
58850
|
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";
|
|
58730
58851
|
var productOperationsOver = /* @__PURE__ */ __name((context) => {
|
|
58731
58852
|
const { database, now: now2 } = context;
|
|
@@ -58833,13 +58954,13 @@ var productsStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
58833
58954
|
};
|
|
58834
58955
|
}, "productsStoreOver");
|
|
58835
58956
|
|
|
58836
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
58957
|
+
// 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/project-transfer/plan.js
|
|
58837
58958
|
import { createHash as createHash19 } from "node:crypto";
|
|
58838
58959
|
|
|
58839
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
58960
|
+
// 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/project-transfer/manifest.js
|
|
58840
58961
|
import { createHash as createHash18 } from "node:crypto";
|
|
58841
58962
|
|
|
58842
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
58963
|
+
// 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/project-transfer/schema.js
|
|
58843
58964
|
var text6 = /* @__PURE__ */ __name((max) => pipe(string(), minLength(1), maxLength(max)), "text");
|
|
58844
58965
|
var ref = text6(2048);
|
|
58845
58966
|
var timestamp2 = pipe(number(), safeInteger(), minValue(0));
|
|
@@ -58909,7 +59030,7 @@ var projectAnnotationsSchema = strictObject({
|
|
|
58909
59030
|
}))
|
|
58910
59031
|
});
|
|
58911
59032
|
|
|
58912
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
59033
|
+
// 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/project-transfer/manifest.js
|
|
58913
59034
|
var PROJECT_ANNOTATIONS_MAX_BYTES = 4 * 1024 * 1024;
|
|
58914
59035
|
var invalid9 = /* @__PURE__ */ __name((field4) => {
|
|
58915
59036
|
throw new CliError("validation_error", `invalid project annotations.${field4}`);
|
|
@@ -59042,7 +59163,7 @@ var projectAnnotationsFingerprint = /* @__PURE__ */ __name((json3) => {
|
|
|
59042
59163
|
return createHash18("sha256").update(JSON.stringify(normalized)).digest("hex");
|
|
59043
59164
|
}, "projectAnnotationsFingerprint");
|
|
59044
59165
|
|
|
59045
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
59166
|
+
// 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/project-transfer/plan.js
|
|
59046
59167
|
var hash = pipe(string(), regex(/^[a-f0-9]{64}$/));
|
|
59047
59168
|
var ref2 = pipe(string(), minLength(1), maxLength(2048));
|
|
59048
59169
|
var targetSchema = strictObject({
|
|
@@ -59149,7 +59270,7 @@ var planBoundProjectAnnotations = /* @__PURE__ */ __name((manifest, manifest_fin
|
|
|
59149
59270
|
}, "planBoundProjectAnnotations");
|
|
59150
59271
|
var planProjectAnnotations = /* @__PURE__ */ __name((json3, target, bindings) => planBoundProjectAnnotations(decodeProjectAnnotations(json3), projectAnnotationsFingerprint(json3), target, bindings), "planProjectAnnotations");
|
|
59151
59272
|
|
|
59152
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
59273
|
+
// 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/project-transfer/snapshot-model.js
|
|
59153
59274
|
import { createHash as createHash20 } from "node:crypto";
|
|
59154
59275
|
var text7 = /* @__PURE__ */ __name((max) => pipe(string(), minLength(1), maxLength(max)), "text");
|
|
59155
59276
|
var timestamp3 = pipe(number(), safeInteger(), minValue(0));
|
|
@@ -59243,7 +59364,7 @@ var projectAnnotationSnapshotFingerprint = /* @__PURE__ */ __name((json3) => {
|
|
|
59243
59364
|
})).digest("hex");
|
|
59244
59365
|
}, "projectAnnotationSnapshotFingerprint");
|
|
59245
59366
|
|
|
59246
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
59367
|
+
// 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/project-transfer/request.js
|
|
59247
59368
|
var projectAnnotationRequest = /* @__PURE__ */ __name((request, restore = false) => {
|
|
59248
59369
|
if (!request || typeof request !== "object" || Array.isArray(request))
|
|
59249
59370
|
throw new CliError("validation_error", "project annotation request is required");
|
|
@@ -59260,7 +59381,7 @@ var projectAnnotationRequest = /* @__PURE__ */ __name((request, restore = false)
|
|
|
59260
59381
|
return { snapshot: snapshot2, projectId: Number(request.project.slice(8)) };
|
|
59261
59382
|
}, "projectAnnotationRequest");
|
|
59262
59383
|
|
|
59263
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
59384
|
+
// 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/project-transfer/budget.js
|
|
59264
59385
|
var SnapshotBudget = class {
|
|
59265
59386
|
static {
|
|
59266
59387
|
__name(this, "SnapshotBudget");
|
|
@@ -59286,13 +59407,13 @@ var SnapshotBudget = class {
|
|
|
59286
59407
|
}
|
|
59287
59408
|
};
|
|
59288
59409
|
|
|
59289
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
59410
|
+
// 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/project-transfer/preview.js
|
|
59290
59411
|
import { createHash as createHash22 } from "node:crypto";
|
|
59291
59412
|
|
|
59292
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
59413
|
+
// 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/project-transfer/snapshot-plan.js
|
|
59293
59414
|
var planProjectAnnotationSnapshot = /* @__PURE__ */ __name((json3, target, bindings) => planBoundProjectAnnotations(decodeProjectAnnotationSnapshot(json3), projectAnnotationSnapshotFingerprint(json3), target, bindings), "planProjectAnnotationSnapshot");
|
|
59294
59415
|
|
|
59295
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
59416
|
+
// 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/project-transfer/sources.js
|
|
59296
59417
|
import { createHash as createHash21 } from "node:crypto";
|
|
59297
59418
|
var invalid11 = /* @__PURE__ */ __name(() => {
|
|
59298
59419
|
throw new CliError("configuration_error", "project snapshot has an unavailable or unsupported dependency");
|
|
@@ -59435,7 +59556,7 @@ var ProjectSnapshotSources = class {
|
|
|
59435
59556
|
}
|
|
59436
59557
|
};
|
|
59437
59558
|
|
|
59438
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
59559
|
+
// 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/project-transfer/snapshot.js
|
|
59439
59560
|
var unsupported = /* @__PURE__ */ __name(() => {
|
|
59440
59561
|
throw new CliError("configuration_error", "project snapshot has unsupported metadata, deletion or account scope");
|
|
59441
59562
|
}, "unsupported");
|
|
@@ -59613,7 +59734,7 @@ var projectAnnotationSnapshot = /* @__PURE__ */ __name((database, projectId2, bu
|
|
|
59613
59734
|
return { snapshot: snapshot2, read_bytes: budget.bytes, records: budget.records };
|
|
59614
59735
|
}), "projectAnnotationSnapshot");
|
|
59615
59736
|
|
|
59616
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
59737
|
+
// 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/project-transfer/preview.js
|
|
59617
59738
|
var previewAnnotationSnapshot = /* @__PURE__ */ __name((database, projectId2, manifest, bindings, budget) => read(database, () => {
|
|
59618
59739
|
const current2 = projectAnnotationSnapshot(database, projectId2, budget).snapshot;
|
|
59619
59740
|
const sources = new ProjectSnapshotSources(database, budget);
|
|
@@ -59675,7 +59796,7 @@ var previewAnnotationSnapshot = /* @__PURE__ */ __name((database, projectId2, ma
|
|
|
59675
59796
|
};
|
|
59676
59797
|
}), "previewAnnotationSnapshot");
|
|
59677
59798
|
|
|
59678
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
59799
|
+
// 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/project-transfer/records.js
|
|
59679
59800
|
var metadataOf2 = /* @__PURE__ */ __name((database, link3, to) => {
|
|
59680
59801
|
const provenance2 = link3.provenance === null ? {} : { provenance: link3.provenance };
|
|
59681
59802
|
if (link3.kind === "evidence" && to)
|
|
@@ -59742,7 +59863,7 @@ var restoreAnnotationRecords = /* @__PURE__ */ __name((database, projectId2, sna
|
|
|
59742
59863
|
return mappings;
|
|
59743
59864
|
}, "restoreAnnotationRecords");
|
|
59744
59865
|
|
|
59745
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
59866
|
+
// 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/project-transfer/store.js
|
|
59746
59867
|
var projectAnnotationStoreOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
59747
59868
|
async preview(request) {
|
|
59748
59869
|
const { snapshot: snapshot2, projectId: projectId2 } = projectAnnotationRequest(request);
|
|
@@ -59772,7 +59893,7 @@ var projectAnnotationStoreOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
|
59772
59893
|
}
|
|
59773
59894
|
}), "projectAnnotationStoreOver");
|
|
59774
59895
|
|
|
59775
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
59896
|
+
// 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/record-relations.js
|
|
59776
59897
|
var isDerived = /* @__PURE__ */ __name((role) => role.startsWith("fields."), "isDerived");
|
|
59777
59898
|
var recordRelationsOver = /* @__PURE__ */ __name(({ database }) => {
|
|
59778
59899
|
const sql2 = /* @__PURE__ */ __name((text8) => database.prepare(text8), "sql");
|
|
@@ -59843,7 +59964,7 @@ var recordRelationsOver = /* @__PURE__ */ __name(({ database }) => {
|
|
|
59843
59964
|
return { entityRef, relatedOf, storedRelations, relate, missingOf };
|
|
59844
59965
|
}, "recordRelationsOver");
|
|
59845
59966
|
|
|
59846
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
59967
|
+
// 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/record-remap.js
|
|
59847
59968
|
var recordRemapOver = /* @__PURE__ */ __name(({ database, now: now2 }) => {
|
|
59848
59969
|
const pointedAt = /* @__PURE__ */ __name((type, id2) => {
|
|
59849
59970
|
for (const { table, pointer } of pointerPairs(database))
|
|
@@ -59897,7 +60018,7 @@ var recordRemapOver = /* @__PURE__ */ __name(({ database, now: now2 }) => {
|
|
|
59897
60018
|
return { pointedAt, remap };
|
|
59898
60019
|
}, "recordRemapOver");
|
|
59899
60020
|
|
|
59900
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
60021
|
+
// 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/record-run.js
|
|
59901
60022
|
var runs = 0;
|
|
59902
60023
|
var PAGE = 500;
|
|
59903
60024
|
var recordRunOver = /* @__PURE__ */ __name((context, writes) => {
|
|
@@ -60110,7 +60231,7 @@ var waitingPointer = /* @__PURE__ */ __name((index2, missing4) => {
|
|
|
60110
60231
|
return pointerOf("records", index2, "fields", key2);
|
|
60111
60232
|
}, "waitingPointer");
|
|
60112
60233
|
|
|
60113
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
60234
|
+
// 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/record-matching.js
|
|
60114
60235
|
var valuesOf = /* @__PURE__ */ __name((value) => (Array.isArray(value) ? value : [value]).filter((one2) => typeof one2 === "string"), "valuesOf");
|
|
60115
60236
|
var SCHEME = /^(email|domain|tax-id:[a-z]{2}|registration:[a-z]{2})$/;
|
|
60116
60237
|
var ORG_EMAIL = "org-email";
|
|
@@ -60276,7 +60397,7 @@ var renameMade = /* @__PURE__ */ __name(({ database, now: now2 }, type, id2, nam
|
|
|
60276
60397
|
]);
|
|
60277
60398
|
}, "renameMade");
|
|
60278
60399
|
|
|
60279
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
60400
|
+
// 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/record-projectors-direct.js
|
|
60280
60401
|
var productFields = /* @__PURE__ */ __name((fields4) => ({
|
|
60281
60402
|
name: given(fields4, "name"),
|
|
60282
60403
|
unit: given(fields4, "unit"),
|
|
@@ -60399,7 +60520,7 @@ var DIRECT_PROJECTORS = {
|
|
|
60399
60520
|
lead: dealProjector("lead")
|
|
60400
60521
|
};
|
|
60401
60522
|
|
|
60402
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
60523
|
+
// 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/record-projectors-document.js
|
|
60403
60524
|
var TEXT_ONLY = { storage: "text", localPath: null };
|
|
60404
60525
|
var textOf7 = /* @__PURE__ */ __name(({ fields: fields4, externalId }) => {
|
|
60405
60526
|
const text8 = String(fields4.text ?? "");
|
|
@@ -60468,7 +60589,7 @@ var DOCUMENT_PROJECTORS = {
|
|
|
60468
60589
|
}
|
|
60469
60590
|
};
|
|
60470
60591
|
|
|
60471
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
60592
|
+
// 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/record-projectors-money.js
|
|
60472
60593
|
var allocatedByOthers = /* @__PURE__ */ __name((context, paymentId) => {
|
|
60473
60594
|
const importer = authorActor(context, IMPORTER).actor;
|
|
60474
60595
|
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;
|
|
@@ -60678,7 +60799,7 @@ var MONEY_PROJECTORS = {
|
|
|
60678
60799
|
}
|
|
60679
60800
|
};
|
|
60680
60801
|
|
|
60681
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
60802
|
+
// 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/record-projectors-phone.js
|
|
60682
60803
|
var CALLS_CALENDAR = "calls";
|
|
60683
60804
|
var importOnly = /* @__PURE__ */ __name((source2, type) => {
|
|
60684
60805
|
if (!isImportedProvider(source2.provider))
|
|
@@ -60853,7 +60974,7 @@ var PHONE_PROJECTORS = {
|
|
|
60853
60974
|
}
|
|
60854
60975
|
};
|
|
60855
60976
|
|
|
60856
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
60977
|
+
// 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/record-projectors.js
|
|
60857
60978
|
var RECORD_PROJECTORS = {
|
|
60858
60979
|
...MONEY_PROJECTORS,
|
|
60859
60980
|
...DIRECT_PROJECTORS,
|
|
@@ -60864,7 +60985,7 @@ var RECORD_PROJECTORS = {
|
|
|
60864
60985
|
project: null
|
|
60865
60986
|
};
|
|
60866
60987
|
|
|
60867
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
60988
|
+
// 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/record-settling.js
|
|
60868
60989
|
var recordSettlingOver = /* @__PURE__ */ __name(({ database }, finance) => {
|
|
60869
60990
|
const sql2 = /* @__PURE__ */ __name((text8) => database.prepare(text8), "sql");
|
|
60870
60991
|
const freeOn = /* @__PURE__ */ __name((invoice, payment) => {
|
|
@@ -60926,7 +61047,7 @@ var recordSettlingOver = /* @__PURE__ */ __name(({ database }, finance) => {
|
|
|
60926
61047
|
return { settle, checkShares };
|
|
60927
61048
|
}, "recordSettlingOver");
|
|
60928
61049
|
|
|
60929
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
61050
|
+
// 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/record-stamps.js
|
|
60930
61051
|
import { createHash as createHash23 } from "node:crypto";
|
|
60931
61052
|
var VOLATILE = /* @__PURE__ */ new Set(["id", "created_at", "updated_at", "metadata"]);
|
|
60932
61053
|
var content = /* @__PURE__ */ __name((row2) => row2 === void 0 ? null : Object.fromEntries(Object.entries(row2).filter(([column2]) => !VOLATILE.has(column2))), "content");
|
|
@@ -60942,7 +61063,7 @@ var importStampsOver = /* @__PURE__ */ __name(({ database }) => {
|
|
|
60942
61063
|
return { stamp, untouched };
|
|
60943
61064
|
}, "importStampsOver");
|
|
60944
61065
|
|
|
60945
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
61066
|
+
// 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/subscriptions.js
|
|
60946
61067
|
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";
|
|
60947
61068
|
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";
|
|
60948
61069
|
var PRICE_REF = /^subscription_price:([1-9]\d{0,15})$/;
|
|
@@ -61179,7 +61300,7 @@ var subscriptionsStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
61179
61300
|
};
|
|
61180
61301
|
}, "subscriptionsStoreOver");
|
|
61181
61302
|
|
|
61182
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
61303
|
+
// 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/wallets.js
|
|
61183
61304
|
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";
|
|
61184
61305
|
var SIGNED = "CASE t.direction WHEN 'in' THEN t.amount ELSE -t.amount END";
|
|
61185
61306
|
var walletOperationsOver = /* @__PURE__ */ __name((context) => {
|
|
@@ -61304,7 +61425,7 @@ var walletsStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
61304
61425
|
};
|
|
61305
61426
|
}, "walletsStoreOver");
|
|
61306
61427
|
|
|
61307
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
61428
|
+
// 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/record-writes.js
|
|
61308
61429
|
var specOf = /* @__PURE__ */ __name((type) => RECORD_TYPES[type], "specOf");
|
|
61309
61430
|
var unsettled = /* @__PURE__ */ __name((fields4, relations) => recordFingerprint(fields4, relations.filter((relation) => !AMOUNT_ROLES.includes(relation.role))), "unsettled");
|
|
61310
61431
|
var tableOf2 = /* @__PURE__ */ __name((type) => typeof type === "string" && Object.hasOwn(DECIDED_TABLES, type) ? DECIDED_TABLES[type] : void 0, "tableOf");
|
|
@@ -61563,7 +61684,7 @@ var recordWritesOver = /* @__PURE__ */ __name((context) => {
|
|
|
61563
61684
|
return { writeOne, project: project2, completeDependents, entityRef, missingOf: relations.missingOf };
|
|
61564
61685
|
}, "recordWritesOver");
|
|
61565
61686
|
|
|
61566
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
61687
|
+
// 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/records.js
|
|
61567
61688
|
var LIMIT = 1e3;
|
|
61568
61689
|
var iso16 = /* @__PURE__ */ __name((value) => new Date(Number(value)).toISOString(), "iso");
|
|
61569
61690
|
var checkLimit = /* @__PURE__ */ __name((limit) => {
|
|
@@ -61787,7 +61908,7 @@ var recordStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
61787
61908
|
};
|
|
61788
61909
|
}, "recordStoreOver");
|
|
61789
61910
|
|
|
61790
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
61911
|
+
// 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/templates.js
|
|
61791
61912
|
var templateOf = /* @__PURE__ */ __name((row2) => ({
|
|
61792
61913
|
key: row2.key,
|
|
61793
61914
|
channel: row2.channel,
|
|
@@ -61842,7 +61963,182 @@ var storedTemplateBodies = /* @__PURE__ */ __name((database, key2, language) =>
|
|
|
61842
61963
|
return Object.fromEntries(rows.map((row2) => [row2.channel, row2.body]));
|
|
61843
61964
|
}, "storedTemplateBodies");
|
|
61844
61965
|
|
|
61845
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
61966
|
+
// 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/domain/tracker.js
|
|
61967
|
+
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
|
+
var trackerBodyOf = /* @__PURE__ */ __name((kind3, record3) => kind3 === "comment" ? record3.body : kind3 === "issue" || kind3 === "project" ? record3.description : null, "trackerBodyOf");
|
|
61969
|
+
var trackerParentOf = /* @__PURE__ */ __name((kind3, record3) => kind3 === "comment" ? record3.issue : kind3 === "state" || kind3 === "label" ? record3.team : kind3 === "issue" ? record3.team : null, "trackerParentOf");
|
|
61970
|
+
|
|
61971
|
+
// 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/tracker.js
|
|
61972
|
+
var MOST2 = 500;
|
|
61973
|
+
var itemOf = /* @__PURE__ */ __name((row2) => ({
|
|
61974
|
+
kind: String(row2.kind),
|
|
61975
|
+
record: JSON.parse(String(row2.data)),
|
|
61976
|
+
deletedAt: row2.deleted_at == null ? null : Number(row2.deleted_at),
|
|
61977
|
+
syncedAt: Number(row2.synced_at)
|
|
61978
|
+
}), "itemOf");
|
|
61979
|
+
var COLUMNS10 = "t.kind, t.data, t.deleted_at, t.synced_at";
|
|
61980
|
+
var definedOnly = /* @__PURE__ */ __name((record3) => Object.fromEntries(Object.entries(record3).filter(([, value]) => value !== void 0)), "definedOnly");
|
|
61981
|
+
var resetTrackerItemWords = /* @__PURE__ */ __name((database) => {
|
|
61982
|
+
if (!database.prepare("SELECT 1 FROM sqlite_master WHERE name = 'tracker_item_words'").get())
|
|
61983
|
+
return 0;
|
|
61984
|
+
return write(database, () => {
|
|
61985
|
+
const update2 = database.prepare("UPDATE tracker_items SET normalized_text = ? WHERE id = ?");
|
|
61986
|
+
for (const row2 of database.prepare("SELECT id, title, body, normalized_text FROM tracker_items").all()) {
|
|
61987
|
+
const normalized = normalize([row2.title, row2.body].filter(Boolean).join("\n"));
|
|
61988
|
+
if (normalized !== row2.normalized_text)
|
|
61989
|
+
update2.run(normalized, Number(row2.id));
|
|
61990
|
+
}
|
|
61991
|
+
database.exec("INSERT INTO tracker_item_words (tracker_item_words) VALUES ('delete-all')");
|
|
61992
|
+
const { changes } = database.prepare("INSERT INTO tracker_item_words (rowid, normalized_text) SELECT id, normalized_text FROM tracker_items WHERE normalized_text <> ''").run();
|
|
61993
|
+
return Number(changes);
|
|
61994
|
+
});
|
|
61995
|
+
}, "resetTrackerItemWords");
|
|
61996
|
+
var ISSUE_FIELDS = { assignee: "assignee", project: "project", state: "state" };
|
|
61997
|
+
var trackerStoreOver = /* @__PURE__ */ __name((context) => {
|
|
61998
|
+
const { database } = context;
|
|
61999
|
+
const save2 = /* @__PURE__ */ __name((key2, kind3, records2, now2) => write(database, () => {
|
|
62000
|
+
const accountId = accountPk(context, key2);
|
|
62001
|
+
const stored4 = database.prepare("SELECT data FROM tracker_items WHERE account_id = ? AND kind = ? AND external_id = ?");
|
|
62002
|
+
const upsert2 = database.prepare("INSERT INTO tracker_items (account_id, kind, external_id, parent_id, title, title_folded, body, normalized_text, data, source_created_at, source_updated_at, archived_at, deleted_at, synced_at) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, NULL, ?) ON CONFLICT (account_id, kind, external_id) DO UPDATE SET parent_id = excluded.parent_id, title = excluded.title, title_folded = excluded.title_folded, body = excluded.body, normalized_text = excluded.normalized_text, data = excluded.data, source_created_at = excluded.source_created_at, source_updated_at = excluded.source_updated_at, archived_at = excluded.archived_at, deleted_at = NULL, synced_at = excluded.synced_at");
|
|
62003
|
+
for (const record3 of records2) {
|
|
62004
|
+
const before2 = stored4.get(accountId, kind3, record3.externalId);
|
|
62005
|
+
const merged2 = {
|
|
62006
|
+
...before2 ? JSON.parse(String(before2.data)) : {},
|
|
62007
|
+
...definedOnly(record3)
|
|
62008
|
+
};
|
|
62009
|
+
const title2 = trackerTitleOf(kind3, merged2);
|
|
62010
|
+
const body2 = trackerBodyOf(kind3, merged2) ?? null;
|
|
62011
|
+
upsert2.run(accountId, kind3, merged2.externalId, trackerParentOf(kind3, merged2) ?? null, title2, fold(title2), body2, normalize([title2, body2].filter(Boolean).join("\n")), JSON.stringify(merged2), merged2.createdAt ?? null, merged2.updatedAt ?? null, merged2.archivedAt ?? null, now2);
|
|
62012
|
+
}
|
|
62013
|
+
return records2.length;
|
|
62014
|
+
}), "save");
|
|
62015
|
+
const removeUnlisted = /* @__PURE__ */ __name((key2, kind3, listed, before2, now2, { dryRun = false } = {}) => {
|
|
62016
|
+
const accountId = findAccountPk(context, key2);
|
|
62017
|
+
if (accountId === void 0)
|
|
62018
|
+
return 0;
|
|
62019
|
+
const keep2 = new Set(listed);
|
|
62020
|
+
return write(database, () => {
|
|
62021
|
+
const mark = database.prepare("UPDATE tracker_items SET deleted_at = ? WHERE id = ?");
|
|
62022
|
+
let removed = 0;
|
|
62023
|
+
for (const row2 of database.prepare("SELECT id, external_id FROM tracker_items WHERE account_id = ? AND kind = ? AND deleted_at IS NULL AND synced_at < ?").all(accountId, kind3, before2)) {
|
|
62024
|
+
if (keep2.has(String(row2.external_id)))
|
|
62025
|
+
continue;
|
|
62026
|
+
if (!dryRun)
|
|
62027
|
+
mark.run(now2, Number(row2.id));
|
|
62028
|
+
removed += 1;
|
|
62029
|
+
}
|
|
62030
|
+
return removed;
|
|
62031
|
+
});
|
|
62032
|
+
}, "removeUnlisted");
|
|
62033
|
+
const list2 = /* @__PURE__ */ __name((key2, kind3, filter = {}) => {
|
|
62034
|
+
const accountId = findAccountPk(context, key2);
|
|
62035
|
+
if (accountId === void 0)
|
|
62036
|
+
return { items: [], hasMore: false };
|
|
62037
|
+
const limit = Math.min(Math.max(filter.limit ?? 100, 1), MOST2);
|
|
62038
|
+
const params = [accountId, kind3];
|
|
62039
|
+
let sql2 = `SELECT ${COLUMNS10} FROM tracker_items t WHERE t.account_id = ? AND t.kind = ? AND t.deleted_at IS NULL`;
|
|
62040
|
+
if (!filter.archived)
|
|
62041
|
+
sql2 += " AND t.archived_at IS NULL";
|
|
62042
|
+
if (filter.parent !== void 0) {
|
|
62043
|
+
sql2 += " AND t.parent_id = ?";
|
|
62044
|
+
params.push(filter.parent);
|
|
62045
|
+
}
|
|
62046
|
+
for (const [name, field4] of Object.entries(ISSUE_FIELDS)) {
|
|
62047
|
+
const value = filter[name];
|
|
62048
|
+
if (value === void 0)
|
|
62049
|
+
continue;
|
|
62050
|
+
if (value === null)
|
|
62051
|
+
sql2 += ` AND json_extract(t.data, '$.${field4}') IS NULL`;
|
|
62052
|
+
else {
|
|
62053
|
+
sql2 += ` AND json_extract(t.data, '$.${field4}') = ?`;
|
|
62054
|
+
params.push(value);
|
|
62055
|
+
}
|
|
62056
|
+
}
|
|
62057
|
+
if (filter.label !== void 0) {
|
|
62058
|
+
sql2 += " AND EXISTS (SELECT 1 FROM json_each(t.data, '$.labels') l WHERE l.value = ?)";
|
|
62059
|
+
params.push(filter.label);
|
|
62060
|
+
}
|
|
62061
|
+
if (filter.stateTypes?.length) {
|
|
62062
|
+
sql2 += ` AND EXISTS (SELECT 1 FROM tracker_items s WHERE s.account_id = t.account_id AND s.kind = 'state' AND s.external_id = json_extract(t.data, '$.state') AND json_extract(s.data, '$.type') IN (${filter.stateTypes.map(() => "?").join(", ")}))`;
|
|
62063
|
+
for (const type of filter.stateTypes)
|
|
62064
|
+
params.push(type);
|
|
62065
|
+
}
|
|
62066
|
+
sql2 += " ORDER BY coalesce(t.source_updated_at, t.synced_at) DESC, t.id DESC LIMIT ? OFFSET ?";
|
|
62067
|
+
params.push(limit + 1, filter.offset ?? 0);
|
|
62068
|
+
const rows = database.prepare(sql2).all(...params);
|
|
62069
|
+
return { items: rows.slice(0, limit).map((row2) => itemOf(row2)), hasMore: rows.length > limit };
|
|
62070
|
+
}, "list");
|
|
62071
|
+
const find2 = /* @__PURE__ */ __name(({ words: words4, anyWord = false, exact = false, accounts: accounts2, kinds: kinds2, limit, offset = 0 }) => {
|
|
62072
|
+
const match = matchOf2(words4, anyWord, exact);
|
|
62073
|
+
if (!match)
|
|
62074
|
+
return { items: [], hasMore: false };
|
|
62075
|
+
const most = Math.min(Math.max(limit ?? 100, 1), MOST2);
|
|
62076
|
+
const scoped2 = accounts2?.map((one2) => findAccountPk(context, one2)).filter((one2) => one2 !== void 0) ?? [];
|
|
62077
|
+
if (accounts2 !== void 0 && !scoped2.length)
|
|
62078
|
+
return { items: [], hasMore: false };
|
|
62079
|
+
const params = [match];
|
|
62080
|
+
let sql2 = `SELECT ${COLUMNS10}, t.title, t.body, a.provider, a.external_id AS account FROM tracker_items t JOIN accounts a ON a.id = t.account_id JOIN (SELECT rowid, rank FROM tracker_item_words WHERE tracker_item_words MATCH ?) w ON w.rowid = t.id WHERE t.deleted_at IS NULL`;
|
|
62081
|
+
if (accounts2 !== void 0) {
|
|
62082
|
+
sql2 += ` AND t.account_id IN (${scoped2.map(() => "?").join(", ")})`;
|
|
62083
|
+
for (const id2 of scoped2)
|
|
62084
|
+
params.push(id2);
|
|
62085
|
+
}
|
|
62086
|
+
if (kinds2?.length) {
|
|
62087
|
+
sql2 += ` AND t.kind IN (${kinds2.map(() => "?").join(", ")})`;
|
|
62088
|
+
for (const kind3 of kinds2)
|
|
62089
|
+
params.push(kind3);
|
|
62090
|
+
}
|
|
62091
|
+
sql2 += " ORDER BY w.rank, t.source_updated_at DESC, t.id DESC LIMIT ? OFFSET ?";
|
|
62092
|
+
params.push(most + 1, offset);
|
|
62093
|
+
const rows = database.prepare(sql2).all(...params);
|
|
62094
|
+
return {
|
|
62095
|
+
items: rows.slice(0, most).map((row2) => ({
|
|
62096
|
+
account: { provider: String(row2.provider), account: String(row2.account) },
|
|
62097
|
+
item: itemOf(row2),
|
|
62098
|
+
excerpt: excerptOf([row2.title, row2.body].filter(Boolean).join("\n"), words4)
|
|
62099
|
+
})),
|
|
62100
|
+
hasMore: rows.length > most
|
|
62101
|
+
};
|
|
62102
|
+
}, "find");
|
|
62103
|
+
return {
|
|
62104
|
+
save: /* @__PURE__ */ __name(async (key2, kind3, records2, now2) => save2(key2, kind3, records2, now2), "save"),
|
|
62105
|
+
removeUnlisted: /* @__PURE__ */ __name(async (key2, kind3, listed, before2, now2, options) => removeUnlisted(key2, kind3, listed, before2, now2, options), "removeUnlisted"),
|
|
62106
|
+
get: /* @__PURE__ */ __name(async (key2, kind3, externalId) => {
|
|
62107
|
+
const accountId = findAccountPk(context, key2);
|
|
62108
|
+
if (accountId === void 0)
|
|
62109
|
+
return void 0;
|
|
62110
|
+
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 ? itemOf(row2) : void 0;
|
|
62112
|
+
}, "get"),
|
|
62113
|
+
issueByKey: /* @__PURE__ */ __name(async (key2, issueKey) => {
|
|
62114
|
+
const accountId = findAccountPk(context, key2);
|
|
62115
|
+
if (accountId === void 0)
|
|
62116
|
+
return void 0;
|
|
62117
|
+
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 ? itemOf(row2) : void 0;
|
|
62119
|
+
}, "issueByKey"),
|
|
62120
|
+
list: /* @__PURE__ */ __name(async (key2, kind3, filter) => list2(key2, kind3, filter), "list"),
|
|
62121
|
+
find: /* @__PURE__ */ __name(async (search2) => find2(search2), "find"),
|
|
62122
|
+
count: /* @__PURE__ */ __name(async (key2, kind3) => {
|
|
62123
|
+
const accountId = findAccountPk(context, key2);
|
|
62124
|
+
if (accountId === void 0)
|
|
62125
|
+
return 0;
|
|
62126
|
+
return Number(database.prepare("SELECT count(*) AS n FROM tracker_items WHERE account_id = ? AND kind = ? AND deleted_at IS NULL").get(accountId, kind3)?.n ?? 0);
|
|
62127
|
+
}, "count"),
|
|
62128
|
+
people: /* @__PURE__ */ __name(async (key2, users) => {
|
|
62129
|
+
const accountId = findAccountPk(context, key2);
|
|
62130
|
+
if (accountId === void 0 || users.length === 0)
|
|
62131
|
+
return [];
|
|
62132
|
+
return database.prepare(`SELECT u.external_id AS user, p.id AS person, p.name AS name FROM tracker_items u JOIN identities i ON i.email IS NOT NULL AND lower(i.email) = lower(json_extract(u.data, '$.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.kind = 'user' AND u.external_id IN (${users.map(() => "?").join(", ")}) GROUP BY u.external_id HAVING count(DISTINCT p.id) = 1 ORDER BY u.external_id`).all(accountId, ...users).map((row2) => ({
|
|
62133
|
+
user: String(row2.user),
|
|
62134
|
+
person: `person:${String(row2.person)}`,
|
|
62135
|
+
name: row2.name == null ? null : String(row2.name)
|
|
62136
|
+
}));
|
|
62137
|
+
}, "people")
|
|
62138
|
+
};
|
|
62139
|
+
}, "trackerStoreOver");
|
|
62140
|
+
|
|
62141
|
+
// 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/store-errors.js
|
|
61846
62142
|
var refusalOf2 = /* @__PURE__ */ __name((error) => error instanceof Error && error.name === "DrizzleQueryError" && error.cause instanceof CliError ? error.cause : error, "refusalOf");
|
|
61847
62143
|
var wrapped2 = /* @__PURE__ */ new WeakMap();
|
|
61848
62144
|
var storeErrors = /* @__PURE__ */ __name((area) => {
|
|
@@ -61877,7 +62173,7 @@ var storeErrors = /* @__PURE__ */ __name((area) => {
|
|
|
61877
62173
|
return proxy;
|
|
61878
62174
|
}, "storeErrors");
|
|
61879
62175
|
|
|
61880
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
62176
|
+
// 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/ranges.js
|
|
61881
62177
|
var markRange = /* @__PURE__ */ __name(({ orm, now: now2 }, chatKey, from2, to) => {
|
|
61882
62178
|
const touching = and(eq(syncRanges.chatId, chatKey), lte(syncRanges.fromKey, to + 1), gte(syncRanges.toKey, from2 - 1));
|
|
61883
62179
|
let merged2 = { from: from2, to };
|
|
@@ -61890,7 +62186,7 @@ var markRange = /* @__PURE__ */ __name(({ orm, now: now2 }, chatKey, from2, to)
|
|
|
61890
62186
|
}, "markRange");
|
|
61891
62187
|
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");
|
|
61892
62188
|
|
|
61893
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
62189
|
+
// 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/task-analysis-marks.js
|
|
61894
62190
|
var prefixOf2 = /* @__PURE__ */ __name(({ provider, account }) => `task_analysis:${provider}:${account}:`, "prefixOf");
|
|
61895
62191
|
var markOf = /* @__PURE__ */ __name((prefix, row2) => ({
|
|
61896
62192
|
chatId: String(row2.key).slice(prefix.length),
|
|
@@ -61911,7 +62207,7 @@ var setTaskAnalysisMark = /* @__PURE__ */ __name((database, account, { chatId, c
|
|
|
61911
62207
|
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);
|
|
61912
62208
|
}, "setTaskAnalysisMark");
|
|
61913
62209
|
|
|
61914
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
62210
|
+
// 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/task-rule-stops.js
|
|
61915
62211
|
var keyOf6 = /* @__PURE__ */ __name(({ provider, account }) => `task_rules_until:${provider}:${account}`, "keyOf");
|
|
61916
62212
|
var taskRulesStop = /* @__PURE__ */ __name((database, account) => {
|
|
61917
62213
|
const row2 = database.prepare("SELECT value FROM store_settings WHERE key = ?").get(keyOf6(account));
|
|
@@ -61921,7 +62217,7 @@ var setTaskRulesStop = /* @__PURE__ */ __name((database, account, until, now2) =
|
|
|
61921
62217
|
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);
|
|
61922
62218
|
}, "setTaskRulesStop");
|
|
61923
62219
|
|
|
61924
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
62220
|
+
// 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/sync.js
|
|
61925
62221
|
var syncStoreOver = /* @__PURE__ */ __name((context) => {
|
|
61926
62222
|
const { database } = context;
|
|
61927
62223
|
const { accountPk: accountPk2, findAccountPk: findAccountPk2, chatKeyOf, chatPkFor: chatPkFor2, identityPk: identityPk2, writeMembers: writeMembers2, writeState: writeState2 } = keysOver(context);
|
|
@@ -61980,7 +62276,7 @@ var syncStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
61980
62276
|
};
|
|
61981
62277
|
}, "syncStoreOver");
|
|
61982
62278
|
|
|
61983
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
62279
|
+
// 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/tags.js
|
|
61984
62280
|
var tagsStoreOver = /* @__PURE__ */ __name((context) => {
|
|
61985
62281
|
const { database } = context;
|
|
61986
62282
|
return {
|
|
@@ -62002,7 +62298,7 @@ var tagsStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
62002
62298
|
};
|
|
62003
62299
|
}, "tagsStoreOver");
|
|
62004
62300
|
|
|
62005
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
62301
|
+
// 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/image-chunks.js
|
|
62006
62302
|
var IS_IMAGE = sql`(a.kind = 'photo' OR a.mime LIKE 'image/%')`;
|
|
62007
62303
|
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
|
|
62008
62304
|
WHERE chat_id = ${chatKey} AND deleted_at IS NULL AND trim(text) <> '' AND id <> ${messagePk}
|
|
@@ -62129,7 +62425,7 @@ var savePictureChunks = /* @__PURE__ */ __name(({ orm, now: now2, database }, ac
|
|
|
62129
62425
|
dropUnusedVectors(database, released.map(({ hash: hash2 }) => hash2));
|
|
62130
62426
|
}, "savePictureChunks");
|
|
62131
62427
|
|
|
62132
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
62428
|
+
// 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/message-chunks.js
|
|
62133
62429
|
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,
|
|
62134
62430
|
EXISTS (SELECT 1 FROM embeddings v WHERE v.model = ${model} AND v.content_hash = k.content_hash) AS embedded
|
|
62135
62431
|
FROM messages m
|
|
@@ -62218,7 +62514,7 @@ var nearestMessages = /* @__PURE__ */ __name((context, accountPk2, { limit, quer
|
|
|
62218
62514
|
return plain2(best(found2));
|
|
62219
62515
|
}, "nearestMessages");
|
|
62220
62516
|
|
|
62221
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
62517
|
+
// 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/vectors.js
|
|
62222
62518
|
var accountVectorsOver = /* @__PURE__ */ __name((context, mail) => {
|
|
62223
62519
|
const { database } = context;
|
|
62224
62520
|
const { findAccountPk: findAccountPk2, findChatPk: findChatPk2, chatKeyOf } = keysOver(context);
|
|
@@ -62442,9 +62738,11 @@ var accountVectorsOver = /* @__PURE__ */ __name((context, mail) => {
|
|
|
62442
62738
|
if (accountPk2 === void 0)
|
|
62443
62739
|
return [];
|
|
62444
62740
|
const chats2 = chatId === void 0 ? builtChats(context, accountPk2, searchableOnly) : [{ chatKey: chatKeyOf(key2, chatId), id: chatId }].flatMap(({ chatKey, id: id2 }) => chatKey === void 0 ? [] : [{ chatKey, id: id2 }]);
|
|
62445
|
-
|
|
62446
|
-
|
|
62447
|
-
|
|
62741
|
+
const since = dataVersion(context);
|
|
62742
|
+
const counted = [];
|
|
62743
|
+
const found2 = chats2.map(({ chatKey, id: id2 }) => {
|
|
62744
|
+
const found3 = readiness(context, chatKey, model, counted);
|
|
62745
|
+
return found3 ? { chatId: id2, ...found3, builtAt: new Date(found3.builtAt).toISOString() } : {
|
|
62448
62746
|
chatId: id2,
|
|
62449
62747
|
builtAt: null,
|
|
62450
62748
|
algorithmVersion: null,
|
|
@@ -62452,6 +62750,8 @@ var accountVectorsOver = /* @__PURE__ */ __name((context, mail) => {
|
|
|
62452
62750
|
vectors: { chunks: 0, embedded: 0, current: 0, stale: 0, missing: 0 }
|
|
62453
62751
|
};
|
|
62454
62752
|
});
|
|
62753
|
+
saveReadiness(context, model, counted, since);
|
|
62754
|
+
return found2;
|
|
62455
62755
|
}, "readiness"),
|
|
62456
62756
|
unbuiltGroups: /* @__PURE__ */ __name(async (key2) => {
|
|
62457
62757
|
const accountPk2 = findAccountPk2(key2);
|
|
@@ -62477,7 +62777,7 @@ var vectorsStoreOver = /* @__PURE__ */ __name((context, keyed) => ({
|
|
|
62477
62777
|
vectorCounts: /* @__PURE__ */ __name(async (models) => vectorCounts(context, models), "vectorCounts")
|
|
62478
62778
|
}), "vectorsStoreOver");
|
|
62479
62779
|
|
|
62480
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
62780
|
+
// 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/store-tables.js
|
|
62481
62781
|
import { existsSync as existsSync3, readFileSync as readFileSync4 } from "node:fs";
|
|
62482
62782
|
import { dirname as dirname3, join as join4 } from "node:path";
|
|
62483
62783
|
var BOOKKEEPING2 = ["schema_migrations", "store_settings"];
|
|
@@ -62565,10 +62865,10 @@ var lastBackup = /* @__PURE__ */ __name((path) => {
|
|
|
62565
62865
|
}
|
|
62566
62866
|
}, "lastBackup");
|
|
62567
62867
|
|
|
62568
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
62868
|
+
// 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/providers.js
|
|
62569
62869
|
var registerProvider2 = /* @__PURE__ */ __name((store, entry2) => store.accounts.registerProvider(entry2), "registerProvider");
|
|
62570
62870
|
|
|
62571
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
62871
|
+
// 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/store-contents.js
|
|
62572
62872
|
var COUNTED_TABLES = [
|
|
62573
62873
|
"accounts",
|
|
62574
62874
|
"chats",
|
|
@@ -62653,7 +62953,7 @@ var storeContents = /* @__PURE__ */ __name((database) => {
|
|
|
62653
62953
|
};
|
|
62654
62954
|
}, "storeContents");
|
|
62655
62955
|
|
|
62656
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
62956
|
+
// 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/store.js
|
|
62657
62957
|
var openStore = /* @__PURE__ */ __name(async (options = {}) => {
|
|
62658
62958
|
const context = await openStoreContext(options);
|
|
62659
62959
|
try {
|
|
@@ -62724,6 +63024,7 @@ var storeOver = /* @__PURE__ */ __name((context) => {
|
|
|
62724
63024
|
const transactions = once3(() => transactionsStoreOver(context));
|
|
62725
63025
|
const crm = once3(() => crmCopiesOver(context, accountPeopleOver(context)));
|
|
62726
63026
|
const crmFiles2 = once3(() => crmFilesOver(context));
|
|
63027
|
+
const tracker = once3(() => trackerStoreOver(context));
|
|
62727
63028
|
const relations = once3(() => relationsStoreOver(context));
|
|
62728
63029
|
const decisionRequests2 = once3(() => decisionRequestStoreOver(context));
|
|
62729
63030
|
const templates2 = once3(() => templateStoreOver(context));
|
|
@@ -62869,6 +63170,9 @@ var storeOver = /* @__PURE__ */ __name((context) => {
|
|
|
62869
63170
|
get crm() {
|
|
62870
63171
|
return crm();
|
|
62871
63172
|
},
|
|
63173
|
+
get tracker() {
|
|
63174
|
+
return tracker();
|
|
63175
|
+
},
|
|
62872
63176
|
get crmFiles() {
|
|
62873
63177
|
return crmFiles2();
|
|
62874
63178
|
},
|
|
@@ -63043,11 +63347,6 @@ export {
|
|
|
63043
63347
|
ADDED_KINDS,
|
|
63044
63348
|
addedSourceKeyOf,
|
|
63045
63349
|
baseSettingKey,
|
|
63046
|
-
dayIn2 as dayIn,
|
|
63047
|
-
MINUTE,
|
|
63048
|
-
YEAR,
|
|
63049
|
-
readMoment,
|
|
63050
|
-
aheadOf,
|
|
63051
63350
|
viewerSql,
|
|
63052
63351
|
seenBy,
|
|
63053
63352
|
crmIdentityId,
|
|
@@ -63059,6 +63358,7 @@ export {
|
|
|
63059
63358
|
CRM_LINK_MODES,
|
|
63060
63359
|
COMPANY_TYPE_MEANINGS,
|
|
63061
63360
|
CRM_SCOPES,
|
|
63361
|
+
CRM_FILE_LIMITS,
|
|
63062
63362
|
crmSettingKey,
|
|
63063
63363
|
parseCrmSetting,
|
|
63064
63364
|
parseCrmSettingValue,
|
|
@@ -63107,6 +63407,7 @@ export {
|
|
|
63107
63407
|
previewAnnotationSnapshot,
|
|
63108
63408
|
waitingPointer,
|
|
63109
63409
|
storedTemplateBodies,
|
|
63410
|
+
resetTrackerItemWords,
|
|
63110
63411
|
readStoreTables,
|
|
63111
63412
|
fileFacts,
|
|
63112
63413
|
registerProvider2 as registerProvider,
|