@wirecat/tg-cli 0.120.0 → 0.121.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/contracts/wirecat.json +25 -3
- package/dist/bin/tg.js +2 -2
- package/dist/bundle/{adapter-OJKHXGBC.js → adapter-GVSBFSBY.js} +53 -49
- package/dist/bundle/{all-profiles-URIWNL23.js → all-profiles-CTOGU4XR.js} +6 -6
- package/dist/bundle/{anthropic-YUKNB63B.js → anthropic-7472H6ES.js} +13 -4
- package/dist/bundle/{app-server-H5QNHGH4.js → app-server-GZWV4NPR.js} +43 -42
- package/dist/bundle/{bot-api-27GN4Y3D.js → bot-api-PPVAKICN.js} +47 -44
- package/dist/bundle/{bot-history-VVSWLVZM.js → bot-history-7YY7MCR4.js} +12 -12
- package/dist/bundle/{bun-PAAJX3GU.js → bun-KCN62RMD.js} +2 -2
- package/dist/bundle/{bun-sqlite-TPEBWFZH.js → bun-sqlite-2BNE56MY.js} +2 -2
- package/dist/bundle/{chunk-FPWXG53C.js → chunk-24DWSW6H.js} +35 -120
- package/dist/bundle/{chunk-DDKFAUQD.js → chunk-3E35VJME.js} +1 -1
- package/dist/bundle/{chunk-KP26Y5OA.js → chunk-3EGVR7OF.js} +4883 -4825
- package/dist/bundle/{chunk-CYWV2RLN.js → chunk-3HNI6GI7.js} +4 -4
- package/dist/bundle/{chunk-U2TPRUWK.js → chunk-4HJCWFPN.js} +81 -81
- package/dist/bundle/{chunk-KW6JZGG3.js → chunk-4J34T6IQ.js} +1 -1
- package/dist/bundle/{chunk-MMPISXSU.js → chunk-54KFRAHF.js} +1 -1
- package/dist/bundle/{chunk-ZRRZTPSB.js → chunk-5P43K3GL.js} +1418 -742
- package/dist/bundle/{chunk-3GLLWDM6.js → chunk-6LRKWXCS.js} +16 -16
- package/dist/bundle/{chunk-3FPFRDG2.js → chunk-6SQAE7NM.js} +6 -6
- package/dist/bundle/{chunk-WLBPNLDF.js → chunk-7MXRFFIT.js} +2 -2
- package/dist/bundle/{chunk-KRCMKFUV.js → chunk-7UIMMQOV.js} +1 -1
- package/dist/bundle/{chunk-DH7VKHTZ.js → chunk-AYDLA27G.js} +3 -3
- package/dist/bundle/{chunk-7N4IUEX3.js → chunk-BJTJBNR7.js} +6 -6
- package/dist/bundle/{chunk-JJY3TQTM.js → chunk-CLMRF6XR.js} +2 -2
- package/dist/bundle/{chunk-JQLGS3SG.js → chunk-CMEWPXKU.js} +1 -1
- package/dist/bundle/{chunk-THJHYMFR.js → chunk-CPDYPZIG.js} +3599 -3595
- package/dist/bundle/{chunk-WQ55F4Y3.js → chunk-DAK2J3FG.js} +7 -7
- package/dist/bundle/{chunk-YDROJG2Y.js → chunk-DG44ORQ3.js} +4 -4
- package/dist/bundle/{chunk-D2WNQJUQ.js → chunk-ESLV57MC.js} +1 -1
- package/dist/bundle/{chunk-CLTMVPGT.js → chunk-FERGNQYA.js} +12 -12
- package/dist/bundle/{chunk-KTV5Y5EX.js → chunk-GB55EDOF.js} +1 -1
- package/dist/bundle/chunk-GNGYV5NX.js +116 -0
- package/dist/bundle/{chunk-4OWY7QBE.js → chunk-KKD5ZPGD.js} +5 -5
- package/dist/bundle/{chunk-4JATS2J5.js → chunk-KPAUPIC3.js} +2 -2
- package/dist/bundle/chunk-KVW7LCZK.js +109 -0
- package/dist/bundle/{chunk-LLCGOZ44.js → chunk-LTAHG7BO.js} +2 -2
- package/dist/bundle/{chunk-DE7QIEUP.js → chunk-M47CXY5J.js} +30 -49
- package/dist/bundle/{chunk-DQTQO6PB.js → chunk-M73VM67N.js} +1209 -851
- package/dist/bundle/{chunk-6XHZV7AQ.js → chunk-MAPJUOTD.js} +3 -3
- package/dist/bundle/{chunk-S6OC367D.js → chunk-MKAKM3V7.js} +2 -2
- package/dist/bundle/{chunk-LS72R7DN.js → chunk-NR7PGYPO.js} +37 -35
- package/dist/bundle/chunk-PLBEUSZP.js +18 -0
- package/dist/bundle/{chunk-B7B65ZLU.js → chunk-QMNUQTA2.js} +1 -1
- package/dist/bundle/{chunk-3SANNNWS.js → chunk-QNNUNGPL.js} +2 -2
- package/dist/bundle/{chunk-YQKEPT22.js → chunk-QQ264PXQ.js} +1 -1
- package/dist/bundle/{chunk-JSEIT2WO.js → chunk-R6KXHBMW.js} +1 -1
- package/dist/bundle/{chunk-YBOVL25O.js → chunk-RPBO5XL3.js} +16 -16
- package/dist/bundle/{chunk-VUUR2SRS.js → chunk-RZX7RDXY.js} +33 -16
- package/dist/bundle/{chunk-7VNV426X.js → chunk-S7P5X23R.js} +26 -22
- package/dist/bundle/{chunk-HDSKBXAF.js → chunk-SHIHW2YN.js} +2 -2
- package/dist/bundle/{chunk-7WS3ULOO.js → chunk-SQWTUENZ.js} +1155 -800
- package/dist/bundle/{chunk-34DSPJNN.js → chunk-T7ONSJAA.js} +2 -2
- package/dist/bundle/{chunk-HIBYYKGO.js → chunk-TEMCXODM.js} +1 -1
- package/dist/bundle/{chunk-MTD6WZKV.js → chunk-VAAZL6OD.js} +6 -6
- package/dist/bundle/{chunk-PDYTNTQI.js → chunk-VPNLTNQD.js} +5 -5
- package/dist/bundle/{chunk-ZON7K5QE.js → chunk-W77WC6ZK.js} +2 -2
- package/dist/bundle/{chunk-KLHOQ6XQ.js → chunk-Y4CSR5RP.js} +3 -1
- package/dist/bundle/{chunk-CGUDXNJE.js → chunk-YMJKHMHX.js} +1 -1
- package/dist/bundle/{chunk-CLURRDNU.js → chunk-YRY752BB.js} +4 -4
- package/dist/bundle/{chunk-H5XC2WYO.js → chunk-ZSW7LN7T.js} +22 -22
- package/dist/bundle/{command-contract-KW6FNOJO.js → command-contract-3W73W27G.js} +12 -12
- package/dist/bundle/command-server-entry-37PKBJ5A.js +146 -0
- package/dist/bundle/{decode-RVWSCZW4.js → decode-F7KC7WT4.js} +2 -2
- package/dist/bundle/{echarts-6VNUD3JF.js → echarts-4VYG66GX.js} +2 -2
- package/dist/bundle/{embed-LWLCQKIK.js → embed-ENZ6R4HF.js} +3 -3
- package/dist/bundle/{embedder-CXKHLRJT.js → embedder-4CBICMFO.js} +6 -6
- package/dist/bundle/{entry-HV4NSX3Z.js → entry-XQ562EDO.js} +7 -4
- package/dist/bundle/{first-run-OPI6NIWQ.js → first-run-PPXOC6ID.js} +5 -5
- package/dist/bundle/{first-screen-BVQLF4LN.js → first-screen-JC6BYZYD.js} +13 -13
- package/dist/bundle/{instructions-TK4HXL3A.js → instructions-XLCMJ5PJ.js} +1 -1
- package/dist/bundle/{node-WFPNBUCU.js → node-SSAC67R5.js} +2 -2
- package/dist/bundle/{node-sqlite-L5BRGJLK.js → node-sqlite-SUUUSYSZ.js} +3 -3
- package/dist/bundle/{oauth-CGVWL35B.js → oauth-2ZNHMPEX.js} +4 -4
- package/dist/bundle/{open-HLL55C5S.js → open-EFNT7V2Q.js} +2 -2
- package/dist/bundle/{openai-YFCNXIJ4.js → openai-7STFVJXA.js} +13 -13
- package/dist/bundle/{process-4A5JP5LO.js → process-63F4PNWH.js} +1 -1
- package/dist/bundle/{program-IFGQGSUF.js → program-C2E3TQNK.js} +63 -60
- package/dist/bundle/{prompt-B5FYE2DQ.js → prompt-QPO7EKD5.js} +2 -2
- package/dist/bundle/{recognize-ZHMHGIV3.js → recognize-MLXEHFYL.js} +1 -1
- package/dist/bundle/{remote-A3W5HE52.js → remote-DO7FLJEF.js} +4 -4
- package/dist/bundle/{rerank-HWJAQOZM.js → rerank-W3WSBDAM.js} +4 -4
- package/dist/bundle/{serve-PP326Q2F.js → serve-Z3TOTEMQ.js} +11 -11
- package/dist/bundle/{server-MV6CL63L.js → server-BYSOJCUA.js} +32 -32
- package/dist/bundle/server-IRUVLXD4.js +61 -0
- package/dist/bundle/{state-Y3RJ7ZXB.js → state-PKRPBCMY.js} +3 -3
- package/dist/bundle/{store-EVNI2MHZ.js → store-Y4G7CNJT.js} +9 -9
- package/dist/bundle/store-maintenance-command-PHK43OSM.js +49 -0
- package/dist/bundle/tg.js +4 -4
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +2 -2
- package/dist/bundle/server-TZGGOJ26.js +0 -60
- package/dist/bundle/store-maintenance-command-XPQE47RE.js +0 -49
|
@@ -8,67 +8,14 @@ import {
|
|
|
8
8
|
sameOrdinaryFile,
|
|
9
9
|
syncDirectory,
|
|
10
10
|
writeFileAtomic
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-FERGNQYA.js";
|
|
12
12
|
import {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
CustomTextModelShape,
|
|
16
|
-
DEFAULT_IMAGE_MODEL,
|
|
17
|
-
DEFAULT_RERANK_MODEL,
|
|
18
|
-
DEFAULT_TEXT_MODEL,
|
|
19
|
-
InvalidArgumentError,
|
|
20
|
-
LEVELS,
|
|
21
|
-
LINK,
|
|
22
|
-
Option,
|
|
23
|
-
PREVIOUS_DEFAULT_TEXT_MODEL,
|
|
24
|
-
WEIGHTS,
|
|
25
|
-
agenda,
|
|
26
|
-
annotate,
|
|
27
|
-
annotateOption,
|
|
28
|
-
attachment,
|
|
29
|
-
chosenTextModel,
|
|
30
|
-
codeOf,
|
|
31
|
-
conversation,
|
|
32
|
-
endpoint,
|
|
33
|
-
environmentOf,
|
|
34
|
-
guardedWrite,
|
|
35
|
-
historyWindow,
|
|
36
|
-
imageModel,
|
|
37
|
-
imageModelsDirectory,
|
|
38
|
-
isImageModelInstalled,
|
|
39
|
-
itemOf,
|
|
40
|
-
keyForWrite,
|
|
41
|
-
levelFor,
|
|
42
|
-
listOf,
|
|
43
|
-
meaningFloor,
|
|
44
|
-
nextStep,
|
|
45
|
-
oddName,
|
|
46
|
-
parseDuration,
|
|
47
|
-
placedImage,
|
|
48
|
-
readTextModelsSection,
|
|
49
|
-
renderAnswer,
|
|
50
|
-
rerankModel,
|
|
51
|
-
sentIds,
|
|
52
|
-
sharedCommand,
|
|
53
|
-
skipFlagFor,
|
|
54
|
-
snakeKeys,
|
|
55
|
-
tagging,
|
|
56
|
-
task,
|
|
57
|
-
textModel,
|
|
58
|
-
textModels,
|
|
59
|
-
vectorModelKey,
|
|
60
|
-
writeTextModelsSection
|
|
61
|
-
} from "./chunk-THJHYMFR.js";
|
|
13
|
+
remoteKey
|
|
14
|
+
} from "./chunk-QNNUNGPL.js";
|
|
62
15
|
import {
|
|
63
16
|
isNewer,
|
|
64
17
|
updateCommand
|
|
65
18
|
} from "./chunk-7DPWVKYS.js";
|
|
66
|
-
import {
|
|
67
|
-
MESSENGER_CHANGE_REFUSAL,
|
|
68
|
-
envName,
|
|
69
|
-
readOnlyLockOf,
|
|
70
|
-
readOnlyRefusal
|
|
71
|
-
} from "./chunk-DDKFAUQD.js";
|
|
72
19
|
import {
|
|
73
20
|
AGENDA_COLUMNS,
|
|
74
21
|
BUSINESS_FIND_MAX,
|
|
@@ -99,6 +46,7 @@ import {
|
|
|
99
46
|
calendarKey,
|
|
100
47
|
calendarMoment,
|
|
101
48
|
certaintyOf,
|
|
49
|
+
chatReferenceOf,
|
|
102
50
|
chunkHash,
|
|
103
51
|
chunkTextOf,
|
|
104
52
|
contextEvidenceFingerprint,
|
|
@@ -110,6 +58,7 @@ import {
|
|
|
110
58
|
cutChunks,
|
|
111
59
|
delayStats,
|
|
112
60
|
dueDayOf,
|
|
61
|
+
ensureAccount,
|
|
113
62
|
exhausted,
|
|
114
63
|
fetchedKey,
|
|
115
64
|
googleDocumentLinks,
|
|
@@ -118,6 +67,7 @@ import {
|
|
|
118
67
|
historyStartKey,
|
|
119
68
|
hitFiles,
|
|
120
69
|
inboxKey,
|
|
70
|
+
isId,
|
|
121
71
|
isQueryLimit,
|
|
122
72
|
isStemmed,
|
|
123
73
|
matchDownloads,
|
|
@@ -126,6 +76,8 @@ import {
|
|
|
126
76
|
openStore,
|
|
127
77
|
outOfTime,
|
|
128
78
|
pdfPreviewLimits,
|
|
79
|
+
pickChat,
|
|
80
|
+
pickPerson,
|
|
129
81
|
plainQuery,
|
|
130
82
|
profilesOn,
|
|
131
83
|
queryFilter,
|
|
@@ -137,7 +89,88 @@ import {
|
|
|
137
89
|
validateAst,
|
|
138
90
|
validateFields,
|
|
139
91
|
withoutField
|
|
140
|
-
} from "./chunk-
|
|
92
|
+
} from "./chunk-5P43K3GL.js";
|
|
93
|
+
import {
|
|
94
|
+
DEFAULT_STEMMERS,
|
|
95
|
+
createStemmer,
|
|
96
|
+
fold,
|
|
97
|
+
normalize
|
|
98
|
+
} from "./chunk-DAK2J3FG.js";
|
|
99
|
+
import {
|
|
100
|
+
MAX_MODEL_IMAGE_BYTES,
|
|
101
|
+
checkedOptions,
|
|
102
|
+
messagesFor,
|
|
103
|
+
range,
|
|
104
|
+
systemFor,
|
|
105
|
+
validateImages
|
|
106
|
+
} from "./chunk-MKAKM3V7.js";
|
|
107
|
+
import {
|
|
108
|
+
Unzip,
|
|
109
|
+
UnzipInflate,
|
|
110
|
+
defaultThreads,
|
|
111
|
+
installNativeRuntime,
|
|
112
|
+
isTextModelInstalled,
|
|
113
|
+
openEmbedder,
|
|
114
|
+
placedText,
|
|
115
|
+
runEmbedders,
|
|
116
|
+
textModelsDirectory
|
|
117
|
+
} from "./chunk-KKD5ZPGD.js";
|
|
118
|
+
import {
|
|
119
|
+
CEILING_KEY,
|
|
120
|
+
Command,
|
|
121
|
+
CustomTextModelShape,
|
|
122
|
+
DEFAULT_IMAGE_MODEL,
|
|
123
|
+
DEFAULT_RERANK_MODEL,
|
|
124
|
+
DEFAULT_TEXT_MODEL,
|
|
125
|
+
InvalidArgumentError,
|
|
126
|
+
LEVELS,
|
|
127
|
+
LINK,
|
|
128
|
+
Option,
|
|
129
|
+
PREVIOUS_DEFAULT_TEXT_MODEL,
|
|
130
|
+
WEIGHTS,
|
|
131
|
+
agenda,
|
|
132
|
+
annotate,
|
|
133
|
+
annotateOption,
|
|
134
|
+
attachment,
|
|
135
|
+
chosenTextModel,
|
|
136
|
+
codeOf,
|
|
137
|
+
conversation,
|
|
138
|
+
endpoint,
|
|
139
|
+
environmentOf,
|
|
140
|
+
guardedWrite,
|
|
141
|
+
historyWindow,
|
|
142
|
+
imageModel,
|
|
143
|
+
imageModelsDirectory,
|
|
144
|
+
isImageModelInstalled,
|
|
145
|
+
itemOf,
|
|
146
|
+
keyForWrite,
|
|
147
|
+
levelFor,
|
|
148
|
+
listOf,
|
|
149
|
+
meaningFloor,
|
|
150
|
+
nextStep,
|
|
151
|
+
oddName,
|
|
152
|
+
parseDuration,
|
|
153
|
+
placedImage,
|
|
154
|
+
readTextModelsSection,
|
|
155
|
+
renderAnswer,
|
|
156
|
+
rerankModel,
|
|
157
|
+
sentIds,
|
|
158
|
+
sharedCommand,
|
|
159
|
+
skipFlagFor,
|
|
160
|
+
snakeKeys,
|
|
161
|
+
tagging,
|
|
162
|
+
task,
|
|
163
|
+
textModel,
|
|
164
|
+
textModels,
|
|
165
|
+
vectorModelKey,
|
|
166
|
+
writeTextModelsSection
|
|
167
|
+
} from "./chunk-CPDYPZIG.js";
|
|
168
|
+
import {
|
|
169
|
+
MESSENGER_CHANGE_REFUSAL,
|
|
170
|
+
envName,
|
|
171
|
+
readOnlyLockOf,
|
|
172
|
+
readOnlyRefusal
|
|
173
|
+
} from "./chunk-3E35VJME.js";
|
|
141
174
|
import {
|
|
142
175
|
EVENT_QUERY,
|
|
143
176
|
INTERNAL_NOTES,
|
|
@@ -147,6 +180,7 @@ import {
|
|
|
147
180
|
MEETING_QUERY_GUIDE,
|
|
148
181
|
MeetingError,
|
|
149
182
|
OPERATORS_BY_TYPE,
|
|
183
|
+
READ_BUDGET_EXCEEDED,
|
|
150
184
|
SAVE_HELP,
|
|
151
185
|
TASK_KINDS,
|
|
152
186
|
TASK_STATES,
|
|
@@ -155,6 +189,7 @@ import {
|
|
|
155
189
|
createTaskService,
|
|
156
190
|
currentRun,
|
|
157
191
|
dateRange,
|
|
192
|
+
dayBoundary,
|
|
158
193
|
defineQuery,
|
|
159
194
|
entriesOfList,
|
|
160
195
|
eventItem,
|
|
@@ -182,10 +217,10 @@ import {
|
|
|
182
217
|
isUsable,
|
|
183
218
|
keyOf,
|
|
184
219
|
kindIn,
|
|
220
|
+
liftMeetingFields,
|
|
185
221
|
listed,
|
|
186
222
|
listedHolds,
|
|
187
223
|
logAttributes,
|
|
188
|
-
looksLikeReference,
|
|
189
224
|
meetingCueFingerprint,
|
|
190
225
|
meetingDetailsAnswer,
|
|
191
226
|
meetingHitsList,
|
|
@@ -197,17 +232,17 @@ import {
|
|
|
197
232
|
normalizeTag,
|
|
198
233
|
parseLocator,
|
|
199
234
|
parseLucene,
|
|
235
|
+
parseMeetingQuery,
|
|
200
236
|
parseMeetingReference,
|
|
201
237
|
parseReference,
|
|
202
|
-
providerLabel,
|
|
203
238
|
providerNamed,
|
|
204
239
|
pull,
|
|
205
240
|
queryError,
|
|
206
241
|
queryFieldsOf,
|
|
207
242
|
readMeetingProjectEvidence,
|
|
208
243
|
sameAs,
|
|
209
|
-
sourceOf,
|
|
210
|
-
sourceOf2,
|
|
244
|
+
sourceOf2 as sourceOf,
|
|
245
|
+
sourceOf3 as sourceOf2,
|
|
211
246
|
strongRecordingValidator,
|
|
212
247
|
timezoneOf,
|
|
213
248
|
typedCommand,
|
|
@@ -217,54 +252,26 @@ import {
|
|
|
217
252
|
walkQuery,
|
|
218
253
|
withAttempt,
|
|
219
254
|
zonedMoment
|
|
220
|
-
} from "./chunk-
|
|
255
|
+
} from "./chunk-3EGVR7OF.js";
|
|
221
256
|
import {
|
|
222
257
|
isCliFailure,
|
|
223
258
|
sqliteCode
|
|
224
|
-
} from "./chunk-
|
|
225
|
-
import {
|
|
226
|
-
DEFAULT_STEMMERS,
|
|
227
|
-
createStemmer,
|
|
228
|
-
fold,
|
|
229
|
-
normalize
|
|
230
|
-
} from "./chunk-WQ55F4Y3.js";
|
|
259
|
+
} from "./chunk-7MXRFFIT.js";
|
|
231
260
|
import {
|
|
232
261
|
DEFAULT_TASK_CATEGORIES,
|
|
233
262
|
FALLBACK_CATEGORY,
|
|
234
263
|
readSharedSection,
|
|
235
264
|
sharedConfigPath,
|
|
236
265
|
writeSharedSection
|
|
237
|
-
} from "./chunk-
|
|
238
|
-
import {
|
|
239
|
-
MAX_MODEL_IMAGE_BYTES,
|
|
240
|
-
checkedOptions,
|
|
241
|
-
messagesFor,
|
|
242
|
-
range,
|
|
243
|
-
systemFor,
|
|
244
|
-
validateImages
|
|
245
|
-
} from "./chunk-S6OC367D.js";
|
|
246
|
-
import {
|
|
247
|
-
remoteKey
|
|
248
|
-
} from "./chunk-3SANNNWS.js";
|
|
249
|
-
import {
|
|
250
|
-
Unzip,
|
|
251
|
-
UnzipInflate,
|
|
252
|
-
defaultThreads,
|
|
253
|
-
installNativeRuntime,
|
|
254
|
-
isTextModelInstalled,
|
|
255
|
-
openEmbedder,
|
|
256
|
-
placedText,
|
|
257
|
-
runEmbedders,
|
|
258
|
-
textModelsDirectory
|
|
259
|
-
} from "./chunk-4OWY7QBE.js";
|
|
266
|
+
} from "./chunk-YRY752BB.js";
|
|
260
267
|
import {
|
|
261
268
|
installFiles,
|
|
262
269
|
megabytes
|
|
263
|
-
} from "./chunk-
|
|
270
|
+
} from "./chunk-AYDLA27G.js";
|
|
264
271
|
import {
|
|
265
272
|
storePath,
|
|
266
273
|
wirecatDirectory
|
|
267
|
-
} from "./chunk-
|
|
274
|
+
} from "./chunk-54KFRAHF.js";
|
|
268
275
|
import {
|
|
269
276
|
Credentials,
|
|
270
277
|
logRecordOf,
|
|
@@ -1648,9 +1655,9 @@ var require_dom = __commonJS({
|
|
|
1648
1655
|
var headNode = doc2.createElement("head");
|
|
1649
1656
|
htmlNode.appendChild(headNode);
|
|
1650
1657
|
if (typeof title === "string") {
|
|
1651
|
-
var
|
|
1652
|
-
|
|
1653
|
-
headNode.appendChild(
|
|
1658
|
+
var titleNode2 = doc2.createElement("title");
|
|
1659
|
+
titleNode2.appendChild(doc2.createTextNode(title));
|
|
1660
|
+
headNode.appendChild(titleNode2);
|
|
1654
1661
|
}
|
|
1655
1662
|
htmlNode.appendChild(doc2.createElement("body"));
|
|
1656
1663
|
}
|
|
@@ -16926,7 +16933,7 @@ var require_lib3 = __commonJS({
|
|
|
16926
16933
|
}
|
|
16927
16934
|
});
|
|
16928
16935
|
|
|
16929
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
16936
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.624.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._325ff8c9daf4b8769887d5253d3c1255/node_modules/@wirecat/cli-core/dist/conversations/link.js
|
|
16930
16937
|
var RULES_VERSION = 5;
|
|
16931
16938
|
var LOOK_BACK = 50;
|
|
16932
16939
|
var SAME_SENDER_WITHIN = 10;
|
|
@@ -17016,15 +17023,15 @@ var latest = /* @__PURE__ */ __name((window3, matches) => {
|
|
|
17016
17023
|
var sameThread = /* @__PURE__ */ __name((a, b) => a.threadId === b.threadId, "sameThread");
|
|
17017
17024
|
var link = /* @__PURE__ */ __name((message, parentId, source, kind, confidence, method) => ({ messageId: message.id, parentId, source, kind, confidence, method }), "link");
|
|
17018
17025
|
|
|
17019
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
17026
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.624.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._325ff8c9daf4b8769887d5253d3c1255/node_modules/@wirecat/cli-core/dist/ports/traits.js
|
|
17020
17027
|
var syncsOneChat = /* @__PURE__ */ __name((messenger) => messenger.history !== "store" || messenger.historyOnDemand === true, "syncsOneChat");
|
|
17021
17028
|
|
|
17022
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
17029
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.624.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._325ff8c9daf4b8769887d5253d3c1255/node_modules/@wirecat/cli-core/dist/sends/send-id.js
|
|
17023
17030
|
import { randomBytes } from "node:crypto";
|
|
17024
17031
|
var newSendId = /* @__PURE__ */ __name(() => randomBytes(8).readBigInt64BE().toString(), "newSendId");
|
|
17025
17032
|
var newOperationId = newSendId;
|
|
17026
17033
|
|
|
17027
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
17034
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.624.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._325ff8c9daf4b8769887d5253d3c1255/node_modules/@wirecat/cli-core/dist/sends/upload.js
|
|
17028
17035
|
import { openAsBlob, realpathSync } from "node:fs";
|
|
17029
17036
|
import { open, stat } from "node:fs/promises";
|
|
17030
17037
|
import { basename, dirname, extname, isAbsolute, relative, resolve, sep } from "node:path";
|
|
@@ -17245,10 +17252,10 @@ var readStickerFile = /* @__PURE__ */ __name(async (path, maxBytes, read) => {
|
|
|
17245
17252
|
return { name, source };
|
|
17246
17253
|
}, "readStickerFile");
|
|
17247
17254
|
|
|
17248
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
17255
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.624.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._325ff8c9daf4b8769887d5253d3c1255/node_modules/@wirecat/cli-core/dist/sends/guard.js
|
|
17249
17256
|
import { randomUUID } from "node:crypto";
|
|
17250
17257
|
|
|
17251
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
17258
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.624.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._325ff8c9daf4b8769887d5253d3c1255/node_modules/@wirecat/cli-core/dist/sends/flood.js
|
|
17252
17259
|
import { mkdirSync, readFileSync, renameSync, writeFileSync } from "node:fs";
|
|
17253
17260
|
import { dirname as dirname2, join } from "node:path";
|
|
17254
17261
|
var MOST_DEADLINES = 50;
|
|
@@ -17332,11 +17339,11 @@ var FloodMemory = class {
|
|
|
17332
17339
|
}
|
|
17333
17340
|
};
|
|
17334
17341
|
|
|
17335
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
17342
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.624.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._325ff8c9daf4b8769887d5253d3c1255/node_modules/@wirecat/cli-core/dist/sends/journal.js
|
|
17336
17343
|
import { appendFileSync, mkdirSync as mkdirSync3, readFileSync as readFileSync2 } from "node:fs";
|
|
17337
17344
|
import { dirname as dirname4, join as join2 } from "node:path";
|
|
17338
17345
|
|
|
17339
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
17346
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.624.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._325ff8c9daf4b8769887d5253d3c1255/node_modules/@wirecat/cli-core/dist/sends/file-lock.js
|
|
17340
17347
|
import { closeSync, mkdirSync as mkdirSync2, openSync, statSync, unlinkSync } from "node:fs";
|
|
17341
17348
|
import { dirname as dirname3 } from "node:path";
|
|
17342
17349
|
var LOCK_WAIT_MS = 5e3;
|
|
@@ -17403,7 +17410,7 @@ var lockTime = /* @__PURE__ */ __name((lock) => {
|
|
|
17403
17410
|
}
|
|
17404
17411
|
}, "lockTime");
|
|
17405
17412
|
|
|
17406
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
17413
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.624.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._325ff8c9daf4b8769887d5253d3c1255/node_modules/@wirecat/cli-core/dist/sends/journal.js
|
|
17407
17414
|
var sendsPathFor = /* @__PURE__ */ __name((app, profile, env = process.env) => join2(resolvePaths({ appName: app.appName, prefix: app.envPrefix, env }).state, "sends", `${profile}.jsonl`), "sendsPathFor");
|
|
17408
17415
|
var SendJournal = class {
|
|
17409
17416
|
static {
|
|
@@ -17480,7 +17487,7 @@ var withSendId = /* @__PURE__ */ __name((entry) => {
|
|
|
17480
17487
|
return cid === void 0 || rest.sendId !== void 0 ? rest : { ...rest, sendId: String(cid) };
|
|
17481
17488
|
}, "withSendId");
|
|
17482
17489
|
|
|
17483
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
17490
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.624.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._325ff8c9daf4b8769887d5253d3c1255/node_modules/@wirecat/cli-core/dist/sends/recipients.js
|
|
17484
17491
|
import { existsSync, readFileSync as readFileSync3, rmSync } from "node:fs";
|
|
17485
17492
|
import { join as join3 } from "node:path";
|
|
17486
17493
|
var recipientsPathFor = /* @__PURE__ */ __name((app, profile, env = process.env) => join3(resolvePaths({ appName: app.appName, prefix: app.envPrefix, env }).state, "profiles", `${profile}.recipients.json`), "recipientsPathFor");
|
|
@@ -17592,7 +17599,7 @@ var RecipientList = class {
|
|
|
17592
17599
|
}
|
|
17593
17600
|
};
|
|
17594
17601
|
|
|
17595
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
17602
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.624.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._325ff8c9daf4b8769887d5253d3c1255/node_modules/@wirecat/cli-core/dist/sends/guard.js
|
|
17596
17603
|
var HOUR_MS = 60 * 60 * 1e3;
|
|
17597
17604
|
var READS_UNDER_HOLD = /* @__PURE__ */ new Set([
|
|
17598
17605
|
"attachments.extract",
|
|
@@ -17611,7 +17618,7 @@ var weightOf = /* @__PURE__ */ __name(({ kind = "message", action: action2, coun
|
|
|
17611
17618
|
var timeOf = /* @__PURE__ */ __name((entry) => Date.parse(entry.scheduledFor ?? entry.at), "timeOf");
|
|
17612
17619
|
var ceilingRefusal = /* @__PURE__ */ __name((key, command) => new CliError("permission_error", `${key} is not allowed: setup's answer keeps every WireCat tool read-only; the owner changes it at a terminal with \`${command} setup\``, { permission: key }), "ceilingRefusal");
|
|
17613
17620
|
var levelRefusal = /* @__PURE__ */ __name((refused, fix = `${refused.command} ${refused.profile} config set permissions.${refused.key} allow`) => refused.named === CEILING_KEY ? ceilingRefusal(refused.key, refused.command) : new CliError("permission_error", `profile ${refused.profile} does not let ${refused.key} write (permissions.${refused.named} is ${refused.level}, from the ${refused.permissionSources[refused.named ?? ""] ?? "default"}); to allow it: ${fix}`, { permission: refused.key }), "levelRefusal");
|
|
17614
|
-
var sendGuard = /* @__PURE__ */ __name(({ profile, recipients, command = recipients.command, readOnlyLock, permissions, permissionSources = {}, permissionDefaults, permissionFix, ask = refuseToAsk, sendsPerHour, journal, flood, warn, now = /* @__PURE__ */ __name(() => /* @__PURE__ */ new Date(), "now") }) => {
|
|
17621
|
+
var sendGuard = /* @__PURE__ */ __name(({ profile, recipients, command = recipients.command, readOnlyLock, permissions, permissionSources = {}, permissionDefaults, permissionFix, ask: ask2 = refuseToAsk, sendsPerHour, journal, flood, warn, now = /* @__PURE__ */ __name(() => /* @__PURE__ */ new Date(), "now") }) => {
|
|
17615
17622
|
const currentPermissions = /* @__PURE__ */ __name(() => typeof permissions === "function" ? permissions() : permissions, "currentPermissions");
|
|
17616
17623
|
let reservation;
|
|
17617
17624
|
const answered = /* @__PURE__ */ new WeakSet();
|
|
@@ -17731,7 +17738,7 @@ var sendGuard = /* @__PURE__ */ __name(({ profile, recipients, command = recipie
|
|
|
17731
17738
|
if (levelFor(levels, key, permissionDefaults).level !== "ask")
|
|
17732
17739
|
return;
|
|
17733
17740
|
refuseHeld(request);
|
|
17734
|
-
await
|
|
17741
|
+
await ask2(key, request);
|
|
17735
17742
|
answered.add(request);
|
|
17736
17743
|
}, "ask"),
|
|
17737
17744
|
check: /* @__PURE__ */ __name((request, { reserve = true } = {}) => {
|
|
@@ -17769,14 +17776,14 @@ var sendGuard = /* @__PURE__ */ __name(({ profile, recipients, command = recipie
|
|
|
17769
17776
|
var refuseToAsk = /* @__PURE__ */ __name(async (key) => {
|
|
17770
17777
|
throw new CliError("confirmation_required", `${key} asks before it acts (its permission level is ask), and nobody is here to answer \u2014 add ${skipFlagFor(key)} to go ahead`);
|
|
17771
17778
|
}, "refuseToAsk");
|
|
17772
|
-
var guardFor = /* @__PURE__ */ __name((app, settings, warn, env = process.env,
|
|
17779
|
+
var guardFor = /* @__PURE__ */ __name((app, settings, warn, env = process.env, ask2) => sendGuard({
|
|
17773
17780
|
profile: settings.profile,
|
|
17774
17781
|
command: app.command,
|
|
17775
17782
|
...settings.readOnlyLock ? { readOnlyLock: settings.readOnlyLock } : {},
|
|
17776
17783
|
permissions: /* @__PURE__ */ __name(() => settings.permissions, "permissions"),
|
|
17777
17784
|
permissionSources: settings.permissionSources,
|
|
17778
17785
|
...settings.permissionDefaults ? { permissionDefaults: settings.permissionDefaults } : {},
|
|
17779
|
-
...
|
|
17786
|
+
...ask2 ? { ask: ask2 } : {},
|
|
17780
17787
|
sendsPerHour: settings.sendsPerHour,
|
|
17781
17788
|
journal: new SendJournal(sendsPathFor(app, settings.profile, env), { service: app.command, version: app.version }),
|
|
17782
17789
|
recipients: new RecipientList(recipientsPathFor(app, settings.profile, env), app.command),
|
|
@@ -17785,7 +17792,7 @@ var guardFor = /* @__PURE__ */ __name((app, settings, warn, env = process.env, a
|
|
|
17785
17792
|
}), "guardFor");
|
|
17786
17793
|
var journalFailure = /* @__PURE__ */ __name((error) => error?.code ?? (error instanceof Error ? error.name : "error"), "journalFailure");
|
|
17787
17794
|
|
|
17788
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
17795
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.624.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._325ff8c9daf4b8769887d5253d3c1255/node_modules/@wirecat/cli-core/dist/cli/messenger/lacks.js
|
|
17789
17796
|
var COMMAND_NEEDS = {
|
|
17790
17797
|
"account update": ["updateProfile", "change the profile"],
|
|
17791
17798
|
"account sessions list": ["sessions", "list the account's sessions"],
|
|
@@ -17835,7 +17842,7 @@ var hideNever = /* @__PURE__ */ __name((messenger, group) => {
|
|
|
17835
17842
|
return group;
|
|
17836
17843
|
}, "hideNever");
|
|
17837
17844
|
|
|
17838
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
17845
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.624.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._325ff8c9daf4b8769887d5253d3c1255/node_modules/@wirecat/cli-core/dist/services/members-audit.js
|
|
17839
17846
|
var AUDIT_PAGE = 200;
|
|
17840
17847
|
var AUDIT_BUDGET = 10;
|
|
17841
17848
|
var AUDIT_PAUSE_MS = 1e3;
|
|
@@ -17915,7 +17922,7 @@ var burstJoins = /* @__PURE__ */ __name((members) => {
|
|
|
17915
17922
|
return found;
|
|
17916
17923
|
}, "burstJoins");
|
|
17917
17924
|
|
|
17918
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
17925
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.624.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._325ff8c9daf4b8769887d5253d3c1255/node_modules/@wirecat/cli-core/dist/meetings/cli/query-options.js
|
|
17919
17926
|
var queryWordsAfterOptions = /* @__PURE__ */ __name((command) => {
|
|
17920
17927
|
command.allowUnknownOption();
|
|
17921
17928
|
const parse2 = command.parseOptions.bind(command);
|
|
@@ -17935,7 +17942,7 @@ var queryWordsAfterOptions = /* @__PURE__ */ __name((command) => {
|
|
|
17935
17942
|
return command;
|
|
17936
17943
|
}, "queryWordsAfterOptions");
|
|
17937
17944
|
|
|
17938
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
17945
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.624.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._325ff8c9daf4b8769887d5253d3c1255/node_modules/@wirecat/cli-core/dist/meetings/cli/passage.js
|
|
17939
17946
|
var count = /* @__PURE__ */ __name((value) => {
|
|
17940
17947
|
if (!/^(0|[1-9]\d*)$/.test(value) || !Number.isSafeInteger(Number(value)))
|
|
17941
17948
|
throw new CliError("validation_error", "expected a nonnegative safe integer");
|
|
@@ -17977,7 +17984,7 @@ var addMeetingPassageCommandDefinition = /* @__PURE__ */ __name((program, deps)
|
|
|
17977
17984
|
var createMeetingPassageCommand = sharedCommand(createMeetingPassageCommandDefinition);
|
|
17978
17985
|
var addMeetingPassageCommand = sharedCommand(addMeetingPassageCommandDefinition);
|
|
17979
17986
|
|
|
17980
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
17987
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.624.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._325ff8c9daf4b8769887d5253d3c1255/node_modules/@wirecat/cli-core/dist/meetings/cli/project-evidence.js
|
|
17981
17988
|
var integer2 = /* @__PURE__ */ __name((value) => {
|
|
17982
17989
|
if (!/^[1-9]\d*$/.test(value) || !Number.isSafeInteger(Number(value)))
|
|
17983
17990
|
throw new CliError("validation_error", "expected a positive safe integer");
|
|
@@ -18000,7 +18007,7 @@ ${fieldsHelp(MEETING_PROJECT_EVIDENCE_QUERY)}`).option("--limit <n>", "hits in o
|
|
|
18000
18007
|
}, "addMeetingProjectEvidenceCommandDefinition");
|
|
18001
18008
|
var addMeetingProjectEvidenceCommand = sharedCommand(addMeetingProjectEvidenceCommandDefinition);
|
|
18002
18009
|
|
|
18003
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
18010
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.624.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._325ff8c9daf4b8769887d5253d3c1255/node_modules/@wirecat/cli-core/dist/meetings/cli/search.js
|
|
18004
18011
|
var ZONED = /(?:Z|[+-]\d{2}:?\d{2})$/i;
|
|
18005
18012
|
var moment = /* @__PURE__ */ __name((flag, end, readIn) => (value) => {
|
|
18006
18013
|
const zone = timezoneOf();
|
|
@@ -18086,7 +18093,7 @@ var addMeetingSearchCommandDefinition = /* @__PURE__ */ __name((program, deps) =
|
|
|
18086
18093
|
var createMeetingSearchCommand = sharedCommand(createMeetingSearchCommandDefinition);
|
|
18087
18094
|
var addMeetingSearchCommand = sharedCommand(addMeetingSearchCommandDefinition);
|
|
18088
18095
|
|
|
18089
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
18096
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.624.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._325ff8c9daf4b8769887d5253d3c1255/node_modules/@wirecat/cli-core/dist/meetings/cli/index.js
|
|
18090
18097
|
var integer4 = /* @__PURE__ */ __name((text2) => {
|
|
18091
18098
|
if (!/^[1-9]\d*$/.test(text2) || !Number.isSafeInteger(Number(text2)))
|
|
18092
18099
|
throw new InvalidArgumentError("expected a positive integer");
|
|
@@ -18230,7 +18237,7 @@ ${fieldsHelp(EVENT_QUERY, MEETING_QUERY_GUIDE)}`);
|
|
|
18230
18237
|
}, "addMeetingCommandsDefinition");
|
|
18231
18238
|
var addMeetingCommands = sharedCommand(addMeetingCommandsDefinition);
|
|
18232
18239
|
|
|
18233
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
18240
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.624.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._325ff8c9daf4b8769887d5253d3c1255/node_modules/@wirecat/cli-core/dist/cli/list-query.js
|
|
18234
18241
|
var LIST_QUERY_GUIDE = "https://github.com/WireCatLabs/cli-core/blob/main/docs/search/query-language.md";
|
|
18235
18242
|
var QUERY_ARGUMENT = "field:value terms that narrow the list \u2014 the fields are below";
|
|
18236
18243
|
var withQuery = /* @__PURE__ */ __name((command, registry) => {
|
|
@@ -18363,7 +18370,7 @@ var termField = /* @__PURE__ */ __name((name, type, example, more = {}) => nativ
|
|
|
18363
18370
|
var queryHelp = /* @__PURE__ */ __name((registry) => `
|
|
18364
18371
|
${fieldsHelp(registry, LIST_QUERY_GUIDE)}`, "queryHelp");
|
|
18365
18372
|
|
|
18366
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
18373
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.624.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._325ff8c9daf4b8769887d5253d3c1255/node_modules/@wirecat/cli-core/dist/cli/paging.js
|
|
18367
18374
|
var positiveCount = /* @__PURE__ */ __name((flag) => (value) => {
|
|
18368
18375
|
if (!/^\d+$/.test(value.trim()) || Number(value) < 1)
|
|
18369
18376
|
throw new CliError("validation_error", `${flag} takes a whole number from 1 upwards, not "${value}"`);
|
|
@@ -18372,7 +18379,7 @@ var positiveCount = /* @__PURE__ */ __name((flag) => (value) => {
|
|
|
18372
18379
|
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");
|
|
18373
18380
|
var window = /* @__PURE__ */ __name(({ limit, page, all }) => all ? { offset: 0 } : { limit, offset: (page - 1) * limit }, "window");
|
|
18374
18381
|
|
|
18375
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
18382
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.624.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._325ff8c9daf4b8769887d5253d3c1255/node_modules/@wirecat/cli-core/dist/cli/messenger/chat-answers.js
|
|
18376
18383
|
var defined = /* @__PURE__ */ __name((record2) => Object.fromEntries(Object.entries(record2).filter(([, value]) => value !== void 0)), "defined");
|
|
18377
18384
|
var chatRef = /* @__PURE__ */ __name((account, chat) => formatReference({ type: "chat", provider: account.provider, account: account.account, chat }), "chatRef");
|
|
18378
18385
|
var settingsOf = /* @__PURE__ */ __name((settings) => defined({
|
|
@@ -18634,7 +18641,7 @@ var sessionAnswer = /* @__PURE__ */ __name(({ current, client, device, location,
|
|
|
18634
18641
|
...createdAt === void 0 ? {} : { created_at: createdAt }
|
|
18635
18642
|
}), "sessionAnswer");
|
|
18636
18643
|
|
|
18637
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
18644
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.624.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._325ff8c9daf4b8769887d5253d3c1255/node_modules/@wirecat/cli-core/dist/ports/messenger.js
|
|
18638
18645
|
var throughWrapper = /* @__PURE__ */ __name((inner, handled, wrap = (_, call) => call) => new Proxy(handled, {
|
|
18639
18646
|
get: /* @__PURE__ */ __name((own, key) => {
|
|
18640
18647
|
if (key in own)
|
|
@@ -18651,112 +18658,7 @@ var capability = /* @__PURE__ */ __name((adapter, method, what) => {
|
|
|
18651
18658
|
return found.bind(adapter);
|
|
18652
18659
|
}, "capability");
|
|
18653
18660
|
|
|
18654
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
18655
|
-
var TAKES = {
|
|
18656
|
-
chat: "a chat: chat:<provider>/<account>/<chat>, its id or its title",
|
|
18657
|
-
message: "a message: msg:<provider>/<account>/<chat>/<message>, or a chat and the message's id"
|
|
18658
|
-
};
|
|
18659
|
-
var article = /* @__PURE__ */ __name((word) => /^[aeiou]/.test(word) ? "an" : "a", "article");
|
|
18660
|
-
var wrongKind = /* @__PURE__ */ __name((text2, kind, takes) => new CliError("validation_error", `${text2} names ${article(kind)} ${kind}; this takes ${TAKES[takes]}`, {
|
|
18661
|
-
reason: "ref.wrong-kind"
|
|
18662
|
-
}), "wrongKind");
|
|
18663
|
-
var wrongProvider = /* @__PURE__ */ __name((text2, provider, kind) => {
|
|
18664
|
-
const entry = providerNamed(provider);
|
|
18665
|
-
const command = entry?.command;
|
|
18666
|
-
const opens = kind === "entity" ? void 0 : entry?.opens?.[kind];
|
|
18667
|
-
const how = command && opens ? `open it with ${command} <profile> ${opens} ${text2}` : "open it with its own CLI";
|
|
18668
|
-
const label = providerLabel(provider);
|
|
18669
|
-
return new CliError("validation_error", `${text2} is ${article(label.toLowerCase())} ${label} ${kind}; ${how}`, {
|
|
18670
|
-
reason: "ref.wrong-provider"
|
|
18671
|
-
});
|
|
18672
|
-
}, "wrongProvider");
|
|
18673
|
-
var chatReferenceOf = /* @__PURE__ */ __name((text2, provider, takes = "chat") => {
|
|
18674
|
-
const trimmed = text2.trim();
|
|
18675
|
-
if (!looksLikeReference(trimmed))
|
|
18676
|
-
return void 0;
|
|
18677
|
-
const reference = parseReference(trimmed);
|
|
18678
|
-
if (reference.type !== "chat" && reference.type !== "message")
|
|
18679
|
-
throw wrongKind(trimmed, reference.type, takes);
|
|
18680
|
-
if (reference.provider !== provider)
|
|
18681
|
-
throw wrongProvider(trimmed, reference.provider, reference.type);
|
|
18682
|
-
const found = {
|
|
18683
|
-
text: trimmed,
|
|
18684
|
-
provider: reference.provider,
|
|
18685
|
-
account: reference.account,
|
|
18686
|
-
chat: reference.chat,
|
|
18687
|
-
...reference.type === "message" ? { message: reference.message } : {}
|
|
18688
|
-
};
|
|
18689
|
-
return found;
|
|
18690
|
-
}, "chatReferenceOf");
|
|
18691
|
-
var contactReferenceOf = /* @__PURE__ */ __name((text2, provider) => {
|
|
18692
|
-
const trimmed = text2.trim();
|
|
18693
|
-
if (!trimmed.startsWith("contact:"))
|
|
18694
|
-
return void 0;
|
|
18695
|
-
const reference = parseReference(trimmed);
|
|
18696
|
-
if (reference.type !== "contact")
|
|
18697
|
-
return void 0;
|
|
18698
|
-
if (provider !== void 0 && reference.provider !== provider)
|
|
18699
|
-
throw wrongProvider(trimmed, reference.provider, reference.type);
|
|
18700
|
-
return reference.id;
|
|
18701
|
-
}, "contactReferenceOf");
|
|
18702
|
-
var wrongAccount = /* @__PURE__ */ __name((reference, scope, profiles) => {
|
|
18703
|
-
const here = scope.account === void 0 ? "the account of this profile is not known yet" : `${scope.profile === void 0 ? "this profile" : `profile ${scope.profile}`} is account ${scope.account}`;
|
|
18704
|
-
const others = profiles === void 0 ? "" : `. Profiles signed in to ${reference.account}: ${profiles.length > 0 ? profiles.join(", ") : "none here"}`;
|
|
18705
|
-
return new CliError("validation_error", `${reference.text} belongs to account ${reference.account}; ${here}${others}`, { reason: "ref.wrong-account" });
|
|
18706
|
-
}, "wrongAccount");
|
|
18707
|
-
var ensureAccount = /* @__PURE__ */ __name(async (reference, scope, profilesOn2) => {
|
|
18708
|
-
if (scope.account !== void 0 && scope.account === reference.account)
|
|
18709
|
-
return;
|
|
18710
|
-
const profiles = await profilesOn2?.(reference.account).catch(() => void 0);
|
|
18711
|
-
throw wrongAccount(reference, scope, profiles);
|
|
18712
|
-
}, "ensureAccount");
|
|
18713
|
-
|
|
18714
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.619.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._3343d636b3fedf7ef3285e4c7a47096e/node_modules/@wirecat/cli-core/dist/resolve.js
|
|
18715
|
-
var isId = /* @__PURE__ */ __name((reference) => /^-?\d+$/.test(reference.trim()), "isId");
|
|
18716
|
-
var foldName = /* @__PURE__ */ __name((name) => name.normalize("NFC").replace(/[\uFE0E\uFE0F\u200D]/g, "").toLowerCase().replaceAll("\u0451", "\u0435"), "foldName");
|
|
18717
|
-
var pickChat = /* @__PURE__ */ __name((reference, chats) => {
|
|
18718
|
-
const wanted = foldName(reference.trim());
|
|
18719
|
-
const matches = chats.filter((chat) => chat.title !== null && foldName(chat.title).includes(wanted));
|
|
18720
|
-
if (matches.length === 1 && matches[0])
|
|
18721
|
-
return matches[0];
|
|
18722
|
-
if (matches.length === 0)
|
|
18723
|
-
throw new CliError("not_found", `no chat matches "${reference}"`);
|
|
18724
|
-
throw ambiguous(reference, "chats", matches.map((chat) => ({ id: chat.id, title: chat.title })), ({ title }) => singleLine(String(title)));
|
|
18725
|
-
}, "pickChat");
|
|
18726
|
-
var pickPerson = /* @__PURE__ */ __name((reference, people) => {
|
|
18727
|
-
const trimmed = reference.trim();
|
|
18728
|
-
const contact = contactReferenceOf(trimmed, people.provider);
|
|
18729
|
-
if (contact !== void 0) {
|
|
18730
|
-
const named2 = people.get(contact);
|
|
18731
|
-
if (named2)
|
|
18732
|
-
return named2;
|
|
18733
|
-
throw new CliError("not_found", `no person ${contact} in what this account has seen`);
|
|
18734
|
-
}
|
|
18735
|
-
const known2 = people.get(trimmed);
|
|
18736
|
-
if (known2)
|
|
18737
|
-
return known2;
|
|
18738
|
-
if (isId(trimmed))
|
|
18739
|
-
throw new CliError("not_found", `no person ${trimmed} in what this account has seen`);
|
|
18740
|
-
const wanted = foldName(trimmed.replace(/^@/, ""));
|
|
18741
|
-
const everyone = people.all().toSorted((a, b) => (a.name ?? "").localeCompare(b.name ?? ""));
|
|
18742
|
-
const fields = /* @__PURE__ */ __name((person) => [person.alias, person.name, person.username].filter(isPresent).map(foldName), "fields");
|
|
18743
|
-
const exact = everyone.filter((person) => fields(person).includes(wanted));
|
|
18744
|
-
const matches = exact.length > 0 ? exact : everyone.filter((person) => fields(person).some((one) => one.includes(wanted)));
|
|
18745
|
-
if (matches.length === 1 && matches[0])
|
|
18746
|
-
return matches[0];
|
|
18747
|
-
if (matches.length === 0)
|
|
18748
|
-
throw new CliError("not_found", `nobody matches "${reference}"`);
|
|
18749
|
-
throw ambiguous(reference, "people", matches.map(({ id: id2, name, username }) => ({ id: id2, name, username })), ({ name, username }) => singleLine([name, username && `@${username}`].filter(isPresent).join(" ")));
|
|
18750
|
-
}, "pickPerson");
|
|
18751
|
-
var ambiguous = /* @__PURE__ */ __name((reference, what, candidates, label) => {
|
|
18752
|
-
const width = Math.max(...candidates.map(({ id: id2 }) => id2.length));
|
|
18753
|
-
const lines3 = candidates.map((candidate) => ` ${candidate.id.padEnd(width)} ${label(candidate)}`).join("\n");
|
|
18754
|
-
return new CliError("validation_error", `"${singleLine(reference)}" matches ${candidates.length} ${what} \u2014 name one by its id:
|
|
18755
|
-
${lines3}`, { candidates });
|
|
18756
|
-
}, "ambiguous");
|
|
18757
|
-
var isPresent = /* @__PURE__ */ __name((value) => value !== null && value !== void 0, "isPresent");
|
|
18758
|
-
|
|
18759
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.619.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._3343d636b3fedf7ef3285e4c7a47096e/node_modules/@wirecat/cli-core/dist/services/deps.js
|
|
18661
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.624.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._325ff8c9daf4b8769887d5253d3c1255/node_modules/@wirecat/cli-core/dist/services/deps.js
|
|
18760
18662
|
var accountStore = /* @__PURE__ */ __name(async (deps) => (await deps.store()).forAccount(await deps.account()), "accountStore");
|
|
18761
18663
|
var crossAccount = /* @__PURE__ */ __name((deps, _reason) => deps.store(), "crossAccount");
|
|
18762
18664
|
var NO_LOCAL_STORE = "this answer comes from the messenger, not from the local store";
|
|
@@ -18818,7 +18720,7 @@ var storedDeps = /* @__PURE__ */ __name((messenger, store, account, guard) => ({
|
|
|
18818
18720
|
}), "storedDeps");
|
|
18819
18721
|
var storeModeDeps = /* @__PURE__ */ __name((messenger, store, account, guard) => ({ ...storedDeps(messenger, store, account, guard), offline: false, reads: "store" }), "storeModeDeps");
|
|
18820
18722
|
|
|
18821
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
18723
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.624.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._325ff8c9daf4b8769887d5253d3c1255/node_modules/@wirecat/cli-core/dist/services/patience.js
|
|
18822
18724
|
import { setTimeout as sleep } from "node:timers/promises";
|
|
18823
18725
|
var LONGEST_WAIT_MS = 5 * 60 * 1e3;
|
|
18824
18726
|
var patiently = /* @__PURE__ */ __name(async (request, note, stop) => {
|
|
@@ -18841,10 +18743,10 @@ var patiently = /* @__PURE__ */ __name(async (request, note, stop) => {
|
|
|
18841
18743
|
}
|
|
18842
18744
|
}, "patiently");
|
|
18843
18745
|
|
|
18844
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
18746
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.624.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._325ff8c9daf4b8769887d5253d3c1255/node_modules/@wirecat/cli-core/dist/services/archive.js
|
|
18845
18747
|
import { setTimeout as sleep2 } from "node:timers/promises";
|
|
18846
18748
|
|
|
18847
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
18749
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.624.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._325ff8c9daf4b8769887d5253d3c1255/node_modules/@wirecat/cli-core/dist/services/backfill-estimate.js
|
|
18848
18750
|
var REQUEST_MS = 400;
|
|
18849
18751
|
var estimateBackfill = /* @__PURE__ */ __name(({ ranges, held, newest, page, maxPages, pauseMs }) => {
|
|
18850
18752
|
const lowest = ranges[0];
|
|
@@ -18867,13 +18769,13 @@ var estimateBackfill = /* @__PURE__ */ __name(({ ranges, held, newest, page, max
|
|
|
18867
18769
|
};
|
|
18868
18770
|
}, "estimateBackfill");
|
|
18869
18771
|
|
|
18870
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
18772
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.624.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._325ff8c9daf4b8769887d5253d3c1255/node_modules/@wirecat/cli-core/dist/domain/recovery.js
|
|
18871
18773
|
var withRecovery = /* @__PURE__ */ __name((error) => ({
|
|
18872
18774
|
...error,
|
|
18873
18775
|
retryable: typeof error.retryable === "boolean" ? error.retryable : error.code === "rate_limited" || error.status === 429
|
|
18874
18776
|
}), "withRecovery");
|
|
18875
18777
|
|
|
18876
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
18778
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.624.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._325ff8c9daf4b8769887d5253d3c1255/node_modules/@wirecat/cli-core/dist/services/batch.js
|
|
18877
18779
|
var actionable = /* @__PURE__ */ __name((error) => {
|
|
18878
18780
|
if (isCliFailure(error))
|
|
18879
18781
|
return withRecovery({ code: error.code, message: error.message, ...error.details });
|
|
@@ -18956,7 +18858,7 @@ var mergeBatches = /* @__PURE__ */ __name((a, b) => {
|
|
|
18956
18858
|
};
|
|
18957
18859
|
}, "mergeBatches");
|
|
18958
18860
|
|
|
18959
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
18861
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.624.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._325ff8c9daf4b8769887d5253d3c1255/node_modules/@wirecat/cli-core/dist/services/message-resolution.js
|
|
18960
18862
|
var readChatId = /* @__PURE__ */ __name(async (deps, reference, store, account) => {
|
|
18961
18863
|
if (deps.reads !== "store")
|
|
18962
18864
|
return keptChatId(deps.messenger, reference, store, account);
|
|
@@ -19115,7 +19017,7 @@ var senderAmong = /* @__PURE__ */ __name(async (store, accounts, reference) => {
|
|
|
19115
19017
|
}
|
|
19116
19018
|
}, "senderAmong");
|
|
19117
19019
|
|
|
19118
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
19020
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.624.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._325ff8c9daf4b8769887d5253d3c1255/node_modules/@wirecat/cli-core/dist/images/context/index.js
|
|
19119
19021
|
var CONTEXT_MESSAGES = 3;
|
|
19120
19022
|
var CONTEXT_MINUTES = 10;
|
|
19121
19023
|
var MAX_CHARS = 1200;
|
|
@@ -19139,12 +19041,12 @@ var context = {
|
|
|
19139
19041
|
}, "describe")
|
|
19140
19042
|
};
|
|
19141
19043
|
|
|
19142
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
19044
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.624.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._325ff8c9daf4b8769887d5253d3c1255/node_modules/@wirecat/cli-core/dist/images/registry.js
|
|
19143
19045
|
var BUILT_INS = [context];
|
|
19144
19046
|
var providers = [...BUILT_INS];
|
|
19145
19047
|
var registeredImageProviders = /* @__PURE__ */ __name(() => providers, "registeredImageProviders");
|
|
19146
19048
|
|
|
19147
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
19049
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.624.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._325ff8c9daf4b8769887d5253d3c1255/node_modules/@wirecat/cli-core/dist/services/conversations.js
|
|
19148
19050
|
var READ_PAGE = 5e3;
|
|
19149
19051
|
var CHAIN = 50;
|
|
19150
19052
|
var CONVERSATION_QUERY = {
|
|
@@ -19296,7 +19198,7 @@ var sized = /* @__PURE__ */ __name((size2) => {
|
|
|
19296
19198
|
return size2;
|
|
19297
19199
|
}, "sized");
|
|
19298
19200
|
|
|
19299
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
19201
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.624.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._325ff8c9daf4b8769887d5253d3c1255/node_modules/@wirecat/cli-core/dist/services/embeddings-maintenance.js
|
|
19300
19202
|
var REFRESH_BOUNDS = { maxChats: 20, maxChunks: 2e3 };
|
|
19301
19203
|
var MESSAGE_PAGE = 5e3;
|
|
19302
19204
|
var PER_SESSION = 8;
|
|
@@ -19315,7 +19217,7 @@ var embeddingTarget = /* @__PURE__ */ __name((deps, choice = chosenTextModel(dep
|
|
|
19315
19217
|
price: remote.price,
|
|
19316
19218
|
installed: true,
|
|
19317
19219
|
perBatch: PER_REQUEST * concurrency,
|
|
19318
|
-
open: /* @__PURE__ */ __name(async () => (await import("./remote-
|
|
19220
|
+
open: /* @__PURE__ */ __name(async () => (await import("./remote-DO7FLJEF.js")).openRemote(remote, apiKey, { concurrency }), "open")
|
|
19319
19221
|
};
|
|
19320
19222
|
}
|
|
19321
19223
|
const model = textModel(choice, deps.env);
|
|
@@ -19332,7 +19234,7 @@ var embeddingTarget = /* @__PURE__ */ __name((deps, choice = chosenTextModel(dep
|
|
|
19332
19234
|
if (!isTextModelInstalled(model, directory2))
|
|
19333
19235
|
throw notDownloaded(model.id);
|
|
19334
19236
|
if (apart) {
|
|
19335
|
-
const { openProcess } = await import("./process-
|
|
19237
|
+
const { openProcess } = await import("./process-63F4PNWH.js");
|
|
19336
19238
|
return openProcess(model, directory2, { threads: threads ?? defaultThreads() });
|
|
19337
19239
|
}
|
|
19338
19240
|
return openEmbedder(model, directory2, { threads: threads ?? defaultThreads() });
|
|
@@ -19621,7 +19523,7 @@ var shaped = /* @__PURE__ */ __name(({ chatId, builtAt, algorithmVersion, pendin
|
|
|
19621
19523
|
return { ...one, state };
|
|
19622
19524
|
}, "shaped");
|
|
19623
19525
|
|
|
19624
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
19526
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.624.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._325ff8c9daf4b8769887d5253d3c1255/node_modules/@wirecat/cli-core/dist/services/search-catchup.js
|
|
19625
19527
|
var CATCH_UP_BOUNDS = { maxChunks: 500, maxMessages: 1e4, timeMs: 3e4 };
|
|
19626
19528
|
var validateCatchUpBounds = /* @__PURE__ */ __name((options2) => {
|
|
19627
19529
|
for (const [key, value, maximum] of [
|
|
@@ -19674,7 +19576,7 @@ var catchUpSearch = /* @__PURE__ */ __name(async (deps, chat, options2, signal,
|
|
|
19674
19576
|
}
|
|
19675
19577
|
}, "catchUpSearch");
|
|
19676
19578
|
|
|
19677
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
19579
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.624.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._325ff8c9daf4b8769887d5253d3c1255/node_modules/@wirecat/cli-core/dist/services/archive.js
|
|
19678
19580
|
var pushed = /* @__PURE__ */ __name((deps, what) => {
|
|
19679
19581
|
if (deps.reads === "store") {
|
|
19680
19582
|
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`);
|
|
@@ -20055,7 +19957,7 @@ var timeOfKey = /* @__PURE__ */ __name(async (store, account, chatId, key, byTim
|
|
|
20055
19957
|
return message?.timestamp ?? fallback;
|
|
20056
19958
|
}, "timeOfKey");
|
|
20057
19959
|
|
|
20058
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
19960
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.624.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._325ff8c9daf4b8769887d5253d3c1255/node_modules/@wirecat/cli-core/dist/services/questions.js
|
|
20059
19961
|
var LINKS = /https?:\/\/\S+/g;
|
|
20060
19962
|
var unanswered = /* @__PURE__ */ __name((messages, { answerers: answerers2, before: before2 }) => questions(messages, { answerers: answerers2 }).filter(({ question, answer }) => answer === void 0 && Date.parse(question.timestamp) < before2).map(({ question }) => question), "unanswered");
|
|
20061
19963
|
var questions = /* @__PURE__ */ __name((messages, { answerers: answerers2, asker = "others" }) => {
|
|
@@ -20085,7 +19987,7 @@ var questions = /* @__PURE__ */ __name((messages, { answerers: answerers2, asker
|
|
|
20085
19987
|
});
|
|
20086
19988
|
}, "questions");
|
|
20087
19989
|
|
|
20088
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
19990
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.624.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._325ff8c9daf4b8769887d5253d3c1255/node_modules/@wirecat/cli-core/dist/services/task-categories.js
|
|
20089
19991
|
var names = /* @__PURE__ */ __name((categories) => categories.map(({ name }) => name).join(", "), "names");
|
|
20090
19992
|
var taskCategoryOf = /* @__PURE__ */ __name((categories = DEFAULT_TASK_CATEGORIES, flag = "--category") => (typed) => {
|
|
20091
19993
|
const name = typed.trim().toLowerCase();
|
|
@@ -20142,7 +20044,7 @@ var categorize = /* @__PURE__ */ __name((text2, categories = DEFAULT_TASK_CATEGO
|
|
|
20142
20044
|
return best.name;
|
|
20143
20045
|
}, "categorize");
|
|
20144
20046
|
|
|
20145
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
20047
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.624.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._325ff8c9daf4b8769887d5253d3c1255/node_modules/@wirecat/cli-core/dist/services/task-rules.js
|
|
20146
20048
|
var taskAccount = /* @__PURE__ */ __name(({ provider, account }) => `${provider}:${account}`, "taskAccount");
|
|
20147
20049
|
var RULES_IN = {
|
|
20148
20050
|
dialog: "all",
|
|
@@ -20348,11 +20250,11 @@ var applyTaskRulesToChats = /* @__PURE__ */ __name(async (store, account, chatId
|
|
|
20348
20250
|
return passes;
|
|
20349
20251
|
}, "applyTaskRulesToChats");
|
|
20350
20252
|
|
|
20351
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
20253
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.624.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._325ff8c9daf4b8769887d5253d3c1255/node_modules/@wirecat/cli-core/dist/domain/vcard.js
|
|
20352
20254
|
var AS_WORD = new RegExp(`^${WORD_BODY}$`);
|
|
20353
20255
|
var encoder = new TextEncoder();
|
|
20354
20256
|
|
|
20355
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
20257
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.624.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._325ff8c9daf4b8769887d5253d3c1255/node_modules/@wirecat/cli-core/dist/services/moment.js
|
|
20356
20258
|
var AGO = /^(\d+)(m|h|d)$/;
|
|
20357
20259
|
var AGO_MS = { m: 6e4, h: 36e5, d: 864e5 };
|
|
20358
20260
|
var DATE = /^\d{4}-\d{2}-\d{2}/;
|
|
@@ -20392,7 +20294,7 @@ var dateWindow = /* @__PURE__ */ __name(({ sinceTime, untilTime, zone, now = Dat
|
|
|
20392
20294
|
};
|
|
20393
20295
|
}, "dateWindow");
|
|
20394
20296
|
|
|
20395
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
20297
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.624.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._325ff8c9daf4b8769887d5253d3c1255/node_modules/@wirecat/cli-core/dist/botcheck/check.js
|
|
20396
20298
|
var DAY_MS = 864e5;
|
|
20397
20299
|
var NEW_DAYS = 30;
|
|
20398
20300
|
var SAME_TEXT_MIN = 20;
|
|
@@ -20469,7 +20371,7 @@ var scorePerson = /* @__PURE__ */ __name(({ subject, provider, activity, photos,
|
|
|
20469
20371
|
};
|
|
20470
20372
|
}, "scorePerson");
|
|
20471
20373
|
|
|
20472
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
20374
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.624.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._325ff8c9daf4b8769887d5253d3c1255/node_modules/@wirecat/cli-core/dist/http/time-limit.js
|
|
20473
20375
|
var timeLimit = /* @__PURE__ */ __name((ms) => {
|
|
20474
20376
|
const controller = new AbortController();
|
|
20475
20377
|
const timer = setTimeout(() => controller.abort(new DOMException("The operation timed out.", "TimeoutError")), ms);
|
|
@@ -20485,7 +20387,7 @@ var withTimeLimit = /* @__PURE__ */ __name(async (ms, run) => {
|
|
|
20485
20387
|
}
|
|
20486
20388
|
}, "withTimeLimit");
|
|
20487
20389
|
|
|
20488
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
20390
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.624.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._325ff8c9daf4b8769887d5253d3c1255/node_modules/@wirecat/cli-core/dist/botcheck/registries.js
|
|
20489
20391
|
var REGISTRIES = {
|
|
20490
20392
|
cas: { title: "Combot Anti-Spam (CAS)", docs: "https://cas.chat/api" },
|
|
20491
20393
|
lols: { title: "lols.bot", docs: "https://api.lols.bot/lols-bot.json" }
|
|
@@ -20572,7 +20474,7 @@ var notCovered = /* @__PURE__ */ __name((messenger, now = /* @__PURE__ */ new Da
|
|
|
20572
20474
|
detail: `lists Telegram accounts only, not ${messenger} ones`
|
|
20573
20475
|
})), "notCovered");
|
|
20574
20476
|
|
|
20575
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
20477
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.624.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._325ff8c9daf4b8769887d5253d3c1255/node_modules/@wirecat/cli-core/dist/botcheck/service.js
|
|
20576
20478
|
var ACTIVITY_MESSAGES = 1e3;
|
|
20577
20479
|
var botCheckService = /* @__PURE__ */ __name((deps) => {
|
|
20578
20480
|
const subjectOf = /* @__PURE__ */ __name(async (reference) => {
|
|
@@ -20660,7 +20562,7 @@ var botCheckService = /* @__PURE__ */ __name((deps) => {
|
|
|
20660
20562
|
};
|
|
20661
20563
|
}, "botCheckService");
|
|
20662
20564
|
|
|
20663
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
20565
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.624.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._325ff8c9daf4b8769887d5253d3c1255/node_modules/@wirecat/cli-core/dist/domain/thread.js
|
|
20664
20566
|
var threadIdOf = /* @__PURE__ */ __name((value) => {
|
|
20665
20567
|
if (value === void 0)
|
|
20666
20568
|
return void 0;
|
|
@@ -20670,7 +20572,7 @@ var threadIdOf = /* @__PURE__ */ __name((value) => {
|
|
|
20670
20572
|
return id2;
|
|
20671
20573
|
}, "threadIdOf");
|
|
20672
20574
|
|
|
20673
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
20575
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.624.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._325ff8c9daf4b8769887d5253d3c1255/node_modules/@wirecat/cli-core/dist/services/chat-stats.js
|
|
20674
20576
|
var TOP_POSTS = 5;
|
|
20675
20577
|
var JOINS = /* @__PURE__ */ new Set(["join", "add"]);
|
|
20676
20578
|
var LEAVES = /* @__PURE__ */ new Set(["leave", "remove"]);
|
|
@@ -20748,7 +20650,7 @@ var membersOf = /* @__PURE__ */ __name(({ events, more }, messages, since) => {
|
|
|
20748
20650
|
}, "membersOf");
|
|
20749
20651
|
var seriesOf = /* @__PURE__ */ __name((messages, events, by, timezone) => {
|
|
20750
20652
|
const dayOf = calendarKey(timezone, "day");
|
|
20751
|
-
const
|
|
20653
|
+
const keyOf7 = /* @__PURE__ */ __name((timestamp) => {
|
|
20752
20654
|
const day2 = dayOf(Date.parse(timestamp));
|
|
20753
20655
|
if (by === "day")
|
|
20754
20656
|
return day2;
|
|
@@ -20763,12 +20665,12 @@ var seriesOf = /* @__PURE__ */ __name((messages, events, by, timezone) => {
|
|
|
20763
20665
|
return found;
|
|
20764
20666
|
}, "row");
|
|
20765
20667
|
for (const one of messages)
|
|
20766
|
-
row(
|
|
20668
|
+
row(keyOf7(one.timestamp)).messages.push(one);
|
|
20767
20669
|
for (const { timestamp, event, people } of events?.events ?? []) {
|
|
20768
20670
|
if (JOINS.has(event))
|
|
20769
|
-
row(
|
|
20671
|
+
row(keyOf7(timestamp)).joined += people.length;
|
|
20770
20672
|
if (LEAVES.has(event))
|
|
20771
|
-
row(
|
|
20673
|
+
row(keyOf7(timestamp)).left += people.length;
|
|
20772
20674
|
}
|
|
20773
20675
|
return [...rows.entries()].sort(([a], [b]) => a.localeCompare(b)).map(([key, found]) => ({
|
|
20774
20676
|
key,
|
|
@@ -20787,7 +20689,7 @@ var median = /* @__PURE__ */ __name((values) => {
|
|
|
20787
20689
|
return Math.round(sorted.length % 2 === 0 ? ((sorted[middle - 1] ?? upper) + upper) / 2 : upper);
|
|
20788
20690
|
}, "median");
|
|
20789
20691
|
|
|
20790
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
20692
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.624.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._325ff8c9daf4b8769887d5253d3c1255/node_modules/@wirecat/cli-core/dist/services/member-history.js
|
|
20791
20693
|
var memberEvents = /* @__PURE__ */ __name((stays, revisions, since = 0) => {
|
|
20792
20694
|
const events = [];
|
|
20793
20695
|
for (const stay of stays) {
|
|
@@ -20819,7 +20721,7 @@ var memberEvents = /* @__PURE__ */ __name((stays, revisions, since = 0) => {
|
|
|
20819
20721
|
return events.filter(({ at }) => Date.parse(at) >= since).sort((a, b) => Date.parse(a.at) - Date.parse(b.at) || a.id.localeCompare(b.id));
|
|
20820
20722
|
}, "memberEvents");
|
|
20821
20723
|
|
|
20822
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
20724
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.624.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._325ff8c9daf4b8769887d5253d3c1255/node_modules/@wirecat/cli-core/dist/services/chats.js
|
|
20823
20725
|
var EVENTS_DAYS = 7;
|
|
20824
20726
|
var TRACKED_DAYS = 30;
|
|
20825
20727
|
var STATS_PAGE = 1e3;
|
|
@@ -21114,7 +21016,7 @@ var storedMembers = /* @__PURE__ */ __name(async (store, chatId) => {
|
|
|
21114
21016
|
return members.length === 0 ? null : members;
|
|
21115
21017
|
}, "storedMembers");
|
|
21116
21018
|
|
|
21117
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
21019
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.624.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._325ff8c9daf4b8769887d5253d3c1255/node_modules/@wirecat/cli-core/dist/services/inbox.js
|
|
21118
21020
|
var INBOX_CHATS = 20;
|
|
21119
21021
|
var REVIEW_DAYS = 3;
|
|
21120
21022
|
var UNANSWERED_HOURS = 24;
|
|
@@ -21322,7 +21224,7 @@ var inboxService = /* @__PURE__ */ __name((deps) => {
|
|
|
21322
21224
|
};
|
|
21323
21225
|
}, "inboxService");
|
|
21324
21226
|
|
|
21325
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
21227
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.624.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._325ff8c9daf4b8769887d5253d3c1255/node_modules/@wirecat/cli-core/dist/domain/formatting.js
|
|
21326
21228
|
var invalid = /* @__PURE__ */ __name(() => new CliError("validation_error", "the messenger formatter returned invalid text spans"), "invalid");
|
|
21327
21229
|
var validateFormattedText = /* @__PURE__ */ __name((formatted2) => {
|
|
21328
21230
|
const { text: text2, spans } = formatted2;
|
|
@@ -21382,7 +21284,7 @@ var visibleFormattedText = /* @__PURE__ */ __name((formatted2) => {
|
|
|
21382
21284
|
};
|
|
21383
21285
|
}, "visibleFormattedText");
|
|
21384
21286
|
|
|
21385
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
21287
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.624.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._325ff8c9daf4b8769887d5253d3c1255/node_modules/@wirecat/cli-core/dist/moderation/check.js
|
|
21386
21288
|
var INVITE = /max\.ru\/join\/|(t|telegram)\.me\/(\+|joinchat\/)|tg:\/\/join/i;
|
|
21387
21289
|
var LINK2 = /https?:\/\/\S+/i;
|
|
21388
21290
|
var STRENGTH = { report: 0, delete: 1, remove: 2 };
|
|
@@ -21570,7 +21472,7 @@ var nextPoint = /* @__PURE__ */ __name((rows, found) => {
|
|
|
21570
21472
|
}, "nextPoint");
|
|
21571
21473
|
var someUndone = /* @__PURE__ */ __name((rows) => rows.some(undone), "someUndone");
|
|
21572
21474
|
|
|
21573
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
21475
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.624.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._325ff8c9daf4b8769887d5253d3c1255/node_modules/@wirecat/cli-core/dist/moderation/rules.js
|
|
21574
21476
|
import { existsSync as existsSync2, readFileSync as readFileSync4 } from "node:fs";
|
|
21575
21477
|
import { join as join4 } from "node:path";
|
|
21576
21478
|
var RULE_ACTIONS = ["report", "delete", "remove"];
|
|
@@ -21713,7 +21615,7 @@ var assign = /* @__PURE__ */ __name((rules, key, value) => {
|
|
|
21713
21615
|
return { ...rules, [head]: { ...rules[head], [tail]: value } };
|
|
21714
21616
|
}, "assign");
|
|
21715
21617
|
|
|
21716
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
21618
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.624.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._325ff8c9daf4b8769887d5253d3c1255/node_modules/@wirecat/cli-core/dist/services/person-context.js
|
|
21717
21619
|
var CONTEXT_MESSAGES2 = 10;
|
|
21718
21620
|
var CONTEXT_BYTES = 64 * 1024;
|
|
21719
21621
|
var toContext = /* @__PURE__ */ __name((key, message, chatTitle2) => ({
|
|
@@ -21790,14 +21692,18 @@ var eventsOnce = /* @__PURE__ */ __name(async (store, filter, limit) => {
|
|
|
21790
21692
|
return { items, cut: true };
|
|
21791
21693
|
}, "eventsOnce");
|
|
21792
21694
|
var nameOf = /* @__PURE__ */ __name(({ provider, account }) => `${provider}:${account}`, "nameOf");
|
|
21793
|
-
var
|
|
21695
|
+
var allowedOf = /* @__PURE__ */ __name(async (store, asked, scopes) => {
|
|
21794
21696
|
const stored = await store.accounts.storedAccounts();
|
|
21795
21697
|
const own = stored.find((one) => nameOf(one) === nameOf(asked));
|
|
21796
21698
|
if (!own || asked.scope !== void 0 && asked.scope !== own.scope)
|
|
21797
21699
|
throw new CliError("not_found", `no ${asked.provider} account ${asked.account} in the store`);
|
|
21798
|
-
|
|
21700
|
+
return { stored, allowed: scopes ?? [own.scope] };
|
|
21701
|
+
}, "allowedOf");
|
|
21702
|
+
var readableAccounts = /* @__PURE__ */ __name(async (store, asked, scopes) => {
|
|
21703
|
+
const { stored, allowed } = await allowedOf(store, asked, scopes);
|
|
21799
21704
|
return stored.filter((one) => allowed.includes(one.scope));
|
|
21800
21705
|
}, "readableAccounts");
|
|
21706
|
+
var readableScopes = /* @__PURE__ */ __name(async (store, asked, scopes) => (await allowedOf(store, asked, scopes)).allowed, "readableScopes");
|
|
21801
21707
|
var readsOf = /* @__PURE__ */ __name((record2, asked, readable) => {
|
|
21802
21708
|
const scopeOf5 = new Map(readable.map((one) => [nameOf(one), one.scope]));
|
|
21803
21709
|
return record2.identities.flatMap((identity) => (identity.provider === asked.provider ? [asked.account] : identity.accounts).flatMap((account) => {
|
|
@@ -21816,8 +21722,13 @@ var personContext = /* @__PURE__ */ __name(async (store, asked, reference, optio
|
|
|
21816
21722
|
...await recordContext(store, record2, readsOf(record2, asked, readable), readable, options2)
|
|
21817
21723
|
};
|
|
21818
21724
|
}, "personContext");
|
|
21819
|
-
var recordContext = /* @__PURE__ */ __name(async (store, record2, reads, readable, { messages = CONTEXT_MESSAGES2, bytes: bytes2 = CONTEXT_BYTES, since, now = Date.now(), calendarIds } = {}) => {
|
|
21725
|
+
var recordContext = /* @__PURE__ */ __name(async (store, record2, reads, readable, { messages = CONTEXT_MESSAGES2, bytes: bytes2 = CONTEXT_BYTES, since, now = Date.now(), calendarIds, scopes } = {}) => {
|
|
21820
21726
|
const recent = /* @__PURE__ */ __name((message) => since === void 0 || Date.parse(message.timestamp) >= since, "recent");
|
|
21727
|
+
const allowed = new Set(scopes ?? readable.map((one) => one.scope));
|
|
21728
|
+
const inScope = /* @__PURE__ */ __name(async (key, scope, hits) => {
|
|
21729
|
+
const pinned = await store.chats.chatScopes(key, [...new Set(hits.map((hit) => hit.chatId))]);
|
|
21730
|
+
return hits.filter((hit) => allowed.has(pinned.get(hit.chatId) ?? scope));
|
|
21731
|
+
}, "inScope");
|
|
21821
21732
|
const shared = [];
|
|
21822
21733
|
const notRead = [];
|
|
21823
21734
|
const direct = [];
|
|
@@ -21825,8 +21736,8 @@ var recordContext = /* @__PURE__ */ __name(async (store, record2, reads, readabl
|
|
|
21825
21736
|
const theirs = [];
|
|
21826
21737
|
const mentions = [];
|
|
21827
21738
|
let cut = false;
|
|
21828
|
-
for (const { key, identity } of reads) {
|
|
21829
|
-
const chats = await store.chats.chatsWith(key, identity.id);
|
|
21739
|
+
for (const { key, scope, identity } of reads) {
|
|
21740
|
+
const chats = (await store.chats.chatsWith(key, identity.id)).filter((chat) => allowed.has(chat.scope ?? scope));
|
|
21830
21741
|
for (const chat of chats) {
|
|
21831
21742
|
shared.push({ ...key, chatId: chat.id, title: chat.title, kind: chat.kind, lastMessageAt: chat.lastMessageAt });
|
|
21832
21743
|
}
|
|
@@ -21867,10 +21778,10 @@ var recordContext = /* @__PURE__ */ __name(async (store, record2, reads, readabl
|
|
|
21867
21778
|
cut ||= mail.hasMore;
|
|
21868
21779
|
}
|
|
21869
21780
|
const written = await store.messages.find({ account: key, senders: [identity.id], limit: messages });
|
|
21870
|
-
theirs.push(...written.items.map((hit) => toContext(key, hit, hit.chatTitle ?? null)).filter(recent));
|
|
21781
|
+
theirs.push(...(await inScope(key, scope, written.items)).map((hit) => toContext(key, hit, hit.chatTitle ?? null)).filter(recent));
|
|
21871
21782
|
cut ||= written.hasMore;
|
|
21872
21783
|
const named2 = await store.messages.mentioning(key, { id: identity.id, username: identity.username }, messages);
|
|
21873
|
-
mentions.push(...named2.items.filter((hit) => hit.senderId !== identity.id).map((hit) => toContext(key, hit, hit.chatTitle ?? null)).filter(recent));
|
|
21784
|
+
mentions.push(...(await inScope(key, scope, named2.items)).filter((hit) => hit.senderId !== identity.id).map((hit) => toContext(key, hit, hit.chatTitle ?? null)).filter(recent));
|
|
21874
21785
|
cut ||= named2.hasMore;
|
|
21875
21786
|
}
|
|
21876
21787
|
const personId = Number(record2.uid);
|
|
@@ -22003,10 +21914,10 @@ var personMessages = /* @__PURE__ */ __name(async (store, asked, reference, { ch
|
|
|
22003
21914
|
};
|
|
22004
21915
|
}, "personMessages");
|
|
22005
21916
|
|
|
22006
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
21917
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.624.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._325ff8c9daf4b8769887d5253d3c1255/node_modules/@wirecat/cli-core/dist/services/meeting-evidence.js
|
|
22007
21918
|
import { createHash } from "node:crypto";
|
|
22008
21919
|
|
|
22009
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
21920
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.624.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._325ff8c9daf4b8769887d5253d3c1255/node_modules/@wirecat/cli-core/dist/services/meeting-reference.js
|
|
22010
21921
|
var missing2 = /* @__PURE__ */ __name(() => new CliError("not_found", "the meeting evidence is unavailable for this account"), "missing");
|
|
22011
21922
|
var authorizedMeetingMetadata = /* @__PURE__ */ __name(async (store, accountId, reference, options2 = {}) => {
|
|
22012
21923
|
const parsed = parseMeetingReference(reference);
|
|
@@ -22024,7 +21935,7 @@ var authorizedMeetingMetadata = /* @__PURE__ */ __name(async (store, accountId,
|
|
|
22024
21935
|
return { parsed, meeting };
|
|
22025
21936
|
}, "authorizedMeetingMetadata");
|
|
22026
21937
|
|
|
22027
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
21938
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.624.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._325ff8c9daf4b8769887d5253d3c1255/node_modules/@wirecat/cli-core/dist/services/meeting-evidence.js
|
|
22028
21939
|
var hash = /* @__PURE__ */ __name((value) => createHash("sha256").update(JSON.stringify(value)).digest("hex"), "hash");
|
|
22029
21940
|
var checkMeetingCancelled = /* @__PURE__ */ __name((signal) => {
|
|
22030
21941
|
if (signal?.aborted)
|
|
@@ -22223,7 +22134,7 @@ var readMeetingEvidence = /* @__PURE__ */ __name(async (store, accountId, refere
|
|
|
22223
22134
|
return { ...packet, fingerprint: hash(packet) };
|
|
22224
22135
|
}, "readMeetingEvidence");
|
|
22225
22136
|
|
|
22226
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
22137
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.624.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._325ff8c9daf4b8769887d5253d3c1255/node_modules/@wirecat/cli-core/dist/services/person-meeting-context.js
|
|
22227
22138
|
var personMeetingContext = /* @__PURE__ */ __name(async (store, personReference, options2) => {
|
|
22228
22139
|
const { meetings = 10, cues = 5, bytes: bytes2 = 64 * 1024, scanLimit = 1e3, since, signal } = options2;
|
|
22229
22140
|
const requestedAccounts = options2.accountIds;
|
|
@@ -22322,7 +22233,7 @@ var personMeetingContext = /* @__PURE__ */ __name(async (store, personReference,
|
|
|
22322
22233
|
};
|
|
22323
22234
|
}, "personMeetingContext");
|
|
22324
22235
|
|
|
22325
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
22236
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.624.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._325ff8c9daf4b8769887d5253d3c1255/node_modules/@wirecat/cli-core/dist/services/person-preparation.js
|
|
22326
22237
|
var PREPARE_BYTES = 96 * 1024;
|
|
22327
22238
|
var MEETINGS = 5;
|
|
22328
22239
|
var CUES = 3;
|
|
@@ -22367,7 +22278,8 @@ var personPreparation = /* @__PURE__ */ __name(async (store, asked, reference, o
|
|
|
22367
22278
|
}
|
|
22368
22279
|
waiting.sort((a, b) => Date.parse(b.message.timestamp) - Date.parse(a.message.timestamp));
|
|
22369
22280
|
const accounts = context2.accounts.map(({ provider, account }) => ({ provider, account }));
|
|
22370
|
-
const
|
|
22281
|
+
const scopes = await readableScopes(store, asked, options2.scopes);
|
|
22282
|
+
const held = await store.people.preparation(context2.person.uid, { accounts, scopes, limit });
|
|
22371
22283
|
const readable = await readableAccounts(store, asked, options2.scopes);
|
|
22372
22284
|
const meetings = await meetingsOf(store, context2.person.uid, readable, options2.since, () => left);
|
|
22373
22285
|
const sections = {
|
|
@@ -22394,12 +22306,18 @@ var personPreparation = /* @__PURE__ */ __name(async (store, asked, reference, o
|
|
|
22394
22306
|
tasks: {
|
|
22395
22307
|
...sections.tasks.coverage,
|
|
22396
22308
|
selection: "open, assigned to them in any role",
|
|
22397
|
-
accounts: accounts.map(accountName)
|
|
22309
|
+
accounts: accounts.map(accountName),
|
|
22310
|
+
scopes
|
|
22311
|
+
},
|
|
22312
|
+
facts: {
|
|
22313
|
+
...sections.facts.coverage,
|
|
22314
|
+
selection: "accepted, about them or a project they are a member of",
|
|
22315
|
+
scopes
|
|
22398
22316
|
},
|
|
22399
|
-
facts: { ...sections.facts.coverage, selection: "accepted, about them or a project they are a member of" },
|
|
22400
22317
|
notes: {
|
|
22401
22318
|
...sections.notes.coverage,
|
|
22402
22319
|
selection: "written by you, about them",
|
|
22320
|
+
scopes,
|
|
22403
22321
|
...options2.notes === false ? { withheld: "contacts.notes.list" } : {}
|
|
22404
22322
|
},
|
|
22405
22323
|
meetings: {
|
|
@@ -22438,7 +22356,7 @@ var meetingsOf = /* @__PURE__ */ __name(async (store, uid, stored, since, left)
|
|
|
22438
22356
|
}
|
|
22439
22357
|
}, "meetingsOf");
|
|
22440
22358
|
|
|
22441
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
22359
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.624.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._325ff8c9daf4b8769887d5253d3c1255/node_modules/@wirecat/cli-core/dist/services/person-profile.js
|
|
22442
22360
|
var personProfile = /* @__PURE__ */ __name(async (deps, person, known2) => {
|
|
22443
22361
|
const online = deps.offline ? void 0 : await deps.connection();
|
|
22444
22362
|
const held = await storeIfOpen(deps);
|
|
@@ -22484,7 +22402,7 @@ var activityIn = /* @__PURE__ */ __name(async (store, account, facts) => {
|
|
|
22484
22402
|
...facts.chats,
|
|
22485
22403
|
...[...stats.values()].filter(({ chatId }) => !listed2.has(chatId)).map(({ chatId, title, kind, lastAt }) => ({ id: chatId, title, kind, lastMessageAt: lastAt }))
|
|
22486
22404
|
];
|
|
22487
|
-
const
|
|
22405
|
+
const whole3 = new Set((await store.chats.chatCompleteness(account, chats.map(({ id: id2 }) => id2))).filter(({ state }) => state === "complete").map(({ chatId }) => chatId));
|
|
22488
22406
|
return chats.map(({ id: id2, title, kind }) => {
|
|
22489
22407
|
const one = stats.get(id2);
|
|
22490
22408
|
return {
|
|
@@ -22494,7 +22412,7 @@ var activityIn = /* @__PURE__ */ __name(async (store, account, facts) => {
|
|
|
22494
22412
|
theirMessages: one?.messages ?? 0,
|
|
22495
22413
|
firstAt: one?.firstAt ?? null,
|
|
22496
22414
|
lastAt: one?.lastAt ?? null,
|
|
22497
|
-
complete:
|
|
22415
|
+
complete: whole3.has(id2)
|
|
22498
22416
|
};
|
|
22499
22417
|
});
|
|
22500
22418
|
}, "activityIn");
|
|
@@ -22508,7 +22426,7 @@ var quiet = /* @__PURE__ */ __name((facts) => facts.chats.map(({ id: id2, title,
|
|
|
22508
22426
|
complete: false
|
|
22509
22427
|
})), "quiet");
|
|
22510
22428
|
|
|
22511
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
22429
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.624.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._325ff8c9daf4b8769887d5253d3c1255/node_modules/@wirecat/cli-core/dist/services/person-timeline.js
|
|
22512
22430
|
var TIMELINE_ITEMS = 50;
|
|
22513
22431
|
var TIMELINE_MAX = 500;
|
|
22514
22432
|
var SCOPES = ["personal", "work"];
|
|
@@ -22520,11 +22438,17 @@ var boundOf = /* @__PURE__ */ __name((cursor) => {
|
|
|
22520
22438
|
throw new CliError("validation_error", `--cursor takes what page.next gave, before:<time>:<id> \u2014 not "${cursor}"`);
|
|
22521
22439
|
return bound2;
|
|
22522
22440
|
}, "boundOf");
|
|
22523
|
-
var personTimeline = /* @__PURE__ */ __name(async (store, asked, reference, { scope, since, until, cursor, limit = TIMELINE_ITEMS } = {}) => {
|
|
22441
|
+
var personTimeline = /* @__PURE__ */ __name(async (store, asked, reference, { scopes, scope, since, until, cursor, limit = TIMELINE_ITEMS } = {}) => {
|
|
22524
22442
|
if (!Number.isSafeInteger(limit) || limit < 1 || limit > TIMELINE_MAX)
|
|
22525
22443
|
throw new CliError("validation_error", `the limit takes 1\u2013${TIMELINE_MAX}`);
|
|
22526
22444
|
if (since !== void 0 && until !== void 0 && since > until)
|
|
22527
22445
|
throw new CliError("validation_error", "the start of the range is after its end");
|
|
22446
|
+
const allowed = await readableScopes(store, asked, scopes);
|
|
22447
|
+
if (scope !== void 0 && !allowed.includes(scope))
|
|
22448
|
+
throw new CliError("permission_error", `this profile reads ${allowed.join(" and ")}, not ${scope}`, {
|
|
22449
|
+
reason: "selection.out-of-scope"
|
|
22450
|
+
});
|
|
22451
|
+
const read = scope === void 0 ? [...allowed] : [scope];
|
|
22528
22452
|
const found = pickPerson(reference, await store.people.people(asked.provider, { account: asked.account }));
|
|
22529
22453
|
const record2 = await store.people.personOf({ provider: asked.provider, id: found.id });
|
|
22530
22454
|
if (!record2)
|
|
@@ -22532,7 +22456,7 @@ var personTimeline = /* @__PURE__ */ __name(async (store, asked, reference, { sc
|
|
|
22532
22456
|
const personId = Number(record2.uid);
|
|
22533
22457
|
const pending = store.involvements.pending();
|
|
22534
22458
|
const rows = store.involvements.forPerson(personId, {
|
|
22535
|
-
|
|
22459
|
+
scopes: read,
|
|
22536
22460
|
...since === void 0 ? {} : { since },
|
|
22537
22461
|
...until === void 0 ? {} : { until },
|
|
22538
22462
|
only: asked,
|
|
@@ -22544,6 +22468,7 @@ var personTimeline = /* @__PURE__ */ __name(async (store, asked, reference, { sc
|
|
|
22544
22468
|
const hasMore = rows.length > limit;
|
|
22545
22469
|
return {
|
|
22546
22470
|
person: { uid: record2.uid, name: record2.name },
|
|
22471
|
+
scopes: read,
|
|
22547
22472
|
items: shown.map((row) => ({
|
|
22548
22473
|
at: new Date(row.occurredAt).toISOString(),
|
|
22549
22474
|
subject: row.subjectType,
|
|
@@ -22563,7 +22488,7 @@ var personTimeline = /* @__PURE__ */ __name(async (store, asked, reference, { sc
|
|
|
22563
22488
|
};
|
|
22564
22489
|
}, "personTimeline");
|
|
22565
22490
|
|
|
22566
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
22491
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.624.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._325ff8c9daf4b8769887d5253d3c1255/node_modules/@wirecat/cli-core/dist/services/people.js
|
|
22567
22492
|
var peopleService = /* @__PURE__ */ __name((deps) => {
|
|
22568
22493
|
const localCard = /* @__PURE__ */ __name(async (card, includeNotes = false) => {
|
|
22569
22494
|
const held = await storeIfOpen(deps);
|
|
@@ -22684,7 +22609,7 @@ var peopleService = /* @__PURE__ */ __name((deps) => {
|
|
|
22684
22609
|
else if (known2.name !== person.name || known2.username !== person.username)
|
|
22685
22610
|
changed2 += 1;
|
|
22686
22611
|
}
|
|
22687
|
-
await store.people.
|
|
22612
|
+
await store.people.saveAddressBook(account, people);
|
|
22688
22613
|
return {
|
|
22689
22614
|
added,
|
|
22690
22615
|
changed: changed2,
|
|
@@ -22817,7 +22742,7 @@ var withoutPhone = /* @__PURE__ */ __name((answer) => {
|
|
|
22817
22742
|
return rest;
|
|
22818
22743
|
}, "withoutPhone");
|
|
22819
22744
|
|
|
22820
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
22745
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.624.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._325ff8c9daf4b8769887d5253d3c1255/node_modules/@wirecat/cli-core/dist/services/task-stats.js
|
|
22821
22746
|
var TASK_STATS_BY = ["chat", "meeting", "project"];
|
|
22822
22747
|
var PERIOD_FIELD = "created";
|
|
22823
22748
|
var refuseNestedPeriod = /* @__PURE__ */ __name((node, top = true) => {
|
|
@@ -22863,10 +22788,10 @@ var taskStatsOf = /* @__PURE__ */ __name(async (store, account, { by = "chat", q
|
|
|
22863
22788
|
const closed = await store.tasks.statRows(scope, where(query && { ...query, root: renamed(query.root, PERIOD_FIELD, "closed") }, [
|
|
22864
22789
|
{ sql: "t.closed_at IS NOT NULL", params: [] }
|
|
22865
22790
|
]));
|
|
22866
|
-
const
|
|
22791
|
+
const keyOf7 = /* @__PURE__ */ __name((row) => by === "project" ? String(row.projectId) : row.group ?? "", "keyOf");
|
|
22867
22792
|
const groups = /* @__PURE__ */ new Map();
|
|
22868
22793
|
const slot = /* @__PURE__ */ __name((row) => {
|
|
22869
|
-
const key =
|
|
22794
|
+
const key = keyOf7(row);
|
|
22870
22795
|
const found = groups.get(key) ?? { open: [], created: 0, closeMs: [] };
|
|
22871
22796
|
groups.set(key, found);
|
|
22872
22797
|
return found;
|
|
@@ -22920,7 +22845,7 @@ var meetingNames = /* @__PURE__ */ __name(async (store, groups) => {
|
|
|
22920
22845
|
}));
|
|
22921
22846
|
}, "meetingNames");
|
|
22922
22847
|
|
|
22923
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
22848
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.624.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._325ff8c9daf4b8769887d5253d3c1255/node_modules/@wirecat/cli-core/dist/services/task-tag-filters.js
|
|
22924
22849
|
var taskTagFilters = /* @__PURE__ */ __name(async (store, query) => {
|
|
22925
22850
|
const tags = /* @__PURE__ */ new Map();
|
|
22926
22851
|
for (const node of query ? walkQuery(query.root) : [])
|
|
@@ -22929,7 +22854,7 @@ var taskTagFilters = /* @__PURE__ */ __name(async (store, query) => {
|
|
|
22929
22854
|
return tags;
|
|
22930
22855
|
}, "taskTagFilters");
|
|
22931
22856
|
|
|
22932
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
22857
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.624.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._325ff8c9daf4b8769887d5253d3c1255/node_modules/@wirecat/cli-core/dist/services/tasks.js
|
|
22933
22858
|
var TASK_QUERY = {
|
|
22934
22859
|
entity: "task",
|
|
22935
22860
|
backend: "sql",
|
|
@@ -23233,9 +23158,9 @@ var tasksService = /* @__PURE__ */ __name((deps, categories) => {
|
|
|
23233
23158
|
merge: /* @__PURE__ */ __name((dup, into, by) => inStore(async (store, account) => {
|
|
23234
23159
|
await owned(store, account, dup);
|
|
23235
23160
|
await owned(store, account, into);
|
|
23236
|
-
const
|
|
23161
|
+
const merged2 = await store.tasks.merge(dup, into, by === "owner" ? "owner" : { bot: by });
|
|
23237
23162
|
const review = await reviewAfterLink(store, into);
|
|
23238
|
-
return { ...
|
|
23163
|
+
return { ...merged2, review, task: await cardOf(store, into) };
|
|
23239
23164
|
}), "merge"),
|
|
23240
23165
|
unmerge: /* @__PURE__ */ __name((dup, by) => inStore(async (store, account) => {
|
|
23241
23166
|
await owned(store, account, dup);
|
|
@@ -23421,7 +23346,7 @@ var taskView = /* @__PURE__ */ __name(async (store, account, task2) => {
|
|
|
23421
23346
|
};
|
|
23422
23347
|
}, "taskView");
|
|
23423
23348
|
|
|
23424
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
23349
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.624.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._325ff8c9daf4b8769887d5253d3c1255/node_modules/@wirecat/cli-core/dist/mail/owed.js
|
|
23425
23350
|
var mailTurn = /* @__PURE__ */ __name((newest) => {
|
|
23426
23351
|
if (newest === null)
|
|
23427
23352
|
return null;
|
|
@@ -23430,7 +23355,7 @@ var mailTurn = /* @__PURE__ */ __name((newest) => {
|
|
|
23430
23355
|
return newest.addressed ? "owed" : null;
|
|
23431
23356
|
}, "mailTurn");
|
|
23432
23357
|
|
|
23433
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
23358
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.624.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._325ff8c9daf4b8769887d5253d3c1255/node_modules/@wirecat/cli-core/dist/services/agenda-mail.js
|
|
23434
23359
|
var absent = /* @__PURE__ */ __name((error) => {
|
|
23435
23360
|
if (error instanceof CliError && error.code === "not_found")
|
|
23436
23361
|
return void 0;
|
|
@@ -23488,7 +23413,7 @@ var mailActivity = /* @__PURE__ */ __name(async (store, account, since, chats) =
|
|
|
23488
23413
|
};
|
|
23489
23414
|
}, "mailActivity");
|
|
23490
23415
|
|
|
23491
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
23416
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.624.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._325ff8c9daf4b8769887d5253d3c1255/node_modules/@wirecat/cli-core/dist/services/chat-coverage.js
|
|
23492
23417
|
var chatCoverage = /* @__PURE__ */ __name(async (store, account, chatIds) => {
|
|
23493
23418
|
const ids = [...new Set(chatIds)];
|
|
23494
23419
|
if (ids.length === 0)
|
|
@@ -23514,7 +23439,7 @@ var chatCoverage = /* @__PURE__ */ __name(async (store, account, chatIds) => {
|
|
|
23514
23439
|
}));
|
|
23515
23440
|
}, "chatCoverage");
|
|
23516
23441
|
|
|
23517
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
23442
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.624.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._325ff8c9daf4b8769887d5253d3c1255/node_modules/@wirecat/cli-core/dist/services/agenda.js
|
|
23518
23443
|
var DAY = 864e5;
|
|
23519
23444
|
var AGENDA_DEFAULTS = { unanswered: DAY, waiting: 7 * DAY };
|
|
23520
23445
|
var CLAIMS = ["none", "mine", "others", "any"];
|
|
@@ -23761,7 +23686,7 @@ var agendaItem = /* @__PURE__ */ __name((shown) => {
|
|
|
23761
23686
|
};
|
|
23762
23687
|
}, "agendaItem");
|
|
23763
23688
|
|
|
23764
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
23689
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.624.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._325ff8c9daf4b8769887d5253d3c1255/node_modules/@wirecat/cli-core/dist/context/evidence-response.js
|
|
23765
23690
|
var contextSourceKey = /* @__PURE__ */ __name((source) => JSON.stringify([source.kind, source.accountId, source.provider, source.account]), "contextSourceKey");
|
|
23766
23691
|
var validateContextEvidencePage = /* @__PURE__ */ __name((page, request) => {
|
|
23767
23692
|
const fail2 = /* @__PURE__ */ __name(() => {
|
|
@@ -23825,7 +23750,7 @@ var validateContextEvidencePage = /* @__PURE__ */ __name((page, request) => {
|
|
|
23825
23750
|
}
|
|
23826
23751
|
}, "validateContextEvidencePage");
|
|
23827
23752
|
|
|
23828
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
23753
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.624.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._325ff8c9daf4b8769887d5253d3c1255/node_modules/@wirecat/cli-core/dist/context/read-budget.js
|
|
23829
23754
|
var contextReadBudget = /* @__PURE__ */ __name((limits = {}) => {
|
|
23830
23755
|
if (!limits || typeof limits !== "object" || Array.isArray(limits))
|
|
23831
23756
|
throw new CliError("validation_error", "limits needs a context read allowance");
|
|
@@ -23878,7 +23803,7 @@ var contextReadBudget = /* @__PURE__ */ __name((limits = {}) => {
|
|
|
23878
23803
|
};
|
|
23879
23804
|
}, "contextReadBudget");
|
|
23880
23805
|
|
|
23881
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
23806
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.624.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._325ff8c9daf4b8769887d5253d3c1255/node_modules/@wirecat/cli-core/dist/services/context-evidence.js
|
|
23882
23807
|
var createContextEvidenceReader = /* @__PURE__ */ __name((port, allowed, limits) => {
|
|
23883
23808
|
if (!port || typeof port.read !== "function")
|
|
23884
23809
|
throw new CliError("configuration_error", "context evidence reader is unavailable");
|
|
@@ -23922,7 +23847,7 @@ var createContextEvidenceReader = /* @__PURE__ */ __name((port, allowed, limits)
|
|
|
23922
23847
|
};
|
|
23923
23848
|
}, "createContextEvidenceReader");
|
|
23924
23849
|
|
|
23925
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
23850
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.624.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._325ff8c9daf4b8769887d5253d3c1255/node_modules/@wirecat/cli-core/dist/services/excerpt.js
|
|
23926
23851
|
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");
|
|
23927
23852
|
var excerpt = /* @__PURE__ */ __name((text2, query, size2 = 240, options2 = {}) => {
|
|
23928
23853
|
const flat = text2.replace(/\s+/g, " ").trim();
|
|
@@ -23938,7 +23863,7 @@ var excerpt = /* @__PURE__ */ __name((text2, query, size2 = 240, options2 = {})
|
|
|
23938
23863
|
}, "excerpt");
|
|
23939
23864
|
var withExcerpt = /* @__PURE__ */ __name(({ matchedText, ...hit }, query) => ({ ...hit, excerpt: excerpt(matchedText ?? hit.text, query) }), "withExcerpt");
|
|
23940
23865
|
|
|
23941
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
23866
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.624.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._325ff8c9daf4b8769887d5253d3c1255/node_modules/@wirecat/cli-core/dist/services/project-purposes.js
|
|
23942
23867
|
var BUILT_IN_PURPOSES = ["work", "sales", "support", "other"];
|
|
23943
23868
|
var DEFAULT_PURPOSES = ["work"];
|
|
23944
23869
|
var LINK_PURPOSE = "work";
|
|
@@ -23968,7 +23893,7 @@ var purposeList = /* @__PURE__ */ __name((value, previous = []) => [
|
|
|
23968
23893
|
...value.split(",").map((one) => one.trim()).filter(Boolean)
|
|
23969
23894
|
], "purposeList");
|
|
23970
23895
|
|
|
23971
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
23896
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.624.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._325ff8c9daf4b8769887d5253d3c1255/node_modules/@wirecat/cli-core/dist/services/project-gathering-around.js
|
|
23972
23897
|
var storedMessageNeighbours = /* @__PURE__ */ __name((messages) => ({
|
|
23973
23898
|
async around(ref, window3) {
|
|
23974
23899
|
const at = parseLocator(ref);
|
|
@@ -24063,7 +23988,7 @@ var storedNeighbours = /* @__PURE__ */ __name((store) => {
|
|
|
24063
23988
|
};
|
|
24064
23989
|
}, "storedNeighbours");
|
|
24065
23990
|
|
|
24066
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
23991
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.624.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._325ff8c9daf4b8769887d5253d3c1255/node_modules/@wirecat/cli-core/dist/services/project-gathering-request.js
|
|
24067
23992
|
import { createHash as createHash2 } from "node:crypto";
|
|
24068
23993
|
var DAY2 = 864e5;
|
|
24069
23994
|
var MAX_TIME = 864e13;
|
|
@@ -24379,7 +24304,7 @@ var decodeCheckpoint = /* @__PURE__ */ __name((text2, plan) => {
|
|
|
24379
24304
|
return value;
|
|
24380
24305
|
}, "decodeCheckpoint");
|
|
24381
24306
|
|
|
24382
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
24307
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.624.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._325ff8c9daf4b8769887d5253d3c1255/node_modules/@wirecat/cli-core/dist/services/project-gathering.js
|
|
24383
24308
|
var terminal = /* @__PURE__ */ new Set(["done", "unavailable", "failed"]);
|
|
24384
24309
|
var PAGE3 = 20;
|
|
24385
24310
|
var PEOPLE = 20;
|
|
@@ -24783,7 +24708,7 @@ var peopleOf = /* @__PURE__ */ __name((items, senderOf) => {
|
|
|
24783
24708
|
return [...byKey.values()].sort((a, b) => b.items - a.items || a.name.localeCompare(b.name));
|
|
24784
24709
|
}, "peopleOf");
|
|
24785
24710
|
|
|
24786
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
24711
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.624.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._325ff8c9daf4b8769887d5253d3c1255/node_modules/@wirecat/cli-core/dist/services/meeting-project-candidate-matching.js
|
|
24787
24712
|
var normalizedText = /* @__PURE__ */ __name((text2) => text2.normalize("NFKC").toLowerCase().replace(/\s+/gu, " "), "normalizedText");
|
|
24788
24713
|
var termsOf = /* @__PURE__ */ __name((entry) => [
|
|
24789
24714
|
{ name: entry.name, kind: "canonical" },
|
|
@@ -24827,7 +24752,7 @@ var matchVocabularyTerms = /* @__PURE__ */ __name((catalog, texts) => {
|
|
|
24827
24752
|
return result.sort((a, b) => Number(a.entry.id) - Number(b.entry.id));
|
|
24828
24753
|
}, "matchVocabularyTerms");
|
|
24829
24754
|
|
|
24830
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
24755
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.624.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._325ff8c9daf4b8769887d5253d3c1255/node_modules/@wirecat/cli-core/dist/services/project-gathering-mentions.js
|
|
24831
24756
|
var KINDS = ["project", "tag", "topic"];
|
|
24832
24757
|
var findEvidenceMentions = /* @__PURE__ */ __name(async (vocabulary, gathering, options2 = {}) => {
|
|
24833
24758
|
if (typeof vocabulary?.vocabulary !== "function")
|
|
@@ -24862,7 +24787,7 @@ var findEvidenceMentions = /* @__PURE__ */ __name(async (vocabulary, gathering,
|
|
|
24862
24787
|
continue;
|
|
24863
24788
|
items.push({
|
|
24864
24789
|
target: { kind, id: entry.id, reference, name: entry.name, key: entry.key },
|
|
24865
|
-
matches: matches.map(({ term, source, ambiguous
|
|
24790
|
+
matches: matches.map(({ term, source, ambiguous }) => ({ term, ambiguous, ...source })),
|
|
24866
24791
|
omittedMatches: omitted
|
|
24867
24792
|
});
|
|
24868
24793
|
}
|
|
@@ -24882,7 +24807,7 @@ var findEvidenceMentions = /* @__PURE__ */ __name(async (vocabulary, gathering,
|
|
|
24882
24807
|
};
|
|
24883
24808
|
}, "findEvidenceMentions");
|
|
24884
24809
|
|
|
24885
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
24810
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.624.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._325ff8c9daf4b8769887d5253d3c1255/node_modules/@wirecat/cli-core/dist/services/stored-project-gathering.js
|
|
24886
24811
|
var storedChatCount = /* @__PURE__ */ __name((store) => async (account, chatId, { since, until }) => {
|
|
24887
24812
|
const window3 = { since: new Date(since).toISOString(), until: new Date(until - 1).toISOString() };
|
|
24888
24813
|
const [messages, newest, oldest] = await Promise.all([
|
|
@@ -25188,18 +25113,18 @@ var purposeHintOf = /* @__PURE__ */ __name((linked, rows, of) => {
|
|
|
25188
25113
|
return { chat: top.ref, relationship: link4.relationship, items, of };
|
|
25189
25114
|
}, "purposeHintOf");
|
|
25190
25115
|
|
|
25191
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
25116
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.624.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._325ff8c9daf4b8769887d5253d3c1255/node_modules/@wirecat/cli-core/dist/services/media-archive.js
|
|
25192
25117
|
import { setTimeout as sleep3 } from "node:timers/promises";
|
|
25193
25118
|
|
|
25194
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
25119
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.624.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._325ff8c9daf4b8769887d5253d3c1255/node_modules/@wirecat/cli-core/dist/services/media-archive-files.js
|
|
25195
25120
|
import { lstat } from "node:fs/promises";
|
|
25196
25121
|
|
|
25197
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
25122
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.624.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._325ff8c9daf4b8769887d5253d3c1255/node_modules/@wirecat/cli-core/dist/persistence/native/recording-partial-store.js
|
|
25198
25123
|
import { createHash as createHash4, randomUUID as randomUUID3 } from "node:crypto";
|
|
25199
25124
|
import { open as open3, rename as rename2, unlink as unlink2 } from "node:fs/promises";
|
|
25200
25125
|
import { join as join6 } from "node:path";
|
|
25201
25126
|
|
|
25202
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
25127
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.624.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._325ff8c9daf4b8769887d5253d3c1255/node_modules/@wirecat/cli-core/dist/persistence/native/recording-partial-metadata.js
|
|
25203
25128
|
import { createHash as createHash3 } from "node:crypto";
|
|
25204
25129
|
var metadataLimit = 16384;
|
|
25205
25130
|
var partialIdentity = /* @__PURE__ */ __name((locator) => JSON.stringify([locator.provider, locator.account, locator.occurrenceId, locator.assetId]), "partialIdentity");
|
|
@@ -25259,7 +25184,7 @@ var readPartialMetadata = /* @__PURE__ */ __name(async (path, locator, maxBytes,
|
|
|
25259
25184
|
}
|
|
25260
25185
|
}, "readPartialMetadata");
|
|
25261
25186
|
|
|
25262
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
25187
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.624.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._325ff8c9daf4b8769887d5253d3c1255/node_modules/@wirecat/cli-core/dist/persistence/native/recording-partial-writer.js
|
|
25263
25188
|
import { randomUUID as randomUUID2 } from "node:crypto";
|
|
25264
25189
|
import { open as open2, rename, unlink } from "node:fs/promises";
|
|
25265
25190
|
import { join as join5 } from "node:path";
|
|
@@ -25351,7 +25276,7 @@ var partialWriter = /* @__PURE__ */ __name(async (input) => {
|
|
|
25351
25276
|
};
|
|
25352
25277
|
}, "partialWriter");
|
|
25353
25278
|
|
|
25354
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
25279
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.624.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._325ff8c9daf4b8769887d5253d3c1255/node_modules/@wirecat/cli-core/dist/persistence/native/recording-partial-store.js
|
|
25355
25280
|
var NativeRecordingPartialStore = class {
|
|
25356
25281
|
static {
|
|
25357
25282
|
__name(this, "NativeRecordingPartialStore");
|
|
@@ -25458,12 +25383,12 @@ var NativeRecordingPartialStore = class {
|
|
|
25458
25383
|
}
|
|
25459
25384
|
};
|
|
25460
25385
|
|
|
25461
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
25386
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.624.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._325ff8c9daf4b8769887d5253d3c1255/node_modules/@wirecat/cli-core/dist/persistence/native/recording-publication.js
|
|
25462
25387
|
import { createHash as createHash5 } from "node:crypto";
|
|
25463
25388
|
import { link as link2 } from "node:fs/promises";
|
|
25464
25389
|
import { basename as basename2, dirname as dirname5, join as join8, resolve as resolve2 } from "node:path";
|
|
25465
25390
|
|
|
25466
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
25391
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.624.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._325ff8c9daf4b8769887d5253d3c1255/node_modules/@wirecat/cli-core/dist/persistence/native/recording-publication-files.js
|
|
25467
25392
|
import { unlink as unlink3 } from "node:fs/promises";
|
|
25468
25393
|
var verifiedPublicationFile = /* @__PURE__ */ __name(async (path, expected2, signal, writable = false) => {
|
|
25469
25394
|
signal?.throwIfAborted();
|
|
@@ -25498,7 +25423,7 @@ var commitPublication = /* @__PURE__ */ __name(async (root, partialPath, finalPa
|
|
|
25498
25423
|
signal?.throwIfAborted();
|
|
25499
25424
|
}, "commitPublication");
|
|
25500
25425
|
|
|
25501
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
25426
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.624.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._325ff8c9daf4b8769887d5253d3c1255/node_modules/@wirecat/cli-core/dist/persistence/native/recording-publication-journal.js
|
|
25502
25427
|
import { randomUUID as randomUUID4 } from "node:crypto";
|
|
25503
25428
|
import { open as open4, rename as rename3, unlink as unlink4 } from "node:fs/promises";
|
|
25504
25429
|
import { join as join7 } from "node:path";
|
|
@@ -25571,7 +25496,7 @@ var writePublicationJournal = /* @__PURE__ */ __name(async (root, path, prefix,
|
|
|
25571
25496
|
}
|
|
25572
25497
|
}, "writePublicationJournal");
|
|
25573
25498
|
|
|
25574
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
25499
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.624.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._325ff8c9daf4b8769887d5253d3c1255/node_modules/@wirecat/cli-core/dist/persistence/native/recording-publication.js
|
|
25575
25500
|
var NativeRecordingPublication = class {
|
|
25576
25501
|
static {
|
|
25577
25502
|
__name(this, "NativeRecordingPublication");
|
|
@@ -25644,7 +25569,7 @@ var NativeRecordingPublication = class {
|
|
|
25644
25569
|
}
|
|
25645
25570
|
};
|
|
25646
25571
|
|
|
25647
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
25572
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.624.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._325ff8c9daf4b8769887d5253d3c1255/node_modules/@wirecat/cli-core/dist/services/media-archive-manifest.js
|
|
25648
25573
|
import { createHash as createHash6 } from "node:crypto";
|
|
25649
25574
|
import { readdir } from "node:fs/promises";
|
|
25650
25575
|
import { isAbsolute as isAbsolute2, join as join9, resolve as resolve3 } from "node:path";
|
|
@@ -25731,7 +25656,7 @@ var commitMediaEntry = /* @__PURE__ */ __name((root, one, beforePublish) => writ
|
|
|
25731
25656
|
beforePublish
|
|
25732
25657
|
}), "commitMediaEntry");
|
|
25733
25658
|
|
|
25734
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
25659
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.624.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._325ff8c9daf4b8769887d5253d3c1255/node_modules/@wirecat/cli-core/dist/services/media-archive-files.js
|
|
25735
25660
|
var validator = '"media-completed-v1"';
|
|
25736
25661
|
var maximumFileBytes = 64 * 1024 * 1024 * 1024;
|
|
25737
25662
|
var archiveMediaFile = /* @__PURE__ */ __name(async (root, identity, kind, file2, beforeWrite, signal, metadata = {}) => {
|
|
@@ -25832,7 +25757,7 @@ var archiveMediaFile = /* @__PURE__ */ __name(async (root, identity, kind, file2
|
|
|
25832
25757
|
return entry;
|
|
25833
25758
|
}, "archiveMediaFile");
|
|
25834
25759
|
|
|
25835
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
25760
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.624.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._325ff8c9daf4b8769887d5253d3c1255/node_modules/@wirecat/cli-core/dist/services/media-archive-locks.js
|
|
25836
25761
|
import { mkdir, realpath } from "node:fs/promises";
|
|
25837
25762
|
import { join as join10, resolve as resolve4 } from "node:path";
|
|
25838
25763
|
var archiveLocations = /* @__PURE__ */ __name(async (initial, signal) => {
|
|
@@ -25899,7 +25824,7 @@ var withMediaArchiveLocks = /* @__PURE__ */ __name(async (directory2, signal, ru
|
|
|
25899
25824
|
throw new CliError("validation_error", "archive locations changed during locking; run the command again");
|
|
25900
25825
|
}, "withMediaArchiveLocks");
|
|
25901
25826
|
|
|
25902
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
25827
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.624.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._325ff8c9daf4b8769887d5253d3c1255/node_modules/@wirecat/cli-core/dist/services/media-archive.js
|
|
25903
25828
|
var validateMediaSince = /* @__PURE__ */ __name((value, flag = "--since-time") => {
|
|
25904
25829
|
if (value === void 0)
|
|
25905
25830
|
return void 0;
|
|
@@ -26052,7 +25977,7 @@ var archiveMedia = /* @__PURE__ */ __name(async (ports, options2) => {
|
|
|
26052
25977
|
}, { create: true });
|
|
26053
25978
|
}, "archiveMedia");
|
|
26054
25979
|
|
|
26055
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
25980
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.624.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._325ff8c9daf4b8769887d5253d3c1255/node_modules/@wirecat/cli-core/dist/services/media-archive-move.js
|
|
26056
25981
|
import { realpath as realpath2, unlink as unlink5 } from "node:fs/promises";
|
|
26057
25982
|
import { basename as basename3, dirname as dirname6, join as join11, resolve as resolve5 } from "node:path";
|
|
26058
25983
|
var canonicalDestination = /* @__PURE__ */ __name(async (directory2) => {
|
|
@@ -26205,7 +26130,7 @@ var moveMediaArchive = /* @__PURE__ */ __name(async (options2) => {
|
|
|
26205
26130
|
}, { additional: [target2], createAdditional: !options2.dryRun });
|
|
26206
26131
|
}, "moveMediaArchive");
|
|
26207
26132
|
|
|
26208
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
26133
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.624.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._325ff8c9daf4b8769887d5253d3c1255/node_modules/@wirecat/cli-core/dist/services/model-downloads.js
|
|
26209
26134
|
import { writeFileSync as writeFileSync2 } from "node:fs";
|
|
26210
26135
|
import { join as join12 } from "node:path";
|
|
26211
26136
|
var bytesOf = /* @__PURE__ */ __name((model) => model.files.reduce((sum2, file2) => sum2 + file2.bytes, 0), "bytesOf");
|
|
@@ -26230,7 +26155,7 @@ var downloadTextModel = /* @__PURE__ */ __name(async (id2, { env, progress = /*
|
|
|
26230
26155
|
`);
|
|
26231
26156
|
await nativeRuntime({ env, progress });
|
|
26232
26157
|
progress(`${model.id}: loading it once to check it works`);
|
|
26233
|
-
const { openEmbedder: openEmbedder2 } = await import("./embed-
|
|
26158
|
+
const { openEmbedder: openEmbedder2 } = await import("./embed-ENZ6R4HF.js");
|
|
26234
26159
|
const embedder = await openEmbedder2(model, directory2);
|
|
26235
26160
|
try {
|
|
26236
26161
|
const [vector] = await embedder.embed(["check"], "query");
|
|
@@ -26251,7 +26176,7 @@ var downloadRerankModel = /* @__PURE__ */ __name(async (id2, { env, progress = /
|
|
|
26251
26176
|
}
|
|
26252
26177
|
await nativeRuntime({ env, progress });
|
|
26253
26178
|
progress(`${model.id}: loading it once to check it works`);
|
|
26254
|
-
const { openReranker } = await import("./rerank-
|
|
26179
|
+
const { openReranker } = await import("./rerank-W3WSBDAM.js");
|
|
26255
26180
|
const reranker = await openReranker(model, directory2);
|
|
26256
26181
|
try {
|
|
26257
26182
|
await reranker.score("check", ["check"]);
|
|
@@ -26269,7 +26194,7 @@ var downloadImageModel = /* @__PURE__ */ __name(async (id2, { env, progress = /*
|
|
|
26269
26194
|
await installFiles(placedImage(model, directory2), { progress, ...bytes2 ? { bytes: bytes2 } : {} });
|
|
26270
26195
|
}
|
|
26271
26196
|
progress(`${model.id}: loading it once to check it works`);
|
|
26272
|
-
const { openPictureEmbedder } = await import("./embedder-
|
|
26197
|
+
const { openPictureEmbedder } = await import("./embedder-4CBICMFO.js");
|
|
26273
26198
|
const embedder = await openPictureEmbedder(model, directory2);
|
|
26274
26199
|
try {
|
|
26275
26200
|
const vector = await embedder.embedQuery("check");
|
|
@@ -26281,7 +26206,7 @@ var downloadImageModel = /* @__PURE__ */ __name(async (id2, { env, progress = /*
|
|
|
26281
26206
|
return { model, directory: directory2 };
|
|
26282
26207
|
}, "downloadImageModel");
|
|
26283
26208
|
|
|
26284
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
26209
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.624.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._325ff8c9daf4b8769887d5253d3c1255/node_modules/@wirecat/cli-core/dist/domain/money-words.js
|
|
26285
26210
|
var MONEY_REQUEST = "money-request";
|
|
26286
26211
|
var MONEY_DONE = "money-done";
|
|
26287
26212
|
var PROMISE = "promise";
|
|
@@ -26315,10 +26240,10 @@ var MONEY_WORDS = [
|
|
|
26315
26240
|
}
|
|
26316
26241
|
];
|
|
26317
26242
|
|
|
26318
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
26243
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.624.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._325ff8c9daf4b8769887d5253d3c1255/node_modules/@wirecat/cli-core/dist/services/money-words.js
|
|
26319
26244
|
var moneyClassesOf = /* @__PURE__ */ __name((text2) => listsHit(text2, MONEY_WORDS), "moneyClassesOf");
|
|
26320
26245
|
|
|
26321
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
26246
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.624.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._325ff8c9daf4b8769887d5253d3c1255/node_modules/@wirecat/cli-core/dist/domain/status-words.js
|
|
26322
26247
|
var words = /* @__PURE__ */ __name((forms) => new RegExp(`(?<![\\p{L}\\p{N}])(?:${forms.join("|")})(?![\\p{L}\\p{N}])`, "iu"), "words");
|
|
26323
26248
|
var MONEY_DONE_FORMS = words([
|
|
26324
26249
|
"\u043E\u043F\u043B\u0430\u0442\u0438\u043B[\u0430\u0438]?",
|
|
@@ -26358,7 +26283,7 @@ var PROMISE_FORMS = words([
|
|
|
26358
26283
|
"estar\xE1 listo"
|
|
26359
26284
|
]);
|
|
26360
26285
|
|
|
26361
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
26286
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.624.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._325ff8c9daf4b8769887d5253d3c1255/node_modules/@wirecat/cli-core/dist/services/project-status/items.js
|
|
26362
26287
|
var EXCERPT_CHARS = 80;
|
|
26363
26288
|
var excerpt2 = /* @__PURE__ */ __name((text2) => {
|
|
26364
26289
|
const flat = text2.replace(/\s+/g, " ").trim();
|
|
@@ -26380,7 +26305,7 @@ var whoOf = /* @__PURE__ */ __name((message) => ({
|
|
|
26380
26305
|
var fromOwner = /* @__PURE__ */ __name((message) => message.outgoing === true, "fromOwner");
|
|
26381
26306
|
var day = /* @__PURE__ */ __name((at) => new Date(at).toISOString().slice(0, 10), "day");
|
|
26382
26307
|
|
|
26383
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
26308
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.624.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._325ff8c9daf4b8769887d5253d3c1255/node_modules/@wirecat/cli-core/dist/services/project-status/signals/amounts.js
|
|
26384
26309
|
var MONEY = DEFAULT_TASK_CATEGORIES.filter((category) => category.name === "money");
|
|
26385
26310
|
var verbOf = /* @__PURE__ */ __name((text2) => {
|
|
26386
26311
|
if (MONEY_DONE_FORMS.test(text2))
|
|
@@ -26461,7 +26386,7 @@ var amounts = {
|
|
|
26461
26386
|
attention: /* @__PURE__ */ __name((items) => items.flatMap((item2) => item2.chat !== null && item2.data.state === "asked" ? [{ chat: item2.chat, weight: 2, why: "money asked" }] : []), "attention")
|
|
26462
26387
|
};
|
|
26463
26388
|
|
|
26464
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
26389
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.624.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._325ff8c9daf4b8769887d5253d3c1255/node_modules/@wirecat/cli-core/dist/services/project-status/signals/children.js
|
|
26465
26390
|
var children = {
|
|
26466
26391
|
id: "children",
|
|
26467
26392
|
version: 1,
|
|
@@ -26490,7 +26415,7 @@ var children = {
|
|
|
26490
26415
|
}, "read")
|
|
26491
26416
|
};
|
|
26492
26417
|
|
|
26493
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
26418
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.624.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._325ff8c9daf4b8769887d5253d3c1255/node_modules/@wirecat/cli-core/dist/services/project-status/signals/coverage.js
|
|
26494
26419
|
var coverage = {
|
|
26495
26420
|
id: "coverage",
|
|
26496
26421
|
version: 1,
|
|
@@ -26519,7 +26444,7 @@ var coverage = {
|
|
|
26519
26444
|
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")
|
|
26520
26445
|
};
|
|
26521
26446
|
|
|
26522
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
26447
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.624.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._325ff8c9daf4b8769887d5253d3c1255/node_modules/@wirecat/cli-core/dist/services/project-status/signals/payments.js
|
|
26523
26448
|
var holding2 = /* @__PURE__ */ __name((row) => row.review !== "rejected", "holding");
|
|
26524
26449
|
var item = /* @__PURE__ */ __name((row, at, data) => ({
|
|
26525
26450
|
signal: "payments",
|
|
@@ -26569,7 +26494,7 @@ var payments = {
|
|
|
26569
26494
|
}, "read")
|
|
26570
26495
|
};
|
|
26571
26496
|
|
|
26572
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
26497
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.624.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._325ff8c9daf4b8769887d5253d3c1255/node_modules/@wirecat/cli-core/dist/services/project-status/signals/promises.js
|
|
26573
26498
|
var PATTERNS_PER_CHAT = 3;
|
|
26574
26499
|
var DAY3 = 864e5;
|
|
26575
26500
|
var KINDS2 = /* @__PURE__ */ new Set(["promise", "request"]);
|
|
@@ -26658,7 +26583,7 @@ var promises = {
|
|
|
26658
26583
|
}, "read")
|
|
26659
26584
|
};
|
|
26660
26585
|
|
|
26661
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
26586
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.624.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._325ff8c9daf4b8769887d5253d3c1255/node_modules/@wirecat/cli-core/dist/services/project-status/signals/questions.js
|
|
26662
26587
|
var PER_SIDE = 5;
|
|
26663
26588
|
var WEEK = 7 * 864e5;
|
|
26664
26589
|
var NOBODY = /* @__PURE__ */ new Set();
|
|
@@ -26689,7 +26614,7 @@ var questions2 = {
|
|
|
26689
26614
|
}, "attention")
|
|
26690
26615
|
};
|
|
26691
26616
|
|
|
26692
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
26617
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.624.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._325ff8c9daf4b8769887d5253d3c1255/node_modules/@wirecat/cli-core/dist/services/project-status/signals/reply-next.js
|
|
26693
26618
|
var targetOf = /* @__PURE__ */ __name((message, chat, owners) => {
|
|
26694
26619
|
const byId2 = /* @__PURE__ */ __name((id2) => chat.messages.find((one) => one.id === id2), "byId");
|
|
26695
26620
|
const quoted = message.replyTo ?? (message.replyToId === void 0 ? void 0 : byId2(message.replyToId));
|
|
@@ -26757,7 +26682,7 @@ var replyNext = {
|
|
|
26757
26682
|
attention: /* @__PURE__ */ __name((items) => items.flatMap((item2) => item2.chat !== null && item2.data.next === "owner" ? [{ chat: item2.chat, weight: 2, why: "your move" }] : []), "attention")
|
|
26758
26683
|
};
|
|
26759
26684
|
|
|
26760
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
26685
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.624.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._325ff8c9daf4b8769887d5253d3c1255/node_modules/@wirecat/cli-core/dist/services/project-status/signals/topics.js
|
|
26761
26686
|
var escaped = /* @__PURE__ */ __name((text2) => text2.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), "escaped");
|
|
26762
26687
|
var wholeWord = /* @__PURE__ */ __name((word) => new RegExp(`(?<![\\p{L}\\p{N}])${escaped(word)}(?![\\p{L}\\p{N}])`, "u"), "wholeWord");
|
|
26763
26688
|
var matcherOf = /* @__PURE__ */ __name((query) => {
|
|
@@ -26803,7 +26728,7 @@ var topics = {
|
|
|
26803
26728
|
}, "read")
|
|
26804
26729
|
};
|
|
26805
26730
|
|
|
26806
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
26731
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.624.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._325ff8c9daf4b8769887d5253d3c1255/node_modules/@wirecat/cli-core/dist/services/project-status/signals/index.js
|
|
26807
26732
|
var STATUS_SIGNALS = [
|
|
26808
26733
|
replyNext,
|
|
26809
26734
|
questions2,
|
|
@@ -26815,7 +26740,7 @@ var STATUS_SIGNALS = [
|
|
|
26815
26740
|
children
|
|
26816
26741
|
];
|
|
26817
26742
|
|
|
26818
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
26743
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.624.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._325ff8c9daf4b8769887d5253d3c1255/node_modules/@wirecat/cli-core/dist/services/project-status/index.js
|
|
26819
26744
|
var DAY4 = 864e5;
|
|
26820
26745
|
var STATUS_WINDOW = 300;
|
|
26821
26746
|
var STATUS_CHATS = 16;
|
|
@@ -27004,7 +26929,7 @@ var projectStatus = /* @__PURE__ */ __name(async (store, input) => {
|
|
|
27004
26929
|
};
|
|
27005
26930
|
}, "projectStatus");
|
|
27006
26931
|
|
|
27007
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
26932
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.624.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._325ff8c9daf4b8769887d5253d3c1255/node_modules/@wirecat/cli-core/dist/services/account.js
|
|
27008
26933
|
var accountService = /* @__PURE__ */ __name((deps) => {
|
|
27009
26934
|
const online = /* @__PURE__ */ __name(async (command) => {
|
|
27010
26935
|
if (deps.offline)
|
|
@@ -27076,7 +27001,7 @@ var accountService = /* @__PURE__ */ __name((deps) => {
|
|
|
27076
27001
|
};
|
|
27077
27002
|
}, "accountService");
|
|
27078
27003
|
|
|
27079
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
27004
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.624.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._325ff8c9daf4b8769887d5253d3c1255/node_modules/@wirecat/cli-core/dist/domain/send-time.js
|
|
27080
27005
|
var MINUTE = 6e4;
|
|
27081
27006
|
var YEAR = 365 * 24 * 60 * MINUTE;
|
|
27082
27007
|
var DELAY = /^(\d+)(m|h|d)$/;
|
|
@@ -27095,7 +27020,7 @@ var sendTime = /* @__PURE__ */ __name((value, now = Date.now(), flag = "--at-tim
|
|
|
27095
27020
|
return new Date(at - at % MINUTE).toISOString();
|
|
27096
27021
|
}, "sendTime");
|
|
27097
27022
|
|
|
27098
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
27023
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.624.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._325ff8c9daf4b8769887d5253d3c1255/node_modules/@wirecat/cli-core/dist/services/admin.js
|
|
27099
27024
|
var recordMembership = /* @__PURE__ */ __name(async (deps, operationId, done2, change, fix, write) => {
|
|
27100
27025
|
try {
|
|
27101
27026
|
const held = await accountStoreIfOpen(deps);
|
|
@@ -27342,7 +27267,7 @@ var linkLimits = /* @__PURE__ */ __name(({ approval, expires, maxUses }) => {
|
|
|
27342
27267
|
return expires === void 0 ? void 0 : sendTime(expires, Date.now(), "--expire-time");
|
|
27343
27268
|
}, "linkLimits");
|
|
27344
27269
|
|
|
27345
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
27270
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.624.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._325ff8c9daf4b8769887d5253d3c1255/node_modules/@wirecat/cli-core/dist/services/mail-search.js
|
|
27346
27271
|
var THREADS_PAGE = 500;
|
|
27347
27272
|
var threadsOf = /* @__PURE__ */ __name(async (store, key) => {
|
|
27348
27273
|
const account = await store.accounts.storedAccount(key).catch(() => void 0);
|
|
@@ -27421,7 +27346,7 @@ var readMail = /* @__PURE__ */ __name(async (store, locator, { before: before2 =
|
|
|
27421
27346
|
return thread.slice(Math.max(0, at - before2), at + after + 1).map((hit) => hit.id === message ? { ...hit, anchor: true } : hit);
|
|
27422
27347
|
}, "readMail");
|
|
27423
27348
|
|
|
27424
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
27349
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.624.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._325ff8c9daf4b8769887d5253d3c1255/node_modules/@wirecat/cli-core/dist/search/groups.js
|
|
27425
27350
|
var ALL = "all";
|
|
27426
27351
|
var OWNER_NOTES = { provider: "notes", account: INTERNAL_NOTES };
|
|
27427
27352
|
var NOT_GROUP_NAMES = /* @__PURE__ */ new Set([ALL, "bots"]);
|
|
@@ -27492,7 +27417,7 @@ var groupEntries = /* @__PURE__ */ __name((saved) => ({
|
|
|
27492
27417
|
[ALL]: [ALL]
|
|
27493
27418
|
}), "groupEntries");
|
|
27494
27419
|
|
|
27495
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
27420
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.624.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._325ff8c9daf4b8769887d5253d3c1255/node_modules/@wirecat/cli-core/dist/services/search-kind.js
|
|
27496
27421
|
var NO_MAIL = "no_mail";
|
|
27497
27422
|
var MAIL = "email";
|
|
27498
27423
|
var groupLockOf = /* @__PURE__ */ __name((app, env) => {
|
|
@@ -27566,7 +27491,7 @@ var accountsOfKind = /* @__PURE__ */ __name((kind, chosen, held, explicit, comma
|
|
|
27566
27491
|
return chosenMail.map(({ provider, account }) => ({ provider, account }));
|
|
27567
27492
|
}, "accountsOfKind");
|
|
27568
27493
|
|
|
27569
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
27494
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.624.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._325ff8c9daf4b8769887d5253d3c1255/node_modules/@wirecat/cli-core/dist/services/messages-search.js
|
|
27570
27495
|
var MAIL_FIELDS = /* @__PURE__ */ new Set(["to", "cc", "bcc", "subject", "mailbox", "label", "is"]);
|
|
27571
27496
|
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");
|
|
27572
27497
|
var prepareLucene = /* @__PURE__ */ __name(async (store, account, request, messenger) => {
|
|
@@ -27668,6 +27593,7 @@ var prepareLucene = /* @__PURE__ */ __name(async (store, account, request, messe
|
|
|
27668
27593
|
...request.senders === void 0 ? {} : { senders: request.senders },
|
|
27669
27594
|
...selectedChat ? { chat: selectedChat } : {},
|
|
27670
27595
|
...request.signal ? { signal: request.signal } : {},
|
|
27596
|
+
...request.timeLimitMs === void 0 ? {} : { timeLimitMs: request.timeLimitMs },
|
|
27671
27597
|
newest: request.newest,
|
|
27672
27598
|
...stemmer ? { stemmer } : {},
|
|
27673
27599
|
...unstemmed ? { unstemmed: true } : {},
|
|
@@ -27888,10 +27814,10 @@ var statsLucene = /* @__PURE__ */ __name(async (store, account, request, messeng
|
|
|
27888
27814
|
const groups = prepared.scopeAccounts.length ? await count4(prepared.execution, calendar ? "time" : by) : [];
|
|
27889
27815
|
let rows;
|
|
27890
27816
|
if (calendar) {
|
|
27891
|
-
const
|
|
27817
|
+
const keyOf7 = calendarKey(prepared.timezone, by);
|
|
27892
27818
|
const totals = /* @__PURE__ */ new Map();
|
|
27893
27819
|
for (const { id: id2, count: count5 } of groups) {
|
|
27894
|
-
const key =
|
|
27820
|
+
const key = keyOf7(Number(id2));
|
|
27895
27821
|
totals.set(key, (totals.get(key) ?? 0) + count5);
|
|
27896
27822
|
}
|
|
27897
27823
|
rows = [...totals].sort(([a], [b]) => a.localeCompare(b)).map(([key, count5]) => ({ key, name: null, count: count5 }));
|
|
@@ -27914,7 +27840,7 @@ var statsLucene = /* @__PURE__ */ __name(async (store, account, request, messeng
|
|
|
27914
27840
|
};
|
|
27915
27841
|
}, "statsLucene");
|
|
27916
27842
|
|
|
27917
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
27843
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.624.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._325ff8c9daf4b8769887d5253d3c1255/node_modules/@wirecat/cli-core/dist/services/rankings-selection.js
|
|
27918
27844
|
var RANKING_SELECTION_BYTES = 64 * 1024;
|
|
27919
27845
|
var object2 = /* @__PURE__ */ __name((value) => value !== null && typeof value === "object" && !Array.isArray(value) ? value : void 0, "object");
|
|
27920
27846
|
function invalid3(message = "ranking selection is invalid \u2014 obtain a new drilldown from stats top") {
|
|
@@ -28083,7 +28009,7 @@ var readRankingSelection = /* @__PURE__ */ __name(async (store, input) => {
|
|
|
28083
28009
|
};
|
|
28084
28010
|
}, "readRankingSelection");
|
|
28085
28011
|
|
|
28086
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
28012
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.624.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._325ff8c9daf4b8769887d5253d3c1255/node_modules/@wirecat/cli-core/dist/services/search-record.js
|
|
28087
28013
|
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");
|
|
28088
28014
|
var searchRecordOf = /* @__PURE__ */ __name((command, params) => ({
|
|
28089
28015
|
command,
|
|
@@ -28093,7 +28019,7 @@ var searchRecordOf = /* @__PURE__ */ __name((command, params) => ({
|
|
|
28093
28019
|
fieldsVersion: FIELD_VERSION
|
|
28094
28020
|
}), "searchRecordOf");
|
|
28095
28021
|
|
|
28096
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
28022
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.624.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._325ff8c9daf4b8769887d5253d3c1255/node_modules/@wirecat/cli-core/dist/services/admin-statistics.js
|
|
28097
28023
|
function invalid4(message) {
|
|
28098
28024
|
throw new CliError("validation_error", message);
|
|
28099
28025
|
}
|
|
@@ -28387,7 +28313,7 @@ var adminStatisticsService = /* @__PURE__ */ __name((deps) => ({
|
|
|
28387
28313
|
}, "evidence")
|
|
28388
28314
|
}), "adminStatisticsService");
|
|
28389
28315
|
|
|
28390
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
28316
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.624.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._325ff8c9daf4b8769887d5253d3c1255/node_modules/@wirecat/cli-core/dist/services/archive-gaps.js
|
|
28391
28317
|
import { createHash as createHash7, randomUUID as randomUUID5 } from "node:crypto";
|
|
28392
28318
|
var GAP_BOUNDS = { maxGaps: 5, limit: 500, timeMs: 3e4 };
|
|
28393
28319
|
var validateRepair = /* @__PURE__ */ __name((messenger, options2) => {
|
|
@@ -28524,12 +28450,12 @@ var gapsService = /* @__PURE__ */ __name((deps) => {
|
|
|
28524
28450
|
return { plan, repair };
|
|
28525
28451
|
}, "gapsService");
|
|
28526
28452
|
|
|
28527
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
28453
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.624.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._325ff8c9daf4b8769887d5253d3c1255/node_modules/@wirecat/cli-core/dist/services/attachments.js
|
|
28528
28454
|
import { createHash as createHash9 } from "node:crypto";
|
|
28529
28455
|
import { constants as constants2, mkdirSync as mkdirSync5 } from "node:fs";
|
|
28530
28456
|
import { lstat as lstat4, open as open6, readFile, stat as stat2 } from "node:fs/promises";
|
|
28531
28457
|
|
|
28532
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
28458
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.624.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._325ff8c9daf4b8769887d5253d3c1255/node_modules/@wirecat/cli-core/dist/attachments/directory.js
|
|
28533
28459
|
import { lstat as lstat2, readdir as readdir2, realpath as realpath3 } from "node:fs/promises";
|
|
28534
28460
|
import { basename as basename4, join as join13, relative as relative2, sep as sep2 } from "node:path";
|
|
28535
28461
|
var MAX_FILES = 1e4;
|
|
@@ -28600,15 +28526,15 @@ var directoryPaths = /* @__PURE__ */ __name(async (store, chat, directory2, app,
|
|
|
28600
28526
|
return choices;
|
|
28601
28527
|
}, "directoryPaths");
|
|
28602
28528
|
|
|
28603
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
28529
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.624.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._325ff8c9daf4b8769887d5253d3c1255/node_modules/@wirecat/cli-core/dist/attachments/documents.js
|
|
28604
28530
|
import { posix } from "node:path";
|
|
28605
28531
|
|
|
28606
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
28532
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.624.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._325ff8c9daf4b8769887d5253d3c1255/node_modules/@wirecat/cli-core/dist/attachments/container.js
|
|
28607
28533
|
import { setImmediate as tick } from "node:timers/promises";
|
|
28608
28534
|
import { crc32 } from "node:zlib";
|
|
28609
28535
|
var import_xmldom = __toESM(require_lib(), 1);
|
|
28610
28536
|
|
|
28611
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
28537
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.624.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._325ff8c9daf4b8769887d5253d3c1255/node_modules/@wirecat/cli-core/dist/attachments/encoding.js
|
|
28612
28538
|
var import_chardet = __toESM(require_lib2(), 1);
|
|
28613
28539
|
var import_iconv_lite = __toESM(require_lib3(), 1);
|
|
28614
28540
|
var SAMPLE = 65536;
|
|
@@ -28710,7 +28636,7 @@ var decodeXml = /* @__PURE__ */ __name((bytes2) => {
|
|
|
28710
28636
|
return result.text;
|
|
28711
28637
|
}, "decodeXml");
|
|
28712
28638
|
|
|
28713
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
28639
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.624.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._325ff8c9daf4b8769887d5253d3c1255/node_modules/@wirecat/cli-core/dist/attachments/container.js
|
|
28714
28640
|
var MAX_PART = 10 * 1024 * 1024;
|
|
28715
28641
|
var MAX_ENTRIES = 1e3;
|
|
28716
28642
|
var decoder = new TextDecoder("utf-8", { fatal: true });
|
|
@@ -28925,7 +28851,7 @@ var elements = /* @__PURE__ */ __name((node, name, namespace) => {
|
|
|
28925
28851
|
return found;
|
|
28926
28852
|
}, "elements");
|
|
28927
28853
|
|
|
28928
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
28854
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.624.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._325ff8c9daf4b8769887d5253d3c1255/node_modules/@wirecat/cli-core/dist/attachments/sheets.js
|
|
28929
28855
|
var columnName = /* @__PURE__ */ __name((column) => {
|
|
28930
28856
|
let name = "";
|
|
28931
28857
|
for (let rest = column; rest > 0; rest = Math.floor((rest - 1) / 26))
|
|
@@ -28980,7 +28906,7 @@ var sheetText = /* @__PURE__ */ __name((sheets2, maxChars = MAX_TEXT_CHARS) => {
|
|
|
28980
28906
|
return { text: parts.join("").trim(), truncated: false };
|
|
28981
28907
|
}, "sheetText");
|
|
28982
28908
|
|
|
28983
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
28909
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.624.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._325ff8c9daf4b8769887d5253d3c1255/node_modules/@wirecat/cli-core/dist/attachments/documents.js
|
|
28984
28910
|
var OFFICE = "urn:oasis:names:tc:opendocument:xmlns:office:1.0";
|
|
28985
28911
|
var TEXT = "urn:oasis:names:tc:opendocument:xmlns:text:1.0";
|
|
28986
28912
|
var TABLE = "urn:oasis:names:tc:opendocument:xmlns:table:1.0";
|
|
@@ -29380,10 +29306,10 @@ var readDocument = /* @__PURE__ */ __name(async (bytes2, kind, signal) => {
|
|
|
29380
29306
|
}
|
|
29381
29307
|
}, "readDocument");
|
|
29382
29308
|
|
|
29383
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
29309
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.624.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._325ff8c9daf4b8769887d5253d3c1255/node_modules/@wirecat/cli-core/dist/attachments/extract.js
|
|
29384
29310
|
import { extname as extname3 } from "node:path";
|
|
29385
29311
|
|
|
29386
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
29312
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.624.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._325ff8c9daf4b8769887d5253d3c1255/node_modules/@wirecat/cli-core/dist/readers/engine.js
|
|
29387
29313
|
import { readFileSync as readFileSync5 } from "node:fs";
|
|
29388
29314
|
import { dirname as dirname7, extname as extname2, join as join14 } from "node:path";
|
|
29389
29315
|
import { fileURLToPath } from "node:url";
|
|
@@ -29444,7 +29370,7 @@ var derived = /* @__PURE__ */ __name((bytes2, extractor, read) => {
|
|
|
29444
29370
|
}
|
|
29445
29371
|
}, "derived");
|
|
29446
29372
|
|
|
29447
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
29373
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.624.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._325ff8c9daf4b8769887d5253d3c1255/node_modules/@wirecat/cli-core/dist/readers/image/index.js
|
|
29448
29374
|
var IMAGES = /* @__PURE__ */ new Set([".jpg", ".jpeg", ".png", ".webp", ".gif", ".heic", ".tif", ".tiff", ".bmp"]);
|
|
29449
29375
|
var image2 = {
|
|
29450
29376
|
id: "image",
|
|
@@ -29453,7 +29379,7 @@ var image2 = {
|
|
|
29453
29379
|
read: /* @__PURE__ */ __name(async () => ({ status: "needs-agent" }), "read")
|
|
29454
29380
|
};
|
|
29455
29381
|
|
|
29456
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
29382
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.624.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._325ff8c9daf4b8769887d5253d3c1255/node_modules/@wirecat/cli-core/dist/readers/doc/index.js
|
|
29457
29383
|
var OLE = "\xD0\xCF\xE0\xA1\xB1\xE1";
|
|
29458
29384
|
var doc = {
|
|
29459
29385
|
id: "doc",
|
|
@@ -29465,7 +29391,7 @@ var doc = {
|
|
|
29465
29391
|
}), "read")
|
|
29466
29392
|
};
|
|
29467
29393
|
|
|
29468
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
29394
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.624.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._325ff8c9daf4b8769887d5253d3c1255/node_modules/@wirecat/cli-core/dist/readers/docx/index.js
|
|
29469
29395
|
var DOCX = "application/vnd.openxmlformats-officedocument.wordprocessingml.document";
|
|
29470
29396
|
var docx = {
|
|
29471
29397
|
id: "docx",
|
|
@@ -29478,7 +29404,7 @@ var docx = {
|
|
|
29478
29404
|
}), "read")
|
|
29479
29405
|
};
|
|
29480
29406
|
|
|
29481
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
29407
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.624.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._325ff8c9daf4b8769887d5253d3c1255/node_modules/@wirecat/cli-core/dist/attachments/markup.js
|
|
29482
29408
|
var import_iconv_lite2 = __toESM(require_lib3(), 1);
|
|
29483
29409
|
var RTF_SKIPPED = /* @__PURE__ */ new Set([
|
|
29484
29410
|
"fonttbl",
|
|
@@ -29654,7 +29580,7 @@ var htmlText = /* @__PURE__ */ __name((source) => {
|
|
|
29654
29580
|
}, "htmlText");
|
|
29655
29581
|
var safeChar = /* @__PURE__ */ __name((code, fallback) => code > 0 && code <= 1114111 ? String.fromCodePoint(code) : fallback, "safeChar");
|
|
29656
29582
|
|
|
29657
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
29583
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.624.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._325ff8c9daf4b8769887d5253d3c1255/node_modules/@wirecat/cli-core/dist/readers/html/page.js
|
|
29658
29584
|
var clean = /* @__PURE__ */ __name((value) => typeof value === "string" ? value.replace(/\s+/g, " ").trim() : "", "clean");
|
|
29659
29585
|
var namesIn = /* @__PURE__ */ __name((value) => [value].flat().map((entry) => typeof entry === "string" ? clean(entry) : clean(entry?.name)).filter(Boolean).join(", "), "namesIn");
|
|
29660
29586
|
var jsonLdNodes = /* @__PURE__ */ __name((document) => {
|
|
@@ -29710,7 +29636,7 @@ var markdownSections = /* @__PURE__ */ __name((text2) => {
|
|
|
29710
29636
|
return found.map((section, index) => ({ ...section, end: found[index + 1]?.start ?? text2.length }));
|
|
29711
29637
|
}, "markdownSections");
|
|
29712
29638
|
|
|
29713
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
29639
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.624.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._325ff8c9daf4b8769887d5253d3c1255/node_modules/@wirecat/cli-core/dist/readers/html/index.js
|
|
29714
29640
|
var HTML = /* @__PURE__ */ new Set([".html", ".htm", ".xhtml"]);
|
|
29715
29641
|
var first = /* @__PURE__ */ __name((...values) => values.find((value) => typeof value === "string" && value !== ""), "first");
|
|
29716
29642
|
var loaded = /* @__PURE__ */ __name(async (load, name) => {
|
|
@@ -29732,7 +29658,7 @@ var readPage = /* @__PURE__ */ __name(async (source, load) => {
|
|
|
29732
29658
|
if (text2 === "")
|
|
29733
29659
|
return void 0;
|
|
29734
29660
|
const title = first(page.title, metadata["og:title"], metadata.title);
|
|
29735
|
-
const
|
|
29661
|
+
const merged2 = {
|
|
29736
29662
|
...metadata,
|
|
29737
29663
|
...title ? { title } : {},
|
|
29738
29664
|
...first(page.author, metadata.author) ? { author: first(page.author, metadata.author) } : {},
|
|
@@ -29743,7 +29669,7 @@ var readPage = /* @__PURE__ */ __name(async (source, load) => {
|
|
|
29743
29669
|
status: "extracted",
|
|
29744
29670
|
text: text2,
|
|
29745
29671
|
extractor: "html:v2",
|
|
29746
|
-
metadata:
|
|
29672
|
+
metadata: merged2,
|
|
29747
29673
|
sections: markdownSections(text2)
|
|
29748
29674
|
};
|
|
29749
29675
|
}, "readPage");
|
|
@@ -29781,7 +29707,7 @@ var html = {
|
|
|
29781
29707
|
}, "read")
|
|
29782
29708
|
};
|
|
29783
29709
|
|
|
29784
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
29710
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.624.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._325ff8c9daf4b8769887d5253d3c1255/node_modules/@wirecat/cli-core/dist/readers/office/index.js
|
|
29785
29711
|
var office = {
|
|
29786
29712
|
id: "office",
|
|
29787
29713
|
version: documentExtractor("odt"),
|
|
@@ -29792,7 +29718,7 @@ var office = {
|
|
|
29792
29718
|
}, "read")
|
|
29793
29719
|
};
|
|
29794
29720
|
|
|
29795
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
29721
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.624.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._325ff8c9daf4b8769887d5253d3c1255/node_modules/@wirecat/cli-core/dist/readers/pdf/index.js
|
|
29796
29722
|
var pdf = {
|
|
29797
29723
|
id: "pdf",
|
|
29798
29724
|
version: "unpdf",
|
|
@@ -29859,7 +29785,7 @@ var pdf = {
|
|
|
29859
29785
|
}), "read")
|
|
29860
29786
|
};
|
|
29861
29787
|
|
|
29862
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
29788
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.624.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._325ff8c9daf4b8769887d5253d3c1255/node_modules/@wirecat/cli-core/dist/readers/plain/index.js
|
|
29863
29789
|
var PLAIN = /* @__PURE__ */ new Set([".txt", ".md", ".markdown", ".csv", ".tsv", ".json", ".log"]);
|
|
29864
29790
|
var isPlain = /* @__PURE__ */ __name((hint) => PLAIN.has(extensionOf(hint)) || hint.mime?.startsWith("text/") || hint.mime === "application/json", "isPlain");
|
|
29865
29791
|
var readPlain = /* @__PURE__ */ __name((bytes2) => {
|
|
@@ -29879,7 +29805,7 @@ var plain = {
|
|
|
29879
29805
|
read: /* @__PURE__ */ __name(async (bytes2) => readPlain(bytes2), "read")
|
|
29880
29806
|
};
|
|
29881
29807
|
|
|
29882
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
29808
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.624.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._325ff8c9daf4b8769887d5253d3c1255/node_modules/@wirecat/cli-core/dist/readers/rtf/index.js
|
|
29883
29809
|
var rtf = {
|
|
29884
29810
|
id: "rtf",
|
|
29885
29811
|
version: "v1",
|
|
@@ -29887,10 +29813,10 @@ var rtf = {
|
|
|
29887
29813
|
read: /* @__PURE__ */ __name(async (bytes2) => derived(bytes2, "rtf:v1", rtfText), "read")
|
|
29888
29814
|
};
|
|
29889
29815
|
|
|
29890
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
29816
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.624.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._325ff8c9daf4b8769887d5253d3c1255/node_modules/@wirecat/cli-core/dist/readers/sheets/index.js
|
|
29891
29817
|
import { basename as basename5 } from "node:path";
|
|
29892
29818
|
|
|
29893
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
29819
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.624.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._325ff8c9daf4b8769887d5253d3c1255/node_modules/@wirecat/cli-core/dist/attachments/csv-spans.js
|
|
29894
29820
|
var delimitedSpans = /* @__PURE__ */ __name((text2, delimiter, maxCells = 1e4) => {
|
|
29895
29821
|
const cells = [];
|
|
29896
29822
|
let row = 1, column = 1, start = 0, quoted = false, truncated = false;
|
|
@@ -29928,7 +29854,7 @@ var delimitedSpans = /* @__PURE__ */ __name((text2, delimiter, maxCells = 1e4) =
|
|
|
29928
29854
|
return { cells, truncated };
|
|
29929
29855
|
}, "delimitedSpans");
|
|
29930
29856
|
|
|
29931
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
29857
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.624.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._325ff8c9daf4b8769887d5253d3c1255/node_modules/@wirecat/cli-core/dist/readers/sheets/index.js
|
|
29932
29858
|
var DELIMITED = {
|
|
29933
29859
|
".csv": ",",
|
|
29934
29860
|
".tsv": " ",
|
|
@@ -29967,7 +29893,7 @@ var sheets = {
|
|
|
29967
29893
|
}, "read")
|
|
29968
29894
|
};
|
|
29969
29895
|
|
|
29970
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
29896
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.624.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._325ff8c9daf4b8769887d5253d3c1255/node_modules/@wirecat/cli-core/dist/readers/registry.js
|
|
29971
29897
|
var BUILT_INS2 = [office, pdf, docx, doc, rtf, html, sheets, plain, image2];
|
|
29972
29898
|
var HEAD_BYTES = 1024;
|
|
29973
29899
|
var readers = [...BUILT_INS2];
|
|
@@ -29977,7 +29903,7 @@ var readWithRegistry = /* @__PURE__ */ __name(async (bytes2, hint, context2) =>
|
|
|
29977
29903
|
return reader ? reader.read(bytes2, hint, context2) : { status: "unsupported" };
|
|
29978
29904
|
}, "readWithRegistry");
|
|
29979
29905
|
|
|
29980
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
29906
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.624.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._325ff8c9daf4b8769887d5253d3c1255/node_modules/@wirecat/cli-core/dist/attachments/extract.js
|
|
29981
29907
|
var importEngine = /* @__PURE__ */ __name((name) => importFrom(new URL("attachments/extract.js", import.meta.resolve("@wirecat/cli-core")).href, name), "importEngine");
|
|
29982
29908
|
var extensionOf2 = /* @__PURE__ */ __name(({ name, path }) => extname3(name ?? path).toLowerCase(), "extensionOf");
|
|
29983
29909
|
var extractText = /* @__PURE__ */ __name(async (bytes2, hint, load, signal, env = process.env) => {
|
|
@@ -31056,7 +30982,7 @@ function imageSize(input) {
|
|
|
31056
30982
|
}
|
|
31057
30983
|
__name(imageSize, "imageSize");
|
|
31058
30984
|
|
|
31059
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
30985
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.624.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._325ff8c9daf4b8769887d5253d3c1255/node_modules/@wirecat/cli-core/dist/attachments/ocr.js
|
|
31060
30986
|
var MAX_PAGES = 20;
|
|
31061
30987
|
var MAX_PIXELS = 2e7;
|
|
31062
30988
|
var cancelled2 = /* @__PURE__ */ __name((signal) => {
|
|
@@ -31207,14 +31133,14 @@ var ocrPdf = /* @__PURE__ */ __name(async (bytes2, pipeline2, load, signal) => {
|
|
|
31207
31133
|
}
|
|
31208
31134
|
}, "ocrPdf");
|
|
31209
31135
|
|
|
31210
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
31136
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.624.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._325ff8c9daf4b8769887d5253d3c1255/node_modules/@wirecat/cli-core/dist/attachments/pdf-preview.js
|
|
31211
31137
|
var pdfPreview = /* @__PURE__ */ __name(async (bytes2, page, signal, load = importEngine, env = process.env) => {
|
|
31212
31138
|
const limits = pdfPreviewLimits(env);
|
|
31213
|
-
const
|
|
31139
|
+
const cancelled3 = /* @__PURE__ */ __name(() => {
|
|
31214
31140
|
if (signal?.aborted)
|
|
31215
31141
|
throw new CliError("cancelled", "PDF preview cancelled");
|
|
31216
31142
|
}, "cancelled");
|
|
31217
|
-
|
|
31143
|
+
cancelled3();
|
|
31218
31144
|
if (!Number.isSafeInteger(page) || page < 1)
|
|
31219
31145
|
throw new CliError("validation_error", "PDF page must be a position from 1");
|
|
31220
31146
|
const optional2 = /* @__PURE__ */ __name(async (name) => {
|
|
@@ -31228,7 +31154,7 @@ var pdfPreview = /* @__PURE__ */ __name(async (bytes2, page, signal, load = impo
|
|
|
31228
31154
|
if (typeof engine.createIsomorphicCanvasFactory !== "function" || typeof engine.renderPageAsImage !== "function")
|
|
31229
31155
|
throw new CliError("validation_error", "PDF page previews need unpdf with rendering support (1.8.1 or later)");
|
|
31230
31156
|
const canvas = await optional2("@napi-rs/canvas");
|
|
31231
|
-
|
|
31157
|
+
cancelled3();
|
|
31232
31158
|
let document;
|
|
31233
31159
|
let closed;
|
|
31234
31160
|
const close = /* @__PURE__ */ __name(() => {
|
|
@@ -31245,7 +31171,7 @@ var pdfPreview = /* @__PURE__ */ __name(async (bytes2, page, signal, load = impo
|
|
|
31245
31171
|
maxImageSize: Math.max(2e7, limits.pixels * limits.pixels)
|
|
31246
31172
|
});
|
|
31247
31173
|
signal?.addEventListener("abort", close, { once: true });
|
|
31248
|
-
|
|
31174
|
+
cancelled3();
|
|
31249
31175
|
if (!Number.isSafeInteger(document.numPages) || document.numPages < 1)
|
|
31250
31176
|
throw new CliError("validation_error", "PDF page count must be a positive integer");
|
|
31251
31177
|
if (page > document.numPages)
|
|
@@ -31263,7 +31189,7 @@ var pdfPreview = /* @__PURE__ */ __name(async (bytes2, page, signal, load = impo
|
|
|
31263
31189
|
} finally {
|
|
31264
31190
|
selected.cleanup();
|
|
31265
31191
|
}
|
|
31266
|
-
|
|
31192
|
+
cancelled3();
|
|
31267
31193
|
if (image3.byteLength > limits.bytes)
|
|
31268
31194
|
throw new CliError("validation_error", `PDF preview exceeds ${limits.bytes / 1024 / 1024} MiB; configure MESSAGING_PDF_PREVIEW_MAX_MIB`);
|
|
31269
31195
|
const { width, height, type } = imageSize(image3);
|
|
@@ -31273,7 +31199,7 @@ var pdfPreview = /* @__PURE__ */ __name(async (bytes2, page, signal, load = impo
|
|
|
31273
31199
|
throw new CliError("validation_error", `PDF preview dimensions exceed ${limits.pixels} pixels per side; configure MESSAGING_PDF_PREVIEW_MAX_PIXELS`);
|
|
31274
31200
|
return { bytes: image3, page, pageCount: document.numPages };
|
|
31275
31201
|
} catch (error) {
|
|
31276
|
-
|
|
31202
|
+
cancelled3();
|
|
31277
31203
|
if (error instanceof CliError)
|
|
31278
31204
|
throw error;
|
|
31279
31205
|
throw new CliError("validation_error", "the retained PDF cannot be rendered");
|
|
@@ -31284,7 +31210,7 @@ var pdfPreview = /* @__PURE__ */ __name(async (bytes2, page, signal, load = impo
|
|
|
31284
31210
|
}
|
|
31285
31211
|
}, "pdfPreview");
|
|
31286
31212
|
|
|
31287
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
31213
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.624.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._325ff8c9daf4b8769887d5253d3c1255/node_modules/@wirecat/cli-core/dist/attachments/transfer.js
|
|
31288
31214
|
import { createHash as createHash8 } from "node:crypto";
|
|
31289
31215
|
import { constants } from "node:fs";
|
|
31290
31216
|
import { lstat as lstat3, open as open5 } from "node:fs/promises";
|
|
@@ -31297,11 +31223,11 @@ var validateWindow = /* @__PURE__ */ __name(({ offsetBytes = 0, chunkBytes = 524
|
|
|
31297
31223
|
var retainedBytes = /* @__PURE__ */ __name(async (path, options2, captureFile = false, env = process.env) => {
|
|
31298
31224
|
const maxBytes = attachmentMaxBytes(env);
|
|
31299
31225
|
const { offsetBytes, chunkBytes } = validateWindow(options2);
|
|
31300
|
-
const
|
|
31226
|
+
const cancelled3 = /* @__PURE__ */ __name(() => {
|
|
31301
31227
|
if (options2.signal?.aborted)
|
|
31302
31228
|
throw new CliError("cancelled", "file transfer cancelled");
|
|
31303
31229
|
}, "cancelled");
|
|
31304
|
-
|
|
31230
|
+
cancelled3();
|
|
31305
31231
|
try {
|
|
31306
31232
|
const before2 = await lstat3(path);
|
|
31307
31233
|
if (!before2.isFile() || before2.isSymbolicLink())
|
|
@@ -31323,7 +31249,7 @@ var retainedBytes = /* @__PURE__ */ __name(async (path, options2, captureFile =
|
|
|
31323
31249
|
let copied = 0;
|
|
31324
31250
|
const scratch = Buffer.alloc(65536);
|
|
31325
31251
|
while (true) {
|
|
31326
|
-
|
|
31252
|
+
cancelled3();
|
|
31327
31253
|
const { bytesRead } = await handle.read(scratch, 0, scratch.length, seen);
|
|
31328
31254
|
if (bytesRead === 0)
|
|
31329
31255
|
break;
|
|
@@ -31341,7 +31267,7 @@ var retainedBytes = /* @__PURE__ */ __name(async (path, options2, captureFile =
|
|
|
31341
31267
|
copied += chunk.copy(bytes2, seen + start - offsetBytes, start, end);
|
|
31342
31268
|
seen += chunk.length;
|
|
31343
31269
|
}
|
|
31344
|
-
|
|
31270
|
+
cancelled3();
|
|
31345
31271
|
const after = await handle.stat();
|
|
31346
31272
|
if (seen !== opened.size || copied !== bytes2.length || after.size !== opened.size || after.mtimeMs !== opened.mtimeMs || after.ctimeMs !== opened.ctimeMs)
|
|
31347
31273
|
throw new CliError("validation_error", "the retained attachment changed; restart its transfer");
|
|
@@ -31365,7 +31291,7 @@ var retainedBytes = /* @__PURE__ */ __name(async (path, options2, captureFile =
|
|
|
31365
31291
|
} catch (error) {
|
|
31366
31292
|
if (error instanceof CliError)
|
|
31367
31293
|
throw error;
|
|
31368
|
-
|
|
31294
|
+
cancelled3();
|
|
31369
31295
|
throw new CliError("not_found", "the retained attachment cannot be read; download it again");
|
|
31370
31296
|
}
|
|
31371
31297
|
}, "retainedBytes");
|
|
@@ -31392,7 +31318,7 @@ var transferMime = /* @__PURE__ */ __name((head, hint, name = null) => {
|
|
|
31392
31318
|
return hint !== null && /^[a-z0-9.+-]+\/[a-z0-9.+-]+$/i.test(hint) ? hint : "application/octet-stream";
|
|
31393
31319
|
}, "transferMime");
|
|
31394
31320
|
|
|
31395
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
31321
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.624.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._325ff8c9daf4b8769887d5253d3c1255/node_modules/@wirecat/cli-core/dist/services/file-download.js
|
|
31396
31322
|
import { createWriteStream, mkdirSync as mkdirSync4 } from "node:fs";
|
|
31397
31323
|
import { link as link3, rm } from "node:fs/promises";
|
|
31398
31324
|
import { join as join15, resolve as resolve6 } from "node:path";
|
|
@@ -31506,7 +31432,7 @@ var save = /* @__PURE__ */ __name(async (file2, directory2, fallbackName, { uniq
|
|
|
31506
31432
|
}
|
|
31507
31433
|
}, "save");
|
|
31508
31434
|
|
|
31509
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
31435
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.624.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._325ff8c9daf4b8769887d5253d3c1255/node_modules/@wirecat/cli-core/dist/services/attachments.js
|
|
31510
31436
|
var ATTACHMENT_QUERY = {
|
|
31511
31437
|
entity: "attachment",
|
|
31512
31438
|
backend: "sql",
|
|
@@ -31929,7 +31855,7 @@ var attachmentsService = /* @__PURE__ */ __name((deps) => ({
|
|
|
31929
31855
|
}, "setText")
|
|
31930
31856
|
}), "attachmentsService");
|
|
31931
31857
|
|
|
31932
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
31858
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.624.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._325ff8c9daf4b8769887d5253d3c1255/node_modules/@wirecat/cli-core/dist/services/chat-documents.js
|
|
31933
31859
|
var chatDocumentsService = /* @__PURE__ */ __name((deps) => ({
|
|
31934
31860
|
list: /* @__PURE__ */ __name(async (chat, { limit, offset, ref }) => {
|
|
31935
31861
|
const store = await accountStore(deps);
|
|
@@ -31959,7 +31885,7 @@ var chatDocumentsService = /* @__PURE__ */ __name((deps) => ({
|
|
|
31959
31885
|
}, "list")
|
|
31960
31886
|
}), "chatDocumentsService");
|
|
31961
31887
|
|
|
31962
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
31888
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.624.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._325ff8c9daf4b8769887d5253d3c1255/node_modules/@wirecat/cli-core/dist/services/retention.js
|
|
31963
31889
|
var observationDuration = /* @__PURE__ */ __name((text2, flag) => {
|
|
31964
31890
|
const match = /^(\d+(?:\.\d+)?)([smhdw])$/.exec(text2);
|
|
31965
31891
|
const units2 = { s: 1e3, m: 6e4, h: 36e5, d: 864e5, w: 6048e5 };
|
|
@@ -32046,7 +31972,7 @@ var isRetentionSelection = /* @__PURE__ */ __name((selection) => {
|
|
|
32046
31972
|
}
|
|
32047
31973
|
}, "isRetentionSelection");
|
|
32048
31974
|
|
|
32049
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
31975
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.624.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._325ff8c9daf4b8769887d5253d3c1255/node_modules/@wirecat/cli-core/dist/services/counters.js
|
|
32050
31976
|
var counterFields = /* @__PURE__ */ __name((text2 = "views,reactions,comments") => {
|
|
32051
31977
|
const fields = text2.split(",").map((one) => one.trim());
|
|
32052
31978
|
if (!fields.length || fields.some((one) => !COUNTER_FIELDS.includes(one)) || new Set(fields).size !== fields.length)
|
|
@@ -32253,7 +32179,7 @@ var countersService = /* @__PURE__ */ __name((deps) => {
|
|
|
32253
32179
|
};
|
|
32254
32180
|
}, "countersService");
|
|
32255
32181
|
|
|
32256
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
32182
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.624.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._325ff8c9daf4b8769887d5253d3c1255/node_modules/@wirecat/cli-core/dist/services/search-refresh.js
|
|
32257
32183
|
var SYNC_KEY = "messages.sync-first";
|
|
32258
32184
|
var SYNC_BOUNDS = { maxChats: 5, timeMs: 3e4, maxMessages: 500 };
|
|
32259
32185
|
var keyOf3 = /* @__PURE__ */ __name((chat) => JSON.stringify([chat.account.provider, chat.account.account, chat.chatId]), "keyOf");
|
|
@@ -32385,7 +32311,7 @@ var withRefresh = /* @__PURE__ */ __name((found, refreshed) => ({
|
|
|
32385
32311
|
...!refreshed || refreshed.complete ? {} : { coverage: { ...found.coverage, state: "stale" } }
|
|
32386
32312
|
}), "withRefresh");
|
|
32387
32313
|
|
|
32388
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
32314
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.624.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._325ff8c9daf4b8769887d5253d3c1255/node_modules/@wirecat/cli-core/dist/services/embeddings-search.js
|
|
32389
32315
|
var CANDIDATES = 50;
|
|
32390
32316
|
var WORD_HITS = 200;
|
|
32391
32317
|
var RRF_K = 60;
|
|
@@ -32613,9 +32539,9 @@ var embeddingsSearch = /* @__PURE__ */ __name((deps) => {
|
|
|
32613
32539
|
};
|
|
32614
32540
|
}, "embeddingsSearch");
|
|
32615
32541
|
var fused = /* @__PURE__ */ __name((meaning, words3, minimumCosine) => {
|
|
32616
|
-
const
|
|
32542
|
+
const merged2 = /* @__PURE__ */ new Map();
|
|
32617
32543
|
meaning.filter(({ score }) => score > minimumCosine).forEach(({ summary, chunk, score, stale, matchedIn }, index) => {
|
|
32618
|
-
|
|
32544
|
+
merged2.set(matchedIn ? `${summary.id}#${chunk.firstMessageId}` : summary.id, {
|
|
32619
32545
|
summary,
|
|
32620
32546
|
chunk,
|
|
32621
32547
|
score,
|
|
@@ -32627,14 +32553,14 @@ var fused = /* @__PURE__ */ __name((meaning, words3, minimumCosine) => {
|
|
|
32627
32553
|
});
|
|
32628
32554
|
words3.forEach(({ summary, chunk }, index) => {
|
|
32629
32555
|
const share = 1 / (RRF_K + index + 1);
|
|
32630
|
-
const held =
|
|
32556
|
+
const held = merged2.get(summary.id);
|
|
32631
32557
|
if (held) {
|
|
32632
32558
|
held.fused += share;
|
|
32633
32559
|
held.by.push("words");
|
|
32634
32560
|
} else
|
|
32635
|
-
|
|
32561
|
+
merged2.set(summary.id, { summary, chunk, score: null, by: ["words"], stale: false, fused: share });
|
|
32636
32562
|
});
|
|
32637
|
-
return [...
|
|
32563
|
+
return [...merged2.values()].sort((a, b) => b.fused - a.fused || (b.score ?? -2) - (a.score ?? -2)).map(({ fused: _, ...hit }) => hit);
|
|
32638
32564
|
}, "fused");
|
|
32639
32565
|
var searchReadiness = /* @__PURE__ */ __name((chats, meaning, outside) => {
|
|
32640
32566
|
const built = new Set(chats.filter(({ state }) => state !== "not-built").map(({ chat }) => chat));
|
|
@@ -32660,13 +32586,13 @@ var meanOf = /* @__PURE__ */ __name((vectors) => {
|
|
|
32660
32586
|
return mean2.map((value) => value / length);
|
|
32661
32587
|
}, "meanOf");
|
|
32662
32588
|
|
|
32663
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
32589
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.624.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._325ff8c9daf4b8769887d5253d3c1255/node_modules/@wirecat/cli-core/dist/services/embeddings.js
|
|
32664
32590
|
var embeddingsService = /* @__PURE__ */ __name((deps) => ({
|
|
32665
32591
|
...embeddingsMaintenance(deps),
|
|
32666
32592
|
...embeddingsSearch(deps)
|
|
32667
32593
|
}), "embeddingsService");
|
|
32668
32594
|
|
|
32669
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
32595
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.624.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._325ff8c9daf4b8769887d5253d3c1255/node_modules/@wirecat/cli-core/dist/services/folders.js
|
|
32670
32596
|
var foldersService = /* @__PURE__ */ __name((deps) => {
|
|
32671
32597
|
const online = /* @__PURE__ */ __name(async (command) => {
|
|
32672
32598
|
if (deps.offline)
|
|
@@ -32807,7 +32733,7 @@ var foldersService = /* @__PURE__ */ __name((deps) => {
|
|
|
32807
32733
|
};
|
|
32808
32734
|
}, "foldersService");
|
|
32809
32735
|
|
|
32810
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
32736
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.624.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._325ff8c9daf4b8769887d5253d3c1255/node_modules/@wirecat/cli-core/dist/services/mentions.js
|
|
32811
32737
|
var REVIEW_COUNT = 500;
|
|
32812
32738
|
var mentionsService = /* @__PURE__ */ __name((deps) => {
|
|
32813
32739
|
const located = /* @__PURE__ */ __name(async () => {
|
|
@@ -32886,7 +32812,7 @@ var mentionsService = /* @__PURE__ */ __name((deps) => {
|
|
|
32886
32812
|
};
|
|
32887
32813
|
}, "mentionsService");
|
|
32888
32814
|
|
|
32889
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
32815
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.624.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._325ff8c9daf4b8769887d5253d3c1255/node_modules/@wirecat/cli-core/dist/domain/message-link.js
|
|
32890
32816
|
var fileLinks = /* @__PURE__ */ __name((attachments) => hitFiles(attachments).map(({ position, kind, name }) => ({
|
|
32891
32817
|
position,
|
|
32892
32818
|
kind,
|
|
@@ -32935,7 +32861,7 @@ var validatePermalink = /* @__PURE__ */ __name((link4) => {
|
|
|
32935
32861
|
return { url: link4.url, access: link4.access, reason: link4.reason };
|
|
32936
32862
|
}, "validatePermalink");
|
|
32937
32863
|
|
|
32938
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
32864
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.624.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._325ff8c9daf4b8769887d5253d3c1255/node_modules/@wirecat/cli-core/dist/domain/pin-duration.js
|
|
32939
32865
|
var spokenSeconds = /* @__PURE__ */ __name((seconds) => {
|
|
32940
32866
|
if (seconds % 86400 === 0 && seconds > 86400)
|
|
32941
32867
|
return `${seconds / 86400}d`;
|
|
@@ -32967,7 +32893,7 @@ var pinDurationOf = /* @__PURE__ */ __name((value, allowed, flag = "--expire-tim
|
|
|
32967
32893
|
return seconds;
|
|
32968
32894
|
}, "pinDurationOf");
|
|
32969
32895
|
|
|
32970
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
32896
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.624.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._325ff8c9daf4b8769887d5253d3c1255/node_modules/@wirecat/cli-core/dist/sends/send-as.js
|
|
32971
32897
|
var sendAsCheck = /* @__PURE__ */ __name((connection, sendAs) => {
|
|
32972
32898
|
if (sendAs === void 0) {
|
|
32973
32899
|
const saved = connection.savedSender?.bind(connection);
|
|
@@ -32992,7 +32918,7 @@ var typedSendAs = /* @__PURE__ */ __name((typed) => {
|
|
|
32992
32918
|
return sendAs;
|
|
32993
32919
|
}, "typedSendAs");
|
|
32994
32920
|
|
|
32995
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
32921
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.624.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._325ff8c9daf4b8769887d5253d3c1255/node_modules/@wirecat/cli-core/dist/search/total.js
|
|
32996
32922
|
var TOTAL_CAP = 1e4;
|
|
32997
32923
|
var totalOf = /* @__PURE__ */ __name((count4, shown, hasMore, exact = true) => {
|
|
32998
32924
|
const least = shown + (hasMore ? 1 : 0);
|
|
@@ -33003,7 +32929,7 @@ var totalOf = /* @__PURE__ */ __name((count4, shown, hasMore, exact = true) => {
|
|
|
33003
32929
|
return { value: count4, relation: exact ? "eq" : "gte" };
|
|
33004
32930
|
}, "totalOf");
|
|
33005
32931
|
|
|
33006
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
32932
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.624.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._325ff8c9daf4b8769887d5253d3c1255/node_modules/@wirecat/cli-core/dist/search/lucene/meaning-parts.js
|
|
33007
32933
|
var WORD_FIELDS = /* @__PURE__ */ new Set(["text", "exact"]);
|
|
33008
32934
|
var fieldsOfQuery = /* @__PURE__ */ __name((root, everything) => {
|
|
33009
32935
|
let narrows = false;
|
|
@@ -33032,7 +32958,7 @@ var meaningWords = /* @__PURE__ */ __name((root) => {
|
|
|
33032
32958
|
return wanted(root).join(" ").trim();
|
|
33033
32959
|
}, "meaningWords");
|
|
33034
32960
|
|
|
33035
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
32961
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.624.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._325ff8c9daf4b8769887d5253d3c1255/node_modules/@wirecat/cli-core/dist/search/question-plan.js
|
|
33036
32962
|
var words2 = /* @__PURE__ */ __name((text2) => normalize(text2).match(/[\p{L}\p{N}]+/gu) ?? [], "words");
|
|
33037
32963
|
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"));
|
|
33038
32964
|
var questionWord = /\b(?:what|which|how|who|where|when|can|could|should)\b|(?:^|\s)(?:сколько|какой|какая|какие|какое|кто|кому|кем|где|когда|как|что|можно|может|могут|ли)(?:\s|$)/iu;
|
|
@@ -33165,7 +33091,7 @@ var questionLookup = /* @__PURE__ */ __name((text2) => {
|
|
|
33165
33091
|
return terms.length ? anyOfTerms(terms, plan.scope) : void 0;
|
|
33166
33092
|
}, "questionLookup");
|
|
33167
33093
|
|
|
33168
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
33094
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.624.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._325ff8c9daf4b8769887d5253d3c1255/node_modules/@wirecat/cli-core/dist/services/messages-combined.js
|
|
33169
33095
|
var COMBINED_DEFAULTS = { candidateDepth: 300, rrfK: 60, rerank: "all", chatCap: 0 };
|
|
33170
33096
|
var tokensOf = /* @__PURE__ */ __name((text2) => normalize(text2).match(/[\p{L}\p{N}\p{Co}\p{M}]+/gu) ?? [], "tokensOf");
|
|
33171
33097
|
var searchCombined = /* @__PURE__ */ __name(async (store, account, request, messenger = {}, options2 = COMBINED_DEFAULTS) => {
|
|
@@ -33180,8 +33106,9 @@ var searchCombined = /* @__PURE__ */ __name(async (store, account, request, mess
|
|
|
33180
33106
|
const check2 = /* @__PURE__ */ __name(() => {
|
|
33181
33107
|
if (request.signal?.aborted)
|
|
33182
33108
|
throw new CliError("validation_error", "search was aborted", { reason: "query.aborted", complete: false });
|
|
33183
|
-
|
|
33184
|
-
|
|
33109
|
+
const limitMs = request.timeLimitMs ?? QUERY_LIMITS.milliseconds;
|
|
33110
|
+
if (performance.now() - started > limitMs)
|
|
33111
|
+
outOfTime(limitMs);
|
|
33185
33112
|
}, "check");
|
|
33186
33113
|
check2();
|
|
33187
33114
|
const spans = request.ast === void 0 && !request.exact && request.text !== void 0 ? implicitTextTerms(request.text) : /* @__PURE__ */ new Set();
|
|
@@ -33354,11 +33281,11 @@ var signals = /* @__PURE__ */ __name((hit, terms, corrections, execution, mode,
|
|
|
33354
33281
|
}
|
|
33355
33282
|
}
|
|
33356
33283
|
const proximity = Number.isFinite(span) ? Math.min(1, terms.length / span) : 0;
|
|
33357
|
-
const
|
|
33358
|
-
return mode === "coverage" ? coverage2 * 4 : mode === "proximity" ? proximity : mode === "phrase" ?
|
|
33284
|
+
const phrase2 = tokens.some((_, index) => terms.every((term, offset) => tokens[index + offset] === term)) ? 1 : 0;
|
|
33285
|
+
return mode === "coverage" ? coverage2 * 4 : mode === "proximity" ? proximity : mode === "phrase" ? phrase2 : coverage2 * 4 + proximity + phrase2;
|
|
33359
33286
|
}, "signals");
|
|
33360
33287
|
|
|
33361
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
33288
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.624.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._325ff8c9daf4b8769887d5253d3c1255/node_modules/@wirecat/cli-core/dist/services/messages-discovery.js
|
|
33362
33289
|
var MEANING_DEPTH = 100;
|
|
33363
33290
|
var RRF_K2 = 60;
|
|
33364
33291
|
var RERANK_DEPTH = 50;
|
|
@@ -33407,8 +33334,9 @@ var searchDiscovery = /* @__PURE__ */ __name(async (store, account, asked, messe
|
|
|
33407
33334
|
const check2 = /* @__PURE__ */ __name(() => {
|
|
33408
33335
|
if (request.signal?.aborted)
|
|
33409
33336
|
throw new CliError("validation_error", "search was aborted", { reason: "query.aborted", complete: false });
|
|
33410
|
-
|
|
33411
|
-
|
|
33337
|
+
const limitMs = request.timeLimitMs ?? QUERY_LIMITS.milliseconds;
|
|
33338
|
+
if (performance.now() - started > limitMs)
|
|
33339
|
+
outOfTime(limitMs);
|
|
33412
33340
|
}, "check");
|
|
33413
33341
|
const union2 = /* @__PURE__ */ new Map();
|
|
33414
33342
|
let truncated = false;
|
|
@@ -33629,36 +33557,36 @@ var filterPks = /* @__PURE__ */ __name(async (store, account, request, messenger
|
|
|
33629
33557
|
return pks === void 0 || pks.length > RANK_WITHIN_MESSAGES ? void 0 : pks;
|
|
33630
33558
|
}, "filterPks");
|
|
33631
33559
|
var nearEligible = /* @__PURE__ */ __name(async (store, account, request, messenger, ranked, scope) => {
|
|
33632
|
-
const
|
|
33633
|
-
const only = ranked.slice(0, MEANING_DEPTH).filter((m) => !request.only || request.only.some((key) =>
|
|
33560
|
+
const keyOf7 = /* @__PURE__ */ __name((one) => JSON.stringify([one.provider, one.account, one.chatId, one.id]), "keyOf");
|
|
33561
|
+
const only = ranked.slice(0, MEANING_DEPTH).filter((m) => !request.only || request.only.some((key) => keyOf7(key) === keyOf7(m))).map(({ provider, account: account2, chatId, id: id2 }) => ({ provider, account: account2, chatId, id: id2 }));
|
|
33634
33562
|
if (!only.length)
|
|
33635
33563
|
return [];
|
|
33636
33564
|
const eligible = await searchLucene(store, account, { ...request, text: void 0, ast: void 0, ...scope, limit: only.length, only, context: 0, thread: void 0 }, messenger);
|
|
33637
33565
|
const hits = new Map(eligible.items.map((hit) => {
|
|
33638
33566
|
const { provider, account: account2 } = parseLocator(hit.locator);
|
|
33639
|
-
return [
|
|
33567
|
+
return [keyOf7({ provider, account: account2, chatId: hit.chatId, id: hit.id }), hit];
|
|
33640
33568
|
}));
|
|
33641
33569
|
return ranked.flatMap((m) => {
|
|
33642
|
-
const hit = hits.get(
|
|
33570
|
+
const hit = hits.get(keyOf7(m));
|
|
33643
33571
|
return hit ? [{ ...hit, cosine: m.score }] : [];
|
|
33644
33572
|
});
|
|
33645
33573
|
}, "nearEligible");
|
|
33646
33574
|
var fusedWithMeaning = /* @__PURE__ */ __name((words3, near2, described) => {
|
|
33647
|
-
const
|
|
33575
|
+
const merged2 = /* @__PURE__ */ new Map();
|
|
33648
33576
|
const by = /* @__PURE__ */ __name((hit, foundBy) => hit.discovery ? { ...hit, discovery: { ...hit.discovery, foundBy } } : hit, "by");
|
|
33649
33577
|
words3.forEach((hit, rank) => {
|
|
33650
|
-
|
|
33578
|
+
merged2.set(hit.locator, { hit: by(hit, ["words"]), rrf: 1 / (RRF_K2 + rank + 1) });
|
|
33651
33579
|
});
|
|
33652
33580
|
near2.forEach(({ cosine: _, ...m }, rank) => {
|
|
33653
33581
|
const share = 1 / (RRF_K2 + rank + 1);
|
|
33654
|
-
const held =
|
|
33582
|
+
const held = merged2.get(m.locator);
|
|
33655
33583
|
if (held) {
|
|
33656
33584
|
held.rrf += share;
|
|
33657
33585
|
held.hit = by(held.hit, ["words", "meaning"]);
|
|
33658
33586
|
} else
|
|
33659
|
-
|
|
33587
|
+
merged2.set(m.locator, { hit: by(described({ ...m, fused: 0 }), ["meaning"]), rrf: share });
|
|
33660
33588
|
});
|
|
33661
|
-
return [...
|
|
33589
|
+
return [...merged2.values()].sort((a, b) => b.rrf - a.rrf).map(({ hit, rrf }) => ({ ...hit, score: rrf }));
|
|
33662
33590
|
}, "fusedWithMeaning");
|
|
33663
33591
|
var PARENT_CHARACTERS = 300;
|
|
33664
33592
|
var pairInput = /* @__PURE__ */ __name((hit, parent) => {
|
|
@@ -33683,7 +33611,7 @@ var mixedWithReranker = /* @__PURE__ */ __name((head, scores) => {
|
|
|
33683
33611
|
})).sort((a, b) => b.mixed - a.mixed).map(({ hit }) => hit);
|
|
33684
33612
|
}, "mixedWithReranker");
|
|
33685
33613
|
|
|
33686
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
33614
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.624.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._325ff8c9daf4b8769887d5253d3c1255/node_modules/@wirecat/cli-core/dist/services/thread-context.js
|
|
33687
33615
|
var THREAD_BOUNDS = { maxHops: 8, maxMessages: 50, maxBytes: 65536, withinMs: 864e5 };
|
|
33688
33616
|
var bytes = /* @__PURE__ */ __name((items, links) => Buffer.byteLength(JSON.stringify({ items, links }), "utf8"), "bytes");
|
|
33689
33617
|
var threadBounds = /* @__PURE__ */ __name((options2 = {}) => {
|
|
@@ -33882,7 +33810,7 @@ var readThreadContext = /* @__PURE__ */ __name(async (store, account, chat, mess
|
|
|
33882
33810
|
return result;
|
|
33883
33811
|
}, "readThreadContext");
|
|
33884
33812
|
|
|
33885
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
33813
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.624.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._325ff8c9daf4b8769887d5253d3c1255/node_modules/@wirecat/cli-core/dist/services/messages-archive-search.js
|
|
33886
33814
|
var SEARCH_FILL_MS = 200;
|
|
33887
33815
|
var statsStore = /* @__PURE__ */ __name(async (store, account, request, messenger = {}) => {
|
|
33888
33816
|
const stop = Date.now() + SEARCH_FILL_MS;
|
|
@@ -33951,7 +33879,7 @@ var accountOf2 = /* @__PURE__ */ __name((hit) => {
|
|
|
33951
33879
|
}, "accountOf");
|
|
33952
33880
|
var keyOf4 = /* @__PURE__ */ __name(({ provider, account }) => `${provider}/${account}`, "keyOf");
|
|
33953
33881
|
|
|
33954
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
33882
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.624.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._325ff8c9daf4b8769887d5253d3c1255/node_modules/@wirecat/cli-core/dist/services/meaning-model.js
|
|
33955
33883
|
var meaningModel = /* @__PURE__ */ __name(async (store, env = process.env) => {
|
|
33956
33884
|
const chosen = chosenTextModel(env);
|
|
33957
33885
|
if (chosen.from === "chosen" || chosen.id !== DEFAULT_TEXT_MODEL)
|
|
@@ -33966,12 +33894,12 @@ var meaningModel = /* @__PURE__ */ __name(async (store, env = process.env) => {
|
|
|
33966
33894
|
return (counts.get(before2) ?? 0) > (counts.get(now) ?? 0) ? previous.id : current.id;
|
|
33967
33895
|
}, "meaningModel");
|
|
33968
33896
|
|
|
33969
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
33897
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.624.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._325ff8c9daf4b8769887d5253d3c1255/node_modules/@wirecat/cli-core/dist/services/pictures.js
|
|
33970
33898
|
import { createHash as createHash10 } from "node:crypto";
|
|
33971
33899
|
import { readFile as readFile2, stat as stat3 } from "node:fs/promises";
|
|
33972
33900
|
import { setTimeout as sleep4 } from "node:timers/promises";
|
|
33973
33901
|
|
|
33974
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
33902
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.624.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._325ff8c9daf4b8769887d5253d3c1255/node_modules/@wirecat/cli-core/dist/domain/models.js
|
|
33975
33903
|
var GROUP_SETTINGS = [
|
|
33976
33904
|
"allCanPin",
|
|
33977
33905
|
"onlyAdminsAdd",
|
|
@@ -33985,7 +33913,7 @@ var ADMIN_RIGHTS = ["read", "members", "admins", "info", "pin", "link", "post",
|
|
|
33985
33913
|
var senderIsMe = /* @__PURE__ */ __name((message, account) => message.outgoing === true || message.senderId !== null && String(message.senderId) === account, "senderIsMe");
|
|
33986
33914
|
var MEDIA_KINDS = ["photo", "video", "file", "audio", "link"];
|
|
33987
33915
|
|
|
33988
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
33916
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.624.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._325ff8c9daf4b8769887d5253d3c1255/node_modules/@wirecat/cli-core/dist/services/pictures.js
|
|
33989
33917
|
var PICTURE_MAX_BYTES = 25 * 1024 * 1024;
|
|
33990
33918
|
var PICTURE_FLOOR = 0.25;
|
|
33991
33919
|
var PAGE5 = 50;
|
|
@@ -34002,7 +33930,7 @@ var picturesService = /* @__PURE__ */ __name((deps) => {
|
|
|
34002
33930
|
const directory2 = imageModelsDirectory(deps.env);
|
|
34003
33931
|
if (!isImageModelInstalled(model2, directory2))
|
|
34004
33932
|
throw new CliError("not_found", missingModel(model2.id), { reason: "model.not-downloaded", model: model2.id });
|
|
34005
|
-
const { openPictureEmbedder } = await import("./embedder-
|
|
33933
|
+
const { openPictureEmbedder } = await import("./embedder-4CBICMFO.js");
|
|
34006
33934
|
return openPictureEmbedder(model2, directory2);
|
|
34007
33935
|
}, "open");
|
|
34008
33936
|
const embedder = /* @__PURE__ */ __name(() => {
|
|
@@ -34199,7 +34127,7 @@ var withPictures = /* @__PURE__ */ __name((messages, pictures) => ({
|
|
|
34199
34127
|
}, "search")
|
|
34200
34128
|
}), "withPictures");
|
|
34201
34129
|
|
|
34202
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34130
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.624.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._325ff8c9daf4b8769887d5253d3c1255/node_modules/@wirecat/cli-core/dist/services/messages-meaning.js
|
|
34203
34131
|
var meaningText = /* @__PURE__ */ __name((question) => {
|
|
34204
34132
|
try {
|
|
34205
34133
|
const text2 = questionLookup(question) === void 0 ? question : questionText(question);
|
|
@@ -34278,7 +34206,7 @@ var meaningLane = /* @__PURE__ */ __name((deps) => async (question, accounts, sh
|
|
|
34278
34206
|
}
|
|
34279
34207
|
}, "meaningLane");
|
|
34280
34208
|
|
|
34281
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34209
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.624.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._325ff8c9daf4b8769887d5253d3c1255/node_modules/@wirecat/cli-core/dist/services/messages-rerank.js
|
|
34282
34210
|
var rerankLane = /* @__PURE__ */ __name((deps) => {
|
|
34283
34211
|
const choice = deps.reranker ?? DEFAULT_RERANK_MODEL;
|
|
34284
34212
|
if (choice === "off")
|
|
@@ -34290,9 +34218,9 @@ var rerankLane = /* @__PURE__ */ __name((deps) => {
|
|
|
34290
34218
|
return { skipped: { reason: `${model.id} is not downloaded`, step: "models.download", model: model.id } };
|
|
34291
34219
|
try {
|
|
34292
34220
|
const warm = deps.embedders;
|
|
34293
|
-
const reranker = warm ? await warm.reranker(`rerank:${model.id}`, async () => (await import("./process-
|
|
34221
|
+
const reranker = warm ? await warm.reranker(`rerank:${model.id}`, async () => (await import("./process-63F4PNWH.js")).openRerankerProcess(model, directory2, {
|
|
34294
34222
|
threads: defaultThreads()
|
|
34295
|
-
})) : await (await import("./rerank-
|
|
34223
|
+
})) : await (await import("./rerank-W3WSBDAM.js")).openReranker(model, directory2);
|
|
34296
34224
|
return {
|
|
34297
34225
|
model: model.id,
|
|
34298
34226
|
score: /* @__PURE__ */ __name((question, passages) => reranker.score(plainWords(question), passages), "score"),
|
|
@@ -34312,17 +34240,142 @@ var rerankLane = /* @__PURE__ */ __name((deps) => {
|
|
|
34312
34240
|
};
|
|
34313
34241
|
}, "rerankLane");
|
|
34314
34242
|
|
|
34315
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34243
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.624.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._325ff8c9daf4b8769887d5253d3c1255/node_modules/@wirecat/cli-core/dist/search/question-period.js
|
|
34244
|
+
var DAY5 = 864e5;
|
|
34245
|
+
var SPAN = { start: 0, end: 0 };
|
|
34246
|
+
var phrase = /* @__PURE__ */ __name((source) => new RegExp(`(?<![\\p{L}\\p{N}])(?:${source})(?![\\p{L}\\p{N}])`, "giu"), "phrase");
|
|
34247
|
+
var MONTHS = [
|
|
34248
|
+
new RegExp("january|\u044F\u043D\u0432\u0430\u0440\\p{L}*", "u"),
|
|
34249
|
+
new RegExp("february|\u0444\u0435\u0432\u0440\u0430\u043B\\p{L}*", "u"),
|
|
34250
|
+
new RegExp("march|\u043C\u0430\u0440\u0442\\p{L}*", "u"),
|
|
34251
|
+
new RegExp("april|\u0430\u043F\u0440\u0435\u043B\\p{L}*", "u"),
|
|
34252
|
+
/may|ма[йяе]/u,
|
|
34253
|
+
new RegExp("june|\u0438\u044E\u043D\\p{L}*", "u"),
|
|
34254
|
+
new RegExp("july|\u0438\u044E\u043B\\p{L}*", "u"),
|
|
34255
|
+
new RegExp("august|\u0430\u0432\u0433\u0443\u0441\u0442\\p{L}*", "u"),
|
|
34256
|
+
new RegExp("september|\u0441\u0435\u043D\u0442\u044F\u0431\u0440\\p{L}*", "u"),
|
|
34257
|
+
new RegExp("october|\u043E\u043A\u0442\u044F\u0431\u0440\\p{L}*", "u"),
|
|
34258
|
+
new RegExp("november|\u043D\u043E\u044F\u0431\u0440\\p{L}*", "u"),
|
|
34259
|
+
new RegExp("december|\u0434\u0435\u043A\u0430\u0431\u0440\\p{L}*", "u")
|
|
34260
|
+
];
|
|
34261
|
+
var MONTH = MONTHS.map(({ source }) => source).join("|");
|
|
34262
|
+
var ORDINAL = "(?:st|nd|rd|th)?";
|
|
34263
|
+
var DATED_MONTH = phrase(`(?:(\\d{1,2})${ORDINAL}\\s+(?:of\\s+)?)?(${MONTH})(?:\\s+(\\d{1,2})${ORDINAL}(?!\\p{N}))?(?:,?\\s+(\\d{4}))?`);
|
|
34264
|
+
var MONTH_BEFORE_MAY = /(?:in|of|since|during|until|by|early|late|mid|from|through)\s+$/iu;
|
|
34265
|
+
var monthOf = /* @__PURE__ */ __name((name) => MONTHS.findIndex(({ source }) => new RegExp(`^(?:${source})$`, "iu").test(name)), "monthOf");
|
|
34266
|
+
var monthDays = /* @__PURE__ */ __name((year, month) => [Date.UTC(year, month, 1), Date.UTC(year, month + 1, 0)], "monthDays");
|
|
34267
|
+
var weekDays = /* @__PURE__ */ __name((day2) => {
|
|
34268
|
+
const sinceMonday = (new Date(day2).getUTCDay() + 6) % 7;
|
|
34269
|
+
return [day2 - sinceMonday * DAY5, day2 + (6 - sinceMonday) * DAY5];
|
|
34270
|
+
}, "weekDays");
|
|
34271
|
+
var yearDays = /* @__PURE__ */ __name((year) => [Date.UTC(year, 0, 1), Date.UTC(year, 11, 31)], "yearDays");
|
|
34272
|
+
var unitDays = /* @__PURE__ */ __name((unit, day2) => {
|
|
34273
|
+
const at = new Date(day2);
|
|
34274
|
+
if (/^(?:day|дн|день)/iu.test(unit))
|
|
34275
|
+
return [day2, day2];
|
|
34276
|
+
if (/^(?:week|недел)/iu.test(unit))
|
|
34277
|
+
return weekDays(day2);
|
|
34278
|
+
if (/^(?:month|месяц)/iu.test(unit))
|
|
34279
|
+
return monthDays(at.getUTCFullYear(), at.getUTCMonth());
|
|
34280
|
+
return yearDays(at.getUTCFullYear());
|
|
34281
|
+
}, "unitDays");
|
|
34282
|
+
var unitsBack = /* @__PURE__ */ __name((unit, count4, today) => {
|
|
34283
|
+
const at = new Date(today);
|
|
34284
|
+
if (/^(?:day|дн|день)/iu.test(unit))
|
|
34285
|
+
return today - count4 * DAY5;
|
|
34286
|
+
if (/^(?:week|недел)/iu.test(unit))
|
|
34287
|
+
return today - 7 * count4 * DAY5;
|
|
34288
|
+
if (/^(?:month|месяц)/iu.test(unit))
|
|
34289
|
+
return Date.UTC(at.getUTCFullYear(), at.getUTCMonth() - count4, 1);
|
|
34290
|
+
return Date.UTC(at.getUTCFullYear() - count4, 0, 1);
|
|
34291
|
+
}, "unitsBack");
|
|
34292
|
+
var RULES = [
|
|
34293
|
+
[
|
|
34294
|
+
new RegExp("(?<!\\p{N})(\\d{4})-(\\d{2})-(\\d{2})(?!\\p{N})", "gu"),
|
|
34295
|
+
(part) => {
|
|
34296
|
+
const day2 = Date.UTC(Number(part(1)), Number(part(2)) - 1, Number(part(3)));
|
|
34297
|
+
return [day2, day2];
|
|
34298
|
+
}
|
|
34299
|
+
],
|
|
34300
|
+
[phrase("today|tonight|\u0441\u0435\u0433\u043E\u0434\u043D\u044F"), (_, today) => [today, today]],
|
|
34301
|
+
[phrase("yesterday|\u0432\u0447\u0435\u0440\u0430"), (_, today) => [today - DAY5, today - DAY5]],
|
|
34302
|
+
[phrase("\u043F\u043E\u0437\u0430\u0432\u0447\u0435\u0440\u0430"), (_, today) => [today - 2 * DAY5, today - 2 * DAY5]],
|
|
34303
|
+
[
|
|
34304
|
+
phrase(new RegExp("(\\d+|an?|one)\\s+(days?|weeks?|months?|years?)\\s+ago|(\\d+)\\s+(\u0434\u043D\\p{L}*|\u0434\u0435\u043D\u044C|\u043D\u0435\u0434\u0435\u043B\\p{L}*|\u043C\u0435\u0441\u044F\u0446\\p{L}*|\u0433\u043E\u0434\\p{L}*|\u043B\u0435\u0442)\\s+\u043D\u0430\u0437\u0430\u0434", "u").source),
|
|
34305
|
+
(part, today) => {
|
|
34306
|
+
const n = Number.parseInt(part(1) || part(3), 10) || 1;
|
|
34307
|
+
const word = part(2) || part(4);
|
|
34308
|
+
return unitDays(word, unitsBack(word, n, today));
|
|
34309
|
+
}
|
|
34310
|
+
],
|
|
34311
|
+
[
|
|
34312
|
+
phrase("(?:last|past)\\s+(\\d+)\\s+days|(?:\u043F\u043E\u0441\u043B\u0435\u0434\u043D\u0438\u0435|\u0437\u0430\\s+\u043F\u043E\u0441\u043B\u0435\u0434\u043D\u0438\u0435)\\s+(\\d+)\\s+\u0434\u043D\\p{L}*"),
|
|
34313
|
+
(part, today) => [today - (Number(part(1) || part(2)) - 1) * DAY5, today]
|
|
34314
|
+
],
|
|
34315
|
+
[
|
|
34316
|
+
phrase("(last|past|previous|this)\\s+(week|weekend|month|year)"),
|
|
34317
|
+
(part, today) => {
|
|
34318
|
+
const last = part(1).toLowerCase() !== "this";
|
|
34319
|
+
const unit = part(2);
|
|
34320
|
+
if (unit.toLowerCase() === "weekend") {
|
|
34321
|
+
const [monday] = weekDays(last ? today - 7 * DAY5 : today);
|
|
34322
|
+
return [monday + 5 * DAY5, monday + 6 * DAY5];
|
|
34323
|
+
}
|
|
34324
|
+
return unitDays(unit, last ? unitsBack(unit, 1, today) : today);
|
|
34325
|
+
}
|
|
34326
|
+
],
|
|
34327
|
+
[
|
|
34328
|
+
phrase(new RegExp("(?:\u043D\u0430|\u0432)\\s+(\u043F\u0440\u043E\u0448\u043B|\u044D\u0442)\\p{L}*\\s+(\u043D\u0435\u0434\u0435\u043B\\p{L}*|\u043C\u0435\u0441\u044F\u0446\\p{L}*|\u0433\u043E\u0434\\p{L}*)", "u").source),
|
|
34329
|
+
(part, today) => unitDays(part(2), part(1).toLowerCase() === "\u044D\u0442" ? today : unitsBack(part(2), 1, today))
|
|
34330
|
+
],
|
|
34331
|
+
[
|
|
34332
|
+
DATED_MONTH,
|
|
34333
|
+
(part, today, match) => {
|
|
34334
|
+
const [name, year] = [part(2), part(4)];
|
|
34335
|
+
const day2 = Number(part(1) || part(3) || 0);
|
|
34336
|
+
if (/^may$/iu.test(name) && !day2 && !year && !MONTH_BEFORE_MAY.test(match.input.slice(0, match.index)))
|
|
34337
|
+
return;
|
|
34338
|
+
const month = monthOf(name);
|
|
34339
|
+
const now = new Date(today);
|
|
34340
|
+
const lastYear = month > now.getUTCMonth() || month === now.getUTCMonth() && day2 > now.getUTCDate();
|
|
34341
|
+
const y = year ? Number(year) : now.getUTCFullYear() - (lastYear ? 1 : 0);
|
|
34342
|
+
const [first2, last] = monthDays(y, month);
|
|
34343
|
+
if (!day2 || day2 > new Date(last).getUTCDate())
|
|
34344
|
+
return [first2, last];
|
|
34345
|
+
return [Date.UTC(y, month, day2), Date.UTC(y, month, day2)];
|
|
34346
|
+
}
|
|
34347
|
+
]
|
|
34348
|
+
];
|
|
34349
|
+
var questionPeriod = /* @__PURE__ */ __name((text2, now, zone) => {
|
|
34350
|
+
const today = Date.parse(`${new Intl.DateTimeFormat("en-CA", { timeZone: zone }).format(now)}T00:00:00Z`);
|
|
34351
|
+
const found = [];
|
|
34352
|
+
for (const [pattern, days] of RULES)
|
|
34353
|
+
for (const match of text2.matchAll(pattern)) {
|
|
34354
|
+
const span = days((n) => match[n] ?? "", today, match);
|
|
34355
|
+
if (span)
|
|
34356
|
+
found.push(span);
|
|
34357
|
+
}
|
|
34358
|
+
const inner = found.filter(([first2, last]) => !found.some(([f, l]) => f >= first2 && l <= last && l - f < last - first2));
|
|
34359
|
+
if (!inner.length)
|
|
34360
|
+
return;
|
|
34361
|
+
const iso4 = /* @__PURE__ */ __name((day2) => new Date(day2).toISOString().slice(0, 10), "iso");
|
|
34362
|
+
return {
|
|
34363
|
+
from: dayBoundary(iso4(inner.reduce((min, [first2]) => Math.min(min, first2), Infinity)), zone, false, SPAN),
|
|
34364
|
+
to: dayBoundary(iso4(inner.reduce((max, [, last]) => Math.max(max, last), -Infinity)), zone, true, SPAN)
|
|
34365
|
+
};
|
|
34366
|
+
}, "questionPeriod");
|
|
34367
|
+
|
|
34368
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.624.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._325ff8c9daf4b8769887d5253d3c1255/node_modules/@wirecat/cli-core/dist/services/document-pictures.js
|
|
34316
34369
|
var openPictureEmbedderFor = /* @__PURE__ */ __name(async ({ env, command } = {}) => {
|
|
34317
34370
|
const model = imageModel(DEFAULT_IMAGE_MODEL);
|
|
34318
34371
|
const directory2 = imageModelsDirectory(env);
|
|
34319
34372
|
if (!isImageModelInstalled(model, directory2))
|
|
34320
34373
|
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 });
|
|
34321
|
-
const { openPictureEmbedder } = await import("./embedder-
|
|
34374
|
+
const { openPictureEmbedder } = await import("./embedder-4CBICMFO.js");
|
|
34322
34375
|
return openPictureEmbedder(model, directory2);
|
|
34323
34376
|
}, "openPictureEmbedderFor");
|
|
34324
34377
|
|
|
34325
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34378
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.624.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._325ff8c9daf4b8769887d5253d3c1255/node_modules/@wirecat/cli-core/dist/services/document-source.js
|
|
34326
34379
|
var documentSource = /* @__PURE__ */ __name((note, accounts, profiles, file2) => {
|
|
34327
34380
|
const metadata = note.frontMatter;
|
|
34328
34381
|
const account = accounts.find(({ id: id2 }) => String(id2) === note.folderId);
|
|
@@ -34337,7 +34390,7 @@ var documentSource = /* @__PURE__ */ __name((note, accounts, profiles, file2) =>
|
|
|
34337
34390
|
};
|
|
34338
34391
|
}, "documentSource");
|
|
34339
34392
|
|
|
34340
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34393
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.624.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._325ff8c9daf4b8769887d5253d3c1255/node_modules/@wirecat/cli-core/dist/embeddings/keys.js
|
|
34341
34394
|
var endpointKeyName = /* @__PURE__ */ __name((baseUrl) => {
|
|
34342
34395
|
const host = new URL(baseUrl).host;
|
|
34343
34396
|
return ["openai", "anthropic"].includes(host) ? `endpoint:${host}` : host;
|
|
@@ -34370,7 +34423,7 @@ var embeddingKeys = /* @__PURE__ */ __name((app, env = process.env, keyring) =>
|
|
|
34370
34423
|
};
|
|
34371
34424
|
}, "embeddingKeys");
|
|
34372
34425
|
|
|
34373
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34426
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.624.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._325ff8c9daf4b8769887d5253d3c1255/node_modules/@wirecat/cli-core/dist/models/openai.js
|
|
34374
34427
|
var options = strictObject({
|
|
34375
34428
|
temperature: range(0, 2),
|
|
34376
34429
|
top_p: range(0, 1),
|
|
@@ -34424,7 +34477,7 @@ var openai = {
|
|
|
34424
34477
|
}), "complete")
|
|
34425
34478
|
};
|
|
34426
34479
|
|
|
34427
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34480
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.624.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._325ff8c9daf4b8769887d5253d3c1255/node_modules/@wirecat/cli-core/dist/models/index.js
|
|
34428
34481
|
var modelGateway = /* @__PURE__ */ __name((deps) => ({
|
|
34429
34482
|
complete: /* @__PURE__ */ __name(async (request) => {
|
|
34430
34483
|
if (deps.signal?.aborted)
|
|
@@ -34439,7 +34492,7 @@ var modelGateway = /* @__PURE__ */ __name((deps) => ({
|
|
|
34439
34492
|
if (!adapter && target2.provider === "openai")
|
|
34440
34493
|
adapter = openai;
|
|
34441
34494
|
if (!adapter && target2.provider === "anthropic")
|
|
34442
|
-
adapter = (await import("./anthropic-
|
|
34495
|
+
adapter = (await import("./anthropic-7472H6ES.js")).anthropic;
|
|
34443
34496
|
if (!adapter)
|
|
34444
34497
|
throw new CliError("validation_error", `no model adapter for ${target2.provider}`);
|
|
34445
34498
|
if (request.images !== void 0 && adapter.images !== true)
|
|
@@ -34491,17 +34544,20 @@ var modelGateway = /* @__PURE__ */ __name((deps) => ({
|
|
|
34491
34544
|
}, "complete")
|
|
34492
34545
|
}), "modelGateway");
|
|
34493
34546
|
|
|
34494
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34547
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.624.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._325ff8c9daf4b8769887d5253d3c1255/node_modules/@wirecat/cli-core/dist/services/enrichment-setting.js
|
|
34495
34548
|
var SECTION = "enrichment";
|
|
34496
34549
|
var ENRICHMENT_PROVIDERS = ["openai", "anthropic"];
|
|
34497
34550
|
var DEFAULT_BASE_URLS = {
|
|
34498
34551
|
openai: "https://api.openai.com/v1",
|
|
34499
34552
|
anthropic: "https://api.anthropic.com"
|
|
34500
34553
|
};
|
|
34501
|
-
var
|
|
34554
|
+
var MODEL_CHOICE = {
|
|
34502
34555
|
provider: picklist(ENRICHMENT_PROVIDERS),
|
|
34503
34556
|
model: pipe(string(), trim(), minLength(1), maxLength(200)),
|
|
34504
|
-
base_url: optional(pipe(string(), check((value) => endpoint(value), "use an HTTP/S endpoint without credentials, query or fragment")))
|
|
34557
|
+
base_url: optional(pipe(string(), check((value) => endpoint(value), "use an HTTP/S endpoint without credentials, query or fragment")))
|
|
34558
|
+
};
|
|
34559
|
+
var Setting = strictObject({
|
|
34560
|
+
...MODEL_CHOICE,
|
|
34505
34561
|
/** When the owner agreed that records go to this provider and endpoint; the setting exists only with it. */
|
|
34506
34562
|
consented_at: pipe(string(), isoTimestamp())
|
|
34507
34563
|
});
|
|
@@ -34558,8 +34614,12 @@ var estimateEnrichment = /* @__PURE__ */ __name((records, chars, setting) => {
|
|
|
34558
34614
|
usd: price ? Math.round((input * price.input + output * price.output) * 1e6) / 1e6 : null
|
|
34559
34615
|
};
|
|
34560
34616
|
}, "estimateEnrichment");
|
|
34617
|
+
var costOf = /* @__PURE__ */ __name((usage, setting) => {
|
|
34618
|
+
const price = enrichmentPrice(setting.provider, setting.model, setting.base_url);
|
|
34619
|
+
return price ? Math.round((usage.input * price.input + usage.output * price.output) * 1e6) / 1e6 : null;
|
|
34620
|
+
}, "costOf");
|
|
34561
34621
|
|
|
34562
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34622
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.624.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._325ff8c9daf4b8769887d5253d3c1255/node_modules/@wirecat/cli-core/dist/services/enrichment.js
|
|
34563
34623
|
var ENRICH_PER_RUN = 600;
|
|
34564
34624
|
var MAX_LINE = 400;
|
|
34565
34625
|
var line2 = pipe(unknown(), transform((value) => typeof value === "string" ? value.replace(/\s+/g, " ").trim().slice(0, MAX_LINE) : ""));
|
|
@@ -34635,7 +34695,7 @@ var enrichmentState = /* @__PURE__ */ __name(async (store, env, estimateFor, key
|
|
|
34635
34695
|
};
|
|
34636
34696
|
}, "enrichmentState");
|
|
34637
34697
|
|
|
34638
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34698
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.624.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._325ff8c9daf4b8769887d5253d3c1255/node_modules/@wirecat/cli-core/dist/services/notes-title-tier.js
|
|
34639
34699
|
var plainQueryWords = /* @__PURE__ */ __name((query) => {
|
|
34640
34700
|
let root;
|
|
34641
34701
|
try {
|
|
@@ -34662,7 +34722,7 @@ var titleTiers = /* @__PURE__ */ __name((hits, words3) => {
|
|
|
34662
34722
|
return [...hits].sort((a, b) => rank(a) - rank(b));
|
|
34663
34723
|
}, "titleTiers");
|
|
34664
34724
|
|
|
34665
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34725
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.624.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._325ff8c9daf4b8769887d5253d3c1255/node_modules/@wirecat/cli-core/dist/services/notes-search.js
|
|
34666
34726
|
var storeQuery = /* @__PURE__ */ __name(async (store, text2, { exact, timezone } = {}) => resolvedQuery(store, parsedQuery(text2, exact), timezone), "storeQuery");
|
|
34667
34727
|
var parsedQuery = /* @__PURE__ */ __name((text2, exact) => validateFields(parseLucene(text2, { ...SEARCH_QUERY, defaultField: exact ? "exact" : "text" })).root, "parsedQuery");
|
|
34668
34728
|
var resolvedQuery = /* @__PURE__ */ __name(async (store, root, timezone) => {
|
|
@@ -34942,13 +35002,13 @@ var searchNotes = /* @__PURE__ */ __name(async (store, query, { limit = 20, offs
|
|
|
34942
35002
|
meaningSkipped = error.message;
|
|
34943
35003
|
}
|
|
34944
35004
|
}
|
|
34945
|
-
const
|
|
34946
|
-
const titled =
|
|
34947
|
-
text: [titleQuery(
|
|
35005
|
+
const titleWords3 = plainQueryWords(rest);
|
|
35006
|
+
const titled = titleWords3 === void 0 ? { items: [], hasMore: false } : await searchNotesQuery(store, {
|
|
35007
|
+
text: [titleQuery(titleWords3), filter ?? ""].filter(Boolean).join(" AND "),
|
|
34948
35008
|
limit: Math.max(window3, CANDIDATES2),
|
|
34949
35009
|
...scope
|
|
34950
35010
|
});
|
|
34951
|
-
const tier =
|
|
35011
|
+
const tier = titleWords3 === void 0 ? [] : titleTiers(titled.items, titleWords3);
|
|
34952
35012
|
const tierRefs = new Set(tier.map(({ ref }) => ref));
|
|
34953
35013
|
const slice = meaning === void 0 && tier.length === 0;
|
|
34954
35014
|
const matched = await searchNotesQuery(store, {
|
|
@@ -35087,7 +35147,7 @@ var searchNotesOf = /* @__PURE__ */ __name(async (store, account, text2, { accou
|
|
|
35087
35147
|
};
|
|
35088
35148
|
}, "searchNotesOf");
|
|
35089
35149
|
|
|
35090
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
35150
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.624.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._325ff8c9daf4b8769887d5253d3c1255/node_modules/@wirecat/cli-core/dist/services/events-search.js
|
|
35091
35151
|
var MAX_EVENTS_OFFSET = 1e3;
|
|
35092
35152
|
var iso3 = /* @__PURE__ */ __name((at) => at === null ? null : new Date(at).toISOString(), "iso");
|
|
35093
35153
|
var accountIdsOf = /* @__PURE__ */ __name(async (store, accounts) => {
|
|
@@ -35205,7 +35265,7 @@ var searchEvents = /* @__PURE__ */ __name(async (store, query, { limit = 20, off
|
|
|
35205
35265
|
};
|
|
35206
35266
|
}, "searchEvents");
|
|
35207
35267
|
|
|
35208
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
35268
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.624.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._325ff8c9daf4b8769887d5253d3c1255/node_modules/@wirecat/cli-core/dist/services/search-all-business.js
|
|
35209
35269
|
var OWN_BUSINESS = { provider: "business", account: INTERNAL_NOTES };
|
|
35210
35270
|
var BUSINESS_WORDS_ONLY = "invoices, payments, orders, contracts, subscriptions, products and wallets are found by the words of their numbers and names only";
|
|
35211
35271
|
var placeOf = /* @__PURE__ */ __name(({ source, imported }) => source ?? (imported === void 0 ? OWN_BUSINESS : { provider: imported, account: "" }), "placeOf");
|
|
@@ -35236,8 +35296,494 @@ var searchBusiness = /* @__PURE__ */ __name(async (store, { words: words3, anyWo
|
|
|
35236
35296
|
};
|
|
35237
35297
|
}, "searchBusiness");
|
|
35238
35298
|
|
|
35239
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
35240
|
-
var
|
|
35299
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.624.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._325ff8c9daf4b8769887d5253d3c1255/node_modules/@wirecat/cli-core/dist/services/meeting-hit-search.js
|
|
35300
|
+
var resolveMeetingSelection = /* @__PURE__ */ __name(async (store, request) => {
|
|
35301
|
+
const { project, tag, topic, ...input } = request;
|
|
35302
|
+
input.signal?.throwIfAborted();
|
|
35303
|
+
if (project !== void 0 && input.projectId !== void 0 || [tag, topic].filter((value) => value !== void 0).length + Number(input.tagId !== void 0) > 1)
|
|
35304
|
+
throw new CliError("validation_error", "choose one project selector and one tag or topic selector");
|
|
35305
|
+
const selection = [];
|
|
35306
|
+
const knowledge = store.knowledge;
|
|
35307
|
+
if (!knowledge && [project, tag, topic].some((value) => value !== void 0))
|
|
35308
|
+
throw new CliError("configuration_error", "this store cannot resolve project, tag or topic names");
|
|
35309
|
+
for (const [kind, name] of [
|
|
35310
|
+
["project", project],
|
|
35311
|
+
["tag", tag],
|
|
35312
|
+
["topic", topic]
|
|
35313
|
+
]) {
|
|
35314
|
+
if (name === void 0)
|
|
35315
|
+
continue;
|
|
35316
|
+
if (!knowledge)
|
|
35317
|
+
continue;
|
|
35318
|
+
const found = await knowledge.resolveVocabulary(name, { kind, signal: input.signal });
|
|
35319
|
+
input.signal?.throwIfAborted();
|
|
35320
|
+
if (found.ambiguous || found.matches.length !== 1)
|
|
35321
|
+
throw new CliError(found.matches.length ? "validation_error" : "not_found", `the ${kind} name needs one canonical record`, {
|
|
35322
|
+
candidates: found.matches.map((entry2) => ({ kind: entry2.kind, id: entry2.id, name: entry2.name }))
|
|
35323
|
+
});
|
|
35324
|
+
const entry = found.matches[0];
|
|
35325
|
+
const id2 = Number(entry?.id);
|
|
35326
|
+
if (!entry || entry.kind !== kind || !Number.isSafeInteger(id2) || id2 < 1)
|
|
35327
|
+
throw new CliError("invalid_response", "vocabulary resolution returned an invalid canonical record");
|
|
35328
|
+
if (kind === "project")
|
|
35329
|
+
input.projectId = id2;
|
|
35330
|
+
else
|
|
35331
|
+
input.tagId = id2;
|
|
35332
|
+
selection.push({ kind, id: id2, name: entry.name, by: "explicit-link" });
|
|
35333
|
+
}
|
|
35334
|
+
return { input, selection };
|
|
35335
|
+
}, "resolveMeetingSelection");
|
|
35336
|
+
|
|
35337
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.624.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._325ff8c9daf4b8769887d5253d3c1255/node_modules/@wirecat/cli-core/dist/services/search-all-meetings.js
|
|
35338
|
+
var MOST_HITS_PER_MEETING = 3;
|
|
35339
|
+
var PAGE_ROWS = 200;
|
|
35340
|
+
var MOST_PAGES = 25;
|
|
35341
|
+
var exactly = /* @__PURE__ */ __name((node) => node.kind === "boolean" ? { ...node, clauses: node.clauses.map((clause) => ({ ...clause, node: exactly(clause.node) })) } : node.field === "text" ? { ...node, field: "exact" } : node, "exactly");
|
|
35342
|
+
var positive = /* @__PURE__ */ __name((node) => node.kind === "predicate" || node.clauses.some(({ occur, node: node2 }) => occur !== "must_not" && positive(node2)), "positive");
|
|
35343
|
+
var titleNode = /* @__PURE__ */ __name((node) => {
|
|
35344
|
+
if (node.kind === "boolean") {
|
|
35345
|
+
const clauses = node.clauses.map((clause) => ({ ...clause, node: titleNode(clause.node) }));
|
|
35346
|
+
return clauses.every((clause) => clause.node) ? { ...node, clauses } : void 0;
|
|
35347
|
+
}
|
|
35348
|
+
if (node.field !== "text" && node.field !== "exact" || node.operator !== "term" && node.operator !== "phrase" || node.slop !== void 0)
|
|
35349
|
+
return void 0;
|
|
35350
|
+
const word = node.value.replace(/[\\*?[]/gu, "\\$&");
|
|
35351
|
+
const starting = /* @__PURE__ */ __name((value) => ({ ...node, field: "title", operator: "wildcard", value }), "starting");
|
|
35352
|
+
return {
|
|
35353
|
+
kind: "boolean",
|
|
35354
|
+
span: node.span,
|
|
35355
|
+
clauses: [
|
|
35356
|
+
{ occur: "should", node: starting(`${word}*`) },
|
|
35357
|
+
{ occur: "should", node: starting(`* ${word}*`) }
|
|
35358
|
+
]
|
|
35359
|
+
};
|
|
35360
|
+
}, "titleNode");
|
|
35361
|
+
var everyWord = /* @__PURE__ */ __name((node) => node.kind === "boolean" ? {
|
|
35362
|
+
...node,
|
|
35363
|
+
clauses: node.clauses.map((clause) => clause.occur === "should" ? { ...clause, occur: "must" } : clause)
|
|
35364
|
+
} : node, "everyWord");
|
|
35365
|
+
var titleQuery2 = /* @__PURE__ */ __name((query, input, question) => {
|
|
35366
|
+
if (input.projectId !== void 0 || input.tagId !== void 0 || !positive(query.root))
|
|
35367
|
+
return void 0;
|
|
35368
|
+
const root = titleNode(question ? everyWord(query.root) : query.root);
|
|
35369
|
+
return root && { ...query, root };
|
|
35370
|
+
}, "titleQuery");
|
|
35371
|
+
var titleWords = /* @__PURE__ */ __name((title) => fold(title).match(/[\p{L}\p{N}]+/gu) ?? [], "titleWords");
|
|
35372
|
+
var holdsExactly = /* @__PURE__ */ __name((node, words3) => {
|
|
35373
|
+
if (node.kind === "boolean") {
|
|
35374
|
+
const must = node.clauses.filter(({ occur }) => occur === "must");
|
|
35375
|
+
const should = node.clauses.filter(({ occur }) => occur === "should");
|
|
35376
|
+
return must.every((clause) => holdsExactly(clause.node, words3)) && !node.clauses.some(({ occur, node: node2 }) => occur === "must_not" && holdsExactly(node2, words3)) && (must.length > 0 || should.length === 0 || should.some((clause) => holdsExactly(clause.node, words3)));
|
|
35377
|
+
}
|
|
35378
|
+
const wanted = titleWords(node.value);
|
|
35379
|
+
if (node.field !== "exact")
|
|
35380
|
+
return wanted.every((one) => words3.some((word) => word.startsWith(one)));
|
|
35381
|
+
return ` ${words3.join(" ")} `.includes(` ${wanted.join(" ")} `);
|
|
35382
|
+
}, "holdsExactly");
|
|
35383
|
+
var sameAccount3 = /* @__PURE__ */ __name((one, other) => one.provider === other.provider && one.account === other.account, "sameAccount");
|
|
35384
|
+
var callerScopes = /* @__PURE__ */ __name(async (all, caller) => {
|
|
35385
|
+
const own = all.find((one) => sameAccount3(one, caller));
|
|
35386
|
+
if (own && caller.scope !== void 0 && caller.scope !== own.scope)
|
|
35387
|
+
throw new CliError("not_found", `no ${caller.provider} account ${caller.account} in the store`);
|
|
35388
|
+
const scope = own?.scope ?? caller.scope;
|
|
35389
|
+
return scope === void 0 ? [] : [scope];
|
|
35390
|
+
}, "callerScopes");
|
|
35391
|
+
var meetingLane = /* @__PURE__ */ __name(async (store, caller, request) => {
|
|
35392
|
+
const all = await store.accounts.storedAccounts();
|
|
35393
|
+
const scopes = request.scopes ?? await callerScopes(all, caller);
|
|
35394
|
+
const unknownCaller = request.scopes === void 0 && !all.some((one) => sameAccount3(one, caller));
|
|
35395
|
+
const meetings = all.filter((one) => holdsKind(one.provider, "meetings"));
|
|
35396
|
+
const stored = meetings.filter((one) => scopes.includes(one.scope));
|
|
35397
|
+
const chosen = request.accounts;
|
|
35398
|
+
const read = chosen ? stored.filter((one) => chosen.some((key) => sameAccount3(key, one))) : stored;
|
|
35399
|
+
const skipped = (chosen ?? []).filter((key) => !read.some((one) => sameAccount3(key, one))).map(({ provider, account }) => {
|
|
35400
|
+
const other = meetings.find((one) => sameAccount3({ provider, account }, one));
|
|
35401
|
+
return {
|
|
35402
|
+
source: `${provider}:${account}`,
|
|
35403
|
+
code: "not_found",
|
|
35404
|
+
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`
|
|
35405
|
+
};
|
|
35406
|
+
});
|
|
35407
|
+
const [first2] = read;
|
|
35408
|
+
if (!first2) {
|
|
35409
|
+
if (!skipped.length && request.asked)
|
|
35410
|
+
skipped.push({
|
|
35411
|
+
resource: "meetings",
|
|
35412
|
+
code: "not_found",
|
|
35413
|
+
reason: !meetings.length ? "no meeting account stored" : unknownCaller ? "this account is not in the store yet" : "no meeting account in this scope"
|
|
35414
|
+
});
|
|
35415
|
+
return { items: [], hasMore: false, read, skipped, coverage: [] };
|
|
35416
|
+
}
|
|
35417
|
+
const lifted = liftMeetingFields(request.text, { accountId: first2.id }, void 0, request.timezone);
|
|
35418
|
+
const parsed = parseMeetingQuery(lifted.query);
|
|
35419
|
+
const query = request.exact ? { ...parsed, root: exactly(parsed.root) } : parsed;
|
|
35420
|
+
const { input } = await resolveMeetingSelection(store, {
|
|
35421
|
+
...lifted.request,
|
|
35422
|
+
...request.signal ? { signal: request.signal } : {}
|
|
35423
|
+
});
|
|
35424
|
+
const lists = [];
|
|
35425
|
+
const coverage2 = [];
|
|
35426
|
+
const answered = [];
|
|
35427
|
+
for (const account of read) {
|
|
35428
|
+
try {
|
|
35429
|
+
const found = await accountHits(store, account, query, { ...input, accountId: account.id }, request);
|
|
35430
|
+
lists.push(found.ranked);
|
|
35431
|
+
coverage2.push({ provider: account.provider, account: account.account, ...found.coverage });
|
|
35432
|
+
answered.push(account);
|
|
35433
|
+
} catch (error) {
|
|
35434
|
+
if (!(error instanceof CliError) || error.code === "cancelled")
|
|
35435
|
+
throw error;
|
|
35436
|
+
skipped.push({ source: `${account.provider}:${account.account}`, code: error.code, reason: error.message });
|
|
35437
|
+
}
|
|
35438
|
+
}
|
|
35439
|
+
return { items: merged(lists), hasMore: coverage2.some((one) => one.hasMore), read: answered, skipped, coverage: coverage2 };
|
|
35440
|
+
}, "meetingLane");
|
|
35441
|
+
var merged = /* @__PURE__ */ __name((lists) => {
|
|
35442
|
+
const heads = lists.map((list3) => ({ list: list3, at: 0 }));
|
|
35443
|
+
const items = [];
|
|
35444
|
+
for (; ; ) {
|
|
35445
|
+
let best;
|
|
35446
|
+
for (const one of heads) {
|
|
35447
|
+
const head = one.list[one.at];
|
|
35448
|
+
const leader = best?.list[best.at];
|
|
35449
|
+
if (head && (!leader || head.tier < leader.tier || head.tier === leader.tier && head.started > leader.started))
|
|
35450
|
+
best = one;
|
|
35451
|
+
}
|
|
35452
|
+
const next = best?.list[best.at];
|
|
35453
|
+
if (!best || !next)
|
|
35454
|
+
return items;
|
|
35455
|
+
items.push(next.item);
|
|
35456
|
+
best.at++;
|
|
35457
|
+
}
|
|
35458
|
+
}, "merged");
|
|
35459
|
+
var accountHits = /* @__PURE__ */ __name(async (store, account, query, input, { text: text2, window: window3, signal, question, exact }) => {
|
|
35460
|
+
const ranked = [];
|
|
35461
|
+
const perMeeting = /* @__PURE__ */ new Map();
|
|
35462
|
+
const keep2 = /* @__PURE__ */ __name((one) => {
|
|
35463
|
+
const seen = perMeeting.get(one.item.meetingId) ?? 0;
|
|
35464
|
+
if (seen >= MOST_HITS_PER_MEETING)
|
|
35465
|
+
return false;
|
|
35466
|
+
perMeeting.set(one.item.meetingId, seen + 1);
|
|
35467
|
+
ranked.push(one);
|
|
35468
|
+
return true;
|
|
35469
|
+
}, "keep");
|
|
35470
|
+
let indexing = "ready";
|
|
35471
|
+
let hasMore = false;
|
|
35472
|
+
let passages = 0;
|
|
35473
|
+
const titles = titleQuery2(query, input, question === true);
|
|
35474
|
+
if (titles) {
|
|
35475
|
+
for (const meeting of await store.meetings.meetings({
|
|
35476
|
+
accountId: account.id,
|
|
35477
|
+
query: titles,
|
|
35478
|
+
...input.since === void 0 ? {} : { since: input.since },
|
|
35479
|
+
...input.until === void 0 ? {} : { until: input.until },
|
|
35480
|
+
limit: window3 + 1
|
|
35481
|
+
}))
|
|
35482
|
+
if (!exact || holdsExactly(query.root, titleWords(meeting.title ?? "")))
|
|
35483
|
+
keep2({ item: titleItem(account, meeting, text2), tier: 1, started: meeting.startedAt ?? 0 });
|
|
35484
|
+
}
|
|
35485
|
+
let after;
|
|
35486
|
+
let rows = Math.min(PAGE_ROWS, window3 + 1);
|
|
35487
|
+
for (let page = 1; ; page++) {
|
|
35488
|
+
let found;
|
|
35489
|
+
try {
|
|
35490
|
+
found = await store.meetings.searchHits(query, {
|
|
35491
|
+
...input,
|
|
35492
|
+
limit: rows,
|
|
35493
|
+
...after === void 0 ? {} : { after }
|
|
35494
|
+
});
|
|
35495
|
+
} catch (error) {
|
|
35496
|
+
if (!(error instanceof CliError) || error.message !== READ_BUDGET_EXCEEDED || rows === 1)
|
|
35497
|
+
throw error;
|
|
35498
|
+
rows = Math.ceil(rows / 2);
|
|
35499
|
+
page--;
|
|
35500
|
+
continue;
|
|
35501
|
+
}
|
|
35502
|
+
signal?.throwIfAborted();
|
|
35503
|
+
if (found.coverage.indexing === "pending")
|
|
35504
|
+
indexing = "pending";
|
|
35505
|
+
for (const hit of found.items)
|
|
35506
|
+
if (keep2({
|
|
35507
|
+
item: meetingItem(account, hit, text2),
|
|
35508
|
+
tier: hit.match === "corrected" ? 2 : 1,
|
|
35509
|
+
started: hit.source?.startedAt ?? 0
|
|
35510
|
+
}))
|
|
35511
|
+
passages++;
|
|
35512
|
+
if (passages > window3 || !found.hasMore || found.nextCursor === null)
|
|
35513
|
+
break;
|
|
35514
|
+
if (page === MOST_PAGES) {
|
|
35515
|
+
hasMore = true;
|
|
35516
|
+
break;
|
|
35517
|
+
}
|
|
35518
|
+
after = found.nextCursor;
|
|
35519
|
+
}
|
|
35520
|
+
ranked.sort((one, other) => one.tier - other.tier || other.started - one.started);
|
|
35521
|
+
return {
|
|
35522
|
+
ranked: ranked.slice(0, window3),
|
|
35523
|
+
coverage: { indexing, hasMore: hasMore || ranked.length > window3 }
|
|
35524
|
+
};
|
|
35525
|
+
}, "accountHits");
|
|
35526
|
+
var meetingItem = /* @__PURE__ */ __name((account, hit, query) => ({
|
|
35527
|
+
kind: "meeting",
|
|
35528
|
+
ref: formatMeetingReference({ type: "meeting", accountId: account.id, meetingId: hit.meetingId }),
|
|
35529
|
+
provider: account.provider,
|
|
35530
|
+
account: account.account,
|
|
35531
|
+
accountId: account.id,
|
|
35532
|
+
title: hit.source?.title ?? null,
|
|
35533
|
+
timestamp: typeof hit.source?.startedAt === "number" ? new Date(hit.source.startedAt).toISOString() : null,
|
|
35534
|
+
// Centred on the words the index matched: another form, a garbled spelling, never a word only under NOT.
|
|
35535
|
+
text: hit.matchedWords?.length ? excerpt(hit.text, hit.matchedWords.join(" "), 240, { literal: true }) : excerpt(hit.text, query),
|
|
35536
|
+
meetingId: hit.meetingId,
|
|
35537
|
+
scope: hit.scope,
|
|
35538
|
+
id: hit.id,
|
|
35539
|
+
startMs: hit.startMs,
|
|
35540
|
+
foundBy: ["words"],
|
|
35541
|
+
...hit.match === "corrected" ? { match: hit.match, corrections: hit.corrections ?? [] } : {},
|
|
35542
|
+
...hit.scope === "transcript" ? {
|
|
35543
|
+
cueRef: hit.ref,
|
|
35544
|
+
speakerName: hit.speakerName ?? null,
|
|
35545
|
+
language: hit.language ?? null,
|
|
35546
|
+
...hit.line === void 0 ? {} : { line: hit.line, linesTotal: hit.linesTotal }
|
|
35547
|
+
} : {}
|
|
35548
|
+
}), "meetingItem");
|
|
35549
|
+
var titleItem = /* @__PURE__ */ __name((account, meeting, query) => ({
|
|
35550
|
+
kind: "meeting",
|
|
35551
|
+
ref: formatMeetingReference({ type: "meeting", accountId: account.id, meetingId: meeting.id }),
|
|
35552
|
+
provider: account.provider,
|
|
35553
|
+
account: account.account,
|
|
35554
|
+
accountId: account.id,
|
|
35555
|
+
title: meeting.title,
|
|
35556
|
+
timestamp: meeting.startedAt === null ? null : new Date(meeting.startedAt).toISOString(),
|
|
35557
|
+
text: excerpt(meeting.title ?? "", query),
|
|
35558
|
+
meetingId: meeting.id,
|
|
35559
|
+
scope: "title",
|
|
35560
|
+
id: meeting.id,
|
|
35561
|
+
startMs: null,
|
|
35562
|
+
foundBy: ["title"]
|
|
35563
|
+
}), "titleItem");
|
|
35564
|
+
|
|
35565
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.624.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._325ff8c9daf4b8769887d5253d3c1255/node_modules/@wirecat/cli-core/dist/services/search-harder.js
|
|
35566
|
+
var SECTION2 = "search_harder";
|
|
35567
|
+
var HARDER_MODELS = {
|
|
35568
|
+
anthropic: "claude-haiku-5-5",
|
|
35569
|
+
openai: "gpt-4o-mini"
|
|
35570
|
+
};
|
|
35571
|
+
var HARDER_CANDIDATES = 30;
|
|
35572
|
+
var HARDER_CHARS = 400;
|
|
35573
|
+
var TIMEOUT_MS2 = 5e3;
|
|
35574
|
+
var Setting2 = strictObject({
|
|
35575
|
+
...MODEL_CHOICE,
|
|
35576
|
+
/** When the owner agreed that a `--harder` search sends its question and hits; the setting exists only with it. */
|
|
35577
|
+
consented_at: pipe(string(), isoTimestamp())
|
|
35578
|
+
});
|
|
35579
|
+
var readHarderSetting = /* @__PURE__ */ __name((env) => {
|
|
35580
|
+
const path = enrichmentSettingPath(env);
|
|
35581
|
+
const section = readSharedSection(path, SECTION2);
|
|
35582
|
+
if (section === void 0 || section === null)
|
|
35583
|
+
return void 0;
|
|
35584
|
+
const checked2 = safeParse(Setting2, section);
|
|
35585
|
+
if (!checked2.success)
|
|
35586
|
+
throw new CliError("configuration_error", `${path}: ${SECTION2}.${getDotPath(checked2.issues[0]) ?? "settings"} is invalid \u2014 ${checked2.issues[0].message}`);
|
|
35587
|
+
return checked2.output;
|
|
35588
|
+
}, "readHarderSetting");
|
|
35589
|
+
var writeHarderSetting = /* @__PURE__ */ __name((env, setting) => writeSharedSection(enrichmentSettingPath(env), SECTION2, setting === void 0 ? void 0 : parse(Setting2, setting)), "writeHarderSetting");
|
|
35590
|
+
var PROMPT = "Today is {as_of}. A person searches their own archive of messages, mails, notes, calendar entries and phone records with the question below. Here are {n} candidate records, numbered, in the data.\n\nQuestion: {question}\n\nWhich records help answer the question? List their numbers, most useful first, at most ten; an empty list if none does.";
|
|
35591
|
+
var JSON_SHAPE = '\n\nAnswer with JSON only, in the form {"records": [numbers]}.';
|
|
35592
|
+
var FORMAT = {
|
|
35593
|
+
type: "json_schema",
|
|
35594
|
+
schema: {
|
|
35595
|
+
type: "object",
|
|
35596
|
+
properties: { records: { type: "array", items: { type: "integer" } } },
|
|
35597
|
+
required: ["records"],
|
|
35598
|
+
additionalProperties: false
|
|
35599
|
+
}
|
|
35600
|
+
};
|
|
35601
|
+
var Reply2 = object({ records: array(pipe(number(), integer())) });
|
|
35602
|
+
var jsonOf = /* @__PURE__ */ __name((text2) => {
|
|
35603
|
+
try {
|
|
35604
|
+
return JSON.parse(text2);
|
|
35605
|
+
} catch {
|
|
35606
|
+
const start = text2.indexOf("{");
|
|
35607
|
+
const end = text2.lastIndexOf("}");
|
|
35608
|
+
if (start < 0 || end <= start)
|
|
35609
|
+
throw new Error("no JSON in the answer");
|
|
35610
|
+
return JSON.parse(text2.slice(start, end + 1));
|
|
35611
|
+
}
|
|
35612
|
+
}, "jsonOf");
|
|
35613
|
+
var recordLine = /* @__PURE__ */ __name((hit, i) => `[${i}] (${hit.timestamp?.slice(0, 10) ?? "undated"}) ${`${hit.title ? `${hit.title}
|
|
35614
|
+
` : ""}${hit.text.slice(0, HARDER_CHARS)}`.replace(/\s*\n\s*/g, " ")}`, "recordLine");
|
|
35615
|
+
var REASON_TEXT = {
|
|
35616
|
+
"harder.no-consent": "the owner has not agreed to send searches to a hosted model",
|
|
35617
|
+
"harder.no-key": "no key for the provider",
|
|
35618
|
+
"harder.bad-setting": "the search_harder setting cannot be read; nothing was sent",
|
|
35619
|
+
"harder.later-page": "--harder reorders the first page only; nothing was sent",
|
|
35620
|
+
"harder.too-few": "fewer than two hits to reorder; nothing was sent",
|
|
35621
|
+
"harder.timeout": `the model did not answer within ${TIMEOUT_MS2 / 1e3} s`,
|
|
35622
|
+
"harder.key-rejected": "the provider refused the key",
|
|
35623
|
+
"harder.unreachable": "the provider could not be reached",
|
|
35624
|
+
"harder.rate-limited": "the provider's rate limit was reached",
|
|
35625
|
+
"harder.bad-reply": "the model's answer could not be read",
|
|
35626
|
+
"harder.error": "the provider failed"
|
|
35627
|
+
};
|
|
35628
|
+
var reasonOf = /* @__PURE__ */ __name((error, timedOut) => {
|
|
35629
|
+
if (timedOut)
|
|
35630
|
+
return "harder.timeout";
|
|
35631
|
+
if (!(error instanceof CliError))
|
|
35632
|
+
return "harder.bad-reply";
|
|
35633
|
+
if (error.details.reason === "model.key-rejected")
|
|
35634
|
+
return "harder.key-rejected";
|
|
35635
|
+
if (error.details.reason === "model.unreachable")
|
|
35636
|
+
return "harder.unreachable";
|
|
35637
|
+
if (error.code === "rate_limited")
|
|
35638
|
+
return "harder.rate-limited";
|
|
35639
|
+
return "harder.error";
|
|
35640
|
+
}, "reasonOf");
|
|
35641
|
+
var UNSET = {
|
|
35642
|
+
provider: "anthropic",
|
|
35643
|
+
model: HARDER_MODELS.anthropic,
|
|
35644
|
+
endpoint: enrichmentEndpoint({ provider: "anthropic" })
|
|
35645
|
+
};
|
|
35646
|
+
var harderAccess = /* @__PURE__ */ __name(({ env, command, ...options2 }) => {
|
|
35647
|
+
let setting;
|
|
35648
|
+
try {
|
|
35649
|
+
setting = readHarderSetting(env);
|
|
35650
|
+
} catch (error) {
|
|
35651
|
+
const unreadable = error instanceof CliError ? error.message : REASON_TEXT["harder.bad-setting"];
|
|
35652
|
+
return { ready: false, ...UNSET, reason_id: "harder.bad-setting", reason: `${unreadable}; nothing was sent` };
|
|
35653
|
+
}
|
|
35654
|
+
const tool = command ?? "memo";
|
|
35655
|
+
if (!setting)
|
|
35656
|
+
return {
|
|
35657
|
+
ready: false,
|
|
35658
|
+
...UNSET,
|
|
35659
|
+
reason_id: "harder.no-consent",
|
|
35660
|
+
reason: `${REASON_TEXT["harder.no-consent"]}: \`${tool} models search-consents set <provider> --yes\`; nothing was sent`
|
|
35661
|
+
};
|
|
35662
|
+
const chosen = {
|
|
35663
|
+
provider: setting.provider,
|
|
35664
|
+
model: setting.model,
|
|
35665
|
+
endpoint: enrichmentEndpoint(setting),
|
|
35666
|
+
custom: setting.base_url !== void 0
|
|
35667
|
+
};
|
|
35668
|
+
let key;
|
|
35669
|
+
try {
|
|
35670
|
+
key = keyLookup({ env, ...options2 }, setting)?.key;
|
|
35671
|
+
} catch {
|
|
35672
|
+
return {
|
|
35673
|
+
ready: false,
|
|
35674
|
+
...chosen,
|
|
35675
|
+
reason_id: "harder.error",
|
|
35676
|
+
reason: `the ${setting.provider} key could not be read; nothing was sent`
|
|
35677
|
+
};
|
|
35678
|
+
}
|
|
35679
|
+
if (key === void 0 && !chosen.custom)
|
|
35680
|
+
return {
|
|
35681
|
+
ready: false,
|
|
35682
|
+
...chosen,
|
|
35683
|
+
reason_id: "harder.no-key",
|
|
35684
|
+
reason: `no ${setting.provider} key: \`${tool} models keys set ${setting.provider}\` or set ${keyVariable(setting.provider)}; nothing was sent`
|
|
35685
|
+
};
|
|
35686
|
+
return { ready: true, ...chosen, ...key === void 0 ? {} : { key } };
|
|
35687
|
+
}, "harderAccess");
|
|
35688
|
+
var ask = /* @__PURE__ */ __name(async (access, options2, request) => {
|
|
35689
|
+
const limit = new AbortController();
|
|
35690
|
+
const timer = setTimeout(() => limit.abort(), options2.timeoutMs ?? TIMEOUT_MS2);
|
|
35691
|
+
const gateway = modelGateway({
|
|
35692
|
+
resolve: /* @__PURE__ */ __name(() => ({ provider: access.provider, model: access.model, baseUrl: access.endpoint }), "resolve"),
|
|
35693
|
+
consent: /* @__PURE__ */ __name((_request, chosen) => chosen.provider === access.provider && chosen.baseUrl === access.endpoint, "consent"),
|
|
35694
|
+
key: /* @__PURE__ */ __name(() => access.key, "key"),
|
|
35695
|
+
signal: limit.signal,
|
|
35696
|
+
...options2.adapters ? { adapters: options2.adapters } : {},
|
|
35697
|
+
...options2.fetch ? { fetch: options2.fetch } : {}
|
|
35698
|
+
});
|
|
35699
|
+
const { format, ...rest } = request;
|
|
35700
|
+
const settings = access.provider === "anthropic" ? { thinking: { type: "disabled" }, output_config: { effort: "low", ...format ? { format } : {} } } : access.custom ? void 0 : { temperature: 0, ...format ? { response_format: { type: "json_object" } } : {} };
|
|
35701
|
+
try {
|
|
35702
|
+
const answer = await gateway.complete({
|
|
35703
|
+
...rest,
|
|
35704
|
+
...format && access.provider !== "anthropic" ? { prompt: `${rest.prompt}${JSON_SHAPE}` } : {},
|
|
35705
|
+
...settings ? { options: settings } : {}
|
|
35706
|
+
});
|
|
35707
|
+
const cost = costOf(answer.usage ?? { input: answer.tokens, output: 0 }, {
|
|
35708
|
+
provider: access.provider,
|
|
35709
|
+
model: access.model,
|
|
35710
|
+
...access.custom ? { base_url: access.endpoint } : {}
|
|
35711
|
+
});
|
|
35712
|
+
return { text: answer.text, cost, ...answer.usage ? { usage: answer.usage } : {} };
|
|
35713
|
+
} catch (error) {
|
|
35714
|
+
return { reason_id: reasonOf(error, limit.signal.aborted) };
|
|
35715
|
+
} finally {
|
|
35716
|
+
clearTimeout(timer);
|
|
35717
|
+
}
|
|
35718
|
+
}, "ask");
|
|
35719
|
+
var reorderHarder = /* @__PURE__ */ __name(async (question, hits, { laterPage, access: given, ...asking }) => {
|
|
35720
|
+
const started = Date.now();
|
|
35721
|
+
const access = laterPage ? void 0 : given ?? harderAccess(asking);
|
|
35722
|
+
const plain2 = /* @__PURE__ */ __name((reason_id, extra = {}, reason = REASON_TEXT[reason_id]) => ({
|
|
35723
|
+
items: [...hits],
|
|
35724
|
+
harder: {
|
|
35725
|
+
applied: false,
|
|
35726
|
+
provider: (access ?? UNSET).provider,
|
|
35727
|
+
model: (access ?? UNSET).model,
|
|
35728
|
+
endpoint: (access ?? UNSET).endpoint,
|
|
35729
|
+
sent: 0,
|
|
35730
|
+
cost_usd: 0,
|
|
35731
|
+
ms: Date.now() - started,
|
|
35732
|
+
...extra,
|
|
35733
|
+
reason,
|
|
35734
|
+
reason_id
|
|
35735
|
+
}
|
|
35736
|
+
}), "plain");
|
|
35737
|
+
if (!access)
|
|
35738
|
+
return plain2("harder.later-page");
|
|
35739
|
+
if (!access.ready)
|
|
35740
|
+
return plain2(access.reason_id, {}, access.reason);
|
|
35741
|
+
const candidates = hits.slice(0, HARDER_CANDIDATES);
|
|
35742
|
+
if (candidates.length < 2)
|
|
35743
|
+
return plain2("harder.too-few");
|
|
35744
|
+
const sent = { sent: candidates.length };
|
|
35745
|
+
const answer = await ask(access, asking, {
|
|
35746
|
+
purpose: "search-harder",
|
|
35747
|
+
prompt: PROMPT.replace("{as_of}", new Date(asking.now).toISOString().slice(0, 10)).replace("{n}", String(candidates.length)).replace("{question}", () => question),
|
|
35748
|
+
data: candidates.map(recordLine).join("\n"),
|
|
35749
|
+
maxTokens: 300,
|
|
35750
|
+
format: FORMAT
|
|
35751
|
+
});
|
|
35752
|
+
if ("reason_id" in answer)
|
|
35753
|
+
return plain2(answer.reason_id, { ...sent, cost_usd: null });
|
|
35754
|
+
let picked;
|
|
35755
|
+
try {
|
|
35756
|
+
picked = parse(Reply2, jsonOf(answer.text)).records;
|
|
35757
|
+
} catch {
|
|
35758
|
+
return plain2("harder.bad-reply", {
|
|
35759
|
+
...sent,
|
|
35760
|
+
cost_usd: answer.cost,
|
|
35761
|
+
...answer.usage ? { usage: answer.usage } : {}
|
|
35762
|
+
});
|
|
35763
|
+
}
|
|
35764
|
+
const first2 = [...new Set(picked.filter((i) => i >= 0 && i < candidates.length))];
|
|
35765
|
+
const chosen = new Set(first2);
|
|
35766
|
+
return {
|
|
35767
|
+
items: [
|
|
35768
|
+
...first2.map((i) => candidates[i]),
|
|
35769
|
+
...candidates.filter((_, i) => !chosen.has(i)),
|
|
35770
|
+
...hits.slice(HARDER_CANDIDATES)
|
|
35771
|
+
],
|
|
35772
|
+
harder: {
|
|
35773
|
+
applied: true,
|
|
35774
|
+
provider: access.provider,
|
|
35775
|
+
model: access.model,
|
|
35776
|
+
endpoint: access.endpoint,
|
|
35777
|
+
...sent,
|
|
35778
|
+
cost_usd: answer.cost,
|
|
35779
|
+
...answer.usage ? { usage: answer.usage } : {},
|
|
35780
|
+
ms: Date.now() - started
|
|
35781
|
+
}
|
|
35782
|
+
};
|
|
35783
|
+
}, "reorderHarder");
|
|
35784
|
+
|
|
35785
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.624.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._325ff8c9daf4b8769887d5253d3c1255/node_modules/@wirecat/cli-core/dist/services/search-all.js
|
|
35786
|
+
var RESOURCES_SEARCHED = ["messages", "mail", "notes", "events", "crm", "business", "meetings"];
|
|
35241
35787
|
var refusal = /* @__PURE__ */ __name((error, text2) => {
|
|
35242
35788
|
const { reason, span } = error.details ?? {};
|
|
35243
35789
|
const why = typeof reason === "string" ? reason : void 0;
|
|
@@ -35251,7 +35797,7 @@ var filtersBeside = /* @__PURE__ */ __name((text2) => {
|
|
|
35251
35797
|
const top = root.kind === "boolean" ? root.clauses : [{ node: root, occur: "must" }];
|
|
35252
35798
|
return top.every(({ node, occur }) => occur !== "must_not" && followable(node, occur === "must")) ? planQuestion(text2).scope : void 0;
|
|
35253
35799
|
}, "filtersBeside");
|
|
35254
|
-
var
|
|
35800
|
+
var titleWords2 = /* @__PURE__ */ __name((text2, refused = "deals and leads are found by the words of their title only") => {
|
|
35255
35801
|
const { root } = parseLucene(text2, SEARCH_QUERY);
|
|
35256
35802
|
const clauses = root.kind === "boolean" ? root.clauses : [{ node: root, occur: "must" }];
|
|
35257
35803
|
const words3 = clauses.map(({ node, occur }) => occur !== "must_not" && node.kind === "predicate" && node.field === "text" && (node.operator === "term" || node.operator === "phrase") ? (
|
|
@@ -35264,7 +35810,7 @@ var titleWords = /* @__PURE__ */ __name((text2, refused = "deals and leads are f
|
|
|
35264
35810
|
}, "titleWords");
|
|
35265
35811
|
var strictWords = /* @__PURE__ */ __name((text2) => {
|
|
35266
35812
|
try {
|
|
35267
|
-
const { words: words3, anyWord } =
|
|
35813
|
+
const { words: words3, anyWord } = titleWords2(text2);
|
|
35268
35814
|
const unique = [...new Set(words3)];
|
|
35269
35815
|
return anyWord || unique.length < 2 || unique.length > 8 || unique.some((word) => /\s/u.test(word)) ? [] : unique;
|
|
35270
35816
|
} catch (error) {
|
|
@@ -35273,6 +35819,20 @@ var strictWords = /* @__PURE__ */ __name((text2) => {
|
|
|
35273
35819
|
throw error;
|
|
35274
35820
|
}
|
|
35275
35821
|
}, "strictWords");
|
|
35822
|
+
var accountKeyOf = /* @__PURE__ */ __name(({ provider, account }) => `${provider}\0${account}`, "accountKeyOf");
|
|
35823
|
+
var sourceScope = /* @__PURE__ */ __name(async (store, account, source, asked, messenger) => {
|
|
35824
|
+
const entries = entriesOfList(source, await listContextOf(store, account, messenger.app));
|
|
35825
|
+
const imported = asked.includes("business") ? new Set((await store.business.accounts()).map(accountKeyOf)) : /* @__PURE__ */ new Set();
|
|
35826
|
+
const holdsBusiness = /* @__PURE__ */ __name((one) => imported.has(accountKeyOf(one)), "holdsBusiness");
|
|
35827
|
+
const { skipped } = fitting(entries, asked.filter((one) => one !== "business"), "search all", (kind) => `--only leaves ${kind} out`, holdsBusiness);
|
|
35828
|
+
const named2 = /* @__PURE__ */ __name((resource) => [
|
|
35829
|
+
...new Map(entries.flatMap(({ accounts }) => accounts).filter((one) => resource === "business" ? holdsBusiness(one) : listedHolds(one, resource)).map(({ provider, account: account2 }) => [`${provider}\0${account2}`, { provider, account: account2 }])).values()
|
|
35830
|
+
], "named");
|
|
35831
|
+
const scope = Object.fromEntries(asked.map((resource) => [resource, named2(resource)]));
|
|
35832
|
+
const only = asked.filter((resource) => scope[resource]?.length);
|
|
35833
|
+
const unnamed = asked.filter((resource) => !only.includes(resource)).map((resource) => ({ resource, code: "not_found", reason: `--source names no ${resource} account` }));
|
|
35834
|
+
return { only, scope, skipped: [...skipped, ...unnamed] };
|
|
35835
|
+
}, "sourceScope");
|
|
35276
35836
|
var crmAccounts = /* @__PURE__ */ __name(async (store) => (await store.accounts.accounts()).filter(({ provider }) => holdsKind(provider, "crm")), "crmAccounts");
|
|
35277
35837
|
var searchAll = /* @__PURE__ */ __name(async (store, account, asked, messenger = {}, searchMessages = (query) => searchStore(store, account, query, messenger), meaning) => {
|
|
35278
35838
|
if (!asked.text.trim())
|
|
@@ -35281,13 +35841,16 @@ var searchAll = /* @__PURE__ */ __name(async (store, account, asked, messenger =
|
|
|
35281
35841
|
const offset = request.offset ?? 0;
|
|
35282
35842
|
if (!Number.isInteger(offset) || offset < 0 || offset > MAX_SEARCH_OFFSET)
|
|
35283
35843
|
throw new CliError("validation_error", `offset takes a whole number from 0 to ${MAX_SEARCH_OFFSET}`);
|
|
35844
|
+
const period = questionPeriod(request.text, request.now ?? Date.now(), timezoneOf(request.timezone));
|
|
35284
35845
|
const window3 = offset + request.limit;
|
|
35285
|
-
const
|
|
35846
|
+
const depth = Math.max(window3, period ? PERIOD_DEPTH : 0, request.harder ? HARDER_CANDIDATES : 0);
|
|
35847
|
+
const chosen = request.source === void 0 ? { only: request.only ?? RESOURCES_SEARCHED, scope: request.scope, skipped: [] } : await sourceScope(store, account, request.source, request.only ?? RESOURCES_SEARCHED, messenger);
|
|
35848
|
+
const { only, scope } = chosen;
|
|
35286
35849
|
const command = messenger.hintCommand === void 0 ? messenger.app?.command : messenger.hintCommand ?? void 0;
|
|
35287
35850
|
const lists = [];
|
|
35288
35851
|
const searched = [];
|
|
35289
35852
|
const accounts = [];
|
|
35290
|
-
const skipped = [];
|
|
35853
|
+
const skipped = [...chosen.skipped];
|
|
35291
35854
|
let hasMore = false;
|
|
35292
35855
|
let notes;
|
|
35293
35856
|
let events;
|
|
@@ -35296,8 +35859,9 @@ var searchAll = /* @__PURE__ */ __name(async (store, account, asked, messenger =
|
|
|
35296
35859
|
const discover = !request.exact && questionLookup(request.text) !== void 0;
|
|
35297
35860
|
const cosines = /* @__PURE__ */ new Map();
|
|
35298
35861
|
let coverage2;
|
|
35862
|
+
let meetings;
|
|
35299
35863
|
const messagesOf = /* @__PURE__ */ __name(async (kind) => {
|
|
35300
|
-
const given =
|
|
35864
|
+
const given = scope?.[kind];
|
|
35301
35865
|
const discovers = discover && (kind === "mail" || request.backend !== "server");
|
|
35302
35866
|
const query = {
|
|
35303
35867
|
text: request.text,
|
|
@@ -35309,7 +35873,7 @@ var searchAll = /* @__PURE__ */ __name(async (store, account, asked, messenger =
|
|
|
35309
35873
|
...request.backend === void 0 ? {} : { backend: request.backend },
|
|
35310
35874
|
...request.server === void 0 ? {} : { server: request.server }
|
|
35311
35875
|
} : {},
|
|
35312
|
-
limit:
|
|
35876
|
+
limit: depth,
|
|
35313
35877
|
...request.exact ? { exact: true } : {},
|
|
35314
35878
|
...discovers ? { discover: true } : {},
|
|
35315
35879
|
...request.timezone === void 0 ? {} : { timezone: request.timezone },
|
|
@@ -35381,12 +35945,12 @@ var searchAll = /* @__PURE__ */ __name(async (store, account, asked, messenger =
|
|
|
35381
35945
|
for (const resource of only) {
|
|
35382
35946
|
try {
|
|
35383
35947
|
if (resource === "notes") {
|
|
35384
|
-
const
|
|
35948
|
+
const chosen2 = scope?.notes;
|
|
35385
35949
|
const found = await searchNotes(store, request.text, {
|
|
35386
|
-
limit:
|
|
35950
|
+
limit: depth,
|
|
35387
35951
|
command,
|
|
35388
35952
|
embedders,
|
|
35389
|
-
...
|
|
35953
|
+
...chosen2 === void 0 ? {} : notesScopeOf(chosen2),
|
|
35390
35954
|
...request.exact ? { exact: true } : {},
|
|
35391
35955
|
...discover ? { discover: true } : {},
|
|
35392
35956
|
...request.timezone === void 0 ? {} : { timezone: request.timezone },
|
|
@@ -35411,7 +35975,7 @@ var searchAll = /* @__PURE__ */ __name(async (store, account, asked, messenger =
|
|
|
35411
35975
|
text: hit.excerpt,
|
|
35412
35976
|
foundBy: hit.found_by
|
|
35413
35977
|
})));
|
|
35414
|
-
const read =
|
|
35978
|
+
const read = chosen2?.map(({ account: account2 }) => account2) ?? [
|
|
35415
35979
|
INTERNAL_NOTES,
|
|
35416
35980
|
...(await store.notes.folders()).map(({ id: id2 }) => id2),
|
|
35417
35981
|
...(await store.notes.documentsAccounts()).map(({ id: id2 }) => id2),
|
|
@@ -35419,11 +35983,11 @@ var searchAll = /* @__PURE__ */ __name(async (store, account, asked, messenger =
|
|
|
35419
35983
|
];
|
|
35420
35984
|
accounts.push(...read.map((account2) => ({ resource, provider: "notes", account: account2 })));
|
|
35421
35985
|
} else if (resource === "events") {
|
|
35422
|
-
const read =
|
|
35986
|
+
const read = scope?.events ?? await calendarAccounts(store);
|
|
35423
35987
|
if (!read.length)
|
|
35424
35988
|
continue;
|
|
35425
35989
|
const found = await searchEvents(store, request.text, {
|
|
35426
|
-
limit:
|
|
35990
|
+
limit: depth,
|
|
35427
35991
|
accounts: read,
|
|
35428
35992
|
embedders,
|
|
35429
35993
|
...command === void 0 ? {} : { command },
|
|
@@ -35454,17 +36018,17 @@ var searchAll = /* @__PURE__ */ __name(async (store, account, asked, messenger =
|
|
|
35454
36018
|
})));
|
|
35455
36019
|
accounts.push(...read.map(({ provider, account: account2 }) => ({ resource, provider, account: account2 })));
|
|
35456
36020
|
} else if (resource === "crm") {
|
|
35457
|
-
const { words: words3, anyWord } =
|
|
35458
|
-
const
|
|
36021
|
+
const { words: words3, anyWord } = titleWords2(request.text);
|
|
36022
|
+
const chosen2 = scope?.crm;
|
|
35459
36023
|
const found = await store.deals.find({
|
|
35460
36024
|
words: words3,
|
|
35461
36025
|
anyWord: anyWord || discover,
|
|
35462
36026
|
...request.crmKinds === void 0 ? {} : { kinds: request.crmKinds },
|
|
35463
|
-
limit: Math.min(
|
|
35464
|
-
...
|
|
36027
|
+
limit: Math.min(depth + 1, 500),
|
|
36028
|
+
...chosen2 === void 0 ? {} : { accounts: chosen2 }
|
|
35465
36029
|
});
|
|
35466
|
-
hasMore ||= found.length >
|
|
35467
|
-
lists.push(found.slice(0,
|
|
36030
|
+
hasMore ||= found.length > depth;
|
|
36031
|
+
lists.push(found.slice(0, depth).map((deal) => ({
|
|
35468
36032
|
kind: deal.kind,
|
|
35469
36033
|
ref: deal.ref,
|
|
35470
36034
|
provider: deal.account?.provider ?? "crm",
|
|
@@ -35474,21 +36038,43 @@ var searchAll = /* @__PURE__ */ __name(async (store, account, asked, messenger =
|
|
|
35474
36038
|
text: deal.summary,
|
|
35475
36039
|
foundBy: ["title"]
|
|
35476
36040
|
})));
|
|
35477
|
-
const read =
|
|
36041
|
+
const read = chosen2 ?? [...await crmAccounts(store), { provider: "crm", account: INTERNAL_NOTES }];
|
|
35478
36042
|
for (const { provider, account: account2 } of read)
|
|
35479
36043
|
accounts.push({ resource, provider, account: account2 });
|
|
35480
36044
|
} else if (resource === "business") {
|
|
35481
|
-
const { words: words3, anyWord } =
|
|
36045
|
+
const { words: words3, anyWord } = titleWords2(request.text, BUSINESS_WORDS_ONLY);
|
|
35482
36046
|
const found = await searchBusiness(store, {
|
|
35483
36047
|
words: words3,
|
|
35484
36048
|
anyWord: anyWord || discover,
|
|
35485
|
-
window:
|
|
35486
|
-
accounts:
|
|
36049
|
+
window: depth,
|
|
36050
|
+
accounts: scope?.business
|
|
35487
36051
|
});
|
|
35488
36052
|
hasMore ||= found.hasMore;
|
|
35489
36053
|
lists.push(found.items);
|
|
35490
36054
|
for (const { provider, account: account2 } of found.read)
|
|
35491
36055
|
accounts.push({ resource, provider, account: account2 });
|
|
36056
|
+
} else if (resource === "meetings") {
|
|
36057
|
+
const found = await meetingLane(store, account, {
|
|
36058
|
+
// A question finds passages that hold some of its words, as every other source does.
|
|
36059
|
+
text: (discover ? questionLookup(request.text) : void 0) ?? request.text,
|
|
36060
|
+
...discover ? { question: true } : {},
|
|
36061
|
+
window: depth,
|
|
36062
|
+
...scope?.meetings === void 0 ? {} : { accounts: scope.meetings },
|
|
36063
|
+
...request.meetingScopes === void 0 ? {} : { scopes: request.meetingScopes },
|
|
36064
|
+
...request.meetingsAsked ? { asked: true } : {},
|
|
36065
|
+
...request.exact ? { exact: true } : {},
|
|
36066
|
+
...request.timezone === void 0 ? {} : { timezone: request.timezone },
|
|
36067
|
+
...request.signal === void 0 ? {} : { signal: request.signal }
|
|
36068
|
+
});
|
|
36069
|
+
for (const one of found.skipped)
|
|
36070
|
+
skipped.push(one);
|
|
36071
|
+
if (!found.read.length)
|
|
36072
|
+
continue;
|
|
36073
|
+
hasMore ||= found.hasMore;
|
|
36074
|
+
meetings = found.coverage;
|
|
36075
|
+
lists.push(found.items);
|
|
36076
|
+
for (const { provider, account: account2 } of found.read)
|
|
36077
|
+
accounts.push({ resource, provider, account: account2 });
|
|
35492
36078
|
} else
|
|
35493
36079
|
lists.push(await messagesOf(resource));
|
|
35494
36080
|
searched.push(resource);
|
|
@@ -35501,9 +36087,21 @@ var searchAll = /* @__PURE__ */ __name(async (store, account, asked, messenger =
|
|
|
35501
36087
|
} finally {
|
|
35502
36088
|
await embedders.close();
|
|
35503
36089
|
}
|
|
35504
|
-
|
|
36090
|
+
let ordered = insidePeriodFirst(oneList(lists, cosines), period);
|
|
36091
|
+
let harder;
|
|
36092
|
+
if (request.harder) {
|
|
36093
|
+
const asking = {
|
|
36094
|
+
...request.harder,
|
|
36095
|
+
env: request.env ?? process.env,
|
|
36096
|
+
now: request.now ?? Date.now(),
|
|
36097
|
+
...command === void 0 ? {} : { command }
|
|
36098
|
+
};
|
|
36099
|
+
const done2 = await reorderHarder(asked.text, ordered, { ...asking, laterPage: offset > 0 });
|
|
36100
|
+
ordered = done2.items;
|
|
36101
|
+
harder = done2.harder;
|
|
36102
|
+
}
|
|
35505
36103
|
const more = hasMore || ordered.length > window3;
|
|
35506
|
-
const { backend: _backend, server: _server, ...local } = asked;
|
|
36104
|
+
const { backend: _backend, server: _server, harder: _harder, ...local } = asked;
|
|
35507
36105
|
const unmatched = [];
|
|
35508
36106
|
if (!ordered.length && !offset && !discover)
|
|
35509
36107
|
for (const word of strictWords(request.text)) {
|
|
@@ -35525,283 +36123,40 @@ var searchAll = /* @__PURE__ */ __name(async (store, account, asked, messenger =
|
|
|
35525
36123
|
...by.mail === void 0 ? {} : { mail: by.mail },
|
|
35526
36124
|
...server === void 0 ? {} : { server },
|
|
35527
36125
|
...coverage2 === void 0 ? {} : { coverage: coverage2 },
|
|
35528
|
-
...unmatched.length ? { unmatched } : {}
|
|
36126
|
+
...unmatched.length ? { unmatched } : {},
|
|
36127
|
+
...meetings === void 0 ? {} : { meetings },
|
|
36128
|
+
...harder === void 0 ? {} : { harder }
|
|
35529
36129
|
};
|
|
35530
36130
|
}, "searchAll");
|
|
36131
|
+
var hitKey = /* @__PURE__ */ __name((item2) => item2.kind === "meeting" ? `${item2.ref}\0${item2.scope}\0${item2.id}` : item2.ref, "hitKey");
|
|
35531
36132
|
var oneList = /* @__PURE__ */ __name((lists, cosines) => {
|
|
35532
36133
|
const place = /* @__PURE__ */ new Map();
|
|
35533
36134
|
for (const list3 of lists) {
|
|
35534
36135
|
let above = Number.NEGATIVE_INFINITY;
|
|
35535
36136
|
list3.forEach((item2, rank) => {
|
|
36137
|
+
const key = hitKey(item2);
|
|
35536
36138
|
above = cosines.get(item2.ref) ?? above;
|
|
35537
|
-
const held = place.get(
|
|
36139
|
+
const held = place.get(key);
|
|
35538
36140
|
if (!held || rank < held.rank)
|
|
35539
|
-
place.set(
|
|
36141
|
+
place.set(key, { item: item2, rank, cosine: above });
|
|
35540
36142
|
});
|
|
35541
36143
|
}
|
|
35542
36144
|
const head = /* @__PURE__ */ __name((rank) => Math.min(rank, 1), "head");
|
|
35543
36145
|
return [...place.values()].sort((a, b) => head(a.rank) - head(b.rank) || b.cosine - a.cosine || a.rank - b.rank).map(({ item: item2 }) => item2);
|
|
35544
36146
|
}, "oneList");
|
|
35545
|
-
|
|
35546
|
-
|
|
35547
|
-
var
|
|
35548
|
-
|
|
35549
|
-
|
|
35550
|
-
|
|
35551
|
-
|
|
35552
|
-
|
|
35553
|
-
|
|
35554
|
-
|
|
35555
|
-
|
|
35556
|
-
|
|
35557
|
-
|
|
35558
|
-
if (exact)
|
|
35559
|
-
return { reason: "meetings use word prefixes and cannot answer --exact" };
|
|
35560
|
-
try {
|
|
35561
|
-
const terms = [];
|
|
35562
|
-
const supported = /* @__PURE__ */ __name((node) => {
|
|
35563
|
-
if (node.kind === "boolean")
|
|
35564
|
-
return node.clauses.every(({ occur, node: node2 }) => occur === "must" && supported(node2));
|
|
35565
|
-
if (node.field !== "text" || node.operator !== "term" || !/^[\p{L}\p{N}]+$/u.test(node.value))
|
|
35566
|
-
return false;
|
|
35567
|
-
terms.push(node.value);
|
|
35568
|
-
return true;
|
|
35569
|
-
}, "supported");
|
|
35570
|
-
if (!supported(parseLucene(text2, SEARCH_QUERY).root) || !terms.length)
|
|
35571
|
-
return {
|
|
35572
|
-
reason: "meetings support letter/digit words joined by AND; phrases, OR/NOT, patterns and filters are unsupported"
|
|
35573
|
-
};
|
|
35574
|
-
return { query: terms.join(" ") };
|
|
35575
|
-
} catch (error) {
|
|
35576
|
-
if (codeOf(error) !== "validation_error")
|
|
35577
|
-
throw error;
|
|
35578
|
-
return { reason: error instanceof Error ? error.message : "invalid meeting search query" };
|
|
35579
|
-
}
|
|
35580
|
-
}, "meetingQuery");
|
|
35581
|
-
var collectMeetings = /* @__PURE__ */ __name(async (store, account, request, query) => {
|
|
35582
|
-
cancelled3(request.signal);
|
|
35583
|
-
const selected = await store.accounts.storedAccount(account);
|
|
35584
|
-
cancelled3(request.signal);
|
|
35585
|
-
whole3(selected.id, 1, Number.MAX_SAFE_INTEGER, "meeting account id");
|
|
35586
|
-
if (account.scope !== void 0 && selected.scope !== account.scope)
|
|
35587
|
-
throw new CliError("not_found", "the selected meeting account has a different scope");
|
|
35588
|
-
const cursor = request.meetingCursor;
|
|
35589
|
-
if (cursor && (cursor.accountId !== selected.id || cursor.query !== query))
|
|
35590
|
-
throw new CliError("validation_error", "meeting cursor belongs to a different account or query");
|
|
35591
|
-
let meetingOffset = cursor?.meetingOffset ?? 0;
|
|
35592
|
-
let hitOffset = cursor?.hitOffset ?? 0;
|
|
35593
|
-
const position = /* @__PURE__ */ __name(() => ({ accountId: selected.id, query, meetingOffset, hitOffset }), "position");
|
|
35594
|
-
const collected = {
|
|
35595
|
-
items: [],
|
|
35596
|
-
coverage: { accountId: selected.id, by: "word-prefixes", meetingsScanned: 0, complete: false },
|
|
35597
|
-
after: position()
|
|
35598
|
-
};
|
|
35599
|
-
const seen = /* @__PURE__ */ new Set();
|
|
35600
|
-
const most = request.maxMeetings === "all" ? Number.POSITIVE_INFINITY : request.maxMeetings ?? 100;
|
|
35601
|
-
while (collected.coverage.meetingsScanned < most) {
|
|
35602
|
-
cancelled3(request.signal);
|
|
35603
|
-
const page = await store.meetings.meetings({ accountId: selected.id, limit: 2, offset: meetingOffset });
|
|
35604
|
-
cancelled3(request.signal);
|
|
35605
|
-
const meeting = page[0];
|
|
35606
|
-
if (!meeting) {
|
|
35607
|
-
collected.coverage.complete = true;
|
|
35608
|
-
break;
|
|
35609
|
-
}
|
|
35610
|
-
const hits = await store.meetings.search(query, { accountId: selected.id, limit: 1, offset: meetingOffset });
|
|
35611
|
-
cancelled3(request.signal);
|
|
35612
|
-
if (meeting.accountId !== selected.id || meeting.deletedAt !== null || hits.some((hit) => hit.meetingId !== meeting.id))
|
|
35613
|
-
throw new CliError("validation_error", "meeting archive changed during search; restart from the first page", {
|
|
35614
|
-
complete: false
|
|
35615
|
-
});
|
|
35616
|
-
if (hitOffset > hits.length)
|
|
35617
|
-
throw new CliError("validation_error", "meeting cursor is past the current hit list; restart from the first page");
|
|
35618
|
-
collected.coverage.meetingsScanned++;
|
|
35619
|
-
for (; hitOffset < hits.length; hitOffset++) {
|
|
35620
|
-
const hit = hits[hitOffset];
|
|
35621
|
-
const key = JSON.stringify([selected.id, hit.meetingId, hit.scope, hit.id]);
|
|
35622
|
-
if (seen.has(key))
|
|
35623
|
-
continue;
|
|
35624
|
-
seen.add(key);
|
|
35625
|
-
collected.items.push({
|
|
35626
|
-
before: position(),
|
|
35627
|
-
item: {
|
|
35628
|
-
kind: "meeting",
|
|
35629
|
-
ref: formatMeetingReference({ type: "meeting", accountId: selected.id, meetingId: hit.meetingId }),
|
|
35630
|
-
provider: selected.provider,
|
|
35631
|
-
account: selected.account,
|
|
35632
|
-
accountId: selected.id,
|
|
35633
|
-
title: meeting.title,
|
|
35634
|
-
timestamp: meeting.startedAt === null ? null : new Date(meeting.startedAt).toISOString(),
|
|
35635
|
-
text: hit.text.slice(0, 2e3),
|
|
35636
|
-
meetingId: hit.meetingId,
|
|
35637
|
-
scope: hit.scope,
|
|
35638
|
-
id: hit.id,
|
|
35639
|
-
startMs: hit.startMs,
|
|
35640
|
-
...hit.scope === "transcript" && hit.ref !== void 0 ? {
|
|
35641
|
-
cueRef: hit.ref,
|
|
35642
|
-
speakerName: hit.speakerName ?? null,
|
|
35643
|
-
language: hit.language ?? null,
|
|
35644
|
-
...hit.line === void 0 ? {} : { line: hit.line, linesTotal: hit.linesTotal }
|
|
35645
|
-
} : {}
|
|
35646
|
-
}
|
|
35647
|
-
});
|
|
35648
|
-
if (collected.items.length > request.limit) {
|
|
35649
|
-
hitOffset++;
|
|
35650
|
-
break;
|
|
35651
|
-
}
|
|
35652
|
-
}
|
|
35653
|
-
if (hitOffset === hits.length) {
|
|
35654
|
-
meetingOffset++;
|
|
35655
|
-
hitOffset = 0;
|
|
35656
|
-
if (page.length < 2)
|
|
35657
|
-
collected.coverage.complete = true;
|
|
35658
|
-
}
|
|
35659
|
-
collected.after = position();
|
|
35660
|
-
if (collected.coverage.complete || collected.items.length > request.limit)
|
|
35661
|
-
break;
|
|
35662
|
-
}
|
|
35663
|
-
return collected;
|
|
35664
|
-
}, "collectMeetings");
|
|
35665
|
-
var searchAllIncludingMeetings = /* @__PURE__ */ __name(async (store, account, request, messenger = {}, searchMessages, meaning) => {
|
|
35666
|
-
whole3(request.limit, 1, 1e3, "limit");
|
|
35667
|
-
if (request.maxMeetings !== "all")
|
|
35668
|
-
whole3(request.maxMeetings ?? 100, 1, Number.MAX_SAFE_INTEGER, "maxMeetings");
|
|
35669
|
-
const only = request.only ?? RESOURCES_SEARCHED_WITH_MEETINGS;
|
|
35670
|
-
if (!only.length || only.some((resource) => !RESOURCES_SEARCHED_WITH_MEETINGS.includes(resource)))
|
|
35671
|
-
throw new CliError("validation_error", "only takes messages, mail, notes, events and meetings");
|
|
35672
|
-
if (request.meetingCursor) {
|
|
35673
|
-
if (only.length !== 1 || only[0] !== "meetings")
|
|
35674
|
-
throw new CliError("validation_error", "meeting cursor requires only: [meetings]");
|
|
35675
|
-
whole3(request.meetingCursor.accountId, 1, Number.MAX_SAFE_INTEGER, "cursor account id");
|
|
35676
|
-
whole3(request.meetingCursor.meetingOffset, 0, Number.MAX_SAFE_INTEGER - 2, "cursor meeting offset");
|
|
35677
|
-
whole3(request.meetingCursor.hitOffset, 0, Number.MAX_SAFE_INTEGER, "cursor hit offset");
|
|
35678
|
-
}
|
|
35679
|
-
cancelled3(request.signal);
|
|
35680
|
-
const others = { ...request, only: only.filter((one) => one !== "meetings") };
|
|
35681
|
-
if (!only.includes("meetings")) {
|
|
35682
|
-
const found = await searchAll(store, account, others, messenger, searchMessages, meaning);
|
|
35683
|
-
cancelled3(request.signal);
|
|
35684
|
-
return found;
|
|
35685
|
-
}
|
|
35686
|
-
const offset = request.offset ?? 0;
|
|
35687
|
-
const window3 = offset + request.limit;
|
|
35688
|
-
const legacy = await searchAll(store, account, { ...others, offset: 0, limit: window3 }, messenger, searchMessages, meaning);
|
|
35689
|
-
cancelled3(request.signal);
|
|
35690
|
-
const compiled = meetingQuery(request.text, request.exact);
|
|
35691
|
-
if ("reason" in compiled)
|
|
35692
|
-
return {
|
|
35693
|
-
...legacy,
|
|
35694
|
-
items: legacy.items.slice(offset),
|
|
35695
|
-
skipped: [...legacy.skipped, { resource: "meetings", code: "validation_error", reason: compiled.reason }]
|
|
35696
|
-
};
|
|
35697
|
-
let meetings;
|
|
35698
|
-
const meetingAccount = request.meetingAccount ?? account;
|
|
35699
|
-
try {
|
|
35700
|
-
meetings = await collectMeetings(store, meetingAccount, { ...request, limit: window3 }, compiled.query);
|
|
35701
|
-
} catch (error) {
|
|
35702
|
-
if (codeOf(error) !== "not_found")
|
|
35703
|
-
throw error;
|
|
35704
|
-
return {
|
|
35705
|
-
...legacy,
|
|
35706
|
-
items: legacy.items.slice(offset),
|
|
35707
|
-
skipped: [
|
|
35708
|
-
...legacy.skipped,
|
|
35709
|
-
{ resource: "meetings", code: "not_found", reason: "the selected meeting account is not stored" }
|
|
35710
|
-
]
|
|
35711
|
-
};
|
|
35712
|
-
}
|
|
35713
|
-
const ranked = /* @__PURE__ */ new Map();
|
|
35714
|
-
for (const list3 of [legacy.items, meetings.items.map(({ item: item2 }) => item2)])
|
|
35715
|
-
list3.forEach((item2, rank) => {
|
|
35716
|
-
const key = item2.kind === "meeting" ? JSON.stringify([item2.kind, item2.accountId, item2.meetingId, item2.scope, item2.id]) : item2.ref;
|
|
35717
|
-
const held = ranked.get(key) ?? { item: item2, score: 0 };
|
|
35718
|
-
held.score += 1 / (RRF_K3 + rank + 1);
|
|
35719
|
-
ranked.set(key, held);
|
|
35720
|
-
});
|
|
35721
|
-
const ordered = [...ranked.values()].sort((a, b) => b.score - a.score).map(({ item: item2 }) => item2);
|
|
35722
|
-
const items = ordered.slice(offset, window3);
|
|
35723
|
-
const returnedMeetings = ordered.slice(0, window3).filter((item2) => item2.kind === "meeting").length;
|
|
35724
|
-
const nextCursor = meetings.items[returnedMeetings]?.before ?? (!meetings.coverage.complete ? meetings.after : void 0);
|
|
35725
|
-
const more = legacy.hasMore || ordered.length > window3;
|
|
35726
|
-
const { nextOffset: _, ...rest } = legacy;
|
|
35727
|
-
return {
|
|
35728
|
-
...rest,
|
|
35729
|
-
items,
|
|
35730
|
-
hasMore: more ? true : meetings.coverage.complete ? false : null,
|
|
35731
|
-
...more && window3 <= MAX_SEARCH_OFFSET ? { nextOffset: window3 } : {},
|
|
35732
|
-
searched: [...legacy.searched, "meetings"],
|
|
35733
|
-
accounts: [
|
|
35734
|
-
...legacy.accounts,
|
|
35735
|
-
{ resource: "meetings", provider: meetingAccount.provider, account: meetingAccount.account }
|
|
35736
|
-
],
|
|
35737
|
-
meetings: { ...meetings.coverage, ...nextCursor ? { nextCursor } : {} }
|
|
35738
|
-
};
|
|
35739
|
-
}, "searchAllIncludingMeetings");
|
|
35740
|
-
var MEETINGS_UNNAMED = "meetings are searched only when --source names a meeting account, zoom or meetings";
|
|
35741
|
-
var searchAllWithMeetings = /* @__PURE__ */ __name(async (store, account, request, messenger = {}, searchMessages, meaning) => {
|
|
35742
|
-
if (request.source !== void 0)
|
|
35743
|
-
return searchAllOfSource(store, account, request.source, request, messenger, searchMessages, meaning);
|
|
35744
|
-
const only = request.only ?? RESOURCES_SEARCHED_WITH_MEETINGS;
|
|
35745
|
-
if (only.length === 1 && only[0] === "meetings")
|
|
35746
|
-
throw new CliError("validation_error", `--only meetings: ${MEETINGS_UNNAMED}`);
|
|
35747
|
-
if (request.maxMeetings !== void 0)
|
|
35748
|
-
throw new CliError("validation_error", `--max-meetings: ${MEETINGS_UNNAMED}`);
|
|
35749
|
-
const found = await searchAll(store, account, { ...request, only: only.filter((resource) => resource !== "meetings") }, messenger, searchMessages, meaning);
|
|
35750
|
-
return only.includes("meetings") ? {
|
|
35751
|
-
...found,
|
|
35752
|
-
skipped: [...found.skipped, { resource: "meetings", code: "validation_error", reason: MEETINGS_UNNAMED }]
|
|
35753
|
-
} : found;
|
|
35754
|
-
}, "searchAllWithMeetings");
|
|
35755
|
-
var holdingMeetings = /* @__PURE__ */ __name(async (store, named2) => {
|
|
35756
|
-
if (named2.length < 2)
|
|
35757
|
-
return named2;
|
|
35758
|
-
const holding3 = [];
|
|
35759
|
-
for (const key of named2) {
|
|
35760
|
-
const { id: id2 } = await store.accounts.storedAccount(key);
|
|
35761
|
-
if ((await store.meetings.meetings({ accountId: id2, limit: 1 })).length)
|
|
35762
|
-
holding3.push(key);
|
|
35763
|
-
}
|
|
35764
|
-
return holding3.length ? holding3 : named2;
|
|
35765
|
-
}, "holdingMeetings");
|
|
35766
|
-
var keyOf6 = /* @__PURE__ */ __name(({ provider, account }) => `${provider}\0${account}`, "keyOf");
|
|
35767
|
-
var searchAllOfSource = /* @__PURE__ */ __name(async (store, account, source, request, messenger, searchMessages, meaning) => {
|
|
35768
|
-
const only = request.only ?? RESOURCES_SEARCHED_WITH_MEETINGS;
|
|
35769
|
-
const entries = entriesOfList(source, await listContextOf(store, account, messenger.app));
|
|
35770
|
-
const imported = only.includes("business") ? new Set((await store.business.accounts()).map(keyOf6)) : /* @__PURE__ */ new Set();
|
|
35771
|
-
const holdsBusiness = /* @__PURE__ */ __name((one) => imported.has(keyOf6(one)), "holdsBusiness");
|
|
35772
|
-
const { skipped } = fitting(entries, only.filter((one) => one !== "business"), "search all", (kind) => `--only leaves ${kind} out`, holdsBusiness);
|
|
35773
|
-
const named2 = /* @__PURE__ */ __name((resource) => [
|
|
35774
|
-
...new Map(entries.flatMap(({ accounts }) => accounts).filter((one) => resource === "business" ? holdsBusiness(one) : listedHolds(one, resource)).map(({ provider, account: account2 }) => [`${provider}\0${account2}`, { provider, account: account2 }])).values()
|
|
35775
|
-
], "named");
|
|
35776
|
-
const meetings = await holdingMeetings(store, named2("meetings"));
|
|
35777
|
-
const empty2 = named2("meetings").filter((one) => !meetings.some(({ provider, account: account2 }) => provider === one.provider && account2 === one.account)).map(({ provider, account: account2 }) => ({
|
|
35778
|
-
source: `${provider}:${account2}`,
|
|
35779
|
-
code: "not_found",
|
|
35780
|
-
reason: "no meetings stored for it"
|
|
35781
|
-
}));
|
|
35782
|
-
if (only.includes("meetings") && meetings.length > 1)
|
|
35783
|
-
throw new CliError("validation_error", `--source names several meeting accounts; search all reads one: ${meetings.map(({ provider, account: account2 }) => `${provider}:${account2}`).join(", ")}`);
|
|
35784
|
-
const read = only.filter((resource) => named2(resource).length > 0);
|
|
35785
|
-
if (read.includes("meetings") && request.offset !== void 0)
|
|
35786
|
-
throw new CliError("validation_error", "--offset pages messages, mail and notes; not with a meeting account yet");
|
|
35787
|
-
const found = await searchAllIncludingMeetings(store, account, {
|
|
35788
|
-
...request,
|
|
35789
|
-
only: read,
|
|
35790
|
-
scope: {
|
|
35791
|
-
messages: named2("messages"),
|
|
35792
|
-
mail: named2("mail"),
|
|
35793
|
-
notes: named2("notes"),
|
|
35794
|
-
events: named2("events"),
|
|
35795
|
-
crm: named2("crm"),
|
|
35796
|
-
business: named2("business")
|
|
35797
|
-
},
|
|
35798
|
-
...meetings[0] ? { meetingAccount: meetings[0] } : {}
|
|
35799
|
-
}, messenger, searchMessages, meaning);
|
|
35800
|
-
const unnamed = only.filter((resource) => !read.includes(resource)).map((resource) => ({ resource, code: "not_found", reason: `--source names no ${resource} account` }));
|
|
35801
|
-
return { ...found, skipped: [...skipped, ...empty2, ...unnamed, ...found.skipped] };
|
|
35802
|
-
}, "searchAllOfSource");
|
|
35803
|
-
|
|
35804
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.619.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._3343d636b3fedf7ef3285e4c7a47096e/node_modules/@wirecat/cli-core/dist/services/server-search.js
|
|
36147
|
+
var PERIOD_DEPTH = 100;
|
|
36148
|
+
var PERIOD_BOOST = 0.5;
|
|
36149
|
+
var insidePeriodFirst = /* @__PURE__ */ __name((ordered, period) => {
|
|
36150
|
+
if (!period)
|
|
36151
|
+
return ordered;
|
|
36152
|
+
const inside2 = /* @__PURE__ */ __name(({ timestamp }) => {
|
|
36153
|
+
const at = timestamp === null ? Number.NaN : Date.parse(timestamp);
|
|
36154
|
+
return at >= period.from && at < period.to;
|
|
36155
|
+
}, "inside");
|
|
36156
|
+
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);
|
|
36157
|
+
}, "insidePeriodFirst");
|
|
36158
|
+
|
|
36159
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.624.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._325ff8c9daf4b8769887d5253d3c1255/node_modules/@wirecat/cli-core/dist/services/server-search.js
|
|
35805
36160
|
var SERVER_SEARCH_KEY = "messages.server-search";
|
|
35806
36161
|
var SERVER_BOUNDS = { timeMs: 5e3, perCall: 100, maxCalls: 3, textBytes: 262144 };
|
|
35807
36162
|
var DEFAULT_BACKEND = "both";
|
|
@@ -35823,14 +36178,14 @@ var merge = /* @__PURE__ */ __name((one, other) => {
|
|
|
35823
36178
|
...Number.isFinite(maxDate) ? { maxDate } : {}
|
|
35824
36179
|
};
|
|
35825
36180
|
}, "merge");
|
|
35826
|
-
var
|
|
36181
|
+
var sameAccount4 = /* @__PURE__ */ __name((one, other) => one.provider === other.provider && one.account === other.account, "sameAccount");
|
|
35827
36182
|
var branchesOf = /* @__PURE__ */ __name((node, account) => {
|
|
35828
36183
|
if (node.kind === "predicate") {
|
|
35829
36184
|
if ((node.field === "text" || node.field === "exact") && (node.operator === "term" || node.operator === "phrase"))
|
|
35830
36185
|
return node.value === "" ? [{ words: [] }] : [{ words: [node.value] }];
|
|
35831
36186
|
const { chat, sender, date: date2 } = node.resolution ?? {};
|
|
35832
36187
|
if (chat)
|
|
35833
|
-
return
|
|
36188
|
+
return sameAccount4(chat.account, account) ? [{ words: [], chat: chat.chatId }] : [];
|
|
35834
36189
|
if (sender?.provider === account.provider)
|
|
35835
36190
|
return [{ words: [], from: sender.id }];
|
|
35836
36191
|
if (date2)
|
|
@@ -35900,9 +36255,9 @@ var searchServer = /* @__PURE__ */ __name(async (deps, request) => {
|
|
|
35900
36255
|
const store = await deps.store();
|
|
35901
36256
|
const account = await deps.account();
|
|
35902
36257
|
const { execution } = await prepareLucene(store, account, request, deps.messenger);
|
|
35903
|
-
if (!execution.accounts.some((one) =>
|
|
36258
|
+
if (!execution.accounts.some((one) => sameAccount4(one, account)))
|
|
35904
36259
|
return skip("other_accounts");
|
|
35905
|
-
const scoped = execution.chat ?
|
|
36260
|
+
const scoped = execution.chat ? sameAccount4(execution.chat.account, account) ? { words: [], chat: execution.chat.chatId } : void 0 : { words: [] };
|
|
35906
36261
|
if (!scoped)
|
|
35907
36262
|
return skip("other_accounts");
|
|
35908
36263
|
const all = branchesOf(execution.root, account).flatMap((branch) => merge(scoped, branch) ?? []);
|
|
@@ -35932,7 +36287,7 @@ var searchServer = /* @__PURE__ */ __name(async (deps, request) => {
|
|
|
35932
36287
|
report.complete = false;
|
|
35933
36288
|
report.failed.push({ chat: branch.chat ?? null, reason });
|
|
35934
36289
|
}, "fail");
|
|
35935
|
-
const
|
|
36290
|
+
const ask2 = /* @__PURE__ */ __name(async (adapter) => {
|
|
35936
36291
|
const search = capability(adapter, "searchMessages", "search messages on its server");
|
|
35937
36292
|
await Promise.all(calls.map(async (branch) => {
|
|
35938
36293
|
if (!open7)
|
|
@@ -35954,7 +36309,7 @@ var searchServer = /* @__PURE__ */ __name(async (deps, request) => {
|
|
|
35954
36309
|
}));
|
|
35955
36310
|
}, "ask");
|
|
35956
36311
|
try {
|
|
35957
|
-
const run = deps.withConnection ? deps.withConnection(
|
|
36312
|
+
const run = deps.withConnection ? deps.withConnection(ask2) : deps.connection().then(ask2);
|
|
35958
36313
|
const outcome2 = await Promise.race([
|
|
35959
36314
|
run.then(() => "done", () => "failed"),
|
|
35960
36315
|
bound2
|
|
@@ -35990,7 +36345,7 @@ var searchServer = /* @__PURE__ */ __name(async (deps, request) => {
|
|
|
35990
36345
|
return { report, sources };
|
|
35991
36346
|
}, "searchServer");
|
|
35992
36347
|
|
|
35993
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
36348
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.624.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._325ff8c9daf4b8769887d5253d3c1255/node_modules/@wirecat/cli-core/dist/services/messages.js
|
|
35994
36349
|
var DELETE_AT_ONCE = 10;
|
|
35995
36350
|
var filesOf = /* @__PURE__ */ __name(({ attachments }) => {
|
|
35996
36351
|
const files = fileLinks(attachments);
|
|
@@ -36212,7 +36567,6 @@ var messagesService = /* @__PURE__ */ __name((deps) => {
|
|
|
36212
36567
|
});
|
|
36213
36568
|
}, "search"),
|
|
36214
36569
|
searchAll: /* @__PURE__ */ __name((request) => inStore((store, account) => searchAll(store, account, request, deps.messenger, unifiedMessages(store, account), meaningLane(deps))), "searchAll"),
|
|
36215
|
-
searchAllWithMeetings: /* @__PURE__ */ __name((request) => inStore((store, account) => searchAllWithMeetings(store, account, request, deps.messenger, unifiedMessages(store, account), meaningLane(deps))), "searchAllWithMeetings"),
|
|
36216
36570
|
stats: /* @__PURE__ */ __name((query) => inStore(async (store, account) => {
|
|
36217
36571
|
const refreshed = await refreshSearch(deps, query);
|
|
36218
36572
|
const stats = await statsStore(store, account, query, deps.messenger);
|
|
@@ -36431,9 +36785,9 @@ var checkMediaOptions = /* @__PURE__ */ __name((messenger, asked, attachments) =
|
|
|
36431
36785
|
throw new CliError("validation_error", `${MEDIA_FLAGS[first2]} needs a --photo or --file`);
|
|
36432
36786
|
}, "checkMediaOptions");
|
|
36433
36787
|
|
|
36434
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
36788
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.624.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._325ff8c9daf4b8769887d5253d3c1255/node_modules/@wirecat/cli-core/dist/domain/channel-tags.js
|
|
36435
36789
|
var CHANNEL_TAG_RULES_VERSION = "keywords-v1";
|
|
36436
|
-
var
|
|
36790
|
+
var RULES2 = {
|
|
36437
36791
|
ai: [/\b(ai|gpt|llm|machine learning|artificial intelligence)\b/iu, /нейросет|искусственн/iu],
|
|
36438
36792
|
news: [/\b(news|breaking|digest)\b/iu, /новост|дайджест|сводк/iu],
|
|
36439
36793
|
memes: [/\b(memes?|humou?r|lol)\b/iu, /мем|юмор|шутк/iu],
|
|
@@ -36441,12 +36795,12 @@ var RULES = {
|
|
|
36441
36795
|
jobs: [/\b(jobs?|hiring|careers?)\b/iu, /ваканс|работа/iu],
|
|
36442
36796
|
events: [/\b(events?|meetups?|conference)\b/iu, /мероприяти|митап|конференц/iu]
|
|
36443
36797
|
};
|
|
36444
|
-
var classifyChannel = /* @__PURE__ */ __name((metadata) => Object.entries(
|
|
36798
|
+
var classifyChannel = /* @__PURE__ */ __name((metadata) => Object.entries(RULES2).flatMap(([tag, patterns]) => {
|
|
36445
36799
|
const fields = Object.entries(metadata).filter(([, value]) => value && patterns.some((pattern) => pattern.test(value))).map(([field]) => field);
|
|
36446
36800
|
return fields.length ? [{ tag, score: fields.length / 3, fields }] : [];
|
|
36447
36801
|
}), "classifyChannel");
|
|
36448
36802
|
|
|
36449
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
36803
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.624.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._325ff8c9daf4b8769887d5253d3c1255/node_modules/@wirecat/cli-core/dist/services/metadata.js
|
|
36450
36804
|
var metadataService = /* @__PURE__ */ __name((deps) => {
|
|
36451
36805
|
const held = /* @__PURE__ */ __name(async (reference, { includeLeft = false } = {}) => {
|
|
36452
36806
|
const store = await deps.store();
|
|
@@ -36532,7 +36886,7 @@ var metadataService = /* @__PURE__ */ __name((deps) => {
|
|
|
36532
36886
|
};
|
|
36533
36887
|
}, "metadataService");
|
|
36534
36888
|
|
|
36535
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
36889
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.624.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._325ff8c9daf4b8769887d5253d3c1255/node_modules/@wirecat/cli-core/dist/moderation/run.js
|
|
36536
36890
|
var FIRST_LOOK_MS = 24 * 36e5;
|
|
36537
36891
|
var moderateWith = /* @__PURE__ */ __name(async (run) => {
|
|
36538
36892
|
const { chatId, title, rules, point, since, dryRun } = run;
|
|
@@ -36569,7 +36923,7 @@ var moderateWith = /* @__PURE__ */ __name(async (run) => {
|
|
|
36569
36923
|
return { chatId, rows, notes };
|
|
36570
36924
|
}, "moderateWith");
|
|
36571
36925
|
|
|
36572
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
36926
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.624.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._325ff8c9daf4b8769887d5253d3c1255/node_modules/@wirecat/cli-core/dist/services/moderation.js
|
|
36573
36927
|
var moderationService = /* @__PURE__ */ __name((deps) => {
|
|
36574
36928
|
const file2 = /* @__PURE__ */ __name(() => new ModerationRules(moderationPathFor(deps.messenger.app, deps.profile ?? "default", deps.env ?? process.env)), "file");
|
|
36575
36929
|
const group = /* @__PURE__ */ __name(async (chat) => {
|
|
@@ -36647,7 +37001,7 @@ var moderatorOf = /* @__PURE__ */ __name((adapter, deps) => ({
|
|
|
36647
37001
|
}, "removePerson")
|
|
36648
37002
|
}), "moderatorOf");
|
|
36649
37003
|
|
|
36650
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
37004
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.624.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._325ff8c9daf4b8769887d5253d3c1255/node_modules/@wirecat/cli-core/dist/services/private-people.js
|
|
36651
37005
|
var noteItem = /* @__PURE__ */ __name((provider, note) => ({
|
|
36652
37006
|
id: note.id,
|
|
36653
37007
|
contact: formatReference({ type: "contact", provider, id: note.personId }),
|
|
@@ -36691,7 +37045,7 @@ var privatePeopleService = /* @__PURE__ */ __name((deps) => {
|
|
|
36691
37045
|
};
|
|
36692
37046
|
}, "privatePeopleService");
|
|
36693
37047
|
|
|
36694
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
37048
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.624.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._325ff8c9daf4b8769887d5253d3c1255/node_modules/@wirecat/cli-core/dist/services/rankings.js
|
|
36695
37049
|
var empty = /* @__PURE__ */ __name(() => ({
|
|
36696
37050
|
total: 0,
|
|
36697
37051
|
population: 0,
|
|
@@ -36947,7 +37301,7 @@ var rankingsService = /* @__PURE__ */ __name((deps) => ({
|
|
|
36947
37301
|
}, "evidence")
|
|
36948
37302
|
}), "rankingsService");
|
|
36949
37303
|
|
|
36950
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
37304
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.624.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._325ff8c9daf4b8769887d5253d3c1255/node_modules/@wirecat/cli-core/dist/services/reply-stats.js
|
|
36951
37305
|
var FIELDS = ["date", "chat", "kind"];
|
|
36952
37306
|
var WAITING_TAIL = 100;
|
|
36953
37307
|
var plainOnly = /* @__PURE__ */ __name((text2, command) => {
|
|
@@ -37041,9 +37395,9 @@ var replyStatsService = /* @__PURE__ */ __name((deps) => {
|
|
|
37041
37395
|
}
|
|
37042
37396
|
const days = /* @__PURE__ */ new Map();
|
|
37043
37397
|
if (by === "day") {
|
|
37044
|
-
const
|
|
37398
|
+
const keyOf7 = calendarKey(timezone, "day");
|
|
37045
37399
|
for (const { repliedAt, delayMs } of delays) {
|
|
37046
|
-
const key =
|
|
37400
|
+
const key = keyOf7(repliedAt);
|
|
37047
37401
|
const list3 = days.get(key) ?? [];
|
|
37048
37402
|
list3.push(delayMs);
|
|
37049
37403
|
days.set(key, list3);
|
|
@@ -37074,7 +37428,7 @@ var replyStatsService = /* @__PURE__ */ __name((deps) => {
|
|
|
37074
37428
|
};
|
|
37075
37429
|
}, "replyStatsService");
|
|
37076
37430
|
|
|
37077
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
37431
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.624.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._325ff8c9daf4b8769887d5253d3c1255/node_modules/@wirecat/cli-core/dist/services/searches.js
|
|
37078
37432
|
var savedSearchItem = /* @__PURE__ */ __name((one) => ({
|
|
37079
37433
|
id: one.id,
|
|
37080
37434
|
name: one.name,
|
|
@@ -37203,7 +37557,7 @@ var searchesService = /* @__PURE__ */ __name((deps) => {
|
|
|
37203
37557
|
};
|
|
37204
37558
|
}, "searchesService");
|
|
37205
37559
|
|
|
37206
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
37560
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.624.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._325ff8c9daf4b8769887d5253d3c1255/node_modules/@wirecat/cli-core/dist/services/tags.js
|
|
37207
37561
|
var TAGGING_QUERY = {
|
|
37208
37562
|
entity: "tagging",
|
|
37209
37563
|
backend: "sql",
|
|
@@ -37287,7 +37641,7 @@ var tagsService = /* @__PURE__ */ __name((deps) => {
|
|
|
37287
37641
|
};
|
|
37288
37642
|
}, "tagsService");
|
|
37289
37643
|
|
|
37290
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
37644
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.624.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._325ff8c9daf4b8769887d5253d3c1255/node_modules/@wirecat/cli-core/dist/services/topics.js
|
|
37291
37645
|
var actionOf = /* @__PURE__ */ __name(({ title, closed, pinned, hidden, icon }) => {
|
|
37292
37646
|
const set = [closed, pinned, hidden].filter((one) => one !== void 0).length;
|
|
37293
37647
|
if (title !== void 0 || icon !== void 0 || set !== 1)
|
|
@@ -37486,10 +37840,10 @@ var topicsService = /* @__PURE__ */ __name((deps) => {
|
|
|
37486
37840
|
};
|
|
37487
37841
|
}, "topicsService");
|
|
37488
37842
|
|
|
37489
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
37843
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.624.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._325ff8c9daf4b8769887d5253d3c1255/node_modules/@wirecat/cli-core/dist/crm/sync.js
|
|
37490
37844
|
var CLOCK_MARGIN = 60 * 6e4;
|
|
37491
37845
|
|
|
37492
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
37846
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.624.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._325ff8c9daf4b8769887d5253d3c1255/node_modules/@wirecat/cli-core/dist/crm/writer.js
|
|
37493
37847
|
var CRM_ASSIGN_OTHERS_KEY = "crm.assign-others";
|
|
37494
37848
|
var CRM_WRITE_DEFAULTS = {
|
|
37495
37849
|
"deals.delete": "ask",
|
|
@@ -37497,10 +37851,10 @@ var CRM_WRITE_DEFAULTS = {
|
|
|
37497
37851
|
[CRM_ASSIGN_OTHERS_KEY]: "deny"
|
|
37498
37852
|
};
|
|
37499
37853
|
|
|
37500
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
37854
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.624.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._325ff8c9daf4b8769887d5253d3c1255/node_modules/@wirecat/cli-core/dist/services/evidence.js
|
|
37501
37855
|
import { createHash as createHash11, randomUUID as randomUUID6 } from "node:crypto";
|
|
37502
37856
|
var hash2 = /* @__PURE__ */ __name((value) => createHash11("sha256").update(JSON.stringify(value)).digest("hex"), "hash");
|
|
37503
|
-
var
|
|
37857
|
+
var positive2 = /* @__PURE__ */ __name((value, name, minimum = 1) => {
|
|
37504
37858
|
if (!Number.isSafeInteger(value) || value < minimum)
|
|
37505
37859
|
throw new CliError("validation_error", `${name} must be a safe integer of at least ${minimum}`);
|
|
37506
37860
|
return value;
|
|
@@ -37517,8 +37871,8 @@ var prepareEvidencePacket = /* @__PURE__ */ __name(({ kind, source, page, limits
|
|
|
37517
37871
|
if (new Set(page.items.map(({ id: id2 }) => id2)).size !== page.items.length)
|
|
37518
37872
|
throw new CliError("validation_error", "an evidence page must not repeat a message id");
|
|
37519
37873
|
const limits = {
|
|
37520
|
-
messages:
|
|
37521
|
-
bytes:
|
|
37874
|
+
messages: positive2(requested?.messages ?? 100, "evidence message limit"),
|
|
37875
|
+
bytes: positive2(requested?.bytes ?? 64 * 1024, "evidence byte limit", 2)
|
|
37522
37876
|
};
|
|
37523
37877
|
const scope = { provider: source.provider, account: source.account, chat: source.chat };
|
|
37524
37878
|
const items = [];
|
|
@@ -37571,7 +37925,7 @@ var prepareEvidencePacket = /* @__PURE__ */ __name(({ kind, source, page, limits
|
|
|
37571
37925
|
return { ...content, id: randomUUID6(), fingerprint: hash2(content) };
|
|
37572
37926
|
}, "prepareEvidencePacket");
|
|
37573
37927
|
|
|
37574
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
37928
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.624.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._325ff8c9daf4b8769887d5253d3c1255/node_modules/@wirecat/cli-core/dist/services/evidence-read.js
|
|
37575
37929
|
var readEvidencePacket = /* @__PURE__ */ __name(async (store, account, { chat, limit, before: before2 }, messenger = {}) => {
|
|
37576
37930
|
if (!Number.isSafeInteger(limit) || limit < 1 || limit > 100)
|
|
37577
37931
|
throw new CliError("validation_error", "evidence message limit must be an integer from 1 to 100");
|
|
@@ -37591,7 +37945,7 @@ var readEvidencePacket = /* @__PURE__ */ __name(async (store, account, { chat, l
|
|
|
37591
37945
|
return { ...packet, nextBeforeId: older && last ? last.id : null };
|
|
37592
37946
|
}, "readEvidencePacket");
|
|
37593
37947
|
|
|
37594
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
37948
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.624.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._325ff8c9daf4b8769887d5253d3c1255/node_modules/@wirecat/cli-core/dist/services/meeting-project-discovery.js
|
|
37595
37949
|
var scopeKeys = [
|
|
37596
37950
|
"accountId",
|
|
37597
37951
|
"meetingId",
|
|
@@ -37613,7 +37967,7 @@ var optionKeys = /* @__PURE__ */ new Set([
|
|
|
37613
37967
|
"maxVocabularyReadBytes"
|
|
37614
37968
|
]);
|
|
37615
37969
|
|
|
37616
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
37970
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.624.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._325ff8c9daf4b8769887d5253d3c1255/node_modules/@wirecat/cli-core/dist/services/text-model-choice.js
|
|
37617
37971
|
import { createHash as createHash12 } from "node:crypto";
|
|
37618
37972
|
import { existsSync as existsSync3 } from "node:fs";
|
|
37619
37973
|
var useTextModel = /* @__PURE__ */ __name(async (id2, { env, command }) => {
|
|
@@ -37744,7 +38098,7 @@ var addCustomTextModel = /* @__PURE__ */ __name(async (id2, payload, { env, fetc
|
|
|
37744
38098
|
return { ...checked2.output, custom: true };
|
|
37745
38099
|
}, "addCustomTextModel");
|
|
37746
38100
|
|
|
37747
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
38101
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.624.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._325ff8c9daf4b8769887d5253d3c1255/node_modules/@wirecat/cli-core/dist/context/communication-selection.js
|
|
37748
38102
|
var communicationFields = {
|
|
37749
38103
|
sources: pipe(array(strictObject({
|
|
37750
38104
|
id: pipe(string(), regex(/^[A-Za-z0-9][A-Za-z0-9._-]{0,127}$/)),
|
|
@@ -37776,7 +38130,7 @@ var communicationRequest = /* @__PURE__ */ __name((value, preparationAfter) => {
|
|
|
37776
38130
|
return { ...input, after, before: before2 };
|
|
37777
38131
|
}, "communicationRequest");
|
|
37778
38132
|
|
|
37779
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
38133
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.624.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._325ff8c9daf4b8769887d5253d3c1255/node_modules/@wirecat/cli-core/dist/services/meeting-preparation-validation.js
|
|
37780
38134
|
var MEETING_PREPARATION_LIMITS = {
|
|
37781
38135
|
meetings: { min: 1, max: 20, default: 5 },
|
|
37782
38136
|
cues: { min: 1, max: 100, default: 10 },
|
|
@@ -37849,7 +38203,7 @@ var validateMeetingPreparationRequest = /* @__PURE__ */ __name((externalId, orig
|
|
|
37849
38203
|
};
|
|
37850
38204
|
}, "validateMeetingPreparationRequest");
|
|
37851
38205
|
|
|
37852
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
38206
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.624.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._325ff8c9daf4b8769887d5253d3c1255/node_modules/@wirecat/cli-core/dist/services/meeting-communications-selection.js
|
|
37853
38207
|
var validatePreparationCommunications = /* @__PURE__ */ __name((section, request, after) => {
|
|
37854
38208
|
const fail2 = /* @__PURE__ */ __name(() => {
|
|
37855
38209
|
throw new CliError("invalid_response", "Preparation communications returned another selection or invalid evidence");
|
|
@@ -37897,7 +38251,7 @@ var validatePreparationCommunications = /* @__PURE__ */ __name((section, request
|
|
|
37897
38251
|
}
|
|
37898
38252
|
}, "validatePreparationCommunications");
|
|
37899
38253
|
|
|
37900
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
38254
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.624.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._325ff8c9daf4b8769887d5253d3c1255/node_modules/@wirecat/cli-core/dist/services/package-upgrade.js
|
|
37901
38255
|
var upgradePackage = /* @__PURE__ */ __name(async ({ current, command, packageName, check: check2 }, ports) => {
|
|
37902
38256
|
const installer = ports.installer();
|
|
37903
38257
|
const argv = updateCommand(installer, packageName);
|
|
@@ -37962,7 +38316,7 @@ var dayAfter = /* @__PURE__ */ __name((published) => {
|
|
|
37962
38316
|
return Number.isNaN(time) ? null : new Date(time + 24 * 60 * 60 * 1e3).toISOString();
|
|
37963
38317
|
}, "dayAfter");
|
|
37964
38318
|
|
|
37965
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
38319
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.624.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._325ff8c9daf4b8769887d5253d3c1255/node_modules/@wirecat/cli-core/dist/services/index.js
|
|
37966
38320
|
var servicesFor = /* @__PURE__ */ __name((deps) => {
|
|
37967
38321
|
const pictures = picturesService(deps);
|
|
37968
38322
|
const base = {
|
|
@@ -37999,7 +38353,7 @@ var servicesFor = /* @__PURE__ */ __name((deps) => {
|
|
|
37999
38353
|
return deps.messenger.services ? { ...base, ...deps.messenger.services(base, deps) } : base;
|
|
38000
38354
|
}, "servicesFor");
|
|
38001
38355
|
|
|
38002
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
38356
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.624.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._325ff8c9daf4b8769887d5253d3c1255/node_modules/@wirecat/cli-core/dist/background/relay.js
|
|
38003
38357
|
import { createHash as createHash13 } from "node:crypto";
|
|
38004
38358
|
import { chmodSync, lstatSync, mkdirSync as mkdirSync6, rmSync as rmSync2 } from "node:fs";
|
|
38005
38359
|
import { createConnection, createServer } from "node:net";
|
|
@@ -38220,7 +38574,7 @@ var relayCommand = /* @__PURE__ */ __name((path, request, options2) => new Promi
|
|
|
38220
38574
|
}, () => finish({ error: stopped() }));
|
|
38221
38575
|
}), "relayCommand");
|
|
38222
38576
|
|
|
38223
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
38577
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.624.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._325ff8c9daf4b8769887d5253d3c1255/node_modules/@wirecat/cli-core/dist/cli/messenger/serve-relay.js
|
|
38224
38578
|
var lentConnection = /* @__PURE__ */ __name((connection, watchers) => throughWrapper(connection, {
|
|
38225
38579
|
close: /* @__PURE__ */ __name(async () => {
|
|
38226
38580
|
}, "close"),
|
|
@@ -38318,13 +38672,6 @@ export {
|
|
|
38318
38672
|
newOperationId,
|
|
38319
38673
|
batchProgress,
|
|
38320
38674
|
mergeBatches,
|
|
38321
|
-
chatReferenceOf,
|
|
38322
|
-
wrongAccount,
|
|
38323
|
-
ensureAccount,
|
|
38324
|
-
isId,
|
|
38325
|
-
foldName,
|
|
38326
|
-
pickChat,
|
|
38327
|
-
pickPerson,
|
|
38328
38675
|
OFFLINE,
|
|
38329
38676
|
onlineDeps,
|
|
38330
38677
|
storedDeps,
|
|
@@ -38425,8 +38772,16 @@ export {
|
|
|
38425
38772
|
writeEnrichmentSetting,
|
|
38426
38773
|
enrichmentEndpoint,
|
|
38427
38774
|
isEnrichmentProvider,
|
|
38775
|
+
enrichmentPrice,
|
|
38776
|
+
keyLookup,
|
|
38777
|
+
keyVariable,
|
|
38428
38778
|
enrichmentState,
|
|
38429
38779
|
searchNotesOf,
|
|
38780
|
+
HARDER_MODELS,
|
|
38781
|
+
HARDER_CANDIDATES,
|
|
38782
|
+
HARDER_CHARS,
|
|
38783
|
+
readHarderSetting,
|
|
38784
|
+
writeHarderSetting,
|
|
38430
38785
|
DELETE_AT_ONCE,
|
|
38431
38786
|
describe,
|
|
38432
38787
|
CHECK_READS,
|