@wirecat/tg-cli 0.134.0 → 0.135.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin/tg.js +2 -2
- package/dist/bundle/{adapter-Y4IXTXAG.js → adapter-OHJF6PB5.js} +67 -67
- package/dist/bundle/agent-QPF2KU4I.js +37 -0
- package/dist/bundle/{all-profiles-SUGID6CX.js → all-profiles-LQ73BIFB.js} +10 -10
- package/dist/bundle/{anthropic-4QKTXT4B.js → anthropic-YYBMT2HD.js} +5 -5
- package/dist/bundle/{app-server-TPOD6LIJ.js → app-server-HV4C4CSA.js} +61 -61
- package/dist/bundle/{bot-api-KBESP422.js → bot-api-URQXWMVR.js} +67 -67
- package/dist/bundle/{bot-history-3EORA23G.js → bot-history-FRLCHPDQ.js} +23 -23
- package/dist/bundle/{bun-FL76M4M2.js → bun-J3ML43BO.js} +2 -2
- package/dist/bundle/{bun-sqlite-H37OSTAJ.js → bun-sqlite-ZNB2B2DL.js} +6 -6
- package/dist/bundle/{chunk-JXEO5EIN.js → chunk-24G3SEXH.js} +2 -2
- package/dist/bundle/{chunk-JWLODUN3.js → chunk-27F6QBPY.js} +14 -14
- package/dist/bundle/{chunk-XVRLD3LN.js → chunk-2OFCIF2W.js} +2 -2
- package/dist/bundle/{chunk-4S2DHHJM.js → chunk-2U7XA4IH.js} +1 -1
- package/dist/bundle/{chunk-HD7DV5B2.js → chunk-4CLSIEWN.js} +35 -35
- package/dist/bundle/{chunk-PRM7GKBV.js → chunk-5CEKH6R6.js} +7 -7
- package/dist/bundle/{chunk-Z77R76S2.js → chunk-5WEEK65F.js} +1 -1
- package/dist/bundle/{chunk-3O25FAPA.js → chunk-6VWVYPH2.js} +1 -1
- package/dist/bundle/{chunk-CNGNR4CY.js → chunk-6WS474NQ.js} +6 -6
- package/dist/bundle/{chunk-L4PNDW4S.js → chunk-7GWOGEWJ.js} +6 -6
- package/dist/bundle/{chunk-HETHFOHC.js → chunk-AMRMU23L.js} +16 -3
- package/dist/bundle/{chunk-M323L5SG.js → chunk-B2UXNYCD.js} +13 -13
- package/dist/bundle/{chunk-2GT563YH.js → chunk-B4ZMFU5I.js} +2 -2
- package/dist/bundle/{chunk-JWNSG5GI.js → chunk-BFKPMG5T.js} +1 -1
- package/dist/bundle/{chunk-ZC7OEYDX.js → chunk-BQSODAU3.js} +1 -1
- package/dist/bundle/{chunk-YHTSJMZ5.js → chunk-BXUMZWMN.js} +565 -477
- package/dist/bundle/{chunk-DG35TQ6P.js → chunk-E2VIO7RY.js} +3 -3
- package/dist/bundle/{chunk-H3TLAYGY.js → chunk-F5FOS64B.js} +4 -4
- package/dist/bundle/{chunk-PK5WEGPJ.js → chunk-GCUFGDKE.js} +2 -2
- package/dist/bundle/{chunk-YPJCURT6.js → chunk-GUERS64O.js} +2 -2
- package/dist/bundle/{chunk-ZW2N2GI2.js → chunk-HILS2UL7.js} +12 -12
- package/dist/bundle/{chunk-XS4EE7MO.js → chunk-IOJOLV25.js} +14 -14
- package/dist/bundle/{chunk-XLNV3U6N.js → chunk-JBS4VPAX.js} +3 -3
- package/dist/bundle/{chunk-2JWY7CXJ.js → chunk-K5QGBYDL.js} +4 -4
- package/dist/bundle/{chunk-ANBI3OXK.js → chunk-KKXF6TSS.js} +1 -1
- package/dist/bundle/{chunk-UTTEAOJ3.js → chunk-L2ZQDTDU.js} +1 -1
- package/dist/bundle/{chunk-XZ6XEAJP.js → chunk-LFPUW7DR.js} +15 -15
- package/dist/bundle/{chunk-L47PFECD.js → chunk-LGYATGQI.js} +7 -7
- package/dist/bundle/{chunk-JCDD5T3A.js → chunk-MA27675E.js} +2 -2
- package/dist/bundle/{chunk-NUD4CBHK.js → chunk-MDI7554C.js} +3 -3
- package/dist/bundle/{chunk-VH4J7IIS.js → chunk-MMZ4QAKJ.js} +1 -1
- package/dist/bundle/{chunk-FR4Y5CGW.js → chunk-MOPBEBVS.js} +4 -4
- package/dist/bundle/{chunk-TZCFJJEU.js → chunk-MPRXUTIK.js} +2 -2
- package/dist/bundle/{chunk-K5FK6WWN.js → chunk-N7F5KT6U.js} +1 -1
- package/dist/bundle/{chunk-CSXCCK6J.js → chunk-NBP6LXSY.js} +2 -2
- package/dist/bundle/{chunk-PCBVSHKD.js → chunk-NP46ZKQW.js} +4 -4
- package/dist/bundle/{chunk-TI5U6AUT.js → chunk-NRSJXUUO.js} +26 -26
- package/dist/bundle/{chunk-4R2ZJGFF.js → chunk-NVWZ7S3I.js} +578 -451
- package/dist/bundle/{chunk-W2QSDPG6.js → chunk-OBIMTRA7.js} +3 -3
- package/dist/bundle/{chunk-O3QBO6NW.js → chunk-OQJURSRL.js} +17 -17
- package/dist/bundle/{chunk-V6G4LTXU.js → chunk-OU3WN4YH.js} +3 -3
- package/dist/bundle/{chunk-VNJRWFHP.js → chunk-PBK2ECXT.js} +1 -1
- package/dist/bundle/{chunk-3ZNO27UE.js → chunk-PHAFT2BO.js} +1 -1
- package/dist/bundle/{chunk-3QQWTP77.js → chunk-PKIGE4NE.js} +2 -2
- package/dist/bundle/{chunk-CA7DY2YU.js → chunk-QBRQLOZA.js} +3 -3
- package/dist/bundle/{chunk-NYEVPAF2.js → chunk-QD4MTOI7.js} +61 -61
- package/dist/bundle/{chunk-WGGUKQE7.js → chunk-QHQ52UMF.js} +75 -31
- package/dist/bundle/{chunk-6UNLEQA5.js → chunk-R2G3MWEF.js} +19 -19
- package/dist/bundle/{chunk-TKWYXM7L.js → chunk-RCEP5OXD.js} +7 -7
- package/dist/bundle/{chunk-7GGDCQJ5.js → chunk-RHJ2VGHV.js} +8 -8
- package/dist/bundle/{chunk-SPXNI53Z.js → chunk-RXBKVNOK.js} +23 -10
- package/dist/bundle/{chunk-WPXVJGSL.js → chunk-RZ7POTFA.js} +3 -3
- package/dist/bundle/{chunk-OJSPB4LA.js → chunk-S7PIM4GG.js} +2 -2
- package/dist/bundle/{chunk-JHZJBNDO.js → chunk-SIDGH56R.js} +2 -2
- package/dist/bundle/{chunk-RVA3CRSY.js → chunk-SRMELB6Q.js} +12 -12
- package/dist/bundle/{chunk-IJ7R2WMK.js → chunk-SVPNU7PD.js} +4 -4
- package/dist/bundle/{chunk-GIGZTI74.js → chunk-TB2MG6PE.js} +938 -710
- package/dist/bundle/{chunk-J5RB4ASI.js → chunk-UN5TH2CG.js} +28 -13
- package/dist/bundle/{chunk-PZ2ZFPGO.js → chunk-V3ZWYMXT.js} +1 -1
- package/dist/bundle/{chunk-ITJ7DGNA.js → chunk-VFU25P57.js} +4 -4
- package/dist/bundle/{chunk-AYWST6NA.js → chunk-VJEMCJPL.js} +35 -35
- package/dist/bundle/{chunk-AHVWZDXO.js → chunk-VK2NDTBS.js} +72 -57
- package/dist/bundle/{chunk-CDKXZLMP.js → chunk-W6A2OZ3C.js} +164 -158
- package/dist/bundle/{chunk-EXMAWEHC.js → chunk-WDI6LA4X.js} +2 -2
- package/dist/bundle/{chunk-O4ZOQJ6W.js → chunk-WTGRQGQL.js} +15 -8
- package/dist/bundle/{chunk-JAL443BH.js → chunk-WUCTF2XE.js} +9 -9
- package/dist/bundle/{chunk-HEZK4W3U.js → chunk-WZCRCCOZ.js} +6 -6
- package/dist/bundle/{chunk-4X6BX3XP.js → chunk-XB6O445X.js} +6 -6
- package/dist/bundle/{chunk-PRI2XTM7.js → chunk-XKFES4EM.js} +8 -8
- package/dist/bundle/{chunk-6DJJVFSG.js → chunk-YBUX6EAK.js} +6 -6
- package/dist/bundle/{chunk-77E7Q4EQ.js → chunk-YMRL7MYS.js} +7 -7
- package/dist/bundle/{chunk-6MEHKUN6.js → chunk-Z6M6NZUX.js} +1 -1
- package/dist/bundle/{chunk-QYRK4XXH.js → chunk-ZCDRXKCR.js} +13 -13
- package/dist/bundle/{chunk-MMDFPBFZ.js → chunk-ZJ3S4S6H.js} +6 -6
- package/dist/bundle/{chunk-3PG6QVQZ.js → chunk-ZL7TJXFL.js} +10 -10
- package/dist/bundle/{chunk-MXA3FU2R.js → chunk-ZMBVZWUW.js} +1 -1
- package/dist/bundle/{chunk-MUV73B5A.js → chunk-ZMTASSIB.js} +7 -7
- package/dist/bundle/{chunk-6DGVK5KS.js → chunk-ZQ5ERQHO.js} +2 -2
- package/dist/bundle/{chunk-FR3ATU5I.js → chunk-ZWVDXVG3.js} +4 -4
- package/dist/bundle/command-contract-K4MU32K6.js +37 -0
- package/dist/bundle/{command-server-entry-WQAE5UGU.js → command-server-entry-XP6BVJIK.js} +27 -27
- package/dist/bundle/{decode-2J2DOVGV.js → decode-TUB45ALX.js} +5 -5
- package/dist/bundle/{dispatch-IZ2TP5GW.js → dispatch-ICPUKMEG.js} +8 -8
- package/dist/bundle/{echarts-GFIIHZ4U.js → echarts-HJ7D7XTM.js} +2 -2
- package/dist/bundle/{embed-AGOXADHW.js → embed-4QDN36YF.js} +6 -6
- package/dist/bundle/{embedder-PCIXGM2Y.js → embedder-Q7ID2LEG.js} +9 -9
- package/dist/bundle/{entry-HUQXUV52.js → entry-Z6VRZP7F.js} +9 -9
- package/dist/bundle/{failure-JSRHZ2S6.js → failure-PEPNEEK7.js} +2 -2
- package/dist/bundle/{first-run-2LXN7B33.js → first-run-GKBEHAAX.js} +12 -12
- package/dist/bundle/first-screen-IA3ONZ75.js +37 -0
- package/dist/bundle/{instructions-RSLTJVFJ.js → instructions-26ZXYYMY.js} +1 -1
- package/dist/bundle/{mcp-MMENCB7I.js → mcp-KGWT6TGO.js} +2 -2
- package/dist/bundle/meeting-combined-KUV2HP52.js +23 -0
- package/dist/bundle/{meeting-model-SI77WMMK.js → meeting-model-JB7X4CA3.js} +11 -11
- package/dist/bundle/{meeting-semantic-WRXWUR4M.js → meeting-semantic-MQNUVG33.js} +6 -6
- package/dist/bundle/{node-5XGMCUGQ.js → node-RIANITAT.js} +2 -2
- package/dist/bundle/{node-sqlite-ES7SQSIC.js → node-sqlite-I2P26Z3S.js} +7 -7
- package/dist/bundle/{oauth-QFM4Y6N7.js → oauth-GFMJL2ZZ.js} +7 -7
- package/dist/bundle/{open-2MD2DKGQ.js → open-CWVYEFNN.js} +5 -5
- package/dist/bundle/{openai-6TMKJKYO.js → openai-PQLK7YTJ.js} +15 -15
- package/dist/bundle/{process-VA2DP7MY.js → process-P4D4KFWE.js} +1 -1
- package/dist/bundle/{program-K3SLEA42.js → program-MF4QZJKH.js} +70 -70
- package/dist/bundle/{prompt-VZSPCE6E.js → prompt-JWIOYU53.js} +5 -5
- package/dist/bundle/{proxy-transport-OJU2EOOC.js → proxy-transport-DWY6ABVT.js} +5 -5
- package/dist/bundle/{recognize-LH3ZZEIL.js → recognize-IPJL4CQZ.js} +4 -4
- package/dist/bundle/{remote-JNW5HN2I.js → remote-DVY6F6YO.js} +9 -9
- package/dist/bundle/{rerank-P23UJMII.js → rerank-XSPWLBIO.js} +7 -7
- package/dist/bundle/{serve-VSLLMILH.js → serve-AJAVEH2M.js} +9 -9
- package/dist/bundle/server-GGXUR5BZ.js +78 -0
- package/dist/bundle/{server-FBRRRKCS.js → server-GII7NIKF.js} +53 -53
- package/dist/bundle/{sqlite-runtime-LWATDAAU.js → sqlite-runtime-KFDYJTUO.js} +6 -6
- package/dist/bundle/{state-3AFJL2EL.js → state-76OJSCQC.js} +6 -6
- package/dist/bundle/{store-6TLYL2VU.js → store-2KJS4YMH.js} +18 -18
- package/dist/bundle/{store-PEXV5DNA.js → store-FBP2J23G.js} +20 -20
- package/dist/bundle/store-maintenance-command-NUWOUZ62.js +65 -0
- package/dist/bundle/surface-EGSHCISG.js +64 -0
- package/dist/bundle/tg.js +13 -13
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +3 -3
- package/skills/tg-cli/SKILL.md +5 -4
- package/skills/tg-cli/references/search.md +2 -2
- package/dist/bundle/agent-G7VHOJMS.js +0 -37
- package/dist/bundle/command-contract-LEFXJAA3.js +0 -37
- package/dist/bundle/first-screen-VUE6RCSF.js +0 -37
- package/dist/bundle/meeting-combined-PBNPHOM3.js +0 -23
- package/dist/bundle/server-TA4QP7PG.js +0 -78
- package/dist/bundle/store-maintenance-command-IYJLUQ5X.js +0 -65
- package/dist/bundle/surface-L4VY4WFG.js +0 -64
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
sameOrdinaryFile,
|
|
9
9
|
syncDirectory,
|
|
10
10
|
writeFileAtomic
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-B2UXNYCD.js";
|
|
12
12
|
import {
|
|
13
13
|
anyOfTerms,
|
|
14
14
|
isFunctionWord,
|
|
@@ -19,25 +19,25 @@ import {
|
|
|
19
19
|
questionText,
|
|
20
20
|
resolveMeetingSelection,
|
|
21
21
|
words
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-ZL7TJXFL.js";
|
|
23
23
|
import {
|
|
24
24
|
WIRECAT_TOOLS
|
|
25
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-ZMBVZWUW.js";
|
|
26
26
|
import {
|
|
27
27
|
isNewer,
|
|
28
28
|
updateCommand
|
|
29
|
-
} from "./chunk-
|
|
29
|
+
} from "./chunk-ZWVDXVG3.js";
|
|
30
30
|
import {
|
|
31
31
|
LIST_QUERY_GUIDE,
|
|
32
32
|
capability,
|
|
33
33
|
dateWindow,
|
|
34
34
|
momentOf
|
|
35
|
-
} from "./chunk-
|
|
35
|
+
} from "./chunk-ZCDRXKCR.js";
|
|
36
36
|
import {
|
|
37
37
|
localOnly,
|
|
38
38
|
refuseOffComputer,
|
|
39
39
|
remoteKey
|
|
40
|
-
} from "./chunk-
|
|
40
|
+
} from "./chunk-WUCTF2XE.js";
|
|
41
41
|
import {
|
|
42
42
|
Unzip,
|
|
43
43
|
UnzipInflate,
|
|
@@ -48,7 +48,7 @@ import {
|
|
|
48
48
|
placedText,
|
|
49
49
|
runEmbedders,
|
|
50
50
|
textModelsDirectory
|
|
51
|
-
} from "./chunk-
|
|
51
|
+
} from "./chunk-ZJ3S4S6H.js";
|
|
52
52
|
import {
|
|
53
53
|
AGENDA_COLUMNS,
|
|
54
54
|
BUSINESS_FIND_MAX,
|
|
@@ -116,7 +116,7 @@ import {
|
|
|
116
116
|
rankingQuestion,
|
|
117
117
|
threadConversation,
|
|
118
118
|
withoutField
|
|
119
|
-
} from "./chunk-
|
|
119
|
+
} from "./chunk-NVWZ7S3I.js";
|
|
120
120
|
import {
|
|
121
121
|
FIELD_VERSION,
|
|
122
122
|
MESSAGE_PARSING,
|
|
@@ -133,21 +133,21 @@ import {
|
|
|
133
133
|
searchError,
|
|
134
134
|
validateAst,
|
|
135
135
|
validateFields
|
|
136
|
-
} from "./chunk-
|
|
136
|
+
} from "./chunk-WTGRQGQL.js";
|
|
137
137
|
import {
|
|
138
138
|
DEFAULT_STEMMERS,
|
|
139
139
|
createStemmer,
|
|
140
140
|
cutsDeep
|
|
141
|
-
} from "./chunk-
|
|
141
|
+
} from "./chunk-XKFES4EM.js";
|
|
142
142
|
import {
|
|
143
143
|
fold,
|
|
144
144
|
normalize
|
|
145
|
-
} from "./chunk-
|
|
145
|
+
} from "./chunk-PHAFT2BO.js";
|
|
146
146
|
import {
|
|
147
147
|
MINUTE,
|
|
148
148
|
YEAR,
|
|
149
149
|
aheadOf
|
|
150
|
-
} from "./chunk-
|
|
150
|
+
} from "./chunk-OBIMTRA7.js";
|
|
151
151
|
import {
|
|
152
152
|
EmptyAnswer,
|
|
153
153
|
MAX_MODEL_IMAGE_BYTES,
|
|
@@ -156,7 +156,7 @@ import {
|
|
|
156
156
|
range,
|
|
157
157
|
systemFor,
|
|
158
158
|
validateImages
|
|
159
|
-
} from "./chunk-
|
|
159
|
+
} from "./chunk-MOPBEBVS.js";
|
|
160
160
|
import {
|
|
161
161
|
CEILING_KEY,
|
|
162
162
|
DEFAULT_IMAGE_MODEL,
|
|
@@ -183,14 +183,14 @@ import {
|
|
|
183
183
|
stops,
|
|
184
184
|
tagging,
|
|
185
185
|
task
|
|
186
|
-
} from "./chunk-
|
|
186
|
+
} from "./chunk-W6A2OZ3C.js";
|
|
187
187
|
import {
|
|
188
188
|
MESSENGER_CHANGE_REFUSAL,
|
|
189
189
|
ancestorValue,
|
|
190
190
|
envName,
|
|
191
191
|
readOnlyLockOf,
|
|
192
192
|
readOnlyRefusal
|
|
193
|
-
} from "./chunk-
|
|
193
|
+
} from "./chunk-S7PIM4GG.js";
|
|
194
194
|
import {
|
|
195
195
|
CustomTextModelShape,
|
|
196
196
|
DEFAULT_RERANK_MODEL,
|
|
@@ -204,18 +204,18 @@ import {
|
|
|
204
204
|
textModels,
|
|
205
205
|
vectorModelKey,
|
|
206
206
|
writeTextModelsSection
|
|
207
|
-
} from "./chunk-
|
|
207
|
+
} from "./chunk-WZCRCCOZ.js";
|
|
208
208
|
import {
|
|
209
209
|
PLAIN_HTTP_REFUSED,
|
|
210
210
|
endpoint,
|
|
211
211
|
endpointFetch,
|
|
212
212
|
modelAddressAllowed,
|
|
213
213
|
onThisComputer
|
|
214
|
-
} from "./chunk-
|
|
214
|
+
} from "./chunk-XB6O445X.js";
|
|
215
215
|
import {
|
|
216
216
|
installFiles,
|
|
217
217
|
megabytes
|
|
218
|
-
} from "./chunk-
|
|
218
|
+
} from "./chunk-K5QGBYDL.js";
|
|
219
219
|
import {
|
|
220
220
|
CRM_KINDS,
|
|
221
221
|
DEAL_KINDS,
|
|
@@ -258,21 +258,21 @@ import {
|
|
|
258
258
|
sourceOf3 as sourceOf2,
|
|
259
259
|
typedCommand,
|
|
260
260
|
withAttempt
|
|
261
|
-
} from "./chunk-
|
|
261
|
+
} from "./chunk-4CLSIEWN.js";
|
|
262
262
|
import {
|
|
263
263
|
isCliFailure,
|
|
264
264
|
sqliteCode
|
|
265
|
-
} from "./chunk-
|
|
265
|
+
} from "./chunk-RZ7POTFA.js";
|
|
266
266
|
import {
|
|
267
267
|
normalizeTag
|
|
268
|
-
} from "./chunk-
|
|
268
|
+
} from "./chunk-MA27675E.js";
|
|
269
269
|
import {
|
|
270
270
|
DEFAULT_TASK_CATEGORIES,
|
|
271
271
|
FALLBACK_CATEGORY,
|
|
272
272
|
readSharedSection,
|
|
273
273
|
sharedConfigPath,
|
|
274
274
|
writeSharedSection
|
|
275
|
-
} from "./chunk-
|
|
275
|
+
} from "./chunk-YMRL7MYS.js";
|
|
276
276
|
import {
|
|
277
277
|
OPERATORS_BY_TYPE,
|
|
278
278
|
READ_BUDGET_EXCEEDED,
|
|
@@ -296,11 +296,11 @@ import {
|
|
|
296
296
|
validateQuery,
|
|
297
297
|
walkQuery,
|
|
298
298
|
windowOf
|
|
299
|
-
} from "./chunk-
|
|
299
|
+
} from "./chunk-QD4MTOI7.js";
|
|
300
300
|
import {
|
|
301
301
|
storePath,
|
|
302
302
|
wirecatDirectory
|
|
303
|
-
} from "./chunk-
|
|
303
|
+
} from "./chunk-2OFCIF2W.js";
|
|
304
304
|
import {
|
|
305
305
|
Credentials,
|
|
306
306
|
logRecordOf,
|
|
@@ -308,7 +308,7 @@ import {
|
|
|
308
308
|
realSleep,
|
|
309
309
|
resolvePaths,
|
|
310
310
|
writeSecurely
|
|
311
|
-
} from "./chunk-
|
|
311
|
+
} from "./chunk-R2G3MWEF.js";
|
|
312
312
|
import {
|
|
313
313
|
array,
|
|
314
314
|
boolean,
|
|
@@ -340,7 +340,7 @@ import {
|
|
|
340
340
|
trim,
|
|
341
341
|
union,
|
|
342
342
|
unknown
|
|
343
|
-
} from "./chunk-
|
|
343
|
+
} from "./chunk-RXBKVNOK.js";
|
|
344
344
|
import {
|
|
345
345
|
importFrom,
|
|
346
346
|
resolveFrom
|
|
@@ -350,7 +350,7 @@ import {
|
|
|
350
350
|
isCliError,
|
|
351
351
|
singleLine,
|
|
352
352
|
visibleControls
|
|
353
|
-
} from "./chunk-
|
|
353
|
+
} from "./chunk-GCUFGDKE.js";
|
|
354
354
|
import {
|
|
355
355
|
__commonJS,
|
|
356
356
|
__name,
|
|
@@ -16966,7 +16966,7 @@ var require_lib3 = __commonJS({
|
|
|
16966
16966
|
}
|
|
16967
16967
|
});
|
|
16968
16968
|
|
|
16969
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
16969
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/conversations/link.js
|
|
16970
16970
|
var RULES_VERSION = 6;
|
|
16971
16971
|
var LOOK_BACK = 50;
|
|
16972
16972
|
var SAME_SENDER_WITHIN = 10;
|
|
@@ -17024,8 +17024,8 @@ var mentionLinks = /* @__PURE__ */ __name((message, window2, handles) => {
|
|
|
17024
17024
|
var sameSenderLink = /* @__PURE__ */ __name((message, window2) => {
|
|
17025
17025
|
if (message.senderId === null)
|
|
17026
17026
|
return [];
|
|
17027
|
-
const
|
|
17028
|
-
const target2 = latest(window2.slice(-SAME_SENDER_WITHIN), (candidate) => candidate.senderId === message.senderId && sameThread(candidate, message) &&
|
|
17027
|
+
const at2 = Date.parse(message.timestamp);
|
|
17028
|
+
const target2 = latest(window2.slice(-SAME_SENDER_WITHIN), (candidate) => candidate.senderId === message.senderId && sameThread(candidate, message) && at2 - Date.parse(candidate.timestamp) <= SAME_SENDER_MS);
|
|
17029
17029
|
return target2 ? [link(message, target2.id, "rule", "same_sender", 0.5, "same-sender-v2")] : [];
|
|
17030
17030
|
}, "sameSenderLink");
|
|
17031
17031
|
var mentioned = /* @__PURE__ */ __name((text3, handles) => {
|
|
@@ -17064,10 +17064,10 @@ var latest = /* @__PURE__ */ __name((window2, matches) => {
|
|
|
17064
17064
|
var sameThread = /* @__PURE__ */ __name((a, b) => a.threadId === b.threadId, "sameThread");
|
|
17065
17065
|
var link = /* @__PURE__ */ __name((message, parentId, source, kind2, confidence, method) => ({ messageId: message.id, parentId, source, kind: kind2, confidence, method }), "link");
|
|
17066
17066
|
|
|
17067
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
17067
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/ports/traits.js
|
|
17068
17068
|
var syncsOneChat = /* @__PURE__ */ __name((messenger) => messenger.history !== "store" || messenger.historyOnDemand === true, "syncsOneChat");
|
|
17069
17069
|
|
|
17070
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
17070
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/sends/upload.js
|
|
17071
17071
|
import { openAsBlob, realpathSync } from "node:fs";
|
|
17072
17072
|
import { open, stat } from "node:fs/promises";
|
|
17073
17073
|
import { basename, dirname, extname, isAbsolute, relative, resolve, sep } from "node:path";
|
|
@@ -17302,15 +17302,15 @@ var readStickerFile = /* @__PURE__ */ __name(async (path2, maxBytes, read) => {
|
|
|
17302
17302
|
return { name, source };
|
|
17303
17303
|
}, "readStickerFile");
|
|
17304
17304
|
|
|
17305
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
17305
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/sends/send-id.js
|
|
17306
17306
|
import { randomBytes } from "node:crypto";
|
|
17307
17307
|
var newSendId = /* @__PURE__ */ __name(() => randomBytes(8).readBigInt64BE().toString(), "newSendId");
|
|
17308
17308
|
var newOperationId = newSendId;
|
|
17309
17309
|
|
|
17310
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
17310
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/cli/bot/api-input.js
|
|
17311
17311
|
import { readFileSync } from "node:fs";
|
|
17312
17312
|
|
|
17313
|
-
// node_modules/.pnpm/@wirecat+cli-base@0.
|
|
17313
|
+
// node_modules/.pnpm/@wirecat+cli-base@0.126.1_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/codegen/names.js
|
|
17314
17314
|
var pascal = /* @__PURE__ */ __name((text3) => text3.split(/[^A-Za-z0-9]+/).filter(Boolean).map((word) => word[0]?.toUpperCase() + word.slice(1)).join(""), "pascal");
|
|
17315
17315
|
var GLOBALS = /* @__PURE__ */ new Set([
|
|
17316
17316
|
"Array",
|
|
@@ -17346,7 +17346,7 @@ var identifier = /* @__PURE__ */ __name((id3) => {
|
|
|
17346
17346
|
return GLOBALS.has(name) ? `Api${name}` : name;
|
|
17347
17347
|
}, "identifier");
|
|
17348
17348
|
|
|
17349
|
-
// node_modules/.pnpm/@wirecat+cli-base@0.
|
|
17349
|
+
// node_modules/.pnpm/@wirecat+cli-base@0.126.1_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/codegen/sign-in.js
|
|
17350
17350
|
var BEARER = { in: "header", name: "authorization", value: /* @__PURE__ */ __name((token) => `Bearer ${token}`, "value") };
|
|
17351
17351
|
var signInPlace = /* @__PURE__ */ __name((scheme) => {
|
|
17352
17352
|
if (scheme.type === "apiKey") {
|
|
@@ -17379,7 +17379,7 @@ var signInRequirements = /* @__PURE__ */ __name((operation, document) => {
|
|
|
17379
17379
|
return requirements?.some((one) => Object.keys(one).length > 0) ? requirements : void 0;
|
|
17380
17380
|
}, "signInRequirements");
|
|
17381
17381
|
|
|
17382
|
-
// node_modules/.pnpm/@wirecat+cli-base@0.
|
|
17382
|
+
// node_modules/.pnpm/@wirecat+cli-base@0.126.1_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/codegen/graphql.js
|
|
17383
17383
|
var graphqlDocument = /* @__PURE__ */ __name((binding, selection = binding.selection) => {
|
|
17384
17384
|
const variables = Object.entries(binding.variables);
|
|
17385
17385
|
const declared = variables.length ? `(${variables.map(([name, type]) => `$${name}: ${type}`).join(", ")})` : "";
|
|
@@ -17388,7 +17388,7 @@ var graphqlDocument = /* @__PURE__ */ __name((binding, selection = binding.selec
|
|
|
17388
17388
|
return `${binding.operation} ${binding.field[0]?.toUpperCase()}${binding.field.slice(1)}${declared} { ${binding.field}${passed}${inner} }`;
|
|
17389
17389
|
}, "graphqlDocument");
|
|
17390
17390
|
|
|
17391
|
-
// node_modules/.pnpm/@wirecat+cli-base@0.
|
|
17391
|
+
// node_modules/.pnpm/@wirecat+cli-base@0.126.1_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/codegen/runtime.js
|
|
17392
17392
|
var isLossless = /* @__PURE__ */ __name((input) => typeof input === "object" && input !== null && input.isLosslessNumber === true && typeof input.value === "string", "isLossless");
|
|
17393
17393
|
var INTEGER = /^-?\d+$/;
|
|
17394
17394
|
var INT64_MIN = -(2n ** 63n);
|
|
@@ -17413,7 +17413,7 @@ var integer2 = /* @__PURE__ */ __name((range2 = {}) => pipe(custom((input) => {
|
|
|
17413
17413
|
}, "expected an integer within \xB12^53"), transform((input) => Number(digitsOf(input))), check((value) => inRange(value, range2), "integer out of range")), "integer");
|
|
17414
17414
|
var number2 = /* @__PURE__ */ __name((range2 = {}) => pipe(custom((input) => isLossless(input) ? Number.isFinite(Number(input.value)) : Number.isFinite(input), "expected a number"), transform((input) => isLossless(input) ? Number(input.value) : input), check((value) => inRange(value, range2), "number out of range")), "number");
|
|
17415
17415
|
|
|
17416
|
-
// node_modules/.pnpm/@wirecat+cli-base@0.
|
|
17416
|
+
// node_modules/.pnpm/@wirecat+cli-base@0.126.1_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/codegen/openapi.js
|
|
17417
17417
|
var IGNORED = /* @__PURE__ */ new Set([
|
|
17418
17418
|
"readOnly",
|
|
17419
17419
|
"example",
|
|
@@ -18141,7 +18141,7 @@ function resolveSpace(space) {
|
|
|
18141
18141
|
}
|
|
18142
18142
|
__name(resolveSpace, "resolveSpace");
|
|
18143
18143
|
|
|
18144
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
18144
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/cli/bot/api-input.js
|
|
18145
18145
|
var RENAMED = { timeout: "poll-timeout" };
|
|
18146
18146
|
var apiFlagOf = /* @__PURE__ */ __name((name) => RENAMED[name] ?? name.replace(/_/g, "-").replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(), "apiFlagOf");
|
|
18147
18147
|
var apiOptionKey = /* @__PURE__ */ __name((name) => apiFlagOf(name).replace(/-([a-z0-9])/g, (_, letter) => letter.toUpperCase()), "apiOptionKey");
|
|
@@ -18280,10 +18280,10 @@ var flagValue = /* @__PURE__ */ __name((operation, name, raw, type) => {
|
|
|
18280
18280
|
return raw;
|
|
18281
18281
|
}, "flagValue");
|
|
18282
18282
|
|
|
18283
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
18283
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/sends/guard.js
|
|
18284
18284
|
import { randomUUID } from "node:crypto";
|
|
18285
18285
|
|
|
18286
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
18286
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/sends/flood.js
|
|
18287
18287
|
import { mkdirSync, readFileSync as readFileSync2, renameSync, writeFileSync } from "node:fs";
|
|
18288
18288
|
import { dirname as dirname2, join } from "node:path";
|
|
18289
18289
|
var MOST_DEADLINES = 50;
|
|
@@ -18367,11 +18367,11 @@ var FloodMemory = class {
|
|
|
18367
18367
|
}
|
|
18368
18368
|
};
|
|
18369
18369
|
|
|
18370
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
18370
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/sends/journal.js
|
|
18371
18371
|
import { appendFileSync, mkdirSync as mkdirSync3, readFileSync as readFileSync3 } from "node:fs";
|
|
18372
18372
|
import { dirname as dirname4, join as join2 } from "node:path";
|
|
18373
18373
|
|
|
18374
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
18374
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/sends/file-lock.js
|
|
18375
18375
|
import { closeSync, mkdirSync as mkdirSync2, openSync, statSync, unlinkSync } from "node:fs";
|
|
18376
18376
|
import { dirname as dirname3 } from "node:path";
|
|
18377
18377
|
var LOCK_WAIT_MS = 5e3;
|
|
@@ -18438,7 +18438,7 @@ var lockTime = /* @__PURE__ */ __name((lock) => {
|
|
|
18438
18438
|
}
|
|
18439
18439
|
}, "lockTime");
|
|
18440
18440
|
|
|
18441
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
18441
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/sends/journal.js
|
|
18442
18442
|
var sendsPathFor = /* @__PURE__ */ __name((app, profile, env = process.env) => join2(resolvePaths({ appName: app.appName, prefix: app.envPrefix, env }).state, "sends", `${profile}.jsonl`), "sendsPathFor");
|
|
18443
18443
|
var SendJournal = class {
|
|
18444
18444
|
static {
|
|
@@ -18462,12 +18462,12 @@ var SendJournal = class {
|
|
|
18462
18462
|
return withFileLockAsync(this.path, "the send journal", body);
|
|
18463
18463
|
}
|
|
18464
18464
|
append(entry) {
|
|
18465
|
-
const { at:
|
|
18465
|
+
const { at: at2, ...attributes } = entry;
|
|
18466
18466
|
const { runId, command, traceId } = currentRun();
|
|
18467
18467
|
const record2 = logRecordOf({
|
|
18468
18468
|
severity: entry.outcome === "sent" || entry.outcome === "reserved" ? "info" : "warn",
|
|
18469
18469
|
event: logAttributes({ event: "send.recorded", ...attributes }),
|
|
18470
|
-
time:
|
|
18470
|
+
time: at2,
|
|
18471
18471
|
runId,
|
|
18472
18472
|
...traceId === void 0 ? {} : { traceId },
|
|
18473
18473
|
command,
|
|
@@ -18515,7 +18515,7 @@ var withSendId = /* @__PURE__ */ __name((entry) => {
|
|
|
18515
18515
|
return cid === void 0 || rest.sendId !== void 0 ? rest : { ...rest, sendId: String(cid) };
|
|
18516
18516
|
}, "withSendId");
|
|
18517
18517
|
|
|
18518
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
18518
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/sends/recipients.js
|
|
18519
18519
|
import { existsSync, readFileSync as readFileSync4, rmSync } from "node:fs";
|
|
18520
18520
|
import { join as join3 } from "node:path";
|
|
18521
18521
|
var recipientsPathFor = /* @__PURE__ */ __name((app, profile, env = process.env) => join3(resolvePaths({ appName: app.appName, prefix: app.envPrefix, env }).state, "profiles", `${profile}.recipients.json`), "recipientsPathFor");
|
|
@@ -18627,7 +18627,7 @@ var RecipientList = class {
|
|
|
18627
18627
|
}
|
|
18628
18628
|
};
|
|
18629
18629
|
|
|
18630
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
18630
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/sends/guard.js
|
|
18631
18631
|
var HOUR_MS = 60 * 60 * 1e3;
|
|
18632
18632
|
var countsTowardLimit = /* @__PURE__ */ __name(({ kind: kind2 = "message", action: action2, notify }) => kind2 === "message" || kind2 === "forward" || kind2 === "edit" || kind2 === "delete" || kind2 === "pin" && notify === true || action2 === "create" || action2 === "members.add" || action2 === "requests.accept" || action2 === "join" || action2 === "contact-import", "countsTowardLimit");
|
|
18633
18633
|
var weightOf = /* @__PURE__ */ __name(({ kind: kind2 = "message", action: action2, count: count3, people }) => kind2 === "delete" || kind2 === "message" && action2 === void 0 ? Math.max(1, count3 ?? 1) : action2 === "create" || action2 === "members.add" || action2 === "requests.accept" || action2 === "contact-import" ? Math.max(1, people ?? count3 ?? 1) : 1, "weightOf");
|
|
@@ -18684,10 +18684,10 @@ var sendGuard = /* @__PURE__ */ __name(({ profile, recipients, command = recipie
|
|
|
18684
18684
|
if (count3 > sendsPerHour) {
|
|
18685
18685
|
throw new CliError("rate_limited", `${count3} at once is more than the hourly limit of profile ${profile} (sendsPerHour ${sendsPerHour}) \u2014 do fewer at a time`);
|
|
18686
18686
|
}
|
|
18687
|
-
const
|
|
18688
|
-
if (Number.isNaN(
|
|
18687
|
+
const at2 = request.scheduledFor ? Date.parse(request.scheduledFor) : now().getTime();
|
|
18688
|
+
if (Number.isNaN(at2))
|
|
18689
18689
|
throw new CliError("validation_error", `"${request.scheduledFor}" is not a time to send at \u2014 use ISO 8601`);
|
|
18690
|
-
const counted2 = entries.filter(countsTowardLimit).filter((entry) => entry.outcome === "sent" || entry.outcome === "outcome_unknown" || entry.outcome === "reserved").filter((entry) => Math.abs(timeOf(entry) -
|
|
18690
|
+
const counted2 = entries.filter(countsTowardLimit).filter((entry) => entry.outcome === "sent" || entry.outcome === "outcome_unknown" || entry.outcome === "reserved").filter((entry) => Math.abs(timeOf(entry) - at2) < HOUR_MS);
|
|
18691
18691
|
const unsure = /* @__PURE__ */ __name((entry) => entry.outcome === "outcome_unknown", "unsure");
|
|
18692
18692
|
const same2 = /* @__PURE__ */ __name((a, b) => a.sendId !== void 0 && a.sendId === b.sendId && a.chatId === b.chatId, "same");
|
|
18693
18693
|
const last = [...counted2].reverse().find((entry) => same2(entry, { chatId, sendId }));
|
|
@@ -18707,7 +18707,7 @@ var sendGuard = /* @__PURE__ */ __name(({ profile, recipients, command = recipie
|
|
|
18707
18707
|
});
|
|
18708
18708
|
const nextMs = (opening?.time ?? 0) + HOUR_MS;
|
|
18709
18709
|
const next = new Date(nextMs).toISOString();
|
|
18710
|
-
throw new CliError("rate_limited", `profile ${profile} has sent ${used} messages in the hour around ${new Date(
|
|
18710
|
+
throw new CliError("rate_limited", `profile ${profile} has sent ${used} messages in the hour around ${new Date(at2).toISOString()}, and its limit is ${sendsPerHour} (sendsPerHour) \u2014 the next send is possible at ${next}`, { retry_after_ms: nextMs - now().getTime(), retry_at: next });
|
|
18711
18711
|
}
|
|
18712
18712
|
return true;
|
|
18713
18713
|
}, "withinLimit");
|
|
@@ -18815,7 +18815,7 @@ var guardFor = /* @__PURE__ */ __name((app, settings, warn, env = process.env, a
|
|
|
18815
18815
|
}), "guardFor");
|
|
18816
18816
|
var journalFailure = /* @__PURE__ */ __name((error) => error?.code ?? (error instanceof Error ? error.name : "error"), "journalFailure");
|
|
18817
18817
|
|
|
18818
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
18818
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/cli/messenger/lacks.js
|
|
18819
18819
|
var COMMAND_NEEDS = {
|
|
18820
18820
|
"account update": ["updateProfile", "change the profile"],
|
|
18821
18821
|
"account sessions list": ["sessions", "list the account's sessions"],
|
|
@@ -18857,18 +18857,18 @@ var refuseLacking = /* @__PURE__ */ __name((messenger, path2) => {
|
|
|
18857
18857
|
var hideNever = /* @__PURE__ */ __name((messenger, group) => {
|
|
18858
18858
|
const walk2 = /* @__PURE__ */ __name((command, path2) => {
|
|
18859
18859
|
for (const child of command.commands) {
|
|
18860
|
-
const
|
|
18861
|
-
const need = COMMAND_NEEDS[
|
|
18860
|
+
const at2 = [...path2, child.name()];
|
|
18861
|
+
const need = COMMAND_NEEDS[at2.join(" ")];
|
|
18862
18862
|
if (need && messenger.never?.includes(need[0]))
|
|
18863
18863
|
child._hidden = true;
|
|
18864
|
-
walk2(child,
|
|
18864
|
+
walk2(child, at2);
|
|
18865
18865
|
}
|
|
18866
18866
|
}, "walk");
|
|
18867
18867
|
walk2(group, [group.name()]);
|
|
18868
18868
|
return group;
|
|
18869
18869
|
}, "hideNever");
|
|
18870
18870
|
|
|
18871
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
18871
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/services/deps.js
|
|
18872
18872
|
var accountStore = /* @__PURE__ */ __name(async (deps) => (await deps.store()).forAccount(await deps.account()), "accountStore");
|
|
18873
18873
|
var crossAccount = /* @__PURE__ */ __name((deps, _reason) => deps.store(), "crossAccount");
|
|
18874
18874
|
var NO_LOCAL_STORE = "this answer comes from the messenger, not from the local store";
|
|
@@ -18930,7 +18930,7 @@ var storedDeps = /* @__PURE__ */ __name((messenger, store, account, guard) => ({
|
|
|
18930
18930
|
}), "storedDeps");
|
|
18931
18931
|
var storeModeDeps = /* @__PURE__ */ __name((messenger, store, account, guard) => ({ ...storedDeps(messenger, store, account, guard), offline: false, reads: "store" }), "storeModeDeps");
|
|
18932
18932
|
|
|
18933
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
18933
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/services/patience.js
|
|
18934
18934
|
import { setTimeout as sleep } from "node:timers/promises";
|
|
18935
18935
|
var LONGEST_WAIT_MS = 5 * 60 * 1e3;
|
|
18936
18936
|
var patiently = /* @__PURE__ */ __name(async (request, note, stop) => {
|
|
@@ -18953,10 +18953,10 @@ var patiently = /* @__PURE__ */ __name(async (request, note, stop) => {
|
|
|
18953
18953
|
}
|
|
18954
18954
|
}, "patiently");
|
|
18955
18955
|
|
|
18956
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
18956
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/services/archive.js
|
|
18957
18957
|
import { setTimeout as sleep2 } from "node:timers/promises";
|
|
18958
18958
|
|
|
18959
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
18959
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/services/backfill-estimate.js
|
|
18960
18960
|
var REQUEST_MS = 400;
|
|
18961
18961
|
var estimateBackfill = /* @__PURE__ */ __name(({ ranges, held, newest, page, maxPages, pauseMs }) => {
|
|
18962
18962
|
const lowest = ranges[0];
|
|
@@ -18979,13 +18979,13 @@ var estimateBackfill = /* @__PURE__ */ __name(({ ranges, held, newest, page, max
|
|
|
18979
18979
|
};
|
|
18980
18980
|
}, "estimateBackfill");
|
|
18981
18981
|
|
|
18982
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
18982
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/domain/recovery.js
|
|
18983
18983
|
var withRecovery = /* @__PURE__ */ __name((error) => ({
|
|
18984
18984
|
...error,
|
|
18985
18985
|
retryable: typeof error.retryable === "boolean" ? error.retryable : error.code === "rate_limited" || error.status === 429
|
|
18986
18986
|
}), "withRecovery");
|
|
18987
18987
|
|
|
18988
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
18988
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/services/batch.js
|
|
18989
18989
|
var actionable = /* @__PURE__ */ __name((error) => {
|
|
18990
18990
|
if (isCliFailure(error))
|
|
18991
18991
|
return withRecovery({ code: error.code, message: error.message, ...error.details });
|
|
@@ -19068,7 +19068,7 @@ var mergeBatches = /* @__PURE__ */ __name((a, b) => {
|
|
|
19068
19068
|
};
|
|
19069
19069
|
}, "mergeBatches");
|
|
19070
19070
|
|
|
19071
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
19071
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/search/groups.js
|
|
19072
19072
|
var ALL = "all";
|
|
19073
19073
|
var OWNER_NOTES = { provider: "notes", account: INTERNAL_NOTES };
|
|
19074
19074
|
var NOT_GROUP_NAMES = /* @__PURE__ */ new Set([ALL, "bots"]);
|
|
@@ -19140,7 +19140,7 @@ var groupEntries = /* @__PURE__ */ __name((saved) => ({
|
|
|
19140
19140
|
[ALL]: [ALL]
|
|
19141
19141
|
}), "groupEntries");
|
|
19142
19142
|
|
|
19143
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
19143
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/services/search-kind.js
|
|
19144
19144
|
var NO_MAIL = "no_mail";
|
|
19145
19145
|
var MAIL = "email";
|
|
19146
19146
|
var groupLockOf = /* @__PURE__ */ __name((app, env) => {
|
|
@@ -19214,7 +19214,7 @@ var accountsOfKind = /* @__PURE__ */ __name((kind2, chosen, held, explicit, comm
|
|
|
19214
19214
|
return chosenMail.map(({ provider, account }) => ({ provider, account }));
|
|
19215
19215
|
}, "accountsOfKind");
|
|
19216
19216
|
|
|
19217
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
19217
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/services/message-resolution.js
|
|
19218
19218
|
var readChatId = /* @__PURE__ */ __name(async (deps, reference, store, account) => {
|
|
19219
19219
|
if (deps.reads !== "store")
|
|
19220
19220
|
return keptChatId(deps.messenger, reference, store, account);
|
|
@@ -19415,12 +19415,12 @@ var chatsMatchingIn = /* @__PURE__ */ __name(async (store, accounts, pattern) =>
|
|
|
19415
19415
|
}, "chatsMatchingIn");
|
|
19416
19416
|
var isText = /* @__PURE__ */ __name((value) => typeof value === "string" && value !== "", "isText");
|
|
19417
19417
|
|
|
19418
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
19418
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/images/context/index.js
|
|
19419
19419
|
var CONTEXT_MESSAGES = 3;
|
|
19420
19420
|
var CONTEXT_MINUTES = 10;
|
|
19421
19421
|
var MAX_CHARS = 1200;
|
|
19422
19422
|
var line = /* @__PURE__ */ __name(({ sender, text: text3 }) => sender ? `${sender}: ${text3.trim()}` : text3.trim(), "line");
|
|
19423
|
-
var near = /* @__PURE__ */ __name((messages, sentAt) => messages.filter(({ text: text3, sentAt:
|
|
19423
|
+
var near = /* @__PURE__ */ __name((messages, sentAt) => messages.filter(({ text: text3, sentAt: at2 }) => text3.trim() && Math.abs(at2 - sentAt) <= CONTEXT_MINUTES * 6e4).slice(0, CONTEXT_MESSAGES), "near");
|
|
19424
19424
|
var contextText = /* @__PURE__ */ __name(({ chatTitle: chatTitle2, sender, caption, sentAt, before, after }) => {
|
|
19425
19425
|
const earlier = near(before, sentAt).reverse();
|
|
19426
19426
|
const later = near(after, sentAt);
|
|
@@ -19439,12 +19439,12 @@ var context = {
|
|
|
19439
19439
|
}, "describe")
|
|
19440
19440
|
};
|
|
19441
19441
|
|
|
19442
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
19442
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/images/registry.js
|
|
19443
19443
|
var BUILT_INS = [context];
|
|
19444
19444
|
var providers = [...BUILT_INS];
|
|
19445
19445
|
var registeredImageProviders = /* @__PURE__ */ __name(() => providers, "registeredImageProviders");
|
|
19446
19446
|
|
|
19447
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
19447
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/services/conversations.js
|
|
19448
19448
|
var READ_PAGE = 5e3;
|
|
19449
19449
|
var CHAIN = 50;
|
|
19450
19450
|
var CONVERSATION_QUERY = {
|
|
@@ -19596,7 +19596,7 @@ var sized = /* @__PURE__ */ __name((size2) => {
|
|
|
19596
19596
|
return size2;
|
|
19597
19597
|
}, "sized");
|
|
19598
19598
|
|
|
19599
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
19599
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/services/embeddings-maintenance.js
|
|
19600
19600
|
var REFRESH_BOUNDS = { maxChats: 20, maxChunks: 2e3 };
|
|
19601
19601
|
var MESSAGE_PAGE = 5e3;
|
|
19602
19602
|
var PER_SESSION = 8;
|
|
@@ -19615,7 +19615,7 @@ var embeddingTarget = /* @__PURE__ */ __name((deps, choice = chosenTextModel(dep
|
|
|
19615
19615
|
price: remote.price,
|
|
19616
19616
|
installed: true,
|
|
19617
19617
|
perBatch: PER_REQUEST * concurrency,
|
|
19618
|
-
open: /* @__PURE__ */ __name(async () => (await import("./remote-
|
|
19618
|
+
open: /* @__PURE__ */ __name(async () => (await import("./remote-DVY6F6YO.js")).openRemote(remote, apiKey, {
|
|
19619
19619
|
concurrency,
|
|
19620
19620
|
env: deps.env ?? process.env
|
|
19621
19621
|
}), "open")
|
|
@@ -19635,7 +19635,7 @@ var embeddingTarget = /* @__PURE__ */ __name((deps, choice = chosenTextModel(dep
|
|
|
19635
19635
|
if (!isTextModelInstalled(model, directory2))
|
|
19636
19636
|
throw notDownloaded(model.id);
|
|
19637
19637
|
if (apart) {
|
|
19638
|
-
const { openProcess } = await import("./process-
|
|
19638
|
+
const { openProcess } = await import("./process-P4D4KFWE.js");
|
|
19639
19639
|
return openProcess(model, directory2, { threads: threads ?? defaultThreads() });
|
|
19640
19640
|
}
|
|
19641
19641
|
return openEmbedder(model, directory2, { threads: threads ?? defaultThreads() });
|
|
@@ -19733,8 +19733,8 @@ ${text3}`),
|
|
|
19733
19733
|
}
|
|
19734
19734
|
const have = await store.vectors.embeddedHashes(target2.key, described.map(({ hash: hash3 }) => hash3));
|
|
19735
19735
|
const missing4 = [...new Map(described.filter(({ hash: hash3 }) => !have.has(hash3)).map((one) => [one.hash, one])).values()];
|
|
19736
|
-
for (let
|
|
19737
|
-
const batch = missing4.slice(
|
|
19736
|
+
for (let at2 = 0; at2 < missing4.length; at2 += PER_REQUEST) {
|
|
19737
|
+
const batch = missing4.slice(at2, at2 + PER_REQUEST);
|
|
19738
19738
|
const vectors = await embedder.embed(batch.map(({ text: text3 }) => text3), "passage");
|
|
19739
19739
|
check2?.();
|
|
19740
19740
|
await store.vectors.saveVectors(target2.key, target2.dims, batch.map(({ hash: hash3 }, index) => ({ hash: hash3, vector: vectors[index] })));
|
|
@@ -19781,9 +19781,9 @@ ${text3}`),
|
|
|
19781
19781
|
const embedMessages = /* @__PURE__ */ __name(async (items, target2, embedder, check2) => {
|
|
19782
19782
|
const store = await deps.store();
|
|
19783
19783
|
const account = await deps.account();
|
|
19784
|
-
for (let
|
|
19784
|
+
for (let at2 = 0; at2 < items.length; at2 += target2.perBatch) {
|
|
19785
19785
|
check2?.();
|
|
19786
|
-
const batch = items.slice(
|
|
19786
|
+
const batch = items.slice(at2, at2 + target2.perBatch);
|
|
19787
19787
|
const vectors = await embedder.embed(batch.map(({ text: text3 }) => text3), "passage");
|
|
19788
19788
|
await store.vectors.saveMessageVectors(account, target2.key, target2.dims, batch.map(({ messagePk, hash: hash3, text: text3, occurredAt }, index) => ({
|
|
19789
19789
|
messagePk,
|
|
@@ -19924,7 +19924,7 @@ var shaped = /* @__PURE__ */ __name(({ chatId, builtAt, algorithmVersion, pendin
|
|
|
19924
19924
|
return { ...one, state };
|
|
19925
19925
|
}, "shaped");
|
|
19926
19926
|
|
|
19927
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
19927
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/services/search-catchup.js
|
|
19928
19928
|
var CATCH_UP_BOUNDS = { maxChunks: 500, maxMessages: 1e4, timeMs: 3e4 };
|
|
19929
19929
|
var validateCatchUpBounds = /* @__PURE__ */ __name((options2) => {
|
|
19930
19930
|
for (const [key, value, maximum] of [
|
|
@@ -19977,7 +19977,7 @@ var catchUpSearch = /* @__PURE__ */ __name(async (deps, chat, options2, signal,
|
|
|
19977
19977
|
}
|
|
19978
19978
|
}, "catchUpSearch");
|
|
19979
19979
|
|
|
19980
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
19980
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/services/archive.js
|
|
19981
19981
|
var pushed = /* @__PURE__ */ __name((deps, what) => {
|
|
19982
19982
|
if (deps.reads === "store") {
|
|
19983
19983
|
throw new CliError("validation_error", `${what} asks for older history, and this messenger pushes its history instead \u2014 keep \`${typedCommand(deps.messenger.app.command, "serve")}\` running`);
|
|
@@ -20208,8 +20208,8 @@ var limitOf = /* @__PURE__ */ __name(async (deps, store, account, chat, options2
|
|
|
20208
20208
|
var recordSkip = /* @__PURE__ */ __name(async (store, account, chatId, skip) => {
|
|
20209
20209
|
if (!chatId)
|
|
20210
20210
|
return;
|
|
20211
|
-
const
|
|
20212
|
-
await store.chats.recordHistorySkips(account, /* @__PURE__ */ new Map([[chatId, { ...skip, messages: 0, oldestAt:
|
|
20211
|
+
const at2 = (/* @__PURE__ */ new Date()).toISOString();
|
|
20212
|
+
await store.chats.recordHistorySkips(account, /* @__PURE__ */ new Map([[chatId, { ...skip, messages: 0, oldestAt: at2, newestAt: at2, unread: true }]]));
|
|
20213
20213
|
}, "recordSkip");
|
|
20214
20214
|
var abortable = /* @__PURE__ */ __name(async (read, signal) => {
|
|
20215
20215
|
signal.throwIfAborted();
|
|
@@ -20301,7 +20301,7 @@ var fetchInto = /* @__PURE__ */ __name(async ({ history, store, account, fetchin
|
|
|
20301
20301
|
reachedSince = true;
|
|
20302
20302
|
break;
|
|
20303
20303
|
}
|
|
20304
|
-
const oldestAt = page.items.reduce((
|
|
20304
|
+
const oldestAt = page.items.reduce((at2, message) => message.timestamp < at2 ? message.timestamp : at2, first2.timestamp);
|
|
20305
20305
|
const fromAt = held.from === low ? oldestAt : await timeOfKey(store, account, chatId, held.from, byTime, oldestAt);
|
|
20306
20306
|
if (last !== void 0 && await store.messages.countMessages(account, chatId, { since: fromAt }) >= last) {
|
|
20307
20307
|
reachedLast = true;
|
|
@@ -20358,7 +20358,7 @@ var timeOfKey = /* @__PURE__ */ __name(async (store, account, chatId, key, byTim
|
|
|
20358
20358
|
return message?.timestamp ?? fallback;
|
|
20359
20359
|
}, "timeOfKey");
|
|
20360
20360
|
|
|
20361
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
20361
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/services/questions.js
|
|
20362
20362
|
var LINKS = /https?:\/\/\S+/g;
|
|
20363
20363
|
var unanswered = /* @__PURE__ */ __name((messages, { answerers: answerers2, before }) => questions(messages, { answerers: answerers2 }).filter(({ question, answer }) => answer === void 0 && Date.parse(question.timestamp) < before).map(({ question }) => question), "unanswered");
|
|
20364
20364
|
var questions = /* @__PURE__ */ __name((messages, { answerers: answerers2, asker = "others" }) => {
|
|
@@ -20388,7 +20388,7 @@ var questions = /* @__PURE__ */ __name((messages, { answerers: answerers2, asker
|
|
|
20388
20388
|
});
|
|
20389
20389
|
}, "questions");
|
|
20390
20390
|
|
|
20391
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
20391
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/services/members-audit.js
|
|
20392
20392
|
var AUDIT_PAGE = 200;
|
|
20393
20393
|
var AUDIT_BUDGET = 10;
|
|
20394
20394
|
var AUDIT_PAUSE_MS = 1e3;
|
|
@@ -20468,7 +20468,7 @@ var burstJoins = /* @__PURE__ */ __name((members) => {
|
|
|
20468
20468
|
return found;
|
|
20469
20469
|
}, "burstJoins");
|
|
20470
20470
|
|
|
20471
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
20471
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/services/task-categories.js
|
|
20472
20472
|
var names = /* @__PURE__ */ __name((categories) => categories.map(({ name }) => name).join(", "), "names");
|
|
20473
20473
|
var taskCategoryOf = /* @__PURE__ */ __name((categories = DEFAULT_TASK_CATEGORIES, flag = "--category") => (typed) => {
|
|
20474
20474
|
const name = typed.trim().toLowerCase();
|
|
@@ -20505,8 +20505,8 @@ var hitsByList = /* @__PURE__ */ __name((text3, categories) => {
|
|
|
20505
20505
|
const counted2 = [];
|
|
20506
20506
|
for (const triggers of triggerStems(categories)) {
|
|
20507
20507
|
const hit = /* @__PURE__ */ new Set();
|
|
20508
|
-
english.forEach((word,
|
|
20509
|
-
const other = spanish[
|
|
20508
|
+
english.forEach((word, at2) => {
|
|
20509
|
+
const other = spanish[at2];
|
|
20510
20510
|
if (triggers.english.has(word))
|
|
20511
20511
|
hit.add(word);
|
|
20512
20512
|
else if (other !== void 0 && triggers.spanish.has(other))
|
|
@@ -20525,7 +20525,7 @@ var categorize = /* @__PURE__ */ __name((text3, categories = DEFAULT_TASK_CATEGO
|
|
|
20525
20525
|
return best.name;
|
|
20526
20526
|
}, "categorize");
|
|
20527
20527
|
|
|
20528
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
20528
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/services/task-rules.js
|
|
20529
20529
|
var taskAccount = /* @__PURE__ */ __name(({ provider, account }) => `${provider}:${account}`, "taskAccount");
|
|
20530
20530
|
var RULES_IN = {
|
|
20531
20531
|
dialog: "all",
|
|
@@ -20731,11 +20731,11 @@ var applyTaskRulesToChats = /* @__PURE__ */ __name(async (store, account, chatId
|
|
|
20731
20731
|
return passes;
|
|
20732
20732
|
}, "applyTaskRulesToChats");
|
|
20733
20733
|
|
|
20734
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
20734
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/domain/vcard.js
|
|
20735
20735
|
var AS_WORD = new RegExp(`^${WORD_BODY}$`);
|
|
20736
20736
|
var encoder = new TextEncoder();
|
|
20737
20737
|
|
|
20738
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
20738
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/botcheck/check.js
|
|
20739
20739
|
var DAY_MS = 864e5;
|
|
20740
20740
|
var NEW_DAYS = 30;
|
|
20741
20741
|
var SAME_TEXT_MIN = 20;
|
|
@@ -20754,7 +20754,7 @@ var scorePerson = /* @__PURE__ */ __name(({ subject, provider, activity, photos,
|
|
|
20754
20754
|
const reasons = [];
|
|
20755
20755
|
const unknown3 = [];
|
|
20756
20756
|
const add = /* @__PURE__ */ __name((reason, source, detail) => reasons.push({ reason, weight: WEIGHTS[reason], source, ...detail ? { detail } : {} }), "add");
|
|
20757
|
-
const young = /* @__PURE__ */ __name((
|
|
20757
|
+
const young = /* @__PURE__ */ __name((at2) => now.getTime() - Date.parse(at2) < NEW_DAYS * DAY_MS, "young");
|
|
20758
20758
|
const { flags } = subject;
|
|
20759
20759
|
for (const flag of ["bot", "scam", "fake", "deleted"]) {
|
|
20760
20760
|
if (flags?.[flag] === void 0)
|
|
@@ -20812,7 +20812,7 @@ var scorePerson = /* @__PURE__ */ __name(({ subject, provider, activity, photos,
|
|
|
20812
20812
|
};
|
|
20813
20813
|
}, "scorePerson");
|
|
20814
20814
|
|
|
20815
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
20815
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/http/time-limit.js
|
|
20816
20816
|
var timeLimit = /* @__PURE__ */ __name((ms) => {
|
|
20817
20817
|
const controller = new AbortController();
|
|
20818
20818
|
const timer = setTimeout(() => controller.abort(new DOMException("The operation timed out.", "TimeoutError")), ms);
|
|
@@ -20828,7 +20828,7 @@ var withTimeLimit = /* @__PURE__ */ __name(async (ms, run2) => {
|
|
|
20828
20828
|
}
|
|
20829
20829
|
}, "withTimeLimit");
|
|
20830
20830
|
|
|
20831
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
20831
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/botcheck/registries.js
|
|
20832
20832
|
var REGISTRIES = {
|
|
20833
20833
|
cas: { title: "Combot Anti-Spam (CAS)", docs: "https://cas.chat/api" },
|
|
20834
20834
|
lols: { title: "lols.bot", docs: "https://api.lols.bot/lols-bot.json" }
|
|
@@ -20915,7 +20915,7 @@ var notCovered = /* @__PURE__ */ __name((messenger, now = /* @__PURE__ */ new Da
|
|
|
20915
20915
|
detail: `lists Telegram accounts only, not ${messenger} ones`
|
|
20916
20916
|
})), "notCovered");
|
|
20917
20917
|
|
|
20918
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
20918
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/botcheck/service.js
|
|
20919
20919
|
var ACTIVITY_MESSAGES = 1e3;
|
|
20920
20920
|
var botCheckService = /* @__PURE__ */ __name((deps) => {
|
|
20921
20921
|
const subjectOf = /* @__PURE__ */ __name(async (reference) => {
|
|
@@ -21003,7 +21003,7 @@ var botCheckService = /* @__PURE__ */ __name((deps) => {
|
|
|
21003
21003
|
};
|
|
21004
21004
|
}, "botCheckService");
|
|
21005
21005
|
|
|
21006
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
21006
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/domain/thread.js
|
|
21007
21007
|
var threadIdOf = /* @__PURE__ */ __name((value) => {
|
|
21008
21008
|
if (value === void 0)
|
|
21009
21009
|
return void 0;
|
|
@@ -21013,7 +21013,7 @@ var threadIdOf = /* @__PURE__ */ __name((value) => {
|
|
|
21013
21013
|
return id3;
|
|
21014
21014
|
}, "threadIdOf");
|
|
21015
21015
|
|
|
21016
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
21016
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/services/chat-stats.js
|
|
21017
21017
|
var TOP_POSTS = 5;
|
|
21018
21018
|
var JOINS = /* @__PURE__ */ new Set(["join", "add"]);
|
|
21019
21019
|
var LEAVES = /* @__PURE__ */ new Set(["leave", "remove"]);
|
|
@@ -21076,9 +21076,9 @@ var membersOf2 = /* @__PURE__ */ __name(({ events, more }, messages, since) => {
|
|
|
21076
21076
|
const people = /* @__PURE__ */ __name((names2) => inPeriod.filter(({ event: event2 }) => names2.has(event2)).flatMap(({ timestamp, people: people2 }) => people2.map(({ id: id3 }) => ({ id: id3, at: Date.parse(timestamp) }))), "people");
|
|
21077
21077
|
const joined = people(JOINS);
|
|
21078
21078
|
const left = people(LEAVES);
|
|
21079
|
-
const firstWords = joined.flatMap(({ id: id3, at:
|
|
21080
|
-
const first2 = messages.find((one) => one.senderId === id3 && Date.parse(one.timestamp) >=
|
|
21081
|
-
return first2 ? [(Date.parse(first2.timestamp) -
|
|
21079
|
+
const firstWords = joined.flatMap(({ id: id3, at: at2 }) => {
|
|
21080
|
+
const first2 = messages.find((one) => one.senderId === id3 && Date.parse(one.timestamp) >= at2);
|
|
21081
|
+
return first2 ? [(Date.parse(first2.timestamp) - at2) / 6e4] : [];
|
|
21082
21082
|
});
|
|
21083
21083
|
return {
|
|
21084
21084
|
joined: joined.length,
|
|
@@ -21130,7 +21130,7 @@ var median = /* @__PURE__ */ __name((values) => {
|
|
|
21130
21130
|
return Math.round(sorted.length % 2 === 0 ? ((sorted[middle - 1] ?? upper) + upper) / 2 : upper);
|
|
21131
21131
|
}, "median");
|
|
21132
21132
|
|
|
21133
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
21133
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/services/member-history.js
|
|
21134
21134
|
var memberEvents = /* @__PURE__ */ __name((stays, revisions, since = 0) => {
|
|
21135
21135
|
const events = [];
|
|
21136
21136
|
for (const stay of stays) {
|
|
@@ -21159,10 +21159,10 @@ var memberEvents = /* @__PURE__ */ __name((stays, revisions, since = 0) => {
|
|
|
21159
21159
|
before: { name: before.name, username: before.username, marks: before.marks }
|
|
21160
21160
|
});
|
|
21161
21161
|
}
|
|
21162
|
-
return events.filter(({ at:
|
|
21162
|
+
return events.filter(({ at: at2 }) => Date.parse(at2) >= since).sort((a, b) => Date.parse(a.at) - Date.parse(b.at) || a.id.localeCompare(b.id));
|
|
21163
21163
|
}, "memberEvents");
|
|
21164
21164
|
|
|
21165
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
21165
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/services/chats.js
|
|
21166
21166
|
var EVENTS_DAYS = 7;
|
|
21167
21167
|
var TRACKED_DAYS = 30;
|
|
21168
21168
|
var STATS_PAGE = 1e3;
|
|
@@ -21457,7 +21457,7 @@ var storedMembers = /* @__PURE__ */ __name(async (store, chatId) => {
|
|
|
21457
21457
|
return members.length === 0 ? null : members;
|
|
21458
21458
|
}, "storedMembers");
|
|
21459
21459
|
|
|
21460
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
21460
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/services/inbox.js
|
|
21461
21461
|
var INBOX_CHATS = 20;
|
|
21462
21462
|
var REVIEW_DAYS = 3;
|
|
21463
21463
|
var UNANSWERED_HOURS = 24;
|
|
@@ -21470,9 +21470,9 @@ var storeReader = /* @__PURE__ */ __name((deps, store, account) => ({
|
|
|
21470
21470
|
chats: /* @__PURE__ */ __name(async ({ limit, offset }) => {
|
|
21471
21471
|
const newest = new Map((await store.chats.chatStats(account)).map((one) => [one.chatId, one.newestAt]));
|
|
21472
21472
|
const all = byRecency((await store.chats.chats(account, {})).items.map((chat) => {
|
|
21473
|
-
const
|
|
21474
|
-
const later =
|
|
21475
|
-
return later ? { ...chat, lastMessageAt:
|
|
21473
|
+
const at2 = newest.get(chat.id) ?? null;
|
|
21474
|
+
const later = at2 !== null && (chat.lastMessageAt === null || Date.parse(at2) > Date.parse(chat.lastMessageAt));
|
|
21475
|
+
return later ? { ...chat, lastMessageAt: at2 } : chat;
|
|
21476
21476
|
}));
|
|
21477
21477
|
const end = limit === void 0 ? all.length : offset + limit;
|
|
21478
21478
|
return { items: all.slice(offset, end), hasMore: all.length > end };
|
|
@@ -21665,13 +21665,13 @@ var inboxService = /* @__PURE__ */ __name((deps) => {
|
|
|
21665
21665
|
};
|
|
21666
21666
|
}, "inboxService");
|
|
21667
21667
|
|
|
21668
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
21668
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/domain/formatting.js
|
|
21669
21669
|
var invalid = /* @__PURE__ */ __name(() => new CliError("validation_error", "the messenger formatter returned invalid text spans"), "invalid");
|
|
21670
21670
|
var validateFormattedText = /* @__PURE__ */ __name((formatted2) => {
|
|
21671
21671
|
const { text: text3, spans } = formatted2;
|
|
21672
21672
|
if (typeof text3 !== "string" || !Array.isArray(spans) || spans.length > 100)
|
|
21673
21673
|
throw invalid();
|
|
21674
|
-
const boundary = /* @__PURE__ */ __name((
|
|
21674
|
+
const boundary = /* @__PURE__ */ __name((at2) => !(at2 > 0 && at2 < text3.length && /[\uD800-\uDBFF]/u.test(text3[at2 - 1] ?? "") && /[\uDC00-\uDFFF]/u.test(text3[at2] ?? "")), "boundary");
|
|
21675
21675
|
for (const span of spans) {
|
|
21676
21676
|
if (![
|
|
21677
21677
|
"bold",
|
|
@@ -21725,7 +21725,7 @@ var visibleFormattedText = /* @__PURE__ */ __name((formatted2) => {
|
|
|
21725
21725
|
};
|
|
21726
21726
|
}, "visibleFormattedText");
|
|
21727
21727
|
|
|
21728
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
21728
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/cli/service-api-manifest.js
|
|
21729
21729
|
var manifestBaseUrl = /* @__PURE__ */ __name((manifest, given, variables = {}) => {
|
|
21730
21730
|
const server = manifest.servers?.[0];
|
|
21731
21731
|
if (given === void 0 && !server)
|
|
@@ -21803,7 +21803,7 @@ var underBase = /* @__PURE__ */ __name((url, baseUrl) => {
|
|
|
21803
21803
|
const prefix = base.pathname.endsWith("/") ? base.pathname : `${base.pathname}/`;
|
|
21804
21804
|
return url.origin === base.origin && (url.pathname === base.pathname || url.pathname.startsWith(prefix));
|
|
21805
21805
|
}, "underBase");
|
|
21806
|
-
var
|
|
21806
|
+
var answerAt = /* @__PURE__ */ __name((value, path2) => path2 === "" ? value : path2.split(".").reduce((inner, key) => inner && typeof inner === "object" ? inner[key] : void 0, value), "answerAt");
|
|
21807
21807
|
var numberOf = /* @__PURE__ */ __name((value) => {
|
|
21808
21808
|
const number4 = typeof value === "number" ? value : typeof value === "string" ? Number(value) : Number(String(value));
|
|
21809
21809
|
return Number.isFinite(number4) ? number4 : void 0;
|
|
@@ -21817,18 +21817,18 @@ var withValue = /* @__PURE__ */ __name((input, parameter, value) => {
|
|
|
21817
21817
|
return { ...input, fields: fields2, body: apiJson({ ...body, [parameter.name]: value }) };
|
|
21818
21818
|
}, "withValue");
|
|
21819
21819
|
var nextPage = /* @__PURE__ */ __name((pagination, input, answer, headers) => {
|
|
21820
|
-
const listed2 = pagination.items === void 0 ? [answer] :
|
|
21820
|
+
const listed2 = pagination.items === void 0 ? [answer] : answerAt(answer, pagination.items);
|
|
21821
21821
|
const items = Array.isArray(listed2) ? listed2 : [];
|
|
21822
21822
|
switch (pagination.style) {
|
|
21823
21823
|
case "cursor": {
|
|
21824
|
-
const cursor =
|
|
21825
|
-
const more = pagination.hasMore === void 0 ||
|
|
21824
|
+
const cursor = answerAt(answer, pagination.next);
|
|
21825
|
+
const more = pagination.hasMore === void 0 || answerAt(answer, pagination.hasMore) !== false;
|
|
21826
21826
|
return more && typeof cursor === "string" && cursor !== "" ? { items, next: { input: withValue(input, pagination.cursor, cursor) } } : { items };
|
|
21827
21827
|
}
|
|
21828
21828
|
case "offset":
|
|
21829
21829
|
case "page": {
|
|
21830
21830
|
const parameter = pagination.style === "offset" ? pagination.offset : pagination.page;
|
|
21831
|
-
const total = pagination.total === void 0 ? void 0 : numberOf(
|
|
21831
|
+
const total = pagination.total === void 0 ? void 0 : numberOf(answerAt(answer, pagination.total));
|
|
21832
21832
|
const current = numberOf(parameterValue(input, parameter)) ?? (pagination.style === "offset" ? 0 : pagination.start ?? 1);
|
|
21833
21833
|
const next = pagination.style === "offset" ? current + items.length : current + 1;
|
|
21834
21834
|
const pages = pagination.style === "page" && pagination.pagesHeader !== void 0 ? numberOf(headers?.get(pagination.pagesHeader) ?? void 0) : void 0;
|
|
@@ -21836,13 +21836,13 @@ var nextPage = /* @__PURE__ */ __name((pagination, input, answer, headers) => {
|
|
|
21836
21836
|
return last ? { items } : { items, next: { input: withValue(input, parameter, next) } };
|
|
21837
21837
|
}
|
|
21838
21838
|
case "link": {
|
|
21839
|
-
const url =
|
|
21839
|
+
const url = answerAt(answer, pagination.next);
|
|
21840
21840
|
return typeof url === "string" && url !== "" ? { items, next: { url } } : { items };
|
|
21841
21841
|
}
|
|
21842
21842
|
}
|
|
21843
21843
|
}, "nextPage");
|
|
21844
21844
|
|
|
21845
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
21845
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/sends/pace.js
|
|
21846
21846
|
import { readFileSync as readFileSync5, renameSync as renameSync2, writeFileSync as writeFileSync2 } from "node:fs";
|
|
21847
21847
|
import { join as join4 } from "node:path";
|
|
21848
21848
|
var DEFAULT_PACE = { perMinute: 60, burst: 20 };
|
|
@@ -21893,15 +21893,15 @@ var Pacer = class {
|
|
|
21893
21893
|
const tat = Number(file2.tat);
|
|
21894
21894
|
if (!Number.isFinite(tat))
|
|
21895
21895
|
return 0;
|
|
21896
|
-
const
|
|
21897
|
-
return Number.isFinite(
|
|
21896
|
+
const at2 = Number(file2.at);
|
|
21897
|
+
return Number.isFinite(at2) && at2 > now ? now + Math.max(0, tat - at2) : tat;
|
|
21898
21898
|
} catch {
|
|
21899
21899
|
return 0;
|
|
21900
21900
|
}
|
|
21901
21901
|
}
|
|
21902
|
-
write(tat,
|
|
21902
|
+
write(tat, at2) {
|
|
21903
21903
|
const temporary = `${this.path}.${process.pid}.tmp`;
|
|
21904
|
-
writeFileSync2(temporary, JSON.stringify({ tat, at:
|
|
21904
|
+
writeFileSync2(temporary, JSON.stringify({ tat, at: at2 }), { mode: 384 });
|
|
21905
21905
|
renameSync2(temporary, this.path);
|
|
21906
21906
|
}
|
|
21907
21907
|
};
|
|
@@ -21910,9 +21910,9 @@ var LONGEST_PACE_WAIT_MS = 5 * 6e4;
|
|
|
21910
21910
|
var waitForTurn = /* @__PURE__ */ __name(async (pacer, options2) => {
|
|
21911
21911
|
const { name, operation, warn } = options2;
|
|
21912
21912
|
const now = options2.now ?? Date.now;
|
|
21913
|
-
let
|
|
21913
|
+
let at2 = now();
|
|
21914
21914
|
try {
|
|
21915
|
-
|
|
21915
|
+
at2 = await pacer.reserve();
|
|
21916
21916
|
} catch (error) {
|
|
21917
21917
|
warn?.(`could not remember ${name}'s wait (${error instanceof Error ? error.message : String(error)})`, {
|
|
21918
21918
|
event: "warning",
|
|
@@ -21920,11 +21920,11 @@ var waitForTurn = /* @__PURE__ */ __name(async (pacer, options2) => {
|
|
|
21920
21920
|
operation
|
|
21921
21921
|
});
|
|
21922
21922
|
}
|
|
21923
|
-
const waitMs =
|
|
21923
|
+
const waitMs = at2 - now();
|
|
21924
21924
|
if (waitMs <= 0)
|
|
21925
21925
|
return;
|
|
21926
21926
|
if (waitMs > (options2.longestWaitMs ?? LONGEST_PACE_WAIT_MS))
|
|
21927
|
-
throw new CliError("rate_limited", `this profile's next request to ${name} has to wait ${Math.ceil(waitMs / 1e3)} s more \u2014 nothing was sent to ${name}`, { retry_after_ms: waitMs, retry_at: new Date(
|
|
21927
|
+
throw new CliError("rate_limited", `this profile's next request to ${name} has to wait ${Math.ceil(waitMs / 1e3)} s more \u2014 nothing was sent to ${name}`, { retry_after_ms: waitMs, retry_at: new Date(at2).toISOString(), remembered: true });
|
|
21928
21928
|
if (waitMs >= ANNOUNCE_WAIT_MS) {
|
|
21929
21929
|
const seconds = Math.ceil(waitMs / 1e3);
|
|
21930
21930
|
warn?.(`waiting ${seconds} s to keep this profile's pace with ${name}`, {
|
|
@@ -21937,7 +21937,7 @@ var waitForTurn = /* @__PURE__ */ __name(async (pacer, options2) => {
|
|
|
21937
21937
|
await (options2.sleep ?? ((ms) => new Promise((resolve7) => setTimeout(resolve7, ms))))(waitMs);
|
|
21938
21938
|
}, "waitForTurn");
|
|
21939
21939
|
|
|
21940
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
21940
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/sends/keyed-guard.js
|
|
21941
21941
|
var keyedGuard = /* @__PURE__ */ __name((build, ask2, levelOf, extra) => {
|
|
21942
21942
|
let question;
|
|
21943
21943
|
let answered = false;
|
|
@@ -21980,7 +21980,7 @@ var keyedGuard = /* @__PURE__ */ __name((build, ask2, levelOf, extra) => {
|
|
|
21980
21980
|
};
|
|
21981
21981
|
}, "keyedGuard");
|
|
21982
21982
|
|
|
21983
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
21983
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/moderation/check.js
|
|
21984
21984
|
var INVITE = /max\.ru\/join\/|(t|telegram)\.me\/(\+|joinchat\/)|tg:\/\/join/i;
|
|
21985
21985
|
var LINK2 = /https?:\/\/\S+/i;
|
|
21986
21986
|
var STRENGTH = { report: 0, delete: 1, remove: 2 };
|
|
@@ -22041,10 +22041,10 @@ var floodOf = /* @__PURE__ */ __name((messages, flood) => {
|
|
|
22041
22041
|
if (message.senderId === null)
|
|
22042
22042
|
continue;
|
|
22043
22043
|
const times = bySender.get(message.senderId) ?? [];
|
|
22044
|
-
const
|
|
22045
|
-
times.push(
|
|
22044
|
+
const at2 = Date.parse(message.timestamp);
|
|
22045
|
+
times.push(at2);
|
|
22046
22046
|
bySender.set(message.senderId, times);
|
|
22047
|
-
if (times.filter((time) =>
|
|
22047
|
+
if (times.filter((time) => at2 - time < window2).length > flood.messages)
|
|
22048
22048
|
over.add(message.id);
|
|
22049
22049
|
}
|
|
22050
22050
|
return over;
|
|
@@ -22168,7 +22168,7 @@ var nextPoint = /* @__PURE__ */ __name((rows, found) => {
|
|
|
22168
22168
|
}, "nextPoint");
|
|
22169
22169
|
var someUndone = /* @__PURE__ */ __name((rows) => rows.some(undone), "someUndone");
|
|
22170
22170
|
|
|
22171
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
22171
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/moderation/rules.js
|
|
22172
22172
|
import { existsSync as existsSync2, readdirSync, readFileSync as readFileSync6 } from "node:fs";
|
|
22173
22173
|
import { join as join5 } from "node:path";
|
|
22174
22174
|
var RULE_ACTIONS = ["report", "delete", "remove"];
|
|
@@ -22285,9 +22285,9 @@ var ModerationRules = class {
|
|
|
22285
22285
|
checkedUntil(chatId) {
|
|
22286
22286
|
return this.#file().checkedUntil?.[chatId];
|
|
22287
22287
|
}
|
|
22288
|
-
markChecked(chatId,
|
|
22288
|
+
markChecked(chatId, at2) {
|
|
22289
22289
|
const saved = this.#file();
|
|
22290
|
-
this.#write({ ...saved, checkedUntil: { ...saved.checkedUntil, [chatId]:
|
|
22290
|
+
this.#write({ ...saved, checkedUntil: { ...saved.checkedUntil, [chatId]: at2 } });
|
|
22291
22291
|
}
|
|
22292
22292
|
#file() {
|
|
22293
22293
|
if (!existsSync2(this.path))
|
|
@@ -22320,7 +22320,7 @@ var assign = /* @__PURE__ */ __name((rules, key, value) => {
|
|
|
22320
22320
|
return { ...rules, [head]: { ...rules[head], [tail]: value } };
|
|
22321
22321
|
}, "assign");
|
|
22322
22322
|
|
|
22323
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
22323
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/services/excerpt.js
|
|
22324
22324
|
var queryWords = /* @__PURE__ */ __name((query) => query.toLowerCase().split(/\s+/).map((word) => word.replace(/^[\p{L}_]+:/u, "").replace(/~\d+$/u, "").replace(/^[^\p{L}\p{N}]+|[^\p{L}\p{N}]+$/gu, "")).filter((word) => word.length > 2 && !["and", "or", "not"].includes(word)), "queryWords");
|
|
22325
22325
|
var excerpt = /* @__PURE__ */ __name((text3, query, size2 = 240, options2 = {}) => {
|
|
22326
22326
|
const flat = text3.replace(/\s+/g, " ").trim();
|
|
@@ -22329,14 +22329,14 @@ var excerpt = /* @__PURE__ */ __name((text3, query, size2 = 240, options2 = {})
|
|
|
22329
22329
|
const lower = flat.toLowerCase();
|
|
22330
22330
|
const literalWords = new Set((query.match(/[\p{L}\p{N}]+/gu) ?? []).map(fold));
|
|
22331
22331
|
const found = options2.literal ? [...flat.matchAll(/[\p{L}\p{N}\p{M}]+/gu)].filter((match) => literalWords.has(fold(match[0]))).map((match) => match.index) : queryWords(query).map((word) => lower.indexOf(word)).filter((index) => index >= 0);
|
|
22332
|
-
const
|
|
22333
|
-
const start = Math.max(0, Math.min(
|
|
22332
|
+
const at2 = found.reduce((minimum, index) => Math.min(minimum, index), found[0] ?? 0);
|
|
22333
|
+
const start = Math.max(0, Math.min(at2 - Math.floor(size2 / 3), flat.length - size2));
|
|
22334
22334
|
const end = start + size2;
|
|
22335
22335
|
return `${start > 0 ? "\u2026" : ""}${flat.slice(start, end).trim()}${end < flat.length ? "\u2026" : ""}`;
|
|
22336
22336
|
}, "excerpt");
|
|
22337
22337
|
var withExcerpt = /* @__PURE__ */ __name(({ matchedText, ...hit }, query) => ({ ...hit, excerpt: excerpt(matchedText ?? hit.text, query) }), "withExcerpt");
|
|
22338
22338
|
|
|
22339
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
22339
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/services/person-meetings.js
|
|
22340
22340
|
var SCAN = 1e3;
|
|
22341
22341
|
var SNIPPET = 200;
|
|
22342
22342
|
var SNIPPET_ROWS = 6;
|
|
@@ -22401,7 +22401,7 @@ var personMeetings = /* @__PURE__ */ __name(async (store, people, accounts, { li
|
|
|
22401
22401
|
return { items, total: newest.length, hasMore: cut || newest.length > limit };
|
|
22402
22402
|
}, "personMeetings");
|
|
22403
22403
|
|
|
22404
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
22404
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/services/person-context.js
|
|
22405
22405
|
var CONTEXT_MESSAGES2 = 10;
|
|
22406
22406
|
var CONTEXT_BYTES = 64 * 1024;
|
|
22407
22407
|
var toContext = /* @__PURE__ */ __name((key, message, chatTitle2) => ({
|
|
@@ -22443,7 +22443,7 @@ var mailWith = /* @__PURE__ */ __name(async (store, key, address, limit, since)
|
|
|
22443
22443
|
return { items, hasMore: emails.length > limit };
|
|
22444
22444
|
}, "mailWith");
|
|
22445
22445
|
var newestFirst = /* @__PURE__ */ __name((a, b) => Date.parse(b.timestamp) - Date.parse(a.timestamp), "newestFirst");
|
|
22446
|
-
var iso = /* @__PURE__ */ __name((
|
|
22446
|
+
var iso = /* @__PURE__ */ __name((at2) => at2 === null ? null : new Date(at2).toISOString(), "iso");
|
|
22447
22447
|
var contextEvent = /* @__PURE__ */ __name((event2) => ({
|
|
22448
22448
|
ref: `event:${event2.id}`,
|
|
22449
22449
|
title: event2.title,
|
|
@@ -22707,10 +22707,10 @@ var personMessages = /* @__PURE__ */ __name(async (store, asked, reference, { ch
|
|
|
22707
22707
|
};
|
|
22708
22708
|
}, "personMessages");
|
|
22709
22709
|
|
|
22710
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
22710
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/services/meeting-evidence.js
|
|
22711
22711
|
import { createHash } from "node:crypto";
|
|
22712
22712
|
|
|
22713
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
22713
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/services/meeting-reference.js
|
|
22714
22714
|
var missing2 = /* @__PURE__ */ __name(() => new CliError("not_found", "the meeting evidence is unavailable for this account"), "missing");
|
|
22715
22715
|
var authorizedMeetingMetadata = /* @__PURE__ */ __name(async (store, accountId, reference, options2 = {}) => {
|
|
22716
22716
|
const parsed = parseMeetingReference(reference);
|
|
@@ -22728,7 +22728,7 @@ var authorizedMeetingMetadata = /* @__PURE__ */ __name(async (store, accountId,
|
|
|
22728
22728
|
return { parsed, meeting };
|
|
22729
22729
|
}, "authorizedMeetingMetadata");
|
|
22730
22730
|
|
|
22731
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
22731
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/services/meeting-evidence.js
|
|
22732
22732
|
var hash = /* @__PURE__ */ __name((value) => createHash("sha256").update(JSON.stringify(value)).digest("hex"), "hash");
|
|
22733
22733
|
var checkMeetingCancelled = /* @__PURE__ */ __name((signal) => {
|
|
22734
22734
|
if (signal?.aborted)
|
|
@@ -22927,7 +22927,7 @@ var readMeetingEvidence = /* @__PURE__ */ __name(async (store, accountId, refere
|
|
|
22927
22927
|
return { ...packet, fingerprint: hash(packet) };
|
|
22928
22928
|
}, "readMeetingEvidence");
|
|
22929
22929
|
|
|
22930
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
22930
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/services/person-meeting-context.js
|
|
22931
22931
|
var personMeetingContext = /* @__PURE__ */ __name(async (store, personReference, options2) => {
|
|
22932
22932
|
const { meetings = 10, cues = 5, bytes: bytes2 = 64 * 1024, scanLimit = 1e3, since, signal } = options2;
|
|
22933
22933
|
const requestedAccounts = options2.accountIds;
|
|
@@ -23026,7 +23026,7 @@ var personMeetingContext = /* @__PURE__ */ __name(async (store, personReference,
|
|
|
23026
23026
|
};
|
|
23027
23027
|
}, "personMeetingContext");
|
|
23028
23028
|
|
|
23029
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
23029
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/services/person-preparation.js
|
|
23030
23030
|
var PREPARE_BYTES = 96 * 1024;
|
|
23031
23031
|
var MEETINGS = 5;
|
|
23032
23032
|
var CUES = 3;
|
|
@@ -23149,7 +23149,7 @@ var meetingsOf = /* @__PURE__ */ __name(async (store, uid, stored, since, left)
|
|
|
23149
23149
|
}
|
|
23150
23150
|
}, "meetingsOf");
|
|
23151
23151
|
|
|
23152
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
23152
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/services/person-profile.js
|
|
23153
23153
|
var personProfile = /* @__PURE__ */ __name(async (deps, person, known2) => {
|
|
23154
23154
|
const online = deps.offline ? void 0 : await deps.connection();
|
|
23155
23155
|
const held = await storeIfOpen(deps);
|
|
@@ -23219,14 +23219,14 @@ var quiet = /* @__PURE__ */ __name((facts) => facts.chats.map(({ id: id3, title,
|
|
|
23219
23219
|
complete: false
|
|
23220
23220
|
})), "quiet");
|
|
23221
23221
|
|
|
23222
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
23222
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/services/person-timeline.js
|
|
23223
23223
|
var TIMELINE_ITEMS = 50;
|
|
23224
23224
|
var TIMELINE_MAX = 500;
|
|
23225
23225
|
var SCOPES = ["personal", "work"];
|
|
23226
23226
|
var cursorOf = /* @__PURE__ */ __name((row) => `before:${row.occurredAt}:${row.id}`, "cursorOf");
|
|
23227
23227
|
var boundOf = /* @__PURE__ */ __name((cursor) => {
|
|
23228
|
-
const [way,
|
|
23229
|
-
const bound2 = { at: Number(
|
|
23228
|
+
const [way, at2, id3, ...rest] = cursor.split(":");
|
|
23229
|
+
const bound2 = { at: Number(at2), id: Number(id3) };
|
|
23230
23230
|
if (way !== "before" || rest.length > 0 || !Number.isSafeInteger(bound2.at) || !Number.isSafeInteger(bound2.id))
|
|
23231
23231
|
throw new CliError("validation_error", `--cursor takes what page.next gave, before:<time>:<id> \u2014 not "${cursor}"`);
|
|
23232
23232
|
return bound2;
|
|
@@ -23281,7 +23281,7 @@ var personTimeline = /* @__PURE__ */ __name(async (store, asked, reference, { sc
|
|
|
23281
23281
|
};
|
|
23282
23282
|
}, "personTimeline");
|
|
23283
23283
|
|
|
23284
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
23284
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/services/chat-coverage.js
|
|
23285
23285
|
var chatCoverage = /* @__PURE__ */ __name(async (store, account, chatIds) => {
|
|
23286
23286
|
const ids = [...new Set(chatIds)];
|
|
23287
23287
|
if (ids.length === 0)
|
|
@@ -23307,7 +23307,7 @@ var chatCoverage = /* @__PURE__ */ __name(async (store, account, chatIds) => {
|
|
|
23307
23307
|
}));
|
|
23308
23308
|
}, "chatCoverage");
|
|
23309
23309
|
|
|
23310
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
23310
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/context/evidence-response.js
|
|
23311
23311
|
var contextSourceKey = /* @__PURE__ */ __name((source) => JSON.stringify([source.kind, source.accountId, source.provider, source.account]), "contextSourceKey");
|
|
23312
23312
|
var validateContextEvidencePage = /* @__PURE__ */ __name((page, request) => {
|
|
23313
23313
|
const fail2 = /* @__PURE__ */ __name(() => {
|
|
@@ -23371,7 +23371,7 @@ var validateContextEvidencePage = /* @__PURE__ */ __name((page, request) => {
|
|
|
23371
23371
|
}
|
|
23372
23372
|
}, "validateContextEvidencePage");
|
|
23373
23373
|
|
|
23374
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
23374
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/context/read-budget.js
|
|
23375
23375
|
var contextReadBudget = /* @__PURE__ */ __name((limits = {}) => {
|
|
23376
23376
|
if (!limits || typeof limits !== "object" || Array.isArray(limits))
|
|
23377
23377
|
throw new CliError("validation_error", "limits needs a context read allowance");
|
|
@@ -23424,7 +23424,7 @@ var contextReadBudget = /* @__PURE__ */ __name((limits = {}) => {
|
|
|
23424
23424
|
};
|
|
23425
23425
|
}, "contextReadBudget");
|
|
23426
23426
|
|
|
23427
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
23427
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/services/context-evidence.js
|
|
23428
23428
|
var createContextEvidenceReader = /* @__PURE__ */ __name((port, allowed, limits) => {
|
|
23429
23429
|
if (!port || typeof port.read !== "function")
|
|
23430
23430
|
throw new CliError("configuration_error", "context evidence reader is unavailable");
|
|
@@ -23468,15 +23468,15 @@ var createContextEvidenceReader = /* @__PURE__ */ __name((port, allowed, limits)
|
|
|
23468
23468
|
};
|
|
23469
23469
|
}, "createContextEvidenceReader");
|
|
23470
23470
|
|
|
23471
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
23471
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/services/project-gathering-around.js
|
|
23472
23472
|
var storedMessageNeighbours = /* @__PURE__ */ __name((messages) => ({
|
|
23473
23473
|
async around(ref, window2) {
|
|
23474
|
-
const
|
|
23475
|
-
if (
|
|
23474
|
+
const at2 = parseLocator(ref);
|
|
23475
|
+
if (at2.provider === "email")
|
|
23476
23476
|
return [];
|
|
23477
|
-
const rows = await messages.around({ provider:
|
|
23477
|
+
const rows = await messages.around({ provider: at2.provider, account: at2.account }, at2.chat, at2.message, window2);
|
|
23478
23478
|
return rows.filter((row) => !row.anchor).map((row) => ({
|
|
23479
|
-
ref: formatLocator({ ...
|
|
23479
|
+
ref: formatLocator({ ...at2, message: row.id }),
|
|
23480
23480
|
at: Date.parse(row.timestamp),
|
|
23481
23481
|
sender: row.senderName,
|
|
23482
23482
|
text: row.text ?? ""
|
|
@@ -23538,11 +23538,11 @@ var storedNeighbours = /* @__PURE__ */ __name((store) => {
|
|
|
23538
23538
|
const messages = storedMessageNeighbours(store.messages);
|
|
23539
23539
|
return {
|
|
23540
23540
|
async around(ref, window2) {
|
|
23541
|
-
const
|
|
23542
|
-
if (
|
|
23541
|
+
const at2 = parseLocator(ref);
|
|
23542
|
+
if (at2.provider !== "email")
|
|
23543
23543
|
return messages.around(ref, window2);
|
|
23544
|
-
const account = await store.accounts.storedAccount({ provider:
|
|
23545
|
-
const email = await store.mail.email(account.id,
|
|
23544
|
+
const account = await store.accounts.storedAccount({ provider: at2.provider, account: at2.account });
|
|
23545
|
+
const email = await store.mail.email(account.id, at2.message);
|
|
23546
23546
|
if (!email)
|
|
23547
23547
|
throw new CliError("not_found", "the hit's email is no longer stored");
|
|
23548
23548
|
const thread = await store.mail.thread(email.emailThreadId);
|
|
@@ -23554,7 +23554,7 @@ var storedNeighbours = /* @__PURE__ */ __name((store) => {
|
|
|
23554
23554
|
...emails.slice(Math.max(0, index - window2.before), index),
|
|
23555
23555
|
...emails.slice(index + 1, index + 1 + window2.after)
|
|
23556
23556
|
].map((one) => ({
|
|
23557
|
-
ref: formatLocator({ ...
|
|
23557
|
+
ref: formatLocator({ ...at2, message: one.externalId }),
|
|
23558
23558
|
at: one.sentAt ?? one.receivedAt ?? 0,
|
|
23559
23559
|
sender: one.fromName ?? one.fromAddress,
|
|
23560
23560
|
text: [one.subject, one.bodyText ?? one.snippet].filter(Boolean).join(" \u2014 ")
|
|
@@ -23563,7 +23563,7 @@ var storedNeighbours = /* @__PURE__ */ __name((store) => {
|
|
|
23563
23563
|
};
|
|
23564
23564
|
}, "storedNeighbours");
|
|
23565
23565
|
|
|
23566
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
23566
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/services/project-gathering-request.js
|
|
23567
23567
|
import { createHash as createHash2 } from "node:crypto";
|
|
23568
23568
|
var DAY = 864e5;
|
|
23569
23569
|
var MAX_TIME = 864e13;
|
|
@@ -23879,7 +23879,7 @@ var decodeCheckpoint = /* @__PURE__ */ __name((text3, plan) => {
|
|
|
23879
23879
|
return value;
|
|
23880
23880
|
}, "decodeCheckpoint");
|
|
23881
23881
|
|
|
23882
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
23882
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/services/project-gathering.js
|
|
23883
23883
|
var terminal = /* @__PURE__ */ new Set(["done", "unavailable", "failed"]);
|
|
23884
23884
|
var PAGE3 = 20;
|
|
23885
23885
|
var PEOPLE = 20;
|
|
@@ -24283,7 +24283,7 @@ var peopleOf = /* @__PURE__ */ __name((items, senderOf) => {
|
|
|
24283
24283
|
return [...byKey.values()].sort((a, b) => b.items - a.items || a.name.localeCompare(b.name));
|
|
24284
24284
|
}, "peopleOf");
|
|
24285
24285
|
|
|
24286
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
24286
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/services/meeting-project-candidate-matching.js
|
|
24287
24287
|
var normalizedText = /* @__PURE__ */ __name((text3) => text3.normalize("NFKC").toLowerCase().replace(/\s+/gu, " "), "normalizedText");
|
|
24288
24288
|
var termsOf = /* @__PURE__ */ __name((entry) => [
|
|
24289
24289
|
{ name: entry.name, kind: "canonical" },
|
|
@@ -24327,7 +24327,7 @@ var matchVocabularyTerms = /* @__PURE__ */ __name((catalog, texts) => {
|
|
|
24327
24327
|
return result.sort((a, b) => Number(a.entry.id) - Number(b.entry.id));
|
|
24328
24328
|
}, "matchVocabularyTerms");
|
|
24329
24329
|
|
|
24330
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
24330
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/services/project-gathering-mentions.js
|
|
24331
24331
|
var KINDS = ["project", "tag", "topic"];
|
|
24332
24332
|
var findEvidenceMentions = /* @__PURE__ */ __name(async (vocabulary, gathering, options2 = {}) => {
|
|
24333
24333
|
if (typeof vocabulary?.vocabulary !== "function")
|
|
@@ -24382,7 +24382,7 @@ var findEvidenceMentions = /* @__PURE__ */ __name(async (vocabulary, gathering,
|
|
|
24382
24382
|
};
|
|
24383
24383
|
}, "findEvidenceMentions");
|
|
24384
24384
|
|
|
24385
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
24385
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/services/project-purposes.js
|
|
24386
24386
|
var BUILT_IN_PURPOSES = ["work", "sales", "support", "other"];
|
|
24387
24387
|
var DEFAULT_PURPOSES = ["work"];
|
|
24388
24388
|
var LINK_PURPOSE = "work";
|
|
@@ -24412,7 +24412,7 @@ var purposeList = /* @__PURE__ */ __name((value, previous = []) => [
|
|
|
24412
24412
|
...value.split(",").map((one) => one.trim()).filter(Boolean)
|
|
24413
24413
|
], "purposeList");
|
|
24414
24414
|
|
|
24415
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
24415
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/services/stored-project-gathering.js
|
|
24416
24416
|
var storedChatCount = /* @__PURE__ */ __name((store) => async (account, chatId, { since, until }) => {
|
|
24417
24417
|
const window2 = { since: new Date(since).toISOString(), until: new Date(until - 1).toISOString() };
|
|
24418
24418
|
const [messages, newest, oldest] = await Promise.all([
|
|
@@ -24723,7 +24723,7 @@ var purposeHintOf = /* @__PURE__ */ __name((linked, rows, of) => {
|
|
|
24723
24723
|
return { chat: top.ref, relationship: link4.relationship, items, of };
|
|
24724
24724
|
}, "purposeHintOf");
|
|
24725
24725
|
|
|
24726
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
24726
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/services/people.js
|
|
24727
24727
|
var peopleService = /* @__PURE__ */ __name((deps) => {
|
|
24728
24728
|
const localCard = /* @__PURE__ */ __name(async (card, includeNotes = false) => {
|
|
24729
24729
|
const held = await storeIfOpen(deps);
|
|
@@ -24988,7 +24988,7 @@ var withoutPhone = /* @__PURE__ */ __name((answer) => {
|
|
|
24988
24988
|
return rest;
|
|
24989
24989
|
}, "withoutPhone");
|
|
24990
24990
|
|
|
24991
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
24991
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/services/task-stats.js
|
|
24992
24992
|
var TASK_STATS_BY = ["chat", "meeting", "project"];
|
|
24993
24993
|
var PERIOD_FIELD = "created";
|
|
24994
24994
|
var refuseNestedPeriod = /* @__PURE__ */ __name((node, top = true) => {
|
|
@@ -25119,7 +25119,7 @@ var meetingNames = /* @__PURE__ */ __name(async (store, groups) => {
|
|
|
25119
25119
|
}));
|
|
25120
25120
|
}, "meetingNames");
|
|
25121
25121
|
|
|
25122
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
25122
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/services/task-tag-filters.js
|
|
25123
25123
|
var taskTagFilters = /* @__PURE__ */ __name(async (store, query) => {
|
|
25124
25124
|
const tags = /* @__PURE__ */ new Map();
|
|
25125
25125
|
for (const node of query ? walkQuery(query.root) : [])
|
|
@@ -25128,7 +25128,7 @@ var taskTagFilters = /* @__PURE__ */ __name(async (store, query) => {
|
|
|
25128
25128
|
return tags;
|
|
25129
25129
|
}, "taskTagFilters");
|
|
25130
25130
|
|
|
25131
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
25131
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/services/tasks.js
|
|
25132
25132
|
var TASK_QUERY = {
|
|
25133
25133
|
entity: "task",
|
|
25134
25134
|
backend: "sql",
|
|
@@ -25581,7 +25581,7 @@ var tasksService = /* @__PURE__ */ __name((deps, categories) => {
|
|
|
25581
25581
|
}), "stats")
|
|
25582
25582
|
};
|
|
25583
25583
|
}, "tasksService");
|
|
25584
|
-
var iso2 = /* @__PURE__ */ __name((
|
|
25584
|
+
var iso2 = /* @__PURE__ */ __name((at2) => at2 === void 0 ? null : at2.toISOString(), "iso");
|
|
25585
25585
|
var taskItem = /* @__PURE__ */ __name((account, { task: task2, title, updatedAt, closeSuggestion = null }) => ({
|
|
25586
25586
|
ref: `task:${task2.id}`,
|
|
25587
25587
|
id: task2.id,
|
|
@@ -25628,7 +25628,7 @@ var taskView = /* @__PURE__ */ __name(async (store, account, task2) => {
|
|
|
25628
25628
|
};
|
|
25629
25629
|
}, "taskView");
|
|
25630
25630
|
|
|
25631
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
25631
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/mail/owed.js
|
|
25632
25632
|
var mailTurn = /* @__PURE__ */ __name((newest) => {
|
|
25633
25633
|
if (newest === null)
|
|
25634
25634
|
return null;
|
|
@@ -25637,7 +25637,7 @@ var mailTurn = /* @__PURE__ */ __name((newest) => {
|
|
|
25637
25637
|
return newest.addressed ? "owed" : null;
|
|
25638
25638
|
}, "mailTurn");
|
|
25639
25639
|
|
|
25640
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
25640
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/services/agenda-mail.js
|
|
25641
25641
|
var absent = /* @__PURE__ */ __name((error) => {
|
|
25642
25642
|
if (error instanceof CliError && error.code === "not_found")
|
|
25643
25643
|
return void 0;
|
|
@@ -25695,7 +25695,7 @@ var mailActivity = /* @__PURE__ */ __name(async (store, account, since, chats) =
|
|
|
25695
25695
|
};
|
|
25696
25696
|
}, "mailActivity");
|
|
25697
25697
|
|
|
25698
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
25698
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/services/agenda.js
|
|
25699
25699
|
var DAY2 = 864e5;
|
|
25700
25700
|
var AGENDA_DEFAULTS = { unanswered: DAY2, waiting: 7 * DAY2 };
|
|
25701
25701
|
var CLAIMS = ["none", "mine", "others", "any"];
|
|
@@ -25727,7 +25727,7 @@ var AGENDA_QUERY = {
|
|
|
25727
25727
|
var agendaService = /* @__PURE__ */ __name((deps, now = Date.now) => ({
|
|
25728
25728
|
show: /* @__PURE__ */ __name(async ({ dueWithin = DAY2, waiting = AGENDA_DEFAULTS.waiting, unanswered: unanswered2 = AGENDA_DEFAULTS.unanswered, within = 30 * DAY2, query, holder } = {}) => {
|
|
25729
25729
|
const [store, account] = [await deps.store(), await deps.account()];
|
|
25730
|
-
const
|
|
25730
|
+
const at2 = now();
|
|
25731
25731
|
const parts = query ? split(query) : { tasks: void 0, chats: void 0 };
|
|
25732
25732
|
const find = /* @__PURE__ */ __name((where) => store.tasks.find({
|
|
25733
25733
|
project: inboxKey(taskAccount(account)),
|
|
@@ -25743,8 +25743,8 @@ var agendaService = /* @__PURE__ */ __name((deps, now = Date.now) => ({
|
|
|
25743
25743
|
}), "find");
|
|
25744
25744
|
const open7 = await find();
|
|
25745
25745
|
const tags = await taskTagFilters(store, parts.tasks);
|
|
25746
|
-
const listed2 = parts.tasks ? await find(queryFilter(parts.tasks, taskColumns2(holder,
|
|
25747
|
-
const tasks = listed2.map((task2) => ({ task: task2, reasons: reasonsOf(task2,
|
|
25746
|
+
const listed2 = parts.tasks ? await find(queryFilter(parts.tasks, taskColumns2(holder, at2, tags), { command: "tasks agenda", zone: timezoneOf() })) : open7;
|
|
25747
|
+
const tasks = listed2.map((task2) => ({ task: task2, reasons: reasonsOf(task2, at2, dueWithin) })).filter(({ reasons }) => reasons.length > 0).sort((a, b) => urgency(a.task) - urgency(b.task)).map(({ task: task2, reasons }) => ({
|
|
25748
25748
|
id: task2.id,
|
|
25749
25749
|
key: task2.key,
|
|
25750
25750
|
title: task2.title,
|
|
@@ -25773,8 +25773,8 @@ var agendaService = /* @__PURE__ */ __name((deps, now = Date.now) => ({
|
|
|
25773
25773
|
createdAt: task2.createdAt,
|
|
25774
25774
|
assignees
|
|
25775
25775
|
}));
|
|
25776
|
-
const mail = account.provider === "email" ? await mailActivity(store, account,
|
|
25777
|
-
const activity = mail ?? await store.chats.chatActivity(account,
|
|
25776
|
+
const mail = account.provider === "email" ? await mailActivity(store, account, at2 - within, parts.chats) : void 0;
|
|
25777
|
+
const activity = mail ?? await store.chats.chatActivity(account, at2 - within, parts.chats ? queryFilter(parts.chats, AGENDA_COLUMNS, { command: "tasks agenda", zone: timezoneOf() }) : void 0);
|
|
25778
25778
|
const turnOf = /* @__PURE__ */ __name((chat) => "turn" in chat ? chat.turn : chat.lastFromOwner === null ? null : chat.lastFromOwner ? "waiting" : "owed", "turnOf");
|
|
25779
25779
|
const chats = activity.chats.map(({ lastMessageId, ...chat }) => ({
|
|
25780
25780
|
turn: turnOf({ lastMessageId, ...chat }),
|
|
@@ -25787,7 +25787,7 @@ var agendaService = /* @__PURE__ */ __name((deps, now = Date.now) => ({
|
|
|
25787
25787
|
}),
|
|
25788
25788
|
openTasks: open7.filter((task2) => chatOf2(task2.source) === chat.chatId).map((task2) => task2.id)
|
|
25789
25789
|
}));
|
|
25790
|
-
const silentFor = /* @__PURE__ */ __name((chat) =>
|
|
25790
|
+
const silentFor = /* @__PURE__ */ __name((chat) => at2 - Date.parse(chat.lastMessageAt), "silentFor");
|
|
25791
25791
|
const shown = {
|
|
25792
25792
|
owed: chats.filter((chat) => chat.turn === "owed" && silentFor(chat) >= unanswered2),
|
|
25793
25793
|
waiting: chats.filter((chat) => chat.turn === "waiting" && silentFor(chat) >= waiting),
|
|
@@ -25803,11 +25803,11 @@ var agendaService = /* @__PURE__ */ __name((deps, now = Date.now) => ({
|
|
|
25803
25803
|
if (category && !inList.has(category))
|
|
25804
25804
|
unlisted.set(category, (unlisted.get(category) ?? 0) + 1);
|
|
25805
25805
|
return {
|
|
25806
|
-
at: new Date(
|
|
25807
|
-
since: new Date(
|
|
25806
|
+
at: new Date(at2).toISOString(),
|
|
25807
|
+
since: new Date(at2 - within).toISOString(),
|
|
25808
25808
|
account: taskAccount(account),
|
|
25809
25809
|
storedAt: activity.storedAt,
|
|
25810
|
-
stale: activity.storedAt === null ||
|
|
25810
|
+
stale: activity.storedAt === null || at2 - Date.parse(activity.storedAt) > DAY2,
|
|
25811
25811
|
tasks,
|
|
25812
25812
|
owed: withCoverage(shown.owed),
|
|
25813
25813
|
waiting: withCoverage(shown.waiting),
|
|
@@ -25844,7 +25844,7 @@ var split = /* @__PURE__ */ __name((query) => {
|
|
|
25844
25844
|
}, "of");
|
|
25845
25845
|
return { tasks: of("tasks"), chats: of("chats") };
|
|
25846
25846
|
}, "split");
|
|
25847
|
-
var taskColumns2 = /* @__PURE__ */ __name((holder,
|
|
25847
|
+
var taskColumns2 = /* @__PURE__ */ __name((holder, at2, tags) => ({
|
|
25848
25848
|
tag: { where: /* @__PURE__ */ __name((node) => tags.get(node.value) ?? { sql: "0", params: [] }, "where") },
|
|
25849
25849
|
category: { type: "kw", sql: "t.category" },
|
|
25850
25850
|
claimed: {
|
|
@@ -25853,28 +25853,28 @@ var taskColumns2 = /* @__PURE__ */ __name((holder, at3, tags) => ({
|
|
|
25853
25853
|
if (claim === "any")
|
|
25854
25854
|
return { sql: "1", params: [] };
|
|
25855
25855
|
if (claim === "none")
|
|
25856
|
-
return { sql: "t.claimed_by IS NULL OR t.claimed_until < ?", params: [
|
|
25856
|
+
return { sql: "t.claimed_by IS NULL OR t.claimed_until < ?", params: [at2] };
|
|
25857
25857
|
if (claim === "mine")
|
|
25858
25858
|
return {
|
|
25859
25859
|
sql: "t.claimed_by IS NOT NULL AND t.claimed_by = ? AND t.claimed_until >= ?",
|
|
25860
|
-
params: [holder ?? null,
|
|
25860
|
+
params: [holder ?? null, at2]
|
|
25861
25861
|
};
|
|
25862
25862
|
return {
|
|
25863
25863
|
sql: "t.claimed_by IS NOT NULL AND t.claimed_by IS NOT ? AND t.claimed_until >= ?",
|
|
25864
|
-
params: [holder ?? null,
|
|
25864
|
+
params: [holder ?? null, at2]
|
|
25865
25865
|
};
|
|
25866
25866
|
}, "where")
|
|
25867
25867
|
}
|
|
25868
25868
|
}), "taskColumns");
|
|
25869
|
-
var reasonsOf = /* @__PURE__ */ __name((task2,
|
|
25869
|
+
var reasonsOf = /* @__PURE__ */ __name((task2, at2, dueWithin) => {
|
|
25870
25870
|
const due = task2.dueAt === null ? void 0 : Date.parse(task2.dueAt);
|
|
25871
25871
|
const check2 = task2.nextCheckAt === null ? void 0 : Date.parse(task2.nextCheckAt);
|
|
25872
25872
|
const reasons = [];
|
|
25873
|
-
if (due !== void 0 && due <=
|
|
25873
|
+
if (due !== void 0 && due <= at2)
|
|
25874
25874
|
reasons.push("overdue");
|
|
25875
|
-
else if (due !== void 0 && due <=
|
|
25875
|
+
else if (due !== void 0 && due <= at2 + dueWithin)
|
|
25876
25876
|
reasons.push("due");
|
|
25877
|
-
if (check2 !== void 0 && check2 <=
|
|
25877
|
+
if (check2 !== void 0 && check2 <= at2)
|
|
25878
25878
|
reasons.push("check");
|
|
25879
25879
|
if (due === void 0 && check2 === void 0)
|
|
25880
25880
|
reasons.push("unplanned");
|
|
@@ -25949,18 +25949,18 @@ var agendaItem = /* @__PURE__ */ __name((shown) => {
|
|
|
25949
25949
|
};
|
|
25950
25950
|
}, "agendaItem");
|
|
25951
25951
|
|
|
25952
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
25952
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/services/media-archive.js
|
|
25953
25953
|
import { setTimeout as sleep3 } from "node:timers/promises";
|
|
25954
25954
|
|
|
25955
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
25955
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/services/media-archive-files.js
|
|
25956
25956
|
import { lstat } from "node:fs/promises";
|
|
25957
25957
|
|
|
25958
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
25958
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/persistence/native/recording-partial-store.js
|
|
25959
25959
|
import { createHash as createHash4, randomUUID as randomUUID3 } from "node:crypto";
|
|
25960
25960
|
import { open as open3, rename as rename2, unlink as unlink2 } from "node:fs/promises";
|
|
25961
25961
|
import { join as join7 } from "node:path";
|
|
25962
25962
|
|
|
25963
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
25963
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/persistence/native/recording-partial-metadata.js
|
|
25964
25964
|
import { createHash as createHash3 } from "node:crypto";
|
|
25965
25965
|
var metadataLimit = 16384;
|
|
25966
25966
|
var partialIdentity = /* @__PURE__ */ __name((locator) => JSON.stringify([locator.provider, locator.account, locator.occurrenceId, locator.assetId]), "partialIdentity");
|
|
@@ -26020,7 +26020,7 @@ var readPartialMetadata = /* @__PURE__ */ __name(async (path2, locator, maxBytes
|
|
|
26020
26020
|
}
|
|
26021
26021
|
}, "readPartialMetadata");
|
|
26022
26022
|
|
|
26023
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
26023
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/persistence/native/recording-partial-writer.js
|
|
26024
26024
|
import { randomUUID as randomUUID2 } from "node:crypto";
|
|
26025
26025
|
import { open as open2, rename, unlink } from "node:fs/promises";
|
|
26026
26026
|
import { join as join6 } from "node:path";
|
|
@@ -26112,7 +26112,7 @@ var partialWriter = /* @__PURE__ */ __name(async (input) => {
|
|
|
26112
26112
|
};
|
|
26113
26113
|
}, "partialWriter");
|
|
26114
26114
|
|
|
26115
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
26115
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/persistence/native/recording-partial-store.js
|
|
26116
26116
|
var NativeRecordingPartialStore = class {
|
|
26117
26117
|
static {
|
|
26118
26118
|
__name(this, "NativeRecordingPartialStore");
|
|
@@ -26219,12 +26219,12 @@ var NativeRecordingPartialStore = class {
|
|
|
26219
26219
|
}
|
|
26220
26220
|
};
|
|
26221
26221
|
|
|
26222
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
26222
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/persistence/native/recording-publication.js
|
|
26223
26223
|
import { createHash as createHash5 } from "node:crypto";
|
|
26224
26224
|
import { link as link2 } from "node:fs/promises";
|
|
26225
26225
|
import { basename as basename2, dirname as dirname5, join as join9, resolve as resolve2 } from "node:path";
|
|
26226
26226
|
|
|
26227
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
26227
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/persistence/native/recording-publication-files.js
|
|
26228
26228
|
import { unlink as unlink3 } from "node:fs/promises";
|
|
26229
26229
|
var verifiedPublicationFile = /* @__PURE__ */ __name(async (path2, expected2, signal, writable = false) => {
|
|
26230
26230
|
signal?.throwIfAborted();
|
|
@@ -26259,7 +26259,7 @@ var commitPublication = /* @__PURE__ */ __name(async (root, partialPath, finalPa
|
|
|
26259
26259
|
signal?.throwIfAborted();
|
|
26260
26260
|
}, "commitPublication");
|
|
26261
26261
|
|
|
26262
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
26262
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/persistence/native/recording-publication-journal.js
|
|
26263
26263
|
import { randomUUID as randomUUID4 } from "node:crypto";
|
|
26264
26264
|
import { open as open4, rename as rename3, unlink as unlink4 } from "node:fs/promises";
|
|
26265
26265
|
import { join as join8 } from "node:path";
|
|
@@ -26332,7 +26332,7 @@ var writePublicationJournal = /* @__PURE__ */ __name(async (root, path2, prefix,
|
|
|
26332
26332
|
}
|
|
26333
26333
|
}, "writePublicationJournal");
|
|
26334
26334
|
|
|
26335
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
26335
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/persistence/native/recording-publication.js
|
|
26336
26336
|
var NativeRecordingPublication = class {
|
|
26337
26337
|
static {
|
|
26338
26338
|
__name(this, "NativeRecordingPublication");
|
|
@@ -26405,7 +26405,7 @@ var NativeRecordingPublication = class {
|
|
|
26405
26405
|
}
|
|
26406
26406
|
};
|
|
26407
26407
|
|
|
26408
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
26408
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/services/media-archive-manifest.js
|
|
26409
26409
|
import { createHash as createHash6 } from "node:crypto";
|
|
26410
26410
|
import { readdir } from "node:fs/promises";
|
|
26411
26411
|
import { isAbsolute as isAbsolute2, join as join10, resolve as resolve3 } from "node:path";
|
|
@@ -26492,7 +26492,7 @@ var commitMediaEntry = /* @__PURE__ */ __name((root, one, beforePublish) => writ
|
|
|
26492
26492
|
beforePublish
|
|
26493
26493
|
}), "commitMediaEntry");
|
|
26494
26494
|
|
|
26495
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
26495
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/services/media-archive-files.js
|
|
26496
26496
|
var validator = '"media-completed-v1"';
|
|
26497
26497
|
var maximumFileBytes = 64 * 1024 * 1024 * 1024;
|
|
26498
26498
|
var archiveMediaFile = /* @__PURE__ */ __name(async (root, identity, kind2, file2, beforeWrite, signal, metadata = {}) => {
|
|
@@ -26593,18 +26593,18 @@ var archiveMediaFile = /* @__PURE__ */ __name(async (root, identity, kind2, file
|
|
|
26593
26593
|
return entry;
|
|
26594
26594
|
}, "archiveMediaFile");
|
|
26595
26595
|
|
|
26596
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
26596
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/services/media-archive-locks.js
|
|
26597
26597
|
import { mkdir, realpath } from "node:fs/promises";
|
|
26598
26598
|
import { join as join11, resolve as resolve4 } from "node:path";
|
|
26599
26599
|
var archiveLocations = /* @__PURE__ */ __name(async (initial, signal) => {
|
|
26600
26600
|
const roots = /* @__PURE__ */ new Set();
|
|
26601
26601
|
const queued = new Set(initial.map((directory2) => resolve4(directory2)));
|
|
26602
26602
|
const pending = [...queued];
|
|
26603
|
-
for (let
|
|
26603
|
+
for (let at2 = 0; at2 < pending.length; at2++) {
|
|
26604
26604
|
signal?.throwIfAborted();
|
|
26605
26605
|
let root;
|
|
26606
26606
|
try {
|
|
26607
|
-
root = await realpath(pending[
|
|
26607
|
+
root = await realpath(pending[at2]);
|
|
26608
26608
|
} catch (error) {
|
|
26609
26609
|
if (missingMediaFile(error))
|
|
26610
26610
|
continue;
|
|
@@ -26660,7 +26660,7 @@ var withMediaArchiveLocks = /* @__PURE__ */ __name(async (directory2, signal, ru
|
|
|
26660
26660
|
throw new CliError("validation_error", "archive locations changed during locking; run the command again");
|
|
26661
26661
|
}, "withMediaArchiveLocks");
|
|
26662
26662
|
|
|
26663
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
26663
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/services/media-archive.js
|
|
26664
26664
|
var checkMediaArchive = /* @__PURE__ */ __name((directory2, signal) => withMediaArchiveLocks(directory2, signal, async (root) => {
|
|
26665
26665
|
const entries = await readMediaManifests(root, signal);
|
|
26666
26666
|
if (!entries.length)
|
|
@@ -26803,7 +26803,7 @@ var archiveMedia = /* @__PURE__ */ __name(async (ports, options2) => {
|
|
|
26803
26803
|
}, { create: true });
|
|
26804
26804
|
}, "archiveMedia");
|
|
26805
26805
|
|
|
26806
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
26806
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/services/media-archive-move.js
|
|
26807
26807
|
import { realpath as realpath2, unlink as unlink5 } from "node:fs/promises";
|
|
26808
26808
|
import { basename as basename3, dirname as dirname6, join as join12, resolve as resolve5 } from "node:path";
|
|
26809
26809
|
var canonicalDestination = /* @__PURE__ */ __name(async (directory2) => {
|
|
@@ -26954,7 +26954,7 @@ var moveMediaArchive = /* @__PURE__ */ __name(async (options2) => {
|
|
|
26954
26954
|
}, { additional: [target2], createAdditional: !options2.dryRun });
|
|
26955
26955
|
}, "moveMediaArchive");
|
|
26956
26956
|
|
|
26957
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
26957
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/services/model-downloads.js
|
|
26958
26958
|
import { writeFileSync as writeFileSync3 } from "node:fs";
|
|
26959
26959
|
import { join as join13 } from "node:path";
|
|
26960
26960
|
var bytesOf = /* @__PURE__ */ __name((model) => model.files.reduce((sum2, file2) => sum2 + file2.bytes, 0), "bytesOf");
|
|
@@ -26979,7 +26979,7 @@ var downloadTextModel = /* @__PURE__ */ __name(async (id3, { env, progress = /*
|
|
|
26979
26979
|
`);
|
|
26980
26980
|
await nativeRuntime({ env, progress });
|
|
26981
26981
|
progress(`${model.id}: loading it once to check it works`);
|
|
26982
|
-
const { openEmbedder: openEmbedder2 } = await import("./embed-
|
|
26982
|
+
const { openEmbedder: openEmbedder2 } = await import("./embed-4QDN36YF.js");
|
|
26983
26983
|
const embedder = await openEmbedder2(model, directory2);
|
|
26984
26984
|
try {
|
|
26985
26985
|
const [vector] = await embedder.embed(["check"], "query");
|
|
@@ -27000,7 +27000,7 @@ var downloadRerankModel = /* @__PURE__ */ __name(async (id3, { env, progress = /
|
|
|
27000
27000
|
}
|
|
27001
27001
|
await nativeRuntime({ env, progress });
|
|
27002
27002
|
progress(`${model.id}: loading it once to check it works`);
|
|
27003
|
-
const { openReranker } = await import("./rerank-
|
|
27003
|
+
const { openReranker } = await import("./rerank-XSPWLBIO.js");
|
|
27004
27004
|
const reranker = await openReranker(model, directory2);
|
|
27005
27005
|
try {
|
|
27006
27006
|
await reranker.score("check", ["check"]);
|
|
@@ -27018,7 +27018,7 @@ var downloadImageModel = /* @__PURE__ */ __name(async (id3, { env, progress = /*
|
|
|
27018
27018
|
await installFiles(placedImage(model, directory2), { progress, ...bytes2 ? { bytes: bytes2 } : {} });
|
|
27019
27019
|
}
|
|
27020
27020
|
progress(`${model.id}: loading it once to check it works`);
|
|
27021
|
-
const { openPictureEmbedder } = await import("./embedder-
|
|
27021
|
+
const { openPictureEmbedder } = await import("./embedder-Q7ID2LEG.js");
|
|
27022
27022
|
const embedder = await openPictureEmbedder(model, directory2);
|
|
27023
27023
|
try {
|
|
27024
27024
|
const vector = await embedder.embedQuery("check");
|
|
@@ -27030,7 +27030,7 @@ var downloadImageModel = /* @__PURE__ */ __name(async (id3, { env, progress = /*
|
|
|
27030
27030
|
return { model, directory: directory2 };
|
|
27031
27031
|
}, "downloadImageModel");
|
|
27032
27032
|
|
|
27033
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
27033
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/domain/money-words.js
|
|
27034
27034
|
var MONEY_REQUEST = "money-request";
|
|
27035
27035
|
var MONEY_DONE = "money-done";
|
|
27036
27036
|
var PROMISE = "promise";
|
|
@@ -27064,10 +27064,10 @@ var MONEY_WORDS = [
|
|
|
27064
27064
|
}
|
|
27065
27065
|
];
|
|
27066
27066
|
|
|
27067
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
27067
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/services/money-words.js
|
|
27068
27068
|
var moneyClassesOf = /* @__PURE__ */ __name((text3) => listsHit(text3, MONEY_WORDS), "moneyClassesOf");
|
|
27069
27069
|
|
|
27070
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
27070
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/domain/status-words.js
|
|
27071
27071
|
var words2 = /* @__PURE__ */ __name((forms) => new RegExp(`(?<![\\p{L}\\p{N}])(?:${forms.join("|")})(?![\\p{L}\\p{N}])`, "iu"), "words");
|
|
27072
27072
|
var MONEY_DONE_FORMS = words2([
|
|
27073
27073
|
"\u043E\u043F\u043B\u0430\u0442\u0438\u043B[\u0430\u0438]?",
|
|
@@ -27107,7 +27107,7 @@ var PROMISE_FORMS = words2([
|
|
|
27107
27107
|
"estar\xE1 listo"
|
|
27108
27108
|
]);
|
|
27109
27109
|
|
|
27110
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
27110
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/services/project-status/items.js
|
|
27111
27111
|
var EXCERPT_CHARS = 80;
|
|
27112
27112
|
var excerpt2 = /* @__PURE__ */ __name((text3) => {
|
|
27113
27113
|
const flat = text3.replace(/\s+/g, " ").trim();
|
|
@@ -27127,9 +27127,9 @@ var whoOf = /* @__PURE__ */ __name((message) => ({
|
|
|
27127
27127
|
owner: message.outgoing === true
|
|
27128
27128
|
}), "whoOf");
|
|
27129
27129
|
var fromOwner = /* @__PURE__ */ __name((message) => message.outgoing === true, "fromOwner");
|
|
27130
|
-
var day = /* @__PURE__ */ __name((
|
|
27130
|
+
var day = /* @__PURE__ */ __name((at2) => new Date(at2).toISOString().slice(0, 10), "day");
|
|
27131
27131
|
|
|
27132
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
27132
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/services/project-status/signals/amounts.js
|
|
27133
27133
|
var MONEY = DEFAULT_TASK_CATEGORIES.filter((category) => category.name === "money");
|
|
27134
27134
|
var verbOf = /* @__PURE__ */ __name((text3) => {
|
|
27135
27135
|
if (MONEY_DONE_FORMS.test(text3))
|
|
@@ -27210,7 +27210,7 @@ var amounts = {
|
|
|
27210
27210
|
attention: /* @__PURE__ */ __name((items) => items.flatMap((item2) => item2.chat !== null && item2.data.state === "asked" ? [{ chat: item2.chat, weight: 2, why: "money asked" }] : []), "attention")
|
|
27211
27211
|
};
|
|
27212
27212
|
|
|
27213
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
27213
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/services/project-status/signals/children.js
|
|
27214
27214
|
var children = {
|
|
27215
27215
|
id: "children",
|
|
27216
27216
|
version: 1,
|
|
@@ -27239,7 +27239,7 @@ var children = {
|
|
|
27239
27239
|
}, "read")
|
|
27240
27240
|
};
|
|
27241
27241
|
|
|
27242
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
27242
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/services/project-status/signals/coverage.js
|
|
27243
27243
|
var coverage = {
|
|
27244
27244
|
id: "coverage",
|
|
27245
27245
|
version: 1,
|
|
@@ -27268,12 +27268,12 @@ var coverage = {
|
|
|
27268
27268
|
attention: /* @__PURE__ */ __name((items) => items.flatMap((item2) => item2.chat !== null && item2.data.state !== "complete" && item2.data.beforeHeld ? [{ chat: item2.chat, weight: 3, why: "held in part" }] : []), "attention")
|
|
27269
27269
|
};
|
|
27270
27270
|
|
|
27271
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
27271
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/services/project-status/signals/payments.js
|
|
27272
27272
|
var holding2 = /* @__PURE__ */ __name((row) => row.review !== "rejected", "holding");
|
|
27273
|
-
var item = /* @__PURE__ */ __name((row,
|
|
27273
|
+
var item = /* @__PURE__ */ __name((row, at2, data) => ({
|
|
27274
27274
|
signal: "payments",
|
|
27275
27275
|
chat: null,
|
|
27276
|
-
at:
|
|
27276
|
+
at: at2,
|
|
27277
27277
|
who: null,
|
|
27278
27278
|
// The row first, then what it cites, so an amount read from a cited message is not counted twice.
|
|
27279
27279
|
evidence: [row.ref, ...row.evidence].map((ref) => ({ ref, fingerprint: null })),
|
|
@@ -27318,7 +27318,7 @@ var payments = {
|
|
|
27318
27318
|
}, "read")
|
|
27319
27319
|
};
|
|
27320
27320
|
|
|
27321
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
27321
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/services/project-status/signals/promises.js
|
|
27322
27322
|
var PATTERNS_PER_CHAT = 3;
|
|
27323
27323
|
var DAY3 = 864e5;
|
|
27324
27324
|
var KINDS2 = /* @__PURE__ */ new Set(["promise", "request"]);
|
|
@@ -27407,7 +27407,7 @@ var promises = {
|
|
|
27407
27407
|
}, "read")
|
|
27408
27408
|
};
|
|
27409
27409
|
|
|
27410
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
27410
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/services/project-status/signals/questions.js
|
|
27411
27411
|
var PER_SIDE = 5;
|
|
27412
27412
|
var WEEK = 7 * 864e5;
|
|
27413
27413
|
var NOBODY = /* @__PURE__ */ new Set();
|
|
@@ -27438,7 +27438,7 @@ var questions2 = {
|
|
|
27438
27438
|
}, "attention")
|
|
27439
27439
|
};
|
|
27440
27440
|
|
|
27441
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
27441
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/services/project-status/signals/reply-next.js
|
|
27442
27442
|
var targetOf = /* @__PURE__ */ __name((message, chat, owners) => {
|
|
27443
27443
|
const byId2 = /* @__PURE__ */ __name((id3) => chat.messages.find((one) => one.id === id3), "byId");
|
|
27444
27444
|
const quoted = message.replyTo ?? (message.replyToId === void 0 ? void 0 : byId2(message.replyToId));
|
|
@@ -27506,7 +27506,7 @@ var replyNext = {
|
|
|
27506
27506
|
attention: /* @__PURE__ */ __name((items) => items.flatMap((item2) => item2.chat !== null && item2.data.next === "owner" ? [{ chat: item2.chat, weight: 2, why: "your move" }] : []), "attention")
|
|
27507
27507
|
};
|
|
27508
27508
|
|
|
27509
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
27509
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/services/project-status/signals/topics.js
|
|
27510
27510
|
var escaped = /* @__PURE__ */ __name((text3) => text3.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), "escaped");
|
|
27511
27511
|
var wholeWord = /* @__PURE__ */ __name((word) => new RegExp(`(?<![\\p{L}\\p{N}])${escaped(word)}(?![\\p{L}\\p{N}])`, "u"), "wholeWord");
|
|
27512
27512
|
var matcherOf = /* @__PURE__ */ __name((query) => {
|
|
@@ -27552,7 +27552,7 @@ var topics = {
|
|
|
27552
27552
|
}, "read")
|
|
27553
27553
|
};
|
|
27554
27554
|
|
|
27555
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
27555
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/services/project-status/signals/index.js
|
|
27556
27556
|
var STATUS_SIGNALS = [
|
|
27557
27557
|
replyNext,
|
|
27558
27558
|
questions2,
|
|
@@ -27564,7 +27564,7 @@ var STATUS_SIGNALS = [
|
|
|
27564
27564
|
children
|
|
27565
27565
|
];
|
|
27566
27566
|
|
|
27567
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
27567
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/services/project-status/index.js
|
|
27568
27568
|
var DAY4 = 864e5;
|
|
27569
27569
|
var STATUS_WINDOW = 300;
|
|
27570
27570
|
var STATUS_CHATS = 16;
|
|
@@ -27753,7 +27753,7 @@ var projectStatus = /* @__PURE__ */ __name(async (store, input) => {
|
|
|
27753
27753
|
};
|
|
27754
27754
|
}, "projectStatus");
|
|
27755
27755
|
|
|
27756
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
27756
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/services/account.js
|
|
27757
27757
|
var accountService = /* @__PURE__ */ __name((deps) => {
|
|
27758
27758
|
const online = /* @__PURE__ */ __name(async (command) => {
|
|
27759
27759
|
if (deps.offline)
|
|
@@ -27825,18 +27825,18 @@ var accountService = /* @__PURE__ */ __name((deps) => {
|
|
|
27825
27825
|
};
|
|
27826
27826
|
}, "accountService");
|
|
27827
27827
|
|
|
27828
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
27828
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/domain/send-time.js
|
|
27829
27829
|
var sendTime = /* @__PURE__ */ __name((value, now = Date.now(), flag = "--at-time", zone) => {
|
|
27830
|
-
const
|
|
27830
|
+
const at2 = aheadOf(value, flag, now, {
|
|
27831
27831
|
...zone === void 0 ? {} : { zone },
|
|
27832
27832
|
refuseDate: true,
|
|
27833
27833
|
soonest: MINUTE,
|
|
27834
27834
|
latest: YEAR
|
|
27835
27835
|
});
|
|
27836
|
-
return new Date(
|
|
27836
|
+
return new Date(at2 - at2 % MINUTE).toISOString();
|
|
27837
27837
|
}, "sendTime");
|
|
27838
27838
|
|
|
27839
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
27839
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/services/admin.js
|
|
27840
27840
|
var recordMembership = /* @__PURE__ */ __name(async (deps, operationId, done2, change, fix, write) => {
|
|
27841
27841
|
try {
|
|
27842
27842
|
const held = await accountStoreIfOpen(deps);
|
|
@@ -28083,7 +28083,7 @@ var linkLimits = /* @__PURE__ */ __name(({ approval, expires, maxUses }) => {
|
|
|
28083
28083
|
return expires === void 0 ? void 0 : sendTime(expires, Date.now(), "--expire-time");
|
|
28084
28084
|
}, "linkLimits");
|
|
28085
28085
|
|
|
28086
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
28086
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/services/mail-search.js
|
|
28087
28087
|
var THREADS_PAGE = 500;
|
|
28088
28088
|
var threadsOf = /* @__PURE__ */ __name(async (store, key) => {
|
|
28089
28089
|
const account = await store.accounts.storedAccount(key).catch(() => void 0);
|
|
@@ -28139,10 +28139,10 @@ var mailAround = /* @__PURE__ */ __name(async (store, hit, count3) => {
|
|
|
28139
28139
|
if (!stored)
|
|
28140
28140
|
return void 0;
|
|
28141
28141
|
const emails = (await store.mail.emails({ accountId: stored.id, threadExternalId: hit.chatId })).reverse();
|
|
28142
|
-
const
|
|
28143
|
-
if (
|
|
28142
|
+
const at2 = emails.findIndex(({ externalId }) => externalId === hit.id);
|
|
28143
|
+
if (at2 < 0)
|
|
28144
28144
|
return void 0;
|
|
28145
|
-
return emails.slice(Math.max(0,
|
|
28145
|
+
return emails.slice(Math.max(0, at2 - count3), at2 + count3 + 1).map((email) => email.externalId === hit.id ? { ...messageOfEmail(email, hit.chatId), anchor: true } : messageOfEmail(email, hit.chatId));
|
|
28146
28146
|
}, "mailAround");
|
|
28147
28147
|
var readMail = /* @__PURE__ */ __name(async (store, locator, { before = 0, after = 0 } = {}) => {
|
|
28148
28148
|
const { provider, account, chat, message } = parseLocator(locator);
|
|
@@ -28152,13 +28152,13 @@ var readMail = /* @__PURE__ */ __name(async (store, locator, { before = 0, after
|
|
|
28152
28152
|
if (!stored)
|
|
28153
28153
|
throw new CliError("not_found", `no mail of ${account} is stored`);
|
|
28154
28154
|
const thread = await store.mail.threadHits(stored.id, chat);
|
|
28155
|
-
const
|
|
28156
|
-
if (
|
|
28155
|
+
const at2 = thread.findIndex(({ id: id3 }) => id3 === message);
|
|
28156
|
+
if (at2 < 0)
|
|
28157
28157
|
throw new CliError("not_found", `no stored email ${message} in that thread`);
|
|
28158
|
-
return thread.slice(Math.max(0,
|
|
28158
|
+
return thread.slice(Math.max(0, at2 - before), at2 + after + 1).map((hit) => hit.id === message ? { ...hit, anchor: true } : hit);
|
|
28159
28159
|
}, "readMail");
|
|
28160
28160
|
|
|
28161
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
28161
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/services/messages-search.js
|
|
28162
28162
|
var PERSON_FIELDS = /* @__PURE__ */ new Set(["from", "to", "cc", "bcc"]);
|
|
28163
28163
|
var MAIL_FIELDS = /* @__PURE__ */ new Set(["to", "cc", "bcc", "subject", "mailbox", "label", "is", "list"]);
|
|
28164
28164
|
var positiveSources = /* @__PURE__ */ __name((node) => node.kind === "predicate" ? node.field === "in" ? [node.value.toLowerCase()] : [] : node.clauses.filter(({ occur }) => occur !== "must_not").flatMap(({ node: node2 }) => positiveSources(node2)), "positiveSources");
|
|
@@ -28531,7 +28531,7 @@ var statsLucene = /* @__PURE__ */ __name(async (store, account, request, messeng
|
|
|
28531
28531
|
};
|
|
28532
28532
|
}, "statsLucene");
|
|
28533
28533
|
|
|
28534
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
28534
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/services/rankings-selection.js
|
|
28535
28535
|
var RANKING_SELECTION_BYTES = 64 * 1024;
|
|
28536
28536
|
var object2 = /* @__PURE__ */ __name((value) => value !== null && typeof value === "object" && !Array.isArray(value) ? value : void 0, "object");
|
|
28537
28537
|
function invalid3(message = "ranking selection is invalid \u2014 obtain a new drilldown from stats top") {
|
|
@@ -28700,7 +28700,7 @@ var readRankingSelection = /* @__PURE__ */ __name(async (store, input) => {
|
|
|
28700
28700
|
};
|
|
28701
28701
|
}, "readRankingSelection");
|
|
28702
28702
|
|
|
28703
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
28703
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/services/search-record.js
|
|
28704
28704
|
var canonical = /* @__PURE__ */ __name((value, nested = false) => Array.isArray(value) ? value.map((one) => canonical(one, true)) : value !== null && typeof value === "object" ? Object.fromEntries(Object.entries(value).filter(([, one]) => one !== void 0 && (nested || one !== false)).sort(([a], [b]) => a < b ? -1 : a > b ? 1 : 0).map(([key, one]) => [key, canonical(one, true)])) : value, "canonical");
|
|
28705
28705
|
var searchRecordOf = /* @__PURE__ */ __name((command, params) => ({
|
|
28706
28706
|
command,
|
|
@@ -28710,7 +28710,7 @@ var searchRecordOf = /* @__PURE__ */ __name((command, params) => ({
|
|
|
28710
28710
|
fieldsVersion: FIELD_VERSION
|
|
28711
28711
|
}), "searchRecordOf");
|
|
28712
28712
|
|
|
28713
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
28713
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/services/admin-statistics.js
|
|
28714
28714
|
function invalid4(message) {
|
|
28715
28715
|
throw new CliError("validation_error", message);
|
|
28716
28716
|
}
|
|
@@ -29004,7 +29004,7 @@ var adminStatisticsService = /* @__PURE__ */ __name((deps) => ({
|
|
|
29004
29004
|
}, "evidence")
|
|
29005
29005
|
}), "adminStatisticsService");
|
|
29006
29006
|
|
|
29007
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
29007
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/services/archive-gaps.js
|
|
29008
29008
|
import { createHash as createHash7, randomUUID as randomUUID5 } from "node:crypto";
|
|
29009
29009
|
var GAP_BOUNDS = { maxGaps: 5, limit: 500, timeMs: 3e4 };
|
|
29010
29010
|
var validateRepair = /* @__PURE__ */ __name((messenger, options2) => {
|
|
@@ -29141,12 +29141,12 @@ var gapsService = /* @__PURE__ */ __name((deps) => {
|
|
|
29141
29141
|
return { plan, repair };
|
|
29142
29142
|
}, "gapsService");
|
|
29143
29143
|
|
|
29144
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
29144
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/services/attachments.js
|
|
29145
29145
|
import { createHash as createHash10 } from "node:crypto";
|
|
29146
29146
|
import { constants as constants2, mkdirSync as mkdirSync5 } from "node:fs";
|
|
29147
29147
|
import { lstat as lstat5, open as open6, readFile as readFile2, stat as stat2 } from "node:fs/promises";
|
|
29148
29148
|
|
|
29149
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
29149
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/attachments/directory.js
|
|
29150
29150
|
import { lstat as lstat2, readdir as readdir2, realpath as realpath3 } from "node:fs/promises";
|
|
29151
29151
|
import { basename as basename4, join as join14, relative as relative2, sep as sep2 } from "node:path";
|
|
29152
29152
|
var MAX_FILES = 1e4;
|
|
@@ -29217,15 +29217,15 @@ var directoryPaths = /* @__PURE__ */ __name(async (store, chat, directory2, app,
|
|
|
29217
29217
|
return choices;
|
|
29218
29218
|
}, "directoryPaths");
|
|
29219
29219
|
|
|
29220
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
29220
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/attachments/documents.js
|
|
29221
29221
|
import { posix } from "node:path";
|
|
29222
29222
|
|
|
29223
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
29223
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/attachments/container.js
|
|
29224
29224
|
import { setImmediate as tick } from "node:timers/promises";
|
|
29225
29225
|
import { crc32 } from "node:zlib";
|
|
29226
29226
|
var import_xmldom = __toESM(require_lib(), 1);
|
|
29227
29227
|
|
|
29228
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
29228
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/attachments/encoding.js
|
|
29229
29229
|
var import_chardet = __toESM(require_lib2(), 1);
|
|
29230
29230
|
var import_iconv_lite = __toESM(require_lib3(), 1);
|
|
29231
29231
|
var SAMPLE = 65536;
|
|
@@ -29327,7 +29327,7 @@ var decodeXml = /* @__PURE__ */ __name((bytes2) => {
|
|
|
29327
29327
|
return result.text;
|
|
29328
29328
|
}, "decodeXml");
|
|
29329
29329
|
|
|
29330
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
29330
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/attachments/container.js
|
|
29331
29331
|
var MAX_PART = 10 * 1024 * 1024;
|
|
29332
29332
|
var MAX_ENTRIES = 1e3;
|
|
29333
29333
|
var decoder = new TextDecoder("utf-8", { fatal: true });
|
|
@@ -29542,7 +29542,7 @@ var elements = /* @__PURE__ */ __name((node, name, namespace) => {
|
|
|
29542
29542
|
return found;
|
|
29543
29543
|
}, "elements");
|
|
29544
29544
|
|
|
29545
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
29545
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/attachments/sheets.js
|
|
29546
29546
|
var columnName = /* @__PURE__ */ __name((column) => {
|
|
29547
29547
|
let name = "";
|
|
29548
29548
|
for (let rest = column; rest > 0; rest = Math.floor((rest - 1) / 26))
|
|
@@ -29597,7 +29597,7 @@ var sheetText = /* @__PURE__ */ __name((sheets2, maxChars = MAX_TEXT_CHARS) => {
|
|
|
29597
29597
|
return { text: parts.join("").trim(), truncated: false };
|
|
29598
29598
|
}, "sheetText");
|
|
29599
29599
|
|
|
29600
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
29600
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/attachments/documents.js
|
|
29601
29601
|
var OFFICE = "urn:oasis:names:tc:opendocument:xmlns:office:1.0";
|
|
29602
29602
|
var TEXT = "urn:oasis:names:tc:opendocument:xmlns:text:1.0";
|
|
29603
29603
|
var TABLE = "urn:oasis:names:tc:opendocument:xmlns:table:1.0";
|
|
@@ -29997,10 +29997,10 @@ var readDocument = /* @__PURE__ */ __name(async (bytes2, kind2, signal) => {
|
|
|
29997
29997
|
}
|
|
29998
29998
|
}, "readDocument");
|
|
29999
29999
|
|
|
30000
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
30000
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/attachments/extract.js
|
|
30001
30001
|
import { extname as extname3 } from "node:path";
|
|
30002
30002
|
|
|
30003
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
30003
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/readers/engine.js
|
|
30004
30004
|
import { readFileSync as readFileSync7 } from "node:fs";
|
|
30005
30005
|
import { dirname as dirname7, extname as extname2, join as join15 } from "node:path";
|
|
30006
30006
|
import { fileURLToPath } from "node:url";
|
|
@@ -30061,7 +30061,7 @@ var derived = /* @__PURE__ */ __name((bytes2, extractor, read) => {
|
|
|
30061
30061
|
}
|
|
30062
30062
|
}, "derived");
|
|
30063
30063
|
|
|
30064
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
30064
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/readers/image/index.js
|
|
30065
30065
|
var IMAGES = /* @__PURE__ */ new Set([".jpg", ".jpeg", ".png", ".webp", ".gif", ".heic", ".tif", ".tiff", ".bmp"]);
|
|
30066
30066
|
var image2 = {
|
|
30067
30067
|
id: "image",
|
|
@@ -30070,7 +30070,7 @@ var image2 = {
|
|
|
30070
30070
|
read: /* @__PURE__ */ __name(async () => ({ status: "needs-agent" }), "read")
|
|
30071
30071
|
};
|
|
30072
30072
|
|
|
30073
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
30073
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/readers/doc/index.js
|
|
30074
30074
|
var OLE = "\xD0\xCF\xE0\xA1\xB1\xE1";
|
|
30075
30075
|
var doc = {
|
|
30076
30076
|
id: "doc",
|
|
@@ -30082,7 +30082,7 @@ var doc = {
|
|
|
30082
30082
|
}), "read")
|
|
30083
30083
|
};
|
|
30084
30084
|
|
|
30085
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
30085
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/readers/docx/index.js
|
|
30086
30086
|
var DOCX = "application/vnd.openxmlformats-officedocument.wordprocessingml.document";
|
|
30087
30087
|
var docx = {
|
|
30088
30088
|
id: "docx",
|
|
@@ -30095,10 +30095,10 @@ var docx = {
|
|
|
30095
30095
|
}), "read")
|
|
30096
30096
|
};
|
|
30097
30097
|
|
|
30098
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
30098
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/attachments/markup.js
|
|
30099
30099
|
var import_iconv_lite2 = __toESM(require_lib3(), 1);
|
|
30100
30100
|
|
|
30101
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
30101
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/domain/html-entities.js
|
|
30102
30102
|
var NAMED = {
|
|
30103
30103
|
amp: "&",
|
|
30104
30104
|
lt: "<",
|
|
@@ -30150,7 +30150,7 @@ var decodeEntities = /* @__PURE__ */ __name((text3) => text3.replace(/&(#x[0-9a-
|
|
|
30150
30150
|
return body[1] === "x" || body[1] === "X" ? character(Number.parseInt(body.slice(2), 16), entity2) : character(Number(body.slice(1)), entity2);
|
|
30151
30151
|
}), "decodeEntities");
|
|
30152
30152
|
|
|
30153
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
30153
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/attachments/markup.js
|
|
30154
30154
|
var RTF_SKIPPED = /* @__PURE__ */ new Set([
|
|
30155
30155
|
"fonttbl",
|
|
30156
30156
|
"colortbl",
|
|
@@ -30316,7 +30316,7 @@ var htmlText = /* @__PURE__ */ __name((source) => {
|
|
|
30316
30316
|
return decodeEntities(replaceTags(blocks, /<[^>]*>/g, "")).replace(/(?<![ \t\u00a0])[ \t\u00a0]+\n/g, "\n").replace(/\n{3,}/g, "\n\n").trim();
|
|
30317
30317
|
}, "htmlText");
|
|
30318
30318
|
|
|
30319
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
30319
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/readers/html/page.js
|
|
30320
30320
|
var clean = /* @__PURE__ */ __name((value) => typeof value === "string" ? value.replace(/\s+/g, " ").trim() : "", "clean");
|
|
30321
30321
|
var namesIn2 = /* @__PURE__ */ __name((value) => [value].flat().map((entry) => typeof entry === "string" ? clean(entry) : clean(entry?.name)).filter(Boolean).join(", "), "namesIn");
|
|
30322
30322
|
var jsonLdNodes = /* @__PURE__ */ __name((document) => {
|
|
@@ -30360,19 +30360,19 @@ var HEADING = /^(#{1,6})[ \t]+(.+?)[ \t]*#*[ \t]*$/;
|
|
|
30360
30360
|
var markdownSections = /* @__PURE__ */ __name((text3) => {
|
|
30361
30361
|
const found = [];
|
|
30362
30362
|
let fence = false;
|
|
30363
|
-
let
|
|
30363
|
+
let at2 = 0;
|
|
30364
30364
|
for (const line3 of text3.split("\n")) {
|
|
30365
30365
|
if (/^(```|~~~)/.test(line3))
|
|
30366
30366
|
fence = !fence;
|
|
30367
30367
|
const match = fence ? null : HEADING.exec(line3);
|
|
30368
30368
|
if (match?.[1] && match[2])
|
|
30369
|
-
found.push({ heading: match[2], level: match[1].length, start:
|
|
30370
|
-
|
|
30369
|
+
found.push({ heading: match[2], level: match[1].length, start: at2, end: text3.length });
|
|
30370
|
+
at2 += line3.length + 1;
|
|
30371
30371
|
}
|
|
30372
30372
|
return found.map((section, index) => ({ ...section, end: found[index + 1]?.start ?? text3.length }));
|
|
30373
30373
|
}, "markdownSections");
|
|
30374
30374
|
|
|
30375
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
30375
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/readers/html/index.js
|
|
30376
30376
|
var HTML = /* @__PURE__ */ new Set([".html", ".htm", ".xhtml"]);
|
|
30377
30377
|
var first = /* @__PURE__ */ __name((...values) => values.find((value) => typeof value === "string" && value !== ""), "first");
|
|
30378
30378
|
var loaded = /* @__PURE__ */ __name(async (load, name) => {
|
|
@@ -30443,7 +30443,7 @@ var html = {
|
|
|
30443
30443
|
}, "read")
|
|
30444
30444
|
};
|
|
30445
30445
|
|
|
30446
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
30446
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/readers/office/index.js
|
|
30447
30447
|
var office = {
|
|
30448
30448
|
id: "office",
|
|
30449
30449
|
version: documentExtractor("odt"),
|
|
@@ -30454,7 +30454,7 @@ var office = {
|
|
|
30454
30454
|
}, "read")
|
|
30455
30455
|
};
|
|
30456
30456
|
|
|
30457
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
30457
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/readers/pdf/index.js
|
|
30458
30458
|
var pdf = {
|
|
30459
30459
|
id: "pdf",
|
|
30460
30460
|
version: "unpdf",
|
|
@@ -30500,10 +30500,10 @@ var pdf = {
|
|
|
30500
30500
|
const result = await Promise.race([reading(), aborted]);
|
|
30501
30501
|
const pages = Array.isArray(result.text) ? result.text : [result.text];
|
|
30502
30502
|
const text3 = pages.join("\n\n");
|
|
30503
|
-
let
|
|
30503
|
+
let at2 = 0;
|
|
30504
30504
|
const spans = pages.map((page, index) => {
|
|
30505
|
-
const span = { page: index + 1, start:
|
|
30506
|
-
|
|
30505
|
+
const span = { page: index + 1, start: at2, end: at2 + page.length };
|
|
30506
|
+
at2 += page.length + 2;
|
|
30507
30507
|
return span;
|
|
30508
30508
|
});
|
|
30509
30509
|
return text3.trim() === "" ? { status: "needs-agent", extractor } : {
|
|
@@ -30521,7 +30521,7 @@ var pdf = {
|
|
|
30521
30521
|
}), "read")
|
|
30522
30522
|
};
|
|
30523
30523
|
|
|
30524
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
30524
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/readers/plain/index.js
|
|
30525
30525
|
var PLAIN = /* @__PURE__ */ new Set([".txt", ".md", ".markdown", ".csv", ".tsv", ".json", ".log"]);
|
|
30526
30526
|
var isPlain = /* @__PURE__ */ __name((hint) => PLAIN.has(extensionOf(hint)) || hint.mime?.startsWith("text/") || hint.mime === "application/json", "isPlain");
|
|
30527
30527
|
var readPlain = /* @__PURE__ */ __name((bytes2) => {
|
|
@@ -30541,7 +30541,7 @@ var plain = {
|
|
|
30541
30541
|
read: /* @__PURE__ */ __name(async (bytes2) => readPlain(bytes2), "read")
|
|
30542
30542
|
};
|
|
30543
30543
|
|
|
30544
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
30544
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/readers/rtf/index.js
|
|
30545
30545
|
var rtf = {
|
|
30546
30546
|
id: "rtf",
|
|
30547
30547
|
version: "v1",
|
|
@@ -30549,10 +30549,10 @@ var rtf = {
|
|
|
30549
30549
|
read: /* @__PURE__ */ __name(async (bytes2) => derived(bytes2, "rtf:v1", rtfText), "read")
|
|
30550
30550
|
};
|
|
30551
30551
|
|
|
30552
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
30552
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/readers/sheets/index.js
|
|
30553
30553
|
import { basename as basename5 } from "node:path";
|
|
30554
30554
|
|
|
30555
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
30555
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/attachments/csv-spans.js
|
|
30556
30556
|
var delimitedSpans = /* @__PURE__ */ __name((text3, delimiter, maxCells = 1e4) => {
|
|
30557
30557
|
const cells = [];
|
|
30558
30558
|
let row = 1, column = 1, start = 0, quoted = false, truncated = false;
|
|
@@ -30562,23 +30562,23 @@ var delimitedSpans = /* @__PURE__ */ __name((text3, delimiter, maxCells = 1e4) =
|
|
|
30562
30562
|
else
|
|
30563
30563
|
truncated = true;
|
|
30564
30564
|
}, "finish");
|
|
30565
|
-
for (let
|
|
30566
|
-
const char = text3[
|
|
30565
|
+
for (let at2 = 0; at2 < text3.length; at2++) {
|
|
30566
|
+
const char = text3[at2];
|
|
30567
30567
|
if (char === '"') {
|
|
30568
|
-
if (quoted && text3[
|
|
30569
|
-
|
|
30568
|
+
if (quoted && text3[at2 + 1] === '"') {
|
|
30569
|
+
at2++;
|
|
30570
30570
|
continue;
|
|
30571
30571
|
}
|
|
30572
30572
|
quoted = !quoted;
|
|
30573
30573
|
} else if (!quoted && char === delimiter) {
|
|
30574
|
-
finish(
|
|
30575
|
-
start =
|
|
30574
|
+
finish(at2);
|
|
30575
|
+
start = at2 + 1;
|
|
30576
30576
|
column++;
|
|
30577
30577
|
} else if (!quoted && (char === "\n" || char === "\r")) {
|
|
30578
|
-
finish(
|
|
30579
|
-
if (char === "\r" && text3[
|
|
30580
|
-
|
|
30581
|
-
start =
|
|
30578
|
+
finish(at2);
|
|
30579
|
+
if (char === "\r" && text3[at2 + 1] === "\n")
|
|
30580
|
+
at2++;
|
|
30581
|
+
start = at2 + 1;
|
|
30582
30582
|
row++;
|
|
30583
30583
|
column = 1;
|
|
30584
30584
|
}
|
|
@@ -30590,7 +30590,7 @@ var delimitedSpans = /* @__PURE__ */ __name((text3, delimiter, maxCells = 1e4) =
|
|
|
30590
30590
|
return { cells, truncated };
|
|
30591
30591
|
}, "delimitedSpans");
|
|
30592
30592
|
|
|
30593
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
30593
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/readers/sheets/index.js
|
|
30594
30594
|
var DELIMITED = {
|
|
30595
30595
|
".csv": ",",
|
|
30596
30596
|
".tsv": " ",
|
|
@@ -30629,7 +30629,7 @@ var sheets = {
|
|
|
30629
30629
|
}, "read")
|
|
30630
30630
|
};
|
|
30631
30631
|
|
|
30632
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
30632
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/readers/registry.js
|
|
30633
30633
|
var BUILT_INS2 = [office, pdf, docx, doc, rtf, html, sheets, plain, image2];
|
|
30634
30634
|
var HEAD_BYTES = 1024;
|
|
30635
30635
|
var readers = [...BUILT_INS2];
|
|
@@ -30639,7 +30639,7 @@ var readWithRegistry = /* @__PURE__ */ __name(async (bytes2, hint, context2) =>
|
|
|
30639
30639
|
return reader ? reader.read(bytes2, hint, context2) : { status: "unsupported" };
|
|
30640
30640
|
}, "readWithRegistry");
|
|
30641
30641
|
|
|
30642
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
30642
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/attachments/extract.js
|
|
30643
30643
|
var importEngine = /* @__PURE__ */ __name((name) => importFrom(new URL("attachments/extract.js", import.meta.resolve("@wirecat/cli-core")).href, name), "importEngine");
|
|
30644
30644
|
var extensionOf2 = /* @__PURE__ */ __name(({ name, path: path2 }) => extname3(name ?? path2).toLowerCase(), "extensionOf");
|
|
30645
30645
|
var extractText = /* @__PURE__ */ __name(async (bytes2, hint, load, signal, env = process.env) => {
|
|
@@ -31718,7 +31718,7 @@ function imageSize(input) {
|
|
|
31718
31718
|
}
|
|
31719
31719
|
__name(imageSize, "imageSize");
|
|
31720
31720
|
|
|
31721
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
31721
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/attachments/ocr.js
|
|
31722
31722
|
var MAX_PAGES = 20;
|
|
31723
31723
|
var MAX_PIXELS = 2e7;
|
|
31724
31724
|
var cancelled2 = /* @__PURE__ */ __name((signal) => {
|
|
@@ -31878,7 +31878,7 @@ var ocrPdf = /* @__PURE__ */ __name(async (bytes2, pipeline2, load, signal) => {
|
|
|
31878
31878
|
}
|
|
31879
31879
|
}, "ocrPdf");
|
|
31880
31880
|
|
|
31881
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
31881
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/attachments/pdf-preview.js
|
|
31882
31882
|
var pdfPreview = /* @__PURE__ */ __name(async (bytes2, page, signal, load = importEngine, env = process.env) => {
|
|
31883
31883
|
const limits = pdfPreviewLimits(env);
|
|
31884
31884
|
const cancelled3 = /* @__PURE__ */ __name(() => {
|
|
@@ -31955,7 +31955,7 @@ var pdfPreview = /* @__PURE__ */ __name(async (bytes2, page, signal, load = impo
|
|
|
31955
31955
|
}
|
|
31956
31956
|
}, "pdfPreview");
|
|
31957
31957
|
|
|
31958
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
31958
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/attachments/picture-reading.js
|
|
31959
31959
|
import { spawn } from "node:child_process";
|
|
31960
31960
|
import { mkdtempSync, readFileSync as readFileSync8, rmSync as rmSync2, writeFileSync as writeFileSync4 } from "node:fs";
|
|
31961
31961
|
import { tmpdir } from "node:os";
|
|
@@ -32118,7 +32118,7 @@ Read the attached picture.`,
|
|
|
32118
32118
|
}
|
|
32119
32119
|
}, "readPictureWithAgent");
|
|
32120
32120
|
|
|
32121
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
32121
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/attachments/transfer.js
|
|
32122
32122
|
import { createHash as createHash8 } from "node:crypto";
|
|
32123
32123
|
import { constants } from "node:fs";
|
|
32124
32124
|
import { lstat as lstat3, open as open5 } from "node:fs/promises";
|
|
@@ -32226,7 +32226,7 @@ var transferMime = /* @__PURE__ */ __name((head, hint, name = null) => {
|
|
|
32226
32226
|
return hint !== null && /^[a-z0-9.+-]+\/[a-z0-9.+-]+$/i.test(hint) ? hint : "application/octet-stream";
|
|
32227
32227
|
}, "transferMime");
|
|
32228
32228
|
|
|
32229
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
32229
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/services/file-download.js
|
|
32230
32230
|
import { createWriteStream, mkdirSync as mkdirSync4 } from "node:fs";
|
|
32231
32231
|
import { link as link3, rm } from "node:fs/promises";
|
|
32232
32232
|
import { join as join17, resolve as resolve6 } from "node:path";
|
|
@@ -32340,12 +32340,12 @@ var save = /* @__PURE__ */ __name(async (file2, directory2, fallbackName, { uniq
|
|
|
32340
32340
|
}
|
|
32341
32341
|
}, "save");
|
|
32342
32342
|
|
|
32343
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
32343
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/services/pictures.js
|
|
32344
32344
|
import { createHash as createHash9 } from "node:crypto";
|
|
32345
32345
|
import { lstat as lstat4, readFile } from "node:fs/promises";
|
|
32346
32346
|
import { setTimeout as sleep4 } from "node:timers/promises";
|
|
32347
32347
|
|
|
32348
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
32348
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/domain/models.js
|
|
32349
32349
|
var GROUP_SETTINGS = [
|
|
32350
32350
|
"allCanPin",
|
|
32351
32351
|
"onlyAdminsAdd",
|
|
@@ -32359,7 +32359,7 @@ var ADMIN_RIGHTS = ["read", "members", "admins", "info", "pin", "link", "post",
|
|
|
32359
32359
|
var senderIsMe = /* @__PURE__ */ __name((message, account) => message.outgoing === true || message.senderId !== null && String(message.senderId) === account, "senderIsMe");
|
|
32360
32360
|
var MEDIA_KINDS = ["photo", "video", "file", "audio", "link"];
|
|
32361
32361
|
|
|
32362
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
32362
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/services/pictures.js
|
|
32363
32363
|
var PICTURE_MAX_BYTES = 25 * 1024 * 1024;
|
|
32364
32364
|
var PICTURE_FLOOR = 0.25;
|
|
32365
32365
|
var PAGE4 = 50;
|
|
@@ -32400,7 +32400,7 @@ var picturesService = /* @__PURE__ */ __name((deps) => {
|
|
|
32400
32400
|
const directory2 = imageModelsDirectory(deps.env);
|
|
32401
32401
|
if (!isImageModelInstalled(model2, directory2))
|
|
32402
32402
|
throw new CliError("not_found", missingModel(model2.id), { reason: "model.not-downloaded", model: model2.id });
|
|
32403
|
-
const { openPictureEmbedder } = await import("./embedder-
|
|
32403
|
+
const { openPictureEmbedder } = await import("./embedder-Q7ID2LEG.js");
|
|
32404
32404
|
return openPictureEmbedder(model2, directory2);
|
|
32405
32405
|
}, "open");
|
|
32406
32406
|
const embedder = /* @__PURE__ */ __name(() => {
|
|
@@ -32574,7 +32574,7 @@ var withPictures = /* @__PURE__ */ __name((messages, pictures) => ({
|
|
|
32574
32574
|
}, "search")
|
|
32575
32575
|
}), "withPictures");
|
|
32576
32576
|
|
|
32577
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
32577
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/services/attachments.js
|
|
32578
32578
|
var ATTACHMENT_QUERY = {
|
|
32579
32579
|
entity: "attachment",
|
|
32580
32580
|
backend: "sql",
|
|
@@ -33045,7 +33045,7 @@ var attachmentsService = /* @__PURE__ */ __name((deps) => ({
|
|
|
33045
33045
|
}, "readPicture")
|
|
33046
33046
|
}), "attachmentsService");
|
|
33047
33047
|
|
|
33048
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
33048
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/services/chat-documents.js
|
|
33049
33049
|
var chatDocumentsService = /* @__PURE__ */ __name((deps) => ({
|
|
33050
33050
|
list: /* @__PURE__ */ __name(async (chat, { limit, offset, ref }) => {
|
|
33051
33051
|
const store = await accountStore(deps);
|
|
@@ -33075,7 +33075,7 @@ var chatDocumentsService = /* @__PURE__ */ __name((deps) => ({
|
|
|
33075
33075
|
}, "list")
|
|
33076
33076
|
}), "chatDocumentsService");
|
|
33077
33077
|
|
|
33078
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
33078
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/services/retention.js
|
|
33079
33079
|
var observationDuration = /* @__PURE__ */ __name((text3, flag) => {
|
|
33080
33080
|
const match = /^(\d+(?:\.\d+)?)([smhdw])$/.exec(text3);
|
|
33081
33081
|
const units2 = { s: 1e3, m: 6e4, h: 36e5, d: 864e5, w: 6048e5 };
|
|
@@ -33162,7 +33162,7 @@ var isRetentionSelection = /* @__PURE__ */ __name((selection) => {
|
|
|
33162
33162
|
}
|
|
33163
33163
|
}, "isRetentionSelection");
|
|
33164
33164
|
|
|
33165
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
33165
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/services/counters.js
|
|
33166
33166
|
var counterFields = /* @__PURE__ */ __name((text3 = "views,reactions,comments") => {
|
|
33167
33167
|
const fields2 = text3.split(",").map((one) => one.trim());
|
|
33168
33168
|
if (!fields2.length || fields2.some((one) => !COUNTER_FIELDS.includes(one)) || new Set(fields2).size !== fields2.length)
|
|
@@ -33369,7 +33369,7 @@ var countersService = /* @__PURE__ */ __name((deps) => {
|
|
|
33369
33369
|
};
|
|
33370
33370
|
}, "countersService");
|
|
33371
33371
|
|
|
33372
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
33372
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/search/respell.js
|
|
33373
33373
|
var LATIN = {
|
|
33374
33374
|
\u0430: "a",
|
|
33375
33375
|
\u0431: "b",
|
|
@@ -33424,10 +33424,11 @@ var respelled = /* @__PURE__ */ __name(async (vocabulary, words3) => {
|
|
|
33424
33424
|
return found;
|
|
33425
33425
|
}, "respelled");
|
|
33426
33426
|
|
|
33427
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
33427
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/services/named-chat.js
|
|
33428
33428
|
var LEAST_USES = 3;
|
|
33429
33429
|
var SAMPLE2 = 50;
|
|
33430
33430
|
var CAPITALISED = 0.8;
|
|
33431
|
+
var NAMED_SHARE = 0.05;
|
|
33431
33432
|
var namedChat = /* @__PURE__ */ __name(async (store, account, messenger, accounts, words3) => {
|
|
33432
33433
|
for (const word of words3) {
|
|
33433
33434
|
if (word.length < 3 || new RegExp("^\\p{N}+$", "u").test(word))
|
|
@@ -33440,6 +33441,7 @@ var namedChat = /* @__PURE__ */ __name(async (store, account, messenger, account
|
|
|
33440
33441
|
messenger
|
|
33441
33442
|
);
|
|
33442
33443
|
const groups = (await store.queries.countQuery(execution, "chat")).sort((a, b) => b.count - a.count);
|
|
33444
|
+
const total = groups.reduce((sum2, { count: count3 }) => sum2 + count3, 0);
|
|
33443
33445
|
const dialogs = [];
|
|
33444
33446
|
for (const group of groups) {
|
|
33445
33447
|
if (dialogs.length === 2)
|
|
@@ -33452,6 +33454,8 @@ var namedChat = /* @__PURE__ */ __name(async (store, account, messenger, account
|
|
|
33452
33454
|
const [best, next] = dialogs;
|
|
33453
33455
|
if (!best || best.count < LEAST_USES || next && next.count * 2 > best.count)
|
|
33454
33456
|
continue;
|
|
33457
|
+
if (best.count < total * NAMED_SHARE)
|
|
33458
|
+
continue;
|
|
33455
33459
|
const { items } = await store.queries.matchQuery({
|
|
33456
33460
|
...execution,
|
|
33457
33461
|
chat: { account: best.source, chatId: best.chatId }
|
|
@@ -33474,7 +33478,7 @@ var queryWords2 = /* @__PURE__ */ __name((query) => {
|
|
|
33474
33478
|
}, "queryWords");
|
|
33475
33479
|
var without = /* @__PURE__ */ __name((query, word) => query.replace(new RegExp(`(?<![\\p{L}\\p{N}])${word}(?![\\p{L}\\p{N}])`, "giu"), " ").replace(/\s+/gu, " ").trim(), "without");
|
|
33476
33480
|
|
|
33477
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
33481
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/services/search-refresh.js
|
|
33478
33482
|
var SYNC_KEY = "messages.sync-first";
|
|
33479
33483
|
var SYNC_BOUNDS = { maxChats: 5, timeMs: 3e4, maxMessages: 500 };
|
|
33480
33484
|
var keyOf3 = /* @__PURE__ */ __name((chat) => JSON.stringify([chat.account.provider, chat.account.account, chat.chatId]), "keyOf");
|
|
@@ -33485,7 +33489,7 @@ var chatScope = /* @__PURE__ */ __name((node) => {
|
|
|
33485
33489
|
const required2 = node.clauses.filter(({ occur }) => occur === "must").map(({ node: node2 }) => chatScope(node2));
|
|
33486
33490
|
const bounded = required2.filter((scope) => scope !== void 0);
|
|
33487
33491
|
if (bounded.length)
|
|
33488
|
-
return bounded.reduce((one, other) => one.filter((chat) => other.some((
|
|
33492
|
+
return bounded.reduce((one, other) => one.filter((chat) => other.some((at2) => keyOf3(at2) === keyOf3(chat))));
|
|
33489
33493
|
const optional2 = node.clauses.filter(({ occur }) => occur === "should").map(({ node: node2 }) => chatScope(node2));
|
|
33490
33494
|
if (!optional2.length || optional2.some((scope) => scope === void 0))
|
|
33491
33495
|
return void 0;
|
|
@@ -33606,12 +33610,18 @@ var withRefresh = /* @__PURE__ */ __name((found, refreshed) => ({
|
|
|
33606
33610
|
...!refreshed || refreshed.complete ? {} : { coverage: { ...found.coverage, state: "stale" } }
|
|
33607
33611
|
}), "withRefresh");
|
|
33608
33612
|
|
|
33609
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
33613
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/services/embeddings-search.js
|
|
33610
33614
|
var CANDIDATES = 50;
|
|
33611
33615
|
var ACROSS_CHATS = 500;
|
|
33612
33616
|
var OWN_BLOCK = 5;
|
|
33613
33617
|
var PER_CHAT = 20;
|
|
33618
|
+
var BIG_CHAT = 100;
|
|
33614
33619
|
var WORD_HITS = 200;
|
|
33620
|
+
var SHOWN_LINES = 3;
|
|
33621
|
+
var SHOWN_CHARS = 200;
|
|
33622
|
+
var SHOWN_HEAD = 80;
|
|
33623
|
+
var CHUNK_READ = 60;
|
|
33624
|
+
var REPLIES_READ = 60;
|
|
33615
33625
|
var RRF_K2 = 60;
|
|
33616
33626
|
var embeddingsSearch = /* @__PURE__ */ __name((deps) => {
|
|
33617
33627
|
const command = deps.messenger.app.command;
|
|
@@ -33630,6 +33640,7 @@ var embeddingsSearch = /* @__PURE__ */ __name((deps) => {
|
|
|
33630
33640
|
}, deps.messenger);
|
|
33631
33641
|
const { items } = await store.queries.matchQuery({
|
|
33632
33642
|
...lexical.execution,
|
|
33643
|
+
rareWordsFirst: true,
|
|
33633
33644
|
...prepared.selectedChat ? {} : { perChat: PER_CHAT },
|
|
33634
33645
|
...prepared.selectedChat ? { chat: prepared.selectedChat } : {},
|
|
33635
33646
|
...conversations === void 0 ? {} : { conversationIds: conversations },
|
|
@@ -33639,13 +33650,13 @@ var embeddingsSearch = /* @__PURE__ */ __name((deps) => {
|
|
|
33639
33650
|
const sources = /* @__PURE__ */ new Map();
|
|
33640
33651
|
for (const account of prepared.scopeAccounts) {
|
|
33641
33652
|
const refs = items.flatMap((hit, index) => {
|
|
33642
|
-
const
|
|
33643
|
-
return
|
|
33653
|
+
const at2 = parseLocator(hit.locator);
|
|
33654
|
+
return at2.provider === account.provider && at2.account === account.account ? [{ hit, index }] : [];
|
|
33644
33655
|
});
|
|
33645
33656
|
const found = await store.conversations.conversationsOfMessages(account, refs.map(({ hit }) => ({ chatId: hit.chatId, messageId: hit.id })));
|
|
33646
33657
|
const chats = /* @__PURE__ */ new Set();
|
|
33647
|
-
refs.forEach(({ hit, index },
|
|
33648
|
-
const summary = found[
|
|
33658
|
+
refs.forEach(({ hit, index }, at2) => {
|
|
33659
|
+
const summary = found[at2];
|
|
33649
33660
|
if (summary) {
|
|
33650
33661
|
summaries.set(index, summary);
|
|
33651
33662
|
sources.set(summary.id, account);
|
|
@@ -33680,8 +33691,8 @@ var embeddingsSearch = /* @__PURE__ */ __name((deps) => {
|
|
|
33680
33691
|
const emails = [];
|
|
33681
33692
|
for (const account of mailAccounts) {
|
|
33682
33693
|
const found = mail.items.filter((hit) => {
|
|
33683
|
-
const
|
|
33684
|
-
return
|
|
33694
|
+
const at2 = parseLocator(hit.locator);
|
|
33695
|
+
return at2.account === account.account && (since === void 0 || hit.timestamp >= since);
|
|
33685
33696
|
});
|
|
33686
33697
|
if (!found.length)
|
|
33687
33698
|
continue;
|
|
@@ -33712,11 +33723,13 @@ var embeddingsSearch = /* @__PURE__ */ __name((deps) => {
|
|
|
33712
33723
|
});
|
|
33713
33724
|
return { hits, outside, sources, respellings };
|
|
33714
33725
|
}, "byWords");
|
|
33715
|
-
const search = /* @__PURE__ */ __name(async (query, { chat, model: choice, since, limit, filter, source, timezone, syncFirst, signal, refresh, timeLimitMs }) => {
|
|
33726
|
+
const search = /* @__PURE__ */ __name(async (query, { chat, model: choice, since, limit, filter, source, timezone, syncFirst, signal, refresh, timeLimitMs, like }) => {
|
|
33716
33727
|
if (!query.trim())
|
|
33717
33728
|
searchError("query.invalid-syntax", { start: 0, end: query.length }, "give words to search for");
|
|
33718
33729
|
if (new TextEncoder().encode(query).length > QUERY_LIMITS.bytes)
|
|
33719
33730
|
searchError("query.too-large", { start: 0, end: query.length }, "query is longer than 8 KiB");
|
|
33731
|
+
if (like !== void 0 && new TextEncoder().encode(like).length > QUERY_LIMITS.bytes)
|
|
33732
|
+
throw new CliError("validation_error", "--like is longer than 8 KiB: one sentence is enough");
|
|
33720
33733
|
const refreshed = await refreshSearch(deps, {
|
|
33721
33734
|
chat,
|
|
33722
33735
|
limit,
|
|
@@ -33755,56 +33768,59 @@ var embeddingsSearch = /* @__PURE__ */ __name((deps) => {
|
|
|
33755
33768
|
respellings: /* @__PURE__ */ new Map()
|
|
33756
33769
|
};
|
|
33757
33770
|
});
|
|
33758
|
-
const
|
|
33771
|
+
const texts = like?.trim() ? [query, like] : [query];
|
|
33772
|
+
const meaning = texts.map(() => []);
|
|
33759
33773
|
const own = [];
|
|
33760
33774
|
const sources = words3.sources;
|
|
33761
33775
|
if (target2.installed && prepared.scopeAccounts.length && eligibility?.conversations.length !== 0) {
|
|
33762
33776
|
await withEmbedder(deps, target2, choice, {}, async (embedder) => {
|
|
33763
|
-
const
|
|
33764
|
-
for (const
|
|
33765
|
-
const
|
|
33766
|
-
|
|
33767
|
-
|
|
33768
|
-
|
|
33769
|
-
|
|
33770
|
-
|
|
33771
|
-
|
|
33772
|
-
|
|
33773
|
-
|
|
33774
|
-
|
|
33775
|
-
|
|
33776
|
-
|
|
33777
|
-
|
|
33778
|
-
|
|
33779
|
-
|
|
33780
|
-
|
|
33781
|
-
|
|
33782
|
-
|
|
33783
|
-
|
|
33784
|
-
|
|
33785
|
-
|
|
33786
|
-
|
|
33787
|
-
|
|
33788
|
-
|
|
33789
|
-
|
|
33790
|
-
|
|
33791
|
-
|
|
33792
|
-
|
|
33793
|
-
|
|
33794
|
-
|
|
33795
|
-
|
|
33796
|
-
|
|
33797
|
-
|
|
33798
|
-
|
|
33799
|
-
|
|
33800
|
-
|
|
33801
|
-
|
|
33777
|
+
const vectors = await embedder.embed(texts, "query");
|
|
33778
|
+
for (const [at2, vector] of vectors.entries())
|
|
33779
|
+
for (const one of prepared.scopeAccounts) {
|
|
33780
|
+
const scope = scopeOf5(one);
|
|
33781
|
+
if (scope === null)
|
|
33782
|
+
continue;
|
|
33783
|
+
const whole3 = "chatId" in scope || one.provider === MAIL;
|
|
33784
|
+
const hits2 = await store.vectors.nearestConversations(one, {
|
|
33785
|
+
...scope,
|
|
33786
|
+
...since === void 0 ? {} : { since },
|
|
33787
|
+
model: target2.key,
|
|
33788
|
+
limit: whole3 ? Math.max(limit, CANDIDATES) : Math.max(limit, ACROSS_CHATS),
|
|
33789
|
+
query: vector,
|
|
33790
|
+
...eligibility ? { conversations: eligibility.conversations } : {}
|
|
33791
|
+
});
|
|
33792
|
+
const images = at2 > 0 ? [] : await store.vectors.nearestImages(one, {
|
|
33793
|
+
...scope,
|
|
33794
|
+
...since === void 0 ? {} : { since },
|
|
33795
|
+
model: target2.key,
|
|
33796
|
+
limit: Math.max(limit, CANDIDATES),
|
|
33797
|
+
query: vector
|
|
33798
|
+
});
|
|
33799
|
+
const found = [
|
|
33800
|
+
...hits2,
|
|
33801
|
+
...images.filter((hit) => !eligibility || eligibility.conversations.includes(hit.summary.id))
|
|
33802
|
+
].sort((a, b) => b.score - a.score);
|
|
33803
|
+
const mine = at2 > 0 ? [] : await store.vectors.nearestConversations(one, {
|
|
33804
|
+
...scope,
|
|
33805
|
+
...since === void 0 ? {} : { since },
|
|
33806
|
+
model: target2.key,
|
|
33807
|
+
limit: OWN_BLOCK,
|
|
33808
|
+
query: vector,
|
|
33809
|
+
fromOwner: true,
|
|
33810
|
+
...eligibility ? { conversations: eligibility.conversations } : {}
|
|
33811
|
+
});
|
|
33812
|
+
for (const hit of found)
|
|
33813
|
+
sources.set(hit.summary.id, one);
|
|
33814
|
+
for (const hit of mine) {
|
|
33815
|
+
sources.set(hit.summary.id, one);
|
|
33816
|
+
own.push(hit);
|
|
33817
|
+
}
|
|
33818
|
+
meaning[at2]?.push(...whole3 ? found.map((hit) => ({ hit, lead: hit.score })) : shared(found, limit));
|
|
33802
33819
|
}
|
|
33803
|
-
meaning.push(...whole3 ? found.map((hit) => ({ hit, lead: hit.score })) : shared(found, limit));
|
|
33804
|
-
}
|
|
33805
33820
|
});
|
|
33806
33821
|
}
|
|
33807
|
-
|
|
33822
|
+
for (const list3 of meaning)
|
|
33823
|
+
list3.sort((a, b) => b.lead - a.lead);
|
|
33808
33824
|
const scoped = [];
|
|
33809
33825
|
const elsewhere = [];
|
|
33810
33826
|
for (const one of prepared.scopeAccounts) {
|
|
@@ -33833,17 +33849,46 @@ var embeddingsSearch = /* @__PURE__ */ __name((deps) => {
|
|
|
33833
33849
|
locator: formatLocator({ ...source2, chat: hit.summary.chatId, message: hit.chunk.firstMessageId })
|
|
33834
33850
|
};
|
|
33835
33851
|
}, "located");
|
|
33836
|
-
const hits = fused(meaning.map(({ hit }) => hit), words3.hits, meaningFloor(target2.key)).slice(0, limit).map(located);
|
|
33852
|
+
const hits = fused(meaning.map((list3) => list3.map(({ hit }) => hit)), words3.hits, meaningFloor(target2.key)).slice(0, limit).map(located);
|
|
33837
33853
|
const shown = new Set(hits.map((hit) => hit.summary.id));
|
|
33838
|
-
const
|
|
33854
|
+
const ownOf = /* @__PURE__ */ __name((keep2) => own.filter(keep2).sort((a, b) => b.score - a.score).slice(0, OWN_BLOCK).map((hit) => located({ ...hit, by: ["meaning"] })), "ownOf");
|
|
33855
|
+
const ownHits = ownOf((hit) => !shown.has(hit.summary.id));
|
|
33856
|
+
const ownSpare = ownOf((hit) => shown.has(hit.summary.id));
|
|
33857
|
+
const asked = wordStems(query);
|
|
33858
|
+
const stems = [...asked, ...wordStems(texts.join(" "))];
|
|
33859
|
+
const replies = (async () => {
|
|
33860
|
+
const found = /* @__PURE__ */ new Map();
|
|
33861
|
+
const bySource = /* @__PURE__ */ new Map();
|
|
33862
|
+
for (const hit of [...hits, ...ownHits, ...ownSpare]) {
|
|
33863
|
+
const source2 = hit.source ?? account;
|
|
33864
|
+
const group = bySource.get(JSON.stringify(source2)) ?? { source: source2, hits: [] };
|
|
33865
|
+
group.hits.push(hit);
|
|
33866
|
+
bySource.set(JSON.stringify(source2), group);
|
|
33867
|
+
}
|
|
33868
|
+
for (const { source: source2, hits: group } of bySource.values()) {
|
|
33869
|
+
const read = await store.conversations.chunkReplies(source2, group.map(({ summary, chunk }) => ({ conversationId: summary.id, ...chunk })), REPLIES_READ);
|
|
33870
|
+
for (const [index, hit] of group.entries())
|
|
33871
|
+
found.set(hit, read[index] ?? []);
|
|
33872
|
+
}
|
|
33873
|
+
return found;
|
|
33874
|
+
})();
|
|
33875
|
+
const withLines = /* @__PURE__ */ __name(async (hit, ownFirst) => {
|
|
33876
|
+
const read = await store.conversations.chunkMessages(hit.source ?? account, hit.summary.id, hit.chunk, CHUNK_READ);
|
|
33877
|
+
const lines = [
|
|
33878
|
+
...shownLines(read, stems, ownFirst, asked),
|
|
33879
|
+
...shownLines((await replies).get(hit) ?? [], stems, false, [], 1)
|
|
33880
|
+
];
|
|
33881
|
+
return lines.length ? { ...hit, lines } : hit;
|
|
33882
|
+
}, "withLines");
|
|
33839
33883
|
return {
|
|
33840
33884
|
accounts: prepared.scopeAccounts,
|
|
33841
33885
|
model: target2.id,
|
|
33842
33886
|
meaning: target2.installed ? "searched" : "unavailable",
|
|
33843
33887
|
...wordsOutOfTime ? { words: "out-of-time" } : {},
|
|
33844
33888
|
...words3.respellings.size ? { respelled: Object.fromEntries(words3.respellings) } : {},
|
|
33845
|
-
hits,
|
|
33846
|
-
...ownHits.length ? { own: ownHits } : {},
|
|
33889
|
+
hits: await Promise.all(hits.map((hit) => withLines(hit, false))),
|
|
33890
|
+
...ownHits.length ? { own: await Promise.all(ownHits.map((hit) => withLines(hit, true))) } : {},
|
|
33891
|
+
...ownSpare.length ? { ownSpare: await Promise.all(ownSpare.map((hit) => withLines(hit, true))) } : {},
|
|
33847
33892
|
readiness,
|
|
33848
33893
|
...locallyRefreshed ? { prepared: locallyRefreshed } : {},
|
|
33849
33894
|
...refreshed ? { refreshed, coverage: { state: refreshed.complete ? "partial" : "stale" } } : {},
|
|
@@ -33853,7 +33898,7 @@ var embeddingsSearch = /* @__PURE__ */ __name((deps) => {
|
|
|
33853
33898
|
return {
|
|
33854
33899
|
/** Over every chat, a query that names someone by a name their private chat uses has that chat's hits first. */
|
|
33855
33900
|
search: /* @__PURE__ */ __name(async (query, options2) => {
|
|
33856
|
-
const found = await search(query, options2);
|
|
33901
|
+
const { ownSpare, ...found } = await search(query, options2);
|
|
33857
33902
|
if (options2.chat !== void 0 || options2.filter !== void 0 || found.accounts?.length !== 1)
|
|
33858
33903
|
return found;
|
|
33859
33904
|
const named2 = await namedChat(await deps.store(), await deps.account(), deps.messenger, found.accounts, queryWords2(query)).catch((error) => {
|
|
@@ -33867,10 +33912,15 @@ var embeddingsSearch = /* @__PURE__ */ __name((deps) => {
|
|
|
33867
33912
|
const { syncFirst: _, refresh: __, ...plain2 } = options2;
|
|
33868
33913
|
const inside2 = await search(rest || query, { ...plain2, chat: named2.chatId });
|
|
33869
33914
|
const shown = new Set(inside2.hits.map(({ summary }) => summary.id));
|
|
33915
|
+
const hits = [...inside2.hits, ...found.hits.filter(({ summary }) => !shown.has(summary.id))].slice(0, options2.limit);
|
|
33916
|
+
const kept2 = new Set(hits.map(({ summary }) => summary.id));
|
|
33917
|
+
const own = [...found.own ?? [], ...(ownSpare ?? []).filter(({ summary }) => !kept2.has(summary.id))].sort((a, b) => (b.score ?? 0) - (a.score ?? 0)).slice(0, OWN_BLOCK);
|
|
33918
|
+
const { own: _shown, ...plainFound } = found;
|
|
33870
33919
|
return {
|
|
33871
|
-
...
|
|
33920
|
+
...plainFound,
|
|
33921
|
+
...own.length ? { own } : {},
|
|
33872
33922
|
named: { word: named2.word, chatId: named2.chatId, title: named2.title },
|
|
33873
|
-
hits
|
|
33923
|
+
hits
|
|
33874
33924
|
};
|
|
33875
33925
|
}, "search"),
|
|
33876
33926
|
related: /* @__PURE__ */ __name(async (chat, message, { model: choice, limit }) => {
|
|
@@ -33910,23 +33960,32 @@ var shared = /* @__PURE__ */ __name((hits, limit) => {
|
|
|
33910
33960
|
for (const hit of hits)
|
|
33911
33961
|
chats.set(hit.summary.chatId, [...chats.get(hit.summary.chatId) ?? [], hit]);
|
|
33912
33962
|
return [...chats.values()].flatMap((own) => {
|
|
33913
|
-
const
|
|
33914
|
-
|
|
33963
|
+
const share = own.length >= BIG_CHAT ? BIG_CHAT : PER_CHAT;
|
|
33964
|
+
const level2 = own[Math.min(share, own.length) - 1]?.score ?? 0;
|
|
33965
|
+
return own.slice(0, Math.max(limit, share)).map((hit, at2) => ({ hit, lead: share > PER_CHAT && at2 >= PER_CHAT ? hit.score - 10 : hit.score - level2 }));
|
|
33915
33966
|
});
|
|
33916
33967
|
}, "shared");
|
|
33917
33968
|
var fused = /* @__PURE__ */ __name((meaning, words3, minimumCosine) => {
|
|
33918
33969
|
const merged2 = /* @__PURE__ */ new Map();
|
|
33919
|
-
|
|
33920
|
-
|
|
33921
|
-
summary
|
|
33922
|
-
|
|
33923
|
-
|
|
33924
|
-
|
|
33925
|
-
|
|
33926
|
-
|
|
33927
|
-
|
|
33970
|
+
for (const list3 of meaning)
|
|
33971
|
+
list3.filter(({ score }) => score > minimumCosine).forEach(({ summary, chunk, score, stale, matchedIn }, index) => {
|
|
33972
|
+
const key = matchedIn ? `${summary.id}#${chunk.firstMessageId}` : summary.id;
|
|
33973
|
+
const share = 1 / (RRF_K2 + index + 1);
|
|
33974
|
+
const held = merged2.get(key);
|
|
33975
|
+
if (!held) {
|
|
33976
|
+
merged2.set(key, {
|
|
33977
|
+
summary,
|
|
33978
|
+
chunk,
|
|
33979
|
+
score,
|
|
33980
|
+
by: ["meaning"],
|
|
33981
|
+
stale,
|
|
33982
|
+
...matchedIn ? { matchedIn } : {},
|
|
33983
|
+
fused: share
|
|
33984
|
+
});
|
|
33985
|
+
return;
|
|
33986
|
+
}
|
|
33987
|
+
held.fused += share;
|
|
33928
33988
|
});
|
|
33929
|
-
});
|
|
33930
33989
|
words3.forEach(({ summary, chunk }, index) => {
|
|
33931
33990
|
const share = 1 / (RRF_K2 + index + 1);
|
|
33932
33991
|
const held = merged2.get(summary.id);
|
|
@@ -33938,6 +33997,35 @@ var fused = /* @__PURE__ */ __name((meaning, words3, minimumCosine) => {
|
|
|
33938
33997
|
});
|
|
33939
33998
|
return [...merged2.values()].sort((a, b) => b.fused - a.fused || (b.score ?? -2) - (a.score ?? -2)).map(({ fused: _, ...hit }) => hit);
|
|
33940
33999
|
}, "fused");
|
|
34000
|
+
var wordStems = /* @__PURE__ */ __name((text3) => [...new Set(queryWords2(text3).map((word) => word.slice(0, 5)))], "wordStems");
|
|
34001
|
+
var shownLines = /* @__PURE__ */ __name((read, stems, ownFirst, asked, count3 = SHOWN_LINES) => {
|
|
34002
|
+
const scored = read.map(({ text: text3, ...line3 }, at2) => {
|
|
34003
|
+
const flat = text3.replace(/\s+/g, " ").trim();
|
|
34004
|
+
const lower = flat.toLowerCase();
|
|
34005
|
+
const found = stems.filter((stem) => lower.includes(stem));
|
|
34006
|
+
const first2 = found.reduce((least, stem) => Math.min(least, lower.indexOf(stem)), Number.POSITIVE_INFINITY);
|
|
34007
|
+
return { ...line3, flat, at: at2, score: found.length + (ownFirst && line3.outgoing ? 100 : 0), first: first2 };
|
|
34008
|
+
});
|
|
34009
|
+
const picked = [...scored].sort((a, b) => b.score - a.score || a.at - b.at).slice(0, count3);
|
|
34010
|
+
const matches = /* @__PURE__ */ __name((flat) => asked.filter((stem) => flat.toLowerCase().includes(stem)).length, "matches");
|
|
34011
|
+
const asking = scored.reduce((best, line3) => matches(line3.flat) > (best ? matches(best.flat) : 0) ? line3 : best, void 0);
|
|
34012
|
+
const reply = asking && scored[asking.at + 1];
|
|
34013
|
+
if (reply && !picked.includes(reply))
|
|
34014
|
+
picked.push(reply);
|
|
34015
|
+
return picked.sort((a, b) => a.at - b.at).map(({ sender, flat, outgoing, first: first2 }) => {
|
|
34016
|
+
const who2 = outgoing ? `${sender ?? "you"}${sender ? " (you)" : ""}: ` : sender ? `${sender}: ` : "";
|
|
34017
|
+
return `${who2}${cutAround(flat, first2)}`;
|
|
34018
|
+
});
|
|
34019
|
+
}, "shownLines");
|
|
34020
|
+
var cutAround = /* @__PURE__ */ __name((flat, first2) => {
|
|
34021
|
+
if (flat.length <= SHOWN_CHARS)
|
|
34022
|
+
return flat;
|
|
34023
|
+
if (!Number.isFinite(first2) || first2 < SHOWN_CHARS - 25)
|
|
34024
|
+
return `${flat.slice(0, SHOWN_CHARS)}\u2026`;
|
|
34025
|
+
const tail = SHOWN_CHARS - SHOWN_HEAD;
|
|
34026
|
+
const from = Math.min(first2 - 30, flat.length - tail);
|
|
34027
|
+
return `${flat.slice(0, SHOWN_HEAD)}\u2026${flat.slice(from, from + tail)}${from + tail < flat.length ? "\u2026" : ""}`;
|
|
34028
|
+
}, "cutAround");
|
|
33941
34029
|
var searchReadiness = /* @__PURE__ */ __name((chats, meaning, outside) => {
|
|
33942
34030
|
const built = new Set(chats.filter(({ state }) => state !== "not-built").map(({ chat }) => chat));
|
|
33943
34031
|
const ids = /* @__PURE__ */ __name((keep2) => chats.filter(keep2).map(({ chat }) => chat), "ids");
|
|
@@ -33962,13 +34050,13 @@ var meanOf = /* @__PURE__ */ __name((vectors) => {
|
|
|
33962
34050
|
return mean2.map((value) => value / length);
|
|
33963
34051
|
}, "meanOf");
|
|
33964
34052
|
|
|
33965
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34053
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/services/embeddings.js
|
|
33966
34054
|
var embeddingsService = /* @__PURE__ */ __name((deps) => ({
|
|
33967
34055
|
...embeddingsMaintenance(deps),
|
|
33968
34056
|
...embeddingsSearch(deps)
|
|
33969
34057
|
}), "embeddingsService");
|
|
33970
34058
|
|
|
33971
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34059
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/services/folders.js
|
|
33972
34060
|
var foldersService = /* @__PURE__ */ __name((deps) => {
|
|
33973
34061
|
const online = /* @__PURE__ */ __name(async (command) => {
|
|
33974
34062
|
if (deps.offline)
|
|
@@ -34109,7 +34197,7 @@ var foldersService = /* @__PURE__ */ __name((deps) => {
|
|
|
34109
34197
|
};
|
|
34110
34198
|
}, "foldersService");
|
|
34111
34199
|
|
|
34112
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34200
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/services/mentions.js
|
|
34113
34201
|
var REVIEW_COUNT = 500;
|
|
34114
34202
|
var mentionsService = /* @__PURE__ */ __name((deps) => {
|
|
34115
34203
|
const located = /* @__PURE__ */ __name(async () => {
|
|
@@ -34188,7 +34276,7 @@ var mentionsService = /* @__PURE__ */ __name((deps) => {
|
|
|
34188
34276
|
};
|
|
34189
34277
|
}, "mentionsService");
|
|
34190
34278
|
|
|
34191
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34279
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/domain/message-link.js
|
|
34192
34280
|
var fileLinks = /* @__PURE__ */ __name((attachments) => hitFiles(attachments).map(({ position, kind: kind2, name }) => ({
|
|
34193
34281
|
position,
|
|
34194
34282
|
kind: kind2,
|
|
@@ -34237,7 +34325,7 @@ var validatePermalink = /* @__PURE__ */ __name((link4) => {
|
|
|
34237
34325
|
return { url: link4.url, access: link4.access, reason: link4.reason };
|
|
34238
34326
|
}, "validatePermalink");
|
|
34239
34327
|
|
|
34240
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34328
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/domain/pin-duration.js
|
|
34241
34329
|
var spokenSeconds = /* @__PURE__ */ __name((seconds) => {
|
|
34242
34330
|
if (seconds % 86400 === 0 && seconds > 86400)
|
|
34243
34331
|
return `${seconds / 86400}d`;
|
|
@@ -34269,7 +34357,7 @@ var pinDurationOf = /* @__PURE__ */ __name((value, allowed, flag = "--expire-tim
|
|
|
34269
34357
|
return seconds;
|
|
34270
34358
|
}, "pinDurationOf");
|
|
34271
34359
|
|
|
34272
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34360
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/sends/send-as.js
|
|
34273
34361
|
var sendAsCheck = /* @__PURE__ */ __name((connection, sendAs) => {
|
|
34274
34362
|
if (sendAs === void 0) {
|
|
34275
34363
|
const saved = connection.savedSender?.bind(connection);
|
|
@@ -34294,7 +34382,7 @@ var typedSendAs = /* @__PURE__ */ __name((typed) => {
|
|
|
34294
34382
|
return sendAs;
|
|
34295
34383
|
}, "typedSendAs");
|
|
34296
34384
|
|
|
34297
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34385
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/search/total.js
|
|
34298
34386
|
var TOTAL_CAP = 1e4;
|
|
34299
34387
|
var totalOf = /* @__PURE__ */ __name((count3, shown, hasMore, exact = true) => {
|
|
34300
34388
|
const least = shown + (hasMore ? 1 : 0);
|
|
@@ -34305,7 +34393,7 @@ var totalOf = /* @__PURE__ */ __name((count3, shown, hasMore, exact = true) => {
|
|
|
34305
34393
|
return { value: count3, relation: exact ? "eq" : "gte" };
|
|
34306
34394
|
}, "totalOf");
|
|
34307
34395
|
|
|
34308
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34396
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/search/lucene/meaning-parts.js
|
|
34309
34397
|
var WORD_FIELDS = /* @__PURE__ */ new Set(["text", "exact"]);
|
|
34310
34398
|
var fieldsOfQuery = /* @__PURE__ */ __name((root, everything) => {
|
|
34311
34399
|
let narrows = false;
|
|
@@ -34334,7 +34422,7 @@ var meaningWords = /* @__PURE__ */ __name((root) => {
|
|
|
34334
34422
|
return wanted(root).join(" ").trim();
|
|
34335
34423
|
}, "meaningWords");
|
|
34336
34424
|
|
|
34337
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34425
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/services/messages-combined.js
|
|
34338
34426
|
var COMBINED_DEFAULTS = { candidateDepth: 300, rrfK: 60, rerank: "all", chatCap: 0 };
|
|
34339
34427
|
var tokensOf = /* @__PURE__ */ __name((text3) => normalize(text3).match(/[\p{L}\p{N}\p{Co}\p{M}]+/gu) ?? [], "tokensOf");
|
|
34340
34428
|
var searchCombined = /* @__PURE__ */ __name(async (store, account, request, messenger = {}, options2 = COMBINED_DEFAULTS) => {
|
|
@@ -34535,7 +34623,7 @@ var signals = /* @__PURE__ */ __name((hit, terms, corrections, execution, mode,
|
|
|
34535
34623
|
return mode === "coverage" ? coverage2 * 4 : mode === "proximity" ? proximity : mode === "phrase" ? phrase2 : coverage2 * 4 + proximity + phrase2;
|
|
34536
34624
|
}, "signals");
|
|
34537
34625
|
|
|
34538
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34626
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/services/messages-discovery.js
|
|
34539
34627
|
var MEANING_DEPTH = 100;
|
|
34540
34628
|
var RRF_K3 = 60;
|
|
34541
34629
|
var RERANK_DEPTH = 50;
|
|
@@ -34861,7 +34949,7 @@ var mixedWithReranker = /* @__PURE__ */ __name((head, scores) => {
|
|
|
34861
34949
|
})).sort((a, b) => b.mixed - a.mixed).map(({ hit }) => hit);
|
|
34862
34950
|
}, "mixedWithReranker");
|
|
34863
34951
|
|
|
34864
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34952
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/services/thread-context.js
|
|
34865
34953
|
var THREAD_BOUNDS = { maxHops: 8, maxMessages: 50, maxBytes: 65536, withinMs: 864e5 };
|
|
34866
34954
|
var bytes = /* @__PURE__ */ __name((items, links) => Buffer.byteLength(JSON.stringify({ items, links }), "utf8"), "bytes");
|
|
34867
34955
|
var threadBounds = /* @__PURE__ */ __name((options2 = {}) => {
|
|
@@ -34954,7 +35042,7 @@ var readThreadContext = /* @__PURE__ */ __name(async (store, account, chat, mess
|
|
|
34954
35042
|
return result;
|
|
34955
35043
|
}
|
|
34956
35044
|
result.stale = state.algorithmVersion !== RULES_VERSION;
|
|
34957
|
-
const
|
|
35045
|
+
const at2 = Date.parse(anchor.timestamp);
|
|
34958
35046
|
const cache = /* @__PURE__ */ new Map();
|
|
34959
35047
|
const linksOf = /* @__PURE__ */ __name(async (id3) => {
|
|
34960
35048
|
if (!cache.has(id3)) {
|
|
@@ -34983,7 +35071,7 @@ var readThreadContext = /* @__PURE__ */ __name(async (store, account, chat, mess
|
|
|
34983
35071
|
result.stale = true;
|
|
34984
35072
|
continue;
|
|
34985
35073
|
}
|
|
34986
|
-
if (Math.abs(Date.parse(item2.timestamp) -
|
|
35074
|
+
if (Math.abs(Date.parse(item2.timestamp) - at2) > bounds.withinMs) {
|
|
34987
35075
|
stopped("time");
|
|
34988
35076
|
continue;
|
|
34989
35077
|
}
|
|
@@ -35060,7 +35148,7 @@ var readThreadContext = /* @__PURE__ */ __name(async (store, account, chat, mess
|
|
|
35060
35148
|
return result;
|
|
35061
35149
|
}, "readThreadContext");
|
|
35062
35150
|
|
|
35063
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
35151
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/services/messages-archive-search.js
|
|
35064
35152
|
var SEARCH_FILL_MS = 200;
|
|
35065
35153
|
var statsStore = /* @__PURE__ */ __name(async (store, account, request, messenger = {}) => {
|
|
35066
35154
|
const stop = Date.now() + SEARCH_FILL_MS;
|
|
@@ -35168,7 +35256,7 @@ var accountOf2 = /* @__PURE__ */ __name((hit) => {
|
|
|
35168
35256
|
}, "accountOf");
|
|
35169
35257
|
var keyOf4 = /* @__PURE__ */ __name(({ provider, account }) => `${provider}/${account}`, "keyOf");
|
|
35170
35258
|
|
|
35171
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
35259
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/services/meaning-model.js
|
|
35172
35260
|
var meaningModel = /* @__PURE__ */ __name(async (store, env = process.env) => {
|
|
35173
35261
|
const chosen = chosenTextModel(env);
|
|
35174
35262
|
if (chosen.from === "chosen" || chosen.id !== DEFAULT_TEXT_MODEL)
|
|
@@ -35183,7 +35271,7 @@ var meaningModel = /* @__PURE__ */ __name(async (store, env = process.env) => {
|
|
|
35183
35271
|
return (counts.get(before) ?? 0) > (counts.get(now) ?? 0) ? previous.id : current.id;
|
|
35184
35272
|
}, "meaningModel");
|
|
35185
35273
|
|
|
35186
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
35274
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/services/messages-meaning.js
|
|
35187
35275
|
var meaningText = /* @__PURE__ */ __name((question) => {
|
|
35188
35276
|
try {
|
|
35189
35277
|
const text3 = questionLookup(question) === void 0 ? question : questionText(question);
|
|
@@ -35262,7 +35350,7 @@ var meaningLane = /* @__PURE__ */ __name((deps) => async (question, accounts, sh
|
|
|
35262
35350
|
}
|
|
35263
35351
|
}, "meaningLane");
|
|
35264
35352
|
|
|
35265
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
35353
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/services/messages-rerank.js
|
|
35266
35354
|
var rerankLane = /* @__PURE__ */ __name((deps) => {
|
|
35267
35355
|
const choice = deps.reranker ?? DEFAULT_RERANK_MODEL;
|
|
35268
35356
|
if (choice === "off")
|
|
@@ -35274,9 +35362,9 @@ var rerankLane = /* @__PURE__ */ __name((deps) => {
|
|
|
35274
35362
|
return { skipped: { reason: `${model.id} is not downloaded`, step: "models.download", model: model.id } };
|
|
35275
35363
|
try {
|
|
35276
35364
|
const warm = deps.embedders;
|
|
35277
|
-
const reranker = warm ? await warm.reranker(`rerank:${model.id}`, async () => (await import("./process-
|
|
35365
|
+
const reranker = warm ? await warm.reranker(`rerank:${model.id}`, async () => (await import("./process-P4D4KFWE.js")).openRerankerProcess(model, directory2, {
|
|
35278
35366
|
threads: defaultThreads()
|
|
35279
|
-
})) : await (await import("./rerank-
|
|
35367
|
+
})) : await (await import("./rerank-XSPWLBIO.js")).openReranker(model, directory2);
|
|
35280
35368
|
return {
|
|
35281
35369
|
model: model.id,
|
|
35282
35370
|
score: /* @__PURE__ */ __name((question, passages) => reranker.score(plainWords(question), passages), "score"),
|
|
@@ -35296,14 +35384,14 @@ var rerankLane = /* @__PURE__ */ __name((deps) => {
|
|
|
35296
35384
|
};
|
|
35297
35385
|
}, "rerankLane");
|
|
35298
35386
|
|
|
35299
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
35387
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/crm/file-fetch.js
|
|
35300
35388
|
var EXCHANGE_MS = 60 * 60 * 1e3;
|
|
35301
35389
|
|
|
35302
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
35390
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/crm/files.js
|
|
35303
35391
|
var foldKey = /* @__PURE__ */ __name((key) => key.replaceAll("_", "").toLowerCase(), "foldKey");
|
|
35304
35392
|
var DOWNLOAD_KEYS = new Set(["DOWNLOAD_URL", "downloadUrl", "fileUrl", "CALL_RECORD_URL", "archiveLink", "publicUrl"].map(foldKey));
|
|
35305
35393
|
|
|
35306
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
35394
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/crm/manifest/map.js
|
|
35307
35395
|
var TIMES = { createdAt: "epoch", updatedAt: "epoch" };
|
|
35308
35396
|
var ITEM = {
|
|
35309
35397
|
externalId: "id",
|
|
@@ -35355,7 +35443,7 @@ var FIELDS = {
|
|
|
35355
35443
|
lead: ITEM
|
|
35356
35444
|
};
|
|
35357
35445
|
|
|
35358
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
35446
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/crm/manifest/manifest.js
|
|
35359
35447
|
var path = pipe(string(), regex(/^[^.\s]+(\.[^.\s]+)*$/, "a dotted path such as properties.name"));
|
|
35360
35448
|
var paths = pipe(array(path), minLength(1));
|
|
35361
35449
|
var crmRuleSchema = union([
|
|
@@ -35448,10 +35536,10 @@ var schema = strictObject({
|
|
|
35448
35536
|
}))
|
|
35449
35537
|
});
|
|
35450
35538
|
|
|
35451
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
35539
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/crm/manifest/source.js
|
|
35452
35540
|
var OVERLAP_MS = 10 * 6e4;
|
|
35453
35541
|
|
|
35454
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
35542
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/crm/writer.js
|
|
35455
35543
|
var CRM_ASSIGN_OTHERS_KEY = "crm.assign-others";
|
|
35456
35544
|
var CRM_WRITE_DEFAULTS = {
|
|
35457
35545
|
"deals.delete": "ask",
|
|
@@ -35459,7 +35547,7 @@ var CRM_WRITE_DEFAULTS = {
|
|
|
35459
35547
|
[CRM_ASSIGN_OTHERS_KEY]: "deny"
|
|
35460
35548
|
};
|
|
35461
35549
|
|
|
35462
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
35550
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/crm/viewer.js
|
|
35463
35551
|
var VIEWERS = "crm:viewers";
|
|
35464
35552
|
var viewersOf = /* @__PURE__ */ __name(async (store, account) => {
|
|
35465
35553
|
try {
|
|
@@ -35490,10 +35578,10 @@ var crmViewerOf = /* @__PURE__ */ __name(async (store, account, user) => {
|
|
|
35490
35578
|
};
|
|
35491
35579
|
}, "crmViewerOf");
|
|
35492
35580
|
|
|
35493
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
35581
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/crm/sync.js
|
|
35494
35582
|
var CLOCK_MARGIN = 60 * 6e4;
|
|
35495
35583
|
|
|
35496
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
35584
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/search/question-period.js
|
|
35497
35585
|
var DAY5 = 864e5;
|
|
35498
35586
|
var SPAN = { start: 0, end: 0 };
|
|
35499
35587
|
var phrase = /* @__PURE__ */ __name((source) => new RegExp(`(?<![\\p{L}\\p{N}])(?:${source})(?![\\p{L}\\p{N}])`, "giu"), "phrase");
|
|
@@ -35523,24 +35611,24 @@ var weekDays = /* @__PURE__ */ __name((day2) => {
|
|
|
35523
35611
|
}, "weekDays");
|
|
35524
35612
|
var yearDays = /* @__PURE__ */ __name((year) => [Date.UTC(year, 0, 1), Date.UTC(year, 11, 31)], "yearDays");
|
|
35525
35613
|
var unitDays = /* @__PURE__ */ __name((unit, day2) => {
|
|
35526
|
-
const
|
|
35614
|
+
const at2 = new Date(day2);
|
|
35527
35615
|
if (/^(?:day|дн|день)/iu.test(unit))
|
|
35528
35616
|
return [day2, day2];
|
|
35529
35617
|
if (/^(?:week|недел)/iu.test(unit))
|
|
35530
35618
|
return weekDays(day2);
|
|
35531
35619
|
if (/^(?:month|месяц)/iu.test(unit))
|
|
35532
|
-
return monthDays(
|
|
35533
|
-
return yearDays(
|
|
35620
|
+
return monthDays(at2.getUTCFullYear(), at2.getUTCMonth());
|
|
35621
|
+
return yearDays(at2.getUTCFullYear());
|
|
35534
35622
|
}, "unitDays");
|
|
35535
35623
|
var unitsBack = /* @__PURE__ */ __name((unit, count3, today) => {
|
|
35536
|
-
const
|
|
35624
|
+
const at2 = new Date(today);
|
|
35537
35625
|
if (/^(?:day|дн|день)/iu.test(unit))
|
|
35538
35626
|
return today - count3 * DAY5;
|
|
35539
35627
|
if (/^(?:week|недел)/iu.test(unit))
|
|
35540
35628
|
return today - 7 * count3 * DAY5;
|
|
35541
35629
|
if (/^(?:month|месяц)/iu.test(unit))
|
|
35542
|
-
return Date.UTC(
|
|
35543
|
-
return Date.UTC(
|
|
35630
|
+
return Date.UTC(at2.getUTCFullYear(), at2.getUTCMonth() - count3, 1);
|
|
35631
|
+
return Date.UTC(at2.getUTCFullYear() - count3, 0, 1);
|
|
35544
35632
|
}, "unitsBack");
|
|
35545
35633
|
var RULES = [
|
|
35546
35634
|
[
|
|
@@ -35618,17 +35706,17 @@ var questionPeriod = /* @__PURE__ */ __name((text3, now, zone) => {
|
|
|
35618
35706
|
};
|
|
35619
35707
|
}, "questionPeriod");
|
|
35620
35708
|
|
|
35621
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
35709
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/services/document-pictures.js
|
|
35622
35710
|
var openPictureEmbedderFor = /* @__PURE__ */ __name(async ({ env, command } = {}) => {
|
|
35623
35711
|
const model = imageModel(DEFAULT_IMAGE_MODEL);
|
|
35624
35712
|
const directory2 = imageModelsDirectory(env);
|
|
35625
35713
|
if (!isImageModelInstalled(model, directory2))
|
|
35626
35714
|
throw new CliError("not_found", `the picture model is not downloaded \u2014 ${command === void 0 ? "install it with a WireCat CLI that has `images models download` (tg, max or wa); they share the model folder" : `\`${command} images models download ${model.id}\` fetches it`}`, { reason: "model.not-downloaded", model: model.id });
|
|
35627
|
-
const { openPictureEmbedder } = await import("./embedder-
|
|
35715
|
+
const { openPictureEmbedder } = await import("./embedder-Q7ID2LEG.js");
|
|
35628
35716
|
return openPictureEmbedder(model, directory2);
|
|
35629
35717
|
}, "openPictureEmbedderFor");
|
|
35630
35718
|
|
|
35631
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
35719
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/services/document-source.js
|
|
35632
35720
|
var documentSource = /* @__PURE__ */ __name((note, accounts, profiles, file2) => {
|
|
35633
35721
|
const metadata = note.frontMatter;
|
|
35634
35722
|
const account = accounts.find(({ id: id3 }) => String(id3) === note.folderId);
|
|
@@ -35650,7 +35738,7 @@ var documentSource = /* @__PURE__ */ __name((note, accounts, profiles, file2) =>
|
|
|
35650
35738
|
};
|
|
35651
35739
|
}, "documentSource");
|
|
35652
35740
|
|
|
35653
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
35741
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/embeddings/keys.js
|
|
35654
35742
|
var endpointKeyName = /* @__PURE__ */ __name((baseUrl) => {
|
|
35655
35743
|
const host = new URL(baseUrl).host;
|
|
35656
35744
|
return ["openai", "anthropic"].includes(host) ? `endpoint:${host}` : host;
|
|
@@ -35683,7 +35771,7 @@ var embeddingKeys = /* @__PURE__ */ __name((app, env = process.env, keyring) =>
|
|
|
35683
35771
|
};
|
|
35684
35772
|
}, "embeddingKeys");
|
|
35685
35773
|
|
|
35686
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
35774
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/models/openai.js
|
|
35687
35775
|
var options = strictObject({
|
|
35688
35776
|
temperature: range(0, 2),
|
|
35689
35777
|
top_p: range(0, 1),
|
|
@@ -35750,7 +35838,7 @@ var openai = {
|
|
|
35750
35838
|
}), "complete")
|
|
35751
35839
|
};
|
|
35752
35840
|
|
|
35753
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
35841
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/models/index.js
|
|
35754
35842
|
var modelGateway = /* @__PURE__ */ __name((deps) => ({
|
|
35755
35843
|
complete: /* @__PURE__ */ __name(async (request) => {
|
|
35756
35844
|
if (deps.signal?.aborted)
|
|
@@ -35765,7 +35853,7 @@ var modelGateway = /* @__PURE__ */ __name((deps) => ({
|
|
|
35765
35853
|
if (!adapter && target2.provider === "openai")
|
|
35766
35854
|
adapter = openai;
|
|
35767
35855
|
if (!adapter && target2.provider === "anthropic")
|
|
35768
|
-
adapter = (await import("./anthropic-
|
|
35856
|
+
adapter = (await import("./anthropic-YYBMT2HD.js")).anthropic;
|
|
35769
35857
|
if (!adapter)
|
|
35770
35858
|
throw new CliError("validation_error", `no model adapter for ${target2.provider}`);
|
|
35771
35859
|
if (request.images !== void 0 && adapter.images !== true)
|
|
@@ -35825,7 +35913,7 @@ var modelGateway = /* @__PURE__ */ __name((deps) => ({
|
|
|
35825
35913
|
}, "complete")
|
|
35826
35914
|
}), "modelGateway");
|
|
35827
35915
|
|
|
35828
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
35916
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/services/enrichment-setting.js
|
|
35829
35917
|
var SECTION2 = "enrichment";
|
|
35830
35918
|
var ENRICHMENT_PROVIDERS = ["openai", "anthropic"];
|
|
35831
35919
|
var DEFAULT_BASE_URLS = {
|
|
@@ -35900,7 +35988,7 @@ var costOf = /* @__PURE__ */ __name((usage, setting) => {
|
|
|
35900
35988
|
return price ? Math.round((usage.input * price.input + usage.output * price.output) * 1e6) / 1e6 : null;
|
|
35901
35989
|
}, "costOf");
|
|
35902
35990
|
|
|
35903
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
35991
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/services/enrichment.js
|
|
35904
35992
|
var ENRICH_PER_RUN = 600;
|
|
35905
35993
|
var MAX_LINE = 400;
|
|
35906
35994
|
var line2 = pipe(unknown(), transform((value) => typeof value === "string" ? value.replace(/\s+/g, " ").trim().slice(0, MAX_LINE) : ""));
|
|
@@ -35976,7 +36064,7 @@ var enrichmentState = /* @__PURE__ */ __name(async (store, env, estimateFor, key
|
|
|
35976
36064
|
};
|
|
35977
36065
|
}, "enrichmentState");
|
|
35978
36066
|
|
|
35979
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
36067
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/services/notes-title-tier.js
|
|
35980
36068
|
var plainQueryWords = /* @__PURE__ */ __name((query) => {
|
|
35981
36069
|
let root;
|
|
35982
36070
|
try {
|
|
@@ -36003,7 +36091,7 @@ var titleTiers = /* @__PURE__ */ __name((hits, words3) => {
|
|
|
36003
36091
|
return [...hits].sort((a, b) => rank(a) - rank(b));
|
|
36004
36092
|
}, "titleTiers");
|
|
36005
36093
|
|
|
36006
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
36094
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/services/notes-search.js
|
|
36007
36095
|
var storeQuery = /* @__PURE__ */ __name(async (store, text3, { exact, timezone } = {}) => resolvedQuery(store, parsedQuery(text3, exact), timezone), "storeQuery");
|
|
36008
36096
|
var parsedQuery = /* @__PURE__ */ __name((text3, exact) => validateFields(parseLucene(text3, { ...SEARCH_QUERY, defaultField: exact ? "exact" : "text" })).root, "parsedQuery");
|
|
36009
36097
|
var resolvedQuery = /* @__PURE__ */ __name(async (store, root, timezone) => {
|
|
@@ -36173,7 +36261,7 @@ var matching = /* @__PURE__ */ __name(async (store, refs, root, scope) => {
|
|
|
36173
36261
|
...scope.source ? { source: scope.source } : {},
|
|
36174
36262
|
...resolved.stemmer ? { stemmer: resolved.stemmer } : {}
|
|
36175
36263
|
});
|
|
36176
|
-
return new Map(found.items.map(({ ref, note, at:
|
|
36264
|
+
return new Map(found.items.map(({ ref, note, at: at2 }) => [ref, { note, at: at2 }]));
|
|
36177
36265
|
}, "matching");
|
|
36178
36266
|
var RANK_WITHIN = 2e3;
|
|
36179
36267
|
var filterRefs = /* @__PURE__ */ __name(async (store, narrowing, scope) => {
|
|
@@ -36299,10 +36387,10 @@ var searchNotes = /* @__PURE__ */ __name(async (store, query, { limit = 20, offs
|
|
|
36299
36387
|
...scope
|
|
36300
36388
|
});
|
|
36301
36389
|
const ranked = /* @__PURE__ */ new Map();
|
|
36302
|
-
const add = /* @__PURE__ */ __name((list3, by) => list3.forEach(({ ref, note, at:
|
|
36390
|
+
const add = /* @__PURE__ */ __name((list3, by) => list3.forEach(({ ref, note, at: at2 }, rank) => {
|
|
36303
36391
|
if (tierRefs.has(ref))
|
|
36304
36392
|
return;
|
|
36305
|
-
const held = ranked.get(ref) ?? { note, at:
|
|
36393
|
+
const held = ranked.get(ref) ?? { note, at: at2, score: 0, foundBy: [] };
|
|
36306
36394
|
held.foundBy.push(by);
|
|
36307
36395
|
ranked.set(ref, held);
|
|
36308
36396
|
const vote = 1 / (RRF_K + rank + 1);
|
|
@@ -36315,7 +36403,7 @@ var searchNotes = /* @__PURE__ */ __name(async (store, query, { limit = 20, offs
|
|
|
36315
36403
|
if (meaning !== void 0)
|
|
36316
36404
|
add(meaning, "meaning");
|
|
36317
36405
|
const ordered = [
|
|
36318
|
-
...tier.map(({ ref, note, at:
|
|
36406
|
+
...tier.map(({ ref, note, at: at2 }) => [ref, { note, at: at2, score: 0, foundBy: ["title"] }]),
|
|
36319
36407
|
...[...ranked.entries()].sort(([, a], [, b]) => b.score - a.score)
|
|
36320
36408
|
];
|
|
36321
36409
|
const page = slice ? ordered : ordered.slice(offset, window2);
|
|
@@ -36325,7 +36413,7 @@ var searchNotes = /* @__PURE__ */ __name(async (store, query, { limit = 20, offs
|
|
|
36325
36413
|
const counts = /* @__PURE__ */ new Map();
|
|
36326
36414
|
const accounts = await store.accounts.storedAccounts();
|
|
36327
36415
|
const profiles = await store.accounts.profiles();
|
|
36328
|
-
for (const [ref, { note, at:
|
|
36416
|
+
for (const [ref, { note, at: at2, foundBy }] of page) {
|
|
36329
36417
|
const links = (await store.notes.links({ from: ref })).map(({ to, targetText, kind: kind2, anchor }) => ({
|
|
36330
36418
|
to,
|
|
36331
36419
|
target_text: targetText,
|
|
@@ -36339,7 +36427,7 @@ var searchNotes = /* @__PURE__ */ __name(async (store, query, { limit = 20, offs
|
|
|
36339
36427
|
path: note.path,
|
|
36340
36428
|
title: note.title,
|
|
36341
36429
|
...documentSource(note, accounts, profiles, note.source === "file" ? (await store.files.ofDocument(note.ref))[0] : void 0),
|
|
36342
|
-
updated_at:
|
|
36430
|
+
updated_at: at2,
|
|
36343
36431
|
excerpt: firstLine2(note.text, words3),
|
|
36344
36432
|
links,
|
|
36345
36433
|
found_by: foundBy,
|
|
@@ -36431,9 +36519,9 @@ var searchNotesOf = /* @__PURE__ */ __name(async (store, account, text3, { accou
|
|
|
36431
36519
|
};
|
|
36432
36520
|
}, "searchNotesOf");
|
|
36433
36521
|
|
|
36434
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
36522
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/services/events-search.js
|
|
36435
36523
|
var MAX_EVENTS_OFFSET = 1e3;
|
|
36436
|
-
var iso3 = /* @__PURE__ */ __name((
|
|
36524
|
+
var iso3 = /* @__PURE__ */ __name((at2) => at2 === null ? null : new Date(at2).toISOString(), "iso");
|
|
36437
36525
|
var accountIdsOf = /* @__PURE__ */ __name(async (store, accounts) => {
|
|
36438
36526
|
const held = await store.accounts.storedAccounts();
|
|
36439
36527
|
return held.filter((one) => accounts.some(({ provider, account }) => one.provider === provider && one.account === account)).map(({ id: id3 }) => String(id3));
|
|
@@ -36549,7 +36637,7 @@ var searchEvents = /* @__PURE__ */ __name(async (store, query, { limit = 20, off
|
|
|
36549
36637
|
};
|
|
36550
36638
|
}, "searchEvents");
|
|
36551
36639
|
|
|
36552
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
36640
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/services/search-all-business.js
|
|
36553
36641
|
var OWN_BUSINESS = { provider: "business", account: INTERNAL_NOTES };
|
|
36554
36642
|
var BUSINESS_WORDS_ONLY = "invoices, payments, orders, contracts, subscriptions, products and wallets are found by the words of their numbers and names only";
|
|
36555
36643
|
var placeOf = /* @__PURE__ */ __name(({ source, imported }) => source ?? (imported === void 0 ? OWN_BUSINESS : { provider: imported, account: "" }), "placeOf");
|
|
@@ -36579,7 +36667,7 @@ var searchBusiness = /* @__PURE__ */ __name(async (store, { words: words3, anyWo
|
|
|
36579
36667
|
};
|
|
36580
36668
|
}, "searchBusiness");
|
|
36581
36669
|
|
|
36582
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
36670
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/services/search-all-meetings.js
|
|
36583
36671
|
var MOST_HITS_PER_MEETING = 3;
|
|
36584
36672
|
var PAGE_ROWS = 200;
|
|
36585
36673
|
var MOST_PAGES = 25;
|
|
@@ -36807,7 +36895,7 @@ var titleItem = /* @__PURE__ */ __name((account, meeting, query) => ({
|
|
|
36807
36895
|
foundBy: ["title"]
|
|
36808
36896
|
}), "titleItem");
|
|
36809
36897
|
|
|
36810
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
36898
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/services/search-harder.js
|
|
36811
36899
|
var SECTION3 = "search_harder";
|
|
36812
36900
|
var HARDER_MODELS = {
|
|
36813
36901
|
anthropic: "claude-haiku-5-5",
|
|
@@ -37053,7 +37141,7 @@ var reorderHarder = /* @__PURE__ */ __name(async (question, hits, { laterPage, a
|
|
|
37053
37141
|
};
|
|
37054
37142
|
}, "reorderHarder");
|
|
37055
37143
|
|
|
37056
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
37144
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/services/search-all.js
|
|
37057
37145
|
var RESOURCES_SEARCHED = ["messages", "mail", "notes", "events", "crm", "business", "meetings"];
|
|
37058
37146
|
var refusal = /* @__PURE__ */ __name((error, text3) => {
|
|
37059
37147
|
const { reason, span } = error.details ?? {};
|
|
@@ -37174,17 +37262,17 @@ var searchAll = /* @__PURE__ */ __name(async (store, account, asked, messenger =
|
|
|
37174
37262
|
skipped.push(one);
|
|
37175
37263
|
accounts.push(...read.map(({ provider, account: account2 }) => ({ resource: kind2, provider, account: account2 })));
|
|
37176
37264
|
const itemOf2 = /* @__PURE__ */ __name((hit, foundBy) => {
|
|
37177
|
-
const
|
|
37265
|
+
const at2 = parseLocator(hit.locator);
|
|
37178
37266
|
return {
|
|
37179
37267
|
kind: kind2 === "mail" ? "mail" : "message",
|
|
37180
37268
|
ref: hit.locator,
|
|
37181
|
-
provider:
|
|
37182
|
-
account:
|
|
37269
|
+
provider: at2.provider,
|
|
37270
|
+
account: at2.account,
|
|
37183
37271
|
title: hit.chatTitle,
|
|
37184
37272
|
timestamp: hit.timestamp,
|
|
37185
37273
|
text: hit.excerpt ?? excerpt(hit.text ?? "", request.text),
|
|
37186
37274
|
from: hit.email?.from ? { name: hit.email.from.name ?? hit.email.from.address, ref: hit.email.from.ref } : { name: hit.senderName, ref: null },
|
|
37187
|
-
senderIsMe: senderIsMe(hit,
|
|
37275
|
+
senderIsMe: senderIsMe(hit, at2.account),
|
|
37188
37276
|
...hit.email ? { email: hit.email } : {},
|
|
37189
37277
|
attachments: hitFiles(hit.attachments),
|
|
37190
37278
|
foundBy
|
|
@@ -37492,13 +37580,13 @@ var insidePeriodFirst = /* @__PURE__ */ __name((ordered, period) => {
|
|
|
37492
37580
|
if (!period)
|
|
37493
37581
|
return ordered;
|
|
37494
37582
|
const inside2 = /* @__PURE__ */ __name(({ timestamp }) => {
|
|
37495
|
-
const
|
|
37496
|
-
return
|
|
37583
|
+
const at2 = timestamp === null ? Number.NaN : Date.parse(timestamp);
|
|
37584
|
+
return at2 >= period.from && at2 < period.to;
|
|
37497
37585
|
}, "inside");
|
|
37498
37586
|
return ordered.map((item2, rank) => ({ item: item2, score: 1 - rank / PERIOD_DEPTH + (inside2(item2) ? PERIOD_BOOST : 0) })).sort((a, b) => b.score - a.score).map(({ item: item2 }) => item2);
|
|
37499
37587
|
}, "insidePeriodFirst");
|
|
37500
37588
|
|
|
37501
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
37589
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/services/server-search.js
|
|
37502
37590
|
var SERVER_SEARCH_KEY = "messages.server-search";
|
|
37503
37591
|
var SERVER_BOUNDS = { timeMs: 5e3, perCall: 100, maxCalls: 3, textBytes: 262144 };
|
|
37504
37592
|
var DEFAULT_BACKEND = "both";
|
|
@@ -37689,7 +37777,7 @@ var searchServer = /* @__PURE__ */ __name(async (deps, request) => {
|
|
|
37689
37777
|
return { report, sources };
|
|
37690
37778
|
}, "searchServer");
|
|
37691
37779
|
|
|
37692
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
37780
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/services/messages.js
|
|
37693
37781
|
var DELETE_AT_ONCE = 10;
|
|
37694
37782
|
var atOnce = /* @__PURE__ */ __name((ids) => {
|
|
37695
37783
|
if (ids.length > DELETE_AT_ONCE)
|
|
@@ -37951,7 +38039,7 @@ var messagesService = /* @__PURE__ */ __name((deps) => {
|
|
|
37951
38039
|
}), void 0, validate === void 0 || threadId === void 0 ? void 0 : () => validate(chatId, threadId, { ...replyTo === void 0 ? {} : { replyTo } }));
|
|
37952
38040
|
return { operationId, chatId, saved: true };
|
|
37953
38041
|
}, "saveDraft"),
|
|
37954
|
-
send: /* @__PURE__ */ __name(async ({ chat, text: typed, sendId, replyTo: typedReplyTo, threadId: typedThread, silent, noPreview, markdown, html: html2, at:
|
|
38042
|
+
send: /* @__PURE__ */ __name(async ({ chat, text: typed, sendId, replyTo: typedReplyTo, threadId: typedThread, silent, noPreview, markdown, html: html2, at: at2, attachments = [], key, origin, spoiler, captionAbove, sendAs, commentTo, sticker, stickerFile }) => {
|
|
37955
38043
|
const stickers = (sticker === void 0 ? 0 : 1) + (stickerFile === void 0 ? 0 : 1);
|
|
37956
38044
|
if (stickers > 0 && (stickers > 1 || typed.trim() !== "" || attachments.length > 0 || markdown || html2))
|
|
37957
38045
|
throw new CliError("validation_error", "a sticker goes alone \u2014 no text, no file, no photo");
|
|
@@ -37960,7 +38048,7 @@ var messagesService = /* @__PURE__ */ __name((deps) => {
|
|
|
37960
38048
|
const media = { ...spoiler ? { spoiler } : {}, ...captionAbove ? { captionAbove } : {} };
|
|
37961
38049
|
checkMediaOptions(deps.messenger, Object.keys(media), attachments.length);
|
|
37962
38050
|
const connection = await deps.connection();
|
|
37963
|
-
if (
|
|
38051
|
+
if (at2 !== void 0 && sendId !== void 0) {
|
|
37964
38052
|
throw new CliError("validation_error", "a scheduled send is never repeated: it would be scheduled twice \u2014 look in `messages scheduled` instead");
|
|
37965
38053
|
}
|
|
37966
38054
|
const prepared = await formatted(connection, typed, { markdown, html: html2 });
|
|
@@ -37988,7 +38076,7 @@ var messagesService = /* @__PURE__ */ __name((deps) => {
|
|
|
37988
38076
|
...replyTo === void 0 ? {} : { replyTo },
|
|
37989
38077
|
...threadId === void 0 ? {} : { threadId },
|
|
37990
38078
|
...sendAs === void 0 ? {} : { sendAs },
|
|
37991
|
-
...
|
|
38079
|
+
...at2 === void 0 ? {} : { scheduledFor: at2 },
|
|
37992
38080
|
...key === void 0 ? {} : { key },
|
|
37993
38081
|
...origin === void 0 ? {} : { origin },
|
|
37994
38082
|
...attachments.length === 0 && stickerFile === void 0 ? {} : {
|
|
@@ -38006,7 +38094,7 @@ var messagesService = /* @__PURE__ */ __name((deps) => {
|
|
|
38006
38094
|
...silent ? { silent } : {},
|
|
38007
38095
|
...noPreview ? { noPreview } : {},
|
|
38008
38096
|
...spans.length > 0 ? { formatting: spans } : {},
|
|
38009
|
-
...
|
|
38097
|
+
...at2 === void 0 ? {} : { at: at2 },
|
|
38010
38098
|
...attachments.length === 0 ? {} : { attachments },
|
|
38011
38099
|
...sticker === void 0 ? {} : { sticker },
|
|
38012
38100
|
...stickerFile === void 0 ? {} : { stickerFile },
|
|
@@ -38015,8 +38103,8 @@ var messagesService = /* @__PURE__ */ __name((deps) => {
|
|
|
38015
38103
|
}), (sent) => sentIds(chatId, sent.message), validate === void 0 || threadId === void 0 ? void 0 : () => validate(chatId, threadId, { ...replyTo === void 0 ? {} : { replyTo } }));
|
|
38016
38104
|
return { ...done2, operationId: id3 };
|
|
38017
38105
|
} catch (error) {
|
|
38018
|
-
if (
|
|
38019
|
-
throw new CliError("outcome_unknown", "no answer \u2014 the message may have been scheduled. Look in `messages scheduled` before anything else; never send it again with --operation-id", { scheduled_for:
|
|
38106
|
+
if (at2 !== void 0 && codeOf(error) === "outcome_unknown") {
|
|
38107
|
+
throw new CliError("outcome_unknown", "no answer \u2014 the message may have been scheduled. Look in `messages scheduled` before anything else; never send it again with --operation-id", { scheduled_for: at2 });
|
|
38020
38108
|
}
|
|
38021
38109
|
throw error;
|
|
38022
38110
|
}
|
|
@@ -38053,8 +38141,8 @@ var messagesService = /* @__PURE__ */ __name((deps) => {
|
|
|
38053
38141
|
await guardedWrite(guard, { operationId, chatId, kind: "delete", key: "messages.scheduled.cancel", count: ids.length }, () => cancel(chatId, ids));
|
|
38054
38142
|
return { operationId, chatId, cancelled: ids };
|
|
38055
38143
|
}, "cancelScheduled"),
|
|
38056
|
-
editScheduled: /* @__PURE__ */ __name(async ({ chat, id: id3, text: typed, markdown, html: html2, at:
|
|
38057
|
-
if (typed === void 0 &&
|
|
38144
|
+
editScheduled: /* @__PURE__ */ __name(async ({ chat, id: id3, text: typed, markdown, html: html2, at: at2 }) => {
|
|
38145
|
+
if (typed === void 0 && at2 === void 0)
|
|
38058
38146
|
throw new CliError("validation_error", "nothing to change \u2014 give the new text, --at-time, or both");
|
|
38059
38147
|
const connection = await deps.connection();
|
|
38060
38148
|
const edit = capability(connection, "editScheduled", "edit a scheduled message");
|
|
@@ -38063,7 +38151,7 @@ var messagesService = /* @__PURE__ */ __name((deps) => {
|
|
|
38063
38151
|
if (change !== void 0 && change.text.trim() === "")
|
|
38064
38152
|
throw new CliError("validation_error", "no new text \u2014 the marks leave nothing");
|
|
38065
38153
|
const { chatId, found: [current] } = await waiting(connection, chat, [id3]);
|
|
38066
|
-
const scheduledFor =
|
|
38154
|
+
const scheduledFor = at2 ?? current?.scheduledFor ?? current?.timestamp;
|
|
38067
38155
|
if (scheduledFor === void 0)
|
|
38068
38156
|
throw new CliError("invalid_response", "the scheduled message has no time");
|
|
38069
38157
|
const operationId = newOperationId();
|
|
@@ -38189,7 +38277,7 @@ var checkMediaOptions = /* @__PURE__ */ __name((messenger, asked, attachments) =
|
|
|
38189
38277
|
throw new CliError("validation_error", `${MEDIA_FLAGS[first2]} needs a --photo or --file`);
|
|
38190
38278
|
}, "checkMediaOptions");
|
|
38191
38279
|
|
|
38192
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
38280
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/domain/channel-tags.js
|
|
38193
38281
|
var CHANNEL_TAG_RULES_VERSION = "keywords-v1";
|
|
38194
38282
|
var RULES2 = {
|
|
38195
38283
|
ai: [/\b(ai|gpt|llm|machine learning|artificial intelligence)\b/iu, /нейросет|искусственн/iu],
|
|
@@ -38204,7 +38292,7 @@ var classifyChannel = /* @__PURE__ */ __name((metadata) => Object.entries(RULES2
|
|
|
38204
38292
|
return fields2.length ? [{ tag, score: fields2.length / 3, fields: fields2 }] : [];
|
|
38205
38293
|
}), "classifyChannel");
|
|
38206
38294
|
|
|
38207
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
38295
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/services/metadata.js
|
|
38208
38296
|
var metadataService = /* @__PURE__ */ __name((deps) => {
|
|
38209
38297
|
const held = /* @__PURE__ */ __name(async (reference, { includeLeft = false } = {}) => {
|
|
38210
38298
|
const store = await deps.store();
|
|
@@ -38290,7 +38378,7 @@ var metadataService = /* @__PURE__ */ __name((deps) => {
|
|
|
38290
38378
|
};
|
|
38291
38379
|
}, "metadataService");
|
|
38292
38380
|
|
|
38293
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
38381
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/moderation/run.js
|
|
38294
38382
|
var FIRST_LOOK_MS = 24 * 36e5;
|
|
38295
38383
|
var moderateWith = /* @__PURE__ */ __name(async (run2) => {
|
|
38296
38384
|
const { chatId, title, rules, point, since, dryRun } = run2;
|
|
@@ -38327,7 +38415,7 @@ var moderateWith = /* @__PURE__ */ __name(async (run2) => {
|
|
|
38327
38415
|
return { chatId, rows, notes };
|
|
38328
38416
|
}, "moderateWith");
|
|
38329
38417
|
|
|
38330
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
38418
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/services/moderation.js
|
|
38331
38419
|
var moderationService = /* @__PURE__ */ __name((deps) => {
|
|
38332
38420
|
const file2 = /* @__PURE__ */ __name(() => {
|
|
38333
38421
|
const env = deps.env ?? process.env;
|
|
@@ -38380,7 +38468,7 @@ var moderationService = /* @__PURE__ */ __name((deps) => {
|
|
|
38380
38468
|
chatId,
|
|
38381
38469
|
title,
|
|
38382
38470
|
rules,
|
|
38383
|
-
point: { read: /* @__PURE__ */ __name((id3) => rules.checkedUntil(id3), "read"), write: /* @__PURE__ */ __name((id3,
|
|
38471
|
+
point: { read: /* @__PURE__ */ __name((id3) => rules.checkedUntil(id3), "read"), write: /* @__PURE__ */ __name((id3, at2) => rules.markChecked(id3, at2), "write") },
|
|
38384
38472
|
gather: /* @__PURE__ */ __name((from) => gather(connection, chatId, from), "gather"),
|
|
38385
38473
|
moderator: moderatorOf(connection, deps),
|
|
38386
38474
|
command: deps.messenger.app.command,
|
|
@@ -38412,7 +38500,7 @@ var moderatorOf = /* @__PURE__ */ __name((adapter, deps) => ({
|
|
|
38412
38500
|
}, "removePerson")
|
|
38413
38501
|
}), "moderatorOf");
|
|
38414
38502
|
|
|
38415
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
38503
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/services/private-people.js
|
|
38416
38504
|
var noteItem = /* @__PURE__ */ __name((provider, note) => ({
|
|
38417
38505
|
id: note.id,
|
|
38418
38506
|
contact: formatReference({ type: "contact", provider, id: note.personId }),
|
|
@@ -38456,7 +38544,7 @@ var privatePeopleService = /* @__PURE__ */ __name((deps) => {
|
|
|
38456
38544
|
};
|
|
38457
38545
|
}, "privatePeopleService");
|
|
38458
38546
|
|
|
38459
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
38547
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/services/rankings.js
|
|
38460
38548
|
var empty = /* @__PURE__ */ __name(() => ({
|
|
38461
38549
|
total: 0,
|
|
38462
38550
|
population: 0,
|
|
@@ -38712,7 +38800,7 @@ var rankingsService = /* @__PURE__ */ __name((deps) => ({
|
|
|
38712
38800
|
}, "evidence")
|
|
38713
38801
|
}), "rankingsService");
|
|
38714
38802
|
|
|
38715
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
38803
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/services/reply-stats.js
|
|
38716
38804
|
var FIELDS2 = ["date", "chat", "kind", "muted"];
|
|
38717
38805
|
var WAITING_TAIL = 100;
|
|
38718
38806
|
var plainOnly = /* @__PURE__ */ __name((text3, command) => {
|
|
@@ -38846,7 +38934,7 @@ var replyStatsService = /* @__PURE__ */ __name((deps) => {
|
|
|
38846
38934
|
};
|
|
38847
38935
|
}, "replyStatsService");
|
|
38848
38936
|
|
|
38849
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
38937
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/services/searches.js
|
|
38850
38938
|
var savedSearchItem = /* @__PURE__ */ __name((one) => ({
|
|
38851
38939
|
id: one.id,
|
|
38852
38940
|
name: one.name,
|
|
@@ -38972,7 +39060,7 @@ var searchesService = /* @__PURE__ */ __name((deps) => {
|
|
|
38972
39060
|
};
|
|
38973
39061
|
}, "searchesService");
|
|
38974
39062
|
|
|
38975
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
39063
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/services/tags.js
|
|
38976
39064
|
var TAGGING_QUERY = {
|
|
38977
39065
|
entity: "tagging",
|
|
38978
39066
|
backend: "sql",
|
|
@@ -39056,7 +39144,7 @@ var tagsService = /* @__PURE__ */ __name((deps) => {
|
|
|
39056
39144
|
};
|
|
39057
39145
|
}, "tagsService");
|
|
39058
39146
|
|
|
39059
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
39147
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/services/topics.js
|
|
39060
39148
|
var actionOf = /* @__PURE__ */ __name(({ title, closed, pinned, hidden, icon }) => {
|
|
39061
39149
|
const set = [closed, pinned, hidden].filter((one) => one !== void 0).length;
|
|
39062
39150
|
if (title !== void 0 || icon !== void 0 || set !== 1)
|
|
@@ -39255,7 +39343,7 @@ var topicsService = /* @__PURE__ */ __name((deps) => {
|
|
|
39255
39343
|
};
|
|
39256
39344
|
}, "topicsService");
|
|
39257
39345
|
|
|
39258
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
39346
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/services/evidence.js
|
|
39259
39347
|
import { createHash as createHash11, randomUUID as randomUUID6 } from "node:crypto";
|
|
39260
39348
|
var hash2 = /* @__PURE__ */ __name((value) => createHash11("sha256").update(JSON.stringify(value)).digest("hex"), "hash");
|
|
39261
39349
|
var positive2 = /* @__PURE__ */ __name((value, name, minimum = 1) => {
|
|
@@ -39329,7 +39417,7 @@ var prepareEvidencePacket = /* @__PURE__ */ __name(({ kind: kind2, source, page,
|
|
|
39329
39417
|
return { ...content, id: randomUUID6(), fingerprint: hash2(content) };
|
|
39330
39418
|
}, "prepareEvidencePacket");
|
|
39331
39419
|
|
|
39332
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
39420
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/services/evidence-read.js
|
|
39333
39421
|
var readEvidencePacket = /* @__PURE__ */ __name(async (store, account, { chat, limit, before }, messenger = {}) => {
|
|
39334
39422
|
if (!Number.isSafeInteger(limit) || limit < 1 || limit > 100)
|
|
39335
39423
|
throw new CliError("validation_error", "evidence message limit must be an integer from 1 to 100");
|
|
@@ -39349,7 +39437,7 @@ var readEvidencePacket = /* @__PURE__ */ __name(async (store, account, { chat, l
|
|
|
39349
39437
|
return { ...packet, nextBeforeId: older && last ? last.id : null };
|
|
39350
39438
|
}, "readEvidencePacket");
|
|
39351
39439
|
|
|
39352
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
39440
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/services/meeting-project-discovery.js
|
|
39353
39441
|
var scopeKeys = [
|
|
39354
39442
|
"accountId",
|
|
39355
39443
|
"meetingId",
|
|
@@ -39371,7 +39459,7 @@ var optionKeys = /* @__PURE__ */ new Set([
|
|
|
39371
39459
|
"maxVocabularyReadBytes"
|
|
39372
39460
|
]);
|
|
39373
39461
|
|
|
39374
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
39462
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/services/text-model-choice.js
|
|
39375
39463
|
import { createHash as createHash12 } from "node:crypto";
|
|
39376
39464
|
import { existsSync as existsSync3 } from "node:fs";
|
|
39377
39465
|
var useTextModel = /* @__PURE__ */ __name(async (id3, { env, command }) => {
|
|
@@ -39421,8 +39509,8 @@ var CustomModelRequest = strictObject({
|
|
|
39421
39509
|
chunksPerSecond: optional(number())
|
|
39422
39510
|
});
|
|
39423
39511
|
var invalid5 = /* @__PURE__ */ __name((what, issues) => {
|
|
39424
|
-
const
|
|
39425
|
-
return new CliError("validation_error", `${what}${
|
|
39512
|
+
const at2 = getDotPath(issues[0]);
|
|
39513
|
+
return new CliError("validation_error", `${what}${at2 ? ` ${at2}` : ""} ${issues[0].message}`);
|
|
39426
39514
|
}, "invalid");
|
|
39427
39515
|
var HUB = "https://huggingface.co";
|
|
39428
39516
|
var SMALL_FILE_MOST = 2e7;
|
|
@@ -39502,14 +39590,14 @@ var addCustomTextModel = /* @__PURE__ */ __name(async (id3, payload, { env, fetc
|
|
|
39502
39590
|
return { ...checked2.output, custom: true };
|
|
39503
39591
|
}, "addCustomTextModel");
|
|
39504
39592
|
|
|
39505
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
39593
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/calendar/sync.js
|
|
39506
39594
|
var DAY6 = 864e5;
|
|
39507
39595
|
var SLOTS_EVERY = 7 * DAY6;
|
|
39508
39596
|
|
|
39509
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
39597
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/calendar/feeds.js
|
|
39510
39598
|
var FEED_LIMITS = { maxBytes: 10 * 1024 * 1024, timeoutMs: 3e4, redirects: 5 };
|
|
39511
39599
|
|
|
39512
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
39600
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/calendar/reads.js
|
|
39513
39601
|
var LIST = "events list";
|
|
39514
39602
|
var EVENT_TYPES = [
|
|
39515
39603
|
"default",
|
|
@@ -39568,7 +39656,7 @@ var EVENTS_QUERY = {
|
|
|
39568
39656
|
} : field)
|
|
39569
39657
|
};
|
|
39570
39658
|
|
|
39571
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
39659
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/calendar/writer.js
|
|
39572
39660
|
var EVENTS_NOTIFY_KEY = "events.notify";
|
|
39573
39661
|
var EVENTS_DELETE_SERIES_KEY = "events.delete.series";
|
|
39574
39662
|
var EVENTS_REMIND_HOOK_KEY = "events.remind.hook";
|
|
@@ -39586,7 +39674,7 @@ var CALENDAR_WRITE_DEFAULTS = {
|
|
|
39586
39674
|
[EVENTS_REMIND_HOOK_KEY]: "deny"
|
|
39587
39675
|
};
|
|
39588
39676
|
|
|
39589
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
39677
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/context/communication-selection.js
|
|
39590
39678
|
var communicationFields = {
|
|
39591
39679
|
sources: pipe(array(strictObject({
|
|
39592
39680
|
id: pipe(string(), regex(/^[A-Za-z0-9][A-Za-z0-9._-]{0,127}$/)),
|
|
@@ -39618,7 +39706,7 @@ var communicationRequest = /* @__PURE__ */ __name((value, preparationAfter) => {
|
|
|
39618
39706
|
return { ...input, after, before };
|
|
39619
39707
|
}, "communicationRequest");
|
|
39620
39708
|
|
|
39621
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
39709
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/services/meeting-preparation-validation.js
|
|
39622
39710
|
var MEETING_PREPARATION_LIMITS = {
|
|
39623
39711
|
meetings: { min: 1, max: 20, default: 5 },
|
|
39624
39712
|
cues: { min: 1, max: 100, default: 10 },
|
|
@@ -39691,7 +39779,7 @@ var validateMeetingPreparationRequest = /* @__PURE__ */ __name((externalId, orig
|
|
|
39691
39779
|
};
|
|
39692
39780
|
}, "validateMeetingPreparationRequest");
|
|
39693
39781
|
|
|
39694
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
39782
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/services/meeting-communications-selection.js
|
|
39695
39783
|
var validatePreparationCommunications = /* @__PURE__ */ __name((section, request, after) => {
|
|
39696
39784
|
const fail2 = /* @__PURE__ */ __name(() => {
|
|
39697
39785
|
throw new CliError("invalid_response", "Preparation communications returned another selection or invalid evidence");
|
|
@@ -39739,7 +39827,7 @@ var validatePreparationCommunications = /* @__PURE__ */ __name((section, request
|
|
|
39739
39827
|
}
|
|
39740
39828
|
}, "validatePreparationCommunications");
|
|
39741
39829
|
|
|
39742
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
39830
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/services/package-upgrade.js
|
|
39743
39831
|
var upgradePackage = /* @__PURE__ */ __name(async ({ current, command, packageName, check: check2 }, ports) => {
|
|
39744
39832
|
const installer = ports.installer();
|
|
39745
39833
|
const argv = updateCommand(installer, packageName);
|
|
@@ -39804,7 +39892,7 @@ var dayAfter = /* @__PURE__ */ __name((published) => {
|
|
|
39804
39892
|
return Number.isNaN(time) ? null : new Date(time + 24 * 60 * 60 * 1e3).toISOString();
|
|
39805
39893
|
}, "dayAfter");
|
|
39806
39894
|
|
|
39807
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
39895
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.718.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.126.1_commander@15_05e4e157d64d32ce6fc62270b9552a1d/node_modules/@wirecat/cli-core/dist/services/index.js
|
|
39808
39896
|
var servicesFor = /* @__PURE__ */ __name((deps) => {
|
|
39809
39897
|
const pictures = picturesService(deps);
|
|
39810
39898
|
const base = {
|