@wirecat/amo-cli 0.3.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 +52 -0
- package/README.md +8 -4
- package/contracts/wirecat.json +15 -14
- 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-PPUN52SP.js → all-profiles-PIWUQWBA.js} +11 -11
- package/dist/bundle/amo.js +28 -28
- package/dist/bundle/{anthropic-RDNDT6ZP.js → anthropic-47CMXBPQ.js} +5 -5
- package/dist/bundle/{app-server-MMALJDBP.js → app-server-QRBQODF2.js} +70 -69
- package/dist/bundle/areas-QVHVU57Z.js +63 -0
- package/dist/bundle/{bun-Y4FRPURU.js → bun-OPDGMZZQ.js} +2 -2
- package/dist/bundle/{bun-sqlite-7NXJGZCO.js → bun-sqlite-7I4X7CZW.js} +6 -6
- package/dist/bundle/{chunk-OMH3WP7F.js → chunk-2JHVQMVC.js} +1 -1
- package/dist/bundle/{chunk-MPXKBF37.js → chunk-2XBDILVW.js} +1 -1
- package/dist/bundle/{chunk-XI75EKLG.js → chunk-3DEQUYEG.js} +9 -9
- package/dist/bundle/{chunk-TWZF7VO6.js → chunk-3GX6KM2E.js} +1666 -163
- package/dist/bundle/{chunk-E2DLRLJ5.js → chunk-3HC5F3P7.js} +1 -1
- package/dist/bundle/{chunk-D6UPCAPD.js → chunk-3PYE55JY.js} +1 -1
- package/dist/bundle/{chunk-UM6SDFB6.js → chunk-3YM4B2GT.js} +1 -1
- package/dist/bundle/{chunk-JTFAG3BX.js → chunk-43OW5NTG.js} +6 -6
- package/dist/bundle/{chunk-ZIFEIJRK.js → chunk-43PMSR33.js} +13 -9
- package/dist/bundle/{chunk-5DPMNYQT.js → chunk-4N7PP76S.js} +1 -1
- package/dist/bundle/{chunk-XM2G62YF.js → chunk-4VN7RI4I.js} +5 -7
- package/dist/bundle/{chunk-5POLHHDZ.js → chunk-57HFPNMF.js} +8 -8
- package/dist/bundle/{chunk-CQ472K6W.js → chunk-5UTB3ADZ.js} +11 -11
- package/dist/bundle/{chunk-3NDMVXGS.js → chunk-633NQY2R.js} +3 -3
- package/dist/bundle/{chunk-VPBSZ4HQ.js → chunk-63N46DJU.js} +220 -234
- package/dist/bundle/{chunk-SJZ52MZE.js → chunk-6D4VWSJD.js} +6 -6
- package/dist/bundle/{chunk-Q2YVY7IR.js → chunk-6JTHXWPE.js} +3 -3
- package/dist/bundle/{chunk-QQT7WUR4.js → chunk-6QGUK3H7.js} +4 -4
- package/dist/bundle/{chunk-AYR6FIXN.js → chunk-6WS6GJ4V.js} +2 -2
- package/dist/bundle/{chunk-N4A6E2LL.js → chunk-7IR2G5XY.js} +16 -16
- package/dist/bundle/{chunk-7Z6NYSAN.js → chunk-7IWIFVXH.js} +4 -4
- package/dist/bundle/{chunk-LOSOWTAZ.js → chunk-ABX7BBS4.js} +6 -6
- package/dist/bundle/{chunk-3YOZTGZ6.js → chunk-ADTI5RUO.js} +6 -6
- package/dist/bundle/{chunk-QHA33ZS6.js → chunk-AKRIUNYP.js} +7 -7
- package/dist/bundle/{chunk-KZDBO2FT.js → chunk-BIKOE2IW.js} +7 -7
- package/dist/bundle/{chunk-VY27K2SH.js → chunk-BVVMIAQ6.js} +769 -692
- package/dist/bundle/{chunk-SBQ5MFHM.js → chunk-CGW5R4UD.js} +7 -7
- package/dist/bundle/{chunk-UZLT6VSP.js → chunk-D4NE7EON.js} +3 -3
- package/dist/bundle/{chunk-L2ZQDTDU.js → chunk-DNCLQPOM.js} +1 -1
- package/dist/bundle/{chunk-VFU25P57.js → chunk-DPV53EZC.js} +4 -4
- package/dist/bundle/{chunk-KEOKH2OZ.js → chunk-DQ6S5TFZ.js} +185 -114
- package/dist/bundle/{chunk-5RXH35ZA.js → chunk-DSJ6EAOA.js} +61 -61
- package/dist/bundle/{chunk-HQH4YPO5.js → chunk-DVZ75WZJ.js} +157 -35
- package/dist/bundle/{chunk-VEGNZPQU.js → chunk-EHK73OSW.js} +38 -24
- package/dist/bundle/{chunk-IEAPNTHT.js → chunk-FNV5HLHX.js} +17 -17
- package/dist/bundle/{chunk-FPDTIQOK.js → chunk-FV4GQNIK.js} +2 -2
- package/dist/bundle/{chunk-7USADF2W.js → chunk-G2TU5RYY.js} +6 -6
- package/dist/bundle/{chunk-IDQ7BNCZ.js → chunk-GDK7ETSB.js} +12 -12
- package/dist/bundle/{chunk-B4ITT55D.js → chunk-GGMAIIVE.js} +1 -1
- package/dist/bundle/{chunk-NJ2LJKNH.js → chunk-GLYWZQY4.js} +3 -3
- package/dist/bundle/{chunk-XDT74W5P.js → chunk-H4AFNENN.js} +34 -29
- package/dist/bundle/{chunk-2YEDK2XV.js → chunk-HOF7GQWW.js} +4 -4
- package/dist/bundle/{chunk-H34RBRS3.js → chunk-HSPEU6S7.js} +8 -8
- package/dist/bundle/{chunk-VJHOBOJR.js → chunk-IA7LLLEI.js} +3 -3
- package/dist/bundle/{chunk-YSOGGUK3.js → chunk-IB55P46L.js} +6 -6
- package/dist/bundle/{chunk-PFZ7WG2B.js → chunk-IG2TJQJ7.js} +3 -3
- package/dist/bundle/{chunk-CUZISGWH.js → chunk-JG6LCSEX.js} +13 -13
- package/dist/bundle/{chunk-MMOEAH5G.js → chunk-JLXXUEAM.js} +2 -2
- package/dist/bundle/{chunk-3RP57VDS.js → chunk-JXT6GY4V.js} +174 -62
- package/dist/bundle/{chunk-7SBAHYZW.js → chunk-K7YY6SXR.js} +19 -15
- package/dist/bundle/{chunk-TCDER3G7.js → chunk-KEKXERBE.js} +14883 -11912
- package/dist/bundle/{chunk-JZ2AITOE.js → chunk-KZ2FIDI3.js} +3 -3
- package/dist/bundle/{chunk-ILUREFWJ.js → chunk-KZN2BG3P.js} +8 -8
- package/dist/bundle/{chunk-L3JDQNBC.js → chunk-LKH3UKLO.js} +4 -4
- package/dist/bundle/{chunk-UA7C57IB.js → chunk-LZPKBN3C.js} +2 -2
- package/dist/bundle/{chunk-FI2TP6TY.js → chunk-M6VZXAJC.js} +3 -3
- package/dist/bundle/{chunk-7VSYOMEH.js → chunk-MDEPJZYJ.js} +2 -2
- package/dist/bundle/{chunk-WBWVBEHH.js → chunk-NB7EOAUZ.js} +8 -1
- package/dist/bundle/{chunk-LYRICHEK.js → chunk-NISH4UXM.js} +2 -2
- package/dist/bundle/{chunk-VD7HD25M.js → chunk-NSKMNIY6.js} +9 -9
- package/dist/bundle/chunk-PPSAWFJD.js +1293 -0
- package/dist/bundle/{chunk-7E6QSIRQ.js → chunk-Q7ICVP25.js} +1 -1
- package/dist/bundle/{chunk-BKTLAXUK.js → chunk-QFOP3KUP.js} +8 -8
- package/dist/bundle/{chunk-ORFLQGWH.js → chunk-R53XXHEI.js} +4 -4
- package/dist/bundle/{chunk-UOPP6ORQ.js → chunk-RIMPFMZE.js} +28 -179
- package/dist/bundle/{chunk-MYMBPQPQ.js → chunk-RN6RT5CB.js} +4 -4
- package/dist/bundle/{chunk-BYVDMPLX.js → chunk-RRTMPSQR.js} +2 -2
- package/dist/bundle/{chunk-R23DRW2T.js → chunk-S4ZHQMNM.js} +5 -5
- package/dist/bundle/{chunk-GCUFGDKE.js → chunk-S6JG4YUH.js} +2 -2
- package/dist/bundle/{chunk-W4KY5JF5.js → chunk-TAVI73RW.js} +2 -2
- package/dist/bundle/{chunk-KTLCQ7GC.js → chunk-TLG6ECZ2.js} +2 -2
- package/dist/bundle/{chunk-V3ZWYMXT.js → chunk-TXDR6YSF.js} +1 -1
- package/dist/bundle/{chunk-KKXF6TSS.js → chunk-TY7NDMFY.js} +1 -1
- package/dist/bundle/{chunk-YVO2YGML.js → chunk-U5RJJ2EC.js} +8 -8
- package/dist/bundle/{chunk-I4QCJZW7.js → chunk-UDSL3MUU.js} +8 -8
- package/dist/bundle/{chunk-SJYVKR54.js → chunk-V2CNGXWX.js} +37 -37
- package/dist/bundle/{chunk-L72UALL5.js → chunk-VB7FZOYX.js} +1 -1
- package/dist/bundle/{chunk-T6D34X5S.js → chunk-VZ5PPYDG.js} +1 -1
- package/dist/bundle/{chunk-FPIUFSWK.js → chunk-W5JRXIG6.js} +826 -1619
- package/dist/bundle/{chunk-ELJGALVX.js → chunk-WIHN3ELW.js} +19 -19
- package/dist/bundle/chunk-WOPVBRPV.js +29 -0
- package/dist/bundle/{chunk-4MVTSMWP.js → chunk-WUFX4TKA.js} +2 -2
- package/dist/bundle/{chunk-GKP7CKW2.js → chunk-WXJYMMEL.js} +6 -6
- package/dist/bundle/{chunk-UT3ODJMI.js → chunk-XCCU2E3Z.js} +4 -4
- package/dist/bundle/{chunk-EHULZEXQ.js → chunk-XEQQJBBO.js} +1 -1
- package/dist/bundle/{chunk-EKNP326Q.js → chunk-XUT7DSM5.js} +2 -2
- package/dist/bundle/{chunk-4EYPFFTN.js → chunk-YWDFYQOU.js} +2 -2
- package/dist/bundle/{chunk-IYUWVMGP.js → chunk-ZLUIRFJX.js} +37 -18
- package/dist/bundle/{cli-GAO7LDDA.js → cli-3NXOSENF.js} +104 -105
- package/dist/bundle/command-contract-LNSAV5LA.js +39 -0
- package/dist/bundle/{command-server-entry-BCDJP7XE.js → command-server-entry-4ZQPNUL4.js} +28 -28
- package/dist/bundle/{decode-OY2GR442.js → decode-K7U7X5EL.js} +5 -5
- package/dist/bundle/{dispatch-JWEJCBTF.js → dispatch-56FECRCU.js} +8 -8
- package/dist/bundle/{echarts-AHEPEA5P.js → echarts-O3TNDAXJ.js} +2 -2
- package/dist/bundle/{embed-RVSUV54Z.js → embed-SWLVG73O.js} +6 -6
- package/dist/bundle/{embedder-GRZXZUXR.js → embedder-EJN75BPV.js} +9 -9
- package/dist/bundle/{failure-DDCSR54L.js → failure-WDSX6H3B.js} +2 -2
- package/dist/bundle/{first-run-G3WI4DH4.js → first-run-WPGUUC4Z.js} +12 -12
- package/dist/bundle/first-screen-JMNEUQ46.js +40 -0
- package/dist/bundle/{instructions-NWQC5IP4.js → instructions-AMH5RWVJ.js} +1 -1
- package/dist/bundle/{mcp-KGWT6TGO.js → mcp-5HFPWC3W.js} +2 -2
- package/dist/bundle/meeting-combined-5TKG2RYD.js +24 -0
- package/dist/bundle/{meeting-model-I6T5HIZ5.js → meeting-model-YXXNETKC.js} +11 -11
- package/dist/bundle/{meeting-semantic-47UA5JBF.js → meeting-semantic-U7EUB3ET.js} +6 -6
- package/dist/bundle/{node-7VXN7F4B.js → node-EGMCBAO7.js} +2 -2
- package/dist/bundle/{node-sqlite-BSEON57L.js → node-sqlite-YVOGMDSP.js} +7 -7
- package/dist/bundle/{oauth-V6UAT4YD.js → oauth-2SNRBIJM.js} +7 -7
- package/dist/bundle/{open-7LVAY7ZU.js → open-ABCPY5IH.js} +5 -5
- package/dist/bundle/{openai-OIEH342H.js → openai-4D6PXJR7.js} +15 -15
- package/dist/bundle/{process-PTUCNLZ7.js → process-SGHEN6MQ.js} +1 -1
- package/dist/bundle/{program-S5WY5IZP.js → program-CBDQBZZ3.js} +1319 -1079
- package/dist/bundle/{prompt-7XWTEQ62.js → prompt-2QUK5QST.js} +5 -5
- package/dist/bundle/{recognize-HGIAJXDR.js → recognize-QMQSJRIH.js} +4 -4
- package/dist/bundle/{remote-X4SVEMHS.js → remote-U7TC2BLZ.js} +9 -9
- package/dist/bundle/{rerank-QWM3DQMU.js → rerank-5UPVXGVV.js} +7 -7
- package/dist/bundle/{serve-VVG3TXYT.js → serve-VX6GUM6J.js} +9 -9
- package/dist/bundle/{server-EHYK62BJ.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-MCKXDNYC.js → sqlite-runtime-77NKDEXN.js} +6 -6
- package/dist/bundle/{state-MYNYQJCT.js → state-X2HU6GB2.js} +6 -6
- package/dist/bundle/{store-B7O3F3QB.js → store-2U4U6KL4.js} +22 -22
- package/dist/bundle/{store-FPIU2546.js → store-3CHPHFP7.js} +30 -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/account.d.ts +3 -2
- package/dist/commands/account.d.ts.map +1 -1
- package/dist/commands/account.js +38 -77
- package/dist/commands/account.js.map +1 -1
- package/dist/commands/crm-shared.d.ts.map +1 -1
- package/dist/commands/crm-shared.js +3 -1
- package/dist/commands/crm-shared.js.map +1 -1
- package/dist/commands/session.d.ts +0 -6
- package/dist/commands/session.d.ts.map +1 -1
- package/dist/commands/session.js +9 -34
- package/dist/commands/session.js.map +1 -1
- package/dist/program.d.ts.map +1 -1
- package/dist/program.js +0 -2
- package/dist/program.js.map +1 -1
- package/dist/reasons.d.ts.map +1 -1
- package/dist/reasons.js +0 -2
- package/dist/reasons.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +4 -4
- package/skills/amo-cli/SKILL.md +6 -0
- package/dist/bundle/agent-FDNP27SW.js +0 -40
- package/dist/bundle/chunk-77FP6AWC.js +0 -1266
- package/dist/bundle/command-contract-RLIBGIDT.js +0 -39
- package/dist/bundle/first-screen-6MLCMW2U.js +0 -39
- package/dist/bundle/meeting-combined-SVTFVZNJ.js +0 -24
- package/dist/bundle/server-WRPTBVNW.js +0 -86
- package/dist/bundle/source-YISMYLBQ.js +0 -44
- package/dist/bundle/store-A7R2SZVD.js +0 -34
- package/dist/bundle/store-maintenance-command-D55FRTIK.js +0 -73
- package/dist/bundle/surface-3EX6IGHW.js +0 -72
- package/dist/bundle/writer-XDHZ54JD.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-WBWVBEHH.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-KTLCQ7GC.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.720.0_@wirecat+cli-base@0.126.1_commander@15.0.0_esbuild@0.28.2_typ_891204b7e0cfbcc49dd71e2850e8663f/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"],
|
|
@@ -22164,10 +21957,20 @@ var COMMAND_NEEDS = {
|
|
|
22164
21957
|
"chats folders create": ["createFolder", "create a folder"],
|
|
22165
21958
|
"chats folders update": ["updateFolder", "change a folder"],
|
|
22166
21959
|
"chats folders delete": ["deleteFolder", "delete a folder"],
|
|
21960
|
+
"chats links show": ["group", "read a group"],
|
|
21961
|
+
"chats links reset": ["resetInviteLink", "replace an invite link"],
|
|
21962
|
+
"chats requests list": ["joinRequests", "read join requests"],
|
|
21963
|
+
"chats requests confirm": ["answerJoinRequest", "answer join requests"],
|
|
21964
|
+
"chats requests reject": ["answerJoinRequest", "answer join requests"],
|
|
21965
|
+
"chats admins add": ["addAdmin", "make someone an admin"],
|
|
21966
|
+
"chats admins remove": ["removeAdmin", "take admin rights back"],
|
|
22167
21967
|
"contacts add": ["addContact", "add a contact"],
|
|
22168
21968
|
"contacts remove": ["removeContact", "remove a contact"],
|
|
22169
21969
|
"contacts rename": ["renameContact", "rename a contact"],
|
|
22170
21970
|
"contacts import": ["importContacts", "import contacts"],
|
|
21971
|
+
"contacts block": ["block", "block a person"],
|
|
21972
|
+
"contacts unblock": ["unblock", "unblock a person"],
|
|
21973
|
+
"messages forward": ["forward", "forward a message"],
|
|
22171
21974
|
"messages comments": ["comments", "read comments on a channel post"],
|
|
22172
21975
|
"messages pin": ["pin", "pin a message"],
|
|
22173
21976
|
"messages unpin": ["unpin", "unpin a message"],
|
|
@@ -22197,15 +22000,17 @@ var hideNever = /* @__PURE__ */ __name((messenger, group) => {
|
|
|
22197
22000
|
const at = [...path, child.name()];
|
|
22198
22001
|
const need = COMMAND_NEEDS[at.join(" ")];
|
|
22199
22002
|
if (need && messenger.never?.includes(need[0]))
|
|
22200
|
-
child
|
|
22003
|
+
hide(child);
|
|
22201
22004
|
walk(child, at);
|
|
22005
|
+
if (child.commands.length > 0 && child.commands.every(isHidden))
|
|
22006
|
+
hide(child);
|
|
22202
22007
|
}
|
|
22203
22008
|
}, "walk");
|
|
22204
22009
|
walk(group, [group.name()]);
|
|
22205
22010
|
return group;
|
|
22206
22011
|
}, "hideNever");
|
|
22207
22012
|
|
|
22208
|
-
// 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
|
|
22209
22014
|
var communicationFields = {
|
|
22210
22015
|
sources: pipe(array(strictObject({
|
|
22211
22016
|
id: pipe(string(), regex(/^[A-Za-z0-9][A-Za-z0-9._-]{0,127}$/)),
|
|
@@ -22237,7 +22042,7 @@ var communicationRequest = /* @__PURE__ */ __name((value, preparationAfter) => {
|
|
|
22237
22042
|
return { ...input, after, before };
|
|
22238
22043
|
}, "communicationRequest");
|
|
22239
22044
|
|
|
22240
|
-
// 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
|
|
22241
22046
|
var mailTurn = /* @__PURE__ */ __name((newest) => {
|
|
22242
22047
|
if (newest === null)
|
|
22243
22048
|
return null;
|
|
@@ -22246,7 +22051,7 @@ var mailTurn = /* @__PURE__ */ __name((newest) => {
|
|
|
22246
22051
|
return newest.addressed ? "owed" : null;
|
|
22247
22052
|
}, "mailTurn");
|
|
22248
22053
|
|
|
22249
|
-
// 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
|
|
22250
22055
|
var absent = /* @__PURE__ */ __name((error) => {
|
|
22251
22056
|
if (error instanceof CliError && error.code === "not_found")
|
|
22252
22057
|
return void 0;
|
|
@@ -22304,7 +22109,7 @@ var mailActivity = /* @__PURE__ */ __name(async (store, account, since, chats) =
|
|
|
22304
22109
|
};
|
|
22305
22110
|
}, "mailActivity");
|
|
22306
22111
|
|
|
22307
|
-
// 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
|
|
22308
22113
|
var DAY2 = 864e5;
|
|
22309
22114
|
var AGENDA_DEFAULTS = { unanswered: DAY2, waiting: 7 * DAY2 };
|
|
22310
22115
|
var CLAIMS = ["none", "mine", "others", "any"];
|
|
@@ -22350,9 +22155,9 @@ var agendaService = /* @__PURE__ */ __name((deps, now = Date.now) => ({
|
|
|
22350
22155
|
return [];
|
|
22351
22156
|
throw error;
|
|
22352
22157
|
}), "find");
|
|
22353
|
-
const
|
|
22158
|
+
const open6 = await find();
|
|
22354
22159
|
const tags = await taskTagFilters(store, parts.tasks);
|
|
22355
|
-
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;
|
|
22356
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 }) => ({
|
|
22357
22162
|
id: task2.id,
|
|
22358
22163
|
key: task2.key,
|
|
@@ -22394,7 +22199,7 @@ var agendaService = /* @__PURE__ */ __name((deps, now = Date.now) => ({
|
|
|
22394
22199
|
chat: chat.chatId,
|
|
22395
22200
|
message: lastMessageId
|
|
22396
22201
|
}),
|
|
22397
|
-
openTasks:
|
|
22202
|
+
openTasks: open6.filter((task2) => chatOf2(task2.source) === chat.chatId).map((task2) => task2.id)
|
|
22398
22203
|
}));
|
|
22399
22204
|
const silentFor = /* @__PURE__ */ __name((chat) => at - Date.parse(chat.lastMessageAt), "silentFor");
|
|
22400
22205
|
const shown = {
|
|
@@ -22408,7 +22213,7 @@ var agendaService = /* @__PURE__ */ __name((deps, now = Date.now) => ({
|
|
|
22408
22213
|
const withCoverage = /* @__PURE__ */ __name((list2) => list2.map(({ turn: _, ...chat }) => ({ ...chat, coverage: covered.get(chat.chatId) })), "withCoverage");
|
|
22409
22214
|
const inList = new Set((await store.tasks.categories()).map(({ name }) => name));
|
|
22410
22215
|
const unlisted = /* @__PURE__ */ new Map();
|
|
22411
|
-
for (const { category } of
|
|
22216
|
+
for (const { category } of open6)
|
|
22412
22217
|
if (category && !inList.has(category))
|
|
22413
22218
|
unlisted.set(category, (unlisted.get(category) ?? 0) + 1);
|
|
22414
22219
|
return {
|
|
@@ -22558,7 +22363,7 @@ var agendaItem = /* @__PURE__ */ __name((shown) => {
|
|
|
22558
22363
|
};
|
|
22559
22364
|
}, "agendaItem");
|
|
22560
22365
|
|
|
22561
|
-
// 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
|
|
22562
22367
|
import { writeFileSync } from "node:fs";
|
|
22563
22368
|
import { join } from "node:path";
|
|
22564
22369
|
var bytesOf = /* @__PURE__ */ __name((model) => model.files.reduce((sum2, file) => sum2 + file.bytes, 0), "bytesOf");
|
|
@@ -22583,7 +22388,7 @@ var downloadTextModel = /* @__PURE__ */ __name(async (id2, { env, progress = /*
|
|
|
22583
22388
|
`);
|
|
22584
22389
|
await nativeRuntime({ env, progress });
|
|
22585
22390
|
progress(`${model.id}: loading it once to check it works`);
|
|
22586
|
-
const { openEmbedder: openEmbedder2 } = await import("./embed-
|
|
22391
|
+
const { openEmbedder: openEmbedder2 } = await import("./embed-SWLVG73O.js");
|
|
22587
22392
|
const embedder = await openEmbedder2(model, directory2);
|
|
22588
22393
|
try {
|
|
22589
22394
|
const [vector] = await embedder.embed(["check"], "query");
|
|
@@ -22604,7 +22409,7 @@ var downloadRerankModel = /* @__PURE__ */ __name(async (id2, { env, progress = /
|
|
|
22604
22409
|
}
|
|
22605
22410
|
await nativeRuntime({ env, progress });
|
|
22606
22411
|
progress(`${model.id}: loading it once to check it works`);
|
|
22607
|
-
const { openReranker } = await import("./rerank-
|
|
22412
|
+
const { openReranker } = await import("./rerank-5UPVXGVV.js");
|
|
22608
22413
|
const reranker = await openReranker(model, directory2);
|
|
22609
22414
|
try {
|
|
22610
22415
|
await reranker.score("check", ["check"]);
|
|
@@ -22622,7 +22427,7 @@ var downloadImageModel = /* @__PURE__ */ __name(async (id2, { env, progress = /*
|
|
|
22622
22427
|
await installFiles(placedImage(model, directory2), { progress, ...bytes2 ? { bytes: bytes2 } : {} });
|
|
22623
22428
|
}
|
|
22624
22429
|
progress(`${model.id}: loading it once to check it works`);
|
|
22625
|
-
const { openPictureEmbedder } = await import("./embedder-
|
|
22430
|
+
const { openPictureEmbedder } = await import("./embedder-EJN75BPV.js");
|
|
22626
22431
|
const embedder = await openPictureEmbedder(model, directory2);
|
|
22627
22432
|
try {
|
|
22628
22433
|
const vector = await embedder.embedQuery("check");
|
|
@@ -22634,7 +22439,7 @@ var downloadImageModel = /* @__PURE__ */ __name(async (id2, { env, progress = /*
|
|
|
22634
22439
|
return { model, directory: directory2 };
|
|
22635
22440
|
}, "downloadImageModel");
|
|
22636
22441
|
|
|
22637
|
-
// 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
|
|
22638
22443
|
var RANKING_SELECTION_BYTES = 64 * 1024;
|
|
22639
22444
|
var object2 = /* @__PURE__ */ __name((value) => value !== null && typeof value === "object" && !Array.isArray(value) ? value : void 0, "object");
|
|
22640
22445
|
function invalid(message = "ranking selection is invalid \u2014 obtain a new drilldown from stats top") {
|
|
@@ -22803,7 +22608,7 @@ var readRankingSelection = /* @__PURE__ */ __name(async (store, input) => {
|
|
|
22803
22608
|
};
|
|
22804
22609
|
}, "readRankingSelection");
|
|
22805
22610
|
|
|
22806
|
-
// 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
|
|
22807
22612
|
var THREADS_PAGE = 500;
|
|
22808
22613
|
var threadsOf = /* @__PURE__ */ __name(async (store, key) => {
|
|
22809
22614
|
const account = await store.accounts.storedAccount(key).catch(() => void 0);
|
|
@@ -22878,7 +22683,7 @@ var readMail = /* @__PURE__ */ __name(async (store, locator, { before = 0, after
|
|
|
22878
22683
|
return thread.slice(Math.max(0, at - before), at + after + 1).map((hit) => hit.id === message ? { ...hit, anchor: true } : hit);
|
|
22879
22684
|
}, "readMail");
|
|
22880
22685
|
|
|
22881
|
-
// 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
|
|
22882
22687
|
var PERSON_FIELDS = /* @__PURE__ */ new Set(["from", "to", "cc", "bcc"]);
|
|
22883
22688
|
var MAIL_FIELDS = /* @__PURE__ */ new Set(["to", "cc", "bcc", "subject", "mailbox", "label", "is", "list"]);
|
|
22884
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");
|
|
@@ -22940,11 +22745,11 @@ var prepareLucene = /* @__PURE__ */ __name(async (store, account, request, messe
|
|
|
22940
22745
|
if (mailField && !scopeAccounts.some(({ provider }) => provider === MAIL))
|
|
22941
22746
|
searchError("query.unsupported-field", mailField.span, `${mailField.field}: is a mail field \u2014 memo search mail reads it`);
|
|
22942
22747
|
const globalChat = request.chat === void 0 ? void 0 : await chatAmong(messenger, chatLookup, scopeAccounts, request.chat);
|
|
22943
|
-
const
|
|
22748
|
+
const resolve6 = /* @__PURE__ */ __name(async (node) => {
|
|
22944
22749
|
if (node.kind === "boolean")
|
|
22945
22750
|
return {
|
|
22946
22751
|
...node,
|
|
22947
|
-
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) })))
|
|
22948
22753
|
};
|
|
22949
22754
|
if (isPresence(node))
|
|
22950
22755
|
return node;
|
|
@@ -22966,7 +22771,7 @@ var prepareLucene = /* @__PURE__ */ __name(async (store, account, request, messe
|
|
|
22966
22771
|
};
|
|
22967
22772
|
return node;
|
|
22968
22773
|
}, "resolve");
|
|
22969
|
-
const root = await
|
|
22774
|
+
const root = await resolve6(ast.root);
|
|
22970
22775
|
const chats = leaves.filter(({ field }) => field === "chat");
|
|
22971
22776
|
const [lone] = chats.length === 1 && chats[0] && requiresChat(ast.root, chats[0]) ? chats : [];
|
|
22972
22777
|
const loneChats = lone === void 0 || globalChat ? [] : lone.operator === "wildcard" ? await chatsMatchingIn(chatLookup, scopeAccounts, lone.value) : [await chatAmong(messenger, chatLookup, scopeAccounts, lone.value)];
|
|
@@ -23251,7 +23056,7 @@ var statsLucene = /* @__PURE__ */ __name(async (store, account, request, messeng
|
|
|
23251
23056
|
};
|
|
23252
23057
|
}, "statsLucene");
|
|
23253
23058
|
|
|
23254
|
-
// 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
|
|
23255
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");
|
|
23256
23061
|
var searchRecordOf = /* @__PURE__ */ __name((command, params) => ({
|
|
23257
23062
|
command,
|
|
@@ -23261,7 +23066,7 @@ var searchRecordOf = /* @__PURE__ */ __name((command, params) => ({
|
|
|
23261
23066
|
fieldsVersion: FIELD_VERSION
|
|
23262
23067
|
}), "searchRecordOf");
|
|
23263
23068
|
|
|
23264
|
-
// 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
|
|
23265
23070
|
function invalid2(message) {
|
|
23266
23071
|
throw new CliError("validation_error", message);
|
|
23267
23072
|
}
|
|
@@ -23555,7 +23360,7 @@ var adminStatisticsService = /* @__PURE__ */ __name((deps) => ({
|
|
|
23555
23360
|
}, "evidence")
|
|
23556
23361
|
}), "adminStatisticsService");
|
|
23557
23362
|
|
|
23558
|
-
// 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
|
|
23559
23364
|
import { setTimeout as sleep } from "node:timers/promises";
|
|
23560
23365
|
var LONGEST_WAIT_MS = 5 * 60 * 1e3;
|
|
23561
23366
|
var patiently = /* @__PURE__ */ __name(async (request, note, stop) => {
|
|
@@ -23578,10 +23383,10 @@ var patiently = /* @__PURE__ */ __name(async (request, note, stop) => {
|
|
|
23578
23383
|
}
|
|
23579
23384
|
}, "patiently");
|
|
23580
23385
|
|
|
23581
|
-
// 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
|
|
23582
23387
|
import { setTimeout as sleep2 } from "node:timers/promises";
|
|
23583
23388
|
|
|
23584
|
-
// 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
|
|
23585
23390
|
var REQUEST_MS = 400;
|
|
23586
23391
|
var estimateBackfill = /* @__PURE__ */ __name(({ ranges, held, newest, page, maxPages, pauseMs }) => {
|
|
23587
23392
|
const lowest = ranges[0];
|
|
@@ -23604,13 +23409,13 @@ var estimateBackfill = /* @__PURE__ */ __name(({ ranges, held, newest, page, max
|
|
|
23604
23409
|
};
|
|
23605
23410
|
}, "estimateBackfill");
|
|
23606
23411
|
|
|
23607
|
-
// 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
|
|
23608
23413
|
var withRecovery = /* @__PURE__ */ __name((error) => ({
|
|
23609
23414
|
...error,
|
|
23610
23415
|
retryable: typeof error.retryable === "boolean" ? error.retryable : error.code === "rate_limited" || error.status === 429
|
|
23611
23416
|
}), "withRecovery");
|
|
23612
23417
|
|
|
23613
|
-
// 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
|
|
23614
23419
|
var actionable = /* @__PURE__ */ __name((error) => {
|
|
23615
23420
|
if (isCliFailure(error))
|
|
23616
23421
|
return withRecovery({ code: error.code, message: error.message, ...error.details });
|
|
@@ -23693,7 +23498,7 @@ var mergeBatches = /* @__PURE__ */ __name((a, b) => {
|
|
|
23693
23498
|
};
|
|
23694
23499
|
}, "mergeBatches");
|
|
23695
23500
|
|
|
23696
|
-
// 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
|
|
23697
23502
|
var CONTEXT_MESSAGES2 = 3;
|
|
23698
23503
|
var CONTEXT_MINUTES = 10;
|
|
23699
23504
|
var MAX_CHARS = 1200;
|
|
@@ -23717,12 +23522,12 @@ var context = {
|
|
|
23717
23522
|
}, "describe")
|
|
23718
23523
|
};
|
|
23719
23524
|
|
|
23720
|
-
// 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
|
|
23721
23526
|
var BUILT_INS = [context];
|
|
23722
23527
|
var providers = [...BUILT_INS];
|
|
23723
23528
|
var registeredImageProviders = /* @__PURE__ */ __name(() => providers, "registeredImageProviders");
|
|
23724
23529
|
|
|
23725
|
-
// 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
|
|
23726
23531
|
var READ_PAGE = 5e3;
|
|
23727
23532
|
var CHAIN = 50;
|
|
23728
23533
|
var CONVERSATION_QUERY = {
|
|
@@ -23874,7 +23679,7 @@ var sized = /* @__PURE__ */ __name((size2) => {
|
|
|
23874
23679
|
return size2;
|
|
23875
23680
|
}, "sized");
|
|
23876
23681
|
|
|
23877
|
-
// 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
|
|
23878
23683
|
var REFRESH_BOUNDS = { maxChats: 20, maxChunks: 2e3 };
|
|
23879
23684
|
var MESSAGE_PAGE = 5e3;
|
|
23880
23685
|
var PER_SESSION = 8;
|
|
@@ -23893,7 +23698,7 @@ var embeddingTarget = /* @__PURE__ */ __name((deps, choice = chosenTextModel(dep
|
|
|
23893
23698
|
price: remote.price,
|
|
23894
23699
|
installed: true,
|
|
23895
23700
|
perBatch: PER_REQUEST * concurrency,
|
|
23896
|
-
open: /* @__PURE__ */ __name(async () => (await import("./remote-
|
|
23701
|
+
open: /* @__PURE__ */ __name(async () => (await import("./remote-U7TC2BLZ.js")).openRemote(remote, apiKey, {
|
|
23897
23702
|
concurrency,
|
|
23898
23703
|
env: deps.env ?? process.env
|
|
23899
23704
|
}), "open")
|
|
@@ -23913,7 +23718,7 @@ var embeddingTarget = /* @__PURE__ */ __name((deps, choice = chosenTextModel(dep
|
|
|
23913
23718
|
if (!isTextModelInstalled(model, directory2))
|
|
23914
23719
|
throw notDownloaded(model.id);
|
|
23915
23720
|
if (apart) {
|
|
23916
|
-
const { openProcess } = await import("./process-
|
|
23721
|
+
const { openProcess } = await import("./process-SGHEN6MQ.js");
|
|
23917
23722
|
return openProcess(model, directory2, { threads: threads ?? defaultThreads() });
|
|
23918
23723
|
}
|
|
23919
23724
|
return openEmbedder(model, directory2, { threads: threads ?? defaultThreads() });
|
|
@@ -24202,7 +24007,7 @@ var shaped = /* @__PURE__ */ __name(({ chatId, builtAt, algorithmVersion, pendin
|
|
|
24202
24007
|
return { ...one, state };
|
|
24203
24008
|
}, "shaped");
|
|
24204
24009
|
|
|
24205
|
-
// 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
|
|
24206
24011
|
var CATCH_UP_BOUNDS = { maxChunks: 500, maxMessages: 1e4, timeMs: 3e4 };
|
|
24207
24012
|
var validateCatchUpBounds = /* @__PURE__ */ __name((options2) => {
|
|
24208
24013
|
for (const [key, value, maximum] of [
|
|
@@ -24255,7 +24060,7 @@ var catchUpSearch = /* @__PURE__ */ __name(async (deps, chat, options2, signal,
|
|
|
24255
24060
|
}
|
|
24256
24061
|
}, "catchUpSearch");
|
|
24257
24062
|
|
|
24258
|
-
// 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
|
|
24259
24064
|
var pushed = /* @__PURE__ */ __name((deps, what) => {
|
|
24260
24065
|
if (deps.reads === "store") {
|
|
24261
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`);
|
|
@@ -24638,11 +24443,18 @@ var savedReplies = /* @__PURE__ */ __name(async (connection, store, account, cha
|
|
|
24638
24443
|
return 0;
|
|
24639
24444
|
const startedAt = Date.now();
|
|
24640
24445
|
const point = Number((await store.sync.syncState(account, threadsKey(chatId)))?.value);
|
|
24641
|
-
const
|
|
24642
|
-
|
|
24643
|
-
|
|
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
|
+
}
|
|
24644
24456
|
await store.sync.setSyncState(account, threadsKey(chatId), String(startedAt));
|
|
24645
|
-
return
|
|
24457
|
+
return saved;
|
|
24646
24458
|
}, "savedReplies");
|
|
24647
24459
|
var timeOfKey = /* @__PURE__ */ __name(async (store, account, chatId, key, byTime, fallback) => {
|
|
24648
24460
|
if (byTime)
|
|
@@ -24651,20 +24463,20 @@ var timeOfKey = /* @__PURE__ */ __name(async (store, account, chatId, key, byTim
|
|
|
24651
24463
|
return message?.timestamp ?? fallback;
|
|
24652
24464
|
}, "timeOfKey");
|
|
24653
24465
|
|
|
24654
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
24655
|
-
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";
|
|
24656
24468
|
|
|
24657
|
-
// 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
|
|
24658
24470
|
import { readFileSync } from "node:fs";
|
|
24659
|
-
import { dirname
|
|
24471
|
+
import { dirname, extname, join as join2 } from "node:path";
|
|
24660
24472
|
import { fileURLToPath } from "node:url";
|
|
24661
24473
|
|
|
24662
|
-
// 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
|
|
24663
24475
|
import { setImmediate as tick } from "node:timers/promises";
|
|
24664
24476
|
import { crc32 } from "node:zlib";
|
|
24665
24477
|
var import_xmldom = __toESM(require_lib(), 1);
|
|
24666
24478
|
|
|
24667
|
-
// 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
|
|
24668
24480
|
var import_chardet = __toESM(require_lib2(), 1);
|
|
24669
24481
|
var import_iconv_lite = __toESM(require_lib3(), 1);
|
|
24670
24482
|
var SAMPLE = 65536;
|
|
@@ -24766,7 +24578,7 @@ var decodeXml = /* @__PURE__ */ __name((bytes2) => {
|
|
|
24766
24578
|
return result.text;
|
|
24767
24579
|
}, "decodeXml");
|
|
24768
24580
|
|
|
24769
|
-
// 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
|
|
24770
24582
|
var MAX_PART = 10 * 1024 * 1024;
|
|
24771
24583
|
var MAX_ENTRIES = 1e3;
|
|
24772
24584
|
var decoder = new TextDecoder("utf-8", { fatal: true });
|
|
@@ -24981,13 +24793,13 @@ var elements = /* @__PURE__ */ __name((node, name, namespace) => {
|
|
|
24981
24793
|
return found;
|
|
24982
24794
|
}, "elements");
|
|
24983
24795
|
|
|
24984
|
-
// 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
|
|
24985
24797
|
var BUILT_IN = ["unpdf", "mammoth", "word-extractor", "linkedom", "defuddle/node"];
|
|
24986
24798
|
var ENGINES = [...BUILT_IN, "@napi-rs/canvas"];
|
|
24987
24799
|
var isMissing = /* @__PURE__ */ __name((error, name) => error?.code === "ERR_MODULE_NOT_FOUND" && String(error.message).includes(name), "isMissing");
|
|
24988
24800
|
var versionOf = /* @__PURE__ */ __name((name) => {
|
|
24989
24801
|
try {
|
|
24990
|
-
let directory2 =
|
|
24802
|
+
let directory2 = dirname(fileURLToPath(resolveFrom(new URL("readers/engine.js", import.meta.resolve("@wirecat/cli-core")).href, name)));
|
|
24991
24803
|
for (let depth = 0; depth < 6; depth += 1) {
|
|
24992
24804
|
try {
|
|
24993
24805
|
const manifest = JSON.parse(readFileSync(join2(directory2, "package.json"), "utf8"));
|
|
@@ -24995,7 +24807,7 @@ var versionOf = /* @__PURE__ */ __name((name) => {
|
|
|
24995
24807
|
return `${name}@${manifest.version}`;
|
|
24996
24808
|
} catch {
|
|
24997
24809
|
}
|
|
24998
|
-
directory2 =
|
|
24810
|
+
directory2 = dirname(directory2);
|
|
24999
24811
|
}
|
|
25000
24812
|
} catch {
|
|
25001
24813
|
}
|
|
@@ -25023,7 +24835,7 @@ var withEngine = /* @__PURE__ */ __name(async (load, name, read) => {
|
|
|
25023
24835
|
}
|
|
25024
24836
|
}, "withEngine");
|
|
25025
24837
|
var startsWith = /* @__PURE__ */ __name((bytes2, magic) => bytes2.length >= magic.length && [...magic].every((char, index) => bytes2[index] === char.charCodeAt(0)), "startsWith");
|
|
25026
|
-
var extensionOf = /* @__PURE__ */ __name(({ name, path }) =>
|
|
24838
|
+
var extensionOf = /* @__PURE__ */ __name(({ name, path }) => extname(name ?? path).toLowerCase(), "extensionOf");
|
|
25027
24839
|
var capped2 = /* @__PURE__ */ __name((text2) => text2.length > MAX_TEXT_CHARS ? text2.slice(0, MAX_TEXT_CHARS) : text2, "capped");
|
|
25028
24840
|
var derived = /* @__PURE__ */ __name((bytes2, extractor, read) => {
|
|
25029
24841
|
const decoded = decodeText(bytes2);
|
|
@@ -25039,7 +24851,7 @@ var derived = /* @__PURE__ */ __name((bytes2, extractor, read) => {
|
|
|
25039
24851
|
}
|
|
25040
24852
|
}, "derived");
|
|
25041
24853
|
|
|
25042
|
-
// 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
|
|
25043
24855
|
var IMAGES = /* @__PURE__ */ new Set([".jpg", ".jpeg", ".png", ".webp", ".gif", ".heic", ".tif", ".tiff", ".bmp"]);
|
|
25044
24856
|
var image = {
|
|
25045
24857
|
id: "image",
|
|
@@ -25048,7 +24860,7 @@ var image = {
|
|
|
25048
24860
|
read: /* @__PURE__ */ __name(async () => ({ status: "needs-agent" }), "read")
|
|
25049
24861
|
};
|
|
25050
24862
|
|
|
25051
|
-
// 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
|
|
25052
24864
|
var OLE = "\xD0\xCF\xE0\xA1\xB1\xE1";
|
|
25053
24865
|
var doc = {
|
|
25054
24866
|
id: "doc",
|
|
@@ -25060,7 +24872,7 @@ var doc = {
|
|
|
25060
24872
|
}), "read")
|
|
25061
24873
|
};
|
|
25062
24874
|
|
|
25063
|
-
// 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
|
|
25064
24876
|
var DOCX = "application/vnd.openxmlformats-officedocument.wordprocessingml.document";
|
|
25065
24877
|
var docx = {
|
|
25066
24878
|
id: "docx",
|
|
@@ -25073,10 +24885,10 @@ var docx = {
|
|
|
25073
24885
|
}), "read")
|
|
25074
24886
|
};
|
|
25075
24887
|
|
|
25076
|
-
// 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
|
|
25077
24889
|
var import_iconv_lite2 = __toESM(require_lib3(), 1);
|
|
25078
24890
|
|
|
25079
|
-
// 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
|
|
25080
24892
|
var NAMED = {
|
|
25081
24893
|
amp: "&",
|
|
25082
24894
|
lt: "<",
|
|
@@ -25128,7 +24940,7 @@ var decodeEntities = /* @__PURE__ */ __name((text2) => text2.replace(/&(#x[0-9a-
|
|
|
25128
24940
|
return body[1] === "x" || body[1] === "X" ? character(Number.parseInt(body.slice(2), 16), entity) : character(Number(body.slice(1)), entity);
|
|
25129
24941
|
}), "decodeEntities");
|
|
25130
24942
|
|
|
25131
|
-
// 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
|
|
25132
24944
|
var RTF_SKIPPED = /* @__PURE__ */ new Set([
|
|
25133
24945
|
"fonttbl",
|
|
25134
24946
|
"colortbl",
|
|
@@ -25269,11 +25081,11 @@ var dropHidden = /* @__PURE__ */ __name((source) => {
|
|
|
25269
25081
|
const unclosed = /* @__PURE__ */ new Set();
|
|
25270
25082
|
let out = "";
|
|
25271
25083
|
let kept2 = 0;
|
|
25272
|
-
for (const
|
|
25273
|
-
const name =
|
|
25274
|
-
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))
|
|
25275
25087
|
continue;
|
|
25276
|
-
const gt = source.indexOf(">",
|
|
25088
|
+
const gt = source.indexOf(">", open6.index + open6[0].length);
|
|
25277
25089
|
if (gt < 0)
|
|
25278
25090
|
break;
|
|
25279
25091
|
const close = HTML_DROPPED_CLOSE.get(name);
|
|
@@ -25283,7 +25095,7 @@ var dropHidden = /* @__PURE__ */ __name((source) => {
|
|
|
25283
25095
|
unclosed.add(name);
|
|
25284
25096
|
continue;
|
|
25285
25097
|
}
|
|
25286
|
-
out += source.slice(kept2,
|
|
25098
|
+
out += source.slice(kept2, open6.index);
|
|
25287
25099
|
kept2 = end.index + end[0].length;
|
|
25288
25100
|
}
|
|
25289
25101
|
return out + source.slice(kept2);
|
|
@@ -25294,7 +25106,7 @@ var htmlText = /* @__PURE__ */ __name((source) => {
|
|
|
25294
25106
|
return decodeEntities(replaceTags(blocks, /<[^>]*>/g, "")).replace(/(?<![ \t\u00a0])[ \t\u00a0]+\n/g, "\n").replace(/\n{3,}/g, "\n\n").trim();
|
|
25295
25107
|
}, "htmlText");
|
|
25296
25108
|
|
|
25297
|
-
// 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
|
|
25298
25110
|
var clean = /* @__PURE__ */ __name((value) => typeof value === "string" ? value.replace(/\s+/g, " ").trim() : "", "clean");
|
|
25299
25111
|
var namesIn = /* @__PURE__ */ __name((value) => [value].flat().map((entry) => typeof entry === "string" ? clean(entry) : clean(entry?.name)).filter(Boolean).join(", "), "namesIn");
|
|
25300
25112
|
var jsonLdNodes = /* @__PURE__ */ __name((document) => {
|
|
@@ -25350,7 +25162,7 @@ var markdownSections = /* @__PURE__ */ __name((text2) => {
|
|
|
25350
25162
|
return found.map((section, index) => ({ ...section, end: found[index + 1]?.start ?? text2.length }));
|
|
25351
25163
|
}, "markdownSections");
|
|
25352
25164
|
|
|
25353
|
-
// 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
|
|
25354
25166
|
var HTML = /* @__PURE__ */ new Set([".html", ".htm", ".xhtml"]);
|
|
25355
25167
|
var first = /* @__PURE__ */ __name((...values) => values.find((value) => typeof value === "string" && value !== ""), "first");
|
|
25356
25168
|
var loaded = /* @__PURE__ */ __name(async (load, name) => {
|
|
@@ -25388,8 +25200,8 @@ var readPage = /* @__PURE__ */ __name(async (source, load) => {
|
|
|
25388
25200
|
};
|
|
25389
25201
|
}, "readPage");
|
|
25390
25202
|
var titleOf = /* @__PURE__ */ __name((source) => {
|
|
25391
|
-
const
|
|
25392
|
-
const gt =
|
|
25203
|
+
const open6 = /<title/i.exec(source);
|
|
25204
|
+
const gt = open6 ? source.indexOf(">", open6.index + open6[0].length) : -1;
|
|
25393
25205
|
if (gt < 0)
|
|
25394
25206
|
return "";
|
|
25395
25207
|
const close = /<\/title\s*>/gi;
|
|
@@ -25421,10 +25233,10 @@ var html = {
|
|
|
25421
25233
|
}, "read")
|
|
25422
25234
|
};
|
|
25423
25235
|
|
|
25424
|
-
// 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
|
|
25425
25237
|
import { posix } from "node:path";
|
|
25426
25238
|
|
|
25427
|
-
// 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
|
|
25428
25240
|
var columnName = /* @__PURE__ */ __name((column) => {
|
|
25429
25241
|
let name = "";
|
|
25430
25242
|
for (let rest = column; rest > 0; rest = Math.floor((rest - 1) / 26))
|
|
@@ -25479,7 +25291,7 @@ var sheetText = /* @__PURE__ */ __name((sheets2, maxChars = MAX_TEXT_CHARS) => {
|
|
|
25479
25291
|
return { text: parts.join("").trim(), truncated: false };
|
|
25480
25292
|
}, "sheetText");
|
|
25481
25293
|
|
|
25482
|
-
// 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
|
|
25483
25295
|
var OFFICE = "urn:oasis:names:tc:opendocument:xmlns:office:1.0";
|
|
25484
25296
|
var TEXT = "urn:oasis:names:tc:opendocument:xmlns:text:1.0";
|
|
25485
25297
|
var TABLE = "urn:oasis:names:tc:opendocument:xmlns:table:1.0";
|
|
@@ -25879,7 +25691,7 @@ var readDocument = /* @__PURE__ */ __name(async (bytes2, kind, signal) => {
|
|
|
25879
25691
|
}
|
|
25880
25692
|
}, "readDocument");
|
|
25881
25693
|
|
|
25882
|
-
// 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
|
|
25883
25695
|
var office = {
|
|
25884
25696
|
id: "office",
|
|
25885
25697
|
version: documentExtractor("odt"),
|
|
@@ -25890,7 +25702,7 @@ var office = {
|
|
|
25890
25702
|
}, "read")
|
|
25891
25703
|
};
|
|
25892
25704
|
|
|
25893
|
-
// 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
|
|
25894
25706
|
var pdf = {
|
|
25895
25707
|
id: "pdf",
|
|
25896
25708
|
version: "unpdf",
|
|
@@ -25957,7 +25769,7 @@ var pdf = {
|
|
|
25957
25769
|
}), "read")
|
|
25958
25770
|
};
|
|
25959
25771
|
|
|
25960
|
-
// 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
|
|
25961
25773
|
var PLAIN = /* @__PURE__ */ new Set([".txt", ".md", ".markdown", ".csv", ".tsv", ".json", ".log"]);
|
|
25962
25774
|
var isPlain = /* @__PURE__ */ __name((hint) => PLAIN.has(extensionOf(hint)) || hint.mime?.startsWith("text/") || hint.mime === "application/json", "isPlain");
|
|
25963
25775
|
var readPlain = /* @__PURE__ */ __name((bytes2) => {
|
|
@@ -25977,7 +25789,7 @@ var plain = {
|
|
|
25977
25789
|
read: /* @__PURE__ */ __name(async (bytes2) => readPlain(bytes2), "read")
|
|
25978
25790
|
};
|
|
25979
25791
|
|
|
25980
|
-
// 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
|
|
25981
25793
|
var rtf = {
|
|
25982
25794
|
id: "rtf",
|
|
25983
25795
|
version: "v1",
|
|
@@ -25985,10 +25797,10 @@ var rtf = {
|
|
|
25985
25797
|
read: /* @__PURE__ */ __name(async (bytes2) => derived(bytes2, "rtf:v1", rtfText), "read")
|
|
25986
25798
|
};
|
|
25987
25799
|
|
|
25988
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
25989
|
-
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";
|
|
25990
25802
|
|
|
25991
|
-
// 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
|
|
25992
25804
|
var delimitedSpans = /* @__PURE__ */ __name((text2, delimiter, maxCells = 1e4) => {
|
|
25993
25805
|
const cells = [];
|
|
25994
25806
|
let row = 1, column = 1, start = 0, quoted = false, truncated = false;
|
|
@@ -26026,7 +25838,7 @@ var delimitedSpans = /* @__PURE__ */ __name((text2, delimiter, maxCells = 1e4) =
|
|
|
26026
25838
|
return { cells, truncated };
|
|
26027
25839
|
}, "delimitedSpans");
|
|
26028
25840
|
|
|
26029
|
-
// 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
|
|
26030
25842
|
var DELIMITED = {
|
|
26031
25843
|
".csv": ",",
|
|
26032
25844
|
".tsv": " ",
|
|
@@ -26056,7 +25868,7 @@ var sheets = {
|
|
|
26056
25868
|
column,
|
|
26057
25869
|
value: unquoted(result.text.slice(start, end))
|
|
26058
25870
|
}));
|
|
26059
|
-
const name =
|
|
25871
|
+
const name = basename(hint.name ?? hint.path, extensionOf(hint)) || "Sheet";
|
|
26060
25872
|
const { text: text2, truncated } = sheetText([{ name, cells }]);
|
|
26061
25873
|
return text2 === "" ? { status: "needs-agent", extractor } : { status: "extracted", text: text2, extractor, ...truncated || spans.truncated ? { truncated: true } : {} };
|
|
26062
25874
|
} catch {
|
|
@@ -26065,7 +25877,7 @@ var sheets = {
|
|
|
26065
25877
|
}, "read")
|
|
26066
25878
|
};
|
|
26067
25879
|
|
|
26068
|
-
// 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
|
|
26069
25881
|
var BUILT_INS2 = [office, pdf, docx, doc, rtf, html, sheets, plain, image];
|
|
26070
25882
|
var HEAD_BYTES = 1024;
|
|
26071
25883
|
var readers = [...BUILT_INS2];
|
|
@@ -26075,9 +25887,9 @@ var readWithRegistry = /* @__PURE__ */ __name(async (bytes2, hint, context2) =>
|
|
|
26075
25887
|
return reader ? reader.read(bytes2, hint, context2) : { status: "unsupported" };
|
|
26076
25888
|
}, "readWithRegistry");
|
|
26077
25889
|
|
|
26078
|
-
// 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
|
|
26079
25891
|
var importEngine = /* @__PURE__ */ __name((name) => importFrom(new URL("attachments/extract.js", import.meta.resolve("@wirecat/cli-core")).href, name), "importEngine");
|
|
26080
|
-
var extensionOf2 = /* @__PURE__ */ __name(({ name, path }) =>
|
|
25892
|
+
var extensionOf2 = /* @__PURE__ */ __name(({ name, path }) => extname2(name ?? path).toLowerCase(), "extensionOf");
|
|
26081
25893
|
var extractText = /* @__PURE__ */ __name(async (bytes2, hint, load, signal, env = process.env) => {
|
|
26082
25894
|
if (bytes2.byteLength > attachmentMaxBytes(env))
|
|
26083
25895
|
return { status: "too-large" };
|
|
@@ -26104,16 +25916,16 @@ var ENGINE_FILES = {
|
|
|
26104
25916
|
var isBuiltIn = /* @__PURE__ */ __name((engine) => BUILT_IN.includes(engine), "isBuiltIn");
|
|
26105
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");
|
|
26106
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");
|
|
26107
|
-
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) => {
|
|
26108
25920
|
try {
|
|
26109
|
-
|
|
25921
|
+
resolve6(name);
|
|
26110
25922
|
return [name, isBuiltIn(name) ? "built in" : "installed"];
|
|
26111
25923
|
} catch {
|
|
26112
25924
|
return [name, "missing"];
|
|
26113
25925
|
}
|
|
26114
25926
|
})), "engineStates");
|
|
26115
25927
|
|
|
26116
|
-
// 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
|
|
26117
25929
|
var GROUP_SETTINGS = [
|
|
26118
25930
|
"allCanPin",
|
|
26119
25931
|
"onlyAdminsAdd",
|
|
@@ -26127,7 +25939,7 @@ var ADMIN_RIGHTS = ["read", "members", "admins", "info", "pin", "link", "post",
|
|
|
26127
25939
|
var senderIsMe = /* @__PURE__ */ __name((message, account) => message.outgoing === true || message.senderId !== null && String(message.senderId) === account, "senderIsMe");
|
|
26128
25940
|
var MEDIA_KINDS = ["photo", "video", "file", "audio", "link"];
|
|
26129
25941
|
|
|
26130
|
-
// 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
|
|
26131
25943
|
var sendAsCheck = /* @__PURE__ */ __name((connection, sendAs) => {
|
|
26132
25944
|
if (sendAs === void 0) {
|
|
26133
25945
|
const saved = connection.savedSender?.bind(connection);
|
|
@@ -26152,62 +25964,7 @@ var typedSendAs = /* @__PURE__ */ __name((typed) => {
|
|
|
26152
25964
|
return sendAs;
|
|
26153
25965
|
}, "typedSendAs");
|
|
26154
25966
|
|
|
26155
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
26156
|
-
var LATIN = {
|
|
26157
|
-
\u0430: "a",
|
|
26158
|
-
\u0431: "b",
|
|
26159
|
-
\u0432: "v",
|
|
26160
|
-
\u0433: "g",
|
|
26161
|
-
\u0434: "d",
|
|
26162
|
-
\u0435: "e",
|
|
26163
|
-
\u0436: "zh",
|
|
26164
|
-
\u0437: "z",
|
|
26165
|
-
\u0438: "i",
|
|
26166
|
-
\u043A: "k",
|
|
26167
|
-
\u043B: "l",
|
|
26168
|
-
\u043C: "m",
|
|
26169
|
-
\u043D: "n",
|
|
26170
|
-
\u043E: "o",
|
|
26171
|
-
\u043F: "p",
|
|
26172
|
-
\u0440: "r",
|
|
26173
|
-
\u0441: "s",
|
|
26174
|
-
\u0442: "t",
|
|
26175
|
-
\u0443: "u",
|
|
26176
|
-
\u0444: "f",
|
|
26177
|
-
\u0445: "h",
|
|
26178
|
-
\u0446: "ts",
|
|
26179
|
-
\u0447: "ch",
|
|
26180
|
-
\u0448: "sh",
|
|
26181
|
-
\u0449: "sch",
|
|
26182
|
-
\u044A: "",
|
|
26183
|
-
\u044B: "y",
|
|
26184
|
-
\u044C: "",
|
|
26185
|
-
\u044D: "e",
|
|
26186
|
-
\u044E: "yu",
|
|
26187
|
-
\u044F: "ya"
|
|
26188
|
-
};
|
|
26189
|
-
var latinSpellings = /* @__PURE__ */ __name((word) => {
|
|
26190
|
-
if (!new RegExp("\\p{Script=Cyrillic}", "u").test(word))
|
|
26191
|
-
return [];
|
|
26192
|
-
const plain2 = [...normalize(word)].map((letter) => LATIN[letter] ?? letter).join("");
|
|
26193
|
-
return [.../* @__PURE__ */ new Set([plain2, plain2.replaceAll("ks", "x")])];
|
|
26194
|
-
}, "latinSpellings");
|
|
26195
|
-
var respelled = /* @__PURE__ */ __name(async (vocabulary, words3) => {
|
|
26196
|
-
const known2 = await vocabulary.knownTerms(words3);
|
|
26197
|
-
const found = /* @__PURE__ */ new Map();
|
|
26198
|
-
for (const word of words3.filter((one) => !known2.has(one))) {
|
|
26199
|
-
const latin = latinSpellings(word);
|
|
26200
|
-
const held = await vocabulary.knownTerms(latin);
|
|
26201
|
-
const nearLatin = await correctWords(vocabulary, latin.filter((one) => !held.has(one)));
|
|
26202
|
-
const asLatin = [.../* @__PURE__ */ new Set([...held, ...[...nearLatin.values()].flat()])];
|
|
26203
|
-
const forms = asLatin.length ? asLatin : (await correctWords(vocabulary, [word])).get(normalize(word)) ?? [];
|
|
26204
|
-
if (forms.length)
|
|
26205
|
-
found.set(word, forms);
|
|
26206
|
-
}
|
|
26207
|
-
return found;
|
|
26208
|
-
}, "respelled");
|
|
26209
|
-
|
|
26210
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.720.0_@wirecat+cli-base@0.126.1_commander@15.0.0_esbuild@0.28.2_typ_891204b7e0cfbcc49dd71e2850e8663f/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
|
|
26211
25968
|
var TOTAL_CAP = 1e4;
|
|
26212
25969
|
var totalOf = /* @__PURE__ */ __name((count3, shown, hasMore, exact = true) => {
|
|
26213
25970
|
const least = shown + (hasMore ? 1 : 0);
|
|
@@ -26218,7 +25975,7 @@ var totalOf = /* @__PURE__ */ __name((count3, shown, hasMore, exact = true) => {
|
|
|
26218
25975
|
return { value: count3, relation: exact ? "eq" : "gte" };
|
|
26219
25976
|
}, "totalOf");
|
|
26220
25977
|
|
|
26221
|
-
// 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
|
|
26222
25979
|
var WORD_FIELDS = /* @__PURE__ */ new Set(["text", "exact"]);
|
|
26223
25980
|
var fieldsOfQuery = /* @__PURE__ */ __name((root, everything) => {
|
|
26224
25981
|
let narrows = false;
|
|
@@ -26247,7 +26004,7 @@ var meaningWords = /* @__PURE__ */ __name((root) => {
|
|
|
26247
26004
|
return wanted(root).join(" ").trim();
|
|
26248
26005
|
}, "meaningWords");
|
|
26249
26006
|
|
|
26250
|
-
// 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
|
|
26251
26008
|
var COMBINED_DEFAULTS = { candidateDepth: 300, rrfK: 60, rerank: "all", chatCap: 0 };
|
|
26252
26009
|
var tokensOf = /* @__PURE__ */ __name((text2) => normalize(text2).match(/[\p{L}\p{N}\p{Co}\p{M}]+/gu) ?? [], "tokensOf");
|
|
26253
26010
|
var searchCombined = /* @__PURE__ */ __name(async (store, account, request, messenger = {}, options2 = COMBINED_DEFAULTS) => {
|
|
@@ -26448,7 +26205,7 @@ var signals = /* @__PURE__ */ __name((hit, terms, corrections, execution, mode,
|
|
|
26448
26205
|
return mode === "coverage" ? coverage2 * 4 : mode === "proximity" ? proximity : mode === "phrase" ? phrase2 : coverage2 * 4 + proximity + phrase2;
|
|
26449
26206
|
}, "signals");
|
|
26450
26207
|
|
|
26451
|
-
// 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
|
|
26452
26209
|
var MEANING_DEPTH = 100;
|
|
26453
26210
|
var RRF_K2 = 60;
|
|
26454
26211
|
var RERANK_DEPTH = 50;
|
|
@@ -26774,7 +26531,7 @@ var mixedWithReranker = /* @__PURE__ */ __name((head, scores) => {
|
|
|
26774
26531
|
})).sort((a, b) => b.mixed - a.mixed).map(({ hit }) => hit);
|
|
26775
26532
|
}, "mixedWithReranker");
|
|
26776
26533
|
|
|
26777
|
-
// 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
|
|
26778
26535
|
var LEAST_USES = 3;
|
|
26779
26536
|
var SAMPLE2 = 50;
|
|
26780
26537
|
var CAPITALISED = 0.8;
|
|
@@ -26828,7 +26585,7 @@ var queryWords2 = /* @__PURE__ */ __name((query) => {
|
|
|
26828
26585
|
}, "queryWords");
|
|
26829
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");
|
|
26830
26587
|
|
|
26831
|
-
// 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
|
|
26832
26589
|
var THREAD_BOUNDS = { maxHops: 8, maxMessages: 50, maxBytes: 65536, withinMs: 864e5 };
|
|
26833
26590
|
var bytes = /* @__PURE__ */ __name((items, links) => Buffer.byteLength(JSON.stringify({ items, links }), "utf8"), "bytes");
|
|
26834
26591
|
var threadBounds = /* @__PURE__ */ __name((options2 = {}) => {
|
|
@@ -27027,7 +26784,7 @@ var readThreadContext = /* @__PURE__ */ __name(async (store, account, chat, mess
|
|
|
27027
26784
|
return result;
|
|
27028
26785
|
}, "readThreadContext");
|
|
27029
26786
|
|
|
27030
|
-
// 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
|
|
27031
26788
|
var SEARCH_FILL_MS = 200;
|
|
27032
26789
|
var statsStore = /* @__PURE__ */ __name(async (store, account, request, messenger = {}) => {
|
|
27033
26790
|
const stop = Date.now() + SEARCH_FILL_MS;
|
|
@@ -27068,15 +26825,15 @@ var searchStore = /* @__PURE__ */ __name(async (store, account, request, messeng
|
|
|
27068
26825
|
const page = /* @__PURE__ */ __name((asked) => searchPage(store, account, { ...asked, limit: asked.limit + offset }, messenger, meaning, rerank), "page");
|
|
27069
26826
|
const all = await page(request);
|
|
27070
26827
|
const { named: named2 } = helped;
|
|
27071
|
-
const
|
|
26828
|
+
const inside = named2 && typed !== void 0 ? await page({
|
|
27072
26829
|
...request,
|
|
27073
26830
|
text: plainQuery(without(helped.text ?? typed, named2.word) || typed),
|
|
27074
26831
|
chat: named2.chatId
|
|
27075
26832
|
}) : void 0;
|
|
27076
|
-
const shown = new Set(
|
|
27077
|
-
const found =
|
|
26833
|
+
const shown = new Set(inside?.items.map(({ locator }) => locator));
|
|
26834
|
+
const found = inside ? {
|
|
27078
26835
|
...all,
|
|
27079
|
-
items: [...
|
|
26836
|
+
items: [...inside.items, ...all.items.filter(({ locator }) => !shown.has(locator))].slice(0, request.limit + offset)
|
|
27080
26837
|
} : all;
|
|
27081
26838
|
const discovery = found.query?.discovery;
|
|
27082
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) => {
|
|
@@ -27135,7 +26892,7 @@ var accountOf2 = /* @__PURE__ */ __name((hit) => {
|
|
|
27135
26892
|
}, "accountOf");
|
|
27136
26893
|
var keyOf2 = /* @__PURE__ */ __name(({ provider, account }) => `${provider}/${account}`, "keyOf");
|
|
27137
26894
|
|
|
27138
|
-
// 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
|
|
27139
26896
|
var endpointKeyName = /* @__PURE__ */ __name((baseUrl) => {
|
|
27140
26897
|
const host = new URL(baseUrl).host;
|
|
27141
26898
|
return ["openai", "anthropic"].includes(host) ? `endpoint:${host}` : host;
|
|
@@ -27168,7 +26925,7 @@ var embeddingKeys = /* @__PURE__ */ __name((app, env = process.env, keyring) =>
|
|
|
27168
26925
|
};
|
|
27169
26926
|
}, "embeddingKeys");
|
|
27170
26927
|
|
|
27171
|
-
// 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
|
|
27172
26929
|
var options = strictObject({
|
|
27173
26930
|
temperature: range(0, 2),
|
|
27174
26931
|
top_p: range(0, 1),
|
|
@@ -27235,7 +26992,7 @@ var openai = {
|
|
|
27235
26992
|
}), "complete")
|
|
27236
26993
|
};
|
|
27237
26994
|
|
|
27238
|
-
// 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
|
|
27239
26996
|
var modelGateway = /* @__PURE__ */ __name((deps) => ({
|
|
27240
26997
|
complete: /* @__PURE__ */ __name(async (request) => {
|
|
27241
26998
|
if (deps.signal?.aborted)
|
|
@@ -27250,7 +27007,7 @@ var modelGateway = /* @__PURE__ */ __name((deps) => ({
|
|
|
27250
27007
|
if (!adapter && target2.provider === "openai")
|
|
27251
27008
|
adapter = openai;
|
|
27252
27009
|
if (!adapter && target2.provider === "anthropic")
|
|
27253
|
-
adapter = (await import("./anthropic-
|
|
27010
|
+
adapter = (await import("./anthropic-47CMXBPQ.js")).anthropic;
|
|
27254
27011
|
if (!adapter)
|
|
27255
27012
|
throw new CliError("validation_error", `no model adapter for ${target2.provider}`);
|
|
27256
27013
|
if (request.images !== void 0 && adapter.images !== true)
|
|
@@ -27310,7 +27067,7 @@ var modelGateway = /* @__PURE__ */ __name((deps) => ({
|
|
|
27310
27067
|
}, "complete")
|
|
27311
27068
|
}), "modelGateway");
|
|
27312
27069
|
|
|
27313
|
-
// 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
|
|
27314
27071
|
var savedSearchItem = /* @__PURE__ */ __name((one) => ({
|
|
27315
27072
|
id: one.id,
|
|
27316
27073
|
name: one.name,
|
|
@@ -27436,7 +27193,7 @@ var searchesService = /* @__PURE__ */ __name((deps) => {
|
|
|
27436
27193
|
};
|
|
27437
27194
|
}, "searchesService");
|
|
27438
27195
|
|
|
27439
|
-
// 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
|
|
27440
27197
|
import { createHash as createHash3 } from "node:crypto";
|
|
27441
27198
|
import { existsSync } from "node:fs";
|
|
27442
27199
|
var useTextModel = /* @__PURE__ */ __name(async (id2, { env, command }) => {
|
|
@@ -27567,11 +27324,11 @@ var addCustomTextModel = /* @__PURE__ */ __name(async (id2, payload, { env, fetc
|
|
|
27567
27324
|
return { ...checked2.output, custom: true };
|
|
27568
27325
|
}, "addCustomTextModel");
|
|
27569
27326
|
|
|
27570
|
-
// 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
|
|
27571
27328
|
var DAY3 = 864e5;
|
|
27572
27329
|
var SLOTS_EVERY = 7 * DAY3;
|
|
27573
27330
|
|
|
27574
|
-
// 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
|
|
27575
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");
|
|
27576
27333
|
var plusDays = /* @__PURE__ */ __name((date, days) => {
|
|
27577
27334
|
const [year, month, day2] = date.split("-").map(Number);
|
|
@@ -27635,10 +27392,10 @@ var EVENTS_QUERY = {
|
|
|
27635
27392
|
} : field)
|
|
27636
27393
|
};
|
|
27637
27394
|
|
|
27638
|
-
// 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
|
|
27639
27396
|
var FEED_LIMITS = { maxBytes: 10 * 1024 * 1024, timeoutMs: 3e4, redirects: 5 };
|
|
27640
27397
|
|
|
27641
|
-
// 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
|
|
27642
27399
|
var EVENTS_NOTIFY_KEY = "events.notify";
|
|
27643
27400
|
var EVENTS_DELETE_SERIES_KEY = "events.delete.series";
|
|
27644
27401
|
var EVENTS_REMIND_HOOK_KEY = "events.remind.hook";
|
|
@@ -27656,7 +27413,7 @@ var CALENDAR_WRITE_DEFAULTS = {
|
|
|
27656
27413
|
[EVENTS_REMIND_HOOK_KEY]: "deny"
|
|
27657
27414
|
};
|
|
27658
27415
|
|
|
27659
|
-
// 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
|
|
27660
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");
|
|
27661
27418
|
var markdown = /* @__PURE__ */ __name((text2) => visible(text2).replaceAll("&", "&").replaceAll("<", "<").replaceAll(">", ">").replace(/[\\`*_[\]#|~]/g, "\\$&"), "markdown");
|
|
27662
27419
|
var timestamp = /* @__PURE__ */ __name((ms) => {
|
|
@@ -27725,7 +27482,7 @@ ${body}`;
|
|
|
27725
27482
|
`;
|
|
27726
27483
|
}, "formatMeetingPassage");
|
|
27727
27484
|
|
|
27728
|
-
// 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
|
|
27729
27486
|
var MEETING_PREPARATION_LIMITS = {
|
|
27730
27487
|
meetings: { min: 1, max: 20, default: 5 },
|
|
27731
27488
|
cues: { min: 1, max: 100, default: 10 },
|
|
@@ -27798,7 +27555,7 @@ var validateMeetingPreparationRequest = /* @__PURE__ */ __name((externalId, orig
|
|
|
27798
27555
|
};
|
|
27799
27556
|
}, "validateMeetingPreparationRequest");
|
|
27800
27557
|
|
|
27801
|
-
// 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
|
|
27802
27559
|
var validatePreparationCommunications = /* @__PURE__ */ __name((section, request, after) => {
|
|
27803
27560
|
const fail2 = /* @__PURE__ */ __name(() => {
|
|
27804
27561
|
throw new CliError("invalid_response", "Preparation communications returned another selection or invalid evidence");
|
|
@@ -27846,7 +27603,7 @@ var validatePreparationCommunications = /* @__PURE__ */ __name((section, request
|
|
|
27846
27603
|
}
|
|
27847
27604
|
}, "validatePreparationCommunications");
|
|
27848
27605
|
|
|
27849
|
-
// 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
|
|
27850
27607
|
var upgradePackage = /* @__PURE__ */ __name(async ({ current, command, packageName, check: check2 }, ports) => {
|
|
27851
27608
|
const installer = ports.installer();
|
|
27852
27609
|
const argv = updateCommand(installer, packageName);
|
|
@@ -27911,18 +27668,18 @@ var dayAfter = /* @__PURE__ */ __name((published) => {
|
|
|
27911
27668
|
return Number.isNaN(time) ? null : new Date(time + 24 * 60 * 60 * 1e3).toISOString();
|
|
27912
27669
|
}, "dayAfter");
|
|
27913
27670
|
|
|
27914
|
-
// 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
|
|
27915
27672
|
import { setTimeout as sleep3 } from "node:timers/promises";
|
|
27916
27673
|
|
|
27917
|
-
// 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
|
|
27918
27675
|
import { lstat } from "node:fs/promises";
|
|
27919
27676
|
|
|
27920
|
-
// 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
|
|
27921
27678
|
import { createHash as createHash5, randomUUID as randomUUID2 } from "node:crypto";
|
|
27922
|
-
import { open as
|
|
27679
|
+
import { open as open2, rename as rename2, unlink as unlink2 } from "node:fs/promises";
|
|
27923
27680
|
import { join as join4 } from "node:path";
|
|
27924
27681
|
|
|
27925
|
-
// 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
|
|
27926
27683
|
import { createHash as createHash4 } from "node:crypto";
|
|
27927
27684
|
var metadataLimit = 16384;
|
|
27928
27685
|
var partialIdentity = /* @__PURE__ */ __name((locator) => JSON.stringify([locator.provider, locator.account, locator.occurrenceId, locator.assetId]), "partialIdentity");
|
|
@@ -27982,9 +27739,9 @@ var readPartialMetadata = /* @__PURE__ */ __name(async (path, locator, maxBytes,
|
|
|
27982
27739
|
}
|
|
27983
27740
|
}, "readPartialMetadata");
|
|
27984
27741
|
|
|
27985
|
-
// 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
|
|
27986
27743
|
import { randomUUID } from "node:crypto";
|
|
27987
|
-
import { open
|
|
27744
|
+
import { open, rename, unlink } from "node:fs/promises";
|
|
27988
27745
|
import { join as join3 } from "node:path";
|
|
27989
27746
|
var partialWriter = /* @__PURE__ */ __name(async (input) => {
|
|
27990
27747
|
const { file, signal, partial } = input;
|
|
@@ -28012,7 +27769,7 @@ var partialWriter = /* @__PURE__ */ __name(async (input) => {
|
|
|
28012
27769
|
if (Buffer.byteLength(content) > metadataLimit)
|
|
28013
27770
|
throw new CliError("validation_error", "recording partial metadata exceeds its byte limit");
|
|
28014
27771
|
const temp = join3(input.root, `${input.prefix}${randomUUID()}.tmp`);
|
|
28015
|
-
const metadata = await
|
|
27772
|
+
const metadata = await open(temp, "wx", 384);
|
|
28016
27773
|
try {
|
|
28017
27774
|
try {
|
|
28018
27775
|
await metadata.writeFile(content);
|
|
@@ -28074,7 +27831,7 @@ var partialWriter = /* @__PURE__ */ __name(async (input) => {
|
|
|
28074
27831
|
};
|
|
28075
27832
|
}, "partialWriter");
|
|
28076
27833
|
|
|
28077
|
-
// 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
|
|
28078
27835
|
var NativeRecordingPartialStore = class {
|
|
28079
27836
|
static {
|
|
28080
27837
|
__name(this, "NativeRecordingPartialStore");
|
|
@@ -28140,7 +27897,7 @@ var NativeRecordingPartialStore = class {
|
|
|
28140
27897
|
file = await openOrdinaryFile(this.path, { writable: true });
|
|
28141
27898
|
} else {
|
|
28142
27899
|
const temp = join4(this.root, `${this.options.prefix}${randomUUID2()}.tmp`);
|
|
28143
|
-
file = await
|
|
27900
|
+
file = await open2(temp, "wx+", 384);
|
|
28144
27901
|
try {
|
|
28145
27902
|
await rename2(temp, this.path);
|
|
28146
27903
|
await unlink2(this.metadataPath).catch((error) => {
|
|
@@ -28181,12 +27938,12 @@ var NativeRecordingPartialStore = class {
|
|
|
28181
27938
|
}
|
|
28182
27939
|
};
|
|
28183
27940
|
|
|
28184
|
-
// 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
|
|
28185
27942
|
import { createHash as createHash6 } from "node:crypto";
|
|
28186
27943
|
import { link as link2 } from "node:fs/promises";
|
|
28187
|
-
import { basename as
|
|
27944
|
+
import { basename as basename2, dirname as dirname2, join as join6, resolve } from "node:path";
|
|
28188
27945
|
|
|
28189
|
-
// 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
|
|
28190
27947
|
import { unlink as unlink3 } from "node:fs/promises";
|
|
28191
27948
|
var verifiedPublicationFile = /* @__PURE__ */ __name(async (path, expected2, signal, writable = false) => {
|
|
28192
27949
|
signal?.throwIfAborted();
|
|
@@ -28221,9 +27978,9 @@ var commitPublication = /* @__PURE__ */ __name(async (root, partialPath, finalPa
|
|
|
28221
27978
|
signal?.throwIfAborted();
|
|
28222
27979
|
}, "commitPublication");
|
|
28223
27980
|
|
|
28224
|
-
// 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
|
|
28225
27982
|
import { randomUUID as randomUUID3 } from "node:crypto";
|
|
28226
|
-
import { open as
|
|
27983
|
+
import { open as open3, rename as rename3, unlink as unlink4 } from "node:fs/promises";
|
|
28227
27984
|
import { join as join5 } from "node:path";
|
|
28228
27985
|
var readPublicationJournal = /* @__PURE__ */ __name(async (path, codec, limit, signal) => {
|
|
28229
27986
|
signal?.throwIfAborted();
|
|
@@ -28269,7 +28026,7 @@ var writePublicationJournal = /* @__PURE__ */ __name(async (root, path, prefix,
|
|
|
28269
28026
|
throw new CliError("validation_error", "recording recovery record exceeds its metadata limit");
|
|
28270
28027
|
codec.decode(JSON.parse(content));
|
|
28271
28028
|
const temp = join5(root, `${prefix}${randomUUID3()}.tmp`);
|
|
28272
|
-
const handle = await
|
|
28029
|
+
const handle = await open3(temp, "wx", 384);
|
|
28273
28030
|
let identity;
|
|
28274
28031
|
try {
|
|
28275
28032
|
try {
|
|
@@ -28294,7 +28051,7 @@ var writePublicationJournal = /* @__PURE__ */ __name(async (root, path, prefix,
|
|
|
28294
28051
|
}
|
|
28295
28052
|
}, "writePublicationJournal");
|
|
28296
28053
|
|
|
28297
|
-
// 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
|
|
28298
28055
|
var NativeRecordingPublication = class {
|
|
28299
28056
|
static {
|
|
28300
28057
|
__name(this, "NativeRecordingPublication");
|
|
@@ -28306,7 +28063,7 @@ var NativeRecordingPublication = class {
|
|
|
28306
28063
|
options;
|
|
28307
28064
|
constructor(root, locator, options2) {
|
|
28308
28065
|
this.root = root;
|
|
28309
|
-
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)))
|
|
28310
28067
|
throw new CliError("validation_error", "invalid native recording publication options");
|
|
28311
28068
|
this.scope = partialIdentity(locator);
|
|
28312
28069
|
this.options = Object.freeze({ ...options2, codec: Object.freeze({ ...options2.codec }) });
|
|
@@ -28322,7 +28079,7 @@ var NativeRecordingPublication = class {
|
|
|
28322
28079
|
return writePublicationJournal(this.root, this.journalPath, this.options.prefix, value, this.options.codec, this.options.metadataLimit, this.options.signal);
|
|
28323
28080
|
}
|
|
28324
28081
|
validate(partialPath, expected2) {
|
|
28325
|
-
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))
|
|
28326
28083
|
throw new CliError("validation_error", "invalid recording publication evidence");
|
|
28327
28084
|
this.options.signal?.throwIfAborted();
|
|
28328
28085
|
}
|
|
@@ -28367,10 +28124,10 @@ var NativeRecordingPublication = class {
|
|
|
28367
28124
|
}
|
|
28368
28125
|
};
|
|
28369
28126
|
|
|
28370
|
-
// 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
|
|
28371
28128
|
import { createHash as createHash7 } from "node:crypto";
|
|
28372
28129
|
import { readdir } from "node:fs/promises";
|
|
28373
|
-
import { isAbsolute
|
|
28130
|
+
import { isAbsolute, join as join7, resolve as resolve2 } from "node:path";
|
|
28374
28131
|
var mediaKey = /* @__PURE__ */ __name((one) => createHash7("sha256").update(JSON.stringify([one.provider, one.account, one.chat, one.message, one.position])).digest("hex"), "mediaKey");
|
|
28375
28132
|
var mediaManifestName = /* @__PURE__ */ __name((one) => `.media-archive-${mediaKey(one)}.json`, "mediaManifestName");
|
|
28376
28133
|
var missingMediaFile = /* @__PURE__ */ __name((error) => typeof error === "object" && error !== null && "code" in error && error.code === "ENOENT", "missingMediaFile");
|
|
@@ -28390,7 +28147,7 @@ var parseMediaEntry = /* @__PURE__ */ __name((value) => {
|
|
|
28390
28147
|
"messageTime",
|
|
28391
28148
|
"mime",
|
|
28392
28149
|
"relocatedTo"
|
|
28393
|
-
].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`)
|
|
28394
28151
|
throw new CliError("validation_error", "invalid media archive manifest");
|
|
28395
28152
|
return { ...one };
|
|
28396
28153
|
}, "parseMediaEntry");
|
|
@@ -28429,7 +28186,7 @@ var readMediaManifests = /* @__PURE__ */ __name(async (root, signal) => {
|
|
|
28429
28186
|
return entries;
|
|
28430
28187
|
}, "readMediaManifests");
|
|
28431
28188
|
var verifyMediaEntry = /* @__PURE__ */ __name(async (root, one, signal) => {
|
|
28432
|
-
let location =
|
|
28189
|
+
let location = resolve2(root);
|
|
28433
28190
|
let entry = one;
|
|
28434
28191
|
const visited = /* @__PURE__ */ new Set();
|
|
28435
28192
|
while (entry.relocatedTo !== void 0) {
|
|
@@ -28437,7 +28194,7 @@ var verifyMediaEntry = /* @__PURE__ */ __name(async (root, one, signal) => {
|
|
|
28437
28194
|
if (visited.has(location) || visited.size >= 64)
|
|
28438
28195
|
throw new CliError("validation_error", "media archive relocation cycle or excessive depth");
|
|
28439
28196
|
visited.add(location);
|
|
28440
|
-
location =
|
|
28197
|
+
location = resolve2(entry.relocatedTo);
|
|
28441
28198
|
const target2 = parseMediaEntry(JSON.parse(await readBoundedUtf8File(join7(location, mediaManifestName(one)), { maxBytes: 16384 })));
|
|
28442
28199
|
if (!sameMediaCopy(one, target2))
|
|
28443
28200
|
return false;
|
|
@@ -28454,7 +28211,7 @@ var commitMediaEntry = /* @__PURE__ */ __name((root, one, beforePublish) => writ
|
|
|
28454
28211
|
beforePublish
|
|
28455
28212
|
}), "commitMediaEntry");
|
|
28456
28213
|
|
|
28457
|
-
// 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
|
|
28458
28215
|
var validator = '"media-completed-v1"';
|
|
28459
28216
|
var maximumFileBytes = 64 * 1024 * 1024 * 1024;
|
|
28460
28217
|
var archiveMediaFile = /* @__PURE__ */ __name(async (root, identity, kind, file, beforeWrite, signal, metadata = {}) => {
|
|
@@ -28555,12 +28312,12 @@ var archiveMediaFile = /* @__PURE__ */ __name(async (root, identity, kind, file,
|
|
|
28555
28312
|
return entry;
|
|
28556
28313
|
}, "archiveMediaFile");
|
|
28557
28314
|
|
|
28558
|
-
// 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
|
|
28559
28316
|
import { mkdir, realpath } from "node:fs/promises";
|
|
28560
|
-
import { join as join8, resolve as
|
|
28317
|
+
import { join as join8, resolve as resolve3 } from "node:path";
|
|
28561
28318
|
var archiveLocations = /* @__PURE__ */ __name(async (initial, signal) => {
|
|
28562
28319
|
const roots = /* @__PURE__ */ new Set();
|
|
28563
|
-
const queued = new Set(initial.map((directory2) =>
|
|
28320
|
+
const queued = new Set(initial.map((directory2) => resolve3(directory2)));
|
|
28564
28321
|
const pending = [...queued];
|
|
28565
28322
|
for (let at = 0; at < pending.length; at++) {
|
|
28566
28323
|
signal?.throwIfAborted();
|
|
@@ -28579,7 +28336,7 @@ var archiveLocations = /* @__PURE__ */ __name(async (initial, signal) => {
|
|
|
28579
28336
|
roots.add(root);
|
|
28580
28337
|
for (const entry of await readMediaManifests(root, signal))
|
|
28581
28338
|
if (entry.relocatedTo) {
|
|
28582
|
-
const location =
|
|
28339
|
+
const location = resolve3(entry.relocatedTo);
|
|
28583
28340
|
if (!queued.has(location)) {
|
|
28584
28341
|
queued.add(location);
|
|
28585
28342
|
pending.push(location);
|
|
@@ -28622,7 +28379,7 @@ var withMediaArchiveLocks = /* @__PURE__ */ __name(async (directory2, signal, ru
|
|
|
28622
28379
|
throw new CliError("validation_error", "archive locations changed during locking; run the command again");
|
|
28623
28380
|
}, "withMediaArchiveLocks");
|
|
28624
28381
|
|
|
28625
|
-
// 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
|
|
28626
28383
|
var checkMediaArchive = /* @__PURE__ */ __name((directory2, signal) => withMediaArchiveLocks(directory2, signal, async (root) => {
|
|
28627
28384
|
const entries = await readMediaManifests(root, signal);
|
|
28628
28385
|
if (!entries.length)
|
|
@@ -28765,17 +28522,17 @@ var archiveMedia = /* @__PURE__ */ __name(async (ports, options2) => {
|
|
|
28765
28522
|
}, { create: true });
|
|
28766
28523
|
}, "archiveMedia");
|
|
28767
28524
|
|
|
28768
|
-
// 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
|
|
28769
28526
|
import { realpath as realpath2, unlink as unlink5 } from "node:fs/promises";
|
|
28770
|
-
import { basename as
|
|
28527
|
+
import { basename as basename3, dirname as dirname3, join as join9, resolve as resolve4 } from "node:path";
|
|
28771
28528
|
var canonicalDestination = /* @__PURE__ */ __name(async (directory2) => {
|
|
28772
|
-
const path =
|
|
28529
|
+
const path = resolve4(directory2);
|
|
28773
28530
|
try {
|
|
28774
28531
|
return await realpath2(path);
|
|
28775
28532
|
} catch (error) {
|
|
28776
|
-
if (!missingMediaFile(error) ||
|
|
28533
|
+
if (!missingMediaFile(error) || dirname3(path) === path)
|
|
28777
28534
|
throw error;
|
|
28778
|
-
return join9(await canonicalDestination(
|
|
28535
|
+
return join9(await canonicalDestination(dirname3(path)), basename3(path));
|
|
28779
28536
|
}
|
|
28780
28537
|
}, "canonicalDestination");
|
|
28781
28538
|
var image2 = /* @__PURE__ */ __name((entry) => ["photo", "image"].includes(entry.kind) || entry.mime?.startsWith("image/"), "image");
|
|
@@ -28916,7 +28673,7 @@ var moveMediaArchive = /* @__PURE__ */ __name(async (options2) => {
|
|
|
28916
28673
|
}, { additional: [target2], createAdditional: !options2.dryRun });
|
|
28917
28674
|
}, "moveMediaArchive");
|
|
28918
28675
|
|
|
28919
|
-
// 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
|
|
28920
28677
|
var MONEY_REQUEST = "money-request";
|
|
28921
28678
|
var MONEY_DONE = "money-done";
|
|
28922
28679
|
var PROMISE = "promise";
|
|
@@ -28950,10 +28707,10 @@ var MONEY_WORDS = [
|
|
|
28950
28707
|
}
|
|
28951
28708
|
];
|
|
28952
28709
|
|
|
28953
|
-
// 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
|
|
28954
28711
|
var moneyClassesOf = /* @__PURE__ */ __name((text2) => listsHit(text2, MONEY_WORDS), "moneyClassesOf");
|
|
28955
28712
|
|
|
28956
|
-
// 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
|
|
28957
28714
|
var words2 = /* @__PURE__ */ __name((forms) => new RegExp(`(?<![\\p{L}\\p{N}])(?:${forms.join("|")})(?![\\p{L}\\p{N}])`, "iu"), "words");
|
|
28958
28715
|
var MONEY_DONE_FORMS = words2([
|
|
28959
28716
|
"\u043E\u043F\u043B\u0430\u0442\u0438\u043B[\u0430\u0438]?",
|
|
@@ -28993,7 +28750,7 @@ var PROMISE_FORMS = words2([
|
|
|
28993
28750
|
"estar\xE1 listo"
|
|
28994
28751
|
]);
|
|
28995
28752
|
|
|
28996
|
-
// 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
|
|
28997
28754
|
var EXCERPT_CHARS = 80;
|
|
28998
28755
|
var excerpt2 = /* @__PURE__ */ __name((text2) => {
|
|
28999
28756
|
const flat = text2.replace(/\s+/g, " ").trim();
|
|
@@ -29015,7 +28772,7 @@ var whoOf = /* @__PURE__ */ __name((message) => ({
|
|
|
29015
28772
|
var fromOwner = /* @__PURE__ */ __name((message) => message.outgoing === true, "fromOwner");
|
|
29016
28773
|
var day = /* @__PURE__ */ __name((at) => new Date(at).toISOString().slice(0, 10), "day");
|
|
29017
28774
|
|
|
29018
|
-
// 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
|
|
29019
28776
|
var MONEY = DEFAULT_TASK_CATEGORIES.filter((category) => category.name === "money");
|
|
29020
28777
|
var verbOf = /* @__PURE__ */ __name((text2) => {
|
|
29021
28778
|
if (MONEY_DONE_FORMS.test(text2))
|
|
@@ -29096,7 +28853,7 @@ var amounts = {
|
|
|
29096
28853
|
attention: /* @__PURE__ */ __name((items) => items.flatMap((item2) => item2.chat !== null && item2.data.state === "asked" ? [{ chat: item2.chat, weight: 2, why: "money asked" }] : []), "attention")
|
|
29097
28854
|
};
|
|
29098
28855
|
|
|
29099
|
-
// 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
|
|
29100
28857
|
var children = {
|
|
29101
28858
|
id: "children",
|
|
29102
28859
|
version: 1,
|
|
@@ -29125,7 +28882,7 @@ var children = {
|
|
|
29125
28882
|
}, "read")
|
|
29126
28883
|
};
|
|
29127
28884
|
|
|
29128
|
-
// 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
|
|
29129
28886
|
var coverage = {
|
|
29130
28887
|
id: "coverage",
|
|
29131
28888
|
version: 1,
|
|
@@ -29154,7 +28911,7 @@ var coverage = {
|
|
|
29154
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")
|
|
29155
28912
|
};
|
|
29156
28913
|
|
|
29157
|
-
// 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
|
|
29158
28915
|
var holding = /* @__PURE__ */ __name((row) => row.review !== "rejected", "holding");
|
|
29159
28916
|
var item = /* @__PURE__ */ __name((row, at, data) => ({
|
|
29160
28917
|
signal: "payments",
|
|
@@ -29204,7 +28961,7 @@ var payments = {
|
|
|
29204
28961
|
}, "read")
|
|
29205
28962
|
};
|
|
29206
28963
|
|
|
29207
|
-
// 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
|
|
29208
28965
|
var PATTERNS_PER_CHAT = 3;
|
|
29209
28966
|
var DAY4 = 864e5;
|
|
29210
28967
|
var KINDS2 = /* @__PURE__ */ new Set(["promise", "request"]);
|
|
@@ -29293,7 +29050,7 @@ var promises = {
|
|
|
29293
29050
|
}, "read")
|
|
29294
29051
|
};
|
|
29295
29052
|
|
|
29296
|
-
// 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
|
|
29297
29054
|
var PER_SIDE = 5;
|
|
29298
29055
|
var WEEK = 7 * 864e5;
|
|
29299
29056
|
var NOBODY = /* @__PURE__ */ new Set();
|
|
@@ -29304,10 +29061,10 @@ var questions2 = {
|
|
|
29304
29061
|
read: /* @__PURE__ */ __name(async (_context, chat) => {
|
|
29305
29062
|
if (!chat)
|
|
29306
29063
|
return [];
|
|
29307
|
-
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");
|
|
29308
29065
|
return [
|
|
29309
|
-
["theirs",
|
|
29310
|
-
["yours",
|
|
29066
|
+
["theirs", open6("others")],
|
|
29067
|
+
["yours", open6("owner")]
|
|
29311
29068
|
].flatMap(([side, asked]) => asked.map((question) => ({
|
|
29312
29069
|
signal: "questions",
|
|
29313
29070
|
chat: chat.ref,
|
|
@@ -29324,7 +29081,7 @@ var questions2 = {
|
|
|
29324
29081
|
}, "attention")
|
|
29325
29082
|
};
|
|
29326
29083
|
|
|
29327
|
-
// 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
|
|
29328
29085
|
var targetOf = /* @__PURE__ */ __name((message, chat, owners) => {
|
|
29329
29086
|
const byId2 = /* @__PURE__ */ __name((id2) => chat.messages.find((one) => one.id === id2), "byId");
|
|
29330
29087
|
const quoted = message.replyTo ?? (message.replyToId === void 0 ? void 0 : byId2(message.replyToId));
|
|
@@ -29392,7 +29149,7 @@ var replyNext = {
|
|
|
29392
29149
|
attention: /* @__PURE__ */ __name((items) => items.flatMap((item2) => item2.chat !== null && item2.data.next === "owner" ? [{ chat: item2.chat, weight: 2, why: "your move" }] : []), "attention")
|
|
29393
29150
|
};
|
|
29394
29151
|
|
|
29395
|
-
// 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
|
|
29396
29153
|
var escaped = /* @__PURE__ */ __name((text2) => text2.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), "escaped");
|
|
29397
29154
|
var wholeWord = /* @__PURE__ */ __name((word) => new RegExp(`(?<![\\p{L}\\p{N}])${escaped(word)}(?![\\p{L}\\p{N}])`, "u"), "wholeWord");
|
|
29398
29155
|
var matcherOf = /* @__PURE__ */ __name((query) => {
|
|
@@ -29438,7 +29195,7 @@ var topics = {
|
|
|
29438
29195
|
}, "read")
|
|
29439
29196
|
};
|
|
29440
29197
|
|
|
29441
|
-
// 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
|
|
29442
29199
|
var STATUS_SIGNALS = [
|
|
29443
29200
|
replyNext,
|
|
29444
29201
|
questions2,
|
|
@@ -29450,7 +29207,7 @@ var STATUS_SIGNALS = [
|
|
|
29450
29207
|
children
|
|
29451
29208
|
];
|
|
29452
29209
|
|
|
29453
|
-
// 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
|
|
29454
29211
|
var DAY5 = 864e5;
|
|
29455
29212
|
var STATUS_WINDOW = 300;
|
|
29456
29213
|
var STATUS_CHATS = 16;
|
|
@@ -29639,7 +29396,7 @@ var projectStatus = /* @__PURE__ */ __name(async (store, input) => {
|
|
|
29639
29396
|
};
|
|
29640
29397
|
}, "projectStatus");
|
|
29641
29398
|
|
|
29642
|
-
// 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
|
|
29643
29400
|
var accountService = /* @__PURE__ */ __name((deps) => {
|
|
29644
29401
|
const online = /* @__PURE__ */ __name(async (command) => {
|
|
29645
29402
|
if (deps.offline)
|
|
@@ -29711,7 +29468,7 @@ var accountService = /* @__PURE__ */ __name((deps) => {
|
|
|
29711
29468
|
};
|
|
29712
29469
|
}, "accountService");
|
|
29713
29470
|
|
|
29714
|
-
// 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
|
|
29715
29472
|
var sendTime = /* @__PURE__ */ __name((value, now = Date.now(), flag = "--at-time", zone) => {
|
|
29716
29473
|
const at = aheadOf(value, flag, now, {
|
|
29717
29474
|
...zone === void 0 ? {} : { zone },
|
|
@@ -29722,7 +29479,7 @@ var sendTime = /* @__PURE__ */ __name((value, now = Date.now(), flag = "--at-tim
|
|
|
29722
29479
|
return new Date(at - at % MINUTE).toISOString();
|
|
29723
29480
|
}, "sendTime");
|
|
29724
29481
|
|
|
29725
|
-
// 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
|
|
29726
29483
|
var recordMembership = /* @__PURE__ */ __name(async (deps, operationId, done2, change, fix, write) => {
|
|
29727
29484
|
try {
|
|
29728
29485
|
const held = await accountStoreIfOpen(deps);
|
|
@@ -29969,7 +29726,7 @@ var linkLimits = /* @__PURE__ */ __name(({ approval, expires, maxUses }) => {
|
|
|
29969
29726
|
return expires === void 0 ? void 0 : sendTime(expires, Date.now(), "--expire-time");
|
|
29970
29727
|
}, "linkLimits");
|
|
29971
29728
|
|
|
29972
|
-
// 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
|
|
29973
29730
|
import { createHash as createHash8, randomUUID as randomUUID4 } from "node:crypto";
|
|
29974
29731
|
var GAP_BOUNDS = { maxGaps: 5, limit: 500, timeMs: 3e4 };
|
|
29975
29732
|
var validateRepair = /* @__PURE__ */ __name((messenger, options2) => {
|
|
@@ -30106,14 +29863,14 @@ var gapsService = /* @__PURE__ */ __name((deps) => {
|
|
|
30106
29863
|
return { plan, repair };
|
|
30107
29864
|
}, "gapsService");
|
|
30108
29865
|
|
|
30109
|
-
// 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
|
|
30110
29867
|
import { createHash as createHash11 } from "node:crypto";
|
|
30111
29868
|
import { constants as constants2, mkdirSync as mkdirSync2 } from "node:fs";
|
|
30112
|
-
import { lstat as lstat5, open as
|
|
29869
|
+
import { lstat as lstat5, open as open5, readFile as readFile2, stat } from "node:fs/promises";
|
|
30113
29870
|
|
|
30114
|
-
// 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
|
|
30115
29872
|
import { lstat as lstat2, readdir as readdir2, realpath as realpath3 } from "node:fs/promises";
|
|
30116
|
-
import { basename as
|
|
29873
|
+
import { basename as basename4, join as join10, relative, sep } from "node:path";
|
|
30117
29874
|
var MAX_FILES = 1e4;
|
|
30118
29875
|
var directoryPaths = /* @__PURE__ */ __name(async (store, chat, directory2, app, env) => {
|
|
30119
29876
|
if (refusedPlace(directory2, app, env))
|
|
@@ -30137,8 +29894,8 @@ var directoryPaths = /* @__PURE__ */ __name(async (store, chat, directory2, app,
|
|
|
30137
29894
|
const canonical2 = await realpath3(path);
|
|
30138
29895
|
if (refusedPlace(canonical2, app, env))
|
|
30139
29896
|
throw new CliError("validation_error", "--from-dir cannot read credential files, the CLI's own files or the message store");
|
|
30140
|
-
const
|
|
30141
|
-
if (
|
|
29897
|
+
const inside = relative(root, canonical2);
|
|
29898
|
+
if (inside === ".." || inside.startsWith(`..${sep}`))
|
|
30142
29899
|
throw new CliError("validation_error", "a file escapes --from-dir");
|
|
30143
29900
|
files.set(name, canonical2);
|
|
30144
29901
|
}
|
|
@@ -30152,20 +29909,20 @@ var directoryPaths = /* @__PURE__ */ __name(async (store, chat, directory2, app,
|
|
|
30152
29909
|
group.push(file);
|
|
30153
29910
|
groups.set(file.messageId, group);
|
|
30154
29911
|
if (file.name)
|
|
30155
|
-
counts.set(
|
|
29912
|
+
counts.set(basename4(file.name), (counts.get(basename4(file.name)) ?? 0) + 1);
|
|
30156
29913
|
}
|
|
30157
29914
|
const choices = /* @__PURE__ */ new Map();
|
|
30158
29915
|
for (const group of groups.values()) {
|
|
30159
29916
|
group.sort((a, b) => a.position - b.position);
|
|
30160
29917
|
const candidates = group.map((file, index) => {
|
|
30161
29918
|
const prefix = `${file.messageId}-${index + 1}`;
|
|
30162
|
-
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);
|
|
30163
29920
|
});
|
|
30164
29921
|
if (candidates.some((paths) => paths.length > 1))
|
|
30165
29922
|
throw new CliError("validation_error", "more than one directory file matches a download ordinal");
|
|
30166
29923
|
const complete = candidates.every((paths) => paths.length === 1);
|
|
30167
29924
|
group.forEach((file, index) => {
|
|
30168
|
-
const own = file.name === null ? void 0 :
|
|
29925
|
+
const own = file.name === null ? void 0 : basename4(file.name);
|
|
30169
29926
|
const named2 = own && counts.get(own) === 1 ? files.get(own) : void 0;
|
|
30170
29927
|
const canonical2 = complete ? candidates[index]?.[0] : void 0;
|
|
30171
29928
|
if (named2 && canonical2 && named2 !== canonical2 || !complete && own && files.has(own) && (counts.get(own) ?? 0) > 1)
|
|
@@ -31223,7 +30980,7 @@ function imageSize(input) {
|
|
|
31223
30980
|
}
|
|
31224
30981
|
__name(imageSize, "imageSize");
|
|
31225
30982
|
|
|
31226
|
-
// 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
|
|
31227
30984
|
var MAX_PAGES = 20;
|
|
31228
30985
|
var MAX_PIXELS = 2e7;
|
|
31229
30986
|
var cancelled2 = /* @__PURE__ */ __name((signal) => {
|
|
@@ -31383,7 +31140,7 @@ var ocrPdf = /* @__PURE__ */ __name(async (bytes2, pipeline2, load, signal) => {
|
|
|
31383
31140
|
}
|
|
31384
31141
|
}, "ocrPdf");
|
|
31385
31142
|
|
|
31386
|
-
// 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
|
|
31387
31144
|
var pdfPreview = /* @__PURE__ */ __name(async (bytes2, page, signal, load = importEngine, env = process.env) => {
|
|
31388
31145
|
const limits = pdfPreviewLimits(env);
|
|
31389
31146
|
const cancelled3 = /* @__PURE__ */ __name(() => {
|
|
@@ -31460,7 +31217,7 @@ var pdfPreview = /* @__PURE__ */ __name(async (bytes2, page, signal, load = impo
|
|
|
31460
31217
|
}
|
|
31461
31218
|
}, "pdfPreview");
|
|
31462
31219
|
|
|
31463
|
-
// 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
|
|
31464
31221
|
import { spawn } from "node:child_process";
|
|
31465
31222
|
import { mkdtempSync, readFileSync as readFileSync2, rmSync, writeFileSync as writeFileSync2 } from "node:fs";
|
|
31466
31223
|
import { tmpdir } from "node:os";
|
|
@@ -31493,7 +31250,7 @@ var TIMEOUT_MS2 = 6e5;
|
|
|
31493
31250
|
var MAX_OUTPUT = 4 * 1024 * 1024;
|
|
31494
31251
|
var WITHHELD = /^(ANTHROPIC_API_KEY|OPENAI_API_KEY|CLAUDECODE|CLAUDE_CODE_SESSION_ID|CODEX_THREAD_ID|AI_AGENT|.*_MCP_CLIENT)$/;
|
|
31495
31252
|
var pictureAgentEnv = /* @__PURE__ */ __name((env) => Object.fromEntries(Object.entries(env).filter(([name]) => !WITHHELD.test(name))), "pictureAgentEnv");
|
|
31496
|
-
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) => {
|
|
31497
31254
|
const child = spawn(program, args, {
|
|
31498
31255
|
env: pictureAgentEnv(env),
|
|
31499
31256
|
cwd,
|
|
@@ -31516,7 +31273,7 @@ var run = /* @__PURE__ */ __name((program, args, { env, cwd, stdin, signal }) =>
|
|
|
31516
31273
|
child.on("error", (error) => {
|
|
31517
31274
|
clearTimeout(timer);
|
|
31518
31275
|
if (error.code === "ENOENT")
|
|
31519
|
-
|
|
31276
|
+
resolve6(void 0);
|
|
31520
31277
|
else if (error.name === "AbortError")
|
|
31521
31278
|
reject(new CliError("cancelled", `${program} was stopped`));
|
|
31522
31279
|
else
|
|
@@ -31528,7 +31285,7 @@ var run = /* @__PURE__ */ __name((program, args, { env, cwd, stdin, signal }) =>
|
|
|
31528
31285
|
return reject(new CliError("timeout", `${program} gave no answer in time, or too long an answer`, {
|
|
31529
31286
|
reason: "picture-reading.timeout"
|
|
31530
31287
|
}));
|
|
31531
|
-
|
|
31288
|
+
resolve6({ code, stdout: Buffer.concat(out).toString("utf8"), stderr: Buffer.concat(err).toString("utf8") });
|
|
31532
31289
|
});
|
|
31533
31290
|
child.stdin.on("error", () => {
|
|
31534
31291
|
});
|
|
@@ -31623,10 +31380,10 @@ Read the attached picture.`,
|
|
|
31623
31380
|
}
|
|
31624
31381
|
}, "readPictureWithAgent");
|
|
31625
31382
|
|
|
31626
|
-
// 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
|
|
31627
31384
|
import { createHash as createHash9 } from "node:crypto";
|
|
31628
31385
|
import { constants } from "node:fs";
|
|
31629
|
-
import { lstat as lstat3, open as
|
|
31386
|
+
import { lstat as lstat3, open as open4 } from "node:fs/promises";
|
|
31630
31387
|
var MAX_CHUNK_BYTES = 1024 * 1024;
|
|
31631
31388
|
var validateWindow = /* @__PURE__ */ __name(({ offsetBytes = 0, chunkBytes = 524288, ifSha256 }) => {
|
|
31632
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))
|
|
@@ -31649,7 +31406,7 @@ var retainedBytes = /* @__PURE__ */ __name(async (path, options2, captureFile =
|
|
|
31649
31406
|
throw new CliError("validation_error", `the retained attachment exceeds ${maxBytes / 1024 / 1024} MiB; configure MESSAGING_ATTACHMENT_MAX_MIB`);
|
|
31650
31407
|
if (offsetBytes > before.size)
|
|
31651
31408
|
throw new CliError("validation_error", "the byte offset is past the end of this attachment");
|
|
31652
|
-
const handle = await
|
|
31409
|
+
const handle = await open4(path, constants.O_RDONLY | (constants.O_NOFOLLOW ?? 0) | (constants.O_NONBLOCK ?? 0));
|
|
31653
31410
|
try {
|
|
31654
31411
|
const opened = await handle.stat();
|
|
31655
31412
|
if (!opened.isFile() || opened.ino !== before.ino || opened.dev !== before.dev || opened.size !== before.size)
|
|
@@ -31731,10 +31488,10 @@ var transferMime = /* @__PURE__ */ __name((head, hint, name = null) => {
|
|
|
31731
31488
|
return hint !== null && /^[a-z0-9.+-]+\/[a-z0-9.+-]+$/i.test(hint) ? hint : "application/octet-stream";
|
|
31732
31489
|
}, "transferMime");
|
|
31733
31490
|
|
|
31734
|
-
// 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
|
|
31735
31492
|
import { createWriteStream, mkdirSync } from "node:fs";
|
|
31736
31493
|
import { link as link3, rm } from "node:fs/promises";
|
|
31737
|
-
import { join as join12, resolve as
|
|
31494
|
+
import { join as join12, resolve as resolve5 } from "node:path";
|
|
31738
31495
|
import { Readable, Transform } from "node:stream";
|
|
31739
31496
|
import { pipeline } from "node:stream/promises";
|
|
31740
31497
|
var refreshedFiles = /* @__PURE__ */ __name((files) => files.flatMap(({ kind, name, position, providerRef }) => providerRef === void 0 || Object.keys(providerRef).length === 0 ? [] : [
|
|
@@ -31810,9 +31567,10 @@ var EXTENSIONS = {
|
|
|
31810
31567
|
var BY_KIND = { photo: "jpg" };
|
|
31811
31568
|
var save = /* @__PURE__ */ __name(async (file, directory2, fallbackName, { unique = false } = {}) => {
|
|
31812
31569
|
const own = safeName(file.name);
|
|
31570
|
+
const fallback = safeName(fallbackName) ?? "file";
|
|
31813
31571
|
const fileName = /* @__PURE__ */ __name(() => {
|
|
31814
31572
|
const extension = EXTENSIONS[file.mime ?? ""] ?? BY_KIND[file.kind];
|
|
31815
|
-
return own ?? (extension ? `${
|
|
31573
|
+
return own ?? (extension ? `${fallback}.${extension}` : fallback);
|
|
31816
31574
|
}, "fileName");
|
|
31817
31575
|
const partial = join12(directory2, `.${fileName()}.${process.pid}.part`);
|
|
31818
31576
|
let bytes2 = 0;
|
|
@@ -31825,9 +31583,9 @@ var save = /* @__PURE__ */ __name(async (file, directory2, fallbackName, { uniqu
|
|
|
31825
31583
|
try {
|
|
31826
31584
|
await pipeline(Readable.from(file.bytes()), counting, createWriteStream(partial, { flags: "wx", mode: 384 }));
|
|
31827
31585
|
const name = fileName();
|
|
31828
|
-
const names2 = unique && own ? [name, `${
|
|
31586
|
+
const names2 = unique && own ? [name, `${fallback}-${own}`] : [name];
|
|
31829
31587
|
for (const candidate of names2) {
|
|
31830
|
-
const path2 =
|
|
31588
|
+
const path2 = resolve5(join12(directory2, candidate));
|
|
31831
31589
|
const taken = await link3(partial, path2).then(() => false, (error) => {
|
|
31832
31590
|
if (error.code === "EEXIST")
|
|
31833
31591
|
return true;
|
|
@@ -31836,7 +31594,7 @@ var save = /* @__PURE__ */ __name(async (file, directory2, fallbackName, { uniqu
|
|
|
31836
31594
|
if (!taken)
|
|
31837
31595
|
return { kind: file.kind, path: path2, bytes: bytes2 };
|
|
31838
31596
|
}
|
|
31839
|
-
const path =
|
|
31597
|
+
const path = resolve5(join12(directory2, names2.at(-1) ?? name));
|
|
31840
31598
|
if (unique)
|
|
31841
31599
|
return { kind: file.kind, path, bytes: bytes2, existing: true };
|
|
31842
31600
|
throw new CliError("validation_error", `${path} already exists \u2014 nothing was overwritten; choose --output-dir`);
|
|
@@ -31845,7 +31603,7 @@ var save = /* @__PURE__ */ __name(async (file, directory2, fallbackName, { uniqu
|
|
|
31845
31603
|
}
|
|
31846
31604
|
}, "save");
|
|
31847
31605
|
|
|
31848
|
-
// 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
|
|
31849
31607
|
import { createHash as createHash10 } from "node:crypto";
|
|
31850
31608
|
import { lstat as lstat4, readFile } from "node:fs/promises";
|
|
31851
31609
|
import { setTimeout as sleep4 } from "node:timers/promises";
|
|
@@ -31882,18 +31640,18 @@ var pictureBytes = /* @__PURE__ */ __name(async (picture, files, read) => {
|
|
|
31882
31640
|
}, "pictureBytes");
|
|
31883
31641
|
var picturesService = /* @__PURE__ */ __name((deps) => {
|
|
31884
31642
|
let opened;
|
|
31885
|
-
const
|
|
31643
|
+
const open6 = /* @__PURE__ */ __name(async () => {
|
|
31886
31644
|
if (deps.pictureEmbedder)
|
|
31887
31645
|
return deps.pictureEmbedder();
|
|
31888
31646
|
const model2 = imageModel(DEFAULT_IMAGE_MODEL);
|
|
31889
31647
|
const directory2 = imageModelsDirectory(deps.env);
|
|
31890
31648
|
if (!isImageModelInstalled(model2, directory2))
|
|
31891
31649
|
throw new CliError("not_found", missingModel(model2.id), { reason: "model.not-downloaded", model: model2.id });
|
|
31892
|
-
const { openPictureEmbedder } = await import("./embedder-
|
|
31650
|
+
const { openPictureEmbedder } = await import("./embedder-EJN75BPV.js");
|
|
31893
31651
|
return openPictureEmbedder(model2, directory2);
|
|
31894
31652
|
}, "open");
|
|
31895
31653
|
const embedder = /* @__PURE__ */ __name(() => {
|
|
31896
|
-
opened ??=
|
|
31654
|
+
opened ??= open6().catch((error) => {
|
|
31897
31655
|
opened = void 0;
|
|
31898
31656
|
throw error;
|
|
31899
31657
|
});
|
|
@@ -32063,7 +31821,7 @@ var withPictures = /* @__PURE__ */ __name((messages, pictures) => ({
|
|
|
32063
31821
|
}, "search")
|
|
32064
31822
|
}), "withPictures");
|
|
32065
31823
|
|
|
32066
|
-
// 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
|
|
32067
31825
|
var ATTACHMENT_QUERY = {
|
|
32068
31826
|
entity: "attachment",
|
|
32069
31827
|
backend: "sql",
|
|
@@ -32092,7 +31850,7 @@ var outcome = /* @__PURE__ */ __name(async (file, path, load, signal, noFollow =
|
|
|
32092
31850
|
setting: "MESSAGING_ATTACHMENT_MAX_MIB"
|
|
32093
31851
|
})
|
|
32094
31852
|
}), "tooLarge");
|
|
32095
|
-
const size2 = await
|
|
31853
|
+
const size2 = await stat(path).then((found) => found.isFile() ? found.size : void 0, () => void 0);
|
|
32096
31854
|
if (size2 === void 0)
|
|
32097
31855
|
return { status: "missing" };
|
|
32098
31856
|
const hint = { kind: file.kind, name: file.name, mime: file.mime, path };
|
|
@@ -32101,7 +31859,7 @@ var outcome = /* @__PURE__ */ __name(async (file, path, load, signal, noFollow =
|
|
|
32101
31859
|
return { status: "unsupported" };
|
|
32102
31860
|
if (size2 > maxBytes)
|
|
32103
31861
|
return tooLarge();
|
|
32104
|
-
const handle = await
|
|
31862
|
+
const handle = await open5(path, constants2.O_RDONLY | (noFollow ? constants2.O_NOFOLLOW : 0));
|
|
32105
31863
|
let bytes2;
|
|
32106
31864
|
try {
|
|
32107
31865
|
const opened = await handle.stat();
|
|
@@ -32464,7 +32222,7 @@ var attachmentsService = /* @__PURE__ */ __name((deps) => ({
|
|
|
32464
32222
|
...file.mime === null ? {} : { mime: file.mime },
|
|
32465
32223
|
position: file.position,
|
|
32466
32224
|
bytes: /* @__PURE__ */ __name(async function* () {
|
|
32467
|
-
const handle = await
|
|
32225
|
+
const handle = await open5(path, constants2.O_RDONLY | (constants2.O_NOFOLLOW ?? 0));
|
|
32468
32226
|
yield* handle.createReadStream();
|
|
32469
32227
|
}, "bytes")
|
|
32470
32228
|
}, output, `${messageId}-${file.position + 1}`));
|
|
@@ -32534,7 +32292,7 @@ var attachmentsService = /* @__PURE__ */ __name((deps) => ({
|
|
|
32534
32292
|
}, "readPicture")
|
|
32535
32293
|
}), "attachmentsService");
|
|
32536
32294
|
|
|
32537
|
-
// 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
|
|
32538
32296
|
var chatDocumentsService = /* @__PURE__ */ __name((deps) => ({
|
|
32539
32297
|
list: /* @__PURE__ */ __name(async (chat, { limit, offset, ref }) => {
|
|
32540
32298
|
const store = await accountStore(deps);
|
|
@@ -32564,7 +32322,7 @@ var chatDocumentsService = /* @__PURE__ */ __name((deps) => ({
|
|
|
32564
32322
|
}, "list")
|
|
32565
32323
|
}), "chatDocumentsService");
|
|
32566
32324
|
|
|
32567
|
-
// 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
|
|
32568
32326
|
var observationDuration = /* @__PURE__ */ __name((text2, flag) => {
|
|
32569
32327
|
const match = /^(\d+(?:\.\d+)?)([smhdw])$/.exec(text2);
|
|
32570
32328
|
const units2 = { s: 1e3, m: 6e4, h: 36e5, d: 864e5, w: 6048e5 };
|
|
@@ -32651,7 +32409,7 @@ var isRetentionSelection = /* @__PURE__ */ __name((selection) => {
|
|
|
32651
32409
|
}
|
|
32652
32410
|
}, "isRetentionSelection");
|
|
32653
32411
|
|
|
32654
|
-
// 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
|
|
32655
32413
|
var counterFields = /* @__PURE__ */ __name((text2 = "views,reactions,comments") => {
|
|
32656
32414
|
const fields = text2.split(",").map((one) => one.trim());
|
|
32657
32415
|
if (!fields.length || fields.some((one) => !COUNTER_FIELDS.includes(one)) || new Set(fields).size !== fields.length)
|
|
@@ -32858,7 +32616,7 @@ var countersService = /* @__PURE__ */ __name((deps) => {
|
|
|
32858
32616
|
};
|
|
32859
32617
|
}, "countersService");
|
|
32860
32618
|
|
|
32861
|
-
// 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
|
|
32862
32620
|
var SYNC_KEY = "messages.sync-first";
|
|
32863
32621
|
var SYNC_BOUNDS = { maxChats: 5, timeMs: 3e4, maxMessages: 500 };
|
|
32864
32622
|
var keyOf3 = /* @__PURE__ */ __name((chat) => JSON.stringify([chat.account.provider, chat.account.account, chat.chatId]), "keyOf");
|
|
@@ -32990,7 +32748,7 @@ var withRefresh = /* @__PURE__ */ __name((found, refreshed) => ({
|
|
|
32990
32748
|
...!refreshed || refreshed.complete ? {} : { coverage: { ...found.coverage, state: "stale" } }
|
|
32991
32749
|
}), "withRefresh");
|
|
32992
32750
|
|
|
32993
|
-
// 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
|
|
32994
32752
|
var CANDIDATES = 50;
|
|
32995
32753
|
var ACROSS_CHATS = 500;
|
|
32996
32754
|
var OWN_BLOCK = 5;
|
|
@@ -33002,6 +32760,7 @@ var SHOWN_CHARS = 200;
|
|
|
33002
32760
|
var SHOWN_HEAD = 80;
|
|
33003
32761
|
var CHUNK_READ = 60;
|
|
33004
32762
|
var REPLIES_READ = 60;
|
|
32763
|
+
var BIG_CONVERSATION = 50;
|
|
33005
32764
|
var RRF_K3 = 60;
|
|
33006
32765
|
var embeddingsSearch = /* @__PURE__ */ __name((deps) => {
|
|
33007
32766
|
const command = deps.messenger.app.command;
|
|
@@ -33152,9 +32911,10 @@ var embeddingsSearch = /* @__PURE__ */ __name((deps) => {
|
|
|
33152
32911
|
const meaning = texts.map(() => []);
|
|
33153
32912
|
const own = [];
|
|
33154
32913
|
const sources = words3.sources;
|
|
32914
|
+
let vectors = [];
|
|
33155
32915
|
if (target2.installed && prepared.scopeAccounts.length && eligibility?.conversations.length !== 0) {
|
|
33156
32916
|
await withEmbedder(deps, target2, choice, {}, async (embedder) => {
|
|
33157
|
-
|
|
32917
|
+
vectors = await embedder.embed(texts, "query");
|
|
33158
32918
|
for (const [at, vector] of vectors.entries())
|
|
33159
32919
|
for (const one of prepared.scopeAccounts) {
|
|
33160
32920
|
const scope = scopeOf5(one);
|
|
@@ -33229,7 +32989,23 @@ var embeddingsSearch = /* @__PURE__ */ __name((deps) => {
|
|
|
33229
32989
|
locator: formatLocator({ ...source2, chat: hit.summary.chatId, message: hit.chunk.firstMessageId })
|
|
33230
32990
|
};
|
|
33231
32991
|
}, "located");
|
|
33232
|
-
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);
|
|
33233
33009
|
const shown = new Set(hits.map((hit) => hit.summary.id));
|
|
33234
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");
|
|
33235
33011
|
const ownHits = ownOf((hit) => !shown.has(hit.summary.id));
|
|
@@ -33290,9 +33066,9 @@ var embeddingsSearch = /* @__PURE__ */ __name((deps) => {
|
|
|
33290
33066
|
return found;
|
|
33291
33067
|
const rest = without(query, named2.word);
|
|
33292
33068
|
const { syncFirst: _, refresh: __, ...plain2 } = options2;
|
|
33293
|
-
const
|
|
33294
|
-
const shown = new Set(
|
|
33295
|
-
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);
|
|
33296
33072
|
const kept2 = new Set(hits.map(({ summary }) => summary.id));
|
|
33297
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);
|
|
33298
33074
|
const { own: _shown, ...plainFound } = found;
|
|
@@ -33377,6 +33153,9 @@ var fused = /* @__PURE__ */ __name((meaning, words3, minimumCosine) => {
|
|
|
33377
33153
|
});
|
|
33378
33154
|
return [...merged2.values()].sort((a, b) => b.fused - a.fused || (b.score ?? -2) - (a.score ?? -2)).map(({ fused: _, ...hit }) => hit);
|
|
33379
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");
|
|
33380
33159
|
var wordStems = /* @__PURE__ */ __name((text2) => [...new Set(queryWords2(text2).map((word) => word.slice(0, 5)))], "wordStems");
|
|
33381
33160
|
var shownLines = /* @__PURE__ */ __name((read, stems, ownFirst, asked, count3 = SHOWN_LINES) => {
|
|
33382
33161
|
const scored = read.map(({ text: text2, ...line3 }, at) => {
|
|
@@ -33430,13 +33209,13 @@ var meanOf = /* @__PURE__ */ __name((vectors) => {
|
|
|
33430
33209
|
return mean2.map((value) => value / length);
|
|
33431
33210
|
}, "meanOf");
|
|
33432
33211
|
|
|
33433
|
-
// 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
|
|
33434
33213
|
var embeddingsService = /* @__PURE__ */ __name((deps) => ({
|
|
33435
33214
|
...embeddingsMaintenance(deps),
|
|
33436
33215
|
...embeddingsSearch(deps)
|
|
33437
33216
|
}), "embeddingsService");
|
|
33438
33217
|
|
|
33439
|
-
// 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
|
|
33440
33219
|
var foldersService = /* @__PURE__ */ __name((deps) => {
|
|
33441
33220
|
const online = /* @__PURE__ */ __name(async (command) => {
|
|
33442
33221
|
if (deps.offline)
|
|
@@ -33577,7 +33356,7 @@ var foldersService = /* @__PURE__ */ __name((deps) => {
|
|
|
33577
33356
|
};
|
|
33578
33357
|
}, "foldersService");
|
|
33579
33358
|
|
|
33580
|
-
// 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
|
|
33581
33360
|
var REVIEW_COUNT = 500;
|
|
33582
33361
|
var mentionsService = /* @__PURE__ */ __name((deps) => {
|
|
33583
33362
|
const located = /* @__PURE__ */ __name(async () => {
|
|
@@ -33656,7 +33435,7 @@ var mentionsService = /* @__PURE__ */ __name((deps) => {
|
|
|
33656
33435
|
};
|
|
33657
33436
|
}, "mentionsService");
|
|
33658
33437
|
|
|
33659
|
-
// 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
|
|
33660
33439
|
var fileLinks = /* @__PURE__ */ __name((attachments) => hitFiles(attachments).map(({ position, kind, name }) => ({
|
|
33661
33440
|
position,
|
|
33662
33441
|
kind,
|
|
@@ -33705,7 +33484,7 @@ var validatePermalink = /* @__PURE__ */ __name((link4) => {
|
|
|
33705
33484
|
return { url: link4.url, access: link4.access, reason: link4.reason };
|
|
33706
33485
|
}, "validatePermalink");
|
|
33707
33486
|
|
|
33708
|
-
// 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
|
|
33709
33488
|
var spokenSeconds = /* @__PURE__ */ __name((seconds) => {
|
|
33710
33489
|
if (seconds % 86400 === 0 && seconds > 86400)
|
|
33711
33490
|
return `${seconds / 86400}d`;
|
|
@@ -33737,7 +33516,7 @@ var pinDurationOf = /* @__PURE__ */ __name((value, allowed, flag = "--expire-tim
|
|
|
33737
33516
|
return seconds;
|
|
33738
33517
|
}, "pinDurationOf");
|
|
33739
33518
|
|
|
33740
|
-
// 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
|
|
33741
33520
|
var meaningModel = /* @__PURE__ */ __name(async (store, env = process.env) => {
|
|
33742
33521
|
const chosen = chosenTextModel(env);
|
|
33743
33522
|
if (chosen.from === "chosen" || chosen.id !== DEFAULT_TEXT_MODEL)
|
|
@@ -33752,7 +33531,7 @@ var meaningModel = /* @__PURE__ */ __name(async (store, env = process.env) => {
|
|
|
33752
33531
|
return (counts.get(before) ?? 0) > (counts.get(now) ?? 0) ? previous.id : current.id;
|
|
33753
33532
|
}, "meaningModel");
|
|
33754
33533
|
|
|
33755
|
-
// 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
|
|
33756
33535
|
var meaningText = /* @__PURE__ */ __name((question) => {
|
|
33757
33536
|
try {
|
|
33758
33537
|
const text2 = questionLookup(question) === void 0 ? question : questionText(question);
|
|
@@ -33831,7 +33610,7 @@ var meaningLane = /* @__PURE__ */ __name((deps) => async (question, accounts, sh
|
|
|
33831
33610
|
}
|
|
33832
33611
|
}, "meaningLane");
|
|
33833
33612
|
|
|
33834
|
-
// 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
|
|
33835
33614
|
var rerankLane = /* @__PURE__ */ __name((deps) => {
|
|
33836
33615
|
const choice = deps.reranker ?? DEFAULT_RERANK_MODEL;
|
|
33837
33616
|
if (choice === "off")
|
|
@@ -33843,9 +33622,9 @@ var rerankLane = /* @__PURE__ */ __name((deps) => {
|
|
|
33843
33622
|
return { skipped: { reason: `${model.id} is not downloaded`, step: "models.download", model: model.id } };
|
|
33844
33623
|
try {
|
|
33845
33624
|
const warm = deps.embedders;
|
|
33846
|
-
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, {
|
|
33847
33626
|
threads: defaultThreads()
|
|
33848
|
-
})) : await (await import("./rerank-
|
|
33627
|
+
})) : await (await import("./rerank-5UPVXGVV.js")).openReranker(model, directory2);
|
|
33849
33628
|
return {
|
|
33850
33629
|
model: model.id,
|
|
33851
33630
|
score: /* @__PURE__ */ __name((question, passages) => reranker.score(plainWords(question), passages), "score"),
|
|
@@ -33865,7 +33644,7 @@ var rerankLane = /* @__PURE__ */ __name((deps) => {
|
|
|
33865
33644
|
};
|
|
33866
33645
|
}, "rerankLane");
|
|
33867
33646
|
|
|
33868
|
-
// 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
|
|
33869
33648
|
var DAY6 = 864e5;
|
|
33870
33649
|
var SPAN = { start: 0, end: 0 };
|
|
33871
33650
|
var phrase = /* @__PURE__ */ __name((source) => new RegExp(`(?<![\\p{L}\\p{N}])(?:${source})(?![\\p{L}\\p{N}])`, "giu"), "phrase");
|
|
@@ -33990,17 +33769,17 @@ var questionPeriod = /* @__PURE__ */ __name((text2, now, zone) => {
|
|
|
33990
33769
|
};
|
|
33991
33770
|
}, "questionPeriod");
|
|
33992
33771
|
|
|
33993
|
-
// 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
|
|
33994
33773
|
var openPictureEmbedderFor = /* @__PURE__ */ __name(async ({ env, command } = {}) => {
|
|
33995
33774
|
const model = imageModel(DEFAULT_IMAGE_MODEL);
|
|
33996
33775
|
const directory2 = imageModelsDirectory(env);
|
|
33997
33776
|
if (!isImageModelInstalled(model, directory2))
|
|
33998
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 });
|
|
33999
|
-
const { openPictureEmbedder } = await import("./embedder-
|
|
33778
|
+
const { openPictureEmbedder } = await import("./embedder-EJN75BPV.js");
|
|
34000
33779
|
return openPictureEmbedder(model, directory2);
|
|
34001
33780
|
}, "openPictureEmbedderFor");
|
|
34002
33781
|
|
|
34003
|
-
// 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
|
|
34004
33783
|
var documentSource = /* @__PURE__ */ __name((note, accounts, profiles, file) => {
|
|
34005
33784
|
const metadata = note.frontMatter;
|
|
34006
33785
|
const account = accounts.find(({ id: id2 }) => String(id2) === note.folderId);
|
|
@@ -34022,7 +33801,7 @@ var documentSource = /* @__PURE__ */ __name((note, accounts, profiles, file) =>
|
|
|
34022
33801
|
};
|
|
34023
33802
|
}, "documentSource");
|
|
34024
33803
|
|
|
34025
|
-
// 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
|
|
34026
33805
|
var SECTION2 = "enrichment";
|
|
34027
33806
|
var ENRICHMENT_PROVIDERS = ["openai", "anthropic"];
|
|
34028
33807
|
var DEFAULT_BASE_URLS = {
|
|
@@ -34097,7 +33876,7 @@ var costOf = /* @__PURE__ */ __name((usage, setting) => {
|
|
|
34097
33876
|
return price ? Math.round((usage.input * price.input + usage.output * price.output) * 1e6) / 1e6 : null;
|
|
34098
33877
|
}, "costOf");
|
|
34099
33878
|
|
|
34100
|
-
// 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
|
|
34101
33880
|
var ENRICH_PER_RUN = 600;
|
|
34102
33881
|
var MAX_LINE = 400;
|
|
34103
33882
|
var line2 = pipe(unknown(), transform((value) => typeof value === "string" ? value.replace(/\s+/g, " ").trim().slice(0, MAX_LINE) : ""));
|
|
@@ -34173,7 +33952,7 @@ var enrichmentState = /* @__PURE__ */ __name(async (store, env, estimateFor, key
|
|
|
34173
33952
|
};
|
|
34174
33953
|
}, "enrichmentState");
|
|
34175
33954
|
|
|
34176
|
-
// 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
|
|
34177
33956
|
var plainQueryWords = /* @__PURE__ */ __name((query) => {
|
|
34178
33957
|
let root;
|
|
34179
33958
|
try {
|
|
@@ -34200,15 +33979,15 @@ var titleTiers = /* @__PURE__ */ __name((hits, words3) => {
|
|
|
34200
33979
|
return [...hits].sort((a, b) => rank(a) - rank(b));
|
|
34201
33980
|
}, "titleTiers");
|
|
34202
33981
|
|
|
34203
|
-
// 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
|
|
34204
33983
|
var storeQuery = /* @__PURE__ */ __name(async (store, text2, { exact, timezone } = {}) => resolvedQuery(store, parsedQuery(text2, exact), timezone), "storeQuery");
|
|
34205
33984
|
var parsedQuery = /* @__PURE__ */ __name((text2, exact) => validateFields(parseLucene(text2, { ...SEARCH_QUERY, defaultField: exact ? "exact" : "text" })).root, "parsedQuery");
|
|
34206
33985
|
var resolvedQuery = /* @__PURE__ */ __name(async (store, root, timezone) => {
|
|
34207
33986
|
const ast = { root };
|
|
34208
33987
|
const zone = timezoneOf(timezone);
|
|
34209
|
-
const
|
|
33988
|
+
const resolve6 = /* @__PURE__ */ __name((node) => {
|
|
34210
33989
|
if (node.kind === "boolean")
|
|
34211
|
-
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) })) };
|
|
34212
33991
|
if (node.field !== "date")
|
|
34213
33992
|
return node;
|
|
34214
33993
|
return {
|
|
@@ -34222,7 +34001,7 @@ var resolvedQuery = /* @__PURE__ */ __name(async (store, root, timezone) => {
|
|
|
34222
34001
|
if (stemmers2 === null)
|
|
34223
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" });
|
|
34224
34003
|
return {
|
|
34225
|
-
root:
|
|
34004
|
+
root: resolve6(ast.root),
|
|
34226
34005
|
...hasStems(ast.root) ? { stemmer: createStemmer(stemmers2 ?? DEFAULT_STEMMERS) } : {}
|
|
34227
34006
|
};
|
|
34228
34007
|
}, "resolvedQuery");
|
|
@@ -34242,6 +34021,7 @@ var searchNotesQuery = /* @__PURE__ */ __name(async (store, request) => {
|
|
|
34242
34021
|
...stemmer ? { stemmer } : {}
|
|
34243
34022
|
});
|
|
34244
34023
|
}, "searchNotesQuery");
|
|
34024
|
+
var NOTE_BATCH = 8;
|
|
34245
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");
|
|
34246
34026
|
var localModel = /* @__PURE__ */ __name((choice, env, command) => {
|
|
34247
34027
|
const model = textModel(choice ?? chosenTextModel(env).id, env);
|
|
@@ -34263,6 +34043,45 @@ var withLocal = /* @__PURE__ */ __name(async (model, directory2, threads, work,
|
|
|
34263
34043
|
await embedder.close();
|
|
34264
34044
|
}
|
|
34265
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");
|
|
34266
34085
|
var nearestNotes = /* @__PURE__ */ __name(async (store, query, options2) => {
|
|
34267
34086
|
const { key, vector, floor } = await queryVector(store, query, options2);
|
|
34268
34087
|
const nearest2 = await store.notes.nearest(key, vector, {
|
|
@@ -34628,7 +34447,31 @@ var searchNotesOf = /* @__PURE__ */ __name(async (store, account, text2, { accou
|
|
|
34628
34447
|
};
|
|
34629
34448
|
}, "searchNotesOf");
|
|
34630
34449
|
|
|
34631
|
-
// 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
|
|
34632
34475
|
var MAX_EVENTS_OFFSET = 1e3;
|
|
34633
34476
|
var iso3 = /* @__PURE__ */ __name((at) => at === null ? null : new Date(at).toISOString(), "iso");
|
|
34634
34477
|
var accountIdsOf = /* @__PURE__ */ __name(async (store, accounts) => {
|
|
@@ -34746,7 +34589,7 @@ var searchEvents = /* @__PURE__ */ __name(async (store, query, { limit = 20, off
|
|
|
34746
34589
|
};
|
|
34747
34590
|
}, "searchEvents");
|
|
34748
34591
|
|
|
34749
|
-
// 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
|
|
34750
34593
|
var OWN_BUSINESS = { provider: "business", account: INTERNAL_NOTES };
|
|
34751
34594
|
var BUSINESS_WORDS_ONLY = "invoices, payments, orders, contracts, subscriptions, products and wallets are found by the words of their numbers and names only";
|
|
34752
34595
|
var placeOf = /* @__PURE__ */ __name(({ source, imported }) => source ?? (imported === void 0 ? OWN_BUSINESS : { provider: imported, account: "" }), "placeOf");
|
|
@@ -34776,7 +34619,7 @@ var searchBusiness = /* @__PURE__ */ __name(async (store, { words: words3, anyWo
|
|
|
34776
34619
|
};
|
|
34777
34620
|
}, "searchBusiness");
|
|
34778
34621
|
|
|
34779
|
-
// 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
|
|
34780
34623
|
var MOST_HITS_PER_MEETING = 3;
|
|
34781
34624
|
var PAGE_ROWS = 200;
|
|
34782
34625
|
var MOST_PAGES = 25;
|
|
@@ -35004,7 +34847,186 @@ var titleItem = /* @__PURE__ */ __name((account, meeting, query) => ({
|
|
|
35004
34847
|
foundBy: ["title"]
|
|
35005
34848
|
}), "titleItem");
|
|
35006
34849
|
|
|
35007
|
-
// 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
|
|
35008
35030
|
var SECTION3 = "search_harder";
|
|
35009
35031
|
var HARDER_MODELS = {
|
|
35010
35032
|
anthropic: "claude-haiku-5-5",
|
|
@@ -35250,8 +35272,17 @@ var reorderHarder = /* @__PURE__ */ __name(async (question, hits, { laterPage, a
|
|
|
35250
35272
|
};
|
|
35251
35273
|
}, "reorderHarder");
|
|
35252
35274
|
|
|
35253
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
35254
|
-
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
|
+
];
|
|
35255
35286
|
var refusal = /* @__PURE__ */ __name((error, text2) => {
|
|
35256
35287
|
const { reason, span } = error.details ?? {};
|
|
35257
35288
|
const why = typeof reason === "string" ? reason : void 0;
|
|
@@ -35265,17 +35296,6 @@ var filtersBeside = /* @__PURE__ */ __name((text2) => {
|
|
|
35265
35296
|
const top = root.kind === "boolean" ? root.clauses : [{ node: root, occur: "must" }];
|
|
35266
35297
|
return top.every(({ node, occur }) => occur !== "must_not" && followable(node, occur === "must")) ? planQuestion(text2).scope : void 0;
|
|
35267
35298
|
}, "filtersBeside");
|
|
35268
|
-
var titleWords2 = /* @__PURE__ */ __name((text2, refused = "deals and leads are found by the words of their title, company, contacts and activities only") => {
|
|
35269
|
-
const { root } = parseLucene(text2, SEARCH_QUERY);
|
|
35270
|
-
const clauses = root.kind === "boolean" ? root.clauses : [{ node: root, occur: "must" }];
|
|
35271
|
-
const words3 = clauses.map(({ node, occur }) => occur !== "must_not" && node.kind === "predicate" && (node.field === "text" || node.field === "title") && (node.operator === "term" || node.operator === "phrase") ? (
|
|
35272
|
-
// A title holds "invoice", not the question mark of "invoice?".
|
|
35273
|
-
node.value.replace(/\?+$/u, "") || node.value
|
|
35274
|
-
) : (() => {
|
|
35275
|
-
throw new CliError("validation_error", refused);
|
|
35276
|
-
})());
|
|
35277
|
-
return { words: words3, anyWord: clauses.length > 1 && clauses.every(({ occur }) => occur === "should") };
|
|
35278
|
-
}, "titleWords");
|
|
35279
35299
|
var strictWords = /* @__PURE__ */ __name((text2) => {
|
|
35280
35300
|
try {
|
|
35281
35301
|
const { words: words3, anyWord } = titleWords2(text2);
|
|
@@ -35289,14 +35309,21 @@ var strictWords = /* @__PURE__ */ __name((text2) => {
|
|
|
35289
35309
|
}, "strictWords");
|
|
35290
35310
|
var accountKeyOf = /* @__PURE__ */ __name(({ provider, account }) => `${provider}\0${account}`, "accountKeyOf");
|
|
35291
35311
|
var sourceScope = /* @__PURE__ */ __name(async (store, account, source, asked, messenger) => {
|
|
35292
|
-
const
|
|
35312
|
+
const context2 = await listContextOf(store, account, messenger.app);
|
|
35313
|
+
const entries = entriesOfList(source, context2);
|
|
35293
35314
|
const imported = asked.includes("business") ? new Set((await store.business.accounts()).map(accountKeyOf)) : /* @__PURE__ */ new Set();
|
|
35294
35315
|
const holdsBusiness = /* @__PURE__ */ __name((one) => imported.has(accountKeyOf(one)), "holdsBusiness");
|
|
35295
35316
|
const holdsDocuments = /* @__PURE__ */ __name((one) => asked.includes("notes") && holdsKind(one.provider, "documents"), "holdsDocuments");
|
|
35296
35317
|
const { skipped } = fitting(entries, asked.filter((one) => one !== "business"), "search all", (kind) => `--only leaves ${kind} out`, (one) => holdsBusiness(one) || holdsDocuments(one));
|
|
35297
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");
|
|
35298
35325
|
const named2 = /* @__PURE__ */ __name((resource) => [
|
|
35299
|
-
...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()
|
|
35300
35327
|
], "named");
|
|
35301
35328
|
const scope = Object.fromEntries(asked.map((resource) => [resource, named2(resource)]));
|
|
35302
35329
|
const only = asked.filter((resource) => scope[resource]?.length);
|
|
@@ -35312,6 +35339,7 @@ var copyViewers = /* @__PURE__ */ __name(async (store) => {
|
|
|
35312
35339
|
}
|
|
35313
35340
|
return viewers;
|
|
35314
35341
|
}, "copyViewers");
|
|
35342
|
+
var trackerAccounts = /* @__PURE__ */ __name(async (store) => (await store.accounts.accounts()).filter(({ provider }) => holdsKind(provider, "tracker")), "trackerAccounts");
|
|
35315
35343
|
var crmAccounts = /* @__PURE__ */ __name(async (store) => (await store.accounts.accounts()).filter(({ provider }) => holdsKind(provider, "crm")), "crmAccounts");
|
|
35316
35344
|
var searchAll = /* @__PURE__ */ __name(async (store, account, asked, messenger = {}, searchMessages = (query) => searchStore(store, account, query, messenger), meaning) => {
|
|
35317
35345
|
if (!asked.text.trim())
|
|
@@ -35333,6 +35361,8 @@ var searchAll = /* @__PURE__ */ __name(async (store, account, asked, messenger =
|
|
|
35333
35361
|
let hasMore = false;
|
|
35334
35362
|
let notes;
|
|
35335
35363
|
let events;
|
|
35364
|
+
let tracker;
|
|
35365
|
+
let crm;
|
|
35336
35366
|
const by = {};
|
|
35337
35367
|
let server;
|
|
35338
35368
|
const discover = !request.exact && questionLookup(request.text) !== void 0;
|
|
@@ -35501,7 +35531,7 @@ var searchAll = /* @__PURE__ */ __name(async (store, account, asked, messenger =
|
|
|
35501
35531
|
})));
|
|
35502
35532
|
accounts.push(...read.map(({ provider, account: account2 }) => ({ resource, provider, account: account2 })));
|
|
35503
35533
|
} else if (resource === "crm") {
|
|
35504
|
-
const { words: words3, anyWord } = titleWords2(request.text);
|
|
35534
|
+
const { words: words3, anyWord } = contentWords(titleWords2(request.text), discover);
|
|
35505
35535
|
const chosen2 = scope?.crm;
|
|
35506
35536
|
const viewers = request.crmViewers ?? await copyViewers(store);
|
|
35507
35537
|
const found = await store.deals.find({
|
|
@@ -35515,7 +35545,7 @@ var searchAll = /* @__PURE__ */ __name(async (store, account, asked, messenger =
|
|
|
35515
35545
|
});
|
|
35516
35546
|
hasMore ||= found.hasMore;
|
|
35517
35547
|
const titled = /(?:^|[\s(+])title:/u.test(request.text);
|
|
35518
|
-
|
|
35548
|
+
const byWords = found.items.filter((deal) => !titled || deal.matched.includes("title")).map((deal) => ({
|
|
35519
35549
|
kind: deal.kind,
|
|
35520
35550
|
ref: deal.ref,
|
|
35521
35551
|
provider: deal.account?.provider ?? "crm",
|
|
@@ -35525,7 +35555,56 @@ var searchAll = /* @__PURE__ */ __name(async (store, account, asked, messenger =
|
|
|
35525
35555
|
text: deal.summary,
|
|
35526
35556
|
foundBy: deal.matched.includes("title") ? ["title"] : ["words"],
|
|
35527
35557
|
...deal.corrections ? { match: "corrected", corrections: deal.corrections } : {}
|
|
35528
|
-
}))
|
|
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
|
+
}
|
|
35529
35608
|
if (request.crmFiles !== false) {
|
|
35530
35609
|
const files = await store.crmFiles.find({
|
|
35531
35610
|
words: words3,
|
|
@@ -35550,8 +35629,28 @@ var searchAll = /* @__PURE__ */ __name(async (store, account, asked, messenger =
|
|
|
35550
35629
|
const read = chosen2 ?? [...await crmAccounts(store), { provider: "crm", account: INTERNAL_NOTES }];
|
|
35551
35630
|
for (const { provider, account: account2 } of read)
|
|
35552
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 });
|
|
35553
35652
|
} else if (resource === "business") {
|
|
35554
|
-
const { words: words3, anyWord } = titleWords2(request.text, BUSINESS_WORDS_ONLY);
|
|
35653
|
+
const { words: words3, anyWord } = contentWords(titleWords2(request.text, BUSINESS_WORDS_ONLY), discover);
|
|
35555
35654
|
const found = await searchBusiness(store, {
|
|
35556
35655
|
words: words3,
|
|
35557
35656
|
anyWord: anyWord || discover,
|
|
@@ -35630,6 +35729,8 @@ var searchAll = /* @__PURE__ */ __name(async (store, account, asked, messenger =
|
|
|
35630
35729
|
skipped,
|
|
35631
35730
|
...notes === void 0 ? {} : { notes },
|
|
35632
35731
|
...events === void 0 ? {} : { events },
|
|
35732
|
+
...tracker === void 0 ? {} : { tracker },
|
|
35733
|
+
...crm === void 0 ? {} : { crm },
|
|
35633
35734
|
...by.messages === void 0 ? {} : { messages: by.messages },
|
|
35634
35735
|
...by.mail === void 0 ? {} : { mail: by.mail },
|
|
35635
35736
|
...server === void 0 ? {} : { server },
|
|
@@ -35667,38 +35768,15 @@ var withMeetingDocuments = /* @__PURE__ */ __name(async (store, lists, read) =>
|
|
|
35667
35768
|
];
|
|
35668
35769
|
}));
|
|
35669
35770
|
}, "withMeetingDocuments");
|
|
35670
|
-
var hitKey = /* @__PURE__ */ __name((item2) => item2.kind === "meeting" ? `${item2.ref}\0${item2.scope}\0${item2.id}` : item2.ref, "hitKey");
|
|
35671
|
-
var oneList = /* @__PURE__ */ __name((lists, cosines) => {
|
|
35672
|
-
const place = /* @__PURE__ */ new Map();
|
|
35673
|
-
for (const list2 of lists) {
|
|
35674
|
-
let above = Number.NEGATIVE_INFINITY;
|
|
35675
|
-
list2.forEach((item2, rank) => {
|
|
35676
|
-
const key = hitKey(item2);
|
|
35677
|
-
above = cosines.get(item2.ref) ?? above;
|
|
35678
|
-
const held = place.get(key);
|
|
35679
|
-
if (!held || rank < held.rank)
|
|
35680
|
-
place.set(key, { item: item2, rank, cosine: above });
|
|
35681
|
-
});
|
|
35682
|
-
}
|
|
35683
|
-
const head = /* @__PURE__ */ __name((rank) => Math.min(rank, 1), "head");
|
|
35684
|
-
return [...place.values()].sort((a, b) => head(a.rank) - head(b.rank) || b.cosine - a.cosine || a.rank - b.rank).map(({ item: item2 }) => item2);
|
|
35685
|
-
}, "oneList");
|
|
35686
|
-
var PERIOD_DEPTH = 100;
|
|
35687
|
-
var PERIOD_BOOST = 0.5;
|
|
35688
|
-
var insidePeriodFirst = /* @__PURE__ */ __name((ordered, period) => {
|
|
35689
|
-
if (!period)
|
|
35690
|
-
return ordered;
|
|
35691
|
-
const inside2 = /* @__PURE__ */ __name(({ timestamp: timestamp2 }) => {
|
|
35692
|
-
const at = timestamp2 === null ? Number.NaN : Date.parse(timestamp2);
|
|
35693
|
-
return at >= period.from && at < period.to;
|
|
35694
|
-
}, "inside");
|
|
35695
|
-
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);
|
|
35696
|
-
}, "insidePeriodFirst");
|
|
35697
35771
|
|
|
35698
|
-
// 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
|
|
35699
35773
|
var SERVER_SEARCH_KEY = "messages.server-search";
|
|
35700
35774
|
var SERVER_BOUNDS = { timeMs: 5e3, perCall: 100, maxCalls: 3, textBytes: 262144 };
|
|
35701
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");
|
|
35702
35780
|
var sourceKey = /* @__PURE__ */ __name((chatId, id2) => JSON.stringify([chatId, id2]), "sourceKey");
|
|
35703
35781
|
var merge = /* @__PURE__ */ __name((one, other) => {
|
|
35704
35782
|
if (one.chat !== void 0 && other.chat !== void 0 && one.chat !== other.chat)
|
|
@@ -35815,37 +35893,41 @@ var searchServer = /* @__PURE__ */ __name(async (deps, request) => {
|
|
|
35815
35893
|
const controller = new AbortController();
|
|
35816
35894
|
const timer = setTimeout(() => controller.abort(), timeMs);
|
|
35817
35895
|
const stop = request.signal ? AbortSignal.any([request.signal, controller.signal]) : controller.signal;
|
|
35818
|
-
const bound2 = new Promise((
|
|
35896
|
+
const bound2 = new Promise((resolve6) => {
|
|
35819
35897
|
if (stop.aborted)
|
|
35820
|
-
|
|
35821
|
-
stop.addEventListener("abort", () =>
|
|
35898
|
+
resolve6(BOUND);
|
|
35899
|
+
stop.addEventListener("abort", () => resolve6(BOUND), { once: true });
|
|
35822
35900
|
});
|
|
35823
35901
|
const pending = new Set(calls);
|
|
35824
35902
|
const found = [];
|
|
35825
|
-
let
|
|
35826
|
-
const fail2 = /* @__PURE__ */ __name((branch, reason) => {
|
|
35903
|
+
let open6 = true;
|
|
35904
|
+
const fail2 = /* @__PURE__ */ __name((branch, reason, error) => {
|
|
35827
35905
|
pending.delete(branch);
|
|
35828
35906
|
report.complete = false;
|
|
35829
|
-
report.failed.push({
|
|
35907
|
+
report.failed.push({
|
|
35908
|
+
chat: branch.chat ?? null,
|
|
35909
|
+
reason,
|
|
35910
|
+
...error instanceof CliError ? { error: keysOf(error) } : {}
|
|
35911
|
+
});
|
|
35830
35912
|
}, "fail");
|
|
35831
35913
|
const ask2 = /* @__PURE__ */ __name(async (adapter) => {
|
|
35832
35914
|
const search = capability(adapter, "searchMessages", "search messages on its server");
|
|
35833
35915
|
await Promise.all(calls.map(async (branch) => {
|
|
35834
|
-
if (!
|
|
35916
|
+
if (!open6)
|
|
35835
35917
|
return;
|
|
35836
35918
|
report.calls += 1;
|
|
35837
35919
|
try {
|
|
35838
35920
|
const page = await search(asQuery(branch), { limit: SERVER_BOUNDS.perCall, signal: stop });
|
|
35839
|
-
if (!
|
|
35921
|
+
if (!open6)
|
|
35840
35922
|
return;
|
|
35841
35923
|
pending.delete(branch);
|
|
35842
35924
|
if (page.hasMore)
|
|
35843
35925
|
report.complete = false;
|
|
35844
35926
|
found.push(page);
|
|
35845
35927
|
} catch (error) {
|
|
35846
|
-
if (!
|
|
35928
|
+
if (!open6)
|
|
35847
35929
|
return;
|
|
35848
|
-
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);
|
|
35849
35931
|
}
|
|
35850
35932
|
}));
|
|
35851
35933
|
}, "ask");
|
|
@@ -35855,11 +35937,11 @@ var searchServer = /* @__PURE__ */ __name(async (deps, request) => {
|
|
|
35855
35937
|
run2.then(() => "done", () => "failed"),
|
|
35856
35938
|
bound2
|
|
35857
35939
|
]);
|
|
35858
|
-
|
|
35940
|
+
open6 = false;
|
|
35859
35941
|
for (const branch of [...pending])
|
|
35860
35942
|
fail2(branch, outcome2 === "failed" ? "search_failed" : "time_or_abort_bound");
|
|
35861
35943
|
} finally {
|
|
35862
|
-
|
|
35944
|
+
open6 = false;
|
|
35863
35945
|
clearTimeout(timer);
|
|
35864
35946
|
}
|
|
35865
35947
|
const chats = new Map(found.flatMap(({ chats: chats2 }) => chats2).map((chat) => [chat.id, chat]));
|
|
@@ -35886,7 +35968,7 @@ var searchServer = /* @__PURE__ */ __name(async (deps, request) => {
|
|
|
35886
35968
|
return { report, sources };
|
|
35887
35969
|
}, "searchServer");
|
|
35888
35970
|
|
|
35889
|
-
// 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
|
|
35890
35972
|
var DELETE_AT_ONCE = 10;
|
|
35891
35973
|
var atOnce = /* @__PURE__ */ __name((ids) => {
|
|
35892
35974
|
if (ids.length > DELETE_AT_ONCE)
|
|
@@ -36386,7 +36468,7 @@ var checkMediaOptions = /* @__PURE__ */ __name((messenger, asked, attachments) =
|
|
|
36386
36468
|
throw new CliError("validation_error", `${MEDIA_FLAGS[first2]} needs a --photo or --file`);
|
|
36387
36469
|
}, "checkMediaOptions");
|
|
36388
36470
|
|
|
36389
|
-
// 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
|
|
36390
36472
|
var CHANNEL_TAG_RULES_VERSION = "keywords-v1";
|
|
36391
36473
|
var RULES2 = {
|
|
36392
36474
|
ai: [/\b(ai|gpt|llm|machine learning|artificial intelligence)\b/iu, /нейросет|искусственн/iu],
|
|
@@ -36401,7 +36483,7 @@ var classifyChannel = /* @__PURE__ */ __name((metadata) => Object.entries(RULES2
|
|
|
36401
36483
|
return fields.length ? [{ tag, score: fields.length / 3, fields }] : [];
|
|
36402
36484
|
}), "classifyChannel");
|
|
36403
36485
|
|
|
36404
|
-
// 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
|
|
36405
36487
|
var metadataService = /* @__PURE__ */ __name((deps) => {
|
|
36406
36488
|
const held = /* @__PURE__ */ __name(async (reference, { includeLeft = false } = {}) => {
|
|
36407
36489
|
const store = await deps.store();
|
|
@@ -36487,7 +36569,7 @@ var metadataService = /* @__PURE__ */ __name((deps) => {
|
|
|
36487
36569
|
};
|
|
36488
36570
|
}, "metadataService");
|
|
36489
36571
|
|
|
36490
|
-
// 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
|
|
36491
36573
|
var FIRST_LOOK_MS = 24 * 36e5;
|
|
36492
36574
|
var moderateWith = /* @__PURE__ */ __name(async (run2) => {
|
|
36493
36575
|
const { chatId, title, rules, point, since, dryRun } = run2;
|
|
@@ -36524,7 +36606,7 @@ var moderateWith = /* @__PURE__ */ __name(async (run2) => {
|
|
|
36524
36606
|
return { chatId, rows, notes };
|
|
36525
36607
|
}, "moderateWith");
|
|
36526
36608
|
|
|
36527
|
-
// 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
|
|
36528
36610
|
var moderationService = /* @__PURE__ */ __name((deps) => {
|
|
36529
36611
|
const file = /* @__PURE__ */ __name(() => {
|
|
36530
36612
|
const env = deps.env ?? process.env;
|
|
@@ -36609,7 +36691,7 @@ var moderatorOf = /* @__PURE__ */ __name((adapter, deps) => ({
|
|
|
36609
36691
|
}, "removePerson")
|
|
36610
36692
|
}), "moderatorOf");
|
|
36611
36693
|
|
|
36612
|
-
// 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
|
|
36613
36695
|
var noteItem = /* @__PURE__ */ __name((provider, note) => ({
|
|
36614
36696
|
id: note.id,
|
|
36615
36697
|
contact: formatReference({ type: "contact", provider, id: note.personId }),
|
|
@@ -36653,7 +36735,7 @@ var privatePeopleService = /* @__PURE__ */ __name((deps) => {
|
|
|
36653
36735
|
};
|
|
36654
36736
|
}, "privatePeopleService");
|
|
36655
36737
|
|
|
36656
|
-
// 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
|
|
36657
36739
|
var empty = /* @__PURE__ */ __name(() => ({
|
|
36658
36740
|
total: 0,
|
|
36659
36741
|
population: 0,
|
|
@@ -36909,7 +36991,7 @@ var rankingsService = /* @__PURE__ */ __name((deps) => ({
|
|
|
36909
36991
|
}, "evidence")
|
|
36910
36992
|
}), "rankingsService");
|
|
36911
36993
|
|
|
36912
|
-
// 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
|
|
36913
36995
|
var FIELDS = ["date", "chat", "kind", "muted"];
|
|
36914
36996
|
var WAITING_TAIL = 100;
|
|
36915
36997
|
var plainOnly = /* @__PURE__ */ __name((text2, command) => {
|
|
@@ -37043,7 +37125,7 @@ var replyStatsService = /* @__PURE__ */ __name((deps) => {
|
|
|
37043
37125
|
};
|
|
37044
37126
|
}, "replyStatsService");
|
|
37045
37127
|
|
|
37046
|
-
// 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
|
|
37047
37129
|
var TAGGING_QUERY = {
|
|
37048
37130
|
entity: "tagging",
|
|
37049
37131
|
backend: "sql",
|
|
@@ -37127,7 +37209,7 @@ var tagsService = /* @__PURE__ */ __name((deps) => {
|
|
|
37127
37209
|
};
|
|
37128
37210
|
}, "tagsService");
|
|
37129
37211
|
|
|
37130
|
-
// 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
|
|
37131
37213
|
var actionOf = /* @__PURE__ */ __name(({ title, closed, pinned, hidden, icon }) => {
|
|
37132
37214
|
const set = [closed, pinned, hidden].filter((one) => one !== void 0).length;
|
|
37133
37215
|
if (title !== void 0 || icon !== void 0 || set !== 1)
|
|
@@ -37326,7 +37408,7 @@ var topicsService = /* @__PURE__ */ __name((deps) => {
|
|
|
37326
37408
|
};
|
|
37327
37409
|
}, "topicsService");
|
|
37328
37410
|
|
|
37329
|
-
// 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
|
|
37330
37412
|
import { createHash as createHash12, randomUUID as randomUUID5 } from "node:crypto";
|
|
37331
37413
|
var hash2 = /* @__PURE__ */ __name((value) => createHash12("sha256").update(JSON.stringify(value)).digest("hex"), "hash");
|
|
37332
37414
|
var positive2 = /* @__PURE__ */ __name((value, name, minimum = 1) => {
|
|
@@ -37400,7 +37482,7 @@ var prepareEvidencePacket = /* @__PURE__ */ __name(({ kind, source, page, limits
|
|
|
37400
37482
|
return { ...content, id: randomUUID5(), fingerprint: hash2(content) };
|
|
37401
37483
|
}, "prepareEvidencePacket");
|
|
37402
37484
|
|
|
37403
|
-
// 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
|
|
37404
37486
|
var readEvidencePacket = /* @__PURE__ */ __name(async (store, account, { chat, limit, before }, messenger = {}) => {
|
|
37405
37487
|
if (!Number.isSafeInteger(limit) || limit < 1 || limit > 100)
|
|
37406
37488
|
throw new CliError("validation_error", "evidence message limit must be an integer from 1 to 100");
|
|
@@ -37420,7 +37502,7 @@ var readEvidencePacket = /* @__PURE__ */ __name(async (store, account, { chat, l
|
|
|
37420
37502
|
return { ...packet, nextBeforeId: older && last ? last.id : null };
|
|
37421
37503
|
}, "readEvidencePacket");
|
|
37422
37504
|
|
|
37423
|
-
// 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
|
|
37424
37506
|
var scopeKeys = [
|
|
37425
37507
|
"accountId",
|
|
37426
37508
|
"meetingId",
|
|
@@ -37442,7 +37524,7 @@ var optionKeys = /* @__PURE__ */ new Set([
|
|
|
37442
37524
|
"maxVocabularyReadBytes"
|
|
37443
37525
|
]);
|
|
37444
37526
|
|
|
37445
|
-
// 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
|
|
37446
37528
|
var servicesFor = /* @__PURE__ */ __name((deps) => {
|
|
37447
37529
|
const pictures = picturesService(deps);
|
|
37448
37530
|
const base = {
|
|
@@ -37541,12 +37623,6 @@ export {
|
|
|
37541
37623
|
keyOf,
|
|
37542
37624
|
fetchInto,
|
|
37543
37625
|
GAP_BOUNDS,
|
|
37544
|
-
typesText,
|
|
37545
|
-
refuseLockedOutput,
|
|
37546
|
-
refusedPlace,
|
|
37547
|
-
readUpload,
|
|
37548
|
-
readAttachments,
|
|
37549
|
-
readStickerFile,
|
|
37550
37626
|
importEngine,
|
|
37551
37627
|
extractText,
|
|
37552
37628
|
engineHint,
|
|
@@ -37599,6 +37675,7 @@ export {
|
|
|
37599
37675
|
keyVariable,
|
|
37600
37676
|
enrichmentState,
|
|
37601
37677
|
searchNotesOf,
|
|
37678
|
+
embedCrmActivities,
|
|
37602
37679
|
HARDER_MODELS,
|
|
37603
37680
|
HARDER_CANDIDATES,
|
|
37604
37681
|
HARDER_CHARS,
|