@wirecat/mail-cli 0.31.0 → 0.33.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +24 -0
- package/dist/bin/mail.js +2 -2
- package/dist/bundle/{all-profiles-XL62TNUO.js → all-profiles-W3CGXEEJ.js} +10 -10
- package/dist/bundle/{anthropic-3MSWVYCE.js → anthropic-UMDO5AKP.js} +5 -5
- package/dist/bundle/{app-server-RRNR5XFA.js → app-server-4SICQ5RP.js} +50 -50
- package/dist/bundle/{bun-E3F3PEQQ.js → bun-QVVCH4MJ.js} +2 -2
- package/dist/bundle/{bun-sqlite-UOFN77LO.js → bun-sqlite-CHD4AIUK.js} +6 -6
- package/dist/bundle/{chunk-JYGFEMTR.js → chunk-2BFXHCZW.js} +2 -2
- package/dist/bundle/{chunk-NEJU74O4.js → chunk-2L6D54BR.js} +8 -8
- package/dist/bundle/{chunk-BS6WYCNZ.js → chunk-2P44S7XK.js} +27 -30
- package/dist/bundle/{chunk-TUXNILKR.js → chunk-2X344EUT.js} +8 -8
- package/dist/bundle/{chunk-M4OP5ASJ.js → chunk-35AH33VJ.js} +1 -1
- package/dist/bundle/{chunk-UFMR2TB3.js → chunk-47YNANPZ.js} +2 -2
- package/dist/bundle/{chunk-7C6FGWDH.js → chunk-6IS4BEN4.js} +4 -4
- package/dist/bundle/{chunk-ITU6K7LU.js → chunk-6VCQ4CTK.js} +1 -1
- package/dist/bundle/{chunk-NYQPKZWL.js → chunk-74BYHR44.js} +590 -604
- package/dist/bundle/{chunk-T72DWT37.js → chunk-7OYZU5SP.js} +4 -4
- package/dist/bundle/{chunk-4BW5JACS.js → chunk-AEKWEYIG.js} +17 -17
- package/dist/bundle/{chunk-3CJ4C6BB.js → chunk-BF73DBAA.js} +13 -13
- package/dist/bundle/{chunk-7KCBPAQS.js → chunk-BI5P7JWM.js} +2 -2
- package/dist/bundle/{chunk-7MEVD5PI.js → chunk-BRRHYXUP.js} +19 -19
- package/dist/bundle/{chunk-GZLCZU5B.js → chunk-BZY5W35X.js} +7 -7
- package/dist/bundle/{chunk-6UOUDIXL.js → chunk-CHNNKHLL.js} +7468 -7317
- package/dist/bundle/{chunk-QVGCHTTU.js → chunk-CIG4UVP6.js} +12 -12
- package/dist/bundle/{chunk-D6D6JLXG.js → chunk-CZ6ZXDSO.js} +46 -37
- package/dist/bundle/{chunk-7E7YXQ52.js → chunk-DI74RP6R.js} +18 -18
- package/dist/bundle/{chunk-IX3GUNGV.js → chunk-EW3JFV7J.js} +4 -4
- package/dist/bundle/{chunk-GWKGZOSO.js → chunk-FSMCXQH2.js} +2 -2
- package/dist/bundle/{chunk-DDCDOBZS.js → chunk-GZYICXO4.js} +1 -1
- package/dist/bundle/{chunk-BKRIIZPV.js → chunk-H46MANPR.js} +3 -3
- package/dist/bundle/{chunk-OP5ZLH53.js → chunk-HFFHL7SV.js} +55 -55
- package/dist/bundle/{chunk-DCR3IWC7.js → chunk-I3UAD4EI.js} +33 -32
- package/dist/bundle/{chunk-EMVLCION.js → chunk-IBIFX2LK.js} +2 -2
- package/dist/bundle/{chunk-BNP7WLDQ.js → chunk-IPSLQX64.js} +2 -2
- package/dist/bundle/{chunk-DPDS6IZJ.js → chunk-JADBHKBP.js} +1 -1
- package/dist/bundle/{chunk-DWBY7DMF.js → chunk-JCQ47WR4.js} +5 -5
- package/dist/bundle/{chunk-LGDJDD5J.js → chunk-JUYUWMTG.js} +4 -4
- package/dist/bundle/{chunk-OXHQNEXU.js → chunk-KLLT572M.js} +3 -3
- package/dist/bundle/{chunk-5YRR52NH.js → chunk-L3MKFI3Y.js} +2 -2
- package/dist/bundle/{chunk-PZL7DHVJ.js → chunk-LACMDMDI.js} +9 -9
- package/dist/bundle/{chunk-DZSS2IUK.js → chunk-LB5FTCPZ.js} +3 -4
- package/dist/bundle/{chunk-JLIVJSCF.js → chunk-LFBD6RTX.js} +2 -2
- package/dist/bundle/{chunk-QSXJ2BVQ.js → chunk-LKGJMM6W.js} +6 -6
- package/dist/bundle/{chunk-NV3WPD3B.js → chunk-LXAX6AZU.js} +6 -6
- package/dist/bundle/{chunk-H2QTUZ3C.js → chunk-LXUHYDNE.js} +1 -1
- package/dist/bundle/{chunk-I3BQ2QIY.js → chunk-MJ7DUSHT.js} +14 -14
- package/dist/bundle/{chunk-4ME2NHNJ.js → chunk-MNJ3BMPZ.js} +3 -3
- package/dist/bundle/{chunk-THZHNCJP.js → chunk-MT7T5N2N.js} +4 -4
- package/dist/bundle/{chunk-KPFB2VUY.js → chunk-OFMYFFEF.js} +461 -402
- package/dist/bundle/{chunk-WZGFC7D5.js → chunk-OOYIPK4F.js} +1 -1
- package/dist/bundle/{chunk-NUN7DBR4.js → chunk-OWAJN74H.js} +17 -18
- package/dist/bundle/{chunk-S2QO6KUI.js → chunk-QN423PC6.js} +3 -3
- package/dist/bundle/{chunk-EV5SR3OC.js → chunk-QO7BK4WD.js} +8 -8
- package/dist/bundle/{chunk-GXBNTKJW.js → chunk-RENCSP47.js} +3 -3
- package/dist/bundle/{chunk-FIVFP53N.js → chunk-RXUVXAMM.js} +1 -1
- package/dist/bundle/{chunk-HZCINHHS.js → chunk-S6CHYNFE.js} +2 -2
- package/dist/bundle/{chunk-E3IOR37T.js → chunk-SDWYOYGN.js} +4 -4
- package/dist/bundle/{chunk-MS5XYEYW.js → chunk-SW7YGW3T.js} +28 -7
- package/dist/bundle/{chunk-BXMLIKUM.js → chunk-SYUIAMVA.js} +181 -156
- package/dist/bundle/{chunk-HZL3X4XR.js → chunk-TBZLGT7R.js} +20 -17
- package/dist/bundle/{chunk-FRXDSR45.js → chunk-TK77DCE5.js} +1 -1
- package/dist/bundle/{chunk-P6CYVOL6.js → chunk-UAV74EY4.js} +1 -1
- package/dist/bundle/{chunk-SQA5JI7Q.js → chunk-UG2QDGAH.js} +1 -1
- package/dist/bundle/{chunk-ECZSYLSL.js → chunk-UWF3SSRL.js} +25 -8
- package/dist/bundle/{chunk-QANXOKYQ.js → chunk-UX76GMQM.js} +6 -6
- package/dist/bundle/{chunk-I5Y6Y7Q5.js → chunk-UYZDH5LK.js} +1 -1
- package/dist/bundle/{chunk-3V6J7VPF.js → chunk-XN5KH24X.js} +5 -5
- package/dist/bundle/{chunk-FYP2M6IT.js → chunk-XQXYAOBV.js} +30 -29
- package/dist/bundle/{chunk-PIXFZZUZ.js → chunk-Y2P2LC5R.js} +21 -11
- package/dist/bundle/command-contract-NRNQAFFE.js +36 -0
- package/dist/bundle/{command-server-entry-A3FCP24M.js → command-server-entry-G2ZHCN5J.js} +25 -25
- package/dist/bundle/{decode-FI2ISRNZ.js → decode-U6V6D6XH.js} +5 -5
- package/dist/bundle/{dispatch-DSVN7MNG.js → dispatch-RHIK22OA.js} +8 -8
- package/dist/bundle/{dist-NLOOZJ64.js → dist-X5G2IMYG.js} +15 -15
- package/dist/bundle/{echarts-PMAJUJFE.js → echarts-UZJ6AREV.js} +2 -2
- package/dist/bundle/{embed-OIMT6SAX.js → embed-FEXLUH3T.js} +6 -6
- package/dist/bundle/{embedder-Q5IF5WIM.js → embedder-NHQARKFJ.js} +9 -9
- package/dist/bundle/{failure-COTPFUP4.js → failure-7DIA4OET.js} +2 -2
- package/dist/bundle/{first-run-4L53QWOT.js → first-run-PS5NR2QG.js} +12 -12
- package/dist/bundle/first-screen-C2WTLOG2.js +34 -0
- package/dist/bundle/{instructions-ZJGGGXOA.js → instructions-SDDUBGH4.js} +1 -1
- package/dist/bundle/mail.js +12 -12
- package/dist/bundle/{mcp-TDKGDB4V.js → mcp-GN4FTJX5.js} +2 -2
- package/dist/bundle/{node-DCSOHRD6.js → node-ELCNUOCE.js} +2 -2
- package/dist/bundle/{node-sqlite-7F77K5JA.js → node-sqlite-2E5MKZMH.js} +7 -7
- package/dist/bundle/{oauth-LVPMEN6M.js → oauth-JGPEIY3M.js} +7 -7
- package/dist/bundle/{open-XM5LWEN6.js → open-6DEMCZAB.js} +5 -5
- package/dist/bundle/{openai-H2LCGK22.js → openai-IVKDU5AH.js} +15 -15
- package/dist/bundle/{process-MFC5VSPT.js → process-67DAKAAQ.js} +1 -1
- package/dist/bundle/{program-ZQ43ZYKZ.js → program-ESJDQMAJ.js} +498 -481
- package/dist/bundle/{prompt-3LZAZNQ4.js → prompt-ZBWOT5KG.js} +5 -5
- package/dist/bundle/{recognize-GYQMHFY2.js → recognize-UUBH2DOH.js} +4 -4
- package/dist/bundle/{remote-P2MD5G64.js → remote-UYTNWNOB.js} +9 -9
- package/dist/bundle/{rerank-A5X6THV6.js → rerank-X2633CQN.js} +7 -7
- package/dist/bundle/{serve-IEC3EUKS.js → serve-CP7Q4OVW.js} +9 -9
- package/dist/bundle/{server-3REPXFNI.js → server-I7MXRSAG.js} +42 -42
- package/dist/bundle/server-QGTMJ7SF.js +67 -0
- package/dist/bundle/{sqlite-runtime-AOLQGC5J.js → sqlite-runtime-BX55LI5G.js} +6 -6
- package/dist/bundle/{state-D3P5IXXA.js → state-LLNJQXFH.js} +6 -6
- package/dist/bundle/{store-MZCQXBVW.js → store-K4KU5N75.js} +19 -19
- package/dist/bundle/{store-DIN6OY3K.js → store-N27XI3VV.js} +17 -17
- package/dist/bundle/store-maintenance-command-VPAFQCNA.js +58 -0
- package/dist/commands/messages.js +1 -1
- package/dist/commands/messages.js.map +1 -1
- package/dist/mail/cleanup.d.ts.map +1 -1
- package/dist/mail/cleanup.js +4 -3
- package/dist/mail/cleanup.js.map +1 -1
- package/dist/mail/rules/apply.js +1 -1
- package/dist/mail/rules/apply.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +3 -3
- package/dist/bundle/command-contract-YRNKDQDL.js +0 -36
- package/dist/bundle/first-screen-ZPQLAAIS.js +0 -34
- package/dist/bundle/server-E2QTFURI.js +0 -67
- package/dist/bundle/store-maintenance-command-UMVFI6M6.js +0 -58
- /package/dist/bundle/{chunk-XWBPP2HX.js → chunk-BDCC2J2Z.js} +0 -0
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
sameOrdinaryFile,
|
|
9
9
|
syncDirectory,
|
|
10
10
|
writeFileAtomic
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-BF73DBAA.js";
|
|
12
12
|
import {
|
|
13
13
|
MAX_ACTIONS,
|
|
14
14
|
ModerationRules,
|
|
@@ -17,11 +17,12 @@ import {
|
|
|
17
17
|
gather,
|
|
18
18
|
judge,
|
|
19
19
|
moderationPathFor,
|
|
20
|
+
moderationProfiles,
|
|
20
21
|
nextPoint,
|
|
21
22
|
someUndone,
|
|
22
23
|
validateFormattedText,
|
|
23
24
|
visibleFormattedText
|
|
24
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-Y2P2LC5R.js";
|
|
25
26
|
import {
|
|
26
27
|
EmptyAnswer,
|
|
27
28
|
MAX_MODEL_IMAGE_BYTES,
|
|
@@ -30,10 +31,11 @@ import {
|
|
|
30
31
|
range,
|
|
31
32
|
systemFor,
|
|
32
33
|
validateImages
|
|
33
|
-
} from "./chunk-
|
|
34
|
+
} from "./chunk-SDWYOYGN.js";
|
|
34
35
|
import {
|
|
35
36
|
Command,
|
|
36
37
|
CustomTextModelShape,
|
|
38
|
+
DEFAULT_CONFIG,
|
|
37
39
|
DEFAULT_IMAGE_MODEL,
|
|
38
40
|
DEFAULT_RERANK_MODEL,
|
|
39
41
|
DEFAULT_TEXT_MODEL,
|
|
@@ -78,18 +80,21 @@ import {
|
|
|
78
80
|
textModel,
|
|
79
81
|
textModels,
|
|
80
82
|
vectorModelKey,
|
|
83
|
+
withAgentLevels,
|
|
81
84
|
writeTextModelsSection
|
|
82
|
-
} from "./chunk-
|
|
85
|
+
} from "./chunk-SYUIAMVA.js";
|
|
83
86
|
import {
|
|
84
87
|
CEILING_KEY,
|
|
88
|
+
STORE_ONLY_KEYS,
|
|
85
89
|
keyForWrite,
|
|
86
90
|
levelFor,
|
|
87
|
-
skipFlagFor
|
|
88
|
-
|
|
91
|
+
skipFlagFor,
|
|
92
|
+
stops
|
|
93
|
+
} from "./chunk-SW7YGW3T.js";
|
|
89
94
|
import {
|
|
90
95
|
isNewer,
|
|
91
96
|
updateCommand
|
|
92
|
-
} from "./chunk-
|
|
97
|
+
} from "./chunk-6IS4BEN4.js";
|
|
93
98
|
import {
|
|
94
99
|
AGENDA_COLUMNS,
|
|
95
100
|
BUSINESS_FIND_MAX,
|
|
@@ -103,15 +108,18 @@ import {
|
|
|
103
108
|
MAX_FILE_BYTES,
|
|
104
109
|
MAX_TEXT_CHARS,
|
|
105
110
|
MENTION_QUERY,
|
|
111
|
+
MINUTE,
|
|
106
112
|
NOT_FILES,
|
|
107
113
|
PRESET_VERSION,
|
|
114
|
+
RRF_K,
|
|
108
115
|
TASK_RELATION_KINDS,
|
|
109
116
|
TRACKED_CHAT_COLUMNS,
|
|
117
|
+
YEAR,
|
|
118
|
+
aheadOf,
|
|
110
119
|
amountsOf,
|
|
111
120
|
attachmentColumns,
|
|
112
121
|
attachmentMaxBytes,
|
|
113
122
|
calendarKey,
|
|
114
|
-
calendarMoment,
|
|
115
123
|
certaintyOf,
|
|
116
124
|
chunkHash,
|
|
117
125
|
chunkTextOf,
|
|
@@ -124,6 +132,7 @@ import {
|
|
|
124
132
|
dueDayOf,
|
|
125
133
|
fetchedKey,
|
|
126
134
|
foldedWords,
|
|
135
|
+
fuseRanked,
|
|
127
136
|
googleDocumentLinks,
|
|
128
137
|
hasStems,
|
|
129
138
|
hasText,
|
|
@@ -141,11 +150,12 @@ import {
|
|
|
141
150
|
profilesOn,
|
|
142
151
|
queryFilter,
|
|
143
152
|
rankingContextRange,
|
|
153
|
+
readMoment,
|
|
144
154
|
threadConversation,
|
|
145
155
|
validateAst,
|
|
146
156
|
validateFields,
|
|
147
157
|
withoutField
|
|
148
|
-
} from "./chunk-
|
|
158
|
+
} from "./chunk-CHNNKHLL.js";
|
|
149
159
|
import {
|
|
150
160
|
COUNTER_FIELDS,
|
|
151
161
|
MESSAGE_PARSING,
|
|
@@ -170,7 +180,7 @@ import {
|
|
|
170
180
|
rankingOptions,
|
|
171
181
|
rankingQuestion,
|
|
172
182
|
searchError
|
|
173
|
-
} from "./chunk-
|
|
183
|
+
} from "./chunk-DI74RP6R.js";
|
|
174
184
|
import {
|
|
175
185
|
LOG_ATTRIBUTES,
|
|
176
186
|
TASK_KINDS,
|
|
@@ -193,7 +203,7 @@ import {
|
|
|
193
203
|
sourceOf3 as sourceOf2,
|
|
194
204
|
typedCommand,
|
|
195
205
|
withAttempt
|
|
196
|
-
} from "./chunk-
|
|
206
|
+
} from "./chunk-XQXYAOBV.js";
|
|
197
207
|
import {
|
|
198
208
|
BACKENDS,
|
|
199
209
|
EVENT_QUERY,
|
|
@@ -258,40 +268,39 @@ import {
|
|
|
258
268
|
validateMeetingPassage,
|
|
259
269
|
validateQuery,
|
|
260
270
|
walkQuery,
|
|
261
|
-
windowOf
|
|
262
|
-
|
|
263
|
-
} from "./chunk-KPFB2VUY.js";
|
|
271
|
+
windowOf
|
|
272
|
+
} from "./chunk-OFMYFFEF.js";
|
|
264
273
|
import {
|
|
265
274
|
isCliFailure,
|
|
266
275
|
sqliteCode
|
|
267
|
-
} from "./chunk-
|
|
276
|
+
} from "./chunk-L3MKFI3Y.js";
|
|
268
277
|
import {
|
|
269
278
|
DEFAULT_STEMMERS,
|
|
270
279
|
createStemmer
|
|
271
|
-
} from "./chunk-
|
|
280
|
+
} from "./chunk-QO7BK4WD.js";
|
|
272
281
|
import {
|
|
273
282
|
fold,
|
|
274
283
|
normalize
|
|
275
|
-
} from "./chunk-
|
|
284
|
+
} from "./chunk-TK77DCE5.js";
|
|
276
285
|
import {
|
|
277
286
|
localOnly,
|
|
278
287
|
refuseOffComputer,
|
|
279
288
|
remoteKey
|
|
280
|
-
} from "./chunk-
|
|
289
|
+
} from "./chunk-LACMDMDI.js";
|
|
281
290
|
import {
|
|
282
291
|
PLAIN_HTTP_REFUSED,
|
|
283
292
|
endpoint,
|
|
284
293
|
endpointFetch,
|
|
285
294
|
modelAddressAllowed,
|
|
286
295
|
onThisComputer
|
|
287
|
-
} from "./chunk-
|
|
296
|
+
} from "./chunk-JCQ47WR4.js";
|
|
288
297
|
import {
|
|
289
298
|
DEFAULT_TASK_CATEGORIES,
|
|
290
299
|
FALLBACK_CATEGORY,
|
|
291
300
|
readSharedSection,
|
|
292
301
|
sharedConfigPath,
|
|
293
302
|
writeSharedSection
|
|
294
|
-
} from "./chunk-
|
|
303
|
+
} from "./chunk-BZY5W35X.js";
|
|
295
304
|
import {
|
|
296
305
|
Unzip,
|
|
297
306
|
UnzipInflate,
|
|
@@ -302,15 +311,15 @@ import {
|
|
|
302
311
|
placedText,
|
|
303
312
|
runEmbedders,
|
|
304
313
|
textModelsDirectory
|
|
305
|
-
} from "./chunk-
|
|
314
|
+
} from "./chunk-UX76GMQM.js";
|
|
306
315
|
import {
|
|
307
316
|
installFiles,
|
|
308
317
|
megabytes
|
|
309
|
-
} from "./chunk-
|
|
318
|
+
} from "./chunk-JUYUWMTG.js";
|
|
310
319
|
import {
|
|
311
320
|
storePath,
|
|
312
321
|
wirecatDirectory
|
|
313
|
-
} from "./chunk-
|
|
322
|
+
} from "./chunk-IPSLQX64.js";
|
|
314
323
|
import {
|
|
315
324
|
Credentials,
|
|
316
325
|
logRecordOf,
|
|
@@ -318,7 +327,7 @@ import {
|
|
|
318
327
|
realSleep,
|
|
319
328
|
resolvePaths,
|
|
320
329
|
writeSecurely
|
|
321
|
-
} from "./chunk-
|
|
330
|
+
} from "./chunk-BRRHYXUP.js";
|
|
322
331
|
import {
|
|
323
332
|
array,
|
|
324
333
|
boolean,
|
|
@@ -346,7 +355,7 @@ import {
|
|
|
346
355
|
trim,
|
|
347
356
|
union,
|
|
348
357
|
unknown
|
|
349
|
-
} from "./chunk-
|
|
358
|
+
} from "./chunk-UWF3SSRL.js";
|
|
350
359
|
import {
|
|
351
360
|
importFrom,
|
|
352
361
|
resolveFrom
|
|
@@ -355,7 +364,7 @@ import {
|
|
|
355
364
|
CliError,
|
|
356
365
|
isCliError,
|
|
357
366
|
singleLine
|
|
358
|
-
} from "./chunk-
|
|
367
|
+
} from "./chunk-BI5P7JWM.js";
|
|
359
368
|
import {
|
|
360
369
|
__commonJS,
|
|
361
370
|
__name,
|
|
@@ -16971,10 +16980,10 @@ var require_lib3 = __commonJS({
|
|
|
16971
16980
|
}
|
|
16972
16981
|
});
|
|
16973
16982
|
|
|
16974
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
16983
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/ports/traits.js
|
|
16975
16984
|
var syncsOneChat = /* @__PURE__ */ __name((messenger) => messenger.history !== "store" || messenger.historyOnDemand === true, "syncsOneChat");
|
|
16976
16985
|
|
|
16977
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
16986
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/conversations/link.js
|
|
16978
16987
|
var RULES_VERSION = 5;
|
|
16979
16988
|
var LOOK_BACK = 50;
|
|
16980
16989
|
var SAME_SENDER_WITHIN = 10;
|
|
@@ -17064,7 +17073,7 @@ var latest = /* @__PURE__ */ __name((window3, matches) => {
|
|
|
17064
17073
|
var sameThread = /* @__PURE__ */ __name((a, b) => a.threadId === b.threadId, "sameThread");
|
|
17065
17074
|
var link = /* @__PURE__ */ __name((message, parentId, source, kind, confidence, method) => ({ messageId: message.id, parentId, source, kind, confidence, method }), "link");
|
|
17066
17075
|
|
|
17067
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
17076
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/sends/upload.js
|
|
17068
17077
|
import { openAsBlob, realpathSync } from "node:fs";
|
|
17069
17078
|
import { open, stat } from "node:fs/promises";
|
|
17070
17079
|
import { basename, dirname, extname, isAbsolute, relative, resolve, sep } from "node:path";
|
|
@@ -17243,7 +17252,7 @@ var checkFilename = /* @__PURE__ */ __name((filename, files) => {
|
|
|
17243
17252
|
throw new CliError("validation_error", "--filename is a name, not a path: no / or \\, at most 255 characters");
|
|
17244
17253
|
}, "checkFilename");
|
|
17245
17254
|
var listOf2 = /* @__PURE__ */ __name((value) => value === void 0 ? [] : typeof value === "string" ? [value] : value, "listOf");
|
|
17246
|
-
var readAttachments = /* @__PURE__ */ __name(async ({ photo, file, voice, asFile, filename, text: text2 },
|
|
17255
|
+
var readAttachments = /* @__PURE__ */ __name(async ({ photo, file, voice, asFile, filename, text: text2 }, read2) => {
|
|
17247
17256
|
const photos = listOf2(photo);
|
|
17248
17257
|
const files = listOf2(file);
|
|
17249
17258
|
if (voice !== void 0 && (photos.length > 0 || files.length > 0 || (text2 ?? "").trim() !== "")) {
|
|
@@ -17255,21 +17264,21 @@ var readAttachments = /* @__PURE__ */ __name(async ({ photo, file, voice, asFile
|
|
|
17255
17264
|
checkFilename(filename, files);
|
|
17256
17265
|
const uploads = [];
|
|
17257
17266
|
for (const one of photos)
|
|
17258
|
-
uploads.push(await readUpload("photo", one,
|
|
17267
|
+
uploads.push(await readUpload("photo", one, read2));
|
|
17259
17268
|
for (const one of files)
|
|
17260
17269
|
uploads.push({
|
|
17261
|
-
...await readUpload("file", one,
|
|
17270
|
+
...await readUpload("file", one, read2),
|
|
17262
17271
|
...filename === void 0 ? {} : { name: filename },
|
|
17263
17272
|
...asFile ? { asFile: true } : {}
|
|
17264
17273
|
});
|
|
17265
17274
|
if (voice !== void 0)
|
|
17266
|
-
uploads.push(await readUpload("voice", voice,
|
|
17275
|
+
uploads.push(await readUpload("voice", voice, read2));
|
|
17267
17276
|
return uploads;
|
|
17268
17277
|
}, "readAttachments");
|
|
17269
|
-
var readStickerFile = /* @__PURE__ */ __name(async (path, maxBytes,
|
|
17278
|
+
var readStickerFile = /* @__PURE__ */ __name(async (path, maxBytes, read2) => {
|
|
17270
17279
|
if (extname(path).toLowerCase() !== ".webp")
|
|
17271
17280
|
throw new CliError("validation_error", `a sticker is a .webp \u2014 send ${path} as a photo or a file instead`);
|
|
17272
|
-
const { name, source } = await readUpload("file", path,
|
|
17281
|
+
const { name, source } = await readUpload("file", path, read2);
|
|
17273
17282
|
if (SIGNATURES[".webp"]?.(await fileHead(path)) !== true)
|
|
17274
17283
|
throw new CliError("validation_error", `${path} is named .webp but is not a WebP image \u2014 nothing was sent`);
|
|
17275
17284
|
const size2 = uploadSize(source);
|
|
@@ -17278,10 +17287,10 @@ var readStickerFile = /* @__PURE__ */ __name(async (path, maxBytes, read) => {
|
|
|
17278
17287
|
return { name, source };
|
|
17279
17288
|
}, "readStickerFile");
|
|
17280
17289
|
|
|
17281
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
17290
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/sends/guard.js
|
|
17282
17291
|
import { randomUUID } from "node:crypto";
|
|
17283
17292
|
|
|
17284
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
17293
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/sends/flood.js
|
|
17285
17294
|
import { mkdirSync, readFileSync, renameSync, writeFileSync } from "node:fs";
|
|
17286
17295
|
import { dirname as dirname2, join } from "node:path";
|
|
17287
17296
|
var MOST_DEADLINES = 50;
|
|
@@ -17365,11 +17374,11 @@ var FloodMemory = class {
|
|
|
17365
17374
|
}
|
|
17366
17375
|
};
|
|
17367
17376
|
|
|
17368
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
17377
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/sends/journal.js
|
|
17369
17378
|
import { appendFileSync, mkdirSync as mkdirSync3, readFileSync as readFileSync2 } from "node:fs";
|
|
17370
17379
|
import { dirname as dirname4, join as join2 } from "node:path";
|
|
17371
17380
|
|
|
17372
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
17381
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/sends/file-lock.js
|
|
17373
17382
|
import { closeSync, mkdirSync as mkdirSync2, openSync, statSync, unlinkSync } from "node:fs";
|
|
17374
17383
|
import { dirname as dirname3 } from "node:path";
|
|
17375
17384
|
var LOCK_WAIT_MS = 5e3;
|
|
@@ -17436,7 +17445,7 @@ var lockTime = /* @__PURE__ */ __name((lock) => {
|
|
|
17436
17445
|
}
|
|
17437
17446
|
}, "lockTime");
|
|
17438
17447
|
|
|
17439
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
17448
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/sends/journal.js
|
|
17440
17449
|
var sendsPathFor = /* @__PURE__ */ __name((app, profile, env = process.env) => join2(resolvePaths({ appName: app.appName, prefix: app.envPrefix, env }).state, "sends", `${profile}.jsonl`), "sendsPathFor");
|
|
17441
17450
|
var SendJournal = class {
|
|
17442
17451
|
static {
|
|
@@ -17513,7 +17522,7 @@ var withSendId = /* @__PURE__ */ __name((entry) => {
|
|
|
17513
17522
|
return cid === void 0 || rest.sendId !== void 0 ? rest : { ...rest, sendId: String(cid) };
|
|
17514
17523
|
}, "withSendId");
|
|
17515
17524
|
|
|
17516
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
17525
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/sends/recipients.js
|
|
17517
17526
|
import { existsSync, readFileSync as readFileSync3, rmSync } from "node:fs";
|
|
17518
17527
|
import { join as join3 } from "node:path";
|
|
17519
17528
|
var recipientsPathFor = /* @__PURE__ */ __name((app, profile, env = process.env) => join3(resolvePaths({ appName: app.appName, prefix: app.envPrefix, env }).state, "profiles", `${profile}.recipients.json`), "recipientsPathFor");
|
|
@@ -17625,20 +17634,8 @@ var RecipientList = class {
|
|
|
17625
17634
|
}
|
|
17626
17635
|
};
|
|
17627
17636
|
|
|
17628
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
17637
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/sends/guard.js
|
|
17629
17638
|
var HOUR_MS = 60 * 60 * 1e3;
|
|
17630
|
-
var READS = /* @__PURE__ */ new Set([
|
|
17631
|
-
"attachments.extract",
|
|
17632
|
-
"conversations.embeddings",
|
|
17633
|
-
"conversations.links",
|
|
17634
|
-
"messages.server-search",
|
|
17635
|
-
"messages.sync-first",
|
|
17636
|
-
"stats.contacts.top.sync-first",
|
|
17637
|
-
"stats.messages.counters.sync",
|
|
17638
|
-
"stats.messages.show.sync-first",
|
|
17639
|
-
"stats.messages.top.sync-first",
|
|
17640
|
-
"store.gaps.repair"
|
|
17641
|
-
]);
|
|
17642
17639
|
var countsTowardLimit = /* @__PURE__ */ __name(({ kind = "message", action, notify }) => kind === "message" || kind === "forward" || kind === "edit" || kind === "delete" || kind === "pin" && notify === true || action === "create" || action === "members.add" || action === "requests.accept" || action === "join" || action === "contact-import", "countsTowardLimit");
|
|
17643
17640
|
var weightOf = /* @__PURE__ */ __name(({ kind = "message", action, count: count4, people }) => kind === "delete" || kind === "message" && action === void 0 ? Math.max(1, count4 ?? 1) : action === "create" || action === "members.add" || action === "requests.accept" || action === "contact-import" ? Math.max(1, people ?? count4 ?? 1) : 1, "weightOf");
|
|
17644
17641
|
var timeOf = /* @__PURE__ */ __name((entry) => {
|
|
@@ -17652,13 +17649,13 @@ var sendGuard = /* @__PURE__ */ __name(({ profile, recipients, command = recipie
|
|
|
17652
17649
|
let reservation;
|
|
17653
17650
|
const answered = /* @__PURE__ */ new WeakSet();
|
|
17654
17651
|
const refuseReadOnly = /* @__PURE__ */ __name(({ key }) => {
|
|
17655
|
-
if (key !== void 0 &&
|
|
17652
|
+
if (key !== void 0 && STORE_ONLY_KEYS.has(key))
|
|
17656
17653
|
return;
|
|
17657
17654
|
if (readOnlyLock)
|
|
17658
17655
|
throw readOnlyRefusal(readOnlyLock, MESSENGER_CHANGE_REFUSAL);
|
|
17659
17656
|
}, "refuseReadOnly");
|
|
17660
17657
|
const refuseHeld = /* @__PURE__ */ __name(({ key }) => {
|
|
17661
|
-
if (key !== void 0 &&
|
|
17658
|
+
if (key !== void 0 && STORE_ONLY_KEYS.has(key))
|
|
17662
17659
|
return;
|
|
17663
17660
|
const block = flood?.sendBlock();
|
|
17664
17661
|
if (!block)
|
|
@@ -17672,7 +17669,7 @@ var sendGuard = /* @__PURE__ */ __name(({ profile, recipients, command = recipie
|
|
|
17672
17669
|
if (levels !== void 0) {
|
|
17673
17670
|
const key = request.key ?? keyForWrite(kind, action);
|
|
17674
17671
|
const { level, key: named2 } = levelFor(levels, key, permissionDefaults);
|
|
17675
|
-
if (level
|
|
17672
|
+
if (stops(level, key))
|
|
17676
17673
|
throw levelRefusal({ profile, command, key, level, named: named2, permissionSources }, permissionFix?.(request, key));
|
|
17677
17674
|
if (level === "ask" && !answered.has(request)) {
|
|
17678
17675
|
throw new CliError("confirmation_required", `${key} asks before it acts, and it was not asked`);
|
|
@@ -17825,7 +17822,7 @@ var guardFor = /* @__PURE__ */ __name((app, settings, warn, env = process.env, a
|
|
|
17825
17822
|
}), "guardFor");
|
|
17826
17823
|
var journalFailure = /* @__PURE__ */ __name((error) => error?.code ?? (error instanceof Error ? error.name : "error"), "journalFailure");
|
|
17827
17824
|
|
|
17828
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
17825
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/cli/messenger/lacks.js
|
|
17829
17826
|
var COMMAND_NEEDS = {
|
|
17830
17827
|
"account update": ["updateProfile", "change the profile"],
|
|
17831
17828
|
"account sessions list": ["sessions", "list the account's sessions"],
|
|
@@ -17875,7 +17872,7 @@ var hideNever = /* @__PURE__ */ __name((messenger, group) => {
|
|
|
17875
17872
|
return group;
|
|
17876
17873
|
}, "hideNever");
|
|
17877
17874
|
|
|
17878
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
17875
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/services/members-audit.js
|
|
17879
17876
|
var AUDIT_PAGE = 200;
|
|
17880
17877
|
var AUDIT_BUDGET = 10;
|
|
17881
17878
|
var AUDIT_PAUSE_MS = 1e3;
|
|
@@ -17955,7 +17952,36 @@ var burstJoins = /* @__PURE__ */ __name((members) => {
|
|
|
17955
17952
|
return found;
|
|
17956
17953
|
}, "burstJoins");
|
|
17957
17954
|
|
|
17958
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
17955
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/services/moment.js
|
|
17956
|
+
var read = /* @__PURE__ */ __name((reference, flag, now, at) => {
|
|
17957
|
+
const found = readMoment(reference, flag, { ...at, now });
|
|
17958
|
+
if (found === void 0)
|
|
17959
|
+
throw new CliError("validation_error", `${flag} takes an ISO 8601 time, today, yesterday, or 30m, 2h, 1d ago \u2014 not "${reference.trim()}"`);
|
|
17960
|
+
return found;
|
|
17961
|
+
}, "read");
|
|
17962
|
+
var momentOf = /* @__PURE__ */ __name((reference, flag = "--since", now = Date.now(), at = {}) => read(reference, flag, now, at).time, "momentOf");
|
|
17963
|
+
var dateWindow = /* @__PURE__ */ __name(({ sinceTime, untilTime, zone, now = Date.now(), names: names2 = ["--since-time", "--until-time"] }) => {
|
|
17964
|
+
const at = zone === void 0 ? {} : { zone };
|
|
17965
|
+
const lower = sinceTime === void 0 ? void 0 : read(sinceTime, names2[0], now, at);
|
|
17966
|
+
const upper = untilTime === void 0 ? void 0 : read(untilTime, names2[1], now, { ...at, end: true });
|
|
17967
|
+
const since = lower?.time;
|
|
17968
|
+
const until = upper?.time;
|
|
17969
|
+
const readInZone = lower?.local === true || upper?.local === true;
|
|
17970
|
+
const window3 = {
|
|
17971
|
+
...since === void 0 ? {} : { since: new Date(since).toISOString() },
|
|
17972
|
+
...until === void 0 ? {} : { until: new Date(until).toISOString() }
|
|
17973
|
+
};
|
|
17974
|
+
return {
|
|
17975
|
+
...since === void 0 ? {} : { since },
|
|
17976
|
+
...until === void 0 ? {} : { until },
|
|
17977
|
+
meta: {
|
|
17978
|
+
...readInZone ? { timezone: timezoneOf(zone) } : {},
|
|
17979
|
+
...since === void 0 && until === void 0 ? {} : { window: window3 }
|
|
17980
|
+
}
|
|
17981
|
+
};
|
|
17982
|
+
}, "dateWindow");
|
|
17983
|
+
|
|
17984
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/meetings/cli/management.js
|
|
17959
17985
|
var REMOTE_READ = { remote: "read", local: "read" };
|
|
17960
17986
|
var REMOTE_WRITE = { remote: "write", local: "write" };
|
|
17961
17987
|
var minutes = /* @__PURE__ */ __name((text2) => {
|
|
@@ -18030,7 +18056,7 @@ var addMeetingManagementCommands = /* @__PURE__ */ __name((group, deps) => {
|
|
|
18030
18056
|
}).description("the invitation text the service writes for a meeting"))).action(async (id2, _flags, command) => inRun(command, async () => print({ item: { ...await management.invitation(id2), untrusted: ["invitation"] } }, command)));
|
|
18031
18057
|
}, "addMeetingManagementCommands");
|
|
18032
18058
|
|
|
18033
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
18059
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/meetings/cli/query-options.js
|
|
18034
18060
|
var queryWordsAfterOptions = /* @__PURE__ */ __name((command) => {
|
|
18035
18061
|
command.allowUnknownOption();
|
|
18036
18062
|
const parse2 = command.parseOptions.bind(command);
|
|
@@ -18050,7 +18076,7 @@ var queryWordsAfterOptions = /* @__PURE__ */ __name((command) => {
|
|
|
18050
18076
|
return command;
|
|
18051
18077
|
}, "queryWordsAfterOptions");
|
|
18052
18078
|
|
|
18053
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
18079
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/meetings/cli/passage.js
|
|
18054
18080
|
var count = /* @__PURE__ */ __name((value) => {
|
|
18055
18081
|
if (!/^(0|[1-9]\d*)$/.test(value) || !Number.isSafeInteger(Number(value)))
|
|
18056
18082
|
throw new CliError("validation_error", "expected a nonnegative safe integer");
|
|
@@ -18092,7 +18118,7 @@ var addMeetingPassageCommandDefinition = /* @__PURE__ */ __name((program, deps)
|
|
|
18092
18118
|
var createMeetingPassageCommand = sharedCommand(createMeetingPassageCommandDefinition);
|
|
18093
18119
|
var addMeetingPassageCommand = sharedCommand(addMeetingPassageCommandDefinition);
|
|
18094
18120
|
|
|
18095
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
18121
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/meetings/cli/project-evidence.js
|
|
18096
18122
|
var integer2 = /* @__PURE__ */ __name((value) => {
|
|
18097
18123
|
if (!/^[1-9]\d*$/.test(value) || !Number.isSafeInteger(Number(value)))
|
|
18098
18124
|
throw new CliError("validation_error", "expected a positive safe integer");
|
|
@@ -18115,24 +18141,12 @@ ${fieldsHelp(MEETING_PROJECT_EVIDENCE_QUERY)}`).option("--limit <n>", "hits in o
|
|
|
18115
18141
|
}, "addMeetingProjectEvidenceCommandDefinition");
|
|
18116
18142
|
var addMeetingProjectEvidenceCommand = sharedCommand(addMeetingProjectEvidenceCommandDefinition);
|
|
18117
18143
|
|
|
18118
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
18119
|
-
var ZONED = /(?:Z|[+-]\d{2}:?\d{2})$/i;
|
|
18120
|
-
var AGO = /^(\d+)(m|h|d)$/;
|
|
18121
|
-
var AGO_MS = { m: 6e4, h: 36e5, d: 864e5 };
|
|
18144
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/meetings/cli/search.js
|
|
18122
18145
|
var moment = /* @__PURE__ */ __name((flag, end, readIn) => (value) => {
|
|
18123
|
-
const
|
|
18124
|
-
if (
|
|
18125
|
-
|
|
18126
|
-
|
|
18127
|
-
let time;
|
|
18128
|
-
try {
|
|
18129
|
-
time = zonedMoment(value, zone, { start: 0, end: value.length }, { end });
|
|
18130
|
-
} catch {
|
|
18131
|
-
throw new CliError("validation_error", `${flag} takes an ISO date, a time with or without an offset, or 30m, 2h, 7d ago`);
|
|
18132
|
-
}
|
|
18133
|
-
if (!ZONED.test(value.trim()))
|
|
18134
|
-
readIn(zone);
|
|
18135
|
-
return time;
|
|
18146
|
+
const { since, until, meta } = dateWindow(end ? { untilTime: value, names: [flag, flag] } : { sinceTime: value, names: [flag, flag] });
|
|
18147
|
+
if (meta.timezone)
|
|
18148
|
+
readIn(meta.timezone);
|
|
18149
|
+
return end ? until : since;
|
|
18136
18150
|
}, "moment");
|
|
18137
18151
|
var integer3 = /* @__PURE__ */ __name((value) => {
|
|
18138
18152
|
if (!/^[1-9]\d*$/.test(value) || !Number.isSafeInteger(Number(value)))
|
|
@@ -18146,7 +18160,7 @@ var createMeetingSearchCommandDefinition = /* @__PURE__ */ __name((program) => {
|
|
|
18146
18160
|
program.addCommand(search);
|
|
18147
18161
|
}
|
|
18148
18162
|
const readIn = /* @__PURE__ */ __name((zone) => command.setOptionValue("timesReadIn", zone), "readIn");
|
|
18149
|
-
const command = search.command("meetings").description("find words in stored meetings, indexing new ones first").argument("<query>", 'words, OR, (groups), -word, "a phrase", "a b"~N (within N lines), exact:word, from:"Name" (who said the line); date>=30d, project:, tag:, topic: choose meetings; a word also matches its other forms and spellings speech recognition garbled').option("--meeting-id <id>", "only this stored meeting", integer3).option("--identity-id <id>", "meetings with this participant identity; does not say who spoke a hit", integer3).option("--person-id <id>", "meetings with a participant linked to this person", integer3).option("--event-id <id>", "only meetings linked to this stored event", integer3).option("--series-id <id>", "only meetings in this stored series", integer3).option("--project <project>", "meetings confirmed in this project, by name, key or alias").option("--tag <name>", "meetings with this tag, by name or alias").option("--topic-name <name>", "meetings with this topic, by name or alias").option("--since-time <time>", "meetings starting at or after this ISO 8601 date or time, or 30m, 2h, 7d ago", moment("--since-time", false, readIn)).option("--until-time <time>", "meetings starting at or before this ISO 8601 date or time; a date alone covers that whole local day", moment("--until-time", true, readIn)).option("--limit <n>", "how many hits, 1 through 1000
|
|
18163
|
+
const command = search.command("meetings").description("find words in stored meetings, indexing new ones first").argument("<query>", 'words, OR, (groups), -word, "a phrase", "a b"~N (within N lines), exact:word, from:"Name" (who said the line); date>=30d, project:, tag:, topic: choose meetings; a word also matches its other forms and spellings speech recognition garbled').option("--meeting-id <id>", "only this stored meeting", integer3).option("--identity-id <id>", "meetings with this participant identity; does not say who spoke a hit", integer3).option("--person-id <id>", "meetings with a participant linked to this person", integer3).option("--event-id <id>", "only meetings linked to this stored event", integer3).option("--series-id <id>", "only meetings in this stored series", integer3).option("--project <project>", "meetings confirmed in this project, by name, key or alias").option("--tag <name>", "meetings with this tag, by name or alias").option("--topic-name <name>", "meetings with this topic, by name or alias").option("--since-time <time>", "meetings starting at or after this ISO 8601 date or time, or 30m, 2h, 7d ago", moment("--since-time", false, readIn)).option("--until-time <time>", "meetings starting at or before this ISO 8601 date or time; a date alone covers that whole local day", moment("--until-time", true, readIn)).option("--limit <n>", "how many hits, 1 through 1000; the profile's defaults.limit when absent", integer3).option("--cursor <cursor>", "continue from the previous page's page.next_cursor, with the same query and filters").option("--max-read-bytes <bytes>", "most stored bytes to read, 1 through 67108864 (default 4194304)", integer3);
|
|
18150
18164
|
annotate(command, {
|
|
18151
18165
|
origin: "handwritten",
|
|
18152
18166
|
effects: { remote: "none", local: "read" },
|
|
@@ -18154,7 +18168,7 @@ var createMeetingSearchCommandDefinition = /* @__PURE__ */ __name((program) => {
|
|
|
18154
18168
|
});
|
|
18155
18169
|
return command;
|
|
18156
18170
|
}, "createMeetingSearchCommandDefinition");
|
|
18157
|
-
var meetingHitSearchRequest = /* @__PURE__ */ __name((query, options2, signal) => {
|
|
18171
|
+
var meetingHitSearchRequest = /* @__PURE__ */ __name((query, options2, limit, signal) => {
|
|
18158
18172
|
const request = {
|
|
18159
18173
|
meetingId: options2.meetingId,
|
|
18160
18174
|
participantIdentityId: options2.identityId,
|
|
@@ -18166,7 +18180,7 @@ var meetingHitSearchRequest = /* @__PURE__ */ __name((query, options2, signal) =
|
|
|
18166
18180
|
topic: options2.topicName ?? options2.topic,
|
|
18167
18181
|
since: options2.sinceTime,
|
|
18168
18182
|
until: options2.untilTime,
|
|
18169
|
-
limit: options2.limit,
|
|
18183
|
+
limit: options2.limit ?? limit,
|
|
18170
18184
|
after: options2.cursor,
|
|
18171
18185
|
maxReadBytes: options2.maxReadBytes,
|
|
18172
18186
|
signal
|
|
@@ -18199,14 +18213,14 @@ var meetingSearchMeta = /* @__PURE__ */ __name((options2) => {
|
|
|
18199
18213
|
...Object.keys(window3).length === 0 ? {} : { window: window3 }
|
|
18200
18214
|
};
|
|
18201
18215
|
}, "meetingSearchMeta");
|
|
18202
|
-
var addMeetingSearchCommandDefinition = /* @__PURE__ */ __name((program, deps) => createMeetingSearchCommand(program).action(async (query, options2) => {
|
|
18203
|
-
const request = meetingHitSearchRequest(query, options2, deps.signal());
|
|
18204
|
-
deps.output(meetingHitsList(await deps.search(query, request, options2), request.limit
|
|
18216
|
+
var addMeetingSearchCommandDefinition = /* @__PURE__ */ __name((program, deps) => createMeetingSearchCommand(program).action(async (query, options2, command) => {
|
|
18217
|
+
const request = meetingHitSearchRequest(query, options2, deps.pagingOf(command).limit, deps.signal());
|
|
18218
|
+
deps.output(meetingHitsList(await deps.search(query, request, options2), request.limit, "search meetings", meetingSearchArguments(query, options2), meetingSearchMeta(options2)));
|
|
18205
18219
|
}), "addMeetingSearchCommandDefinition");
|
|
18206
18220
|
var createMeetingSearchCommand = sharedCommand(createMeetingSearchCommandDefinition);
|
|
18207
18221
|
var addMeetingSearchCommand = sharedCommand(addMeetingSearchCommandDefinition);
|
|
18208
18222
|
|
|
18209
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
18223
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/meetings/cli/index.js
|
|
18210
18224
|
var integer4 = /* @__PURE__ */ __name((text2) => {
|
|
18211
18225
|
if (!/^[1-9]\d*$/.test(text2) || !Number.isSafeInteger(Number(text2)))
|
|
18212
18226
|
throw new InvalidArgumentError("expected a positive integer");
|
|
@@ -18217,13 +18231,6 @@ var lookbackDays = /* @__PURE__ */ __name((text2) => {
|
|
|
18217
18231
|
throw new InvalidArgumentError("expected an integer from 0 through 31 days");
|
|
18218
18232
|
return Number(text2);
|
|
18219
18233
|
}, "lookbackDays");
|
|
18220
|
-
var date = /* @__PURE__ */ __name((text2) => {
|
|
18221
|
-
try {
|
|
18222
|
-
return zonedMoment(text2, timezoneOf(), { start: 0, end: text2.length });
|
|
18223
|
-
} catch {
|
|
18224
|
-
throw new InvalidArgumentError("expected an ISO date, or a time with or without an offset");
|
|
18225
|
-
}
|
|
18226
|
-
}, "date");
|
|
18227
18234
|
var LOCAL_READ = { remote: "none", local: "read" };
|
|
18228
18235
|
var REMOTE_READ2 = { remote: "read", local: "read" };
|
|
18229
18236
|
var backendOf = /* @__PURE__ */ __name((value) => {
|
|
@@ -18239,11 +18246,7 @@ var addMeetingCommandsDefinition = /* @__PURE__ */ __name((program, deps) => {
|
|
|
18239
18246
|
const group = annotate(program.command("meetings").description("stored meetings and their records"), {
|
|
18240
18247
|
effects: { remote: "none", local: "none" }
|
|
18241
18248
|
});
|
|
18242
|
-
const output = /* @__PURE__ */ __name((command) => command
|
|
18243
|
-
const opts = cmd.optsWithGlobals();
|
|
18244
|
-
if (opts.json && opts.jsonl)
|
|
18245
|
-
throw new MeetingError("validation_error", "choose --json or --jsonl");
|
|
18246
|
-
}), "output");
|
|
18249
|
+
const output = /* @__PURE__ */ __name((command) => command, "output");
|
|
18247
18250
|
const print = /* @__PURE__ */ __name((value, command) => {
|
|
18248
18251
|
const opts = command.optsWithGlobals();
|
|
18249
18252
|
deps.write(value, opts.json ? "json" : opts.jsonl ? "jsonl" : "text");
|
|
@@ -18263,13 +18266,14 @@ ${BACKEND_HELP}`);
|
|
|
18263
18266
|
query: defineQuery(MEETING_QUERY),
|
|
18264
18267
|
output: { entity: "meeting" }
|
|
18265
18268
|
});
|
|
18266
|
-
backendOption(output(list2)).option("--limit <n>", "meetings per page", integer4
|
|
18269
|
+
backendOption(output(list2)).option("--limit <n>", "meetings per page; the profile's defaults.limit when absent", integer4).option("--page <n>", "which page, starting at 1", integer4).action(async (words3, opts, command) => {
|
|
18267
18270
|
const query = meetingsQuery(words3.join(" "));
|
|
18271
|
+
const { limit, page } = deps.pagingOf(command);
|
|
18268
18272
|
await deps.inRun(command, async () => {
|
|
18269
18273
|
const { server: _server, ...answer } = await meetingsListThrough(deps.source, deps.store, {
|
|
18270
18274
|
accountId: deps.accountId,
|
|
18271
|
-
limit
|
|
18272
|
-
offset: (
|
|
18275
|
+
limit,
|
|
18276
|
+
offset: (page - 1) * limit,
|
|
18273
18277
|
...query ? { query } : {}
|
|
18274
18278
|
}, access(command, opts.backend));
|
|
18275
18279
|
print(answer, command);
|
|
@@ -18330,7 +18334,7 @@ ${BACKEND_HELP}`))).action(async (meeting, opts, command) => {
|
|
|
18330
18334
|
output: { entity: "meeting_ingestion" },
|
|
18331
18335
|
// Only a sync that stops itself at its budget may outlive the one-shot deadline.
|
|
18332
18336
|
...deps.budgetOf ? { cooperative: true, partial: true } : {}
|
|
18333
|
-
}).description("bring the stored meetings up to date from the connected account, oldest first; a run that stops before its deadline keeps what it saved and the next one goes on from there")).option("--since-time <time>", "fetch meetings starting at or after this ISO 8601 date or time",
|
|
18337
|
+
}).description("bring the stored meetings up to date from the connected account, oldest first; a run that stops before its deadline keeps what it saved and the next one goes on from there")).option("--since-time <time>", "fetch meetings starting at or after this ISO 8601 date or time, or 30m, 2h, 7d ago", (text2) => dateWindow({ sinceTime: text2, ...deps.timezone ? { zone: deps.timezone } : {}, now: deps.now?.() }).since).option("--lookback-days <days>", "revisit recent occurrences for late transcripts (0\u201331)", lookbackDays).option("--rescan", "read the last 30 days again, not only what came after the last sync").action(async (opts, command) => {
|
|
18334
18338
|
const source = deps.source;
|
|
18335
18339
|
if (!source)
|
|
18336
18340
|
throw new MeetingError("configuration_error", "meeting source is unavailable");
|
|
@@ -18395,7 +18399,7 @@ ${fieldsHelp(EVENT_QUERY, MEETING_QUERY_GUIDE)}`);
|
|
|
18395
18399
|
}, "addMeetingCommandsDefinition");
|
|
18396
18400
|
var addMeetingCommands = sharedCommand(addMeetingCommandsDefinition);
|
|
18397
18401
|
|
|
18398
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
18402
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/cli/list-query.js
|
|
18399
18403
|
var LIST_QUERY_GUIDE = "https://github.com/WireCatLabs/cli-core/blob/main/docs/search/query-language.md";
|
|
18400
18404
|
var QUERY_ARGUMENT = "field:value terms that narrow the list \u2014 the fields are below";
|
|
18401
18405
|
var withQuery = /* @__PURE__ */ __name((command, registry) => {
|
|
@@ -18415,9 +18419,9 @@ var unfilteredQuery = /* @__PURE__ */ __name((entity, schema2) => ({
|
|
|
18415
18419
|
}), "unfilteredQuery");
|
|
18416
18420
|
var withTomorrow = /* @__PURE__ */ __name((query, registry, zone = timezoneOf(), now = Date.now()) => {
|
|
18417
18421
|
const times = new Set(registry.fields.filter(({ type }) => type === "time").map(({ name }) => name));
|
|
18418
|
-
const
|
|
18419
|
-
|
|
18420
|
-
const tomorrow =
|
|
18422
|
+
const date = /* @__PURE__ */ new Date(`${new Intl.DateTimeFormat("en-CA", { timeZone: zone }).format(now)}T00:00:00Z`);
|
|
18423
|
+
date.setUTCDate(date.getUTCDate() + 1);
|
|
18424
|
+
const tomorrow = date.toISOString().slice(0, 10);
|
|
18421
18425
|
const day2 = /* @__PURE__ */ __name((value) => value.toLowerCase() === "tomorrow" ? tomorrow : value, "day");
|
|
18422
18426
|
const map = /* @__PURE__ */ __name((node) => node.kind === "predicate" ? times.has(node.field) ? { ...node, value: day2(node.value), ...node.upper === void 0 ? {} : { upper: day2(node.upper) } } : node : { ...node, clauses: node.clauses.map((clause) => ({ ...clause, node: map(clause.node) })) }, "map");
|
|
18423
18427
|
return { ...query, root: map(query.root) };
|
|
@@ -18529,16 +18533,34 @@ var termField = /* @__PURE__ */ __name((name, type, example, more = {}) => nativ
|
|
|
18529
18533
|
var queryHelp = /* @__PURE__ */ __name((registry) => `
|
|
18530
18534
|
${fieldsHelp(registry, LIST_QUERY_GUIDE)}`, "queryHelp");
|
|
18531
18535
|
|
|
18532
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
18536
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/cli/paging.js
|
|
18533
18537
|
var positiveCount = /* @__PURE__ */ __name((flag) => (value) => {
|
|
18534
18538
|
if (!/^\d+$/.test(value.trim()) || Number(value) < 1)
|
|
18535
18539
|
throw new CliError("validation_error", `${flag} takes a whole number from 1 upwards, not "${value}"`);
|
|
18536
18540
|
return Number(value);
|
|
18537
18541
|
}, "positiveCount");
|
|
18542
|
+
var configuredLimit = /* @__PURE__ */ __name((command, most = Number.POSITIVE_INFINITY) => {
|
|
18543
|
+
const { resolveSettings, env } = environmentOf(command);
|
|
18544
|
+
const { limit: _typed, ...flags } = command.optsWithGlobals();
|
|
18545
|
+
const configured = resolveSettings?.(flags, { needsProfile: false, ...env ? { env } : {} }).limit ?? DEFAULT_CONFIG.defaults.limit;
|
|
18546
|
+
return Math.min(configured, most);
|
|
18547
|
+
}, "configuredLimit");
|
|
18538
18548
|
var withPaging = /* @__PURE__ */ __name((command) => command.option("--limit <n>", "how many to show", positiveCount("--limit")).option("--page <n>", "which page, starting at 1", positiveCount("--page")).option("--all", "every row, no paging"), "withPaging");
|
|
18539
18549
|
var window = /* @__PURE__ */ __name(({ limit, page, all }) => all ? { offset: 0 } : { limit, offset: (page - 1) * limit }, "window");
|
|
18550
|
+
var pagingOf = /* @__PURE__ */ __name((command) => {
|
|
18551
|
+
const environment = environmentOf(command);
|
|
18552
|
+
const flags = command.optsWithGlobals();
|
|
18553
|
+
if (!environment.resolveSettings)
|
|
18554
|
+
return { limit: flags.limit ?? DEFAULT_CONFIG.defaults.limit, page: flags.page ?? 1 };
|
|
18555
|
+
const { limit, page } = environment.resolveSettings(withAgentLevels(command, command.optsWithGlobals()), {
|
|
18556
|
+
env: environment.env ?? process.env,
|
|
18557
|
+
needsProfile: false,
|
|
18558
|
+
readOnly: true
|
|
18559
|
+
});
|
|
18560
|
+
return { limit: limit ?? DEFAULT_CONFIG.defaults.limit, page: page ?? 1 };
|
|
18561
|
+
}, "pagingOf");
|
|
18540
18562
|
|
|
18541
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
18563
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/cli/messenger/chat-answers.js
|
|
18542
18564
|
var defined = /* @__PURE__ */ __name((record2) => Object.fromEntries(Object.entries(record2).filter(([, value]) => value !== void 0)), "defined");
|
|
18543
18565
|
var chatRef = /* @__PURE__ */ __name((account, chat) => formatReference({ type: "chat", provider: account.provider, account: account.account, chat }), "chatRef");
|
|
18544
18566
|
var settingsOf = /* @__PURE__ */ __name((settings) => defined({
|
|
@@ -18800,7 +18822,7 @@ var sessionAnswer = /* @__PURE__ */ __name(({ current, client, device, location,
|
|
|
18800
18822
|
...createdAt === void 0 ? {} : { created_at: createdAt }
|
|
18801
18823
|
}), "sessionAnswer");
|
|
18802
18824
|
|
|
18803
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
18825
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/services/deps.js
|
|
18804
18826
|
var accountStore = /* @__PURE__ */ __name(async (deps) => (await deps.store()).forAccount(await deps.account()), "accountStore");
|
|
18805
18827
|
var crossAccount = /* @__PURE__ */ __name((deps, _reason) => deps.store(), "crossAccount");
|
|
18806
18828
|
var NO_LOCAL_STORE = "this answer comes from the messenger, not from the local store";
|
|
@@ -18862,7 +18884,7 @@ var storedDeps = /* @__PURE__ */ __name((messenger, store, account, guard) => ({
|
|
|
18862
18884
|
}), "storedDeps");
|
|
18863
18885
|
var storeModeDeps = /* @__PURE__ */ __name((messenger, store, account, guard) => ({ ...storedDeps(messenger, store, account, guard), offline: false, reads: "store" }), "storeModeDeps");
|
|
18864
18886
|
|
|
18865
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
18887
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/ports/messenger.js
|
|
18866
18888
|
var throughWrapper = /* @__PURE__ */ __name((inner, handled, wrap = (_, call) => call) => new Proxy(handled, {
|
|
18867
18889
|
get: /* @__PURE__ */ __name((own, key) => {
|
|
18868
18890
|
if (key in own)
|
|
@@ -18879,14 +18901,14 @@ var capability = /* @__PURE__ */ __name((adapter, method, what) => {
|
|
|
18879
18901
|
return found.bind(adapter);
|
|
18880
18902
|
}, "capability");
|
|
18881
18903
|
|
|
18882
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
18904
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/sends/send-id.js
|
|
18883
18905
|
import { randomBytes } from "node:crypto";
|
|
18884
18906
|
var newSendId = /* @__PURE__ */ __name(() => randomBytes(8).readBigInt64BE().toString(), "newSendId");
|
|
18885
18907
|
var newOperationId = newSendId;
|
|
18886
18908
|
|
|
18887
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
18909
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/services/questions.js
|
|
18888
18910
|
var LINKS = /https?:\/\/\S+/g;
|
|
18889
|
-
var unanswered = /* @__PURE__ */ __name((messages, { answerers: answerers2, before
|
|
18911
|
+
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");
|
|
18890
18912
|
var questions = /* @__PURE__ */ __name((messages, { answerers: answerers2, asker = "others" }) => {
|
|
18891
18913
|
const fromOwner2 = /* @__PURE__ */ __name((message) => message.outgoing === true, "fromOwner");
|
|
18892
18914
|
const answers = asker === "owner" ? (message) => !fromOwner2(message) : (message) => fromOwner2(message) || message.senderId !== null && answerers2.has(message.senderId);
|
|
@@ -18914,7 +18936,7 @@ var questions = /* @__PURE__ */ __name((messages, { answerers: answerers2, asker
|
|
|
18914
18936
|
});
|
|
18915
18937
|
}, "questions");
|
|
18916
18938
|
|
|
18917
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
18939
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/services/task-categories.js
|
|
18918
18940
|
var names = /* @__PURE__ */ __name((categories) => categories.map(({ name }) => name).join(", "), "names");
|
|
18919
18941
|
var taskCategoryOf = /* @__PURE__ */ __name((categories = DEFAULT_TASK_CATEGORIES, flag = "--category") => (typed) => {
|
|
18920
18942
|
const name = typed.trim().toLowerCase();
|
|
@@ -18971,7 +18993,7 @@ var categorize = /* @__PURE__ */ __name((text2, categories = DEFAULT_TASK_CATEGO
|
|
|
18971
18993
|
return best.name;
|
|
18972
18994
|
}, "categorize");
|
|
18973
18995
|
|
|
18974
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
18996
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/services/task-rules.js
|
|
18975
18997
|
var taskAccount = /* @__PURE__ */ __name(({ provider, account }) => `${provider}:${account}`, "taskAccount");
|
|
18976
18998
|
var RULES_IN = {
|
|
18977
18999
|
dialog: "all",
|
|
@@ -19177,47 +19199,7 @@ var applyTaskRulesToChats = /* @__PURE__ */ __name(async (store, account, chatId
|
|
|
19177
19199
|
return passes;
|
|
19178
19200
|
}, "applyTaskRulesToChats");
|
|
19179
19201
|
|
|
19180
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
19181
|
-
var AGO2 = /^(\d+)(m|h|d)$/;
|
|
19182
|
-
var AGO_MS2 = { m: 6e4, h: 36e5, d: 864e5 };
|
|
19183
|
-
var DATE = /^\d{4}-\d{2}-\d{2}/;
|
|
19184
|
-
var momentOf = /* @__PURE__ */ __name((reference, flag = "--since", now = Date.now(), at = {}) => {
|
|
19185
|
-
const wanted = reference.trim();
|
|
19186
|
-
const [, amount, unit] = AGO2.exec(wanted) ?? [];
|
|
19187
|
-
const time = amount && unit ? now - Number(amount) * (AGO_MS2[unit] ?? 0) : DATE.test(wanted) ? calendarMoment(wanted, flag, at) : Number.NaN;
|
|
19188
|
-
if (Number.isNaN(time)) {
|
|
19189
|
-
throw new CliError("validation_error", `${flag} takes an ISO 8601 time or 30m, 2h, 1d ago \u2014 not "${wanted}"`);
|
|
19190
|
-
}
|
|
19191
|
-
return time;
|
|
19192
|
-
}, "momentOf");
|
|
19193
|
-
var aheadOf = /* @__PURE__ */ __name((reference, flag, now = Date.now(), at = {}) => {
|
|
19194
|
-
const wanted = reference.trim();
|
|
19195
|
-
const [, amount, unit] = AGO2.exec(wanted) ?? [];
|
|
19196
|
-
const time = amount && unit ? now + Number(amount) * (AGO_MS2[unit] ?? 0) : DATE.test(wanted) ? calendarMoment(wanted, flag, at) : Number.NaN;
|
|
19197
|
-
if (Number.isNaN(time)) {
|
|
19198
|
-
throw new CliError("validation_error", `${flag} takes an ISO 8601 time or 30m, 2h, 3d from now \u2014 not "${wanted}"`);
|
|
19199
|
-
}
|
|
19200
|
-
return time;
|
|
19201
|
-
}, "aheadOf");
|
|
19202
|
-
var dateWindow = /* @__PURE__ */ __name(({ sinceTime, untilTime, zone, now = Date.now(), names: names2 = ["--since-time", "--until-time"] }) => {
|
|
19203
|
-
const since = sinceTime === void 0 ? void 0 : momentOf(sinceTime, names2[0], now, { zone });
|
|
19204
|
-
const until = untilTime === void 0 ? void 0 : momentOf(untilTime, names2[1], now, { zone, end: true });
|
|
19205
|
-
const readInZone = [sinceTime, untilTime].some((value) => value !== void 0 && DATE.test(value.trim()) && !/(?:Z|[+-]\d{2}:?\d{2})$/i.test(value.trim()));
|
|
19206
|
-
const window3 = {
|
|
19207
|
-
...since === void 0 ? {} : { since: new Date(since).toISOString() },
|
|
19208
|
-
...until === void 0 ? {} : { until: new Date(until).toISOString() }
|
|
19209
|
-
};
|
|
19210
|
-
return {
|
|
19211
|
-
...since === void 0 ? {} : { since },
|
|
19212
|
-
...until === void 0 ? {} : { until },
|
|
19213
|
-
meta: {
|
|
19214
|
-
...readInZone ? { timezone: timezoneOf(zone) } : {},
|
|
19215
|
-
...since === void 0 && until === void 0 ? {} : { window: window3 }
|
|
19216
|
-
}
|
|
19217
|
-
};
|
|
19218
|
-
}, "dateWindow");
|
|
19219
|
-
|
|
19220
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.661.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_df14b19e105bc4fb805918d3d486e7fb/node_modules/@wirecat/cli-core/dist/services/patience.js
|
|
19202
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/services/patience.js
|
|
19221
19203
|
import { setTimeout as sleep } from "node:timers/promises";
|
|
19222
19204
|
var LONGEST_WAIT_MS = 5 * 60 * 1e3;
|
|
19223
19205
|
var patiently = /* @__PURE__ */ __name(async (request, note, stop) => {
|
|
@@ -19240,10 +19222,10 @@ var patiently = /* @__PURE__ */ __name(async (request, note, stop) => {
|
|
|
19240
19222
|
}
|
|
19241
19223
|
}, "patiently");
|
|
19242
19224
|
|
|
19243
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
19225
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/services/archive.js
|
|
19244
19226
|
import { setTimeout as sleep2 } from "node:timers/promises";
|
|
19245
19227
|
|
|
19246
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
19228
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/services/backfill-estimate.js
|
|
19247
19229
|
var REQUEST_MS = 400;
|
|
19248
19230
|
var estimateBackfill = /* @__PURE__ */ __name(({ ranges, held, newest, page, maxPages, pauseMs }) => {
|
|
19249
19231
|
const lowest = ranges[0];
|
|
@@ -19266,13 +19248,13 @@ var estimateBackfill = /* @__PURE__ */ __name(({ ranges, held, newest, page, max
|
|
|
19266
19248
|
};
|
|
19267
19249
|
}, "estimateBackfill");
|
|
19268
19250
|
|
|
19269
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
19251
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/domain/recovery.js
|
|
19270
19252
|
var withRecovery = /* @__PURE__ */ __name((error) => ({
|
|
19271
19253
|
...error,
|
|
19272
19254
|
retryable: typeof error.retryable === "boolean" ? error.retryable : error.code === "rate_limited" || error.status === 429
|
|
19273
19255
|
}), "withRecovery");
|
|
19274
19256
|
|
|
19275
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
19257
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/services/batch.js
|
|
19276
19258
|
var actionable = /* @__PURE__ */ __name((error) => {
|
|
19277
19259
|
if (isCliFailure(error))
|
|
19278
19260
|
return withRecovery({ code: error.code, message: error.message, ...error.details });
|
|
@@ -19355,7 +19337,7 @@ var mergeBatches = /* @__PURE__ */ __name((a, b) => {
|
|
|
19355
19337
|
};
|
|
19356
19338
|
}, "mergeBatches");
|
|
19357
19339
|
|
|
19358
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
19340
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/search/groups.js
|
|
19359
19341
|
var ALL = "all";
|
|
19360
19342
|
var OWNER_NOTES = { provider: "notes", account: INTERNAL_NOTES };
|
|
19361
19343
|
var NOT_GROUP_NAMES = /* @__PURE__ */ new Set([ALL, "bots"]);
|
|
@@ -19427,7 +19409,7 @@ var groupEntries = /* @__PURE__ */ __name((saved) => ({
|
|
|
19427
19409
|
[ALL]: [ALL]
|
|
19428
19410
|
}), "groupEntries");
|
|
19429
19411
|
|
|
19430
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
19412
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/services/search-kind.js
|
|
19431
19413
|
var NO_MAIL = "no_mail";
|
|
19432
19414
|
var MAIL = "email";
|
|
19433
19415
|
var groupLockOf = /* @__PURE__ */ __name((app, env) => {
|
|
@@ -19501,7 +19483,7 @@ var accountsOfKind = /* @__PURE__ */ __name((kind, chosen, held, explicit, comma
|
|
|
19501
19483
|
return chosenMail.map(({ provider, account }) => ({ provider, account }));
|
|
19502
19484
|
}, "accountsOfKind");
|
|
19503
19485
|
|
|
19504
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
19486
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/services/message-resolution.js
|
|
19505
19487
|
var readChatId = /* @__PURE__ */ __name(async (deps, reference, store, account) => {
|
|
19506
19488
|
if (deps.reads !== "store")
|
|
19507
19489
|
return keptChatId(deps.messenger, reference, store, account);
|
|
@@ -19702,14 +19684,14 @@ var chatsMatchingIn = /* @__PURE__ */ __name(async (store, accounts, pattern) =>
|
|
|
19702
19684
|
}, "chatsMatchingIn");
|
|
19703
19685
|
var isText = /* @__PURE__ */ __name((value) => typeof value === "string" && value !== "", "isText");
|
|
19704
19686
|
|
|
19705
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
19687
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/images/context/index.js
|
|
19706
19688
|
var CONTEXT_MESSAGES = 3;
|
|
19707
19689
|
var CONTEXT_MINUTES = 10;
|
|
19708
19690
|
var MAX_CHARS = 1200;
|
|
19709
19691
|
var line = /* @__PURE__ */ __name(({ sender, text: text2 }) => sender ? `${sender}: ${text2.trim()}` : text2.trim(), "line");
|
|
19710
19692
|
var near = /* @__PURE__ */ __name((messages, sentAt) => messages.filter(({ text: text2, sentAt: at }) => text2.trim() && Math.abs(at - sentAt) <= CONTEXT_MINUTES * 6e4).slice(0, CONTEXT_MESSAGES), "near");
|
|
19711
|
-
var contextText = /* @__PURE__ */ __name(({ chatTitle: chatTitle2, sender, caption, sentAt, before
|
|
19712
|
-
const earlier = near(
|
|
19693
|
+
var contextText = /* @__PURE__ */ __name(({ chatTitle: chatTitle2, sender, caption, sentAt, before, after }) => {
|
|
19694
|
+
const earlier = near(before, sentAt).reverse();
|
|
19713
19695
|
const later = near(after, sentAt);
|
|
19714
19696
|
if (!caption.trim() && earlier.length === 0 && later.length === 0)
|
|
19715
19697
|
return void 0;
|
|
@@ -19726,12 +19708,12 @@ var context = {
|
|
|
19726
19708
|
}, "describe")
|
|
19727
19709
|
};
|
|
19728
19710
|
|
|
19729
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
19711
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/images/registry.js
|
|
19730
19712
|
var BUILT_INS = [context];
|
|
19731
19713
|
var providers = [...BUILT_INS];
|
|
19732
19714
|
var registeredImageProviders = /* @__PURE__ */ __name(() => providers, "registeredImageProviders");
|
|
19733
19715
|
|
|
19734
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
19716
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/services/conversations.js
|
|
19735
19717
|
var READ_PAGE = 5e3;
|
|
19736
19718
|
var CHAIN = 50;
|
|
19737
19719
|
var CONVERSATION_QUERY = {
|
|
@@ -19812,7 +19794,7 @@ var conversationsService = /* @__PURE__ */ __name((deps) => {
|
|
|
19812
19794
|
const { store, chatId } = await found(chat);
|
|
19813
19795
|
if (!(await store.conversations.conversationState(chatId))?.builtAt)
|
|
19814
19796
|
throw notBuilt(chatId);
|
|
19815
|
-
const where = query ? queryFilter(query, CONVERSATION_COLUMNS, { command: "conversations list" }) : void 0;
|
|
19797
|
+
const where = query ? queryFilter(query, CONVERSATION_COLUMNS, { command: "conversations list", zone: timezoneOf() }) : void 0;
|
|
19816
19798
|
const page = await store.conversations.conversations(chatId, { limit, offset, ...where ? { where } : {} });
|
|
19817
19799
|
const account = await deps.account();
|
|
19818
19800
|
return { items: page.items.map((one) => conversationItem(account, one)), hasMore: page.hasMore };
|
|
@@ -19883,7 +19865,7 @@ var sized = /* @__PURE__ */ __name((size2) => {
|
|
|
19883
19865
|
return size2;
|
|
19884
19866
|
}, "sized");
|
|
19885
19867
|
|
|
19886
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
19868
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/services/embeddings-maintenance.js
|
|
19887
19869
|
var REFRESH_BOUNDS = { maxChats: 20, maxChunks: 2e3 };
|
|
19888
19870
|
var MESSAGE_PAGE = 5e3;
|
|
19889
19871
|
var PER_SESSION = 8;
|
|
@@ -19902,7 +19884,7 @@ var embeddingTarget = /* @__PURE__ */ __name((deps, choice = chosenTextModel(dep
|
|
|
19902
19884
|
price: remote.price,
|
|
19903
19885
|
installed: true,
|
|
19904
19886
|
perBatch: PER_REQUEST * concurrency,
|
|
19905
|
-
open: /* @__PURE__ */ __name(async () => (await import("./remote-
|
|
19887
|
+
open: /* @__PURE__ */ __name(async () => (await import("./remote-UYTNWNOB.js")).openRemote(remote, apiKey, {
|
|
19906
19888
|
concurrency,
|
|
19907
19889
|
env: deps.env ?? process.env
|
|
19908
19890
|
}), "open")
|
|
@@ -19922,7 +19904,7 @@ var embeddingTarget = /* @__PURE__ */ __name((deps, choice = chosenTextModel(dep
|
|
|
19922
19904
|
if (!isTextModelInstalled(model, directory2))
|
|
19923
19905
|
throw notDownloaded(model.id);
|
|
19924
19906
|
if (apart) {
|
|
19925
|
-
const { openProcess } = await import("./process-
|
|
19907
|
+
const { openProcess } = await import("./process-67DAKAAQ.js");
|
|
19926
19908
|
return openProcess(model, directory2, { threads: threads ?? defaultThreads() });
|
|
19927
19909
|
}
|
|
19928
19910
|
return openEmbedder(model, directory2, { threads: threads ?? defaultThreads() });
|
|
@@ -20211,7 +20193,7 @@ var shaped = /* @__PURE__ */ __name(({ chatId, builtAt, algorithmVersion, pendin
|
|
|
20211
20193
|
return { ...one, state };
|
|
20212
20194
|
}, "shaped");
|
|
20213
20195
|
|
|
20214
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
20196
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/services/search-catchup.js
|
|
20215
20197
|
var CATCH_UP_BOUNDS = { maxChunks: 500, maxMessages: 1e4, timeMs: 3e4 };
|
|
20216
20198
|
var validateCatchUpBounds = /* @__PURE__ */ __name((options2) => {
|
|
20217
20199
|
for (const [key, value, maximum] of [
|
|
@@ -20264,7 +20246,7 @@ var catchUpSearch = /* @__PURE__ */ __name(async (deps, chat, options2, signal,
|
|
|
20264
20246
|
}
|
|
20265
20247
|
}, "catchUpSearch");
|
|
20266
20248
|
|
|
20267
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
20249
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/services/archive.js
|
|
20268
20250
|
var pushed = /* @__PURE__ */ __name((deps, what) => {
|
|
20269
20251
|
if (deps.reads === "store") {
|
|
20270
20252
|
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`);
|
|
@@ -20498,7 +20480,7 @@ var recordSkip = /* @__PURE__ */ __name(async (store, account, chatId, skip) =>
|
|
|
20498
20480
|
const at = (/* @__PURE__ */ new Date()).toISOString();
|
|
20499
20481
|
await store.chats.recordHistorySkips(account, /* @__PURE__ */ new Map([[chatId, { ...skip, messages: 0, oldestAt: at, newestAt: at, unread: true }]]));
|
|
20500
20482
|
}, "recordSkip");
|
|
20501
|
-
var abortable = /* @__PURE__ */ __name(async (
|
|
20483
|
+
var abortable = /* @__PURE__ */ __name(async (read2, signal) => {
|
|
20502
20484
|
signal.throwIfAborted();
|
|
20503
20485
|
let listener = /* @__PURE__ */ __name(() => {
|
|
20504
20486
|
}, "listener");
|
|
@@ -20507,7 +20489,7 @@ var abortable = /* @__PURE__ */ __name(async (read, signal) => {
|
|
|
20507
20489
|
signal.addEventListener("abort", listener, { once: true });
|
|
20508
20490
|
});
|
|
20509
20491
|
try {
|
|
20510
|
-
return await Promise.race([
|
|
20492
|
+
return await Promise.race([read2(), interrupted]);
|
|
20511
20493
|
} finally {
|
|
20512
20494
|
signal.removeEventListener("abort", listener);
|
|
20513
20495
|
}
|
|
@@ -20517,7 +20499,7 @@ var fetchInto = /* @__PURE__ */ __name(async ({ history, store, account, fetchin
|
|
|
20517
20499
|
throw new CliError("validation_error", "invalid history window");
|
|
20518
20500
|
const byTime = fetching.orderBy === "time";
|
|
20519
20501
|
const keyed = keyOf2(fetching);
|
|
20520
|
-
let
|
|
20502
|
+
let before = window3 === void 0 ? void 0 : byTime ? new Date(window3.to + (fetching.beforeInclusive ? 0 : 1)).toISOString() : String(window3.to + 1);
|
|
20521
20503
|
let requests = 0;
|
|
20522
20504
|
let windowComplete = false;
|
|
20523
20505
|
let chatId;
|
|
@@ -20535,8 +20517,8 @@ var fetchInto = /* @__PURE__ */ __name(async ({ history, store, account, fetchin
|
|
|
20535
20517
|
page = await patiently(() => {
|
|
20536
20518
|
requests += 1;
|
|
20537
20519
|
onRequest?.();
|
|
20538
|
-
const
|
|
20539
|
-
return window3 ? abortable(
|
|
20520
|
+
const read2 = /* @__PURE__ */ __name(() => history({ limit: Math.min(pageSize, limit - fetched), ...before ? { before } : {} }), "read");
|
|
20521
|
+
return window3 ? abortable(read2, stop) : read2();
|
|
20540
20522
|
}, note, stop);
|
|
20541
20523
|
} catch (error) {
|
|
20542
20524
|
if (stop.aborted)
|
|
@@ -20573,7 +20555,7 @@ var fetchInto = /* @__PURE__ */ __name(async ({ history, store, account, fetchin
|
|
|
20573
20555
|
onPage({ fetched, chatId, oldest: window3.from });
|
|
20574
20556
|
break;
|
|
20575
20557
|
}
|
|
20576
|
-
if (window3 === void 0 &&
|
|
20558
|
+
if (window3 === void 0 && before === void 0)
|
|
20577
20559
|
await store.sync.setSyncState(account, fetchedKey(chatId), String(top));
|
|
20578
20560
|
onPage({ fetched, chatId, oldest: held.from });
|
|
20579
20561
|
idle = fresh === 0 ? idle + 1 : 0;
|
|
@@ -20595,7 +20577,7 @@ var fetchInto = /* @__PURE__ */ __name(async ({ history, store, account, fetchin
|
|
|
20595
20577
|
break;
|
|
20596
20578
|
}
|
|
20597
20579
|
const boundary = window3 === void 0 ? held.from : low;
|
|
20598
|
-
|
|
20580
|
+
before = byTime ? new Date(boundary + (fresh > 0 && !(window3 && fetching.beforeInclusive) ? 1 : 0)).toISOString() : String(boundary);
|
|
20599
20581
|
note(`${fetched} messages so far, back to ${fromAt.slice(0, 10)}`);
|
|
20600
20582
|
const wait = fetching.jitter ? pauseMs * (1 + Math.random()) : pauseMs;
|
|
20601
20583
|
await sleep2(wait, void 0, { signal: stop }).catch(() => {
|
|
@@ -20610,7 +20592,7 @@ var fetchInto = /* @__PURE__ */ __name(async ({ history, store, account, fetchin
|
|
|
20610
20592
|
fetched,
|
|
20611
20593
|
complete: reachedStart && ranges.length === 1,
|
|
20612
20594
|
ranges,
|
|
20613
|
-
...issue ? { issue, resume: { ...
|
|
20595
|
+
...issue ? { issue, resume: { ...before === void 0 ? {} : { before } } } : {},
|
|
20614
20596
|
...window3 === void 0 ? {} : { windowComplete, requests },
|
|
20615
20597
|
...reachedSince ? { reachedSince: true } : {},
|
|
20616
20598
|
...reachedLast ? { reachedLast: true } : {},
|
|
@@ -20645,7 +20627,7 @@ var timeOfKey = /* @__PURE__ */ __name(async (store, account, chatId, key, byTim
|
|
|
20645
20627
|
return message?.timestamp ?? fallback;
|
|
20646
20628
|
}, "timeOfKey");
|
|
20647
20629
|
|
|
20648
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
20630
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/botcheck/check.js
|
|
20649
20631
|
var DAY_MS = 864e5;
|
|
20650
20632
|
var NEW_DAYS = 30;
|
|
20651
20633
|
var SAME_TEXT_MIN = 20;
|
|
@@ -20722,7 +20704,7 @@ var scorePerson = /* @__PURE__ */ __name(({ subject, provider, activity, photos,
|
|
|
20722
20704
|
};
|
|
20723
20705
|
}, "scorePerson");
|
|
20724
20706
|
|
|
20725
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
20707
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/http/time-limit.js
|
|
20726
20708
|
var timeLimit = /* @__PURE__ */ __name((ms) => {
|
|
20727
20709
|
const controller = new AbortController();
|
|
20728
20710
|
const timer = setTimeout(() => controller.abort(new DOMException("The operation timed out.", "TimeoutError")), ms);
|
|
@@ -20738,7 +20720,7 @@ var withTimeLimit = /* @__PURE__ */ __name(async (ms, run2) => {
|
|
|
20738
20720
|
}
|
|
20739
20721
|
}, "withTimeLimit");
|
|
20740
20722
|
|
|
20741
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
20723
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/botcheck/registries.js
|
|
20742
20724
|
var REGISTRIES = {
|
|
20743
20725
|
cas: { title: "Combot Anti-Spam (CAS)", docs: "https://cas.chat/api" },
|
|
20744
20726
|
lols: { title: "lols.bot", docs: "https://api.lols.bot/lols-bot.json" }
|
|
@@ -20825,7 +20807,7 @@ var notCovered = /* @__PURE__ */ __name((messenger, now = /* @__PURE__ */ new Da
|
|
|
20825
20807
|
detail: `lists Telegram accounts only, not ${messenger} ones`
|
|
20826
20808
|
})), "notCovered");
|
|
20827
20809
|
|
|
20828
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
20810
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/botcheck/service.js
|
|
20829
20811
|
var ACTIVITY_MESSAGES = 1e3;
|
|
20830
20812
|
var botCheckService = /* @__PURE__ */ __name((deps) => {
|
|
20831
20813
|
const subjectOf = /* @__PURE__ */ __name(async (reference) => {
|
|
@@ -20913,7 +20895,7 @@ var botCheckService = /* @__PURE__ */ __name((deps) => {
|
|
|
20913
20895
|
};
|
|
20914
20896
|
}, "botCheckService");
|
|
20915
20897
|
|
|
20916
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
20898
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/domain/thread.js
|
|
20917
20899
|
var threadIdOf = /* @__PURE__ */ __name((value) => {
|
|
20918
20900
|
if (value === void 0)
|
|
20919
20901
|
return void 0;
|
|
@@ -20923,7 +20905,7 @@ var threadIdOf = /* @__PURE__ */ __name((value) => {
|
|
|
20923
20905
|
return id2;
|
|
20924
20906
|
}, "threadIdOf");
|
|
20925
20907
|
|
|
20926
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
20908
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/services/chat-stats.js
|
|
20927
20909
|
var TOP_POSTS = 5;
|
|
20928
20910
|
var JOINS = /* @__PURE__ */ new Set(["join", "add"]);
|
|
20929
20911
|
var LEAVES = /* @__PURE__ */ new Set(["leave", "remove"]);
|
|
@@ -21005,9 +20987,9 @@ var seriesOf = /* @__PURE__ */ __name((messages, events, by, timezone) => {
|
|
|
21005
20987
|
const day2 = dayOf(Date.parse(timestamp));
|
|
21006
20988
|
if (by === "day")
|
|
21007
20989
|
return day2;
|
|
21008
|
-
const
|
|
21009
|
-
|
|
21010
|
-
return
|
|
20990
|
+
const date = /* @__PURE__ */ new Date(`${day2}T00:00:00Z`);
|
|
20991
|
+
date.setUTCDate(date.getUTCDate() - (date.getUTCDay() + 6) % 7);
|
|
20992
|
+
return date.toISOString().slice(0, 10);
|
|
21011
20993
|
}, "keyOf");
|
|
21012
20994
|
const rows = /* @__PURE__ */ new Map();
|
|
21013
20995
|
const row = /* @__PURE__ */ __name((key) => {
|
|
@@ -21040,7 +21022,7 @@ var median = /* @__PURE__ */ __name((values) => {
|
|
|
21040
21022
|
return Math.round(sorted.length % 2 === 0 ? ((sorted[middle - 1] ?? upper) + upper) / 2 : upper);
|
|
21041
21023
|
}, "median");
|
|
21042
21024
|
|
|
21043
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
21025
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/services/member-history.js
|
|
21044
21026
|
var memberEvents = /* @__PURE__ */ __name((stays, revisions, since = 0) => {
|
|
21045
21027
|
const events = [];
|
|
21046
21028
|
for (const stay of stays) {
|
|
@@ -21056,9 +21038,9 @@ var memberEvents = /* @__PURE__ */ __name((stays, revisions, since = 0) => {
|
|
|
21056
21038
|
}
|
|
21057
21039
|
const last = /* @__PURE__ */ new Map();
|
|
21058
21040
|
for (const revision of revisions) {
|
|
21059
|
-
const
|
|
21041
|
+
const before = last.get(revision.id);
|
|
21060
21042
|
last.set(revision.id, revision);
|
|
21061
|
-
if (!
|
|
21043
|
+
if (!before)
|
|
21062
21044
|
continue;
|
|
21063
21045
|
events.push({
|
|
21064
21046
|
at: revision.capturedAt,
|
|
@@ -21066,13 +21048,13 @@ var memberEvents = /* @__PURE__ */ __name((stays, revisions, since = 0) => {
|
|
|
21066
21048
|
id: revision.id,
|
|
21067
21049
|
name: revision.name,
|
|
21068
21050
|
username: revision.username,
|
|
21069
|
-
before: { name:
|
|
21051
|
+
before: { name: before.name, username: before.username, marks: before.marks }
|
|
21070
21052
|
});
|
|
21071
21053
|
}
|
|
21072
21054
|
return events.filter(({ at }) => Date.parse(at) >= since).sort((a, b) => Date.parse(a.at) - Date.parse(b.at) || a.id.localeCompare(b.id));
|
|
21073
21055
|
}, "memberEvents");
|
|
21074
21056
|
|
|
21075
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
21057
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/services/chats.js
|
|
21076
21058
|
var EVENTS_DAYS = 7;
|
|
21077
21059
|
var TRACKED_DAYS = 30;
|
|
21078
21060
|
var STATS_PAGE = 1e3;
|
|
@@ -21108,7 +21090,7 @@ var deepChecks = /* @__PURE__ */ __name(async (deps, items, deep, pauseMs, regis
|
|
|
21108
21090
|
var chatsService = /* @__PURE__ */ __name((deps) => ({
|
|
21109
21091
|
list: /* @__PURE__ */ __name(async (window3, query) => {
|
|
21110
21092
|
if (fromStore(deps)) {
|
|
21111
|
-
const where = query ? queryFilter(query, CHAT_COLUMNS, { command: "chats list" }) : void 0;
|
|
21093
|
+
const where = query ? queryFilter(query, CHAT_COLUMNS, { command: "chats list", zone: timezoneOf() }) : void 0;
|
|
21112
21094
|
return (await accountStore(deps)).chats.chats({ ...window3, ...where ? { where } : {} });
|
|
21113
21095
|
}
|
|
21114
21096
|
const [term] = query ? walkQuery(query.root) : [];
|
|
@@ -21207,10 +21189,10 @@ var chatsService = /* @__PURE__ */ __name((deps) => ({
|
|
|
21207
21189
|
throw new CliError("validation_error", "`chats members check` reads the member list from the messenger; not with --offline");
|
|
21208
21190
|
}
|
|
21209
21191
|
const connection = await deps.connection();
|
|
21210
|
-
const { chatId: id2, members:
|
|
21192
|
+
const { chatId: id2, members: read2, more, participants } = await readMembers(connection, chat, budget, pauseMs);
|
|
21211
21193
|
const held = await accountStoreIfOpen(deps);
|
|
21212
21194
|
const stored = held ? await storedFacts(held, id2) : void 0;
|
|
21213
|
-
const { items: judged, unknown: unknown3 } = auditMembers(
|
|
21195
|
+
const { items: judged, unknown: unknown3 } = auditMembers(read2, {
|
|
21214
21196
|
firstMessages: stored?.firstMessages,
|
|
21215
21197
|
self: connection.self(),
|
|
21216
21198
|
minScore
|
|
@@ -21218,7 +21200,7 @@ var chatsService = /* @__PURE__ */ __name((deps) => ({
|
|
|
21218
21200
|
const items = deep > 0 ? await deepChecks(deps, judged, deep, pauseMs, registry) : judged;
|
|
21219
21201
|
return {
|
|
21220
21202
|
chatId: id2,
|
|
21221
|
-
read:
|
|
21203
|
+
read: read2.length,
|
|
21222
21204
|
participantsCount: participants ?? stored?.participantsCount ?? null,
|
|
21223
21205
|
more,
|
|
21224
21206
|
unknown: unknown3,
|
|
@@ -21232,11 +21214,11 @@ var chatsService = /* @__PURE__ */ __name((deps) => ({
|
|
|
21232
21214
|
throw new CliError("validation_error", "`chats members fetch` reads the member list from the messenger; not with --offline");
|
|
21233
21215
|
}
|
|
21234
21216
|
const startedAt = (/* @__PURE__ */ new Date()).toISOString();
|
|
21235
|
-
const
|
|
21217
|
+
const read2 = await readMembers(await deps.connection(), chat, budget, pauseMs);
|
|
21236
21218
|
const observedAt = (/* @__PURE__ */ new Date()).toISOString();
|
|
21237
|
-
const { chatId, members, more } =
|
|
21219
|
+
const { chatId, members, more } = read2;
|
|
21238
21220
|
const store = await accountStore(deps);
|
|
21239
|
-
const participants =
|
|
21221
|
+
const participants = read2.participants ?? (await store.chats.chats({})).items.find(({ id: id2 }) => id2 === chatId)?.participantsCount ?? null;
|
|
21240
21222
|
const complete = !more && participants !== null && members.length >= participants;
|
|
21241
21223
|
const change = await store.roster.saveRoster(chatId, {
|
|
21242
21224
|
members,
|
|
@@ -21250,7 +21232,7 @@ var chatsService = /* @__PURE__ */ __name((deps) => ({
|
|
|
21250
21232
|
return { chatId, read: members.length, participants, complete, more, ...change, tracked };
|
|
21251
21233
|
}, "fetchMembers"),
|
|
21252
21234
|
tracked: /* @__PURE__ */ __name(async (query) => {
|
|
21253
|
-
const where = query ? queryFilter(query, TRACKED_CHAT_COLUMNS, { command: "chats tracking list" }) : void 0;
|
|
21235
|
+
const where = query ? queryFilter(query, TRACKED_CHAT_COLUMNS, { command: "chats tracking list", zone: timezoneOf() }) : void 0;
|
|
21254
21236
|
return (await accountStore(deps)).roster.trackedChats(where ? { where } : {});
|
|
21255
21237
|
}, "tracked"),
|
|
21256
21238
|
memberHistory: /* @__PURE__ */ __name(async (chat, { since }) => {
|
|
@@ -21316,16 +21298,16 @@ var storedFacts = /* @__PURE__ */ __name(async (store, chatId) => {
|
|
|
21316
21298
|
const chat = (await store.chats.chats({})).items.find((one) => one.id === chatId);
|
|
21317
21299
|
const [completeness] = await store.chats.chatCompleteness([chatId]);
|
|
21318
21300
|
const firstMessages = /* @__PURE__ */ new Map();
|
|
21319
|
-
let
|
|
21301
|
+
let before;
|
|
21320
21302
|
for (; ; ) {
|
|
21321
|
-
const page = await store.messages.messages(chatId, { limit: STATS_PAGE, ...
|
|
21303
|
+
const page = await store.messages.messages(chatId, { limit: STATS_PAGE, ...before ? { before } : {} });
|
|
21322
21304
|
for (const message of [...page.items].reverse())
|
|
21323
21305
|
if (message.senderId)
|
|
21324
21306
|
firstMessages.set(message.senderId, message);
|
|
21325
21307
|
const oldest = page.items[0];
|
|
21326
21308
|
if (!page.hasMore || !oldest)
|
|
21327
21309
|
break;
|
|
21328
|
-
|
|
21310
|
+
before = oldest.id;
|
|
21329
21311
|
}
|
|
21330
21312
|
return {
|
|
21331
21313
|
participantsCount: chat?.participantsCount ?? null,
|
|
@@ -21335,39 +21317,39 @@ var storedFacts = /* @__PURE__ */ __name(async (store, chatId) => {
|
|
|
21335
21317
|
}, "storedFacts");
|
|
21336
21318
|
var storedSince = /* @__PURE__ */ __name(async (store, chatId, since) => {
|
|
21337
21319
|
const pages = [];
|
|
21338
|
-
let
|
|
21320
|
+
let before;
|
|
21339
21321
|
for (; ; ) {
|
|
21340
|
-
const page = await store.messages.messages(chatId, { limit: STATS_PAGE, since, ...
|
|
21322
|
+
const page = await store.messages.messages(chatId, { limit: STATS_PAGE, since, ...before ? { before } : {} });
|
|
21341
21323
|
pages.unshift(page.items);
|
|
21342
21324
|
const oldest = page.items[0];
|
|
21343
21325
|
if (!page.hasMore || !oldest)
|
|
21344
21326
|
return pages.flat();
|
|
21345
|
-
|
|
21327
|
+
before = oldest.id;
|
|
21346
21328
|
}
|
|
21347
21329
|
}, "storedSince");
|
|
21348
21330
|
var readMembers = /* @__PURE__ */ __name(async (connection, chat, budget, pauseMs) => {
|
|
21349
21331
|
const members = capability(connection, "members", "list a group's members");
|
|
21350
|
-
const
|
|
21332
|
+
const read2 = [];
|
|
21351
21333
|
let chatId;
|
|
21352
21334
|
let participants = null;
|
|
21353
21335
|
let more = true;
|
|
21354
21336
|
for (let page = 0; page < budget && more; page++) {
|
|
21355
21337
|
if (page > 0)
|
|
21356
21338
|
await new Promise((resolve7) => setTimeout(resolve7, pauseMs));
|
|
21357
|
-
const found = await members(chatId ?? chat, { limit: AUDIT_PAGE, offset:
|
|
21339
|
+
const found = await members(chatId ?? chat, { limit: AUDIT_PAGE, offset: read2.length });
|
|
21358
21340
|
chatId = found.chatId;
|
|
21359
21341
|
participants = found.participantsCount ?? participants;
|
|
21360
|
-
|
|
21342
|
+
read2.push(...found.items);
|
|
21361
21343
|
more = found.hasMore && found.items.length > 0;
|
|
21362
21344
|
}
|
|
21363
|
-
return { chatId: chatId ?? chat, members:
|
|
21345
|
+
return { chatId: chatId ?? chat, members: read2, more, participants };
|
|
21364
21346
|
}, "readMembers");
|
|
21365
21347
|
var storedMembers = /* @__PURE__ */ __name(async (store, chatId) => {
|
|
21366
21348
|
const members = (await store.roster.members(chatId)).filter((one) => one.id !== store.account.account);
|
|
21367
21349
|
return members.length === 0 ? null : members;
|
|
21368
21350
|
}, "storedMembers");
|
|
21369
21351
|
|
|
21370
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
21352
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/services/inbox.js
|
|
21371
21353
|
var INBOX_CHATS = 20;
|
|
21372
21354
|
var REVIEW_DAYS = 3;
|
|
21373
21355
|
var UNANSWERED_HOURS = 24;
|
|
@@ -21412,9 +21394,9 @@ var capped = /* @__PURE__ */ __name((chats, most) => ({
|
|
|
21412
21394
|
var unreadIn = /* @__PURE__ */ __name(async (adapter, { limit, all = false, kinds }) => {
|
|
21413
21395
|
const page = await everyChat(adapter);
|
|
21414
21396
|
const { heard: waiting, quiet: quiet2 } = heard(byRecency(ofKinds(page.items, kinds).filter((chat) => (chat.unreadCount ?? 0) > 0 || chat.markedUnread === true)), all);
|
|
21415
|
-
const { read, skipped } = capped(waiting, INBOX_CHATS);
|
|
21397
|
+
const { read: read2, skipped } = capped(waiting, INBOX_CHATS);
|
|
21416
21398
|
const chats = [];
|
|
21417
|
-
for (const { id: id2, title, kind, unreadCount } of
|
|
21399
|
+
for (const { id: id2, title, kind, unreadCount } of read2) {
|
|
21418
21400
|
const count4 = unreadCount ?? 0;
|
|
21419
21401
|
if (count4 === 0) {
|
|
21420
21402
|
const newest = (await adapter.history(id2, { limit })).items.findLast((message) => !message.outgoing);
|
|
@@ -21437,10 +21419,10 @@ var newIn = /* @__PURE__ */ __name(async (adapter, { since, points, limit, all =
|
|
|
21437
21419
|
const changed = byRecency(ofKinds(changedAll, kinds));
|
|
21438
21420
|
const cut = changed.reduce((latest2, chat) => Math.max(latest2, Date.parse(chat.lastMessageAt ?? "")), since);
|
|
21439
21421
|
const { heard: wanted, quiet: quiet2 } = heard(changed, all);
|
|
21440
|
-
const { read, skipped } = capped(wanted, INBOX_CHATS);
|
|
21422
|
+
const { read: read2, skipped } = capped(wanted, INBOX_CHATS);
|
|
21441
21423
|
const chats = [];
|
|
21442
21424
|
const checked2 = {};
|
|
21443
|
-
for (const { id: id2, title, kind, unreadCount } of
|
|
21425
|
+
for (const { id: id2, title, kind, unreadCount } of read2) {
|
|
21444
21426
|
const { items } = await adapter.history(id2, { limit });
|
|
21445
21427
|
const fresh = items.filter((message) => {
|
|
21446
21428
|
const time = Date.parse(message.timestamp);
|
|
@@ -21468,9 +21450,9 @@ var REVIEW_PAGE = 100;
|
|
|
21468
21450
|
var REVIEW_PER_CHAT = 300;
|
|
21469
21451
|
var window2 = /* @__PURE__ */ __name(async (adapter, chat, since, cut) => {
|
|
21470
21452
|
const messages = [];
|
|
21471
|
-
let
|
|
21453
|
+
let before;
|
|
21472
21454
|
while (true) {
|
|
21473
|
-
const page = await adapter.history(chat, { limit: REVIEW_PAGE, ...
|
|
21455
|
+
const page = await adapter.history(chat, { limit: REVIEW_PAGE, ...before === void 0 ? {} : { before } });
|
|
21474
21456
|
const time = /* @__PURE__ */ __name((message) => Date.parse(message.timestamp), "time");
|
|
21475
21457
|
messages.unshift(...page.items.filter((message) => time(message) > since && time(message) <= cut));
|
|
21476
21458
|
const oldest = page.items[0];
|
|
@@ -21478,7 +21460,7 @@ var window2 = /* @__PURE__ */ __name(async (adapter, chat, since, cut) => {
|
|
|
21478
21460
|
return { messages, more: false };
|
|
21479
21461
|
if (messages.length >= REVIEW_PER_CHAT)
|
|
21480
21462
|
return { messages: messages.slice(-REVIEW_PER_CHAT), more: true };
|
|
21481
|
-
|
|
21463
|
+
before = oldest.id;
|
|
21482
21464
|
}
|
|
21483
21465
|
}, "window");
|
|
21484
21466
|
var reviewIn = /* @__PURE__ */ __name(async (adapter, { since, points, chat, kinds, all = false, unansweredAfterHours, now = Date.now(), enrich, onReviewed }) => {
|
|
@@ -21488,10 +21470,10 @@ var reviewIn = /* @__PURE__ */ __name(async (adapter, { since, points, chat, kin
|
|
|
21488
21470
|
const cut = changed.reduce((latest2, one) => Math.max(latest2, Date.parse(one.lastMessageAt ?? "")), since);
|
|
21489
21471
|
const only = chat === void 0 ? void 0 : (await adapter.resolve(chat)).id;
|
|
21490
21472
|
const { heard: wanted, quiet: quiet2 } = only === void 0 ? heard(ofKinds(changed, kinds), all) : { heard: changed.filter((one) => one.id === only), quiet: 0 };
|
|
21491
|
-
const { read, skipped } = capped(wanted, REVIEW_CHATS);
|
|
21473
|
+
const { read: read2, skipped } = capped(wanted, REVIEW_CHATS);
|
|
21492
21474
|
const chats = [];
|
|
21493
21475
|
const checked2 = {};
|
|
21494
|
-
for (const { id: id2, title, kind } of
|
|
21476
|
+
for (const { id: id2, title, kind } of read2) {
|
|
21495
21477
|
const { messages, more } = await window2(adapter, id2, startOf(id2), cut);
|
|
21496
21478
|
if (messages.length > 0)
|
|
21497
21479
|
chats.push({ id: id2, title, kind, messages, more });
|
|
@@ -21575,7 +21557,7 @@ var inboxService = /* @__PURE__ */ __name((deps) => {
|
|
|
21575
21557
|
};
|
|
21576
21558
|
}, "inboxService");
|
|
21577
21559
|
|
|
21578
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
21560
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/services/person-meetings.js
|
|
21579
21561
|
var SCAN = 1e3;
|
|
21580
21562
|
var personMeetings = /* @__PURE__ */ __name(async (store, people, accounts, { limit = 10, since, until } = {}) => {
|
|
21581
21563
|
const byId2 = new Map(accounts.map((one) => [one.id, one]));
|
|
@@ -21627,7 +21609,7 @@ var personMeetings = /* @__PURE__ */ __name(async (store, people, accounts, { li
|
|
|
21627
21609
|
return { items, total: newest.length, hasMore: cut || newest.length > limit };
|
|
21628
21610
|
}, "personMeetings");
|
|
21629
21611
|
|
|
21630
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
21612
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/services/person-context.js
|
|
21631
21613
|
var CONTEXT_MESSAGES2 = 10;
|
|
21632
21614
|
var CONTEXT_BYTES = 64 * 1024;
|
|
21633
21615
|
var toContext = /* @__PURE__ */ __name((key, message, chatTitle2) => ({
|
|
@@ -21827,12 +21809,12 @@ var recordContext = /* @__PURE__ */ __name(async (store, record2, reads, readabl
|
|
|
21827
21809
|
};
|
|
21828
21810
|
cut ||= direct.length > messages || groups.length > messages || mentions.length > messages;
|
|
21829
21811
|
const kept2 = withinBytes(lists, bytes2);
|
|
21830
|
-
const
|
|
21812
|
+
const read2 = [
|
|
21831
21813
|
...reads.map(({ key, scope }) => ({ ...key, scope })),
|
|
21832
21814
|
...calendars.map(({ provider, account, scope }) => ({ provider, account, scope })),
|
|
21833
21815
|
...recorded.items.flatMap(({ account }) => readable.filter((one) => nameOf(one) === nameOf(account)))
|
|
21834
21816
|
].map(({ provider, account, scope }) => ({ provider, account, scope }));
|
|
21835
|
-
const accounts = [...new Map(
|
|
21817
|
+
const accounts = [...new Map(read2.map((one) => [nameOf(one), one])).values()].sort((a, b) => nameOf(a).localeCompare(nameOf(b)));
|
|
21836
21818
|
return {
|
|
21837
21819
|
accounts,
|
|
21838
21820
|
shared: shared.sort((a, b) => Date.parse(b.lastMessageAt ?? "") - Date.parse(a.lastMessageAt ?? "")),
|
|
@@ -21933,10 +21915,10 @@ var personMessages = /* @__PURE__ */ __name(async (store, asked, reference, { ch
|
|
|
21933
21915
|
};
|
|
21934
21916
|
}, "personMessages");
|
|
21935
21917
|
|
|
21936
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
21918
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/services/meeting-evidence.js
|
|
21937
21919
|
import { createHash } from "node:crypto";
|
|
21938
21920
|
|
|
21939
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
21921
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/services/meeting-reference.js
|
|
21940
21922
|
var missing2 = /* @__PURE__ */ __name(() => new CliError("not_found", "the meeting evidence is unavailable for this account"), "missing");
|
|
21941
21923
|
var authorizedMeetingMetadata = /* @__PURE__ */ __name(async (store, accountId, reference, options2 = {}) => {
|
|
21942
21924
|
const parsed = parseMeetingReference(reference);
|
|
@@ -21954,7 +21936,7 @@ var authorizedMeetingMetadata = /* @__PURE__ */ __name(async (store, accountId,
|
|
|
21954
21936
|
return { parsed, meeting };
|
|
21955
21937
|
}, "authorizedMeetingMetadata");
|
|
21956
21938
|
|
|
21957
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
21939
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/services/meeting-evidence.js
|
|
21958
21940
|
var hash = /* @__PURE__ */ __name((value) => createHash("sha256").update(JSON.stringify(value)).digest("hex"), "hash");
|
|
21959
21941
|
var checkMeetingCancelled = /* @__PURE__ */ __name((signal) => {
|
|
21960
21942
|
if (signal?.aborted)
|
|
@@ -22153,7 +22135,7 @@ var readMeetingEvidence = /* @__PURE__ */ __name(async (store, accountId, refere
|
|
|
22153
22135
|
return { ...packet, fingerprint: hash(packet) };
|
|
22154
22136
|
}, "readMeetingEvidence");
|
|
22155
22137
|
|
|
22156
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
22138
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/services/person-meeting-context.js
|
|
22157
22139
|
var personMeetingContext = /* @__PURE__ */ __name(async (store, personReference, options2) => {
|
|
22158
22140
|
const { meetings = 10, cues = 5, bytes: bytes2 = 64 * 1024, scanLimit = 1e3, since, signal } = options2;
|
|
22159
22141
|
const requestedAccounts = options2.accountIds;
|
|
@@ -22252,7 +22234,7 @@ var personMeetingContext = /* @__PURE__ */ __name(async (store, personReference,
|
|
|
22252
22234
|
};
|
|
22253
22235
|
}, "personMeetingContext");
|
|
22254
22236
|
|
|
22255
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
22237
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/services/person-preparation.js
|
|
22256
22238
|
var PREPARE_BYTES = 96 * 1024;
|
|
22257
22239
|
var MEETINGS = 5;
|
|
22258
22240
|
var CUES = 3;
|
|
@@ -22361,11 +22343,11 @@ var meetingsOf = /* @__PURE__ */ __name(async (store, uid, stored, since, left)
|
|
|
22361
22343
|
bytes: Math.min(left(), 4 * 1024 * 1024),
|
|
22362
22344
|
...since === void 0 ? {} : { since }
|
|
22363
22345
|
});
|
|
22364
|
-
const
|
|
22346
|
+
const read2 = new Set(found.items.map((item2) => parseMeetingReference(item2.reference).accountId));
|
|
22365
22347
|
return {
|
|
22366
22348
|
items: found.items,
|
|
22367
22349
|
hasMore: found.coverage.truncatedBy !== null || found.coverage.scanLimitReached,
|
|
22368
|
-
accounts: stored.filter(({ id: id2 }) =>
|
|
22350
|
+
accounts: stored.filter(({ id: id2 }) => read2.has(id2)).map(accountName),
|
|
22369
22351
|
pending: found.coverage.pending
|
|
22370
22352
|
};
|
|
22371
22353
|
} catch (error) {
|
|
@@ -22375,18 +22357,18 @@ var meetingsOf = /* @__PURE__ */ __name(async (store, uid, stored, since, left)
|
|
|
22375
22357
|
}
|
|
22376
22358
|
}, "meetingsOf");
|
|
22377
22359
|
|
|
22378
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
22360
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/services/person-profile.js
|
|
22379
22361
|
var personProfile = /* @__PURE__ */ __name(async (deps, person, known2) => {
|
|
22380
22362
|
const online = deps.offline ? void 0 : await deps.connection();
|
|
22381
22363
|
const held = await storeIfOpen(deps);
|
|
22382
|
-
const
|
|
22364
|
+
const read2 = online?.profile ? await online.profile(person) : known2 ? factsOfCard(known2) : await storedFacts2(held ?? { store: await deps.store(), account: await deps.account() }, person);
|
|
22383
22365
|
if (!held)
|
|
22384
|
-
return { ...
|
|
22385
|
-
if (online?.profile &&
|
|
22386
|
-
await unlessBusy(() => held.store.people.savePeople(held.account, [{ id:
|
|
22366
|
+
return { ...read2, chats: quiet(read2), aliases: [] };
|
|
22367
|
+
if (online?.profile && read2.phone) {
|
|
22368
|
+
await unlessBusy(() => held.store.people.savePeople(held.account, [{ id: read2.id, name: read2.name, phone: read2.phone }]));
|
|
22387
22369
|
}
|
|
22388
|
-
const phone =
|
|
22389
|
-
const facts = phone ? { ...
|
|
22370
|
+
const phone = read2.phone ?? await held.store.people.phoneOf(held.account, read2.id);
|
|
22371
|
+
const facts = phone ? { ...read2, phone } : read2;
|
|
22390
22372
|
return {
|
|
22391
22373
|
...facts,
|
|
22392
22374
|
chats: await activityIn(held.store, held.account, facts),
|
|
@@ -22445,7 +22427,7 @@ var quiet = /* @__PURE__ */ __name((facts) => facts.chats.map(({ id: id2, title,
|
|
|
22445
22427
|
complete: false
|
|
22446
22428
|
})), "quiet");
|
|
22447
22429
|
|
|
22448
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
22430
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/services/person-timeline.js
|
|
22449
22431
|
var TIMELINE_ITEMS = 50;
|
|
22450
22432
|
var TIMELINE_MAX = 500;
|
|
22451
22433
|
var SCOPES = ["personal", "work"];
|
|
@@ -22467,7 +22449,7 @@ var personTimeline = /* @__PURE__ */ __name(async (store, asked, reference, { sc
|
|
|
22467
22449
|
throw new CliError("permission_error", `this profile reads ${allowed.join(" and ")}, not ${scope}`, {
|
|
22468
22450
|
reason: "selection.out-of-scope"
|
|
22469
22451
|
});
|
|
22470
|
-
const
|
|
22452
|
+
const read2 = scope === void 0 ? [...allowed] : [scope];
|
|
22471
22453
|
const found = pickPerson(reference, await store.people.people(asked.provider, { account: asked.account }));
|
|
22472
22454
|
const record2 = await store.people.personOf({ provider: asked.provider, id: found.id });
|
|
22473
22455
|
if (!record2)
|
|
@@ -22475,7 +22457,7 @@ var personTimeline = /* @__PURE__ */ __name(async (store, asked, reference, { sc
|
|
|
22475
22457
|
const personId = Number(record2.uid);
|
|
22476
22458
|
const pending = store.involvements.pending();
|
|
22477
22459
|
const rows = store.involvements.forPerson(personId, {
|
|
22478
|
-
scopes:
|
|
22460
|
+
scopes: read2,
|
|
22479
22461
|
...since === void 0 ? {} : { since },
|
|
22480
22462
|
...until === void 0 ? {} : { until },
|
|
22481
22463
|
only: asked,
|
|
@@ -22487,7 +22469,7 @@ var personTimeline = /* @__PURE__ */ __name(async (store, asked, reference, { sc
|
|
|
22487
22469
|
const hasMore = rows.length > limit;
|
|
22488
22470
|
return {
|
|
22489
22471
|
person: { uid: record2.uid, name: record2.name },
|
|
22490
|
-
scopes:
|
|
22472
|
+
scopes: read2,
|
|
22491
22473
|
items: shown.map((row) => ({
|
|
22492
22474
|
at: new Date(row.occurredAt).toISOString(),
|
|
22493
22475
|
subject: row.subjectType,
|
|
@@ -22507,7 +22489,7 @@ var personTimeline = /* @__PURE__ */ __name(async (store, asked, reference, { sc
|
|
|
22507
22489
|
};
|
|
22508
22490
|
}, "personTimeline");
|
|
22509
22491
|
|
|
22510
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
22492
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/services/chat-coverage.js
|
|
22511
22493
|
var chatCoverage = /* @__PURE__ */ __name(async (store, account, chatIds) => {
|
|
22512
22494
|
const ids = [...new Set(chatIds)];
|
|
22513
22495
|
if (ids.length === 0)
|
|
@@ -22533,14 +22515,14 @@ var chatCoverage = /* @__PURE__ */ __name(async (store, account, chatIds) => {
|
|
|
22533
22515
|
}));
|
|
22534
22516
|
}, "chatCoverage");
|
|
22535
22517
|
|
|
22536
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
22518
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/context/evidence-response.js
|
|
22537
22519
|
var contextSourceKey = /* @__PURE__ */ __name((source) => JSON.stringify([source.kind, source.accountId, source.provider, source.account]), "contextSourceKey");
|
|
22538
22520
|
var validateContextEvidencePage = /* @__PURE__ */ __name((page, request) => {
|
|
22539
22521
|
const fail2 = /* @__PURE__ */ __name(() => {
|
|
22540
22522
|
throw new CliError("invalid_response", "context reader returned invalid or out-of-scope evidence");
|
|
22541
22523
|
}, "fail");
|
|
22542
22524
|
try {
|
|
22543
|
-
const { source, chat, senders, after, before
|
|
22525
|
+
const { source, chat, senders, after, before, limit, maxReadBytes } = contextEvidenceRequest(request);
|
|
22544
22526
|
if (!page || contextSourceKey(contextSource(page.source)) !== contextSourceKey(source))
|
|
22545
22527
|
fail2();
|
|
22546
22528
|
if (!Array.isArray(page.items) || page.items.length > limit || !Number.isSafeInteger(page.readBytes) || page.readBytes < 0 || page.readBytes > maxReadBytes)
|
|
@@ -22559,7 +22541,7 @@ var validateContextEvidencePage = /* @__PURE__ */ __name((page, request) => {
|
|
|
22559
22541
|
for (const item2 of page.items) {
|
|
22560
22542
|
if (!item2 || item2.provider !== source.provider || item2.account !== source.account || typeof item2.text !== "string" || typeof item2.ref !== "string")
|
|
22561
22543
|
fail2();
|
|
22562
|
-
if (!Number.isSafeInteger(item2.at) || item2.at < after || item2.at >=
|
|
22544
|
+
if (!Number.isSafeInteger(item2.at) || item2.at < after || item2.at >= before || !Number.isSafeInteger(item2.updatedAt) || item2.updatedAt < 0)
|
|
22563
22545
|
fail2();
|
|
22564
22546
|
if (item2.revision !== null && (!Number.isSafeInteger(item2.revision) || item2.revision < 1))
|
|
22565
22547
|
fail2();
|
|
@@ -22597,7 +22579,7 @@ var validateContextEvidencePage = /* @__PURE__ */ __name((page, request) => {
|
|
|
22597
22579
|
}
|
|
22598
22580
|
}, "validateContextEvidencePage");
|
|
22599
22581
|
|
|
22600
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
22582
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/context/read-budget.js
|
|
22601
22583
|
var contextReadBudget = /* @__PURE__ */ __name((limits = {}) => {
|
|
22602
22584
|
if (!limits || typeof limits !== "object" || Array.isArray(limits))
|
|
22603
22585
|
throw new CliError("validation_error", "limits needs a context read allowance");
|
|
@@ -22650,7 +22632,7 @@ var contextReadBudget = /* @__PURE__ */ __name((limits = {}) => {
|
|
|
22650
22632
|
};
|
|
22651
22633
|
}, "contextReadBudget");
|
|
22652
22634
|
|
|
22653
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
22635
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/services/context-evidence.js
|
|
22654
22636
|
var createContextEvidenceReader = /* @__PURE__ */ __name((port, allowed, limits) => {
|
|
22655
22637
|
if (!port || typeof port.read !== "function")
|
|
22656
22638
|
throw new CliError("configuration_error", "context evidence reader is unavailable");
|
|
@@ -22658,7 +22640,7 @@ var createContextEvidenceReader = /* @__PURE__ */ __name((port, allowed, limits)
|
|
|
22658
22640
|
throw new CliError("validation_error", "allowed needs 1\u20138 explicitly authorized sources");
|
|
22659
22641
|
const keys = new Set(allowed.map(contextSource).map(contextSourceKey));
|
|
22660
22642
|
const budget = contextReadBudget(limits);
|
|
22661
|
-
const
|
|
22643
|
+
const read2 = port.read.bind(port);
|
|
22662
22644
|
return {
|
|
22663
22645
|
usage: budget.usage,
|
|
22664
22646
|
async read(original) {
|
|
@@ -22681,7 +22663,7 @@ var createContextEvidenceReader = /* @__PURE__ */ __name((port, allowed, limits)
|
|
|
22681
22663
|
signal
|
|
22682
22664
|
});
|
|
22683
22665
|
try {
|
|
22684
|
-
const page = await
|
|
22666
|
+
const page = await read2(request);
|
|
22685
22667
|
signal?.throwIfAborted();
|
|
22686
22668
|
validateContextEvidencePage(page, request);
|
|
22687
22669
|
reservation.complete(page.readBytes);
|
|
@@ -22694,7 +22676,7 @@ var createContextEvidenceReader = /* @__PURE__ */ __name((port, allowed, limits)
|
|
|
22694
22676
|
};
|
|
22695
22677
|
}, "createContextEvidenceReader");
|
|
22696
22678
|
|
|
22697
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
22679
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/services/excerpt.js
|
|
22698
22680
|
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");
|
|
22699
22681
|
var excerpt = /* @__PURE__ */ __name((text2, query, size2 = 240, options2 = {}) => {
|
|
22700
22682
|
const flat = text2.replace(/\s+/g, " ").trim();
|
|
@@ -22710,7 +22692,7 @@ var excerpt = /* @__PURE__ */ __name((text2, query, size2 = 240, options2 = {})
|
|
|
22710
22692
|
}, "excerpt");
|
|
22711
22693
|
var withExcerpt = /* @__PURE__ */ __name(({ matchedText, ...hit }, query) => ({ ...hit, excerpt: excerpt(matchedText ?? hit.text, query) }), "withExcerpt");
|
|
22712
22694
|
|
|
22713
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
22695
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/services/project-gathering-around.js
|
|
22714
22696
|
var storedMessageNeighbours = /* @__PURE__ */ __name((messages) => ({
|
|
22715
22697
|
async around(ref, window3) {
|
|
22716
22698
|
const at = parseLocator(ref);
|
|
@@ -22805,7 +22787,7 @@ var storedNeighbours = /* @__PURE__ */ __name((store) => {
|
|
|
22805
22787
|
};
|
|
22806
22788
|
}, "storedNeighbours");
|
|
22807
22789
|
|
|
22808
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
22790
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/services/project-gathering-request.js
|
|
22809
22791
|
import { createHash as createHash2 } from "node:crypto";
|
|
22810
22792
|
var DAY = 864e5;
|
|
22811
22793
|
var MAX_TIME = 864e13;
|
|
@@ -23007,10 +22989,10 @@ var projectGatheringRequest = /* @__PURE__ */ __name((input, now) => {
|
|
|
23007
22989
|
const lookbackDays2 = explicit ? null : whole(input.lookbackDays ?? 60, "lookbackDays", 1, LIMITS.lookbackDays);
|
|
23008
22990
|
const window3 = explicit ? (() => {
|
|
23009
22991
|
const after = whole(input.after, "after", 0, MAX_TIME);
|
|
23010
|
-
const
|
|
23011
|
-
if (
|
|
22992
|
+
const before = whole(input.before ?? asOf ?? now, "before", after + 1, MAX_TIME);
|
|
22993
|
+
if (before - after > LIMITS.lookbackDays * DAY)
|
|
23012
22994
|
fail(`window must not exceed ${LIMITS.lookbackDays} days`, "after");
|
|
23013
|
-
return { after, before
|
|
22995
|
+
return { after, before, asOf: asOf ?? before };
|
|
23014
22996
|
})() : { after: Math.max(0, (asOf ?? now) - lookbackDays2 * DAY), before: asOf ?? now, asOf: asOf ?? now };
|
|
23015
22997
|
if (input.budgets !== void 0 && (!input.budgets || typeof input.budgets !== "object"))
|
|
23016
22998
|
fail("budgets needs whole-run limits", "budgets");
|
|
@@ -23059,9 +23041,9 @@ var projectGatheringRequest = /* @__PURE__ */ __name((input, now) => {
|
|
|
23059
23041
|
signal: input.signal
|
|
23060
23042
|
};
|
|
23061
23043
|
}, "projectGatheringRequest");
|
|
23062
|
-
var contextChunks = /* @__PURE__ */ __name((after,
|
|
23044
|
+
var contextChunks = /* @__PURE__ */ __name((after, before) => {
|
|
23063
23045
|
const chunks = [];
|
|
23064
|
-
for (let end =
|
|
23046
|
+
for (let end = before; end > after; end -= CONTEXT_CHUNK_DAYS * DAY)
|
|
23065
23047
|
chunks.push({ after: Math.max(after, end - CONTEXT_CHUNK_DAYS * DAY), before: end });
|
|
23066
23048
|
return chunks;
|
|
23067
23049
|
}, "contextChunks");
|
|
@@ -23121,7 +23103,7 @@ var decodeCheckpoint = /* @__PURE__ */ __name((text2, plan) => {
|
|
|
23121
23103
|
return value;
|
|
23122
23104
|
}, "decodeCheckpoint");
|
|
23123
23105
|
|
|
23124
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
23106
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/services/project-gathering.js
|
|
23125
23107
|
var terminal = /* @__PURE__ */ new Set(["done", "unavailable", "failed"]);
|
|
23126
23108
|
var PAGE2 = 20;
|
|
23127
23109
|
var PEOPLE = 20;
|
|
@@ -23525,7 +23507,7 @@ var peopleOf = /* @__PURE__ */ __name((items, senderOf) => {
|
|
|
23525
23507
|
return [...byKey.values()].sort((a, b) => b.items - a.items || a.name.localeCompare(b.name));
|
|
23526
23508
|
}, "peopleOf");
|
|
23527
23509
|
|
|
23528
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
23510
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/services/meeting-project-candidate-matching.js
|
|
23529
23511
|
var normalizedText = /* @__PURE__ */ __name((text2) => text2.normalize("NFKC").toLowerCase().replace(/\s+/gu, " "), "normalizedText");
|
|
23530
23512
|
var termsOf = /* @__PURE__ */ __name((entry) => [
|
|
23531
23513
|
{ name: entry.name, kind: "canonical" },
|
|
@@ -23569,7 +23551,7 @@ var matchVocabularyTerms = /* @__PURE__ */ __name((catalog, texts) => {
|
|
|
23569
23551
|
return result.sort((a, b) => Number(a.entry.id) - Number(b.entry.id));
|
|
23570
23552
|
}, "matchVocabularyTerms");
|
|
23571
23553
|
|
|
23572
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
23554
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/services/project-gathering-mentions.js
|
|
23573
23555
|
var KINDS = ["project", "tag", "topic"];
|
|
23574
23556
|
var findEvidenceMentions = /* @__PURE__ */ __name(async (vocabulary, gathering, options2 = {}) => {
|
|
23575
23557
|
if (typeof vocabulary?.vocabulary !== "function")
|
|
@@ -23624,7 +23606,7 @@ var findEvidenceMentions = /* @__PURE__ */ __name(async (vocabulary, gathering,
|
|
|
23624
23606
|
};
|
|
23625
23607
|
}, "findEvidenceMentions");
|
|
23626
23608
|
|
|
23627
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
23609
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/services/project-purposes.js
|
|
23628
23610
|
var BUILT_IN_PURPOSES = ["work", "sales", "support", "other"];
|
|
23629
23611
|
var DEFAULT_PURPOSES = ["work"];
|
|
23630
23612
|
var LINK_PURPOSE = "work";
|
|
@@ -23654,7 +23636,7 @@ var purposeList = /* @__PURE__ */ __name((value, previous = []) => [
|
|
|
23654
23636
|
...value.split(",").map((one) => one.trim()).filter(Boolean)
|
|
23655
23637
|
], "purposeList");
|
|
23656
23638
|
|
|
23657
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
23639
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/services/stored-project-gathering.js
|
|
23658
23640
|
var storedChatCount = /* @__PURE__ */ __name((store) => async (account, chatId, { since, until }) => {
|
|
23659
23641
|
const window3 = { since: new Date(since).toISOString(), until: new Date(until - 1).toISOString() };
|
|
23660
23642
|
const [messages, newest, oldest] = await Promise.all([
|
|
@@ -23965,7 +23947,7 @@ var purposeHintOf = /* @__PURE__ */ __name((linked, rows, of) => {
|
|
|
23965
23947
|
return { chat: top.ref, relationship: link4.relationship, items, of };
|
|
23966
23948
|
}, "purposeHintOf");
|
|
23967
23949
|
|
|
23968
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
23950
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/services/people.js
|
|
23969
23951
|
var peopleService = /* @__PURE__ */ __name((deps) => {
|
|
23970
23952
|
const localCard = /* @__PURE__ */ __name(async (card, includeNotes = false) => {
|
|
23971
23953
|
const held = await storeIfOpen(deps);
|
|
@@ -24081,11 +24063,11 @@ var peopleService = /* @__PURE__ */ __name((deps) => {
|
|
|
24081
24063
|
const people = await capability(await deps.connection(), "addressBook", "list its contacts")();
|
|
24082
24064
|
const store = await deps.store();
|
|
24083
24065
|
const account = await deps.account();
|
|
24084
|
-
const
|
|
24066
|
+
const before = await store.people.people(account.provider, { account: account.account });
|
|
24085
24067
|
let added = 0;
|
|
24086
24068
|
let changed = 0;
|
|
24087
24069
|
for (const person of people) {
|
|
24088
|
-
const known2 =
|
|
24070
|
+
const known2 = before.get(person.id);
|
|
24089
24071
|
if (!known2)
|
|
24090
24072
|
added += 1;
|
|
24091
24073
|
else if (known2.name !== person.name || known2.username !== person.username)
|
|
@@ -24230,7 +24212,7 @@ var withoutPhone = /* @__PURE__ */ __name((answer) => {
|
|
|
24230
24212
|
return rest;
|
|
24231
24213
|
}, "withoutPhone");
|
|
24232
24214
|
|
|
24233
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
24215
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/services/task-stats.js
|
|
24234
24216
|
var TASK_STATS_BY = ["chat", "meeting", "project"];
|
|
24235
24217
|
var PERIOD_FIELD = "created";
|
|
24236
24218
|
var refuseNestedPeriod = /* @__PURE__ */ __name((node, top = true) => {
|
|
@@ -24264,14 +24246,14 @@ var taskStatsOf = /* @__PURE__ */ __name(async (store, accounts, { by = "chat",
|
|
|
24264
24246
|
const several = Array.isArray(accounts);
|
|
24265
24247
|
const list2 = several ? [...new Map(accounts.map((one) => [taskAccount(one), one])).values()] : [accounts];
|
|
24266
24248
|
const time = /* @__PURE__ */ __name((sql) => ({ type: "time", sql }), "time");
|
|
24267
|
-
const
|
|
24249
|
+
const read2 = { ...columns, [PERIOD_FIELD]: time("t.created_at"), closed: time("t.closed_at") };
|
|
24268
24250
|
const fixed = [
|
|
24269
24251
|
...group === void 0 ? [] : [{ sql: "t.source_group = ?", params: [group] }],
|
|
24270
24252
|
...kind === void 0 ? [] : [{ sql: "t.type = ?", params: [kind] }],
|
|
24271
24253
|
...by === "meeting" ? [{ sql: "t.source_kind = 'meeting'", params: [] }] : []
|
|
24272
24254
|
];
|
|
24273
|
-
const options2 = { command: "stats tasks show", now,
|
|
24274
|
-
const where = /* @__PURE__ */ __name((ast, more = []) => and([...fixed, ...more, ...ast ? [queryFilter(ast,
|
|
24255
|
+
const options2 = { command: "stats tasks show", now, zone: timezoneOf(timezone) };
|
|
24256
|
+
const where = /* @__PURE__ */ __name((ast, more = []) => and([...fixed, ...more, ...ast ? [queryFilter(ast, read2, options2)] : []]), "where");
|
|
24275
24257
|
const scopes = by === "project" ? [{ scope: { board: true } }] : list2.map((one) => ({ account: one, scope: { account: taskAccount(one) } }));
|
|
24276
24258
|
const rowsOf2 = /* @__PURE__ */ __name(async (filter) => (await Promise.all(scopes.map(async ({ account, scope }) => (await store.tasks.statRows(scope, filter)).map((row) => account ? { ...row, account } : row)))).flat(), "rowsOf");
|
|
24277
24259
|
const all = await rowsOf2(where(withoutField(query, PERIOD_FIELD)));
|
|
@@ -24361,7 +24343,7 @@ var meetingNames = /* @__PURE__ */ __name(async (store, groups) => {
|
|
|
24361
24343
|
}));
|
|
24362
24344
|
}, "meetingNames");
|
|
24363
24345
|
|
|
24364
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
24346
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/services/task-tag-filters.js
|
|
24365
24347
|
var taskTagFilters = /* @__PURE__ */ __name(async (store, query) => {
|
|
24366
24348
|
const tags = /* @__PURE__ */ new Map();
|
|
24367
24349
|
for (const node of query ? walkQuery(query.root) : [])
|
|
@@ -24370,7 +24352,7 @@ var taskTagFilters = /* @__PURE__ */ __name(async (store, query) => {
|
|
|
24370
24352
|
return tags;
|
|
24371
24353
|
}, "taskTagFilters");
|
|
24372
24354
|
|
|
24373
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
24355
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/services/tasks.js
|
|
24374
24356
|
var TASK_QUERY = {
|
|
24375
24357
|
entity: "task",
|
|
24376
24358
|
backend: "sql",
|
|
@@ -24563,7 +24545,7 @@ var tasksService = /* @__PURE__ */ __name((deps, categories) => {
|
|
|
24563
24545
|
const reviewAfterLink = /* @__PURE__ */ __name(async (store, id2) => !isClosedState((await store.tasks.get(id2))?.state ?? "done") ? store.tasks.reviewDuplicates(id2, { linked: true }) : 0, "reviewAfterLink");
|
|
24564
24546
|
return {
|
|
24565
24547
|
list: /* @__PURE__ */ __name(({ query, limit, offset, previews }) => inStore(async (store, account) => {
|
|
24566
|
-
const where = query ? queryFilter(query, await queryColumns(store, account, query), { command: "tasks list" }) : void 0;
|
|
24548
|
+
const where = query ? queryFilter(query, await queryColumns(store, account, query), { command: "tasks list", zone: timezoneOf() }) : void 0;
|
|
24567
24549
|
const rows = await store.tasks.query(taskAccount(account), where, { limit: limit + 1, offset });
|
|
24568
24550
|
const shown = rows.slice(0, limit);
|
|
24569
24551
|
return {
|
|
@@ -24870,7 +24852,7 @@ var taskView = /* @__PURE__ */ __name(async (store, account, task2) => {
|
|
|
24870
24852
|
};
|
|
24871
24853
|
}, "taskView");
|
|
24872
24854
|
|
|
24873
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
24855
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/mail/owed.js
|
|
24874
24856
|
var mailTurn = /* @__PURE__ */ __name((newest) => {
|
|
24875
24857
|
if (newest === null)
|
|
24876
24858
|
return null;
|
|
@@ -24879,7 +24861,7 @@ var mailTurn = /* @__PURE__ */ __name((newest) => {
|
|
|
24879
24861
|
return newest.addressed ? "owed" : null;
|
|
24880
24862
|
}, "mailTurn");
|
|
24881
24863
|
|
|
24882
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
24864
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/services/agenda-mail.js
|
|
24883
24865
|
var absent = /* @__PURE__ */ __name((error) => {
|
|
24884
24866
|
if (error instanceof CliError && error.code === "not_found")
|
|
24885
24867
|
return void 0;
|
|
@@ -24889,7 +24871,7 @@ var mailActivity = /* @__PURE__ */ __name(async (store, account, since, chats) =
|
|
|
24889
24871
|
const stored = await store.accounts.storedAccount(account).catch(absent);
|
|
24890
24872
|
if (!stored)
|
|
24891
24873
|
return { chats: [], storedAt: null, coverage: /* @__PURE__ */ __name(() => [], "coverage") };
|
|
24892
|
-
const where = chats ? queryFilter(chats, MAIL_AGENDA_COLUMNS, { command: "tasks agenda" }) : void 0;
|
|
24874
|
+
const where = chats ? queryFilter(chats, MAIL_AGENDA_COLUMNS, { command: "tasks agenda", zone: timezoneOf() }) : void 0;
|
|
24893
24875
|
const threads = await store.mail.threadActivity(stored.id, since, where);
|
|
24894
24876
|
const synced = await store.sync.syncState(account, "mail_coverage");
|
|
24895
24877
|
const window3 = (() => {
|
|
@@ -24937,7 +24919,7 @@ var mailActivity = /* @__PURE__ */ __name(async (store, account, since, chats) =
|
|
|
24937
24919
|
};
|
|
24938
24920
|
}, "mailActivity");
|
|
24939
24921
|
|
|
24940
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
24922
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/services/agenda.js
|
|
24941
24923
|
var DAY2 = 864e5;
|
|
24942
24924
|
var AGENDA_DEFAULTS = { unanswered: DAY2, waiting: 7 * DAY2 };
|
|
24943
24925
|
var CLAIMS = ["none", "mine", "others", "any"];
|
|
@@ -24985,7 +24967,7 @@ var agendaService = /* @__PURE__ */ __name((deps, now = Date.now) => ({
|
|
|
24985
24967
|
}), "find");
|
|
24986
24968
|
const open7 = await find();
|
|
24987
24969
|
const tags = await taskTagFilters(store, parts.tasks);
|
|
24988
|
-
const listed2 = parts.tasks ? await find(queryFilter(parts.tasks, taskColumns2(holder, at, tags), { command: "tasks agenda" })) : open7;
|
|
24970
|
+
const listed2 = parts.tasks ? await find(queryFilter(parts.tasks, taskColumns2(holder, at, tags), { command: "tasks agenda", zone: timezoneOf() })) : open7;
|
|
24989
24971
|
const tasks = listed2.map((task2) => ({ task: task2, reasons: reasonsOf(task2, at, dueWithin) })).filter(({ reasons }) => reasons.length > 0).sort((a, b) => urgency(a.task) - urgency(b.task)).map(({ task: task2, reasons }) => ({
|
|
24990
24972
|
id: task2.id,
|
|
24991
24973
|
key: task2.key,
|
|
@@ -25016,7 +24998,7 @@ var agendaService = /* @__PURE__ */ __name((deps, now = Date.now) => ({
|
|
|
25016
24998
|
assignees
|
|
25017
24999
|
}));
|
|
25018
25000
|
const mail = account.provider === "email" ? await mailActivity(store, account, at - within, parts.chats) : void 0;
|
|
25019
|
-
const activity = mail ?? await store.chats.chatActivity(account, at - within, parts.chats ? queryFilter(parts.chats, AGENDA_COLUMNS, { command: "tasks agenda" }) : void 0);
|
|
25001
|
+
const activity = mail ?? await store.chats.chatActivity(account, at - within, parts.chats ? queryFilter(parts.chats, AGENDA_COLUMNS, { command: "tasks agenda", zone: timezoneOf() }) : void 0);
|
|
25020
25002
|
const turnOf = /* @__PURE__ */ __name((chat) => "turn" in chat ? chat.turn : chat.lastFromOwner === null ? null : chat.lastFromOwner ? "waiting" : "owed", "turnOf");
|
|
25021
25003
|
const chats = activity.chats.map(({ lastMessageId, ...chat }) => ({
|
|
25022
25004
|
turn: turnOf({ lastMessageId, ...chat }),
|
|
@@ -25191,18 +25173,18 @@ var agendaItem = /* @__PURE__ */ __name((shown) => {
|
|
|
25191
25173
|
};
|
|
25192
25174
|
}, "agendaItem");
|
|
25193
25175
|
|
|
25194
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
25176
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/services/media-archive.js
|
|
25195
25177
|
import { setTimeout as sleep3 } from "node:timers/promises";
|
|
25196
25178
|
|
|
25197
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
25179
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/services/media-archive-files.js
|
|
25198
25180
|
import { lstat } from "node:fs/promises";
|
|
25199
25181
|
|
|
25200
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
25182
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/persistence/native/recording-partial-store.js
|
|
25201
25183
|
import { createHash as createHash4, randomUUID as randomUUID3 } from "node:crypto";
|
|
25202
25184
|
import { open as open3, rename as rename2, unlink as unlink2 } from "node:fs/promises";
|
|
25203
25185
|
import { join as join5 } from "node:path";
|
|
25204
25186
|
|
|
25205
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
25187
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/persistence/native/recording-partial-metadata.js
|
|
25206
25188
|
import { createHash as createHash3 } from "node:crypto";
|
|
25207
25189
|
var metadataLimit = 16384;
|
|
25208
25190
|
var partialIdentity = /* @__PURE__ */ __name((locator) => JSON.stringify([locator.provider, locator.account, locator.occurrenceId, locator.assetId]), "partialIdentity");
|
|
@@ -25262,7 +25244,7 @@ var readPartialMetadata = /* @__PURE__ */ __name(async (path, locator, maxBytes,
|
|
|
25262
25244
|
}
|
|
25263
25245
|
}, "readPartialMetadata");
|
|
25264
25246
|
|
|
25265
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
25247
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/persistence/native/recording-partial-writer.js
|
|
25266
25248
|
import { randomUUID as randomUUID2 } from "node:crypto";
|
|
25267
25249
|
import { open as open2, rename, unlink } from "node:fs/promises";
|
|
25268
25250
|
import { join as join4 } from "node:path";
|
|
@@ -25354,7 +25336,7 @@ var partialWriter = /* @__PURE__ */ __name(async (input) => {
|
|
|
25354
25336
|
};
|
|
25355
25337
|
}, "partialWriter");
|
|
25356
25338
|
|
|
25357
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
25339
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/persistence/native/recording-partial-store.js
|
|
25358
25340
|
var NativeRecordingPartialStore = class {
|
|
25359
25341
|
static {
|
|
25360
25342
|
__name(this, "NativeRecordingPartialStore");
|
|
@@ -25461,12 +25443,12 @@ var NativeRecordingPartialStore = class {
|
|
|
25461
25443
|
}
|
|
25462
25444
|
};
|
|
25463
25445
|
|
|
25464
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
25446
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/persistence/native/recording-publication.js
|
|
25465
25447
|
import { createHash as createHash5 } from "node:crypto";
|
|
25466
25448
|
import { link as link2 } from "node:fs/promises";
|
|
25467
25449
|
import { basename as basename2, dirname as dirname5, join as join7, resolve as resolve2 } from "node:path";
|
|
25468
25450
|
|
|
25469
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
25451
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/persistence/native/recording-publication-files.js
|
|
25470
25452
|
import { unlink as unlink3 } from "node:fs/promises";
|
|
25471
25453
|
var verifiedPublicationFile = /* @__PURE__ */ __name(async (path, expected2, signal, writable = false) => {
|
|
25472
25454
|
signal?.throwIfAborted();
|
|
@@ -25501,7 +25483,7 @@ var commitPublication = /* @__PURE__ */ __name(async (root, partialPath, finalPa
|
|
|
25501
25483
|
signal?.throwIfAborted();
|
|
25502
25484
|
}, "commitPublication");
|
|
25503
25485
|
|
|
25504
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
25486
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/persistence/native/recording-publication-journal.js
|
|
25505
25487
|
import { randomUUID as randomUUID4 } from "node:crypto";
|
|
25506
25488
|
import { open as open4, rename as rename3, unlink as unlink4 } from "node:fs/promises";
|
|
25507
25489
|
import { join as join6 } from "node:path";
|
|
@@ -25574,7 +25556,7 @@ var writePublicationJournal = /* @__PURE__ */ __name(async (root, path, prefix,
|
|
|
25574
25556
|
}
|
|
25575
25557
|
}, "writePublicationJournal");
|
|
25576
25558
|
|
|
25577
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
25559
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/persistence/native/recording-publication.js
|
|
25578
25560
|
var NativeRecordingPublication = class {
|
|
25579
25561
|
static {
|
|
25580
25562
|
__name(this, "NativeRecordingPublication");
|
|
@@ -25647,7 +25629,7 @@ var NativeRecordingPublication = class {
|
|
|
25647
25629
|
}
|
|
25648
25630
|
};
|
|
25649
25631
|
|
|
25650
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
25632
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/services/media-archive-manifest.js
|
|
25651
25633
|
import { createHash as createHash6 } from "node:crypto";
|
|
25652
25634
|
import { readdir } from "node:fs/promises";
|
|
25653
25635
|
import { isAbsolute as isAbsolute2, join as join8, resolve as resolve3 } from "node:path";
|
|
@@ -25734,7 +25716,7 @@ var commitMediaEntry = /* @__PURE__ */ __name((root, one, beforePublish) => writ
|
|
|
25734
25716
|
beforePublish
|
|
25735
25717
|
}), "commitMediaEntry");
|
|
25736
25718
|
|
|
25737
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
25719
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/services/media-archive-files.js
|
|
25738
25720
|
var validator = '"media-completed-v1"';
|
|
25739
25721
|
var maximumFileBytes = 64 * 1024 * 1024 * 1024;
|
|
25740
25722
|
var archiveMediaFile = /* @__PURE__ */ __name(async (root, identity, kind, file, beforeWrite, signal, metadata = {}) => {
|
|
@@ -25835,7 +25817,7 @@ var archiveMediaFile = /* @__PURE__ */ __name(async (root, identity, kind, file,
|
|
|
25835
25817
|
return entry;
|
|
25836
25818
|
}, "archiveMediaFile");
|
|
25837
25819
|
|
|
25838
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
25820
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/services/media-archive-locks.js
|
|
25839
25821
|
import { mkdir, realpath } from "node:fs/promises";
|
|
25840
25822
|
import { join as join9, resolve as resolve4 } from "node:path";
|
|
25841
25823
|
var archiveLocations = /* @__PURE__ */ __name(async (initial, signal) => {
|
|
@@ -25902,17 +25884,7 @@ var withMediaArchiveLocks = /* @__PURE__ */ __name(async (directory2, signal, ru
|
|
|
25902
25884
|
throw new CliError("validation_error", "archive locations changed during locking; run the command again");
|
|
25903
25885
|
}, "withMediaArchiveLocks");
|
|
25904
25886
|
|
|
25905
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
25906
|
-
var validateMediaSince = /* @__PURE__ */ __name((value, flag = "--since-time") => {
|
|
25907
|
-
if (value === void 0)
|
|
25908
|
-
return void 0;
|
|
25909
|
-
if (!/^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(?:\.\d{1,3})?(?:Z|[+-]\d\d:\d\d)$/.test(value) || !Number.isFinite(Date.parse(value)))
|
|
25910
|
-
throw new CliError("validation_error", `${flag} needs an ISO timestamp with a time zone`);
|
|
25911
|
-
const date2 = value.slice(0, 10);
|
|
25912
|
-
if ((/* @__PURE__ */ new Date(`${date2}T00:00:00Z`)).toISOString().slice(0, 10) !== date2)
|
|
25913
|
-
throw new CliError("validation_error", `${flag} has an invalid calendar date`);
|
|
25914
|
-
return Date.parse(value);
|
|
25915
|
-
}, "validateMediaSince");
|
|
25887
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/services/media-archive.js
|
|
25916
25888
|
var checkMediaArchive = /* @__PURE__ */ __name((directory2, signal) => withMediaArchiveLocks(directory2, signal, async (root) => {
|
|
25917
25889
|
const entries = await readMediaManifests(root, signal);
|
|
25918
25890
|
if (!entries.length)
|
|
@@ -25963,7 +25935,7 @@ var saveMessage = /* @__PURE__ */ __name(async (root, account, message, ports, k
|
|
|
25963
25935
|
return { saved, existing };
|
|
25964
25936
|
}, "saveMessage");
|
|
25965
25937
|
var archiveMedia = /* @__PURE__ */ __name(async (ports, options2) => {
|
|
25966
|
-
const since =
|
|
25938
|
+
const since = options2.sinceTime === void 0 ? void 0 : momentOf(options2.sinceTime, "--since-time");
|
|
25967
25939
|
const pageSize = options2.pageSize ?? 100;
|
|
25968
25940
|
const pauseMs = options2.pauseMs ?? 1e3;
|
|
25969
25941
|
if (!Number.isSafeInteger(pageSize) || pageSize < 1 || pageSize > 1e3 || !Number.isSafeInteger(pauseMs) || pauseMs < 0)
|
|
@@ -25985,10 +25957,10 @@ var archiveMedia = /* @__PURE__ */ __name(async (ports, options2) => {
|
|
|
25985
25957
|
let saved = 0, existing = 0, chats = 0;
|
|
25986
25958
|
const walk = /* @__PURE__ */ __name(async (chat) => {
|
|
25987
25959
|
const seen = /* @__PURE__ */ new Set();
|
|
25988
|
-
let
|
|
25960
|
+
let before;
|
|
25989
25961
|
for (; ; ) {
|
|
25990
25962
|
await beforeWrite();
|
|
25991
|
-
const page = await ports.messages.list(chat, { limit: pageSize, ...
|
|
25963
|
+
const page = await ports.messages.list(chat, { limit: pageSize, ...before ? { before } : {} });
|
|
25992
25964
|
let fresh = 0;
|
|
25993
25965
|
let reachedSince = false;
|
|
25994
25966
|
let oldest;
|
|
@@ -26014,7 +25986,7 @@ var archiveMedia = /* @__PURE__ */ __name(async (ports, options2) => {
|
|
|
26014
25986
|
break;
|
|
26015
25987
|
if (!oldest || !fresh)
|
|
26016
25988
|
throw new CliError("invalid_response", "media history pagination did not advance; archive is incomplete");
|
|
26017
|
-
|
|
25989
|
+
before = options2.orderByTime ? new Date(Date.parse(oldest.timestamp) + 1).toISOString() : page.items[0]?.id;
|
|
26018
25990
|
if (pauseMs)
|
|
26019
25991
|
await sleep3(pauseMs, void 0, { signal: options2.signal });
|
|
26020
25992
|
}
|
|
@@ -26055,7 +26027,7 @@ var archiveMedia = /* @__PURE__ */ __name(async (ports, options2) => {
|
|
|
26055
26027
|
}, { create: true });
|
|
26056
26028
|
}, "archiveMedia");
|
|
26057
26029
|
|
|
26058
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
26030
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/services/media-archive-move.js
|
|
26059
26031
|
import { realpath as realpath2, unlink as unlink5 } from "node:fs/promises";
|
|
26060
26032
|
import { basename as basename3, dirname as dirname6, join as join10, resolve as resolve5 } from "node:path";
|
|
26061
26033
|
var canonicalDestination = /* @__PURE__ */ __name(async (directory2) => {
|
|
@@ -26096,9 +26068,7 @@ var removeLocalCopy = /* @__PURE__ */ __name(async (root, entry, beforeWrite, si
|
|
|
26096
26068
|
}
|
|
26097
26069
|
}, "removeLocalCopy");
|
|
26098
26070
|
var moveMediaArchive = /* @__PURE__ */ __name(async (options2) => {
|
|
26099
|
-
const cutoff =
|
|
26100
|
-
if (cutoff === void 0)
|
|
26101
|
-
throw new CliError("validation_error", "--before-time is required");
|
|
26071
|
+
const cutoff = momentOf(options2.beforeTime, "--before-time");
|
|
26102
26072
|
const target2 = await canonicalDestination(options2.archiveDirectory);
|
|
26103
26073
|
const source = await realpath2(options2.directory);
|
|
26104
26074
|
if (source === target2)
|
|
@@ -26208,7 +26178,7 @@ var moveMediaArchive = /* @__PURE__ */ __name(async (options2) => {
|
|
|
26208
26178
|
}, { additional: [target2], createAdditional: !options2.dryRun });
|
|
26209
26179
|
}, "moveMediaArchive");
|
|
26210
26180
|
|
|
26211
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
26181
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/services/model-downloads.js
|
|
26212
26182
|
import { writeFileSync as writeFileSync2 } from "node:fs";
|
|
26213
26183
|
import { join as join11 } from "node:path";
|
|
26214
26184
|
var bytesOf = /* @__PURE__ */ __name((model) => model.files.reduce((sum2, file) => sum2 + file.bytes, 0), "bytesOf");
|
|
@@ -26233,7 +26203,7 @@ var downloadTextModel = /* @__PURE__ */ __name(async (id2, { env, progress = /*
|
|
|
26233
26203
|
`);
|
|
26234
26204
|
await nativeRuntime({ env, progress });
|
|
26235
26205
|
progress(`${model.id}: loading it once to check it works`);
|
|
26236
|
-
const { openEmbedder: openEmbedder2 } = await import("./embed-
|
|
26206
|
+
const { openEmbedder: openEmbedder2 } = await import("./embed-FEXLUH3T.js");
|
|
26237
26207
|
const embedder = await openEmbedder2(model, directory2);
|
|
26238
26208
|
try {
|
|
26239
26209
|
const [vector] = await embedder.embed(["check"], "query");
|
|
@@ -26254,7 +26224,7 @@ var downloadRerankModel = /* @__PURE__ */ __name(async (id2, { env, progress = /
|
|
|
26254
26224
|
}
|
|
26255
26225
|
await nativeRuntime({ env, progress });
|
|
26256
26226
|
progress(`${model.id}: loading it once to check it works`);
|
|
26257
|
-
const { openReranker } = await import("./rerank-
|
|
26227
|
+
const { openReranker } = await import("./rerank-X2633CQN.js");
|
|
26258
26228
|
const reranker = await openReranker(model, directory2);
|
|
26259
26229
|
try {
|
|
26260
26230
|
await reranker.score("check", ["check"]);
|
|
@@ -26272,7 +26242,7 @@ var downloadImageModel = /* @__PURE__ */ __name(async (id2, { env, progress = /*
|
|
|
26272
26242
|
await installFiles(placedImage(model, directory2), { progress, ...bytes2 ? { bytes: bytes2 } : {} });
|
|
26273
26243
|
}
|
|
26274
26244
|
progress(`${model.id}: loading it once to check it works`);
|
|
26275
|
-
const { openPictureEmbedder } = await import("./embedder-
|
|
26245
|
+
const { openPictureEmbedder } = await import("./embedder-NHQARKFJ.js");
|
|
26276
26246
|
const embedder = await openPictureEmbedder(model, directory2);
|
|
26277
26247
|
try {
|
|
26278
26248
|
const vector = await embedder.embedQuery("check");
|
|
@@ -26284,7 +26254,7 @@ var downloadImageModel = /* @__PURE__ */ __name(async (id2, { env, progress = /*
|
|
|
26284
26254
|
return { model, directory: directory2 };
|
|
26285
26255
|
}, "downloadImageModel");
|
|
26286
26256
|
|
|
26287
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
26257
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/domain/money-words.js
|
|
26288
26258
|
var MONEY_REQUEST = "money-request";
|
|
26289
26259
|
var MONEY_DONE = "money-done";
|
|
26290
26260
|
var PROMISE = "promise";
|
|
@@ -26318,10 +26288,10 @@ var MONEY_WORDS = [
|
|
|
26318
26288
|
}
|
|
26319
26289
|
];
|
|
26320
26290
|
|
|
26321
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
26291
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/services/money-words.js
|
|
26322
26292
|
var moneyClassesOf = /* @__PURE__ */ __name((text2) => listsHit(text2, MONEY_WORDS), "moneyClassesOf");
|
|
26323
26293
|
|
|
26324
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
26294
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/domain/status-words.js
|
|
26325
26295
|
var words = /* @__PURE__ */ __name((forms) => new RegExp(`(?<![\\p{L}\\p{N}])(?:${forms.join("|")})(?![\\p{L}\\p{N}])`, "iu"), "words");
|
|
26326
26296
|
var MONEY_DONE_FORMS = words([
|
|
26327
26297
|
"\u043E\u043F\u043B\u0430\u0442\u0438\u043B[\u0430\u0438]?",
|
|
@@ -26361,7 +26331,7 @@ var PROMISE_FORMS = words([
|
|
|
26361
26331
|
"estar\xE1 listo"
|
|
26362
26332
|
]);
|
|
26363
26333
|
|
|
26364
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
26334
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/services/project-status/items.js
|
|
26365
26335
|
var EXCERPT_CHARS = 80;
|
|
26366
26336
|
var excerpt2 = /* @__PURE__ */ __name((text2) => {
|
|
26367
26337
|
const flat = text2.replace(/\s+/g, " ").trim();
|
|
@@ -26383,7 +26353,7 @@ var whoOf = /* @__PURE__ */ __name((message) => ({
|
|
|
26383
26353
|
var fromOwner = /* @__PURE__ */ __name((message) => message.outgoing === true, "fromOwner");
|
|
26384
26354
|
var day = /* @__PURE__ */ __name((at) => new Date(at).toISOString().slice(0, 10), "day");
|
|
26385
26355
|
|
|
26386
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
26356
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/services/project-status/signals/amounts.js
|
|
26387
26357
|
var MONEY = DEFAULT_TASK_CATEGORIES.filter((category) => category.name === "money");
|
|
26388
26358
|
var verbOf = /* @__PURE__ */ __name((text2) => {
|
|
26389
26359
|
if (MONEY_DONE_FORMS.test(text2))
|
|
@@ -26464,7 +26434,7 @@ var amounts = {
|
|
|
26464
26434
|
attention: /* @__PURE__ */ __name((items) => items.flatMap((item2) => item2.chat !== null && item2.data.state === "asked" ? [{ chat: item2.chat, weight: 2, why: "money asked" }] : []), "attention")
|
|
26465
26435
|
};
|
|
26466
26436
|
|
|
26467
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
26437
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/services/project-status/signals/children.js
|
|
26468
26438
|
var children = {
|
|
26469
26439
|
id: "children",
|
|
26470
26440
|
version: 1,
|
|
@@ -26493,7 +26463,7 @@ var children = {
|
|
|
26493
26463
|
}, "read")
|
|
26494
26464
|
};
|
|
26495
26465
|
|
|
26496
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
26466
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/services/project-status/signals/coverage.js
|
|
26497
26467
|
var coverage = {
|
|
26498
26468
|
id: "coverage",
|
|
26499
26469
|
version: 1,
|
|
@@ -26522,7 +26492,7 @@ var coverage = {
|
|
|
26522
26492
|
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")
|
|
26523
26493
|
};
|
|
26524
26494
|
|
|
26525
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
26495
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/services/project-status/signals/payments.js
|
|
26526
26496
|
var holding2 = /* @__PURE__ */ __name((row) => row.review !== "rejected", "holding");
|
|
26527
26497
|
var item = /* @__PURE__ */ __name((row, at, data) => ({
|
|
26528
26498
|
signal: "payments",
|
|
@@ -26572,7 +26542,7 @@ var payments = {
|
|
|
26572
26542
|
}, "read")
|
|
26573
26543
|
};
|
|
26574
26544
|
|
|
26575
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
26545
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/services/project-status/signals/promises.js
|
|
26576
26546
|
var PATTERNS_PER_CHAT = 3;
|
|
26577
26547
|
var DAY3 = 864e5;
|
|
26578
26548
|
var KINDS2 = /* @__PURE__ */ new Set(["promise", "request"]);
|
|
@@ -26661,7 +26631,7 @@ var promises = {
|
|
|
26661
26631
|
}, "read")
|
|
26662
26632
|
};
|
|
26663
26633
|
|
|
26664
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
26634
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/services/project-status/signals/questions.js
|
|
26665
26635
|
var PER_SIDE = 5;
|
|
26666
26636
|
var WEEK = 7 * 864e5;
|
|
26667
26637
|
var NOBODY = /* @__PURE__ */ new Set();
|
|
@@ -26692,7 +26662,7 @@ var questions2 = {
|
|
|
26692
26662
|
}, "attention")
|
|
26693
26663
|
};
|
|
26694
26664
|
|
|
26695
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
26665
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/services/project-status/signals/reply-next.js
|
|
26696
26666
|
var targetOf = /* @__PURE__ */ __name((message, chat, owners) => {
|
|
26697
26667
|
const byId2 = /* @__PURE__ */ __name((id2) => chat.messages.find((one) => one.id === id2), "byId");
|
|
26698
26668
|
const quoted = message.replyTo ?? (message.replyToId === void 0 ? void 0 : byId2(message.replyToId));
|
|
@@ -26760,7 +26730,7 @@ var replyNext = {
|
|
|
26760
26730
|
attention: /* @__PURE__ */ __name((items) => items.flatMap((item2) => item2.chat !== null && item2.data.next === "owner" ? [{ chat: item2.chat, weight: 2, why: "your move" }] : []), "attention")
|
|
26761
26731
|
};
|
|
26762
26732
|
|
|
26763
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
26733
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/services/project-status/signals/topics.js
|
|
26764
26734
|
var escaped = /* @__PURE__ */ __name((text2) => text2.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), "escaped");
|
|
26765
26735
|
var wholeWord = /* @__PURE__ */ __name((word) => new RegExp(`(?<![\\p{L}\\p{N}])${escaped(word)}(?![\\p{L}\\p{N}])`, "u"), "wholeWord");
|
|
26766
26736
|
var matcherOf = /* @__PURE__ */ __name((query) => {
|
|
@@ -26806,7 +26776,7 @@ var topics = {
|
|
|
26806
26776
|
}, "read")
|
|
26807
26777
|
};
|
|
26808
26778
|
|
|
26809
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
26779
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/services/project-status/signals/index.js
|
|
26810
26780
|
var STATUS_SIGNALS = [
|
|
26811
26781
|
replyNext,
|
|
26812
26782
|
questions2,
|
|
@@ -26818,7 +26788,7 @@ var STATUS_SIGNALS = [
|
|
|
26818
26788
|
children
|
|
26819
26789
|
];
|
|
26820
26790
|
|
|
26821
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
26791
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/services/project-status/index.js
|
|
26822
26792
|
var DAY4 = 864e5;
|
|
26823
26793
|
var STATUS_WINDOW = 300;
|
|
26824
26794
|
var STATUS_CHATS = 16;
|
|
@@ -27007,7 +26977,7 @@ var projectStatus = /* @__PURE__ */ __name(async (store, input) => {
|
|
|
27007
26977
|
};
|
|
27008
26978
|
}, "projectStatus");
|
|
27009
26979
|
|
|
27010
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
26980
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/services/account.js
|
|
27011
26981
|
var accountService = /* @__PURE__ */ __name((deps) => {
|
|
27012
26982
|
const online = /* @__PURE__ */ __name(async (command) => {
|
|
27013
26983
|
if (deps.offline)
|
|
@@ -27079,26 +27049,18 @@ var accountService = /* @__PURE__ */ __name((deps) => {
|
|
|
27079
27049
|
};
|
|
27080
27050
|
}, "accountService");
|
|
27081
27051
|
|
|
27082
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
27083
|
-
var MINUTE = 6e4;
|
|
27084
|
-
var YEAR = 365 * 24 * 60 * MINUTE;
|
|
27085
|
-
var DELAY = /^(\d+)(m|h|d)$/;
|
|
27086
|
-
var UNIT_MS = { m: MINUTE, h: 60 * MINUTE, d: 24 * 60 * MINUTE };
|
|
27052
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/domain/send-time.js
|
|
27087
27053
|
var sendTime = /* @__PURE__ */ __name((value, now = Date.now(), flag = "--at-time", zone) => {
|
|
27088
|
-
const
|
|
27089
|
-
|
|
27090
|
-
|
|
27091
|
-
|
|
27092
|
-
|
|
27093
|
-
}
|
|
27094
|
-
if (at < now + MINUTE)
|
|
27095
|
-
throw new CliError("validation_error", `${flag} has to be at least a minute from now`);
|
|
27096
|
-
if (at > now + YEAR)
|
|
27097
|
-
throw new CliError("validation_error", `${flag} can be at most a year from now`);
|
|
27054
|
+
const at = aheadOf(value, flag, now, {
|
|
27055
|
+
...zone === void 0 ? {} : { zone },
|
|
27056
|
+
refuseDate: true,
|
|
27057
|
+
soonest: MINUTE,
|
|
27058
|
+
latest: YEAR
|
|
27059
|
+
});
|
|
27098
27060
|
return new Date(at - at % MINUTE).toISOString();
|
|
27099
27061
|
}, "sendTime");
|
|
27100
27062
|
|
|
27101
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
27063
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/services/admin.js
|
|
27102
27064
|
var recordMembership = /* @__PURE__ */ __name(async (deps, operationId, done2, change, fix, write) => {
|
|
27103
27065
|
try {
|
|
27104
27066
|
const held = await accountStoreIfOpen(deps);
|
|
@@ -27345,7 +27307,7 @@ var linkLimits = /* @__PURE__ */ __name(({ approval, expires, maxUses }) => {
|
|
|
27345
27307
|
return expires === void 0 ? void 0 : sendTime(expires, Date.now(), "--expire-time");
|
|
27346
27308
|
}, "linkLimits");
|
|
27347
27309
|
|
|
27348
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
27310
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/services/mail-search.js
|
|
27349
27311
|
var THREADS_PAGE = 500;
|
|
27350
27312
|
var threadsOf = /* @__PURE__ */ __name(async (store, key) => {
|
|
27351
27313
|
const account = await store.accounts.storedAccount(key).catch(() => void 0);
|
|
@@ -27382,18 +27344,14 @@ var withMailThreads = /* @__PURE__ */ __name((store) => {
|
|
|
27382
27344
|
get: /* @__PURE__ */ __name((target2, key, receiver) => key === "chats" ? chats : Reflect.get(target2, key, receiver), "get")
|
|
27383
27345
|
});
|
|
27384
27346
|
}, "withMailThreads");
|
|
27385
|
-
var before = /* @__PURE__ */ __name((newest) => (a, b) => {
|
|
27386
|
-
if (!newest) {
|
|
27387
|
-
if ((a.exact ?? false) !== (b.exact ?? false))
|
|
27388
|
-
return a.exact ? -1 : 1;
|
|
27389
|
-
if (a.score !== b.score)
|
|
27390
|
-
return a.score === null ? 1 : b.score === null ? -1 : b.score - a.score;
|
|
27391
|
-
}
|
|
27392
|
-
return b.timestamp.localeCompare(a.timestamp);
|
|
27393
|
-
}, "before");
|
|
27394
27347
|
var mergeMail = /* @__PURE__ */ __name((messages, mail, limit, newest = false) => {
|
|
27395
27348
|
const moved = new Set(mail.items.map(({ locator }) => locator));
|
|
27396
|
-
const
|
|
27349
|
+
const kept2 = messages.items.filter(({ locator }) => !moved.has(locator));
|
|
27350
|
+
const items = newest ? [...kept2, ...mail.items].sort((a, b) => b.timestamp.localeCompare(a.timestamp)) : fuseRanked([kept2, mail.items], (hit) => ({
|
|
27351
|
+
exact: hit.exact,
|
|
27352
|
+
ranked: hit.score !== null,
|
|
27353
|
+
at: Date.parse(hit.timestamp)
|
|
27354
|
+
}));
|
|
27397
27355
|
return {
|
|
27398
27356
|
items: items.slice(0, limit),
|
|
27399
27357
|
hasMore: messages.hasMore || mail.hasMore || items.length > limit
|
|
@@ -27410,7 +27368,7 @@ var mailAround = /* @__PURE__ */ __name(async (store, hit, count4) => {
|
|
|
27410
27368
|
return void 0;
|
|
27411
27369
|
return emails.slice(Math.max(0, at - count4), at + count4 + 1).map((email) => email.externalId === hit.id ? { ...messageOfEmail(email, hit.chatId), anchor: true } : messageOfEmail(email, hit.chatId));
|
|
27412
27370
|
}, "mailAround");
|
|
27413
|
-
var readMail = /* @__PURE__ */ __name(async (store, locator, { before
|
|
27371
|
+
var readMail = /* @__PURE__ */ __name(async (store, locator, { before = 0, after = 0 } = {}) => {
|
|
27414
27372
|
const { provider, account, chat, message } = parseLocator(locator);
|
|
27415
27373
|
if (provider !== "email")
|
|
27416
27374
|
throw new CliError("validation_error", `${locator} is not an email \u2014 it names ${provider}`);
|
|
@@ -27421,10 +27379,10 @@ var readMail = /* @__PURE__ */ __name(async (store, locator, { before: before2 =
|
|
|
27421
27379
|
const at = thread.findIndex(({ id: id2 }) => id2 === message);
|
|
27422
27380
|
if (at < 0)
|
|
27423
27381
|
throw new CliError("not_found", `no stored email ${message} in that thread`);
|
|
27424
|
-
return thread.slice(Math.max(0, at -
|
|
27382
|
+
return thread.slice(Math.max(0, at - before), at + after + 1).map((hit) => hit.id === message ? { ...hit, anchor: true } : hit);
|
|
27425
27383
|
}, "readMail");
|
|
27426
27384
|
|
|
27427
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
27385
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/services/messages-search.js
|
|
27428
27386
|
var PERSON_FIELDS = /* @__PURE__ */ new Set(["from", "to", "cc", "bcc"]);
|
|
27429
27387
|
var MAIL_FIELDS = /* @__PURE__ */ new Set(["to", "cc", "bcc", "subject", "mailbox", "label", "is", "list"]);
|
|
27430
27388
|
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");
|
|
@@ -27791,7 +27749,7 @@ var statsLucene = /* @__PURE__ */ __name(async (store, account, request, messeng
|
|
|
27791
27749
|
};
|
|
27792
27750
|
}, "statsLucene");
|
|
27793
27751
|
|
|
27794
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
27752
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/services/rankings-selection.js
|
|
27795
27753
|
var RANKING_SELECTION_BYTES = 64 * 1024;
|
|
27796
27754
|
var object2 = /* @__PURE__ */ __name((value) => value !== null && typeof value === "object" && !Array.isArray(value) ? value : void 0, "object");
|
|
27797
27755
|
function invalid(message = "ranking selection is invalid \u2014 obtain a new drilldown from stats top") {
|
|
@@ -27960,7 +27918,7 @@ var readRankingSelection = /* @__PURE__ */ __name(async (store, input) => {
|
|
|
27960
27918
|
};
|
|
27961
27919
|
}, "readRankingSelection");
|
|
27962
27920
|
|
|
27963
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
27921
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/services/search-record.js
|
|
27964
27922
|
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");
|
|
27965
27923
|
var searchRecordOf = /* @__PURE__ */ __name((command, params) => ({
|
|
27966
27924
|
command,
|
|
@@ -27970,7 +27928,7 @@ var searchRecordOf = /* @__PURE__ */ __name((command, params) => ({
|
|
|
27970
27928
|
fieldsVersion: FIELD_VERSION
|
|
27971
27929
|
}), "searchRecordOf");
|
|
27972
27930
|
|
|
27973
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
27931
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/services/admin-statistics.js
|
|
27974
27932
|
function invalid2(message) {
|
|
27975
27933
|
throw new CliError("validation_error", message);
|
|
27976
27934
|
}
|
|
@@ -28264,7 +28222,7 @@ var adminStatisticsService = /* @__PURE__ */ __name((deps) => ({
|
|
|
28264
28222
|
}, "evidence")
|
|
28265
28223
|
}), "adminStatisticsService");
|
|
28266
28224
|
|
|
28267
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
28225
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/services/archive-gaps.js
|
|
28268
28226
|
import { createHash as createHash7, randomUUID as randomUUID5 } from "node:crypto";
|
|
28269
28227
|
var GAP_BOUNDS = { maxGaps: 5, limit: 500, timeMs: 3e4 };
|
|
28270
28228
|
var validateRepair = /* @__PURE__ */ __name((messenger, options2) => {
|
|
@@ -28320,12 +28278,12 @@ var gapsService = /* @__PURE__ */ __name((deps) => {
|
|
|
28320
28278
|
if (prepare)
|
|
28321
28279
|
validateCatchUp(deps, prepare);
|
|
28322
28280
|
deps.guard.check({ chatId: null, key: "store.gaps.repair" }, { reserve: false });
|
|
28323
|
-
const
|
|
28324
|
-
if (options2.fingerprint !== void 0 && options2.fingerprint !==
|
|
28281
|
+
const before = await plan(chat);
|
|
28282
|
+
if (options2.fingerprint !== void 0 && options2.fingerprint !== before.fingerprint)
|
|
28325
28283
|
throw new CliError("validation_error", "the gap plan changed; inspect it again before repairing");
|
|
28326
28284
|
const store = await deps.store();
|
|
28327
28285
|
const holder = randomUUID5();
|
|
28328
|
-
if (!await store.sync.claim(
|
|
28286
|
+
if (!await store.sync.claim(before.account, before.chat, "gaps", holder, timeMs + 5e3))
|
|
28329
28287
|
throw new CliError("validation_error", "another gap repair holds this chat; retry after it finishes");
|
|
28330
28288
|
const started = Date.now();
|
|
28331
28289
|
const controller = new AbortController();
|
|
@@ -28337,7 +28295,7 @@ var gapsService = /* @__PURE__ */ __name((deps) => {
|
|
|
28337
28295
|
let stopped;
|
|
28338
28296
|
try {
|
|
28339
28297
|
for (let round = 0; round < maxGaps; round += 1) {
|
|
28340
|
-
const current = await plan(
|
|
28298
|
+
const current = await plan(before.chat);
|
|
28341
28299
|
const gap = current.gaps.at(-1);
|
|
28342
28300
|
if (!gap)
|
|
28343
28301
|
break;
|
|
@@ -28348,7 +28306,7 @@ var gapsService = /* @__PURE__ */ __name((deps) => {
|
|
|
28348
28306
|
let result;
|
|
28349
28307
|
let windowFetched = 0;
|
|
28350
28308
|
try {
|
|
28351
|
-
result = await abortable(() => archiveService(deps).fetch(
|
|
28309
|
+
result = await abortable(() => archiveService(deps).fetch(before.chat, {
|
|
28352
28310
|
window: gap,
|
|
28353
28311
|
onRequest: /* @__PURE__ */ __name(() => {
|
|
28354
28312
|
requests += 1;
|
|
@@ -28377,14 +28335,14 @@ var gapsService = /* @__PURE__ */ __name((deps) => {
|
|
|
28377
28335
|
}
|
|
28378
28336
|
repaired.push(gap);
|
|
28379
28337
|
}
|
|
28380
|
-
const after = await plan(
|
|
28338
|
+
const after = await plan(before.chat);
|
|
28381
28339
|
const remainingMs = timeMs - (Date.now() - started);
|
|
28382
|
-
const prepared = !prepare ? void 0 : remainingMs <= 0 || signal.aborted ? { complete: false, reason: "time_or_abort_bound" } : await catchUpSearch(deps,
|
|
28340
|
+
const prepared = !prepare ? void 0 : remainingMs <= 0 || signal.aborted ? { complete: false, reason: "time_or_abort_bound" } : await catchUpSearch(deps, before.chat, { ...prepare, timeMs: Math.min(prepare.timeMs ?? 3e4, remainingMs) }, signal);
|
|
28383
28341
|
return {
|
|
28384
28342
|
version: 1,
|
|
28385
28343
|
scope: "interior",
|
|
28386
|
-
chat:
|
|
28387
|
-
before
|
|
28344
|
+
chat: before.chat,
|
|
28345
|
+
before,
|
|
28388
28346
|
after,
|
|
28389
28347
|
repaired,
|
|
28390
28348
|
fetched,
|
|
@@ -28395,18 +28353,18 @@ var gapsService = /* @__PURE__ */ __name((deps) => {
|
|
|
28395
28353
|
};
|
|
28396
28354
|
} finally {
|
|
28397
28355
|
clearTimeout(timer);
|
|
28398
|
-
await store.sync.release(
|
|
28356
|
+
await store.sync.release(before.account, before.chat, "gaps", holder);
|
|
28399
28357
|
}
|
|
28400
28358
|
}, "repair");
|
|
28401
28359
|
return { plan, repair };
|
|
28402
28360
|
}, "gapsService");
|
|
28403
28361
|
|
|
28404
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
28362
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/services/attachments.js
|
|
28405
28363
|
import { createHash as createHash10 } from "node:crypto";
|
|
28406
28364
|
import { constants as constants2, mkdirSync as mkdirSync5 } from "node:fs";
|
|
28407
28365
|
import { lstat as lstat5, open as open6, readFile as readFile2, stat as stat2 } from "node:fs/promises";
|
|
28408
28366
|
|
|
28409
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
28367
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/attachments/directory.js
|
|
28410
28368
|
import { lstat as lstat2, readdir as readdir2, realpath as realpath3 } from "node:fs/promises";
|
|
28411
28369
|
import { basename as basename4, join as join12, relative as relative2, sep as sep2 } from "node:path";
|
|
28412
28370
|
var MAX_FILES = 1e4;
|
|
@@ -28477,15 +28435,15 @@ var directoryPaths = /* @__PURE__ */ __name(async (store, chat, directory2, app,
|
|
|
28477
28435
|
return choices;
|
|
28478
28436
|
}, "directoryPaths");
|
|
28479
28437
|
|
|
28480
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
28438
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/attachments/documents.js
|
|
28481
28439
|
import { posix } from "node:path";
|
|
28482
28440
|
|
|
28483
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
28441
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/attachments/container.js
|
|
28484
28442
|
import { setImmediate as tick } from "node:timers/promises";
|
|
28485
28443
|
import { crc32 } from "node:zlib";
|
|
28486
28444
|
var import_xmldom = __toESM(require_lib(), 1);
|
|
28487
28445
|
|
|
28488
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
28446
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/attachments/encoding.js
|
|
28489
28447
|
var import_chardet = __toESM(require_lib2(), 1);
|
|
28490
28448
|
var import_iconv_lite = __toESM(require_lib3(), 1);
|
|
28491
28449
|
var SAMPLE = 65536;
|
|
@@ -28587,7 +28545,7 @@ var decodeXml = /* @__PURE__ */ __name((bytes2) => {
|
|
|
28587
28545
|
return result.text;
|
|
28588
28546
|
}, "decodeXml");
|
|
28589
28547
|
|
|
28590
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
28548
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/attachments/container.js
|
|
28591
28549
|
var MAX_PART = 10 * 1024 * 1024;
|
|
28592
28550
|
var MAX_ENTRIES = 1e3;
|
|
28593
28551
|
var decoder = new TextDecoder("utf-8", { fatal: true });
|
|
@@ -28802,7 +28760,7 @@ var elements = /* @__PURE__ */ __name((node, name, namespace) => {
|
|
|
28802
28760
|
return found;
|
|
28803
28761
|
}, "elements");
|
|
28804
28762
|
|
|
28805
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
28763
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/attachments/sheets.js
|
|
28806
28764
|
var columnName = /* @__PURE__ */ __name((column) => {
|
|
28807
28765
|
let name = "";
|
|
28808
28766
|
for (let rest = column; rest > 0; rest = Math.floor((rest - 1) / 26))
|
|
@@ -28857,7 +28815,7 @@ var sheetText = /* @__PURE__ */ __name((sheets2, maxChars = MAX_TEXT_CHARS) => {
|
|
|
28857
28815
|
return { text: parts.join("").trim(), truncated: false };
|
|
28858
28816
|
}, "sheetText");
|
|
28859
28817
|
|
|
28860
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
28818
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/attachments/documents.js
|
|
28861
28819
|
var OFFICE = "urn:oasis:names:tc:opendocument:xmlns:office:1.0";
|
|
28862
28820
|
var TEXT = "urn:oasis:names:tc:opendocument:xmlns:text:1.0";
|
|
28863
28821
|
var TABLE = "urn:oasis:names:tc:opendocument:xmlns:table:1.0";
|
|
@@ -29257,10 +29215,10 @@ var readDocument = /* @__PURE__ */ __name(async (bytes2, kind, signal) => {
|
|
|
29257
29215
|
}
|
|
29258
29216
|
}, "readDocument");
|
|
29259
29217
|
|
|
29260
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
29218
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/attachments/extract.js
|
|
29261
29219
|
import { extname as extname3 } from "node:path";
|
|
29262
29220
|
|
|
29263
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
29221
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/readers/engine.js
|
|
29264
29222
|
import { readFileSync as readFileSync4 } from "node:fs";
|
|
29265
29223
|
import { dirname as dirname7, extname as extname2, join as join13 } from "node:path";
|
|
29266
29224
|
import { fileURLToPath } from "node:url";
|
|
@@ -29283,7 +29241,7 @@ var versionOf = /* @__PURE__ */ __name((name) => {
|
|
|
29283
29241
|
}
|
|
29284
29242
|
return name;
|
|
29285
29243
|
}, "versionOf");
|
|
29286
|
-
var withEngine = /* @__PURE__ */ __name(async (load, name,
|
|
29244
|
+
var withEngine = /* @__PURE__ */ __name(async (load, name, read2) => {
|
|
29287
29245
|
let engine;
|
|
29288
29246
|
try {
|
|
29289
29247
|
const loaded2 = await load(name);
|
|
@@ -29295,7 +29253,7 @@ var withEngine = /* @__PURE__ */ __name(async (load, name, read) => {
|
|
|
29295
29253
|
}
|
|
29296
29254
|
const extractor = `${name === "mammoth" ? "docx" : name === "word-extractor" ? "doc" : "pdf"}:${versionOf(name)}`;
|
|
29297
29255
|
try {
|
|
29298
|
-
return await
|
|
29256
|
+
return await read2(engine, extractor);
|
|
29299
29257
|
} catch (error) {
|
|
29300
29258
|
if (error instanceof ReaderLimit)
|
|
29301
29259
|
return { status: "too-large" };
|
|
@@ -29307,12 +29265,12 @@ var withEngine = /* @__PURE__ */ __name(async (load, name, read) => {
|
|
|
29307
29265
|
var startsWith = /* @__PURE__ */ __name((bytes2, magic) => bytes2.length >= magic.length && [...magic].every((char, index) => bytes2[index] === char.charCodeAt(0)), "startsWith");
|
|
29308
29266
|
var extensionOf = /* @__PURE__ */ __name(({ name, path }) => extname2(name ?? path).toLowerCase(), "extensionOf");
|
|
29309
29267
|
var capped2 = /* @__PURE__ */ __name((text2) => text2.length > MAX_TEXT_CHARS ? text2.slice(0, MAX_TEXT_CHARS) : text2, "capped");
|
|
29310
|
-
var derived = /* @__PURE__ */ __name((bytes2, extractor,
|
|
29268
|
+
var derived = /* @__PURE__ */ __name((bytes2, extractor, read2) => {
|
|
29311
29269
|
const decoded = decodeText(bytes2);
|
|
29312
29270
|
if ("error" in decoded)
|
|
29313
29271
|
return { status: "unreadable", extractor, error: decoded.error };
|
|
29314
29272
|
try {
|
|
29315
|
-
const text2 =
|
|
29273
|
+
const text2 = read2(decoded.text);
|
|
29316
29274
|
return text2 === "" ? { status: "needs-agent", extractor } : { status: "extracted", text: capped2(text2), extractor };
|
|
29317
29275
|
} catch (error) {
|
|
29318
29276
|
if (error instanceof ReaderLimit)
|
|
@@ -29321,7 +29279,7 @@ var derived = /* @__PURE__ */ __name((bytes2, extractor, read) => {
|
|
|
29321
29279
|
}
|
|
29322
29280
|
}, "derived");
|
|
29323
29281
|
|
|
29324
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
29282
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/readers/image/index.js
|
|
29325
29283
|
var IMAGES = /* @__PURE__ */ new Set([".jpg", ".jpeg", ".png", ".webp", ".gif", ".heic", ".tif", ".tiff", ".bmp"]);
|
|
29326
29284
|
var image2 = {
|
|
29327
29285
|
id: "image",
|
|
@@ -29330,7 +29288,7 @@ var image2 = {
|
|
|
29330
29288
|
read: /* @__PURE__ */ __name(async () => ({ status: "needs-agent" }), "read")
|
|
29331
29289
|
};
|
|
29332
29290
|
|
|
29333
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
29291
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/readers/doc/index.js
|
|
29334
29292
|
var OLE = "\xD0\xCF\xE0\xA1\xB1\xE1";
|
|
29335
29293
|
var doc = {
|
|
29336
29294
|
id: "doc",
|
|
@@ -29342,7 +29300,7 @@ var doc = {
|
|
|
29342
29300
|
}), "read")
|
|
29343
29301
|
};
|
|
29344
29302
|
|
|
29345
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
29303
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/readers/docx/index.js
|
|
29346
29304
|
var DOCX = "application/vnd.openxmlformats-officedocument.wordprocessingml.document";
|
|
29347
29305
|
var docx = {
|
|
29348
29306
|
id: "docx",
|
|
@@ -29355,10 +29313,10 @@ var docx = {
|
|
|
29355
29313
|
}), "read")
|
|
29356
29314
|
};
|
|
29357
29315
|
|
|
29358
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
29316
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/attachments/markup.js
|
|
29359
29317
|
var import_iconv_lite2 = __toESM(require_lib3(), 1);
|
|
29360
29318
|
|
|
29361
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
29319
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/domain/html-entities.js
|
|
29362
29320
|
var NAMED = {
|
|
29363
29321
|
amp: "&",
|
|
29364
29322
|
lt: "<",
|
|
@@ -29410,7 +29368,7 @@ var decodeEntities = /* @__PURE__ */ __name((text2) => text2.replace(/&(#x[0-9a-
|
|
|
29410
29368
|
return body[1] === "x" || body[1] === "X" ? character(Number.parseInt(body.slice(2), 16), entity) : character(Number(body.slice(1)), entity);
|
|
29411
29369
|
}), "decodeEntities");
|
|
29412
29370
|
|
|
29413
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
29371
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/attachments/markup.js
|
|
29414
29372
|
var RTF_SKIPPED = /* @__PURE__ */ new Set([
|
|
29415
29373
|
"fonttbl",
|
|
29416
29374
|
"colortbl",
|
|
@@ -29576,7 +29534,7 @@ var htmlText = /* @__PURE__ */ __name((source) => {
|
|
|
29576
29534
|
return decodeEntities(replaceTags(blocks, /<[^>]*>/g, "")).replace(/(?<![ \t\u00a0])[ \t\u00a0]+\n/g, "\n").replace(/\n{3,}/g, "\n\n").trim();
|
|
29577
29535
|
}, "htmlText");
|
|
29578
29536
|
|
|
29579
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
29537
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/readers/html/page.js
|
|
29580
29538
|
var clean = /* @__PURE__ */ __name((value) => typeof value === "string" ? value.replace(/\s+/g, " ").trim() : "", "clean");
|
|
29581
29539
|
var namesIn = /* @__PURE__ */ __name((value) => [value].flat().map((entry) => typeof entry === "string" ? clean(entry) : clean(entry?.name)).filter(Boolean).join(", "), "namesIn");
|
|
29582
29540
|
var jsonLdNodes = /* @__PURE__ */ __name((document) => {
|
|
@@ -29632,7 +29590,7 @@ var markdownSections = /* @__PURE__ */ __name((text2) => {
|
|
|
29632
29590
|
return found.map((section, index) => ({ ...section, end: found[index + 1]?.start ?? text2.length }));
|
|
29633
29591
|
}, "markdownSections");
|
|
29634
29592
|
|
|
29635
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
29593
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/readers/html/index.js
|
|
29636
29594
|
var HTML = /* @__PURE__ */ new Set([".html", ".htm", ".xhtml"]);
|
|
29637
29595
|
var first = /* @__PURE__ */ __name((...values) => values.find((value) => typeof value === "string" && value !== ""), "first");
|
|
29638
29596
|
var loaded = /* @__PURE__ */ __name(async (load, name) => {
|
|
@@ -29703,7 +29661,7 @@ var html = {
|
|
|
29703
29661
|
}, "read")
|
|
29704
29662
|
};
|
|
29705
29663
|
|
|
29706
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
29664
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/readers/office/index.js
|
|
29707
29665
|
var office = {
|
|
29708
29666
|
id: "office",
|
|
29709
29667
|
version: documentExtractor("odt"),
|
|
@@ -29714,7 +29672,7 @@ var office = {
|
|
|
29714
29672
|
}, "read")
|
|
29715
29673
|
};
|
|
29716
29674
|
|
|
29717
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
29675
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/readers/pdf/index.js
|
|
29718
29676
|
var pdf = {
|
|
29719
29677
|
id: "pdf",
|
|
29720
29678
|
version: "unpdf",
|
|
@@ -29781,7 +29739,7 @@ var pdf = {
|
|
|
29781
29739
|
}), "read")
|
|
29782
29740
|
};
|
|
29783
29741
|
|
|
29784
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
29742
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/readers/plain/index.js
|
|
29785
29743
|
var PLAIN = /* @__PURE__ */ new Set([".txt", ".md", ".markdown", ".csv", ".tsv", ".json", ".log"]);
|
|
29786
29744
|
var isPlain = /* @__PURE__ */ __name((hint) => PLAIN.has(extensionOf(hint)) || hint.mime?.startsWith("text/") || hint.mime === "application/json", "isPlain");
|
|
29787
29745
|
var readPlain = /* @__PURE__ */ __name((bytes2) => {
|
|
@@ -29801,7 +29759,7 @@ var plain = {
|
|
|
29801
29759
|
read: /* @__PURE__ */ __name(async (bytes2) => readPlain(bytes2), "read")
|
|
29802
29760
|
};
|
|
29803
29761
|
|
|
29804
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
29762
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/readers/rtf/index.js
|
|
29805
29763
|
var rtf = {
|
|
29806
29764
|
id: "rtf",
|
|
29807
29765
|
version: "v1",
|
|
@@ -29809,10 +29767,10 @@ var rtf = {
|
|
|
29809
29767
|
read: /* @__PURE__ */ __name(async (bytes2) => derived(bytes2, "rtf:v1", rtfText), "read")
|
|
29810
29768
|
};
|
|
29811
29769
|
|
|
29812
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
29770
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/readers/sheets/index.js
|
|
29813
29771
|
import { basename as basename5 } from "node:path";
|
|
29814
29772
|
|
|
29815
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
29773
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/attachments/csv-spans.js
|
|
29816
29774
|
var delimitedSpans = /* @__PURE__ */ __name((text2, delimiter, maxCells = 1e4) => {
|
|
29817
29775
|
const cells = [];
|
|
29818
29776
|
let row = 1, column = 1, start = 0, quoted = false, truncated = false;
|
|
@@ -29850,7 +29808,7 @@ var delimitedSpans = /* @__PURE__ */ __name((text2, delimiter, maxCells = 1e4) =
|
|
|
29850
29808
|
return { cells, truncated };
|
|
29851
29809
|
}, "delimitedSpans");
|
|
29852
29810
|
|
|
29853
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
29811
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/readers/sheets/index.js
|
|
29854
29812
|
var DELIMITED = {
|
|
29855
29813
|
".csv": ",",
|
|
29856
29814
|
".tsv": " ",
|
|
@@ -29889,7 +29847,7 @@ var sheets = {
|
|
|
29889
29847
|
}, "read")
|
|
29890
29848
|
};
|
|
29891
29849
|
|
|
29892
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
29850
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/readers/registry.js
|
|
29893
29851
|
var BUILT_INS2 = [office, pdf, docx, doc, rtf, html, sheets, plain, image2];
|
|
29894
29852
|
var HEAD_BYTES = 1024;
|
|
29895
29853
|
var readers = [...BUILT_INS2];
|
|
@@ -29899,7 +29857,7 @@ var readWithRegistry = /* @__PURE__ */ __name(async (bytes2, hint, context2) =>
|
|
|
29899
29857
|
return reader ? reader.read(bytes2, hint, context2) : { status: "unsupported" };
|
|
29900
29858
|
}, "readWithRegistry");
|
|
29901
29859
|
|
|
29902
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
29860
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/attachments/extract.js
|
|
29903
29861
|
var importEngine = /* @__PURE__ */ __name((name) => importFrom(new URL("attachments/extract.js", import.meta.resolve("@wirecat/cli-core")).href, name), "importEngine");
|
|
29904
29862
|
var extensionOf2 = /* @__PURE__ */ __name(({ name, path }) => extname3(name ?? path).toLowerCase(), "extensionOf");
|
|
29905
29863
|
var extractText = /* @__PURE__ */ __name(async (bytes2, hint, load, signal, env = process.env) => {
|
|
@@ -30978,7 +30936,7 @@ function imageSize(input) {
|
|
|
30978
30936
|
}
|
|
30979
30937
|
__name(imageSize, "imageSize");
|
|
30980
30938
|
|
|
30981
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
30939
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/attachments/ocr.js
|
|
30982
30940
|
var MAX_PAGES = 20;
|
|
30983
30941
|
var MAX_PIXELS = 2e7;
|
|
30984
30942
|
var cancelled2 = /* @__PURE__ */ __name((signal) => {
|
|
@@ -31138,7 +31096,7 @@ var ocrPdf = /* @__PURE__ */ __name(async (bytes2, pipeline2, load, signal) => {
|
|
|
31138
31096
|
}
|
|
31139
31097
|
}, "ocrPdf");
|
|
31140
31098
|
|
|
31141
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
31099
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/attachments/pdf-preview.js
|
|
31142
31100
|
var pdfPreview = /* @__PURE__ */ __name(async (bytes2, page, signal, load = importEngine, env = process.env) => {
|
|
31143
31101
|
const limits = pdfPreviewLimits(env);
|
|
31144
31102
|
const cancelled3 = /* @__PURE__ */ __name(() => {
|
|
@@ -31215,7 +31173,7 @@ var pdfPreview = /* @__PURE__ */ __name(async (bytes2, page, signal, load = impo
|
|
|
31215
31173
|
}
|
|
31216
31174
|
}, "pdfPreview");
|
|
31217
31175
|
|
|
31218
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
31176
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/attachments/picture-reading.js
|
|
31219
31177
|
import { spawn } from "node:child_process";
|
|
31220
31178
|
import { mkdtempSync, readFileSync as readFileSync5, rmSync as rmSync2, writeFileSync as writeFileSync3 } from "node:fs";
|
|
31221
31179
|
import { tmpdir } from "node:os";
|
|
@@ -31369,16 +31327,16 @@ Read the attached picture.`,
|
|
|
31369
31327
|
text2 = readFileSync5(answer, "utf8");
|
|
31370
31328
|
} catch {
|
|
31371
31329
|
}
|
|
31372
|
-
const
|
|
31373
|
-
if (
|
|
31330
|
+
const read2 = text2.trim();
|
|
31331
|
+
if (read2 === "")
|
|
31374
31332
|
throw new CliError("invalid_response", `${TITLE[agent]} answered nothing`, { reason: "picture-reading.failed" });
|
|
31375
|
-
return
|
|
31333
|
+
return read2;
|
|
31376
31334
|
} finally {
|
|
31377
31335
|
rmSync2(folder, { recursive: true, force: true });
|
|
31378
31336
|
}
|
|
31379
31337
|
}, "readPictureWithAgent");
|
|
31380
31338
|
|
|
31381
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
31339
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/attachments/transfer.js
|
|
31382
31340
|
import { createHash as createHash8 } from "node:crypto";
|
|
31383
31341
|
import { constants } from "node:fs";
|
|
31384
31342
|
import { lstat as lstat3, open as open5 } from "node:fs/promises";
|
|
@@ -31397,17 +31355,17 @@ var retainedBytes = /* @__PURE__ */ __name(async (path, options2, captureFile =
|
|
|
31397
31355
|
}, "cancelled");
|
|
31398
31356
|
cancelled3();
|
|
31399
31357
|
try {
|
|
31400
|
-
const
|
|
31401
|
-
if (!
|
|
31358
|
+
const before = await lstat3(path);
|
|
31359
|
+
if (!before.isFile() || before.isSymbolicLink())
|
|
31402
31360
|
throw new CliError("validation_error", "the retained attachment must be a regular file");
|
|
31403
|
-
if (
|
|
31361
|
+
if (before.size > maxBytes)
|
|
31404
31362
|
throw new CliError("validation_error", `the retained attachment exceeds ${maxBytes / 1024 / 1024} MiB; configure MESSAGING_ATTACHMENT_MAX_MIB`);
|
|
31405
|
-
if (offsetBytes >
|
|
31363
|
+
if (offsetBytes > before.size)
|
|
31406
31364
|
throw new CliError("validation_error", "the byte offset is past the end of this attachment");
|
|
31407
31365
|
const handle = await open5(path, constants.O_RDONLY | (constants.O_NOFOLLOW ?? 0) | (constants.O_NONBLOCK ?? 0));
|
|
31408
31366
|
try {
|
|
31409
31367
|
const opened = await handle.stat();
|
|
31410
|
-
if (!opened.isFile() || opened.ino !==
|
|
31368
|
+
if (!opened.isFile() || opened.ino !== before.ino || opened.dev !== before.dev || opened.size !== before.size)
|
|
31411
31369
|
throw new CliError("validation_error", "the retained attachment changed; restart its transfer");
|
|
31412
31370
|
const bytes2 = Buffer.alloc(Math.min(chunkBytes, opened.size - offsetBytes));
|
|
31413
31371
|
const capturedFile = captureFile ? Buffer.alloc(opened.size) : void 0;
|
|
@@ -31486,7 +31444,7 @@ var transferMime = /* @__PURE__ */ __name((head, hint, name = null) => {
|
|
|
31486
31444
|
return hint !== null && /^[a-z0-9.+-]+\/[a-z0-9.+-]+$/i.test(hint) ? hint : "application/octet-stream";
|
|
31487
31445
|
}, "transferMime");
|
|
31488
31446
|
|
|
31489
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
31447
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/services/file-download.js
|
|
31490
31448
|
import { createWriteStream, mkdirSync as mkdirSync4 } from "node:fs";
|
|
31491
31449
|
import { link as link3, rm } from "node:fs/promises";
|
|
31492
31450
|
import { join as join15, resolve as resolve6 } from "node:path";
|
|
@@ -31600,12 +31558,12 @@ var save = /* @__PURE__ */ __name(async (file, directory2, fallbackName, { uniqu
|
|
|
31600
31558
|
}
|
|
31601
31559
|
}, "save");
|
|
31602
31560
|
|
|
31603
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
31561
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/services/pictures.js
|
|
31604
31562
|
import { createHash as createHash9 } from "node:crypto";
|
|
31605
31563
|
import { lstat as lstat4, readFile } from "node:fs/promises";
|
|
31606
31564
|
import { setTimeout as sleep4 } from "node:timers/promises";
|
|
31607
31565
|
|
|
31608
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
31566
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/domain/models.js
|
|
31609
31567
|
var GROUP_SETTINGS = [
|
|
31610
31568
|
"allCanPin",
|
|
31611
31569
|
"onlyAdminsAdd",
|
|
@@ -31619,7 +31577,7 @@ var ADMIN_RIGHTS = ["read", "members", "admins", "info", "pin", "link", "post",
|
|
|
31619
31577
|
var senderIsMe = /* @__PURE__ */ __name((message, account) => message.outgoing === true || message.senderId !== null && String(message.senderId) === account, "senderIsMe");
|
|
31620
31578
|
var MEDIA_KINDS = ["photo", "video", "file", "audio", "link"];
|
|
31621
31579
|
|
|
31622
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
31580
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/services/pictures.js
|
|
31623
31581
|
var PICTURE_MAX_BYTES = 25 * 1024 * 1024;
|
|
31624
31582
|
var PICTURE_FLOOR = 0.25;
|
|
31625
31583
|
var PAGE3 = 50;
|
|
@@ -31627,7 +31585,7 @@ var SAVE_EVERY = 8;
|
|
|
31627
31585
|
var PICTURES_OFF = "picture search is off for this profile \u2014 set pictureSearch to true in its config to turn it on";
|
|
31628
31586
|
var missingModel = /* @__PURE__ */ __name((id2) => `the picture model is not downloaded \u2014 \`images models download ${id2}\` fetches it`, "missingModel");
|
|
31629
31587
|
var plainWords = /* @__PURE__ */ __name((query) => query.replace(/\b(?:text|content|transcript|filename):("[^"]*"|\S+)/gi, "$1").replace(/\b[a-z_]+:("[^"]*"|\[[^\]]*\]|\{[^}]*\}|\([^)]*\)|\S+)/gi, " ").replace(/\b(?:AND|OR|NOT)\b/g, " ").replace(/[()"+\-~^*?\\[\]{}!|&]/g, " ").replace(/\s+/g, " ").trim(), "plainWords");
|
|
31630
|
-
var pictureBytes = /* @__PURE__ */ __name(async (picture, files,
|
|
31588
|
+
var pictureBytes = /* @__PURE__ */ __name(async (picture, files, read2) => {
|
|
31631
31589
|
if (picture.localPath) {
|
|
31632
31590
|
try {
|
|
31633
31591
|
const found = await lstat4(picture.localPath);
|
|
@@ -31648,7 +31606,7 @@ var pictureBytes = /* @__PURE__ */ __name(async (picture, files, read) => {
|
|
|
31648
31606
|
return void 0;
|
|
31649
31607
|
parts.push(part);
|
|
31650
31608
|
}
|
|
31651
|
-
await
|
|
31609
|
+
await read2(file);
|
|
31652
31610
|
return Buffer.concat(parts);
|
|
31653
31611
|
}, "pictureBytes");
|
|
31654
31612
|
var picturesService = /* @__PURE__ */ __name((deps) => {
|
|
@@ -31660,7 +31618,7 @@ var picturesService = /* @__PURE__ */ __name((deps) => {
|
|
|
31660
31618
|
const directory2 = imageModelsDirectory(deps.env);
|
|
31661
31619
|
if (!isImageModelInstalled(model2, directory2))
|
|
31662
31620
|
throw new CliError("not_found", missingModel(model2.id), { reason: "model.not-downloaded", model: model2.id });
|
|
31663
|
-
const { openPictureEmbedder } = await import("./embedder-
|
|
31621
|
+
const { openPictureEmbedder } = await import("./embedder-NHQARKFJ.js");
|
|
31664
31622
|
return openPictureEmbedder(model2, directory2);
|
|
31665
31623
|
}, "open");
|
|
31666
31624
|
const embedder = /* @__PURE__ */ __name(() => {
|
|
@@ -31834,7 +31792,7 @@ var withPictures = /* @__PURE__ */ __name((messages, pictures) => ({
|
|
|
31834
31792
|
}, "search")
|
|
31835
31793
|
}), "withPictures");
|
|
31836
31794
|
|
|
31837
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
31795
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/services/attachments.js
|
|
31838
31796
|
var ATTACHMENT_QUERY = {
|
|
31839
31797
|
entity: "attachment",
|
|
31840
31798
|
backend: "sql",
|
|
@@ -31998,7 +31956,7 @@ var attachmentsService = /* @__PURE__ */ __name((deps) => ({
|
|
|
31998
31956
|
};
|
|
31999
31957
|
const batch = batchProgress(deps.env);
|
|
32000
31958
|
const fetched = /* @__PURE__ */ new Set();
|
|
32001
|
-
let
|
|
31959
|
+
let read2 = 0;
|
|
32002
31960
|
let beforePk = cursor === void 0 ? void 0 : Number(cursor);
|
|
32003
31961
|
let scanned = 0;
|
|
32004
31962
|
const pending = [];
|
|
@@ -32021,12 +31979,12 @@ var attachmentsService = /* @__PURE__ */ __name((deps) => ({
|
|
|
32021
31979
|
if (extraction && bytes2 !== void 0 && (!ocr || status === "extracted") && (status === "extracted" || file.read?.error !== null)) {
|
|
32022
31980
|
if (await keep(store, file, extraction, bytes2, sha) === false) {
|
|
32023
31981
|
run2.unchanged += 1;
|
|
32024
|
-
|
|
31982
|
+
read2 += 1;
|
|
32025
31983
|
return;
|
|
32026
31984
|
}
|
|
32027
31985
|
}
|
|
32028
31986
|
if (status !== "missing" && status !== "too-large" && status !== "engine-missing")
|
|
32029
|
-
|
|
31987
|
+
read2 += 1;
|
|
32030
31988
|
if (extraction?.status === "engine-missing" && !run2.enginesMissing.includes(extraction.engine))
|
|
32031
31989
|
run2.enginesMissing.push(extraction.engine);
|
|
32032
31990
|
if (status === "extracted")
|
|
@@ -32082,9 +32040,9 @@ var attachmentsService = /* @__PURE__ */ __name((deps) => ({
|
|
|
32082
32040
|
limit: PAGE4
|
|
32083
32041
|
});
|
|
32084
32042
|
for (const file of page) {
|
|
32085
|
-
while (pending.length && (pending.length >= concurrency || limit !== void 0 &&
|
|
32043
|
+
while (pending.length && (pending.length >= concurrency || limit !== void 0 && read2 + pending.length >= limit))
|
|
32086
32044
|
await pending.shift();
|
|
32087
|
-
if (batch.stopped || signal?.aborted || limit !== void 0 &&
|
|
32045
|
+
if (batch.stopped || signal?.aborted || limit !== void 0 && read2 >= limit || scanLimit !== void 0 && scanned >= scanLimit) {
|
|
32088
32046
|
run2.complete = false;
|
|
32089
32047
|
if (beforePk !== void 0)
|
|
32090
32048
|
run2.cursor = String(beforePk);
|
|
@@ -32143,7 +32101,7 @@ var attachmentsService = /* @__PURE__ */ __name((deps) => ({
|
|
|
32143
32101
|
if (node.field === "chat" && node.operator !== "wildcard" && !chats.has(node.value))
|
|
32144
32102
|
chats.set(node.value, await chatIdIn(deps.messenger, node.value, store, { includeLeft: true }));
|
|
32145
32103
|
}
|
|
32146
|
-
const where = query ? queryFilter(query, attachmentColumns(chats), { command: "attachments list" }) : void 0;
|
|
32104
|
+
const where = query ? queryFilter(query, attachmentColumns(chats), { command: "attachments list", zone: timezoneOf() }) : void 0;
|
|
32147
32105
|
const views = await store.attachments.attachments({ ...where ? { where } : {}, offset, limit: limit + 1 });
|
|
32148
32106
|
return { items: views.slice(0, limit).map((view) => itemOf2(account, view)), hasMore: views.length > limit };
|
|
32149
32107
|
}, "list"),
|
|
@@ -32283,8 +32241,8 @@ var attachmentsService = /* @__PURE__ */ __name((deps) => ({
|
|
|
32283
32241
|
const mime = transferMime(Buffer.from(bytes2.subarray(0, 16)), null);
|
|
32284
32242
|
if (!mime.startsWith("image/"))
|
|
32285
32243
|
throw notPicture;
|
|
32286
|
-
const
|
|
32287
|
-
const text2 =
|
|
32244
|
+
const read2 = await readPictureWithAgent({ ...reader, bytes: bytes2, mime, env, ...signal ? { signal } : {} });
|
|
32245
|
+
const text2 = read2.slice(0, MAX_TEXT_CHARS);
|
|
32288
32246
|
const extractor = pictureExtractor(reader.agent, reader.model);
|
|
32289
32247
|
await store.attachments.keepAttachmentText(chosen.pk, {
|
|
32290
32248
|
text: text2,
|
|
@@ -32305,7 +32263,7 @@ var attachmentsService = /* @__PURE__ */ __name((deps) => ({
|
|
|
32305
32263
|
}, "readPicture")
|
|
32306
32264
|
}), "attachmentsService");
|
|
32307
32265
|
|
|
32308
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
32266
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/services/chat-documents.js
|
|
32309
32267
|
var chatDocumentsService = /* @__PURE__ */ __name((deps) => ({
|
|
32310
32268
|
list: /* @__PURE__ */ __name(async (chat, { limit, offset, ref }) => {
|
|
32311
32269
|
const store = await accountStore(deps);
|
|
@@ -32335,7 +32293,7 @@ var chatDocumentsService = /* @__PURE__ */ __name((deps) => ({
|
|
|
32335
32293
|
}, "list")
|
|
32336
32294
|
}), "chatDocumentsService");
|
|
32337
32295
|
|
|
32338
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
32296
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/services/retention.js
|
|
32339
32297
|
var observationDuration = /* @__PURE__ */ __name((text2, flag) => {
|
|
32340
32298
|
const match = /^(\d+(?:\.\d+)?)([smhdw])$/.exec(text2);
|
|
32341
32299
|
const units2 = { s: 1e3, m: 6e4, h: 36e5, d: 864e5, w: 6048e5 };
|
|
@@ -32422,7 +32380,7 @@ var isRetentionSelection = /* @__PURE__ */ __name((selection) => {
|
|
|
32422
32380
|
}
|
|
32423
32381
|
}, "isRetentionSelection");
|
|
32424
32382
|
|
|
32425
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
32383
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/services/counters.js
|
|
32426
32384
|
var counterFields = /* @__PURE__ */ __name((text2 = "views,reactions,comments") => {
|
|
32427
32385
|
const fields = text2.split(",").map((one) => one.trim());
|
|
32428
32386
|
if (!fields.length || fields.some((one) => !COUNTER_FIELDS.includes(one)) || new Set(fields).size !== fields.length)
|
|
@@ -32629,7 +32587,7 @@ var countersService = /* @__PURE__ */ __name((deps) => {
|
|
|
32629
32587
|
};
|
|
32630
32588
|
}, "countersService");
|
|
32631
32589
|
|
|
32632
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
32590
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/services/search-refresh.js
|
|
32633
32591
|
var SYNC_KEY = "messages.sync-first";
|
|
32634
32592
|
var SYNC_BOUNDS = { maxChats: 5, timeMs: 3e4, maxMessages: 500 };
|
|
32635
32593
|
var keyOf3 = /* @__PURE__ */ __name((chat) => JSON.stringify([chat.account.provider, chat.account.account, chat.chatId]), "keyOf");
|
|
@@ -32761,10 +32719,10 @@ var withRefresh = /* @__PURE__ */ __name((found, refreshed) => ({
|
|
|
32761
32719
|
...!refreshed || refreshed.complete ? {} : { coverage: { ...found.coverage, state: "stale" } }
|
|
32762
32720
|
}), "withRefresh");
|
|
32763
32721
|
|
|
32764
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
32722
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/services/embeddings-search.js
|
|
32765
32723
|
var CANDIDATES = 50;
|
|
32766
32724
|
var WORD_HITS = 200;
|
|
32767
|
-
var
|
|
32725
|
+
var RRF_K2 = 60;
|
|
32768
32726
|
var embeddingsSearch = /* @__PURE__ */ __name((deps) => {
|
|
32769
32727
|
const command = deps.messenger.app.command;
|
|
32770
32728
|
const byWords = /* @__PURE__ */ __name(async (query, prepared, conversations, since) => {
|
|
@@ -32803,9 +32761,16 @@ var embeddingsSearch = /* @__PURE__ */ __name((deps) => {
|
|
|
32803
32761
|
});
|
|
32804
32762
|
outside.set(JSON.stringify(account), { account, chats });
|
|
32805
32763
|
}
|
|
32806
|
-
|
|
32764
|
+
let ranked = items.flatMap(({ id: id2, score, timestamp }, index) => {
|
|
32807
32765
|
const summary = summaries.get(index);
|
|
32808
|
-
return summary ? [
|
|
32766
|
+
return summary ? [
|
|
32767
|
+
{
|
|
32768
|
+
summary,
|
|
32769
|
+
chunk: { firstMessageId: id2, lastMessageId: id2 },
|
|
32770
|
+
ranked: score !== null,
|
|
32771
|
+
at: Date.parse(timestamp)
|
|
32772
|
+
}
|
|
32773
|
+
] : [];
|
|
32809
32774
|
});
|
|
32810
32775
|
const mailAccounts = prepared.scopeAccounts.filter(({ provider }) => provider === MAIL);
|
|
32811
32776
|
if (mailAccounts.length && conversations === void 0) {
|
|
@@ -32819,6 +32784,7 @@ var embeddingsSearch = /* @__PURE__ */ __name((deps) => {
|
|
|
32819
32784
|
return { items: [] };
|
|
32820
32785
|
throw error;
|
|
32821
32786
|
});
|
|
32787
|
+
const emails = [];
|
|
32822
32788
|
for (const account of mailAccounts) {
|
|
32823
32789
|
const found = mail.items.filter((hit) => {
|
|
32824
32790
|
const at = parseLocator(hit.locator);
|
|
@@ -32834,10 +32800,15 @@ var embeddingsSearch = /* @__PURE__ */ __name((deps) => {
|
|
|
32834
32800
|
continue;
|
|
32835
32801
|
const summary = threadConversation(place, Date.now());
|
|
32836
32802
|
sources.set(summary.id, account);
|
|
32837
|
-
|
|
32803
|
+
emails.push({
|
|
32804
|
+
summary,
|
|
32805
|
+
chunk: { firstMessageId: hit.id, lastMessageId: hit.id },
|
|
32806
|
+
ranked: hit.score !== null,
|
|
32807
|
+
at: Date.parse(hit.timestamp)
|
|
32808
|
+
});
|
|
32838
32809
|
}
|
|
32839
32810
|
}
|
|
32840
|
-
ranked
|
|
32811
|
+
ranked = fuseRanked([ranked, emails], (one) => one);
|
|
32841
32812
|
}
|
|
32842
32813
|
const seen = /* @__PURE__ */ new Set();
|
|
32843
32814
|
const hits = ranked.flatMap(({ summary, chunk }) => {
|
|
@@ -32998,11 +32969,11 @@ var fused = /* @__PURE__ */ __name((meaning, words3, minimumCosine) => {
|
|
|
32998
32969
|
by: ["meaning"],
|
|
32999
32970
|
stale,
|
|
33000
32971
|
...matchedIn ? { matchedIn } : {},
|
|
33001
|
-
fused: 1 / (
|
|
32972
|
+
fused: 1 / (RRF_K2 + index + 1)
|
|
33002
32973
|
});
|
|
33003
32974
|
});
|
|
33004
32975
|
words3.forEach(({ summary, chunk }, index) => {
|
|
33005
|
-
const share = 1 / (
|
|
32976
|
+
const share = 1 / (RRF_K2 + index + 1);
|
|
33006
32977
|
const held = merged2.get(summary.id);
|
|
33007
32978
|
if (held) {
|
|
33008
32979
|
held.fused += share;
|
|
@@ -33036,13 +33007,13 @@ var meanOf = /* @__PURE__ */ __name((vectors) => {
|
|
|
33036
33007
|
return mean2.map((value) => value / length);
|
|
33037
33008
|
}, "meanOf");
|
|
33038
33009
|
|
|
33039
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
33010
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/services/embeddings.js
|
|
33040
33011
|
var embeddingsService = /* @__PURE__ */ __name((deps) => ({
|
|
33041
33012
|
...embeddingsMaintenance(deps),
|
|
33042
33013
|
...embeddingsSearch(deps)
|
|
33043
33014
|
}), "embeddingsService");
|
|
33044
33015
|
|
|
33045
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
33016
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/services/folders.js
|
|
33046
33017
|
var foldersService = /* @__PURE__ */ __name((deps) => {
|
|
33047
33018
|
const online = /* @__PURE__ */ __name(async (command) => {
|
|
33048
33019
|
if (deps.offline)
|
|
@@ -33183,7 +33154,7 @@ var foldersService = /* @__PURE__ */ __name((deps) => {
|
|
|
33183
33154
|
};
|
|
33184
33155
|
}, "foldersService");
|
|
33185
33156
|
|
|
33186
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
33157
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/services/mentions.js
|
|
33187
33158
|
var REVIEW_COUNT = 500;
|
|
33188
33159
|
var mentionsService = /* @__PURE__ */ __name((deps) => {
|
|
33189
33160
|
const located = /* @__PURE__ */ __name(async () => {
|
|
@@ -33244,8 +33215,8 @@ var mentionsService = /* @__PURE__ */ __name((deps) => {
|
|
|
33244
33215
|
const found = await store.mentions.mention(id2);
|
|
33245
33216
|
if (!found)
|
|
33246
33217
|
throw new CliError("not_found", `no mention ${id2} in this account`);
|
|
33247
|
-
const { before
|
|
33248
|
-
return { ...mention(rest), before
|
|
33218
|
+
const { before, after, sameValue, candidates, ...rest } = found;
|
|
33219
|
+
return { ...mention(rest), before, after, sameValue, candidates };
|
|
33249
33220
|
}, "show"),
|
|
33250
33221
|
confirm: /* @__PURE__ */ __name(async (id2, target2, by, inChat = false) => {
|
|
33251
33222
|
let owner;
|
|
@@ -33262,7 +33233,7 @@ var mentionsService = /* @__PURE__ */ __name((deps) => {
|
|
|
33262
33233
|
};
|
|
33263
33234
|
}, "mentionsService");
|
|
33264
33235
|
|
|
33265
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
33236
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/domain/message-link.js
|
|
33266
33237
|
var fileLinks = /* @__PURE__ */ __name((attachments) => hitFiles(attachments).map(({ position, kind, name }) => ({
|
|
33267
33238
|
position,
|
|
33268
33239
|
kind,
|
|
@@ -33311,7 +33282,7 @@ var validatePermalink = /* @__PURE__ */ __name((link4) => {
|
|
|
33311
33282
|
return { url: link4.url, access: link4.access, reason: link4.reason };
|
|
33312
33283
|
}, "validatePermalink");
|
|
33313
33284
|
|
|
33314
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
33285
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/domain/pin-duration.js
|
|
33315
33286
|
var spokenSeconds = /* @__PURE__ */ __name((seconds) => {
|
|
33316
33287
|
if (seconds % 86400 === 0 && seconds > 86400)
|
|
33317
33288
|
return `${seconds / 86400}d`;
|
|
@@ -33343,7 +33314,7 @@ var pinDurationOf = /* @__PURE__ */ __name((value, allowed, flag = "--expire-tim
|
|
|
33343
33314
|
return seconds;
|
|
33344
33315
|
}, "pinDurationOf");
|
|
33345
33316
|
|
|
33346
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
33317
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/sends/send-as.js
|
|
33347
33318
|
var sendAsCheck = /* @__PURE__ */ __name((connection, sendAs) => {
|
|
33348
33319
|
if (sendAs === void 0) {
|
|
33349
33320
|
const saved = connection.savedSender?.bind(connection);
|
|
@@ -33368,7 +33339,7 @@ var typedSendAs = /* @__PURE__ */ __name((typed) => {
|
|
|
33368
33339
|
return sendAs;
|
|
33369
33340
|
}, "typedSendAs");
|
|
33370
33341
|
|
|
33371
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
33342
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/search/total.js
|
|
33372
33343
|
var TOTAL_CAP = 1e4;
|
|
33373
33344
|
var totalOf = /* @__PURE__ */ __name((count4, shown, hasMore, exact = true) => {
|
|
33374
33345
|
const least = shown + (hasMore ? 1 : 0);
|
|
@@ -33379,7 +33350,7 @@ var totalOf = /* @__PURE__ */ __name((count4, shown, hasMore, exact = true) => {
|
|
|
33379
33350
|
return { value: count4, relation: exact ? "eq" : "gte" };
|
|
33380
33351
|
}, "totalOf");
|
|
33381
33352
|
|
|
33382
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
33353
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/search/lucene/meaning-parts.js
|
|
33383
33354
|
var WORD_FIELDS = /* @__PURE__ */ new Set(["text", "exact"]);
|
|
33384
33355
|
var fieldsOfQuery = /* @__PURE__ */ __name((root, everything) => {
|
|
33385
33356
|
let narrows = false;
|
|
@@ -33408,12 +33379,14 @@ var meaningWords = /* @__PURE__ */ __name((root) => {
|
|
|
33408
33379
|
return wanted(root).join(" ").trim();
|
|
33409
33380
|
}, "meaningWords");
|
|
33410
33381
|
|
|
33411
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
33382
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/search/question-plan.js
|
|
33412
33383
|
var words2 = /* @__PURE__ */ __name((text2) => normalize(text2).match(/[\p{L}\p{N}]+/gu) ?? [], "words");
|
|
33413
33384
|
var scaffolding = new Set(words2("what which how many much who where when is are was were do does did can could should we the a an for of to under from in on at has have \u0441\u043A\u043E\u043B\u044C\u043A\u043E \u043A\u0430\u043A\u043E\u0439 \u043A\u0430\u043A\u0430\u044F \u043A\u0430\u043A\u0438\u0435 \u043A\u0430\u043A\u043E\u0435 \u043A\u0442\u043E \u043A\u043E\u043C\u0443 \u043A\u0435\u043C \u0433\u0434\u0435 \u043A\u043E\u0433\u0434\u0430 \u043A\u0430\u043A \u0447\u0442\u043E \u0432\u043E \u043F\u043E \u043D\u0430 \u0432 \u043A \u0441 \u0443 \u0447\u0435\u0440\u0435\u0437 \u043B\u0438 \u0434\u043E\u043B\u0436\u0435\u043D \u0434\u043E\u043B\u0436\u043D\u0430 \u043D\u0443\u0436\u043D\u043E \u0438\u0434\u0451\u0442 \u0438\u0434\u0435\u0442 \u043C\u043E\u0436\u043D\u043E \u043C\u043E\u0436\u0435\u0442 \u043C\u043E\u0433\u0443\u0442"));
|
|
33414
33385
|
var questionWord = /\b(?:what|which|how|who|where|when|can|could|should)\b|(?:^|\s)(?:сколько|какой|какая|какие|какое|кто|кому|кем|где|когда|как|что|можно|может|могут|ли)(?:\s|$)/iu;
|
|
33415
33386
|
var QUESTION_STARTS = new Set(words2("what which how who whom whose where when why can could should would did do does is are was were will \u0447\u0442\u043E \u043A\u0442\u043E \u043A\u043E\u0433\u043E \u043A\u043E\u043C\u0443 \u043A\u0435\u043C \u0433\u0434\u0435 \u043A\u043E\u0433\u0434\u0430 \u043A\u0430\u043A \u043A\u0430\u043A\u043E\u0439 \u043A\u0430\u043A\u0430\u044F \u043A\u0430\u043A\u043E\u0435 \u043A\u0430\u043A\u0438\u0435 \u043A\u0430\u043A\u0443\u044E \u043A\u0430\u043A\u0438\u043C \u043A\u0430\u043A\u043E\u0433\u043E \u043A\u0430\u043A\u0438\u0445 \u043F\u043E\u0447\u0435\u043C\u0443 \u0437\u0430\u0447\u0435\u043C \u043E\u0442\u043A\u0443\u0434\u0430 \u043A\u0443\u0434\u0430 \u0441\u043A\u043E\u043B\u044C\u043A\u043E \u043B\u0438 \u043C\u043E\u0436\u043D\u043E \u0440\u0430\u0437\u0432\u0435 \u0447\u0435\u0439 \u0447\u044C\u044F \u0447\u044C\u0451 \u0447\u044C\u0438"));
|
|
33416
33387
|
var QUESTION_FILLER = new Set(words2("about any did does why whom whose would will \u044D\u0442\u043E \u043C\u044B \u0432\u044B \u044F \u043E\u043D\u0438 \u043E\u043D \u043E\u043D\u0430 \u043E \u043E\u0431 \u043F\u0440\u043E \u043B\u0438"));
|
|
33388
|
+
var LINKING = new Set(words2("and or but not nor with without this that these those there their they them you your our its his her all any and for into onto over then than also just and \u043F\u0440\u0438 \u0434\u043B\u044F \u0431\u0435\u0437 \u043D\u0430\u0434 \u043F\u043E\u0434 \u0438\u043B\u0438 \u043B\u0438\u0431\u043E \u0435\u0433\u043E \u0435\u0451 \u0438\u0445 \u0432\u0441\u0435 \u0432\u0441\u0451 \u0443\u0436\u0435 \u0435\u0449\u0451 \u0442\u0430\u043A \u0442\u043E\u0436\u0435 \u0442\u0430\u043A\u0436\u0435 \u0431\u044B\u043B \u0431\u044B\u043B\u0430 \u0431\u044B\u043B\u0438 \u0431\u044B\u043B\u043E \u0431\u0443\u0434\u0435\u0442 \u044D\u0442\u043E \u044D\u0442\u0430 \u044D\u0442\u043E\u0442 \u044D\u0442\u0438 \u0442\u0430\u043C \u0442\u0443\u0442"));
|
|
33389
|
+
var isFunctionWord = /* @__PURE__ */ __name((word) => scaffolding.has(word) || QUESTION_STARTS.has(word) || QUESTION_FILLER.has(word) || LINKING.has(word), "isFunctionWord");
|
|
33417
33390
|
function planQuestion(text2, strict = false) {
|
|
33418
33391
|
if (strict)
|
|
33419
33392
|
return {
|
|
@@ -33541,7 +33514,7 @@ var questionLookup = /* @__PURE__ */ __name((text2) => {
|
|
|
33541
33514
|
return terms.length ? anyOfTerms(terms, plan.scope) : void 0;
|
|
33542
33515
|
}, "questionLookup");
|
|
33543
33516
|
|
|
33544
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
33517
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/services/messages-combined.js
|
|
33545
33518
|
var COMBINED_DEFAULTS = { candidateDepth: 300, rrfK: 60, rerank: "all", chatCap: 0 };
|
|
33546
33519
|
var tokensOf = /* @__PURE__ */ __name((text2) => normalize(text2).match(/[\p{L}\p{N}\p{Co}\p{M}]+/gu) ?? [], "tokensOf");
|
|
33547
33520
|
var searchCombined = /* @__PURE__ */ __name(async (store, account, request, messenger = {}, options2 = COMBINED_DEFAULTS) => {
|
|
@@ -33569,6 +33542,13 @@ var searchCombined = /* @__PURE__ */ __name(async (store, account, request, mess
|
|
|
33569
33542
|
const corrections = expanding ? await correctWords(store.searchIndex, [...new Set(eligible.map((leaf) => normalize(leaf.value)))]) : /* @__PURE__ */ new Map();
|
|
33570
33543
|
check2();
|
|
33571
33544
|
const bySpan = new Map(eligible.map((leaf) => [leaf.span.start, leaf]));
|
|
33545
|
+
const widenable = /* @__PURE__ */ __name((node) => node.kind === "predicate" && bySpan.has(node.span.start) && [...normalize(node.value)].length >= 3 && !isFunctionWord(normalize(node.value)), "widenable");
|
|
33546
|
+
const beginning = /* @__PURE__ */ __name((node) => ({
|
|
33547
|
+
...node,
|
|
33548
|
+
operator: "wildcard",
|
|
33549
|
+
value: `${normalize(node.value)}*`,
|
|
33550
|
+
widened: true
|
|
33551
|
+
}), "beginning");
|
|
33572
33552
|
const transform2 = /* @__PURE__ */ __name((node, source, exact2 = false) => {
|
|
33573
33553
|
if (node.kind === "boolean")
|
|
33574
33554
|
return {
|
|
@@ -33579,8 +33559,8 @@ var searchCombined = /* @__PURE__ */ __name(async (store, account, request, mess
|
|
|
33579
33559
|
return { ...node, field: "exact" };
|
|
33580
33560
|
if (!bySpan.has(node.span.start))
|
|
33581
33561
|
return node;
|
|
33582
|
-
if (source === "beginnings" &&
|
|
33583
|
-
return
|
|
33562
|
+
if (source === "beginnings" && widenable(node))
|
|
33563
|
+
return beginning(node);
|
|
33584
33564
|
if (source !== "corrected")
|
|
33585
33565
|
return node;
|
|
33586
33566
|
const fixes = corrections.get(normalize(node.value));
|
|
@@ -33589,7 +33569,7 @@ var searchCombined = /* @__PURE__ */ __name(async (store, account, request, mess
|
|
|
33589
33569
|
const clauses = fixes.map((value) => ({ occur: "should", node: { ...node, field: "exact", value } }));
|
|
33590
33570
|
return { kind: "boolean", clauses, span: node.span };
|
|
33591
33571
|
}, "transform");
|
|
33592
|
-
const
|
|
33572
|
+
const read2 = /* @__PURE__ */ __name(async (root, limit) => {
|
|
33593
33573
|
check2();
|
|
33594
33574
|
const nodes = /* @__PURE__ */ __name((node) => node.kind === "predicate" ? 1 : 1 + node.clauses.reduce((sum2, clause) => sum2 + nodes(clause.node), 0), "nodes");
|
|
33595
33575
|
if (nodes(root) > QUERY_LIMITS.nodes)
|
|
@@ -33599,16 +33579,16 @@ var searchCombined = /* @__PURE__ */ __name(async (store, account, request, mess
|
|
|
33599
33579
|
return found;
|
|
33600
33580
|
}, "read");
|
|
33601
33581
|
if (!expanding) {
|
|
33602
|
-
const found = await
|
|
33582
|
+
const found = await read2(execution.root, request.limit);
|
|
33603
33583
|
return finish(found.items, found.hasMore, [], false, false);
|
|
33604
33584
|
}
|
|
33605
|
-
const exact = await
|
|
33606
|
-
const stemmed = await
|
|
33607
|
-
const prefix = await
|
|
33608
|
-
const fixed = corrections.size ? await
|
|
33585
|
+
const exact = await read2(transform2(execution.root, "words", true), depth);
|
|
33586
|
+
const stemmed = await read2(execution.root, depth);
|
|
33587
|
+
const prefix = await read2(transform2(execution.root, "beginnings"), depth);
|
|
33588
|
+
const fixed = corrections.size ? await read2(transform2(execution.root, "corrected"), depth) : { items: [], hasMore: false };
|
|
33609
33589
|
const fixedPrefixRoot = transform2(execution.root, "corrected");
|
|
33610
|
-
const correctedBeginnings = /* @__PURE__ */ __name((node) => node.kind === "boolean" ? { ...node, clauses: node.clauses.map((clause) => ({ ...clause, node: correctedBeginnings(clause.node) })) } :
|
|
33611
|
-
const fixedPrefix = corrections.size ? await
|
|
33590
|
+
const correctedBeginnings = /* @__PURE__ */ __name((node) => node.kind === "boolean" ? { ...node, clauses: node.clauses.map((clause) => ({ ...clause, node: correctedBeginnings(clause.node) })) } : widenable(node) ? { ...beginning(node), field: "exact" } : node, "correctedBeginnings");
|
|
33591
|
+
const fixedPrefix = corrections.size ? await read2(correctedBeginnings(fixedPrefixRoot), depth) : { items: [], hasMore: false };
|
|
33612
33592
|
const ranked = /* @__PURE__ */ new Map();
|
|
33613
33593
|
const add = /* @__PURE__ */ __name((lists, source) => {
|
|
33614
33594
|
const shares = /* @__PURE__ */ new Map();
|
|
@@ -33735,9 +33715,9 @@ var signals = /* @__PURE__ */ __name((hit, terms, corrections, execution, mode,
|
|
|
33735
33715
|
return mode === "coverage" ? coverage2 * 4 : mode === "proximity" ? proximity : mode === "phrase" ? phrase2 : coverage2 * 4 + proximity + phrase2;
|
|
33736
33716
|
}, "signals");
|
|
33737
33717
|
|
|
33738
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
33718
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/services/messages-discovery.js
|
|
33739
33719
|
var MEANING_DEPTH = 100;
|
|
33740
|
-
var
|
|
33720
|
+
var RRF_K3 = 60;
|
|
33741
33721
|
var RERANK_DEPTH = 50;
|
|
33742
33722
|
var RERANK_WEIGHT = 0.7;
|
|
33743
33723
|
var RERANK_CHUNK = 5;
|
|
@@ -34025,10 +34005,10 @@ var fusedWithMeaning = /* @__PURE__ */ __name((words3, near2, described) => {
|
|
|
34025
34005
|
const merged2 = /* @__PURE__ */ new Map();
|
|
34026
34006
|
const by = /* @__PURE__ */ __name((hit, foundBy) => hit.discovery ? { ...hit, discovery: { ...hit.discovery, foundBy } } : hit, "by");
|
|
34027
34007
|
words3.forEach((hit, rank) => {
|
|
34028
|
-
merged2.set(hit.locator, { hit: by(hit, ["words"]), rrf: 1 / (
|
|
34008
|
+
merged2.set(hit.locator, { hit: by(hit, ["words"]), rrf: 1 / (RRF_K3 + rank + 1) });
|
|
34029
34009
|
});
|
|
34030
34010
|
near2.forEach(({ cosine: _, ...m }, rank) => {
|
|
34031
|
-
const share = 1 / (
|
|
34011
|
+
const share = 1 / (RRF_K3 + rank + 1);
|
|
34032
34012
|
const held = merged2.get(m.locator);
|
|
34033
34013
|
if (held) {
|
|
34034
34014
|
held.rrf += share;
|
|
@@ -34054,14 +34034,14 @@ var scaled = /* @__PURE__ */ __name((values) => {
|
|
|
34054
34034
|
}, "scaled");
|
|
34055
34035
|
var mixedWithReranker = /* @__PURE__ */ __name((head, scores) => {
|
|
34056
34036
|
const fused2 = scaled(head.map((m) => m.score ?? 0));
|
|
34057
|
-
const
|
|
34037
|
+
const read2 = scaled(scores);
|
|
34058
34038
|
return head.map((m, i) => ({
|
|
34059
34039
|
hit: m.discovery ? { ...m, discovery: { ...m.discovery, rerankerScore: scores[i] } } : m,
|
|
34060
|
-
mixed: (1 - RERANK_WEIGHT) * fused2[i] + RERANK_WEIGHT *
|
|
34040
|
+
mixed: (1 - RERANK_WEIGHT) * fused2[i] + RERANK_WEIGHT * read2[i]
|
|
34061
34041
|
})).sort((a, b) => b.mixed - a.mixed).map(({ hit }) => hit);
|
|
34062
34042
|
}, "mixedWithReranker");
|
|
34063
34043
|
|
|
34064
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34044
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/services/thread-context.js
|
|
34065
34045
|
var THREAD_BOUNDS = { maxHops: 8, maxMessages: 50, maxBytes: 65536, withinMs: 864e5 };
|
|
34066
34046
|
var bytes = /* @__PURE__ */ __name((items, links) => Buffer.byteLength(JSON.stringify({ items, links }), "utf8"), "bytes");
|
|
34067
34047
|
var threadBounds = /* @__PURE__ */ __name((options2 = {}) => {
|
|
@@ -34107,7 +34087,7 @@ var readThreadContext = /* @__PURE__ */ __name(async (store, account, chat, mess
|
|
|
34107
34087
|
stopped("aborted");
|
|
34108
34088
|
return result;
|
|
34109
34089
|
}
|
|
34110
|
-
const around = /* @__PURE__ */ __name((id2,
|
|
34090
|
+
const around = /* @__PURE__ */ __name((id2, before = 0, after = 0) => store.messages.around(account, chat, id2, { before, after }).catch((error) => {
|
|
34111
34091
|
if (isCliFailure(error) && error.code === "not_found")
|
|
34112
34092
|
return [];
|
|
34113
34093
|
throw error;
|
|
@@ -34124,12 +34104,12 @@ var readThreadContext = /* @__PURE__ */ __name(async (store, account, chat, mess
|
|
|
34124
34104
|
const wantedBefore = options2.before ?? 5;
|
|
34125
34105
|
const wantedAfter = options2.after ?? 5;
|
|
34126
34106
|
const available = bounds.maxMessages - 1;
|
|
34127
|
-
let
|
|
34128
|
-
const after = Math.min(wantedAfter, available -
|
|
34129
|
-
|
|
34130
|
-
if (anchor &&
|
|
34107
|
+
let before = Math.min(wantedBefore, Math.ceil(available / 2));
|
|
34108
|
+
const after = Math.min(wantedAfter, available - before);
|
|
34109
|
+
before = Math.min(wantedBefore, available - after);
|
|
34110
|
+
if (anchor && before + after < wantedBefore + wantedAfter)
|
|
34131
34111
|
stopped("messages");
|
|
34132
|
-
const neighbours = anchor ? await around(message,
|
|
34112
|
+
const neighbours = anchor ? await around(message, before, after) : [];
|
|
34133
34113
|
const nearest2 = neighbours.sort((a, b) => Number(a.id !== message) - Number(b.id !== message) || Math.abs(Date.parse(a.timestamp) - Date.parse(anchor?.timestamp ?? "")) - Math.abs(Date.parse(b.timestamp) - Date.parse(anchor?.timestamp ?? "")));
|
|
34134
34114
|
for (const item2 of nearest2) {
|
|
34135
34115
|
if (item2.threadId !== anchor?.threadId) {
|
|
@@ -34260,7 +34240,7 @@ var readThreadContext = /* @__PURE__ */ __name(async (store, account, chat, mess
|
|
|
34260
34240
|
return result;
|
|
34261
34241
|
}, "readThreadContext");
|
|
34262
34242
|
|
|
34263
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34243
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/services/messages-archive-search.js
|
|
34264
34244
|
var SEARCH_FILL_MS = 200;
|
|
34265
34245
|
var statsStore = /* @__PURE__ */ __name(async (store, account, request, messenger = {}) => {
|
|
34266
34246
|
const stop = Date.now() + SEARCH_FILL_MS;
|
|
@@ -34329,7 +34309,7 @@ var accountOf2 = /* @__PURE__ */ __name((hit) => {
|
|
|
34329
34309
|
}, "accountOf");
|
|
34330
34310
|
var keyOf4 = /* @__PURE__ */ __name(({ provider, account }) => `${provider}/${account}`, "keyOf");
|
|
34331
34311
|
|
|
34332
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34312
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/services/meaning-model.js
|
|
34333
34313
|
var meaningModel = /* @__PURE__ */ __name(async (store, env = process.env) => {
|
|
34334
34314
|
const chosen = chosenTextModel(env);
|
|
34335
34315
|
if (chosen.from === "chosen" || chosen.id !== DEFAULT_TEXT_MODEL)
|
|
@@ -34339,12 +34319,12 @@ var meaningModel = /* @__PURE__ */ __name(async (store, env = process.env) => {
|
|
|
34339
34319
|
const previous = models.find(({ id: id2 }) => id2 === PREVIOUS_DEFAULT_TEXT_MODEL);
|
|
34340
34320
|
if (!current || !previous || !isTextModelInstalled(previous, textModelsDirectory(env)))
|
|
34341
34321
|
return chosen.id;
|
|
34342
|
-
const [now,
|
|
34343
|
-
const counts = await store.vectors.vectorCounts([now,
|
|
34344
|
-
return (counts.get(
|
|
34322
|
+
const [now, before] = [vectorModelKey(current), vectorModelKey(previous)];
|
|
34323
|
+
const counts = await store.vectors.vectorCounts([now, before]);
|
|
34324
|
+
return (counts.get(before) ?? 0) > (counts.get(now) ?? 0) ? previous.id : current.id;
|
|
34345
34325
|
}, "meaningModel");
|
|
34346
34326
|
|
|
34347
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34327
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/services/messages-meaning.js
|
|
34348
34328
|
var meaningText = /* @__PURE__ */ __name((question) => {
|
|
34349
34329
|
try {
|
|
34350
34330
|
const text2 = questionLookup(question) === void 0 ? question : questionText(question);
|
|
@@ -34423,7 +34403,7 @@ var meaningLane = /* @__PURE__ */ __name((deps) => async (question, accounts, sh
|
|
|
34423
34403
|
}
|
|
34424
34404
|
}, "meaningLane");
|
|
34425
34405
|
|
|
34426
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34406
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/services/messages-rerank.js
|
|
34427
34407
|
var rerankLane = /* @__PURE__ */ __name((deps) => {
|
|
34428
34408
|
const choice = deps.reranker ?? DEFAULT_RERANK_MODEL;
|
|
34429
34409
|
if (choice === "off")
|
|
@@ -34435,9 +34415,9 @@ var rerankLane = /* @__PURE__ */ __name((deps) => {
|
|
|
34435
34415
|
return { skipped: { reason: `${model.id} is not downloaded`, step: "models.download", model: model.id } };
|
|
34436
34416
|
try {
|
|
34437
34417
|
const warm = deps.embedders;
|
|
34438
|
-
const reranker = warm ? await warm.reranker(`rerank:${model.id}`, async () => (await import("./process-
|
|
34418
|
+
const reranker = warm ? await warm.reranker(`rerank:${model.id}`, async () => (await import("./process-67DAKAAQ.js")).openRerankerProcess(model, directory2, {
|
|
34439
34419
|
threads: defaultThreads()
|
|
34440
|
-
})) : await (await import("./rerank-
|
|
34420
|
+
})) : await (await import("./rerank-X2633CQN.js")).openReranker(model, directory2);
|
|
34441
34421
|
return {
|
|
34442
34422
|
model: model.id,
|
|
34443
34423
|
score: /* @__PURE__ */ __name((question, passages) => reranker.score(plainWords(question), passages), "score"),
|
|
@@ -34457,7 +34437,7 @@ var rerankLane = /* @__PURE__ */ __name((deps) => {
|
|
|
34457
34437
|
};
|
|
34458
34438
|
}, "rerankLane");
|
|
34459
34439
|
|
|
34460
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34440
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/search/question-period.js
|
|
34461
34441
|
var DAY5 = 864e5;
|
|
34462
34442
|
var SPAN = { start: 0, end: 0 };
|
|
34463
34443
|
var phrase = /* @__PURE__ */ __name((source) => new RegExp(`(?<![\\p{L}\\p{N}])(?:${source})(?![\\p{L}\\p{N}])`, "giu"), "phrase");
|
|
@@ -34582,17 +34562,17 @@ var questionPeriod = /* @__PURE__ */ __name((text2, now, zone) => {
|
|
|
34582
34562
|
};
|
|
34583
34563
|
}, "questionPeriod");
|
|
34584
34564
|
|
|
34585
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34565
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/services/document-pictures.js
|
|
34586
34566
|
var openPictureEmbedderFor = /* @__PURE__ */ __name(async ({ env, command } = {}) => {
|
|
34587
34567
|
const model = imageModel(DEFAULT_IMAGE_MODEL);
|
|
34588
34568
|
const directory2 = imageModelsDirectory(env);
|
|
34589
34569
|
if (!isImageModelInstalled(model, directory2))
|
|
34590
34570
|
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 });
|
|
34591
|
-
const { openPictureEmbedder } = await import("./embedder-
|
|
34571
|
+
const { openPictureEmbedder } = await import("./embedder-NHQARKFJ.js");
|
|
34592
34572
|
return openPictureEmbedder(model, directory2);
|
|
34593
34573
|
}, "openPictureEmbedderFor");
|
|
34594
34574
|
|
|
34595
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34575
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/services/document-source.js
|
|
34596
34576
|
var documentSource = /* @__PURE__ */ __name((note, accounts, profiles, file) => {
|
|
34597
34577
|
const metadata = note.frontMatter;
|
|
34598
34578
|
const account = accounts.find(({ id: id2 }) => String(id2) === note.folderId);
|
|
@@ -34603,7 +34583,7 @@ var documentSource = /* @__PURE__ */ __name((note, accounts, profiles, file) =>
|
|
|
34603
34583
|
account: account.account,
|
|
34604
34584
|
...file?.url ? { url: file.url } : {}
|
|
34605
34585
|
};
|
|
34606
|
-
const remote = note.source === "file" && (account !== void 0 &&
|
|
34586
|
+
const remote = note.source === "file" && (account !== void 0 && isDocumentAccountProvider(account.provider) || isDocumentAccountProvider(metadata?.source));
|
|
34607
34587
|
const profile = remote && account ? Object.entries(profiles).flatMap(([command, named2]) => Object.entries(named2).map(([name, key]) => ({ command, name, key }))).find(({ key }) => key.provider === account.provider && key.account === account.account || isFolderProvider(key.provider) && key.account === account.name) : void 0;
|
|
34608
34588
|
const url = file?.url ?? (remote && typeof metadata?.sourceUrl === "string" ? metadata.sourceUrl : void 0);
|
|
34609
34589
|
return {
|
|
@@ -34614,7 +34594,7 @@ var documentSource = /* @__PURE__ */ __name((note, accounts, profiles, file) =>
|
|
|
34614
34594
|
};
|
|
34615
34595
|
}, "documentSource");
|
|
34616
34596
|
|
|
34617
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34597
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/embeddings/keys.js
|
|
34618
34598
|
var endpointKeyName = /* @__PURE__ */ __name((baseUrl) => {
|
|
34619
34599
|
const host = new URL(baseUrl).host;
|
|
34620
34600
|
return ["openai", "anthropic"].includes(host) ? `endpoint:${host}` : host;
|
|
@@ -34647,7 +34627,7 @@ var embeddingKeys = /* @__PURE__ */ __name((app, env = process.env, keyring) =>
|
|
|
34647
34627
|
};
|
|
34648
34628
|
}, "embeddingKeys");
|
|
34649
34629
|
|
|
34650
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34630
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/models/openai.js
|
|
34651
34631
|
var options = strictObject({
|
|
34652
34632
|
temperature: range(0, 2),
|
|
34653
34633
|
top_p: range(0, 1),
|
|
@@ -34714,7 +34694,7 @@ var openai = {
|
|
|
34714
34694
|
}), "complete")
|
|
34715
34695
|
};
|
|
34716
34696
|
|
|
34717
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34697
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/models/index.js
|
|
34718
34698
|
var modelGateway = /* @__PURE__ */ __name((deps) => ({
|
|
34719
34699
|
complete: /* @__PURE__ */ __name(async (request) => {
|
|
34720
34700
|
if (deps.signal?.aborted)
|
|
@@ -34729,7 +34709,7 @@ var modelGateway = /* @__PURE__ */ __name((deps) => ({
|
|
|
34729
34709
|
if (!adapter && target2.provider === "openai")
|
|
34730
34710
|
adapter = openai;
|
|
34731
34711
|
if (!adapter && target2.provider === "anthropic")
|
|
34732
|
-
adapter = (await import("./anthropic-
|
|
34712
|
+
adapter = (await import("./anthropic-UMDO5AKP.js")).anthropic;
|
|
34733
34713
|
if (!adapter)
|
|
34734
34714
|
throw new CliError("validation_error", `no model adapter for ${target2.provider}`);
|
|
34735
34715
|
if (request.images !== void 0 && adapter.images !== true)
|
|
@@ -34789,7 +34769,7 @@ var modelGateway = /* @__PURE__ */ __name((deps) => ({
|
|
|
34789
34769
|
}, "complete")
|
|
34790
34770
|
}), "modelGateway");
|
|
34791
34771
|
|
|
34792
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34772
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/services/enrichment-setting.js
|
|
34793
34773
|
var SECTION2 = "enrichment";
|
|
34794
34774
|
var ENRICHMENT_PROVIDERS = ["openai", "anthropic"];
|
|
34795
34775
|
var DEFAULT_BASE_URLS = {
|
|
@@ -34864,7 +34844,7 @@ var costOf = /* @__PURE__ */ __name((usage, setting) => {
|
|
|
34864
34844
|
return price ? Math.round((usage.input * price.input + usage.output * price.output) * 1e6) / 1e6 : null;
|
|
34865
34845
|
}, "costOf");
|
|
34866
34846
|
|
|
34867
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34847
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/services/enrichment.js
|
|
34868
34848
|
var ENRICH_PER_RUN = 600;
|
|
34869
34849
|
var MAX_LINE = 400;
|
|
34870
34850
|
var line2 = pipe(unknown(), transform((value) => typeof value === "string" ? value.replace(/\s+/g, " ").trim().slice(0, MAX_LINE) : ""));
|
|
@@ -34940,7 +34920,7 @@ var enrichmentState = /* @__PURE__ */ __name(async (store, env, estimateFor, key
|
|
|
34940
34920
|
};
|
|
34941
34921
|
}, "enrichmentState");
|
|
34942
34922
|
|
|
34943
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34923
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/services/notes-title-tier.js
|
|
34944
34924
|
var plainQueryWords = /* @__PURE__ */ __name((query) => {
|
|
34945
34925
|
let root;
|
|
34946
34926
|
try {
|
|
@@ -34967,7 +34947,7 @@ var titleTiers = /* @__PURE__ */ __name((hits, words3) => {
|
|
|
34967
34947
|
return [...hits].sort((a, b) => rank(a) - rank(b));
|
|
34968
34948
|
}, "titleTiers");
|
|
34969
34949
|
|
|
34970
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34950
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/services/notes-search.js
|
|
34971
34951
|
var storeQuery = /* @__PURE__ */ __name(async (store, text2, { exact, timezone } = {}) => resolvedQuery(store, parsedQuery(text2, exact), timezone), "storeQuery");
|
|
34972
34952
|
var parsedQuery = /* @__PURE__ */ __name((text2, exact) => validateFields(parseLucene(text2, { ...SEARCH_QUERY, defaultField: exact ? "exact" : "text" })).root, "parsedQuery");
|
|
34973
34953
|
var resolvedQuery = /* @__PURE__ */ __name(async (store, root, timezone) => {
|
|
@@ -35061,7 +35041,6 @@ var nearestAmong = /* @__PURE__ */ __name(async (store, query, refs, options2) =
|
|
|
35061
35041
|
var MAX_LINE2 = 200;
|
|
35062
35042
|
var MAX_NOTES_OFFSET = 1e3;
|
|
35063
35043
|
var CANDIDATES2 = 50;
|
|
35064
|
-
var RRF_K3 = 60;
|
|
35065
35044
|
var firstLine2 = /* @__PURE__ */ __name((text2, query) => {
|
|
35066
35045
|
const words3 = query.toLowerCase().split(/\s+/).map((word) => word.replace(/^[^\p{L}\p{N}]+|[^\p{L}\p{N}]+$/gu, "")).filter((word) => word.length > 2 && !["and", "or", "not"].includes(word));
|
|
35067
35046
|
const lines3 = text2.split("\n");
|
|
@@ -35270,7 +35249,7 @@ var searchNotes = /* @__PURE__ */ __name(async (store, query, { limit = 20, offs
|
|
|
35270
35249
|
const held = ranked.get(ref) ?? { note, at, score: 0, foundBy: [] };
|
|
35271
35250
|
held.foundBy.push(by);
|
|
35272
35251
|
ranked.set(ref, held);
|
|
35273
|
-
const vote = 1 / (
|
|
35252
|
+
const vote = 1 / (RRF_K + rank + 1);
|
|
35274
35253
|
if (by === "meaning" && lookup !== void 0 && held.foundBy.includes("words"))
|
|
35275
35254
|
held.score = Math.max(held.score, vote);
|
|
35276
35255
|
else
|
|
@@ -35396,7 +35375,7 @@ var searchNotesOf = /* @__PURE__ */ __name(async (store, account, text2, { accou
|
|
|
35396
35375
|
};
|
|
35397
35376
|
}, "searchNotesOf");
|
|
35398
35377
|
|
|
35399
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
35378
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/services/events-search.js
|
|
35400
35379
|
var MAX_EVENTS_OFFSET = 1e3;
|
|
35401
35380
|
var iso3 = /* @__PURE__ */ __name((at) => at === null ? null : new Date(at).toISOString(), "iso");
|
|
35402
35381
|
var accountIdsOf = /* @__PURE__ */ __name(async (store, accounts) => {
|
|
@@ -35492,7 +35471,7 @@ var searchEvents = /* @__PURE__ */ __name(async (store, query, { limit = 20, off
|
|
|
35492
35471
|
const ranked = /* @__PURE__ */ new Map();
|
|
35493
35472
|
const add = /* @__PURE__ */ __name((list2, half) => list2.forEach((hit, rank) => {
|
|
35494
35473
|
const held = ranked.get(keyOf5(hit)) ?? { hit, score: 0, by: [] };
|
|
35495
|
-
held.score += 1 / (
|
|
35474
|
+
held.score += 1 / (RRF_K + rank + 1);
|
|
35496
35475
|
held.by.push(half);
|
|
35497
35476
|
ranked.set(keyOf5(hit), held);
|
|
35498
35477
|
}), "add");
|
|
@@ -35514,7 +35493,7 @@ var searchEvents = /* @__PURE__ */ __name(async (store, query, { limit = 20, off
|
|
|
35514
35493
|
};
|
|
35515
35494
|
}, "searchEvents");
|
|
35516
35495
|
|
|
35517
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
35496
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/services/search-all-business.js
|
|
35518
35497
|
var OWN_BUSINESS = { provider: "business", account: INTERNAL_NOTES };
|
|
35519
35498
|
var BUSINESS_WORDS_ONLY = "invoices, payments, orders, contracts, subscriptions, products and wallets are found by the words of their numbers and names only";
|
|
35520
35499
|
var placeOf = /* @__PURE__ */ __name(({ source, imported }) => source ?? (imported === void 0 ? OWN_BUSINESS : { provider: imported, account: "" }), "placeOf");
|
|
@@ -35544,7 +35523,7 @@ var searchBusiness = /* @__PURE__ */ __name(async (store, { words: words3, anyWo
|
|
|
35544
35523
|
};
|
|
35545
35524
|
}, "searchBusiness");
|
|
35546
35525
|
|
|
35547
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
35526
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/services/meeting-hit-search.js
|
|
35548
35527
|
var resolveMeetingSelection = /* @__PURE__ */ __name(async (store, request) => {
|
|
35549
35528
|
const { project, tag, topic, ...input } = request;
|
|
35550
35529
|
input.signal?.throwIfAborted();
|
|
@@ -35582,7 +35561,7 @@ var resolveMeetingSelection = /* @__PURE__ */ __name(async (store, request) => {
|
|
|
35582
35561
|
return { input, selection };
|
|
35583
35562
|
}, "resolveMeetingSelection");
|
|
35584
35563
|
|
|
35585
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
35564
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/services/search-all-meetings.js
|
|
35586
35565
|
var MOST_HITS_PER_MEETING = 3;
|
|
35587
35566
|
var PAGE_ROWS = 200;
|
|
35588
35567
|
var MOST_PAGES = 25;
|
|
@@ -35643,8 +35622,8 @@ var meetingLane = /* @__PURE__ */ __name(async (store, caller, request) => {
|
|
|
35643
35622
|
const meetings = all.filter((one) => holdsKind(one.provider, "meetings"));
|
|
35644
35623
|
const stored = meetings.filter((one) => scopes.includes(one.scope));
|
|
35645
35624
|
const chosen = request.accounts;
|
|
35646
|
-
const
|
|
35647
|
-
const skipped = (chosen ?? []).filter((key) => !
|
|
35625
|
+
const read2 = chosen ? stored.filter((one) => chosen.some((key) => sameAccount3(key, one))) : stored;
|
|
35626
|
+
const skipped = (chosen ?? []).filter((key) => !read2.some((one) => sameAccount3(key, one))).map(({ provider, account }) => {
|
|
35648
35627
|
const other = meetings.find((one) => sameAccount3({ provider, account }, one));
|
|
35649
35628
|
return {
|
|
35650
35629
|
source: `${provider}:${account}`,
|
|
@@ -35652,7 +35631,7 @@ var meetingLane = /* @__PURE__ */ __name(async (store, caller, request) => {
|
|
|
35652
35631
|
reason: !other ? "no meetings stored for it" : unknownCaller ? "this account is not in the store yet, so no scope is read" : `a ${other.scope} account; this run reads ${scopes.join(" and ")} accounts`
|
|
35653
35632
|
};
|
|
35654
35633
|
});
|
|
35655
|
-
const [first2] =
|
|
35634
|
+
const [first2] = read2;
|
|
35656
35635
|
if (!first2) {
|
|
35657
35636
|
if (!skipped.length && request.asked)
|
|
35658
35637
|
skipped.push({
|
|
@@ -35660,7 +35639,7 @@ var meetingLane = /* @__PURE__ */ __name(async (store, caller, request) => {
|
|
|
35660
35639
|
code: "not_found",
|
|
35661
35640
|
reason: !meetings.length ? "no meeting account stored" : unknownCaller ? "this account is not in the store yet" : "no meeting account in this scope"
|
|
35662
35641
|
});
|
|
35663
|
-
return { items: [], hasMore: false, read, skipped, coverage: [] };
|
|
35642
|
+
return { items: [], hasMore: false, read: read2, skipped, coverage: [] };
|
|
35664
35643
|
}
|
|
35665
35644
|
const lifted = liftMeetingFields(request.text, { accountId: first2.id }, void 0, request.timezone);
|
|
35666
35645
|
const parsed = parseMeetingQuery(lifted.query);
|
|
@@ -35672,7 +35651,7 @@ var meetingLane = /* @__PURE__ */ __name(async (store, caller, request) => {
|
|
|
35672
35651
|
const lists = [];
|
|
35673
35652
|
const coverage2 = [];
|
|
35674
35653
|
const answered = [];
|
|
35675
|
-
for (const account of
|
|
35654
|
+
for (const account of read2) {
|
|
35676
35655
|
try {
|
|
35677
35656
|
const found = await accountHits(store, account, query, { ...input, accountId: account.id }, request);
|
|
35678
35657
|
lists.push(found.ranked);
|
|
@@ -35810,7 +35789,7 @@ var titleItem = /* @__PURE__ */ __name((account, meeting, query) => ({
|
|
|
35810
35789
|
foundBy: ["title"]
|
|
35811
35790
|
}), "titleItem");
|
|
35812
35791
|
|
|
35813
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
35792
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/services/search-harder.js
|
|
35814
35793
|
var SECTION3 = "search_harder";
|
|
35815
35794
|
var HARDER_MODELS = {
|
|
35816
35795
|
anthropic: "claude-haiku-5-5",
|
|
@@ -36056,7 +36035,7 @@ var reorderHarder = /* @__PURE__ */ __name(async (question, hits, { laterPage, a
|
|
|
36056
36035
|
};
|
|
36057
36036
|
}, "reorderHarder");
|
|
36058
36037
|
|
|
36059
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
36038
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/services/search-all.js
|
|
36060
36039
|
var RESOURCES_SEARCHED = ["messages", "mail", "notes", "events", "crm", "business", "meetings"];
|
|
36061
36040
|
var refusal = /* @__PURE__ */ __name((error, text2) => {
|
|
36062
36041
|
const { reason, span } = error.details ?? {};
|
|
@@ -36162,11 +36141,11 @@ var searchAll = /* @__PURE__ */ __name(async (store, account, asked, messenger =
|
|
|
36162
36141
|
if (kind === "messages" && found.coverage)
|
|
36163
36142
|
coverage2 = found.coverage;
|
|
36164
36143
|
hasMore ||= found.hasMore;
|
|
36165
|
-
const
|
|
36144
|
+
const read2 = found.coverage?.accounts ?? given ?? (await store.accounts.accounts()).filter(({ provider }) => holdsKind(provider, kind));
|
|
36166
36145
|
for (const one of found.skipped ?? [])
|
|
36167
36146
|
if (!skipped.some(({ source }) => source === one.source))
|
|
36168
36147
|
skipped.push(one);
|
|
36169
|
-
accounts.push(...
|
|
36148
|
+
accounts.push(...read2.map(({ provider, account: account2 }) => ({ resource: kind, provider, account: account2 })));
|
|
36170
36149
|
const itemOf3 = /* @__PURE__ */ __name((hit, foundBy) => {
|
|
36171
36150
|
const at = parseLocator(hit.locator);
|
|
36172
36151
|
return {
|
|
@@ -36193,7 +36172,7 @@ var searchAll = /* @__PURE__ */ __name(async (store, account, asked, messenger =
|
|
|
36193
36172
|
reason: "the query uses NOT, or a filter under OR or in a group, which meaning cannot follow",
|
|
36194
36173
|
model: chosenTextModel(request.env).id
|
|
36195
36174
|
}
|
|
36196
|
-
} : await meaning(request.text,
|
|
36175
|
+
} : await meaning(request.text, read2, embedders);
|
|
36197
36176
|
if ("skipped" in lane) {
|
|
36198
36177
|
by[kind] = { by: "words", meaningSkipped: lane.skipped };
|
|
36199
36178
|
return byWords;
|
|
@@ -36202,14 +36181,14 @@ var searchAll = /* @__PURE__ */ __name(async (store, account, asked, messenger =
|
|
|
36202
36181
|
const near2 = await nearEligible(store, account, query, messenger, lane.ranked, filters ? { text: filters } : {});
|
|
36203
36182
|
const fused2 = /* @__PURE__ */ new Map();
|
|
36204
36183
|
byWords.forEach((item2, rank) => {
|
|
36205
|
-
fused2.set(item2.ref, { item: item2, score: 1 / (
|
|
36184
|
+
fused2.set(item2.ref, { item: item2, score: 1 / (RRF_K + rank + 1) });
|
|
36206
36185
|
});
|
|
36207
36186
|
near2.forEach((hit, rank) => {
|
|
36208
36187
|
cosines.set(hit.locator, hit.cosine);
|
|
36209
36188
|
const held = fused2.get(hit.locator);
|
|
36210
36189
|
if (held)
|
|
36211
36190
|
held.item.foundBy = ["words", "meaning"];
|
|
36212
|
-
const vote = 1 / (
|
|
36191
|
+
const vote = 1 / (RRF_K + rank + 1);
|
|
36213
36192
|
if (held && discovers)
|
|
36214
36193
|
held.score = Math.max(held.score, vote);
|
|
36215
36194
|
else
|
|
@@ -36252,7 +36231,7 @@ var searchAll = /* @__PURE__ */ __name(async (store, account, asked, messenger =
|
|
|
36252
36231
|
text: hit.excerpt,
|
|
36253
36232
|
foundBy: hit.found_by
|
|
36254
36233
|
})));
|
|
36255
|
-
const
|
|
36234
|
+
const read2 = chosen2 ?? [
|
|
36256
36235
|
...[
|
|
36257
36236
|
INTERNAL_NOTES,
|
|
36258
36237
|
...(await store.notes.folders()).map(({ id: id2 }) => id2),
|
|
@@ -36261,14 +36240,14 @@ var searchAll = /* @__PURE__ */ __name(async (store, account, asked, messenger =
|
|
|
36261
36240
|
].map((account2) => ({ provider: "notes", account: account2 })),
|
|
36262
36241
|
...(await importAccounts(store)).map(({ provider, account: account2 }) => ({ provider, account: account2 }))
|
|
36263
36242
|
];
|
|
36264
|
-
accounts.push(...
|
|
36243
|
+
accounts.push(...read2.map(({ provider, account: account2 }) => ({ resource, provider, account: account2 })));
|
|
36265
36244
|
} else if (resource === "events") {
|
|
36266
|
-
const
|
|
36267
|
-
if (!
|
|
36245
|
+
const read2 = scope?.events ?? await calendarAccounts(store);
|
|
36246
|
+
if (!read2.length)
|
|
36268
36247
|
continue;
|
|
36269
36248
|
const found = await searchEvents(store, request.text, {
|
|
36270
36249
|
limit: depth,
|
|
36271
|
-
accounts:
|
|
36250
|
+
accounts: read2,
|
|
36272
36251
|
embedders,
|
|
36273
36252
|
...command === void 0 ? {} : { command },
|
|
36274
36253
|
...request.env === void 0 ? {} : { env: request.env },
|
|
@@ -36296,7 +36275,7 @@ var searchAll = /* @__PURE__ */ __name(async (store, account, asked, messenger =
|
|
|
36296
36275
|
text: hit.excerpt,
|
|
36297
36276
|
foundBy: hit.found_by
|
|
36298
36277
|
})));
|
|
36299
|
-
accounts.push(...
|
|
36278
|
+
accounts.push(...read2.map(({ provider, account: account2 }) => ({ resource, provider, account: account2 })));
|
|
36300
36279
|
} else if (resource === "crm") {
|
|
36301
36280
|
const { words: words3, anyWord } = titleWords2(request.text);
|
|
36302
36281
|
const chosen2 = scope?.crm;
|
|
@@ -36321,8 +36300,8 @@ var searchAll = /* @__PURE__ */ __name(async (store, account, asked, messenger =
|
|
|
36321
36300
|
foundBy: deal.matched.includes("title") ? ["title"] : ["words"],
|
|
36322
36301
|
...deal.corrections ? { match: "corrected", corrections: deal.corrections } : {}
|
|
36323
36302
|
})));
|
|
36324
|
-
const
|
|
36325
|
-
for (const { provider, account: account2 } of
|
|
36303
|
+
const read2 = chosen2 ?? [...await crmAccounts(store), { provider: "crm", account: INTERNAL_NOTES }];
|
|
36304
|
+
for (const { provider, account: account2 } of read2)
|
|
36326
36305
|
accounts.push({ resource, provider, account: account2 });
|
|
36327
36306
|
} else if (resource === "business") {
|
|
36328
36307
|
const { words: words3, anyWord } = titleWords2(request.text, BUSINESS_WORDS_ONLY);
|
|
@@ -36413,8 +36392,8 @@ var searchAll = /* @__PURE__ */ __name(async (store, account, asked, messenger =
|
|
|
36413
36392
|
...harder === void 0 ? {} : { harder }
|
|
36414
36393
|
};
|
|
36415
36394
|
}, "searchAll");
|
|
36416
|
-
var withMeetingDocuments = /* @__PURE__ */ __name(async (store, lists,
|
|
36417
|
-
if (!
|
|
36395
|
+
var withMeetingDocuments = /* @__PURE__ */ __name(async (store, lists, read2) => {
|
|
36396
|
+
if (!read2.size)
|
|
36418
36397
|
return lists;
|
|
36419
36398
|
const documentOf = /* @__PURE__ */ __name((item2) => item2.kind === "document" && /^document:\d+$/.test(item2.ref) ? Number(item2.ref.slice("document:".length)) : void 0, "documentOf");
|
|
36420
36399
|
const documents = lists.flat().flatMap((item2) => documentOf(item2) ?? []);
|
|
@@ -36431,7 +36410,7 @@ var withMeetingDocuments = /* @__PURE__ */ __name(async (store, lists, read) =>
|
|
|
36431
36410
|
return [item2];
|
|
36432
36411
|
if (owner.role === "transcript" && meetings.has(owner.meetingId))
|
|
36433
36412
|
return [];
|
|
36434
|
-
if (!
|
|
36413
|
+
if (!read2.has(owner.accountId))
|
|
36435
36414
|
return [item2];
|
|
36436
36415
|
return [
|
|
36437
36416
|
{
|
|
@@ -36469,7 +36448,7 @@ var insidePeriodFirst = /* @__PURE__ */ __name((ordered, period) => {
|
|
|
36469
36448
|
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);
|
|
36470
36449
|
}, "insidePeriodFirst");
|
|
36471
36450
|
|
|
36472
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
36451
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/services/server-search.js
|
|
36473
36452
|
var SERVER_SEARCH_KEY = "messages.server-search";
|
|
36474
36453
|
var SERVER_BOUNDS = { timeMs: 5e3, perCall: 100, maxCalls: 3, textBytes: 262144 };
|
|
36475
36454
|
var DEFAULT_BACKEND = "both";
|
|
@@ -36505,13 +36484,13 @@ var serverReads = /* @__PURE__ */ __name((account) => ({
|
|
|
36505
36484
|
leaf: /* @__PURE__ */ __name((node) => {
|
|
36506
36485
|
if (node.field === "text" || node.field === "exact")
|
|
36507
36486
|
return { words: node.value === "" ? [] : [node.value] };
|
|
36508
|
-
const { chat, sender, date
|
|
36487
|
+
const { chat, sender, date } = node.resolution ?? {};
|
|
36509
36488
|
if (chat)
|
|
36510
36489
|
return sameAccount4(chat.account, account) ? { words: [], chat: chat.chatId } : void 0;
|
|
36511
36490
|
if (sender?.provider === account.provider)
|
|
36512
36491
|
return { words: [], from: sender.id };
|
|
36513
|
-
if (
|
|
36514
|
-
const { from, to } = windowOf(
|
|
36492
|
+
if (date) {
|
|
36493
|
+
const { from, to } = windowOf(date);
|
|
36515
36494
|
return {
|
|
36516
36495
|
words: [],
|
|
36517
36496
|
...from === void 0 ? {} : { minDate: from },
|
|
@@ -36660,7 +36639,7 @@ var searchServer = /* @__PURE__ */ __name(async (deps, request) => {
|
|
|
36660
36639
|
return { report, sources };
|
|
36661
36640
|
}, "searchServer");
|
|
36662
36641
|
|
|
36663
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
36642
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/services/messages.js
|
|
36664
36643
|
var DELETE_AT_ONCE = 10;
|
|
36665
36644
|
var filesOf = /* @__PURE__ */ __name(({ attachments }) => {
|
|
36666
36645
|
const files = fileLinks(attachments);
|
|
@@ -36668,7 +36647,7 @@ var filesOf = /* @__PURE__ */ __name(({ attachments }) => {
|
|
|
36668
36647
|
}, "filesOf");
|
|
36669
36648
|
var messagesService = /* @__PURE__ */ __name((deps) => {
|
|
36670
36649
|
const { guard } = deps;
|
|
36671
|
-
const inStore = /* @__PURE__ */ __name(async (
|
|
36650
|
+
const inStore = /* @__PURE__ */ __name(async (read2) => read2(await deps.store(), await deps.account()), "inStore");
|
|
36672
36651
|
const ownTarget = /* @__PURE__ */ __name(async (target2, account) => {
|
|
36673
36652
|
if (account.provider !== deps.messenger.provider)
|
|
36674
36653
|
throw new CliError("validation_error", "that locator belongs to another account; select its profile first");
|
|
@@ -36710,18 +36689,18 @@ var messagesService = /* @__PURE__ */ __name((deps) => {
|
|
|
36710
36689
|
await guardedWrite(guard, { operationId, chatId, kind: "pin", key: pinned ? "messages.pin" : "messages.unpin", messageId: message, notify }, () => act2(chatId, message, { notify, ...duration2 === void 0 ? {} : { duration: duration2 } }));
|
|
36711
36690
|
return { operationId, chatId, messageId: message, pinned };
|
|
36712
36691
|
}, "pinning");
|
|
36713
|
-
const topicPage = /* @__PURE__ */ __name(async (chat, threadId, { limit, before
|
|
36692
|
+
const topicPage = /* @__PURE__ */ __name(async (chat, threadId, { limit, before, beforeTime, after, until }) => {
|
|
36714
36693
|
if (beforeTime !== void 0 || after !== void 0 || until !== void 0)
|
|
36715
36694
|
throw new CliError("validation_error", "a topic is read back from its newest message, or from --before-id");
|
|
36716
36695
|
if (threadId === "1")
|
|
36717
36696
|
throw new CliError("validation_error", "the General topic's messages carry no topic id \u2014 read the whole chat without --topic");
|
|
36718
|
-
const window3 = { limit, ...
|
|
36697
|
+
const window3 = { limit, ...before === void 0 ? {} : { before } };
|
|
36719
36698
|
if (fromStore(deps)) {
|
|
36720
36699
|
return inStore(async (store, account) => store.messages.messages(account, await readChatId(deps, chat, store, account), { ...window3, threadId }));
|
|
36721
36700
|
}
|
|
36722
36701
|
return capability(await deps.connection(), "topicHistory", "read one forum topic")(chat, threadId, window3);
|
|
36723
36702
|
}, "topicPage");
|
|
36724
|
-
const listPage = /* @__PURE__ */ __name(async (chat, { limit, before
|
|
36703
|
+
const listPage = /* @__PURE__ */ __name(async (chat, { limit, before, beforeTime, after, until, threadId: typedThread, starred }) => {
|
|
36725
36704
|
if (starred !== void 0) {
|
|
36726
36705
|
if (!fromStore(deps))
|
|
36727
36706
|
throw new CliError("validation_error", "starred: reads the local store; not while reading from the messenger");
|
|
@@ -36729,17 +36708,17 @@ var messagesService = /* @__PURE__ */ __name((deps) => {
|
|
|
36729
36708
|
throw new CliError("validation_error", "starred: pages back through the whole chat; give only id< with it");
|
|
36730
36709
|
return inStore(async (store, account) => store.messages.messages(account, await readChatId(deps, chat, store, account), {
|
|
36731
36710
|
limit,
|
|
36732
|
-
...
|
|
36711
|
+
...before === void 0 ? {} : { before },
|
|
36733
36712
|
starred
|
|
36734
36713
|
}));
|
|
36735
36714
|
}
|
|
36736
36715
|
const threadId = threadIdOf(typedThread);
|
|
36737
36716
|
if (threadId !== void 0)
|
|
36738
|
-
return topicPage(chat, threadId, { limit, before
|
|
36717
|
+
return topicPage(chat, threadId, { limit, before, beforeTime, after, until });
|
|
36739
36718
|
if (fromStore(deps)) {
|
|
36740
36719
|
const window4 = after ? { limit, after, ...until === void 0 ? {} : { until } } : {
|
|
36741
36720
|
limit,
|
|
36742
|
-
...
|
|
36721
|
+
...before === void 0 ? {} : { before },
|
|
36743
36722
|
// historyBefore reads strictly before its moment; the store's end is inclusive.
|
|
36744
36723
|
...beforeTime === void 0 ? {} : { until: beforeTime - 1 }
|
|
36745
36724
|
};
|
|
@@ -36755,7 +36734,7 @@ var messagesService = /* @__PURE__ */ __name((deps) => {
|
|
|
36755
36734
|
const items = page.items.filter((one) => Date.parse(one.timestamp) <= until);
|
|
36756
36735
|
return { items, hasMore: page.hasMore && items.length === page.items.length };
|
|
36757
36736
|
}
|
|
36758
|
-
const window3 = { limit, ...
|
|
36737
|
+
const window3 = { limit, ...before === void 0 ? {} : { before } };
|
|
36759
36738
|
return capability(connection, "history", "read a chat's history")(chat, window3);
|
|
36760
36739
|
}, "listPage");
|
|
36761
36740
|
return {
|
|
@@ -37100,7 +37079,7 @@ var checkMediaOptions = /* @__PURE__ */ __name((messenger, asked, attachments) =
|
|
|
37100
37079
|
throw new CliError("validation_error", `${MEDIA_FLAGS[first2]} needs a --photo or --file`);
|
|
37101
37080
|
}, "checkMediaOptions");
|
|
37102
37081
|
|
|
37103
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
37082
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/domain/channel-tags.js
|
|
37104
37083
|
var CHANNEL_TAG_RULES_VERSION = "keywords-v1";
|
|
37105
37084
|
var RULES2 = {
|
|
37106
37085
|
ai: [/\b(ai|gpt|llm|machine learning|artificial intelligence)\b/iu, /нейросет|искусственн/iu],
|
|
@@ -37115,7 +37094,7 @@ var classifyChannel = /* @__PURE__ */ __name((metadata) => Object.entries(RULES2
|
|
|
37115
37094
|
return fields.length ? [{ tag, score: fields.length / 3, fields }] : [];
|
|
37116
37095
|
}), "classifyChannel");
|
|
37117
37096
|
|
|
37118
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
37097
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/services/metadata.js
|
|
37119
37098
|
var metadataService = /* @__PURE__ */ __name((deps) => {
|
|
37120
37099
|
const held = /* @__PURE__ */ __name(async (reference, { includeLeft = false } = {}) => {
|
|
37121
37100
|
const store = await deps.store();
|
|
@@ -37130,8 +37109,8 @@ var metadataService = /* @__PURE__ */ __name((deps) => {
|
|
|
37130
37109
|
const found = (await store.chats.chats(account, {})).items.find((chat) => chat.id === chatId);
|
|
37131
37110
|
if (!found || found.kind !== "group" && found.kind !== "channel")
|
|
37132
37111
|
throw new CliError("validation_error", "metadata sync applies to groups and channels");
|
|
37133
|
-
const
|
|
37134
|
-
const card = deps.withConnection ? await deps.withConnection(
|
|
37112
|
+
const read2 = /* @__PURE__ */ __name(async (adapter) => capability(adapter, "group", "read group or channel metadata")(chatId), "read");
|
|
37113
|
+
const card = deps.withConnection ? await deps.withConnection(read2) : await read2(await deps.connection());
|
|
37135
37114
|
return store.chats.saveChatMetadata(account, {
|
|
37136
37115
|
chatId,
|
|
37137
37116
|
title: card.title,
|
|
@@ -37201,7 +37180,7 @@ var metadataService = /* @__PURE__ */ __name((deps) => {
|
|
|
37201
37180
|
};
|
|
37202
37181
|
}, "metadataService");
|
|
37203
37182
|
|
|
37204
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
37183
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/moderation/run.js
|
|
37205
37184
|
var FIRST_LOOK_MS = 24 * 36e5;
|
|
37206
37185
|
var moderateWith = /* @__PURE__ */ __name(async (run2) => {
|
|
37207
37186
|
const { chatId, title, rules, point, since, dryRun } = run2;
|
|
@@ -37238,9 +37217,16 @@ var moderateWith = /* @__PURE__ */ __name(async (run2) => {
|
|
|
37238
37217
|
return { chatId, rows, notes };
|
|
37239
37218
|
}, "moderateWith");
|
|
37240
37219
|
|
|
37241
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
37220
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/services/moderation.js
|
|
37242
37221
|
var moderationService = /* @__PURE__ */ __name((deps) => {
|
|
37243
|
-
const file = /* @__PURE__ */ __name(() =>
|
|
37222
|
+
const file = /* @__PURE__ */ __name(() => {
|
|
37223
|
+
const env = deps.env ?? process.env;
|
|
37224
|
+
if (deps.profile === void 0) {
|
|
37225
|
+
const choices = moderationProfiles(deps.messenger.app, env);
|
|
37226
|
+
throw new CliError("validation_error", `name a profile: moderation rules are kept per profile \u2014 ${choices.length ? `profiles here: ${choices.join(", ")}` : "there is none on this computer yet"}`, { profiles: choices });
|
|
37227
|
+
}
|
|
37228
|
+
return new ModerationRules(moderationPathFor(deps.messenger.app, deps.profile, env));
|
|
37229
|
+
}, "file");
|
|
37244
37230
|
const group = /* @__PURE__ */ __name(async (chat) => {
|
|
37245
37231
|
if (deps.offline)
|
|
37246
37232
|
throw new CliError("validation_error", "a group's rules are kept by its id, which the messenger gives");
|
|
@@ -37316,7 +37302,7 @@ var moderatorOf = /* @__PURE__ */ __name((adapter, deps) => ({
|
|
|
37316
37302
|
}, "removePerson")
|
|
37317
37303
|
}), "moderatorOf");
|
|
37318
37304
|
|
|
37319
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
37305
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/services/private-people.js
|
|
37320
37306
|
var noteItem = /* @__PURE__ */ __name((provider, note) => ({
|
|
37321
37307
|
id: note.id,
|
|
37322
37308
|
contact: formatReference({ type: "contact", provider, id: note.personId }),
|
|
@@ -37360,7 +37346,7 @@ var privatePeopleService = /* @__PURE__ */ __name((deps) => {
|
|
|
37360
37346
|
};
|
|
37361
37347
|
}, "privatePeopleService");
|
|
37362
37348
|
|
|
37363
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
37349
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/services/rankings.js
|
|
37364
37350
|
var empty = /* @__PURE__ */ __name(() => ({
|
|
37365
37351
|
total: 0,
|
|
37366
37352
|
population: 0,
|
|
@@ -37616,7 +37602,7 @@ var rankingsService = /* @__PURE__ */ __name((deps) => ({
|
|
|
37616
37602
|
}, "evidence")
|
|
37617
37603
|
}), "rankingsService");
|
|
37618
37604
|
|
|
37619
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
37605
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/services/reply-stats.js
|
|
37620
37606
|
var FIELDS = ["date", "chat", "kind", "muted"];
|
|
37621
37607
|
var WAITING_TAIL = 100;
|
|
37622
37608
|
var plainOnly = /* @__PURE__ */ __name((text2, command) => {
|
|
@@ -37645,7 +37631,7 @@ var scopeOf3 = /* @__PURE__ */ __name((root, accounts) => {
|
|
|
37645
37631
|
visit(clause.node);
|
|
37646
37632
|
return;
|
|
37647
37633
|
}
|
|
37648
|
-
const { chat, date
|
|
37634
|
+
const { chat, date } = node.resolution ?? {};
|
|
37649
37635
|
if (chat)
|
|
37650
37636
|
scope.chats.push(chat);
|
|
37651
37637
|
else if (node.field === "kind")
|
|
@@ -37657,13 +37643,13 @@ var scopeOf3 = /* @__PURE__ */ __name((root, accounts) => {
|
|
|
37657
37643
|
reason: "query.conflict"
|
|
37658
37644
|
});
|
|
37659
37645
|
scope.muted = muted;
|
|
37660
|
-
} else if (
|
|
37661
|
-
if (
|
|
37662
|
-
const lower =
|
|
37646
|
+
} else if (date) {
|
|
37647
|
+
if (date.lower !== void 0) {
|
|
37648
|
+
const lower = date.lower + (date.lower_inclusive ? 0 : 1);
|
|
37663
37649
|
scope.since = Math.max(scope.since ?? lower, lower);
|
|
37664
37650
|
}
|
|
37665
|
-
if (
|
|
37666
|
-
const upper =
|
|
37651
|
+
if (date.upper !== void 0) {
|
|
37652
|
+
const upper = date.upper - (date.upper_inclusive ? 0 : 1);
|
|
37667
37653
|
scope.until = Math.min(scope.until ?? upper, upper);
|
|
37668
37654
|
}
|
|
37669
37655
|
}
|
|
@@ -37750,7 +37736,7 @@ var replyStatsService = /* @__PURE__ */ __name((deps) => {
|
|
|
37750
37736
|
};
|
|
37751
37737
|
}, "replyStatsService");
|
|
37752
37738
|
|
|
37753
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
37739
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/services/searches.js
|
|
37754
37740
|
var savedSearchItem = /* @__PURE__ */ __name((one) => ({
|
|
37755
37741
|
id: one.id,
|
|
37756
37742
|
name: one.name,
|
|
@@ -37876,7 +37862,7 @@ var searchesService = /* @__PURE__ */ __name((deps) => {
|
|
|
37876
37862
|
};
|
|
37877
37863
|
}, "searchesService");
|
|
37878
37864
|
|
|
37879
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
37865
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/services/tags.js
|
|
37880
37866
|
var TAGGING_QUERY = {
|
|
37881
37867
|
entity: "tagging",
|
|
37882
37868
|
backend: "sql",
|
|
@@ -37950,7 +37936,7 @@ var tagsService = /* @__PURE__ */ __name((deps) => {
|
|
|
37950
37936
|
return { target: viewOf(account, target2), removed, unchanged: tags.filter((tag) => !removed.includes(tag)) };
|
|
37951
37937
|
}), "remove"),
|
|
37952
37938
|
list: /* @__PURE__ */ __name(({ query, limit, offset }) => inStore(async (store, account) => {
|
|
37953
|
-
const where = query ? queryFilter(query, TAGGING_COLUMNS, { command: "tags list" }) : void 0;
|
|
37939
|
+
const where = query ? queryFilter(query, TAGGING_COLUMNS, { command: "tags list", zone: timezoneOf() }) : void 0;
|
|
37954
37940
|
const rows = await store.tags.tags(account, {
|
|
37955
37941
|
...where ? { where } : {},
|
|
37956
37942
|
window: { limit: limit + 1, offset }
|
|
@@ -37960,7 +37946,7 @@ var tagsService = /* @__PURE__ */ __name((deps) => {
|
|
|
37960
37946
|
};
|
|
37961
37947
|
}, "tagsService");
|
|
37962
37948
|
|
|
37963
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
37949
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/services/topics.js
|
|
37964
37950
|
var actionOf = /* @__PURE__ */ __name(({ title, closed, pinned, hidden, icon }) => {
|
|
37965
37951
|
const set = [closed, pinned, hidden].filter((one) => one !== void 0).length;
|
|
37966
37952
|
if (title !== void 0 || icon !== void 0 || set !== 1)
|
|
@@ -38159,10 +38145,10 @@ var topicsService = /* @__PURE__ */ __name((deps) => {
|
|
|
38159
38145
|
};
|
|
38160
38146
|
}, "topicsService");
|
|
38161
38147
|
|
|
38162
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
38148
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/crm/sync.js
|
|
38163
38149
|
var CLOCK_MARGIN = 60 * 6e4;
|
|
38164
38150
|
|
|
38165
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
38151
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/crm/writer.js
|
|
38166
38152
|
var CRM_ASSIGN_OTHERS_KEY = "crm.assign-others";
|
|
38167
38153
|
var CRM_WRITE_DEFAULTS = {
|
|
38168
38154
|
"deals.delete": "ask",
|
|
@@ -38170,7 +38156,7 @@ var CRM_WRITE_DEFAULTS = {
|
|
|
38170
38156
|
[CRM_ASSIGN_OTHERS_KEY]: "deny"
|
|
38171
38157
|
};
|
|
38172
38158
|
|
|
38173
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
38159
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/services/evidence.js
|
|
38174
38160
|
import { createHash as createHash11, randomUUID as randomUUID6 } from "node:crypto";
|
|
38175
38161
|
var hash2 = /* @__PURE__ */ __name((value) => createHash11("sha256").update(JSON.stringify(value)).digest("hex"), "hash");
|
|
38176
38162
|
var positive2 = /* @__PURE__ */ __name((value, name, minimum = 1) => {
|
|
@@ -38244,14 +38230,14 @@ var prepareEvidencePacket = /* @__PURE__ */ __name(({ kind, source, page, limits
|
|
|
38244
38230
|
return { ...content, id: randomUUID6(), fingerprint: hash2(content) };
|
|
38245
38231
|
}, "prepareEvidencePacket");
|
|
38246
38232
|
|
|
38247
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
38248
|
-
var readEvidencePacket = /* @__PURE__ */ __name(async (store, account, { chat, limit, before
|
|
38233
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/services/evidence-read.js
|
|
38234
|
+
var readEvidencePacket = /* @__PURE__ */ __name(async (store, account, { chat, limit, before }, messenger = {}) => {
|
|
38249
38235
|
if (!Number.isSafeInteger(limit) || limit < 1 || limit > 100)
|
|
38250
38236
|
throw new CliError("validation_error", "evidence message limit must be an integer from 1 to 100");
|
|
38251
|
-
if (
|
|
38237
|
+
if (before !== void 0 && !before.trim())
|
|
38252
38238
|
throw new CliError("validation_error", "evidence before id must not be empty");
|
|
38253
38239
|
const chatId = await storedChatId(messenger, chat, store, account, { includeLeft: true });
|
|
38254
|
-
const page = await store.messages.messages(account, chatId, { limit, ...
|
|
38240
|
+
const page = await store.messages.messages(account, chatId, { limit, ...before === void 0 ? {} : { before } });
|
|
38255
38241
|
const items = page.items.toReversed();
|
|
38256
38242
|
const packet = prepareEvidencePacket({
|
|
38257
38243
|
kind: "chats",
|
|
@@ -38264,7 +38250,7 @@ var readEvidencePacket = /* @__PURE__ */ __name(async (store, account, { chat, l
|
|
|
38264
38250
|
return { ...packet, nextBeforeId: older && last ? last.id : null };
|
|
38265
38251
|
}, "readEvidencePacket");
|
|
38266
38252
|
|
|
38267
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
38253
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/services/meeting-project-discovery.js
|
|
38268
38254
|
var scopeKeys = [
|
|
38269
38255
|
"accountId",
|
|
38270
38256
|
"meetingId",
|
|
@@ -38286,7 +38272,7 @@ var optionKeys = /* @__PURE__ */ new Set([
|
|
|
38286
38272
|
"maxVocabularyReadBytes"
|
|
38287
38273
|
]);
|
|
38288
38274
|
|
|
38289
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
38275
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/services/text-model-choice.js
|
|
38290
38276
|
import { createHash as createHash12 } from "node:crypto";
|
|
38291
38277
|
import { existsSync as existsSync2 } from "node:fs";
|
|
38292
38278
|
var useTextModel = /* @__PURE__ */ __name(async (id2, { env, command }) => {
|
|
@@ -38294,8 +38280,8 @@ var useTextModel = /* @__PURE__ */ __name(async (id2, { env, command }) => {
|
|
|
38294
38280
|
if (!isTextModelInstalled(model, textModelsDirectory(env)))
|
|
38295
38281
|
throw new CliError("not_found", `${model.id} is not downloaded \u2014 \`${command} models download ${model.id}\` first`, { reason: "model.not-downloaded", model: model.id });
|
|
38296
38282
|
const previous = chosenTextModel(env).id;
|
|
38297
|
-
const
|
|
38298
|
-
const toEmbed = previous === model.id ? 0 :
|
|
38283
|
+
const before = textModels(env).find((one) => one.id === previous);
|
|
38284
|
+
const toEmbed = previous === model.id ? 0 : before ? await missingVectors(before, model, env) : null;
|
|
38299
38285
|
writeTextModelsSection({ ...readTextModelsSection(env), use: model.id }, env);
|
|
38300
38286
|
return {
|
|
38301
38287
|
model,
|
|
@@ -38417,14 +38403,14 @@ var addCustomTextModel = /* @__PURE__ */ __name(async (id2, payload, { env, fetc
|
|
|
38417
38403
|
return { ...checked2.output, custom: true };
|
|
38418
38404
|
}, "addCustomTextModel");
|
|
38419
38405
|
|
|
38420
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
38406
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/calendar/sync.js
|
|
38421
38407
|
var DAY6 = 864e5;
|
|
38422
38408
|
var SLOTS_EVERY = 7 * DAY6;
|
|
38423
38409
|
|
|
38424
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
38410
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/calendar/feeds.js
|
|
38425
38411
|
var FEED_LIMITS = { maxBytes: 10 * 1024 * 1024, timeoutMs: 3e4, redirects: 5 };
|
|
38426
38412
|
|
|
38427
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
38413
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/calendar/reads.js
|
|
38428
38414
|
var LIST = "events list";
|
|
38429
38415
|
var EVENT_TYPES = [
|
|
38430
38416
|
"default",
|
|
@@ -38483,7 +38469,7 @@ var EVENTS_QUERY = {
|
|
|
38483
38469
|
} : field)
|
|
38484
38470
|
};
|
|
38485
38471
|
|
|
38486
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
38472
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/calendar/writer.js
|
|
38487
38473
|
var EVENTS_NOTIFY_KEY = "events.notify";
|
|
38488
38474
|
var EVENTS_DELETE_SERIES_KEY = "events.delete.series";
|
|
38489
38475
|
var EVENTS_REMIND_HOOK_KEY = "events.remind.hook";
|
|
@@ -38501,7 +38487,7 @@ var CALENDAR_WRITE_DEFAULTS = {
|
|
|
38501
38487
|
[EVENTS_REMIND_HOOK_KEY]: "deny"
|
|
38502
38488
|
};
|
|
38503
38489
|
|
|
38504
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
38490
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/context/communication-selection.js
|
|
38505
38491
|
var communicationFields = {
|
|
38506
38492
|
sources: pipe(array(strictObject({
|
|
38507
38493
|
id: pipe(string(), regex(/^[A-Za-z0-9][A-Za-z0-9._-]{0,127}$/)),
|
|
@@ -38524,16 +38510,16 @@ var communicationRequest = /* @__PURE__ */ __name((value, preparationAfter) => {
|
|
|
38524
38510
|
const words3 = input.query.match(/[\p{L}\p{N}]+/gu) ?? [];
|
|
38525
38511
|
if (Buffer.byteLength(input.query) > 2048 || !words3.length || words3.length > 16)
|
|
38526
38512
|
throw new CliError("validation_error", "communications.query needs 1\u201316 literal words within 2048 UTF-8 bytes");
|
|
38527
|
-
const
|
|
38528
|
-
const after = input.after ?? Math.max(0,
|
|
38529
|
-
if (
|
|
38513
|
+
const before = input.before ?? preparationAfter;
|
|
38514
|
+
const after = input.after ?? Math.max(0, before - 14 * 864e5);
|
|
38515
|
+
if (before > preparationAfter || after >= before || before - after > 90 * 864e5)
|
|
38530
38516
|
throw new CliError("validation_error", "communications window must be nonempty, span at most 90 days and end by preparation after");
|
|
38531
38517
|
if (new Set(input.sources.map((s) => s.id)).size !== input.sources.length)
|
|
38532
38518
|
throw new CliError("validation_error", "communications.sources must not repeat a selection");
|
|
38533
|
-
return { ...input, after, before
|
|
38519
|
+
return { ...input, after, before };
|
|
38534
38520
|
}, "communicationRequest");
|
|
38535
38521
|
|
|
38536
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
38522
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/services/meeting-preparation-validation.js
|
|
38537
38523
|
var MEETING_PREPARATION_LIMITS = {
|
|
38538
38524
|
meetings: { min: 1, max: 20, default: 5 },
|
|
38539
38525
|
cues: { min: 1, max: 100, default: 10 },
|
|
@@ -38606,7 +38592,7 @@ var validateMeetingPreparationRequest = /* @__PURE__ */ __name((externalId, orig
|
|
|
38606
38592
|
};
|
|
38607
38593
|
}, "validateMeetingPreparationRequest");
|
|
38608
38594
|
|
|
38609
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
38595
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/services/meeting-communications-selection.js
|
|
38610
38596
|
var validatePreparationCommunications = /* @__PURE__ */ __name((section, request, after) => {
|
|
38611
38597
|
const fail2 = /* @__PURE__ */ __name(() => {
|
|
38612
38598
|
throw new CliError("invalid_response", "Preparation communications returned another selection or invalid evidence");
|
|
@@ -38654,7 +38640,7 @@ var validatePreparationCommunications = /* @__PURE__ */ __name((section, request
|
|
|
38654
38640
|
}
|
|
38655
38641
|
}, "validatePreparationCommunications");
|
|
38656
38642
|
|
|
38657
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
38643
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/services/package-upgrade.js
|
|
38658
38644
|
var upgradePackage = /* @__PURE__ */ __name(async ({ current, command, packageName, check: check2 }, ports) => {
|
|
38659
38645
|
const installer = ports.installer();
|
|
38660
38646
|
const argv = updateCommand(installer, packageName);
|
|
@@ -38686,9 +38672,9 @@ var upgradePackage = /* @__PURE__ */ __name(async ({ current, command, packageNa
|
|
|
38686
38672
|
const installed = await ports.installed?.();
|
|
38687
38673
|
if (installed === void 0)
|
|
38688
38674
|
return restart(result, ports);
|
|
38689
|
-
const
|
|
38675
|
+
const read2 = { ...result, installed };
|
|
38690
38676
|
if (!isNewer(latest2, installed))
|
|
38691
|
-
return restart(
|
|
38677
|
+
return restart(read2, ports);
|
|
38692
38678
|
const heldBack = {
|
|
38693
38679
|
// pnpm 11 resolves `@latest` to the newest version older than minimumReleaseAge, 1 day by default.
|
|
38694
38680
|
until: installer === "pnpm" ? dayAfter(await ports.publishedAt?.(latest2)) : null,
|
|
@@ -38696,8 +38682,8 @@ var upgradePackage = /* @__PURE__ */ __name(async ({ current, command, packageNa
|
|
|
38696
38682
|
command: argv.map((word) => word === `${packageName}@latest` ? `${packageName}@${latest2}` : word).join(" ")
|
|
38697
38683
|
};
|
|
38698
38684
|
if (installed === current)
|
|
38699
|
-
return { result: { ...
|
|
38700
|
-
return { ...await restart({ ...
|
|
38685
|
+
return { result: { ...read2, heldBack }, reason: "held_back", left: [] };
|
|
38686
|
+
return { ...await restart({ ...read2, heldBack }, ports), reason: "held_back" };
|
|
38701
38687
|
}, "upgradePackage");
|
|
38702
38688
|
var restart = /* @__PURE__ */ __name(async (result, ports) => {
|
|
38703
38689
|
const servers = await ports.afterUpdate?.();
|
|
@@ -38719,7 +38705,7 @@ var dayAfter = /* @__PURE__ */ __name((published) => {
|
|
|
38719
38705
|
return Number.isNaN(time) ? null : new Date(time + 24 * 60 * 60 * 1e3).toISOString();
|
|
38720
38706
|
}, "dayAfter");
|
|
38721
38707
|
|
|
38722
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
38708
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/services/index.js
|
|
38723
38709
|
var servicesFor = /* @__PURE__ */ __name((deps) => {
|
|
38724
38710
|
const pictures = picturesService(deps);
|
|
38725
38711
|
const base = {
|
|
@@ -38756,7 +38742,7 @@ var servicesFor = /* @__PURE__ */ __name((deps) => {
|
|
|
38756
38742
|
return deps.messenger.services ? { ...base, ...deps.messenger.services(base, deps) } : base;
|
|
38757
38743
|
}, "servicesFor");
|
|
38758
38744
|
|
|
38759
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
38745
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/background/relay.js
|
|
38760
38746
|
import { createHash as createHash13 } from "node:crypto";
|
|
38761
38747
|
import { chmodSync, lstatSync, mkdirSync as mkdirSync6, rmSync as rmSync3 } from "node:fs";
|
|
38762
38748
|
import { createConnection, createServer } from "node:net";
|
|
@@ -38977,7 +38963,7 @@ var relayCommand = /* @__PURE__ */ __name((path, request, options2) => new Promi
|
|
|
38977
38963
|
}, () => finish({ error: stopped() }));
|
|
38978
38964
|
}), "relayCommand");
|
|
38979
38965
|
|
|
38980
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
38966
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.100.0_commander@15.0.0_esbuild@0.28.2_typ_3651938dd4032f987ce713acb104c9b9/node_modules/@wirecat/cli-core/dist/cli/messenger/serve-relay.js
|
|
38981
38967
|
var lentConnection = /* @__PURE__ */ __name((connection, watchers) => throughWrapper(connection, {
|
|
38982
38968
|
close: /* @__PURE__ */ __name(async () => {
|
|
38983
38969
|
}, "close"),
|
|
@@ -39107,7 +39093,8 @@ export {
|
|
|
39107
39093
|
BUILT_IN_PURPOSES,
|
|
39108
39094
|
purposeList,
|
|
39109
39095
|
gatherStoredProject,
|
|
39110
|
-
|
|
39096
|
+
momentOf,
|
|
39097
|
+
dateWindow,
|
|
39111
39098
|
checkMediaArchive,
|
|
39112
39099
|
archiveMedia,
|
|
39113
39100
|
moveMediaArchive,
|
|
@@ -39119,9 +39106,6 @@ export {
|
|
|
39119
39106
|
sendTime,
|
|
39120
39107
|
readMail,
|
|
39121
39108
|
prepareLucene,
|
|
39122
|
-
momentOf,
|
|
39123
|
-
aheadOf,
|
|
39124
|
-
dateWindow,
|
|
39125
39109
|
RANKING_SELECTION_BYTES,
|
|
39126
39110
|
readRankingSelection,
|
|
39127
39111
|
isAdminSelection,
|
|
@@ -39273,8 +39257,10 @@ export {
|
|
|
39273
39257
|
lentConnection,
|
|
39274
39258
|
serveRelay,
|
|
39275
39259
|
positiveCount,
|
|
39260
|
+
configuredLimit,
|
|
39276
39261
|
withPaging,
|
|
39277
39262
|
window,
|
|
39263
|
+
pagingOf,
|
|
39278
39264
|
chatRef,
|
|
39279
39265
|
chatAnswer,
|
|
39280
39266
|
memberAnswer,
|