@wirecat/amo-cli 0.4.0 → 0.5.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 +33 -0
- package/contracts/wirecat.json +2 -1
- package/dist/amo/allow-list.d.ts +1 -1
- package/dist/amo/allow-list.d.ts.map +1 -1
- package/dist/amo/operation.d.ts +1 -1
- package/dist/amo/operation.d.ts.map +1 -1
- package/dist/bin/amo.js +2 -2
- package/dist/bundle/agent-EFMUK732.js +41 -0
- package/dist/bundle/{all-profiles-PRNXEZRH.js → all-profiles-PIWUQWBA.js} +11 -11
- package/dist/bundle/amo.js +28 -28
- package/dist/bundle/{anthropic-FDI24DU2.js → anthropic-47CMXBPQ.js} +5 -5
- package/dist/bundle/{app-server-WAKJVDLN.js → app-server-QRBQODF2.js} +70 -69
- package/dist/bundle/areas-QVHVU57Z.js +63 -0
- package/dist/bundle/{bun-YPXUXMBI.js → bun-OPDGMZZQ.js} +2 -2
- package/dist/bundle/{bun-sqlite-UBQ5M47X.js → bun-sqlite-7I4X7CZW.js} +6 -6
- package/dist/bundle/{chunk-SFZVMKB6.js → chunk-2JHVQMVC.js} +1 -1
- package/dist/bundle/{chunk-SNBYFQHT.js → chunk-2XBDILVW.js} +1 -1
- package/dist/bundle/{chunk-BCIZAUDV.js → chunk-3DEQUYEG.js} +9 -9
- package/dist/bundle/{chunk-2AIG2SSJ.js → chunk-3GX6KM2E.js} +1661 -164
- package/dist/bundle/{chunk-5II6TAJE.js → chunk-3HC5F3P7.js} +1 -1
- package/dist/bundle/{chunk-DWD3KDJA.js → chunk-3PYE55JY.js} +1 -1
- package/dist/bundle/{chunk-SMM7GS4Q.js → chunk-3YM4B2GT.js} +1 -1
- package/dist/bundle/{chunk-XEYT2EQT.js → chunk-43OW5NTG.js} +6 -6
- package/dist/bundle/{chunk-HDZNSOV5.js → chunk-43PMSR33.js} +13 -9
- package/dist/bundle/{chunk-EBNCUQLV.js → chunk-4N7PP76S.js} +1 -1
- package/dist/bundle/{chunk-WAFB3IWJ.js → chunk-4VN7RI4I.js} +5 -5
- package/dist/bundle/{chunk-CEBX63XY.js → chunk-57HFPNMF.js} +8 -8
- package/dist/bundle/{chunk-Z2B3VNRI.js → chunk-5UTB3ADZ.js} +11 -11
- package/dist/bundle/{chunk-PLU2IQXC.js → chunk-633NQY2R.js} +3 -3
- package/dist/bundle/{chunk-NKYWQTS2.js → chunk-63N46DJU.js} +216 -233
- package/dist/bundle/{chunk-5HZMXHRH.js → chunk-6D4VWSJD.js} +6 -6
- package/dist/bundle/{chunk-V2QWX6B3.js → chunk-6JTHXWPE.js} +3 -3
- package/dist/bundle/{chunk-YREKMP24.js → chunk-6QGUK3H7.js} +4 -4
- package/dist/bundle/{chunk-4PQECIU2.js → chunk-6WS6GJ4V.js} +2 -2
- package/dist/bundle/{chunk-23AQD7JU.js → chunk-7IR2G5XY.js} +16 -16
- package/dist/bundle/{chunk-OYMHPQF7.js → chunk-7IWIFVXH.js} +4 -4
- package/dist/bundle/{chunk-YHVHDRED.js → chunk-ABX7BBS4.js} +6 -6
- package/dist/bundle/{chunk-3K6T2G52.js → chunk-ADTI5RUO.js} +6 -6
- package/dist/bundle/{chunk-YFRTEJ6V.js → chunk-AKRIUNYP.js} +7 -7
- package/dist/bundle/{chunk-KBAOJISR.js → chunk-BIKOE2IW.js} +7 -7
- package/dist/bundle/{chunk-TIR3AB35.js → chunk-BVVMIAQ6.js} +759 -694
- package/dist/bundle/{chunk-M54YKD3I.js → chunk-CGW5R4UD.js} +7 -7
- package/dist/bundle/{chunk-CYHIM5SL.js → chunk-D4NE7EON.js} +3 -3
- package/dist/bundle/{chunk-TCSVW7BA.js → chunk-DNCLQPOM.js} +1 -1
- package/dist/bundle/{chunk-WASBOYI2.js → chunk-DPV53EZC.js} +4 -4
- package/dist/bundle/{chunk-VEFAYLKX.js → chunk-DQ6S5TFZ.js} +185 -114
- package/dist/bundle/{chunk-GMHRPX5M.js → chunk-DSJ6EAOA.js} +61 -61
- package/dist/bundle/{chunk-GQKEMBM6.js → chunk-DVZ75WZJ.js} +121 -36
- package/dist/bundle/{chunk-SHOSFYI7.js → chunk-EHK73OSW.js} +38 -24
- package/dist/bundle/{chunk-KQZTX4LM.js → chunk-FNV5HLHX.js} +17 -17
- package/dist/bundle/{chunk-RQPB2BSH.js → chunk-FV4GQNIK.js} +2 -2
- package/dist/bundle/{chunk-E3EWS6DF.js → chunk-G2TU5RYY.js} +6 -6
- package/dist/bundle/{chunk-WEWJA42Q.js → chunk-GDK7ETSB.js} +12 -12
- package/dist/bundle/{chunk-KORZEYZN.js → chunk-GGMAIIVE.js} +1 -1
- package/dist/bundle/{chunk-U46RNOEQ.js → chunk-GLYWZQY4.js} +3 -3
- package/dist/bundle/{chunk-KRD375P7.js → chunk-H4AFNENN.js} +34 -29
- package/dist/bundle/{chunk-SZX7EPPY.js → chunk-HOF7GQWW.js} +4 -4
- package/dist/bundle/{chunk-DWA5TZMP.js → chunk-HSPEU6S7.js} +8 -8
- package/dist/bundle/{chunk-VG2ERHFJ.js → chunk-IA7LLLEI.js} +3 -3
- package/dist/bundle/{chunk-O3WE5IGP.js → chunk-IB55P46L.js} +6 -6
- package/dist/bundle/{chunk-2UJ7ZZZC.js → chunk-IG2TJQJ7.js} +3 -3
- package/dist/bundle/{chunk-ZJC2XJQC.js → chunk-JG6LCSEX.js} +13 -13
- package/dist/bundle/{chunk-ELAKOEIO.js → chunk-JLXXUEAM.js} +2 -2
- package/dist/bundle/{chunk-UCM7C773.js → chunk-JXT6GY4V.js} +158 -61
- package/dist/bundle/{chunk-ABMPZL2P.js → chunk-K7YY6SXR.js} +19 -15
- package/dist/bundle/{chunk-TEGQVVCZ.js → chunk-KEKXERBE.js} +14581 -11880
- package/dist/bundle/{chunk-GJBOZAUD.js → chunk-KZ2FIDI3.js} +3 -3
- package/dist/bundle/{chunk-IBEHYGG6.js → chunk-KZN2BG3P.js} +8 -8
- package/dist/bundle/{chunk-VG26HDKH.js → chunk-LKH3UKLO.js} +4 -4
- package/dist/bundle/{chunk-PIOR6PIO.js → chunk-LZPKBN3C.js} +2 -2
- package/dist/bundle/{chunk-5SJEJYQZ.js → chunk-M6VZXAJC.js} +3 -3
- package/dist/bundle/{chunk-NFWD4QX3.js → chunk-MDEPJZYJ.js} +2 -2
- package/dist/bundle/{chunk-QGFURWEP.js → chunk-NB7EOAUZ.js} +8 -1
- package/dist/bundle/{chunk-GBQ76X6T.js → chunk-NISH4UXM.js} +2 -2
- package/dist/bundle/{chunk-MW7HUD6R.js → chunk-NSKMNIY6.js} +9 -9
- package/dist/bundle/chunk-PPSAWFJD.js +1293 -0
- package/dist/bundle/{chunk-UEN5NWNW.js → chunk-Q7ICVP25.js} +1 -1
- package/dist/bundle/{chunk-7OVTUADG.js → chunk-QFOP3KUP.js} +8 -8
- package/dist/bundle/{chunk-LAR2DLTI.js → chunk-R53XXHEI.js} +4 -4
- package/dist/bundle/{chunk-A4W7J6VN.js → chunk-RIMPFMZE.js} +28 -189
- package/dist/bundle/{chunk-G3LAYJJJ.js → chunk-RN6RT5CB.js} +4 -4
- package/dist/bundle/{chunk-FQRP6JWX.js → chunk-RRTMPSQR.js} +2 -2
- package/dist/bundle/{chunk-AN6IJYH3.js → chunk-S4ZHQMNM.js} +5 -5
- package/dist/bundle/{chunk-AP3CWDRK.js → chunk-S6JG4YUH.js} +2 -2
- package/dist/bundle/{chunk-PL7TNKAY.js → chunk-TAVI73RW.js} +2 -2
- package/dist/bundle/{chunk-ZKRWNL4T.js → chunk-TLG6ECZ2.js} +2 -2
- package/dist/bundle/{chunk-745FMNI5.js → chunk-TXDR6YSF.js} +1 -1
- package/dist/bundle/{chunk-3WG4MTQI.js → chunk-TY7NDMFY.js} +1 -1
- package/dist/bundle/{chunk-WR2FPZTE.js → chunk-U5RJJ2EC.js} +8 -8
- package/dist/bundle/{chunk-6QMSKJB4.js → chunk-UDSL3MUU.js} +8 -8
- package/dist/bundle/{chunk-FEUNZG7U.js → chunk-V2CNGXWX.js} +37 -37
- package/dist/bundle/{chunk-V5SETIQK.js → chunk-VB7FZOYX.js} +1 -1
- package/dist/bundle/{chunk-HZZ56JO7.js → chunk-VZ5PPYDG.js} +1 -1
- package/dist/bundle/{chunk-LZ4IWN43.js → chunk-W5JRXIG6.js} +822 -1604
- package/dist/bundle/{chunk-SCMB4LI6.js → chunk-WIHN3ELW.js} +19 -19
- package/dist/bundle/chunk-WOPVBRPV.js +29 -0
- package/dist/bundle/{chunk-6PILR4AX.js → chunk-WUFX4TKA.js} +2 -2
- package/dist/bundle/{chunk-NXNUCGGO.js → chunk-WXJYMMEL.js} +6 -6
- package/dist/bundle/{chunk-IPNIF5JE.js → chunk-XCCU2E3Z.js} +4 -4
- package/dist/bundle/{chunk-EAX5RO7S.js → chunk-XEQQJBBO.js} +1 -1
- package/dist/bundle/{chunk-3PCVQCCV.js → chunk-XUT7DSM5.js} +2 -2
- package/dist/bundle/{chunk-ASU63X5C.js → chunk-YWDFYQOU.js} +2 -2
- package/dist/bundle/{chunk-S6DTLAOB.js → chunk-ZLUIRFJX.js} +37 -18
- package/dist/bundle/{cli-QDPKC2HJ.js → cli-3NXOSENF.js} +104 -105
- package/dist/bundle/command-contract-LNSAV5LA.js +39 -0
- package/dist/bundle/{command-server-entry-TX7WNN7G.js → command-server-entry-4ZQPNUL4.js} +28 -28
- package/dist/bundle/{decode-BLPC7OYE.js → decode-K7U7X5EL.js} +5 -5
- package/dist/bundle/{dispatch-5JUT55CS.js → dispatch-56FECRCU.js} +8 -8
- package/dist/bundle/{echarts-54D3FOCL.js → echarts-O3TNDAXJ.js} +2 -2
- package/dist/bundle/{embed-O7KMDYM7.js → embed-SWLVG73O.js} +6 -6
- package/dist/bundle/{embedder-4PE67CLX.js → embedder-EJN75BPV.js} +9 -9
- package/dist/bundle/{failure-NNQYTB3Z.js → failure-WDSX6H3B.js} +2 -2
- package/dist/bundle/{first-run-EAU5SHBI.js → first-run-WPGUUC4Z.js} +12 -12
- package/dist/bundle/first-screen-JMNEUQ46.js +40 -0
- package/dist/bundle/{instructions-ONXP5DZQ.js → instructions-AMH5RWVJ.js} +1 -1
- package/dist/bundle/{mcp-ZNULRPZ4.js → mcp-5HFPWC3W.js} +2 -2
- package/dist/bundle/meeting-combined-5TKG2RYD.js +24 -0
- package/dist/bundle/{meeting-model-FWIZRKVN.js → meeting-model-YXXNETKC.js} +11 -11
- package/dist/bundle/{meeting-semantic-M4YVJ57W.js → meeting-semantic-U7EUB3ET.js} +6 -6
- package/dist/bundle/{node-UTQCYQF5.js → node-EGMCBAO7.js} +2 -2
- package/dist/bundle/{node-sqlite-APJG6MGL.js → node-sqlite-YVOGMDSP.js} +7 -7
- package/dist/bundle/{oauth-TY7RMIBL.js → oauth-2SNRBIJM.js} +7 -7
- package/dist/bundle/{open-WDVEQL75.js → open-ABCPY5IH.js} +5 -5
- package/dist/bundle/{openai-H5UJHSEZ.js → openai-4D6PXJR7.js} +15 -15
- package/dist/bundle/{process-MGMXXPMY.js → process-SGHEN6MQ.js} +1 -1
- package/dist/bundle/{program-IF36C6VR.js → program-CBDQBZZ3.js} +319 -133
- package/dist/bundle/{prompt-4RLIWLMF.js → prompt-2QUK5QST.js} +5 -5
- package/dist/bundle/{recognize-UIRTMWM4.js → recognize-QMQSJRIH.js} +4 -4
- package/dist/bundle/{remote-L3MNWZQK.js → remote-U7TC2BLZ.js} +9 -9
- package/dist/bundle/{rerank-F4KZQTY6.js → rerank-5UPVXGVV.js} +7 -7
- package/dist/bundle/{serve-37AUYTWS.js → serve-VX6GUM6J.js} +9 -9
- package/dist/bundle/{server-UBG676ZJ.js → server-FOPC6DJ3.js} +62 -61
- package/dist/bundle/server-OIVNOMVK.js +87 -0
- package/dist/bundle/source-HWS5SJIV.js +46 -0
- package/dist/bundle/{sqlite-runtime-CI3RW7VA.js → sqlite-runtime-77NKDEXN.js} +6 -6
- package/dist/bundle/{state-JOHLSLUO.js → state-X2HU6GB2.js} +6 -6
- package/dist/bundle/{store-2MBG4IUS.js → store-2U4U6KL4.js} +22 -22
- package/dist/bundle/{store-OSOUXBYL.js → store-3CHPHFP7.js} +26 -24
- package/dist/bundle/store-Z3747L5F.js +34 -0
- package/dist/bundle/store-maintenance-command-UOSZJTVP.js +74 -0
- package/dist/bundle/surface-MUT72QON.js +73 -0
- package/dist/bundle/writer-RBKQ64ZM.js +48 -0
- package/dist/commands/crm-shared.js +1 -1
- package/dist/commands/crm-shared.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +4 -4
- package/skills/amo-cli/SKILL.md +6 -0
- package/dist/bundle/agent-43BMVBX2.js +0 -40
- package/dist/bundle/chunk-M33XHJTM.js +0 -1266
- package/dist/bundle/command-contract-KWNCP3MQ.js +0 -39
- package/dist/bundle/first-screen-APSNGZYZ.js +0 -39
- package/dist/bundle/meeting-combined-W2XIYXFU.js +0 -24
- package/dist/bundle/server-CRF4QSZR.js +0 -86
- package/dist/bundle/source-Z7GH7T4B.js +0 -44
- package/dist/bundle/store-SNW6U32Y.js +0 -34
- package/dist/bundle/store-maintenance-command-W7V54SLT.js +0 -73
- package/dist/bundle/surface-ESJS2FUI.js +0 -72
- package/dist/bundle/writer-BJDQMKUV.js +0 -46
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
sameOrdinaryFile,
|
|
9
9
|
syncDirectory,
|
|
10
10
|
writeFileAtomic
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-JG6LCSEX.js";
|
|
12
12
|
import {
|
|
13
13
|
MAIL,
|
|
14
14
|
OWNER_NOTES,
|
|
@@ -18,23 +18,26 @@ import {
|
|
|
18
18
|
listContextOf,
|
|
19
19
|
listedAccounts,
|
|
20
20
|
newOperationId,
|
|
21
|
-
newSendId
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
} from "./chunk-QGFURWEP.js";
|
|
21
|
+
newSendId,
|
|
22
|
+
refusedPlace,
|
|
23
|
+
uploadSize
|
|
24
|
+
} from "./chunk-3GX6KM2E.js";
|
|
26
25
|
import {
|
|
27
26
|
isNewer,
|
|
28
27
|
updateCommand
|
|
29
|
-
} from "./chunk-
|
|
28
|
+
} from "./chunk-HOF7GQWW.js";
|
|
30
29
|
import {
|
|
31
30
|
capability
|
|
32
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-6WS6GJ4V.js";
|
|
33
32
|
import {
|
|
34
33
|
LIST_QUERY_GUIDE,
|
|
35
34
|
dateWindow,
|
|
36
35
|
momentOf
|
|
37
|
-
} from "./chunk-
|
|
36
|
+
} from "./chunk-K7YY6SXR.js";
|
|
37
|
+
import {
|
|
38
|
+
hide,
|
|
39
|
+
isHidden
|
|
40
|
+
} from "./chunk-WOPVBRPV.js";
|
|
38
41
|
import {
|
|
39
42
|
EmptyAnswer,
|
|
40
43
|
MAX_MODEL_IMAGE_BYTES,
|
|
@@ -43,7 +46,7 @@ import {
|
|
|
43
46
|
range,
|
|
44
47
|
systemFor,
|
|
45
48
|
validateImages
|
|
46
|
-
} from "./chunk-
|
|
49
|
+
} from "./chunk-R53XXHEI.js";
|
|
47
50
|
import {
|
|
48
51
|
anyOfTerms,
|
|
49
52
|
isFunctionWord,
|
|
@@ -54,16 +57,16 @@ import {
|
|
|
54
57
|
questionText,
|
|
55
58
|
resolveMeetingSelection,
|
|
56
59
|
words
|
|
57
|
-
} from "./chunk-
|
|
60
|
+
} from "./chunk-5UTB3ADZ.js";
|
|
58
61
|
import {
|
|
59
62
|
DEFAULT_IMAGE_MODEL,
|
|
60
63
|
LINK,
|
|
61
64
|
WEIGHTS,
|
|
62
65
|
agenda,
|
|
63
|
-
ancestorValue,
|
|
64
66
|
attachment,
|
|
65
67
|
codeOf,
|
|
66
68
|
conversation,
|
|
69
|
+
deadlineMargin,
|
|
67
70
|
envName,
|
|
68
71
|
guardedWrite,
|
|
69
72
|
historyWindow,
|
|
@@ -73,11 +76,10 @@ import {
|
|
|
73
76
|
oddName,
|
|
74
77
|
parseDuration,
|
|
75
78
|
placedImage,
|
|
76
|
-
readOnlyLockOf,
|
|
77
79
|
sentIds,
|
|
78
80
|
tagging,
|
|
79
81
|
task
|
|
80
|
-
} from "./chunk-
|
|
82
|
+
} from "./chunk-63N46DJU.js";
|
|
81
83
|
import {
|
|
82
84
|
CustomTextModelShape,
|
|
83
85
|
DEFAULT_RERANK_MODEL,
|
|
@@ -91,7 +93,7 @@ import {
|
|
|
91
93
|
textModels,
|
|
92
94
|
vectorModelKey,
|
|
93
95
|
writeTextModelsSection
|
|
94
|
-
} from "./chunk-
|
|
96
|
+
} from "./chunk-IB55P46L.js";
|
|
95
97
|
import {
|
|
96
98
|
AGENDA_COLUMNS,
|
|
97
99
|
BUSINESS_FIND_MAX,
|
|
@@ -140,19 +142,22 @@ import {
|
|
|
140
142
|
profilesOn,
|
|
141
143
|
queryFilter,
|
|
142
144
|
rankingContextRange,
|
|
145
|
+
respelled,
|
|
143
146
|
threadConversation,
|
|
147
|
+
trackerBodyOf,
|
|
148
|
+
trackerTitleOf,
|
|
144
149
|
withoutField
|
|
145
|
-
} from "./chunk-
|
|
150
|
+
} from "./chunk-KEKXERBE.js";
|
|
146
151
|
import {
|
|
147
152
|
DEFAULT_STEMMERS,
|
|
148
153
|
createStemmer,
|
|
149
154
|
cutsDeep
|
|
150
|
-
} from "./chunk-
|
|
155
|
+
} from "./chunk-UDSL3MUU.js";
|
|
151
156
|
import {
|
|
152
157
|
MINUTE,
|
|
153
158
|
YEAR,
|
|
154
159
|
aheadOf
|
|
155
|
-
} from "./chunk-
|
|
160
|
+
} from "./chunk-633NQY2R.js";
|
|
156
161
|
import {
|
|
157
162
|
FIELD_VERSION,
|
|
158
163
|
RRF_K,
|
|
@@ -161,7 +166,7 @@ import {
|
|
|
161
166
|
plainQuery,
|
|
162
167
|
validateAst,
|
|
163
168
|
validateFields
|
|
164
|
-
} from "./chunk-
|
|
169
|
+
} from "./chunk-KZN2BG3P.js";
|
|
165
170
|
import {
|
|
166
171
|
TASK_KINDS,
|
|
167
172
|
TASK_STATES,
|
|
@@ -175,23 +180,23 @@ import {
|
|
|
175
180
|
sourceOf3 as sourceOf2,
|
|
176
181
|
typedCommand,
|
|
177
182
|
withAttempt
|
|
178
|
-
} from "./chunk-
|
|
183
|
+
} from "./chunk-PPSAWFJD.js";
|
|
179
184
|
import {
|
|
180
185
|
isCliFailure,
|
|
181
186
|
sqliteCode
|
|
182
|
-
} from "./chunk-
|
|
187
|
+
} from "./chunk-JLXXUEAM.js";
|
|
183
188
|
import {
|
|
184
189
|
localOnly,
|
|
185
190
|
refuseOffComputer,
|
|
186
191
|
remoteKey
|
|
187
|
-
} from "./chunk-
|
|
192
|
+
} from "./chunk-3DEQUYEG.js";
|
|
188
193
|
import {
|
|
189
194
|
PLAIN_HTTP_REFUSED,
|
|
190
195
|
endpoint,
|
|
191
196
|
endpointFetch,
|
|
192
197
|
modelAddressAllowed,
|
|
193
198
|
onThisComputer
|
|
194
|
-
} from "./chunk-
|
|
199
|
+
} from "./chunk-G2TU5RYY.js";
|
|
195
200
|
import {
|
|
196
201
|
Unzip,
|
|
197
202
|
UnzipInflate,
|
|
@@ -202,11 +207,11 @@ import {
|
|
|
202
207
|
placedText,
|
|
203
208
|
runEmbedders,
|
|
204
209
|
textModelsDirectory
|
|
205
|
-
} from "./chunk-
|
|
210
|
+
} from "./chunk-ADTI5RUO.js";
|
|
206
211
|
import {
|
|
207
212
|
installFiles,
|
|
208
213
|
megabytes
|
|
209
|
-
} from "./chunk-
|
|
214
|
+
} from "./chunk-XCCU2E3Z.js";
|
|
210
215
|
import {
|
|
211
216
|
MAX_ACTIONS,
|
|
212
217
|
ModerationRules,
|
|
@@ -220,7 +225,7 @@ import {
|
|
|
220
225
|
someUndone,
|
|
221
226
|
validateFormattedText,
|
|
222
227
|
visibleFormattedText
|
|
223
|
-
} from "./chunk-
|
|
228
|
+
} from "./chunk-NSKMNIY6.js";
|
|
224
229
|
import {
|
|
225
230
|
COUNTER_FIELDS,
|
|
226
231
|
RANKING_TOKENIZER_VERSION,
|
|
@@ -237,7 +242,7 @@ import {
|
|
|
237
242
|
pickPerson,
|
|
238
243
|
rankingOptions,
|
|
239
244
|
rankingQuestion
|
|
240
|
-
} from "./chunk-
|
|
245
|
+
} from "./chunk-EHK73OSW.js";
|
|
241
246
|
import {
|
|
242
247
|
MESSAGE_PARSING,
|
|
243
248
|
QUERY_LIMITS,
|
|
@@ -247,16 +252,17 @@ import {
|
|
|
247
252
|
isQueryLimit,
|
|
248
253
|
outOfTime,
|
|
249
254
|
searchError
|
|
250
|
-
} from "./chunk-
|
|
255
|
+
} from "./chunk-IG2TJQJ7.js";
|
|
251
256
|
import {
|
|
252
257
|
fold,
|
|
253
258
|
normalize
|
|
254
|
-
} from "./chunk-
|
|
259
|
+
} from "./chunk-2JHVQMVC.js";
|
|
255
260
|
import {
|
|
256
261
|
INTERNAL_NOTES,
|
|
257
262
|
UNKNOWN_PROVIDER,
|
|
258
263
|
formatLocator,
|
|
259
264
|
formatReference,
|
|
265
|
+
hasGlobalItemIds,
|
|
260
266
|
holdsKind,
|
|
261
267
|
isDocumentAccountProvider,
|
|
262
268
|
isFolderProvider,
|
|
@@ -266,10 +272,10 @@ import {
|
|
|
266
272
|
kindIn,
|
|
267
273
|
parseLocator,
|
|
268
274
|
parseReference
|
|
269
|
-
} from "./chunk-
|
|
275
|
+
} from "./chunk-ZLUIRFJX.js";
|
|
270
276
|
import {
|
|
271
277
|
normalizeTag
|
|
272
|
-
} from "./chunk-
|
|
278
|
+
} from "./chunk-RRTMPSQR.js";
|
|
273
279
|
import {
|
|
274
280
|
OPERATORS_BY_TYPE,
|
|
275
281
|
READ_BUDGET_EXCEEDED,
|
|
@@ -294,23 +300,22 @@ import {
|
|
|
294
300
|
validateQuery,
|
|
295
301
|
walkQuery,
|
|
296
302
|
windowOf
|
|
297
|
-
} from "./chunk-
|
|
303
|
+
} from "./chunk-DSJ6EAOA.js";
|
|
298
304
|
import {
|
|
299
305
|
DEFAULT_TASK_CATEGORIES,
|
|
300
306
|
FALLBACK_CATEGORY,
|
|
301
307
|
readSharedSection,
|
|
302
308
|
sharedConfigPath,
|
|
303
309
|
writeSharedSection
|
|
304
|
-
} from "./chunk-
|
|
310
|
+
} from "./chunk-AKRIUNYP.js";
|
|
305
311
|
import {
|
|
306
|
-
storePath
|
|
307
|
-
|
|
308
|
-
} from "./chunk-ZKRWNL4T.js";
|
|
312
|
+
storePath
|
|
313
|
+
} from "./chunk-TLG6ECZ2.js";
|
|
309
314
|
import {
|
|
310
315
|
Credentials,
|
|
311
316
|
pathsAreOverridden,
|
|
312
317
|
resolvePaths
|
|
313
|
-
} from "./chunk-
|
|
318
|
+
} from "./chunk-WIHN3ELW.js";
|
|
314
319
|
import {
|
|
315
320
|
array,
|
|
316
321
|
check,
|
|
@@ -336,7 +341,7 @@ import {
|
|
|
336
341
|
trim,
|
|
337
342
|
union,
|
|
338
343
|
unknown
|
|
339
|
-
} from "./chunk-
|
|
344
|
+
} from "./chunk-QFOP3KUP.js";
|
|
340
345
|
import {
|
|
341
346
|
importFrom,
|
|
342
347
|
resolveFrom
|
|
@@ -345,7 +350,7 @@ import {
|
|
|
345
350
|
CliError,
|
|
346
351
|
isCliError,
|
|
347
352
|
singleLine
|
|
348
|
-
} from "./chunk-
|
|
353
|
+
} from "./chunk-S6JG4YUH.js";
|
|
349
354
|
import {
|
|
350
355
|
__commonJS,
|
|
351
356
|
__name,
|
|
@@ -13075,7 +13080,7 @@ var require_lib2 = __commonJS({
|
|
|
13075
13080
|
return matches;
|
|
13076
13081
|
}, "analyse");
|
|
13077
13082
|
exports.analyse = analyse2;
|
|
13078
|
-
var detectFile = /* @__PURE__ */ __name((filepath, opts = {}) => new Promise((
|
|
13083
|
+
var detectFile = /* @__PURE__ */ __name((filepath, opts = {}) => new Promise((resolve6, reject) => {
|
|
13079
13084
|
let fd;
|
|
13080
13085
|
const fs = (0, node_1.default)();
|
|
13081
13086
|
const handler = /* @__PURE__ */ __name((err, buffer) => {
|
|
@@ -13085,7 +13090,7 @@ var require_lib2 = __commonJS({
|
|
|
13085
13090
|
if (err) {
|
|
13086
13091
|
reject(err);
|
|
13087
13092
|
} else if (buffer) {
|
|
13088
|
-
|
|
13093
|
+
resolve6((0, exports.detect)(buffer));
|
|
13089
13094
|
} else {
|
|
13090
13095
|
reject(new Error("No error and no buffer received"));
|
|
13091
13096
|
}
|
|
@@ -16961,10 +16966,10 @@ var require_lib3 = __commonJS({
|
|
|
16961
16966
|
}
|
|
16962
16967
|
});
|
|
16963
16968
|
|
|
16964
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
16969
|
+
// node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/ports/traits.js
|
|
16965
16970
|
var syncsOneChat = /* @__PURE__ */ __name((messenger) => messenger.history !== "store" || messenger.historyOnDemand === true, "syncsOneChat");
|
|
16966
16971
|
|
|
16967
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
16972
|
+
// node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/services/questions.js
|
|
16968
16973
|
var LINKS = /https?:\/\/\S+/g;
|
|
16969
16974
|
var unanswered = /* @__PURE__ */ __name((messages, { answerers: answerers2, before }) => questions(messages, { answerers: answerers2 }).filter(({ question, answer }) => answer === void 0 && Date.parse(question.timestamp) < before).map(({ question }) => question), "unanswered");
|
|
16970
16975
|
var questions = /* @__PURE__ */ __name((messages, { answerers: answerers2, asker = "others" }) => {
|
|
@@ -16994,7 +16999,7 @@ var questions = /* @__PURE__ */ __name((messages, { answerers: answerers2, asker
|
|
|
16994
16999
|
});
|
|
16995
17000
|
}, "questions");
|
|
16996
17001
|
|
|
16997
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
17002
|
+
// node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/services/task-categories.js
|
|
16998
17003
|
var names = /* @__PURE__ */ __name((categories) => categories.map(({ name }) => name).join(", "), "names");
|
|
16999
17004
|
var taskCategoryOf = /* @__PURE__ */ __name((categories = DEFAULT_TASK_CATEGORIES, flag = "--category") => (typed) => {
|
|
17000
17005
|
const name = typed.trim().toLowerCase();
|
|
@@ -17051,7 +17056,7 @@ var categorize = /* @__PURE__ */ __name((text2, categories = DEFAULT_TASK_CATEGO
|
|
|
17051
17056
|
return best.name;
|
|
17052
17057
|
}, "categorize");
|
|
17053
17058
|
|
|
17054
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
17059
|
+
// node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/services/task-rules.js
|
|
17055
17060
|
var taskAccount = /* @__PURE__ */ __name(({ provider, account }) => `${provider}:${account}`, "taskAccount");
|
|
17056
17061
|
var RULES_IN = {
|
|
17057
17062
|
dialog: "all",
|
|
@@ -17077,7 +17082,7 @@ var applyTaskRules = /* @__PURE__ */ __name(async (review, { store, account, now
|
|
|
17077
17082
|
const owner = taskAccount(account);
|
|
17078
17083
|
const result = { added: 0, closed: 0, review: 0 };
|
|
17079
17084
|
const sourceOf3 = /* @__PURE__ */ __name((message) => formatLocator({ provider: account.provider, account: account.account, chat: message.chatId, message: message.id }), "sourceOf");
|
|
17080
|
-
const
|
|
17085
|
+
const open6 = /* @__PURE__ */ __name(async (message, group, kind) => {
|
|
17081
17086
|
const { created, review: review2 = 0 } = await tasks.add({
|
|
17082
17087
|
source: sourceOf3(message),
|
|
17083
17088
|
sourceKind: "message",
|
|
@@ -17134,7 +17139,7 @@ var applyTaskRules = /* @__PURE__ */ __name(async (review, { store, account, now
|
|
|
17134
17139
|
let held = 0;
|
|
17135
17140
|
for (const [index, { message, kind }] of opens.entries()) {
|
|
17136
17141
|
if (index >= opens.length - keep2)
|
|
17137
|
-
await
|
|
17142
|
+
await open6(message, chat.id, kind);
|
|
17138
17143
|
else if (!await hasTask(message)) {
|
|
17139
17144
|
held += 1;
|
|
17140
17145
|
onHeld?.({ source: sourceOf3(message), kind, category: categorize(message.text, categories) });
|
|
@@ -17257,7 +17262,7 @@ var applyTaskRulesToChats = /* @__PURE__ */ __name(async (store, account, chatId
|
|
|
17257
17262
|
return passes;
|
|
17258
17263
|
}, "applyTaskRulesToChats");
|
|
17259
17264
|
|
|
17260
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
17265
|
+
// node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/conversations/link.js
|
|
17261
17266
|
var RULES_VERSION = 6;
|
|
17262
17267
|
var LOOK_BACK = 50;
|
|
17263
17268
|
var SAME_SENDER_WITHIN = 10;
|
|
@@ -17355,223 +17360,7 @@ var latest = /* @__PURE__ */ __name((window2, matches) => {
|
|
|
17355
17360
|
var sameThread = /* @__PURE__ */ __name((a, b) => a.threadId === b.threadId, "sameThread");
|
|
17356
17361
|
var link = /* @__PURE__ */ __name((message, parentId, source, kind, confidence, method) => ({ messageId: message.id, parentId, source, kind, confidence, method }), "link");
|
|
17357
17362
|
|
|
17358
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
17359
|
-
import { openAsBlob, realpathSync } from "node:fs";
|
|
17360
|
-
import { open, stat } from "node:fs/promises";
|
|
17361
|
-
import { basename, dirname, extname, isAbsolute, relative, resolve, sep } from "node:path";
|
|
17362
|
-
var MAX_BUFFERED_UPLOAD_BYTES = 256 * 1024 * 1024;
|
|
17363
|
-
var uploadSize = /* @__PURE__ */ __name((source) => source.kind === "file" ? source.size : source.bytes.byteLength, "uploadSize");
|
|
17364
|
-
var PHOTO = /* @__PURE__ */ new Set([".jpg", ".jpeg", ".png", ".webp"]);
|
|
17365
|
-
var VOICE = /* @__PURE__ */ new Set([".ogg", ".oga", ".opus"]);
|
|
17366
|
-
var JPEG = /* @__PURE__ */ __name((head) => head[0] === 255 && head[1] === 216 && head[2] === 255, "JPEG");
|
|
17367
|
-
var SIGNATURES = {
|
|
17368
|
-
".jpg": JPEG,
|
|
17369
|
-
".jpeg": JPEG,
|
|
17370
|
-
".png": /* @__PURE__ */ __name((head) => Buffer.from(head.subarray(0, 8)).toString("latin1") === "\x89PNG\r\n\n", ".png"),
|
|
17371
|
-
".webp": /* @__PURE__ */ __name((head) => {
|
|
17372
|
-
const text2 = Buffer.from(head).toString("latin1");
|
|
17373
|
-
return text2.startsWith("RIFF") && text2.slice(8, 12) === "WEBP";
|
|
17374
|
-
}, ".webp")
|
|
17375
|
-
};
|
|
17376
|
-
var fileHead = /* @__PURE__ */ __name(async (path) => {
|
|
17377
|
-
const file = await open(path, "r");
|
|
17378
|
-
try {
|
|
17379
|
-
const head = new Uint8Array(12);
|
|
17380
|
-
const { bytesRead } = await file.read(head, 0, head.length, 0);
|
|
17381
|
-
return head.subarray(0, bytesRead);
|
|
17382
|
-
} finally {
|
|
17383
|
-
await file.close();
|
|
17384
|
-
}
|
|
17385
|
-
}, "fileHead");
|
|
17386
|
-
var typesText = /* @__PURE__ */ __name((types2) => types2.length < 2 ? types2[0] ?? "" : `${types2.slice(0, -1).join(", ")} or ${types2.at(-1)}`, "typesText");
|
|
17387
|
-
var CREDENTIAL_PARTS = /* @__PURE__ */ new Set([
|
|
17388
|
-
".ssh",
|
|
17389
|
-
".gnupg",
|
|
17390
|
-
".aws",
|
|
17391
|
-
".azure",
|
|
17392
|
-
".kube",
|
|
17393
|
-
".secrets",
|
|
17394
|
-
"secrets",
|
|
17395
|
-
".password-store",
|
|
17396
|
-
".mozilla",
|
|
17397
|
-
".env",
|
|
17398
|
-
".npmrc",
|
|
17399
|
-
".pypirc",
|
|
17400
|
-
".netrc",
|
|
17401
|
-
"_netrc",
|
|
17402
|
-
".git-credentials",
|
|
17403
|
-
"credentials.yml.enc",
|
|
17404
|
-
"master.key"
|
|
17405
|
-
]);
|
|
17406
|
-
var CREDENTIAL_RUNS = [
|
|
17407
|
-
[".config", "autostart"],
|
|
17408
|
-
[".config", "git", "credentials"],
|
|
17409
|
-
[".config", "gh"],
|
|
17410
|
-
[".config", "gcloud"],
|
|
17411
|
-
[".config", "google-chrome"],
|
|
17412
|
-
[".config", "chromium"],
|
|
17413
|
-
[".config", "microsoft-edge"],
|
|
17414
|
-
[".config", "BraveSoftware"],
|
|
17415
|
-
[".docker", "config.json"],
|
|
17416
|
-
[".claude", ".credentials.json"],
|
|
17417
|
-
[".codex", "auth.json"],
|
|
17418
|
-
[".local", "share", "keyrings"],
|
|
17419
|
-
["Library", "Keychains"],
|
|
17420
|
-
["Library", "Cookies"],
|
|
17421
|
-
["Library", "Safari"],
|
|
17422
|
-
["Library", "Application Support", "Google", "Chrome"],
|
|
17423
|
-
["Library", "Application Support", "Chromium"],
|
|
17424
|
-
["Library", "Application Support", "Microsoft Edge"],
|
|
17425
|
-
["Library", "Application Support", "BraveSoftware"],
|
|
17426
|
-
["Library", "Application Support", "Firefox"],
|
|
17427
|
-
["AppData", "Local", "Google", "Chrome"],
|
|
17428
|
-
["AppData", "Local", "Chromium"],
|
|
17429
|
-
["AppData", "Local", "Microsoft", "Edge"],
|
|
17430
|
-
["AppData", "Local", "BraveSoftware"],
|
|
17431
|
-
["AppData", "Roaming", "Mozilla", "Firefox"],
|
|
17432
|
-
["AppData", "Local", "Microsoft", "Credentials"],
|
|
17433
|
-
["AppData", "Roaming", "Microsoft", "Credentials"],
|
|
17434
|
-
["AppData", "Roaming", "Microsoft", "Protect"],
|
|
17435
|
-
["AppData", "Roaming", "gcloud"],
|
|
17436
|
-
["AppData", "Roaming", "GitHub CLI"]
|
|
17437
|
-
];
|
|
17438
|
-
var WIRECAT_APPS = [
|
|
17439
|
-
...WIRECAT_TOOLS.map(({ appName, envPrefix }) => ({ appName, prefix: envPrefix })),
|
|
17440
|
-
{ appName: "beeline-cli", prefix: "BEELINE" },
|
|
17441
|
-
{ appName: "zm", prefix: "ZM" },
|
|
17442
|
-
{ appName: "cli-messaging", prefix: "MESSAGING" },
|
|
17443
|
-
{ appName: "cli-common", prefix: "CLI_COMMON" }
|
|
17444
|
-
];
|
|
17445
|
-
var SYSTEM_ROOTS = ["/proc", "/sys", "/dev"];
|
|
17446
|
-
var systemPlace = /* @__PURE__ */ __name((path, platform) => platform !== "win32" && SYSTEM_ROOTS.some((root) => inside(path, root)), "systemPlace");
|
|
17447
|
-
var realPathOf = /* @__PURE__ */ __name((path) => {
|
|
17448
|
-
let ancestor = resolve(path);
|
|
17449
|
-
for (; ; ) {
|
|
17450
|
-
try {
|
|
17451
|
-
return resolve(realpathSync(ancestor), relative(ancestor, resolve(path)));
|
|
17452
|
-
} catch {
|
|
17453
|
-
const parent = dirname(ancestor);
|
|
17454
|
-
if (parent === ancestor)
|
|
17455
|
-
return resolve(path);
|
|
17456
|
-
ancestor = parent;
|
|
17457
|
-
}
|
|
17458
|
-
}
|
|
17459
|
-
}, "realPathOf");
|
|
17460
|
-
var refuseLockedOutput = /* @__PURE__ */ __name((path, app, env, flag) => {
|
|
17461
|
-
const lock = readOnlyLockOf(app, env);
|
|
17462
|
-
if (lock === void 0)
|
|
17463
|
-
return;
|
|
17464
|
-
const named2 = ancestorValue(envName(app, "WORK_FOLDER"), env);
|
|
17465
|
-
const work = named2 ? realPathOf(named2) : void 0;
|
|
17466
|
-
const real = realPathOf(path);
|
|
17467
|
-
if (work !== void 0 && (real === work || real.startsWith(`${work}${sep}`)))
|
|
17468
|
-
return;
|
|
17469
|
-
throw new CliError("permission_error", work === void 0 ? `this process is read-only (${lock}) \u2014 ${flag} writes a file only inside a scheduled run's work folder` : `this process is read-only (${lock}) \u2014 ${flag} writes only inside its run's work folder, ${work}`, { reason: "read-only.output-outside", param: flag });
|
|
17470
|
-
}, "refuseLockedOutput");
|
|
17471
|
-
var refusedPlace = /* @__PURE__ */ __name((path, app, env, platform = process.platform) => {
|
|
17472
|
-
const own = [
|
|
17473
|
-
...[{ appName: app.appName, prefix: app.envPrefix }, ...WIRECAT_APPS].flatMap((one) => Object.values(resolvePaths({ ...one, env, platform }))),
|
|
17474
|
-
// The shared WireCat folder: the store, its backups beside it, the models.
|
|
17475
|
-
wirecatDirectory(env, platform)
|
|
17476
|
-
];
|
|
17477
|
-
const store = resolve(storePath(env));
|
|
17478
|
-
const real = realPathOf(path);
|
|
17479
|
-
const folded = platform === "darwin" || platform === "win32";
|
|
17480
|
-
const fold2 = /* @__PURE__ */ __name((text2) => folded ? text2.toLowerCase() : text2, "fold");
|
|
17481
|
-
const parts = new Set([...CREDENTIAL_PARTS].map(fold2));
|
|
17482
|
-
const runs = CREDENTIAL_RUNS.map((run2) => run2.map(fold2));
|
|
17483
|
-
const named2 = /* @__PURE__ */ __name((candidate) => {
|
|
17484
|
-
const names2 = candidate.split(sep).map(fold2);
|
|
17485
|
-
return names2.some((name, index) => parts.has(name) || /^\.env\./.test(name) || runs.some((run2) => run2.every((part, offset) => names2[index + offset] === part)));
|
|
17486
|
-
}, "named");
|
|
17487
|
-
const same2 = /* @__PURE__ */ __name((a, b) => fold2(a) === fold2(b), "same");
|
|
17488
|
-
return [resolve(path), real].some((candidate) => systemPlace(candidate, platform) || named2(candidate) || own.some((dir) => inside(fold2(candidate), fold2(dir))) || [store, `${store}-wal`, `${store}-shm`].some((file) => same2(candidate, file)));
|
|
17489
|
-
}, "refusedPlace");
|
|
17490
|
-
var inside = /* @__PURE__ */ __name((path, dir) => {
|
|
17491
|
-
const way = relative(resolve(dir), path);
|
|
17492
|
-
return way === "" || !way.startsWith("..") && !isAbsolute(way);
|
|
17493
|
-
}, "inside");
|
|
17494
|
-
var readUpload = /* @__PURE__ */ __name(async (kind, path, { app, env = process.env, anyFile = false, photoTypes }) => {
|
|
17495
|
-
const extension = extname(path).toLowerCase();
|
|
17496
|
-
if (kind === "photo" && photoTypes !== void 0 && !photoTypes.includes(extension)) {
|
|
17497
|
-
throw new CliError("validation_error", `this photo must be a ${typesText(photoTypes)} file, not ${path}`);
|
|
17498
|
-
}
|
|
17499
|
-
if (kind === "photo" && photoTypes === void 0 && !PHOTO.has(extension)) {
|
|
17500
|
-
throw new CliError("validation_error", `a photo is a .jpg, .png or .webp \u2014 send ${path} as a file instead`);
|
|
17501
|
-
}
|
|
17502
|
-
if (kind === "voice" && !VOICE.has(extension)) {
|
|
17503
|
-
throw new CliError("validation_error", `a voice message is Ogg Opus: .ogg, .oga or .opus \u2014 send ${path} as a file`);
|
|
17504
|
-
}
|
|
17505
|
-
if ([resolve(path), realPathOf(path)].some((candidate) => systemPlace(candidate, process.platform))) {
|
|
17506
|
-
throw new CliError("validation_error", `cannot send ${path}: a file under /proc, /sys or /dev is never sent`);
|
|
17507
|
-
}
|
|
17508
|
-
if (!anyFile && refusedPlace(path, app, env)) {
|
|
17509
|
-
throw new CliError("validation_error", `cannot send ${path}: known credential files, browser profiles, the WireCat apps' folders and the message store are not sent \u2014 the owner adds --allow-any-file to the command if this file is meant to go`);
|
|
17510
|
-
}
|
|
17511
|
-
let size2;
|
|
17512
|
-
let head;
|
|
17513
|
-
try {
|
|
17514
|
-
const info = await stat(path);
|
|
17515
|
-
if (!info.isFile())
|
|
17516
|
-
throw Object.assign(new Error("not a file"), { code: "EISDIR" });
|
|
17517
|
-
size2 = info.size;
|
|
17518
|
-
if (photoTypes !== void 0 && SIGNATURES[extension] !== void 0)
|
|
17519
|
-
head = await fileHead(path);
|
|
17520
|
-
} catch (error) {
|
|
17521
|
-
const code = error.code;
|
|
17522
|
-
const reason = code === "ENOENT" ? "no such file" : code === "EISDIR" ? "it is a folder" : "it cannot be read";
|
|
17523
|
-
throw new CliError("validation_error", `cannot send ${path}: ${reason}`);
|
|
17524
|
-
}
|
|
17525
|
-
if (head !== void 0 && SIGNATURES[extension]?.(head) !== true) {
|
|
17526
|
-
throw new CliError("validation_error", `${path} is not a ${typesText(photoTypes ?? [])} image inside`);
|
|
17527
|
-
}
|
|
17528
|
-
return { kind, name: basename(path), source: { kind: "file", path: resolve(path), size: size2 } };
|
|
17529
|
-
}, "readUpload");
|
|
17530
|
-
var checkFilename = /* @__PURE__ */ __name((filename, files) => {
|
|
17531
|
-
if (files.length === 0)
|
|
17532
|
-
throw new CliError("validation_error", "--filename names a --file; give one");
|
|
17533
|
-
if (files.length > 1)
|
|
17534
|
-
throw new CliError("validation_error", "--filename names one --file; an album keeps its names");
|
|
17535
|
-
if (filename.trim() === "" || /[/\\\0]/.test(filename) || filename.length > 255)
|
|
17536
|
-
throw new CliError("validation_error", "--filename is a name, not a path: no / or \\, at most 255 characters");
|
|
17537
|
-
}, "checkFilename");
|
|
17538
|
-
var listOf = /* @__PURE__ */ __name((value) => value === void 0 ? [] : typeof value === "string" ? [value] : value, "listOf");
|
|
17539
|
-
var readAttachments = /* @__PURE__ */ __name(async ({ photo, file, voice, asFile, filename, text: text2 }, read) => {
|
|
17540
|
-
const photos = listOf(photo);
|
|
17541
|
-
const files = listOf(file);
|
|
17542
|
-
if (voice !== void 0 && (photos.length > 0 || files.length > 0 || (text2 ?? "").trim() !== "")) {
|
|
17543
|
-
throw new CliError("validation_error", "a voice message goes alone \u2014 no text, no file, no photo beside it");
|
|
17544
|
-
}
|
|
17545
|
-
if (asFile && files.length === 0)
|
|
17546
|
-
throw new CliError("validation_error", "--as-file is about a --file; give one");
|
|
17547
|
-
if (filename !== void 0)
|
|
17548
|
-
checkFilename(filename, files);
|
|
17549
|
-
const uploads = [];
|
|
17550
|
-
for (const one of photos)
|
|
17551
|
-
uploads.push(await readUpload("photo", one, read));
|
|
17552
|
-
for (const one of files)
|
|
17553
|
-
uploads.push({
|
|
17554
|
-
...await readUpload("file", one, read),
|
|
17555
|
-
...filename === void 0 ? {} : { name: filename },
|
|
17556
|
-
...asFile ? { asFile: true } : {}
|
|
17557
|
-
});
|
|
17558
|
-
if (voice !== void 0)
|
|
17559
|
-
uploads.push(await readUpload("voice", voice, read));
|
|
17560
|
-
return uploads;
|
|
17561
|
-
}, "readAttachments");
|
|
17562
|
-
var readStickerFile = /* @__PURE__ */ __name(async (path, maxBytes, read) => {
|
|
17563
|
-
if (extname(path).toLowerCase() !== ".webp")
|
|
17564
|
-
throw new CliError("validation_error", `a sticker is a .webp \u2014 send ${path} as a photo or a file instead`);
|
|
17565
|
-
const { name, source } = await readUpload("file", path, read);
|
|
17566
|
-
if (SIGNATURES[".webp"]?.(await fileHead(path)) !== true)
|
|
17567
|
-
throw new CliError("validation_error", `${path} is named .webp but is not a WebP image \u2014 nothing was sent`);
|
|
17568
|
-
const size2 = uploadSize(source);
|
|
17569
|
-
if (size2 > maxBytes)
|
|
17570
|
-
throw new CliError("validation_error", `the sticker is ${Math.ceil(size2 / 1024)} KiB, and this messenger takes at most ${Math.floor(maxBytes / 1024)} KiB \u2014 nothing was sent`);
|
|
17571
|
-
return { name, source };
|
|
17572
|
-
}, "readStickerFile");
|
|
17573
|
-
|
|
17574
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.722.0_@wirecat+cli-base@0.127.0_commander@15.0.0_esbuild@0.28.2_typ_d2bed0cfbe6b4358c89d465b9e07afcb/node_modules/@wirecat/cli-core/dist/services/deps.js
|
|
17363
|
+
// node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/services/deps.js
|
|
17575
17364
|
var accountStore = /* @__PURE__ */ __name(async (deps) => (await deps.store()).forAccount(await deps.account()), "accountStore");
|
|
17576
17365
|
var crossAccount = /* @__PURE__ */ __name((deps, _reason) => deps.store(), "crossAccount");
|
|
17577
17366
|
var NO_LOCAL_STORE = "this answer comes from the messenger, not from the local store";
|
|
@@ -17633,7 +17422,7 @@ var storedDeps = /* @__PURE__ */ __name((messenger, store, account, guard) => ({
|
|
|
17633
17422
|
}), "storedDeps");
|
|
17634
17423
|
var storeModeDeps = /* @__PURE__ */ __name((messenger, store, account, guard) => ({ ...storedDeps(messenger, store, account, guard), offline: false, reads: "store" }), "storeModeDeps");
|
|
17635
17424
|
|
|
17636
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
17425
|
+
// node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/botcheck/check.js
|
|
17637
17426
|
var DAY_MS = 864e5;
|
|
17638
17427
|
var NEW_DAYS = 30;
|
|
17639
17428
|
var SAME_TEXT_MIN = 20;
|
|
@@ -17710,7 +17499,7 @@ var scorePerson = /* @__PURE__ */ __name(({ subject, provider, activity, photos,
|
|
|
17710
17499
|
};
|
|
17711
17500
|
}, "scorePerson");
|
|
17712
17501
|
|
|
17713
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
17502
|
+
// node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/http/time-limit.js
|
|
17714
17503
|
var timeLimit = /* @__PURE__ */ __name((ms) => {
|
|
17715
17504
|
const controller = new AbortController();
|
|
17716
17505
|
const timer = setTimeout(() => controller.abort(new DOMException("The operation timed out.", "TimeoutError")), ms);
|
|
@@ -17726,7 +17515,7 @@ var withTimeLimit = /* @__PURE__ */ __name(async (ms, run2) => {
|
|
|
17726
17515
|
}
|
|
17727
17516
|
}, "withTimeLimit");
|
|
17728
17517
|
|
|
17729
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
17518
|
+
// node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/botcheck/registries.js
|
|
17730
17519
|
var REGISTRIES = {
|
|
17731
17520
|
cas: { title: "Combot Anti-Spam (CAS)", docs: "https://cas.chat/api" },
|
|
17732
17521
|
lols: { title: "lols.bot", docs: "https://api.lols.bot/lols-bot.json" }
|
|
@@ -17813,7 +17602,7 @@ var notCovered = /* @__PURE__ */ __name((messenger, now = /* @__PURE__ */ new Da
|
|
|
17813
17602
|
detail: `lists Telegram accounts only, not ${messenger} ones`
|
|
17814
17603
|
})), "notCovered");
|
|
17815
17604
|
|
|
17816
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
17605
|
+
// node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/botcheck/service.js
|
|
17817
17606
|
var ACTIVITY_MESSAGES = 1e3;
|
|
17818
17607
|
var botCheckService = /* @__PURE__ */ __name((deps) => {
|
|
17819
17608
|
const subjectOf = /* @__PURE__ */ __name(async (reference) => {
|
|
@@ -17901,7 +17690,7 @@ var botCheckService = /* @__PURE__ */ __name((deps) => {
|
|
|
17901
17690
|
};
|
|
17902
17691
|
}, "botCheckService");
|
|
17903
17692
|
|
|
17904
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
17693
|
+
// node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/domain/thread.js
|
|
17905
17694
|
var threadIdOf = /* @__PURE__ */ __name((value) => {
|
|
17906
17695
|
if (value === void 0)
|
|
17907
17696
|
return void 0;
|
|
@@ -17911,7 +17700,7 @@ var threadIdOf = /* @__PURE__ */ __name((value) => {
|
|
|
17911
17700
|
return id2;
|
|
17912
17701
|
}, "threadIdOf");
|
|
17913
17702
|
|
|
17914
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
17703
|
+
// node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/services/chat-stats.js
|
|
17915
17704
|
var TOP_POSTS = 5;
|
|
17916
17705
|
var JOINS = /* @__PURE__ */ new Set(["join", "add"]);
|
|
17917
17706
|
var LEAVES = /* @__PURE__ */ new Set(["leave", "remove"]);
|
|
@@ -18028,7 +17817,7 @@ var median = /* @__PURE__ */ __name((values) => {
|
|
|
18028
17817
|
return Math.round(sorted.length % 2 === 0 ? ((sorted[middle - 1] ?? upper) + upper) / 2 : upper);
|
|
18029
17818
|
}, "median");
|
|
18030
17819
|
|
|
18031
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
17820
|
+
// node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/services/member-history.js
|
|
18032
17821
|
var memberEvents = /* @__PURE__ */ __name((stays, revisions, since = 0) => {
|
|
18033
17822
|
const events = [];
|
|
18034
17823
|
for (const stay of stays) {
|
|
@@ -18060,7 +17849,7 @@ var memberEvents = /* @__PURE__ */ __name((stays, revisions, since = 0) => {
|
|
|
18060
17849
|
return events.filter(({ at }) => Date.parse(at) >= since).sort((a, b) => Date.parse(a.at) - Date.parse(b.at) || a.id.localeCompare(b.id));
|
|
18061
17850
|
}, "memberEvents");
|
|
18062
17851
|
|
|
18063
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
17852
|
+
// node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/services/members-audit.js
|
|
18064
17853
|
var AUDIT_PAGE = 200;
|
|
18065
17854
|
var AUDIT_BUDGET = 10;
|
|
18066
17855
|
var AUDIT_PAUSE_MS = 1e3;
|
|
@@ -18140,7 +17929,7 @@ var burstJoins = /* @__PURE__ */ __name((members) => {
|
|
|
18140
17929
|
return found;
|
|
18141
17930
|
}, "burstJoins");
|
|
18142
17931
|
|
|
18143
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
17932
|
+
// node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/services/message-resolution.js
|
|
18144
17933
|
var readChatId = /* @__PURE__ */ __name(async (deps, reference, store, account) => {
|
|
18145
17934
|
if (deps.reads !== "store")
|
|
18146
17935
|
return keptChatId(deps.messenger, reference, store, account);
|
|
@@ -18305,9 +18094,9 @@ var senderAmong = /* @__PURE__ */ __name(async (store, accounts, reference, fiel
|
|
|
18305
18094
|
var MOST_NAME_MATCHES = 50;
|
|
18306
18095
|
var patternRefused = /* @__PURE__ */ __name((field, pattern, what, found, near2) => {
|
|
18307
18096
|
if (found === 0) {
|
|
18308
|
-
const
|
|
18097
|
+
const inside = `*${pattern.replace(/^\*+|\*+$/gu, "")}*`;
|
|
18309
18098
|
const [closest] = near2;
|
|
18310
|
-
throw new CliError("not_found", `${field}:${pattern} \u2014 no ${what} fits${near2.length ? `; near: ${near2.map(({ label }) => label).join(", ")}` : ""} \u2014 a pattern matches the whole name: ${pattern ===
|
|
18099
|
+
throw new CliError("not_found", `${field}:${pattern} \u2014 no ${what} fits${near2.length ? `; near: ${near2.map(({ label }) => label).join(", ")}` : ""} \u2014 a pattern matches the whole name: ${pattern === inside ? "" : `write ${field}:${inside} for a part of it, or `}the name: ${field}:${JSON.stringify(closest?.label ?? pattern.replace(/[*?]/gu, ""))}`, { reason: "query.no-match", candidates: near2.map(({ candidate }) => candidate) });
|
|
18311
18100
|
}
|
|
18312
18101
|
throw new CliError("validation_error", `${field}:${pattern} fits ${found} ${what}, more than ${MOST_NAME_MATCHES} \u2014 write more of the name`, { reason: "query.too-large", budget: "name matches", limit: MOST_NAME_MATCHES, complete: false });
|
|
18313
18102
|
}, "patternRefused");
|
|
@@ -18341,7 +18130,7 @@ var chatsMatchingIn = /* @__PURE__ */ __name(async (store, accounts, pattern) =>
|
|
|
18341
18130
|
}, "chatsMatchingIn");
|
|
18342
18131
|
var isText = /* @__PURE__ */ __name((value) => typeof value === "string" && value !== "", "isText");
|
|
18343
18132
|
|
|
18344
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
18133
|
+
// node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/services/chats.js
|
|
18345
18134
|
var EVENTS_DAYS = 7;
|
|
18346
18135
|
var TRACKED_DAYS = 30;
|
|
18347
18136
|
var STATS_PAGE = 1e3;
|
|
@@ -18365,7 +18154,7 @@ var deepChecks = /* @__PURE__ */ __name(async (deps, items, deep, pauseMs, regis
|
|
|
18365
18154
|
continue;
|
|
18366
18155
|
}
|
|
18367
18156
|
if (index > 0)
|
|
18368
|
-
await new Promise((
|
|
18157
|
+
await new Promise((resolve6) => setTimeout(resolve6, pauseMs));
|
|
18369
18158
|
const { score, reasons, registries, unknown: unknown3 } = await checks.person(item2.id, {
|
|
18370
18159
|
registries: true,
|
|
18371
18160
|
...registry ? { registry } : {}
|
|
@@ -18622,7 +18411,7 @@ var readMembers = /* @__PURE__ */ __name(async (connection, chat, budget, pauseM
|
|
|
18622
18411
|
let more = true;
|
|
18623
18412
|
for (let page = 0; page < budget && more; page++) {
|
|
18624
18413
|
if (page > 0)
|
|
18625
|
-
await new Promise((
|
|
18414
|
+
await new Promise((resolve6) => setTimeout(resolve6, pauseMs));
|
|
18626
18415
|
const found = await members(chatId ?? chat, { limit: AUDIT_PAGE, offset: read.length });
|
|
18627
18416
|
chatId = found.chatId;
|
|
18628
18417
|
participants = found.participantsCount ?? participants;
|
|
@@ -18636,7 +18425,7 @@ var storedMembers = /* @__PURE__ */ __name(async (store, chatId) => {
|
|
|
18636
18425
|
return members.length === 0 ? null : members;
|
|
18637
18426
|
}, "storedMembers");
|
|
18638
18427
|
|
|
18639
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
18428
|
+
// node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/services/inbox.js
|
|
18640
18429
|
var INBOX_CHATS = 20;
|
|
18641
18430
|
var REVIEW_DAYS = 3;
|
|
18642
18431
|
var UNANSWERED_HOURS = 24;
|
|
@@ -18644,7 +18433,8 @@ var reviewStart = /* @__PURE__ */ __name((now = Date.now()) => now - REVIEW_DAYS
|
|
|
18644
18433
|
var byRecency = /* @__PURE__ */ __name((chats) => chats.toSorted((a, b) => Date.parse(b.lastMessageAt ?? "") - Date.parse(a.lastMessageAt ?? "")), "byRecency");
|
|
18645
18434
|
var isQuiet = /* @__PURE__ */ __name((chat) => (chat.muted === true || chat.archived === true) && (chat.unreadMentions ?? 0) === 0 && chat.markedUnread !== true, "isQuiet");
|
|
18646
18435
|
var heard = /* @__PURE__ */ __name((chats, all) => all ? { heard: chats, quiet: 0 } : { heard: chats.filter((chat) => !isQuiet(chat)), quiet: chats.filter(isQuiet).length }, "heard");
|
|
18647
|
-
var everyChat = /* @__PURE__ */ __name((adapter) => adapter.chats({ offset: 0 }), "everyChat");
|
|
18436
|
+
var everyChat = /* @__PURE__ */ __name((adapter) => adapter.unreadChats ? adapter.unreadChats() : adapter.chats({ offset: 0 }), "everyChat");
|
|
18437
|
+
var leftOf = /* @__PURE__ */ __name((page) => page.left?.length ? { left: page.left } : {}, "leftOf");
|
|
18648
18438
|
var storeReader = /* @__PURE__ */ __name((deps, store, account) => ({
|
|
18649
18439
|
chats: /* @__PURE__ */ __name(async ({ limit, offset }) => {
|
|
18650
18440
|
const newest = new Map((await store.chats.chatStats(account)).map((one) => [one.chatId, one.newestAt]));
|
|
@@ -18697,7 +18487,7 @@ var unreadIn = /* @__PURE__ */ __name(async (adapter, { limit, all = false, kind
|
|
|
18697
18487
|
if (theirs.length > 0)
|
|
18698
18488
|
chats.push({ id: id2, title, kind, unreadCount, messages: theirs, more: count3 > limit });
|
|
18699
18489
|
}
|
|
18700
|
-
return { mode: "unread", chats, skipped, partial: page.hasMore, quiet: quiet2 };
|
|
18490
|
+
return { mode: "unread", chats, skipped, partial: page.hasMore, ...leftOf(page), quiet: quiet2 };
|
|
18701
18491
|
}, "unreadIn");
|
|
18702
18492
|
var newIn = /* @__PURE__ */ __name(async (adapter, { since, points, limit, all = false, kinds }) => {
|
|
18703
18493
|
const page = await everyChat(adapter);
|
|
@@ -18728,6 +18518,7 @@ var newIn = /* @__PURE__ */ __name(async (adapter, { since, points, limit, all =
|
|
|
18728
18518
|
chats,
|
|
18729
18519
|
skipped,
|
|
18730
18520
|
partial: page.hasMore,
|
|
18521
|
+
...leftOf(page),
|
|
18731
18522
|
quiet: quiet2,
|
|
18732
18523
|
checked: checked2
|
|
18733
18524
|
};
|
|
@@ -18776,6 +18567,7 @@ var reviewIn = /* @__PURE__ */ __name(async (adapter, { since, points, chat, kin
|
|
|
18776
18567
|
chats,
|
|
18777
18568
|
skipped,
|
|
18778
18569
|
partial,
|
|
18570
|
+
...leftOf(page),
|
|
18779
18571
|
quiet: quiet2,
|
|
18780
18572
|
...points === void 0 ? {} : { checked: checked2 }
|
|
18781
18573
|
};
|
|
@@ -18789,7 +18581,7 @@ var reviewIn = /* @__PURE__ */ __name(async (adapter, { since, points, chat, kin
|
|
|
18789
18581
|
await onReviewed?.(reviewed);
|
|
18790
18582
|
if (unansweredAfterHours === void 0)
|
|
18791
18583
|
return reviewed;
|
|
18792
|
-
const
|
|
18584
|
+
const open6 = [];
|
|
18793
18585
|
for (const one of reviewed.chats) {
|
|
18794
18586
|
const admins = answerers2.get(one.id);
|
|
18795
18587
|
const questions3 = unanswered(one.messages, {
|
|
@@ -18797,10 +18589,10 @@ var reviewIn = /* @__PURE__ */ __name(async (adapter, { since, points, chat, kin
|
|
|
18797
18589
|
before: now - unansweredAfterHours * 36e5
|
|
18798
18590
|
});
|
|
18799
18591
|
if (questions3.length > 0) {
|
|
18800
|
-
|
|
18592
|
+
open6.push({ ...one, messages: questions3, answeredBy: admins === void 0 ? "owner" : "owner-and-admins" });
|
|
18801
18593
|
}
|
|
18802
18594
|
}
|
|
18803
|
-
return { ...reviewed, chats:
|
|
18595
|
+
return { ...reviewed, chats: open6, unanswered: { olderThanHours: unansweredAfterHours } };
|
|
18804
18596
|
}, "reviewIn");
|
|
18805
18597
|
var inboxService = /* @__PURE__ */ __name((deps) => {
|
|
18806
18598
|
const reader = /* @__PURE__ */ __name(async () => {
|
|
@@ -18811,7 +18603,8 @@ var inboxService = /* @__PURE__ */ __name((deps) => {
|
|
|
18811
18603
|
chats: capability(connection, "chats", "list chats"),
|
|
18812
18604
|
history: capability(connection, "history", "read a chat's history"),
|
|
18813
18605
|
resolve: /* @__PURE__ */ __name((reference) => connection.resolve(reference), "resolve"),
|
|
18814
|
-
...connection.admins ? { admins: capability(connection, "admins", "list a chat's admins") } : {}
|
|
18606
|
+
...connection.admins ? { admins: capability(connection, "admins", "list a chat's admins") } : {},
|
|
18607
|
+
...connection.unreadChats ? { unreadChats: capability(connection, "unreadChats", "count unread chats") } : {}
|
|
18815
18608
|
};
|
|
18816
18609
|
}, "reader");
|
|
18817
18610
|
return {
|
|
@@ -18844,7 +18637,7 @@ var inboxService = /* @__PURE__ */ __name((deps) => {
|
|
|
18844
18637
|
};
|
|
18845
18638
|
}, "inboxService");
|
|
18846
18639
|
|
|
18847
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
18640
|
+
// node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/services/excerpt.js
|
|
18848
18641
|
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");
|
|
18849
18642
|
var excerpt = /* @__PURE__ */ __name((text2, query, size2 = 240, options2 = {}) => {
|
|
18850
18643
|
const flat = text2.replace(/\s+/g, " ").trim();
|
|
@@ -18860,7 +18653,7 @@ var excerpt = /* @__PURE__ */ __name((text2, query, size2 = 240, options2 = {})
|
|
|
18860
18653
|
}, "excerpt");
|
|
18861
18654
|
var withExcerpt = /* @__PURE__ */ __name(({ matchedText, ...hit }, query) => ({ ...hit, excerpt: excerpt(matchedText ?? hit.text, query) }), "withExcerpt");
|
|
18862
18655
|
|
|
18863
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
18656
|
+
// node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/services/person-meetings.js
|
|
18864
18657
|
var SCAN = 1e3;
|
|
18865
18658
|
var SNIPPET = 200;
|
|
18866
18659
|
var SNIPPET_ROWS = 6;
|
|
@@ -18925,7 +18718,7 @@ var personMeetings = /* @__PURE__ */ __name(async (store, people, accounts, { li
|
|
|
18925
18718
|
return { items, total: newest.length, hasMore: cut || newest.length > limit };
|
|
18926
18719
|
}, "personMeetings");
|
|
18927
18720
|
|
|
18928
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
18721
|
+
// node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/services/person-context.js
|
|
18929
18722
|
var CONTEXT_MESSAGES = 10;
|
|
18930
18723
|
var CONTEXT_BYTES = 64 * 1024;
|
|
18931
18724
|
var toContext = /* @__PURE__ */ __name((key, message, chatTitle2) => ({
|
|
@@ -19231,10 +19024,10 @@ var personMessages = /* @__PURE__ */ __name(async (store, asked, reference, { ch
|
|
|
19231
19024
|
};
|
|
19232
19025
|
}, "personMessages");
|
|
19233
19026
|
|
|
19234
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
19027
|
+
// node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/services/meeting-evidence.js
|
|
19235
19028
|
import { createHash } from "node:crypto";
|
|
19236
19029
|
|
|
19237
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
19030
|
+
// node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/services/meeting-reference.js
|
|
19238
19031
|
var missing2 = /* @__PURE__ */ __name(() => new CliError("not_found", "the meeting evidence is unavailable for this account"), "missing");
|
|
19239
19032
|
var authorizedMeetingMetadata = /* @__PURE__ */ __name(async (store, accountId, reference, options2 = {}) => {
|
|
19240
19033
|
const parsed = parseMeetingReference(reference);
|
|
@@ -19252,7 +19045,7 @@ var authorizedMeetingMetadata = /* @__PURE__ */ __name(async (store, accountId,
|
|
|
19252
19045
|
return { parsed, meeting };
|
|
19253
19046
|
}, "authorizedMeetingMetadata");
|
|
19254
19047
|
|
|
19255
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
19048
|
+
// node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/services/meeting-evidence.js
|
|
19256
19049
|
var hash = /* @__PURE__ */ __name((value) => createHash("sha256").update(JSON.stringify(value)).digest("hex"), "hash");
|
|
19257
19050
|
var checkMeetingCancelled = /* @__PURE__ */ __name((signal) => {
|
|
19258
19051
|
if (signal?.aborted)
|
|
@@ -19451,7 +19244,7 @@ var readMeetingEvidence = /* @__PURE__ */ __name(async (store, accountId, refere
|
|
|
19451
19244
|
return { ...packet, fingerprint: hash(packet) };
|
|
19452
19245
|
}, "readMeetingEvidence");
|
|
19453
19246
|
|
|
19454
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
19247
|
+
// node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/services/person-meeting-context.js
|
|
19455
19248
|
var personMeetingContext = /* @__PURE__ */ __name(async (store, personReference, options2) => {
|
|
19456
19249
|
const { meetings = 10, cues = 5, bytes: bytes2 = 64 * 1024, scanLimit = 1e3, since, signal } = options2;
|
|
19457
19250
|
const requestedAccounts = options2.accountIds;
|
|
@@ -19550,7 +19343,7 @@ var personMeetingContext = /* @__PURE__ */ __name(async (store, personReference,
|
|
|
19550
19343
|
};
|
|
19551
19344
|
}, "personMeetingContext");
|
|
19552
19345
|
|
|
19553
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
19346
|
+
// node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/services/person-preparation.js
|
|
19554
19347
|
var PREPARE_BYTES = 96 * 1024;
|
|
19555
19348
|
var MEETINGS = 5;
|
|
19556
19349
|
var CUES = 3;
|
|
@@ -19673,7 +19466,7 @@ var meetingsOf = /* @__PURE__ */ __name(async (store, uid, stored, since, left)
|
|
|
19673
19466
|
}
|
|
19674
19467
|
}, "meetingsOf");
|
|
19675
19468
|
|
|
19676
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
19469
|
+
// node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/services/person-profile.js
|
|
19677
19470
|
var personProfile = /* @__PURE__ */ __name(async (deps, person, known2) => {
|
|
19678
19471
|
const online = deps.offline ? void 0 : await deps.connection();
|
|
19679
19472
|
const held = await storeIfOpen(deps);
|
|
@@ -19743,7 +19536,7 @@ var quiet = /* @__PURE__ */ __name((facts) => facts.chats.map(({ id: id2, title,
|
|
|
19743
19536
|
complete: false
|
|
19744
19537
|
})), "quiet");
|
|
19745
19538
|
|
|
19746
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
19539
|
+
// node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/services/person-timeline.js
|
|
19747
19540
|
var TIMELINE_ITEMS = 50;
|
|
19748
19541
|
var TIMELINE_MAX = 500;
|
|
19749
19542
|
var SCOPES = ["personal", "work"];
|
|
@@ -19805,7 +19598,7 @@ var personTimeline = /* @__PURE__ */ __name(async (store, asked, reference, { sc
|
|
|
19805
19598
|
};
|
|
19806
19599
|
}, "personTimeline");
|
|
19807
19600
|
|
|
19808
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
19601
|
+
// node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/services/chat-coverage.js
|
|
19809
19602
|
var chatCoverage = /* @__PURE__ */ __name(async (store, account, chatIds) => {
|
|
19810
19603
|
const ids = [...new Set(chatIds)];
|
|
19811
19604
|
if (ids.length === 0)
|
|
@@ -19831,7 +19624,7 @@ var chatCoverage = /* @__PURE__ */ __name(async (store, account, chatIds) => {
|
|
|
19831
19624
|
}));
|
|
19832
19625
|
}, "chatCoverage");
|
|
19833
19626
|
|
|
19834
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
19627
|
+
// node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/context/evidence-response.js
|
|
19835
19628
|
var contextSourceKey = /* @__PURE__ */ __name((source) => JSON.stringify([source.kind, source.accountId, source.provider, source.account]), "contextSourceKey");
|
|
19836
19629
|
var validateContextEvidencePage = /* @__PURE__ */ __name((page, request) => {
|
|
19837
19630
|
const fail2 = /* @__PURE__ */ __name(() => {
|
|
@@ -19895,7 +19688,7 @@ var validateContextEvidencePage = /* @__PURE__ */ __name((page, request) => {
|
|
|
19895
19688
|
}
|
|
19896
19689
|
}, "validateContextEvidencePage");
|
|
19897
19690
|
|
|
19898
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
19691
|
+
// node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/context/read-budget.js
|
|
19899
19692
|
var contextReadBudget = /* @__PURE__ */ __name((limits = {}) => {
|
|
19900
19693
|
if (!limits || typeof limits !== "object" || Array.isArray(limits))
|
|
19901
19694
|
throw new CliError("validation_error", "limits needs a context read allowance");
|
|
@@ -19948,7 +19741,7 @@ var contextReadBudget = /* @__PURE__ */ __name((limits = {}) => {
|
|
|
19948
19741
|
};
|
|
19949
19742
|
}, "contextReadBudget");
|
|
19950
19743
|
|
|
19951
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
19744
|
+
// node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/services/context-evidence.js
|
|
19952
19745
|
var createContextEvidenceReader = /* @__PURE__ */ __name((port, allowed, limits) => {
|
|
19953
19746
|
if (!port || typeof port.read !== "function")
|
|
19954
19747
|
throw new CliError("configuration_error", "context evidence reader is unavailable");
|
|
@@ -19992,7 +19785,7 @@ var createContextEvidenceReader = /* @__PURE__ */ __name((port, allowed, limits)
|
|
|
19992
19785
|
};
|
|
19993
19786
|
}, "createContextEvidenceReader");
|
|
19994
19787
|
|
|
19995
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
19788
|
+
// node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/services/project-gathering-around.js
|
|
19996
19789
|
var storedMessageNeighbours = /* @__PURE__ */ __name((messages) => ({
|
|
19997
19790
|
async around(ref, window2) {
|
|
19998
19791
|
const at = parseLocator(ref);
|
|
@@ -20087,7 +19880,7 @@ var storedNeighbours = /* @__PURE__ */ __name((store) => {
|
|
|
20087
19880
|
};
|
|
20088
19881
|
}, "storedNeighbours");
|
|
20089
19882
|
|
|
20090
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
19883
|
+
// node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/services/project-gathering-request.js
|
|
20091
19884
|
import { createHash as createHash2 } from "node:crypto";
|
|
20092
19885
|
var DAY = 864e5;
|
|
20093
19886
|
var MAX_TIME = 864e13;
|
|
@@ -20403,7 +20196,7 @@ var decodeCheckpoint = /* @__PURE__ */ __name((text2, plan) => {
|
|
|
20403
20196
|
return value;
|
|
20404
20197
|
}, "decodeCheckpoint");
|
|
20405
20198
|
|
|
20406
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
20199
|
+
// node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/services/project-gathering.js
|
|
20407
20200
|
var terminal = /* @__PURE__ */ new Set(["done", "unavailable", "failed"]);
|
|
20408
20201
|
var PAGE = 20;
|
|
20409
20202
|
var PEOPLE = 20;
|
|
@@ -20528,9 +20321,9 @@ var gatherProjectEvidence = /* @__PURE__ */ __name(async (ports, request) => {
|
|
|
20528
20321
|
const matchedAgain = /* @__PURE__ */ new Map();
|
|
20529
20322
|
const oversized = /* @__PURE__ */ new Map();
|
|
20530
20323
|
let stopped = null;
|
|
20531
|
-
const
|
|
20324
|
+
const open6 = /* @__PURE__ */ __name((u) => !terminal.has(u.state) && u.state !== "read-limited", "open");
|
|
20532
20325
|
const linkedLanes = new Set(plan.linkedChats.flatMap((c) => c.lane === null ? [] : [c.lane]));
|
|
20533
|
-
const openLanes = new Set(progress.flatMap((u, index) =>
|
|
20326
|
+
const openLanes = new Set(progress.flatMap((u, index) => open6(u) ? [units2[index]?.lane.id] : []));
|
|
20534
20327
|
const shares = [...linkedLanes].filter((id2) => openLanes.has(id2)).length + ([...openLanes].some((id2) => id2 !== void 0 && !linkedLanes.has(id2)) ? 1 : 0);
|
|
20535
20328
|
const linkedLimit = Math.max(PAGE, Math.floor(plan.budgets.maxItems / Math.max(1, shares)));
|
|
20536
20329
|
const linkedTaken = /* @__PURE__ */ new Map();
|
|
@@ -20589,9 +20382,9 @@ var gatherProjectEvidence = /* @__PURE__ */ __name(async (ports, request) => {
|
|
|
20589
20382
|
if (linkedLanes.has(lane.id))
|
|
20590
20383
|
linkedTaken.set(lane.id, (linkedTaken.get(lane.id) ?? 0) + 1);
|
|
20591
20384
|
}, "take");
|
|
20592
|
-
const shallowest = progress.reduce((low, u) =>
|
|
20385
|
+
const shallowest = progress.reduce((low, u) => open6(u) ? Math.min(low, u.pages) : low, Number.POSITIVE_INFINITY);
|
|
20593
20386
|
for (let round = shallowest; !stopped; round++) {
|
|
20594
|
-
const due = progress.flatMap((u, index) =>
|
|
20387
|
+
const due = progress.flatMap((u, index) => open6(u) && u.pages <= round && !capped3.has(units2[index]?.lane.id ?? "") ? [index] : []);
|
|
20595
20388
|
if (!due.length)
|
|
20596
20389
|
break;
|
|
20597
20390
|
for (const index of due) {
|
|
@@ -20807,7 +20600,7 @@ var peopleOf = /* @__PURE__ */ __name((items, senderOf) => {
|
|
|
20807
20600
|
return [...byKey.values()].sort((a, b) => b.items - a.items || a.name.localeCompare(b.name));
|
|
20808
20601
|
}, "peopleOf");
|
|
20809
20602
|
|
|
20810
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
20603
|
+
// node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/services/meeting-project-candidate-matching.js
|
|
20811
20604
|
var normalizedText = /* @__PURE__ */ __name((text2) => text2.normalize("NFKC").toLowerCase().replace(/\s+/gu, " "), "normalizedText");
|
|
20812
20605
|
var termsOf = /* @__PURE__ */ __name((entry) => [
|
|
20813
20606
|
{ name: entry.name, kind: "canonical" },
|
|
@@ -20851,7 +20644,7 @@ var matchVocabularyTerms = /* @__PURE__ */ __name((catalog, texts) => {
|
|
|
20851
20644
|
return result.sort((a, b) => Number(a.entry.id) - Number(b.entry.id));
|
|
20852
20645
|
}, "matchVocabularyTerms");
|
|
20853
20646
|
|
|
20854
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
20647
|
+
// node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/services/project-gathering-mentions.js
|
|
20855
20648
|
var KINDS = ["project", "tag", "topic"];
|
|
20856
20649
|
var findEvidenceMentions = /* @__PURE__ */ __name(async (vocabulary, gathering, options2 = {}) => {
|
|
20857
20650
|
if (typeof vocabulary?.vocabulary !== "function")
|
|
@@ -20906,7 +20699,7 @@ var findEvidenceMentions = /* @__PURE__ */ __name(async (vocabulary, gathering,
|
|
|
20906
20699
|
};
|
|
20907
20700
|
}, "findEvidenceMentions");
|
|
20908
20701
|
|
|
20909
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
20702
|
+
// node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/services/project-purposes.js
|
|
20910
20703
|
var BUILT_IN_PURPOSES = ["work", "sales", "support", "other"];
|
|
20911
20704
|
var DEFAULT_PURPOSES = ["work"];
|
|
20912
20705
|
var LINK_PURPOSE = "work";
|
|
@@ -20936,7 +20729,7 @@ var purposeList = /* @__PURE__ */ __name((value, previous = []) => [
|
|
|
20936
20729
|
...value.split(",").map((one) => one.trim()).filter(Boolean)
|
|
20937
20730
|
], "purposeList");
|
|
20938
20731
|
|
|
20939
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
20732
|
+
// node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/services/stored-project-gathering.js
|
|
20940
20733
|
var storedChatCount = /* @__PURE__ */ __name((store) => async (account, chatId, { since, until }) => {
|
|
20941
20734
|
const window2 = { since: new Date(since).toISOString(), until: new Date(until - 1).toISOString() };
|
|
20942
20735
|
const [messages, newest, oldest] = await Promise.all([
|
|
@@ -21247,7 +21040,7 @@ var purposeHintOf = /* @__PURE__ */ __name((linked, rows, of) => {
|
|
|
21247
21040
|
return { chat: top.ref, relationship: link4.relationship, items, of };
|
|
21248
21041
|
}, "purposeHintOf");
|
|
21249
21042
|
|
|
21250
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
21043
|
+
// node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/services/people.js
|
|
21251
21044
|
var peopleService = /* @__PURE__ */ __name((deps) => {
|
|
21252
21045
|
const localCard = /* @__PURE__ */ __name(async (card, includeNotes = false) => {
|
|
21253
21046
|
const held = await storeIfOpen(deps);
|
|
@@ -21512,7 +21305,7 @@ var withoutPhone = /* @__PURE__ */ __name((answer) => {
|
|
|
21512
21305
|
return rest;
|
|
21513
21306
|
}, "withoutPhone");
|
|
21514
21307
|
|
|
21515
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
21308
|
+
// node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/services/task-stats.js
|
|
21516
21309
|
var TASK_STATS_BY = ["chat", "meeting", "project"];
|
|
21517
21310
|
var PERIOD_FIELD = "created";
|
|
21518
21311
|
var refuseNestedPeriod = /* @__PURE__ */ __name((node, top = true) => {
|
|
@@ -21535,9 +21328,9 @@ var median2 = /* @__PURE__ */ __name((values) => {
|
|
|
21535
21328
|
return sorted.length % 2 === 1 ? upper : ((sorted[middle - 1] ?? 0) + upper) / 2;
|
|
21536
21329
|
}, "median");
|
|
21537
21330
|
var mean = /* @__PURE__ */ __name((values) => Math.round(values.reduce((sum2, one) => sum2 + one, 0) / values.length), "mean");
|
|
21538
|
-
var spread = /* @__PURE__ */ __name((
|
|
21331
|
+
var spread = /* @__PURE__ */ __name((open6, closeMs, now) => ({
|
|
21539
21332
|
...closeMs.length > 0 ? { medianCloseMs: median2(closeMs) } : {},
|
|
21540
|
-
...
|
|
21333
|
+
...open6.length > 0 ? { meanOpenAgeMs: mean(open6.map(({ createdAt }) => now - createdAt)) } : {}
|
|
21541
21334
|
}), "spread");
|
|
21542
21335
|
var and = /* @__PURE__ */ __name((parts) => parts.length === 0 ? void 0 : { sql: parts.map(({ sql }) => `(${sql})`).join(" AND "), params: parts.flatMap(({ params }) => params) }, "and");
|
|
21543
21336
|
var taskStatsOf = /* @__PURE__ */ __name(async (store, accounts, { by = "chat", query, timezone, group, kind }, columns, now = Date.now()) => {
|
|
@@ -21598,15 +21391,15 @@ var taskStatsOf = /* @__PURE__ */ __name(async (store, accounts, { by = "chat",
|
|
|
21598
21391
|
...one.open[0] ? { oldestOpenAt: new Date(one.open[0].createdAt) } : {},
|
|
21599
21392
|
...spread(one.open, one.closeMs, now)
|
|
21600
21393
|
}));
|
|
21601
|
-
const
|
|
21394
|
+
const open6 = kept2.flatMap((one) => one.open);
|
|
21602
21395
|
const closeMs = kept2.flatMap((one) => one.closeMs);
|
|
21603
21396
|
return {
|
|
21604
21397
|
by,
|
|
21605
21398
|
...several ? { accounts: [...list2] } : {},
|
|
21606
|
-
open:
|
|
21399
|
+
open: open6.length,
|
|
21607
21400
|
created: created.length,
|
|
21608
21401
|
closed: closeMs.length,
|
|
21609
|
-
...spread(
|
|
21402
|
+
...spread(open6, closeMs, now),
|
|
21610
21403
|
rows
|
|
21611
21404
|
};
|
|
21612
21405
|
}, "taskStatsOf");
|
|
@@ -21643,7 +21436,7 @@ var meetingNames = /* @__PURE__ */ __name(async (store, groups) => {
|
|
|
21643
21436
|
}));
|
|
21644
21437
|
}, "meetingNames");
|
|
21645
21438
|
|
|
21646
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
21439
|
+
// node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/services/task-tag-filters.js
|
|
21647
21440
|
var taskTagFilters = /* @__PURE__ */ __name(async (store, query) => {
|
|
21648
21441
|
const tags = /* @__PURE__ */ new Map();
|
|
21649
21442
|
for (const node of query ? walkQuery(query.root) : [])
|
|
@@ -21652,7 +21445,7 @@ var taskTagFilters = /* @__PURE__ */ __name(async (store, query) => {
|
|
|
21652
21445
|
return tags;
|
|
21653
21446
|
}, "taskTagFilters");
|
|
21654
21447
|
|
|
21655
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
21448
|
+
// node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/services/tasks.js
|
|
21656
21449
|
var TASK_QUERY = {
|
|
21657
21450
|
entity: "task",
|
|
21658
21451
|
backend: "sql",
|
|
@@ -21779,8 +21572,8 @@ var taskStateOf = oneOf(TASK_STATES, "task state", "--state");
|
|
|
21779
21572
|
var closedStateOf = oneOf(["done", "dismissed"], "way to close a task", "--as");
|
|
21780
21573
|
var taskLinkKindOf = oneOf(TASK_LINK_OPTION_KINDS, "link kind", "--kind");
|
|
21781
21574
|
var tasksService = /* @__PURE__ */ __name((deps, categories) => {
|
|
21782
|
-
const
|
|
21783
|
-
const categoryOf = /* @__PURE__ */ __name(async (store, name) => taskCategoryOf(await
|
|
21575
|
+
const listOf = /* @__PURE__ */ __name(async (store) => categories ?? await store.tasks.categories(), "listOf");
|
|
21576
|
+
const categoryOf = /* @__PURE__ */ __name(async (store, name) => taskCategoryOf(await listOf(store))(name), "categoryOf");
|
|
21784
21577
|
const inStore = /* @__PURE__ */ __name(async (work) => work(await deps.store(), await deps.account()), "inStore");
|
|
21785
21578
|
const service = /* @__PURE__ */ __name((store) => createTaskService({ store: store.tasks }), "service");
|
|
21786
21579
|
const groupOf = /* @__PURE__ */ __name(async (store, account, chat) => chat === void 0 ? void 0 : storedChatId(deps.messenger, chat, store, account, { includeLeft: true }), "groupOf");
|
|
@@ -21811,8 +21604,8 @@ var tasksService = /* @__PURE__ */ __name((deps, categories) => {
|
|
|
21811
21604
|
const planOf = /* @__PURE__ */ __name(async (store, id2, plan, by) => {
|
|
21812
21605
|
if (plan.category !== void 0)
|
|
21813
21606
|
plan = { ...plan, category: await categoryOf(store, plan.category) };
|
|
21814
|
-
const
|
|
21815
|
-
if (!
|
|
21607
|
+
const open6 = !isClosedState((await store.tasks.details(id2)).status);
|
|
21608
|
+
if (!open6 && (plan.dueAt != null || plan.nextCheckAt != null))
|
|
21816
21609
|
throw new CliError("validation_error", "a closed task takes no due date or next check; it stays closed");
|
|
21817
21610
|
const { assignees, ...fields } = plan;
|
|
21818
21611
|
const author = by === "owner" ? "owner" : { bot: by };
|
|
@@ -21932,7 +21725,7 @@ var tasksService = /* @__PURE__ */ __name((deps, categories) => {
|
|
|
21932
21725
|
kind: type,
|
|
21933
21726
|
origin,
|
|
21934
21727
|
...plan.dueAt ? { dueAt: plan.dueAt } : {},
|
|
21935
|
-
category: chosen ?? categorize(await sourceText(), await
|
|
21728
|
+
category: chosen ?? categorize(await sourceText(), await listOf(store))
|
|
21936
21729
|
});
|
|
21937
21730
|
const task2 = await store.tasks.get(added.id) ?? added;
|
|
21938
21731
|
if (created && choice.new)
|
|
@@ -21945,7 +21738,7 @@ var tasksService = /* @__PURE__ */ __name((deps, categories) => {
|
|
|
21945
21738
|
const card = await planOf(store, task2.id, plan, origin);
|
|
21946
21739
|
return { task: await taskView(store, account, task2), created, ...followed, card };
|
|
21947
21740
|
}), "add"),
|
|
21948
|
-
categories: /* @__PURE__ */ __name(() => inStore(async (store) =>
|
|
21741
|
+
categories: /* @__PURE__ */ __name(() => inStore(async (store) => listOf(store)), "categories"),
|
|
21949
21742
|
unlistedCategories: /* @__PURE__ */ __name(() => inStore(async (store) => store.tasks.unlistedCategories()), "unlistedCategories"),
|
|
21950
21743
|
categoriesFile: /* @__PURE__ */ __name(() => inStore(async (store) => store.tasks.categoriesFile()), "categoriesFile"),
|
|
21951
21744
|
duplicates: /* @__PURE__ */ __name(({ decision, limit, offset }) => inStore(async (store, account) => store.tasks.pairs(taskAccount(account), { decision, limit, offset })), "duplicates"),
|
|
@@ -22152,7 +21945,7 @@ var taskView = /* @__PURE__ */ __name(async (store, account, task2) => {
|
|
|
22152
21945
|
};
|
|
22153
21946
|
}, "taskView");
|
|
22154
21947
|
|
|
22155
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
21948
|
+
// node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/cli/messenger/lacks.js
|
|
22156
21949
|
var COMMAND_NEEDS = {
|
|
22157
21950
|
"account update": ["updateProfile", "change the profile"],
|
|
22158
21951
|
"account sessions list": ["sessions", "list the account's sessions"],
|
|
@@ -22207,17 +22000,17 @@ var hideNever = /* @__PURE__ */ __name((messenger, group) => {
|
|
|
22207
22000
|
const at = [...path, child.name()];
|
|
22208
22001
|
const need = COMMAND_NEEDS[at.join(" ")];
|
|
22209
22002
|
if (need && messenger.never?.includes(need[0]))
|
|
22210
|
-
child
|
|
22003
|
+
hide(child);
|
|
22211
22004
|
walk(child, at);
|
|
22212
|
-
if (child.commands.length > 0 && child.commands.every(
|
|
22213
|
-
child
|
|
22005
|
+
if (child.commands.length > 0 && child.commands.every(isHidden))
|
|
22006
|
+
hide(child);
|
|
22214
22007
|
}
|
|
22215
22008
|
}, "walk");
|
|
22216
22009
|
walk(group, [group.name()]);
|
|
22217
22010
|
return group;
|
|
22218
22011
|
}, "hideNever");
|
|
22219
22012
|
|
|
22220
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
22013
|
+
// node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/context/communication-selection.js
|
|
22221
22014
|
var communicationFields = {
|
|
22222
22015
|
sources: pipe(array(strictObject({
|
|
22223
22016
|
id: pipe(string(), regex(/^[A-Za-z0-9][A-Za-z0-9._-]{0,127}$/)),
|
|
@@ -22249,7 +22042,7 @@ var communicationRequest = /* @__PURE__ */ __name((value, preparationAfter) => {
|
|
|
22249
22042
|
return { ...input, after, before };
|
|
22250
22043
|
}, "communicationRequest");
|
|
22251
22044
|
|
|
22252
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
22045
|
+
// node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/mail/owed.js
|
|
22253
22046
|
var mailTurn = /* @__PURE__ */ __name((newest) => {
|
|
22254
22047
|
if (newest === null)
|
|
22255
22048
|
return null;
|
|
@@ -22258,7 +22051,7 @@ var mailTurn = /* @__PURE__ */ __name((newest) => {
|
|
|
22258
22051
|
return newest.addressed ? "owed" : null;
|
|
22259
22052
|
}, "mailTurn");
|
|
22260
22053
|
|
|
22261
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
22054
|
+
// node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/services/agenda-mail.js
|
|
22262
22055
|
var absent = /* @__PURE__ */ __name((error) => {
|
|
22263
22056
|
if (error instanceof CliError && error.code === "not_found")
|
|
22264
22057
|
return void 0;
|
|
@@ -22316,7 +22109,7 @@ var mailActivity = /* @__PURE__ */ __name(async (store, account, since, chats) =
|
|
|
22316
22109
|
};
|
|
22317
22110
|
}, "mailActivity");
|
|
22318
22111
|
|
|
22319
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
22112
|
+
// node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/services/agenda.js
|
|
22320
22113
|
var DAY2 = 864e5;
|
|
22321
22114
|
var AGENDA_DEFAULTS = { unanswered: DAY2, waiting: 7 * DAY2 };
|
|
22322
22115
|
var CLAIMS = ["none", "mine", "others", "any"];
|
|
@@ -22362,9 +22155,9 @@ var agendaService = /* @__PURE__ */ __name((deps, now = Date.now) => ({
|
|
|
22362
22155
|
return [];
|
|
22363
22156
|
throw error;
|
|
22364
22157
|
}), "find");
|
|
22365
|
-
const
|
|
22158
|
+
const open6 = await find();
|
|
22366
22159
|
const tags = await taskTagFilters(store, parts.tasks);
|
|
22367
|
-
const listed2 = parts.tasks ? await find(queryFilter(parts.tasks, taskColumns2(holder, at, tags), { command: "tasks agenda", zone: timezoneOf() })) :
|
|
22160
|
+
const listed2 = parts.tasks ? await find(queryFilter(parts.tasks, taskColumns2(holder, at, tags), { command: "tasks agenda", zone: timezoneOf() })) : open6;
|
|
22368
22161
|
const tasks = listed2.map((task2) => ({ task: task2, reasons: reasonsOf(task2, at, dueWithin) })).filter(({ reasons }) => reasons.length > 0).sort((a, b) => urgency(a.task) - urgency(b.task)).map(({ task: task2, reasons }) => ({
|
|
22369
22162
|
id: task2.id,
|
|
22370
22163
|
key: task2.key,
|
|
@@ -22406,7 +22199,7 @@ var agendaService = /* @__PURE__ */ __name((deps, now = Date.now) => ({
|
|
|
22406
22199
|
chat: chat.chatId,
|
|
22407
22200
|
message: lastMessageId
|
|
22408
22201
|
}),
|
|
22409
|
-
openTasks:
|
|
22202
|
+
openTasks: open6.filter((task2) => chatOf2(task2.source) === chat.chatId).map((task2) => task2.id)
|
|
22410
22203
|
}));
|
|
22411
22204
|
const silentFor = /* @__PURE__ */ __name((chat) => at - Date.parse(chat.lastMessageAt), "silentFor");
|
|
22412
22205
|
const shown = {
|
|
@@ -22420,7 +22213,7 @@ var agendaService = /* @__PURE__ */ __name((deps, now = Date.now) => ({
|
|
|
22420
22213
|
const withCoverage = /* @__PURE__ */ __name((list2) => list2.map(({ turn: _, ...chat }) => ({ ...chat, coverage: covered.get(chat.chatId) })), "withCoverage");
|
|
22421
22214
|
const inList = new Set((await store.tasks.categories()).map(({ name }) => name));
|
|
22422
22215
|
const unlisted = /* @__PURE__ */ new Map();
|
|
22423
|
-
for (const { category } of
|
|
22216
|
+
for (const { category } of open6)
|
|
22424
22217
|
if (category && !inList.has(category))
|
|
22425
22218
|
unlisted.set(category, (unlisted.get(category) ?? 0) + 1);
|
|
22426
22219
|
return {
|
|
@@ -22570,7 +22363,7 @@ var agendaItem = /* @__PURE__ */ __name((shown) => {
|
|
|
22570
22363
|
};
|
|
22571
22364
|
}, "agendaItem");
|
|
22572
22365
|
|
|
22573
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
22366
|
+
// node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/services/model-downloads.js
|
|
22574
22367
|
import { writeFileSync } from "node:fs";
|
|
22575
22368
|
import { join } from "node:path";
|
|
22576
22369
|
var bytesOf = /* @__PURE__ */ __name((model) => model.files.reduce((sum2, file) => sum2 + file.bytes, 0), "bytesOf");
|
|
@@ -22595,7 +22388,7 @@ var downloadTextModel = /* @__PURE__ */ __name(async (id2, { env, progress = /*
|
|
|
22595
22388
|
`);
|
|
22596
22389
|
await nativeRuntime({ env, progress });
|
|
22597
22390
|
progress(`${model.id}: loading it once to check it works`);
|
|
22598
|
-
const { openEmbedder: openEmbedder2 } = await import("./embed-
|
|
22391
|
+
const { openEmbedder: openEmbedder2 } = await import("./embed-SWLVG73O.js");
|
|
22599
22392
|
const embedder = await openEmbedder2(model, directory2);
|
|
22600
22393
|
try {
|
|
22601
22394
|
const [vector] = await embedder.embed(["check"], "query");
|
|
@@ -22616,7 +22409,7 @@ var downloadRerankModel = /* @__PURE__ */ __name(async (id2, { env, progress = /
|
|
|
22616
22409
|
}
|
|
22617
22410
|
await nativeRuntime({ env, progress });
|
|
22618
22411
|
progress(`${model.id}: loading it once to check it works`);
|
|
22619
|
-
const { openReranker } = await import("./rerank-
|
|
22412
|
+
const { openReranker } = await import("./rerank-5UPVXGVV.js");
|
|
22620
22413
|
const reranker = await openReranker(model, directory2);
|
|
22621
22414
|
try {
|
|
22622
22415
|
await reranker.score("check", ["check"]);
|
|
@@ -22634,7 +22427,7 @@ var downloadImageModel = /* @__PURE__ */ __name(async (id2, { env, progress = /*
|
|
|
22634
22427
|
await installFiles(placedImage(model, directory2), { progress, ...bytes2 ? { bytes: bytes2 } : {} });
|
|
22635
22428
|
}
|
|
22636
22429
|
progress(`${model.id}: loading it once to check it works`);
|
|
22637
|
-
const { openPictureEmbedder } = await import("./embedder-
|
|
22430
|
+
const { openPictureEmbedder } = await import("./embedder-EJN75BPV.js");
|
|
22638
22431
|
const embedder = await openPictureEmbedder(model, directory2);
|
|
22639
22432
|
try {
|
|
22640
22433
|
const vector = await embedder.embedQuery("check");
|
|
@@ -22646,7 +22439,7 @@ var downloadImageModel = /* @__PURE__ */ __name(async (id2, { env, progress = /*
|
|
|
22646
22439
|
return { model, directory: directory2 };
|
|
22647
22440
|
}, "downloadImageModel");
|
|
22648
22441
|
|
|
22649
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
22442
|
+
// node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/services/rankings-selection.js
|
|
22650
22443
|
var RANKING_SELECTION_BYTES = 64 * 1024;
|
|
22651
22444
|
var object2 = /* @__PURE__ */ __name((value) => value !== null && typeof value === "object" && !Array.isArray(value) ? value : void 0, "object");
|
|
22652
22445
|
function invalid(message = "ranking selection is invalid \u2014 obtain a new drilldown from stats top") {
|
|
@@ -22815,7 +22608,7 @@ var readRankingSelection = /* @__PURE__ */ __name(async (store, input) => {
|
|
|
22815
22608
|
};
|
|
22816
22609
|
}, "readRankingSelection");
|
|
22817
22610
|
|
|
22818
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
22611
|
+
// node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/services/mail-search.js
|
|
22819
22612
|
var THREADS_PAGE = 500;
|
|
22820
22613
|
var threadsOf = /* @__PURE__ */ __name(async (store, key) => {
|
|
22821
22614
|
const account = await store.accounts.storedAccount(key).catch(() => void 0);
|
|
@@ -22890,7 +22683,7 @@ var readMail = /* @__PURE__ */ __name(async (store, locator, { before = 0, after
|
|
|
22890
22683
|
return thread.slice(Math.max(0, at - before), at + after + 1).map((hit) => hit.id === message ? { ...hit, anchor: true } : hit);
|
|
22891
22684
|
}, "readMail");
|
|
22892
22685
|
|
|
22893
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
22686
|
+
// node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/services/messages-search.js
|
|
22894
22687
|
var PERSON_FIELDS = /* @__PURE__ */ new Set(["from", "to", "cc", "bcc"]);
|
|
22895
22688
|
var MAIL_FIELDS = /* @__PURE__ */ new Set(["to", "cc", "bcc", "subject", "mailbox", "label", "is", "list"]);
|
|
22896
22689
|
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");
|
|
@@ -22952,11 +22745,11 @@ var prepareLucene = /* @__PURE__ */ __name(async (store, account, request, messe
|
|
|
22952
22745
|
if (mailField && !scopeAccounts.some(({ provider }) => provider === MAIL))
|
|
22953
22746
|
searchError("query.unsupported-field", mailField.span, `${mailField.field}: is a mail field \u2014 memo search mail reads it`);
|
|
22954
22747
|
const globalChat = request.chat === void 0 ? void 0 : await chatAmong(messenger, chatLookup, scopeAccounts, request.chat);
|
|
22955
|
-
const
|
|
22748
|
+
const resolve6 = /* @__PURE__ */ __name(async (node) => {
|
|
22956
22749
|
if (node.kind === "boolean")
|
|
22957
22750
|
return {
|
|
22958
22751
|
...node,
|
|
22959
|
-
clauses: await Promise.all(node.clauses.map(async ({ occur, node: node2 }) => ({ occur, node: await
|
|
22752
|
+
clauses: await Promise.all(node.clauses.map(async ({ occur, node: node2 }) => ({ occur, node: await resolve6(node2) })))
|
|
22960
22753
|
};
|
|
22961
22754
|
if (isPresence(node))
|
|
22962
22755
|
return node;
|
|
@@ -22978,7 +22771,7 @@ var prepareLucene = /* @__PURE__ */ __name(async (store, account, request, messe
|
|
|
22978
22771
|
};
|
|
22979
22772
|
return node;
|
|
22980
22773
|
}, "resolve");
|
|
22981
|
-
const root = await
|
|
22774
|
+
const root = await resolve6(ast.root);
|
|
22982
22775
|
const chats = leaves.filter(({ field }) => field === "chat");
|
|
22983
22776
|
const [lone] = chats.length === 1 && chats[0] && requiresChat(ast.root, chats[0]) ? chats : [];
|
|
22984
22777
|
const loneChats = lone === void 0 || globalChat ? [] : lone.operator === "wildcard" ? await chatsMatchingIn(chatLookup, scopeAccounts, lone.value) : [await chatAmong(messenger, chatLookup, scopeAccounts, lone.value)];
|
|
@@ -23263,7 +23056,7 @@ var statsLucene = /* @__PURE__ */ __name(async (store, account, request, messeng
|
|
|
23263
23056
|
};
|
|
23264
23057
|
}, "statsLucene");
|
|
23265
23058
|
|
|
23266
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
23059
|
+
// node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/services/search-record.js
|
|
23267
23060
|
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");
|
|
23268
23061
|
var searchRecordOf = /* @__PURE__ */ __name((command, params) => ({
|
|
23269
23062
|
command,
|
|
@@ -23273,7 +23066,7 @@ var searchRecordOf = /* @__PURE__ */ __name((command, params) => ({
|
|
|
23273
23066
|
fieldsVersion: FIELD_VERSION
|
|
23274
23067
|
}), "searchRecordOf");
|
|
23275
23068
|
|
|
23276
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
23069
|
+
// node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/services/admin-statistics.js
|
|
23277
23070
|
function invalid2(message) {
|
|
23278
23071
|
throw new CliError("validation_error", message);
|
|
23279
23072
|
}
|
|
@@ -23567,7 +23360,7 @@ var adminStatisticsService = /* @__PURE__ */ __name((deps) => ({
|
|
|
23567
23360
|
}, "evidence")
|
|
23568
23361
|
}), "adminStatisticsService");
|
|
23569
23362
|
|
|
23570
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
23363
|
+
// node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/services/patience.js
|
|
23571
23364
|
import { setTimeout as sleep } from "node:timers/promises";
|
|
23572
23365
|
var LONGEST_WAIT_MS = 5 * 60 * 1e3;
|
|
23573
23366
|
var patiently = /* @__PURE__ */ __name(async (request, note, stop) => {
|
|
@@ -23590,10 +23383,10 @@ var patiently = /* @__PURE__ */ __name(async (request, note, stop) => {
|
|
|
23590
23383
|
}
|
|
23591
23384
|
}, "patiently");
|
|
23592
23385
|
|
|
23593
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
23386
|
+
// node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/services/archive.js
|
|
23594
23387
|
import { setTimeout as sleep2 } from "node:timers/promises";
|
|
23595
23388
|
|
|
23596
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
23389
|
+
// node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/services/backfill-estimate.js
|
|
23597
23390
|
var REQUEST_MS = 400;
|
|
23598
23391
|
var estimateBackfill = /* @__PURE__ */ __name(({ ranges, held, newest, page, maxPages, pauseMs }) => {
|
|
23599
23392
|
const lowest = ranges[0];
|
|
@@ -23616,13 +23409,13 @@ var estimateBackfill = /* @__PURE__ */ __name(({ ranges, held, newest, page, max
|
|
|
23616
23409
|
};
|
|
23617
23410
|
}, "estimateBackfill");
|
|
23618
23411
|
|
|
23619
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
23412
|
+
// node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/domain/recovery.js
|
|
23620
23413
|
var withRecovery = /* @__PURE__ */ __name((error) => ({
|
|
23621
23414
|
...error,
|
|
23622
23415
|
retryable: typeof error.retryable === "boolean" ? error.retryable : error.code === "rate_limited" || error.status === 429
|
|
23623
23416
|
}), "withRecovery");
|
|
23624
23417
|
|
|
23625
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
23418
|
+
// node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/services/batch.js
|
|
23626
23419
|
var actionable = /* @__PURE__ */ __name((error) => {
|
|
23627
23420
|
if (isCliFailure(error))
|
|
23628
23421
|
return withRecovery({ code: error.code, message: error.message, ...error.details });
|
|
@@ -23705,7 +23498,7 @@ var mergeBatches = /* @__PURE__ */ __name((a, b) => {
|
|
|
23705
23498
|
};
|
|
23706
23499
|
}, "mergeBatches");
|
|
23707
23500
|
|
|
23708
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
23501
|
+
// node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/images/context/index.js
|
|
23709
23502
|
var CONTEXT_MESSAGES2 = 3;
|
|
23710
23503
|
var CONTEXT_MINUTES = 10;
|
|
23711
23504
|
var MAX_CHARS = 1200;
|
|
@@ -23729,12 +23522,12 @@ var context = {
|
|
|
23729
23522
|
}, "describe")
|
|
23730
23523
|
};
|
|
23731
23524
|
|
|
23732
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
23525
|
+
// node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/images/registry.js
|
|
23733
23526
|
var BUILT_INS = [context];
|
|
23734
23527
|
var providers = [...BUILT_INS];
|
|
23735
23528
|
var registeredImageProviders = /* @__PURE__ */ __name(() => providers, "registeredImageProviders");
|
|
23736
23529
|
|
|
23737
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
23530
|
+
// node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/services/conversations.js
|
|
23738
23531
|
var READ_PAGE = 5e3;
|
|
23739
23532
|
var CHAIN = 50;
|
|
23740
23533
|
var CONVERSATION_QUERY = {
|
|
@@ -23886,7 +23679,7 @@ var sized = /* @__PURE__ */ __name((size2) => {
|
|
|
23886
23679
|
return size2;
|
|
23887
23680
|
}, "sized");
|
|
23888
23681
|
|
|
23889
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
23682
|
+
// node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/services/embeddings-maintenance.js
|
|
23890
23683
|
var REFRESH_BOUNDS = { maxChats: 20, maxChunks: 2e3 };
|
|
23891
23684
|
var MESSAGE_PAGE = 5e3;
|
|
23892
23685
|
var PER_SESSION = 8;
|
|
@@ -23905,7 +23698,7 @@ var embeddingTarget = /* @__PURE__ */ __name((deps, choice = chosenTextModel(dep
|
|
|
23905
23698
|
price: remote.price,
|
|
23906
23699
|
installed: true,
|
|
23907
23700
|
perBatch: PER_REQUEST * concurrency,
|
|
23908
|
-
open: /* @__PURE__ */ __name(async () => (await import("./remote-
|
|
23701
|
+
open: /* @__PURE__ */ __name(async () => (await import("./remote-U7TC2BLZ.js")).openRemote(remote, apiKey, {
|
|
23909
23702
|
concurrency,
|
|
23910
23703
|
env: deps.env ?? process.env
|
|
23911
23704
|
}), "open")
|
|
@@ -23925,7 +23718,7 @@ var embeddingTarget = /* @__PURE__ */ __name((deps, choice = chosenTextModel(dep
|
|
|
23925
23718
|
if (!isTextModelInstalled(model, directory2))
|
|
23926
23719
|
throw notDownloaded(model.id);
|
|
23927
23720
|
if (apart) {
|
|
23928
|
-
const { openProcess } = await import("./process-
|
|
23721
|
+
const { openProcess } = await import("./process-SGHEN6MQ.js");
|
|
23929
23722
|
return openProcess(model, directory2, { threads: threads ?? defaultThreads() });
|
|
23930
23723
|
}
|
|
23931
23724
|
return openEmbedder(model, directory2, { threads: threads ?? defaultThreads() });
|
|
@@ -24214,7 +24007,7 @@ var shaped = /* @__PURE__ */ __name(({ chatId, builtAt, algorithmVersion, pendin
|
|
|
24214
24007
|
return { ...one, state };
|
|
24215
24008
|
}, "shaped");
|
|
24216
24009
|
|
|
24217
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
24010
|
+
// node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/services/search-catchup.js
|
|
24218
24011
|
var CATCH_UP_BOUNDS = { maxChunks: 500, maxMessages: 1e4, timeMs: 3e4 };
|
|
24219
24012
|
var validateCatchUpBounds = /* @__PURE__ */ __name((options2) => {
|
|
24220
24013
|
for (const [key, value, maximum] of [
|
|
@@ -24267,7 +24060,7 @@ var catchUpSearch = /* @__PURE__ */ __name(async (deps, chat, options2, signal,
|
|
|
24267
24060
|
}
|
|
24268
24061
|
}, "catchUpSearch");
|
|
24269
24062
|
|
|
24270
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
24063
|
+
// node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/services/archive.js
|
|
24271
24064
|
var pushed = /* @__PURE__ */ __name((deps, what) => {
|
|
24272
24065
|
if (deps.reads === "store") {
|
|
24273
24066
|
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`);
|
|
@@ -24650,11 +24443,18 @@ var savedReplies = /* @__PURE__ */ __name(async (connection, store, account, cha
|
|
|
24650
24443
|
return 0;
|
|
24651
24444
|
const startedAt = Date.now();
|
|
24652
24445
|
const point = Number((await store.sync.syncState(account, threadsKey(chatId)))?.value);
|
|
24653
|
-
const
|
|
24654
|
-
|
|
24655
|
-
|
|
24446
|
+
const answer = await connection.threadReplies(chatId, Number.isFinite(point) ? { since: point } : {});
|
|
24447
|
+
const batches = Symbol.asyncIterator in answer ? answer : [answer];
|
|
24448
|
+
let saved = 0;
|
|
24449
|
+
for await (const replies of batches) {
|
|
24450
|
+
if (replies.length > 0)
|
|
24451
|
+
await store.messages.saveMessages(account, chatId, replies, { via: "history", seenAt: startedAt });
|
|
24452
|
+
saved += replies.length;
|
|
24453
|
+
if (stop.aborted)
|
|
24454
|
+
return saved;
|
|
24455
|
+
}
|
|
24656
24456
|
await store.sync.setSyncState(account, threadsKey(chatId), String(startedAt));
|
|
24657
|
-
return
|
|
24457
|
+
return saved;
|
|
24658
24458
|
}, "savedReplies");
|
|
24659
24459
|
var timeOfKey = /* @__PURE__ */ __name(async (store, account, chatId, key, byTime, fallback) => {
|
|
24660
24460
|
if (byTime)
|
|
@@ -24663,20 +24463,20 @@ var timeOfKey = /* @__PURE__ */ __name(async (store, account, chatId, key, byTim
|
|
|
24663
24463
|
return message?.timestamp ?? fallback;
|
|
24664
24464
|
}, "timeOfKey");
|
|
24665
24465
|
|
|
24666
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
24667
|
-
import { extname as
|
|
24466
|
+
// node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/attachments/extract.js
|
|
24467
|
+
import { extname as extname2 } from "node:path";
|
|
24668
24468
|
|
|
24669
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
24469
|
+
// node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/readers/engine.js
|
|
24670
24470
|
import { readFileSync } from "node:fs";
|
|
24671
|
-
import { dirname
|
|
24471
|
+
import { dirname, extname, join as join2 } from "node:path";
|
|
24672
24472
|
import { fileURLToPath } from "node:url";
|
|
24673
24473
|
|
|
24674
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
24474
|
+
// node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/attachments/container.js
|
|
24675
24475
|
import { setImmediate as tick } from "node:timers/promises";
|
|
24676
24476
|
import { crc32 } from "node:zlib";
|
|
24677
24477
|
var import_xmldom = __toESM(require_lib(), 1);
|
|
24678
24478
|
|
|
24679
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
24479
|
+
// node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/attachments/encoding.js
|
|
24680
24480
|
var import_chardet = __toESM(require_lib2(), 1);
|
|
24681
24481
|
var import_iconv_lite = __toESM(require_lib3(), 1);
|
|
24682
24482
|
var SAMPLE = 65536;
|
|
@@ -24778,7 +24578,7 @@ var decodeXml = /* @__PURE__ */ __name((bytes2) => {
|
|
|
24778
24578
|
return result.text;
|
|
24779
24579
|
}, "decodeXml");
|
|
24780
24580
|
|
|
24781
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
24581
|
+
// node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/attachments/container.js
|
|
24782
24582
|
var MAX_PART = 10 * 1024 * 1024;
|
|
24783
24583
|
var MAX_ENTRIES = 1e3;
|
|
24784
24584
|
var decoder = new TextDecoder("utf-8", { fatal: true });
|
|
@@ -24993,13 +24793,13 @@ var elements = /* @__PURE__ */ __name((node, name, namespace) => {
|
|
|
24993
24793
|
return found;
|
|
24994
24794
|
}, "elements");
|
|
24995
24795
|
|
|
24996
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
24796
|
+
// node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/readers/engine.js
|
|
24997
24797
|
var BUILT_IN = ["unpdf", "mammoth", "word-extractor", "linkedom", "defuddle/node"];
|
|
24998
24798
|
var ENGINES = [...BUILT_IN, "@napi-rs/canvas"];
|
|
24999
24799
|
var isMissing = /* @__PURE__ */ __name((error, name) => error?.code === "ERR_MODULE_NOT_FOUND" && String(error.message).includes(name), "isMissing");
|
|
25000
24800
|
var versionOf = /* @__PURE__ */ __name((name) => {
|
|
25001
24801
|
try {
|
|
25002
|
-
let directory2 =
|
|
24802
|
+
let directory2 = dirname(fileURLToPath(resolveFrom(new URL("readers/engine.js", import.meta.resolve("@wirecat/cli-core")).href, name)));
|
|
25003
24803
|
for (let depth = 0; depth < 6; depth += 1) {
|
|
25004
24804
|
try {
|
|
25005
24805
|
const manifest = JSON.parse(readFileSync(join2(directory2, "package.json"), "utf8"));
|
|
@@ -25007,7 +24807,7 @@ var versionOf = /* @__PURE__ */ __name((name) => {
|
|
|
25007
24807
|
return `${name}@${manifest.version}`;
|
|
25008
24808
|
} catch {
|
|
25009
24809
|
}
|
|
25010
|
-
directory2 =
|
|
24810
|
+
directory2 = dirname(directory2);
|
|
25011
24811
|
}
|
|
25012
24812
|
} catch {
|
|
25013
24813
|
}
|
|
@@ -25035,7 +24835,7 @@ var withEngine = /* @__PURE__ */ __name(async (load, name, read) => {
|
|
|
25035
24835
|
}
|
|
25036
24836
|
}, "withEngine");
|
|
25037
24837
|
var startsWith = /* @__PURE__ */ __name((bytes2, magic) => bytes2.length >= magic.length && [...magic].every((char, index) => bytes2[index] === char.charCodeAt(0)), "startsWith");
|
|
25038
|
-
var extensionOf = /* @__PURE__ */ __name(({ name, path }) =>
|
|
24838
|
+
var extensionOf = /* @__PURE__ */ __name(({ name, path }) => extname(name ?? path).toLowerCase(), "extensionOf");
|
|
25039
24839
|
var capped2 = /* @__PURE__ */ __name((text2) => text2.length > MAX_TEXT_CHARS ? text2.slice(0, MAX_TEXT_CHARS) : text2, "capped");
|
|
25040
24840
|
var derived = /* @__PURE__ */ __name((bytes2, extractor, read) => {
|
|
25041
24841
|
const decoded = decodeText(bytes2);
|
|
@@ -25051,7 +24851,7 @@ var derived = /* @__PURE__ */ __name((bytes2, extractor, read) => {
|
|
|
25051
24851
|
}
|
|
25052
24852
|
}, "derived");
|
|
25053
24853
|
|
|
25054
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
24854
|
+
// node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/readers/image/index.js
|
|
25055
24855
|
var IMAGES = /* @__PURE__ */ new Set([".jpg", ".jpeg", ".png", ".webp", ".gif", ".heic", ".tif", ".tiff", ".bmp"]);
|
|
25056
24856
|
var image = {
|
|
25057
24857
|
id: "image",
|
|
@@ -25060,7 +24860,7 @@ var image = {
|
|
|
25060
24860
|
read: /* @__PURE__ */ __name(async () => ({ status: "needs-agent" }), "read")
|
|
25061
24861
|
};
|
|
25062
24862
|
|
|
25063
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
24863
|
+
// node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/readers/doc/index.js
|
|
25064
24864
|
var OLE = "\xD0\xCF\xE0\xA1\xB1\xE1";
|
|
25065
24865
|
var doc = {
|
|
25066
24866
|
id: "doc",
|
|
@@ -25072,7 +24872,7 @@ var doc = {
|
|
|
25072
24872
|
}), "read")
|
|
25073
24873
|
};
|
|
25074
24874
|
|
|
25075
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
24875
|
+
// node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/readers/docx/index.js
|
|
25076
24876
|
var DOCX = "application/vnd.openxmlformats-officedocument.wordprocessingml.document";
|
|
25077
24877
|
var docx = {
|
|
25078
24878
|
id: "docx",
|
|
@@ -25085,10 +24885,10 @@ var docx = {
|
|
|
25085
24885
|
}), "read")
|
|
25086
24886
|
};
|
|
25087
24887
|
|
|
25088
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
24888
|
+
// node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/attachments/markup.js
|
|
25089
24889
|
var import_iconv_lite2 = __toESM(require_lib3(), 1);
|
|
25090
24890
|
|
|
25091
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
24891
|
+
// node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/domain/html-entities.js
|
|
25092
24892
|
var NAMED = {
|
|
25093
24893
|
amp: "&",
|
|
25094
24894
|
lt: "<",
|
|
@@ -25140,7 +24940,7 @@ var decodeEntities = /* @__PURE__ */ __name((text2) => text2.replace(/&(#x[0-9a-
|
|
|
25140
24940
|
return body[1] === "x" || body[1] === "X" ? character(Number.parseInt(body.slice(2), 16), entity) : character(Number(body.slice(1)), entity);
|
|
25141
24941
|
}), "decodeEntities");
|
|
25142
24942
|
|
|
25143
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
24943
|
+
// node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/attachments/markup.js
|
|
25144
24944
|
var RTF_SKIPPED = /* @__PURE__ */ new Set([
|
|
25145
24945
|
"fonttbl",
|
|
25146
24946
|
"colortbl",
|
|
@@ -25281,11 +25081,11 @@ var dropHidden = /* @__PURE__ */ __name((source) => {
|
|
|
25281
25081
|
const unclosed = /* @__PURE__ */ new Set();
|
|
25282
25082
|
let out = "";
|
|
25283
25083
|
let kept2 = 0;
|
|
25284
|
-
for (const
|
|
25285
|
-
const name =
|
|
25286
|
-
if (
|
|
25084
|
+
for (const open6 of source.matchAll(HTML_DROPPED_OPEN)) {
|
|
25085
|
+
const name = open6[1].toLowerCase();
|
|
25086
|
+
if (open6.index < kept2 || unclosed.has(name))
|
|
25287
25087
|
continue;
|
|
25288
|
-
const gt = source.indexOf(">",
|
|
25088
|
+
const gt = source.indexOf(">", open6.index + open6[0].length);
|
|
25289
25089
|
if (gt < 0)
|
|
25290
25090
|
break;
|
|
25291
25091
|
const close = HTML_DROPPED_CLOSE.get(name);
|
|
@@ -25295,7 +25095,7 @@ var dropHidden = /* @__PURE__ */ __name((source) => {
|
|
|
25295
25095
|
unclosed.add(name);
|
|
25296
25096
|
continue;
|
|
25297
25097
|
}
|
|
25298
|
-
out += source.slice(kept2,
|
|
25098
|
+
out += source.slice(kept2, open6.index);
|
|
25299
25099
|
kept2 = end.index + end[0].length;
|
|
25300
25100
|
}
|
|
25301
25101
|
return out + source.slice(kept2);
|
|
@@ -25306,7 +25106,7 @@ var htmlText = /* @__PURE__ */ __name((source) => {
|
|
|
25306
25106
|
return decodeEntities(replaceTags(blocks, /<[^>]*>/g, "")).replace(/(?<![ \t\u00a0])[ \t\u00a0]+\n/g, "\n").replace(/\n{3,}/g, "\n\n").trim();
|
|
25307
25107
|
}, "htmlText");
|
|
25308
25108
|
|
|
25309
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
25109
|
+
// node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/readers/html/page.js
|
|
25310
25110
|
var clean = /* @__PURE__ */ __name((value) => typeof value === "string" ? value.replace(/\s+/g, " ").trim() : "", "clean");
|
|
25311
25111
|
var namesIn = /* @__PURE__ */ __name((value) => [value].flat().map((entry) => typeof entry === "string" ? clean(entry) : clean(entry?.name)).filter(Boolean).join(", "), "namesIn");
|
|
25312
25112
|
var jsonLdNodes = /* @__PURE__ */ __name((document) => {
|
|
@@ -25362,7 +25162,7 @@ var markdownSections = /* @__PURE__ */ __name((text2) => {
|
|
|
25362
25162
|
return found.map((section, index) => ({ ...section, end: found[index + 1]?.start ?? text2.length }));
|
|
25363
25163
|
}, "markdownSections");
|
|
25364
25164
|
|
|
25365
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
25165
|
+
// node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/readers/html/index.js
|
|
25366
25166
|
var HTML = /* @__PURE__ */ new Set([".html", ".htm", ".xhtml"]);
|
|
25367
25167
|
var first = /* @__PURE__ */ __name((...values) => values.find((value) => typeof value === "string" && value !== ""), "first");
|
|
25368
25168
|
var loaded = /* @__PURE__ */ __name(async (load, name) => {
|
|
@@ -25400,8 +25200,8 @@ var readPage = /* @__PURE__ */ __name(async (source, load) => {
|
|
|
25400
25200
|
};
|
|
25401
25201
|
}, "readPage");
|
|
25402
25202
|
var titleOf = /* @__PURE__ */ __name((source) => {
|
|
25403
|
-
const
|
|
25404
|
-
const gt =
|
|
25203
|
+
const open6 = /<title/i.exec(source);
|
|
25204
|
+
const gt = open6 ? source.indexOf(">", open6.index + open6[0].length) : -1;
|
|
25405
25205
|
if (gt < 0)
|
|
25406
25206
|
return "";
|
|
25407
25207
|
const close = /<\/title\s*>/gi;
|
|
@@ -25433,10 +25233,10 @@ var html = {
|
|
|
25433
25233
|
}, "read")
|
|
25434
25234
|
};
|
|
25435
25235
|
|
|
25436
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
25236
|
+
// node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/attachments/documents.js
|
|
25437
25237
|
import { posix } from "node:path";
|
|
25438
25238
|
|
|
25439
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
25239
|
+
// node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/attachments/sheets.js
|
|
25440
25240
|
var columnName = /* @__PURE__ */ __name((column) => {
|
|
25441
25241
|
let name = "";
|
|
25442
25242
|
for (let rest = column; rest > 0; rest = Math.floor((rest - 1) / 26))
|
|
@@ -25491,7 +25291,7 @@ var sheetText = /* @__PURE__ */ __name((sheets2, maxChars = MAX_TEXT_CHARS) => {
|
|
|
25491
25291
|
return { text: parts.join("").trim(), truncated: false };
|
|
25492
25292
|
}, "sheetText");
|
|
25493
25293
|
|
|
25494
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
25294
|
+
// node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/attachments/documents.js
|
|
25495
25295
|
var OFFICE = "urn:oasis:names:tc:opendocument:xmlns:office:1.0";
|
|
25496
25296
|
var TEXT = "urn:oasis:names:tc:opendocument:xmlns:text:1.0";
|
|
25497
25297
|
var TABLE = "urn:oasis:names:tc:opendocument:xmlns:table:1.0";
|
|
@@ -25891,7 +25691,7 @@ var readDocument = /* @__PURE__ */ __name(async (bytes2, kind, signal) => {
|
|
|
25891
25691
|
}
|
|
25892
25692
|
}, "readDocument");
|
|
25893
25693
|
|
|
25894
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
25694
|
+
// node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/readers/office/index.js
|
|
25895
25695
|
var office = {
|
|
25896
25696
|
id: "office",
|
|
25897
25697
|
version: documentExtractor("odt"),
|
|
@@ -25902,7 +25702,7 @@ var office = {
|
|
|
25902
25702
|
}, "read")
|
|
25903
25703
|
};
|
|
25904
25704
|
|
|
25905
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
25705
|
+
// node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/readers/pdf/index.js
|
|
25906
25706
|
var pdf = {
|
|
25907
25707
|
id: "pdf",
|
|
25908
25708
|
version: "unpdf",
|
|
@@ -25969,7 +25769,7 @@ var pdf = {
|
|
|
25969
25769
|
}), "read")
|
|
25970
25770
|
};
|
|
25971
25771
|
|
|
25972
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
25772
|
+
// node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/readers/plain/index.js
|
|
25973
25773
|
var PLAIN = /* @__PURE__ */ new Set([".txt", ".md", ".markdown", ".csv", ".tsv", ".json", ".log"]);
|
|
25974
25774
|
var isPlain = /* @__PURE__ */ __name((hint) => PLAIN.has(extensionOf(hint)) || hint.mime?.startsWith("text/") || hint.mime === "application/json", "isPlain");
|
|
25975
25775
|
var readPlain = /* @__PURE__ */ __name((bytes2) => {
|
|
@@ -25989,7 +25789,7 @@ var plain = {
|
|
|
25989
25789
|
read: /* @__PURE__ */ __name(async (bytes2) => readPlain(bytes2), "read")
|
|
25990
25790
|
};
|
|
25991
25791
|
|
|
25992
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
25792
|
+
// node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/readers/rtf/index.js
|
|
25993
25793
|
var rtf = {
|
|
25994
25794
|
id: "rtf",
|
|
25995
25795
|
version: "v1",
|
|
@@ -25997,10 +25797,10 @@ var rtf = {
|
|
|
25997
25797
|
read: /* @__PURE__ */ __name(async (bytes2) => derived(bytes2, "rtf:v1", rtfText), "read")
|
|
25998
25798
|
};
|
|
25999
25799
|
|
|
26000
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
26001
|
-
import { basename
|
|
25800
|
+
// node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/readers/sheets/index.js
|
|
25801
|
+
import { basename } from "node:path";
|
|
26002
25802
|
|
|
26003
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
25803
|
+
// node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/attachments/csv-spans.js
|
|
26004
25804
|
var delimitedSpans = /* @__PURE__ */ __name((text2, delimiter, maxCells = 1e4) => {
|
|
26005
25805
|
const cells = [];
|
|
26006
25806
|
let row = 1, column = 1, start = 0, quoted = false, truncated = false;
|
|
@@ -26038,7 +25838,7 @@ var delimitedSpans = /* @__PURE__ */ __name((text2, delimiter, maxCells = 1e4) =
|
|
|
26038
25838
|
return { cells, truncated };
|
|
26039
25839
|
}, "delimitedSpans");
|
|
26040
25840
|
|
|
26041
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
25841
|
+
// node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/readers/sheets/index.js
|
|
26042
25842
|
var DELIMITED = {
|
|
26043
25843
|
".csv": ",",
|
|
26044
25844
|
".tsv": " ",
|
|
@@ -26068,7 +25868,7 @@ var sheets = {
|
|
|
26068
25868
|
column,
|
|
26069
25869
|
value: unquoted(result.text.slice(start, end))
|
|
26070
25870
|
}));
|
|
26071
|
-
const name =
|
|
25871
|
+
const name = basename(hint.name ?? hint.path, extensionOf(hint)) || "Sheet";
|
|
26072
25872
|
const { text: text2, truncated } = sheetText([{ name, cells }]);
|
|
26073
25873
|
return text2 === "" ? { status: "needs-agent", extractor } : { status: "extracted", text: text2, extractor, ...truncated || spans.truncated ? { truncated: true } : {} };
|
|
26074
25874
|
} catch {
|
|
@@ -26077,7 +25877,7 @@ var sheets = {
|
|
|
26077
25877
|
}, "read")
|
|
26078
25878
|
};
|
|
26079
25879
|
|
|
26080
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
25880
|
+
// node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/readers/registry.js
|
|
26081
25881
|
var BUILT_INS2 = [office, pdf, docx, doc, rtf, html, sheets, plain, image];
|
|
26082
25882
|
var HEAD_BYTES = 1024;
|
|
26083
25883
|
var readers = [...BUILT_INS2];
|
|
@@ -26087,9 +25887,9 @@ var readWithRegistry = /* @__PURE__ */ __name(async (bytes2, hint, context2) =>
|
|
|
26087
25887
|
return reader ? reader.read(bytes2, hint, context2) : { status: "unsupported" };
|
|
26088
25888
|
}, "readWithRegistry");
|
|
26089
25889
|
|
|
26090
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
25890
|
+
// node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/attachments/extract.js
|
|
26091
25891
|
var importEngine = /* @__PURE__ */ __name((name) => importFrom(new URL("attachments/extract.js", import.meta.resolve("@wirecat/cli-core")).href, name), "importEngine");
|
|
26092
|
-
var extensionOf2 = /* @__PURE__ */ __name(({ name, path }) =>
|
|
25892
|
+
var extensionOf2 = /* @__PURE__ */ __name(({ name, path }) => extname2(name ?? path).toLowerCase(), "extensionOf");
|
|
26093
25893
|
var extractText = /* @__PURE__ */ __name(async (bytes2, hint, load, signal, env = process.env) => {
|
|
26094
25894
|
if (bytes2.byteLength > attachmentMaxBytes(env))
|
|
26095
25895
|
return { status: "too-large" };
|
|
@@ -26116,16 +25916,16 @@ var ENGINE_FILES = {
|
|
|
26116
25916
|
var isBuiltIn = /* @__PURE__ */ __name((engine) => BUILT_IN.includes(engine), "isBuiltIn");
|
|
26117
25917
|
var engineMissing = /* @__PURE__ */ __name((engine) => isBuiltIn(engine) ? `the package ${engine}, which ships with this tool, could not be loaded \u2014 reinstall the tool` : `the optional package ${engine} is needed, installed where this tool is (for a global npm install: npm install -g ${engine})`, "engineMissing");
|
|
26118
25918
|
var engineHint = /* @__PURE__ */ __name((engine, command) => `${ENGINE_FILES[engine]} files: ${engineMissing(engine).replace("this tool", command)}; they are read on the next run`, "engineHint");
|
|
26119
|
-
var engineStates = /* @__PURE__ */ __name((
|
|
25919
|
+
var engineStates = /* @__PURE__ */ __name((resolve6 = (name) => resolveFrom(new URL("attachments/extract.js", import.meta.resolve("@wirecat/cli-core")).href, name)) => Object.fromEntries(ENGINES.map((name) => {
|
|
26120
25920
|
try {
|
|
26121
|
-
|
|
25921
|
+
resolve6(name);
|
|
26122
25922
|
return [name, isBuiltIn(name) ? "built in" : "installed"];
|
|
26123
25923
|
} catch {
|
|
26124
25924
|
return [name, "missing"];
|
|
26125
25925
|
}
|
|
26126
25926
|
})), "engineStates");
|
|
26127
25927
|
|
|
26128
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
25928
|
+
// node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/domain/models.js
|
|
26129
25929
|
var GROUP_SETTINGS = [
|
|
26130
25930
|
"allCanPin",
|
|
26131
25931
|
"onlyAdminsAdd",
|
|
@@ -26139,7 +25939,7 @@ var ADMIN_RIGHTS = ["read", "members", "admins", "info", "pin", "link", "post",
|
|
|
26139
25939
|
var senderIsMe = /* @__PURE__ */ __name((message, account) => message.outgoing === true || message.senderId !== null && String(message.senderId) === account, "senderIsMe");
|
|
26140
25940
|
var MEDIA_KINDS = ["photo", "video", "file", "audio", "link"];
|
|
26141
25941
|
|
|
26142
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
25942
|
+
// node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/sends/send-as.js
|
|
26143
25943
|
var sendAsCheck = /* @__PURE__ */ __name((connection, sendAs) => {
|
|
26144
25944
|
if (sendAs === void 0) {
|
|
26145
25945
|
const saved = connection.savedSender?.bind(connection);
|
|
@@ -26164,62 +25964,7 @@ var typedSendAs = /* @__PURE__ */ __name((typed) => {
|
|
|
26164
25964
|
return sendAs;
|
|
26165
25965
|
}, "typedSendAs");
|
|
26166
25966
|
|
|
26167
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
26168
|
-
var LATIN = {
|
|
26169
|
-
\u0430: "a",
|
|
26170
|
-
\u0431: "b",
|
|
26171
|
-
\u0432: "v",
|
|
26172
|
-
\u0433: "g",
|
|
26173
|
-
\u0434: "d",
|
|
26174
|
-
\u0435: "e",
|
|
26175
|
-
\u0436: "zh",
|
|
26176
|
-
\u0437: "z",
|
|
26177
|
-
\u0438: "i",
|
|
26178
|
-
\u043A: "k",
|
|
26179
|
-
\u043B: "l",
|
|
26180
|
-
\u043C: "m",
|
|
26181
|
-
\u043D: "n",
|
|
26182
|
-
\u043E: "o",
|
|
26183
|
-
\u043F: "p",
|
|
26184
|
-
\u0440: "r",
|
|
26185
|
-
\u0441: "s",
|
|
26186
|
-
\u0442: "t",
|
|
26187
|
-
\u0443: "u",
|
|
26188
|
-
\u0444: "f",
|
|
26189
|
-
\u0445: "h",
|
|
26190
|
-
\u0446: "ts",
|
|
26191
|
-
\u0447: "ch",
|
|
26192
|
-
\u0448: "sh",
|
|
26193
|
-
\u0449: "sch",
|
|
26194
|
-
\u044A: "",
|
|
26195
|
-
\u044B: "y",
|
|
26196
|
-
\u044C: "",
|
|
26197
|
-
\u044D: "e",
|
|
26198
|
-
\u044E: "yu",
|
|
26199
|
-
\u044F: "ya"
|
|
26200
|
-
};
|
|
26201
|
-
var latinSpellings = /* @__PURE__ */ __name((word) => {
|
|
26202
|
-
if (!new RegExp("\\p{Script=Cyrillic}", "u").test(word))
|
|
26203
|
-
return [];
|
|
26204
|
-
const plain2 = [...normalize(word)].map((letter) => LATIN[letter] ?? letter).join("");
|
|
26205
|
-
return [.../* @__PURE__ */ new Set([plain2, plain2.replaceAll("ks", "x")])];
|
|
26206
|
-
}, "latinSpellings");
|
|
26207
|
-
var respelled = /* @__PURE__ */ __name(async (vocabulary, words3) => {
|
|
26208
|
-
const known2 = await vocabulary.knownTerms(words3);
|
|
26209
|
-
const found = /* @__PURE__ */ new Map();
|
|
26210
|
-
for (const word of words3.filter((one) => !known2.has(one))) {
|
|
26211
|
-
const latin = latinSpellings(word);
|
|
26212
|
-
const held = await vocabulary.knownTerms(latin);
|
|
26213
|
-
const nearLatin = await correctWords(vocabulary, latin.filter((one) => !held.has(one)));
|
|
26214
|
-
const asLatin = [.../* @__PURE__ */ new Set([...held, ...[...nearLatin.values()].flat()])];
|
|
26215
|
-
const forms = asLatin.length ? asLatin : (await correctWords(vocabulary, [word])).get(normalize(word)) ?? [];
|
|
26216
|
-
if (forms.length)
|
|
26217
|
-
found.set(word, forms);
|
|
26218
|
-
}
|
|
26219
|
-
return found;
|
|
26220
|
-
}, "respelled");
|
|
26221
|
-
|
|
26222
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.722.0_@wirecat+cli-base@0.127.0_commander@15.0.0_esbuild@0.28.2_typ_d2bed0cfbe6b4358c89d465b9e07afcb/node_modules/@wirecat/cli-core/dist/search/total.js
|
|
25967
|
+
// node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/search/total.js
|
|
26223
25968
|
var TOTAL_CAP = 1e4;
|
|
26224
25969
|
var totalOf = /* @__PURE__ */ __name((count3, shown, hasMore, exact = true) => {
|
|
26225
25970
|
const least = shown + (hasMore ? 1 : 0);
|
|
@@ -26230,7 +25975,7 @@ var totalOf = /* @__PURE__ */ __name((count3, shown, hasMore, exact = true) => {
|
|
|
26230
25975
|
return { value: count3, relation: exact ? "eq" : "gte" };
|
|
26231
25976
|
}, "totalOf");
|
|
26232
25977
|
|
|
26233
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
25978
|
+
// node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/search/lucene/meaning-parts.js
|
|
26234
25979
|
var WORD_FIELDS = /* @__PURE__ */ new Set(["text", "exact"]);
|
|
26235
25980
|
var fieldsOfQuery = /* @__PURE__ */ __name((root, everything) => {
|
|
26236
25981
|
let narrows = false;
|
|
@@ -26259,7 +26004,7 @@ var meaningWords = /* @__PURE__ */ __name((root) => {
|
|
|
26259
26004
|
return wanted(root).join(" ").trim();
|
|
26260
26005
|
}, "meaningWords");
|
|
26261
26006
|
|
|
26262
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
26007
|
+
// node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/services/messages-combined.js
|
|
26263
26008
|
var COMBINED_DEFAULTS = { candidateDepth: 300, rrfK: 60, rerank: "all", chatCap: 0 };
|
|
26264
26009
|
var tokensOf = /* @__PURE__ */ __name((text2) => normalize(text2).match(/[\p{L}\p{N}\p{Co}\p{M}]+/gu) ?? [], "tokensOf");
|
|
26265
26010
|
var searchCombined = /* @__PURE__ */ __name(async (store, account, request, messenger = {}, options2 = COMBINED_DEFAULTS) => {
|
|
@@ -26460,7 +26205,7 @@ var signals = /* @__PURE__ */ __name((hit, terms, corrections, execution, mode,
|
|
|
26460
26205
|
return mode === "coverage" ? coverage2 * 4 : mode === "proximity" ? proximity : mode === "phrase" ? phrase2 : coverage2 * 4 + proximity + phrase2;
|
|
26461
26206
|
}, "signals");
|
|
26462
26207
|
|
|
26463
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
26208
|
+
// node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/services/messages-discovery.js
|
|
26464
26209
|
var MEANING_DEPTH = 100;
|
|
26465
26210
|
var RRF_K2 = 60;
|
|
26466
26211
|
var RERANK_DEPTH = 50;
|
|
@@ -26786,7 +26531,7 @@ var mixedWithReranker = /* @__PURE__ */ __name((head, scores) => {
|
|
|
26786
26531
|
})).sort((a, b) => b.mixed - a.mixed).map(({ hit }) => hit);
|
|
26787
26532
|
}, "mixedWithReranker");
|
|
26788
26533
|
|
|
26789
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
26534
|
+
// node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/services/named-chat.js
|
|
26790
26535
|
var LEAST_USES = 3;
|
|
26791
26536
|
var SAMPLE2 = 50;
|
|
26792
26537
|
var CAPITALISED = 0.8;
|
|
@@ -26840,7 +26585,7 @@ var queryWords2 = /* @__PURE__ */ __name((query) => {
|
|
|
26840
26585
|
}, "queryWords");
|
|
26841
26586
|
var without = /* @__PURE__ */ __name((query, word) => query.replace(new RegExp(`(?<![\\p{L}\\p{N}])${word}(?![\\p{L}\\p{N}])`, "giu"), " ").replace(/\s+/gu, " ").trim(), "without");
|
|
26842
26587
|
|
|
26843
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
26588
|
+
// node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/services/thread-context.js
|
|
26844
26589
|
var THREAD_BOUNDS = { maxHops: 8, maxMessages: 50, maxBytes: 65536, withinMs: 864e5 };
|
|
26845
26590
|
var bytes = /* @__PURE__ */ __name((items, links) => Buffer.byteLength(JSON.stringify({ items, links }), "utf8"), "bytes");
|
|
26846
26591
|
var threadBounds = /* @__PURE__ */ __name((options2 = {}) => {
|
|
@@ -27039,7 +26784,7 @@ var readThreadContext = /* @__PURE__ */ __name(async (store, account, chat, mess
|
|
|
27039
26784
|
return result;
|
|
27040
26785
|
}, "readThreadContext");
|
|
27041
26786
|
|
|
27042
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
26787
|
+
// node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/services/messages-archive-search.js
|
|
27043
26788
|
var SEARCH_FILL_MS = 200;
|
|
27044
26789
|
var statsStore = /* @__PURE__ */ __name(async (store, account, request, messenger = {}) => {
|
|
27045
26790
|
const stop = Date.now() + SEARCH_FILL_MS;
|
|
@@ -27080,15 +26825,15 @@ var searchStore = /* @__PURE__ */ __name(async (store, account, request, messeng
|
|
|
27080
26825
|
const page = /* @__PURE__ */ __name((asked) => searchPage(store, account, { ...asked, limit: asked.limit + offset }, messenger, meaning, rerank), "page");
|
|
27081
26826
|
const all = await page(request);
|
|
27082
26827
|
const { named: named2 } = helped;
|
|
27083
|
-
const
|
|
26828
|
+
const inside = named2 && typed !== void 0 ? await page({
|
|
27084
26829
|
...request,
|
|
27085
26830
|
text: plainQuery(without(helped.text ?? typed, named2.word) || typed),
|
|
27086
26831
|
chat: named2.chatId
|
|
27087
26832
|
}) : void 0;
|
|
27088
|
-
const shown = new Set(
|
|
27089
|
-
const found =
|
|
26833
|
+
const shown = new Set(inside?.items.map(({ locator }) => locator));
|
|
26834
|
+
const found = inside ? {
|
|
27090
26835
|
...all,
|
|
27091
|
-
items: [...
|
|
26836
|
+
items: [...inside.items, ...all.items.filter(({ locator }) => !shown.has(locator))].slice(0, request.limit + offset)
|
|
27092
26837
|
} : all;
|
|
27093
26838
|
const discovery = found.query?.discovery;
|
|
27094
26839
|
const total = discovery ? totalOf(discovery.candidates, found.items.length, found.hasMore, !discovery.truncated) : totalOf(await countLucene(store, account, { ...request.discover ? discoveryRequest(request) : request, limit: request.limit + offset }, messenger, TOTAL_CAP).catch((error) => {
|
|
@@ -27147,7 +26892,7 @@ var accountOf2 = /* @__PURE__ */ __name((hit) => {
|
|
|
27147
26892
|
}, "accountOf");
|
|
27148
26893
|
var keyOf2 = /* @__PURE__ */ __name(({ provider, account }) => `${provider}/${account}`, "keyOf");
|
|
27149
26894
|
|
|
27150
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
26895
|
+
// node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/embeddings/keys.js
|
|
27151
26896
|
var endpointKeyName = /* @__PURE__ */ __name((baseUrl) => {
|
|
27152
26897
|
const host = new URL(baseUrl).host;
|
|
27153
26898
|
return ["openai", "anthropic"].includes(host) ? `endpoint:${host}` : host;
|
|
@@ -27180,7 +26925,7 @@ var embeddingKeys = /* @__PURE__ */ __name((app, env = process.env, keyring) =>
|
|
|
27180
26925
|
};
|
|
27181
26926
|
}, "embeddingKeys");
|
|
27182
26927
|
|
|
27183
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
26928
|
+
// node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/models/openai.js
|
|
27184
26929
|
var options = strictObject({
|
|
27185
26930
|
temperature: range(0, 2),
|
|
27186
26931
|
top_p: range(0, 1),
|
|
@@ -27247,7 +26992,7 @@ var openai = {
|
|
|
27247
26992
|
}), "complete")
|
|
27248
26993
|
};
|
|
27249
26994
|
|
|
27250
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
26995
|
+
// node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/models/index.js
|
|
27251
26996
|
var modelGateway = /* @__PURE__ */ __name((deps) => ({
|
|
27252
26997
|
complete: /* @__PURE__ */ __name(async (request) => {
|
|
27253
26998
|
if (deps.signal?.aborted)
|
|
@@ -27262,7 +27007,7 @@ var modelGateway = /* @__PURE__ */ __name((deps) => ({
|
|
|
27262
27007
|
if (!adapter && target2.provider === "openai")
|
|
27263
27008
|
adapter = openai;
|
|
27264
27009
|
if (!adapter && target2.provider === "anthropic")
|
|
27265
|
-
adapter = (await import("./anthropic-
|
|
27010
|
+
adapter = (await import("./anthropic-47CMXBPQ.js")).anthropic;
|
|
27266
27011
|
if (!adapter)
|
|
27267
27012
|
throw new CliError("validation_error", `no model adapter for ${target2.provider}`);
|
|
27268
27013
|
if (request.images !== void 0 && adapter.images !== true)
|
|
@@ -27322,7 +27067,7 @@ var modelGateway = /* @__PURE__ */ __name((deps) => ({
|
|
|
27322
27067
|
}, "complete")
|
|
27323
27068
|
}), "modelGateway");
|
|
27324
27069
|
|
|
27325
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
27070
|
+
// node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/services/searches.js
|
|
27326
27071
|
var savedSearchItem = /* @__PURE__ */ __name((one) => ({
|
|
27327
27072
|
id: one.id,
|
|
27328
27073
|
name: one.name,
|
|
@@ -27448,7 +27193,7 @@ var searchesService = /* @__PURE__ */ __name((deps) => {
|
|
|
27448
27193
|
};
|
|
27449
27194
|
}, "searchesService");
|
|
27450
27195
|
|
|
27451
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
27196
|
+
// node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/services/text-model-choice.js
|
|
27452
27197
|
import { createHash as createHash3 } from "node:crypto";
|
|
27453
27198
|
import { existsSync } from "node:fs";
|
|
27454
27199
|
var useTextModel = /* @__PURE__ */ __name(async (id2, { env, command }) => {
|
|
@@ -27579,11 +27324,11 @@ var addCustomTextModel = /* @__PURE__ */ __name(async (id2, payload, { env, fetc
|
|
|
27579
27324
|
return { ...checked2.output, custom: true };
|
|
27580
27325
|
}, "addCustomTextModel");
|
|
27581
27326
|
|
|
27582
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
27327
|
+
// node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/calendar/sync.js
|
|
27583
27328
|
var DAY3 = 864e5;
|
|
27584
27329
|
var SLOTS_EVERY = 7 * DAY3;
|
|
27585
27330
|
|
|
27586
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
27331
|
+
// node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/calendar/reads.js
|
|
27587
27332
|
var localDate = /* @__PURE__ */ __name((at, zone) => new Intl.DateTimeFormat("en-CA", { timeZone: zone, year: "numeric", month: "2-digit", day: "2-digit" }).format(at), "localDate");
|
|
27588
27333
|
var plusDays = /* @__PURE__ */ __name((date, days) => {
|
|
27589
27334
|
const [year, month, day2] = date.split("-").map(Number);
|
|
@@ -27647,10 +27392,10 @@ var EVENTS_QUERY = {
|
|
|
27647
27392
|
} : field)
|
|
27648
27393
|
};
|
|
27649
27394
|
|
|
27650
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
27395
|
+
// node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/calendar/feeds.js
|
|
27651
27396
|
var FEED_LIMITS = { maxBytes: 10 * 1024 * 1024, timeoutMs: 3e4, redirects: 5 };
|
|
27652
27397
|
|
|
27653
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
27398
|
+
// node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/calendar/writer.js
|
|
27654
27399
|
var EVENTS_NOTIFY_KEY = "events.notify";
|
|
27655
27400
|
var EVENTS_DELETE_SERIES_KEY = "events.delete.series";
|
|
27656
27401
|
var EVENTS_REMIND_HOOK_KEY = "events.remind.hook";
|
|
@@ -27668,7 +27413,7 @@ var CALENDAR_WRITE_DEFAULTS = {
|
|
|
27668
27413
|
[EVENTS_REMIND_HOOK_KEY]: "deny"
|
|
27669
27414
|
};
|
|
27670
27415
|
|
|
27671
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
27416
|
+
// node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/services/meeting-passage-format.js
|
|
27672
27417
|
var visible = /* @__PURE__ */ __name((text2) => text2.replace(/[\p{Cc}\p{Cf}]/gu, (value) => value === "\n" || value === " " ? value : `\\u{${value.codePointAt(0)?.toString(16)}}`), "visible");
|
|
27673
27418
|
var markdown = /* @__PURE__ */ __name((text2) => visible(text2).replaceAll("&", "&").replaceAll("<", "<").replaceAll(">", ">").replace(/[\\`*_[\]#|~]/g, "\\$&"), "markdown");
|
|
27674
27419
|
var timestamp = /* @__PURE__ */ __name((ms) => {
|
|
@@ -27737,7 +27482,7 @@ ${body}`;
|
|
|
27737
27482
|
`;
|
|
27738
27483
|
}, "formatMeetingPassage");
|
|
27739
27484
|
|
|
27740
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
27485
|
+
// node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/services/meeting-preparation-validation.js
|
|
27741
27486
|
var MEETING_PREPARATION_LIMITS = {
|
|
27742
27487
|
meetings: { min: 1, max: 20, default: 5 },
|
|
27743
27488
|
cues: { min: 1, max: 100, default: 10 },
|
|
@@ -27810,7 +27555,7 @@ var validateMeetingPreparationRequest = /* @__PURE__ */ __name((externalId, orig
|
|
|
27810
27555
|
};
|
|
27811
27556
|
}, "validateMeetingPreparationRequest");
|
|
27812
27557
|
|
|
27813
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
27558
|
+
// node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/services/meeting-communications-selection.js
|
|
27814
27559
|
var validatePreparationCommunications = /* @__PURE__ */ __name((section, request, after) => {
|
|
27815
27560
|
const fail2 = /* @__PURE__ */ __name(() => {
|
|
27816
27561
|
throw new CliError("invalid_response", "Preparation communications returned another selection or invalid evidence");
|
|
@@ -27858,7 +27603,7 @@ var validatePreparationCommunications = /* @__PURE__ */ __name((section, request
|
|
|
27858
27603
|
}
|
|
27859
27604
|
}, "validatePreparationCommunications");
|
|
27860
27605
|
|
|
27861
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
27606
|
+
// node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/services/package-upgrade.js
|
|
27862
27607
|
var upgradePackage = /* @__PURE__ */ __name(async ({ current, command, packageName, check: check2 }, ports) => {
|
|
27863
27608
|
const installer = ports.installer();
|
|
27864
27609
|
const argv = updateCommand(installer, packageName);
|
|
@@ -27923,18 +27668,18 @@ var dayAfter = /* @__PURE__ */ __name((published) => {
|
|
|
27923
27668
|
return Number.isNaN(time) ? null : new Date(time + 24 * 60 * 60 * 1e3).toISOString();
|
|
27924
27669
|
}, "dayAfter");
|
|
27925
27670
|
|
|
27926
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
27671
|
+
// node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/services/media-archive.js
|
|
27927
27672
|
import { setTimeout as sleep3 } from "node:timers/promises";
|
|
27928
27673
|
|
|
27929
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
27674
|
+
// node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/services/media-archive-files.js
|
|
27930
27675
|
import { lstat } from "node:fs/promises";
|
|
27931
27676
|
|
|
27932
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
27677
|
+
// node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/persistence/native/recording-partial-store.js
|
|
27933
27678
|
import { createHash as createHash5, randomUUID as randomUUID2 } from "node:crypto";
|
|
27934
|
-
import { open as
|
|
27679
|
+
import { open as open2, rename as rename2, unlink as unlink2 } from "node:fs/promises";
|
|
27935
27680
|
import { join as join4 } from "node:path";
|
|
27936
27681
|
|
|
27937
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
27682
|
+
// node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/persistence/native/recording-partial-metadata.js
|
|
27938
27683
|
import { createHash as createHash4 } from "node:crypto";
|
|
27939
27684
|
var metadataLimit = 16384;
|
|
27940
27685
|
var partialIdentity = /* @__PURE__ */ __name((locator) => JSON.stringify([locator.provider, locator.account, locator.occurrenceId, locator.assetId]), "partialIdentity");
|
|
@@ -27994,9 +27739,9 @@ var readPartialMetadata = /* @__PURE__ */ __name(async (path, locator, maxBytes,
|
|
|
27994
27739
|
}
|
|
27995
27740
|
}, "readPartialMetadata");
|
|
27996
27741
|
|
|
27997
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
27742
|
+
// node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/persistence/native/recording-partial-writer.js
|
|
27998
27743
|
import { randomUUID } from "node:crypto";
|
|
27999
|
-
import { open
|
|
27744
|
+
import { open, rename, unlink } from "node:fs/promises";
|
|
28000
27745
|
import { join as join3 } from "node:path";
|
|
28001
27746
|
var partialWriter = /* @__PURE__ */ __name(async (input) => {
|
|
28002
27747
|
const { file, signal, partial } = input;
|
|
@@ -28024,7 +27769,7 @@ var partialWriter = /* @__PURE__ */ __name(async (input) => {
|
|
|
28024
27769
|
if (Buffer.byteLength(content) > metadataLimit)
|
|
28025
27770
|
throw new CliError("validation_error", "recording partial metadata exceeds its byte limit");
|
|
28026
27771
|
const temp = join3(input.root, `${input.prefix}${randomUUID()}.tmp`);
|
|
28027
|
-
const metadata = await
|
|
27772
|
+
const metadata = await open(temp, "wx", 384);
|
|
28028
27773
|
try {
|
|
28029
27774
|
try {
|
|
28030
27775
|
await metadata.writeFile(content);
|
|
@@ -28086,7 +27831,7 @@ var partialWriter = /* @__PURE__ */ __name(async (input) => {
|
|
|
28086
27831
|
};
|
|
28087
27832
|
}, "partialWriter");
|
|
28088
27833
|
|
|
28089
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
27834
|
+
// node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/persistence/native/recording-partial-store.js
|
|
28090
27835
|
var NativeRecordingPartialStore = class {
|
|
28091
27836
|
static {
|
|
28092
27837
|
__name(this, "NativeRecordingPartialStore");
|
|
@@ -28152,7 +27897,7 @@ var NativeRecordingPartialStore = class {
|
|
|
28152
27897
|
file = await openOrdinaryFile(this.path, { writable: true });
|
|
28153
27898
|
} else {
|
|
28154
27899
|
const temp = join4(this.root, `${this.options.prefix}${randomUUID2()}.tmp`);
|
|
28155
|
-
file = await
|
|
27900
|
+
file = await open2(temp, "wx+", 384);
|
|
28156
27901
|
try {
|
|
28157
27902
|
await rename2(temp, this.path);
|
|
28158
27903
|
await unlink2(this.metadataPath).catch((error) => {
|
|
@@ -28193,12 +27938,12 @@ var NativeRecordingPartialStore = class {
|
|
|
28193
27938
|
}
|
|
28194
27939
|
};
|
|
28195
27940
|
|
|
28196
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
27941
|
+
// node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/persistence/native/recording-publication.js
|
|
28197
27942
|
import { createHash as createHash6 } from "node:crypto";
|
|
28198
27943
|
import { link as link2 } from "node:fs/promises";
|
|
28199
|
-
import { basename as
|
|
27944
|
+
import { basename as basename2, dirname as dirname2, join as join6, resolve } from "node:path";
|
|
28200
27945
|
|
|
28201
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
27946
|
+
// node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/persistence/native/recording-publication-files.js
|
|
28202
27947
|
import { unlink as unlink3 } from "node:fs/promises";
|
|
28203
27948
|
var verifiedPublicationFile = /* @__PURE__ */ __name(async (path, expected2, signal, writable = false) => {
|
|
28204
27949
|
signal?.throwIfAborted();
|
|
@@ -28233,9 +27978,9 @@ var commitPublication = /* @__PURE__ */ __name(async (root, partialPath, finalPa
|
|
|
28233
27978
|
signal?.throwIfAborted();
|
|
28234
27979
|
}, "commitPublication");
|
|
28235
27980
|
|
|
28236
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
27981
|
+
// node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/persistence/native/recording-publication-journal.js
|
|
28237
27982
|
import { randomUUID as randomUUID3 } from "node:crypto";
|
|
28238
|
-
import { open as
|
|
27983
|
+
import { open as open3, rename as rename3, unlink as unlink4 } from "node:fs/promises";
|
|
28239
27984
|
import { join as join5 } from "node:path";
|
|
28240
27985
|
var readPublicationJournal = /* @__PURE__ */ __name(async (path, codec, limit, signal) => {
|
|
28241
27986
|
signal?.throwIfAborted();
|
|
@@ -28281,7 +28026,7 @@ var writePublicationJournal = /* @__PURE__ */ __name(async (root, path, prefix,
|
|
|
28281
28026
|
throw new CliError("validation_error", "recording recovery record exceeds its metadata limit");
|
|
28282
28027
|
codec.decode(JSON.parse(content));
|
|
28283
28028
|
const temp = join5(root, `${prefix}${randomUUID3()}.tmp`);
|
|
28284
|
-
const handle = await
|
|
28029
|
+
const handle = await open3(temp, "wx", 384);
|
|
28285
28030
|
let identity;
|
|
28286
28031
|
try {
|
|
28287
28032
|
try {
|
|
@@ -28306,7 +28051,7 @@ var writePublicationJournal = /* @__PURE__ */ __name(async (root, path, prefix,
|
|
|
28306
28051
|
}
|
|
28307
28052
|
}, "writePublicationJournal");
|
|
28308
28053
|
|
|
28309
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
28054
|
+
// node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/persistence/native/recording-publication.js
|
|
28310
28055
|
var NativeRecordingPublication = class {
|
|
28311
28056
|
static {
|
|
28312
28057
|
__name(this, "NativeRecordingPublication");
|
|
@@ -28318,7 +28063,7 @@ var NativeRecordingPublication = class {
|
|
|
28318
28063
|
options;
|
|
28319
28064
|
constructor(root, locator, options2) {
|
|
28320
28065
|
this.root = root;
|
|
28321
|
-
if (!root || root.includes("\0") || !/^\.[a-zA-Z0-9][a-zA-Z0-9._-]{0,95}-$/.test(options2.prefix) || !options2.filename ||
|
|
28066
|
+
if (!root || root.includes("\0") || !/^\.[a-zA-Z0-9][a-zA-Z0-9._-]{0,95}-$/.test(options2.prefix) || !options2.filename || basename2(options2.filename) !== options2.filename || /[\\/\0]/.test(options2.filename) || [".", ".."].includes(options2.filename) || !Number.isSafeInteger(options2.maxBytes) || options2.maxBytes <= 0 || !Number.isSafeInteger(options2.metadataLimit) || options2.metadataLimit <= 0 || options2.metadataLimit > 1048576 || [locator.provider, locator.account, locator.occurrenceId, locator.assetId].some((value) => typeof value !== "string" || !value.trim() || /[\0\r\n]/.test(value)))
|
|
28322
28067
|
throw new CliError("validation_error", "invalid native recording publication options");
|
|
28323
28068
|
this.scope = partialIdentity(locator);
|
|
28324
28069
|
this.options = Object.freeze({ ...options2, codec: Object.freeze({ ...options2.codec }) });
|
|
@@ -28334,7 +28079,7 @@ var NativeRecordingPublication = class {
|
|
|
28334
28079
|
return writePublicationJournal(this.root, this.journalPath, this.options.prefix, value, this.options.codec, this.options.metadataLimit, this.options.signal);
|
|
28335
28080
|
}
|
|
28336
28081
|
validate(partialPath, expected2) {
|
|
28337
|
-
if (
|
|
28082
|
+
if (resolve(dirname2(partialPath)) !== resolve(this.root) || resolve(partialPath) === resolve(this.finalPath) || resolve(partialPath) === resolve(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))
|
|
28338
28083
|
throw new CliError("validation_error", "invalid recording publication evidence");
|
|
28339
28084
|
this.options.signal?.throwIfAborted();
|
|
28340
28085
|
}
|
|
@@ -28379,10 +28124,10 @@ var NativeRecordingPublication = class {
|
|
|
28379
28124
|
}
|
|
28380
28125
|
};
|
|
28381
28126
|
|
|
28382
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
28127
|
+
// node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/services/media-archive-manifest.js
|
|
28383
28128
|
import { createHash as createHash7 } from "node:crypto";
|
|
28384
28129
|
import { readdir } from "node:fs/promises";
|
|
28385
|
-
import { isAbsolute
|
|
28130
|
+
import { isAbsolute, join as join7, resolve as resolve2 } from "node:path";
|
|
28386
28131
|
var mediaKey = /* @__PURE__ */ __name((one) => createHash7("sha256").update(JSON.stringify([one.provider, one.account, one.chat, one.message, one.position])).digest("hex"), "mediaKey");
|
|
28387
28132
|
var mediaManifestName = /* @__PURE__ */ __name((one) => `.media-archive-${mediaKey(one)}.json`, "mediaManifestName");
|
|
28388
28133
|
var missingMediaFile = /* @__PURE__ */ __name((error) => typeof error === "object" && error !== null && "code" in error && error.code === "ENOENT", "missingMediaFile");
|
|
@@ -28402,7 +28147,7 @@ var parseMediaEntry = /* @__PURE__ */ __name((value) => {
|
|
|
28402
28147
|
"messageTime",
|
|
28403
28148
|
"mime",
|
|
28404
28149
|
"relocatedTo"
|
|
28405
|
-
].includes(key)) || one.messageTime !== void 0 && (typeof one.messageTime !== "string" || !Number.isFinite(Date.parse(one.messageTime)) || new Date(one.messageTime).toISOString() !== one.messageTime) || one.mime !== void 0 && (typeof one.mime !== "string" || one.mime.length > 127 || !/^[a-z0-9.+-]+\/[a-z0-9.+-]+$/.test(one.mime)) || one.relocatedTo !== void 0 && (typeof one.relocatedTo !== "string" || !
|
|
28150
|
+
].includes(key)) || one.messageTime !== void 0 && (typeof one.messageTime !== "string" || !Number.isFinite(Date.parse(one.messageTime)) || new Date(one.messageTime).toISOString() !== one.messageTime) || one.mime !== void 0 && (typeof one.mime !== "string" || one.mime.length > 127 || !/^[a-z0-9.+-]+\/[a-z0-9.+-]+$/.test(one.mime)) || one.relocatedTo !== void 0 && (typeof one.relocatedTo !== "string" || !isAbsolute(one.relocatedTo) || /[\p{Cc}]/u.test(one.relocatedTo)) || [one.provider, one.account, one.chat, one.message, one.kind].some((text2) => typeof text2 !== "string" || !text2.trim() || text2.length > 512 || /[\0\r\n]/.test(text2)) || !Number.isSafeInteger(one.position) || one.position < 0 || !Number.isSafeInteger(one.size) || one.size < 0 || typeof one.sha256 !== "string" || !/^[a-f0-9]{64}$/.test(one.sha256) || one.path !== `${mediaKey(one)}.bin`)
|
|
28406
28151
|
throw new CliError("validation_error", "invalid media archive manifest");
|
|
28407
28152
|
return { ...one };
|
|
28408
28153
|
}, "parseMediaEntry");
|
|
@@ -28441,7 +28186,7 @@ var readMediaManifests = /* @__PURE__ */ __name(async (root, signal) => {
|
|
|
28441
28186
|
return entries;
|
|
28442
28187
|
}, "readMediaManifests");
|
|
28443
28188
|
var verifyMediaEntry = /* @__PURE__ */ __name(async (root, one, signal) => {
|
|
28444
|
-
let location =
|
|
28189
|
+
let location = resolve2(root);
|
|
28445
28190
|
let entry = one;
|
|
28446
28191
|
const visited = /* @__PURE__ */ new Set();
|
|
28447
28192
|
while (entry.relocatedTo !== void 0) {
|
|
@@ -28449,7 +28194,7 @@ var verifyMediaEntry = /* @__PURE__ */ __name(async (root, one, signal) => {
|
|
|
28449
28194
|
if (visited.has(location) || visited.size >= 64)
|
|
28450
28195
|
throw new CliError("validation_error", "media archive relocation cycle or excessive depth");
|
|
28451
28196
|
visited.add(location);
|
|
28452
|
-
location =
|
|
28197
|
+
location = resolve2(entry.relocatedTo);
|
|
28453
28198
|
const target2 = parseMediaEntry(JSON.parse(await readBoundedUtf8File(join7(location, mediaManifestName(one)), { maxBytes: 16384 })));
|
|
28454
28199
|
if (!sameMediaCopy(one, target2))
|
|
28455
28200
|
return false;
|
|
@@ -28466,7 +28211,7 @@ var commitMediaEntry = /* @__PURE__ */ __name((root, one, beforePublish) => writ
|
|
|
28466
28211
|
beforePublish
|
|
28467
28212
|
}), "commitMediaEntry");
|
|
28468
28213
|
|
|
28469
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
28214
|
+
// node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/services/media-archive-files.js
|
|
28470
28215
|
var validator = '"media-completed-v1"';
|
|
28471
28216
|
var maximumFileBytes = 64 * 1024 * 1024 * 1024;
|
|
28472
28217
|
var archiveMediaFile = /* @__PURE__ */ __name(async (root, identity, kind, file, beforeWrite, signal, metadata = {}) => {
|
|
@@ -28567,12 +28312,12 @@ var archiveMediaFile = /* @__PURE__ */ __name(async (root, identity, kind, file,
|
|
|
28567
28312
|
return entry;
|
|
28568
28313
|
}, "archiveMediaFile");
|
|
28569
28314
|
|
|
28570
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
28315
|
+
// node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/services/media-archive-locks.js
|
|
28571
28316
|
import { mkdir, realpath } from "node:fs/promises";
|
|
28572
|
-
import { join as join8, resolve as
|
|
28317
|
+
import { join as join8, resolve as resolve3 } from "node:path";
|
|
28573
28318
|
var archiveLocations = /* @__PURE__ */ __name(async (initial, signal) => {
|
|
28574
28319
|
const roots = /* @__PURE__ */ new Set();
|
|
28575
|
-
const queued = new Set(initial.map((directory2) =>
|
|
28320
|
+
const queued = new Set(initial.map((directory2) => resolve3(directory2)));
|
|
28576
28321
|
const pending = [...queued];
|
|
28577
28322
|
for (let at = 0; at < pending.length; at++) {
|
|
28578
28323
|
signal?.throwIfAborted();
|
|
@@ -28591,7 +28336,7 @@ var archiveLocations = /* @__PURE__ */ __name(async (initial, signal) => {
|
|
|
28591
28336
|
roots.add(root);
|
|
28592
28337
|
for (const entry of await readMediaManifests(root, signal))
|
|
28593
28338
|
if (entry.relocatedTo) {
|
|
28594
|
-
const location =
|
|
28339
|
+
const location = resolve3(entry.relocatedTo);
|
|
28595
28340
|
if (!queued.has(location)) {
|
|
28596
28341
|
queued.add(location);
|
|
28597
28342
|
pending.push(location);
|
|
@@ -28634,7 +28379,7 @@ var withMediaArchiveLocks = /* @__PURE__ */ __name(async (directory2, signal, ru
|
|
|
28634
28379
|
throw new CliError("validation_error", "archive locations changed during locking; run the command again");
|
|
28635
28380
|
}, "withMediaArchiveLocks");
|
|
28636
28381
|
|
|
28637
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
28382
|
+
// node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/services/media-archive.js
|
|
28638
28383
|
var checkMediaArchive = /* @__PURE__ */ __name((directory2, signal) => withMediaArchiveLocks(directory2, signal, async (root) => {
|
|
28639
28384
|
const entries = await readMediaManifests(root, signal);
|
|
28640
28385
|
if (!entries.length)
|
|
@@ -28777,17 +28522,17 @@ var archiveMedia = /* @__PURE__ */ __name(async (ports, options2) => {
|
|
|
28777
28522
|
}, { create: true });
|
|
28778
28523
|
}, "archiveMedia");
|
|
28779
28524
|
|
|
28780
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
28525
|
+
// node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/services/media-archive-move.js
|
|
28781
28526
|
import { realpath as realpath2, unlink as unlink5 } from "node:fs/promises";
|
|
28782
|
-
import { basename as
|
|
28527
|
+
import { basename as basename3, dirname as dirname3, join as join9, resolve as resolve4 } from "node:path";
|
|
28783
28528
|
var canonicalDestination = /* @__PURE__ */ __name(async (directory2) => {
|
|
28784
|
-
const path =
|
|
28529
|
+
const path = resolve4(directory2);
|
|
28785
28530
|
try {
|
|
28786
28531
|
return await realpath2(path);
|
|
28787
28532
|
} catch (error) {
|
|
28788
|
-
if (!missingMediaFile(error) ||
|
|
28533
|
+
if (!missingMediaFile(error) || dirname3(path) === path)
|
|
28789
28534
|
throw error;
|
|
28790
|
-
return join9(await canonicalDestination(
|
|
28535
|
+
return join9(await canonicalDestination(dirname3(path)), basename3(path));
|
|
28791
28536
|
}
|
|
28792
28537
|
}, "canonicalDestination");
|
|
28793
28538
|
var image2 = /* @__PURE__ */ __name((entry) => ["photo", "image"].includes(entry.kind) || entry.mime?.startsWith("image/"), "image");
|
|
@@ -28928,7 +28673,7 @@ var moveMediaArchive = /* @__PURE__ */ __name(async (options2) => {
|
|
|
28928
28673
|
}, { additional: [target2], createAdditional: !options2.dryRun });
|
|
28929
28674
|
}, "moveMediaArchive");
|
|
28930
28675
|
|
|
28931
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
28676
|
+
// node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/domain/money-words.js
|
|
28932
28677
|
var MONEY_REQUEST = "money-request";
|
|
28933
28678
|
var MONEY_DONE = "money-done";
|
|
28934
28679
|
var PROMISE = "promise";
|
|
@@ -28962,10 +28707,10 @@ var MONEY_WORDS = [
|
|
|
28962
28707
|
}
|
|
28963
28708
|
];
|
|
28964
28709
|
|
|
28965
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
28710
|
+
// node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/services/money-words.js
|
|
28966
28711
|
var moneyClassesOf = /* @__PURE__ */ __name((text2) => listsHit(text2, MONEY_WORDS), "moneyClassesOf");
|
|
28967
28712
|
|
|
28968
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
28713
|
+
// node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/domain/status-words.js
|
|
28969
28714
|
var words2 = /* @__PURE__ */ __name((forms) => new RegExp(`(?<![\\p{L}\\p{N}])(?:${forms.join("|")})(?![\\p{L}\\p{N}])`, "iu"), "words");
|
|
28970
28715
|
var MONEY_DONE_FORMS = words2([
|
|
28971
28716
|
"\u043E\u043F\u043B\u0430\u0442\u0438\u043B[\u0430\u0438]?",
|
|
@@ -29005,7 +28750,7 @@ var PROMISE_FORMS = words2([
|
|
|
29005
28750
|
"estar\xE1 listo"
|
|
29006
28751
|
]);
|
|
29007
28752
|
|
|
29008
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
28753
|
+
// node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/services/project-status/items.js
|
|
29009
28754
|
var EXCERPT_CHARS = 80;
|
|
29010
28755
|
var excerpt2 = /* @__PURE__ */ __name((text2) => {
|
|
29011
28756
|
const flat = text2.replace(/\s+/g, " ").trim();
|
|
@@ -29027,7 +28772,7 @@ var whoOf = /* @__PURE__ */ __name((message) => ({
|
|
|
29027
28772
|
var fromOwner = /* @__PURE__ */ __name((message) => message.outgoing === true, "fromOwner");
|
|
29028
28773
|
var day = /* @__PURE__ */ __name((at) => new Date(at).toISOString().slice(0, 10), "day");
|
|
29029
28774
|
|
|
29030
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
28775
|
+
// node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/services/project-status/signals/amounts.js
|
|
29031
28776
|
var MONEY = DEFAULT_TASK_CATEGORIES.filter((category) => category.name === "money");
|
|
29032
28777
|
var verbOf = /* @__PURE__ */ __name((text2) => {
|
|
29033
28778
|
if (MONEY_DONE_FORMS.test(text2))
|
|
@@ -29108,7 +28853,7 @@ var amounts = {
|
|
|
29108
28853
|
attention: /* @__PURE__ */ __name((items) => items.flatMap((item2) => item2.chat !== null && item2.data.state === "asked" ? [{ chat: item2.chat, weight: 2, why: "money asked" }] : []), "attention")
|
|
29109
28854
|
};
|
|
29110
28855
|
|
|
29111
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
28856
|
+
// node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/services/project-status/signals/children.js
|
|
29112
28857
|
var children = {
|
|
29113
28858
|
id: "children",
|
|
29114
28859
|
version: 1,
|
|
@@ -29137,7 +28882,7 @@ var children = {
|
|
|
29137
28882
|
}, "read")
|
|
29138
28883
|
};
|
|
29139
28884
|
|
|
29140
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
28885
|
+
// node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/services/project-status/signals/coverage.js
|
|
29141
28886
|
var coverage = {
|
|
29142
28887
|
id: "coverage",
|
|
29143
28888
|
version: 1,
|
|
@@ -29166,7 +28911,7 @@ var coverage = {
|
|
|
29166
28911
|
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")
|
|
29167
28912
|
};
|
|
29168
28913
|
|
|
29169
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
28914
|
+
// node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/services/project-status/signals/payments.js
|
|
29170
28915
|
var holding = /* @__PURE__ */ __name((row) => row.review !== "rejected", "holding");
|
|
29171
28916
|
var item = /* @__PURE__ */ __name((row, at, data) => ({
|
|
29172
28917
|
signal: "payments",
|
|
@@ -29216,7 +28961,7 @@ var payments = {
|
|
|
29216
28961
|
}, "read")
|
|
29217
28962
|
};
|
|
29218
28963
|
|
|
29219
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
28964
|
+
// node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/services/project-status/signals/promises.js
|
|
29220
28965
|
var PATTERNS_PER_CHAT = 3;
|
|
29221
28966
|
var DAY4 = 864e5;
|
|
29222
28967
|
var KINDS2 = /* @__PURE__ */ new Set(["promise", "request"]);
|
|
@@ -29305,7 +29050,7 @@ var promises = {
|
|
|
29305
29050
|
}, "read")
|
|
29306
29051
|
};
|
|
29307
29052
|
|
|
29308
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
29053
|
+
// node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/services/project-status/signals/questions.js
|
|
29309
29054
|
var PER_SIDE = 5;
|
|
29310
29055
|
var WEEK = 7 * 864e5;
|
|
29311
29056
|
var NOBODY = /* @__PURE__ */ new Set();
|
|
@@ -29316,10 +29061,10 @@ var questions2 = {
|
|
|
29316
29061
|
read: /* @__PURE__ */ __name(async (_context, chat) => {
|
|
29317
29062
|
if (!chat)
|
|
29318
29063
|
return [];
|
|
29319
|
-
const
|
|
29064
|
+
const open6 = /* @__PURE__ */ __name((asker) => questions(chat.messages, { answerers: NOBODY, asker }).filter(({ answer }) => answer === void 0).map(({ question }) => question).reverse().slice(0, PER_SIDE), "open");
|
|
29320
29065
|
return [
|
|
29321
|
-
["theirs",
|
|
29322
|
-
["yours",
|
|
29066
|
+
["theirs", open6("others")],
|
|
29067
|
+
["yours", open6("owner")]
|
|
29323
29068
|
].flatMap(([side, asked]) => asked.map((question) => ({
|
|
29324
29069
|
signal: "questions",
|
|
29325
29070
|
chat: chat.ref,
|
|
@@ -29336,7 +29081,7 @@ var questions2 = {
|
|
|
29336
29081
|
}, "attention")
|
|
29337
29082
|
};
|
|
29338
29083
|
|
|
29339
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
29084
|
+
// node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/services/project-status/signals/reply-next.js
|
|
29340
29085
|
var targetOf = /* @__PURE__ */ __name((message, chat, owners) => {
|
|
29341
29086
|
const byId2 = /* @__PURE__ */ __name((id2) => chat.messages.find((one) => one.id === id2), "byId");
|
|
29342
29087
|
const quoted = message.replyTo ?? (message.replyToId === void 0 ? void 0 : byId2(message.replyToId));
|
|
@@ -29404,7 +29149,7 @@ var replyNext = {
|
|
|
29404
29149
|
attention: /* @__PURE__ */ __name((items) => items.flatMap((item2) => item2.chat !== null && item2.data.next === "owner" ? [{ chat: item2.chat, weight: 2, why: "your move" }] : []), "attention")
|
|
29405
29150
|
};
|
|
29406
29151
|
|
|
29407
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
29152
|
+
// node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/services/project-status/signals/topics.js
|
|
29408
29153
|
var escaped = /* @__PURE__ */ __name((text2) => text2.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), "escaped");
|
|
29409
29154
|
var wholeWord = /* @__PURE__ */ __name((word) => new RegExp(`(?<![\\p{L}\\p{N}])${escaped(word)}(?![\\p{L}\\p{N}])`, "u"), "wholeWord");
|
|
29410
29155
|
var matcherOf = /* @__PURE__ */ __name((query) => {
|
|
@@ -29450,7 +29195,7 @@ var topics = {
|
|
|
29450
29195
|
}, "read")
|
|
29451
29196
|
};
|
|
29452
29197
|
|
|
29453
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
29198
|
+
// node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/services/project-status/signals/index.js
|
|
29454
29199
|
var STATUS_SIGNALS = [
|
|
29455
29200
|
replyNext,
|
|
29456
29201
|
questions2,
|
|
@@ -29462,7 +29207,7 @@ var STATUS_SIGNALS = [
|
|
|
29462
29207
|
children
|
|
29463
29208
|
];
|
|
29464
29209
|
|
|
29465
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
29210
|
+
// node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/services/project-status/index.js
|
|
29466
29211
|
var DAY5 = 864e5;
|
|
29467
29212
|
var STATUS_WINDOW = 300;
|
|
29468
29213
|
var STATUS_CHATS = 16;
|
|
@@ -29651,7 +29396,7 @@ var projectStatus = /* @__PURE__ */ __name(async (store, input) => {
|
|
|
29651
29396
|
};
|
|
29652
29397
|
}, "projectStatus");
|
|
29653
29398
|
|
|
29654
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
29399
|
+
// node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/services/account.js
|
|
29655
29400
|
var accountService = /* @__PURE__ */ __name((deps) => {
|
|
29656
29401
|
const online = /* @__PURE__ */ __name(async (command) => {
|
|
29657
29402
|
if (deps.offline)
|
|
@@ -29723,7 +29468,7 @@ var accountService = /* @__PURE__ */ __name((deps) => {
|
|
|
29723
29468
|
};
|
|
29724
29469
|
}, "accountService");
|
|
29725
29470
|
|
|
29726
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
29471
|
+
// node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/domain/send-time.js
|
|
29727
29472
|
var sendTime = /* @__PURE__ */ __name((value, now = Date.now(), flag = "--at-time", zone) => {
|
|
29728
29473
|
const at = aheadOf(value, flag, now, {
|
|
29729
29474
|
...zone === void 0 ? {} : { zone },
|
|
@@ -29734,7 +29479,7 @@ var sendTime = /* @__PURE__ */ __name((value, now = Date.now(), flag = "--at-tim
|
|
|
29734
29479
|
return new Date(at - at % MINUTE).toISOString();
|
|
29735
29480
|
}, "sendTime");
|
|
29736
29481
|
|
|
29737
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
29482
|
+
// node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/services/admin.js
|
|
29738
29483
|
var recordMembership = /* @__PURE__ */ __name(async (deps, operationId, done2, change, fix, write) => {
|
|
29739
29484
|
try {
|
|
29740
29485
|
const held = await accountStoreIfOpen(deps);
|
|
@@ -29981,7 +29726,7 @@ var linkLimits = /* @__PURE__ */ __name(({ approval, expires, maxUses }) => {
|
|
|
29981
29726
|
return expires === void 0 ? void 0 : sendTime(expires, Date.now(), "--expire-time");
|
|
29982
29727
|
}, "linkLimits");
|
|
29983
29728
|
|
|
29984
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
29729
|
+
// node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/services/archive-gaps.js
|
|
29985
29730
|
import { createHash as createHash8, randomUUID as randomUUID4 } from "node:crypto";
|
|
29986
29731
|
var GAP_BOUNDS = { maxGaps: 5, limit: 500, timeMs: 3e4 };
|
|
29987
29732
|
var validateRepair = /* @__PURE__ */ __name((messenger, options2) => {
|
|
@@ -30118,14 +29863,14 @@ var gapsService = /* @__PURE__ */ __name((deps) => {
|
|
|
30118
29863
|
return { plan, repair };
|
|
30119
29864
|
}, "gapsService");
|
|
30120
29865
|
|
|
30121
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
29866
|
+
// node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/services/attachments.js
|
|
30122
29867
|
import { createHash as createHash11 } from "node:crypto";
|
|
30123
29868
|
import { constants as constants2, mkdirSync as mkdirSync2 } from "node:fs";
|
|
30124
|
-
import { lstat as lstat5, open as
|
|
29869
|
+
import { lstat as lstat5, open as open5, readFile as readFile2, stat } from "node:fs/promises";
|
|
30125
29870
|
|
|
30126
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
29871
|
+
// node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/attachments/directory.js
|
|
30127
29872
|
import { lstat as lstat2, readdir as readdir2, realpath as realpath3 } from "node:fs/promises";
|
|
30128
|
-
import { basename as
|
|
29873
|
+
import { basename as basename4, join as join10, relative, sep } from "node:path";
|
|
30129
29874
|
var MAX_FILES = 1e4;
|
|
30130
29875
|
var directoryPaths = /* @__PURE__ */ __name(async (store, chat, directory2, app, env) => {
|
|
30131
29876
|
if (refusedPlace(directory2, app, env))
|
|
@@ -30149,8 +29894,8 @@ var directoryPaths = /* @__PURE__ */ __name(async (store, chat, directory2, app,
|
|
|
30149
29894
|
const canonical2 = await realpath3(path);
|
|
30150
29895
|
if (refusedPlace(canonical2, app, env))
|
|
30151
29896
|
throw new CliError("validation_error", "--from-dir cannot read credential files, the CLI's own files or the message store");
|
|
30152
|
-
const
|
|
30153
|
-
if (
|
|
29897
|
+
const inside = relative(root, canonical2);
|
|
29898
|
+
if (inside === ".." || inside.startsWith(`..${sep}`))
|
|
30154
29899
|
throw new CliError("validation_error", "a file escapes --from-dir");
|
|
30155
29900
|
files.set(name, canonical2);
|
|
30156
29901
|
}
|
|
@@ -30164,20 +29909,20 @@ var directoryPaths = /* @__PURE__ */ __name(async (store, chat, directory2, app,
|
|
|
30164
29909
|
group.push(file);
|
|
30165
29910
|
groups.set(file.messageId, group);
|
|
30166
29911
|
if (file.name)
|
|
30167
|
-
counts.set(
|
|
29912
|
+
counts.set(basename4(file.name), (counts.get(basename4(file.name)) ?? 0) + 1);
|
|
30168
29913
|
}
|
|
30169
29914
|
const choices = /* @__PURE__ */ new Map();
|
|
30170
29915
|
for (const group of groups.values()) {
|
|
30171
29916
|
group.sort((a, b) => a.position - b.position);
|
|
30172
29917
|
const candidates = group.map((file, index) => {
|
|
30173
29918
|
const prefix = `${file.messageId}-${index + 1}`;
|
|
30174
|
-
return [...files].filter(([name]) => name === prefix || name.startsWith(`${prefix}.`) || file.name !== null && name === `${prefix}-${
|
|
29919
|
+
return [...files].filter(([name]) => name === prefix || name.startsWith(`${prefix}.`) || file.name !== null && name === `${prefix}-${basename4(file.name)}`).map(([, path]) => path);
|
|
30175
29920
|
});
|
|
30176
29921
|
if (candidates.some((paths) => paths.length > 1))
|
|
30177
29922
|
throw new CliError("validation_error", "more than one directory file matches a download ordinal");
|
|
30178
29923
|
const complete = candidates.every((paths) => paths.length === 1);
|
|
30179
29924
|
group.forEach((file, index) => {
|
|
30180
|
-
const own = file.name === null ? void 0 :
|
|
29925
|
+
const own = file.name === null ? void 0 : basename4(file.name);
|
|
30181
29926
|
const named2 = own && counts.get(own) === 1 ? files.get(own) : void 0;
|
|
30182
29927
|
const canonical2 = complete ? candidates[index]?.[0] : void 0;
|
|
30183
29928
|
if (named2 && canonical2 && named2 !== canonical2 || !complete && own && files.has(own) && (counts.get(own) ?? 0) > 1)
|
|
@@ -31235,7 +30980,7 @@ function imageSize(input) {
|
|
|
31235
30980
|
}
|
|
31236
30981
|
__name(imageSize, "imageSize");
|
|
31237
30982
|
|
|
31238
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
30983
|
+
// node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/attachments/ocr.js
|
|
31239
30984
|
var MAX_PAGES = 20;
|
|
31240
30985
|
var MAX_PIXELS = 2e7;
|
|
31241
30986
|
var cancelled2 = /* @__PURE__ */ __name((signal) => {
|
|
@@ -31395,7 +31140,7 @@ var ocrPdf = /* @__PURE__ */ __name(async (bytes2, pipeline2, load, signal) => {
|
|
|
31395
31140
|
}
|
|
31396
31141
|
}, "ocrPdf");
|
|
31397
31142
|
|
|
31398
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
31143
|
+
// node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/attachments/pdf-preview.js
|
|
31399
31144
|
var pdfPreview = /* @__PURE__ */ __name(async (bytes2, page, signal, load = importEngine, env = process.env) => {
|
|
31400
31145
|
const limits = pdfPreviewLimits(env);
|
|
31401
31146
|
const cancelled3 = /* @__PURE__ */ __name(() => {
|
|
@@ -31472,7 +31217,7 @@ var pdfPreview = /* @__PURE__ */ __name(async (bytes2, page, signal, load = impo
|
|
|
31472
31217
|
}
|
|
31473
31218
|
}, "pdfPreview");
|
|
31474
31219
|
|
|
31475
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
31220
|
+
// node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/attachments/picture-reading.js
|
|
31476
31221
|
import { spawn } from "node:child_process";
|
|
31477
31222
|
import { mkdtempSync, readFileSync as readFileSync2, rmSync, writeFileSync as writeFileSync2 } from "node:fs";
|
|
31478
31223
|
import { tmpdir } from "node:os";
|
|
@@ -31505,7 +31250,7 @@ var TIMEOUT_MS2 = 6e5;
|
|
|
31505
31250
|
var MAX_OUTPUT = 4 * 1024 * 1024;
|
|
31506
31251
|
var WITHHELD = /^(ANTHROPIC_API_KEY|OPENAI_API_KEY|CLAUDECODE|CLAUDE_CODE_SESSION_ID|CODEX_THREAD_ID|AI_AGENT|.*_MCP_CLIENT)$/;
|
|
31507
31252
|
var pictureAgentEnv = /* @__PURE__ */ __name((env) => Object.fromEntries(Object.entries(env).filter(([name]) => !WITHHELD.test(name))), "pictureAgentEnv");
|
|
31508
|
-
var run = /* @__PURE__ */ __name((program, args, { env, cwd, stdin, signal }) => new Promise((
|
|
31253
|
+
var run = /* @__PURE__ */ __name((program, args, { env, cwd, stdin, signal }) => new Promise((resolve6, reject) => {
|
|
31509
31254
|
const child = spawn(program, args, {
|
|
31510
31255
|
env: pictureAgentEnv(env),
|
|
31511
31256
|
cwd,
|
|
@@ -31528,7 +31273,7 @@ var run = /* @__PURE__ */ __name((program, args, { env, cwd, stdin, signal }) =>
|
|
|
31528
31273
|
child.on("error", (error) => {
|
|
31529
31274
|
clearTimeout(timer);
|
|
31530
31275
|
if (error.code === "ENOENT")
|
|
31531
|
-
|
|
31276
|
+
resolve6(void 0);
|
|
31532
31277
|
else if (error.name === "AbortError")
|
|
31533
31278
|
reject(new CliError("cancelled", `${program} was stopped`));
|
|
31534
31279
|
else
|
|
@@ -31540,7 +31285,7 @@ var run = /* @__PURE__ */ __name((program, args, { env, cwd, stdin, signal }) =>
|
|
|
31540
31285
|
return reject(new CliError("timeout", `${program} gave no answer in time, or too long an answer`, {
|
|
31541
31286
|
reason: "picture-reading.timeout"
|
|
31542
31287
|
}));
|
|
31543
|
-
|
|
31288
|
+
resolve6({ code, stdout: Buffer.concat(out).toString("utf8"), stderr: Buffer.concat(err).toString("utf8") });
|
|
31544
31289
|
});
|
|
31545
31290
|
child.stdin.on("error", () => {
|
|
31546
31291
|
});
|
|
@@ -31635,10 +31380,10 @@ Read the attached picture.`,
|
|
|
31635
31380
|
}
|
|
31636
31381
|
}, "readPictureWithAgent");
|
|
31637
31382
|
|
|
31638
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
31383
|
+
// node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/attachments/transfer.js
|
|
31639
31384
|
import { createHash as createHash9 } from "node:crypto";
|
|
31640
31385
|
import { constants } from "node:fs";
|
|
31641
|
-
import { lstat as lstat3, open as
|
|
31386
|
+
import { lstat as lstat3, open as open4 } from "node:fs/promises";
|
|
31642
31387
|
var MAX_CHUNK_BYTES = 1024 * 1024;
|
|
31643
31388
|
var validateWindow = /* @__PURE__ */ __name(({ offsetBytes = 0, chunkBytes = 524288, ifSha256 }) => {
|
|
31644
31389
|
if (!Number.isSafeInteger(offsetBytes) || offsetBytes < 0 || !Number.isSafeInteger(chunkBytes) || chunkBytes < 1 || chunkBytes > MAX_CHUNK_BYTES || ifSha256 !== void 0 && !/^[a-f0-9]{64}$/i.test(ifSha256))
|
|
@@ -31661,7 +31406,7 @@ var retainedBytes = /* @__PURE__ */ __name(async (path, options2, captureFile =
|
|
|
31661
31406
|
throw new CliError("validation_error", `the retained attachment exceeds ${maxBytes / 1024 / 1024} MiB; configure MESSAGING_ATTACHMENT_MAX_MIB`);
|
|
31662
31407
|
if (offsetBytes > before.size)
|
|
31663
31408
|
throw new CliError("validation_error", "the byte offset is past the end of this attachment");
|
|
31664
|
-
const handle = await
|
|
31409
|
+
const handle = await open4(path, constants.O_RDONLY | (constants.O_NOFOLLOW ?? 0) | (constants.O_NONBLOCK ?? 0));
|
|
31665
31410
|
try {
|
|
31666
31411
|
const opened = await handle.stat();
|
|
31667
31412
|
if (!opened.isFile() || opened.ino !== before.ino || opened.dev !== before.dev || opened.size !== before.size)
|
|
@@ -31743,10 +31488,10 @@ var transferMime = /* @__PURE__ */ __name((head, hint, name = null) => {
|
|
|
31743
31488
|
return hint !== null && /^[a-z0-9.+-]+\/[a-z0-9.+-]+$/i.test(hint) ? hint : "application/octet-stream";
|
|
31744
31489
|
}, "transferMime");
|
|
31745
31490
|
|
|
31746
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
31491
|
+
// node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/services/file-download.js
|
|
31747
31492
|
import { createWriteStream, mkdirSync } from "node:fs";
|
|
31748
31493
|
import { link as link3, rm } from "node:fs/promises";
|
|
31749
|
-
import { join as join12, resolve as
|
|
31494
|
+
import { join as join12, resolve as resolve5 } from "node:path";
|
|
31750
31495
|
import { Readable, Transform } from "node:stream";
|
|
31751
31496
|
import { pipeline } from "node:stream/promises";
|
|
31752
31497
|
var refreshedFiles = /* @__PURE__ */ __name((files) => files.flatMap(({ kind, name, position, providerRef }) => providerRef === void 0 || Object.keys(providerRef).length === 0 ? [] : [
|
|
@@ -31822,9 +31567,10 @@ var EXTENSIONS = {
|
|
|
31822
31567
|
var BY_KIND = { photo: "jpg" };
|
|
31823
31568
|
var save = /* @__PURE__ */ __name(async (file, directory2, fallbackName, { unique = false } = {}) => {
|
|
31824
31569
|
const own = safeName(file.name);
|
|
31570
|
+
const fallback = safeName(fallbackName) ?? "file";
|
|
31825
31571
|
const fileName = /* @__PURE__ */ __name(() => {
|
|
31826
31572
|
const extension = EXTENSIONS[file.mime ?? ""] ?? BY_KIND[file.kind];
|
|
31827
|
-
return own ?? (extension ? `${
|
|
31573
|
+
return own ?? (extension ? `${fallback}.${extension}` : fallback);
|
|
31828
31574
|
}, "fileName");
|
|
31829
31575
|
const partial = join12(directory2, `.${fileName()}.${process.pid}.part`);
|
|
31830
31576
|
let bytes2 = 0;
|
|
@@ -31837,9 +31583,9 @@ var save = /* @__PURE__ */ __name(async (file, directory2, fallbackName, { uniqu
|
|
|
31837
31583
|
try {
|
|
31838
31584
|
await pipeline(Readable.from(file.bytes()), counting, createWriteStream(partial, { flags: "wx", mode: 384 }));
|
|
31839
31585
|
const name = fileName();
|
|
31840
|
-
const names2 = unique && own ? [name, `${
|
|
31586
|
+
const names2 = unique && own ? [name, `${fallback}-${own}`] : [name];
|
|
31841
31587
|
for (const candidate of names2) {
|
|
31842
|
-
const path2 =
|
|
31588
|
+
const path2 = resolve5(join12(directory2, candidate));
|
|
31843
31589
|
const taken = await link3(partial, path2).then(() => false, (error) => {
|
|
31844
31590
|
if (error.code === "EEXIST")
|
|
31845
31591
|
return true;
|
|
@@ -31848,7 +31594,7 @@ var save = /* @__PURE__ */ __name(async (file, directory2, fallbackName, { uniqu
|
|
|
31848
31594
|
if (!taken)
|
|
31849
31595
|
return { kind: file.kind, path: path2, bytes: bytes2 };
|
|
31850
31596
|
}
|
|
31851
|
-
const path =
|
|
31597
|
+
const path = resolve5(join12(directory2, names2.at(-1) ?? name));
|
|
31852
31598
|
if (unique)
|
|
31853
31599
|
return { kind: file.kind, path, bytes: bytes2, existing: true };
|
|
31854
31600
|
throw new CliError("validation_error", `${path} already exists \u2014 nothing was overwritten; choose --output-dir`);
|
|
@@ -31857,7 +31603,7 @@ var save = /* @__PURE__ */ __name(async (file, directory2, fallbackName, { uniqu
|
|
|
31857
31603
|
}
|
|
31858
31604
|
}, "save");
|
|
31859
31605
|
|
|
31860
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
31606
|
+
// node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/services/pictures.js
|
|
31861
31607
|
import { createHash as createHash10 } from "node:crypto";
|
|
31862
31608
|
import { lstat as lstat4, readFile } from "node:fs/promises";
|
|
31863
31609
|
import { setTimeout as sleep4 } from "node:timers/promises";
|
|
@@ -31894,18 +31640,18 @@ var pictureBytes = /* @__PURE__ */ __name(async (picture, files, read) => {
|
|
|
31894
31640
|
}, "pictureBytes");
|
|
31895
31641
|
var picturesService = /* @__PURE__ */ __name((deps) => {
|
|
31896
31642
|
let opened;
|
|
31897
|
-
const
|
|
31643
|
+
const open6 = /* @__PURE__ */ __name(async () => {
|
|
31898
31644
|
if (deps.pictureEmbedder)
|
|
31899
31645
|
return deps.pictureEmbedder();
|
|
31900
31646
|
const model2 = imageModel(DEFAULT_IMAGE_MODEL);
|
|
31901
31647
|
const directory2 = imageModelsDirectory(deps.env);
|
|
31902
31648
|
if (!isImageModelInstalled(model2, directory2))
|
|
31903
31649
|
throw new CliError("not_found", missingModel(model2.id), { reason: "model.not-downloaded", model: model2.id });
|
|
31904
|
-
const { openPictureEmbedder } = await import("./embedder-
|
|
31650
|
+
const { openPictureEmbedder } = await import("./embedder-EJN75BPV.js");
|
|
31905
31651
|
return openPictureEmbedder(model2, directory2);
|
|
31906
31652
|
}, "open");
|
|
31907
31653
|
const embedder = /* @__PURE__ */ __name(() => {
|
|
31908
|
-
opened ??=
|
|
31654
|
+
opened ??= open6().catch((error) => {
|
|
31909
31655
|
opened = void 0;
|
|
31910
31656
|
throw error;
|
|
31911
31657
|
});
|
|
@@ -32075,7 +31821,7 @@ var withPictures = /* @__PURE__ */ __name((messages, pictures) => ({
|
|
|
32075
31821
|
}, "search")
|
|
32076
31822
|
}), "withPictures");
|
|
32077
31823
|
|
|
32078
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
31824
|
+
// node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/services/attachments.js
|
|
32079
31825
|
var ATTACHMENT_QUERY = {
|
|
32080
31826
|
entity: "attachment",
|
|
32081
31827
|
backend: "sql",
|
|
@@ -32104,7 +31850,7 @@ var outcome = /* @__PURE__ */ __name(async (file, path, load, signal, noFollow =
|
|
|
32104
31850
|
setting: "MESSAGING_ATTACHMENT_MAX_MIB"
|
|
32105
31851
|
})
|
|
32106
31852
|
}), "tooLarge");
|
|
32107
|
-
const size2 = await
|
|
31853
|
+
const size2 = await stat(path).then((found) => found.isFile() ? found.size : void 0, () => void 0);
|
|
32108
31854
|
if (size2 === void 0)
|
|
32109
31855
|
return { status: "missing" };
|
|
32110
31856
|
const hint = { kind: file.kind, name: file.name, mime: file.mime, path };
|
|
@@ -32113,7 +31859,7 @@ var outcome = /* @__PURE__ */ __name(async (file, path, load, signal, noFollow =
|
|
|
32113
31859
|
return { status: "unsupported" };
|
|
32114
31860
|
if (size2 > maxBytes)
|
|
32115
31861
|
return tooLarge();
|
|
32116
|
-
const handle = await
|
|
31862
|
+
const handle = await open5(path, constants2.O_RDONLY | (noFollow ? constants2.O_NOFOLLOW : 0));
|
|
32117
31863
|
let bytes2;
|
|
32118
31864
|
try {
|
|
32119
31865
|
const opened = await handle.stat();
|
|
@@ -32476,7 +32222,7 @@ var attachmentsService = /* @__PURE__ */ __name((deps) => ({
|
|
|
32476
32222
|
...file.mime === null ? {} : { mime: file.mime },
|
|
32477
32223
|
position: file.position,
|
|
32478
32224
|
bytes: /* @__PURE__ */ __name(async function* () {
|
|
32479
|
-
const handle = await
|
|
32225
|
+
const handle = await open5(path, constants2.O_RDONLY | (constants2.O_NOFOLLOW ?? 0));
|
|
32480
32226
|
yield* handle.createReadStream();
|
|
32481
32227
|
}, "bytes")
|
|
32482
32228
|
}, output, `${messageId}-${file.position + 1}`));
|
|
@@ -32546,7 +32292,7 @@ var attachmentsService = /* @__PURE__ */ __name((deps) => ({
|
|
|
32546
32292
|
}, "readPicture")
|
|
32547
32293
|
}), "attachmentsService");
|
|
32548
32294
|
|
|
32549
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
32295
|
+
// node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/services/chat-documents.js
|
|
32550
32296
|
var chatDocumentsService = /* @__PURE__ */ __name((deps) => ({
|
|
32551
32297
|
list: /* @__PURE__ */ __name(async (chat, { limit, offset, ref }) => {
|
|
32552
32298
|
const store = await accountStore(deps);
|
|
@@ -32576,7 +32322,7 @@ var chatDocumentsService = /* @__PURE__ */ __name((deps) => ({
|
|
|
32576
32322
|
}, "list")
|
|
32577
32323
|
}), "chatDocumentsService");
|
|
32578
32324
|
|
|
32579
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
32325
|
+
// node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/services/retention.js
|
|
32580
32326
|
var observationDuration = /* @__PURE__ */ __name((text2, flag) => {
|
|
32581
32327
|
const match = /^(\d+(?:\.\d+)?)([smhdw])$/.exec(text2);
|
|
32582
32328
|
const units2 = { s: 1e3, m: 6e4, h: 36e5, d: 864e5, w: 6048e5 };
|
|
@@ -32663,7 +32409,7 @@ var isRetentionSelection = /* @__PURE__ */ __name((selection) => {
|
|
|
32663
32409
|
}
|
|
32664
32410
|
}, "isRetentionSelection");
|
|
32665
32411
|
|
|
32666
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
32412
|
+
// node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/services/counters.js
|
|
32667
32413
|
var counterFields = /* @__PURE__ */ __name((text2 = "views,reactions,comments") => {
|
|
32668
32414
|
const fields = text2.split(",").map((one) => one.trim());
|
|
32669
32415
|
if (!fields.length || fields.some((one) => !COUNTER_FIELDS.includes(one)) || new Set(fields).size !== fields.length)
|
|
@@ -32870,7 +32616,7 @@ var countersService = /* @__PURE__ */ __name((deps) => {
|
|
|
32870
32616
|
};
|
|
32871
32617
|
}, "countersService");
|
|
32872
32618
|
|
|
32873
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
32619
|
+
// node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/services/search-refresh.js
|
|
32874
32620
|
var SYNC_KEY = "messages.sync-first";
|
|
32875
32621
|
var SYNC_BOUNDS = { maxChats: 5, timeMs: 3e4, maxMessages: 500 };
|
|
32876
32622
|
var keyOf3 = /* @__PURE__ */ __name((chat) => JSON.stringify([chat.account.provider, chat.account.account, chat.chatId]), "keyOf");
|
|
@@ -33002,7 +32748,7 @@ var withRefresh = /* @__PURE__ */ __name((found, refreshed) => ({
|
|
|
33002
32748
|
...!refreshed || refreshed.complete ? {} : { coverage: { ...found.coverage, state: "stale" } }
|
|
33003
32749
|
}), "withRefresh");
|
|
33004
32750
|
|
|
33005
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
32751
|
+
// node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/services/embeddings-search.js
|
|
33006
32752
|
var CANDIDATES = 50;
|
|
33007
32753
|
var ACROSS_CHATS = 500;
|
|
33008
32754
|
var OWN_BLOCK = 5;
|
|
@@ -33014,6 +32760,7 @@ var SHOWN_CHARS = 200;
|
|
|
33014
32760
|
var SHOWN_HEAD = 80;
|
|
33015
32761
|
var CHUNK_READ = 60;
|
|
33016
32762
|
var REPLIES_READ = 60;
|
|
32763
|
+
var BIG_CONVERSATION = 50;
|
|
33017
32764
|
var RRF_K3 = 60;
|
|
33018
32765
|
var embeddingsSearch = /* @__PURE__ */ __name((deps) => {
|
|
33019
32766
|
const command = deps.messenger.app.command;
|
|
@@ -33164,9 +32911,10 @@ var embeddingsSearch = /* @__PURE__ */ __name((deps) => {
|
|
|
33164
32911
|
const meaning = texts.map(() => []);
|
|
33165
32912
|
const own = [];
|
|
33166
32913
|
const sources = words3.sources;
|
|
32914
|
+
let vectors = [];
|
|
33167
32915
|
if (target2.installed && prepared.scopeAccounts.length && eligibility?.conversations.length !== 0) {
|
|
33168
32916
|
await withEmbedder(deps, target2, choice, {}, async (embedder) => {
|
|
33169
|
-
|
|
32917
|
+
vectors = await embedder.embed(texts, "query");
|
|
33170
32918
|
for (const [at, vector] of vectors.entries())
|
|
33171
32919
|
for (const one of prepared.scopeAccounts) {
|
|
33172
32920
|
const scope = scopeOf5(one);
|
|
@@ -33241,7 +32989,23 @@ var embeddingsSearch = /* @__PURE__ */ __name((deps) => {
|
|
|
33241
32989
|
locator: formatLocator({ ...source2, chat: hit.summary.chatId, message: hit.chunk.firstMessageId })
|
|
33242
32990
|
};
|
|
33243
32991
|
}, "located");
|
|
33244
|
-
const
|
|
32992
|
+
const stemmed = [
|
|
32993
|
+
...chunkStems(query).map((stem) => ({ stem, weight: 2 })),
|
|
32994
|
+
...texts.slice(1).flatMap((text2) => chunkStems(text2).map((stem) => ({ stem, weight: 1 })))
|
|
32995
|
+
];
|
|
32996
|
+
const rechunked = /* @__PURE__ */ __name(async (hit) => {
|
|
32997
|
+
const source2 = sources.get(hit.summary.id);
|
|
32998
|
+
if (texts.length < 2 || hit.matchedIn || !vectors.length || !source2)
|
|
32999
|
+
return hit;
|
|
33000
|
+
const chunk = await store.conversations.bestChunk(source2, hit.summary.id, {
|
|
33001
|
+
model: target2.key,
|
|
33002
|
+
vectors,
|
|
33003
|
+
stems: stemmed,
|
|
33004
|
+
over: BIG_CONVERSATION
|
|
33005
|
+
});
|
|
33006
|
+
return chunk ? { ...hit, chunk } : hit;
|
|
33007
|
+
}, "rechunked");
|
|
33008
|
+
const hits = (await Promise.all(fused(meaning.map((list2) => list2.map(({ hit }) => hit)), words3.hits, meaningFloor(target2.key)).slice(0, limit).map(rechunked))).map(located);
|
|
33245
33009
|
const shown = new Set(hits.map((hit) => hit.summary.id));
|
|
33246
33010
|
const ownOf = /* @__PURE__ */ __name((keep2) => own.filter(keep2).sort((a, b) => b.score - a.score).slice(0, OWN_BLOCK).map((hit) => located({ ...hit, by: ["meaning"] })), "ownOf");
|
|
33247
33011
|
const ownHits = ownOf((hit) => !shown.has(hit.summary.id));
|
|
@@ -33302,9 +33066,9 @@ var embeddingsSearch = /* @__PURE__ */ __name((deps) => {
|
|
|
33302
33066
|
return found;
|
|
33303
33067
|
const rest = without(query, named2.word);
|
|
33304
33068
|
const { syncFirst: _, refresh: __, ...plain2 } = options2;
|
|
33305
|
-
const
|
|
33306
|
-
const shown = new Set(
|
|
33307
|
-
const hits = [...
|
|
33069
|
+
const inside = await search(rest || query, { ...plain2, chat: named2.chatId });
|
|
33070
|
+
const shown = new Set(inside.hits.map(({ summary }) => summary.id));
|
|
33071
|
+
const hits = [...inside.hits, ...found.hits.filter(({ summary }) => !shown.has(summary.id))].slice(0, options2.limit);
|
|
33308
33072
|
const kept2 = new Set(hits.map(({ summary }) => summary.id));
|
|
33309
33073
|
const own = [...found.own ?? [], ...(ownSpare ?? []).filter(({ summary }) => !kept2.has(summary.id))].sort((a, b) => (b.score ?? 0) - (a.score ?? 0)).slice(0, OWN_BLOCK);
|
|
33310
33074
|
const { own: _shown, ...plainFound } = found;
|
|
@@ -33389,6 +33153,9 @@ var fused = /* @__PURE__ */ __name((meaning, words3, minimumCosine) => {
|
|
|
33389
33153
|
});
|
|
33390
33154
|
return [...merged2.values()].sort((a, b) => b.fused - a.fused || (b.score ?? -2) - (a.score ?? -2)).map(({ fused: _, ...hit }) => hit);
|
|
33391
33155
|
}, "fused");
|
|
33156
|
+
var chunkStems = /* @__PURE__ */ __name((text2) => [
|
|
33157
|
+
...new Set((text2.toLowerCase().match(/[\p{L}\p{N}_]+/gu) ?? []).filter((word) => word.length >= 3).map((word) => word.slice(0, 5)))
|
|
33158
|
+
], "chunkStems");
|
|
33392
33159
|
var wordStems = /* @__PURE__ */ __name((text2) => [...new Set(queryWords2(text2).map((word) => word.slice(0, 5)))], "wordStems");
|
|
33393
33160
|
var shownLines = /* @__PURE__ */ __name((read, stems, ownFirst, asked, count3 = SHOWN_LINES) => {
|
|
33394
33161
|
const scored = read.map(({ text: text2, ...line3 }, at) => {
|
|
@@ -33442,13 +33209,13 @@ var meanOf = /* @__PURE__ */ __name((vectors) => {
|
|
|
33442
33209
|
return mean2.map((value) => value / length);
|
|
33443
33210
|
}, "meanOf");
|
|
33444
33211
|
|
|
33445
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
33212
|
+
// node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/services/embeddings.js
|
|
33446
33213
|
var embeddingsService = /* @__PURE__ */ __name((deps) => ({
|
|
33447
33214
|
...embeddingsMaintenance(deps),
|
|
33448
33215
|
...embeddingsSearch(deps)
|
|
33449
33216
|
}), "embeddingsService");
|
|
33450
33217
|
|
|
33451
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
33218
|
+
// node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/services/folders.js
|
|
33452
33219
|
var foldersService = /* @__PURE__ */ __name((deps) => {
|
|
33453
33220
|
const online = /* @__PURE__ */ __name(async (command) => {
|
|
33454
33221
|
if (deps.offline)
|
|
@@ -33589,7 +33356,7 @@ var foldersService = /* @__PURE__ */ __name((deps) => {
|
|
|
33589
33356
|
};
|
|
33590
33357
|
}, "foldersService");
|
|
33591
33358
|
|
|
33592
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
33359
|
+
// node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/services/mentions.js
|
|
33593
33360
|
var REVIEW_COUNT = 500;
|
|
33594
33361
|
var mentionsService = /* @__PURE__ */ __name((deps) => {
|
|
33595
33362
|
const located = /* @__PURE__ */ __name(async () => {
|
|
@@ -33668,7 +33435,7 @@ var mentionsService = /* @__PURE__ */ __name((deps) => {
|
|
|
33668
33435
|
};
|
|
33669
33436
|
}, "mentionsService");
|
|
33670
33437
|
|
|
33671
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
33438
|
+
// node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/domain/message-link.js
|
|
33672
33439
|
var fileLinks = /* @__PURE__ */ __name((attachments) => hitFiles(attachments).map(({ position, kind, name }) => ({
|
|
33673
33440
|
position,
|
|
33674
33441
|
kind,
|
|
@@ -33717,7 +33484,7 @@ var validatePermalink = /* @__PURE__ */ __name((link4) => {
|
|
|
33717
33484
|
return { url: link4.url, access: link4.access, reason: link4.reason };
|
|
33718
33485
|
}, "validatePermalink");
|
|
33719
33486
|
|
|
33720
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
33487
|
+
// node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/domain/pin-duration.js
|
|
33721
33488
|
var spokenSeconds = /* @__PURE__ */ __name((seconds) => {
|
|
33722
33489
|
if (seconds % 86400 === 0 && seconds > 86400)
|
|
33723
33490
|
return `${seconds / 86400}d`;
|
|
@@ -33749,7 +33516,7 @@ var pinDurationOf = /* @__PURE__ */ __name((value, allowed, flag = "--expire-tim
|
|
|
33749
33516
|
return seconds;
|
|
33750
33517
|
}, "pinDurationOf");
|
|
33751
33518
|
|
|
33752
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
33519
|
+
// node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/services/meaning-model.js
|
|
33753
33520
|
var meaningModel = /* @__PURE__ */ __name(async (store, env = process.env) => {
|
|
33754
33521
|
const chosen = chosenTextModel(env);
|
|
33755
33522
|
if (chosen.from === "chosen" || chosen.id !== DEFAULT_TEXT_MODEL)
|
|
@@ -33764,7 +33531,7 @@ var meaningModel = /* @__PURE__ */ __name(async (store, env = process.env) => {
|
|
|
33764
33531
|
return (counts.get(before) ?? 0) > (counts.get(now) ?? 0) ? previous.id : current.id;
|
|
33765
33532
|
}, "meaningModel");
|
|
33766
33533
|
|
|
33767
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
33534
|
+
// node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/services/messages-meaning.js
|
|
33768
33535
|
var meaningText = /* @__PURE__ */ __name((question) => {
|
|
33769
33536
|
try {
|
|
33770
33537
|
const text2 = questionLookup(question) === void 0 ? question : questionText(question);
|
|
@@ -33843,7 +33610,7 @@ var meaningLane = /* @__PURE__ */ __name((deps) => async (question, accounts, sh
|
|
|
33843
33610
|
}
|
|
33844
33611
|
}, "meaningLane");
|
|
33845
33612
|
|
|
33846
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
33613
|
+
// node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/services/messages-rerank.js
|
|
33847
33614
|
var rerankLane = /* @__PURE__ */ __name((deps) => {
|
|
33848
33615
|
const choice = deps.reranker ?? DEFAULT_RERANK_MODEL;
|
|
33849
33616
|
if (choice === "off")
|
|
@@ -33855,9 +33622,9 @@ var rerankLane = /* @__PURE__ */ __name((deps) => {
|
|
|
33855
33622
|
return { skipped: { reason: `${model.id} is not downloaded`, step: "models.download", model: model.id } };
|
|
33856
33623
|
try {
|
|
33857
33624
|
const warm = deps.embedders;
|
|
33858
|
-
const reranker = warm ? await warm.reranker(`rerank:${model.id}`, async () => (await import("./process-
|
|
33625
|
+
const reranker = warm ? await warm.reranker(`rerank:${model.id}`, async () => (await import("./process-SGHEN6MQ.js")).openRerankerProcess(model, directory2, {
|
|
33859
33626
|
threads: defaultThreads()
|
|
33860
|
-
})) : await (await import("./rerank-
|
|
33627
|
+
})) : await (await import("./rerank-5UPVXGVV.js")).openReranker(model, directory2);
|
|
33861
33628
|
return {
|
|
33862
33629
|
model: model.id,
|
|
33863
33630
|
score: /* @__PURE__ */ __name((question, passages) => reranker.score(plainWords(question), passages), "score"),
|
|
@@ -33877,7 +33644,7 @@ var rerankLane = /* @__PURE__ */ __name((deps) => {
|
|
|
33877
33644
|
};
|
|
33878
33645
|
}, "rerankLane");
|
|
33879
33646
|
|
|
33880
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
33647
|
+
// node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/search/question-period.js
|
|
33881
33648
|
var DAY6 = 864e5;
|
|
33882
33649
|
var SPAN = { start: 0, end: 0 };
|
|
33883
33650
|
var phrase = /* @__PURE__ */ __name((source) => new RegExp(`(?<![\\p{L}\\p{N}])(?:${source})(?![\\p{L}\\p{N}])`, "giu"), "phrase");
|
|
@@ -34002,17 +33769,17 @@ var questionPeriod = /* @__PURE__ */ __name((text2, now, zone) => {
|
|
|
34002
33769
|
};
|
|
34003
33770
|
}, "questionPeriod");
|
|
34004
33771
|
|
|
34005
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
33772
|
+
// node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/services/document-pictures.js
|
|
34006
33773
|
var openPictureEmbedderFor = /* @__PURE__ */ __name(async ({ env, command } = {}) => {
|
|
34007
33774
|
const model = imageModel(DEFAULT_IMAGE_MODEL);
|
|
34008
33775
|
const directory2 = imageModelsDirectory(env);
|
|
34009
33776
|
if (!isImageModelInstalled(model, directory2))
|
|
34010
33777
|
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 });
|
|
34011
|
-
const { openPictureEmbedder } = await import("./embedder-
|
|
33778
|
+
const { openPictureEmbedder } = await import("./embedder-EJN75BPV.js");
|
|
34012
33779
|
return openPictureEmbedder(model, directory2);
|
|
34013
33780
|
}, "openPictureEmbedderFor");
|
|
34014
33781
|
|
|
34015
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
33782
|
+
// node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/services/document-source.js
|
|
34016
33783
|
var documentSource = /* @__PURE__ */ __name((note, accounts, profiles, file) => {
|
|
34017
33784
|
const metadata = note.frontMatter;
|
|
34018
33785
|
const account = accounts.find(({ id: id2 }) => String(id2) === note.folderId);
|
|
@@ -34034,7 +33801,7 @@ var documentSource = /* @__PURE__ */ __name((note, accounts, profiles, file) =>
|
|
|
34034
33801
|
};
|
|
34035
33802
|
}, "documentSource");
|
|
34036
33803
|
|
|
34037
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
33804
|
+
// node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/services/enrichment-setting.js
|
|
34038
33805
|
var SECTION2 = "enrichment";
|
|
34039
33806
|
var ENRICHMENT_PROVIDERS = ["openai", "anthropic"];
|
|
34040
33807
|
var DEFAULT_BASE_URLS = {
|
|
@@ -34109,7 +33876,7 @@ var costOf = /* @__PURE__ */ __name((usage, setting) => {
|
|
|
34109
33876
|
return price ? Math.round((usage.input * price.input + usage.output * price.output) * 1e6) / 1e6 : null;
|
|
34110
33877
|
}, "costOf");
|
|
34111
33878
|
|
|
34112
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
33879
|
+
// node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/services/enrichment.js
|
|
34113
33880
|
var ENRICH_PER_RUN = 600;
|
|
34114
33881
|
var MAX_LINE = 400;
|
|
34115
33882
|
var line2 = pipe(unknown(), transform((value) => typeof value === "string" ? value.replace(/\s+/g, " ").trim().slice(0, MAX_LINE) : ""));
|
|
@@ -34185,7 +33952,7 @@ var enrichmentState = /* @__PURE__ */ __name(async (store, env, estimateFor, key
|
|
|
34185
33952
|
};
|
|
34186
33953
|
}, "enrichmentState");
|
|
34187
33954
|
|
|
34188
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
33955
|
+
// node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/services/notes-title-tier.js
|
|
34189
33956
|
var plainQueryWords = /* @__PURE__ */ __name((query) => {
|
|
34190
33957
|
let root;
|
|
34191
33958
|
try {
|
|
@@ -34212,15 +33979,15 @@ var titleTiers = /* @__PURE__ */ __name((hits, words3) => {
|
|
|
34212
33979
|
return [...hits].sort((a, b) => rank(a) - rank(b));
|
|
34213
33980
|
}, "titleTiers");
|
|
34214
33981
|
|
|
34215
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
33982
|
+
// node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/services/notes-search.js
|
|
34216
33983
|
var storeQuery = /* @__PURE__ */ __name(async (store, text2, { exact, timezone } = {}) => resolvedQuery(store, parsedQuery(text2, exact), timezone), "storeQuery");
|
|
34217
33984
|
var parsedQuery = /* @__PURE__ */ __name((text2, exact) => validateFields(parseLucene(text2, { ...SEARCH_QUERY, defaultField: exact ? "exact" : "text" })).root, "parsedQuery");
|
|
34218
33985
|
var resolvedQuery = /* @__PURE__ */ __name(async (store, root, timezone) => {
|
|
34219
33986
|
const ast = { root };
|
|
34220
33987
|
const zone = timezoneOf(timezone);
|
|
34221
|
-
const
|
|
33988
|
+
const resolve6 = /* @__PURE__ */ __name((node) => {
|
|
34222
33989
|
if (node.kind === "boolean")
|
|
34223
|
-
return { ...node, clauses: node.clauses.map(({ occur, node: node2 }) => ({ occur, node:
|
|
33990
|
+
return { ...node, clauses: node.clauses.map(({ occur, node: node2 }) => ({ occur, node: resolve6(node2) })) };
|
|
34224
33991
|
if (node.field !== "date")
|
|
34225
33992
|
return node;
|
|
34226
33993
|
return {
|
|
@@ -34234,7 +34001,7 @@ var resolvedQuery = /* @__PURE__ */ __name(async (store, root, timezone) => {
|
|
|
34234
34001
|
if (stemmers2 === null)
|
|
34235
34002
|
throw new CliError("validation_error", "the store asks for stemmers this tool does not know \u2014 upgrade this tool, or search exact forms with --exact", { reason: "stemmer.unknown" });
|
|
34236
34003
|
return {
|
|
34237
|
-
root:
|
|
34004
|
+
root: resolve6(ast.root),
|
|
34238
34005
|
...hasStems(ast.root) ? { stemmer: createStemmer(stemmers2 ?? DEFAULT_STEMMERS) } : {}
|
|
34239
34006
|
};
|
|
34240
34007
|
}, "resolvedQuery");
|
|
@@ -34254,6 +34021,7 @@ var searchNotesQuery = /* @__PURE__ */ __name(async (store, request) => {
|
|
|
34254
34021
|
...stemmer ? { stemmer } : {}
|
|
34255
34022
|
});
|
|
34256
34023
|
}, "searchNotesQuery");
|
|
34024
|
+
var NOTE_BATCH = 8;
|
|
34257
34025
|
var downloadHint = /* @__PURE__ */ __name((model, command) => command === void 0 ? `install it with a WireCat CLI that has \`models download\` (tg, max or wa); they share the model folder` : `\`${command} models download ${model}\``, "downloadHint");
|
|
34258
34026
|
var localModel = /* @__PURE__ */ __name((choice, env, command) => {
|
|
34259
34027
|
const model = textModel(choice ?? chosenTextModel(env).id, env);
|
|
@@ -34275,6 +34043,45 @@ var withLocal = /* @__PURE__ */ __name(async (model, directory2, threads, work,
|
|
|
34275
34043
|
await embedder.close();
|
|
34276
34044
|
}
|
|
34277
34045
|
}, "withLocal");
|
|
34046
|
+
var stopsAt = /* @__PURE__ */ __name((deadline) => deadline ? deadline.endsAt - deadlineMargin(deadline) : Number.POSITIVE_INFINITY, "stopsAt");
|
|
34047
|
+
var embedChunks = /* @__PURE__ */ __name(async (store, source, { model: choice, maxChunks = Number.POSITIVE_INFINITY, env, threads, command, deadline, signal } = {}) => {
|
|
34048
|
+
const { model, directory: directory2, key } = localModel(choice, env, command);
|
|
34049
|
+
if ((await source.chunksToEmbed(key, { limit: 1 })).length === 0)
|
|
34050
|
+
return { model: model.id, embedded: 0, left: false };
|
|
34051
|
+
const until = stopsAt(deadline);
|
|
34052
|
+
const stopped = /* @__PURE__ */ __name((slowest) => signal?.aborted ? "cancelled" : Date.now() + slowest >= until ? "deadline" : void 0, "stopped");
|
|
34053
|
+
const stop = /* @__PURE__ */ __name(async (embedded, why) => {
|
|
34054
|
+
const remaining = await source.chunksLeft?.(key);
|
|
34055
|
+
return { model: model.id, embedded, left: true, stopped: why, ...remaining === void 0 ? {} : { remaining } };
|
|
34056
|
+
}, "stop");
|
|
34057
|
+
const early = stopped(0);
|
|
34058
|
+
if (early)
|
|
34059
|
+
return stop(0, early);
|
|
34060
|
+
return withLocal(model, directory2, threads, async (embedder) => {
|
|
34061
|
+
let embedded = 0;
|
|
34062
|
+
let after;
|
|
34063
|
+
let slowest = 0;
|
|
34064
|
+
while (embedded < maxChunks) {
|
|
34065
|
+
const started = Date.now();
|
|
34066
|
+
const batch = await source.chunksToEmbed(key, {
|
|
34067
|
+
limit: Math.min(NOTE_BATCH, maxChunks - embedded),
|
|
34068
|
+
...after === void 0 ? {} : { after }
|
|
34069
|
+
});
|
|
34070
|
+
if (batch.length === 0)
|
|
34071
|
+
break;
|
|
34072
|
+
const why = stopped(slowest);
|
|
34073
|
+
if (why)
|
|
34074
|
+
return stop(embedded, why);
|
|
34075
|
+
after = batch.at(-1)?.hash;
|
|
34076
|
+
const vectors = await embedder.embed(batch.map(({ text: text2 }) => text2), "passage");
|
|
34077
|
+
await store.vectors.saveVectors(key, model.dims, batch.map(({ hash: hash3 }, index) => ({ hash: hash3, vector: vectors[index] })));
|
|
34078
|
+
embedded += batch.length;
|
|
34079
|
+
slowest = Math.max(slowest, Date.now() - started);
|
|
34080
|
+
}
|
|
34081
|
+
const left = (await source.chunksToEmbed(key, { limit: 1, ...after === void 0 ? {} : { after } })).length > 0;
|
|
34082
|
+
return { model: model.id, embedded, left };
|
|
34083
|
+
});
|
|
34084
|
+
}, "embedChunks");
|
|
34278
34085
|
var nearestNotes = /* @__PURE__ */ __name(async (store, query, options2) => {
|
|
34279
34086
|
const { key, vector, floor } = await queryVector(store, query, options2);
|
|
34280
34087
|
const nearest2 = await store.notes.nearest(key, vector, {
|
|
@@ -34640,7 +34447,31 @@ var searchNotesOf = /* @__PURE__ */ __name(async (store, account, text2, { accou
|
|
|
34640
34447
|
};
|
|
34641
34448
|
}, "searchNotesOf");
|
|
34642
34449
|
|
|
34643
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34450
|
+
// node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/services/crm-meaning.js
|
|
34451
|
+
var embedCrmActivities = /* @__PURE__ */ __name(async (store, options2 = {}) => {
|
|
34452
|
+
localModel(options2.model, options2.env, options2.command);
|
|
34453
|
+
const until = stopsAt(options2.deadline);
|
|
34454
|
+
const refreshed = await store.crm.activityChunks.refresh({
|
|
34455
|
+
until: /* @__PURE__ */ __name(() => options2.signal?.aborted === true || Date.now() >= until, "until")
|
|
34456
|
+
});
|
|
34457
|
+
const embedded = await embedChunks(store, store.crm.activityChunks, options2);
|
|
34458
|
+
return refreshed.left ? { ...embedded, left: true } : embedded;
|
|
34459
|
+
}, "embedCrmActivities");
|
|
34460
|
+
var nearestCrmActivities = /* @__PURE__ */ __name(async (store, words3, { limit, accounts, kinds, viewers, env, command, embedders }) => {
|
|
34461
|
+
const { model, directory: directory2, key } = localModel(await meaningModel(store, env), env, command);
|
|
34462
|
+
if (!await store.crm.activityChunks.embedded(key, accounts))
|
|
34463
|
+
throw new CliError("not_found", `no CRM activity has vectors of ${model.id} yet, so only words were matched`);
|
|
34464
|
+
const [vector] = await withLocal(model, directory2, void 0, (embedder) => embedder.embed([words3], "query"), embedders);
|
|
34465
|
+
const floor = meaningFloor(key);
|
|
34466
|
+
return (await store.crm.activityChunks.nearest(key, vector, {
|
|
34467
|
+
limit,
|
|
34468
|
+
...accounts === void 0 ? {} : { accounts },
|
|
34469
|
+
...kinds === void 0 ? {} : { kinds },
|
|
34470
|
+
...viewers === void 0 ? {} : { viewers }
|
|
34471
|
+
})).filter(({ score }) => score > floor);
|
|
34472
|
+
}, "nearestCrmActivities");
|
|
34473
|
+
|
|
34474
|
+
// node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/services/events-search.js
|
|
34644
34475
|
var MAX_EVENTS_OFFSET = 1e3;
|
|
34645
34476
|
var iso3 = /* @__PURE__ */ __name((at) => at === null ? null : new Date(at).toISOString(), "iso");
|
|
34646
34477
|
var accountIdsOf = /* @__PURE__ */ __name(async (store, accounts) => {
|
|
@@ -34758,7 +34589,7 @@ var searchEvents = /* @__PURE__ */ __name(async (store, query, { limit = 20, off
|
|
|
34758
34589
|
};
|
|
34759
34590
|
}, "searchEvents");
|
|
34760
34591
|
|
|
34761
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34592
|
+
// node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/services/search-all-business.js
|
|
34762
34593
|
var OWN_BUSINESS = { provider: "business", account: INTERNAL_NOTES };
|
|
34763
34594
|
var BUSINESS_WORDS_ONLY = "invoices, payments, orders, contracts, subscriptions, products and wallets are found by the words of their numbers and names only";
|
|
34764
34595
|
var placeOf = /* @__PURE__ */ __name(({ source, imported }) => source ?? (imported === void 0 ? OWN_BUSINESS : { provider: imported, account: "" }), "placeOf");
|
|
@@ -34788,7 +34619,7 @@ var searchBusiness = /* @__PURE__ */ __name(async (store, { words: words3, anyWo
|
|
|
34788
34619
|
};
|
|
34789
34620
|
}, "searchBusiness");
|
|
34790
34621
|
|
|
34791
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34622
|
+
// node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/services/search-all-meetings.js
|
|
34792
34623
|
var MOST_HITS_PER_MEETING = 3;
|
|
34793
34624
|
var PAGE_ROWS = 200;
|
|
34794
34625
|
var MOST_PAGES = 25;
|
|
@@ -35016,7 +34847,186 @@ var titleItem = /* @__PURE__ */ __name((account, meeting, query) => ({
|
|
|
35016
34847
|
foundBy: ["title"]
|
|
35017
34848
|
}), "titleItem");
|
|
35018
34849
|
|
|
35019
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34850
|
+
// node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/services/search-all-rank.js
|
|
34851
|
+
var titleWords2 = /* @__PURE__ */ __name((text2, refused = "deals and leads are found by the words of their title, company, contacts and activities only") => {
|
|
34852
|
+
const { root } = parseLucene(text2, SEARCH_QUERY);
|
|
34853
|
+
const clauses = root.kind === "boolean" ? root.clauses : [{ node: root, occur: "must" }];
|
|
34854
|
+
const words3 = clauses.map(({ node, occur }) => occur !== "must_not" && node.kind === "predicate" && (node.field === "text" || node.field === "title") && (node.operator === "term" || node.operator === "phrase") ? (
|
|
34855
|
+
// A title holds "invoice", not the question mark of "invoice?".
|
|
34856
|
+
node.value.replace(/\?+$/u, "") || node.value
|
|
34857
|
+
) : (() => {
|
|
34858
|
+
throw new CliError("validation_error", refused);
|
|
34859
|
+
})());
|
|
34860
|
+
return { words: words3, anyWord: clauses.length > 1 && clauses.every(({ occur }) => occur === "should") };
|
|
34861
|
+
}, "titleWords");
|
|
34862
|
+
var contentWords = /* @__PURE__ */ __name((found, discover) => {
|
|
34863
|
+
if (!discover)
|
|
34864
|
+
return found;
|
|
34865
|
+
const content = found.words.filter((word) => !words(word).every(isFunctionWord));
|
|
34866
|
+
return content.length ? { ...found, words: content } : found;
|
|
34867
|
+
}, "contentWords");
|
|
34868
|
+
var meaningWordsOf = /* @__PURE__ */ __name((text2) => {
|
|
34869
|
+
try {
|
|
34870
|
+
const { root } = parseLucene(text2, SEARCH_QUERY);
|
|
34871
|
+
const nodes = root.kind === "boolean" ? root.clauses.map(({ node }) => node) : [root];
|
|
34872
|
+
if (!nodes.every((node) => node.kind === "predicate" && node.field === "text"))
|
|
34873
|
+
return void 0;
|
|
34874
|
+
return meaningWords(root) || void 0;
|
|
34875
|
+
} catch {
|
|
34876
|
+
return void 0;
|
|
34877
|
+
}
|
|
34878
|
+
}, "meaningWordsOf");
|
|
34879
|
+
var fusedLane = /* @__PURE__ */ __name((byWords, byMeaning, discover, cosines) => {
|
|
34880
|
+
const fused2 = /* @__PURE__ */ new Map();
|
|
34881
|
+
byWords.forEach((item2, rank) => {
|
|
34882
|
+
fused2.set(item2.ref, { item: item2, score: 1 / (RRF_K + rank + 1) });
|
|
34883
|
+
});
|
|
34884
|
+
byMeaning.forEach(({ hit, score }, rank) => {
|
|
34885
|
+
cosines.set(hit.ref, score);
|
|
34886
|
+
const held = fused2.get(hit.ref);
|
|
34887
|
+
if (held && !held.item.foundBy.includes("meaning"))
|
|
34888
|
+
held.item.foundBy = [...held.item.foundBy, "meaning"];
|
|
34889
|
+
const vote = 1 / (RRF_K + rank + 1);
|
|
34890
|
+
if (held && discover)
|
|
34891
|
+
held.score = Math.max(held.score, vote);
|
|
34892
|
+
else
|
|
34893
|
+
fused2.set(hit.ref, { item: held?.item ?? hit, score: (held?.score ?? 0) + vote });
|
|
34894
|
+
});
|
|
34895
|
+
return [...fused2.values()].sort((a, b) => b.score - a.score).map(({ item: item2 }) => item2);
|
|
34896
|
+
}, "fusedLane");
|
|
34897
|
+
var hitKey = /* @__PURE__ */ __name((item2) => item2.kind === "meeting" ? `${item2.ref}\0${item2.scope}\0${item2.id}` : item2.ref, "hitKey");
|
|
34898
|
+
var oneList = /* @__PURE__ */ __name((lists, cosines) => {
|
|
34899
|
+
const place = /* @__PURE__ */ new Map();
|
|
34900
|
+
for (const list2 of lists) {
|
|
34901
|
+
let above = Number.NEGATIVE_INFINITY;
|
|
34902
|
+
list2.forEach((item2, rank) => {
|
|
34903
|
+
const key = hitKey(item2);
|
|
34904
|
+
above = cosines.get(item2.ref) ?? above;
|
|
34905
|
+
const held = place.get(key);
|
|
34906
|
+
if (!held || rank < held.rank)
|
|
34907
|
+
place.set(key, { item: item2, rank, cosine: above });
|
|
34908
|
+
});
|
|
34909
|
+
}
|
|
34910
|
+
const head = /* @__PURE__ */ __name((rank) => Math.min(rank, 1), "head");
|
|
34911
|
+
return [...place.values()].sort((a, b) => head(a.rank) - head(b.rank) || b.cosine - a.cosine || a.rank - b.rank).map(({ item: item2 }) => item2);
|
|
34912
|
+
}, "oneList");
|
|
34913
|
+
var PERIOD_DEPTH = 100;
|
|
34914
|
+
var PERIOD_BOOST = 0.5;
|
|
34915
|
+
var insidePeriodFirst = /* @__PURE__ */ __name((ordered, period) => {
|
|
34916
|
+
if (!period)
|
|
34917
|
+
return ordered;
|
|
34918
|
+
const inside = /* @__PURE__ */ __name(({ timestamp: timestamp2 }) => {
|
|
34919
|
+
const at = timestamp2 === null ? Number.NaN : Date.parse(timestamp2);
|
|
34920
|
+
return at >= period.from && at < period.to;
|
|
34921
|
+
}, "inside");
|
|
34922
|
+
return ordered.map((item2, rank) => ({ item: item2, score: 1 - rank / PERIOD_DEPTH + (inside(item2) ? PERIOD_BOOST : 0) })).sort((a, b) => b.score - a.score).map(({ item: item2 }) => item2);
|
|
34923
|
+
}, "insidePeriodFirst");
|
|
34924
|
+
|
|
34925
|
+
// node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/services/tracker-meaning.js
|
|
34926
|
+
var nearestTracker = /* @__PURE__ */ __name(async (store, words3, { limit, accounts, env, command, embedders }) => {
|
|
34927
|
+
const { model, directory: directory2, key } = localModel(await meaningModel(store, env), env, command);
|
|
34928
|
+
if (!await store.tracker.embedded(key, accounts))
|
|
34929
|
+
throw new CliError("not_found", `no issue, project or comment has vectors of ${model.id} yet, so only words were matched`, { reason: "tracker.no-vectors", model: model.id });
|
|
34930
|
+
const [vector] = await withLocal(model, directory2, void 0, (embedder) => embedder.embed([words3], "query"), embedders);
|
|
34931
|
+
const floor = meaningFloor(key);
|
|
34932
|
+
return (await store.tracker.nearest(key, vector, { limit, accounts })).filter(({ score }) => score > floor);
|
|
34933
|
+
}, "nearestTracker");
|
|
34934
|
+
|
|
34935
|
+
// node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/services/search-all-tracker.js
|
|
34936
|
+
var TRACKER_HIT_KINDS = { issue: "issue", project: "project", comment: "issue_comment" };
|
|
34937
|
+
var trackerTitle = /* @__PURE__ */ __name(({ kind, record }) => {
|
|
34938
|
+
const title = trackerTitleOf(kind, record);
|
|
34939
|
+
const key = kind === "issue" ? record.key : void 0;
|
|
34940
|
+
return key ? `${key} ${title}` : title;
|
|
34941
|
+
}, "trackerTitle");
|
|
34942
|
+
var trackerExcerpt = /* @__PURE__ */ __name(({ kind, record }, query) => excerpt([trackerTitleOf(kind, record), trackerBodyOf(kind, record)].filter(Boolean).join("\n"), query), "trackerExcerpt");
|
|
34943
|
+
var oneHitPerItem = /* @__PURE__ */ __name((ordered, cosines, items) => {
|
|
34944
|
+
const kept2 = /* @__PURE__ */ new Map();
|
|
34945
|
+
for (const hit of ordered) {
|
|
34946
|
+
const key = items.get(hit.ref) ?? hit.ref;
|
|
34947
|
+
const held = kept2.get(key);
|
|
34948
|
+
if (!held) {
|
|
34949
|
+
kept2.set(key, hit);
|
|
34950
|
+
continue;
|
|
34951
|
+
}
|
|
34952
|
+
held.accounts = [...held.accounts ?? [held.account], hit.account];
|
|
34953
|
+
held.foundBy = ["words", "meaning"].filter((by) => [held, hit].some(({ foundBy }) => foundBy.includes(by)));
|
|
34954
|
+
const cosine = cosines.get(hit.ref);
|
|
34955
|
+
if (cosine !== void 0 && cosine > (cosines.get(held.ref) ?? Number.NEGATIVE_INFINITY))
|
|
34956
|
+
cosines.set(held.ref, cosine);
|
|
34957
|
+
}
|
|
34958
|
+
return [...kept2.values()];
|
|
34959
|
+
}, "oneHitPerItem");
|
|
34960
|
+
var TRACKER_DEPTH = 500;
|
|
34961
|
+
var trackerLane = /* @__PURE__ */ __name(async (store, { text: text2, accounts: read, depth, discover, exact, cosines, embedders, command, env }) => {
|
|
34962
|
+
const { words: words3, anyWord } = contentWords(titleWords2(text2, "issues, projects and comments are found by the words and meaning of their title and text only"), discover);
|
|
34963
|
+
const deep = Math.min(depth * read.length, TRACKER_DEPTH);
|
|
34964
|
+
const found = await store.tracker.find({
|
|
34965
|
+
words: words3,
|
|
34966
|
+
anyWord: anyWord || discover,
|
|
34967
|
+
...exact ? { exact: true } : {},
|
|
34968
|
+
kinds: ["issue", "project", "comment"],
|
|
34969
|
+
limit: deep,
|
|
34970
|
+
accounts: read
|
|
34971
|
+
});
|
|
34972
|
+
const items = /* @__PURE__ */ new Map();
|
|
34973
|
+
const records = /* @__PURE__ */ new Map();
|
|
34974
|
+
const hitOf = /* @__PURE__ */ __name((at, item2, excerpt3, foundBy) => {
|
|
34975
|
+
const ref = `tracker:${at.provider}/${at.account}/${item2.kind}/${item2.record.externalId}`;
|
|
34976
|
+
if (hasGlobalItemIds(at.provider))
|
|
34977
|
+
items.set(ref, JSON.stringify([at.provider, item2.kind, item2.record.externalId]));
|
|
34978
|
+
records.set(ref, item2);
|
|
34979
|
+
return {
|
|
34980
|
+
kind: TRACKER_HIT_KINDS[item2.kind],
|
|
34981
|
+
// Two sign-ins see the same issue under the same id, so the account keeps their hits apart.
|
|
34982
|
+
ref,
|
|
34983
|
+
provider: at.provider,
|
|
34984
|
+
account: at.account,
|
|
34985
|
+
...item2.record.url ? { url: item2.record.url } : {},
|
|
34986
|
+
title: trackerTitle(item2),
|
|
34987
|
+
timestamp: new Date(item2.record.updatedAt ?? item2.syncedAt).toISOString(),
|
|
34988
|
+
text: excerpt3,
|
|
34989
|
+
foundBy
|
|
34990
|
+
};
|
|
34991
|
+
}, "hitOf");
|
|
34992
|
+
const byWords = found.items.map(({ account: at, item: item2, excerpt: text3 }) => hitOf(at, item2, text3, ["words"]));
|
|
34993
|
+
const plain2 = meaningWordsOf(discover ? questionText(text2) : text2);
|
|
34994
|
+
let near2;
|
|
34995
|
+
let meaningSkipped;
|
|
34996
|
+
let meaningReason;
|
|
34997
|
+
if (exact)
|
|
34998
|
+
meaningSkipped = "--exact searches words as written";
|
|
34999
|
+
else if (plain2 === void 0)
|
|
35000
|
+
meaningSkipped = "the query names a title, which meaning cannot follow";
|
|
35001
|
+
else
|
|
35002
|
+
try {
|
|
35003
|
+
near2 = await nearestTracker(store, plain2, {
|
|
35004
|
+
limit: deep,
|
|
35005
|
+
accounts: read,
|
|
35006
|
+
embedders,
|
|
35007
|
+
...command === void 0 ? {} : { command },
|
|
35008
|
+
...env === void 0 ? {} : { env }
|
|
35009
|
+
});
|
|
35010
|
+
} catch (error) {
|
|
35011
|
+
if (!(error instanceof CliError && error.code === "not_found"))
|
|
35012
|
+
throw error;
|
|
35013
|
+
meaningSkipped = error.message;
|
|
35014
|
+
const { reason } = error.details;
|
|
35015
|
+
if (typeof reason === "string")
|
|
35016
|
+
meaningReason = reason;
|
|
35017
|
+
}
|
|
35018
|
+
const tracker = {
|
|
35019
|
+
by: near2 === void 0 ? "words" : "words and meaning",
|
|
35020
|
+
...meaningSkipped === void 0 ? {} : { meaningSkipped }
|
|
35021
|
+
};
|
|
35022
|
+
const hits = near2 === void 0 ? oneHitPerItem(byWords, cosines, items) : oneHitPerItem(fusedLane(byWords, near2.map(({ account: at, item: item2, score }) => ({
|
|
35023
|
+
hit: hitOf(at, item2, trackerExcerpt(item2, text2), ["meaning"]),
|
|
35024
|
+
score
|
|
35025
|
+
})), discover, cosines), cosines, items);
|
|
35026
|
+
return { hits, records, hasMore: found.hasMore, tracker, ...meaningReason ? { meaningReason } : {} };
|
|
35027
|
+
}, "trackerLane");
|
|
35028
|
+
|
|
35029
|
+
// node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/services/search-harder.js
|
|
35020
35030
|
var SECTION3 = "search_harder";
|
|
35021
35031
|
var HARDER_MODELS = {
|
|
35022
35032
|
anthropic: "claude-haiku-5-5",
|
|
@@ -35262,8 +35272,17 @@ var reorderHarder = /* @__PURE__ */ __name(async (question, hits, { laterPage, a
|
|
|
35262
35272
|
};
|
|
35263
35273
|
}, "reorderHarder");
|
|
35264
35274
|
|
|
35265
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
35266
|
-
var RESOURCES_SEARCHED = [
|
|
35275
|
+
// node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/services/search-all.js
|
|
35276
|
+
var RESOURCES_SEARCHED = [
|
|
35277
|
+
"messages",
|
|
35278
|
+
"mail",
|
|
35279
|
+
"notes",
|
|
35280
|
+
"events",
|
|
35281
|
+
"crm",
|
|
35282
|
+
"business",
|
|
35283
|
+
"meetings",
|
|
35284
|
+
"tracker"
|
|
35285
|
+
];
|
|
35267
35286
|
var refusal = /* @__PURE__ */ __name((error, text2) => {
|
|
35268
35287
|
const { reason, span } = error.details ?? {};
|
|
35269
35288
|
const why = typeof reason === "string" ? reason : void 0;
|
|
@@ -35277,17 +35296,6 @@ var filtersBeside = /* @__PURE__ */ __name((text2) => {
|
|
|
35277
35296
|
const top = root.kind === "boolean" ? root.clauses : [{ node: root, occur: "must" }];
|
|
35278
35297
|
return top.every(({ node, occur }) => occur !== "must_not" && followable(node, occur === "must")) ? planQuestion(text2).scope : void 0;
|
|
35279
35298
|
}, "filtersBeside");
|
|
35280
|
-
var titleWords2 = /* @__PURE__ */ __name((text2, refused = "deals and leads are found by the words of their title, company, contacts and activities only") => {
|
|
35281
|
-
const { root } = parseLucene(text2, SEARCH_QUERY);
|
|
35282
|
-
const clauses = root.kind === "boolean" ? root.clauses : [{ node: root, occur: "must" }];
|
|
35283
|
-
const words3 = clauses.map(({ node, occur }) => occur !== "must_not" && node.kind === "predicate" && (node.field === "text" || node.field === "title") && (node.operator === "term" || node.operator === "phrase") ? (
|
|
35284
|
-
// A title holds "invoice", not the question mark of "invoice?".
|
|
35285
|
-
node.value.replace(/\?+$/u, "") || node.value
|
|
35286
|
-
) : (() => {
|
|
35287
|
-
throw new CliError("validation_error", refused);
|
|
35288
|
-
})());
|
|
35289
|
-
return { words: words3, anyWord: clauses.length > 1 && clauses.every(({ occur }) => occur === "should") };
|
|
35290
|
-
}, "titleWords");
|
|
35291
35299
|
var strictWords = /* @__PURE__ */ __name((text2) => {
|
|
35292
35300
|
try {
|
|
35293
35301
|
const { words: words3, anyWord } = titleWords2(text2);
|
|
@@ -35301,14 +35309,21 @@ var strictWords = /* @__PURE__ */ __name((text2) => {
|
|
|
35301
35309
|
}, "strictWords");
|
|
35302
35310
|
var accountKeyOf = /* @__PURE__ */ __name(({ provider, account }) => `${provider}\0${account}`, "accountKeyOf");
|
|
35303
35311
|
var sourceScope = /* @__PURE__ */ __name(async (store, account, source, asked, messenger) => {
|
|
35304
|
-
const
|
|
35312
|
+
const context2 = await listContextOf(store, account, messenger.app);
|
|
35313
|
+
const entries = entriesOfList(source, context2);
|
|
35305
35314
|
const imported = asked.includes("business") ? new Set((await store.business.accounts()).map(accountKeyOf)) : /* @__PURE__ */ new Set();
|
|
35306
35315
|
const holdsBusiness = /* @__PURE__ */ __name((one) => imported.has(accountKeyOf(one)), "holdsBusiness");
|
|
35307
35316
|
const holdsDocuments = /* @__PURE__ */ __name((one) => asked.includes("notes") && holdsKind(one.provider, "documents"), "holdsDocuments");
|
|
35308
35317
|
const { skipped } = fitting(entries, asked.filter((one) => one !== "business"), "search all", (kind) => `--only leaves ${kind} out`, (one) => holdsBusiness(one) || holdsDocuments(one));
|
|
35309
35318
|
const holds = /* @__PURE__ */ __name((resource, one) => resource === "business" ? holdsBusiness(one) : listedHolds(one, resource) || resource === "notes" && holdsDocuments(one), "holds");
|
|
35319
|
+
const asNotes = /* @__PURE__ */ __name((one) => {
|
|
35320
|
+
if (!isDocumentAccountProvider(one.provider))
|
|
35321
|
+
return one;
|
|
35322
|
+
const stored = context2.held.find(({ provider, account: account2 }) => provider === one.provider && account2 === one.account);
|
|
35323
|
+
return stored ? { provider: "notes", account: String(stored.id) } : one;
|
|
35324
|
+
}, "asNotes");
|
|
35310
35325
|
const named2 = /* @__PURE__ */ __name((resource) => [
|
|
35311
|
-
...new Map(entries.flatMap(({ accounts }) => accounts).filter((one) => holds(resource, one)).map(({ provider, account: account2 }) => [`${provider}\0${account2}`, { provider, account: account2 }])).values()
|
|
35326
|
+
...new Map(entries.flatMap(({ accounts }) => accounts).filter((one) => holds(resource, one)).map((one) => resource === "notes" ? asNotes(one) : one).map(({ provider, account: account2 }) => [`${provider}\0${account2}`, { provider, account: account2 }])).values()
|
|
35312
35327
|
], "named");
|
|
35313
35328
|
const scope = Object.fromEntries(asked.map((resource) => [resource, named2(resource)]));
|
|
35314
35329
|
const only = asked.filter((resource) => scope[resource]?.length);
|
|
@@ -35324,6 +35339,7 @@ var copyViewers = /* @__PURE__ */ __name(async (store) => {
|
|
|
35324
35339
|
}
|
|
35325
35340
|
return viewers;
|
|
35326
35341
|
}, "copyViewers");
|
|
35342
|
+
var trackerAccounts = /* @__PURE__ */ __name(async (store) => (await store.accounts.accounts()).filter(({ provider }) => holdsKind(provider, "tracker")), "trackerAccounts");
|
|
35327
35343
|
var crmAccounts = /* @__PURE__ */ __name(async (store) => (await store.accounts.accounts()).filter(({ provider }) => holdsKind(provider, "crm")), "crmAccounts");
|
|
35328
35344
|
var searchAll = /* @__PURE__ */ __name(async (store, account, asked, messenger = {}, searchMessages = (query) => searchStore(store, account, query, messenger), meaning) => {
|
|
35329
35345
|
if (!asked.text.trim())
|
|
@@ -35345,6 +35361,8 @@ var searchAll = /* @__PURE__ */ __name(async (store, account, asked, messenger =
|
|
|
35345
35361
|
let hasMore = false;
|
|
35346
35362
|
let notes;
|
|
35347
35363
|
let events;
|
|
35364
|
+
let tracker;
|
|
35365
|
+
let crm;
|
|
35348
35366
|
const by = {};
|
|
35349
35367
|
let server;
|
|
35350
35368
|
const discover = !request.exact && questionLookup(request.text) !== void 0;
|
|
@@ -35513,7 +35531,7 @@ var searchAll = /* @__PURE__ */ __name(async (store, account, asked, messenger =
|
|
|
35513
35531
|
})));
|
|
35514
35532
|
accounts.push(...read.map(({ provider, account: account2 }) => ({ resource, provider, account: account2 })));
|
|
35515
35533
|
} else if (resource === "crm") {
|
|
35516
|
-
const { words: words3, anyWord } = titleWords2(request.text);
|
|
35534
|
+
const { words: words3, anyWord } = contentWords(titleWords2(request.text), discover);
|
|
35517
35535
|
const chosen2 = scope?.crm;
|
|
35518
35536
|
const viewers = request.crmViewers ?? await copyViewers(store);
|
|
35519
35537
|
const found = await store.deals.find({
|
|
@@ -35527,7 +35545,7 @@ var searchAll = /* @__PURE__ */ __name(async (store, account, asked, messenger =
|
|
|
35527
35545
|
});
|
|
35528
35546
|
hasMore ||= found.hasMore;
|
|
35529
35547
|
const titled = /(?:^|[\s(+])title:/u.test(request.text);
|
|
35530
|
-
|
|
35548
|
+
const byWords = found.items.filter((deal) => !titled || deal.matched.includes("title")).map((deal) => ({
|
|
35531
35549
|
kind: deal.kind,
|
|
35532
35550
|
ref: deal.ref,
|
|
35533
35551
|
provider: deal.account?.provider ?? "crm",
|
|
@@ -35537,7 +35555,56 @@ var searchAll = /* @__PURE__ */ __name(async (store, account, asked, messenger =
|
|
|
35537
35555
|
text: deal.summary,
|
|
35538
35556
|
foundBy: deal.matched.includes("title") ? ["title"] : ["words"],
|
|
35539
35557
|
...deal.corrections ? { match: "corrected", corrections: deal.corrections } : {}
|
|
35540
|
-
}))
|
|
35558
|
+
}));
|
|
35559
|
+
const plain2 = titled ? void 0 : meaningWordsOf(discover ? questionText(request.text) : request.text);
|
|
35560
|
+
let near2;
|
|
35561
|
+
let meaningSkipped;
|
|
35562
|
+
if (request.crmActivities === false)
|
|
35563
|
+
meaningSkipped = "the profile may not read activities";
|
|
35564
|
+
else if (request.exact)
|
|
35565
|
+
meaningSkipped = "--exact searches words as written";
|
|
35566
|
+
else if (plain2 === void 0)
|
|
35567
|
+
meaningSkipped = "the query names a title, which meaning cannot follow";
|
|
35568
|
+
else
|
|
35569
|
+
try {
|
|
35570
|
+
near2 = await nearestCrmActivities(store, plain2, {
|
|
35571
|
+
limit: Math.min(depth, 500),
|
|
35572
|
+
accounts: chosen2,
|
|
35573
|
+
viewers,
|
|
35574
|
+
embedders,
|
|
35575
|
+
...request.crmKinds === void 0 ? {} : { kinds: request.crmKinds },
|
|
35576
|
+
...command === void 0 ? {} : { command },
|
|
35577
|
+
...request.env === void 0 ? {} : { env: request.env }
|
|
35578
|
+
});
|
|
35579
|
+
} catch (error) {
|
|
35580
|
+
if (!(error instanceof CliError && error.code === "not_found"))
|
|
35581
|
+
throw error;
|
|
35582
|
+
meaningSkipped = error.message;
|
|
35583
|
+
}
|
|
35584
|
+
crm = {
|
|
35585
|
+
by: near2 === void 0 ? "words" : "words and meaning",
|
|
35586
|
+
...meaningSkipped === void 0 ? {} : { meaningSkipped },
|
|
35587
|
+
...near2 === void 0 && plain2 !== void 0 && !request.exact && request.crmActivities !== false ? { needsVectors: true } : {}
|
|
35588
|
+
};
|
|
35589
|
+
if (near2 === void 0)
|
|
35590
|
+
lists.push(byWords);
|
|
35591
|
+
else {
|
|
35592
|
+
const byMeaning = await Promise.all(near2.map(async ({ ref, kind, account: at, subject, body, score }) => {
|
|
35593
|
+
const deal = await store.deals.get(ref);
|
|
35594
|
+
const hit = {
|
|
35595
|
+
kind,
|
|
35596
|
+
ref,
|
|
35597
|
+
provider: at.provider,
|
|
35598
|
+
account: at.account,
|
|
35599
|
+
title: deal.title,
|
|
35600
|
+
timestamp: deal.updatedAt,
|
|
35601
|
+
text: excerpt([subject, body].filter(Boolean).join("\n"), request.text),
|
|
35602
|
+
foundBy: ["meaning"]
|
|
35603
|
+
};
|
|
35604
|
+
return { hit, score };
|
|
35605
|
+
}));
|
|
35606
|
+
lists.push(fusedLane(byWords, byMeaning, discover, cosines));
|
|
35607
|
+
}
|
|
35541
35608
|
if (request.crmFiles !== false) {
|
|
35542
35609
|
const files = await store.crmFiles.find({
|
|
35543
35610
|
words: words3,
|
|
@@ -35562,8 +35629,28 @@ var searchAll = /* @__PURE__ */ __name(async (store, account, asked, messenger =
|
|
|
35562
35629
|
const read = chosen2 ?? [...await crmAccounts(store), { provider: "crm", account: INTERNAL_NOTES }];
|
|
35563
35630
|
for (const { provider, account: account2 } of read)
|
|
35564
35631
|
accounts.push({ resource, provider, account: account2 });
|
|
35632
|
+
} else if (resource === "tracker") {
|
|
35633
|
+
const read = scope?.tracker ?? await trackerAccounts(store);
|
|
35634
|
+
if (!read.length)
|
|
35635
|
+
continue;
|
|
35636
|
+
const found = await trackerLane(store, {
|
|
35637
|
+
text: request.text,
|
|
35638
|
+
accounts: read,
|
|
35639
|
+
depth,
|
|
35640
|
+
discover,
|
|
35641
|
+
cosines,
|
|
35642
|
+
embedders,
|
|
35643
|
+
...request.exact ? { exact: true } : {},
|
|
35644
|
+
...command === void 0 ? {} : { command },
|
|
35645
|
+
...request.env === void 0 ? {} : { env: request.env }
|
|
35646
|
+
});
|
|
35647
|
+
hasMore ||= found.hasMore;
|
|
35648
|
+
tracker = found.tracker;
|
|
35649
|
+
lists.push(found.hits);
|
|
35650
|
+
for (const { provider, account: account2 } of read)
|
|
35651
|
+
accounts.push({ resource, provider, account: account2 });
|
|
35565
35652
|
} else if (resource === "business") {
|
|
35566
|
-
const { words: words3, anyWord } = titleWords2(request.text, BUSINESS_WORDS_ONLY);
|
|
35653
|
+
const { words: words3, anyWord } = contentWords(titleWords2(request.text, BUSINESS_WORDS_ONLY), discover);
|
|
35567
35654
|
const found = await searchBusiness(store, {
|
|
35568
35655
|
words: words3,
|
|
35569
35656
|
anyWord: anyWord || discover,
|
|
@@ -35642,6 +35729,8 @@ var searchAll = /* @__PURE__ */ __name(async (store, account, asked, messenger =
|
|
|
35642
35729
|
skipped,
|
|
35643
35730
|
...notes === void 0 ? {} : { notes },
|
|
35644
35731
|
...events === void 0 ? {} : { events },
|
|
35732
|
+
...tracker === void 0 ? {} : { tracker },
|
|
35733
|
+
...crm === void 0 ? {} : { crm },
|
|
35645
35734
|
...by.messages === void 0 ? {} : { messages: by.messages },
|
|
35646
35735
|
...by.mail === void 0 ? {} : { mail: by.mail },
|
|
35647
35736
|
...server === void 0 ? {} : { server },
|
|
@@ -35679,38 +35768,15 @@ var withMeetingDocuments = /* @__PURE__ */ __name(async (store, lists, read) =>
|
|
|
35679
35768
|
];
|
|
35680
35769
|
}));
|
|
35681
35770
|
}, "withMeetingDocuments");
|
|
35682
|
-
var hitKey = /* @__PURE__ */ __name((item2) => item2.kind === "meeting" ? `${item2.ref}\0${item2.scope}\0${item2.id}` : item2.ref, "hitKey");
|
|
35683
|
-
var oneList = /* @__PURE__ */ __name((lists, cosines) => {
|
|
35684
|
-
const place = /* @__PURE__ */ new Map();
|
|
35685
|
-
for (const list2 of lists) {
|
|
35686
|
-
let above = Number.NEGATIVE_INFINITY;
|
|
35687
|
-
list2.forEach((item2, rank) => {
|
|
35688
|
-
const key = hitKey(item2);
|
|
35689
|
-
above = cosines.get(item2.ref) ?? above;
|
|
35690
|
-
const held = place.get(key);
|
|
35691
|
-
if (!held || rank < held.rank)
|
|
35692
|
-
place.set(key, { item: item2, rank, cosine: above });
|
|
35693
|
-
});
|
|
35694
|
-
}
|
|
35695
|
-
const head = /* @__PURE__ */ __name((rank) => Math.min(rank, 1), "head");
|
|
35696
|
-
return [...place.values()].sort((a, b) => head(a.rank) - head(b.rank) || b.cosine - a.cosine || a.rank - b.rank).map(({ item: item2 }) => item2);
|
|
35697
|
-
}, "oneList");
|
|
35698
|
-
var PERIOD_DEPTH = 100;
|
|
35699
|
-
var PERIOD_BOOST = 0.5;
|
|
35700
|
-
var insidePeriodFirst = /* @__PURE__ */ __name((ordered, period) => {
|
|
35701
|
-
if (!period)
|
|
35702
|
-
return ordered;
|
|
35703
|
-
const inside2 = /* @__PURE__ */ __name(({ timestamp: timestamp2 }) => {
|
|
35704
|
-
const at = timestamp2 === null ? Number.NaN : Date.parse(timestamp2);
|
|
35705
|
-
return at >= period.from && at < period.to;
|
|
35706
|
-
}, "inside");
|
|
35707
|
-
return ordered.map((item2, rank) => ({ item: item2, score: 1 - rank / PERIOD_DEPTH + (inside2(item2) ? PERIOD_BOOST : 0) })).sort((a, b) => b.score - a.score).map(({ item: item2 }) => item2);
|
|
35708
|
-
}, "insidePeriodFirst");
|
|
35709
35771
|
|
|
35710
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
35772
|
+
// node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/services/server-search.js
|
|
35711
35773
|
var SERVER_SEARCH_KEY = "messages.server-search";
|
|
35712
35774
|
var SERVER_BOUNDS = { timeMs: 5e3, perCall: 100, maxCalls: 3, textBytes: 262144 };
|
|
35713
35775
|
var DEFAULT_BACKEND = "both";
|
|
35776
|
+
var keysOf = /* @__PURE__ */ __name((error) => {
|
|
35777
|
+
const { reason } = error.details;
|
|
35778
|
+
return { code: error.code, ...typeof reason === "string" ? { reason } : {} };
|
|
35779
|
+
}, "keysOf");
|
|
35714
35780
|
var sourceKey = /* @__PURE__ */ __name((chatId, id2) => JSON.stringify([chatId, id2]), "sourceKey");
|
|
35715
35781
|
var merge = /* @__PURE__ */ __name((one, other) => {
|
|
35716
35782
|
if (one.chat !== void 0 && other.chat !== void 0 && one.chat !== other.chat)
|
|
@@ -35827,37 +35893,41 @@ var searchServer = /* @__PURE__ */ __name(async (deps, request) => {
|
|
|
35827
35893
|
const controller = new AbortController();
|
|
35828
35894
|
const timer = setTimeout(() => controller.abort(), timeMs);
|
|
35829
35895
|
const stop = request.signal ? AbortSignal.any([request.signal, controller.signal]) : controller.signal;
|
|
35830
|
-
const bound2 = new Promise((
|
|
35896
|
+
const bound2 = new Promise((resolve6) => {
|
|
35831
35897
|
if (stop.aborted)
|
|
35832
|
-
|
|
35833
|
-
stop.addEventListener("abort", () =>
|
|
35898
|
+
resolve6(BOUND);
|
|
35899
|
+
stop.addEventListener("abort", () => resolve6(BOUND), { once: true });
|
|
35834
35900
|
});
|
|
35835
35901
|
const pending = new Set(calls);
|
|
35836
35902
|
const found = [];
|
|
35837
|
-
let
|
|
35838
|
-
const fail2 = /* @__PURE__ */ __name((branch, reason) => {
|
|
35903
|
+
let open6 = true;
|
|
35904
|
+
const fail2 = /* @__PURE__ */ __name((branch, reason, error) => {
|
|
35839
35905
|
pending.delete(branch);
|
|
35840
35906
|
report.complete = false;
|
|
35841
|
-
report.failed.push({
|
|
35907
|
+
report.failed.push({
|
|
35908
|
+
chat: branch.chat ?? null,
|
|
35909
|
+
reason,
|
|
35910
|
+
...error instanceof CliError ? { error: keysOf(error) } : {}
|
|
35911
|
+
});
|
|
35842
35912
|
}, "fail");
|
|
35843
35913
|
const ask2 = /* @__PURE__ */ __name(async (adapter) => {
|
|
35844
35914
|
const search = capability(adapter, "searchMessages", "search messages on its server");
|
|
35845
35915
|
await Promise.all(calls.map(async (branch) => {
|
|
35846
|
-
if (!
|
|
35916
|
+
if (!open6)
|
|
35847
35917
|
return;
|
|
35848
35918
|
report.calls += 1;
|
|
35849
35919
|
try {
|
|
35850
35920
|
const page = await search(asQuery(branch), { limit: SERVER_BOUNDS.perCall, signal: stop });
|
|
35851
|
-
if (!
|
|
35921
|
+
if (!open6)
|
|
35852
35922
|
return;
|
|
35853
35923
|
pending.delete(branch);
|
|
35854
35924
|
if (page.hasMore)
|
|
35855
35925
|
report.complete = false;
|
|
35856
35926
|
found.push(page);
|
|
35857
35927
|
} catch (error) {
|
|
35858
|
-
if (!
|
|
35928
|
+
if (!open6)
|
|
35859
35929
|
return;
|
|
35860
|
-
fail2(branch, error instanceof CliError && error.code === "rate_limited" ? "rate_limited" : "search_failed");
|
|
35930
|
+
fail2(branch, error instanceof CliError && error.code === "rate_limited" ? "rate_limited" : "search_failed", error);
|
|
35861
35931
|
}
|
|
35862
35932
|
}));
|
|
35863
35933
|
}, "ask");
|
|
@@ -35867,11 +35937,11 @@ var searchServer = /* @__PURE__ */ __name(async (deps, request) => {
|
|
|
35867
35937
|
run2.then(() => "done", () => "failed"),
|
|
35868
35938
|
bound2
|
|
35869
35939
|
]);
|
|
35870
|
-
|
|
35940
|
+
open6 = false;
|
|
35871
35941
|
for (const branch of [...pending])
|
|
35872
35942
|
fail2(branch, outcome2 === "failed" ? "search_failed" : "time_or_abort_bound");
|
|
35873
35943
|
} finally {
|
|
35874
|
-
|
|
35944
|
+
open6 = false;
|
|
35875
35945
|
clearTimeout(timer);
|
|
35876
35946
|
}
|
|
35877
35947
|
const chats = new Map(found.flatMap(({ chats: chats2 }) => chats2).map((chat) => [chat.id, chat]));
|
|
@@ -35898,7 +35968,7 @@ var searchServer = /* @__PURE__ */ __name(async (deps, request) => {
|
|
|
35898
35968
|
return { report, sources };
|
|
35899
35969
|
}, "searchServer");
|
|
35900
35970
|
|
|
35901
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
35971
|
+
// node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/services/messages.js
|
|
35902
35972
|
var DELETE_AT_ONCE = 10;
|
|
35903
35973
|
var atOnce = /* @__PURE__ */ __name((ids) => {
|
|
35904
35974
|
if (ids.length > DELETE_AT_ONCE)
|
|
@@ -36398,7 +36468,7 @@ var checkMediaOptions = /* @__PURE__ */ __name((messenger, asked, attachments) =
|
|
|
36398
36468
|
throw new CliError("validation_error", `${MEDIA_FLAGS[first2]} needs a --photo or --file`);
|
|
36399
36469
|
}, "checkMediaOptions");
|
|
36400
36470
|
|
|
36401
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
36471
|
+
// node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/domain/channel-tags.js
|
|
36402
36472
|
var CHANNEL_TAG_RULES_VERSION = "keywords-v1";
|
|
36403
36473
|
var RULES2 = {
|
|
36404
36474
|
ai: [/\b(ai|gpt|llm|machine learning|artificial intelligence)\b/iu, /нейросет|искусственн/iu],
|
|
@@ -36413,7 +36483,7 @@ var classifyChannel = /* @__PURE__ */ __name((metadata) => Object.entries(RULES2
|
|
|
36413
36483
|
return fields.length ? [{ tag, score: fields.length / 3, fields }] : [];
|
|
36414
36484
|
}), "classifyChannel");
|
|
36415
36485
|
|
|
36416
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
36486
|
+
// node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/services/metadata.js
|
|
36417
36487
|
var metadataService = /* @__PURE__ */ __name((deps) => {
|
|
36418
36488
|
const held = /* @__PURE__ */ __name(async (reference, { includeLeft = false } = {}) => {
|
|
36419
36489
|
const store = await deps.store();
|
|
@@ -36499,7 +36569,7 @@ var metadataService = /* @__PURE__ */ __name((deps) => {
|
|
|
36499
36569
|
};
|
|
36500
36570
|
}, "metadataService");
|
|
36501
36571
|
|
|
36502
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
36572
|
+
// node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/moderation/run.js
|
|
36503
36573
|
var FIRST_LOOK_MS = 24 * 36e5;
|
|
36504
36574
|
var moderateWith = /* @__PURE__ */ __name(async (run2) => {
|
|
36505
36575
|
const { chatId, title, rules, point, since, dryRun } = run2;
|
|
@@ -36536,7 +36606,7 @@ var moderateWith = /* @__PURE__ */ __name(async (run2) => {
|
|
|
36536
36606
|
return { chatId, rows, notes };
|
|
36537
36607
|
}, "moderateWith");
|
|
36538
36608
|
|
|
36539
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
36609
|
+
// node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/services/moderation.js
|
|
36540
36610
|
var moderationService = /* @__PURE__ */ __name((deps) => {
|
|
36541
36611
|
const file = /* @__PURE__ */ __name(() => {
|
|
36542
36612
|
const env = deps.env ?? process.env;
|
|
@@ -36621,7 +36691,7 @@ var moderatorOf = /* @__PURE__ */ __name((adapter, deps) => ({
|
|
|
36621
36691
|
}, "removePerson")
|
|
36622
36692
|
}), "moderatorOf");
|
|
36623
36693
|
|
|
36624
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
36694
|
+
// node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/services/private-people.js
|
|
36625
36695
|
var noteItem = /* @__PURE__ */ __name((provider, note) => ({
|
|
36626
36696
|
id: note.id,
|
|
36627
36697
|
contact: formatReference({ type: "contact", provider, id: note.personId }),
|
|
@@ -36665,7 +36735,7 @@ var privatePeopleService = /* @__PURE__ */ __name((deps) => {
|
|
|
36665
36735
|
};
|
|
36666
36736
|
}, "privatePeopleService");
|
|
36667
36737
|
|
|
36668
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
36738
|
+
// node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/services/rankings.js
|
|
36669
36739
|
var empty = /* @__PURE__ */ __name(() => ({
|
|
36670
36740
|
total: 0,
|
|
36671
36741
|
population: 0,
|
|
@@ -36921,7 +36991,7 @@ var rankingsService = /* @__PURE__ */ __name((deps) => ({
|
|
|
36921
36991
|
}, "evidence")
|
|
36922
36992
|
}), "rankingsService");
|
|
36923
36993
|
|
|
36924
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
36994
|
+
// node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/services/reply-stats.js
|
|
36925
36995
|
var FIELDS = ["date", "chat", "kind", "muted"];
|
|
36926
36996
|
var WAITING_TAIL = 100;
|
|
36927
36997
|
var plainOnly = /* @__PURE__ */ __name((text2, command) => {
|
|
@@ -37055,7 +37125,7 @@ var replyStatsService = /* @__PURE__ */ __name((deps) => {
|
|
|
37055
37125
|
};
|
|
37056
37126
|
}, "replyStatsService");
|
|
37057
37127
|
|
|
37058
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
37128
|
+
// node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/services/tags.js
|
|
37059
37129
|
var TAGGING_QUERY = {
|
|
37060
37130
|
entity: "tagging",
|
|
37061
37131
|
backend: "sql",
|
|
@@ -37139,7 +37209,7 @@ var tagsService = /* @__PURE__ */ __name((deps) => {
|
|
|
37139
37209
|
};
|
|
37140
37210
|
}, "tagsService");
|
|
37141
37211
|
|
|
37142
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
37212
|
+
// node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/services/topics.js
|
|
37143
37213
|
var actionOf = /* @__PURE__ */ __name(({ title, closed, pinned, hidden, icon }) => {
|
|
37144
37214
|
const set = [closed, pinned, hidden].filter((one) => one !== void 0).length;
|
|
37145
37215
|
if (title !== void 0 || icon !== void 0 || set !== 1)
|
|
@@ -37338,7 +37408,7 @@ var topicsService = /* @__PURE__ */ __name((deps) => {
|
|
|
37338
37408
|
};
|
|
37339
37409
|
}, "topicsService");
|
|
37340
37410
|
|
|
37341
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
37411
|
+
// node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/services/evidence.js
|
|
37342
37412
|
import { createHash as createHash12, randomUUID as randomUUID5 } from "node:crypto";
|
|
37343
37413
|
var hash2 = /* @__PURE__ */ __name((value) => createHash12("sha256").update(JSON.stringify(value)).digest("hex"), "hash");
|
|
37344
37414
|
var positive2 = /* @__PURE__ */ __name((value, name, minimum = 1) => {
|
|
@@ -37412,7 +37482,7 @@ var prepareEvidencePacket = /* @__PURE__ */ __name(({ kind, source, page, limits
|
|
|
37412
37482
|
return { ...content, id: randomUUID5(), fingerprint: hash2(content) };
|
|
37413
37483
|
}, "prepareEvidencePacket");
|
|
37414
37484
|
|
|
37415
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
37485
|
+
// node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/services/evidence-read.js
|
|
37416
37486
|
var readEvidencePacket = /* @__PURE__ */ __name(async (store, account, { chat, limit, before }, messenger = {}) => {
|
|
37417
37487
|
if (!Number.isSafeInteger(limit) || limit < 1 || limit > 100)
|
|
37418
37488
|
throw new CliError("validation_error", "evidence message limit must be an integer from 1 to 100");
|
|
@@ -37432,7 +37502,7 @@ var readEvidencePacket = /* @__PURE__ */ __name(async (store, account, { chat, l
|
|
|
37432
37502
|
return { ...packet, nextBeforeId: older && last ? last.id : null };
|
|
37433
37503
|
}, "readEvidencePacket");
|
|
37434
37504
|
|
|
37435
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
37505
|
+
// node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/services/meeting-project-discovery.js
|
|
37436
37506
|
var scopeKeys = [
|
|
37437
37507
|
"accountId",
|
|
37438
37508
|
"meetingId",
|
|
@@ -37454,7 +37524,7 @@ var optionKeys = /* @__PURE__ */ new Set([
|
|
|
37454
37524
|
"maxVocabularyReadBytes"
|
|
37455
37525
|
]);
|
|
37456
37526
|
|
|
37457
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
37527
|
+
// node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/services/index.js
|
|
37458
37528
|
var servicesFor = /* @__PURE__ */ __name((deps) => {
|
|
37459
37529
|
const pictures = picturesService(deps);
|
|
37460
37530
|
const base = {
|
|
@@ -37553,12 +37623,6 @@ export {
|
|
|
37553
37623
|
keyOf,
|
|
37554
37624
|
fetchInto,
|
|
37555
37625
|
GAP_BOUNDS,
|
|
37556
|
-
typesText,
|
|
37557
|
-
refuseLockedOutput,
|
|
37558
|
-
refusedPlace,
|
|
37559
|
-
readUpload,
|
|
37560
|
-
readAttachments,
|
|
37561
|
-
readStickerFile,
|
|
37562
37626
|
importEngine,
|
|
37563
37627
|
extractText,
|
|
37564
37628
|
engineHint,
|
|
@@ -37611,6 +37675,7 @@ export {
|
|
|
37611
37675
|
keyVariable,
|
|
37612
37676
|
enrichmentState,
|
|
37613
37677
|
searchNotesOf,
|
|
37678
|
+
embedCrmActivities,
|
|
37614
37679
|
HARDER_MODELS,
|
|
37615
37680
|
HARDER_CANDIDATES,
|
|
37616
37681
|
HARDER_CHARS,
|