@wirecat/mail-cli 0.13.0 → 0.15.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +67 -0
- package/README.md +9 -4
- package/dist/bin/mail.js +2 -2
- package/dist/bundle/{all-profiles-EEOMFTKE.js → all-profiles-PKXL5TKP.js} +10 -9
- package/dist/bundle/{anthropic-FPSVNB3F.js → anthropic-DFDNZU7C.js} +6 -6
- package/dist/bundle/{app-server-3T6UVR7B.js → app-server-WOZAOCKX.js} +47 -46
- package/dist/bundle/{bun-MSNAKMDK.js → bun-DKZAL6ML.js} +2 -2
- package/dist/bundle/{bun-sqlite-GIBBI5DV.js → bun-sqlite-2A7FS5GD.js} +5 -5
- package/dist/bundle/{chunk-7D7AKYQ2.js → chunk-2A4Z3WOC.js} +3132 -1229
- package/dist/bundle/{chunk-AXWTELO4.js → chunk-2BHY4GFP.js} +2 -2
- package/dist/bundle/{chunk-XLCFCOT4.js → chunk-3MKCLPQV.js} +14 -14
- package/dist/bundle/{chunk-3BC2XSNX.js → chunk-4DGOI6JB.js} +68 -34
- package/dist/bundle/chunk-4HVY3QPF.js +91 -0
- package/dist/bundle/{chunk-NHVOJHHD.js → chunk-4TPNRJER.js} +7 -7
- package/dist/bundle/{chunk-6O6CM2ML.js → chunk-4XRIALMN.js} +2 -2
- package/dist/bundle/{chunk-VSHQITKC.js → chunk-4YECCESG.js} +2 -2
- package/dist/bundle/{chunk-YMNF4QLY.js → chunk-5C3L2QER.js} +26 -25
- package/dist/bundle/{chunk-XPBRNJ2V.js → chunk-5W7D5H2R.js} +1 -1
- package/dist/bundle/{chunk-HANGU5HI.js → chunk-6AYJDBHT.js} +6 -6
- package/dist/bundle/{chunk-CSJYZEFR.js → chunk-6Z7VBDFR.js} +2 -3
- package/dist/bundle/{chunk-BZBNBPCR.js → chunk-73SQQXSU.js} +10 -10
- package/dist/bundle/{chunk-H5XCD6OG.js → chunk-A6O3WHBD.js} +3 -3
- package/dist/bundle/{chunk-6KDFUPBT.js → chunk-BIKMEGC7.js} +8 -8
- package/dist/bundle/{chunk-OHDDGTCH.js → chunk-BKF7XIJ5.js} +10 -10
- package/dist/bundle/{chunk-GQGJV53E.js → chunk-BY5S3JEZ.js} +47 -47
- package/dist/bundle/{chunk-CCHHEMPM.js → chunk-EB2IULWB.js} +3 -2
- package/dist/bundle/{chunk-7FCPLSSM.js → chunk-EDJQDR5X.js} +4 -4
- package/dist/bundle/{chunk-2Y3RKROM.js → chunk-ENZTLYTS.js} +53 -8
- package/dist/bundle/{chunk-VMLGER4M.js → chunk-FEWWBU2I.js} +295 -177
- package/dist/bundle/{chunk-M7JREJFC.js → chunk-G6RG2AZV.js} +27 -8
- package/dist/bundle/{chunk-V25TCQ3Z.js → chunk-HGOYQUT7.js} +1 -1
- package/dist/bundle/{chunk-ZSS22YHM.js → chunk-IA6U76ZY.js} +2 -2
- package/dist/bundle/{chunk-UFWCJUGA.js → chunk-JQTIB4WJ.js} +7 -7
- package/dist/bundle/{chunk-SOCALLW5.js → chunk-K4N5UG64.js} +6 -6
- package/dist/bundle/{chunk-URC4ATBD.js → chunk-KJYCA6IC.js} +4 -4
- package/dist/bundle/{chunk-ILHTNOIV.js → chunk-KV4267S4.js} +1 -1
- package/dist/bundle/{chunk-3QEYHTCQ.js → chunk-LARQTWIL.js} +1 -1
- package/dist/bundle/{chunk-YHSXNUFQ.js → chunk-LRBAQSU3.js} +3 -3
- package/dist/bundle/{chunk-JYZCISN7.js → chunk-M5DF6QNT.js} +13 -13
- package/dist/bundle/{chunk-7L26RKOS.js → chunk-M5VHTDJZ.js} +17 -17
- package/dist/bundle/{chunk-7CSK47S2.js → chunk-NDZK466U.js} +4 -4
- package/dist/bundle/{chunk-FVZST7ZH.js → chunk-NNLYS4IR.js} +12 -89
- package/dist/bundle/{chunk-GIZILLRJ.js → chunk-OJEIUOMW.js} +12 -12
- package/dist/bundle/chunk-OZVGHHFZ.js +35 -0
- package/dist/bundle/{chunk-MBWVZINS.js → chunk-P4SV3VKP.js} +2 -2
- package/dist/bundle/{chunk-OHFSAYZG.js → chunk-PI5P457W.js} +4 -4
- package/dist/bundle/{chunk-TBG3FRS6.js → chunk-PXLVTHMH.js} +3 -3
- package/dist/bundle/{chunk-Y2O3DACO.js → chunk-QCNK3YUZ.js} +95 -36
- package/dist/bundle/{chunk-3CBK26T2.js → chunk-QJQV6KG2.js} +2 -2
- package/dist/bundle/{chunk-UGXTDYUY.js → chunk-QSGT4ZH4.js} +1 -1
- package/dist/bundle/{chunk-VNBQHV5H.js → chunk-QTD3BVS5.js} +6 -6
- package/dist/bundle/{chunk-UUBAWUUI.js → chunk-R6UG66IM.js} +807 -464
- package/dist/bundle/{chunk-XV66LQXV.js → chunk-RBNL3DBQ.js} +3 -3
- package/dist/bundle/{chunk-EFA7FRFJ.js → chunk-RFDP45QO.js} +3 -3
- package/dist/bundle/{chunk-5XTJUQZ5.js → chunk-SPQY3PJX.js} +542 -235
- package/dist/bundle/{chunk-CJPEL2N5.js → chunk-SRHKHE4C.js} +47 -28
- package/dist/bundle/{chunk-WBI7J5B7.js → chunk-U3VX3UUC.js} +5 -5
- package/dist/bundle/{chunk-ZXLJ5EKZ.js → chunk-VQQFOA4O.js} +8 -8
- package/dist/bundle/{chunk-LO66SLGD.js → chunk-WIU733D2.js} +1 -1
- package/dist/bundle/{chunk-JBLZ5XQG.js → chunk-WOV3ABQR.js} +4 -4
- package/dist/bundle/{chunk-H3XWM2VA.js → chunk-WTDYN3TQ.js} +28 -28
- package/dist/bundle/{chunk-EW3XTUPB.js → chunk-XBIPSSKI.js} +4 -4
- package/dist/bundle/{chunk-VD5UJUNR.js → chunk-XGNC5OJG.js} +1 -1
- package/dist/bundle/{chunk-VNXCWZDW.js → chunk-XKUAEYJV.js} +249 -8
- package/dist/bundle/{chunk-PQLBPYJR.js → chunk-YPF6OS37.js} +1 -1
- package/dist/bundle/{chunk-H6Y2A4JA.js → chunk-YRHXVXLQ.js} +2 -2
- package/dist/bundle/{chunk-IGSHWMWC.js → chunk-YWIU4HOT.js} +1 -1
- package/dist/bundle/command-contract-4E4NYRR7.js +34 -0
- package/dist/bundle/{decode-YRTMNHC6.js → decode-LX4FPSI7.js} +5 -5
- package/dist/bundle/{dispatch-BCS2RDF4.js → dispatch-3ILCYZ4Q.js} +8 -8
- package/dist/bundle/{dist-NOBSXRL2.js → dist-HQIZDYNQ.js} +42 -13
- package/dist/bundle/{echarts-5UKZVIF6.js → echarts-BGBPRGR5.js} +2 -2
- package/dist/bundle/{embed-G62XY6BJ.js → embed-ASAE3H5I.js} +6 -6
- package/dist/bundle/{embedder-SCHGLA74.js → embedder-QYDZRKBX.js} +9 -9
- package/dist/bundle/{failure-N5S6ZS62.js → failure-UDL5QZRZ.js} +2 -2
- package/dist/bundle/{first-run-DPF2BBQN.js → first-run-EFNNGFCB.js} +11 -11
- package/dist/bundle/first-screen-XHM3TT6G.js +32 -0
- package/dist/bundle/{instructions-7RP5OKLE.js → instructions-6LPDSKAD.js} +1 -1
- package/dist/bundle/mail.js +12 -12
- package/dist/bundle/{mcp-MNI62HHE.js → mcp-PPVOM4SE.js} +2 -2
- package/dist/bundle/{node-ENCKD6SS.js → node-IB246NCQ.js} +2 -2
- package/dist/bundle/{node-sqlite-4ICXMPYY.js → node-sqlite-UROXM4VR.js} +6 -6
- package/dist/bundle/{oauth-CX2WYMGN.js → oauth-VSCKHS4T.js} +7 -7
- package/dist/bundle/{open-HQZYHMVE.js → open-R4LVB63T.js} +5 -5
- package/dist/bundle/{openai-3ONJIA3F.js → openai-MKCEOFKL.js} +14 -14
- package/dist/bundle/{process-OK3HRPMD.js → process-SWPJGPQC.js} +1 -1
- package/dist/bundle/{program-FLKUE6LL.js → program-CJ2YDRUY.js} +11741 -10648
- package/dist/bundle/{prompt-ZWKUQ42Y.js → prompt-TWWJ5VAM.js} +5 -5
- package/dist/bundle/{recognize-PHDYO6DC.js → recognize-XMO5ETQU.js} +4 -4
- package/dist/bundle/{remote-4CX7GFMU.js → remote-N6VAWJWE.js} +7 -7
- package/dist/bundle/{rerank-ZCZTGXDQ.js → rerank-XNAMC6FH.js} +7 -7
- package/dist/bundle/{serve-3LBS7CPR.js → serve-IJ32WEBH.js} +9 -9
- package/dist/bundle/server-CRVR4L2E.js +64 -0
- package/dist/bundle/{server-2BKI2OQP.js → server-KEYSE5OL.js} +39 -38
- package/dist/bundle/{sqlite-runtime-J5T7SR5W.js → sqlite-runtime-NFBRN7OF.js} +6 -6
- package/dist/bundle/{state-TIRNYVEL.js → state-7WPJEW2Z.js} +6 -6
- package/dist/bundle/{store-F7ZXMIAP.js → store-KHVHOGQR.js} +27 -18
- package/dist/bundle/{store-NGE2E7KZ.js → store-PKQCNACC.js} +15 -14
- package/dist/bundle/store-maintenance-command-5MODJN6R.js +54 -0
- package/dist/commands/account.d.ts.map +1 -1
- package/dist/commands/account.js +149 -3
- package/dist/commands/account.js.map +1 -1
- package/dist/commands/context.d.ts +2 -0
- package/dist/commands/context.d.ts.map +1 -1
- package/dist/commands/context.js +2 -2
- package/dist/commands/context.js.map +1 -1
- package/dist/commands/import.d.ts +3 -0
- package/dist/commands/import.d.ts.map +1 -0
- package/dist/commands/import.js +92 -0
- package/dist/commands/import.js.map +1 -0
- package/dist/commands/read.d.ts.map +1 -1
- package/dist/commands/read.js +29 -3
- package/dist/commands/read.js.map +1 -1
- package/dist/commands/session-start.d.ts.map +1 -1
- package/dist/commands/session-start.js +9 -7
- package/dist/commands/session-start.js.map +1 -1
- package/dist/commands/stats.d.ts.map +1 -1
- package/dist/commands/stats.js +49 -2
- package/dist/commands/stats.js.map +1 -1
- package/dist/commands/sync.d.ts +2 -0
- package/dist/commands/sync.d.ts.map +1 -1
- package/dist/commands/sync.js +38 -4
- package/dist/commands/sync.js.map +1 -1
- package/dist/config.d.ts +11 -0
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +17 -0
- package/dist/config.js.map +1 -1
- package/dist/mail/doctor.d.ts +3 -2
- package/dist/mail/doctor.d.ts.map +1 -1
- package/dist/mail/doctor.js +14 -16
- package/dist/mail/doctor.js.map +1 -1
- package/dist/mail/domain-age.d.ts +29 -0
- package/dist/mail/domain-age.d.ts.map +1 -0
- package/dist/mail/domain-age.js +157 -0
- package/dist/mail/domain-age.js.map +1 -0
- package/dist/mail/mbox.d.ts +9 -0
- package/dist/mail/mbox.d.ts.map +1 -0
- package/dist/mail/mbox.js +230 -0
- package/dist/mail/mbox.js.map +1 -0
- package/dist/oauth.d.ts +13 -9
- package/dist/oauth.d.ts.map +1 -1
- package/dist/oauth.js +12 -25
- package/dist/oauth.js.map +1 -1
- package/dist/profile.d.ts +4 -1
- package/dist/profile.d.ts.map +1 -1
- package/dist/profile.js +6 -1
- package/dist/profile.js.map +1 -1
- package/dist/program.d.ts.map +1 -1
- package/dist/program.js +10 -1
- package/dist/program.js.map +1 -1
- package/dist/reasons.d.ts +1 -1
- package/dist/reasons.d.ts.map +1 -1
- package/dist/reasons.js +0 -1
- package/dist/reasons.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +4 -4
- package/skills/mail-cli/SKILL.md +2 -0
- package/dist/bundle/chunk-72CGQMAZ.js +0 -18
- package/dist/bundle/command-contract-6QSZ5QHQ.js +0 -33
- package/dist/bundle/first-screen-4MRKF6RQ.js +0 -31
- package/dist/bundle/server-X5F7VD2E.js +0 -63
- package/dist/bundle/store-maintenance-command-QZV76KAH.js +0 -53
- /package/dist/bundle/{chunk-NUN6OGOV.js → chunk-LU3WKZBA.js} +0 -0
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
sameOrdinaryFile,
|
|
9
9
|
syncDirectory,
|
|
10
10
|
writeFileAtomic
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-M5DF6QNT.js";
|
|
12
12
|
import {
|
|
13
13
|
MAX_ACTIONS,
|
|
14
14
|
ModerationRules,
|
|
@@ -26,10 +26,10 @@ import {
|
|
|
26
26
|
someUndone,
|
|
27
27
|
validateFormattedText,
|
|
28
28
|
visibleFormattedText
|
|
29
|
-
} from "./chunk-
|
|
29
|
+
} from "./chunk-73SQQXSU.js";
|
|
30
30
|
import {
|
|
31
31
|
MAX_MODEL_IMAGE_BYTES
|
|
32
|
-
} from "./chunk-
|
|
32
|
+
} from "./chunk-QJQV6KG2.js";
|
|
33
33
|
import {
|
|
34
34
|
Command,
|
|
35
35
|
DEFAULT_IMAGE_MODEL,
|
|
@@ -69,17 +69,17 @@ import {
|
|
|
69
69
|
typedCommand,
|
|
70
70
|
vectorModelKey,
|
|
71
71
|
withAttempt
|
|
72
|
-
} from "./chunk-
|
|
72
|
+
} from "./chunk-SPQY3PJX.js";
|
|
73
73
|
import {
|
|
74
74
|
isCliFailure
|
|
75
|
-
} from "./chunk-
|
|
75
|
+
} from "./chunk-NNLYS4IR.js";
|
|
76
76
|
import {
|
|
77
77
|
isNewer,
|
|
78
78
|
updateCommand
|
|
79
|
-
} from "./chunk-
|
|
79
|
+
} from "./chunk-EDJQDR5X.js";
|
|
80
80
|
import {
|
|
81
81
|
remoteKey
|
|
82
|
-
} from "./chunk-
|
|
82
|
+
} from "./chunk-RFDP45QO.js";
|
|
83
83
|
import {
|
|
84
84
|
Unzip,
|
|
85
85
|
UnzipInflate,
|
|
@@ -90,11 +90,11 @@ import {
|
|
|
90
90
|
placedText,
|
|
91
91
|
runEmbedders,
|
|
92
92
|
textModelsDirectory
|
|
93
|
-
} from "./chunk-
|
|
93
|
+
} from "./chunk-QTD3BVS5.js";
|
|
94
94
|
import {
|
|
95
95
|
installFiles,
|
|
96
96
|
megabytes
|
|
97
|
-
} from "./chunk-
|
|
97
|
+
} from "./chunk-WOV3ABQR.js";
|
|
98
98
|
import {
|
|
99
99
|
AGENDA_COLUMNS,
|
|
100
100
|
CHAT_COLUMNS,
|
|
@@ -128,6 +128,7 @@ import {
|
|
|
128
128
|
contextSource,
|
|
129
129
|
correctWords,
|
|
130
130
|
cutChunks,
|
|
131
|
+
delayStats,
|
|
131
132
|
dueDayOf,
|
|
132
133
|
entriesOfList,
|
|
133
134
|
exhausted,
|
|
@@ -154,8 +155,9 @@ import {
|
|
|
154
155
|
sourceOf,
|
|
155
156
|
threadConversation,
|
|
156
157
|
validateAst,
|
|
157
|
-
validateFields
|
|
158
|
-
|
|
158
|
+
validateFields,
|
|
159
|
+
withoutField
|
|
160
|
+
} from "./chunk-2A4Z3WOC.js";
|
|
159
161
|
import {
|
|
160
162
|
COUNTER_FIELDS,
|
|
161
163
|
INTERNAL_NOTES,
|
|
@@ -173,14 +175,15 @@ import {
|
|
|
173
175
|
parseLocator,
|
|
174
176
|
parseReference,
|
|
175
177
|
providerNamed,
|
|
176
|
-
rankingOptions
|
|
177
|
-
|
|
178
|
+
rankingOptions,
|
|
179
|
+
rankingQuestion
|
|
180
|
+
} from "./chunk-XKUAEYJV.js";
|
|
178
181
|
import {
|
|
179
182
|
TASK_KINDS,
|
|
180
183
|
TASK_STATES,
|
|
181
184
|
createTaskService,
|
|
182
185
|
isClosedState
|
|
183
|
-
} from "./chunk-
|
|
186
|
+
} from "./chunk-4TPNRJER.js";
|
|
184
187
|
import {
|
|
185
188
|
EVENT_QUERY,
|
|
186
189
|
MEETING_PROJECT_EVIDENCE_QUERY,
|
|
@@ -210,7 +213,6 @@ import {
|
|
|
210
213
|
normalizeTag,
|
|
211
214
|
parseLucene,
|
|
212
215
|
parseMeetingReference,
|
|
213
|
-
paymentTitle,
|
|
214
216
|
pull,
|
|
215
217
|
queryError,
|
|
216
218
|
queryFieldsOf,
|
|
@@ -222,24 +224,24 @@ import {
|
|
|
222
224
|
validateQuery,
|
|
223
225
|
walkQuery,
|
|
224
226
|
zonedMoment
|
|
225
|
-
} from "./chunk-
|
|
227
|
+
} from "./chunk-FEWWBU2I.js";
|
|
226
228
|
import {
|
|
227
229
|
DEFAULT_STEMMERS,
|
|
228
230
|
createStemmer,
|
|
229
231
|
fold,
|
|
230
232
|
normalize
|
|
231
|
-
} from "./chunk-
|
|
233
|
+
} from "./chunk-BIKMEGC7.js";
|
|
232
234
|
import {
|
|
233
235
|
DEFAULT_TASK_CATEGORIES,
|
|
234
236
|
FALLBACK_CATEGORY
|
|
235
|
-
} from "./chunk-
|
|
237
|
+
} from "./chunk-K4N5UG64.js";
|
|
236
238
|
import {
|
|
237
239
|
storePath,
|
|
238
240
|
wirecatDirectory
|
|
239
|
-
} from "./chunk-
|
|
241
|
+
} from "./chunk-OZVGHHFZ.js";
|
|
240
242
|
import {
|
|
241
243
|
resolvePaths
|
|
242
|
-
} from "./chunk-
|
|
244
|
+
} from "./chunk-QCNK3YUZ.js";
|
|
243
245
|
import {
|
|
244
246
|
array,
|
|
245
247
|
boolean,
|
|
@@ -256,7 +258,7 @@ import {
|
|
|
256
258
|
safeParse,
|
|
257
259
|
strictObject,
|
|
258
260
|
string
|
|
259
|
-
} from "./chunk-
|
|
261
|
+
} from "./chunk-G6RG2AZV.js";
|
|
260
262
|
import {
|
|
261
263
|
importFrom,
|
|
262
264
|
resolveFrom
|
|
@@ -265,7 +267,7 @@ import {
|
|
|
265
267
|
CliError,
|
|
266
268
|
isCliError,
|
|
267
269
|
singleLine
|
|
268
|
-
} from "./chunk-
|
|
270
|
+
} from "./chunk-EB2IULWB.js";
|
|
269
271
|
import {
|
|
270
272
|
__commonJS,
|
|
271
273
|
__name,
|
|
@@ -286,9 +288,9 @@ var require_conventions = __commonJS({
|
|
|
286
288
|
}
|
|
287
289
|
for (var i = 0; i < list2.length; i++) {
|
|
288
290
|
if (hasOwn(list2, i)) {
|
|
289
|
-
var
|
|
290
|
-
if (predicate.call(void 0,
|
|
291
|
-
return
|
|
291
|
+
var item2 = list2[i];
|
|
292
|
+
if (predicate.call(void 0, item2, i, list2)) {
|
|
293
|
+
return item2;
|
|
292
294
|
}
|
|
293
295
|
}
|
|
294
296
|
}
|
|
@@ -1097,8 +1099,8 @@ var require_dom = __commonJS({
|
|
|
1097
1099
|
* The first index of the node in the NodeList; -1 if not found.
|
|
1098
1100
|
* @private
|
|
1099
1101
|
*/
|
|
1100
|
-
indexOf: /* @__PURE__ */ __name(function(
|
|
1101
|
-
return Array.prototype.indexOf.call(this,
|
|
1102
|
+
indexOf: /* @__PURE__ */ __name(function(item2) {
|
|
1103
|
+
return Array.prototype.indexOf.call(this, item2);
|
|
1102
1104
|
}, "indexOf")
|
|
1103
1105
|
};
|
|
1104
1106
|
NodeList.prototype[Symbol.iterator] = function() {
|
|
@@ -16881,10 +16883,10 @@ var require_lib3 = __commonJS({
|
|
|
16881
16883
|
}
|
|
16882
16884
|
});
|
|
16883
16885
|
|
|
16884
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
16886
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/ports/traits.js
|
|
16885
16887
|
var syncsOneChat = /* @__PURE__ */ __name((messenger) => messenger.history !== "store" || messenger.historyOnDemand === true, "syncsOneChat");
|
|
16886
16888
|
|
|
16887
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
16889
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/conversations/link.js
|
|
16888
16890
|
var RULES_VERSION = 5;
|
|
16889
16891
|
var LOOK_BACK = 50;
|
|
16890
16892
|
var SAME_SENDER_WITHIN = 10;
|
|
@@ -16974,7 +16976,7 @@ var latest = /* @__PURE__ */ __name((window3, matches) => {
|
|
|
16974
16976
|
var sameThread = /* @__PURE__ */ __name((a, b) => a.threadId === b.threadId, "sameThread");
|
|
16975
16977
|
var link = /* @__PURE__ */ __name((message, parentId, source, kind, confidence, method) => ({ messageId: message.id, parentId, source, kind, confidence, method }), "link");
|
|
16976
16978
|
|
|
16977
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
16979
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/cli/messenger/lacks.js
|
|
16978
16980
|
var COMMAND_NEEDS = {
|
|
16979
16981
|
"account update": ["updateProfile", "change the profile"],
|
|
16980
16982
|
"account sessions list": ["sessions", "list the account's sessions"],
|
|
@@ -17024,7 +17026,7 @@ var hideNever = /* @__PURE__ */ __name((messenger, group) => {
|
|
|
17024
17026
|
return group;
|
|
17025
17027
|
}, "hideNever");
|
|
17026
17028
|
|
|
17027
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
17029
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/services/members-audit.js
|
|
17028
17030
|
var AUDIT_PAGE = 200;
|
|
17029
17031
|
var AUDIT_BUDGET = 10;
|
|
17030
17032
|
var AUDIT_PAUSE_MS = 1e3;
|
|
@@ -17104,7 +17106,7 @@ var burstJoins = /* @__PURE__ */ __name((members) => {
|
|
|
17104
17106
|
return found;
|
|
17105
17107
|
}, "burstJoins");
|
|
17106
17108
|
|
|
17107
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
17109
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/meetings/cli/query-options.js
|
|
17108
17110
|
var queryWordsAfterOptions = /* @__PURE__ */ __name((command) => {
|
|
17109
17111
|
command.allowUnknownOption();
|
|
17110
17112
|
const parse = command.parseOptions.bind(command);
|
|
@@ -17124,7 +17126,7 @@ var queryWordsAfterOptions = /* @__PURE__ */ __name((command) => {
|
|
|
17124
17126
|
return command;
|
|
17125
17127
|
}, "queryWordsAfterOptions");
|
|
17126
17128
|
|
|
17127
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
17129
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/meetings/cli/passage.js
|
|
17128
17130
|
var count = /* @__PURE__ */ __name((value) => {
|
|
17129
17131
|
if (!/^(0|[1-9]\d*)$/.test(value) || !Number.isSafeInteger(Number(value)))
|
|
17130
17132
|
throw new CliError("validation_error", "expected a nonnegative safe integer");
|
|
@@ -17166,7 +17168,7 @@ var addMeetingPassageCommandDefinition = /* @__PURE__ */ __name((program, deps)
|
|
|
17166
17168
|
var createMeetingPassageCommand = sharedCommand(createMeetingPassageCommandDefinition);
|
|
17167
17169
|
var addMeetingPassageCommand = sharedCommand(addMeetingPassageCommandDefinition);
|
|
17168
17170
|
|
|
17169
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
17171
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/meetings/cli/project-evidence.js
|
|
17170
17172
|
var integer = /* @__PURE__ */ __name((value) => {
|
|
17171
17173
|
if (!/^[1-9]\d*$/.test(value) || !Number.isSafeInteger(Number(value)))
|
|
17172
17174
|
throw new CliError("validation_error", "expected a positive safe integer");
|
|
@@ -17189,7 +17191,7 @@ ${fieldsHelp(MEETING_PROJECT_EVIDENCE_QUERY)}`).option("--limit <n>", "hits in o
|
|
|
17189
17191
|
}, "addMeetingProjectEvidenceCommandDefinition");
|
|
17190
17192
|
var addMeetingProjectEvidenceCommand = sharedCommand(addMeetingProjectEvidenceCommandDefinition);
|
|
17191
17193
|
|
|
17192
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
17194
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/meetings/cli/search.js
|
|
17193
17195
|
var ZONED = /(?:Z|[+-]\d{2}:?\d{2})$/i;
|
|
17194
17196
|
var moment = /* @__PURE__ */ __name((flag, end, readIn) => (value) => {
|
|
17195
17197
|
const zone = timezoneOf();
|
|
@@ -17275,7 +17277,7 @@ var addMeetingSearchCommandDefinition = /* @__PURE__ */ __name((program, deps) =
|
|
|
17275
17277
|
var createMeetingSearchCommand = sharedCommand(createMeetingSearchCommandDefinition);
|
|
17276
17278
|
var addMeetingSearchCommand = sharedCommand(addMeetingSearchCommandDefinition);
|
|
17277
17279
|
|
|
17278
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
17280
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/meetings/cli/index.js
|
|
17279
17281
|
var integer3 = /* @__PURE__ */ __name((text2) => {
|
|
17280
17282
|
if (!/^[1-9]\d*$/.test(text2) || !Number.isSafeInteger(Number(text2)))
|
|
17281
17283
|
throw new InvalidArgumentError("expected a positive integer");
|
|
@@ -17407,7 +17409,7 @@ ${fieldsHelp(EVENT_QUERY, MEETING_QUERY_GUIDE)}`);
|
|
|
17407
17409
|
}, "addMeetingCommandsDefinition");
|
|
17408
17410
|
var addMeetingCommands = sharedCommand(addMeetingCommandsDefinition);
|
|
17409
17411
|
|
|
17410
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
17412
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/cli/list-query.js
|
|
17411
17413
|
var LIST_QUERY_GUIDE = "https://github.com/WireCatLabs/cli-core/blob/main/docs/search/query-language.md";
|
|
17412
17414
|
var QUERY_ARGUMENT = "field:value terms that narrow the list \u2014 the fields are below";
|
|
17413
17415
|
var withQuery = /* @__PURE__ */ __name((command, registry) => {
|
|
@@ -17540,7 +17542,7 @@ var termField = /* @__PURE__ */ __name((name, type, example, more = {}) => nativ
|
|
|
17540
17542
|
var queryHelp = /* @__PURE__ */ __name((registry) => `
|
|
17541
17543
|
${fieldsHelp(registry, LIST_QUERY_GUIDE)}`, "queryHelp");
|
|
17542
17544
|
|
|
17543
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
17545
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/cli/paging.js
|
|
17544
17546
|
var positiveCount = /* @__PURE__ */ __name((flag) => (value) => {
|
|
17545
17547
|
if (!/^\d+$/.test(value.trim()) || Number(value) < 1)
|
|
17546
17548
|
throw new CliError("validation_error", `${flag} takes a whole number from 1 upwards, not "${value}"`);
|
|
@@ -17549,7 +17551,7 @@ var positiveCount = /* @__PURE__ */ __name((flag) => (value) => {
|
|
|
17549
17551
|
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");
|
|
17550
17552
|
var window = /* @__PURE__ */ __name(({ limit, page, all }) => all ? { offset: 0 } : { limit, offset: (page - 1) * limit }, "window");
|
|
17551
17553
|
|
|
17552
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
17554
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/cli/messenger/chat-answers.js
|
|
17553
17555
|
var defined = /* @__PURE__ */ __name((record2) => Object.fromEntries(Object.entries(record2).filter(([, value]) => value !== void 0)), "defined");
|
|
17554
17556
|
var chatRef = /* @__PURE__ */ __name((account, chat) => formatReference({ type: "chat", provider: account.provider, account: account.account, chat }), "chatRef");
|
|
17555
17557
|
var settingsOf = /* @__PURE__ */ __name((settings) => defined({
|
|
@@ -17740,7 +17742,7 @@ var folderAnswer = /* @__PURE__ */ __name((folder) => {
|
|
|
17740
17742
|
excluded_chats: shown?.excluded
|
|
17741
17743
|
});
|
|
17742
17744
|
}, "folderAnswer");
|
|
17743
|
-
var lines = /* @__PURE__ */ __name((line2) => (body) => (body.items ?? (body.item === void 0 ? [] : [body.item])).map((
|
|
17745
|
+
var lines = /* @__PURE__ */ __name((line2) => (body) => (body.items ?? (body.item === void 0 ? [] : [body.item])).map((item2) => `${line2(item2).trimEnd()}
|
|
17744
17746
|
`).join(""), "lines");
|
|
17745
17747
|
var pageOf2 = /* @__PURE__ */ __name(({ limit, page, all }, { items, hasMore }) => all ? { limit: Math.max(1, items.length), has_more: false, page: 1 } : { limit, has_more: hasMore, page }, "pageOf");
|
|
17746
17748
|
var wholeList = /* @__PURE__ */ __name((command, items, extra = {}) => listOf(command, { items, limit: Math.max(1, items.length), has_more: false, ...extra }), "wholeList");
|
|
@@ -17811,7 +17813,7 @@ var sessionAnswer = /* @__PURE__ */ __name(({ current, client, device, location,
|
|
|
17811
17813
|
...createdAt === void 0 ? {} : { created_at: createdAt }
|
|
17812
17814
|
}), "sessionAnswer");
|
|
17813
17815
|
|
|
17814
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
17816
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/services/deps.js
|
|
17815
17817
|
var accountStore = /* @__PURE__ */ __name(async (deps) => (await deps.store()).forAccount(await deps.account()), "accountStore");
|
|
17816
17818
|
var crossAccount = /* @__PURE__ */ __name((deps, _reason) => deps.store(), "crossAccount");
|
|
17817
17819
|
var NO_LOCAL_STORE = "this answer comes from the messenger, not from the local store";
|
|
@@ -17824,11 +17826,11 @@ var storeAbsent = /* @__PURE__ */ __name((error) => {
|
|
|
17824
17826
|
return error instanceof Error && typeof code === "number" && (code & 255) === SQLITE_BUSY;
|
|
17825
17827
|
}, "storeAbsent");
|
|
17826
17828
|
var accountUnknown = /* @__PURE__ */ __name((error) => isCliFailure(error) && (error.code === "not_found" || error.code === "authentication_error"), "accountUnknown");
|
|
17827
|
-
var unless = /* @__PURE__ */ __name(async (work,
|
|
17829
|
+
var unless = /* @__PURE__ */ __name(async (work, expected2) => {
|
|
17828
17830
|
try {
|
|
17829
17831
|
return await work();
|
|
17830
17832
|
} catch (error) {
|
|
17831
|
-
if (
|
|
17833
|
+
if (expected2(error))
|
|
17832
17834
|
return void 0;
|
|
17833
17835
|
throw error;
|
|
17834
17836
|
}
|
|
@@ -17875,7 +17877,7 @@ var storedDeps = /* @__PURE__ */ __name((messenger, store, account, guard) => ({
|
|
|
17875
17877
|
}), "storedDeps");
|
|
17876
17878
|
var storeModeDeps = /* @__PURE__ */ __name((messenger, store, account, guard) => ({ ...storedDeps(messenger, store, account, guard), offline: false, reads: "store" }), "storeModeDeps");
|
|
17877
17879
|
|
|
17878
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
17880
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/ports/messenger.js
|
|
17879
17881
|
var throughWrapper = /* @__PURE__ */ __name((inner, handled, wrap = (_, call) => call) => new Proxy(handled, {
|
|
17880
17882
|
get: /* @__PURE__ */ __name((own, key) => {
|
|
17881
17883
|
if (key in own)
|
|
@@ -17892,12 +17894,12 @@ var capability = /* @__PURE__ */ __name((adapter, method, what) => {
|
|
|
17892
17894
|
return found.bind(adapter);
|
|
17893
17895
|
}, "capability");
|
|
17894
17896
|
|
|
17895
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
17897
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/sends/send-id.js
|
|
17896
17898
|
import { randomBytes } from "node:crypto";
|
|
17897
17899
|
var newSendId = /* @__PURE__ */ __name(() => randomBytes(8).readBigInt64BE().toString(), "newSendId");
|
|
17898
17900
|
var newOperationId = newSendId;
|
|
17899
17901
|
|
|
17900
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
17902
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/services/questions.js
|
|
17901
17903
|
var LINKS = /https?:\/\/\S+/g;
|
|
17902
17904
|
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");
|
|
17903
17905
|
var questions = /* @__PURE__ */ __name((messages, { answerers: answerers2, asker = "others" }) => {
|
|
@@ -17927,7 +17929,7 @@ var questions = /* @__PURE__ */ __name((messages, { answerers: answerers2, asker
|
|
|
17927
17929
|
});
|
|
17928
17930
|
}, "questions");
|
|
17929
17931
|
|
|
17930
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
17932
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/services/task-categories.js
|
|
17931
17933
|
var names = /* @__PURE__ */ __name((categories) => categories.map(({ name }) => name).join(", "), "names");
|
|
17932
17934
|
var taskCategoryOf = /* @__PURE__ */ __name((categories = DEFAULT_TASK_CATEGORIES, flag = "--category") => (typed) => {
|
|
17933
17935
|
const name = typed.trim().toLowerCase();
|
|
@@ -17984,7 +17986,7 @@ var categorize = /* @__PURE__ */ __name((text2, categories = DEFAULT_TASK_CATEGO
|
|
|
17984
17986
|
return best.name;
|
|
17985
17987
|
}, "categorize");
|
|
17986
17988
|
|
|
17987
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
17989
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/services/task-rules.js
|
|
17988
17990
|
var taskAccount = /* @__PURE__ */ __name(({ provider, account }) => `${provider}:${account}`, "taskAccount");
|
|
17989
17991
|
var RULES_IN = {
|
|
17990
17992
|
dialog: "all",
|
|
@@ -18190,7 +18192,7 @@ var applyTaskRulesToChats = /* @__PURE__ */ __name(async (store, account, chatId
|
|
|
18190
18192
|
return passes;
|
|
18191
18193
|
}, "applyTaskRulesToChats");
|
|
18192
18194
|
|
|
18193
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
18195
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/services/moment.js
|
|
18194
18196
|
var AGO = /^(\d+)(m|h|d)$/;
|
|
18195
18197
|
var AGO_MS = { m: 6e4, h: 36e5, d: 864e5 };
|
|
18196
18198
|
var DATE = /^\d{4}-\d{2}-\d{2}/;
|
|
@@ -18230,7 +18232,7 @@ var dateWindow = /* @__PURE__ */ __name(({ sinceTime, untilTime, zone, now = Dat
|
|
|
18230
18232
|
};
|
|
18231
18233
|
}, "dateWindow");
|
|
18232
18234
|
|
|
18233
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
18235
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/services/patience.js
|
|
18234
18236
|
import { setTimeout as sleep } from "node:timers/promises";
|
|
18235
18237
|
var LONGEST_WAIT_MS = 5 * 60 * 1e3;
|
|
18236
18238
|
var patiently = /* @__PURE__ */ __name(async (request, note, stop) => {
|
|
@@ -18253,10 +18255,10 @@ var patiently = /* @__PURE__ */ __name(async (request, note, stop) => {
|
|
|
18253
18255
|
}
|
|
18254
18256
|
}, "patiently");
|
|
18255
18257
|
|
|
18256
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
18258
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/services/archive.js
|
|
18257
18259
|
import { setTimeout as sleep2 } from "node:timers/promises";
|
|
18258
18260
|
|
|
18259
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
18261
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/services/backfill-estimate.js
|
|
18260
18262
|
var REQUEST_MS = 400;
|
|
18261
18263
|
var estimateBackfill = /* @__PURE__ */ __name(({ ranges, held, newest, page, maxPages, pauseMs }) => {
|
|
18262
18264
|
const lowest = ranges[0];
|
|
@@ -18279,13 +18281,13 @@ var estimateBackfill = /* @__PURE__ */ __name(({ ranges, held, newest, page, max
|
|
|
18279
18281
|
};
|
|
18280
18282
|
}, "estimateBackfill");
|
|
18281
18283
|
|
|
18282
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
18284
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/domain/recovery.js
|
|
18283
18285
|
var withRecovery = /* @__PURE__ */ __name((error) => ({
|
|
18284
18286
|
...error,
|
|
18285
18287
|
retryable: typeof error.retryable === "boolean" ? error.retryable : error.code === "rate_limited" || error.status === 429
|
|
18286
18288
|
}), "withRecovery");
|
|
18287
18289
|
|
|
18288
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
18290
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/services/batch.js
|
|
18289
18291
|
var actionable = /* @__PURE__ */ __name((error) => {
|
|
18290
18292
|
if (isCliFailure(error))
|
|
18291
18293
|
return withRecovery({ code: error.code, message: error.message, ...error.details });
|
|
@@ -18368,7 +18370,7 @@ var mergeBatches = /* @__PURE__ */ __name((a, b) => {
|
|
|
18368
18370
|
};
|
|
18369
18371
|
}, "mergeBatches");
|
|
18370
18372
|
|
|
18371
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
18373
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/services/message-resolution.js
|
|
18372
18374
|
var readChatId = /* @__PURE__ */ __name(async (deps, reference, store, account) => {
|
|
18373
18375
|
if (deps.reads !== "store")
|
|
18374
18376
|
return keptChatId(deps.messenger, reference, store, account);
|
|
@@ -18386,11 +18388,11 @@ var readChatId = /* @__PURE__ */ __name(async (deps, reference, store, account)
|
|
|
18386
18388
|
}, "readChatId");
|
|
18387
18389
|
var LEFT_EMPTY = "you left this chat, and the store holds none of its messages";
|
|
18388
18390
|
var storedChatId = /* @__PURE__ */ __name((messenger, reference, store, account, { includeLeft = false } = {}) => {
|
|
18389
|
-
const
|
|
18391
|
+
const renamed2 = /* @__PURE__ */ __name((id2) => store.chats.renamedChatId(account, id2), "renamed");
|
|
18390
18392
|
const profilesOn = profilesOnAccount(store, messenger.app?.command, account.provider);
|
|
18391
18393
|
const among = chatIdAmong(messenger, reference, account, {
|
|
18392
18394
|
held: /* @__PURE__ */ __name(() => store.chats.chats(account, {}), "held"),
|
|
18393
|
-
renamed,
|
|
18395
|
+
renamed: renamed2,
|
|
18394
18396
|
left: /* @__PURE__ */ __name(async (id2) => leftIn(await store.chats.chats(account, byId(id2))), "left"),
|
|
18395
18397
|
profilesOn
|
|
18396
18398
|
});
|
|
@@ -18401,17 +18403,17 @@ var storedChatId = /* @__PURE__ */ __name((messenger, reference, store, account,
|
|
|
18401
18403
|
throw error;
|
|
18402
18404
|
return chatIdAmong(messenger, reference, account, {
|
|
18403
18405
|
held: /* @__PURE__ */ __name(() => store.chats.chats(account, { includeLeft: true }), "held"),
|
|
18404
|
-
renamed,
|
|
18406
|
+
renamed: renamed2,
|
|
18405
18407
|
profilesOn
|
|
18406
18408
|
});
|
|
18407
18409
|
});
|
|
18408
18410
|
}, "storedChatId");
|
|
18409
18411
|
var keptChatId = /* @__PURE__ */ __name((messenger, reference, store, account) => storedChatId(messenger, reference, store, account, { includeLeft: true }), "keptChatId");
|
|
18410
18412
|
var chatIdIn = /* @__PURE__ */ __name((messenger, reference, store, { includeLeft = false } = {}) => {
|
|
18411
|
-
const
|
|
18413
|
+
const renamed2 = /* @__PURE__ */ __name((id2) => store.chats.renamedChatId(id2), "renamed");
|
|
18412
18414
|
const among = chatIdAmong(messenger, reference, store.account, {
|
|
18413
18415
|
held: /* @__PURE__ */ __name(() => store.chats.chats({}), "held"),
|
|
18414
|
-
renamed,
|
|
18416
|
+
renamed: renamed2,
|
|
18415
18417
|
left: /* @__PURE__ */ __name(async (id2) => leftIn(await store.chats.chats(byId(id2))), "left")
|
|
18416
18418
|
});
|
|
18417
18419
|
if (!includeLeft)
|
|
@@ -18421,7 +18423,7 @@ var chatIdIn = /* @__PURE__ */ __name((messenger, reference, store, { includeLef
|
|
|
18421
18423
|
throw error;
|
|
18422
18424
|
return chatIdAmong(messenger, reference, store.account, {
|
|
18423
18425
|
held: /* @__PURE__ */ __name(() => store.chats.chats({ includeLeft: true }), "held"),
|
|
18424
|
-
renamed
|
|
18426
|
+
renamed: renamed2
|
|
18425
18427
|
});
|
|
18426
18428
|
});
|
|
18427
18429
|
}, "chatIdIn");
|
|
@@ -18436,7 +18438,7 @@ var profilesOnAccount = /* @__PURE__ */ __name((store, app, provider) => async (
|
|
|
18436
18438
|
return void 0;
|
|
18437
18439
|
return Object.entries((await store.accounts.profiles())[app] ?? {}).filter(([, key]) => key.provider === provider && key.account === account).map(([name]) => name);
|
|
18438
18440
|
}, "profilesOnAccount");
|
|
18439
|
-
var chatIdAmong = /* @__PURE__ */ __name(async (messenger, reference, account, { held, renamed, left, profilesOn }) => {
|
|
18441
|
+
var chatIdAmong = /* @__PURE__ */ __name(async (messenger, reference, account, { held, renamed: renamed2, left, profilesOn }) => {
|
|
18440
18442
|
const trimmed = reference.trim();
|
|
18441
18443
|
if (messenger.savedChatId && ["me", "self", "saved"].includes(trimmed.toLowerCase())) {
|
|
18442
18444
|
return messenger.savedChatId(account);
|
|
@@ -18446,7 +18448,7 @@ var chatIdAmong = /* @__PURE__ */ __name(async (messenger, reference, account, {
|
|
|
18446
18448
|
await ensureAccount(named2, { account: account.account }, profilesOn);
|
|
18447
18449
|
if (named2 || /^-?\d+$/.test(trimmed)) {
|
|
18448
18450
|
const typed = named2?.chat ?? trimmed;
|
|
18449
|
-
const id2 = await
|
|
18451
|
+
const id2 = await renamed2(typed) ?? typed;
|
|
18450
18452
|
if (await left?.(id2))
|
|
18451
18453
|
throw new CliError("not_found", `you left chat ${id2}`);
|
|
18452
18454
|
return id2;
|
|
@@ -18455,7 +18457,7 @@ var chatIdAmong = /* @__PURE__ */ __name(async (messenger, reference, account, {
|
|
|
18455
18457
|
const exact = chats.find((one) => one.id === trimmed);
|
|
18456
18458
|
if (exact)
|
|
18457
18459
|
return exact.id;
|
|
18458
|
-
const moved = await
|
|
18460
|
+
const moved = await renamed2(trimmed);
|
|
18459
18461
|
if (moved !== void 0 && chats.some((one) => one.id === moved))
|
|
18460
18462
|
return moved;
|
|
18461
18463
|
if (trimmed.startsWith("@")) {
|
|
@@ -18527,7 +18529,7 @@ var senderAmong = /* @__PURE__ */ __name(async (store, accounts, reference) => {
|
|
|
18527
18529
|
}
|
|
18528
18530
|
}, "senderAmong");
|
|
18529
18531
|
|
|
18530
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
18532
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/images/context/index.js
|
|
18531
18533
|
var CONTEXT_MESSAGES = 3;
|
|
18532
18534
|
var CONTEXT_MINUTES = 10;
|
|
18533
18535
|
var MAX_CHARS = 1200;
|
|
@@ -18551,12 +18553,12 @@ var context = {
|
|
|
18551
18553
|
}, "describe")
|
|
18552
18554
|
};
|
|
18553
18555
|
|
|
18554
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
18556
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/images/registry.js
|
|
18555
18557
|
var BUILT_INS = [context];
|
|
18556
18558
|
var providers = [...BUILT_INS];
|
|
18557
18559
|
var registeredImageProviders = /* @__PURE__ */ __name(() => providers, "registeredImageProviders");
|
|
18558
18560
|
|
|
18559
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
18561
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/services/conversations.js
|
|
18560
18562
|
var READ_PAGE = 5e3;
|
|
18561
18563
|
var CHAIN = 50;
|
|
18562
18564
|
var CONVERSATION_QUERY = {
|
|
@@ -18708,7 +18710,7 @@ var sized = /* @__PURE__ */ __name((size2) => {
|
|
|
18708
18710
|
return size2;
|
|
18709
18711
|
}, "sized");
|
|
18710
18712
|
|
|
18711
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
18713
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/services/embeddings-maintenance.js
|
|
18712
18714
|
var REFRESH_BOUNDS = { maxChats: 20, maxChunks: 2e3 };
|
|
18713
18715
|
var MESSAGE_PAGE = 5e3;
|
|
18714
18716
|
var PER_SESSION = 8;
|
|
@@ -18727,7 +18729,7 @@ var embeddingTarget = /* @__PURE__ */ __name((deps, choice = DEFAULT_TEXT_MODEL)
|
|
|
18727
18729
|
price: remote.price,
|
|
18728
18730
|
installed: true,
|
|
18729
18731
|
perBatch: PER_REQUEST * concurrency,
|
|
18730
|
-
open: /* @__PURE__ */ __name(async () => (await import("./remote-
|
|
18732
|
+
open: /* @__PURE__ */ __name(async () => (await import("./remote-N6VAWJWE.js")).openRemote(remote, apiKey, { concurrency }), "open")
|
|
18731
18733
|
};
|
|
18732
18734
|
}
|
|
18733
18735
|
const model = textModel(choice);
|
|
@@ -18744,7 +18746,7 @@ var embeddingTarget = /* @__PURE__ */ __name((deps, choice = DEFAULT_TEXT_MODEL)
|
|
|
18744
18746
|
if (!isTextModelInstalled(model, directory2))
|
|
18745
18747
|
throw notDownloaded(model.id);
|
|
18746
18748
|
if (apart) {
|
|
18747
|
-
const { openProcess } = await import("./process-
|
|
18749
|
+
const { openProcess } = await import("./process-SWPJGPQC.js");
|
|
18748
18750
|
return openProcess(model, directory2, { threads: threads ?? defaultThreads() });
|
|
18749
18751
|
}
|
|
18750
18752
|
return openEmbedder(model, directory2, { threads: threads ?? defaultThreads() });
|
|
@@ -19033,7 +19035,7 @@ var shaped = /* @__PURE__ */ __name(({ chatId, builtAt, algorithmVersion, pendin
|
|
|
19033
19035
|
return { ...one, state };
|
|
19034
19036
|
}, "shaped");
|
|
19035
19037
|
|
|
19036
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
19038
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/services/search-catchup.js
|
|
19037
19039
|
var CATCH_UP_BOUNDS = { maxChunks: 500, maxMessages: 1e4, timeMs: 3e4 };
|
|
19038
19040
|
var validateCatchUpBounds = /* @__PURE__ */ __name((options) => {
|
|
19039
19041
|
for (const [key, value, maximum] of [
|
|
@@ -19086,7 +19088,7 @@ var catchUpSearch = /* @__PURE__ */ __name(async (deps, chat, options, signal, c
|
|
|
19086
19088
|
}
|
|
19087
19089
|
}, "catchUpSearch");
|
|
19088
19090
|
|
|
19089
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
19091
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/services/archive.js
|
|
19090
19092
|
var pushed = /* @__PURE__ */ __name((deps, what) => {
|
|
19091
19093
|
if (deps.reads === "store") {
|
|
19092
19094
|
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`);
|
|
@@ -19452,7 +19454,7 @@ var timeOfKey = /* @__PURE__ */ __name(async (store, account, chatId, key, byTim
|
|
|
19452
19454
|
return message?.timestamp ?? fallback;
|
|
19453
19455
|
}, "timeOfKey");
|
|
19454
19456
|
|
|
19455
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
19457
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/sends/upload.js
|
|
19456
19458
|
import { openAsBlob, realpathSync } from "node:fs";
|
|
19457
19459
|
import { open, stat } from "node:fs/promises";
|
|
19458
19460
|
import { basename, dirname, extname, isAbsolute, relative, resolve, sep } from "node:path";
|
|
@@ -19654,7 +19656,7 @@ var readStickerFile = /* @__PURE__ */ __name(async (path, maxBytes, read) => {
|
|
|
19654
19656
|
return { name, source };
|
|
19655
19657
|
}, "readStickerFile");
|
|
19656
19658
|
|
|
19657
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
19659
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/botcheck/check.js
|
|
19658
19660
|
var DAY_MS = 864e5;
|
|
19659
19661
|
var NEW_DAYS = 30;
|
|
19660
19662
|
var SAME_TEXT_MIN = 20;
|
|
@@ -19731,7 +19733,7 @@ var scorePerson = /* @__PURE__ */ __name(({ subject, provider, activity, photos,
|
|
|
19731
19733
|
};
|
|
19732
19734
|
}, "scorePerson");
|
|
19733
19735
|
|
|
19734
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
19736
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/botcheck/registries.js
|
|
19735
19737
|
var REGISTRIES = {
|
|
19736
19738
|
cas: { title: "Combot Anti-Spam (CAS)", docs: "https://cas.chat/api" },
|
|
19737
19739
|
lols: { title: "lols.bot", docs: "https://api.lols.bot/lols-bot.json" }
|
|
@@ -19816,7 +19818,7 @@ var notCovered = /* @__PURE__ */ __name((messenger, now = /* @__PURE__ */ new Da
|
|
|
19816
19818
|
detail: `lists Telegram accounts only, not ${messenger} ones`
|
|
19817
19819
|
})), "notCovered");
|
|
19818
19820
|
|
|
19819
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
19821
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/botcheck/service.js
|
|
19820
19822
|
var ACTIVITY_MESSAGES = 1e3;
|
|
19821
19823
|
var botCheckService = /* @__PURE__ */ __name((deps) => {
|
|
19822
19824
|
const subjectOf = /* @__PURE__ */ __name(async (reference) => {
|
|
@@ -19904,7 +19906,7 @@ var botCheckService = /* @__PURE__ */ __name((deps) => {
|
|
|
19904
19906
|
};
|
|
19905
19907
|
}, "botCheckService");
|
|
19906
19908
|
|
|
19907
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
19909
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/domain/thread.js
|
|
19908
19910
|
var threadIdOf = /* @__PURE__ */ __name((value) => {
|
|
19909
19911
|
if (value === void 0)
|
|
19910
19912
|
return void 0;
|
|
@@ -19914,7 +19916,7 @@ var threadIdOf = /* @__PURE__ */ __name((value) => {
|
|
|
19914
19916
|
return id2;
|
|
19915
19917
|
}, "threadIdOf");
|
|
19916
19918
|
|
|
19917
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
19919
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/services/chat-stats.js
|
|
19918
19920
|
var TOP_POSTS = 5;
|
|
19919
19921
|
var JOINS = /* @__PURE__ */ new Set(["join", "add"]);
|
|
19920
19922
|
var LEAVES = /* @__PURE__ */ new Set(["leave", "remove"]);
|
|
@@ -20031,7 +20033,7 @@ var median = /* @__PURE__ */ __name((values) => {
|
|
|
20031
20033
|
return Math.round(sorted.length % 2 === 0 ? ((sorted[middle - 1] ?? upper) + upper) / 2 : upper);
|
|
20032
20034
|
}, "median");
|
|
20033
20035
|
|
|
20034
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
20036
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/services/member-history.js
|
|
20035
20037
|
var memberEvents = /* @__PURE__ */ __name((stays, revisions, since = 0) => {
|
|
20036
20038
|
const events = [];
|
|
20037
20039
|
for (const stay of stays) {
|
|
@@ -20063,7 +20065,7 @@ var memberEvents = /* @__PURE__ */ __name((stays, revisions, since = 0) => {
|
|
|
20063
20065
|
return events.filter(({ at }) => Date.parse(at) >= since).sort((a, b) => Date.parse(a.at) - Date.parse(b.at) || a.id.localeCompare(b.id));
|
|
20064
20066
|
}, "memberEvents");
|
|
20065
20067
|
|
|
20066
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
20068
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/services/chats.js
|
|
20067
20069
|
var EVENTS_DAYS = 7;
|
|
20068
20070
|
var TRACKED_DAYS = 30;
|
|
20069
20071
|
var STATS_PAGE = 1e3;
|
|
@@ -20081,18 +20083,18 @@ var storedEvents = /* @__PURE__ */ __name(async (store, deps, chat, since) => {
|
|
|
20081
20083
|
var deepChecks = /* @__PURE__ */ __name(async (deps, items, deep, pauseMs, registry) => {
|
|
20082
20084
|
const checks = botCheckService(deps);
|
|
20083
20085
|
const checked2 = [];
|
|
20084
|
-
for (const [index,
|
|
20086
|
+
for (const [index, item2] of items.entries()) {
|
|
20085
20087
|
if (index >= deep) {
|
|
20086
|
-
checked2.push(
|
|
20088
|
+
checked2.push(item2);
|
|
20087
20089
|
continue;
|
|
20088
20090
|
}
|
|
20089
20091
|
if (index > 0)
|
|
20090
20092
|
await new Promise((resolve7) => setTimeout(resolve7, pauseMs));
|
|
20091
|
-
const { score, reasons, registries, unknown: unknown2 } = await checks.person(
|
|
20093
|
+
const { score, reasons, registries, unknown: unknown2 } = await checks.person(item2.id, {
|
|
20092
20094
|
registries: true,
|
|
20093
20095
|
...registry ? { registry } : {}
|
|
20094
20096
|
});
|
|
20095
|
-
checked2.push({ ...
|
|
20097
|
+
checked2.push({ ...item2, check: { score, reasons, registries, unknown: unknown2 } });
|
|
20096
20098
|
}
|
|
20097
20099
|
return checked2;
|
|
20098
20100
|
}, "deepChecks");
|
|
@@ -20358,7 +20360,7 @@ var storedMembers = /* @__PURE__ */ __name(async (store, chatId) => {
|
|
|
20358
20360
|
return members.length === 0 ? null : members;
|
|
20359
20361
|
}, "storedMembers");
|
|
20360
20362
|
|
|
20361
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
20363
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/services/inbox.js
|
|
20362
20364
|
var INBOX_CHATS = 20;
|
|
20363
20365
|
var REVIEW_DAYS = 3;
|
|
20364
20366
|
var UNANSWERED_HOURS = 24;
|
|
@@ -20566,7 +20568,7 @@ var inboxService = /* @__PURE__ */ __name((deps) => {
|
|
|
20566
20568
|
};
|
|
20567
20569
|
}, "inboxService");
|
|
20568
20570
|
|
|
20569
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
20571
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/services/person-context.js
|
|
20570
20572
|
var CONTEXT_MESSAGES2 = 10;
|
|
20571
20573
|
var CONTEXT_BYTES = 64 * 1024;
|
|
20572
20574
|
var toContext = /* @__PURE__ */ __name((key, message, chatTitle2) => ({
|
|
@@ -20751,8 +20753,8 @@ var recordContext = /* @__PURE__ */ __name(async (store, record2, reads, { messa
|
|
|
20751
20753
|
var withinBytes = /* @__PURE__ */ __name((lists, bytes2) => {
|
|
20752
20754
|
let used = 0;
|
|
20753
20755
|
let cut = false;
|
|
20754
|
-
const keep2 = /* @__PURE__ */ __name((items) => items.filter((
|
|
20755
|
-
const size2 = Buffer.byteLength(JSON.stringify(
|
|
20756
|
+
const keep2 = /* @__PURE__ */ __name((items) => items.filter((item2) => {
|
|
20757
|
+
const size2 = Buffer.byteLength(JSON.stringify(item2), "utf8");
|
|
20756
20758
|
if (cut || used + size2 > bytes2) {
|
|
20757
20759
|
cut = true;
|
|
20758
20760
|
return false;
|
|
@@ -20827,10 +20829,10 @@ var personMessages = /* @__PURE__ */ __name(async (store, asked, reference, { ch
|
|
|
20827
20829
|
};
|
|
20828
20830
|
}, "personMessages");
|
|
20829
20831
|
|
|
20830
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
20832
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/services/meeting-evidence.js
|
|
20831
20833
|
import { createHash } from "node:crypto";
|
|
20832
20834
|
|
|
20833
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
20835
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/services/meeting-reference.js
|
|
20834
20836
|
var missing2 = /* @__PURE__ */ __name(() => new CliError("not_found", "the meeting evidence is unavailable for this account"), "missing");
|
|
20835
20837
|
var authorizedMeetingMetadata = /* @__PURE__ */ __name(async (store, accountId, reference, options = {}) => {
|
|
20836
20838
|
const parsed = parseMeetingReference(reference);
|
|
@@ -20848,7 +20850,7 @@ var authorizedMeetingMetadata = /* @__PURE__ */ __name(async (store, accountId,
|
|
|
20848
20850
|
return { parsed, meeting };
|
|
20849
20851
|
}, "authorizedMeetingMetadata");
|
|
20850
20852
|
|
|
20851
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
20853
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/services/meeting-evidence.js
|
|
20852
20854
|
var hash = /* @__PURE__ */ __name((value) => createHash("sha256").update(JSON.stringify(value)).digest("hex"), "hash");
|
|
20853
20855
|
var checkMeetingCancelled = /* @__PURE__ */ __name((signal) => {
|
|
20854
20856
|
if (signal?.aborted)
|
|
@@ -20994,16 +20996,16 @@ var readMeetingEvidence = /* @__PURE__ */ __name(async (store, accountId, refere
|
|
|
20994
20996
|
hasMore = true;
|
|
20995
20997
|
break;
|
|
20996
20998
|
}
|
|
20997
|
-
const
|
|
20998
|
-
const bytes2 = Buffer.byteLength(JSON.stringify(
|
|
20999
|
+
const item2 = cueEvidence(accountId, meeting.id, page.transcript, row);
|
|
21000
|
+
const bytes2 = Buffer.byteLength(JSON.stringify(item2), "utf8") + (items.length ? 1 : 0);
|
|
20999
21001
|
if (contentBytes + bytes2 > limits.bytes) {
|
|
21000
21002
|
truncatedBy = "bytes";
|
|
21001
21003
|
hasMore = true;
|
|
21002
21004
|
break;
|
|
21003
21005
|
}
|
|
21004
|
-
items.push(
|
|
21006
|
+
items.push(item2);
|
|
21005
21007
|
contentBytes += bytes2;
|
|
21006
|
-
nextReference =
|
|
21008
|
+
nextReference = item2.reference;
|
|
21007
21009
|
afterPosition = row.position;
|
|
21008
21010
|
}
|
|
21009
21011
|
if (truncatedBy !== null || parsed.cuePosition !== void 0 || !page.hasMore)
|
|
@@ -21047,7 +21049,7 @@ var readMeetingEvidence = /* @__PURE__ */ __name(async (store, accountId, refere
|
|
|
21047
21049
|
return { ...packet, fingerprint: hash(packet) };
|
|
21048
21050
|
}, "readMeetingEvidence");
|
|
21049
21051
|
|
|
21050
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
21052
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/services/person-meeting-context.js
|
|
21051
21053
|
var personMeetingContext = /* @__PURE__ */ __name(async (store, personReference, options) => {
|
|
21052
21054
|
const { meetings = 10, cues = 5, bytes: bytes2 = 64 * 1024, scanLimit = 1e3, since, signal } = options;
|
|
21053
21055
|
const requestedAccounts = options.accountIds;
|
|
@@ -21111,7 +21113,7 @@ var personMeetingContext = /* @__PURE__ */ __name(async (store, personReference,
|
|
|
21111
21113
|
}
|
|
21112
21114
|
throw error;
|
|
21113
21115
|
}
|
|
21114
|
-
const
|
|
21116
|
+
const item2 = {
|
|
21115
21117
|
reference,
|
|
21116
21118
|
cues: evidence.items,
|
|
21117
21119
|
cueCoverage: {
|
|
@@ -21120,12 +21122,12 @@ var personMeetingContext = /* @__PURE__ */ __name(async (store, personReference,
|
|
|
21120
21122
|
hasMore: evidence.coverage.hasMore
|
|
21121
21123
|
}
|
|
21122
21124
|
};
|
|
21123
|
-
const itemBytes = Buffer.byteLength(JSON.stringify(
|
|
21125
|
+
const itemBytes = Buffer.byteLength(JSON.stringify(item2), "utf8") + (items.length ? 1 : 0);
|
|
21124
21126
|
if (contentBytes + itemBytes > bytes2) {
|
|
21125
21127
|
truncatedBy = "bytes";
|
|
21126
21128
|
break;
|
|
21127
21129
|
}
|
|
21128
|
-
items.push(
|
|
21130
|
+
items.push(item2);
|
|
21129
21131
|
contentBytes += itemBytes;
|
|
21130
21132
|
}
|
|
21131
21133
|
checkMeetingCancelled(signal);
|
|
@@ -21146,7 +21148,7 @@ var personMeetingContext = /* @__PURE__ */ __name(async (store, personReference,
|
|
|
21146
21148
|
};
|
|
21147
21149
|
}, "personMeetingContext");
|
|
21148
21150
|
|
|
21149
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
21151
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/services/person-preparation.js
|
|
21150
21152
|
var PREPARE_BYTES = 96 * 1024;
|
|
21151
21153
|
var MEETINGS = 5;
|
|
21152
21154
|
var CUES = 3;
|
|
@@ -21159,14 +21161,14 @@ var personPreparation = /* @__PURE__ */ __name(async (store, asked, reference, o
|
|
|
21159
21161
|
const budgeted = /* @__PURE__ */ __name((page) => {
|
|
21160
21162
|
const items = [];
|
|
21161
21163
|
let cut = false;
|
|
21162
|
-
for (const
|
|
21163
|
-
const bytes2 = size(
|
|
21164
|
+
for (const item2 of page.items.slice(0, limit)) {
|
|
21165
|
+
const bytes2 = size(item2);
|
|
21164
21166
|
if (cut || bytes2 > left) {
|
|
21165
21167
|
cut = true;
|
|
21166
21168
|
continue;
|
|
21167
21169
|
}
|
|
21168
21170
|
left -= bytes2;
|
|
21169
|
-
items.push(
|
|
21171
|
+
items.push(item2);
|
|
21170
21172
|
}
|
|
21171
21173
|
const over = page.hasMore || page.items.length > limit;
|
|
21172
21174
|
return {
|
|
@@ -21249,7 +21251,7 @@ var meetingsOf = /* @__PURE__ */ __name(async (store, uid, stored, since, left)
|
|
|
21249
21251
|
bytes: Math.min(left(), 4 * 1024 * 1024),
|
|
21250
21252
|
...since === void 0 ? {} : { since }
|
|
21251
21253
|
});
|
|
21252
|
-
const read = new Set(found.items.map((
|
|
21254
|
+
const read = new Set(found.items.map((item2) => parseMeetingReference(item2.reference).accountId));
|
|
21253
21255
|
return {
|
|
21254
21256
|
items: found.items,
|
|
21255
21257
|
hasMore: found.coverage.truncatedBy !== null || found.coverage.scanLimitReached,
|
|
@@ -21263,7 +21265,7 @@ var meetingsOf = /* @__PURE__ */ __name(async (store, uid, stored, since, left)
|
|
|
21263
21265
|
}
|
|
21264
21266
|
}, "meetingsOf");
|
|
21265
21267
|
|
|
21266
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
21268
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/services/person-profile.js
|
|
21267
21269
|
var personProfile = /* @__PURE__ */ __name(async (deps, person, known2) => {
|
|
21268
21270
|
const online = deps.offline ? void 0 : await deps.connection();
|
|
21269
21271
|
const held = await storeIfOpen(deps);
|
|
@@ -21333,7 +21335,7 @@ var quiet = /* @__PURE__ */ __name((facts) => facts.chats.map(({ id: id2, title,
|
|
|
21333
21335
|
complete: false
|
|
21334
21336
|
})), "quiet");
|
|
21335
21337
|
|
|
21336
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
21338
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/services/person-timeline.js
|
|
21337
21339
|
var TIMELINE_ITEMS = 50;
|
|
21338
21340
|
var TIMELINE_MAX = 500;
|
|
21339
21341
|
var SCOPES = ["personal", "work"];
|
|
@@ -21388,7 +21390,7 @@ var personTimeline = /* @__PURE__ */ __name(async (store, asked, reference, { sc
|
|
|
21388
21390
|
};
|
|
21389
21391
|
}, "personTimeline");
|
|
21390
21392
|
|
|
21391
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
21393
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/services/people.js
|
|
21392
21394
|
var peopleService = /* @__PURE__ */ __name((deps) => {
|
|
21393
21395
|
const localCard = /* @__PURE__ */ __name(async (card, includeNotes = false) => {
|
|
21394
21396
|
const held = await storeIfOpen(deps);
|
|
@@ -21615,7 +21617,110 @@ var withoutPhone = /* @__PURE__ */ __name((answer) => {
|
|
|
21615
21617
|
return rest;
|
|
21616
21618
|
}, "withoutPhone");
|
|
21617
21619
|
|
|
21618
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
21620
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/services/task-stats.js
|
|
21621
|
+
var TASK_STATS_BY = ["chat", "meeting", "project"];
|
|
21622
|
+
var PERIOD_FIELD = "created";
|
|
21623
|
+
var refuseNestedPeriod = /* @__PURE__ */ __name((node, top = true) => {
|
|
21624
|
+
if (node.kind === "predicate")
|
|
21625
|
+
return;
|
|
21626
|
+
const optional2 = node.clauses.some(({ occur }) => occur === "should");
|
|
21627
|
+
for (const { occur, node: inner } of node.clauses) {
|
|
21628
|
+
if (!walkQuery(inner).some(({ field }) => field === PERIOD_FIELD))
|
|
21629
|
+
continue;
|
|
21630
|
+
if (!top || optional2 || occur !== "must")
|
|
21631
|
+
throw new CliError("validation_error", `${PERIOD_FIELD}: sets the period of stats tasks show: give it as a required term, not inside OR or NOT`);
|
|
21632
|
+
refuseNestedPeriod(inner, top);
|
|
21633
|
+
}
|
|
21634
|
+
}, "refuseNestedPeriod");
|
|
21635
|
+
var renamed = /* @__PURE__ */ __name((node, from, to) => node.kind === "predicate" ? node.field === from ? { ...node, field: to } : node : { ...node, clauses: node.clauses.map((clause) => ({ ...clause, node: renamed(clause.node, from, to) })) }, "renamed");
|
|
21636
|
+
var median2 = /* @__PURE__ */ __name((values) => {
|
|
21637
|
+
const sorted = [...values].sort((a, b) => a - b);
|
|
21638
|
+
const middle = Math.floor(sorted.length / 2);
|
|
21639
|
+
const upper = sorted[middle] ?? 0;
|
|
21640
|
+
return sorted.length % 2 === 1 ? upper : ((sorted[middle - 1] ?? 0) + upper) / 2;
|
|
21641
|
+
}, "median");
|
|
21642
|
+
var mean = /* @__PURE__ */ __name((values) => Math.round(values.reduce((sum2, one) => sum2 + one, 0) / values.length), "mean");
|
|
21643
|
+
var spread = /* @__PURE__ */ __name((open7, closeMs, now) => ({
|
|
21644
|
+
...closeMs.length > 0 ? { medianCloseMs: median2(closeMs) } : {},
|
|
21645
|
+
...open7.length > 0 ? { meanOpenAgeMs: mean(open7.map(({ createdAt }) => now - createdAt)) } : {}
|
|
21646
|
+
}), "spread");
|
|
21647
|
+
var and = /* @__PURE__ */ __name((parts) => parts.length === 0 ? void 0 : { sql: parts.map(({ sql }) => `(${sql})`).join(" AND "), params: parts.flatMap(({ params }) => params) }, "and");
|
|
21648
|
+
var taskStatsOf = /* @__PURE__ */ __name(async (store, account, { by = "chat", query, timezone, group, kind }, columns, now = Date.now()) => {
|
|
21649
|
+
if (query)
|
|
21650
|
+
refuseNestedPeriod(query.root);
|
|
21651
|
+
const time = /* @__PURE__ */ __name((sql) => ({ type: "time", sql }), "time");
|
|
21652
|
+
const read = { ...columns, [PERIOD_FIELD]: time("t.created_at"), closed: time("t.closed_at") };
|
|
21653
|
+
const fixed = [
|
|
21654
|
+
...group === void 0 ? [] : [{ sql: "t.source_group = ?", params: [group] }],
|
|
21655
|
+
...kind === void 0 ? [] : [{ sql: "t.type = ?", params: [kind] }],
|
|
21656
|
+
...by === "meeting" ? [{ sql: "t.source_kind = 'meeting'", params: [] }] : []
|
|
21657
|
+
];
|
|
21658
|
+
const options = { command: "stats tasks show", now, ...timezone === void 0 ? {} : { zone: timezone } };
|
|
21659
|
+
const where = /* @__PURE__ */ __name((ast, more = []) => and([...fixed, ...more, ...ast ? [queryFilter(ast, read, options)] : []]), "where");
|
|
21660
|
+
const scope = by === "project" ? { board: true } : { account: taskAccount(account) };
|
|
21661
|
+
const all = await store.tasks.statRows(scope, where(withoutField(query, PERIOD_FIELD)));
|
|
21662
|
+
const created = await store.tasks.statRows(scope, where(query));
|
|
21663
|
+
const closed = await store.tasks.statRows(scope, where(query && { ...query, root: renamed(query.root, PERIOD_FIELD, "closed") }, [
|
|
21664
|
+
{ sql: "t.closed_at IS NOT NULL", params: [] }
|
|
21665
|
+
]));
|
|
21666
|
+
const keyOf5 = /* @__PURE__ */ __name((row) => by === "project" ? String(row.projectId) : row.group ?? "", "keyOf");
|
|
21667
|
+
const groups = /* @__PURE__ */ new Map();
|
|
21668
|
+
const slot = /* @__PURE__ */ __name((row) => {
|
|
21669
|
+
const key = keyOf5(row);
|
|
21670
|
+
const found = groups.get(key) ?? { open: [], created: 0, closeMs: [] };
|
|
21671
|
+
groups.set(key, found);
|
|
21672
|
+
return found;
|
|
21673
|
+
}, "slot");
|
|
21674
|
+
for (const row of all)
|
|
21675
|
+
if (!isClosedState(row.state))
|
|
21676
|
+
slot(row).open.push(row);
|
|
21677
|
+
for (const row of created)
|
|
21678
|
+
slot(row).created++;
|
|
21679
|
+
for (const row of closed)
|
|
21680
|
+
slot(row).closeMs.push((row.closedAt ?? row.createdAt) - row.createdAt);
|
|
21681
|
+
const kept2 = [...groups].filter(([, one]) => one.open.length + one.created + one.closeMs.length > 0);
|
|
21682
|
+
const ids = kept2.map(([key]) => key);
|
|
21683
|
+
const names2 = by === "chat" ? await store.tasks.statNames("chat", ids, taskAccount(account)) : by === "project" ? await store.tasks.statNames("project", ids) : await meetingNames(store, ids);
|
|
21684
|
+
const rows = kept2.map(([key, one]) => ({
|
|
21685
|
+
group: key,
|
|
21686
|
+
name: names2.get(key) ?? null,
|
|
21687
|
+
open: one.open.length,
|
|
21688
|
+
created: one.created,
|
|
21689
|
+
closed: one.closeMs.length,
|
|
21690
|
+
...one.open[0] ? { oldestOpenAt: new Date(one.open[0].createdAt) } : {},
|
|
21691
|
+
...spread(one.open, one.closeMs, now)
|
|
21692
|
+
}));
|
|
21693
|
+
const open7 = kept2.flatMap(([, one]) => one.open);
|
|
21694
|
+
const closeMs = kept2.flatMap(([, one]) => one.closeMs);
|
|
21695
|
+
return {
|
|
21696
|
+
by,
|
|
21697
|
+
open: open7.length,
|
|
21698
|
+
created: created.length,
|
|
21699
|
+
closed: closeMs.length,
|
|
21700
|
+
...spread(open7, closeMs, now),
|
|
21701
|
+
rows
|
|
21702
|
+
};
|
|
21703
|
+
}, "taskStatsOf");
|
|
21704
|
+
var meetingIdOf = /* @__PURE__ */ __name((group) => {
|
|
21705
|
+
try {
|
|
21706
|
+
return String(parseMeetingReference(group).meetingId);
|
|
21707
|
+
} catch {
|
|
21708
|
+
return void 0;
|
|
21709
|
+
}
|
|
21710
|
+
}, "meetingIdOf");
|
|
21711
|
+
var meetingNames = /* @__PURE__ */ __name(async (store, groups) => {
|
|
21712
|
+
const meetingOf = new Map(groups.flatMap((group) => {
|
|
21713
|
+
const id2 = meetingIdOf(group);
|
|
21714
|
+
return id2 === void 0 ? [] : [[group, id2]];
|
|
21715
|
+
}));
|
|
21716
|
+
const titles = await store.tasks.statNames("meeting", [...new Set(meetingOf.values())]);
|
|
21717
|
+
return new Map([...meetingOf].flatMap(([group, id2]) => {
|
|
21718
|
+
const title = titles.get(id2);
|
|
21719
|
+
return title === void 0 ? [] : [[group, title]];
|
|
21720
|
+
}));
|
|
21721
|
+
}, "meetingNames");
|
|
21722
|
+
|
|
21723
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/services/task-tag-filters.js
|
|
21619
21724
|
var taskTagFilters = /* @__PURE__ */ __name(async (store, query) => {
|
|
21620
21725
|
const tags = /* @__PURE__ */ new Map();
|
|
21621
21726
|
for (const node of query ? walkQuery(query.root) : [])
|
|
@@ -21624,7 +21729,7 @@ var taskTagFilters = /* @__PURE__ */ __name(async (store, query) => {
|
|
|
21624
21729
|
return tags;
|
|
21625
21730
|
}, "taskTagFilters");
|
|
21626
21731
|
|
|
21627
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
21732
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/services/tasks.js
|
|
21628
21733
|
var TASK_QUERY = {
|
|
21629
21734
|
entity: "task",
|
|
21630
21735
|
backend: "sql",
|
|
@@ -21655,6 +21760,20 @@ var TASK_QUERY = {
|
|
|
21655
21760
|
}
|
|
21656
21761
|
})
|
|
21657
21762
|
};
|
|
21763
|
+
var TASK_STATS_QUERY = {
|
|
21764
|
+
entity: "task",
|
|
21765
|
+
backend: "sql",
|
|
21766
|
+
fields: [
|
|
21767
|
+
...TASK_QUERY.fields.filter(({ name }) => name !== "created_at" && name !== "closed_at"),
|
|
21768
|
+
{
|
|
21769
|
+
name: PERIOD_FIELD,
|
|
21770
|
+
type: "time",
|
|
21771
|
+
operators: OPERATORS_BY_TYPE.time,
|
|
21772
|
+
example: `${PERIOD_FIELD}>=30d`,
|
|
21773
|
+
relation: "the period: created counts the tasks opened in it, closed the tasks done or dismissed in it; open is open now"
|
|
21774
|
+
}
|
|
21775
|
+
]
|
|
21776
|
+
};
|
|
21658
21777
|
var PAIR_DECISIONS = ["review", "unsure"];
|
|
21659
21778
|
var TASK_PAIR_QUERY = {
|
|
21660
21779
|
entity: "task_pair",
|
|
@@ -21741,6 +21860,13 @@ var tasksService = /* @__PURE__ */ __name((deps, categories) => {
|
|
|
21741
21860
|
const inStore = /* @__PURE__ */ __name(async (work) => work(await deps.store(), await deps.account()), "inStore");
|
|
21742
21861
|
const service = /* @__PURE__ */ __name((store) => createTaskService({ store: store.tasks }), "service");
|
|
21743
21862
|
const groupOf = /* @__PURE__ */ __name(async (store, account, chat) => chat === void 0 ? void 0 : storedChatId(deps.messenger, chat, store, account, { includeLeft: true }), "groupOf");
|
|
21863
|
+
const queryColumns = /* @__PURE__ */ __name(async (store, account, query) => {
|
|
21864
|
+
const groups = /* @__PURE__ */ new Map();
|
|
21865
|
+
for (const node of query ? walkQuery(query.root) : [])
|
|
21866
|
+
if (node.field === "chat" && node.operator !== "wildcard" && !groups.has(node.value))
|
|
21867
|
+
groups.set(node.value, await storedChatId(deps.messenger, node.value, store, account, { includeLeft: true }));
|
|
21868
|
+
return taskColumns(groups, await taskTagFilters(store, query));
|
|
21869
|
+
}, "queryColumns");
|
|
21744
21870
|
const refuseBare = /* @__PURE__ */ __name((target2) => {
|
|
21745
21871
|
throw new CliError("validation_error", `no task ${singleLine(target2)} \u2014 write task:${singleLine(target2)} for a task`);
|
|
21746
21872
|
}, "refuseBare");
|
|
@@ -21795,12 +21921,7 @@ var tasksService = /* @__PURE__ */ __name((deps, categories) => {
|
|
|
21795
21921
|
const reviewAfterLink = /* @__PURE__ */ __name(async (store, id2) => !isClosedState((await store.tasks.get(id2))?.state ?? "done") ? store.tasks.reviewDuplicates(id2, { linked: true }) : 0, "reviewAfterLink");
|
|
21796
21922
|
return {
|
|
21797
21923
|
list: /* @__PURE__ */ __name(({ query, limit, offset, previews }) => inStore(async (store, account) => {
|
|
21798
|
-
const
|
|
21799
|
-
for (const node of query ? walkQuery(query.root) : [])
|
|
21800
|
-
if (node.field === "chat" && node.operator !== "wildcard" && !groups.has(node.value))
|
|
21801
|
-
groups.set(node.value, await storedChatId(deps.messenger, node.value, store, account, { includeLeft: true }));
|
|
21802
|
-
const tags = await taskTagFilters(store, query);
|
|
21803
|
-
const where = query ? queryFilter(query, taskColumns(groups, tags), { command: "tasks list" }) : void 0;
|
|
21924
|
+
const where = query ? queryFilter(query, await queryColumns(store, account, query), { command: "tasks list" }) : void 0;
|
|
21804
21925
|
const rows = await store.tasks.query(taskAccount(account), where, { limit: limit + 1, offset });
|
|
21805
21926
|
const shown = rows.slice(0, limit);
|
|
21806
21927
|
return {
|
|
@@ -22047,13 +22168,9 @@ var tasksService = /* @__PURE__ */ __name((deps, categories) => {
|
|
|
22047
22168
|
await owned(store, account, subject);
|
|
22048
22169
|
return store.tasks.similar({ task: subject }, options);
|
|
22049
22170
|
}), "similar"),
|
|
22050
|
-
stats: /* @__PURE__ */ __name((
|
|
22051
|
-
const group = await groupOf(store, account,
|
|
22052
|
-
|
|
22053
|
-
account: taskAccount(account),
|
|
22054
|
-
...filter.type === void 0 ? {} : { kind: filter.type }
|
|
22055
|
-
});
|
|
22056
|
-
return group === void 0 ? rows : rows.filter((one) => one.group === group);
|
|
22171
|
+
stats: /* @__PURE__ */ __name(({ chat, ...request } = {}) => inStore(async (store, account) => {
|
|
22172
|
+
const group = await groupOf(store, account, chat);
|
|
22173
|
+
return taskStatsOf(store, account, { ...request, ...group === void 0 ? {} : { group } }, await queryColumns(store, account, request.query));
|
|
22057
22174
|
}), "stats")
|
|
22058
22175
|
};
|
|
22059
22176
|
}, "tasksService");
|
|
@@ -22104,7 +22221,7 @@ var taskView = /* @__PURE__ */ __name(async (store, account, task2) => {
|
|
|
22104
22221
|
};
|
|
22105
22222
|
}, "taskView");
|
|
22106
22223
|
|
|
22107
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
22224
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/mail/owed.js
|
|
22108
22225
|
var mailTurn = /* @__PURE__ */ __name((newest) => {
|
|
22109
22226
|
if (newest === null)
|
|
22110
22227
|
return null;
|
|
@@ -22113,7 +22230,7 @@ var mailTurn = /* @__PURE__ */ __name((newest) => {
|
|
|
22113
22230
|
return newest.addressed ? "owed" : null;
|
|
22114
22231
|
}, "mailTurn");
|
|
22115
22232
|
|
|
22116
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
22233
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/services/agenda-mail.js
|
|
22117
22234
|
var absent = /* @__PURE__ */ __name((error) => {
|
|
22118
22235
|
if (error instanceof CliError && error.code === "not_found")
|
|
22119
22236
|
return void 0;
|
|
@@ -22171,7 +22288,7 @@ var mailActivity = /* @__PURE__ */ __name(async (store, account, since, chats) =
|
|
|
22171
22288
|
};
|
|
22172
22289
|
}, "mailActivity");
|
|
22173
22290
|
|
|
22174
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
22291
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/services/chat-coverage.js
|
|
22175
22292
|
var chatCoverage = /* @__PURE__ */ __name(async (store, account, chatIds) => {
|
|
22176
22293
|
const ids = [...new Set(chatIds)];
|
|
22177
22294
|
if (ids.length === 0)
|
|
@@ -22197,7 +22314,7 @@ var chatCoverage = /* @__PURE__ */ __name(async (store, account, chatIds) => {
|
|
|
22197
22314
|
}));
|
|
22198
22315
|
}, "chatCoverage");
|
|
22199
22316
|
|
|
22200
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
22317
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/services/agenda.js
|
|
22201
22318
|
var DAY = 864e5;
|
|
22202
22319
|
var AGENDA_DEFAULTS = { unanswered: DAY, waiting: 7 * DAY };
|
|
22203
22320
|
var CLAIMS = ["none", "mine", "others", "any"];
|
|
@@ -22444,7 +22561,7 @@ var agendaItem = /* @__PURE__ */ __name((shown) => {
|
|
|
22444
22561
|
};
|
|
22445
22562
|
}, "agendaItem");
|
|
22446
22563
|
|
|
22447
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
22564
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/context/evidence-response.js
|
|
22448
22565
|
var contextSourceKey = /* @__PURE__ */ __name((source) => JSON.stringify([source.kind, source.accountId, source.provider, source.account]), "contextSourceKey");
|
|
22449
22566
|
var validateContextEvidencePage = /* @__PURE__ */ __name((page, request) => {
|
|
22450
22567
|
const fail2 = /* @__PURE__ */ __name(() => {
|
|
@@ -22467,33 +22584,33 @@ var validateContextEvidencePage = /* @__PURE__ */ __name((page, request) => {
|
|
|
22467
22584
|
if (big !== void 0 && (!big || page.items.length || typeof big.ref !== "string" || !Number.isSafeInteger(big.bytes) || big.bytes <= maxReadBytes))
|
|
22468
22585
|
fail2();
|
|
22469
22586
|
let actual = 0;
|
|
22470
|
-
for (const
|
|
22471
|
-
if (!
|
|
22587
|
+
for (const item2 of page.items) {
|
|
22588
|
+
if (!item2 || item2.provider !== source.provider || item2.account !== source.account || typeof item2.text !== "string" || typeof item2.ref !== "string")
|
|
22472
22589
|
fail2();
|
|
22473
|
-
if (!Number.isSafeInteger(
|
|
22590
|
+
if (!Number.isSafeInteger(item2.at) || item2.at < after || item2.at >= before2 || !Number.isSafeInteger(item2.updatedAt) || item2.updatedAt < 0)
|
|
22474
22591
|
fail2();
|
|
22475
|
-
if (
|
|
22592
|
+
if (item2.revision !== null && (!Number.isSafeInteger(item2.revision) || item2.revision < 1))
|
|
22476
22593
|
fail2();
|
|
22477
|
-
if (source.kind === "document" ? !["source-modified", "stored-update"].includes(
|
|
22594
|
+
if (source.kind === "document" ? !["source-modified", "stored-update"].includes(item2.timeKind) : item2.timeKind !== (source.kind === "meeting" ? "meeting-start" : "sent"))
|
|
22478
22595
|
fail2();
|
|
22479
|
-
const sender =
|
|
22596
|
+
const sender = item2.sender;
|
|
22480
22597
|
if (sender != null && (typeof sender !== "object" || typeof sender.provider !== "string" || typeof sender.id !== "string" || typeof sender.owner !== "boolean" || [sender.name, sender.person, sender.personName].some((v) => v !== null && typeof v !== "string") || sender.person !== null && !/^person:[1-9]\d*$/.test(sender.person)))
|
|
22481
22598
|
fail2();
|
|
22482
|
-
const text2 = [
|
|
22599
|
+
const text2 = [item2.text, item2.title, item2.url, item2.provider, item2.account, item2.timeKind];
|
|
22483
22600
|
if (text2.some((value) => value !== null && typeof value !== "string"))
|
|
22484
22601
|
fail2();
|
|
22485
22602
|
if (source.kind === "document") {
|
|
22486
|
-
const id2 = Number(
|
|
22487
|
-
if (!Number.isSafeInteger(id2) || id2 < 1 ||
|
|
22603
|
+
const id2 = Number(item2.ref.slice(9));
|
|
22604
|
+
if (!Number.isSafeInteger(id2) || id2 < 1 || item2.ref !== `document:${id2}`)
|
|
22488
22605
|
fail2();
|
|
22489
22606
|
} else if (source.kind === "meeting") {
|
|
22490
|
-
const reference = parseMeetingReference(
|
|
22491
|
-
if (reference.accountId !== source.accountId || reference.transcriptId === void 0 || reference.cuePosition === void 0 || formatMeetingReference(reference) !==
|
|
22607
|
+
const reference = parseMeetingReference(item2.ref);
|
|
22608
|
+
if (reference.accountId !== source.accountId || reference.transcriptId === void 0 || reference.cuePosition === void 0 || formatMeetingReference(reference) !== item2.ref)
|
|
22492
22609
|
fail2();
|
|
22493
|
-
text2.push(
|
|
22610
|
+
text2.push(item2.ref);
|
|
22494
22611
|
} else {
|
|
22495
|
-
const locator = parseLocator(
|
|
22496
|
-
if (locator.provider !== source.provider || locator.account !== source.account || chat !== void 0 && locator.chat !== chat || formatLocator(locator) !==
|
|
22612
|
+
const locator = parseLocator(item2.ref);
|
|
22613
|
+
if (locator.provider !== source.provider || locator.account !== source.account || chat !== void 0 && locator.chat !== chat || formatLocator(locator) !== item2.ref)
|
|
22497
22614
|
fail2();
|
|
22498
22615
|
text2.push(locator.chat, locator.message);
|
|
22499
22616
|
}
|
|
@@ -22508,7 +22625,7 @@ var validateContextEvidencePage = /* @__PURE__ */ __name((page, request) => {
|
|
|
22508
22625
|
}
|
|
22509
22626
|
}, "validateContextEvidencePage");
|
|
22510
22627
|
|
|
22511
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
22628
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/context/read-budget.js
|
|
22512
22629
|
var contextReadBudget = /* @__PURE__ */ __name((limits = {}) => {
|
|
22513
22630
|
if (!limits || typeof limits !== "object" || Array.isArray(limits))
|
|
22514
22631
|
throw new CliError("validation_error", "limits needs a context read allowance");
|
|
@@ -22561,7 +22678,7 @@ var contextReadBudget = /* @__PURE__ */ __name((limits = {}) => {
|
|
|
22561
22678
|
};
|
|
22562
22679
|
}, "contextReadBudget");
|
|
22563
22680
|
|
|
22564
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
22681
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/services/context-evidence.js
|
|
22565
22682
|
var createContextEvidenceReader = /* @__PURE__ */ __name((port, allowed, limits) => {
|
|
22566
22683
|
if (!port || typeof port.read !== "function")
|
|
22567
22684
|
throw new CliError("configuration_error", "context evidence reader is unavailable");
|
|
@@ -22605,7 +22722,7 @@ var createContextEvidenceReader = /* @__PURE__ */ __name((port, allowed, limits)
|
|
|
22605
22722
|
};
|
|
22606
22723
|
}, "createContextEvidenceReader");
|
|
22607
22724
|
|
|
22608
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
22725
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/services/excerpt.js
|
|
22609
22726
|
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");
|
|
22610
22727
|
var excerpt = /* @__PURE__ */ __name((text2, query, size2 = 240, options = {}) => {
|
|
22611
22728
|
const flat = text2.replace(/\s+/g, " ").trim();
|
|
@@ -22621,7 +22738,7 @@ var excerpt = /* @__PURE__ */ __name((text2, query, size2 = 240, options = {}) =
|
|
|
22621
22738
|
}, "excerpt");
|
|
22622
22739
|
var withExcerpt = /* @__PURE__ */ __name(({ matchedText, ...hit }, query) => ({ ...hit, excerpt: excerpt(matchedText ?? hit.text, query) }), "withExcerpt");
|
|
22623
22740
|
|
|
22624
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
22741
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/services/project-purposes.js
|
|
22625
22742
|
var BUILT_IN_PURPOSES = ["work", "sales", "support", "other"];
|
|
22626
22743
|
var DEFAULT_PURPOSES = ["work"];
|
|
22627
22744
|
var LINK_PURPOSE = "work";
|
|
@@ -22651,7 +22768,7 @@ var purposeList = /* @__PURE__ */ __name((value, previous = []) => [
|
|
|
22651
22768
|
...value.split(",").map((one) => one.trim()).filter(Boolean)
|
|
22652
22769
|
], "purposeList");
|
|
22653
22770
|
|
|
22654
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
22771
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/services/project-gathering-around.js
|
|
22655
22772
|
var storedMessageNeighbours = /* @__PURE__ */ __name((messages) => ({
|
|
22656
22773
|
async around(ref, window3) {
|
|
22657
22774
|
const at = parseLocator(ref);
|
|
@@ -22685,35 +22802,35 @@ var documentMatches = /* @__PURE__ */ __name((text2, queries, window3) => {
|
|
|
22685
22802
|
var attachNeighbours = /* @__PURE__ */ __name(async (items, reader, window3, budget, known2, signal) => {
|
|
22686
22803
|
if (!reader || window3.before + window3.after === 0)
|
|
22687
22804
|
return;
|
|
22688
|
-
for (const
|
|
22689
|
-
if (
|
|
22805
|
+
for (const item2 of items) {
|
|
22806
|
+
if (item2.kind !== "message" && item2.kind !== "mail")
|
|
22690
22807
|
continue;
|
|
22691
22808
|
if (budget.remaining() <= 0) {
|
|
22692
|
-
|
|
22693
|
-
|
|
22809
|
+
item2.around = null;
|
|
22810
|
+
item2.aroundIssue = "read-bytes";
|
|
22694
22811
|
continue;
|
|
22695
22812
|
}
|
|
22696
22813
|
signal?.throwIfAborted();
|
|
22697
22814
|
try {
|
|
22698
|
-
const rows = await reader.around(
|
|
22815
|
+
const rows = await reader.around(item2.ref, window3);
|
|
22699
22816
|
const around = [];
|
|
22700
22817
|
for (const row of rows.slice(0, window3.before + window3.after)) {
|
|
22701
22818
|
const text2 = excerpt(row.text, "", 200);
|
|
22702
22819
|
const bytes2 = Buffer.byteLength(text2);
|
|
22703
22820
|
if (bytes2 > budget.remaining()) {
|
|
22704
|
-
|
|
22821
|
+
item2.aroundIssue = "read-bytes";
|
|
22705
22822
|
break;
|
|
22706
22823
|
}
|
|
22707
22824
|
budget.charge(bytes2);
|
|
22708
22825
|
around.push({ ...row, text: text2, found: known2(row.ref) });
|
|
22709
22826
|
}
|
|
22710
|
-
|
|
22827
|
+
item2.around = around;
|
|
22711
22828
|
} catch (error) {
|
|
22712
22829
|
signal?.throwIfAborted();
|
|
22713
22830
|
if (!(error instanceof CliError))
|
|
22714
22831
|
throw error;
|
|
22715
|
-
|
|
22716
|
-
|
|
22832
|
+
item2.around = null;
|
|
22833
|
+
item2.aroundIssue = error.code;
|
|
22717
22834
|
}
|
|
22718
22835
|
}
|
|
22719
22836
|
}, "attachNeighbours");
|
|
@@ -22746,7 +22863,7 @@ var storedNeighbours = /* @__PURE__ */ __name((store) => {
|
|
|
22746
22863
|
};
|
|
22747
22864
|
}, "storedNeighbours");
|
|
22748
22865
|
|
|
22749
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
22866
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/services/project-gathering-request.js
|
|
22750
22867
|
import { createHash as createHash2 } from "node:crypto";
|
|
22751
22868
|
var DAY2 = 864e5;
|
|
22752
22869
|
var MAX_TIME = 864e13;
|
|
@@ -23062,7 +23179,7 @@ var decodeCheckpoint = /* @__PURE__ */ __name((text2, plan) => {
|
|
|
23062
23179
|
return value;
|
|
23063
23180
|
}, "decodeCheckpoint");
|
|
23064
23181
|
|
|
23065
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
23182
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/services/project-gathering.js
|
|
23066
23183
|
var terminal = /* @__PURE__ */ new Set(["done", "unavailable", "failed"]);
|
|
23067
23184
|
var PAGE2 = 20;
|
|
23068
23185
|
var PEOPLE = 20;
|
|
@@ -23209,27 +23326,27 @@ var gatherProjectEvidence = /* @__PURE__ */ __name(async (ports, request) => {
|
|
|
23209
23326
|
matchedAgain.set(ref, (matchedAgain.get(ref) ?? /* @__PURE__ */ new Set()).add(lane.id));
|
|
23210
23327
|
return true;
|
|
23211
23328
|
}, "again");
|
|
23212
|
-
const take = /* @__PURE__ */ __name((
|
|
23213
|
-
if (again(
|
|
23329
|
+
const take = /* @__PURE__ */ __name((item2, lane, kind, source) => {
|
|
23330
|
+
if (again(item2.ref, lane))
|
|
23214
23331
|
return;
|
|
23215
|
-
seen.add(seenKey(
|
|
23216
|
-
const short = excerpt(
|
|
23217
|
-
const fingerprint = contextEvidenceFingerprint(
|
|
23218
|
-
const { sender, ...stored } =
|
|
23332
|
+
seen.add(seenKey(item2.ref));
|
|
23333
|
+
const short = excerpt(item2.text, lane.query ?? "", 300, { literal: true });
|
|
23334
|
+
const fingerprint = contextEvidenceFingerprint(item2);
|
|
23335
|
+
const { sender, ...stored } = item2;
|
|
23219
23336
|
if (sender)
|
|
23220
|
-
senderOf.set(
|
|
23337
|
+
senderOf.set(item2.ref, sender);
|
|
23221
23338
|
const entry = {
|
|
23222
23339
|
...stored,
|
|
23223
23340
|
kind,
|
|
23224
23341
|
source,
|
|
23225
23342
|
text: short,
|
|
23226
|
-
textTruncated: short !==
|
|
23343
|
+
textTruncated: short !== item2.text.replace(/\s+/g, " ").trim(),
|
|
23227
23344
|
fingerprint,
|
|
23228
23345
|
lanes: [lane.id],
|
|
23229
23346
|
context: contextOf(lane)
|
|
23230
23347
|
};
|
|
23231
23348
|
if (kind === "document" && lane.query !== null && plan.around.before + plan.around.after) {
|
|
23232
|
-
const passage = documentMatches(
|
|
23349
|
+
const passage = documentMatches(item2.text, queries, plan.around);
|
|
23233
23350
|
entry.around = [];
|
|
23234
23351
|
entry.moreMatches = passage.moreMatches;
|
|
23235
23352
|
for (const part of passage.around) {
|
|
@@ -23239,10 +23356,10 @@ var gatherProjectEvidence = /* @__PURE__ */ __name(async (ports, request) => {
|
|
|
23239
23356
|
break;
|
|
23240
23357
|
}
|
|
23241
23358
|
usage.aroundBytes += bytes2;
|
|
23242
|
-
entry.around.push({ ref:
|
|
23359
|
+
entry.around.push({ ref: item2.ref, at: item2.at, sender: null, ...part });
|
|
23243
23360
|
}
|
|
23244
23361
|
}
|
|
23245
|
-
byRef.set(
|
|
23362
|
+
byRef.set(item2.ref, entry);
|
|
23246
23363
|
items.push(entry);
|
|
23247
23364
|
usage.items++;
|
|
23248
23365
|
if (linkedLanes.has(lane.id))
|
|
@@ -23309,8 +23426,8 @@ var gatherProjectEvidence = /* @__PURE__ */ __name(async (ports, request) => {
|
|
|
23309
23426
|
}
|
|
23310
23427
|
state.pages++;
|
|
23311
23428
|
state.code = page.coverage.index === "ready" ? null : `index-${page.coverage.index}`;
|
|
23312
|
-
for (const
|
|
23313
|
-
take(
|
|
23429
|
+
for (const item2 of page.items)
|
|
23430
|
+
take(item2, unit.lane, unit.source.kind, unit.sourceIndex);
|
|
23314
23431
|
if (!page.coverage.available)
|
|
23315
23432
|
state.state = "unavailable";
|
|
23316
23433
|
else if (page.next) {
|
|
@@ -23334,7 +23451,7 @@ var gatherProjectEvidence = /* @__PURE__ */ __name(async (ports, request) => {
|
|
|
23334
23451
|
}
|
|
23335
23452
|
await attachNeighbours(
|
|
23336
23453
|
// A linked chat's neighbours are already its own lane's evidence.
|
|
23337
|
-
items.filter((
|
|
23454
|
+
items.filter((item2) => item2.context !== "linked-chat"),
|
|
23338
23455
|
ports.neighbours,
|
|
23339
23456
|
plan.around,
|
|
23340
23457
|
{
|
|
@@ -23445,8 +23562,8 @@ var gatherProjectEvidence = /* @__PURE__ */ __name(async (ports, request) => {
|
|
|
23445
23562
|
}, "gatherProjectEvidence");
|
|
23446
23563
|
var peopleOf = /* @__PURE__ */ __name((items, senderOf) => {
|
|
23447
23564
|
const byKey = /* @__PURE__ */ new Map();
|
|
23448
|
-
for (const
|
|
23449
|
-
const sender = senderOf.get(
|
|
23565
|
+
for (const item2 of items) {
|
|
23566
|
+
const sender = senderOf.get(item2.ref);
|
|
23450
23567
|
if (!sender || sender.owner)
|
|
23451
23568
|
continue;
|
|
23452
23569
|
const key = sender.person ?? JSON.stringify([sender.provider, sender.id]);
|
|
@@ -23458,15 +23575,15 @@ var peopleOf = /* @__PURE__ */ __name((items, senderOf) => {
|
|
|
23458
23575
|
contexts: {}
|
|
23459
23576
|
};
|
|
23460
23577
|
byKey.set(key, found);
|
|
23461
|
-
if (!found.identities.some((i) => i.provider === sender.provider && i.account ===
|
|
23462
|
-
found.identities.push({ provider: sender.provider, account:
|
|
23578
|
+
if (!found.identities.some((i) => i.provider === sender.provider && i.account === item2.account && i.id === sender.id))
|
|
23579
|
+
found.identities.push({ provider: sender.provider, account: item2.account, id: sender.id });
|
|
23463
23580
|
found.items++;
|
|
23464
|
-
found.contexts[
|
|
23581
|
+
found.contexts[item2.context] = (found.contexts[item2.context] ?? 0) + 1;
|
|
23465
23582
|
}
|
|
23466
23583
|
return [...byKey.values()].sort((a, b) => b.items - a.items || a.name.localeCompare(b.name));
|
|
23467
23584
|
}, "peopleOf");
|
|
23468
23585
|
|
|
23469
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
23586
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/services/meeting-project-candidate-matching.js
|
|
23470
23587
|
var normalizedText = /* @__PURE__ */ __name((text2) => text2.normalize("NFKC").toLowerCase().replace(/\s+/gu, " "), "normalizedText");
|
|
23471
23588
|
var termsOf = /* @__PURE__ */ __name((entry) => [
|
|
23472
23589
|
{ name: entry.name, kind: "canonical" },
|
|
@@ -23510,7 +23627,7 @@ var matchVocabularyTerms = /* @__PURE__ */ __name((catalog, texts) => {
|
|
|
23510
23627
|
return result.sort((a, b) => Number(a.entry.id) - Number(b.entry.id));
|
|
23511
23628
|
}, "matchVocabularyTerms");
|
|
23512
23629
|
|
|
23513
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
23630
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/services/project-gathering-mentions.js
|
|
23514
23631
|
var KINDS = ["project", "tag", "topic"];
|
|
23515
23632
|
var findEvidenceMentions = /* @__PURE__ */ __name(async (vocabulary, gathering, options = {}) => {
|
|
23516
23633
|
if (typeof vocabulary?.vocabulary !== "function")
|
|
@@ -23518,9 +23635,9 @@ var findEvidenceMentions = /* @__PURE__ */ __name(async (vocabulary, gathering,
|
|
|
23518
23635
|
const limit = options.limit ?? 50;
|
|
23519
23636
|
if (!Number.isSafeInteger(limit) || limit < 1 || limit > 200)
|
|
23520
23637
|
throw new CliError("validation_error", "limit must be a whole number from 1 to 200", { param: "limit" });
|
|
23521
|
-
const texts = gathering.items.flatMap((
|
|
23522
|
-
{ text: `${
|
|
23523
|
-
...(
|
|
23638
|
+
const texts = gathering.items.flatMap((item2) => [
|
|
23639
|
+
{ text: `${item2.title ?? ""} ${item2.text}`, source: { reference: item2.ref, in: "hit" } },
|
|
23640
|
+
...(item2.around ?? []).map((one) => ({ text: one.text, source: { reference: one.ref, in: "around" } }))
|
|
23524
23641
|
]);
|
|
23525
23642
|
const items = [];
|
|
23526
23643
|
const vocabularyFingerprints = {};
|
|
@@ -23565,7 +23682,7 @@ var findEvidenceMentions = /* @__PURE__ */ __name(async (vocabulary, gathering,
|
|
|
23565
23682
|
};
|
|
23566
23683
|
}, "findEvidenceMentions");
|
|
23567
23684
|
|
|
23568
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
23685
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/services/stored-project-gathering.js
|
|
23569
23686
|
var storedChatCount = /* @__PURE__ */ __name((store) => async (account, chatId, { since, until }) => {
|
|
23570
23687
|
const window3 = { since: new Date(since).toISOString(), until: new Date(until - 1).toISOString() };
|
|
23571
23688
|
const [messages, newest, oldest] = await Promise.all([
|
|
@@ -23816,9 +23933,9 @@ var gatherStoredProject = /* @__PURE__ */ __name(async (store, input) => {
|
|
|
23816
23933
|
if (proposed && lane.kinds.includes("sender"))
|
|
23817
23934
|
proposedLanes.set(lane.id, proposed);
|
|
23818
23935
|
}
|
|
23819
|
-
const items = gathered.items.map((
|
|
23820
|
-
const proposed =
|
|
23821
|
-
return proposed ? { ...
|
|
23936
|
+
const items = gathered.items.map((item2) => {
|
|
23937
|
+
const proposed = item2.lanes.every((lane) => proposedLanes.has(lane)) ? proposedLanes.get(item2.lanes[0] ?? "") : void 0;
|
|
23938
|
+
return proposed ? { ...item2, proposed } : item2;
|
|
23822
23939
|
});
|
|
23823
23940
|
const linkedRows = gathered.linkedChats.map((row) => {
|
|
23824
23941
|
const link4 = byRef.get(row.ref);
|
|
@@ -23871,18 +23988,18 @@ var purposeHintOf = /* @__PURE__ */ __name((linked, rows, of) => {
|
|
|
23871
23988
|
return { chat: top.ref, relationship: link4.relationship, items, of };
|
|
23872
23989
|
}, "purposeHintOf");
|
|
23873
23990
|
|
|
23874
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
23991
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/services/media-archive.js
|
|
23875
23992
|
import { setTimeout as sleep3 } from "node:timers/promises";
|
|
23876
23993
|
|
|
23877
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
23994
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/services/media-archive-files.js
|
|
23878
23995
|
import { lstat } from "node:fs/promises";
|
|
23879
23996
|
|
|
23880
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
23997
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/persistence/native/recording-partial-store.js
|
|
23881
23998
|
import { createHash as createHash4, randomUUID as randomUUID2 } from "node:crypto";
|
|
23882
23999
|
import { open as open3, rename as rename2, unlink as unlink2 } from "node:fs/promises";
|
|
23883
24000
|
import { join as join2 } from "node:path";
|
|
23884
24001
|
|
|
23885
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
24002
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/persistence/native/recording-partial-metadata.js
|
|
23886
24003
|
import { createHash as createHash3 } from "node:crypto";
|
|
23887
24004
|
var metadataLimit = 16384;
|
|
23888
24005
|
var partialIdentity = /* @__PURE__ */ __name((locator) => JSON.stringify([locator.provider, locator.account, locator.occurrenceId, locator.assetId]), "partialIdentity");
|
|
@@ -23942,7 +24059,7 @@ var readPartialMetadata = /* @__PURE__ */ __name(async (path, locator, maxBytes,
|
|
|
23942
24059
|
}
|
|
23943
24060
|
}, "readPartialMetadata");
|
|
23944
24061
|
|
|
23945
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
24062
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/persistence/native/recording-partial-writer.js
|
|
23946
24063
|
import { randomUUID } from "node:crypto";
|
|
23947
24064
|
import { open as open2, rename, unlink } from "node:fs/promises";
|
|
23948
24065
|
import { join } from "node:path";
|
|
@@ -24034,7 +24151,7 @@ var partialWriter = /* @__PURE__ */ __name(async (input) => {
|
|
|
24034
24151
|
};
|
|
24035
24152
|
}, "partialWriter");
|
|
24036
24153
|
|
|
24037
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
24154
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/persistence/native/recording-partial-store.js
|
|
24038
24155
|
var NativeRecordingPartialStore = class {
|
|
24039
24156
|
static {
|
|
24040
24157
|
__name(this, "NativeRecordingPartialStore");
|
|
@@ -24141,21 +24258,21 @@ var NativeRecordingPartialStore = class {
|
|
|
24141
24258
|
}
|
|
24142
24259
|
};
|
|
24143
24260
|
|
|
24144
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
24261
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/persistence/native/recording-publication.js
|
|
24145
24262
|
import { createHash as createHash5 } from "node:crypto";
|
|
24146
24263
|
import { link as link2 } from "node:fs/promises";
|
|
24147
24264
|
import { basename as basename2, dirname as dirname2, join as join4, resolve as resolve2 } from "node:path";
|
|
24148
24265
|
|
|
24149
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
24266
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/persistence/native/recording-publication-files.js
|
|
24150
24267
|
import { unlink as unlink3 } from "node:fs/promises";
|
|
24151
|
-
var verifiedPublicationFile = /* @__PURE__ */ __name(async (path,
|
|
24268
|
+
var verifiedPublicationFile = /* @__PURE__ */ __name(async (path, expected2, signal, writable = false) => {
|
|
24152
24269
|
signal?.throwIfAborted();
|
|
24153
24270
|
const file = await openOrdinaryFile(path, { writable });
|
|
24154
24271
|
try {
|
|
24155
|
-
if ((await file.stat()).size !==
|
|
24272
|
+
if ((await file.stat()).size !== expected2.size)
|
|
24156
24273
|
throw new CliError("validation_error", "recording recovery final checksum does not match");
|
|
24157
|
-
const actual = await fingerprintPartial(file, signal,
|
|
24158
|
-
if (actual.offset !==
|
|
24274
|
+
const actual = await fingerprintPartial(file, signal, expected2.size);
|
|
24275
|
+
if (actual.offset !== expected2.size || actual.sha256 !== expected2.sha256)
|
|
24159
24276
|
throw new CliError("validation_error", "recording recovery final checksum does not match");
|
|
24160
24277
|
return file;
|
|
24161
24278
|
} catch (error) {
|
|
@@ -24181,7 +24298,7 @@ var commitPublication = /* @__PURE__ */ __name(async (root, partialPath, finalPa
|
|
|
24181
24298
|
signal?.throwIfAborted();
|
|
24182
24299
|
}, "commitPublication");
|
|
24183
24300
|
|
|
24184
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
24301
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/persistence/native/recording-publication-journal.js
|
|
24185
24302
|
import { randomUUID as randomUUID3 } from "node:crypto";
|
|
24186
24303
|
import { open as open4, rename as rename3, unlink as unlink4 } from "node:fs/promises";
|
|
24187
24304
|
import { join as join3 } from "node:path";
|
|
@@ -24254,7 +24371,7 @@ var writePublicationJournal = /* @__PURE__ */ __name(async (root, path, prefix,
|
|
|
24254
24371
|
}
|
|
24255
24372
|
}, "writePublicationJournal");
|
|
24256
24373
|
|
|
24257
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
24374
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/persistence/native/recording-publication.js
|
|
24258
24375
|
var NativeRecordingPublication = class {
|
|
24259
24376
|
static {
|
|
24260
24377
|
__name(this, "NativeRecordingPublication");
|
|
@@ -24281,13 +24398,13 @@ var NativeRecordingPublication = class {
|
|
|
24281
24398
|
write(value) {
|
|
24282
24399
|
return writePublicationJournal(this.root, this.journalPath, this.options.prefix, value, this.options.codec, this.options.metadataLimit, this.options.signal);
|
|
24283
24400
|
}
|
|
24284
|
-
validate(partialPath,
|
|
24285
|
-
if (resolve2(dirname2(partialPath)) !== resolve2(this.root) || resolve2(partialPath) === resolve2(this.finalPath) || resolve2(partialPath) === resolve2(this.journalPath) || !Number.isSafeInteger(
|
|
24401
|
+
validate(partialPath, expected2) {
|
|
24402
|
+
if (resolve2(dirname2(partialPath)) !== resolve2(this.root) || resolve2(partialPath) === resolve2(this.finalPath) || resolve2(partialPath) === resolve2(this.journalPath) || !Number.isSafeInteger(expected2.size) || expected2.size < 0 || expected2.size > this.options.maxBytes || typeof expected2.sha256 !== "string" || !/^[a-f0-9]{64}$/.test(expected2.sha256))
|
|
24286
24403
|
throw new CliError("validation_error", "invalid recording publication evidence");
|
|
24287
24404
|
this.options.signal?.throwIfAborted();
|
|
24288
24405
|
}
|
|
24289
|
-
async publish(partialPath,
|
|
24290
|
-
const proof = { ...
|
|
24406
|
+
async publish(partialPath, expected2, commit) {
|
|
24407
|
+
const proof = { ...expected2 };
|
|
24291
24408
|
this.validate(partialPath, proof);
|
|
24292
24409
|
const partial = await verifiedPublicationFile(partialPath, proof, this.options.signal, true);
|
|
24293
24410
|
try {
|
|
@@ -24305,14 +24422,14 @@ var NativeRecordingPublication = class {
|
|
|
24305
24422
|
const intent = await this.read();
|
|
24306
24423
|
if (intent === null)
|
|
24307
24424
|
throw new CliError("validation_error", "recording path already exists without a verified manifest or scoped recovery record");
|
|
24308
|
-
const
|
|
24309
|
-
this.validate(partialPath,
|
|
24425
|
+
const expected2 = { ...this.options.evidence(intent) };
|
|
24426
|
+
this.validate(partialPath, expected2);
|
|
24310
24427
|
const completed = await loadPartial();
|
|
24311
|
-
if (!strongRecordingValidator(
|
|
24428
|
+
if (!strongRecordingValidator(expected2.validator) || !completed || partialIdentity(completed.locator) !== this.scope || completed.offset !== expected2.size || completed.sha256 !== expected2.sha256 || completed.validator !== expected2.validator || completed.total !== null && completed.total !== expected2.size)
|
|
24312
24429
|
throw new CliError("validation_error", "recording recovery checkpoint does not prove this completed asset");
|
|
24313
|
-
const partial = await verifiedPublicationFile(partialPath,
|
|
24430
|
+
const partial = await verifiedPublicationFile(partialPath, expected2, this.options.signal);
|
|
24314
24431
|
try {
|
|
24315
|
-
const final = await verifiedPublicationFile(this.finalPath,
|
|
24432
|
+
const final = await verifiedPublicationFile(this.finalPath, expected2, this.options.signal, true);
|
|
24316
24433
|
try {
|
|
24317
24434
|
await final.sync();
|
|
24318
24435
|
this.options.signal?.throwIfAborted();
|
|
@@ -24327,7 +24444,7 @@ var NativeRecordingPublication = class {
|
|
|
24327
24444
|
}
|
|
24328
24445
|
};
|
|
24329
24446
|
|
|
24330
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
24447
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/services/media-archive-manifest.js
|
|
24331
24448
|
import { createHash as createHash6 } from "node:crypto";
|
|
24332
24449
|
import { readdir } from "node:fs/promises";
|
|
24333
24450
|
import { isAbsolute as isAbsolute2, join as join5, resolve as resolve3 } from "node:path";
|
|
@@ -24414,7 +24531,7 @@ var commitMediaEntry = /* @__PURE__ */ __name((root, one, beforePublish) => writ
|
|
|
24414
24531
|
beforePublish
|
|
24415
24532
|
}), "commitMediaEntry");
|
|
24416
24533
|
|
|
24417
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
24534
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/services/media-archive-files.js
|
|
24418
24535
|
var validator = '"media-completed-v1"';
|
|
24419
24536
|
var maximumFileBytes = 64 * 1024 * 1024 * 1024;
|
|
24420
24537
|
var archiveMediaFile = /* @__PURE__ */ __name(async (root, identity, kind, file, beforeWrite, signal, metadata = {}) => {
|
|
@@ -24515,7 +24632,7 @@ var archiveMediaFile = /* @__PURE__ */ __name(async (root, identity, kind, file,
|
|
|
24515
24632
|
return entry;
|
|
24516
24633
|
}, "archiveMediaFile");
|
|
24517
24634
|
|
|
24518
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
24635
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/services/media-archive-locks.js
|
|
24519
24636
|
import { mkdir, realpath } from "node:fs/promises";
|
|
24520
24637
|
import { join as join6, resolve as resolve4 } from "node:path";
|
|
24521
24638
|
var archiveLocations = /* @__PURE__ */ __name(async (initial, signal) => {
|
|
@@ -24582,7 +24699,7 @@ var withMediaArchiveLocks = /* @__PURE__ */ __name(async (directory2, signal, ru
|
|
|
24582
24699
|
throw new CliError("validation_error", "archive locations changed during locking; run the command again");
|
|
24583
24700
|
}, "withMediaArchiveLocks");
|
|
24584
24701
|
|
|
24585
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
24702
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/services/media-archive.js
|
|
24586
24703
|
var validateMediaSince = /* @__PURE__ */ __name((value, flag = "--since-time") => {
|
|
24587
24704
|
if (value === void 0)
|
|
24588
24705
|
return void 0;
|
|
@@ -24735,7 +24852,7 @@ var archiveMedia = /* @__PURE__ */ __name(async (ports, options) => {
|
|
|
24735
24852
|
}, { create: true });
|
|
24736
24853
|
}, "archiveMedia");
|
|
24737
24854
|
|
|
24738
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
24855
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/services/media-archive-move.js
|
|
24739
24856
|
import { realpath as realpath2, unlink as unlink5 } from "node:fs/promises";
|
|
24740
24857
|
import { basename as basename3, dirname as dirname3, join as join7, resolve as resolve5 } from "node:path";
|
|
24741
24858
|
var canonicalDestination = /* @__PURE__ */ __name(async (directory2) => {
|
|
@@ -24888,7 +25005,7 @@ var moveMediaArchive = /* @__PURE__ */ __name(async (options) => {
|
|
|
24888
25005
|
}, { additional: [target2], createAdditional: !options.dryRun });
|
|
24889
25006
|
}, "moveMediaArchive");
|
|
24890
25007
|
|
|
24891
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
25008
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/services/model-downloads.js
|
|
24892
25009
|
var bytesOf = /* @__PURE__ */ __name((model) => model.files.reduce((sum2, file) => sum2 + file.bytes, 0), "bytesOf");
|
|
24893
25010
|
var nativeRuntime = /* @__PURE__ */ __name(async ({ env, progress = /* @__PURE__ */ __name(() => {
|
|
24894
25011
|
}, "progress") }) => {
|
|
@@ -24911,7 +25028,7 @@ var downloadTextModel = /* @__PURE__ */ __name(async (id2, { env, progress = /*
|
|
|
24911
25028
|
}
|
|
24912
25029
|
await nativeRuntime({ env, progress });
|
|
24913
25030
|
progress(`${model.id}: loading it once to check it works`);
|
|
24914
|
-
const { openEmbedder: openEmbedder2 } = await import("./embed-
|
|
25031
|
+
const { openEmbedder: openEmbedder2 } = await import("./embed-ASAE3H5I.js");
|
|
24915
25032
|
const embedder = await openEmbedder2(model, directory2);
|
|
24916
25033
|
try {
|
|
24917
25034
|
const [vector] = await embedder.embed(["check"], "query");
|
|
@@ -24932,7 +25049,7 @@ var downloadRerankModel = /* @__PURE__ */ __name(async (id2, { env, progress = /
|
|
|
24932
25049
|
}
|
|
24933
25050
|
await nativeRuntime({ env, progress });
|
|
24934
25051
|
progress(`${model.id}: loading it once to check it works`);
|
|
24935
|
-
const { openReranker } = await import("./rerank-
|
|
25052
|
+
const { openReranker } = await import("./rerank-XNAMC6FH.js");
|
|
24936
25053
|
const reranker = await openReranker(model, directory2);
|
|
24937
25054
|
try {
|
|
24938
25055
|
await reranker.score("check", ["check"]);
|
|
@@ -24950,7 +25067,7 @@ var downloadImageModel = /* @__PURE__ */ __name(async (id2, { env, progress = /*
|
|
|
24950
25067
|
await installFiles(placedImage(model, directory2), { progress });
|
|
24951
25068
|
}
|
|
24952
25069
|
progress(`${model.id}: loading it once to check it works`);
|
|
24953
|
-
const { openPictureEmbedder } = await import("./embedder-
|
|
25070
|
+
const { openPictureEmbedder } = await import("./embedder-QYDZRKBX.js");
|
|
24954
25071
|
const embedder = await openPictureEmbedder(model, directory2);
|
|
24955
25072
|
try {
|
|
24956
25073
|
const vector = await embedder.embedQuery("check");
|
|
@@ -24962,7 +25079,7 @@ var downloadImageModel = /* @__PURE__ */ __name(async (id2, { env, progress = /*
|
|
|
24962
25079
|
return { model, directory: directory2 };
|
|
24963
25080
|
}, "downloadImageModel");
|
|
24964
25081
|
|
|
24965
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
25082
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/domain/money-words.js
|
|
24966
25083
|
var MONEY_REQUEST = "money-request";
|
|
24967
25084
|
var MONEY_DONE = "money-done";
|
|
24968
25085
|
var PROMISE = "promise";
|
|
@@ -24996,10 +25113,10 @@ var MONEY_WORDS = [
|
|
|
24996
25113
|
}
|
|
24997
25114
|
];
|
|
24998
25115
|
|
|
24999
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
25116
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/services/money-words.js
|
|
25000
25117
|
var moneyClassesOf = /* @__PURE__ */ __name((text2) => listsHit(text2, MONEY_WORDS), "moneyClassesOf");
|
|
25001
25118
|
|
|
25002
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
25119
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/domain/status-words.js
|
|
25003
25120
|
var words = /* @__PURE__ */ __name((forms) => new RegExp(`(?<![\\p{L}\\p{N}])(?:${forms.join("|")})(?![\\p{L}\\p{N}])`, "iu"), "words");
|
|
25004
25121
|
var MONEY_DONE_FORMS = words([
|
|
25005
25122
|
"\u043E\u043F\u043B\u0430\u0442\u0438\u043B[\u0430\u0438]?",
|
|
@@ -25039,7 +25156,7 @@ var PROMISE_FORMS = words([
|
|
|
25039
25156
|
"estar\xE1 listo"
|
|
25040
25157
|
]);
|
|
25041
25158
|
|
|
25042
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
25159
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/services/project-status/items.js
|
|
25043
25160
|
var EXCERPT_CHARS = 80;
|
|
25044
25161
|
var excerpt2 = /* @__PURE__ */ __name((text2) => {
|
|
25045
25162
|
const flat = text2.replace(/\s+/g, " ").trim();
|
|
@@ -25061,7 +25178,7 @@ var whoOf = /* @__PURE__ */ __name((message) => ({
|
|
|
25061
25178
|
var fromOwner = /* @__PURE__ */ __name((message) => message.outgoing === true, "fromOwner");
|
|
25062
25179
|
var day = /* @__PURE__ */ __name((at) => new Date(at).toISOString().slice(0, 10), "day");
|
|
25063
25180
|
|
|
25064
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
25181
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/services/project-status/signals/amounts.js
|
|
25065
25182
|
var MONEY = DEFAULT_TASK_CATEGORIES.filter((category) => category.name === "money");
|
|
25066
25183
|
var verbOf = /* @__PURE__ */ __name((text2) => {
|
|
25067
25184
|
if (MONEY_DONE_FORMS.test(text2))
|
|
@@ -25138,16 +25255,16 @@ var amounts = {
|
|
|
25138
25255
|
};
|
|
25139
25256
|
});
|
|
25140
25257
|
}, "read"),
|
|
25141
|
-
attention: /* @__PURE__ */ __name((items) => items.flatMap((
|
|
25258
|
+
attention: /* @__PURE__ */ __name((items) => items.flatMap((item2) => item2.chat !== null && item2.data.state === "open" ? [{ chat: item2.chat, weight: 2, why: "money open" }] : []), "attention")
|
|
25142
25259
|
};
|
|
25143
25260
|
|
|
25144
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
25261
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/services/project-status/signals/children.js
|
|
25145
25262
|
var children = {
|
|
25146
25263
|
id: "children",
|
|
25147
25264
|
version: 1,
|
|
25148
25265
|
scope: "project",
|
|
25149
25266
|
read: /* @__PURE__ */ __name(async (context2) => {
|
|
25150
|
-
const
|
|
25267
|
+
const item2 = /* @__PURE__ */ __name((data) => ({
|
|
25151
25268
|
signal: "children",
|
|
25152
25269
|
chat: null,
|
|
25153
25270
|
at: null,
|
|
@@ -25157,7 +25274,7 @@ var children = {
|
|
|
25157
25274
|
data
|
|
25158
25275
|
}), "item");
|
|
25159
25276
|
return [
|
|
25160
|
-
...context2.project.children.map((child) =>
|
|
25277
|
+
...context2.project.children.map((child) => item2({
|
|
25161
25278
|
child: child.ref,
|
|
25162
25279
|
key: child.key,
|
|
25163
25280
|
name: child.name,
|
|
@@ -25165,12 +25282,12 @@ var children = {
|
|
|
25165
25282
|
chats: context2.chats.filter((chat) => chat.project === child.ref).length,
|
|
25166
25283
|
cut: null
|
|
25167
25284
|
})),
|
|
25168
|
-
...context2.project.cut.map(({ ref, reason }) =>
|
|
25285
|
+
...context2.project.cut.map(({ ref, reason }) => item2({ child: ref, key: null, name: null, depth: null, chats: null, cut: reason }))
|
|
25169
25286
|
];
|
|
25170
25287
|
}, "read")
|
|
25171
25288
|
};
|
|
25172
25289
|
|
|
25173
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
25290
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/services/project-status/signals/coverage.js
|
|
25174
25291
|
var coverage = {
|
|
25175
25292
|
id: "coverage",
|
|
25176
25293
|
version: 1,
|
|
@@ -25196,10 +25313,10 @@ var coverage = {
|
|
|
25196
25313
|
}
|
|
25197
25314
|
];
|
|
25198
25315
|
}, "read"),
|
|
25199
|
-
attention: /* @__PURE__ */ __name((items) => items.flatMap((
|
|
25316
|
+
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")
|
|
25200
25317
|
};
|
|
25201
25318
|
|
|
25202
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
25319
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/services/project-status/signals/last-message.js
|
|
25203
25320
|
var lastMessage = {
|
|
25204
25321
|
id: "last-message",
|
|
25205
25322
|
version: 1,
|
|
@@ -25208,7 +25325,7 @@ var lastMessage = {
|
|
|
25208
25325
|
const last = chat?.messages.at(-1);
|
|
25209
25326
|
if (!chat || !last)
|
|
25210
25327
|
return [];
|
|
25211
|
-
const
|
|
25328
|
+
const item2 = {
|
|
25212
25329
|
signal: "last-message",
|
|
25213
25330
|
chat: chat.ref,
|
|
25214
25331
|
at: last.timestamp,
|
|
@@ -25217,33 +25334,61 @@ var lastMessage = {
|
|
|
25217
25334
|
basis: "store",
|
|
25218
25335
|
data: {}
|
|
25219
25336
|
};
|
|
25220
|
-
return [
|
|
25337
|
+
return [item2];
|
|
25221
25338
|
}, "read")
|
|
25222
25339
|
};
|
|
25223
25340
|
|
|
25224
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
25225
|
-
var
|
|
25341
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/services/project-status/signals/payments.js
|
|
25342
|
+
var holding = /* @__PURE__ */ __name((row) => row.review !== "rejected", "holding");
|
|
25343
|
+
var item = /* @__PURE__ */ __name((row, at, data) => ({
|
|
25344
|
+
signal: "payments",
|
|
25345
|
+
chat: null,
|
|
25346
|
+
at,
|
|
25347
|
+
who: null,
|
|
25348
|
+
// The row first, then what it cites, so an amount read from a cited message is not counted twice.
|
|
25349
|
+
evidence: [row.ref, ...row.evidence].map((ref) => ({ ref, fingerprint: null })),
|
|
25350
|
+
basis: "store",
|
|
25351
|
+
data: { ...data, title: row.title, status: row.review }
|
|
25352
|
+
}), "item");
|
|
25353
|
+
var paid = /* @__PURE__ */ __name((row) => {
|
|
25354
|
+
const party = row.direction === "in" ? row.payer : row.payee;
|
|
25355
|
+
return item(row, `${row.date}T00:00:00.000Z`, {
|
|
25356
|
+
amount: row.amount,
|
|
25357
|
+
currency: row.currency,
|
|
25358
|
+
direction: row.direction === "in" ? "to_us" : "from_us",
|
|
25359
|
+
counterparty: party?.ref ?? null,
|
|
25360
|
+
counterparty_name: party?.name ?? null,
|
|
25361
|
+
due_at: null,
|
|
25362
|
+
state: "paid",
|
|
25363
|
+
item: row.reference,
|
|
25364
|
+
paid_at: row.date
|
|
25365
|
+
});
|
|
25366
|
+
}, "paid");
|
|
25367
|
+
var expected = /* @__PURE__ */ __name((row) => item(row, row.issueDate === null ? row.createdAt : `${row.issueDate}T00:00:00.000Z`, {
|
|
25368
|
+
amount: row.open,
|
|
25369
|
+
currency: row.currency,
|
|
25370
|
+
direction: row.direction === "receivable" ? "to_us" : "from_us",
|
|
25371
|
+
counterparty: row.counterparty.ref,
|
|
25372
|
+
counterparty_name: row.counterparty.name,
|
|
25373
|
+
due_at: row.dueDate,
|
|
25374
|
+
state: "expected",
|
|
25375
|
+
item: row.number
|
|
25376
|
+
}), "expected");
|
|
25226
25377
|
var payments = {
|
|
25227
25378
|
id: "payments",
|
|
25228
|
-
version:
|
|
25379
|
+
version: 3,
|
|
25229
25380
|
scope: "project",
|
|
25230
25381
|
read: /* @__PURE__ */ __name(async (context2) => {
|
|
25231
25382
|
const projects = [context2.project.ref, ...context2.project.children.map((child) => child.ref)];
|
|
25232
|
-
const
|
|
25233
|
-
|
|
25234
|
-
|
|
25235
|
-
|
|
25236
|
-
|
|
25237
|
-
who: null,
|
|
25238
|
-
// The fact first, then what it cites, so an amount read from a cited message is not counted twice.
|
|
25239
|
-
evidence: [fact.ref, ...fact.evidence].map((ref) => ({ ref, fingerprint: null })),
|
|
25240
|
-
basis: "fact",
|
|
25241
|
-
data: { ...fact.payment, title: paymentTitle(fact), status: fact.status }
|
|
25242
|
-
}));
|
|
25383
|
+
const rows = await Promise.all(projects.map(async (project) => [
|
|
25384
|
+
...(await context2.store.finance.payments({ project, limit: 500 })).filter(holding).map(paid),
|
|
25385
|
+
...(await context2.store.finance.invoices({ project, open: true, limit: 500 })).filter(holding).map(expected)
|
|
25386
|
+
]));
|
|
25387
|
+
return rows.flat();
|
|
25243
25388
|
}, "read")
|
|
25244
25389
|
};
|
|
25245
25390
|
|
|
25246
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
25391
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/services/project-status/signals/promises.js
|
|
25247
25392
|
var PATTERNS_PER_CHAT = 3;
|
|
25248
25393
|
var DAY3 = 864e5;
|
|
25249
25394
|
var KINDS2 = /* @__PURE__ */ new Set(["promise", "request"]);
|
|
@@ -25332,7 +25477,7 @@ var promises = {
|
|
|
25332
25477
|
}, "read")
|
|
25333
25478
|
};
|
|
25334
25479
|
|
|
25335
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
25480
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/services/project-status/signals/questions.js
|
|
25336
25481
|
var PER_SIDE = 5;
|
|
25337
25482
|
var WEEK = 7 * 864e5;
|
|
25338
25483
|
var NOBODY = /* @__PURE__ */ new Set();
|
|
@@ -25358,12 +25503,12 @@ var questions2 = {
|
|
|
25358
25503
|
})));
|
|
25359
25504
|
}, "read"),
|
|
25360
25505
|
attention: /* @__PURE__ */ __name((items, context2) => {
|
|
25361
|
-
const stale = new Set(items.flatMap((
|
|
25506
|
+
const stale = new Set(items.flatMap((item2) => item2.chat !== null && item2.data.side === "yours" && item2.at && context2.now - Date.parse(item2.at) > WEEK ? [item2.chat] : []));
|
|
25362
25507
|
return [...stale].map((chat) => ({ chat, weight: 1, why: "your question unanswered for a week" }));
|
|
25363
25508
|
}, "attention")
|
|
25364
25509
|
};
|
|
25365
25510
|
|
|
25366
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
25511
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/services/project-status/signals/reply-next.js
|
|
25367
25512
|
var targetOf = /* @__PURE__ */ __name((message, chat, owners) => {
|
|
25368
25513
|
const byId2 = /* @__PURE__ */ __name((id2) => chat.messages.find((one) => one.id === id2), "byId");
|
|
25369
25514
|
const quoted = message.replyTo ?? (message.replyToId === void 0 ? void 0 : byId2(message.replyToId));
|
|
@@ -25428,10 +25573,10 @@ var replyNext = {
|
|
|
25428
25573
|
}
|
|
25429
25574
|
];
|
|
25430
25575
|
}, "read"),
|
|
25431
|
-
attention: /* @__PURE__ */ __name((items) => items.flatMap((
|
|
25576
|
+
attention: /* @__PURE__ */ __name((items) => items.flatMap((item2) => item2.chat !== null && item2.data.next === "owner" ? [{ chat: item2.chat, weight: 2, why: "your move" }] : []), "attention")
|
|
25432
25577
|
};
|
|
25433
25578
|
|
|
25434
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
25579
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/services/project-status/signals/topics.js
|
|
25435
25580
|
var escaped = /* @__PURE__ */ __name((text2) => text2.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), "escaped");
|
|
25436
25581
|
var wholeWord = /* @__PURE__ */ __name((word) => new RegExp(`(?<![\\p{L}\\p{N}])${escaped(word)}(?![\\p{L}\\p{N}])`, "u"), "wholeWord");
|
|
25437
25582
|
var matcherOf = /* @__PURE__ */ __name((query) => {
|
|
@@ -25477,7 +25622,7 @@ var topics = {
|
|
|
25477
25622
|
}, "read")
|
|
25478
25623
|
};
|
|
25479
25624
|
|
|
25480
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
25625
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/services/project-status/signals/index.js
|
|
25481
25626
|
var STATUS_SIGNALS = [
|
|
25482
25627
|
lastMessage,
|
|
25483
25628
|
replyNext,
|
|
@@ -25490,7 +25635,7 @@ var STATUS_SIGNALS = [
|
|
|
25490
25635
|
children
|
|
25491
25636
|
];
|
|
25492
25637
|
|
|
25493
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
25638
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/services/project-status/index.js
|
|
25494
25639
|
var DAY4 = 864e5;
|
|
25495
25640
|
var STATUS_WINDOW = 300;
|
|
25496
25641
|
var STATUS_CHATS = 16;
|
|
@@ -25536,15 +25681,16 @@ var childrenOf = /* @__PURE__ */ __name(async (store, root, catalog) => {
|
|
|
25536
25681
|
var inAccounts = /* @__PURE__ */ __name((accounts, provider, account) => accounts === void 0 || accounts.some((one) => one.provider === provider && one.account === account), "inAccounts");
|
|
25537
25682
|
var failure = /* @__PURE__ */ __name((error) => error instanceof Error ? error.message : String(error), "failure");
|
|
25538
25683
|
var counted2 = /* @__PURE__ */ __name((items) => {
|
|
25539
|
-
const
|
|
25540
|
-
|
|
25684
|
+
const confirmed = /* @__PURE__ */ __name((item2) => item2.signal === "payments" && item2.data.status === "confirmed", "confirmed");
|
|
25685
|
+
const recorded = new Set(items.filter(confirmed).flatMap((item2) => item2.evidence.slice(1).map((one) => one.ref)));
|
|
25686
|
+
return (item2, state) => item2.signal === "payments" ? state === "expected" && confirmed(item2) : item2.signal === "amounts" && state === "open" && !item2.evidence.some((one) => recorded.has(one.ref));
|
|
25541
25687
|
}, "counted");
|
|
25542
25688
|
var totalsOf = /* @__PURE__ */ __name((items) => {
|
|
25543
25689
|
const totals = /* @__PURE__ */ new Map();
|
|
25544
25690
|
const open7 = counted2(items);
|
|
25545
|
-
for (const
|
|
25546
|
-
const data =
|
|
25547
|
-
if (!open7(
|
|
25691
|
+
for (const item2 of items) {
|
|
25692
|
+
const data = item2.data;
|
|
25693
|
+
if (!open7(item2, data.state) || data.amount === void 0)
|
|
25548
25694
|
continue;
|
|
25549
25695
|
const key = `${data.direction}|${data.currency ?? ""}`;
|
|
25550
25696
|
const total = totals.get(key) ?? {
|
|
@@ -25671,7 +25817,7 @@ var projectStatus = /* @__PURE__ */ __name(async (store, input) => {
|
|
|
25671
25817
|
};
|
|
25672
25818
|
}, "projectStatus");
|
|
25673
25819
|
|
|
25674
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
25820
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/services/account.js
|
|
25675
25821
|
var accountService = /* @__PURE__ */ __name((deps) => {
|
|
25676
25822
|
const online = /* @__PURE__ */ __name(async (command) => {
|
|
25677
25823
|
if (deps.offline)
|
|
@@ -25743,7 +25889,7 @@ var accountService = /* @__PURE__ */ __name((deps) => {
|
|
|
25743
25889
|
};
|
|
25744
25890
|
}, "accountService");
|
|
25745
25891
|
|
|
25746
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
25892
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/domain/send-time.js
|
|
25747
25893
|
var MINUTE = 6e4;
|
|
25748
25894
|
var YEAR = 365 * 24 * 60 * MINUTE;
|
|
25749
25895
|
var DELAY = /^(\d+)(m|h|d)$/;
|
|
@@ -25762,7 +25908,7 @@ var sendTime = /* @__PURE__ */ __name((value, now = Date.now(), flag = "--at-tim
|
|
|
25762
25908
|
return new Date(at - at % MINUTE).toISOString();
|
|
25763
25909
|
}, "sendTime");
|
|
25764
25910
|
|
|
25765
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
25911
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/services/admin.js
|
|
25766
25912
|
var recordMembership = /* @__PURE__ */ __name(async (deps, operationId, done2, change, fix, write) => {
|
|
25767
25913
|
try {
|
|
25768
25914
|
const held = await accountStoreIfOpen(deps);
|
|
@@ -26009,7 +26155,7 @@ var linkLimits = /* @__PURE__ */ __name(({ approval, expires, maxUses }) => {
|
|
|
26009
26155
|
return expires === void 0 ? void 0 : sendTime(expires, Date.now(), "--expire-time");
|
|
26010
26156
|
}, "linkLimits");
|
|
26011
26157
|
|
|
26012
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
26158
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/services/mail-search.js
|
|
26013
26159
|
var THREADS_PAGE = 500;
|
|
26014
26160
|
var threadsOf = /* @__PURE__ */ __name(async (store, key) => {
|
|
26015
26161
|
const account = await store.accounts.storedAccount(key).catch(() => void 0);
|
|
@@ -26088,7 +26234,7 @@ var readMail = /* @__PURE__ */ __name(async (store, locator, { before: before2 =
|
|
|
26088
26234
|
return thread.slice(Math.max(0, at - before2), at + after + 1).map((hit) => hit.id === message ? { ...hit, anchor: true } : hit);
|
|
26089
26235
|
}, "readMail");
|
|
26090
26236
|
|
|
26091
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
26237
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/services/search-kind.js
|
|
26092
26238
|
var NO_MAIL = "no_mail";
|
|
26093
26239
|
var MAIL = "email";
|
|
26094
26240
|
var listContextOf = /* @__PURE__ */ __name(async (store, account, app, stored) => {
|
|
@@ -26135,7 +26281,7 @@ var accountsOfKind = /* @__PURE__ */ __name((kind, chosen, held, explicit, comma
|
|
|
26135
26281
|
return chosenMail.map(({ provider, account }) => ({ provider, account }));
|
|
26136
26282
|
}, "accountsOfKind");
|
|
26137
26283
|
|
|
26138
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
26284
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/services/messages-search.js
|
|
26139
26285
|
var MAIL_FIELDS = /* @__PURE__ */ new Set(["to", "cc", "bcc", "subject", "mailbox", "label", "is"]);
|
|
26140
26286
|
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");
|
|
26141
26287
|
var prepareLucene = /* @__PURE__ */ __name(async (store, account, request, messenger) => {
|
|
@@ -26394,9 +26540,9 @@ var searchLucene = /* @__PURE__ */ __name(async (store, account, request, messen
|
|
|
26394
26540
|
}, "inMailTables");
|
|
26395
26541
|
const found = !prepared.scopeAccounts.length ? { items: [], hasMore: false } : mailAccounts.length ? mergeMail(await execute(prepared.execution), await inMailTables(), request.limit, request.newest) : await execute(prepared.execution);
|
|
26396
26542
|
const { completeness, coverage: coverage2 } = request.kind === "mail" ? { completeness: [], coverage: void 0 } : await coverageOf(store, prepared, messenger);
|
|
26397
|
-
const items = await Promise.all(found.items.map(async (
|
|
26398
|
-
const garbled =
|
|
26399
|
-
const hit = withExcerpt(
|
|
26543
|
+
const items = await Promise.all(found.items.map(async (item2) => {
|
|
26544
|
+
const garbled = item2.corrections?.flatMap(({ to }) => to) ?? [];
|
|
26545
|
+
const hit = withExcerpt(item2, [request.text ?? "", ...garbled].join(" "));
|
|
26400
26546
|
if (!request.context)
|
|
26401
26547
|
return hit;
|
|
26402
26548
|
const locator = parseLocator(hit.locator);
|
|
@@ -26483,7 +26629,7 @@ var statsLucene = /* @__PURE__ */ __name(async (store, account, request, messeng
|
|
|
26483
26629
|
};
|
|
26484
26630
|
}, "statsLucene");
|
|
26485
26631
|
|
|
26486
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
26632
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/services/rankings-selection.js
|
|
26487
26633
|
var RANKING_SELECTION_BYTES = 64 * 1024;
|
|
26488
26634
|
var object = /* @__PURE__ */ __name((value) => value !== null && typeof value === "object" && !Array.isArray(value) ? value : void 0, "object");
|
|
26489
26635
|
function invalid(message = "ranking selection is invalid \u2014 obtain a new drilldown from stats top") {
|
|
@@ -26652,7 +26798,7 @@ var readRankingSelection = /* @__PURE__ */ __name(async (store, input) => {
|
|
|
26652
26798
|
};
|
|
26653
26799
|
}, "readRankingSelection");
|
|
26654
26800
|
|
|
26655
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
26801
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/services/search-record.js
|
|
26656
26802
|
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");
|
|
26657
26803
|
var searchRecordOf = /* @__PURE__ */ __name((command, params) => ({
|
|
26658
26804
|
command,
|
|
@@ -26662,7 +26808,7 @@ var searchRecordOf = /* @__PURE__ */ __name((command, params) => ({
|
|
|
26662
26808
|
fieldsVersion: FIELD_VERSION
|
|
26663
26809
|
}), "searchRecordOf");
|
|
26664
26810
|
|
|
26665
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
26811
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/services/admin-statistics.js
|
|
26666
26812
|
function invalid2(message) {
|
|
26667
26813
|
throw new CliError("validation_error", message);
|
|
26668
26814
|
}
|
|
@@ -26956,7 +27102,7 @@ var adminStatisticsService = /* @__PURE__ */ __name((deps) => ({
|
|
|
26956
27102
|
}, "evidence")
|
|
26957
27103
|
}), "adminStatisticsService");
|
|
26958
27104
|
|
|
26959
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
27105
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/services/archive-gaps.js
|
|
26960
27106
|
import { createHash as createHash7, randomUUID as randomUUID4 } from "node:crypto";
|
|
26961
27107
|
var GAP_BOUNDS = { maxGaps: 5, limit: 500, timeMs: 3e4 };
|
|
26962
27108
|
var validateRepair = /* @__PURE__ */ __name((messenger, options) => {
|
|
@@ -27093,12 +27239,12 @@ var gapsService = /* @__PURE__ */ __name((deps) => {
|
|
|
27093
27239
|
return { plan, repair };
|
|
27094
27240
|
}, "gapsService");
|
|
27095
27241
|
|
|
27096
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
27242
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/services/attachments.js
|
|
27097
27243
|
import { createHash as createHash9 } from "node:crypto";
|
|
27098
27244
|
import { constants as constants2, mkdirSync as mkdirSync2 } from "node:fs";
|
|
27099
27245
|
import { lstat as lstat4, open as open6, readFile, stat as stat2 } from "node:fs/promises";
|
|
27100
27246
|
|
|
27101
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
27247
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/attachments/directory.js
|
|
27102
27248
|
import { lstat as lstat2, readdir as readdir2, realpath as realpath3 } from "node:fs/promises";
|
|
27103
27249
|
import { basename as basename4, join as join8, relative as relative2, sep as sep2 } from "node:path";
|
|
27104
27250
|
var MAX_FILES = 1e4;
|
|
@@ -27169,15 +27315,15 @@ var directoryPaths = /* @__PURE__ */ __name(async (store, chat, directory2, app,
|
|
|
27169
27315
|
return choices;
|
|
27170
27316
|
}, "directoryPaths");
|
|
27171
27317
|
|
|
27172
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
27318
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/attachments/documents.js
|
|
27173
27319
|
import { posix } from "node:path";
|
|
27174
27320
|
|
|
27175
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
27321
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/attachments/container.js
|
|
27176
27322
|
import { setImmediate as tick } from "node:timers/promises";
|
|
27177
27323
|
import { crc32 } from "node:zlib";
|
|
27178
27324
|
var import_xmldom = __toESM(require_lib(), 1);
|
|
27179
27325
|
|
|
27180
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
27326
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/attachments/encoding.js
|
|
27181
27327
|
var import_chardet = __toESM(require_lib2(), 1);
|
|
27182
27328
|
var import_iconv_lite = __toESM(require_lib3(), 1);
|
|
27183
27329
|
var SAMPLE = 65536;
|
|
@@ -27279,7 +27425,7 @@ var decodeXml = /* @__PURE__ */ __name((bytes2) => {
|
|
|
27279
27425
|
return result.text;
|
|
27280
27426
|
}, "decodeXml");
|
|
27281
27427
|
|
|
27282
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
27428
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/attachments/container.js
|
|
27283
27429
|
var MAX_PART = 10 * 1024 * 1024;
|
|
27284
27430
|
var MAX_ENTRIES = 1e3;
|
|
27285
27431
|
var decoder = new TextDecoder("utf-8", { fatal: true });
|
|
@@ -27358,8 +27504,8 @@ var readContainer = /* @__PURE__ */ __name(async (bytes2, signal) => {
|
|
|
27358
27504
|
const done2 = /* @__PURE__ */ new Set();
|
|
27359
27505
|
let expanded = 0;
|
|
27360
27506
|
const archive = new Unzip((file) => {
|
|
27361
|
-
const
|
|
27362
|
-
if (!
|
|
27507
|
+
const expected2 = entries.get(file.name);
|
|
27508
|
+
if (!expected2 || seen.has(file.name))
|
|
27363
27509
|
throw new Error("invalid_zip");
|
|
27364
27510
|
seen.add(file.name);
|
|
27365
27511
|
const keep2 = /\.(xml|rels|opf|xhtml|html)$/i.test(file.name) || file.name === "mimetype";
|
|
@@ -27377,7 +27523,7 @@ var readContainer = /* @__PURE__ */ __name(async (bytes2, signal) => {
|
|
|
27377
27523
|
if (keep2)
|
|
27378
27524
|
parts.push(data.slice());
|
|
27379
27525
|
if (final) {
|
|
27380
|
-
if (size2 !==
|
|
27526
|
+
if (size2 !== expected2.size || checksum !== expected2.crc)
|
|
27381
27527
|
throw new Error("invalid_zip");
|
|
27382
27528
|
done2.add(file.name);
|
|
27383
27529
|
if (keep2) {
|
|
@@ -27494,7 +27640,7 @@ var elements = /* @__PURE__ */ __name((node, name, namespace) => {
|
|
|
27494
27640
|
return found;
|
|
27495
27641
|
}, "elements");
|
|
27496
27642
|
|
|
27497
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
27643
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/attachments/sheets.js
|
|
27498
27644
|
var columnName = /* @__PURE__ */ __name((column) => {
|
|
27499
27645
|
let name = "";
|
|
27500
27646
|
for (let rest = column; rest > 0; rest = Math.floor((rest - 1) / 26))
|
|
@@ -27549,7 +27695,7 @@ var sheetText = /* @__PURE__ */ __name((sheets2, maxChars = MAX_TEXT_CHARS) => {
|
|
|
27549
27695
|
return { text: parts.join("").trim(), truncated: false };
|
|
27550
27696
|
}, "sheetText");
|
|
27551
27697
|
|
|
27552
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
27698
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/attachments/documents.js
|
|
27553
27699
|
var OFFICE = "urn:oasis:names:tc:opendocument:xmlns:office:1.0";
|
|
27554
27700
|
var TEXT = "urn:oasis:names:tc:opendocument:xmlns:text:1.0";
|
|
27555
27701
|
var TABLE = "urn:oasis:names:tc:opendocument:xmlns:table:1.0";
|
|
@@ -27885,21 +28031,21 @@ var readBook = /* @__PURE__ */ __name((archive, output) => {
|
|
|
27885
28031
|
const book = xmlPart(archive, path);
|
|
27886
28032
|
rootIs(book, "package", [OPF]);
|
|
27887
28033
|
const manifest = /* @__PURE__ */ new Map();
|
|
27888
|
-
for (const
|
|
27889
|
-
const id2 = required(attribute(
|
|
28034
|
+
for (const item2 of elements(book, "item", OPF)) {
|
|
28035
|
+
const id2 = required(attribute(item2, "id"));
|
|
27890
28036
|
if (manifest.has(id2))
|
|
27891
28037
|
throw new Error("duplicate_chapter");
|
|
27892
|
-
manifest.set(id2, { path: target(path, required(attribute(
|
|
28038
|
+
manifest.set(id2, { path: target(path, required(attribute(item2, "href"))), type: attribute(item2, "media-type") });
|
|
27893
28039
|
}
|
|
27894
28040
|
let number2 = 0;
|
|
27895
28041
|
const chapters = elements(book, "itemref", OPF);
|
|
27896
28042
|
if (!chapters.length)
|
|
27897
28043
|
throw new Error("missing_chapters");
|
|
27898
28044
|
for (const chapter of chapters) {
|
|
27899
|
-
const
|
|
27900
|
-
if (
|
|
28045
|
+
const item2 = manifest.get(required(attribute(chapter, "idref")));
|
|
28046
|
+
if (item2?.type !== "application/xhtml+xml")
|
|
27901
28047
|
throw new Error("unsupported_chapter");
|
|
27902
|
-
const document = xmlPart(archive,
|
|
28048
|
+
const document = xmlPart(archive, item2.path);
|
|
27903
28049
|
const bodies = elements(document, "body", XHTML);
|
|
27904
28050
|
if (bodies.length !== 1)
|
|
27905
28051
|
throw new Error("missing_chapter");
|
|
@@ -27949,10 +28095,10 @@ var readDocument = /* @__PURE__ */ __name(async (bytes2, kind, signal) => {
|
|
|
27949
28095
|
}
|
|
27950
28096
|
}, "readDocument");
|
|
27951
28097
|
|
|
27952
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
28098
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/attachments/extract.js
|
|
27953
28099
|
import { extname as extname3 } from "node:path";
|
|
27954
28100
|
|
|
27955
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
28101
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/readers/engine.js
|
|
27956
28102
|
import { readFileSync } from "node:fs";
|
|
27957
28103
|
import { dirname as dirname4, extname as extname2, join as join9 } from "node:path";
|
|
27958
28104
|
import { fileURLToPath } from "node:url";
|
|
@@ -28013,7 +28159,7 @@ var derived = /* @__PURE__ */ __name((bytes2, extractor, read) => {
|
|
|
28013
28159
|
}
|
|
28014
28160
|
}, "derived");
|
|
28015
28161
|
|
|
28016
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
28162
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/readers/image/index.js
|
|
28017
28163
|
var IMAGES = /* @__PURE__ */ new Set([".jpg", ".jpeg", ".png", ".webp", ".gif", ".heic", ".tif", ".tiff", ".bmp"]);
|
|
28018
28164
|
var image2 = {
|
|
28019
28165
|
id: "image",
|
|
@@ -28022,7 +28168,7 @@ var image2 = {
|
|
|
28022
28168
|
read: /* @__PURE__ */ __name(async () => ({ status: "needs-agent" }), "read")
|
|
28023
28169
|
};
|
|
28024
28170
|
|
|
28025
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
28171
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/readers/doc/index.js
|
|
28026
28172
|
var OLE = "\xD0\xCF\xE0\xA1\xB1\xE1";
|
|
28027
28173
|
var doc = {
|
|
28028
28174
|
id: "doc",
|
|
@@ -28034,7 +28180,7 @@ var doc = {
|
|
|
28034
28180
|
}), "read")
|
|
28035
28181
|
};
|
|
28036
28182
|
|
|
28037
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
28183
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/readers/docx/index.js
|
|
28038
28184
|
var DOCX = "application/vnd.openxmlformats-officedocument.wordprocessingml.document";
|
|
28039
28185
|
var docx = {
|
|
28040
28186
|
id: "docx",
|
|
@@ -28047,7 +28193,7 @@ var docx = {
|
|
|
28047
28193
|
}), "read")
|
|
28048
28194
|
};
|
|
28049
28195
|
|
|
28050
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
28196
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/attachments/markup.js
|
|
28051
28197
|
var import_iconv_lite2 = __toESM(require_lib3(), 1);
|
|
28052
28198
|
var RTF_SKIPPED = /* @__PURE__ */ new Set([
|
|
28053
28199
|
"fonttbl",
|
|
@@ -28223,7 +28369,7 @@ var htmlText = /* @__PURE__ */ __name((source) => {
|
|
|
28223
28369
|
}, "htmlText");
|
|
28224
28370
|
var safeChar = /* @__PURE__ */ __name((code, fallback) => code > 0 && code <= 1114111 ? String.fromCodePoint(code) : fallback, "safeChar");
|
|
28225
28371
|
|
|
28226
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
28372
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/readers/html/page.js
|
|
28227
28373
|
var clean = /* @__PURE__ */ __name((value) => typeof value === "string" ? value.replace(/\s+/g, " ").trim() : "", "clean");
|
|
28228
28374
|
var namesIn = /* @__PURE__ */ __name((value) => [value].flat().map((entry) => typeof entry === "string" ? clean(entry) : clean(entry?.name)).filter(Boolean).join(", "), "namesIn");
|
|
28229
28375
|
var jsonLdNodes = /* @__PURE__ */ __name((document) => {
|
|
@@ -28279,7 +28425,7 @@ var markdownSections = /* @__PURE__ */ __name((text2) => {
|
|
|
28279
28425
|
return found.map((section, index) => ({ ...section, end: found[index + 1]?.start ?? text2.length }));
|
|
28280
28426
|
}, "markdownSections");
|
|
28281
28427
|
|
|
28282
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
28428
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/readers/html/index.js
|
|
28283
28429
|
var HTML = /* @__PURE__ */ new Set([".html", ".htm", ".xhtml"]);
|
|
28284
28430
|
var first = /* @__PURE__ */ __name((...values) => values.find((value) => typeof value === "string" && value !== ""), "first");
|
|
28285
28431
|
var loaded = /* @__PURE__ */ __name(async (load, name) => {
|
|
@@ -28350,7 +28496,7 @@ var html = {
|
|
|
28350
28496
|
}, "read")
|
|
28351
28497
|
};
|
|
28352
28498
|
|
|
28353
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
28499
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/readers/office/index.js
|
|
28354
28500
|
var office = {
|
|
28355
28501
|
id: "office",
|
|
28356
28502
|
version: documentExtractor("odt"),
|
|
@@ -28361,7 +28507,7 @@ var office = {
|
|
|
28361
28507
|
}, "read")
|
|
28362
28508
|
};
|
|
28363
28509
|
|
|
28364
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
28510
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/readers/pdf/index.js
|
|
28365
28511
|
var pdf = {
|
|
28366
28512
|
id: "pdf",
|
|
28367
28513
|
version: "unpdf",
|
|
@@ -28428,7 +28574,7 @@ var pdf = {
|
|
|
28428
28574
|
}), "read")
|
|
28429
28575
|
};
|
|
28430
28576
|
|
|
28431
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
28577
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/readers/plain/index.js
|
|
28432
28578
|
var PLAIN = /* @__PURE__ */ new Set([".txt", ".md", ".markdown", ".csv", ".tsv", ".json", ".log"]);
|
|
28433
28579
|
var isPlain = /* @__PURE__ */ __name((hint) => PLAIN.has(extensionOf(hint)) || hint.mime?.startsWith("text/") || hint.mime === "application/json", "isPlain");
|
|
28434
28580
|
var readPlain = /* @__PURE__ */ __name((bytes2) => {
|
|
@@ -28448,7 +28594,7 @@ var plain = {
|
|
|
28448
28594
|
read: /* @__PURE__ */ __name(async (bytes2) => readPlain(bytes2), "read")
|
|
28449
28595
|
};
|
|
28450
28596
|
|
|
28451
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
28597
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/readers/rtf/index.js
|
|
28452
28598
|
var rtf = {
|
|
28453
28599
|
id: "rtf",
|
|
28454
28600
|
version: "v1",
|
|
@@ -28456,10 +28602,10 @@ var rtf = {
|
|
|
28456
28602
|
read: /* @__PURE__ */ __name(async (bytes2) => derived(bytes2, "rtf:v1", rtfText), "read")
|
|
28457
28603
|
};
|
|
28458
28604
|
|
|
28459
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
28605
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/readers/sheets/index.js
|
|
28460
28606
|
import { basename as basename5 } from "node:path";
|
|
28461
28607
|
|
|
28462
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
28608
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/attachments/csv-spans.js
|
|
28463
28609
|
var delimitedSpans = /* @__PURE__ */ __name((text2, delimiter, maxCells = 1e4) => {
|
|
28464
28610
|
const cells = [];
|
|
28465
28611
|
let row = 1, column = 1, start = 0, quoted = false, truncated = false;
|
|
@@ -28497,7 +28643,7 @@ var delimitedSpans = /* @__PURE__ */ __name((text2, delimiter, maxCells = 1e4) =
|
|
|
28497
28643
|
return { cells, truncated };
|
|
28498
28644
|
}, "delimitedSpans");
|
|
28499
28645
|
|
|
28500
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
28646
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/readers/sheets/index.js
|
|
28501
28647
|
var DELIMITED = {
|
|
28502
28648
|
".csv": ",",
|
|
28503
28649
|
".tsv": " ",
|
|
@@ -28536,7 +28682,7 @@ var sheets = {
|
|
|
28536
28682
|
}, "read")
|
|
28537
28683
|
};
|
|
28538
28684
|
|
|
28539
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
28685
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/readers/registry.js
|
|
28540
28686
|
var BUILT_INS2 = [office, pdf, docx, doc, rtf, html, sheets, plain, image2];
|
|
28541
28687
|
var HEAD_BYTES = 1024;
|
|
28542
28688
|
var readers = [...BUILT_INS2];
|
|
@@ -28546,7 +28692,7 @@ var readWithRegistry = /* @__PURE__ */ __name(async (bytes2, hint, context2) =>
|
|
|
28546
28692
|
return reader ? reader.read(bytes2, hint, context2) : { status: "unsupported" };
|
|
28547
28693
|
}, "readWithRegistry");
|
|
28548
28694
|
|
|
28549
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
28695
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/attachments/extract.js
|
|
28550
28696
|
var importEngine = /* @__PURE__ */ __name((name) => importFrom(new URL("attachments/extract.js", import.meta.resolve("@wirecat/cli-core")).href, name), "importEngine");
|
|
28551
28697
|
var extensionOf2 = /* @__PURE__ */ __name(({ name, path }) => extname3(name ?? path).toLowerCase(), "extensionOf");
|
|
28552
28698
|
var extractText = /* @__PURE__ */ __name(async (bytes2, hint, load, signal, env = process.env) => {
|
|
@@ -29625,7 +29771,7 @@ function imageSize(input) {
|
|
|
29625
29771
|
}
|
|
29626
29772
|
__name(imageSize, "imageSize");
|
|
29627
29773
|
|
|
29628
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
29774
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/attachments/ocr.js
|
|
29629
29775
|
var MAX_PAGES = 20;
|
|
29630
29776
|
var MAX_PIXELS = 2e7;
|
|
29631
29777
|
var cancelled2 = /* @__PURE__ */ __name((signal) => {
|
|
@@ -29709,7 +29855,7 @@ var ocrPdf = /* @__PURE__ */ __name(async (bytes2, pipeline2, load, signal) => {
|
|
|
29709
29855
|
let text2;
|
|
29710
29856
|
try {
|
|
29711
29857
|
const content = await page.getTextContent();
|
|
29712
|
-
text2 = content.items.map((
|
|
29858
|
+
text2 = content.items.map((item2) => `${item2.str ?? ""}${item2.hasEOL ? "\n" : " "}`).join("").trim();
|
|
29713
29859
|
if (!text2) {
|
|
29714
29860
|
if (typeof unpdf.createIsomorphicCanvasFactory !== "function" || typeof unpdf.renderPageAsImage !== "function")
|
|
29715
29861
|
return { status: "engine-missing", engine: "unpdf" };
|
|
@@ -29776,7 +29922,7 @@ var ocrPdf = /* @__PURE__ */ __name(async (bytes2, pipeline2, load, signal) => {
|
|
|
29776
29922
|
}
|
|
29777
29923
|
}, "ocrPdf");
|
|
29778
29924
|
|
|
29779
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
29925
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/attachments/pdf-preview.js
|
|
29780
29926
|
var pdfPreview = /* @__PURE__ */ __name(async (bytes2, page, signal, load = importEngine, env = process.env) => {
|
|
29781
29927
|
const limits = pdfPreviewLimits(env);
|
|
29782
29928
|
const cancelled4 = /* @__PURE__ */ __name(() => {
|
|
@@ -29853,7 +29999,7 @@ var pdfPreview = /* @__PURE__ */ __name(async (bytes2, page, signal, load = impo
|
|
|
29853
29999
|
}
|
|
29854
30000
|
}, "pdfPreview");
|
|
29855
30001
|
|
|
29856
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
30002
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/attachments/transfer.js
|
|
29857
30003
|
import { createHash as createHash8 } from "node:crypto";
|
|
29858
30004
|
import { constants } from "node:fs";
|
|
29859
30005
|
import { lstat as lstat3, open as open5 } from "node:fs/promises";
|
|
@@ -29961,7 +30107,7 @@ var transferMime = /* @__PURE__ */ __name((head, hint, name = null) => {
|
|
|
29961
30107
|
return hint !== null && /^[a-z0-9.+-]+\/[a-z0-9.+-]+$/i.test(hint) ? hint : "application/octet-stream";
|
|
29962
30108
|
}, "transferMime");
|
|
29963
30109
|
|
|
29964
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
30110
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/services/file-download.js
|
|
29965
30111
|
import { createWriteStream, mkdirSync } from "node:fs";
|
|
29966
30112
|
import { link as link3, rm } from "node:fs/promises";
|
|
29967
30113
|
import { join as join10, resolve as resolve6 } from "node:path";
|
|
@@ -30075,7 +30221,7 @@ var save = /* @__PURE__ */ __name(async (file, directory2, fallbackName, { uniqu
|
|
|
30075
30221
|
}
|
|
30076
30222
|
}, "save");
|
|
30077
30223
|
|
|
30078
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
30224
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/services/attachments.js
|
|
30079
30225
|
var ATTACHMENT_QUERY = {
|
|
30080
30226
|
entity: "attachment",
|
|
30081
30227
|
backend: "sql",
|
|
@@ -30271,7 +30417,7 @@ var attachmentsService = /* @__PURE__ */ __name((deps) => ({
|
|
|
30271
30417
|
issue = batch.fail(formatLocator({ ...account, chat: file.chatId, message: file.messageId }), "extract", limitIssue ?? (extraction?.status === "unreadable" && extraction.issue ? extraction.issue : new CliError(status === "missing" ? "not_found" : "validation_error", status === "too-large" ? "attachment exceeds an extraction, decompression or OCR size limit" : extraction?.status === "engine-missing" ? `attachment engine-missing; ${engineMissing(extraction.engine)}; \`doctor\` lists the readers` : `attachment ${status}; retry or skip this item`, { limit_source: ocr ? "provider" : "local" })), file.position + 1);
|
|
30272
30418
|
} else
|
|
30273
30419
|
batch.ok();
|
|
30274
|
-
const
|
|
30420
|
+
const item2 = {
|
|
30275
30421
|
ref: formatLocator({ ...account, chat: file.chatId, message: file.messageId }),
|
|
30276
30422
|
attachment: file.position + 1,
|
|
30277
30423
|
kind: file.kind,
|
|
@@ -30286,13 +30432,13 @@ var attachmentsService = /* @__PURE__ */ __name((deps) => ({
|
|
|
30286
30432
|
...extraction.pages === void 0 ? {} : { pages: extraction.pages, ocrPages: extraction.ocrPages }
|
|
30287
30433
|
} : {}
|
|
30288
30434
|
};
|
|
30289
|
-
finished.set(file.pk,
|
|
30290
|
-
onItem?.(
|
|
30435
|
+
finished.set(file.pk, item2);
|
|
30436
|
+
onItem?.(item2);
|
|
30291
30437
|
}, "processFile");
|
|
30292
30438
|
const failedItem = /* @__PURE__ */ __name((file, stage, error) => {
|
|
30293
30439
|
const issue = batch.fail(formatLocator({ ...account, chat: file.chatId, message: file.messageId }), stage, error, file.position + 1);
|
|
30294
30440
|
run.failed += 1;
|
|
30295
|
-
const
|
|
30441
|
+
const item2 = {
|
|
30296
30442
|
ref: formatLocator({ ...account, chat: file.chatId, message: file.messageId }),
|
|
30297
30443
|
attachment: file.position + 1,
|
|
30298
30444
|
kind: file.kind,
|
|
@@ -30301,8 +30447,8 @@ var attachmentsService = /* @__PURE__ */ __name((deps) => ({
|
|
|
30301
30447
|
error: issue.code,
|
|
30302
30448
|
issue
|
|
30303
30449
|
};
|
|
30304
|
-
finished.set(file.pk,
|
|
30305
|
-
onItem?.(
|
|
30450
|
+
finished.set(file.pk, item2);
|
|
30451
|
+
onItem?.(item2);
|
|
30306
30452
|
}, "failedItem");
|
|
30307
30453
|
try {
|
|
30308
30454
|
walk: for (; ; ) {
|
|
@@ -30362,7 +30508,7 @@ var attachmentsService = /* @__PURE__ */ __name((deps) => ({
|
|
|
30362
30508
|
run.batch = batch.result();
|
|
30363
30509
|
run.complete = false;
|
|
30364
30510
|
}
|
|
30365
|
-
run.items = [...finished.entries()].sort(([a], [b]) => b - a).map(([,
|
|
30511
|
+
run.items = [...finished.entries()].sort(([a], [b]) => b - a).map(([, item2]) => item2);
|
|
30366
30512
|
return run;
|
|
30367
30513
|
}, "extract"),
|
|
30368
30514
|
list: /* @__PURE__ */ __name(async ({ limit, offset = 0, query }) => {
|
|
@@ -30498,7 +30644,7 @@ var attachmentsService = /* @__PURE__ */ __name((deps) => ({
|
|
|
30498
30644
|
}, "setText")
|
|
30499
30645
|
}), "attachmentsService");
|
|
30500
30646
|
|
|
30501
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
30647
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/services/chat-documents.js
|
|
30502
30648
|
var chatDocumentsService = /* @__PURE__ */ __name((deps) => ({
|
|
30503
30649
|
list: /* @__PURE__ */ __name(async (chat, { limit, offset, ref }) => {
|
|
30504
30650
|
const store = await accountStore(deps);
|
|
@@ -30528,7 +30674,7 @@ var chatDocumentsService = /* @__PURE__ */ __name((deps) => ({
|
|
|
30528
30674
|
}, "list")
|
|
30529
30675
|
}), "chatDocumentsService");
|
|
30530
30676
|
|
|
30531
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
30677
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/services/retention.js
|
|
30532
30678
|
var observationDuration = /* @__PURE__ */ __name((text2, flag) => {
|
|
30533
30679
|
const match = /^(\d+(?:\.\d+)?)([smhdw])$/.exec(text2);
|
|
30534
30680
|
const units2 = { s: 1e3, m: 6e4, h: 36e5, d: 864e5, w: 6048e5 };
|
|
@@ -30562,14 +30708,14 @@ var retentionService = /* @__PURE__ */ __name((deps) => ({
|
|
|
30562
30708
|
const result = await store.roster.retention(account, chatId, options);
|
|
30563
30709
|
return {
|
|
30564
30710
|
...result,
|
|
30565
|
-
items: result.items.map((
|
|
30566
|
-
...
|
|
30711
|
+
items: result.items.map((item2) => ({
|
|
30712
|
+
...item2,
|
|
30567
30713
|
drilldown: {
|
|
30568
30714
|
command: "stats messages evidence",
|
|
30569
30715
|
arguments: {
|
|
30570
|
-
message:
|
|
30716
|
+
message: item2.cohort,
|
|
30571
30717
|
component: "report",
|
|
30572
|
-
selection: { kind: "retention", version: 1, account, chatId, cohort:
|
|
30718
|
+
selection: { kind: "retention", version: 1, account, chatId, cohort: item2.cohort, options }
|
|
30573
30719
|
}
|
|
30574
30720
|
}
|
|
30575
30721
|
})),
|
|
@@ -30615,7 +30761,7 @@ var isRetentionSelection = /* @__PURE__ */ __name((selection) => {
|
|
|
30615
30761
|
}
|
|
30616
30762
|
}, "isRetentionSelection");
|
|
30617
30763
|
|
|
30618
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
30764
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/services/counters.js
|
|
30619
30765
|
var counterFields = /* @__PURE__ */ __name((text2 = "views,reactions,comments") => {
|
|
30620
30766
|
const fields = text2.split(",").map((one) => one.trim());
|
|
30621
30767
|
if (!fields.length || fields.some((one) => !COUNTER_FIELDS.includes(one)) || new Set(fields).size !== fields.length)
|
|
@@ -30678,7 +30824,7 @@ var countersService = /* @__PURE__ */ __name((deps) => {
|
|
|
30678
30824
|
fields,
|
|
30679
30825
|
now,
|
|
30680
30826
|
maxAge,
|
|
30681
|
-
items: items.map((
|
|
30827
|
+
items: items.map((item2) => ({ ...item2, counters: item2.counters.filter((one) => fields.includes(one.counter)) })),
|
|
30682
30828
|
hasMore
|
|
30683
30829
|
};
|
|
30684
30830
|
}, "select");
|
|
@@ -30822,7 +30968,7 @@ var countersService = /* @__PURE__ */ __name((deps) => {
|
|
|
30822
30968
|
};
|
|
30823
30969
|
}, "countersService");
|
|
30824
30970
|
|
|
30825
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
30971
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/services/search-refresh.js
|
|
30826
30972
|
var SYNC_KEY = "messages.sync-first";
|
|
30827
30973
|
var SYNC_BOUNDS = { maxChats: 5, timeMs: 3e4, maxMessages: 500 };
|
|
30828
30974
|
var keyOf2 = /* @__PURE__ */ __name((chat) => JSON.stringify([chat.account.provider, chat.account.account, chat.chatId]), "keyOf");
|
|
@@ -30954,7 +31100,7 @@ var withRefresh = /* @__PURE__ */ __name((found, refreshed) => ({
|
|
|
30954
31100
|
...!refreshed || refreshed.complete ? {} : { coverage: { ...found.coverage, state: "stale" } }
|
|
30955
31101
|
}), "withRefresh");
|
|
30956
31102
|
|
|
30957
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
31103
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/services/embeddings-search.js
|
|
30958
31104
|
var CANDIDATES = 50;
|
|
30959
31105
|
var WORD_HITS = 200;
|
|
30960
31106
|
var RRF_K = 60;
|
|
@@ -31072,7 +31218,7 @@ var embeddingsSearch = /* @__PURE__ */ __name((deps) => {
|
|
|
31072
31218
|
}, deps.messenger);
|
|
31073
31219
|
const eligibility = filter === void 0 ? void 0 : await store.queries.conversationEligibility(prepared.execution);
|
|
31074
31220
|
const selected = prepared.selectedChat;
|
|
31075
|
-
const
|
|
31221
|
+
const scopeOf4 = /* @__PURE__ */ __name((one) => selected ? selected.account.provider === one.provider && selected.account.account === one.account ? { chatId: selected.chatId } : null : {}, "scopeOf");
|
|
31076
31222
|
const words3 = await byWords(query, prepared, eligibility?.conversations, since);
|
|
31077
31223
|
const meaning = [];
|
|
31078
31224
|
const sources = words3.sources;
|
|
@@ -31080,7 +31226,7 @@ var embeddingsSearch = /* @__PURE__ */ __name((deps) => {
|
|
|
31080
31226
|
await withEmbedder(deps, target2, choice, {}, async (embedder) => {
|
|
31081
31227
|
const [vector] = await embedder.embed([query], "query");
|
|
31082
31228
|
for (const one of prepared.scopeAccounts) {
|
|
31083
|
-
const scope =
|
|
31229
|
+
const scope = scopeOf4(one);
|
|
31084
31230
|
if (scope === null)
|
|
31085
31231
|
continue;
|
|
31086
31232
|
const hits = await store.vectors.nearestConversations(one, {
|
|
@@ -31114,7 +31260,7 @@ var embeddingsSearch = /* @__PURE__ */ __name((deps) => {
|
|
|
31114
31260
|
const scoped = [];
|
|
31115
31261
|
const elsewhere = [];
|
|
31116
31262
|
for (const one of prepared.scopeAccounts) {
|
|
31117
|
-
const scope =
|
|
31263
|
+
const scope = scopeOf4(one);
|
|
31118
31264
|
if (scope === null)
|
|
31119
31265
|
continue;
|
|
31120
31266
|
const eligibleChats = eligibility?.chats.filter(({ account: account2 }) => account2.provider === one.provider && account2.account === one.account).map(({ chat: chat2 }) => chat2);
|
|
@@ -31220,22 +31366,22 @@ var searchReadiness = /* @__PURE__ */ __name((chats, meaning, outside) => {
|
|
|
31220
31366
|
};
|
|
31221
31367
|
}, "searchReadiness");
|
|
31222
31368
|
var meanOf = /* @__PURE__ */ __name((vectors) => {
|
|
31223
|
-
const
|
|
31369
|
+
const mean2 = new Float32Array(vectors[0]?.length ?? 0);
|
|
31224
31370
|
for (const vector of vectors) {
|
|
31225
|
-
for (let index = 0; index <
|
|
31226
|
-
|
|
31371
|
+
for (let index = 0; index < mean2.length; index++)
|
|
31372
|
+
mean2[index] = mean2[index] + vector[index];
|
|
31227
31373
|
}
|
|
31228
|
-
const length = Math.hypot(...
|
|
31229
|
-
return
|
|
31374
|
+
const length = Math.hypot(...mean2) || 1;
|
|
31375
|
+
return mean2.map((value) => value / length);
|
|
31230
31376
|
}, "meanOf");
|
|
31231
31377
|
|
|
31232
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
31378
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/services/embeddings.js
|
|
31233
31379
|
var embeddingsService = /* @__PURE__ */ __name((deps) => ({
|
|
31234
31380
|
...embeddingsMaintenance(deps),
|
|
31235
31381
|
...embeddingsSearch(deps)
|
|
31236
31382
|
}), "embeddingsService");
|
|
31237
31383
|
|
|
31238
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
31384
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/services/folders.js
|
|
31239
31385
|
var foldersService = /* @__PURE__ */ __name((deps) => {
|
|
31240
31386
|
const online = /* @__PURE__ */ __name(async (command) => {
|
|
31241
31387
|
if (deps.offline)
|
|
@@ -31376,7 +31522,7 @@ var foldersService = /* @__PURE__ */ __name((deps) => {
|
|
|
31376
31522
|
};
|
|
31377
31523
|
}, "foldersService");
|
|
31378
31524
|
|
|
31379
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
31525
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/services/mentions.js
|
|
31380
31526
|
var REVIEW_COUNT = 500;
|
|
31381
31527
|
var mentionsService = /* @__PURE__ */ __name((deps) => {
|
|
31382
31528
|
const located = /* @__PURE__ */ __name(async () => {
|
|
@@ -31455,7 +31601,7 @@ var mentionsService = /* @__PURE__ */ __name((deps) => {
|
|
|
31455
31601
|
};
|
|
31456
31602
|
}, "mentionsService");
|
|
31457
31603
|
|
|
31458
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
31604
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/domain/message-link.js
|
|
31459
31605
|
var fileLinks = /* @__PURE__ */ __name((attachments) => hitFiles(attachments).map(({ position, kind, name }) => ({
|
|
31460
31606
|
position,
|
|
31461
31607
|
kind,
|
|
@@ -31504,7 +31650,7 @@ var validatePermalink = /* @__PURE__ */ __name((link4) => {
|
|
|
31504
31650
|
return { url: link4.url, access: link4.access, reason: link4.reason };
|
|
31505
31651
|
}, "validatePermalink");
|
|
31506
31652
|
|
|
31507
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
31653
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/domain/pin-duration.js
|
|
31508
31654
|
var spokenSeconds = /* @__PURE__ */ __name((seconds) => {
|
|
31509
31655
|
if (seconds % 86400 === 0 && seconds > 86400)
|
|
31510
31656
|
return `${seconds / 86400}d`;
|
|
@@ -31536,7 +31682,7 @@ var pinDurationOf = /* @__PURE__ */ __name((value, allowed, flag = "--expire-tim
|
|
|
31536
31682
|
return seconds;
|
|
31537
31683
|
}, "pinDurationOf");
|
|
31538
31684
|
|
|
31539
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
31685
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/sends/send-as.js
|
|
31540
31686
|
var sendAsCheck = /* @__PURE__ */ __name((connection, sendAs) => {
|
|
31541
31687
|
if (sendAs === void 0) {
|
|
31542
31688
|
const saved = connection.savedSender?.bind(connection);
|
|
@@ -31561,7 +31707,7 @@ var typedSendAs = /* @__PURE__ */ __name((typed) => {
|
|
|
31561
31707
|
return sendAs;
|
|
31562
31708
|
}, "typedSendAs");
|
|
31563
31709
|
|
|
31564
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
31710
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/search/total.js
|
|
31565
31711
|
var TOTAL_CAP = 1e4;
|
|
31566
31712
|
var totalOf = /* @__PURE__ */ __name((count4, shown, hasMore, exact = true) => {
|
|
31567
31713
|
const least = shown + (hasMore ? 1 : 0);
|
|
@@ -31572,7 +31718,7 @@ var totalOf = /* @__PURE__ */ __name((count4, shown, hasMore, exact = true) => {
|
|
|
31572
31718
|
return { value: count4, relation: exact ? "eq" : "gte" };
|
|
31573
31719
|
}, "totalOf");
|
|
31574
31720
|
|
|
31575
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
31721
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/search/lucene/meaning-parts.js
|
|
31576
31722
|
var WORD_FIELDS = /* @__PURE__ */ new Set(["text", "exact"]);
|
|
31577
31723
|
var fieldsOfQuery = /* @__PURE__ */ __name((root, everything) => {
|
|
31578
31724
|
let narrows = false;
|
|
@@ -31601,7 +31747,7 @@ var meaningWords = /* @__PURE__ */ __name((root) => {
|
|
|
31601
31747
|
return wanted(root).join(" ").trim();
|
|
31602
31748
|
}, "meaningWords");
|
|
31603
31749
|
|
|
31604
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
31750
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/search/question-plan.js
|
|
31605
31751
|
var words2 = /* @__PURE__ */ __name((text2) => normalize(text2).match(/[\p{L}\p{N}]+/gu) ?? [], "words");
|
|
31606
31752
|
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"));
|
|
31607
31753
|
var questionWord = /\b(?:what|which|how|who|where|when|can|could|should)\b|(?:^|\s)(?:сколько|какой|какая|какие|какое|кто|кому|кем|где|когда|как|что|можно|может|могут|ли)(?:\s|$)/iu;
|
|
@@ -31715,8 +31861,25 @@ function planQuestion(text2, strict = false) {
|
|
|
31715
31861
|
return { changed: true, natural: true, queries, scope, terms, rankingTerms: original, removed, aliases: changes };
|
|
31716
31862
|
}
|
|
31717
31863
|
__name(planQuestion, "planQuestion");
|
|
31864
|
+
var questionText = /* @__PURE__ */ __name((text2) => text2.replace(new RegExp("(?<=\\p{L})\\?(?=\\s|$)", "gu"), "").replace(/"(?:[^"\\]|\\.)*"|(?<=\d):(?=\d)/gu, (found) => found === ":" ? " " : found), "questionText");
|
|
31865
|
+
var lookupTerms = /* @__PURE__ */ __name((plan) => [
|
|
31866
|
+
...new Set(plan.terms.concat(plan.aliases.flatMap((alias) => words2(alias.split(" -> ")[1] ?? ""))))
|
|
31867
|
+
], "lookupTerms");
|
|
31868
|
+
var anyOfTerms = /* @__PURE__ */ __name((terms, scope) => `(${terms.join(" OR ")})${scope ? ` ${scope}` : ""}`, "anyOfTerms");
|
|
31869
|
+
var questionLookup = /* @__PURE__ */ __name((text2) => {
|
|
31870
|
+
let plan;
|
|
31871
|
+
try {
|
|
31872
|
+
plan = planQuestion(questionText(text2));
|
|
31873
|
+
} catch (error) {
|
|
31874
|
+
if (error instanceof CliError)
|
|
31875
|
+
return void 0;
|
|
31876
|
+
throw error;
|
|
31877
|
+
}
|
|
31878
|
+
const terms = plan.changed ? lookupTerms(plan) : [];
|
|
31879
|
+
return terms.length ? anyOfTerms(terms, plan.scope) : void 0;
|
|
31880
|
+
}, "questionLookup");
|
|
31718
31881
|
|
|
31719
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
31882
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/services/messages-combined.js
|
|
31720
31883
|
var COMBINED_DEFAULTS = { candidateDepth: 300, rrfK: 60, rerank: "all", chatCap: 0 };
|
|
31721
31884
|
var tokensOf = /* @__PURE__ */ __name((text2) => normalize(text2).match(/[\p{L}\p{N}\p{Co}\p{M}]+/gu) ?? [], "tokensOf");
|
|
31722
31885
|
var searchCombined = /* @__PURE__ */ __name(async (store, account, request, messenger = {}, options = COMBINED_DEFAULTS) => {
|
|
@@ -31840,8 +32003,8 @@ var searchCombined = /* @__PURE__ */ __name(async (store, account, request, mess
|
|
|
31840
32003
|
return finish(listed2.map(({ fused: _fused, ...hit }) => hit), ordered.length > request.limit || truncated, usedCorrections, truncated, true);
|
|
31841
32004
|
async function finish(items, hasMore, listed3, truncated2, expanded) {
|
|
31842
32005
|
const { completeness, coverage: coverage2 } = request.kind === "mail" ? { completeness: [], coverage: void 0 } : await coverageOf(store, prepared, messenger);
|
|
31843
|
-
const hydrated = await Promise.all(items.map(async (
|
|
31844
|
-
const hit = withExcerpt(
|
|
32006
|
+
const hydrated = await Promise.all(items.map(async (item2) => {
|
|
32007
|
+
const hit = withExcerpt(item2, request.text ?? "");
|
|
31845
32008
|
if (!request.context)
|
|
31846
32009
|
return hit;
|
|
31847
32010
|
const { provider, account: account2 } = parseLocator(hit.locator);
|
|
@@ -31909,7 +32072,7 @@ var signals = /* @__PURE__ */ __name((hit, terms, corrections, execution, mode,
|
|
|
31909
32072
|
return mode === "coverage" ? coverage2 * 4 : mode === "proximity" ? proximity : mode === "phrase" ? phrase : coverage2 * 4 + proximity + phrase;
|
|
31910
32073
|
}, "signals");
|
|
31911
32074
|
|
|
31912
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
32075
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/services/messages-discovery.js
|
|
31913
32076
|
var MEANING_DEPTH = 100;
|
|
31914
32077
|
var RRF_K2 = 60;
|
|
31915
32078
|
var RERANK_DEPTH = 50;
|
|
@@ -31931,10 +32094,7 @@ var EVERY_MESSAGE = {
|
|
|
31931
32094
|
upper_inclusive: true
|
|
31932
32095
|
};
|
|
31933
32096
|
var scopeOf2 = /* @__PURE__ */ __name((root) => root === void 0 ? {} : { ast: { version: 1, language: "lucene-v1", root } }, "scopeOf");
|
|
31934
|
-
var discoveryRequest = /* @__PURE__ */ __name((asked) => asked.ast !== void 0 || asked.exact || !asked.text ? asked : {
|
|
31935
|
-
...asked,
|
|
31936
|
-
text: asked.text.replace(new RegExp("(?<=\\p{L})\\?(?=\\s|$)", "gu"), "").replace(/"(?:[^"\\]|\\.)*"|(?<=\d):(?=\d)/gu, (found) => found === ":" ? " " : found)
|
|
31937
|
-
}, "discoveryRequest");
|
|
32097
|
+
var discoveryRequest = /* @__PURE__ */ __name((asked) => asked.ast !== void 0 || asked.exact || !asked.text ? asked : { ...asked, text: questionText(asked.text) }, "discoveryRequest");
|
|
31938
32098
|
var searchDiscovery = /* @__PURE__ */ __name(async (store, account, asked, messenger = {}, meaning, rerank) => {
|
|
31939
32099
|
const request = discoveryRequest(asked);
|
|
31940
32100
|
const original = await prepareLucene(store, account, request, messenger);
|
|
@@ -31948,7 +32108,7 @@ var searchDiscovery = /* @__PURE__ */ __name(async (store, account, asked, messe
|
|
|
31948
32108
|
const question = root === void 0 ? text2 : meaningWords(root);
|
|
31949
32109
|
if (!question)
|
|
31950
32110
|
return searchLucene(store, account, request, messenger);
|
|
31951
|
-
const terms = root === void 0 ?
|
|
32111
|
+
const terms = root === void 0 ? lookupTerms(plan) : [...new Set(words2(question))];
|
|
31952
32112
|
if (!terms.length)
|
|
31953
32113
|
return searchLucene(store, account, request, messenger);
|
|
31954
32114
|
if (terms.length > 64)
|
|
@@ -31985,7 +32145,7 @@ var searchDiscovery = /* @__PURE__ */ __name(async (store, account, asked, messe
|
|
|
31985
32145
|
truncated ||= found.hasMore || found.query.combined.truncated;
|
|
31986
32146
|
}
|
|
31987
32147
|
check2();
|
|
31988
|
-
const relaxed = root === void 0 ?
|
|
32148
|
+
const relaxed = root === void 0 ? anyOfTerms(terms, plan.scope) : text2;
|
|
31989
32149
|
const partialRequest = { ...request, text: relaxed, ast: void 0, limit: 300, context: 0, thread: void 0 };
|
|
31990
32150
|
const partial = await searchLucene(store, account, partialRequest, messenger);
|
|
31991
32151
|
add(partial.items);
|
|
@@ -32237,7 +32397,7 @@ var mixedWithReranker = /* @__PURE__ */ __name((head, scores) => {
|
|
|
32237
32397
|
})).sort((a, b) => b.mixed - a.mixed).map(({ hit }) => hit);
|
|
32238
32398
|
}, "mixedWithReranker");
|
|
32239
32399
|
|
|
32240
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
32400
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/services/thread-context.js
|
|
32241
32401
|
var THREAD_BOUNDS = { maxHops: 8, maxMessages: 50, maxBytes: 65536, withinMs: 864e5 };
|
|
32242
32402
|
var bytes = /* @__PURE__ */ __name((items, links) => Buffer.byteLength(JSON.stringify({ items, links }), "utf8"), "bytes");
|
|
32243
32403
|
var threadBounds = /* @__PURE__ */ __name((options = {}) => {
|
|
@@ -32307,8 +32467,8 @@ var readThreadContext = /* @__PURE__ */ __name(async (store, account, chat, mess
|
|
|
32307
32467
|
stopped("messages");
|
|
32308
32468
|
const neighbours = anchor ? await around(message, before2, after) : [];
|
|
32309
32469
|
const nearest = neighbours.sort((a, b) => Number(a.id !== message) - Number(b.id !== message) || Math.abs(Date.parse(a.timestamp) - Date.parse(anchor?.timestamp ?? "")) - Math.abs(Date.parse(b.timestamp) - Date.parse(anchor?.timestamp ?? "")));
|
|
32310
|
-
for (const
|
|
32311
|
-
if (
|
|
32470
|
+
for (const item2 of nearest) {
|
|
32471
|
+
if (item2.threadId !== anchor?.threadId) {
|
|
32312
32472
|
stopped("thread");
|
|
32313
32473
|
continue;
|
|
32314
32474
|
}
|
|
@@ -32316,15 +32476,15 @@ var readThreadContext = /* @__PURE__ */ __name(async (store, account, chat, mess
|
|
|
32316
32476
|
stopped("messages");
|
|
32317
32477
|
break;
|
|
32318
32478
|
}
|
|
32319
|
-
if (Math.abs(Date.parse(
|
|
32479
|
+
if (Math.abs(Date.parse(item2.timestamp) - Date.parse(anchor?.timestamp ?? "")) > bounds.withinMs) {
|
|
32320
32480
|
stopped("time");
|
|
32321
32481
|
continue;
|
|
32322
32482
|
}
|
|
32323
|
-
if (bytes([...result.items,
|
|
32483
|
+
if (bytes([...result.items, item2], []) > bounds.maxBytes) {
|
|
32324
32484
|
stopped("bytes");
|
|
32325
32485
|
break;
|
|
32326
32486
|
}
|
|
32327
|
-
result.items.push(
|
|
32487
|
+
result.items.push(item2);
|
|
32328
32488
|
}
|
|
32329
32489
|
result.items.sort((a, b) => a.timestamp.localeCompare(b.timestamp) || a.id.localeCompare(b.id));
|
|
32330
32490
|
return result;
|
|
@@ -32354,16 +32514,16 @@ var readThreadContext = /* @__PURE__ */ __name(async (store, account, chat, mess
|
|
|
32354
32514
|
break;
|
|
32355
32515
|
}
|
|
32356
32516
|
const node = queue[index];
|
|
32357
|
-
const [
|
|
32358
|
-
if (!
|
|
32517
|
+
const [item2] = node.id === message ? [anchor] : await around(node.id);
|
|
32518
|
+
if (!item2) {
|
|
32359
32519
|
result.stale = true;
|
|
32360
32520
|
continue;
|
|
32361
32521
|
}
|
|
32362
|
-
if (Math.abs(Date.parse(
|
|
32522
|
+
if (Math.abs(Date.parse(item2.timestamp) - at) > bounds.withinMs) {
|
|
32363
32523
|
stopped("time");
|
|
32364
32524
|
continue;
|
|
32365
32525
|
}
|
|
32366
|
-
if (
|
|
32526
|
+
if (item2.threadId !== anchor.threadId) {
|
|
32367
32527
|
stopped("thread");
|
|
32368
32528
|
continue;
|
|
32369
32529
|
}
|
|
@@ -32371,7 +32531,7 @@ var readThreadContext = /* @__PURE__ */ __name(async (store, account, chat, mess
|
|
|
32371
32531
|
stopped("messages");
|
|
32372
32532
|
break;
|
|
32373
32533
|
}
|
|
32374
|
-
const { anchor: _anchor, ...body } =
|
|
32534
|
+
const { anchor: _anchor, ...body } = item2;
|
|
32375
32535
|
const displayed2 = node.id === message ? { ...body, anchor: true } : body;
|
|
32376
32536
|
const own = await linksOf(node.id);
|
|
32377
32537
|
const parent = chosen(own);
|
|
@@ -32436,7 +32596,7 @@ var readThreadContext = /* @__PURE__ */ __name(async (store, account, chat, mess
|
|
|
32436
32596
|
return result;
|
|
32437
32597
|
}, "readThreadContext");
|
|
32438
32598
|
|
|
32439
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
32599
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/services/messages-archive-search.js
|
|
32440
32600
|
var SEARCH_FILL_MS = 200;
|
|
32441
32601
|
var statsStore = /* @__PURE__ */ __name(async (store, account, request, messenger = {}) => {
|
|
32442
32602
|
const stop = Date.now() + SEARCH_FILL_MS;
|
|
@@ -32503,12 +32663,12 @@ var accountOf2 = /* @__PURE__ */ __name((hit) => {
|
|
|
32503
32663
|
}, "accountOf");
|
|
32504
32664
|
var keyOf3 = /* @__PURE__ */ __name(({ provider, account }) => `${provider}/${account}`, "keyOf");
|
|
32505
32665
|
|
|
32506
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
32666
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/services/pictures.js
|
|
32507
32667
|
import { createHash as createHash10 } from "node:crypto";
|
|
32508
32668
|
import { readFile as readFile2, stat as stat3 } from "node:fs/promises";
|
|
32509
32669
|
import { setTimeout as sleep4 } from "node:timers/promises";
|
|
32510
32670
|
|
|
32511
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
32671
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/domain/models.js
|
|
32512
32672
|
var GROUP_SETTINGS = [
|
|
32513
32673
|
"allCanPin",
|
|
32514
32674
|
"onlyAdminsAdd",
|
|
@@ -32522,7 +32682,7 @@ var ADMIN_RIGHTS = ["read", "members", "admins", "info", "pin", "link", "post",
|
|
|
32522
32682
|
var senderIsMe = /* @__PURE__ */ __name((message, account) => message.outgoing === true || message.senderId !== null && String(message.senderId) === account, "senderIsMe");
|
|
32523
32683
|
var MEDIA_KINDS = ["photo", "video", "file", "audio", "link"];
|
|
32524
32684
|
|
|
32525
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
32685
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/services/pictures.js
|
|
32526
32686
|
var PICTURE_MAX_BYTES = 25 * 1024 * 1024;
|
|
32527
32687
|
var PICTURE_FLOOR = 0.25;
|
|
32528
32688
|
var PAGE4 = 50;
|
|
@@ -32539,7 +32699,7 @@ var picturesService = /* @__PURE__ */ __name((deps) => {
|
|
|
32539
32699
|
const directory2 = imageModelsDirectory(deps.env);
|
|
32540
32700
|
if (!isImageModelInstalled(model2, directory2))
|
|
32541
32701
|
throw new CliError("not_found", missingModel(model2.id), { reason: "model.not-downloaded", model: model2.id });
|
|
32542
|
-
const { openPictureEmbedder } = await import("./embedder-
|
|
32702
|
+
const { openPictureEmbedder } = await import("./embedder-QYDZRKBX.js");
|
|
32543
32703
|
return openPictureEmbedder(model2, directory2);
|
|
32544
32704
|
}, "open");
|
|
32545
32705
|
const embedder = /* @__PURE__ */ __name(() => {
|
|
@@ -32736,7 +32896,7 @@ var withPictures = /* @__PURE__ */ __name((messages, pictures) => ({
|
|
|
32736
32896
|
}, "search")
|
|
32737
32897
|
}), "withPictures");
|
|
32738
32898
|
|
|
32739
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
32899
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/services/messages-meaning.js
|
|
32740
32900
|
var meaningLane = /* @__PURE__ */ __name((deps) => async (question, accounts, shared, within) => {
|
|
32741
32901
|
const target2 = embeddingTarget(deps, DEFAULT_TEXT_MODEL);
|
|
32742
32902
|
const skipped = /* @__PURE__ */ __name((reason, step) => ({
|
|
@@ -32747,9 +32907,16 @@ var meaningLane = /* @__PURE__ */ __name((deps) => async (question, accounts, sh
|
|
|
32747
32907
|
const store = await deps.store();
|
|
32748
32908
|
const ready = [];
|
|
32749
32909
|
const without = [];
|
|
32750
|
-
|
|
32751
|
-
|
|
32752
|
-
|
|
32910
|
+
const mail = /* @__PURE__ */ new Map();
|
|
32911
|
+
const stored = await store.accounts.storedAccounts();
|
|
32912
|
+
for (const one of accounts) {
|
|
32913
|
+
const id2 = one.provider === "email" ? stored.find(({ provider, account }) => provider === one.provider && account === one.account)?.id : void 0;
|
|
32914
|
+
if (id2 !== void 0)
|
|
32915
|
+
mail.set(one, Number(id2));
|
|
32916
|
+
else
|
|
32917
|
+
(await store.vectors.hasMessageVectors(one, target2.key) ? ready : without).push(one);
|
|
32918
|
+
}
|
|
32919
|
+
if (ready.length === 0 && mail.size === 0)
|
|
32753
32920
|
return skipped("no message has a vector yet", "conversations.rebuild");
|
|
32754
32921
|
const words3 = plainWords(question);
|
|
32755
32922
|
try {
|
|
@@ -32767,12 +32934,24 @@ var meaningLane = /* @__PURE__ */ __name((deps) => async (question, accounts, sh
|
|
|
32767
32934
|
for (const { chatId, messageId, score } of near2)
|
|
32768
32935
|
ranked.push({ ...one, chatId, id: messageId, score });
|
|
32769
32936
|
}
|
|
32937
|
+
for (const [one, accountId] of mail) {
|
|
32938
|
+
const near2 = await store.mail.nearest(target2.key, query, {
|
|
32939
|
+
accountId,
|
|
32940
|
+
limit: MEANING_DEPTH
|
|
32941
|
+
});
|
|
32942
|
+
if (near2.length === 0)
|
|
32943
|
+
without.push(one);
|
|
32944
|
+
for (const { threadExternalId, externalId, score } of near2)
|
|
32945
|
+
ranked.push({ ...one, chatId: threadExternalId, id: externalId, score });
|
|
32946
|
+
}
|
|
32770
32947
|
}, "lookUp");
|
|
32771
32948
|
if (shared && !deps.embedders)
|
|
32772
32949
|
await lookUp(await shared.get(target2.key, () => target2.open()));
|
|
32773
32950
|
else
|
|
32774
32951
|
await withEmbedder(deps, target2, DEFAULT_TEXT_MODEL, {}, lookUp);
|
|
32775
32952
|
}
|
|
32953
|
+
if (ranked.length === 0 && without.length === accounts.length)
|
|
32954
|
+
return skipped("no message has a vector yet", "conversations.rebuild");
|
|
32776
32955
|
return {
|
|
32777
32956
|
model: target2.id,
|
|
32778
32957
|
ranked: ranked.sort((a, b) => b.score - a.score).slice(0, MEANING_DEPTH),
|
|
@@ -32785,7 +32964,7 @@ var meaningLane = /* @__PURE__ */ __name((deps) => async (question, accounts, sh
|
|
|
32785
32964
|
}
|
|
32786
32965
|
}, "meaningLane");
|
|
32787
32966
|
|
|
32788
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
32967
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/services/messages-rerank.js
|
|
32789
32968
|
var rerankLane = /* @__PURE__ */ __name((deps) => {
|
|
32790
32969
|
const choice = deps.reranker ?? DEFAULT_RERANK_MODEL;
|
|
32791
32970
|
if (choice === "off")
|
|
@@ -32797,9 +32976,9 @@ var rerankLane = /* @__PURE__ */ __name((deps) => {
|
|
|
32797
32976
|
return { skipped: { reason: `${model.id} is not downloaded`, step: "models.download", model: model.id } };
|
|
32798
32977
|
try {
|
|
32799
32978
|
const warm = deps.embedders;
|
|
32800
|
-
const reranker = warm ? await warm.reranker(`rerank:${model.id}`, async () => (await import("./process-
|
|
32979
|
+
const reranker = warm ? await warm.reranker(`rerank:${model.id}`, async () => (await import("./process-SWPJGPQC.js")).openRerankerProcess(model, directory2, {
|
|
32801
32980
|
threads: defaultThreads()
|
|
32802
|
-
})) : await (await import("./rerank-
|
|
32981
|
+
})) : await (await import("./rerank-XNAMC6FH.js")).openReranker(model, directory2);
|
|
32803
32982
|
return {
|
|
32804
32983
|
model: model.id,
|
|
32805
32984
|
score: /* @__PURE__ */ __name((question, passages) => reranker.score(plainWords(question), passages), "score"),
|
|
@@ -32819,17 +32998,17 @@ var rerankLane = /* @__PURE__ */ __name((deps) => {
|
|
|
32819
32998
|
};
|
|
32820
32999
|
}, "rerankLane");
|
|
32821
33000
|
|
|
32822
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
33001
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/services/document-pictures.js
|
|
32823
33002
|
var openPictureEmbedderFor = /* @__PURE__ */ __name(async ({ env, command } = {}) => {
|
|
32824
33003
|
const model = imageModel(DEFAULT_IMAGE_MODEL);
|
|
32825
33004
|
const directory2 = imageModelsDirectory(env);
|
|
32826
33005
|
if (!isImageModelInstalled(model, directory2))
|
|
32827
33006
|
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 });
|
|
32828
|
-
const { openPictureEmbedder } = await import("./embedder-
|
|
33007
|
+
const { openPictureEmbedder } = await import("./embedder-QYDZRKBX.js");
|
|
32829
33008
|
return openPictureEmbedder(model, directory2);
|
|
32830
33009
|
}, "openPictureEmbedderFor");
|
|
32831
33010
|
|
|
32832
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
33011
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/services/document-source.js
|
|
32833
33012
|
var documentSource = /* @__PURE__ */ __name((note, accounts, profiles, file) => {
|
|
32834
33013
|
const metadata = note.frontMatter;
|
|
32835
33014
|
const account = accounts.find(({ id: id2 }) => String(id2) === note.folderId);
|
|
@@ -32844,7 +33023,7 @@ var documentSource = /* @__PURE__ */ __name((note, accounts, profiles, file) =>
|
|
|
32844
33023
|
};
|
|
32845
33024
|
}, "documentSource");
|
|
32846
33025
|
|
|
32847
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
33026
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/services/notes-title-tier.js
|
|
32848
33027
|
var plainQueryWords = /* @__PURE__ */ __name((query) => {
|
|
32849
33028
|
let root;
|
|
32850
33029
|
try {
|
|
@@ -32871,7 +33050,7 @@ var titleTiers = /* @__PURE__ */ __name((hits, words3) => {
|
|
|
32871
33050
|
return [...hits].sort((a, b) => rank(a) - rank(b));
|
|
32872
33051
|
}, "titleTiers");
|
|
32873
33052
|
|
|
32874
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
33053
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/services/notes-search.js
|
|
32875
33054
|
var storeQuery = /* @__PURE__ */ __name(async (store, text2, { exact, timezone } = {}) => resolvedQuery(store, parsedQuery(text2, exact), timezone), "storeQuery");
|
|
32876
33055
|
var parsedQuery = /* @__PURE__ */ __name((text2, exact) => validateFields(parseLucene(text2, { ...SEARCH_QUERY, defaultField: exact ? "exact" : "text" })).root, "parsedQuery");
|
|
32877
33056
|
var resolvedQuery = /* @__PURE__ */ __name(async (store, root, timezone) => {
|
|
@@ -33086,19 +33265,21 @@ var notesTotal = /* @__PURE__ */ __name(async (store, text2, { exact, scope, sho
|
|
|
33086
33265
|
const count4 = (/* @__PURE__ */ new Set([...words3.refs, ...others])).size + (words3.hasMore ? 1 : 0);
|
|
33087
33266
|
return totalOf(count4, shown, hasMore, othersComplete);
|
|
33088
33267
|
}, "notesTotal");
|
|
33089
|
-
var searchNotes = /* @__PURE__ */ __name(async (store, query, { limit = 20, offset = 0, tag, filter: expression, folderIds, withInternal, source: given, exact = false, timezone, env, command, embedders, pictures: withPictures2 = false, pictureLimit = 5, pictureEmbedder } = {}) => {
|
|
33268
|
+
var searchNotes = /* @__PURE__ */ __name(async (store, query, { limit = 20, offset = 0, tag, filter: expression, folderIds, withInternal, source: given, exact = false, discover = false, timezone, env, command, embedders, pictures: withPictures2 = false, pictureLimit = 5, pictureEmbedder } = {}) => {
|
|
33090
33269
|
const typed = noteSourceOfQuery(query);
|
|
33091
33270
|
const source = given ?? typed.source;
|
|
33092
33271
|
const rest = typed.source !== void 0 && typed.source === source ? typed.rest : query;
|
|
33093
33272
|
const label = tag === void 0 ? void 0 : normalizeTag(tag);
|
|
33094
33273
|
const filter = [expression ? `(${expression})` : "", label === void 0 ? "" : `tag:${label}`].filter(Boolean).join(" AND ") || void 0;
|
|
33095
|
-
const
|
|
33274
|
+
const lookup = discover && !exact ? questionLookup(query) : void 0;
|
|
33275
|
+
const parsed = query.trim() ? parsedQuery(lookup === void 0 ? query : questionText(query), exact) : void 0;
|
|
33096
33276
|
const words3 = parsed === void 0 ? "" : meaningWords(parsed);
|
|
33097
33277
|
const narrowing = allOf([
|
|
33098
33278
|
...parsed === void 0 ? [] : [fieldsOfQuery2(parsed)].filter((node) => node !== void 0),
|
|
33099
33279
|
...filter === void 0 ? [] : [parsedQuery(filter)]
|
|
33100
33280
|
]);
|
|
33101
|
-
const
|
|
33281
|
+
const asked = lookup ?? query;
|
|
33282
|
+
const text2 = [asked.trim() ? `(${asked})` : "", filter ?? ""].filter(Boolean).join(" AND ");
|
|
33102
33283
|
const window3 = offset + limit;
|
|
33103
33284
|
const scope = {
|
|
33104
33285
|
...folderIds === void 0 ? {} : { folderIds },
|
|
@@ -33108,6 +33289,7 @@ var searchNotes = /* @__PURE__ */ __name(async (store, query, { limit = 20, offs
|
|
|
33108
33289
|
};
|
|
33109
33290
|
let meaningSkipped;
|
|
33110
33291
|
let meaning;
|
|
33292
|
+
const cosines = /* @__PURE__ */ new Map();
|
|
33111
33293
|
let meaningRefs;
|
|
33112
33294
|
let meaningComplete = true;
|
|
33113
33295
|
if (exact)
|
|
@@ -33134,8 +33316,10 @@ var searchNotes = /* @__PURE__ */ __name(async (store, query, { limit = 20, offs
|
|
|
33134
33316
|
nearest = ranked2.slice(0, depth);
|
|
33135
33317
|
}
|
|
33136
33318
|
const allowed = await matching(store, nearest.map(({ ref }) => ref), narrowing, scope);
|
|
33137
|
-
meaning = nearest.flatMap(({ ref }) => {
|
|
33319
|
+
meaning = nearest.flatMap(({ ref, score }) => {
|
|
33138
33320
|
const found = allowed.get(ref);
|
|
33321
|
+
if (found)
|
|
33322
|
+
cosines.set(ref, score);
|
|
33139
33323
|
return found ? [{ ref, ...found }] : [];
|
|
33140
33324
|
});
|
|
33141
33325
|
meaningRefs ??= new Set(meaning.map(({ ref }) => ref));
|
|
@@ -33166,9 +33350,11 @@ var searchNotes = /* @__PURE__ */ __name(async (store, query, { limit = 20, offs
|
|
|
33166
33350
|
if (tierRefs.has(ref))
|
|
33167
33351
|
return;
|
|
33168
33352
|
const held = ranked.get(ref) ?? { note, at, score: 0, foundBy: [] };
|
|
33169
|
-
held.score += 1 / (RRF_K3 + rank + 1);
|
|
33170
33353
|
held.foundBy.push(by);
|
|
33171
33354
|
ranked.set(ref, held);
|
|
33355
|
+
if (by === "meaning" && lookup !== void 0 && held.foundBy.includes("words"))
|
|
33356
|
+
return;
|
|
33357
|
+
held.score += 1 / (RRF_K3 + rank + 1);
|
|
33172
33358
|
}), "add");
|
|
33173
33359
|
add(matched.items, "words");
|
|
33174
33360
|
if (meaning !== void 0)
|
|
@@ -33201,7 +33387,8 @@ var searchNotes = /* @__PURE__ */ __name(async (store, query, { limit = 20, offs
|
|
|
33201
33387
|
updated_at: at,
|
|
33202
33388
|
excerpt: firstLine(note.text, words3),
|
|
33203
33389
|
links,
|
|
33204
|
-
found_by: foundBy
|
|
33390
|
+
found_by: foundBy,
|
|
33391
|
+
...cosines.has(ref) ? { meaning_score: cosines.get(ref) } : {}
|
|
33205
33392
|
});
|
|
33206
33393
|
for (const link4 of new Map(links.map((link5) => [link5.to ?? `?${link5.target_text}`, link5])).values()) {
|
|
33207
33394
|
const key = link4.to ?? `?${link4.target_text}`;
|
|
@@ -33280,7 +33467,7 @@ var searchNotesOf = /* @__PURE__ */ __name(async (store, account, text2, { accou
|
|
|
33280
33467
|
};
|
|
33281
33468
|
}, "searchNotesOf");
|
|
33282
33469
|
|
|
33283
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
33470
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/services/events-search.js
|
|
33284
33471
|
var MAX_EVENTS_OFFSET = 1e3;
|
|
33285
33472
|
var iso3 = /* @__PURE__ */ __name((at) => at === null ? null : new Date(at).toISOString(), "iso");
|
|
33286
33473
|
var accountIdsOf = /* @__PURE__ */ __name(async (store, accounts) => {
|
|
@@ -33314,17 +33501,18 @@ var nearestEvents = /* @__PURE__ */ __name(async (store, words3, { limit, accoun
|
|
|
33314
33501
|
return (await store.calendar.nearest(key, vector, { limit, ...accountIds ? { accountIds } : {} })).filter(({ score }) => score > floor);
|
|
33315
33502
|
}, "nearestEvents");
|
|
33316
33503
|
var keyOf4 = /* @__PURE__ */ __name(({ event }) => event.eventSeriesId === null ? `e${event.id}` : `s${event.eventSeriesId}`, "keyOf");
|
|
33317
|
-
var searchEvents = /* @__PURE__ */ __name(async (store, query, { limit = 20, offset = 0, accounts, exact, newest, timezone, signal, candidates, env, command, embedders } = {}) => {
|
|
33504
|
+
var searchEvents = /* @__PURE__ */ __name(async (store, query, { limit = 20, offset = 0, accounts, exact, discover, newest, timezone, signal, candidates, env, command, embedders } = {}) => {
|
|
33318
33505
|
if (!query.trim())
|
|
33319
33506
|
throw new CliError("validation_error", "say what to find in the events");
|
|
33320
|
-
const
|
|
33507
|
+
const asked = discover && !exact && !newest ? questionLookup(query) : void 0;
|
|
33508
|
+
const { root, stemmer } = await storeQuery(store, asked ?? query, {
|
|
33321
33509
|
...exact ? { exact: true } : {},
|
|
33322
33510
|
...timezone === void 0 ? {} : { timezone }
|
|
33323
33511
|
});
|
|
33324
33512
|
const accountIds = accounts === void 0 ? void 0 : await accountIdsOf(store, accounts);
|
|
33325
33513
|
if (accountIds?.length === 0)
|
|
33326
33514
|
return { query, by: "words", hits: [], has_more: false };
|
|
33327
|
-
const words3 = plainQueryWords(query);
|
|
33515
|
+
const words3 = plainQueryWords(asked === void 0 ? query : questionText(query));
|
|
33328
33516
|
const window3 = offset + limit;
|
|
33329
33517
|
let meaningSkipped;
|
|
33330
33518
|
let meaning;
|
|
@@ -33380,19 +33568,23 @@ var searchEvents = /* @__PURE__ */ __name(async (store, query, { limit = 20, off
|
|
|
33380
33568
|
}), "add");
|
|
33381
33569
|
add(found.items, "words");
|
|
33382
33570
|
add(meaning, "meaning");
|
|
33571
|
+
const cosines = new Map(meaning.map((hit) => [keyOf4(hit), hit.score]));
|
|
33383
33572
|
const ordered = [...ranked.values()].sort((a, b) => b.score - a.score);
|
|
33384
33573
|
const hasMore = ordered.length > window3 || found.hasMore;
|
|
33385
33574
|
return {
|
|
33386
33575
|
query,
|
|
33387
33576
|
by,
|
|
33388
|
-
hits: ordered.slice(offset, window3).map(({ hit, by: halves }) =>
|
|
33577
|
+
hits: ordered.slice(offset, window3).map(({ hit, by: halves }) => {
|
|
33578
|
+
const cosine = cosines.get(keyOf4(hit));
|
|
33579
|
+
return { ...foundEvent(hit, query, halves), ...cosine === void 0 ? {} : { meaning_score: cosine } };
|
|
33580
|
+
}),
|
|
33389
33581
|
has_more: hasMore,
|
|
33390
33582
|
...hasMore && window3 <= MAX_EVENTS_OFFSET ? { next_offset: window3 } : {},
|
|
33391
33583
|
...truncated
|
|
33392
33584
|
};
|
|
33393
33585
|
}, "searchEvents");
|
|
33394
33586
|
|
|
33395
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
33587
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/services/search-all.js
|
|
33396
33588
|
var RESOURCES_SEARCHED = ["messages", "mail", "notes", "events"];
|
|
33397
33589
|
var skippable = /* @__PURE__ */ __name((error) => error instanceof CliError && (error.code === "validation_error" || error.code === "not_found"), "skippable");
|
|
33398
33590
|
var filtersBeside = /* @__PURE__ */ __name((text2) => {
|
|
@@ -33417,11 +33609,14 @@ var searchAll = /* @__PURE__ */ __name(async (store, account, request, messenger
|
|
|
33417
33609
|
let hasMore = false;
|
|
33418
33610
|
let notes;
|
|
33419
33611
|
let events;
|
|
33420
|
-
|
|
33612
|
+
const by = {};
|
|
33421
33613
|
let server;
|
|
33614
|
+
const discover = !request.exact && questionLookup(request.text) !== void 0;
|
|
33615
|
+
const cosines = /* @__PURE__ */ new Map();
|
|
33422
33616
|
let coverage2;
|
|
33423
33617
|
const messagesOf = /* @__PURE__ */ __name(async (kind) => {
|
|
33424
33618
|
const given = request.scope?.[kind];
|
|
33619
|
+
const discovers = discover && (kind === "mail" || request.backend !== "server");
|
|
33425
33620
|
const query = {
|
|
33426
33621
|
text: request.text,
|
|
33427
33622
|
kind,
|
|
@@ -33434,6 +33629,7 @@ var searchAll = /* @__PURE__ */ __name(async (store, account, request, messenger
|
|
|
33434
33629
|
} : {},
|
|
33435
33630
|
limit: window3,
|
|
33436
33631
|
...request.exact ? { exact: true } : {},
|
|
33632
|
+
...discovers ? { discover: true } : {},
|
|
33437
33633
|
...request.timezone === void 0 ? {} : { timezone: request.timezone },
|
|
33438
33634
|
...request.signal === void 0 ? {} : { signal: request.signal }
|
|
33439
33635
|
};
|
|
@@ -33466,7 +33662,7 @@ var searchAll = /* @__PURE__ */ __name(async (store, account, request, messenger
|
|
|
33466
33662
|
};
|
|
33467
33663
|
}, "itemOf");
|
|
33468
33664
|
const byWords = found.items.map((hit) => itemOf3(hit, ["words"]));
|
|
33469
|
-
if (
|
|
33665
|
+
if (!meaning || request.exact || kind === "messages" && request.backend === "server")
|
|
33470
33666
|
return byWords;
|
|
33471
33667
|
const filters = filtersBeside(request.text);
|
|
33472
33668
|
const lane = filters === void 0 ? {
|
|
@@ -33476,25 +33672,28 @@ var searchAll = /* @__PURE__ */ __name(async (store, account, request, messenger
|
|
|
33476
33672
|
}
|
|
33477
33673
|
} : await meaning(request.text, read, embedders);
|
|
33478
33674
|
if ("skipped" in lane) {
|
|
33479
|
-
|
|
33675
|
+
by[kind] = { by: "words", meaningSkipped: lane.skipped };
|
|
33480
33676
|
return byWords;
|
|
33481
33677
|
}
|
|
33482
|
-
|
|
33678
|
+
by[kind] = { by: "words and meaning", ...lane.partly ? { meaningSkipped: lane.partly } : {} };
|
|
33483
33679
|
const near2 = await nearEligible(store, account, query, messenger, lane.ranked, filters ? { text: filters } : {});
|
|
33484
33680
|
const fused2 = /* @__PURE__ */ new Map();
|
|
33485
|
-
byWords.forEach((
|
|
33486
|
-
fused2.set(
|
|
33681
|
+
byWords.forEach((item2, rank) => {
|
|
33682
|
+
fused2.set(item2.ref, { item: item2, score: 1 / (RRF_K3 + rank + 1) });
|
|
33487
33683
|
});
|
|
33488
33684
|
near2.forEach((hit, rank) => {
|
|
33685
|
+
cosines.set(hit.locator, hit.cosine);
|
|
33489
33686
|
const held = fused2.get(hit.locator);
|
|
33490
33687
|
if (held)
|
|
33491
33688
|
held.item.foundBy = ["words", "meaning"];
|
|
33689
|
+
if (held && discovers)
|
|
33690
|
+
return;
|
|
33492
33691
|
fused2.set(hit.locator, {
|
|
33493
33692
|
item: held?.item ?? itemOf3(hit, ["meaning"]),
|
|
33494
33693
|
score: (held?.score ?? 0) + 1 / (RRF_K3 + rank + 1)
|
|
33495
33694
|
});
|
|
33496
33695
|
});
|
|
33497
|
-
return [...fused2.values()].sort((a, b) => b.score - a.score).map(({ item }) =>
|
|
33696
|
+
return [...fused2.values()].sort((a, b) => b.score - a.score).map(({ item: item2 }) => item2);
|
|
33498
33697
|
}, "messagesOf");
|
|
33499
33698
|
const embedders = runEmbedders();
|
|
33500
33699
|
try {
|
|
@@ -33508,6 +33707,7 @@ var searchAll = /* @__PURE__ */ __name(async (store, account, request, messenger
|
|
|
33508
33707
|
embedders,
|
|
33509
33708
|
...chosen === void 0 ? {} : notesScopeOf(chosen),
|
|
33510
33709
|
...request.exact ? { exact: true } : {},
|
|
33710
|
+
...discover ? { discover: true } : {},
|
|
33511
33711
|
...request.timezone === void 0 ? {} : { timezone: request.timezone },
|
|
33512
33712
|
...request.env === void 0 ? {} : { env: request.env }
|
|
33513
33713
|
});
|
|
@@ -33516,6 +33716,9 @@ var searchAll = /* @__PURE__ */ __name(async (store, account, request, messenger
|
|
|
33516
33716
|
by: found.by,
|
|
33517
33717
|
...found.meaning_skipped === void 0 ? {} : { meaningSkipped: found.meaning_skipped }
|
|
33518
33718
|
};
|
|
33719
|
+
for (const hit of found.hits)
|
|
33720
|
+
if (hit.meaning_score !== void 0)
|
|
33721
|
+
cosines.set(hit.ref, hit.meaning_score);
|
|
33519
33722
|
lists.push(found.hits.map((hit) => ({
|
|
33520
33723
|
kind: hit.kind ?? "note",
|
|
33521
33724
|
ref: hit.ref,
|
|
@@ -33544,6 +33747,7 @@ var searchAll = /* @__PURE__ */ __name(async (store, account, request, messenger
|
|
|
33544
33747
|
...command === void 0 ? {} : { command },
|
|
33545
33748
|
...request.env === void 0 ? {} : { env: request.env },
|
|
33546
33749
|
...request.exact ? { exact: true } : {},
|
|
33750
|
+
...discover ? { discover: true } : {},
|
|
33547
33751
|
...request.timezone === void 0 ? {} : { timezone: request.timezone },
|
|
33548
33752
|
...request.signal === void 0 ? {} : { signal: request.signal }
|
|
33549
33753
|
});
|
|
@@ -33552,6 +33756,9 @@ var searchAll = /* @__PURE__ */ __name(async (store, account, request, messenger
|
|
|
33552
33756
|
by: found.by,
|
|
33553
33757
|
...found.meaning_skipped === void 0 ? {} : { meaningSkipped: found.meaning_skipped }
|
|
33554
33758
|
};
|
|
33759
|
+
for (const hit of found.hits)
|
|
33760
|
+
if (hit.meaning_score !== void 0)
|
|
33761
|
+
cosines.set(hit.ref, hit.meaning_score);
|
|
33555
33762
|
lists.push(found.hits.map((hit) => ({
|
|
33556
33763
|
kind: "event",
|
|
33557
33764
|
ref: hit.ref,
|
|
@@ -33576,14 +33783,7 @@ var searchAll = /* @__PURE__ */ __name(async (store, account, request, messenger
|
|
|
33576
33783
|
} finally {
|
|
33577
33784
|
await embedders.close();
|
|
33578
33785
|
}
|
|
33579
|
-
const
|
|
33580
|
-
for (const list2 of lists)
|
|
33581
|
-
list2.forEach((item, rank) => {
|
|
33582
|
-
const held = ranked.get(item.ref) ?? { item, score: 0 };
|
|
33583
|
-
held.score += 1 / (RRF_K3 + rank + 1);
|
|
33584
|
-
ranked.set(item.ref, held);
|
|
33585
|
-
});
|
|
33586
|
-
const ordered = [...ranked.values()].sort((a, b) => b.score - a.score).map(({ item }) => item);
|
|
33786
|
+
const ordered = oneList(lists, cosines);
|
|
33587
33787
|
const more = hasMore || ordered.length > window3;
|
|
33588
33788
|
return {
|
|
33589
33789
|
query: request.text,
|
|
@@ -33595,13 +33795,25 @@ var searchAll = /* @__PURE__ */ __name(async (store, account, request, messenger
|
|
|
33595
33795
|
skipped,
|
|
33596
33796
|
...notes === void 0 ? {} : { notes },
|
|
33597
33797
|
...events === void 0 ? {} : { events },
|
|
33598
|
-
...
|
|
33798
|
+
...by.messages === void 0 ? {} : { messages: by.messages },
|
|
33799
|
+
...by.mail === void 0 ? {} : { mail: by.mail },
|
|
33599
33800
|
...server === void 0 ? {} : { server },
|
|
33600
33801
|
...coverage2 === void 0 ? {} : { coverage: coverage2 }
|
|
33601
33802
|
};
|
|
33602
33803
|
}, "searchAll");
|
|
33804
|
+
var oneList = /* @__PURE__ */ __name((lists, cosines) => {
|
|
33805
|
+
const place = /* @__PURE__ */ new Map();
|
|
33806
|
+
for (const list2 of lists)
|
|
33807
|
+
list2.forEach((item2, rank) => {
|
|
33808
|
+
const held = place.get(item2.ref);
|
|
33809
|
+
if (!held || rank < held.rank)
|
|
33810
|
+
place.set(item2.ref, { item: item2, rank });
|
|
33811
|
+
});
|
|
33812
|
+
const cosine = /* @__PURE__ */ __name((ref) => cosines.get(ref) ?? Number.NEGATIVE_INFINITY, "cosine");
|
|
33813
|
+
return [...place.values()].sort((a, b) => a.rank - b.rank || cosine(b.item.ref) - cosine(a.item.ref)).map(({ item: item2 }) => item2);
|
|
33814
|
+
}, "oneList");
|
|
33603
33815
|
|
|
33604
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
33816
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/services/search-all-meetings.js
|
|
33605
33817
|
var RESOURCES_SEARCHED_WITH_MEETINGS = [...RESOURCES_SEARCHED, "meetings"];
|
|
33606
33818
|
var whole2 = /* @__PURE__ */ __name((value, minimum, maximum, label) => {
|
|
33607
33819
|
if (!Number.isSafeInteger(value) || value < minimum || value > maximum)
|
|
@@ -33769,16 +33981,16 @@ var searchAllIncludingMeetings = /* @__PURE__ */ __name(async (store, account, r
|
|
|
33769
33981
|
};
|
|
33770
33982
|
}
|
|
33771
33983
|
const ranked = /* @__PURE__ */ new Map();
|
|
33772
|
-
for (const list2 of [legacy.items, meetings.items.map(({ item }) =>
|
|
33773
|
-
list2.forEach((
|
|
33774
|
-
const key =
|
|
33775
|
-
const held = ranked.get(key) ?? { item, score: 0 };
|
|
33984
|
+
for (const list2 of [legacy.items, meetings.items.map(({ item: item2 }) => item2)])
|
|
33985
|
+
list2.forEach((item2, rank) => {
|
|
33986
|
+
const key = item2.kind === "meeting" ? JSON.stringify([item2.kind, item2.accountId, item2.meetingId, item2.scope, item2.id]) : item2.ref;
|
|
33987
|
+
const held = ranked.get(key) ?? { item: item2, score: 0 };
|
|
33776
33988
|
held.score += 1 / (RRF_K3 + rank + 1);
|
|
33777
33989
|
ranked.set(key, held);
|
|
33778
33990
|
});
|
|
33779
|
-
const ordered = [...ranked.values()].sort((a, b) => b.score - a.score).map(({ item }) =>
|
|
33991
|
+
const ordered = [...ranked.values()].sort((a, b) => b.score - a.score).map(({ item: item2 }) => item2);
|
|
33780
33992
|
const items = ordered.slice(offset, window3);
|
|
33781
|
-
const returnedMeetings = ordered.slice(0, window3).filter((
|
|
33993
|
+
const returnedMeetings = ordered.slice(0, window3).filter((item2) => item2.kind === "meeting").length;
|
|
33782
33994
|
const nextCursor = meetings.items[returnedMeetings]?.before ?? (!meetings.coverage.complete ? meetings.after : void 0);
|
|
33783
33995
|
const more = legacy.hasMore || ordered.length > window3;
|
|
33784
33996
|
const { nextOffset: _, ...rest } = legacy;
|
|
@@ -33813,13 +34025,13 @@ var searchAllWithMeetings = /* @__PURE__ */ __name(async (store, account, reques
|
|
|
33813
34025
|
var holdingMeetings = /* @__PURE__ */ __name(async (store, named2) => {
|
|
33814
34026
|
if (named2.length < 2)
|
|
33815
34027
|
return named2;
|
|
33816
|
-
const
|
|
34028
|
+
const holding2 = [];
|
|
33817
34029
|
for (const key of named2) {
|
|
33818
34030
|
const { id: id2 } = await store.accounts.storedAccount(key);
|
|
33819
34031
|
if ((await store.meetings.meetings({ accountId: id2, limit: 1 })).length)
|
|
33820
|
-
|
|
34032
|
+
holding2.push(key);
|
|
33821
34033
|
}
|
|
33822
|
-
return
|
|
34034
|
+
return holding2.length ? holding2 : named2;
|
|
33823
34035
|
}, "holdingMeetings");
|
|
33824
34036
|
var searchAllOfSource = /* @__PURE__ */ __name(async (store, account, source, request, messenger, searchMessages, meaning) => {
|
|
33825
34037
|
const only = request.only ?? RESOURCES_SEARCHED_WITH_MEETINGS;
|
|
@@ -33854,7 +34066,7 @@ var searchAllOfSource = /* @__PURE__ */ __name(async (store, account, source, re
|
|
|
33854
34066
|
return { ...found, skipped: [...skipped, ...empty2, ...unnamed, ...found.skipped] };
|
|
33855
34067
|
}, "searchAllOfSource");
|
|
33856
34068
|
|
|
33857
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34069
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/services/server-search.js
|
|
33858
34070
|
var SERVER_SEARCH_KEY = "messages.server-search";
|
|
33859
34071
|
var SERVER_BOUNDS = { timeMs: 5e3, perCall: 100, maxCalls: 3, textBytes: 262144 };
|
|
33860
34072
|
var DEFAULT_BACKEND = "both";
|
|
@@ -34043,7 +34255,7 @@ var searchServer = /* @__PURE__ */ __name(async (deps, request) => {
|
|
|
34043
34255
|
return { report, sources };
|
|
34044
34256
|
}, "searchServer");
|
|
34045
34257
|
|
|
34046
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34258
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/services/messages.js
|
|
34047
34259
|
var DELETE_AT_ONCE = 10;
|
|
34048
34260
|
var filesOf = /* @__PURE__ */ __name(({ attachments }) => {
|
|
34049
34261
|
const files = fileLinks(attachments);
|
|
@@ -34059,18 +34271,18 @@ var messagesService = /* @__PURE__ */ __name((deps) => {
|
|
|
34059
34271
|
return;
|
|
34060
34272
|
await ensureAccount({ text: target2.text, account: target2.account }, { account: account.account, ...deps.profile === void 0 ? {} : { profile: deps.profile } });
|
|
34061
34273
|
}, "ownTarget");
|
|
34062
|
-
const serverThenStore = /* @__PURE__ */ __name(async (store, account, query) => {
|
|
34274
|
+
const serverThenStore = /* @__PURE__ */ __name(async (store, account, query, lanes = true) => {
|
|
34063
34275
|
const server = await searchServer(deps, query);
|
|
34064
34276
|
const only = query.backend === "server" && server ? [...server.sources.keys()].map((key) => {
|
|
34065
34277
|
const [chatId, id2] = JSON.parse(key);
|
|
34066
34278
|
return { ...account, chatId, id: id2 };
|
|
34067
34279
|
}) : void 0;
|
|
34068
|
-
const found = await searchStore(store, account, only ? { ...query, only } : query, deps.messenger, query.discover && query.kind !== "mail" ? meaningLane(deps) : void 0, query.discover && query.kind !== "mail" ? rerankLane(deps) : void 0);
|
|
34280
|
+
const found = await searchStore(store, account, only ? { ...query, only } : query, deps.messenger, lanes && query.discover && query.kind !== "mail" ? meaningLane(deps) : void 0, lanes && query.discover && query.kind !== "mail" ? rerankLane(deps) : void 0);
|
|
34069
34281
|
return { found, server };
|
|
34070
34282
|
}, "serverThenStore");
|
|
34071
34283
|
const unifiedMessages = /* @__PURE__ */ __name((store, account) => async (query) => {
|
|
34072
34284
|
await topUp(store);
|
|
34073
|
-
const { found, server } = await serverThenStore(store, account, query);
|
|
34285
|
+
const { found, server } = await serverThenStore(store, account, query, false);
|
|
34074
34286
|
return withServer(found, account, server);
|
|
34075
34287
|
}, "unifiedMessages");
|
|
34076
34288
|
const remember = /* @__PURE__ */ __name(async (store, command, query) => {
|
|
@@ -34200,7 +34412,7 @@ var messagesService = /* @__PURE__ */ __name((deps) => {
|
|
|
34200
34412
|
const store = await deps.store();
|
|
34201
34413
|
const chat2 = await readChatId(deps, target2.chat, store, account);
|
|
34202
34414
|
const found2 = await store.messages.around(account, chat2, target2.message, { before: 0, after: 0 });
|
|
34203
|
-
const held2 = found2.find((
|
|
34415
|
+
const held2 = found2.find((item2) => item2.id === target2.message && item2.chatId === chat2);
|
|
34204
34416
|
if (!held2)
|
|
34205
34417
|
throw new CliError("not_found", "no such message in this account's stored chat");
|
|
34206
34418
|
return {
|
|
@@ -34218,14 +34430,14 @@ var messagesService = /* @__PURE__ */ __name((deps) => {
|
|
|
34218
34430
|
const locator = formatLocator({ ...account, chat, message: target2.message });
|
|
34219
34431
|
if (connection.permalink) {
|
|
34220
34432
|
const permalink = validatePermalink(await connection.permalink(chat, target2.message));
|
|
34221
|
-
const held2 = await deps.store().then((store) => store.messages.around(account, chat, target2.message, { before: 0, after: 0 })).then((found2) => found2.find((
|
|
34433
|
+
const held2 = await deps.store().then((store) => store.messages.around(account, chat, target2.message, { before: 0, after: 0 })).then((found2) => found2.find((item2) => item2.id === target2.message && item2.chatId === chat)).catch(() => void 0);
|
|
34222
34434
|
return { locator, ...permalink, ...held2 ? filesOf(held2) : {} };
|
|
34223
34435
|
}
|
|
34224
34436
|
const found = await capability(connection, "around", "read a message")(chat, target2.message, {
|
|
34225
34437
|
before: 0,
|
|
34226
34438
|
after: 0
|
|
34227
34439
|
});
|
|
34228
|
-
const held = found.find((
|
|
34440
|
+
const held = found.find((item2) => item2.id === target2.message && item2.chatId === chat);
|
|
34229
34441
|
if (!held)
|
|
34230
34442
|
throw new CliError("not_found", "no such message in this chat");
|
|
34231
34443
|
return { locator, url: null, access: "unavailable", reason: "unsupported_provider", ...filesOf(held) };
|
|
@@ -34484,7 +34696,7 @@ var checkMediaOptions = /* @__PURE__ */ __name((messenger, asked, attachments) =
|
|
|
34484
34696
|
throw new CliError("validation_error", `${MEDIA_FLAGS[first2]} needs a --photo or --file`);
|
|
34485
34697
|
}, "checkMediaOptions");
|
|
34486
34698
|
|
|
34487
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34699
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/domain/channel-tags.js
|
|
34488
34700
|
var CHANNEL_TAG_RULES_VERSION = "keywords-v1";
|
|
34489
34701
|
var RULES = {
|
|
34490
34702
|
ai: [/\b(ai|gpt|llm|machine learning|artificial intelligence)\b/iu, /нейросет|искусственн/iu],
|
|
@@ -34499,7 +34711,7 @@ var classifyChannel = /* @__PURE__ */ __name((metadata) => Object.entries(RULES)
|
|
|
34499
34711
|
return fields.length ? [{ tag, score: fields.length / 3, fields }] : [];
|
|
34500
34712
|
}), "classifyChannel");
|
|
34501
34713
|
|
|
34502
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34714
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/services/metadata.js
|
|
34503
34715
|
var metadataService = /* @__PURE__ */ __name((deps) => {
|
|
34504
34716
|
const held = /* @__PURE__ */ __name(async (reference, { includeLeft = false } = {}) => {
|
|
34505
34717
|
const store = await deps.store();
|
|
@@ -34585,7 +34797,7 @@ var metadataService = /* @__PURE__ */ __name((deps) => {
|
|
|
34585
34797
|
};
|
|
34586
34798
|
}, "metadataService");
|
|
34587
34799
|
|
|
34588
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34800
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/moderation/run.js
|
|
34589
34801
|
var FIRST_LOOK_MS = 24 * 36e5;
|
|
34590
34802
|
var moderateWith = /* @__PURE__ */ __name(async (run) => {
|
|
34591
34803
|
const { chatId, title, rules, point, since, dryRun } = run;
|
|
@@ -34622,7 +34834,7 @@ var moderateWith = /* @__PURE__ */ __name(async (run) => {
|
|
|
34622
34834
|
return { chatId, rows, notes };
|
|
34623
34835
|
}, "moderateWith");
|
|
34624
34836
|
|
|
34625
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34837
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/services/moderation.js
|
|
34626
34838
|
var moderationService = /* @__PURE__ */ __name((deps) => {
|
|
34627
34839
|
const file = /* @__PURE__ */ __name(() => new ModerationRules(moderationPathFor(deps.messenger.app, deps.profile ?? "default", deps.env ?? process.env)), "file");
|
|
34628
34840
|
const group = /* @__PURE__ */ __name(async (chat) => {
|
|
@@ -34700,7 +34912,7 @@ var moderatorOf = /* @__PURE__ */ __name((adapter, deps) => ({
|
|
|
34700
34912
|
}, "removePerson")
|
|
34701
34913
|
}), "moderatorOf");
|
|
34702
34914
|
|
|
34703
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34915
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/services/private-people.js
|
|
34704
34916
|
var noteItem = /* @__PURE__ */ __name((provider, note) => ({
|
|
34705
34917
|
id: note.id,
|
|
34706
34918
|
contact: formatReference({ type: "contact", provider, id: note.personId }),
|
|
@@ -34744,7 +34956,7 @@ var privatePeopleService = /* @__PURE__ */ __name((deps) => {
|
|
|
34744
34956
|
};
|
|
34745
34957
|
}, "privatePeopleService");
|
|
34746
34958
|
|
|
34747
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34959
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/services/rankings.js
|
|
34748
34960
|
var empty = /* @__PURE__ */ __name(() => ({
|
|
34749
34961
|
total: 0,
|
|
34750
34962
|
population: 0,
|
|
@@ -35000,7 +35212,134 @@ var rankingsService = /* @__PURE__ */ __name((deps) => ({
|
|
|
35000
35212
|
}, "evidence")
|
|
35001
35213
|
}), "rankingsService");
|
|
35002
35214
|
|
|
35003
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
35215
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/services/reply-stats.js
|
|
35216
|
+
var FIELDS = ["date", "chat", "kind"];
|
|
35217
|
+
var WAITING_TAIL = 100;
|
|
35218
|
+
var plainOnly = /* @__PURE__ */ __name((text2, command) => {
|
|
35219
|
+
if (text2 === void 0)
|
|
35220
|
+
return;
|
|
35221
|
+
const refuse = /* @__PURE__ */ __name(() => {
|
|
35222
|
+
throw new CliError("validation_error", `${command} reads date:, chat: and kind: terms, AND-ed \u2014 not words, other fields, OR or NOT`, { reason: "query.unsupported-field" });
|
|
35223
|
+
}, "refuse");
|
|
35224
|
+
const visit = /* @__PURE__ */ __name((node) => {
|
|
35225
|
+
if (node.kind === "boolean")
|
|
35226
|
+
for (const clause of node.clauses) {
|
|
35227
|
+
if (clause.occur !== "must")
|
|
35228
|
+
refuse();
|
|
35229
|
+
visit(clause.node);
|
|
35230
|
+
}
|
|
35231
|
+
else if (!FIELDS.includes(node.field) || !["term", "phrase", "range"].includes(node.operator))
|
|
35232
|
+
refuse();
|
|
35233
|
+
}, "visit");
|
|
35234
|
+
visit(parseLucene(text2, { ...MESSAGE_PARSING, defaultField: "text" }).root);
|
|
35235
|
+
}, "plainOnly");
|
|
35236
|
+
var scopeOf3 = /* @__PURE__ */ __name((root, accounts) => {
|
|
35237
|
+
const scope = { accounts, chats: [], kinds: [] };
|
|
35238
|
+
const visit = /* @__PURE__ */ __name((node) => {
|
|
35239
|
+
if (node.kind === "boolean") {
|
|
35240
|
+
for (const clause of node.clauses)
|
|
35241
|
+
visit(clause.node);
|
|
35242
|
+
return;
|
|
35243
|
+
}
|
|
35244
|
+
const { chat, date: date2 } = node.resolution ?? {};
|
|
35245
|
+
if (chat)
|
|
35246
|
+
scope.chats.push(chat);
|
|
35247
|
+
else if (node.field === "kind")
|
|
35248
|
+
scope.kinds.push(node.value.toLowerCase());
|
|
35249
|
+
else if (date2) {
|
|
35250
|
+
if (date2.lower !== void 0) {
|
|
35251
|
+
const lower = date2.lower + (date2.lower_inclusive ? 0 : 1);
|
|
35252
|
+
scope.since = Math.max(scope.since ?? lower, lower);
|
|
35253
|
+
}
|
|
35254
|
+
if (date2.upper !== void 0) {
|
|
35255
|
+
const upper = date2.upper - (date2.upper_inclusive ? 0 : 1);
|
|
35256
|
+
scope.until = Math.min(scope.until ?? upper, upper);
|
|
35257
|
+
}
|
|
35258
|
+
}
|
|
35259
|
+
}, "visit");
|
|
35260
|
+
visit(root);
|
|
35261
|
+
return scope;
|
|
35262
|
+
}, "scopeOf");
|
|
35263
|
+
var figuresOf = /* @__PURE__ */ __name((delays) => {
|
|
35264
|
+
const { medianMilliseconds, p90Milliseconds } = delayStats(delays);
|
|
35265
|
+
return {
|
|
35266
|
+
replies: delays.length,
|
|
35267
|
+
medianMs: medianMilliseconds,
|
|
35268
|
+
p90Ms: p90Milliseconds,
|
|
35269
|
+
meanMs: delays.length ? Math.round(delays.reduce((sum2, one) => sum2 + one, 0) / delays.length) : null
|
|
35270
|
+
};
|
|
35271
|
+
}, "figuresOf");
|
|
35272
|
+
var MINUTE2 = 6e4;
|
|
35273
|
+
var waitsOnOwner = /* @__PURE__ */ __name((newest) => {
|
|
35274
|
+
if (newest.mine)
|
|
35275
|
+
return false;
|
|
35276
|
+
if (newest.kind === "private")
|
|
35277
|
+
return !newest.quiet && rankingQuestion(newest.text);
|
|
35278
|
+
return newest.addressed || newest.ownerUsername !== null && new RegExp(`(^|[^\\w@])@${newest.ownerUsername.replace(/[^\w]/g, "\\$&")}(?!\\w)`, "i").test(newest.text);
|
|
35279
|
+
}, "waitsOnOwner");
|
|
35280
|
+
var replyStatsService = /* @__PURE__ */ __name((deps) => {
|
|
35281
|
+
const prepared = /* @__PURE__ */ __name(async (query, command) => {
|
|
35282
|
+
plainOnly(query.text, command);
|
|
35283
|
+
const store = await deps.store();
|
|
35284
|
+
const found = await prepareLucene(store, await deps.account(), {
|
|
35285
|
+
...query.text === void 0 ? {} : { text: query.text },
|
|
35286
|
+
...query.source === void 0 ? {} : { source: query.source },
|
|
35287
|
+
timezone: timezoneOf(query.timezone),
|
|
35288
|
+
limit: 1
|
|
35289
|
+
}, deps.messenger);
|
|
35290
|
+
return { store, timezone: found.timezone, scope: scopeOf3(found.execution.root, found.scopeAccounts) };
|
|
35291
|
+
}, "prepared");
|
|
35292
|
+
return {
|
|
35293
|
+
responses: /* @__PURE__ */ __name(async ({ who, by, ...query }) => {
|
|
35294
|
+
const { store, timezone, scope } = await prepared(query, "stats messages responses");
|
|
35295
|
+
const delays = scope.accounts.length ? await store.queries.replyDelays(scope, who) : [];
|
|
35296
|
+
const buckets = { under5m: 0, under1h: 0, under1d: 0, over1d: 0 };
|
|
35297
|
+
for (const { delayMs } of delays) {
|
|
35298
|
+
if (delayMs < 5 * MINUTE2)
|
|
35299
|
+
buckets.under5m++;
|
|
35300
|
+
else if (delayMs < 60 * MINUTE2)
|
|
35301
|
+
buckets.under1h++;
|
|
35302
|
+
else if (delayMs < 24 * 60 * MINUTE2)
|
|
35303
|
+
buckets.under1d++;
|
|
35304
|
+
else
|
|
35305
|
+
buckets.over1d++;
|
|
35306
|
+
}
|
|
35307
|
+
const days = /* @__PURE__ */ new Map();
|
|
35308
|
+
if (by === "day") {
|
|
35309
|
+
const keyOf5 = calendarKey(timezone, "day");
|
|
35310
|
+
for (const { repliedAt, delayMs } of delays) {
|
|
35311
|
+
const key = keyOf5(repliedAt);
|
|
35312
|
+
const list2 = days.get(key) ?? [];
|
|
35313
|
+
list2.push(delayMs);
|
|
35314
|
+
days.set(key, list2);
|
|
35315
|
+
}
|
|
35316
|
+
}
|
|
35317
|
+
return {
|
|
35318
|
+
who,
|
|
35319
|
+
by,
|
|
35320
|
+
...figuresOf(delays.map(({ delayMs }) => delayMs)),
|
|
35321
|
+
buckets,
|
|
35322
|
+
rows: [...days].sort(([a], [b]) => a.localeCompare(b)).map(([key, list2]) => ({ key, ...figuresOf(list2) }))
|
|
35323
|
+
};
|
|
35324
|
+
}, "responses"),
|
|
35325
|
+
waiting: /* @__PURE__ */ __name(async (query) => {
|
|
35326
|
+
const { store, scope } = await prepared(query, "stats messages waiting");
|
|
35327
|
+
const chats = scope.accounts.length ? await store.queries.waitingChats(scope, waitsOnOwner, WAITING_TAIL) : [];
|
|
35328
|
+
const firsts = chats.flatMap(({ unanswered: unanswered2 }) => unanswered2.at(-1) ?? []);
|
|
35329
|
+
return {
|
|
35330
|
+
chats: chats.length,
|
|
35331
|
+
messages: chats.reduce((sum2, { unanswered: unanswered2 }) => sum2 + unanswered2.length, 0),
|
|
35332
|
+
oldestAt: firsts.length ? new Date(firsts.reduce((low, one) => Math.min(low, one))).toISOString() : null,
|
|
35333
|
+
byKind: {
|
|
35334
|
+
private: chats.filter(({ kind }) => kind === "private").length,
|
|
35335
|
+
group: chats.filter(({ kind }) => kind === "group").length
|
|
35336
|
+
}
|
|
35337
|
+
};
|
|
35338
|
+
}, "waiting")
|
|
35339
|
+
};
|
|
35340
|
+
}, "replyStatsService");
|
|
35341
|
+
|
|
35342
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/services/searches.js
|
|
35004
35343
|
var savedSearchItem = /* @__PURE__ */ __name((one) => ({
|
|
35005
35344
|
id: one.id,
|
|
35006
35345
|
name: one.name,
|
|
@@ -35129,7 +35468,7 @@ var searchesService = /* @__PURE__ */ __name((deps) => {
|
|
|
35129
35468
|
};
|
|
35130
35469
|
}, "searchesService");
|
|
35131
35470
|
|
|
35132
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
35471
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/services/tags.js
|
|
35133
35472
|
var TAGGING_QUERY = {
|
|
35134
35473
|
entity: "tagging",
|
|
35135
35474
|
backend: "sql",
|
|
@@ -35213,7 +35552,7 @@ var tagsService = /* @__PURE__ */ __name((deps) => {
|
|
|
35213
35552
|
};
|
|
35214
35553
|
}, "tagsService");
|
|
35215
35554
|
|
|
35216
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
35555
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/services/topics.js
|
|
35217
35556
|
var actionOf = /* @__PURE__ */ __name(({ title, closed, pinned, hidden, icon }) => {
|
|
35218
35557
|
const set = [closed, pinned, hidden].filter((one) => one !== void 0).length;
|
|
35219
35558
|
if (title !== void 0 || icon !== void 0 || set !== 1)
|
|
@@ -35412,7 +35751,7 @@ var topicsService = /* @__PURE__ */ __name((deps) => {
|
|
|
35412
35751
|
};
|
|
35413
35752
|
}, "topicsService");
|
|
35414
35753
|
|
|
35415
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
35754
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/services/evidence.js
|
|
35416
35755
|
import { createHash as createHash11, randomUUID as randomUUID5 } from "node:crypto";
|
|
35417
35756
|
var hash2 = /* @__PURE__ */ __name((value) => createHash11("sha256").update(JSON.stringify(value)).digest("hex"), "hash");
|
|
35418
35757
|
var positive = /* @__PURE__ */ __name((value, name, minimum = 1) => {
|
|
@@ -35458,13 +35797,13 @@ var prepareEvidencePacket = /* @__PURE__ */ __name(({ kind, source, page, limits
|
|
|
35458
35797
|
threadId: message.threadId ?? null,
|
|
35459
35798
|
attachmentKinds: message.attachments.map(({ kind: attachmentKind }) => attachmentKind)
|
|
35460
35799
|
};
|
|
35461
|
-
const
|
|
35462
|
-
const bytes2 = Buffer.byteLength(JSON.stringify(
|
|
35800
|
+
const item2 = { ...content2, fingerprint: hash2(content2) };
|
|
35801
|
+
const bytes2 = Buffer.byteLength(JSON.stringify(item2), "utf8") + (items.length > 0 ? 1 : 0);
|
|
35463
35802
|
if (bytes2 > limits.bytes - contentBytes) {
|
|
35464
35803
|
truncatedBy = "bytes";
|
|
35465
35804
|
break;
|
|
35466
35805
|
}
|
|
35467
|
-
items.push(
|
|
35806
|
+
items.push(item2);
|
|
35468
35807
|
contentBytes += bytes2;
|
|
35469
35808
|
}
|
|
35470
35809
|
const content = {
|
|
@@ -35486,7 +35825,7 @@ var prepareEvidencePacket = /* @__PURE__ */ __name(({ kind, source, page, limits
|
|
|
35486
35825
|
return { ...content, id: randomUUID5(), fingerprint: hash2(content) };
|
|
35487
35826
|
}, "prepareEvidencePacket");
|
|
35488
35827
|
|
|
35489
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
35828
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/services/evidence-read.js
|
|
35490
35829
|
var readEvidencePacket = /* @__PURE__ */ __name(async (store, account, { chat, limit, before: before2 }, messenger = {}) => {
|
|
35491
35830
|
if (!Number.isSafeInteger(limit) || limit < 1 || limit > 100)
|
|
35492
35831
|
throw new CliError("validation_error", "evidence message limit must be an integer from 1 to 100");
|
|
@@ -35506,7 +35845,7 @@ var readEvidencePacket = /* @__PURE__ */ __name(async (store, account, { chat, l
|
|
|
35506
35845
|
return { ...packet, nextBeforeId: older && last ? last.id : null };
|
|
35507
35846
|
}, "readEvidencePacket");
|
|
35508
35847
|
|
|
35509
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
35848
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/services/meeting-project-discovery.js
|
|
35510
35849
|
var scopeKeys = [
|
|
35511
35850
|
"accountId",
|
|
35512
35851
|
"meetingId",
|
|
@@ -35528,7 +35867,7 @@ var optionKeys = /* @__PURE__ */ new Set([
|
|
|
35528
35867
|
"maxVocabularyReadBytes"
|
|
35529
35868
|
]);
|
|
35530
35869
|
|
|
35531
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
35870
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/context/communication-selection.js
|
|
35532
35871
|
var communicationFields = {
|
|
35533
35872
|
sources: pipe(array(strictObject({
|
|
35534
35873
|
id: pipe(string(), regex(/^[A-Za-z0-9][A-Za-z0-9._-]{0,127}$/)),
|
|
@@ -35560,7 +35899,7 @@ var communicationRequest = /* @__PURE__ */ __name((value, preparationAfter) => {
|
|
|
35560
35899
|
return { ...input, after, before: before2 };
|
|
35561
35900
|
}, "communicationRequest");
|
|
35562
35901
|
|
|
35563
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
35902
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/services/meeting-preparation-validation.js
|
|
35564
35903
|
var MEETING_PREPARATION_LIMITS = {
|
|
35565
35904
|
meetings: { min: 1, max: 20, default: 5 },
|
|
35566
35905
|
cues: { min: 1, max: 100, default: 10 },
|
|
@@ -35633,7 +35972,7 @@ var validateMeetingPreparationRequest = /* @__PURE__ */ __name((externalId, orig
|
|
|
35633
35972
|
};
|
|
35634
35973
|
}, "validateMeetingPreparationRequest");
|
|
35635
35974
|
|
|
35636
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
35975
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/services/meeting-communications-selection.js
|
|
35637
35976
|
var validatePreparationCommunications = /* @__PURE__ */ __name((section, request, after) => {
|
|
35638
35977
|
const fail2 = /* @__PURE__ */ __name(() => {
|
|
35639
35978
|
throw new CliError("invalid_response", "Preparation communications returned another selection or invalid evidence");
|
|
@@ -35643,13 +35982,13 @@ var validatePreparationCommunications = /* @__PURE__ */ __name((section, request
|
|
|
35643
35982
|
fail2();
|
|
35644
35983
|
return;
|
|
35645
35984
|
}
|
|
35646
|
-
const
|
|
35647
|
-
if (!section || section.query !==
|
|
35985
|
+
const expected2 = communicationRequest(request, after);
|
|
35986
|
+
if (!section || section.query !== expected2.query || section.window?.after !== expected2.after || section.window?.before !== expected2.before)
|
|
35648
35987
|
fail2();
|
|
35649
|
-
if (!Array.isArray(section.sources) || section.sources.length !==
|
|
35988
|
+
if (!Array.isArray(section.sources) || section.sources.length !== expected2.sources.length || section.sources.some((s) => !s || typeof s.selectionId !== "string") || new Set(section.sources.map((s) => s.selectionId)).size !== expected2.sources.length)
|
|
35650
35989
|
fail2();
|
|
35651
35990
|
for (const source of section.sources) {
|
|
35652
|
-
if (!
|
|
35991
|
+
if (!expected2.sources.some((s) => s.id === source.selectionId))
|
|
35653
35992
|
fail2();
|
|
35654
35993
|
try {
|
|
35655
35994
|
contextSource(source.source);
|
|
@@ -35659,20 +35998,20 @@ var validatePreparationCommunications = /* @__PURE__ */ __name((section, request
|
|
|
35659
35998
|
}
|
|
35660
35999
|
if (!Array.isArray(section.items) || section.items.length > 20)
|
|
35661
36000
|
fail2();
|
|
35662
|
-
for (const
|
|
35663
|
-
if (!
|
|
36001
|
+
for (const item2 of section.items) {
|
|
36002
|
+
if (!item2)
|
|
35664
36003
|
fail2();
|
|
35665
|
-
const source = section.sources.find((s) => s.selectionId ===
|
|
35666
|
-
if (!source ||
|
|
36004
|
+
const source = section.sources.find((s) => s.selectionId === item2.selectionId)?.source;
|
|
36005
|
+
if (!source || item2.provider !== source.provider || item2.account !== source.account || !Number.isSafeInteger(item2.at) || item2.at < expected2.after || item2.at >= expected2.before || !Number.isSafeInteger(item2.updatedAt) || item2.updatedAt < 0 || item2.updatedAt > 864e13 || typeof item2.text !== "string" || Buffer.byteLength(item2.text) > 1024)
|
|
35667
36006
|
fail2();
|
|
35668
36007
|
try {
|
|
35669
36008
|
if (source.kind === "document") {
|
|
35670
|
-
const id2 = Number(
|
|
35671
|
-
if (!Number.isSafeInteger(id2) || id2 < 1 ||
|
|
36009
|
+
const id2 = Number(item2.ref.slice(9));
|
|
36010
|
+
if (!Number.isSafeInteger(id2) || id2 < 1 || item2.ref !== `document:${id2}`)
|
|
35672
36011
|
fail2();
|
|
35673
36012
|
} else {
|
|
35674
|
-
const locator = parseLocator(
|
|
35675
|
-
if (locator.provider !== source.provider || locator.account !== source.account || formatLocator(locator) !==
|
|
36013
|
+
const locator = parseLocator(item2.ref);
|
|
36014
|
+
if (locator.provider !== source.provider || locator.account !== source.account || formatLocator(locator) !== item2.ref)
|
|
35676
36015
|
fail2();
|
|
35677
36016
|
}
|
|
35678
36017
|
} catch {
|
|
@@ -35681,7 +36020,7 @@ var validatePreparationCommunications = /* @__PURE__ */ __name((section, request
|
|
|
35681
36020
|
}
|
|
35682
36021
|
}, "validatePreparationCommunications");
|
|
35683
36022
|
|
|
35684
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
36023
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/services/package-upgrade.js
|
|
35685
36024
|
var upgradePackage = /* @__PURE__ */ __name(async ({ current, command, packageName, check: check2 }, ports) => {
|
|
35686
36025
|
const installer = ports.installer();
|
|
35687
36026
|
const argv = updateCommand(installer, packageName);
|
|
@@ -35746,7 +36085,7 @@ var dayAfter = /* @__PURE__ */ __name((published) => {
|
|
|
35746
36085
|
return Number.isNaN(time) ? null : new Date(time + 24 * 60 * 60 * 1e3).toISOString();
|
|
35747
36086
|
}, "dayAfter");
|
|
35748
36087
|
|
|
35749
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
36088
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/services/index.js
|
|
35750
36089
|
var servicesFor = /* @__PURE__ */ __name((deps) => {
|
|
35751
36090
|
const pictures = picturesService(deps);
|
|
35752
36091
|
const base = {
|
|
@@ -35756,6 +36095,7 @@ var servicesFor = /* @__PURE__ */ __name((deps) => {
|
|
|
35756
36095
|
counters: countersService(deps),
|
|
35757
36096
|
retention: retentionService(deps),
|
|
35758
36097
|
rankings: rankingsService(deps),
|
|
36098
|
+
replyStats: replyStatsService(deps),
|
|
35759
36099
|
topics: topicsService(deps),
|
|
35760
36100
|
messages: withPictures(messagesService(deps), pictures),
|
|
35761
36101
|
chats: chatsService(deps),
|
|
@@ -35782,7 +36122,7 @@ var servicesFor = /* @__PURE__ */ __name((deps) => {
|
|
|
35782
36122
|
return deps.messenger.services ? { ...base, ...deps.messenger.services(base, deps) } : base;
|
|
35783
36123
|
}, "servicesFor");
|
|
35784
36124
|
|
|
35785
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
36125
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/background/relay.js
|
|
35786
36126
|
import { createHash as createHash12 } from "node:crypto";
|
|
35787
36127
|
import { chmodSync, lstatSync, mkdirSync as mkdirSync3, rmSync } from "node:fs";
|
|
35788
36128
|
import { createConnection, createServer } from "node:net";
|
|
@@ -36003,7 +36343,7 @@ var relayCommand = /* @__PURE__ */ __name((path, request, options) => new Promis
|
|
|
36003
36343
|
}, () => finish({ error: stopped() }));
|
|
36004
36344
|
}), "relayCommand");
|
|
36005
36345
|
|
|
36006
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
36346
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.566.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_2c70ab84360472ff0036a7904a884c42/node_modules/@wirecat/cli-core/dist/cli/messenger/serve-relay.js
|
|
36007
36347
|
var lentConnection = /* @__PURE__ */ __name((connection, watchers) => throughWrapper(connection, {
|
|
36008
36348
|
close: /* @__PURE__ */ __name(async () => {
|
|
36009
36349
|
}, "close"),
|
|
@@ -36139,6 +36479,7 @@ export {
|
|
|
36139
36479
|
projectStatus,
|
|
36140
36480
|
sendTime,
|
|
36141
36481
|
readMail,
|
|
36482
|
+
prepareLucene,
|
|
36142
36483
|
momentOf,
|
|
36143
36484
|
aheadOf,
|
|
36144
36485
|
dateWindow,
|
|
@@ -36206,7 +36547,9 @@ export {
|
|
|
36206
36547
|
withoutPhone,
|
|
36207
36548
|
savedSearchItem,
|
|
36208
36549
|
TAGGING_QUERY,
|
|
36550
|
+
TASK_STATS_BY,
|
|
36209
36551
|
TASK_QUERY,
|
|
36552
|
+
TASK_STATS_QUERY,
|
|
36210
36553
|
TASK_PAIR_QUERY,
|
|
36211
36554
|
CLAIM_LEASE_MS,
|
|
36212
36555
|
taskTypeOf,
|