@wirecat/mail-cli 0.5.0 → 0.7.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 +149 -0
- package/README.md +48 -13
- package/dist/bin/mail.js +2 -2
- package/dist/bundle/{all-profiles-GR5JXYEQ.js → all-profiles-SI67TKZM.js} +9 -9
- package/dist/bundle/{anthropic-REBXE65F.js → anthropic-DALMLC3Y.js} +6 -6
- package/dist/bundle/{app-server-QJ7ICQXZ.js → app-server-XOH327Z2.js} +46 -46
- package/dist/bundle/{bun-WAX4QHW5.js → bun-ORL67CJ6.js} +2 -2
- package/dist/bundle/{bun-sqlite-5S7TQ4SG.js → bun-sqlite-DGXFNFHI.js} +5 -5
- package/dist/bundle/{chunk-ZD3WUGR2.js → chunk-23IEVVL2.js} +4 -4
- package/dist/bundle/{chunk-B5WSIWY5.js → chunk-2M4K7HYR.js} +17 -17
- package/dist/bundle/{chunk-IWDOGGMY.js → chunk-35KD2CI2.js} +501 -301
- package/dist/bundle/{chunk-7A7BHABA.js → chunk-3GZK5GTU.js} +1 -1
- package/dist/bundle/{chunk-JJBQPA7D.js → chunk-3TYEJRMZ.js} +4 -4
- package/dist/bundle/{chunk-M6BDHZON.js → chunk-45KA5667.js} +26 -13
- package/dist/bundle/{chunk-LOA4X6JW.js → chunk-4NYWHINR.js} +6 -6
- package/dist/bundle/{dist-KJOAJ6NF.js → chunk-4ULY3GDL.js} +16 -116
- package/dist/bundle/{chunk-2FXVBCA3.js → chunk-5BSEGMNE.js} +4 -4
- package/dist/bundle/{chunk-HCMUGUAG.js → chunk-5JEYIHS6.js} +3 -3
- package/dist/bundle/{chunk-QXOSGGKS.js → chunk-6LK7KTWB.js} +1 -1
- package/dist/bundle/{chunk-ESNNQA7D.js → chunk-6RMMAUUW.js} +28 -28
- package/dist/bundle/{chunk-VXAZZGXE.js → chunk-6XNPXAJU.js} +33 -27
- package/dist/bundle/{chunk-5INWLYBD.js → chunk-73OJJGZE.js} +14 -3
- package/dist/bundle/{chunk-4XJ4AM3K.js → chunk-7K6KJWTO.js} +12 -12
- package/dist/bundle/{chunk-KIDF77MA.js → chunk-AP7V256W.js} +1 -1
- package/dist/bundle/{chunk-4BMNP2FT.js → chunk-BEMLGWY4.js} +1 -1
- package/dist/bundle/{chunk-BFJV4FWJ.js → chunk-BGUMGCUY.js} +2 -2
- package/dist/bundle/{chunk-5BVIWP3S.js → chunk-BM445GYF.js} +2 -2
- package/dist/bundle/{chunk-F3NYA4KN.js → chunk-CAKBG5FC.js} +6 -6
- package/dist/bundle/{chunk-EB3R2PV3.js → chunk-DKQWTQVY.js} +23 -23
- package/dist/bundle/{chunk-6TY3DGCC.js → chunk-DXGMPMFP.js} +4 -4
- package/dist/bundle/{chunk-LFRHIXCF.js → chunk-E3DRM6YP.js} +3 -3
- package/dist/bundle/{chunk-FSUNGHRI.js → chunk-EYT33MM3.js} +47 -46
- package/dist/bundle/{chunk-DXDQOZ2P.js → chunk-FPOGVDLS.js} +2 -2
- package/dist/bundle/{chunk-S677WGOQ.js → chunk-FTFNWGIR.js} +8 -8
- package/dist/bundle/{chunk-TI6VBZKJ.js → chunk-FUB3X25H.js} +4 -4
- package/dist/bundle/{chunk-7JCRQX56.js → chunk-GJUUTUK4.js} +8 -8
- package/dist/bundle/{chunk-BLS5YG77.js → chunk-HFJNEXU7.js} +2 -2
- package/dist/bundle/{chunk-YKPBC3NL.js → chunk-HV3EIYX4.js} +1 -1
- package/dist/bundle/{chunk-EL554DV2.js → chunk-IYZHM3ZN.js} +3 -3
- package/dist/bundle/{chunk-6EO7GVYJ.js → chunk-JFMUI4H6.js} +1 -1
- package/dist/bundle/{chunk-2YQNBIDQ.js → chunk-LZ5J3UXD.js} +4 -4
- package/dist/bundle/{chunk-WNCCYHRV.js → chunk-M2JCUVCJ.js} +116 -95
- package/dist/bundle/{chunk-7F3NDIYL.js → chunk-MCJ7LKYR.js} +6 -6
- package/dist/bundle/{chunk-VDAIJM5L.js → chunk-MHQKHWCJ.js} +88 -34
- package/dist/bundle/{chunk-SQ7KOBRA.js → chunk-MMXMVGA6.js} +10 -8
- package/dist/bundle/{chunk-AFCGOZR7.js → chunk-NNIXREJH.js} +7 -7
- package/dist/bundle/{chunk-LQ37ALDJ.js → chunk-NXJLC2WK.js} +8 -8
- package/dist/bundle/{chunk-6GE3EADU.js → chunk-OHTR4WFO.js} +2 -2
- package/dist/bundle/{chunk-PJCTWPJB.js → chunk-PDL4UREY.js} +8 -8
- package/dist/bundle/{chunk-J3QXTBD2.js → chunk-Q2C3VMSU.js} +20 -18
- package/dist/bundle/{chunk-SWJAG5IE.js → chunk-Q44AYEOB.js} +2 -2
- package/dist/bundle/{chunk-P7P5MNAU.js → chunk-QZBT6BOU.js} +1 -1
- package/dist/bundle/{chunk-IBYTYIYO.js → chunk-R5MML3FC.js} +61 -54
- package/dist/bundle/{chunk-CEAANMJ2.js → chunk-RQVWZBW3.js} +3 -3
- package/dist/bundle/{chunk-5CXAH4Y6.js → chunk-S4YUR4S3.js} +656 -572
- package/dist/bundle/{chunk-QX7RCLRS.js → chunk-SQLCCKEL.js} +1 -1
- package/dist/bundle/chunk-U6UJ3HRS.js +58 -0
- package/dist/bundle/{chunk-YRGBZZUW.js → chunk-V4TDG4KF.js} +14 -14
- package/dist/bundle/{chunk-5FK6RD4M.js → chunk-VBOMKZ4E.js} +73 -57
- package/dist/bundle/{chunk-MQUJEQTU.js → chunk-VKPWP3AK.js} +2 -2
- package/dist/bundle/{chunk-7XNPSIWD.js → chunk-VNJMO5F6.js} +2 -2
- package/dist/bundle/{chunk-MMDCL42A.js → chunk-VSHJWTX5.js} +12 -6
- package/dist/bundle/{chunk-2MRECWJZ.js → chunk-XQJWMBDY.js} +6 -6
- package/dist/bundle/{chunk-2U4IANVV.js → chunk-ZKCNMW7G.js} +2 -2
- package/dist/bundle/{chunk-LNS27BTB.js → chunk-ZKZABB4K.js} +3 -3
- package/dist/bundle/{chunk-WNI5BZFB.js → chunk-ZNGQ3NZ4.js} +9 -9
- package/dist/bundle/command-contract-CB5BII3S.js +34 -0
- package/dist/bundle/{decode-D7BDVIVB.js → decode-KOBURZIQ.js} +5 -5
- package/dist/bundle/{dispatch-EUKKT3PD.js → dispatch-GDAH4JHS.js} +8 -8
- package/dist/bundle/dist-T7HMT675.js +134 -0
- package/dist/bundle/{echarts-IVRX7XHP.js → echarts-LEWTQO6H.js} +2 -2
- package/dist/bundle/{embed-X527RBTG.js → embed-PUFE4BSQ.js} +6 -6
- package/dist/bundle/{embedder-F4PSJS6S.js → embedder-3G4BQQ6X.js} +9 -9
- package/dist/bundle/{failure-OAIC5VAP.js → failure-6COJAO7T.js} +2 -2
- package/dist/bundle/{first-run-M5CIX6NA.js → first-run-FLXOC53U.js} +11 -11
- package/dist/bundle/first-screen-VUZEDSQW.js +32 -0
- package/dist/bundle/{instructions-UX36BT5F.js → instructions-HGSXDCBT.js} +1 -1
- package/dist/bundle/mail.js +12 -11
- package/dist/bundle/{mcp-L7SRVDRN.js → mcp-GAPDLFWA.js} +2 -2
- package/dist/bundle/{node-OXT7WE2T.js → node-5Z7PS4F5.js} +2 -2
- package/dist/bundle/{node-sqlite-X2PSEHA4.js → node-sqlite-OAW7APIX.js} +5 -5
- package/dist/bundle/{oauth-MYK4BSYN.js → oauth-ZFZWPAJN.js} +7 -7
- package/dist/bundle/{open-GONIP2DH.js → open-ZQMBZVH4.js} +4 -4
- package/dist/bundle/{openai-YJFNUOQT.js → openai-XT2RIXAK.js} +14 -14
- package/dist/bundle/{process-7IEUUSRK.js → process-VVEQIHPE.js} +1 -1
- package/dist/bundle/{program-Q73TTG3E.js → program-RD3BBDNY.js} +21470 -7075
- package/dist/bundle/{prompt-SKQ72KN7.js → prompt-PU7GE4Z4.js} +5 -5
- package/dist/bundle/{recognize-GC7CU2DB.js → recognize-AG4A3KUK.js} +4 -4
- package/dist/bundle/{remote-UEXFZP2I.js → remote-D6TQ6T7F.js} +7 -7
- package/dist/bundle/{rerank-2U2NDEZP.js → rerank-GO24HJPF.js} +7 -7
- package/dist/bundle/{serve-OOGKFEWL.js → serve-WCHJAH6G.js} +9 -9
- package/dist/bundle/server-5KJJ3D6P.js +63 -0
- package/dist/bundle/{server-FZ3LFQTF.js → server-CAVNBG3P.js} +38 -38
- package/dist/bundle/{sqlite-runtime-GIQSW6LJ.js → sqlite-runtime-ANXC4AW2.js} +5 -5
- package/dist/bundle/{state-EMFXPQVZ.js → state-EGJ66A62.js} +6 -6
- package/dist/bundle/{store-BDU4UPNK.js → store-OON7FCMQ.js} +15 -15
- package/dist/bundle/{store-LDI62AUG.js → store-SBFA444C.js} +13 -13
- package/dist/bundle/store-maintenance-command-UEOJLYMJ.js +52 -0
- package/dist/commands/attachments.d.ts +3 -0
- package/dist/commands/attachments.d.ts.map +1 -0
- package/dist/commands/attachments.js +97 -0
- package/dist/commands/attachments.js.map +1 -0
- package/dist/commands/context.d.ts +21 -6
- package/dist/commands/context.d.ts.map +1 -1
- package/dist/commands/context.js +58 -7
- package/dist/commands/context.js.map +1 -1
- package/dist/commands/drafts-send.d.ts +7 -0
- package/dist/commands/drafts-send.d.ts.map +1 -0
- package/dist/commands/drafts-send.js +58 -0
- package/dist/commands/drafts-send.js.map +1 -0
- package/dist/commands/drafts.d.ts +3 -0
- package/dist/commands/drafts.d.ts.map +1 -0
- package/dist/commands/drafts.js +243 -0
- package/dist/commands/drafts.js.map +1 -0
- package/dist/commands/export.d.ts +3 -0
- package/dist/commands/export.d.ts.map +1 -0
- package/dist/commands/export.js +278 -0
- package/dist/commands/export.js.map +1 -0
- package/dist/commands/folders.d.ts.map +1 -1
- package/dist/commands/folders.js +120 -2
- package/dist/commands/folders.js.map +1 -1
- package/dist/commands/messages.d.ts +25 -0
- package/dist/commands/messages.d.ts.map +1 -0
- package/dist/commands/messages.js +506 -0
- package/dist/commands/messages.js.map +1 -0
- package/dist/commands/read.d.ts +4 -1
- package/dist/commands/read.d.ts.map +1 -1
- package/dist/commands/read.js +14 -3
- package/dist/commands/read.js.map +1 -1
- package/dist/commands/rules.d.ts +3 -0
- package/dist/commands/rules.d.ts.map +1 -0
- package/dist/commands/rules.js +292 -0
- package/dist/commands/rules.js.map +1 -0
- package/dist/commands/send.d.ts +39 -0
- package/dist/commands/send.d.ts.map +1 -0
- package/dist/commands/send.js +309 -0
- package/dist/commands/send.js.map +1 -0
- package/dist/commands/server-search.d.ts +8 -0
- package/dist/commands/server-search.d.ts.map +1 -0
- package/dist/commands/server-search.js +38 -0
- package/dist/commands/server-search.js.map +1 -0
- package/dist/commands/session-start.d.ts.map +1 -1
- package/dist/commands/session-start.js +107 -10
- package/dist/commands/session-start.js.map +1 -1
- package/dist/commands/session.d.ts.map +1 -1
- package/dist/commands/session.js +72 -9
- package/dist/commands/session.js.map +1 -1
- package/dist/commands/stats.d.ts +3 -0
- package/dist/commands/stats.d.ts.map +1 -0
- package/dist/commands/stats.js +89 -0
- package/dist/commands/stats.js.map +1 -0
- package/dist/commands/status.js +2 -2
- package/dist/commands/status.js.map +1 -1
- package/dist/commands/sync.d.ts +6 -0
- package/dist/commands/sync.d.ts.map +1 -1
- package/dist/commands/sync.js +28 -20
- package/dist/commands/sync.js.map +1 -1
- package/dist/commands/tags.d.ts +3 -0
- package/dist/commands/tags.d.ts.map +1 -0
- package/dist/commands/tags.js +144 -0
- package/dist/commands/tags.js.map +1 -0
- package/dist/config.d.ts +15 -0
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +52 -1
- package/dist/config.js.map +1 -1
- package/dist/export/format.d.ts +19 -0
- package/dist/export/format.d.ts.map +1 -0
- package/dist/export/format.js +40 -0
- package/dist/export/format.js.map +1 -0
- package/dist/export/journal.d.ts +32 -0
- package/dist/export/journal.d.ts.map +1 -0
- package/dist/export/journal.js +84 -0
- package/dist/export/journal.js.map +1 -0
- package/dist/export/write.d.ts +14 -0
- package/dist/export/write.d.ts.map +1 -0
- package/dist/export/write.js +42 -0
- package/dist/export/write.js.map +1 -0
- package/dist/identity.d.ts.map +1 -1
- package/dist/identity.js +3 -0
- package/dist/identity.js.map +1 -1
- package/dist/mail/backend.d.ts +104 -2
- package/dist/mail/backend.d.ts.map +1 -1
- package/dist/mail/backend.js +4 -1
- package/dist/mail/backend.js.map +1 -1
- package/dist/mail/changes.d.ts +91 -0
- package/dist/mail/changes.d.ts.map +1 -0
- package/dist/mail/changes.js +198 -0
- package/dist/mail/changes.js.map +1 -0
- package/dist/mail/cleanup.d.ts +41 -0
- package/dist/mail/cleanup.d.ts.map +1 -0
- package/dist/mail/cleanup.js +119 -0
- package/dist/mail/cleanup.js.map +1 -0
- package/dist/mail/compose.d.ts +73 -0
- package/dist/mail/compose.d.ts.map +1 -0
- package/dist/mail/compose.js +110 -0
- package/dist/mail/compose.js.map +1 -0
- package/dist/mail/doctor.d.ts +67 -0
- package/dist/mail/doctor.d.ts.map +1 -0
- package/dist/mail/doctor.js +115 -0
- package/dist/mail/doctor.js.map +1 -0
- package/dist/mail/drafts.d.ts +54 -0
- package/dist/mail/drafts.d.ts.map +1 -0
- package/dist/mail/drafts.js +104 -0
- package/dist/mail/drafts.js.map +1 -0
- package/dist/mail/imap/connection.d.ts +13 -3
- package/dist/mail/imap/connection.d.ts.map +1 -1
- package/dist/mail/imap/connection.js +87 -18
- package/dist/mail/imap/connection.js.map +1 -1
- package/dist/mail/imap/index.d.ts +3 -3
- package/dist/mail/imap/index.d.ts.map +1 -1
- package/dist/mail/imap/index.js +14 -4
- package/dist/mail/imap/index.js.map +1 -1
- package/dist/mail/imap/messages.d.ts +5 -6
- package/dist/mail/imap/messages.d.ts.map +1 -1
- package/dist/mail/imap/messages.js +14 -28
- package/dist/mail/imap/messages.js.map +1 -1
- package/dist/mail/imap/read.d.ts.map +1 -1
- package/dist/mail/imap/read.js +27 -13
- package/dist/mail/imap/read.js.map +1 -1
- package/dist/mail/imap/search.d.ts +14 -0
- package/dist/mail/imap/search.d.ts.map +1 -0
- package/dist/mail/imap/search.js +55 -0
- package/dist/mail/imap/search.js.map +1 -0
- package/dist/mail/imap/write.d.ts +5 -0
- package/dist/mail/imap/write.d.ts.map +1 -0
- package/dist/mail/imap/write.js +93 -0
- package/dist/mail/imap/write.js.map +1 -0
- package/dist/mail/organise.d.ts +116 -0
- package/dist/mail/organise.d.ts.map +1 -0
- package/dist/mail/organise.js +531 -0
- package/dist/mail/organise.js.map +1 -0
- package/dist/mail/rethread.d.ts +1 -2
- package/dist/mail/rethread.d.ts.map +1 -1
- package/dist/mail/rethread.js +8 -3
- package/dist/mail/rethread.js.map +1 -1
- package/dist/mail/rules/apply.d.ts +40 -0
- package/dist/mail/rules/apply.d.ts.map +1 -0
- package/dist/mail/rules/apply.js +114 -0
- package/dist/mail/rules/apply.js.map +1 -0
- package/dist/mail/rules/file.d.ts +9 -0
- package/dist/mail/rules/file.d.ts.map +1 -0
- package/dist/mail/rules/file.js +51 -0
- package/dist/mail/rules/file.js.map +1 -0
- package/dist/mail/rules/filters.d.ts +11 -0
- package/dist/mail/rules/filters.d.ts.map +1 -0
- package/dist/mail/rules/filters.js +150 -0
- package/dist/mail/rules/filters.js.map +1 -0
- package/dist/mail/rules/folders.d.ts +11 -0
- package/dist/mail/rules/folders.d.ts.map +1 -0
- package/dist/mail/rules/folders.js +17 -0
- package/dist/mail/rules/folders.js.map +1 -0
- package/dist/mail/rules/query.d.ts +15 -0
- package/dist/mail/rules/query.d.ts.map +1 -0
- package/dist/mail/rules/query.js +103 -0
- package/dist/mail/rules/query.js.map +1 -0
- package/dist/mail/rules/store.d.ts +9 -0
- package/dist/mail/rules/store.d.ts.map +1 -0
- package/dist/mail/rules/store.js +17 -0
- package/dist/mail/rules/store.js.map +1 -0
- package/dist/mail/save.d.ts +9 -0
- package/dist/mail/save.d.ts.map +1 -0
- package/dist/mail/save.js +50 -0
- package/dist/mail/save.js.map +1 -0
- package/dist/mail/send.d.ts +67 -0
- package/dist/mail/send.d.ts.map +1 -0
- package/dist/mail/send.js +173 -0
- package/dist/mail/send.js.map +1 -0
- package/dist/mail/smtp.d.ts +4 -0
- package/dist/mail/smtp.d.ts.map +1 -0
- package/dist/mail/smtp.js +133 -0
- package/dist/mail/smtp.js.map +1 -0
- package/dist/oauth.d.ts +74 -0
- package/dist/oauth.d.ts.map +1 -0
- package/dist/oauth.js +230 -0
- package/dist/oauth.js.map +1 -0
- package/dist/program.d.ts.map +1 -1
- package/dist/program.js +26 -4
- package/dist/program.js.map +1 -1
- package/dist/providers.d.ts +96 -9
- package/dist/providers.d.ts.map +1 -1
- package/dist/providers.js +69 -16
- package/dist/providers.js.map +1 -1
- package/dist/reasons.d.ts +9 -0
- package/dist/reasons.d.ts.map +1 -0
- package/dist/reasons.js +27 -0
- package/dist/reasons.js.map +1 -0
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +7 -5
- package/skills/mail-cli/SKILL.md +30 -3
- package/dist/bundle/chunk-YD5WV757.js +0 -27
- package/dist/bundle/command-contract-GPUED3GT.js +0 -34
- package/dist/bundle/first-screen-M7MT776O.js +0 -32
- package/dist/bundle/server-4JMHDHZ7.js +0 -63
- package/dist/bundle/store-maintenance-command-OFRPORN2.js +0 -52
- /package/dist/bundle/{chunk-NPGVOZVK.js → chunk-WJWLHLQ7.js} +0 -0
|
@@ -4,10 +4,11 @@ import {
|
|
|
4
4
|
acquireLock,
|
|
5
5
|
openOrdinaryFile,
|
|
6
6
|
readBoundedUtf8File,
|
|
7
|
+
safeName,
|
|
7
8
|
sameOrdinaryFile,
|
|
8
9
|
syncDirectory,
|
|
9
10
|
writeFileAtomic
|
|
10
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-45KA5667.js";
|
|
11
12
|
import {
|
|
12
13
|
MAX_ACTIONS,
|
|
13
14
|
ModerationRules,
|
|
@@ -23,10 +24,10 @@ import {
|
|
|
23
24
|
someUndone,
|
|
24
25
|
validateFormattedText,
|
|
25
26
|
visibleFormattedText
|
|
26
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-FTFNWGIR.js";
|
|
27
28
|
import {
|
|
28
29
|
MAX_MODEL_IMAGE_BYTES
|
|
29
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-ZKCNMW7G.js";
|
|
30
31
|
import {
|
|
31
32
|
Command,
|
|
32
33
|
DEFAULT_IMAGE_MODEL,
|
|
@@ -65,17 +66,17 @@ import {
|
|
|
65
66
|
typedCommand,
|
|
66
67
|
vectorModelKey,
|
|
67
68
|
withAttempt
|
|
68
|
-
} from "./chunk-
|
|
69
|
+
} from "./chunk-R5MML3FC.js";
|
|
69
70
|
import {
|
|
70
71
|
isCliFailure
|
|
71
|
-
} from "./chunk-
|
|
72
|
+
} from "./chunk-ZNGQ3NZ4.js";
|
|
72
73
|
import {
|
|
73
74
|
isNewer,
|
|
74
75
|
updateCommand
|
|
75
|
-
} from "./chunk-
|
|
76
|
+
} from "./chunk-23IEVVL2.js";
|
|
76
77
|
import {
|
|
77
78
|
remoteKey
|
|
78
|
-
} from "./chunk-
|
|
79
|
+
} from "./chunk-RQVWZBW3.js";
|
|
79
80
|
import {
|
|
80
81
|
AGENDA_COLUMNS,
|
|
81
82
|
CHAT_COLUMNS,
|
|
@@ -115,6 +116,7 @@ import {
|
|
|
115
116
|
hasStems,
|
|
116
117
|
hasText,
|
|
117
118
|
historyStartKey,
|
|
119
|
+
hitFiles,
|
|
118
120
|
inSource,
|
|
119
121
|
inboxKey,
|
|
120
122
|
isAccountList,
|
|
@@ -130,7 +132,7 @@ import {
|
|
|
130
132
|
threadConversation,
|
|
131
133
|
validateAst,
|
|
132
134
|
validateFields
|
|
133
|
-
} from "./chunk-
|
|
135
|
+
} from "./chunk-35KD2CI2.js";
|
|
134
136
|
import {
|
|
135
137
|
COUNTER_FIELDS,
|
|
136
138
|
INTERNAL_NOTES,
|
|
@@ -149,13 +151,13 @@ import {
|
|
|
149
151
|
parseReference,
|
|
150
152
|
providerNamed,
|
|
151
153
|
rankingOptions
|
|
152
|
-
} from "./chunk-
|
|
154
|
+
} from "./chunk-MCJ7LKYR.js";
|
|
153
155
|
import {
|
|
154
156
|
TASK_KINDS,
|
|
155
157
|
TASK_STATES,
|
|
156
158
|
createTaskService,
|
|
157
159
|
isClosedState
|
|
158
|
-
} from "./chunk-
|
|
160
|
+
} from "./chunk-MMXMVGA6.js";
|
|
159
161
|
import {
|
|
160
162
|
EVENT_QUERY,
|
|
161
163
|
MEETING_PROJECT_EVIDENCE_QUERY,
|
|
@@ -196,17 +198,17 @@ import {
|
|
|
196
198
|
validateQuery,
|
|
197
199
|
walkQuery,
|
|
198
200
|
zonedMoment
|
|
199
|
-
} from "./chunk-
|
|
201
|
+
} from "./chunk-VBOMKZ4E.js";
|
|
200
202
|
import {
|
|
201
203
|
DEFAULT_STEMMERS,
|
|
202
204
|
createStemmer,
|
|
203
205
|
fold,
|
|
204
206
|
normalize
|
|
205
|
-
} from "./chunk-
|
|
207
|
+
} from "./chunk-GJUUTUK4.js";
|
|
206
208
|
import {
|
|
207
209
|
DEFAULT_TASK_CATEGORIES,
|
|
208
210
|
FALLBACK_CATEGORY
|
|
209
|
-
} from "./chunk-
|
|
211
|
+
} from "./chunk-4NYWHINR.js";
|
|
210
212
|
import {
|
|
211
213
|
Unzip,
|
|
212
214
|
UnzipInflate,
|
|
@@ -217,18 +219,18 @@ import {
|
|
|
217
219
|
placedText,
|
|
218
220
|
runEmbedders,
|
|
219
221
|
textModelsDirectory
|
|
220
|
-
} from "./chunk-
|
|
222
|
+
} from "./chunk-CAKBG5FC.js";
|
|
221
223
|
import {
|
|
222
224
|
installFiles,
|
|
223
225
|
megabytes
|
|
224
|
-
} from "./chunk-
|
|
226
|
+
} from "./chunk-3TYEJRMZ.js";
|
|
225
227
|
import {
|
|
226
228
|
storePath,
|
|
227
229
|
wirecatDirectory
|
|
228
|
-
} from "./chunk-
|
|
230
|
+
} from "./chunk-Q44AYEOB.js";
|
|
229
231
|
import {
|
|
230
232
|
resolvePaths
|
|
231
|
-
} from "./chunk-
|
|
233
|
+
} from "./chunk-Q2C3VMSU.js";
|
|
232
234
|
import {
|
|
233
235
|
array,
|
|
234
236
|
boolean,
|
|
@@ -245,7 +247,7 @@ import {
|
|
|
245
247
|
safeParse,
|
|
246
248
|
strictObject,
|
|
247
249
|
string
|
|
248
|
-
} from "./chunk-
|
|
250
|
+
} from "./chunk-NXJLC2WK.js";
|
|
249
251
|
import {
|
|
250
252
|
importFrom,
|
|
251
253
|
resolveFrom
|
|
@@ -254,7 +256,7 @@ import {
|
|
|
254
256
|
CliError,
|
|
255
257
|
isCliError,
|
|
256
258
|
singleLine
|
|
257
|
-
} from "./chunk-
|
|
259
|
+
} from "./chunk-BM445GYF.js";
|
|
258
260
|
import {
|
|
259
261
|
__commonJS,
|
|
260
262
|
__name,
|
|
@@ -16870,10 +16872,10 @@ var require_lib3 = __commonJS({
|
|
|
16870
16872
|
}
|
|
16871
16873
|
});
|
|
16872
16874
|
|
|
16873
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
16875
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.537.0_@wirecat+cli-base@0.71.0_commander@15.0.0_esbuild@0.28.2_type_e3a3074c051d1ca759b7e8b914e3af6d/node_modules/@wirecat/cli-core/dist/ports/traits.js
|
|
16874
16876
|
var syncsOneChat = /* @__PURE__ */ __name((messenger) => messenger.history !== "store" || messenger.historyOnDemand === true, "syncsOneChat");
|
|
16875
16877
|
|
|
16876
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
16878
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.537.0_@wirecat+cli-base@0.71.0_commander@15.0.0_esbuild@0.28.2_type_e3a3074c051d1ca759b7e8b914e3af6d/node_modules/@wirecat/cli-core/dist/conversations/link.js
|
|
16877
16879
|
var RULES_VERSION = 5;
|
|
16878
16880
|
var LOOK_BACK = 50;
|
|
16879
16881
|
var SAME_SENDER_WITHIN = 10;
|
|
@@ -16963,7 +16965,7 @@ var latest = /* @__PURE__ */ __name((window3, matches) => {
|
|
|
16963
16965
|
var sameThread = /* @__PURE__ */ __name((a, b) => a.threadId === b.threadId, "sameThread");
|
|
16964
16966
|
var link = /* @__PURE__ */ __name((message, parentId, source, kind, confidence, method) => ({ messageId: message.id, parentId, source, kind, confidence, method }), "link");
|
|
16965
16967
|
|
|
16966
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
16968
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.537.0_@wirecat+cli-base@0.71.0_commander@15.0.0_esbuild@0.28.2_type_e3a3074c051d1ca759b7e8b914e3af6d/node_modules/@wirecat/cli-core/dist/cli/messenger/lacks.js
|
|
16967
16969
|
var COMMAND_NEEDS = {
|
|
16968
16970
|
"account update": ["updateProfile", "change the profile"],
|
|
16969
16971
|
"account sessions list": ["sessions", "list the account's sessions"],
|
|
@@ -17013,7 +17015,7 @@ var hideNever = /* @__PURE__ */ __name((messenger, group) => {
|
|
|
17013
17015
|
return group;
|
|
17014
17016
|
}, "hideNever");
|
|
17015
17017
|
|
|
17016
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
17018
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.537.0_@wirecat+cli-base@0.71.0_commander@15.0.0_esbuild@0.28.2_type_e3a3074c051d1ca759b7e8b914e3af6d/node_modules/@wirecat/cli-core/dist/services/members-audit.js
|
|
17017
17019
|
var AUDIT_PAGE = 200;
|
|
17018
17020
|
var AUDIT_BUDGET = 10;
|
|
17019
17021
|
var AUDIT_PAUSE_MS = 1e3;
|
|
@@ -17093,7 +17095,7 @@ var burstJoins = /* @__PURE__ */ __name((members) => {
|
|
|
17093
17095
|
return found;
|
|
17094
17096
|
}, "burstJoins");
|
|
17095
17097
|
|
|
17096
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
17098
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.537.0_@wirecat+cli-base@0.71.0_commander@15.0.0_esbuild@0.28.2_type_e3a3074c051d1ca759b7e8b914e3af6d/node_modules/@wirecat/cli-core/dist/meetings/cli/query-options.js
|
|
17097
17099
|
var queryWordsAfterOptions = /* @__PURE__ */ __name((command) => {
|
|
17098
17100
|
command.allowUnknownOption();
|
|
17099
17101
|
const parse = command.parseOptions.bind(command);
|
|
@@ -17113,7 +17115,7 @@ var queryWordsAfterOptions = /* @__PURE__ */ __name((command) => {
|
|
|
17113
17115
|
return command;
|
|
17114
17116
|
}, "queryWordsAfterOptions");
|
|
17115
17117
|
|
|
17116
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
17118
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.537.0_@wirecat+cli-base@0.71.0_commander@15.0.0_esbuild@0.28.2_type_e3a3074c051d1ca759b7e8b914e3af6d/node_modules/@wirecat/cli-core/dist/meetings/cli/passage.js
|
|
17117
17119
|
var count = /* @__PURE__ */ __name((value) => {
|
|
17118
17120
|
if (!/^(0|[1-9]\d*)$/.test(value) || !Number.isSafeInteger(Number(value)))
|
|
17119
17121
|
throw new CliError("validation_error", "expected a nonnegative safe integer");
|
|
@@ -17155,7 +17157,7 @@ var addMeetingPassageCommandDefinition = /* @__PURE__ */ __name((program, deps)
|
|
|
17155
17157
|
var createMeetingPassageCommand = sharedCommand(createMeetingPassageCommandDefinition);
|
|
17156
17158
|
var addMeetingPassageCommand = sharedCommand(addMeetingPassageCommandDefinition);
|
|
17157
17159
|
|
|
17158
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
17160
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.537.0_@wirecat+cli-base@0.71.0_commander@15.0.0_esbuild@0.28.2_type_e3a3074c051d1ca759b7e8b914e3af6d/node_modules/@wirecat/cli-core/dist/meetings/cli/project-evidence.js
|
|
17159
17161
|
var integer = /* @__PURE__ */ __name((value) => {
|
|
17160
17162
|
if (!/^[1-9]\d*$/.test(value) || !Number.isSafeInteger(Number(value)))
|
|
17161
17163
|
throw new CliError("validation_error", "expected a positive safe integer");
|
|
@@ -17178,7 +17180,7 @@ ${fieldsHelp(MEETING_PROJECT_EVIDENCE_QUERY)}`).option("--limit <n>", "hits in o
|
|
|
17178
17180
|
}, "addMeetingProjectEvidenceCommandDefinition");
|
|
17179
17181
|
var addMeetingProjectEvidenceCommand = sharedCommand(addMeetingProjectEvidenceCommandDefinition);
|
|
17180
17182
|
|
|
17181
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
17183
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.537.0_@wirecat+cli-base@0.71.0_commander@15.0.0_esbuild@0.28.2_type_e3a3074c051d1ca759b7e8b914e3af6d/node_modules/@wirecat/cli-core/dist/meetings/cli/search.js
|
|
17182
17184
|
var ZONED = /(?:Z|[+-]\d{2}:?\d{2})$/i;
|
|
17183
17185
|
var moment = /* @__PURE__ */ __name((flag, end, readIn) => (value) => {
|
|
17184
17186
|
const zone = timezoneOf();
|
|
@@ -17264,7 +17266,7 @@ var addMeetingSearchCommandDefinition = /* @__PURE__ */ __name((program, deps) =
|
|
|
17264
17266
|
var createMeetingSearchCommand = sharedCommand(createMeetingSearchCommandDefinition);
|
|
17265
17267
|
var addMeetingSearchCommand = sharedCommand(addMeetingSearchCommandDefinition);
|
|
17266
17268
|
|
|
17267
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
17269
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.537.0_@wirecat+cli-base@0.71.0_commander@15.0.0_esbuild@0.28.2_type_e3a3074c051d1ca759b7e8b914e3af6d/node_modules/@wirecat/cli-core/dist/meetings/cli/index.js
|
|
17268
17270
|
var integer3 = /* @__PURE__ */ __name((text2) => {
|
|
17269
17271
|
if (!/^[1-9]\d*$/.test(text2) || !Number.isSafeInteger(Number(text2)))
|
|
17270
17272
|
throw new InvalidArgumentError("expected a positive integer");
|
|
@@ -17384,7 +17386,7 @@ ${fieldsHelp(EVENT_QUERY, MEETING_QUERY_GUIDE)}`);
|
|
|
17384
17386
|
}, "addMeetingCommandsDefinition");
|
|
17385
17387
|
var addMeetingCommands = sharedCommand(addMeetingCommandsDefinition);
|
|
17386
17388
|
|
|
17387
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
17389
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.537.0_@wirecat+cli-base@0.71.0_commander@15.0.0_esbuild@0.28.2_type_e3a3074c051d1ca759b7e8b914e3af6d/node_modules/@wirecat/cli-core/dist/cli/list-query.js
|
|
17388
17390
|
var LIST_QUERY_GUIDE = "https://github.com/WireCatLabs/cli-core/blob/main/docs/search/query-language.md";
|
|
17389
17391
|
var withQuery = /* @__PURE__ */ __name((command, registry) => {
|
|
17390
17392
|
const query = defineQuery(registry);
|
|
@@ -17401,9 +17403,19 @@ var unfilteredQuery = /* @__PURE__ */ __name((entity, schema2) => ({
|
|
|
17401
17403
|
backend: "native",
|
|
17402
17404
|
fields: queryFieldsOf(schema2, {})
|
|
17403
17405
|
}), "unfilteredQuery");
|
|
17406
|
+
var withTomorrow = /* @__PURE__ */ __name((query, registry, zone = timezoneOf(), now = Date.now()) => {
|
|
17407
|
+
const times = new Set(registry.fields.filter(({ type }) => type === "time").map(({ name }) => name));
|
|
17408
|
+
const date2 = /* @__PURE__ */ new Date(`${new Intl.DateTimeFormat("en-CA", { timeZone: zone }).format(now)}T00:00:00Z`);
|
|
17409
|
+
date2.setUTCDate(date2.getUTCDate() + 1);
|
|
17410
|
+
const tomorrow = date2.toISOString().slice(0, 10);
|
|
17411
|
+
const day = /* @__PURE__ */ __name((value) => value.toLowerCase() === "tomorrow" ? tomorrow : value, "day");
|
|
17412
|
+
const map = /* @__PURE__ */ __name((node) => node.kind === "predicate" ? times.has(node.field) ? { ...node, value: day(node.value), ...node.upper === void 0 ? {} : { upper: day(node.upper) } } : node : { ...node, clauses: node.clauses.map((clause) => ({ ...clause, node: map(clause.node) })) }, "map");
|
|
17413
|
+
return { ...query, root: map(query.root) };
|
|
17414
|
+
}, "withTomorrow");
|
|
17404
17415
|
var listQuery = /* @__PURE__ */ __name((text2, registry, command, { defaultField = "none" } = {}) => {
|
|
17405
17416
|
const context2 = { command, guide: LIST_QUERY_GUIDE };
|
|
17406
|
-
const
|
|
17417
|
+
const parsed = text2.trim() === "" ? void 0 : parseLucene(text2, { defaultField, ...context2 });
|
|
17418
|
+
const typed = parsed && withTomorrow(parsed, registry);
|
|
17407
17419
|
if (typed)
|
|
17408
17420
|
validateQuery(typed, registry, context2);
|
|
17409
17421
|
const named2 = typed ? fieldsNamed(typed) : /* @__PURE__ */ new Set();
|
|
@@ -17500,7 +17512,7 @@ var termField = /* @__PURE__ */ __name((name, type, example, more = {}) => nativ
|
|
|
17500
17512
|
var queryHelp = /* @__PURE__ */ __name((registry) => `
|
|
17501
17513
|
${fieldsHelp(registry, LIST_QUERY_GUIDE)}`, "queryHelp");
|
|
17502
17514
|
|
|
17503
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
17515
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.537.0_@wirecat+cli-base@0.71.0_commander@15.0.0_esbuild@0.28.2_type_e3a3074c051d1ca759b7e8b914e3af6d/node_modules/@wirecat/cli-core/dist/cli/paging.js
|
|
17504
17516
|
var positiveCount = /* @__PURE__ */ __name((flag) => (value) => {
|
|
17505
17517
|
if (!/^\d+$/.test(value.trim()) || Number(value) < 1)
|
|
17506
17518
|
throw new CliError("validation_error", `${flag} takes a whole number from 1 upwards, not "${value}"`);
|
|
@@ -17509,7 +17521,7 @@ var positiveCount = /* @__PURE__ */ __name((flag) => (value) => {
|
|
|
17509
17521
|
var withPaging = /* @__PURE__ */ __name((command) => command.option("--limit <n>", "how many to show", positiveCount("--limit")).option("--page <n>", "which page, starting at 1", positiveCount("--page")).option("--all", "every row, no paging"), "withPaging");
|
|
17510
17522
|
var window = /* @__PURE__ */ __name(({ limit, page, all }) => all ? { offset: 0 } : { limit, offset: (page - 1) * limit }, "window");
|
|
17511
17523
|
|
|
17512
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
17524
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.537.0_@wirecat+cli-base@0.71.0_commander@15.0.0_esbuild@0.28.2_type_e3a3074c051d1ca759b7e8b914e3af6d/node_modules/@wirecat/cli-core/dist/cli/messenger/chat-answers.js
|
|
17513
17525
|
var defined = /* @__PURE__ */ __name((record2) => Object.fromEntries(Object.entries(record2).filter(([, value]) => value !== void 0)), "defined");
|
|
17514
17526
|
var chatRef = /* @__PURE__ */ __name((account, chat) => formatReference({ type: "chat", provider: account.provider, account: account.account, chat }), "chatRef");
|
|
17515
17527
|
var settingsOf = /* @__PURE__ */ __name((settings) => defined({
|
|
@@ -17771,7 +17783,7 @@ var sessionAnswer = /* @__PURE__ */ __name(({ current, client, device, location,
|
|
|
17771
17783
|
...createdAt === void 0 ? {} : { created_at: createdAt }
|
|
17772
17784
|
}), "sessionAnswer");
|
|
17773
17785
|
|
|
17774
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
17786
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.537.0_@wirecat+cli-base@0.71.0_commander@15.0.0_esbuild@0.28.2_type_e3a3074c051d1ca759b7e8b914e3af6d/node_modules/@wirecat/cli-core/dist/services/deps.js
|
|
17775
17787
|
var accountStore = /* @__PURE__ */ __name(async (deps) => (await deps.store()).forAccount(await deps.account()), "accountStore");
|
|
17776
17788
|
var crossAccount = /* @__PURE__ */ __name((deps, _reason) => deps.store(), "crossAccount");
|
|
17777
17789
|
var NO_LOCAL_STORE = "this answer comes from the messenger, not from the local store";
|
|
@@ -17806,7 +17818,7 @@ var storeIfOpen = /* @__PURE__ */ __name(async (deps) => {
|
|
|
17806
17818
|
var fromStore = /* @__PURE__ */ __name((deps) => deps.offline || deps.reads === "store", "fromStore");
|
|
17807
17819
|
var nothingStored = /* @__PURE__ */ __name((messenger) => `nothing stored for this chat yet \u2014 keep \`${typedCommand(messenger.app.command, "serve")}\` running`, "nothingStored");
|
|
17808
17820
|
var PUSHED = "this messenger's history is read from the local store";
|
|
17809
|
-
var OFFLINE = "--offline answers only from what is kept locally: `chats list|show`, `messages list|show|context`, `contacts list|show` and `review`";
|
|
17821
|
+
var OFFLINE = "--offline answers only from what is kept locally: `chats list|show`, `messages list|show|context|download`, `contacts list|show` and `review`";
|
|
17810
17822
|
var onlineDeps = /* @__PURE__ */ __name((messenger, adapter, guard, where = {}) => ({
|
|
17811
17823
|
messenger,
|
|
17812
17824
|
...where,
|
|
@@ -17836,7 +17848,7 @@ var storedDeps = /* @__PURE__ */ __name((messenger, store, account, guard) => ({
|
|
|
17836
17848
|
}), "storedDeps");
|
|
17837
17849
|
var storeModeDeps = /* @__PURE__ */ __name((messenger, store, account, guard) => ({ ...storedDeps(messenger, store, account, guard), offline: false, reads: "store" }), "storeModeDeps");
|
|
17838
17850
|
|
|
17839
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
17851
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.537.0_@wirecat+cli-base@0.71.0_commander@15.0.0_esbuild@0.28.2_type_e3a3074c051d1ca759b7e8b914e3af6d/node_modules/@wirecat/cli-core/dist/ports/messenger.js
|
|
17840
17852
|
var throughWrapper = /* @__PURE__ */ __name((inner, handled, wrap = (_, call) => call) => new Proxy(handled, {
|
|
17841
17853
|
get: /* @__PURE__ */ __name((own, key) => {
|
|
17842
17854
|
if (key in own)
|
|
@@ -17853,12 +17865,12 @@ var capability = /* @__PURE__ */ __name((adapter, method, what) => {
|
|
|
17853
17865
|
return found.bind(adapter);
|
|
17854
17866
|
}, "capability");
|
|
17855
17867
|
|
|
17856
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
17868
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.537.0_@wirecat+cli-base@0.71.0_commander@15.0.0_esbuild@0.28.2_type_e3a3074c051d1ca759b7e8b914e3af6d/node_modules/@wirecat/cli-core/dist/sends/send-id.js
|
|
17857
17869
|
import { randomBytes } from "node:crypto";
|
|
17858
17870
|
var newSendId = /* @__PURE__ */ __name(() => randomBytes(8).readBigInt64BE().toString(), "newSendId");
|
|
17859
17871
|
var newOperationId = newSendId;
|
|
17860
17872
|
|
|
17861
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
17873
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.537.0_@wirecat+cli-base@0.71.0_commander@15.0.0_esbuild@0.28.2_type_e3a3074c051d1ca759b7e8b914e3af6d/node_modules/@wirecat/cli-core/dist/services/moment.js
|
|
17862
17874
|
var AGO = /^(\d+)(m|h|d)$/;
|
|
17863
17875
|
var AGO_MS = { m: 6e4, h: 36e5, d: 864e5 };
|
|
17864
17876
|
var DATE = /^\d{4}-\d{2}-\d{2}/;
|
|
@@ -17898,7 +17910,7 @@ var dateWindow = /* @__PURE__ */ __name(({ sinceTime, untilTime, zone, now = Dat
|
|
|
17898
17910
|
};
|
|
17899
17911
|
}, "dateWindow");
|
|
17900
17912
|
|
|
17901
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
17913
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.537.0_@wirecat+cli-base@0.71.0_commander@15.0.0_esbuild@0.28.2_type_e3a3074c051d1ca759b7e8b914e3af6d/node_modules/@wirecat/cli-core/dist/services/questions.js
|
|
17902
17914
|
var LINKS = /https?:\/\/\S+/g;
|
|
17903
17915
|
var unanswered = /* @__PURE__ */ __name((messages, { answerers: answerers2, before: before2 }) => questions(messages, { answerers: answerers2 }).filter(({ question, answer }) => answer === void 0 && Date.parse(question.timestamp) < before2).map(({ question }) => question), "unanswered");
|
|
17904
17916
|
var questions = /* @__PURE__ */ __name((messages, { answerers: answerers2 }) => {
|
|
@@ -17925,7 +17937,7 @@ var questions = /* @__PURE__ */ __name((messages, { answerers: answerers2 }) =>
|
|
|
17925
17937
|
});
|
|
17926
17938
|
}, "questions");
|
|
17927
17939
|
|
|
17928
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
17940
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.537.0_@wirecat+cli-base@0.71.0_commander@15.0.0_esbuild@0.28.2_type_e3a3074c051d1ca759b7e8b914e3af6d/node_modules/@wirecat/cli-core/dist/services/task-categories.js
|
|
17929
17941
|
var names = /* @__PURE__ */ __name((categories) => categories.map(({ name }) => name).join(", "), "names");
|
|
17930
17942
|
var taskCategoryOf = /* @__PURE__ */ __name((categories = DEFAULT_TASK_CATEGORIES, flag = "--category") => (typed) => {
|
|
17931
17943
|
const name = typed.trim().toLowerCase();
|
|
@@ -17975,7 +17987,7 @@ var categorize = /* @__PURE__ */ __name((text2, categories = DEFAULT_TASK_CATEGO
|
|
|
17975
17987
|
return best.name;
|
|
17976
17988
|
}, "categorize");
|
|
17977
17989
|
|
|
17978
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
17990
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.537.0_@wirecat+cli-base@0.71.0_commander@15.0.0_esbuild@0.28.2_type_e3a3074c051d1ca759b7e8b914e3af6d/node_modules/@wirecat/cli-core/dist/services/task-rules.js
|
|
17979
17991
|
var taskAccount = /* @__PURE__ */ __name(({ provider, account }) => `${provider}:${account}`, "taskAccount");
|
|
17980
17992
|
var RULES_IN = {
|
|
17981
17993
|
dialog: "all",
|
|
@@ -18181,7 +18193,209 @@ var applyTaskRulesToChats = /* @__PURE__ */ __name(async (store, account, chatId
|
|
|
18181
18193
|
return passes;
|
|
18182
18194
|
}, "applyTaskRulesToChats");
|
|
18183
18195
|
|
|
18184
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
18196
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.537.0_@wirecat+cli-base@0.71.0_commander@15.0.0_esbuild@0.28.2_type_e3a3074c051d1ca759b7e8b914e3af6d/node_modules/@wirecat/cli-core/dist/sends/upload.js
|
|
18197
|
+
import { openAsBlob, realpathSync } from "node:fs";
|
|
18198
|
+
import { open, stat } from "node:fs/promises";
|
|
18199
|
+
import { basename, dirname, extname, isAbsolute, relative, resolve, sep } from "node:path";
|
|
18200
|
+
var MAX_BUFFERED_UPLOAD_BYTES = 256 * 1024 * 1024;
|
|
18201
|
+
var uploadSize = /* @__PURE__ */ __name((source) => source.kind === "file" ? source.size : source.bytes.byteLength, "uploadSize");
|
|
18202
|
+
var PHOTO = /* @__PURE__ */ new Set([".jpg", ".jpeg", ".png", ".webp"]);
|
|
18203
|
+
var VOICE = /* @__PURE__ */ new Set([".ogg", ".oga", ".opus"]);
|
|
18204
|
+
var JPEG = /* @__PURE__ */ __name((head) => head[0] === 255 && head[1] === 216 && head[2] === 255, "JPEG");
|
|
18205
|
+
var SIGNATURES = {
|
|
18206
|
+
".jpg": JPEG,
|
|
18207
|
+
".jpeg": JPEG,
|
|
18208
|
+
".png": /* @__PURE__ */ __name((head) => Buffer.from(head.subarray(0, 8)).toString("latin1") === "\x89PNG\r\n\n", ".png"),
|
|
18209
|
+
".webp": /* @__PURE__ */ __name((head) => {
|
|
18210
|
+
const text2 = Buffer.from(head).toString("latin1");
|
|
18211
|
+
return text2.startsWith("RIFF") && text2.slice(8, 12) === "WEBP";
|
|
18212
|
+
}, ".webp")
|
|
18213
|
+
};
|
|
18214
|
+
var fileHead = /* @__PURE__ */ __name(async (path) => {
|
|
18215
|
+
const file = await open(path, "r");
|
|
18216
|
+
try {
|
|
18217
|
+
const head = new Uint8Array(12);
|
|
18218
|
+
const { bytesRead } = await file.read(head, 0, head.length, 0);
|
|
18219
|
+
return head.subarray(0, bytesRead);
|
|
18220
|
+
} finally {
|
|
18221
|
+
await file.close();
|
|
18222
|
+
}
|
|
18223
|
+
}, "fileHead");
|
|
18224
|
+
var typesText = /* @__PURE__ */ __name((types2) => types2.length < 2 ? types2[0] ?? "" : `${types2.slice(0, -1).join(", ")} or ${types2.at(-1)}`, "typesText");
|
|
18225
|
+
var CREDENTIAL_PARTS = /* @__PURE__ */ new Set([
|
|
18226
|
+
".ssh",
|
|
18227
|
+
".gnupg",
|
|
18228
|
+
".aws",
|
|
18229
|
+
".azure",
|
|
18230
|
+
".kube",
|
|
18231
|
+
".secrets",
|
|
18232
|
+
"secrets",
|
|
18233
|
+
".password-store",
|
|
18234
|
+
".mozilla",
|
|
18235
|
+
".env",
|
|
18236
|
+
".npmrc",
|
|
18237
|
+
".pypirc",
|
|
18238
|
+
".netrc",
|
|
18239
|
+
"_netrc",
|
|
18240
|
+
".git-credentials",
|
|
18241
|
+
"credentials.yml.enc",
|
|
18242
|
+
"master.key"
|
|
18243
|
+
]);
|
|
18244
|
+
var CREDENTIAL_RUNS = [
|
|
18245
|
+
[".config", "autostart"],
|
|
18246
|
+
[".config", "git", "credentials"],
|
|
18247
|
+
[".config", "gh"],
|
|
18248
|
+
[".config", "gcloud"],
|
|
18249
|
+
[".config", "google-chrome"],
|
|
18250
|
+
[".config", "chromium"],
|
|
18251
|
+
[".config", "microsoft-edge"],
|
|
18252
|
+
[".config", "BraveSoftware"],
|
|
18253
|
+
[".docker", "config.json"],
|
|
18254
|
+
[".claude", ".credentials.json"],
|
|
18255
|
+
[".codex", "auth.json"],
|
|
18256
|
+
[".local", "share", "keyrings"],
|
|
18257
|
+
["Library", "Keychains"],
|
|
18258
|
+
["Library", "Cookies"],
|
|
18259
|
+
["Library", "Safari"],
|
|
18260
|
+
["Library", "Application Support", "Google", "Chrome"],
|
|
18261
|
+
["Library", "Application Support", "Chromium"],
|
|
18262
|
+
["Library", "Application Support", "Microsoft Edge"],
|
|
18263
|
+
["Library", "Application Support", "BraveSoftware"],
|
|
18264
|
+
["Library", "Application Support", "Firefox"],
|
|
18265
|
+
["AppData", "Local", "Google", "Chrome"],
|
|
18266
|
+
["AppData", "Local", "Chromium"],
|
|
18267
|
+
["AppData", "Local", "Microsoft", "Edge"],
|
|
18268
|
+
["AppData", "Local", "BraveSoftware"],
|
|
18269
|
+
["AppData", "Roaming", "Mozilla", "Firefox"],
|
|
18270
|
+
["AppData", "Local", "Microsoft", "Credentials"],
|
|
18271
|
+
["AppData", "Roaming", "Microsoft", "Credentials"],
|
|
18272
|
+
["AppData", "Roaming", "Microsoft", "Protect"],
|
|
18273
|
+
["AppData", "Roaming", "gcloud"],
|
|
18274
|
+
["AppData", "Roaming", "GitHub CLI"]
|
|
18275
|
+
];
|
|
18276
|
+
var WIRECAT_APPS = [
|
|
18277
|
+
{ appName: "max-cli", prefix: "MAX" },
|
|
18278
|
+
{ appName: "tg-cli", prefix: "TG" },
|
|
18279
|
+
{ appName: "whatsapp-cli", prefix: "WA" },
|
|
18280
|
+
{ appName: "cli-memo", prefix: "MEMO" },
|
|
18281
|
+
{ appName: "drive-cli", prefix: "DRIVE" },
|
|
18282
|
+
{ appName: "zm", prefix: "ZM" },
|
|
18283
|
+
{ appName: "cli-messaging", prefix: "MESSAGING" },
|
|
18284
|
+
{ appName: "cli-common", prefix: "CLI_COMMON" }
|
|
18285
|
+
];
|
|
18286
|
+
var refusedPlace = /* @__PURE__ */ __name((path, app, env, platform = process.platform) => {
|
|
18287
|
+
const own = [
|
|
18288
|
+
...[{ appName: app.appName, prefix: app.envPrefix }, ...WIRECAT_APPS].flatMap((one) => Object.values(resolvePaths({ ...one, env, platform }))),
|
|
18289
|
+
// The shared WireCat folder: the store, its backups beside it, the models.
|
|
18290
|
+
wirecatDirectory(env, platform)
|
|
18291
|
+
];
|
|
18292
|
+
const store = resolve(storePath(env));
|
|
18293
|
+
let ancestor = resolve(path);
|
|
18294
|
+
let real = ancestor;
|
|
18295
|
+
for (; ; ) {
|
|
18296
|
+
try {
|
|
18297
|
+
real = resolve(realpathSync(ancestor), relative(ancestor, resolve(path)));
|
|
18298
|
+
break;
|
|
18299
|
+
} catch {
|
|
18300
|
+
const parent = dirname(ancestor);
|
|
18301
|
+
if (parent === ancestor)
|
|
18302
|
+
break;
|
|
18303
|
+
ancestor = parent;
|
|
18304
|
+
}
|
|
18305
|
+
}
|
|
18306
|
+
const folded = platform === "darwin" || platform === "win32";
|
|
18307
|
+
const fold2 = /* @__PURE__ */ __name((text2) => folded ? text2.toLowerCase() : text2, "fold");
|
|
18308
|
+
const parts = new Set([...CREDENTIAL_PARTS].map(fold2));
|
|
18309
|
+
const runs = CREDENTIAL_RUNS.map((run) => run.map(fold2));
|
|
18310
|
+
const named2 = /* @__PURE__ */ __name((candidate) => {
|
|
18311
|
+
const names2 = candidate.split(sep).map(fold2);
|
|
18312
|
+
return names2.some((name, index) => parts.has(name) || /^\.env\./.test(name) || runs.some((run) => run.every((part, offset) => names2[index + offset] === part)));
|
|
18313
|
+
}, "named");
|
|
18314
|
+
const same2 = /* @__PURE__ */ __name((a, b) => fold2(a) === fold2(b), "same");
|
|
18315
|
+
return [resolve(path), real].some((candidate) => named2(candidate) || own.some((dir) => inside(fold2(candidate), fold2(dir))) || [store, `${store}-wal`, `${store}-shm`].some((file) => same2(candidate, file)));
|
|
18316
|
+
}, "refusedPlace");
|
|
18317
|
+
var inside = /* @__PURE__ */ __name((path, dir) => {
|
|
18318
|
+
const way = relative(resolve(dir), path);
|
|
18319
|
+
return way === "" || !way.startsWith("..") && !isAbsolute(way);
|
|
18320
|
+
}, "inside");
|
|
18321
|
+
var readUpload = /* @__PURE__ */ __name(async (kind, path, { app, env = process.env, anyFile = false, photoTypes }) => {
|
|
18322
|
+
const extension = extname(path).toLowerCase();
|
|
18323
|
+
if (kind === "photo" && photoTypes !== void 0 && !photoTypes.includes(extension)) {
|
|
18324
|
+
throw new CliError("validation_error", `this photo must be a ${typesText(photoTypes)} file, not ${path}`);
|
|
18325
|
+
}
|
|
18326
|
+
if (kind === "photo" && photoTypes === void 0 && !PHOTO.has(extension)) {
|
|
18327
|
+
throw new CliError("validation_error", `a photo is a .jpg, .png or .webp \u2014 send ${path} as a file instead`);
|
|
18328
|
+
}
|
|
18329
|
+
if (kind === "voice" && !VOICE.has(extension)) {
|
|
18330
|
+
throw new CliError("validation_error", `a voice message is Ogg Opus: .ogg, .oga or .opus \u2014 send ${path} as a file`);
|
|
18331
|
+
}
|
|
18332
|
+
if (!anyFile && refusedPlace(path, app, env)) {
|
|
18333
|
+
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`);
|
|
18334
|
+
}
|
|
18335
|
+
let size2;
|
|
18336
|
+
let head;
|
|
18337
|
+
try {
|
|
18338
|
+
const info = await stat(path);
|
|
18339
|
+
if (!info.isFile())
|
|
18340
|
+
throw Object.assign(new Error("not a file"), { code: "EISDIR" });
|
|
18341
|
+
size2 = info.size;
|
|
18342
|
+
if (photoTypes !== void 0 && SIGNATURES[extension] !== void 0)
|
|
18343
|
+
head = await fileHead(path);
|
|
18344
|
+
} catch (error) {
|
|
18345
|
+
const code = error.code;
|
|
18346
|
+
const reason = code === "ENOENT" ? "no such file" : code === "EISDIR" ? "it is a folder" : "it cannot be read";
|
|
18347
|
+
throw new CliError("validation_error", `cannot send ${path}: ${reason}`);
|
|
18348
|
+
}
|
|
18349
|
+
if (head !== void 0 && SIGNATURES[extension]?.(head) !== true) {
|
|
18350
|
+
throw new CliError("validation_error", `${path} is not a ${typesText(photoTypes ?? [])} image inside`);
|
|
18351
|
+
}
|
|
18352
|
+
return { kind, name: basename(path), source: { kind: "file", path: resolve(path), size: size2 } };
|
|
18353
|
+
}, "readUpload");
|
|
18354
|
+
var checkFilename = /* @__PURE__ */ __name((filename, files) => {
|
|
18355
|
+
if (files.length === 0)
|
|
18356
|
+
throw new CliError("validation_error", "--filename names a --file; give one");
|
|
18357
|
+
if (files.length > 1)
|
|
18358
|
+
throw new CliError("validation_error", "--filename names one --file; an album keeps its names");
|
|
18359
|
+
if (filename.trim() === "" || /[/\\\0]/.test(filename) || filename.length > 255)
|
|
18360
|
+
throw new CliError("validation_error", "--filename is a name, not a path: no / or \\, at most 255 characters");
|
|
18361
|
+
}, "checkFilename");
|
|
18362
|
+
var listOf2 = /* @__PURE__ */ __name((value) => value === void 0 ? [] : typeof value === "string" ? [value] : value, "listOf");
|
|
18363
|
+
var readAttachments = /* @__PURE__ */ __name(async ({ photo, file, voice, asFile, filename, text: text2 }, read) => {
|
|
18364
|
+
const photos = listOf2(photo);
|
|
18365
|
+
const files = listOf2(file);
|
|
18366
|
+
if (voice !== void 0 && (photos.length > 0 || files.length > 0 || (text2 ?? "").trim() !== "")) {
|
|
18367
|
+
throw new CliError("validation_error", "a voice message goes alone \u2014 no text, no file, no photo beside it");
|
|
18368
|
+
}
|
|
18369
|
+
if (asFile && files.length === 0)
|
|
18370
|
+
throw new CliError("validation_error", "--as-file is about a --file; give one");
|
|
18371
|
+
if (filename !== void 0)
|
|
18372
|
+
checkFilename(filename, files);
|
|
18373
|
+
const uploads = [];
|
|
18374
|
+
for (const one of photos)
|
|
18375
|
+
uploads.push(await readUpload("photo", one, read));
|
|
18376
|
+
for (const one of files)
|
|
18377
|
+
uploads.push({
|
|
18378
|
+
...await readUpload("file", one, read),
|
|
18379
|
+
...filename === void 0 ? {} : { name: filename },
|
|
18380
|
+
...asFile ? { asFile: true } : {}
|
|
18381
|
+
});
|
|
18382
|
+
if (voice !== void 0)
|
|
18383
|
+
uploads.push(await readUpload("voice", voice, read));
|
|
18384
|
+
return uploads;
|
|
18385
|
+
}, "readAttachments");
|
|
18386
|
+
var readStickerFile = /* @__PURE__ */ __name(async (path, maxBytes, read) => {
|
|
18387
|
+
if (extname(path).toLowerCase() !== ".webp")
|
|
18388
|
+
throw new CliError("validation_error", `a sticker is a .webp \u2014 send ${path} as a photo or a file instead`);
|
|
18389
|
+
const { name, source } = await readUpload("file", path, read);
|
|
18390
|
+
if (SIGNATURES[".webp"]?.(await fileHead(path)) !== true)
|
|
18391
|
+
throw new CliError("validation_error", `${path} is named .webp but is not a WebP image \u2014 nothing was sent`);
|
|
18392
|
+
const size2 = uploadSize(source);
|
|
18393
|
+
if (size2 > maxBytes)
|
|
18394
|
+
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`);
|
|
18395
|
+
return { name, source };
|
|
18396
|
+
}, "readStickerFile");
|
|
18397
|
+
|
|
18398
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.537.0_@wirecat+cli-base@0.71.0_commander@15.0.0_esbuild@0.28.2_type_e3a3074c051d1ca759b7e8b914e3af6d/node_modules/@wirecat/cli-core/dist/botcheck/check.js
|
|
18185
18399
|
var DAY_MS = 864e5;
|
|
18186
18400
|
var NEW_DAYS = 30;
|
|
18187
18401
|
var SAME_TEXT_MIN = 20;
|
|
@@ -18258,7 +18472,7 @@ var scorePerson = /* @__PURE__ */ __name(({ subject, provider, activity, photos,
|
|
|
18258
18472
|
};
|
|
18259
18473
|
}, "scorePerson");
|
|
18260
18474
|
|
|
18261
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
18475
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.537.0_@wirecat+cli-base@0.71.0_commander@15.0.0_esbuild@0.28.2_type_e3a3074c051d1ca759b7e8b914e3af6d/node_modules/@wirecat/cli-core/dist/botcheck/registries.js
|
|
18262
18476
|
var REGISTRIES = {
|
|
18263
18477
|
cas: { title: "Combot Anti-Spam (CAS)", docs: "https://cas.chat/api" },
|
|
18264
18478
|
lols: { title: "lols.bot", docs: "https://api.lols.bot/lols-bot.json" }
|
|
@@ -18343,7 +18557,7 @@ var notCovered = /* @__PURE__ */ __name((messenger, now = /* @__PURE__ */ new Da
|
|
|
18343
18557
|
detail: `lists Telegram accounts only, not ${messenger} ones`
|
|
18344
18558
|
})), "notCovered");
|
|
18345
18559
|
|
|
18346
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
18560
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.537.0_@wirecat+cli-base@0.71.0_commander@15.0.0_esbuild@0.28.2_type_e3a3074c051d1ca759b7e8b914e3af6d/node_modules/@wirecat/cli-core/dist/botcheck/service.js
|
|
18347
18561
|
var ACTIVITY_MESSAGES = 1e3;
|
|
18348
18562
|
var botCheckService = /* @__PURE__ */ __name((deps) => {
|
|
18349
18563
|
const subjectOf = /* @__PURE__ */ __name(async (reference) => {
|
|
@@ -18431,7 +18645,7 @@ var botCheckService = /* @__PURE__ */ __name((deps) => {
|
|
|
18431
18645
|
};
|
|
18432
18646
|
}, "botCheckService");
|
|
18433
18647
|
|
|
18434
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
18648
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.537.0_@wirecat+cli-base@0.71.0_commander@15.0.0_esbuild@0.28.2_type_e3a3074c051d1ca759b7e8b914e3af6d/node_modules/@wirecat/cli-core/dist/domain/thread.js
|
|
18435
18649
|
var threadIdOf = /* @__PURE__ */ __name((value) => {
|
|
18436
18650
|
if (value === void 0)
|
|
18437
18651
|
return void 0;
|
|
@@ -18441,7 +18655,7 @@ var threadIdOf = /* @__PURE__ */ __name((value) => {
|
|
|
18441
18655
|
return id2;
|
|
18442
18656
|
}, "threadIdOf");
|
|
18443
18657
|
|
|
18444
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
18658
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.537.0_@wirecat+cli-base@0.71.0_commander@15.0.0_esbuild@0.28.2_type_e3a3074c051d1ca759b7e8b914e3af6d/node_modules/@wirecat/cli-core/dist/services/chat-stats.js
|
|
18445
18659
|
var TOP_POSTS = 5;
|
|
18446
18660
|
var JOINS = /* @__PURE__ */ new Set(["join", "add"]);
|
|
18447
18661
|
var LEAVES = /* @__PURE__ */ new Set(["leave", "remove"]);
|
|
@@ -18558,7 +18772,7 @@ var median = /* @__PURE__ */ __name((values) => {
|
|
|
18558
18772
|
return Math.round(sorted.length % 2 === 0 ? ((sorted[middle - 1] ?? upper) + upper) / 2 : upper);
|
|
18559
18773
|
}, "median");
|
|
18560
18774
|
|
|
18561
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
18775
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.537.0_@wirecat+cli-base@0.71.0_commander@15.0.0_esbuild@0.28.2_type_e3a3074c051d1ca759b7e8b914e3af6d/node_modules/@wirecat/cli-core/dist/services/member-history.js
|
|
18562
18776
|
var memberEvents = /* @__PURE__ */ __name((stays, revisions, since = 0) => {
|
|
18563
18777
|
const events = [];
|
|
18564
18778
|
for (const stay of stays) {
|
|
@@ -18590,7 +18804,7 @@ var memberEvents = /* @__PURE__ */ __name((stays, revisions, since = 0) => {
|
|
|
18590
18804
|
return events.filter(({ at }) => Date.parse(at) >= since).sort((a, b) => Date.parse(a.at) - Date.parse(b.at) || a.id.localeCompare(b.id));
|
|
18591
18805
|
}, "memberEvents");
|
|
18592
18806
|
|
|
18593
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
18807
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.537.0_@wirecat+cli-base@0.71.0_commander@15.0.0_esbuild@0.28.2_type_e3a3074c051d1ca759b7e8b914e3af6d/node_modules/@wirecat/cli-core/dist/services/message-resolution.js
|
|
18594
18808
|
var readChatId = /* @__PURE__ */ __name(async (deps, reference, store, account) => {
|
|
18595
18809
|
if (deps.reads !== "store")
|
|
18596
18810
|
return keptChatId(deps.messenger, reference, store, account);
|
|
@@ -18737,7 +18951,7 @@ var senderAmong = /* @__PURE__ */ __name(async (store, accounts, reference) => {
|
|
|
18737
18951
|
}
|
|
18738
18952
|
}, "senderAmong");
|
|
18739
18953
|
|
|
18740
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
18954
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.537.0_@wirecat+cli-base@0.71.0_commander@15.0.0_esbuild@0.28.2_type_e3a3074c051d1ca759b7e8b914e3af6d/node_modules/@wirecat/cli-core/dist/services/chats.js
|
|
18741
18955
|
var EVENTS_DAYS = 7;
|
|
18742
18956
|
var TRACKED_DAYS = 30;
|
|
18743
18957
|
var STATS_PAGE = 1e3;
|
|
@@ -19032,7 +19246,7 @@ var storedMembers = /* @__PURE__ */ __name(async (store, chatId) => {
|
|
|
19032
19246
|
return members.length === 0 ? null : members;
|
|
19033
19247
|
}, "storedMembers");
|
|
19034
19248
|
|
|
19035
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
19249
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.537.0_@wirecat+cli-base@0.71.0_commander@15.0.0_esbuild@0.28.2_type_e3a3074c051d1ca759b7e8b914e3af6d/node_modules/@wirecat/cli-core/dist/services/inbox.js
|
|
19036
19250
|
var INBOX_CHATS = 20;
|
|
19037
19251
|
var REVIEW_DAYS = 3;
|
|
19038
19252
|
var UNANSWERED_HOURS = 24;
|
|
@@ -19240,7 +19454,7 @@ var inboxService = /* @__PURE__ */ __name((deps) => {
|
|
|
19240
19454
|
};
|
|
19241
19455
|
}, "inboxService");
|
|
19242
19456
|
|
|
19243
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
19457
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.537.0_@wirecat+cli-base@0.71.0_commander@15.0.0_esbuild@0.28.2_type_e3a3074c051d1ca759b7e8b914e3af6d/node_modules/@wirecat/cli-core/dist/services/person-context.js
|
|
19244
19458
|
var CONTEXT_MESSAGES = 10;
|
|
19245
19459
|
var CONTEXT_BYTES = 64 * 1024;
|
|
19246
19460
|
var toContext = /* @__PURE__ */ __name((key, message, chatTitle) => ({
|
|
@@ -19496,10 +19710,10 @@ var personMessages = /* @__PURE__ */ __name(async (store, asked, reference, { ch
|
|
|
19496
19710
|
};
|
|
19497
19711
|
}, "personMessages");
|
|
19498
19712
|
|
|
19499
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
19713
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.537.0_@wirecat+cli-base@0.71.0_commander@15.0.0_esbuild@0.28.2_type_e3a3074c051d1ca759b7e8b914e3af6d/node_modules/@wirecat/cli-core/dist/services/meeting-evidence.js
|
|
19500
19714
|
import { createHash } from "node:crypto";
|
|
19501
19715
|
|
|
19502
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
19716
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.537.0_@wirecat+cli-base@0.71.0_commander@15.0.0_esbuild@0.28.2_type_e3a3074c051d1ca759b7e8b914e3af6d/node_modules/@wirecat/cli-core/dist/services/meeting-reference.js
|
|
19503
19717
|
var missing2 = /* @__PURE__ */ __name(() => new CliError("not_found", "the meeting evidence is unavailable for this account"), "missing");
|
|
19504
19718
|
var authorizedMeetingMetadata = /* @__PURE__ */ __name(async (store, accountId, reference, options = {}) => {
|
|
19505
19719
|
const parsed = parseMeetingReference(reference);
|
|
@@ -19517,7 +19731,7 @@ var authorizedMeetingMetadata = /* @__PURE__ */ __name(async (store, accountId,
|
|
|
19517
19731
|
return { parsed, meeting };
|
|
19518
19732
|
}, "authorizedMeetingMetadata");
|
|
19519
19733
|
|
|
19520
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
19734
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.537.0_@wirecat+cli-base@0.71.0_commander@15.0.0_esbuild@0.28.2_type_e3a3074c051d1ca759b7e8b914e3af6d/node_modules/@wirecat/cli-core/dist/services/meeting-evidence.js
|
|
19521
19735
|
var hash = /* @__PURE__ */ __name((value) => createHash("sha256").update(JSON.stringify(value)).digest("hex"), "hash");
|
|
19522
19736
|
var checkMeetingCancelled = /* @__PURE__ */ __name((signal) => {
|
|
19523
19737
|
if (signal?.aborted)
|
|
@@ -19716,7 +19930,7 @@ var readMeetingEvidence = /* @__PURE__ */ __name(async (store, accountId, refere
|
|
|
19716
19930
|
return { ...packet, fingerprint: hash(packet) };
|
|
19717
19931
|
}, "readMeetingEvidence");
|
|
19718
19932
|
|
|
19719
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
19933
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.537.0_@wirecat+cli-base@0.71.0_commander@15.0.0_esbuild@0.28.2_type_e3a3074c051d1ca759b7e8b914e3af6d/node_modules/@wirecat/cli-core/dist/services/person-meeting-context.js
|
|
19720
19934
|
var personMeetingContext = /* @__PURE__ */ __name(async (store, personReference, options) => {
|
|
19721
19935
|
const { meetings = 10, cues = 5, bytes: bytes2 = 64 * 1024, scanLimit = 1e3, since, signal } = options;
|
|
19722
19936
|
const requestedAccounts = options.accountIds;
|
|
@@ -19815,7 +20029,7 @@ var personMeetingContext = /* @__PURE__ */ __name(async (store, personReference,
|
|
|
19815
20029
|
};
|
|
19816
20030
|
}, "personMeetingContext");
|
|
19817
20031
|
|
|
19818
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
20032
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.537.0_@wirecat+cli-base@0.71.0_commander@15.0.0_esbuild@0.28.2_type_e3a3074c051d1ca759b7e8b914e3af6d/node_modules/@wirecat/cli-core/dist/services/person-preparation.js
|
|
19819
20033
|
var PREPARE_BYTES = 96 * 1024;
|
|
19820
20034
|
var MEETINGS = 5;
|
|
19821
20035
|
var CUES = 3;
|
|
@@ -19932,7 +20146,7 @@ var meetingsOf = /* @__PURE__ */ __name(async (store, uid, stored, since, left)
|
|
|
19932
20146
|
}
|
|
19933
20147
|
}, "meetingsOf");
|
|
19934
20148
|
|
|
19935
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
20149
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.537.0_@wirecat+cli-base@0.71.0_commander@15.0.0_esbuild@0.28.2_type_e3a3074c051d1ca759b7e8b914e3af6d/node_modules/@wirecat/cli-core/dist/services/person-profile.js
|
|
19936
20150
|
var personProfile = /* @__PURE__ */ __name(async (deps, person, known2) => {
|
|
19937
20151
|
const online = deps.offline ? void 0 : await deps.connection();
|
|
19938
20152
|
const held = await storeIfOpen(deps);
|
|
@@ -20002,7 +20216,7 @@ var quiet = /* @__PURE__ */ __name((facts) => facts.chats.map(({ id: id2, title,
|
|
|
20002
20216
|
complete: false
|
|
20003
20217
|
})), "quiet");
|
|
20004
20218
|
|
|
20005
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
20219
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.537.0_@wirecat+cli-base@0.71.0_commander@15.0.0_esbuild@0.28.2_type_e3a3074c051d1ca759b7e8b914e3af6d/node_modules/@wirecat/cli-core/dist/services/person-timeline.js
|
|
20006
20220
|
var TIMELINE_ITEMS = 50;
|
|
20007
20221
|
var TIMELINE_MAX = 500;
|
|
20008
20222
|
var SCOPES = ["personal", "work"];
|
|
@@ -20057,7 +20271,7 @@ var personTimeline = /* @__PURE__ */ __name(async (store, asked, reference, { sc
|
|
|
20057
20271
|
};
|
|
20058
20272
|
}, "personTimeline");
|
|
20059
20273
|
|
|
20060
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
20274
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.537.0_@wirecat+cli-base@0.71.0_commander@15.0.0_esbuild@0.28.2_type_e3a3074c051d1ca759b7e8b914e3af6d/node_modules/@wirecat/cli-core/dist/services/people.js
|
|
20061
20275
|
var peopleService = /* @__PURE__ */ __name((deps) => {
|
|
20062
20276
|
const localCard = /* @__PURE__ */ __name(async (card, includeNotes = false) => {
|
|
20063
20277
|
const held = await storeIfOpen(deps);
|
|
@@ -20284,7 +20498,7 @@ var withoutPhone = /* @__PURE__ */ __name((answer) => {
|
|
|
20284
20498
|
return rest;
|
|
20285
20499
|
}, "withoutPhone");
|
|
20286
20500
|
|
|
20287
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
20501
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.537.0_@wirecat+cli-base@0.71.0_commander@15.0.0_esbuild@0.28.2_type_e3a3074c051d1ca759b7e8b914e3af6d/node_modules/@wirecat/cli-core/dist/services/task-tag-filters.js
|
|
20288
20502
|
var taskTagFilters = /* @__PURE__ */ __name(async (store, query) => {
|
|
20289
20503
|
const tags = /* @__PURE__ */ new Map();
|
|
20290
20504
|
for (const node of query ? walkQuery(query.root) : [])
|
|
@@ -20293,7 +20507,7 @@ var taskTagFilters = /* @__PURE__ */ __name(async (store, query) => {
|
|
|
20293
20507
|
return tags;
|
|
20294
20508
|
}, "taskTagFilters");
|
|
20295
20509
|
|
|
20296
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
20510
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.537.0_@wirecat+cli-base@0.71.0_commander@15.0.0_esbuild@0.28.2_type_e3a3074c051d1ca759b7e8b914e3af6d/node_modules/@wirecat/cli-core/dist/services/tasks.js
|
|
20297
20511
|
var TASK_QUERY = {
|
|
20298
20512
|
entity: "task",
|
|
20299
20513
|
backend: "sql",
|
|
@@ -20478,7 +20692,7 @@ var tasksService = /* @__PURE__ */ __name((deps, categories) => {
|
|
|
20478
20692
|
...previews ? { previews: await Promise.all(shown.map(({ task: task2 }) => taskView(store, account, task2))) } : {}
|
|
20479
20693
|
};
|
|
20480
20694
|
}), "list"),
|
|
20481
|
-
add: /* @__PURE__ */ __name((message, type, origin, { category: named2, ...plan } = {}, choice = {}) => inStore(async (store, account) => {
|
|
20695
|
+
add: /* @__PURE__ */ __name((message, type, origin, { category: named2, ...plan } = {}, choice = {}, author = void 0) => inStore(async (store, account) => {
|
|
20482
20696
|
const chosen = named2 === void 0 ? void 0 : await categoryOf(store, named2);
|
|
20483
20697
|
const source = message.trim();
|
|
20484
20698
|
const native = isNoteReference(source);
|
|
@@ -20513,7 +20727,7 @@ var tasksService = /* @__PURE__ */ __name((deps, categories) => {
|
|
|
20513
20727
|
...plan.dueAt ? { due: plan.dueAt } : {}
|
|
20514
20728
|
};
|
|
20515
20729
|
const subject = { account: taskAccount(account), draft };
|
|
20516
|
-
const by = origin === "owner" ? "owner" : { bot: origin };
|
|
20730
|
+
const by = author ?? (origin === "owner" ? "owner" : { bot: origin });
|
|
20517
20731
|
if (choice.attach !== void 0) {
|
|
20518
20732
|
const target2 = await owned(store, account, choice.attach);
|
|
20519
20733
|
const similarity = await store.tasks.compare(subject, target2.id);
|
|
@@ -20773,7 +20987,7 @@ var taskView = /* @__PURE__ */ __name(async (store, account, task2) => {
|
|
|
20773
20987
|
};
|
|
20774
20988
|
}, "taskView");
|
|
20775
20989
|
|
|
20776
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
20990
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.537.0_@wirecat+cli-base@0.71.0_commander@15.0.0_esbuild@0.28.2_type_e3a3074c051d1ca759b7e8b914e3af6d/node_modules/@wirecat/cli-core/dist/services/chat-coverage.js
|
|
20777
20991
|
var chatCoverage = /* @__PURE__ */ __name(async (store, account, chatIds) => {
|
|
20778
20992
|
const ids = [...new Set(chatIds)];
|
|
20779
20993
|
if (ids.length === 0)
|
|
@@ -20799,7 +21013,7 @@ var chatCoverage = /* @__PURE__ */ __name(async (store, account, chatIds) => {
|
|
|
20799
21013
|
}));
|
|
20800
21014
|
}, "chatCoverage");
|
|
20801
21015
|
|
|
20802
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
21016
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.537.0_@wirecat+cli-base@0.71.0_commander@15.0.0_esbuild@0.28.2_type_e3a3074c051d1ca759b7e8b914e3af6d/node_modules/@wirecat/cli-core/dist/context/evidence-response.js
|
|
20803
21017
|
var contextSourceKey = /* @__PURE__ */ __name((source) => JSON.stringify([source.kind, source.accountId, source.provider, source.account]), "contextSourceKey");
|
|
20804
21018
|
var validateContextEvidencePage = /* @__PURE__ */ __name((page, request) => {
|
|
20805
21019
|
const fail2 = /* @__PURE__ */ __name(() => {
|
|
@@ -20863,7 +21077,7 @@ var validateContextEvidencePage = /* @__PURE__ */ __name((page, request) => {
|
|
|
20863
21077
|
}
|
|
20864
21078
|
}, "validateContextEvidencePage");
|
|
20865
21079
|
|
|
20866
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
21080
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.537.0_@wirecat+cli-base@0.71.0_commander@15.0.0_esbuild@0.28.2_type_e3a3074c051d1ca759b7e8b914e3af6d/node_modules/@wirecat/cli-core/dist/context/read-budget.js
|
|
20867
21081
|
var contextReadBudget = /* @__PURE__ */ __name((limits = {}) => {
|
|
20868
21082
|
if (!limits || typeof limits !== "object" || Array.isArray(limits))
|
|
20869
21083
|
throw new CliError("validation_error", "limits needs a context read allowance");
|
|
@@ -20916,7 +21130,7 @@ var contextReadBudget = /* @__PURE__ */ __name((limits = {}) => {
|
|
|
20916
21130
|
};
|
|
20917
21131
|
}, "contextReadBudget");
|
|
20918
21132
|
|
|
20919
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
21133
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.537.0_@wirecat+cli-base@0.71.0_commander@15.0.0_esbuild@0.28.2_type_e3a3074c051d1ca759b7e8b914e3af6d/node_modules/@wirecat/cli-core/dist/services/context-evidence.js
|
|
20920
21134
|
var createContextEvidenceReader = /* @__PURE__ */ __name((port, allowed, limits) => {
|
|
20921
21135
|
if (!port || typeof port.read !== "function")
|
|
20922
21136
|
throw new CliError("configuration_error", "context evidence reader is unavailable");
|
|
@@ -20960,7 +21174,7 @@ var createContextEvidenceReader = /* @__PURE__ */ __name((port, allowed, limits)
|
|
|
20960
21174
|
};
|
|
20961
21175
|
}, "createContextEvidenceReader");
|
|
20962
21176
|
|
|
20963
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
21177
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.537.0_@wirecat+cli-base@0.71.0_commander@15.0.0_esbuild@0.28.2_type_e3a3074c051d1ca759b7e8b914e3af6d/node_modules/@wirecat/cli-core/dist/services/excerpt.js
|
|
20964
21178
|
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");
|
|
20965
21179
|
var excerpt = /* @__PURE__ */ __name((text2, query, size2 = 240, options = {}) => {
|
|
20966
21180
|
const flat = text2.replace(/\s+/g, " ").trim();
|
|
@@ -20976,18 +21190,18 @@ var excerpt = /* @__PURE__ */ __name((text2, query, size2 = 240, options = {}) =
|
|
|
20976
21190
|
}, "excerpt");
|
|
20977
21191
|
var withExcerpt = /* @__PURE__ */ __name(({ matchedText, ...hit }, query) => ({ ...hit, excerpt: excerpt(matchedText ?? hit.text, query) }), "withExcerpt");
|
|
20978
21192
|
|
|
20979
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
21193
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.537.0_@wirecat+cli-base@0.71.0_commander@15.0.0_esbuild@0.28.2_type_e3a3074c051d1ca759b7e8b914e3af6d/node_modules/@wirecat/cli-core/dist/services/media-archive.js
|
|
20980
21194
|
import { setTimeout as sleep } from "node:timers/promises";
|
|
20981
21195
|
|
|
20982
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
21196
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.537.0_@wirecat+cli-base@0.71.0_commander@15.0.0_esbuild@0.28.2_type_e3a3074c051d1ca759b7e8b914e3af6d/node_modules/@wirecat/cli-core/dist/services/media-archive-files.js
|
|
20983
21197
|
import { lstat } from "node:fs/promises";
|
|
20984
21198
|
|
|
20985
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
21199
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.537.0_@wirecat+cli-base@0.71.0_commander@15.0.0_esbuild@0.28.2_type_e3a3074c051d1ca759b7e8b914e3af6d/node_modules/@wirecat/cli-core/dist/persistence/native/recording-partial-store.js
|
|
20986
21200
|
import { createHash as createHash3, randomUUID as randomUUID2 } from "node:crypto";
|
|
20987
|
-
import { open as
|
|
21201
|
+
import { open as open3, rename as rename2, unlink as unlink2 } from "node:fs/promises";
|
|
20988
21202
|
import { join as join2 } from "node:path";
|
|
20989
21203
|
|
|
20990
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
21204
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.537.0_@wirecat+cli-base@0.71.0_commander@15.0.0_esbuild@0.28.2_type_e3a3074c051d1ca759b7e8b914e3af6d/node_modules/@wirecat/cli-core/dist/persistence/native/recording-partial-metadata.js
|
|
20991
21205
|
import { createHash as createHash2 } from "node:crypto";
|
|
20992
21206
|
var metadataLimit = 16384;
|
|
20993
21207
|
var partialIdentity = /* @__PURE__ */ __name((locator) => JSON.stringify([locator.provider, locator.account, locator.occurrenceId, locator.assetId]), "partialIdentity");
|
|
@@ -21047,9 +21261,9 @@ var readPartialMetadata = /* @__PURE__ */ __name(async (path, locator, maxBytes,
|
|
|
21047
21261
|
}
|
|
21048
21262
|
}, "readPartialMetadata");
|
|
21049
21263
|
|
|
21050
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
21264
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.537.0_@wirecat+cli-base@0.71.0_commander@15.0.0_esbuild@0.28.2_type_e3a3074c051d1ca759b7e8b914e3af6d/node_modules/@wirecat/cli-core/dist/persistence/native/recording-partial-writer.js
|
|
21051
21265
|
import { randomUUID } from "node:crypto";
|
|
21052
|
-
import { open, rename, unlink } from "node:fs/promises";
|
|
21266
|
+
import { open as open2, rename, unlink } from "node:fs/promises";
|
|
21053
21267
|
import { join } from "node:path";
|
|
21054
21268
|
var partialWriter = /* @__PURE__ */ __name(async (input) => {
|
|
21055
21269
|
const { file, signal, partial } = input;
|
|
@@ -21077,7 +21291,7 @@ var partialWriter = /* @__PURE__ */ __name(async (input) => {
|
|
|
21077
21291
|
if (Buffer.byteLength(content) > metadataLimit)
|
|
21078
21292
|
throw new CliError("validation_error", "recording partial metadata exceeds its byte limit");
|
|
21079
21293
|
const temp = join(input.root, `${input.prefix}${randomUUID()}.tmp`);
|
|
21080
|
-
const metadata = await
|
|
21294
|
+
const metadata = await open2(temp, "wx", 384);
|
|
21081
21295
|
try {
|
|
21082
21296
|
try {
|
|
21083
21297
|
await metadata.writeFile(content);
|
|
@@ -21139,7 +21353,7 @@ var partialWriter = /* @__PURE__ */ __name(async (input) => {
|
|
|
21139
21353
|
};
|
|
21140
21354
|
}, "partialWriter");
|
|
21141
21355
|
|
|
21142
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
21356
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.537.0_@wirecat+cli-base@0.71.0_commander@15.0.0_esbuild@0.28.2_type_e3a3074c051d1ca759b7e8b914e3af6d/node_modules/@wirecat/cli-core/dist/persistence/native/recording-partial-store.js
|
|
21143
21357
|
var NativeRecordingPartialStore = class {
|
|
21144
21358
|
static {
|
|
21145
21359
|
__name(this, "NativeRecordingPartialStore");
|
|
@@ -21205,7 +21419,7 @@ var NativeRecordingPartialStore = class {
|
|
|
21205
21419
|
file = await openOrdinaryFile(this.path, { writable: true });
|
|
21206
21420
|
} else {
|
|
21207
21421
|
const temp = join2(this.root, `${this.options.prefix}${randomUUID2()}.tmp`);
|
|
21208
|
-
file = await
|
|
21422
|
+
file = await open3(temp, "wx+", 384);
|
|
21209
21423
|
try {
|
|
21210
21424
|
await rename2(temp, this.path);
|
|
21211
21425
|
await unlink2(this.metadataPath).catch((error) => {
|
|
@@ -21246,12 +21460,12 @@ var NativeRecordingPartialStore = class {
|
|
|
21246
21460
|
}
|
|
21247
21461
|
};
|
|
21248
21462
|
|
|
21249
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
21463
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.537.0_@wirecat+cli-base@0.71.0_commander@15.0.0_esbuild@0.28.2_type_e3a3074c051d1ca759b7e8b914e3af6d/node_modules/@wirecat/cli-core/dist/persistence/native/recording-publication.js
|
|
21250
21464
|
import { createHash as createHash4 } from "node:crypto";
|
|
21251
21465
|
import { link as link2 } from "node:fs/promises";
|
|
21252
|
-
import { basename, dirname, join as join4, resolve } from "node:path";
|
|
21466
|
+
import { basename as basename2, dirname as dirname2, join as join4, resolve as resolve2 } from "node:path";
|
|
21253
21467
|
|
|
21254
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
21468
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.537.0_@wirecat+cli-base@0.71.0_commander@15.0.0_esbuild@0.28.2_type_e3a3074c051d1ca759b7e8b914e3af6d/node_modules/@wirecat/cli-core/dist/persistence/native/recording-publication-files.js
|
|
21255
21469
|
import { unlink as unlink3 } from "node:fs/promises";
|
|
21256
21470
|
var verifiedPublicationFile = /* @__PURE__ */ __name(async (path, expected, signal, writable = false) => {
|
|
21257
21471
|
signal?.throwIfAborted();
|
|
@@ -21286,9 +21500,9 @@ var commitPublication = /* @__PURE__ */ __name(async (root, partialPath, finalPa
|
|
|
21286
21500
|
signal?.throwIfAborted();
|
|
21287
21501
|
}, "commitPublication");
|
|
21288
21502
|
|
|
21289
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
21503
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.537.0_@wirecat+cli-base@0.71.0_commander@15.0.0_esbuild@0.28.2_type_e3a3074c051d1ca759b7e8b914e3af6d/node_modules/@wirecat/cli-core/dist/persistence/native/recording-publication-journal.js
|
|
21290
21504
|
import { randomUUID as randomUUID3 } from "node:crypto";
|
|
21291
|
-
import { open as
|
|
21505
|
+
import { open as open4, rename as rename3, unlink as unlink4 } from "node:fs/promises";
|
|
21292
21506
|
import { join as join3 } from "node:path";
|
|
21293
21507
|
var readPublicationJournal = /* @__PURE__ */ __name(async (path, codec, limit, signal) => {
|
|
21294
21508
|
signal?.throwIfAborted();
|
|
@@ -21334,7 +21548,7 @@ var writePublicationJournal = /* @__PURE__ */ __name(async (root, path, prefix,
|
|
|
21334
21548
|
throw new CliError("validation_error", "recording recovery record exceeds its metadata limit");
|
|
21335
21549
|
codec.decode(JSON.parse(content));
|
|
21336
21550
|
const temp = join3(root, `${prefix}${randomUUID3()}.tmp`);
|
|
21337
|
-
const handle = await
|
|
21551
|
+
const handle = await open4(temp, "wx", 384);
|
|
21338
21552
|
let identity;
|
|
21339
21553
|
try {
|
|
21340
21554
|
try {
|
|
@@ -21359,7 +21573,7 @@ var writePublicationJournal = /* @__PURE__ */ __name(async (root, path, prefix,
|
|
|
21359
21573
|
}
|
|
21360
21574
|
}, "writePublicationJournal");
|
|
21361
21575
|
|
|
21362
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
21576
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.537.0_@wirecat+cli-base@0.71.0_commander@15.0.0_esbuild@0.28.2_type_e3a3074c051d1ca759b7e8b914e3af6d/node_modules/@wirecat/cli-core/dist/persistence/native/recording-publication.js
|
|
21363
21577
|
var NativeRecordingPublication = class {
|
|
21364
21578
|
static {
|
|
21365
21579
|
__name(this, "NativeRecordingPublication");
|
|
@@ -21371,7 +21585,7 @@ var NativeRecordingPublication = class {
|
|
|
21371
21585
|
options;
|
|
21372
21586
|
constructor(root, locator, options) {
|
|
21373
21587
|
this.root = root;
|
|
21374
|
-
if (!root || root.includes("\0") || !/^\.[a-zA-Z0-9][a-zA-Z0-9._-]{0,95}-$/.test(options.prefix) || !options.filename ||
|
|
21588
|
+
if (!root || root.includes("\0") || !/^\.[a-zA-Z0-9][a-zA-Z0-9._-]{0,95}-$/.test(options.prefix) || !options.filename || basename2(options.filename) !== options.filename || /[\\/\0]/.test(options.filename) || [".", ".."].includes(options.filename) || !Number.isSafeInteger(options.maxBytes) || options.maxBytes <= 0 || !Number.isSafeInteger(options.metadataLimit) || options.metadataLimit <= 0 || options.metadataLimit > 1048576 || [locator.provider, locator.account, locator.occurrenceId, locator.assetId].some((value) => typeof value !== "string" || !value.trim() || /[\0\r\n]/.test(value)))
|
|
21375
21589
|
throw new CliError("validation_error", "invalid native recording publication options");
|
|
21376
21590
|
this.scope = partialIdentity(locator);
|
|
21377
21591
|
this.options = Object.freeze({ ...options, codec: Object.freeze({ ...options.codec }) });
|
|
@@ -21387,7 +21601,7 @@ var NativeRecordingPublication = class {
|
|
|
21387
21601
|
return writePublicationJournal(this.root, this.journalPath, this.options.prefix, value, this.options.codec, this.options.metadataLimit, this.options.signal);
|
|
21388
21602
|
}
|
|
21389
21603
|
validate(partialPath, expected) {
|
|
21390
|
-
if (
|
|
21604
|
+
if (resolve2(dirname2(partialPath)) !== resolve2(this.root) || resolve2(partialPath) === resolve2(this.finalPath) || resolve2(partialPath) === resolve2(this.journalPath) || !Number.isSafeInteger(expected.size) || expected.size < 0 || expected.size > this.options.maxBytes || typeof expected.sha256 !== "string" || !/^[a-f0-9]{64}$/.test(expected.sha256))
|
|
21391
21605
|
throw new CliError("validation_error", "invalid recording publication evidence");
|
|
21392
21606
|
this.options.signal?.throwIfAborted();
|
|
21393
21607
|
}
|
|
@@ -21432,10 +21646,10 @@ var NativeRecordingPublication = class {
|
|
|
21432
21646
|
}
|
|
21433
21647
|
};
|
|
21434
21648
|
|
|
21435
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
21649
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.537.0_@wirecat+cli-base@0.71.0_commander@15.0.0_esbuild@0.28.2_type_e3a3074c051d1ca759b7e8b914e3af6d/node_modules/@wirecat/cli-core/dist/services/media-archive-manifest.js
|
|
21436
21650
|
import { createHash as createHash5 } from "node:crypto";
|
|
21437
21651
|
import { readdir } from "node:fs/promises";
|
|
21438
|
-
import { isAbsolute, join as join5, resolve as
|
|
21652
|
+
import { isAbsolute as isAbsolute2, join as join5, resolve as resolve3 } from "node:path";
|
|
21439
21653
|
var mediaKey = /* @__PURE__ */ __name((one) => createHash5("sha256").update(JSON.stringify([one.provider, one.account, one.chat, one.message, one.position])).digest("hex"), "mediaKey");
|
|
21440
21654
|
var mediaManifestName = /* @__PURE__ */ __name((one) => `.media-archive-${mediaKey(one)}.json`, "mediaManifestName");
|
|
21441
21655
|
var missingMediaFile = /* @__PURE__ */ __name((error) => typeof error === "object" && error !== null && "code" in error && error.code === "ENOENT", "missingMediaFile");
|
|
@@ -21455,7 +21669,7 @@ var parseMediaEntry = /* @__PURE__ */ __name((value) => {
|
|
|
21455
21669
|
"messageTime",
|
|
21456
21670
|
"mime",
|
|
21457
21671
|
"relocatedTo"
|
|
21458
|
-
].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" || !
|
|
21672
|
+
].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" || !isAbsolute2(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`)
|
|
21459
21673
|
throw new CliError("validation_error", "invalid media archive manifest");
|
|
21460
21674
|
return { ...one };
|
|
21461
21675
|
}, "parseMediaEntry");
|
|
@@ -21494,7 +21708,7 @@ var readMediaManifests = /* @__PURE__ */ __name(async (root, signal) => {
|
|
|
21494
21708
|
return entries;
|
|
21495
21709
|
}, "readMediaManifests");
|
|
21496
21710
|
var verifyMediaEntry = /* @__PURE__ */ __name(async (root, one, signal) => {
|
|
21497
|
-
let location =
|
|
21711
|
+
let location = resolve3(root);
|
|
21498
21712
|
let entry = one;
|
|
21499
21713
|
const visited = /* @__PURE__ */ new Set();
|
|
21500
21714
|
while (entry.relocatedTo !== void 0) {
|
|
@@ -21502,7 +21716,7 @@ var verifyMediaEntry = /* @__PURE__ */ __name(async (root, one, signal) => {
|
|
|
21502
21716
|
if (visited.has(location) || visited.size >= 64)
|
|
21503
21717
|
throw new CliError("validation_error", "media archive relocation cycle or excessive depth");
|
|
21504
21718
|
visited.add(location);
|
|
21505
|
-
location =
|
|
21719
|
+
location = resolve3(entry.relocatedTo);
|
|
21506
21720
|
const target2 = parseMediaEntry(JSON.parse(await readBoundedUtf8File(join5(location, mediaManifestName(one)), { maxBytes: 16384 })));
|
|
21507
21721
|
if (!sameMediaCopy(one, target2))
|
|
21508
21722
|
return false;
|
|
@@ -21519,7 +21733,7 @@ var commitMediaEntry = /* @__PURE__ */ __name((root, one, beforePublish) => writ
|
|
|
21519
21733
|
beforePublish
|
|
21520
21734
|
}), "commitMediaEntry");
|
|
21521
21735
|
|
|
21522
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
21736
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.537.0_@wirecat+cli-base@0.71.0_commander@15.0.0_esbuild@0.28.2_type_e3a3074c051d1ca759b7e8b914e3af6d/node_modules/@wirecat/cli-core/dist/services/media-archive-files.js
|
|
21523
21737
|
var validator = '"media-completed-v1"';
|
|
21524
21738
|
var maximumFileBytes = 64 * 1024 * 1024 * 1024;
|
|
21525
21739
|
var archiveMediaFile = /* @__PURE__ */ __name(async (root, identity, kind, file, beforeWrite, signal, metadata = {}) => {
|
|
@@ -21620,12 +21834,12 @@ var archiveMediaFile = /* @__PURE__ */ __name(async (root, identity, kind, file,
|
|
|
21620
21834
|
return entry;
|
|
21621
21835
|
}, "archiveMediaFile");
|
|
21622
21836
|
|
|
21623
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
21837
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.537.0_@wirecat+cli-base@0.71.0_commander@15.0.0_esbuild@0.28.2_type_e3a3074c051d1ca759b7e8b914e3af6d/node_modules/@wirecat/cli-core/dist/services/media-archive-locks.js
|
|
21624
21838
|
import { mkdir, realpath } from "node:fs/promises";
|
|
21625
|
-
import { join as join6, resolve as
|
|
21839
|
+
import { join as join6, resolve as resolve4 } from "node:path";
|
|
21626
21840
|
var archiveLocations = /* @__PURE__ */ __name(async (initial, signal) => {
|
|
21627
21841
|
const roots = /* @__PURE__ */ new Set();
|
|
21628
|
-
const queued = new Set(initial.map((directory2) =>
|
|
21842
|
+
const queued = new Set(initial.map((directory2) => resolve4(directory2)));
|
|
21629
21843
|
const pending = [...queued];
|
|
21630
21844
|
for (let at = 0; at < pending.length; at++) {
|
|
21631
21845
|
signal?.throwIfAborted();
|
|
@@ -21644,7 +21858,7 @@ var archiveLocations = /* @__PURE__ */ __name(async (initial, signal) => {
|
|
|
21644
21858
|
roots.add(root);
|
|
21645
21859
|
for (const entry of await readMediaManifests(root, signal))
|
|
21646
21860
|
if (entry.relocatedTo) {
|
|
21647
|
-
const location =
|
|
21861
|
+
const location = resolve4(entry.relocatedTo);
|
|
21648
21862
|
if (!queued.has(location)) {
|
|
21649
21863
|
queued.add(location);
|
|
21650
21864
|
pending.push(location);
|
|
@@ -21687,7 +21901,7 @@ var withMediaArchiveLocks = /* @__PURE__ */ __name(async (directory2, signal, ru
|
|
|
21687
21901
|
throw new CliError("validation_error", "archive locations changed during locking; run the command again");
|
|
21688
21902
|
}, "withMediaArchiveLocks");
|
|
21689
21903
|
|
|
21690
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
21904
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.537.0_@wirecat+cli-base@0.71.0_commander@15.0.0_esbuild@0.28.2_type_e3a3074c051d1ca759b7e8b914e3af6d/node_modules/@wirecat/cli-core/dist/services/media-archive.js
|
|
21691
21905
|
var validateMediaSince = /* @__PURE__ */ __name((value, flag = "--since-time") => {
|
|
21692
21906
|
if (value === void 0)
|
|
21693
21907
|
return void 0;
|
|
@@ -21840,17 +22054,17 @@ var archiveMedia = /* @__PURE__ */ __name(async (ports, options) => {
|
|
|
21840
22054
|
}, { create: true });
|
|
21841
22055
|
}, "archiveMedia");
|
|
21842
22056
|
|
|
21843
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
22057
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.537.0_@wirecat+cli-base@0.71.0_commander@15.0.0_esbuild@0.28.2_type_e3a3074c051d1ca759b7e8b914e3af6d/node_modules/@wirecat/cli-core/dist/services/media-archive-move.js
|
|
21844
22058
|
import { realpath as realpath2, unlink as unlink5 } from "node:fs/promises";
|
|
21845
|
-
import { basename as
|
|
22059
|
+
import { basename as basename3, dirname as dirname3, join as join7, resolve as resolve5 } from "node:path";
|
|
21846
22060
|
var canonicalDestination = /* @__PURE__ */ __name(async (directory2) => {
|
|
21847
|
-
const path =
|
|
22061
|
+
const path = resolve5(directory2);
|
|
21848
22062
|
try {
|
|
21849
22063
|
return await realpath2(path);
|
|
21850
22064
|
} catch (error) {
|
|
21851
|
-
if (!missingMediaFile(error) ||
|
|
22065
|
+
if (!missingMediaFile(error) || dirname3(path) === path)
|
|
21852
22066
|
throw error;
|
|
21853
|
-
return join7(await canonicalDestination(
|
|
22067
|
+
return join7(await canonicalDestination(dirname3(path)), basename3(path));
|
|
21854
22068
|
}
|
|
21855
22069
|
}, "canonicalDestination");
|
|
21856
22070
|
var image = /* @__PURE__ */ __name((entry) => ["photo", "image"].includes(entry.kind) || entry.mime?.startsWith("image/"), "image");
|
|
@@ -21993,7 +22207,7 @@ var moveMediaArchive = /* @__PURE__ */ __name(async (options) => {
|
|
|
21993
22207
|
}, { additional: [target2], createAdditional: !options.dryRun });
|
|
21994
22208
|
}, "moveMediaArchive");
|
|
21995
22209
|
|
|
21996
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
22210
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.537.0_@wirecat+cli-base@0.71.0_commander@15.0.0_esbuild@0.28.2_type_e3a3074c051d1ca759b7e8b914e3af6d/node_modules/@wirecat/cli-core/dist/services/model-downloads.js
|
|
21997
22211
|
var bytesOf = /* @__PURE__ */ __name((model) => model.files.reduce((sum2, file) => sum2 + file.bytes, 0), "bytesOf");
|
|
21998
22212
|
var nativeRuntime = /* @__PURE__ */ __name(async ({ env, progress = /* @__PURE__ */ __name(() => {
|
|
21999
22213
|
}, "progress") }) => {
|
|
@@ -22016,7 +22230,7 @@ var downloadTextModel = /* @__PURE__ */ __name(async (id2, { env, progress = /*
|
|
|
22016
22230
|
}
|
|
22017
22231
|
await nativeRuntime({ env, progress });
|
|
22018
22232
|
progress(`${model.id}: loading it once to check it works`);
|
|
22019
|
-
const { openEmbedder: openEmbedder2 } = await import("./embed-
|
|
22233
|
+
const { openEmbedder: openEmbedder2 } = await import("./embed-PUFE4BSQ.js");
|
|
22020
22234
|
const embedder = await openEmbedder2(model, directory2);
|
|
22021
22235
|
try {
|
|
22022
22236
|
const [vector] = await embedder.embed(["check"], "query");
|
|
@@ -22037,7 +22251,7 @@ var downloadRerankModel = /* @__PURE__ */ __name(async (id2, { env, progress = /
|
|
|
22037
22251
|
}
|
|
22038
22252
|
await nativeRuntime({ env, progress });
|
|
22039
22253
|
progress(`${model.id}: loading it once to check it works`);
|
|
22040
|
-
const { openReranker } = await import("./rerank-
|
|
22254
|
+
const { openReranker } = await import("./rerank-GO24HJPF.js");
|
|
22041
22255
|
const reranker = await openReranker(model, directory2);
|
|
22042
22256
|
try {
|
|
22043
22257
|
await reranker.score("check", ["check"]);
|
|
@@ -22055,7 +22269,7 @@ var downloadImageModel = /* @__PURE__ */ __name(async (id2, { env, progress = /*
|
|
|
22055
22269
|
await installFiles(placedImage(model, directory2), { progress });
|
|
22056
22270
|
}
|
|
22057
22271
|
progress(`${model.id}: loading it once to check it works`);
|
|
22058
|
-
const { openPictureEmbedder } = await import("./embedder-
|
|
22272
|
+
const { openPictureEmbedder } = await import("./embedder-3G4BQQ6X.js");
|
|
22059
22273
|
const embedder = await openPictureEmbedder(model, directory2);
|
|
22060
22274
|
try {
|
|
22061
22275
|
const vector = await embedder.embedQuery("check");
|
|
@@ -22067,7 +22281,7 @@ var downloadImageModel = /* @__PURE__ */ __name(async (id2, { env, progress = /*
|
|
|
22067
22281
|
return { model, directory: directory2 };
|
|
22068
22282
|
}, "downloadImageModel");
|
|
22069
22283
|
|
|
22070
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
22284
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.537.0_@wirecat+cli-base@0.71.0_commander@15.0.0_esbuild@0.28.2_type_e3a3074c051d1ca759b7e8b914e3af6d/node_modules/@wirecat/cli-core/dist/services/project-gathering-around.js
|
|
22071
22285
|
var storedMessageNeighbours = /* @__PURE__ */ __name((messages) => ({
|
|
22072
22286
|
async around(ref, window3) {
|
|
22073
22287
|
const at = parseLocator(ref);
|
|
@@ -22162,7 +22376,7 @@ var storedNeighbours = /* @__PURE__ */ __name((store) => {
|
|
|
22162
22376
|
};
|
|
22163
22377
|
}, "storedNeighbours");
|
|
22164
22378
|
|
|
22165
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
22379
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.537.0_@wirecat+cli-base@0.71.0_commander@15.0.0_esbuild@0.28.2_type_e3a3074c051d1ca759b7e8b914e3af6d/node_modules/@wirecat/cli-core/dist/services/project-gathering-request.js
|
|
22166
22380
|
import { createHash as createHash6 } from "node:crypto";
|
|
22167
22381
|
var DAY = 864e5;
|
|
22168
22382
|
var MAX_TIME = 864e13;
|
|
@@ -22478,7 +22692,7 @@ var decodeCheckpoint = /* @__PURE__ */ __name((text2, plan) => {
|
|
|
22478
22692
|
return value;
|
|
22479
22693
|
}, "decodeCheckpoint");
|
|
22480
22694
|
|
|
22481
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
22695
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.537.0_@wirecat+cli-base@0.71.0_commander@15.0.0_esbuild@0.28.2_type_e3a3074c051d1ca759b7e8b914e3af6d/node_modules/@wirecat/cli-core/dist/services/project-gathering.js
|
|
22482
22696
|
var terminal = /* @__PURE__ */ new Set(["done", "unavailable", "failed"]);
|
|
22483
22697
|
var PAGE = 20;
|
|
22484
22698
|
var PEOPLE = 20;
|
|
@@ -22882,7 +23096,7 @@ var peopleOf = /* @__PURE__ */ __name((items, senderOf) => {
|
|
|
22882
23096
|
return [...byKey.values()].sort((a, b) => b.items - a.items || a.name.localeCompare(b.name));
|
|
22883
23097
|
}, "peopleOf");
|
|
22884
23098
|
|
|
22885
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
23099
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.537.0_@wirecat+cli-base@0.71.0_commander@15.0.0_esbuild@0.28.2_type_e3a3074c051d1ca759b7e8b914e3af6d/node_modules/@wirecat/cli-core/dist/services/meeting-project-candidate-matching.js
|
|
22886
23100
|
var normalizedText = /* @__PURE__ */ __name((text2) => text2.normalize("NFKC").toLowerCase().replace(/\s+/gu, " "), "normalizedText");
|
|
22887
23101
|
var termsOf = /* @__PURE__ */ __name((entry) => [
|
|
22888
23102
|
{ name: entry.name, kind: "canonical" },
|
|
@@ -22926,7 +23140,7 @@ var matchVocabularyTerms = /* @__PURE__ */ __name((catalog, texts) => {
|
|
|
22926
23140
|
return result.sort((a, b) => Number(a.entry.id) - Number(b.entry.id));
|
|
22927
23141
|
}, "matchVocabularyTerms");
|
|
22928
23142
|
|
|
22929
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
23143
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.537.0_@wirecat+cli-base@0.71.0_commander@15.0.0_esbuild@0.28.2_type_e3a3074c051d1ca759b7e8b914e3af6d/node_modules/@wirecat/cli-core/dist/services/project-gathering-mentions.js
|
|
22930
23144
|
var KINDS = ["project", "tag", "topic"];
|
|
22931
23145
|
var findEvidenceMentions = /* @__PURE__ */ __name(async (vocabulary, gathering, options = {}) => {
|
|
22932
23146
|
if (typeof vocabulary?.vocabulary !== "function")
|
|
@@ -22981,7 +23195,7 @@ var findEvidenceMentions = /* @__PURE__ */ __name(async (vocabulary, gathering,
|
|
|
22981
23195
|
};
|
|
22982
23196
|
}, "findEvidenceMentions");
|
|
22983
23197
|
|
|
22984
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
23198
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.537.0_@wirecat+cli-base@0.71.0_commander@15.0.0_esbuild@0.28.2_type_e3a3074c051d1ca759b7e8b914e3af6d/node_modules/@wirecat/cli-core/dist/services/stored-project-gathering.js
|
|
22985
23199
|
var PROJECT_ID = /^project:[1-9]\d*$/;
|
|
22986
23200
|
var canonicalProjectRef = /* @__PURE__ */ __name(async (store, reference) => {
|
|
22987
23201
|
if (PROJECT_ID.test(reference)) {
|
|
@@ -23147,7 +23361,7 @@ var gatherStoredProject = /* @__PURE__ */ __name(async (store, input) => {
|
|
|
23147
23361
|
return { projectRef: project.ref, unreadSources: [...unread, ...unreadChats, ...members.left], ...gathered, mentions };
|
|
23148
23362
|
}, "gatherStoredProject");
|
|
23149
23363
|
|
|
23150
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
23364
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.537.0_@wirecat+cli-base@0.71.0_commander@15.0.0_esbuild@0.28.2_type_e3a3074c051d1ca759b7e8b914e3af6d/node_modules/@wirecat/cli-core/dist/services/account.js
|
|
23151
23365
|
var accountService = /* @__PURE__ */ __name((deps) => {
|
|
23152
23366
|
const online = /* @__PURE__ */ __name(async (command) => {
|
|
23153
23367
|
if (deps.offline)
|
|
@@ -23219,7 +23433,7 @@ var accountService = /* @__PURE__ */ __name((deps) => {
|
|
|
23219
23433
|
};
|
|
23220
23434
|
}, "accountService");
|
|
23221
23435
|
|
|
23222
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
23436
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.537.0_@wirecat+cli-base@0.71.0_commander@15.0.0_esbuild@0.28.2_type_e3a3074c051d1ca759b7e8b914e3af6d/node_modules/@wirecat/cli-core/dist/domain/send-time.js
|
|
23223
23437
|
var MINUTE = 6e4;
|
|
23224
23438
|
var YEAR = 365 * 24 * 60 * MINUTE;
|
|
23225
23439
|
var DELAY = /^(\d+)(m|h|d)$/;
|
|
@@ -23238,7 +23452,7 @@ var sendTime = /* @__PURE__ */ __name((value, now = Date.now(), flag = "--at-tim
|
|
|
23238
23452
|
return new Date(at - at % MINUTE).toISOString();
|
|
23239
23453
|
}, "sendTime");
|
|
23240
23454
|
|
|
23241
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
23455
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.537.0_@wirecat+cli-base@0.71.0_commander@15.0.0_esbuild@0.28.2_type_e3a3074c051d1ca759b7e8b914e3af6d/node_modules/@wirecat/cli-core/dist/services/admin.js
|
|
23242
23456
|
var recordMembership = /* @__PURE__ */ __name(async (deps, operationId, done2, change, fix, write) => {
|
|
23243
23457
|
try {
|
|
23244
23458
|
const held = await accountStoreIfOpen(deps);
|
|
@@ -23485,7 +23699,7 @@ var linkLimits = /* @__PURE__ */ __name(({ approval, expires, maxUses }) => {
|
|
|
23485
23699
|
return expires === void 0 ? void 0 : sendTime(expires, Date.now(), "--expire-time");
|
|
23486
23700
|
}, "linkLimits");
|
|
23487
23701
|
|
|
23488
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
23702
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.537.0_@wirecat+cli-base@0.71.0_commander@15.0.0_esbuild@0.28.2_type_e3a3074c051d1ca759b7e8b914e3af6d/node_modules/@wirecat/cli-core/dist/services/mail-search.js
|
|
23489
23703
|
var THREADS_PAGE = 500;
|
|
23490
23704
|
var threadsOf = /* @__PURE__ */ __name(async (store, key) => {
|
|
23491
23705
|
const account = await store.accounts.storedAccount(key).catch(() => void 0);
|
|
@@ -23564,7 +23778,7 @@ var readMail = /* @__PURE__ */ __name(async (store, locator, { before: before2 =
|
|
|
23564
23778
|
return thread.slice(Math.max(0, at - before2), at + after + 1).map((hit) => hit.id === message ? { ...hit, anchor: true } : hit);
|
|
23565
23779
|
}, "readMail");
|
|
23566
23780
|
|
|
23567
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
23781
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.537.0_@wirecat+cli-base@0.71.0_commander@15.0.0_esbuild@0.28.2_type_e3a3074c051d1ca759b7e8b914e3af6d/node_modules/@wirecat/cli-core/dist/services/search-kind.js
|
|
23568
23782
|
var NO_MAIL = "no_mail";
|
|
23569
23783
|
var MAIL = "email";
|
|
23570
23784
|
var listContextOf = /* @__PURE__ */ __name(async (store, account, app, stored) => {
|
|
@@ -23611,7 +23825,7 @@ var accountsOfKind = /* @__PURE__ */ __name((kind, chosen, held, explicit, comma
|
|
|
23611
23825
|
return chosenMail.map(({ provider, account }) => ({ provider, account }));
|
|
23612
23826
|
}, "accountsOfKind");
|
|
23613
23827
|
|
|
23614
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
23828
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.537.0_@wirecat+cli-base@0.71.0_commander@15.0.0_esbuild@0.28.2_type_e3a3074c051d1ca759b7e8b914e3af6d/node_modules/@wirecat/cli-core/dist/services/messages-search.js
|
|
23615
23829
|
var MAIL_FIELDS = /* @__PURE__ */ new Set(["to", "cc", "bcc", "subject", "mailbox", "label", "is"]);
|
|
23616
23830
|
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");
|
|
23617
23831
|
var prepareLucene = /* @__PURE__ */ __name(async (store, account, request, messenger) => {
|
|
@@ -23959,7 +24173,7 @@ var statsLucene = /* @__PURE__ */ __name(async (store, account, request, messeng
|
|
|
23959
24173
|
};
|
|
23960
24174
|
}, "statsLucene");
|
|
23961
24175
|
|
|
23962
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
24176
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.537.0_@wirecat+cli-base@0.71.0_commander@15.0.0_esbuild@0.28.2_type_e3a3074c051d1ca759b7e8b914e3af6d/node_modules/@wirecat/cli-core/dist/services/rankings-selection.js
|
|
23963
24177
|
var RANKING_SELECTION_BYTES = 64 * 1024;
|
|
23964
24178
|
var object = /* @__PURE__ */ __name((value) => value !== null && typeof value === "object" && !Array.isArray(value) ? value : void 0, "object");
|
|
23965
24179
|
function invalid(message = "ranking selection is invalid \u2014 obtain a new drilldown from stats top") {
|
|
@@ -24128,7 +24342,7 @@ var readRankingSelection = /* @__PURE__ */ __name(async (store, input) => {
|
|
|
24128
24342
|
};
|
|
24129
24343
|
}, "readRankingSelection");
|
|
24130
24344
|
|
|
24131
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
24345
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.537.0_@wirecat+cli-base@0.71.0_commander@15.0.0_esbuild@0.28.2_type_e3a3074c051d1ca759b7e8b914e3af6d/node_modules/@wirecat/cli-core/dist/services/search-record.js
|
|
24132
24346
|
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");
|
|
24133
24347
|
var searchRecordOf = /* @__PURE__ */ __name((command, params) => ({
|
|
24134
24348
|
command,
|
|
@@ -24138,7 +24352,7 @@ var searchRecordOf = /* @__PURE__ */ __name((command, params) => ({
|
|
|
24138
24352
|
fieldsVersion: FIELD_VERSION
|
|
24139
24353
|
}), "searchRecordOf");
|
|
24140
24354
|
|
|
24141
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
24355
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.537.0_@wirecat+cli-base@0.71.0_commander@15.0.0_esbuild@0.28.2_type_e3a3074c051d1ca759b7e8b914e3af6d/node_modules/@wirecat/cli-core/dist/services/admin-statistics.js
|
|
24142
24356
|
function invalid2(message) {
|
|
24143
24357
|
throw new CliError("validation_error", message);
|
|
24144
24358
|
}
|
|
@@ -24432,7 +24646,7 @@ var adminStatisticsService = /* @__PURE__ */ __name((deps) => ({
|
|
|
24432
24646
|
}, "evidence")
|
|
24433
24647
|
}), "adminStatisticsService");
|
|
24434
24648
|
|
|
24435
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
24649
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.537.0_@wirecat+cli-base@0.71.0_commander@15.0.0_esbuild@0.28.2_type_e3a3074c051d1ca759b7e8b914e3af6d/node_modules/@wirecat/cli-core/dist/services/agenda.js
|
|
24436
24650
|
var DAY2 = 864e5;
|
|
24437
24651
|
var CLAIMS = ["none", "mine", "others", "any"];
|
|
24438
24652
|
var TASK_FIELDS = /* @__PURE__ */ new Set(["tag", "category", "claimed"]);
|
|
@@ -24674,10 +24888,10 @@ var agendaItem = /* @__PURE__ */ __name((shown) => {
|
|
|
24674
24888
|
};
|
|
24675
24889
|
}, "agendaItem");
|
|
24676
24890
|
|
|
24677
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
24891
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.537.0_@wirecat+cli-base@0.71.0_commander@15.0.0_esbuild@0.28.2_type_e3a3074c051d1ca759b7e8b914e3af6d/node_modules/@wirecat/cli-core/dist/services/archive.js
|
|
24678
24892
|
import { setTimeout as sleep3 } from "node:timers/promises";
|
|
24679
24893
|
|
|
24680
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
24894
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.537.0_@wirecat+cli-base@0.71.0_commander@15.0.0_esbuild@0.28.2_type_e3a3074c051d1ca759b7e8b914e3af6d/node_modules/@wirecat/cli-core/dist/services/backfill-estimate.js
|
|
24681
24895
|
var REQUEST_MS = 400;
|
|
24682
24896
|
var estimateBackfill = /* @__PURE__ */ __name(({ ranges, held, newest, page, maxPages, pauseMs }) => {
|
|
24683
24897
|
const lowest = ranges[0];
|
|
@@ -24700,13 +24914,13 @@ var estimateBackfill = /* @__PURE__ */ __name(({ ranges, held, newest, page, max
|
|
|
24700
24914
|
};
|
|
24701
24915
|
}, "estimateBackfill");
|
|
24702
24916
|
|
|
24703
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
24917
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.537.0_@wirecat+cli-base@0.71.0_commander@15.0.0_esbuild@0.28.2_type_e3a3074c051d1ca759b7e8b914e3af6d/node_modules/@wirecat/cli-core/dist/domain/recovery.js
|
|
24704
24918
|
var withRecovery = /* @__PURE__ */ __name((error) => ({
|
|
24705
24919
|
...error,
|
|
24706
24920
|
retryable: typeof error.retryable === "boolean" ? error.retryable : error.code === "rate_limited" || error.status === 429
|
|
24707
24921
|
}), "withRecovery");
|
|
24708
24922
|
|
|
24709
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
24923
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.537.0_@wirecat+cli-base@0.71.0_commander@15.0.0_esbuild@0.28.2_type_e3a3074c051d1ca759b7e8b914e3af6d/node_modules/@wirecat/cli-core/dist/services/batch.js
|
|
24710
24924
|
var actionable = /* @__PURE__ */ __name((error) => {
|
|
24711
24925
|
if (isCliFailure(error))
|
|
24712
24926
|
return withRecovery({ code: error.code, message: error.message, ...error.details });
|
|
@@ -24789,7 +25003,7 @@ var mergeBatches = /* @__PURE__ */ __name((a, b) => {
|
|
|
24789
25003
|
};
|
|
24790
25004
|
}, "mergeBatches");
|
|
24791
25005
|
|
|
24792
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
25006
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.537.0_@wirecat+cli-base@0.71.0_commander@15.0.0_esbuild@0.28.2_type_e3a3074c051d1ca759b7e8b914e3af6d/node_modules/@wirecat/cli-core/dist/services/patience.js
|
|
24793
25007
|
import { setTimeout as sleep2 } from "node:timers/promises";
|
|
24794
25008
|
var LONGEST_WAIT_MS = 5 * 60 * 1e3;
|
|
24795
25009
|
var patiently = /* @__PURE__ */ __name(async (request, note, stop) => {
|
|
@@ -24812,7 +25026,7 @@ var patiently = /* @__PURE__ */ __name(async (request, note, stop) => {
|
|
|
24812
25026
|
}
|
|
24813
25027
|
}, "patiently");
|
|
24814
25028
|
|
|
24815
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
25029
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.537.0_@wirecat+cli-base@0.71.0_commander@15.0.0_esbuild@0.28.2_type_e3a3074c051d1ca759b7e8b914e3af6d/node_modules/@wirecat/cli-core/dist/images/context/index.js
|
|
24816
25030
|
var CONTEXT_MESSAGES2 = 3;
|
|
24817
25031
|
var CONTEXT_MINUTES = 10;
|
|
24818
25032
|
var MAX_CHARS = 1200;
|
|
@@ -24836,12 +25050,12 @@ var context = {
|
|
|
24836
25050
|
}, "describe")
|
|
24837
25051
|
};
|
|
24838
25052
|
|
|
24839
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
25053
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.537.0_@wirecat+cli-base@0.71.0_commander@15.0.0_esbuild@0.28.2_type_e3a3074c051d1ca759b7e8b914e3af6d/node_modules/@wirecat/cli-core/dist/images/registry.js
|
|
24840
25054
|
var BUILT_INS = [context];
|
|
24841
25055
|
var providers = [...BUILT_INS];
|
|
24842
25056
|
var registeredImageProviders = /* @__PURE__ */ __name(() => providers, "registeredImageProviders");
|
|
24843
25057
|
|
|
24844
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
25058
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.537.0_@wirecat+cli-base@0.71.0_commander@15.0.0_esbuild@0.28.2_type_e3a3074c051d1ca759b7e8b914e3af6d/node_modules/@wirecat/cli-core/dist/services/conversations.js
|
|
24845
25059
|
var READ_PAGE = 5e3;
|
|
24846
25060
|
var CHAIN = 50;
|
|
24847
25061
|
var CONVERSATION_QUERY = {
|
|
@@ -24993,7 +25207,7 @@ var sized = /* @__PURE__ */ __name((size2) => {
|
|
|
24993
25207
|
return size2;
|
|
24994
25208
|
}, "sized");
|
|
24995
25209
|
|
|
24996
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
25210
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.537.0_@wirecat+cli-base@0.71.0_commander@15.0.0_esbuild@0.28.2_type_e3a3074c051d1ca759b7e8b914e3af6d/node_modules/@wirecat/cli-core/dist/services/embeddings-maintenance.js
|
|
24997
25211
|
var REFRESH_BOUNDS = { maxChats: 20, maxChunks: 2e3 };
|
|
24998
25212
|
var MESSAGE_PAGE = 5e3;
|
|
24999
25213
|
var PER_SESSION = 8;
|
|
@@ -25012,7 +25226,7 @@ var embeddingTarget = /* @__PURE__ */ __name((deps, choice = DEFAULT_TEXT_MODEL)
|
|
|
25012
25226
|
price: remote.price,
|
|
25013
25227
|
installed: true,
|
|
25014
25228
|
perBatch: PER_REQUEST * concurrency,
|
|
25015
|
-
open: /* @__PURE__ */ __name(async () => (await import("./remote-
|
|
25229
|
+
open: /* @__PURE__ */ __name(async () => (await import("./remote-D6TQ6T7F.js")).openRemote(remote, apiKey, { concurrency }), "open")
|
|
25016
25230
|
};
|
|
25017
25231
|
}
|
|
25018
25232
|
const model = textModel(choice);
|
|
@@ -25029,7 +25243,7 @@ var embeddingTarget = /* @__PURE__ */ __name((deps, choice = DEFAULT_TEXT_MODEL)
|
|
|
25029
25243
|
if (!isTextModelInstalled(model, directory2))
|
|
25030
25244
|
throw notDownloaded(model.id);
|
|
25031
25245
|
if (apart) {
|
|
25032
|
-
const { openProcess } = await import("./process-
|
|
25246
|
+
const { openProcess } = await import("./process-VVEQIHPE.js");
|
|
25033
25247
|
return openProcess(model, directory2, { threads: threads ?? defaultThreads() });
|
|
25034
25248
|
}
|
|
25035
25249
|
return openEmbedder(model, directory2, { threads: threads ?? defaultThreads() });
|
|
@@ -25318,7 +25532,7 @@ var shaped = /* @__PURE__ */ __name(({ chatId, builtAt, algorithmVersion, pendin
|
|
|
25318
25532
|
return { ...one, state };
|
|
25319
25533
|
}, "shaped");
|
|
25320
25534
|
|
|
25321
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
25535
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.537.0_@wirecat+cli-base@0.71.0_commander@15.0.0_esbuild@0.28.2_type_e3a3074c051d1ca759b7e8b914e3af6d/node_modules/@wirecat/cli-core/dist/services/search-catchup.js
|
|
25322
25536
|
var CATCH_UP_BOUNDS = { maxChunks: 500, maxMessages: 1e4, timeMs: 3e4 };
|
|
25323
25537
|
var validateCatchUpBounds = /* @__PURE__ */ __name((options) => {
|
|
25324
25538
|
for (const [key, value, maximum] of [
|
|
@@ -25371,7 +25585,7 @@ var catchUpSearch = /* @__PURE__ */ __name(async (deps, chat, options, signal, c
|
|
|
25371
25585
|
}
|
|
25372
25586
|
}, "catchUpSearch");
|
|
25373
25587
|
|
|
25374
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
25588
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.537.0_@wirecat+cli-base@0.71.0_commander@15.0.0_esbuild@0.28.2_type_e3a3074c051d1ca759b7e8b914e3af6d/node_modules/@wirecat/cli-core/dist/services/archive.js
|
|
25375
25589
|
var pushed = /* @__PURE__ */ __name((deps, what) => {
|
|
25376
25590
|
if (deps.reads === "store") {
|
|
25377
25591
|
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`);
|
|
@@ -25692,7 +25906,7 @@ var timeOfKey = /* @__PURE__ */ __name(async (store, account, chatId, key, byTim
|
|
|
25692
25906
|
return message?.timestamp ?? fallback;
|
|
25693
25907
|
}, "timeOfKey");
|
|
25694
25908
|
|
|
25695
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
25909
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.537.0_@wirecat+cli-base@0.71.0_commander@15.0.0_esbuild@0.28.2_type_e3a3074c051d1ca759b7e8b914e3af6d/node_modules/@wirecat/cli-core/dist/services/archive-gaps.js
|
|
25696
25910
|
import { createHash as createHash7, randomUUID as randomUUID4 } from "node:crypto";
|
|
25697
25911
|
var GAP_BOUNDS = { maxGaps: 5, limit: 500, timeMs: 3e4 };
|
|
25698
25912
|
var validateRepair = /* @__PURE__ */ __name((messenger, options) => {
|
|
@@ -25829,218 +26043,14 @@ var gapsService = /* @__PURE__ */ __name((deps) => {
|
|
|
25829
26043
|
return { plan, repair };
|
|
25830
26044
|
}, "gapsService");
|
|
25831
26045
|
|
|
25832
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
26046
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.537.0_@wirecat+cli-base@0.71.0_commander@15.0.0_esbuild@0.28.2_type_e3a3074c051d1ca759b7e8b914e3af6d/node_modules/@wirecat/cli-core/dist/services/attachments.js
|
|
25833
26047
|
import { createHash as createHash9 } from "node:crypto";
|
|
25834
|
-
import { constants as constants2 } from "node:fs";
|
|
25835
|
-
import { open as open6, readFile, stat as stat2 } from "node:fs/promises";
|
|
26048
|
+
import { constants as constants2, mkdirSync as mkdirSync2 } from "node:fs";
|
|
26049
|
+
import { lstat as lstat4, open as open6, readFile, stat as stat2 } from "node:fs/promises";
|
|
25836
26050
|
|
|
25837
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
26051
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.537.0_@wirecat+cli-base@0.71.0_commander@15.0.0_esbuild@0.28.2_type_e3a3074c051d1ca759b7e8b914e3af6d/node_modules/@wirecat/cli-core/dist/attachments/directory.js
|
|
25838
26052
|
import { lstat as lstat2, readdir as readdir2, realpath as realpath3 } from "node:fs/promises";
|
|
25839
26053
|
import { basename as basename4, join as join8, relative as relative2, sep as sep2 } from "node:path";
|
|
25840
|
-
|
|
25841
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.521.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_66d5ccffb8b88e4b24c051b84ef1952a/node_modules/@wirecat/cli-core/dist/sends/upload.js
|
|
25842
|
-
import { openAsBlob, realpathSync } from "node:fs";
|
|
25843
|
-
import { open as open4, stat } from "node:fs/promises";
|
|
25844
|
-
import { basename as basename3, dirname as dirname3, extname, isAbsolute as isAbsolute2, relative, resolve as resolve5, sep } from "node:path";
|
|
25845
|
-
var MAX_BUFFERED_UPLOAD_BYTES = 256 * 1024 * 1024;
|
|
25846
|
-
var uploadSize = /* @__PURE__ */ __name((source) => source.kind === "file" ? source.size : source.bytes.byteLength, "uploadSize");
|
|
25847
|
-
var PHOTO = /* @__PURE__ */ new Set([".jpg", ".jpeg", ".png", ".webp"]);
|
|
25848
|
-
var VOICE = /* @__PURE__ */ new Set([".ogg", ".oga", ".opus"]);
|
|
25849
|
-
var JPEG = /* @__PURE__ */ __name((head) => head[0] === 255 && head[1] === 216 && head[2] === 255, "JPEG");
|
|
25850
|
-
var SIGNATURES = {
|
|
25851
|
-
".jpg": JPEG,
|
|
25852
|
-
".jpeg": JPEG,
|
|
25853
|
-
".png": /* @__PURE__ */ __name((head) => Buffer.from(head.subarray(0, 8)).toString("latin1") === "\x89PNG\r\n\n", ".png"),
|
|
25854
|
-
".webp": /* @__PURE__ */ __name((head) => {
|
|
25855
|
-
const text2 = Buffer.from(head).toString("latin1");
|
|
25856
|
-
return text2.startsWith("RIFF") && text2.slice(8, 12) === "WEBP";
|
|
25857
|
-
}, ".webp")
|
|
25858
|
-
};
|
|
25859
|
-
var fileHead = /* @__PURE__ */ __name(async (path) => {
|
|
25860
|
-
const file = await open4(path, "r");
|
|
25861
|
-
try {
|
|
25862
|
-
const head = new Uint8Array(12);
|
|
25863
|
-
const { bytesRead } = await file.read(head, 0, head.length, 0);
|
|
25864
|
-
return head.subarray(0, bytesRead);
|
|
25865
|
-
} finally {
|
|
25866
|
-
await file.close();
|
|
25867
|
-
}
|
|
25868
|
-
}, "fileHead");
|
|
25869
|
-
var typesText = /* @__PURE__ */ __name((types2) => types2.length < 2 ? types2[0] ?? "" : `${types2.slice(0, -1).join(", ")} or ${types2.at(-1)}`, "typesText");
|
|
25870
|
-
var CREDENTIAL_PARTS = /* @__PURE__ */ new Set([
|
|
25871
|
-
".ssh",
|
|
25872
|
-
".gnupg",
|
|
25873
|
-
".aws",
|
|
25874
|
-
".azure",
|
|
25875
|
-
".kube",
|
|
25876
|
-
".secrets",
|
|
25877
|
-
"secrets",
|
|
25878
|
-
".password-store",
|
|
25879
|
-
".mozilla",
|
|
25880
|
-
".env",
|
|
25881
|
-
".npmrc",
|
|
25882
|
-
".pypirc",
|
|
25883
|
-
".netrc",
|
|
25884
|
-
"_netrc",
|
|
25885
|
-
".git-credentials",
|
|
25886
|
-
"credentials.yml.enc",
|
|
25887
|
-
"master.key"
|
|
25888
|
-
]);
|
|
25889
|
-
var CREDENTIAL_RUNS = [
|
|
25890
|
-
[".config", "autostart"],
|
|
25891
|
-
[".config", "git", "credentials"],
|
|
25892
|
-
[".config", "gh"],
|
|
25893
|
-
[".config", "gcloud"],
|
|
25894
|
-
[".config", "google-chrome"],
|
|
25895
|
-
[".config", "chromium"],
|
|
25896
|
-
[".config", "microsoft-edge"],
|
|
25897
|
-
[".config", "BraveSoftware"],
|
|
25898
|
-
[".docker", "config.json"],
|
|
25899
|
-
[".claude", ".credentials.json"],
|
|
25900
|
-
[".codex", "auth.json"],
|
|
25901
|
-
[".local", "share", "keyrings"],
|
|
25902
|
-
["Library", "Keychains"],
|
|
25903
|
-
["Library", "Cookies"],
|
|
25904
|
-
["Library", "Safari"],
|
|
25905
|
-
["Library", "Application Support", "Google", "Chrome"],
|
|
25906
|
-
["Library", "Application Support", "Chromium"],
|
|
25907
|
-
["Library", "Application Support", "Microsoft Edge"],
|
|
25908
|
-
["Library", "Application Support", "BraveSoftware"],
|
|
25909
|
-
["Library", "Application Support", "Firefox"],
|
|
25910
|
-
["AppData", "Local", "Google", "Chrome"],
|
|
25911
|
-
["AppData", "Local", "Chromium"],
|
|
25912
|
-
["AppData", "Local", "Microsoft", "Edge"],
|
|
25913
|
-
["AppData", "Local", "BraveSoftware"],
|
|
25914
|
-
["AppData", "Roaming", "Mozilla", "Firefox"],
|
|
25915
|
-
["AppData", "Local", "Microsoft", "Credentials"],
|
|
25916
|
-
["AppData", "Roaming", "Microsoft", "Credentials"],
|
|
25917
|
-
["AppData", "Roaming", "Microsoft", "Protect"],
|
|
25918
|
-
["AppData", "Roaming", "gcloud"],
|
|
25919
|
-
["AppData", "Roaming", "GitHub CLI"]
|
|
25920
|
-
];
|
|
25921
|
-
var WIRECAT_APPS = [
|
|
25922
|
-
{ appName: "max-cli", prefix: "MAX" },
|
|
25923
|
-
{ appName: "tg-cli", prefix: "TG" },
|
|
25924
|
-
{ appName: "whatsapp-cli", prefix: "WA" },
|
|
25925
|
-
{ appName: "cli-memo", prefix: "MEMO" },
|
|
25926
|
-
{ appName: "drive-cli", prefix: "DRIVE" },
|
|
25927
|
-
{ appName: "zm", prefix: "ZM" },
|
|
25928
|
-
{ appName: "cli-messaging", prefix: "MESSAGING" },
|
|
25929
|
-
{ appName: "cli-common", prefix: "CLI_COMMON" }
|
|
25930
|
-
];
|
|
25931
|
-
var refusedPlace = /* @__PURE__ */ __name((path, app, env, platform = process.platform) => {
|
|
25932
|
-
const own = [
|
|
25933
|
-
...[{ appName: app.appName, prefix: app.envPrefix }, ...WIRECAT_APPS].flatMap((one) => Object.values(resolvePaths({ ...one, env, platform }))),
|
|
25934
|
-
// The shared WireCat folder: the store, its backups beside it, the models.
|
|
25935
|
-
wirecatDirectory(env, platform)
|
|
25936
|
-
];
|
|
25937
|
-
const store = resolve5(storePath(env));
|
|
25938
|
-
let ancestor = resolve5(path);
|
|
25939
|
-
let real = ancestor;
|
|
25940
|
-
for (; ; ) {
|
|
25941
|
-
try {
|
|
25942
|
-
real = resolve5(realpathSync(ancestor), relative(ancestor, resolve5(path)));
|
|
25943
|
-
break;
|
|
25944
|
-
} catch {
|
|
25945
|
-
const parent = dirname3(ancestor);
|
|
25946
|
-
if (parent === ancestor)
|
|
25947
|
-
break;
|
|
25948
|
-
ancestor = parent;
|
|
25949
|
-
}
|
|
25950
|
-
}
|
|
25951
|
-
const folded = platform === "darwin" || platform === "win32";
|
|
25952
|
-
const fold2 = /* @__PURE__ */ __name((text2) => folded ? text2.toLowerCase() : text2, "fold");
|
|
25953
|
-
const parts = new Set([...CREDENTIAL_PARTS].map(fold2));
|
|
25954
|
-
const runs = CREDENTIAL_RUNS.map((run) => run.map(fold2));
|
|
25955
|
-
const named2 = /* @__PURE__ */ __name((candidate) => {
|
|
25956
|
-
const names2 = candidate.split(sep).map(fold2);
|
|
25957
|
-
return names2.some((name, index) => parts.has(name) || /^\.env\./.test(name) || runs.some((run) => run.every((part, offset) => names2[index + offset] === part)));
|
|
25958
|
-
}, "named");
|
|
25959
|
-
const same2 = /* @__PURE__ */ __name((a, b) => fold2(a) === fold2(b), "same");
|
|
25960
|
-
return [resolve5(path), real].some((candidate) => named2(candidate) || own.some((dir) => inside(fold2(candidate), fold2(dir))) || [store, `${store}-wal`, `${store}-shm`].some((file) => same2(candidate, file)));
|
|
25961
|
-
}, "refusedPlace");
|
|
25962
|
-
var inside = /* @__PURE__ */ __name((path, dir) => {
|
|
25963
|
-
const way = relative(resolve5(dir), path);
|
|
25964
|
-
return way === "" || !way.startsWith("..") && !isAbsolute2(way);
|
|
25965
|
-
}, "inside");
|
|
25966
|
-
var readUpload = /* @__PURE__ */ __name(async (kind, path, { app, env = process.env, anyFile = false, photoTypes }) => {
|
|
25967
|
-
const extension = extname(path).toLowerCase();
|
|
25968
|
-
if (kind === "photo" && photoTypes !== void 0 && !photoTypes.includes(extension)) {
|
|
25969
|
-
throw new CliError("validation_error", `this photo must be a ${typesText(photoTypes)} file, not ${path}`);
|
|
25970
|
-
}
|
|
25971
|
-
if (kind === "photo" && photoTypes === void 0 && !PHOTO.has(extension)) {
|
|
25972
|
-
throw new CliError("validation_error", `a photo is a .jpg, .png or .webp \u2014 send ${path} as a file instead`);
|
|
25973
|
-
}
|
|
25974
|
-
if (kind === "voice" && !VOICE.has(extension)) {
|
|
25975
|
-
throw new CliError("validation_error", `a voice message is Ogg Opus: .ogg, .oga or .opus \u2014 send ${path} as a file`);
|
|
25976
|
-
}
|
|
25977
|
-
if (!anyFile && refusedPlace(path, app, env)) {
|
|
25978
|
-
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`);
|
|
25979
|
-
}
|
|
25980
|
-
let size2;
|
|
25981
|
-
let head;
|
|
25982
|
-
try {
|
|
25983
|
-
const info = await stat(path);
|
|
25984
|
-
if (!info.isFile())
|
|
25985
|
-
throw Object.assign(new Error("not a file"), { code: "EISDIR" });
|
|
25986
|
-
size2 = info.size;
|
|
25987
|
-
if (photoTypes !== void 0 && SIGNATURES[extension] !== void 0)
|
|
25988
|
-
head = await fileHead(path);
|
|
25989
|
-
} catch (error) {
|
|
25990
|
-
const code = error.code;
|
|
25991
|
-
const reason = code === "ENOENT" ? "no such file" : code === "EISDIR" ? "it is a folder" : "it cannot be read";
|
|
25992
|
-
throw new CliError("validation_error", `cannot send ${path}: ${reason}`);
|
|
25993
|
-
}
|
|
25994
|
-
if (head !== void 0 && SIGNATURES[extension]?.(head) !== true) {
|
|
25995
|
-
throw new CliError("validation_error", `${path} is not a ${typesText(photoTypes ?? [])} image inside`);
|
|
25996
|
-
}
|
|
25997
|
-
return { kind, name: basename3(path), source: { kind: "file", path: resolve5(path), size: size2 } };
|
|
25998
|
-
}, "readUpload");
|
|
25999
|
-
var checkFilename = /* @__PURE__ */ __name((filename, files) => {
|
|
26000
|
-
if (files.length === 0)
|
|
26001
|
-
throw new CliError("validation_error", "--filename names a --file; give one");
|
|
26002
|
-
if (files.length > 1)
|
|
26003
|
-
throw new CliError("validation_error", "--filename names one --file; an album keeps its names");
|
|
26004
|
-
if (filename.trim() === "" || /[/\\\0]/.test(filename) || filename.length > 255)
|
|
26005
|
-
throw new CliError("validation_error", "--filename is a name, not a path: no / or \\, at most 255 characters");
|
|
26006
|
-
}, "checkFilename");
|
|
26007
|
-
var listOf2 = /* @__PURE__ */ __name((value) => value === void 0 ? [] : typeof value === "string" ? [value] : value, "listOf");
|
|
26008
|
-
var readAttachments = /* @__PURE__ */ __name(async ({ photo, file, voice, asFile, filename, text: text2 }, read) => {
|
|
26009
|
-
const photos = listOf2(photo);
|
|
26010
|
-
const files = listOf2(file);
|
|
26011
|
-
if (voice !== void 0 && (photos.length > 0 || files.length > 0 || (text2 ?? "").trim() !== "")) {
|
|
26012
|
-
throw new CliError("validation_error", "a voice message goes alone \u2014 no text, no file, no photo beside it");
|
|
26013
|
-
}
|
|
26014
|
-
if (asFile && files.length === 0)
|
|
26015
|
-
throw new CliError("validation_error", "--as-file is about a --file; give one");
|
|
26016
|
-
if (filename !== void 0)
|
|
26017
|
-
checkFilename(filename, files);
|
|
26018
|
-
const uploads = [];
|
|
26019
|
-
for (const one of photos)
|
|
26020
|
-
uploads.push(await readUpload("photo", one, read));
|
|
26021
|
-
for (const one of files)
|
|
26022
|
-
uploads.push({
|
|
26023
|
-
...await readUpload("file", one, read),
|
|
26024
|
-
...filename === void 0 ? {} : { name: filename },
|
|
26025
|
-
...asFile ? { asFile: true } : {}
|
|
26026
|
-
});
|
|
26027
|
-
if (voice !== void 0)
|
|
26028
|
-
uploads.push(await readUpload("voice", voice, read));
|
|
26029
|
-
return uploads;
|
|
26030
|
-
}, "readAttachments");
|
|
26031
|
-
var readStickerFile = /* @__PURE__ */ __name(async (path, maxBytes, read) => {
|
|
26032
|
-
if (extname(path).toLowerCase() !== ".webp")
|
|
26033
|
-
throw new CliError("validation_error", `a sticker is a .webp \u2014 send ${path} as a photo or a file instead`);
|
|
26034
|
-
const { name, source } = await readUpload("file", path, read);
|
|
26035
|
-
if (SIGNATURES[".webp"]?.(await fileHead(path)) !== true)
|
|
26036
|
-
throw new CliError("validation_error", `${path} is named .webp but is not a WebP image \u2014 nothing was sent`);
|
|
26037
|
-
const size2 = uploadSize(source);
|
|
26038
|
-
if (size2 > maxBytes)
|
|
26039
|
-
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`);
|
|
26040
|
-
return { name, source };
|
|
26041
|
-
}, "readStickerFile");
|
|
26042
|
-
|
|
26043
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.521.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_66d5ccffb8b88e4b24c051b84ef1952a/node_modules/@wirecat/cli-core/dist/attachments/directory.js
|
|
26044
26054
|
var MAX_FILES = 1e4;
|
|
26045
26055
|
var directoryPaths = /* @__PURE__ */ __name(async (store, chat, directory2, app, env) => {
|
|
26046
26056
|
if (refusedPlace(directory2, app, env))
|
|
@@ -26109,15 +26119,15 @@ var directoryPaths = /* @__PURE__ */ __name(async (store, chat, directory2, app,
|
|
|
26109
26119
|
return choices;
|
|
26110
26120
|
}, "directoryPaths");
|
|
26111
26121
|
|
|
26112
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
26122
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.537.0_@wirecat+cli-base@0.71.0_commander@15.0.0_esbuild@0.28.2_type_e3a3074c051d1ca759b7e8b914e3af6d/node_modules/@wirecat/cli-core/dist/attachments/documents.js
|
|
26113
26123
|
import { posix } from "node:path";
|
|
26114
26124
|
|
|
26115
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
26125
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.537.0_@wirecat+cli-base@0.71.0_commander@15.0.0_esbuild@0.28.2_type_e3a3074c051d1ca759b7e8b914e3af6d/node_modules/@wirecat/cli-core/dist/attachments/container.js
|
|
26116
26126
|
import { setImmediate as tick } from "node:timers/promises";
|
|
26117
26127
|
import { crc32 } from "node:zlib";
|
|
26118
26128
|
var import_xmldom = __toESM(require_lib(), 1);
|
|
26119
26129
|
|
|
26120
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
26130
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.537.0_@wirecat+cli-base@0.71.0_commander@15.0.0_esbuild@0.28.2_type_e3a3074c051d1ca759b7e8b914e3af6d/node_modules/@wirecat/cli-core/dist/attachments/encoding.js
|
|
26121
26131
|
var import_chardet = __toESM(require_lib2(), 1);
|
|
26122
26132
|
var import_iconv_lite = __toESM(require_lib3(), 1);
|
|
26123
26133
|
var SAMPLE = 65536;
|
|
@@ -26219,7 +26229,7 @@ var decodeXml = /* @__PURE__ */ __name((bytes2) => {
|
|
|
26219
26229
|
return result.text;
|
|
26220
26230
|
}, "decodeXml");
|
|
26221
26231
|
|
|
26222
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
26232
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.537.0_@wirecat+cli-base@0.71.0_commander@15.0.0_esbuild@0.28.2_type_e3a3074c051d1ca759b7e8b914e3af6d/node_modules/@wirecat/cli-core/dist/attachments/container.js
|
|
26223
26233
|
var MAX_PART = 10 * 1024 * 1024;
|
|
26224
26234
|
var MAX_ENTRIES = 1e3;
|
|
26225
26235
|
var decoder = new TextDecoder("utf-8", { fatal: true });
|
|
@@ -26232,7 +26242,7 @@ var cancelled = /* @__PURE__ */ __name((signal) => {
|
|
|
26232
26242
|
if (signal?.aborted)
|
|
26233
26243
|
throw new CliError("cancelled", "document extraction cancelled");
|
|
26234
26244
|
}, "cancelled");
|
|
26235
|
-
var
|
|
26245
|
+
var safeName2 = /* @__PURE__ */ __name((name) => name.length > 0 && name.length <= 512 && !/^[\\/]|\\/.test(name) && ![...name].some((character) => character.charCodeAt(0) < 32) && !name.split("/").includes(".."), "safeName");
|
|
26236
26246
|
var directory = /* @__PURE__ */ __name((bytes2) => {
|
|
26237
26247
|
const view = new DataView(bytes2.buffer, bytes2.byteOffset, bytes2.byteLength);
|
|
26238
26248
|
let end = -1;
|
|
@@ -26267,7 +26277,7 @@ var directory = /* @__PURE__ */ __name((bytes2) => {
|
|
|
26267
26277
|
if (next > stop)
|
|
26268
26278
|
throw new Error("invalid_zip");
|
|
26269
26279
|
const name = decoder.decode(bytes2.subarray(offset + 46, offset + 46 + length));
|
|
26270
|
-
if (!
|
|
26280
|
+
if (!safeName2(name) || entries.has(name) || flags & 1 || method !== 0 && method !== 8)
|
|
26271
26281
|
throw new Error("invalid_zip");
|
|
26272
26282
|
if ((view.getUint32(offset + 38, true) >>> 16 & 61440) === 40960)
|
|
26273
26283
|
throw new Error("invalid_zip");
|
|
@@ -26434,7 +26444,7 @@ var elements = /* @__PURE__ */ __name((node, name, namespace) => {
|
|
|
26434
26444
|
return found;
|
|
26435
26445
|
}, "elements");
|
|
26436
26446
|
|
|
26437
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
26447
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.537.0_@wirecat+cli-base@0.71.0_commander@15.0.0_esbuild@0.28.2_type_e3a3074c051d1ca759b7e8b914e3af6d/node_modules/@wirecat/cli-core/dist/attachments/sheets.js
|
|
26438
26448
|
var columnName = /* @__PURE__ */ __name((column) => {
|
|
26439
26449
|
let name = "";
|
|
26440
26450
|
for (let rest = column; rest > 0; rest = Math.floor((rest - 1) / 26))
|
|
@@ -26489,7 +26499,7 @@ var sheetText = /* @__PURE__ */ __name((sheets2, maxChars = MAX_TEXT_CHARS) => {
|
|
|
26489
26499
|
return { text: parts.join("").trim(), truncated: false };
|
|
26490
26500
|
}, "sheetText");
|
|
26491
26501
|
|
|
26492
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
26502
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.537.0_@wirecat+cli-base@0.71.0_commander@15.0.0_esbuild@0.28.2_type_e3a3074c051d1ca759b7e8b914e3af6d/node_modules/@wirecat/cli-core/dist/attachments/documents.js
|
|
26493
26503
|
var OFFICE = "urn:oasis:names:tc:opendocument:xmlns:office:1.0";
|
|
26494
26504
|
var TEXT = "urn:oasis:names:tc:opendocument:xmlns:text:1.0";
|
|
26495
26505
|
var TABLE = "urn:oasis:names:tc:opendocument:xmlns:table:1.0";
|
|
@@ -26889,10 +26899,10 @@ var readDocument = /* @__PURE__ */ __name(async (bytes2, kind, signal) => {
|
|
|
26889
26899
|
}
|
|
26890
26900
|
}, "readDocument");
|
|
26891
26901
|
|
|
26892
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
26902
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.537.0_@wirecat+cli-base@0.71.0_commander@15.0.0_esbuild@0.28.2_type_e3a3074c051d1ca759b7e8b914e3af6d/node_modules/@wirecat/cli-core/dist/attachments/extract.js
|
|
26893
26903
|
import { extname as extname3 } from "node:path";
|
|
26894
26904
|
|
|
26895
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
26905
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.537.0_@wirecat+cli-base@0.71.0_commander@15.0.0_esbuild@0.28.2_type_e3a3074c051d1ca759b7e8b914e3af6d/node_modules/@wirecat/cli-core/dist/readers/engine.js
|
|
26896
26906
|
import { readFileSync } from "node:fs";
|
|
26897
26907
|
import { dirname as dirname4, extname as extname2, join as join9 } from "node:path";
|
|
26898
26908
|
import { fileURLToPath } from "node:url";
|
|
@@ -26953,7 +26963,7 @@ var derived = /* @__PURE__ */ __name((bytes2, extractor, read) => {
|
|
|
26953
26963
|
}
|
|
26954
26964
|
}, "derived");
|
|
26955
26965
|
|
|
26956
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
26966
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.537.0_@wirecat+cli-base@0.71.0_commander@15.0.0_esbuild@0.28.2_type_e3a3074c051d1ca759b7e8b914e3af6d/node_modules/@wirecat/cli-core/dist/readers/image/index.js
|
|
26957
26967
|
var IMAGES = /* @__PURE__ */ new Set([".jpg", ".jpeg", ".png", ".webp", ".gif", ".heic", ".tif", ".tiff", ".bmp"]);
|
|
26958
26968
|
var image2 = {
|
|
26959
26969
|
id: "image",
|
|
@@ -26962,7 +26972,7 @@ var image2 = {
|
|
|
26962
26972
|
read: /* @__PURE__ */ __name(async () => ({ status: "needs-agent" }), "read")
|
|
26963
26973
|
};
|
|
26964
26974
|
|
|
26965
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
26975
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.537.0_@wirecat+cli-base@0.71.0_commander@15.0.0_esbuild@0.28.2_type_e3a3074c051d1ca759b7e8b914e3af6d/node_modules/@wirecat/cli-core/dist/readers/doc/index.js
|
|
26966
26976
|
var OLE = "\xD0\xCF\xE0\xA1\xB1\xE1";
|
|
26967
26977
|
var doc = {
|
|
26968
26978
|
id: "doc",
|
|
@@ -26974,7 +26984,7 @@ var doc = {
|
|
|
26974
26984
|
}), "read")
|
|
26975
26985
|
};
|
|
26976
26986
|
|
|
26977
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
26987
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.537.0_@wirecat+cli-base@0.71.0_commander@15.0.0_esbuild@0.28.2_type_e3a3074c051d1ca759b7e8b914e3af6d/node_modules/@wirecat/cli-core/dist/readers/docx/index.js
|
|
26978
26988
|
var DOCX = "application/vnd.openxmlformats-officedocument.wordprocessingml.document";
|
|
26979
26989
|
var docx = {
|
|
26980
26990
|
id: "docx",
|
|
@@ -26987,7 +26997,7 @@ var docx = {
|
|
|
26987
26997
|
}), "read")
|
|
26988
26998
|
};
|
|
26989
26999
|
|
|
26990
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
27000
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.537.0_@wirecat+cli-base@0.71.0_commander@15.0.0_esbuild@0.28.2_type_e3a3074c051d1ca759b7e8b914e3af6d/node_modules/@wirecat/cli-core/dist/attachments/markup.js
|
|
26991
27001
|
var import_iconv_lite2 = __toESM(require_lib3(), 1);
|
|
26992
27002
|
var RTF_SKIPPED = /* @__PURE__ */ new Set([
|
|
26993
27003
|
"fonttbl",
|
|
@@ -27163,7 +27173,7 @@ var htmlText = /* @__PURE__ */ __name((source) => {
|
|
|
27163
27173
|
}, "htmlText");
|
|
27164
27174
|
var safeChar = /* @__PURE__ */ __name((code, fallback) => code > 0 && code <= 1114111 ? String.fromCodePoint(code) : fallback, "safeChar");
|
|
27165
27175
|
|
|
27166
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
27176
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.537.0_@wirecat+cli-base@0.71.0_commander@15.0.0_esbuild@0.28.2_type_e3a3074c051d1ca759b7e8b914e3af6d/node_modules/@wirecat/cli-core/dist/readers/html/page.js
|
|
27167
27177
|
var clean = /* @__PURE__ */ __name((value) => typeof value === "string" ? value.replace(/\s+/g, " ").trim() : "", "clean");
|
|
27168
27178
|
var namesIn = /* @__PURE__ */ __name((value) => [value].flat().map((entry) => typeof entry === "string" ? clean(entry) : clean(entry?.name)).filter(Boolean).join(", "), "namesIn");
|
|
27169
27179
|
var jsonLdNodes = /* @__PURE__ */ __name((document) => {
|
|
@@ -27219,7 +27229,7 @@ var markdownSections = /* @__PURE__ */ __name((text2) => {
|
|
|
27219
27229
|
return found.map((section, index) => ({ ...section, end: found[index + 1]?.start ?? text2.length }));
|
|
27220
27230
|
}, "markdownSections");
|
|
27221
27231
|
|
|
27222
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
27232
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.537.0_@wirecat+cli-base@0.71.0_commander@15.0.0_esbuild@0.28.2_type_e3a3074c051d1ca759b7e8b914e3af6d/node_modules/@wirecat/cli-core/dist/readers/html/index.js
|
|
27223
27233
|
var HTML = /* @__PURE__ */ new Set([".html", ".htm", ".xhtml"]);
|
|
27224
27234
|
var first = /* @__PURE__ */ __name((...values) => values.find((value) => typeof value === "string" && value !== ""), "first");
|
|
27225
27235
|
var loaded = /* @__PURE__ */ __name(async (load, name) => {
|
|
@@ -27290,7 +27300,7 @@ var html = {
|
|
|
27290
27300
|
}, "read")
|
|
27291
27301
|
};
|
|
27292
27302
|
|
|
27293
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
27303
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.537.0_@wirecat+cli-base@0.71.0_commander@15.0.0_esbuild@0.28.2_type_e3a3074c051d1ca759b7e8b914e3af6d/node_modules/@wirecat/cli-core/dist/readers/office/index.js
|
|
27294
27304
|
var office = {
|
|
27295
27305
|
id: "office",
|
|
27296
27306
|
version: documentExtractor("odt"),
|
|
@@ -27301,7 +27311,7 @@ var office = {
|
|
|
27301
27311
|
}, "read")
|
|
27302
27312
|
};
|
|
27303
27313
|
|
|
27304
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
27314
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.537.0_@wirecat+cli-base@0.71.0_commander@15.0.0_esbuild@0.28.2_type_e3a3074c051d1ca759b7e8b914e3af6d/node_modules/@wirecat/cli-core/dist/readers/pdf/index.js
|
|
27305
27315
|
var pdf = {
|
|
27306
27316
|
id: "pdf",
|
|
27307
27317
|
version: "unpdf",
|
|
@@ -27368,7 +27378,7 @@ var pdf = {
|
|
|
27368
27378
|
}), "read")
|
|
27369
27379
|
};
|
|
27370
27380
|
|
|
27371
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
27381
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.537.0_@wirecat+cli-base@0.71.0_commander@15.0.0_esbuild@0.28.2_type_e3a3074c051d1ca759b7e8b914e3af6d/node_modules/@wirecat/cli-core/dist/readers/plain/index.js
|
|
27372
27382
|
var PLAIN = /* @__PURE__ */ new Set([".txt", ".md", ".markdown", ".csv", ".tsv", ".json", ".log"]);
|
|
27373
27383
|
var isPlain = /* @__PURE__ */ __name((hint) => PLAIN.has(extensionOf(hint)) || hint.mime?.startsWith("text/") || hint.mime === "application/json", "isPlain");
|
|
27374
27384
|
var readPlain = /* @__PURE__ */ __name((bytes2) => {
|
|
@@ -27388,7 +27398,7 @@ var plain = {
|
|
|
27388
27398
|
read: /* @__PURE__ */ __name(async (bytes2) => readPlain(bytes2), "read")
|
|
27389
27399
|
};
|
|
27390
27400
|
|
|
27391
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
27401
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.537.0_@wirecat+cli-base@0.71.0_commander@15.0.0_esbuild@0.28.2_type_e3a3074c051d1ca759b7e8b914e3af6d/node_modules/@wirecat/cli-core/dist/readers/rtf/index.js
|
|
27392
27402
|
var rtf = {
|
|
27393
27403
|
id: "rtf",
|
|
27394
27404
|
version: "v1",
|
|
@@ -27396,10 +27406,10 @@ var rtf = {
|
|
|
27396
27406
|
read: /* @__PURE__ */ __name(async (bytes2) => derived(bytes2, "rtf:v1", rtfText), "read")
|
|
27397
27407
|
};
|
|
27398
27408
|
|
|
27399
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
27409
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.537.0_@wirecat+cli-base@0.71.0_commander@15.0.0_esbuild@0.28.2_type_e3a3074c051d1ca759b7e8b914e3af6d/node_modules/@wirecat/cli-core/dist/readers/sheets/index.js
|
|
27400
27410
|
import { basename as basename5 } from "node:path";
|
|
27401
27411
|
|
|
27402
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
27412
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.537.0_@wirecat+cli-base@0.71.0_commander@15.0.0_esbuild@0.28.2_type_e3a3074c051d1ca759b7e8b914e3af6d/node_modules/@wirecat/cli-core/dist/attachments/csv-spans.js
|
|
27403
27413
|
var delimitedSpans = /* @__PURE__ */ __name((text2, delimiter, maxCells = 1e4) => {
|
|
27404
27414
|
const cells = [];
|
|
27405
27415
|
let row = 1, column = 1, start = 0, quoted = false, truncated = false;
|
|
@@ -27437,7 +27447,7 @@ var delimitedSpans = /* @__PURE__ */ __name((text2, delimiter, maxCells = 1e4) =
|
|
|
27437
27447
|
return { cells, truncated };
|
|
27438
27448
|
}, "delimitedSpans");
|
|
27439
27449
|
|
|
27440
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
27450
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.537.0_@wirecat+cli-base@0.71.0_commander@15.0.0_esbuild@0.28.2_type_e3a3074c051d1ca759b7e8b914e3af6d/node_modules/@wirecat/cli-core/dist/readers/sheets/index.js
|
|
27441
27451
|
var DELIMITED = {
|
|
27442
27452
|
".csv": ",",
|
|
27443
27453
|
".tsv": " ",
|
|
@@ -27476,7 +27486,7 @@ var sheets = {
|
|
|
27476
27486
|
}, "read")
|
|
27477
27487
|
};
|
|
27478
27488
|
|
|
27479
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
27489
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.537.0_@wirecat+cli-base@0.71.0_commander@15.0.0_esbuild@0.28.2_type_e3a3074c051d1ca759b7e8b914e3af6d/node_modules/@wirecat/cli-core/dist/readers/registry.js
|
|
27480
27490
|
var BUILT_INS2 = [office, pdf, docx, doc, rtf, html, sheets, plain, image2];
|
|
27481
27491
|
var HEAD_BYTES = 1024;
|
|
27482
27492
|
var readers = [...BUILT_INS2];
|
|
@@ -27486,7 +27496,7 @@ var readWithRegistry = /* @__PURE__ */ __name(async (bytes2, hint, context2) =>
|
|
|
27486
27496
|
return reader ? reader.read(bytes2, hint, context2) : { status: "unsupported" };
|
|
27487
27497
|
}, "readWithRegistry");
|
|
27488
27498
|
|
|
27489
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
27499
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.537.0_@wirecat+cli-base@0.71.0_commander@15.0.0_esbuild@0.28.2_type_e3a3074c051d1ca759b7e8b914e3af6d/node_modules/@wirecat/cli-core/dist/attachments/extract.js
|
|
27490
27500
|
var importEngine = /* @__PURE__ */ __name((name) => importFrom(new URL("attachments/extract.js", import.meta.resolve("@wirecat/cli-core")).href, name), "importEngine");
|
|
27491
27501
|
var extensionOf2 = /* @__PURE__ */ __name(({ name, path }) => extname3(name ?? path).toLowerCase(), "extensionOf");
|
|
27492
27502
|
var extractText = /* @__PURE__ */ __name(async (bytes2, hint, load, signal, env = process.env) => {
|
|
@@ -28565,7 +28575,7 @@ function imageSize(input) {
|
|
|
28565
28575
|
}
|
|
28566
28576
|
__name(imageSize, "imageSize");
|
|
28567
28577
|
|
|
28568
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
28578
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.537.0_@wirecat+cli-base@0.71.0_commander@15.0.0_esbuild@0.28.2_type_e3a3074c051d1ca759b7e8b914e3af6d/node_modules/@wirecat/cli-core/dist/attachments/ocr.js
|
|
28569
28579
|
var MAX_PAGES = 20;
|
|
28570
28580
|
var MAX_PIXELS = 2e7;
|
|
28571
28581
|
var cancelled2 = /* @__PURE__ */ __name((signal) => {
|
|
@@ -28716,7 +28726,7 @@ var ocrPdf = /* @__PURE__ */ __name(async (bytes2, pipeline2, load, signal) => {
|
|
|
28716
28726
|
}
|
|
28717
28727
|
}, "ocrPdf");
|
|
28718
28728
|
|
|
28719
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
28729
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.537.0_@wirecat+cli-base@0.71.0_commander@15.0.0_esbuild@0.28.2_type_e3a3074c051d1ca759b7e8b914e3af6d/node_modules/@wirecat/cli-core/dist/attachments/pdf-preview.js
|
|
28720
28730
|
var pdfPreview = /* @__PURE__ */ __name(async (bytes2, page, signal, load = importEngine, env = process.env) => {
|
|
28721
28731
|
const limits = pdfPreviewLimits(env);
|
|
28722
28732
|
const cancelled4 = /* @__PURE__ */ __name(() => {
|
|
@@ -28793,7 +28803,7 @@ var pdfPreview = /* @__PURE__ */ __name(async (bytes2, page, signal, load = impo
|
|
|
28793
28803
|
}
|
|
28794
28804
|
}, "pdfPreview");
|
|
28795
28805
|
|
|
28796
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
28806
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.537.0_@wirecat+cli-base@0.71.0_commander@15.0.0_esbuild@0.28.2_type_e3a3074c051d1ca759b7e8b914e3af6d/node_modules/@wirecat/cli-core/dist/attachments/transfer.js
|
|
28797
28807
|
import { createHash as createHash8 } from "node:crypto";
|
|
28798
28808
|
import { constants } from "node:fs";
|
|
28799
28809
|
import { lstat as lstat3, open as open5 } from "node:fs/promises";
|
|
@@ -28901,7 +28911,121 @@ var transferMime = /* @__PURE__ */ __name((head, hint, name = null) => {
|
|
|
28901
28911
|
return hint !== null && /^[a-z0-9.+-]+\/[a-z0-9.+-]+$/i.test(hint) ? hint : "application/octet-stream";
|
|
28902
28912
|
}, "transferMime");
|
|
28903
28913
|
|
|
28904
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
28914
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.537.0_@wirecat+cli-base@0.71.0_commander@15.0.0_esbuild@0.28.2_type_e3a3074c051d1ca759b7e8b914e3af6d/node_modules/@wirecat/cli-core/dist/services/file-download.js
|
|
28915
|
+
import { createWriteStream, mkdirSync } from "node:fs";
|
|
28916
|
+
import { link as link3, rm } from "node:fs/promises";
|
|
28917
|
+
import { join as join10, resolve as resolve6 } from "node:path";
|
|
28918
|
+
import { Readable, Transform } from "node:stream";
|
|
28919
|
+
import { pipeline } from "node:stream/promises";
|
|
28920
|
+
var refreshedFiles = /* @__PURE__ */ __name((files) => files.flatMap(({ kind, name, position, providerRef }) => providerRef === void 0 || Object.keys(providerRef).length === 0 ? [] : [
|
|
28921
|
+
{
|
|
28922
|
+
kind,
|
|
28923
|
+
providerRef,
|
|
28924
|
+
...name === void 0 ? {} : { name },
|
|
28925
|
+
...position === void 0 ? {} : { position }
|
|
28926
|
+
}
|
|
28927
|
+
]), "refreshedFiles");
|
|
28928
|
+
var recordPaths = /* @__PURE__ */ __name(async (messages, chat, message, files, saved, warn, onFailure) => {
|
|
28929
|
+
const downloaded = saved.map((one, index) => ({
|
|
28930
|
+
kind: one.kind,
|
|
28931
|
+
path: one.path,
|
|
28932
|
+
...files[index]?.name === void 0 ? {} : { name: files[index]?.name },
|
|
28933
|
+
...files[index]?.position === void 0 ? {} : { position: files[index]?.position },
|
|
28934
|
+
...files[index]?.providerRef === void 0 ? {} : { providerRef: files[index]?.providerRef }
|
|
28935
|
+
}));
|
|
28936
|
+
try {
|
|
28937
|
+
const kept = await messages.keepDownloaded(chat, message, downloaded);
|
|
28938
|
+
if (kept < downloaded.length && downloaded.some(({ providerRef }) => Object.keys(providerRef ?? {}).length > 0))
|
|
28939
|
+
warn(`message ${message}: a new file reference from the messenger was not saved; the next download asks again`);
|
|
28940
|
+
return kept;
|
|
28941
|
+
} catch (error) {
|
|
28942
|
+
onFailure?.(error);
|
|
28943
|
+
warn(`not recorded in the local store where message ${message}'s files went: ${error.message}`);
|
|
28944
|
+
return 0;
|
|
28945
|
+
}
|
|
28946
|
+
}, "recordPaths");
|
|
28947
|
+
var downloadMessage = /* @__PURE__ */ __name(async (messages, chat, message, output, warn) => {
|
|
28948
|
+
const { files } = await messages.download(chat, message);
|
|
28949
|
+
mkdirSync(output, { recursive: true });
|
|
28950
|
+
const result = await saveFiles(messages, chat, message, files, output, { unique: true, warn });
|
|
28951
|
+
if (result.batch.failed > 0)
|
|
28952
|
+
throw new CliError("provider_error", "some attachments failed; completed downloads are retained", {
|
|
28953
|
+
batch: result.batch,
|
|
28954
|
+
saved: result.saved
|
|
28955
|
+
});
|
|
28956
|
+
return result.saved;
|
|
28957
|
+
}, "downloadMessage");
|
|
28958
|
+
var saveFiles = /* @__PURE__ */ __name(async (messages, chat, message, files, output, { unique = false, warn, onSaved, batch = batchProgress() }) => {
|
|
28959
|
+
const saved = [];
|
|
28960
|
+
const successful = [];
|
|
28961
|
+
for (const [index, file] of files.entries()) {
|
|
28962
|
+
if (batch.stopped)
|
|
28963
|
+
break;
|
|
28964
|
+
try {
|
|
28965
|
+
const one = await save(file, output, `${message}-${index + 1}`, { unique });
|
|
28966
|
+
saved.push(one);
|
|
28967
|
+
successful.push(file);
|
|
28968
|
+
batch.ok();
|
|
28969
|
+
onSaved?.(one);
|
|
28970
|
+
} catch (error) {
|
|
28971
|
+
const issue = batch.fail(message, "download", error, (file.position ?? index) + 1);
|
|
28972
|
+
warn(`message ${message}, attachment ${(file.position ?? index) + 1}: ${issue.code} \u2014 ${issue.message}`);
|
|
28973
|
+
}
|
|
28974
|
+
}
|
|
28975
|
+
await recordPaths(messages, chat, message, successful, saved, warn, (error) => batch.fail(message, "record_downloads", error));
|
|
28976
|
+
return { saved, batch: batch.result() };
|
|
28977
|
+
}, "saveFiles");
|
|
28978
|
+
var EXTENSIONS = {
|
|
28979
|
+
"image/jpeg": "jpg",
|
|
28980
|
+
"image/png": "png",
|
|
28981
|
+
"image/webp": "webp",
|
|
28982
|
+
"image/gif": "gif",
|
|
28983
|
+
"video/mp4": "mp4",
|
|
28984
|
+
"video/webm": "webm",
|
|
28985
|
+
"audio/mpeg": "mp3",
|
|
28986
|
+
"audio/ogg": "ogg",
|
|
28987
|
+
"audio/mp4": "m4a",
|
|
28988
|
+
"application/pdf": "pdf"
|
|
28989
|
+
};
|
|
28990
|
+
var BY_KIND = { photo: "jpg" };
|
|
28991
|
+
var save = /* @__PURE__ */ __name(async (file, directory2, fallbackName, { unique = false } = {}) => {
|
|
28992
|
+
const own = safeName(file.name);
|
|
28993
|
+
const fileName = /* @__PURE__ */ __name(() => {
|
|
28994
|
+
const extension = EXTENSIONS[file.mime ?? ""] ?? BY_KIND[file.kind];
|
|
28995
|
+
return own ?? (extension ? `${fallbackName}.${extension}` : fallbackName);
|
|
28996
|
+
}, "fileName");
|
|
28997
|
+
const partial = join10(directory2, `.${fileName()}.${process.pid}.part`);
|
|
28998
|
+
let bytes2 = 0;
|
|
28999
|
+
const counting = new Transform({
|
|
29000
|
+
transform(chunk, _encoding, done2) {
|
|
29001
|
+
bytes2 += chunk.length;
|
|
29002
|
+
done2(null, chunk);
|
|
29003
|
+
}
|
|
29004
|
+
});
|
|
29005
|
+
try {
|
|
29006
|
+
await pipeline(Readable.from(file.bytes()), counting, createWriteStream(partial, { flags: "wx", mode: 384 }));
|
|
29007
|
+
const name = fileName();
|
|
29008
|
+
const names2 = unique && own ? [name, `${fallbackName}-${own}`] : [name];
|
|
29009
|
+
for (const candidate of names2) {
|
|
29010
|
+
const path2 = resolve6(join10(directory2, candidate));
|
|
29011
|
+
const taken = await link3(partial, path2).then(() => false, (error) => {
|
|
29012
|
+
if (error.code === "EEXIST")
|
|
29013
|
+
return true;
|
|
29014
|
+
throw error;
|
|
29015
|
+
});
|
|
29016
|
+
if (!taken)
|
|
29017
|
+
return { kind: file.kind, path: path2, bytes: bytes2 };
|
|
29018
|
+
}
|
|
29019
|
+
const path = resolve6(join10(directory2, names2.at(-1) ?? name));
|
|
29020
|
+
if (unique)
|
|
29021
|
+
return { kind: file.kind, path, bytes: bytes2, existing: true };
|
|
29022
|
+
throw new CliError("validation_error", `${path} already exists \u2014 nothing was overwritten; choose --output-dir`);
|
|
29023
|
+
} finally {
|
|
29024
|
+
await rm(partial, { force: true });
|
|
29025
|
+
}
|
|
29026
|
+
}, "save");
|
|
29027
|
+
|
|
29028
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.537.0_@wirecat+cli-base@0.71.0_commander@15.0.0_esbuild@0.28.2_type_e3a3074c051d1ca759b7e8b914e3af6d/node_modules/@wirecat/cli-core/dist/services/attachments.js
|
|
28905
29029
|
var ATTACHMENT_QUERY = {
|
|
28906
29030
|
entity: "attachment",
|
|
28907
29031
|
backend: "sql",
|
|
@@ -29256,6 +29380,48 @@ var attachmentsService = /* @__PURE__ */ __name((deps) => ({
|
|
|
29256
29380
|
...preview
|
|
29257
29381
|
};
|
|
29258
29382
|
}, "show"),
|
|
29383
|
+
saveHeld: /* @__PURE__ */ __name(async ({ chat, message, attachment: attachment2, output }) => {
|
|
29384
|
+
if (attachment2 !== void 0 && (!Number.isSafeInteger(attachment2) || attachment2 < 1))
|
|
29385
|
+
throw new CliError("validation_error", "attachment must be a position from 1");
|
|
29386
|
+
const store = await accountStore(deps);
|
|
29387
|
+
const { account } = store;
|
|
29388
|
+
const { chatId, messageId } = await messageOf(deps, store, chat, message);
|
|
29389
|
+
const ref = formatLocator({ ...account, chat: chatId, message: messageId });
|
|
29390
|
+
const files = (await store.attachments.attachments({ chatId, messageId, limit: 1e3 })).filter(({ kind }) => !NOT_FILES.has(kind));
|
|
29391
|
+
if (files.length === 0)
|
|
29392
|
+
throw new CliError("not_found", `the local store holds no file of ${ref}`);
|
|
29393
|
+
const chosen = attachment2 === void 0 ? files : files.filter(({ position }) => position === attachment2 - 1);
|
|
29394
|
+
if (chosen.length === 0)
|
|
29395
|
+
throw new CliError("not_found", `${ref} has no file at position ${attachment2}; its files are at ${files.map(({ position }) => position + 1).join(", ")}`);
|
|
29396
|
+
const env = deps.env ?? process.env;
|
|
29397
|
+
const held = await Promise.all(chosen.map(async (file) => {
|
|
29398
|
+
const missing4 = new CliError("not_found", `file ${file.position + 1} of ${ref} is not saved on this computer; run messages download without --offline`);
|
|
29399
|
+
if (file.localPath === null)
|
|
29400
|
+
throw missing4;
|
|
29401
|
+
if (refusedPlace(file.localPath, deps.messenger.app, env))
|
|
29402
|
+
throw new CliError("validation_error", "cannot copy known credential files, the WireCat apps' own files or the message store");
|
|
29403
|
+
const found = await lstat4(file.localPath).catch(() => void 0);
|
|
29404
|
+
if (!found)
|
|
29405
|
+
throw missing4;
|
|
29406
|
+
if (!found.isFile())
|
|
29407
|
+
throw new CliError("validation_error", "the saved attachment must be a regular file");
|
|
29408
|
+
return { file, path: file.localPath };
|
|
29409
|
+
}));
|
|
29410
|
+
mkdirSync2(output, { recursive: true });
|
|
29411
|
+
const saved = [];
|
|
29412
|
+
for (const { file, path } of held)
|
|
29413
|
+
saved.push(await save({
|
|
29414
|
+
kind: file.kind,
|
|
29415
|
+
...file.name === null ? {} : { name: file.name },
|
|
29416
|
+
...file.mime === null ? {} : { mime: file.mime },
|
|
29417
|
+
position: file.position,
|
|
29418
|
+
bytes: /* @__PURE__ */ __name(async function* () {
|
|
29419
|
+
const handle = await open6(path, constants2.O_RDONLY | (constants2.O_NOFOLLOW ?? 0));
|
|
29420
|
+
yield* handle.createReadStream();
|
|
29421
|
+
}, "bytes")
|
|
29422
|
+
}, output, `${messageId}-${file.position + 1}`));
|
|
29423
|
+
return saved;
|
|
29424
|
+
}, "saveHeld"),
|
|
29259
29425
|
setText: /* @__PURE__ */ __name(async ({ chat, message, attachment: attachment2, text: text2 }) => {
|
|
29260
29426
|
if (text2.trim() === "")
|
|
29261
29427
|
throw new CliError("validation_error", "the text is empty \u2014 nothing to keep");
|
|
@@ -29282,7 +29448,7 @@ var attachmentsService = /* @__PURE__ */ __name((deps) => ({
|
|
|
29282
29448
|
}, "setText")
|
|
29283
29449
|
}), "attachmentsService");
|
|
29284
29450
|
|
|
29285
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
29451
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.537.0_@wirecat+cli-base@0.71.0_commander@15.0.0_esbuild@0.28.2_type_e3a3074c051d1ca759b7e8b914e3af6d/node_modules/@wirecat/cli-core/dist/services/chat-documents.js
|
|
29286
29452
|
var chatDocumentsService = /* @__PURE__ */ __name((deps) => ({
|
|
29287
29453
|
list: /* @__PURE__ */ __name(async (chat, { limit, offset, ref }) => {
|
|
29288
29454
|
const store = await accountStore(deps);
|
|
@@ -29312,7 +29478,7 @@ var chatDocumentsService = /* @__PURE__ */ __name((deps) => ({
|
|
|
29312
29478
|
}, "list")
|
|
29313
29479
|
}), "chatDocumentsService");
|
|
29314
29480
|
|
|
29315
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
29481
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.537.0_@wirecat+cli-base@0.71.0_commander@15.0.0_esbuild@0.28.2_type_e3a3074c051d1ca759b7e8b914e3af6d/node_modules/@wirecat/cli-core/dist/services/retention.js
|
|
29316
29482
|
var observationDuration = /* @__PURE__ */ __name((text2, flag) => {
|
|
29317
29483
|
const match = /^(\d+(?:\.\d+)?)([smhdw])$/.exec(text2);
|
|
29318
29484
|
const units2 = { s: 1e3, m: 6e4, h: 36e5, d: 864e5, w: 6048e5 };
|
|
@@ -29399,7 +29565,7 @@ var isRetentionSelection = /* @__PURE__ */ __name((selection) => {
|
|
|
29399
29565
|
}
|
|
29400
29566
|
}, "isRetentionSelection");
|
|
29401
29567
|
|
|
29402
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
29568
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.537.0_@wirecat+cli-base@0.71.0_commander@15.0.0_esbuild@0.28.2_type_e3a3074c051d1ca759b7e8b914e3af6d/node_modules/@wirecat/cli-core/dist/services/counters.js
|
|
29403
29569
|
var counterFields = /* @__PURE__ */ __name((text2 = "views,reactions,comments") => {
|
|
29404
29570
|
const fields = text2.split(",").map((one) => one.trim());
|
|
29405
29571
|
if (!fields.length || fields.some((one) => !COUNTER_FIELDS.includes(one)) || new Set(fields).size !== fields.length)
|
|
@@ -29606,7 +29772,7 @@ var countersService = /* @__PURE__ */ __name((deps) => {
|
|
|
29606
29772
|
};
|
|
29607
29773
|
}, "countersService");
|
|
29608
29774
|
|
|
29609
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
29775
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.537.0_@wirecat+cli-base@0.71.0_commander@15.0.0_esbuild@0.28.2_type_e3a3074c051d1ca759b7e8b914e3af6d/node_modules/@wirecat/cli-core/dist/services/search-refresh.js
|
|
29610
29776
|
var SYNC_KEY = "messages.sync-first";
|
|
29611
29777
|
var SYNC_BOUNDS = { maxChats: 5, timeMs: 3e4, maxMessages: 500 };
|
|
29612
29778
|
var keyOf2 = /* @__PURE__ */ __name((chat) => JSON.stringify([chat.account.provider, chat.account.account, chat.chatId]), "keyOf");
|
|
@@ -29738,7 +29904,7 @@ var withRefresh = /* @__PURE__ */ __name((found, refreshed) => ({
|
|
|
29738
29904
|
...!refreshed || refreshed.complete ? {} : { coverage: { ...found.coverage, state: "stale" } }
|
|
29739
29905
|
}), "withRefresh");
|
|
29740
29906
|
|
|
29741
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
29907
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.537.0_@wirecat+cli-base@0.71.0_commander@15.0.0_esbuild@0.28.2_type_e3a3074c051d1ca759b7e8b914e3af6d/node_modules/@wirecat/cli-core/dist/services/embeddings-search.js
|
|
29742
29908
|
var CANDIDATES = 50;
|
|
29743
29909
|
var WORD_HITS = 200;
|
|
29744
29910
|
var RRF_K = 60;
|
|
@@ -30013,13 +30179,13 @@ var meanOf = /* @__PURE__ */ __name((vectors) => {
|
|
|
30013
30179
|
return mean.map((value) => value / length);
|
|
30014
30180
|
}, "meanOf");
|
|
30015
30181
|
|
|
30016
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
30182
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.537.0_@wirecat+cli-base@0.71.0_commander@15.0.0_esbuild@0.28.2_type_e3a3074c051d1ca759b7e8b914e3af6d/node_modules/@wirecat/cli-core/dist/services/embeddings.js
|
|
30017
30183
|
var embeddingsService = /* @__PURE__ */ __name((deps) => ({
|
|
30018
30184
|
...embeddingsMaintenance(deps),
|
|
30019
30185
|
...embeddingsSearch(deps)
|
|
30020
30186
|
}), "embeddingsService");
|
|
30021
30187
|
|
|
30022
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
30188
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.537.0_@wirecat+cli-base@0.71.0_commander@15.0.0_esbuild@0.28.2_type_e3a3074c051d1ca759b7e8b914e3af6d/node_modules/@wirecat/cli-core/dist/services/folders.js
|
|
30023
30189
|
var foldersService = /* @__PURE__ */ __name((deps) => {
|
|
30024
30190
|
const online = /* @__PURE__ */ __name(async (command) => {
|
|
30025
30191
|
if (deps.offline)
|
|
@@ -30160,7 +30326,7 @@ var foldersService = /* @__PURE__ */ __name((deps) => {
|
|
|
30160
30326
|
};
|
|
30161
30327
|
}, "foldersService");
|
|
30162
30328
|
|
|
30163
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
30329
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.537.0_@wirecat+cli-base@0.71.0_commander@15.0.0_esbuild@0.28.2_type_e3a3074c051d1ca759b7e8b914e3af6d/node_modules/@wirecat/cli-core/dist/services/mentions.js
|
|
30164
30330
|
var REVIEW_COUNT = 500;
|
|
30165
30331
|
var mentionsService = /* @__PURE__ */ __name((deps) => {
|
|
30166
30332
|
const located = /* @__PURE__ */ __name(async () => {
|
|
@@ -30239,7 +30405,14 @@ var mentionsService = /* @__PURE__ */ __name((deps) => {
|
|
|
30239
30405
|
};
|
|
30240
30406
|
}, "mentionsService");
|
|
30241
30407
|
|
|
30242
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
30408
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.537.0_@wirecat+cli-base@0.71.0_commander@15.0.0_esbuild@0.28.2_type_e3a3074c051d1ca759b7e8b914e3af6d/node_modules/@wirecat/cli-core/dist/domain/message-link.js
|
|
30409
|
+
var fileLinks = /* @__PURE__ */ __name((attachments) => hitFiles(attachments).map(({ position, kind, name }) => ({
|
|
30410
|
+
position,
|
|
30411
|
+
kind,
|
|
30412
|
+
...name === void 0 ? {} : { name },
|
|
30413
|
+
url: null,
|
|
30414
|
+
reason: "unsupported_provider"
|
|
30415
|
+
})), "fileLinks");
|
|
30243
30416
|
var messageLinkTarget = /* @__PURE__ */ __name((reference, message, provider) => {
|
|
30244
30417
|
if (isLocator(reference)) {
|
|
30245
30418
|
if (message !== void 0)
|
|
@@ -30286,7 +30459,7 @@ var validatePermalink = /* @__PURE__ */ __name((link4) => {
|
|
|
30286
30459
|
return { url: link4.url, access: link4.access, reason: link4.reason };
|
|
30287
30460
|
}, "validatePermalink");
|
|
30288
30461
|
|
|
30289
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
30462
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.537.0_@wirecat+cli-base@0.71.0_commander@15.0.0_esbuild@0.28.2_type_e3a3074c051d1ca759b7e8b914e3af6d/node_modules/@wirecat/cli-core/dist/domain/pin-duration.js
|
|
30290
30463
|
var spokenSeconds = /* @__PURE__ */ __name((seconds) => {
|
|
30291
30464
|
if (seconds % 86400 === 0 && seconds > 86400)
|
|
30292
30465
|
return `${seconds / 86400}d`;
|
|
@@ -30318,7 +30491,7 @@ var pinDurationOf = /* @__PURE__ */ __name((value, allowed, flag = "--expire-tim
|
|
|
30318
30491
|
return seconds;
|
|
30319
30492
|
}, "pinDurationOf");
|
|
30320
30493
|
|
|
30321
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
30494
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.537.0_@wirecat+cli-base@0.71.0_commander@15.0.0_esbuild@0.28.2_type_e3a3074c051d1ca759b7e8b914e3af6d/node_modules/@wirecat/cli-core/dist/sends/send-as.js
|
|
30322
30495
|
var sendAsCheck = /* @__PURE__ */ __name((connection, sendAs) => {
|
|
30323
30496
|
if (sendAs === void 0) {
|
|
30324
30497
|
const saved = connection.savedSender?.bind(connection);
|
|
@@ -30343,7 +30516,7 @@ var typedSendAs = /* @__PURE__ */ __name((typed) => {
|
|
|
30343
30516
|
return sendAs;
|
|
30344
30517
|
}, "typedSendAs");
|
|
30345
30518
|
|
|
30346
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
30519
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.537.0_@wirecat+cli-base@0.71.0_commander@15.0.0_esbuild@0.28.2_type_e3a3074c051d1ca759b7e8b914e3af6d/node_modules/@wirecat/cli-core/dist/search/total.js
|
|
30347
30520
|
var TOTAL_CAP = 1e4;
|
|
30348
30521
|
var totalOf = /* @__PURE__ */ __name((count4, shown, hasMore, exact = true) => {
|
|
30349
30522
|
const least = shown + (hasMore ? 1 : 0);
|
|
@@ -30354,7 +30527,7 @@ var totalOf = /* @__PURE__ */ __name((count4, shown, hasMore, exact = true) => {
|
|
|
30354
30527
|
return { value: count4, relation: exact ? "eq" : "gte" };
|
|
30355
30528
|
}, "totalOf");
|
|
30356
30529
|
|
|
30357
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
30530
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.537.0_@wirecat+cli-base@0.71.0_commander@15.0.0_esbuild@0.28.2_type_e3a3074c051d1ca759b7e8b914e3af6d/node_modules/@wirecat/cli-core/dist/search/lucene/meaning-parts.js
|
|
30358
30531
|
var WORD_FIELDS = /* @__PURE__ */ new Set(["text", "exact"]);
|
|
30359
30532
|
var fieldsOfQuery = /* @__PURE__ */ __name((root, everything) => {
|
|
30360
30533
|
let narrows = false;
|
|
@@ -30383,7 +30556,7 @@ var meaningWords = /* @__PURE__ */ __name((root) => {
|
|
|
30383
30556
|
return wanted(root).join(" ").trim();
|
|
30384
30557
|
}, "meaningWords");
|
|
30385
30558
|
|
|
30386
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
30559
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.537.0_@wirecat+cli-base@0.71.0_commander@15.0.0_esbuild@0.28.2_type_e3a3074c051d1ca759b7e8b914e3af6d/node_modules/@wirecat/cli-core/dist/search/question-plan.js
|
|
30387
30560
|
var words = /* @__PURE__ */ __name((text2) => normalize(text2).match(/[\p{L}\p{N}]+/gu) ?? [], "words");
|
|
30388
30561
|
var scaffolding = new Set(words("what which how many much who where when is are was were do does did can could should we the a an for of to under from in on at has have \u0441\u043A\u043E\u043B\u044C\u043A\u043E \u043A\u0430\u043A\u043E\u0439 \u043A\u0430\u043A\u0430\u044F \u043A\u0430\u043A\u0438\u0435 \u043A\u0430\u043A\u043E\u0435 \u043A\u0442\u043E \u043A\u043E\u043C\u0443 \u043A\u0435\u043C \u0433\u0434\u0435 \u043A\u043E\u0433\u0434\u0430 \u043A\u0430\u043A \u0447\u0442\u043E \u0432\u043E \u043F\u043E \u043D\u0430 \u0432 \u043A \u0441 \u0443 \u0447\u0435\u0440\u0435\u0437 \u043B\u0438 \u0434\u043E\u043B\u0436\u0435\u043D \u0434\u043E\u043B\u0436\u043D\u0430 \u043D\u0443\u0436\u043D\u043E \u0438\u0434\u0451\u0442 \u0438\u0434\u0435\u0442 \u043C\u043E\u0436\u043D\u043E \u043C\u043E\u0436\u0435\u0442 \u043C\u043E\u0433\u0443\u0442"));
|
|
30389
30562
|
var questionWord = /\b(?:what|which|how|who|where|when|can|could|should)\b|(?:^|\s)(?:сколько|какой|какая|какие|какое|кто|кому|кем|где|когда|как|что|можно|может|могут|ли)(?:\s|$)/iu;
|
|
@@ -30498,7 +30671,7 @@ function planQuestion(text2, strict = false) {
|
|
|
30498
30671
|
}
|
|
30499
30672
|
__name(planQuestion, "planQuestion");
|
|
30500
30673
|
|
|
30501
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
30674
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.537.0_@wirecat+cli-base@0.71.0_commander@15.0.0_esbuild@0.28.2_type_e3a3074c051d1ca759b7e8b914e3af6d/node_modules/@wirecat/cli-core/dist/services/messages-combined.js
|
|
30502
30675
|
var COMBINED_DEFAULTS = { candidateDepth: 300, rrfK: 60, rerank: "all", chatCap: 0 };
|
|
30503
30676
|
var tokensOf = /* @__PURE__ */ __name((text2) => normalize(text2).match(/[\p{L}\p{N}\p{Co}\p{M}]+/gu) ?? [], "tokensOf");
|
|
30504
30677
|
var searchCombined = /* @__PURE__ */ __name(async (store, account, request, messenger = {}, options = COMBINED_DEFAULTS) => {
|
|
@@ -30691,7 +30864,7 @@ var signals = /* @__PURE__ */ __name((hit, terms, corrections, execution, mode,
|
|
|
30691
30864
|
return mode === "coverage" ? coverage * 4 : mode === "proximity" ? proximity : mode === "phrase" ? phrase : coverage * 4 + proximity + phrase;
|
|
30692
30865
|
}, "signals");
|
|
30693
30866
|
|
|
30694
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
30867
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.537.0_@wirecat+cli-base@0.71.0_commander@15.0.0_esbuild@0.28.2_type_e3a3074c051d1ca759b7e8b914e3af6d/node_modules/@wirecat/cli-core/dist/services/messages-discovery.js
|
|
30695
30868
|
var MEANING_DEPTH = 100;
|
|
30696
30869
|
var RRF_K2 = 60;
|
|
30697
30870
|
var RERANK_DEPTH = 50;
|
|
@@ -31019,7 +31192,7 @@ var mixedWithReranker = /* @__PURE__ */ __name((head, scores) => {
|
|
|
31019
31192
|
})).sort((a, b) => b.mixed - a.mixed).map(({ hit }) => hit);
|
|
31020
31193
|
}, "mixedWithReranker");
|
|
31021
31194
|
|
|
31022
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
31195
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.537.0_@wirecat+cli-base@0.71.0_commander@15.0.0_esbuild@0.28.2_type_e3a3074c051d1ca759b7e8b914e3af6d/node_modules/@wirecat/cli-core/dist/services/thread-context.js
|
|
31023
31196
|
var THREAD_BOUNDS = { maxHops: 8, maxMessages: 50, maxBytes: 65536, withinMs: 864e5 };
|
|
31024
31197
|
var bytes = /* @__PURE__ */ __name((items, links) => Buffer.byteLength(JSON.stringify({ items, links }), "utf8"), "bytes");
|
|
31025
31198
|
var threadBounds = /* @__PURE__ */ __name((options = {}) => {
|
|
@@ -31218,7 +31391,7 @@ var readThreadContext = /* @__PURE__ */ __name(async (store, account, chat, mess
|
|
|
31218
31391
|
return result;
|
|
31219
31392
|
}, "readThreadContext");
|
|
31220
31393
|
|
|
31221
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
31394
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.537.0_@wirecat+cli-base@0.71.0_commander@15.0.0_esbuild@0.28.2_type_e3a3074c051d1ca759b7e8b914e3af6d/node_modules/@wirecat/cli-core/dist/services/messages-archive-search.js
|
|
31222
31395
|
var SEARCH_FILL_MS = 200;
|
|
31223
31396
|
var statsStore = /* @__PURE__ */ __name(async (store, account, request, messenger = {}) => {
|
|
31224
31397
|
const stop = Date.now() + SEARCH_FILL_MS;
|
|
@@ -31285,12 +31458,12 @@ var accountOf2 = /* @__PURE__ */ __name((hit) => {
|
|
|
31285
31458
|
}, "accountOf");
|
|
31286
31459
|
var keyOf3 = /* @__PURE__ */ __name(({ provider, account }) => `${provider}/${account}`, "keyOf");
|
|
31287
31460
|
|
|
31288
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
31461
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.537.0_@wirecat+cli-base@0.71.0_commander@15.0.0_esbuild@0.28.2_type_e3a3074c051d1ca759b7e8b914e3af6d/node_modules/@wirecat/cli-core/dist/services/pictures.js
|
|
31289
31462
|
import { createHash as createHash10 } from "node:crypto";
|
|
31290
31463
|
import { readFile as readFile2, stat as stat3 } from "node:fs/promises";
|
|
31291
31464
|
import { setTimeout as sleep4 } from "node:timers/promises";
|
|
31292
31465
|
|
|
31293
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
31466
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.537.0_@wirecat+cli-base@0.71.0_commander@15.0.0_esbuild@0.28.2_type_e3a3074c051d1ca759b7e8b914e3af6d/node_modules/@wirecat/cli-core/dist/domain/models.js
|
|
31294
31467
|
var GROUP_SETTINGS = [
|
|
31295
31468
|
"allCanPin",
|
|
31296
31469
|
"onlyAdminsAdd",
|
|
@@ -31304,130 +31477,7 @@ var ADMIN_RIGHTS = ["read", "members", "admins", "info", "pin", "link", "post",
|
|
|
31304
31477
|
var senderIsMe = /* @__PURE__ */ __name((message, account) => message.outgoing === true || message.senderId !== null && String(message.senderId) === account, "senderIsMe");
|
|
31305
31478
|
var MEDIA_KINDS = ["photo", "video", "file", "audio", "link"];
|
|
31306
31479
|
|
|
31307
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
31308
|
-
import { createWriteStream, mkdirSync } from "node:fs";
|
|
31309
|
-
import { link as link3, rm } from "node:fs/promises";
|
|
31310
|
-
import { basename as basename6, join as join10, resolve as resolve6 } from "node:path";
|
|
31311
|
-
import { Readable, Transform } from "node:stream";
|
|
31312
|
-
import { pipeline } from "node:stream/promises";
|
|
31313
|
-
var refreshedFiles = /* @__PURE__ */ __name((files) => files.flatMap(({ kind, name, position, providerRef }) => providerRef === void 0 || Object.keys(providerRef).length === 0 ? [] : [
|
|
31314
|
-
{
|
|
31315
|
-
kind,
|
|
31316
|
-
providerRef,
|
|
31317
|
-
...name === void 0 ? {} : { name },
|
|
31318
|
-
...position === void 0 ? {} : { position }
|
|
31319
|
-
}
|
|
31320
|
-
]), "refreshedFiles");
|
|
31321
|
-
var recordPaths = /* @__PURE__ */ __name(async (messages, chat, message, files, saved, warn, onFailure) => {
|
|
31322
|
-
const downloaded = saved.map((one, index) => ({
|
|
31323
|
-
kind: one.kind,
|
|
31324
|
-
path: one.path,
|
|
31325
|
-
...files[index]?.name === void 0 ? {} : { name: files[index]?.name },
|
|
31326
|
-
...files[index]?.position === void 0 ? {} : { position: files[index]?.position },
|
|
31327
|
-
...files[index]?.providerRef === void 0 ? {} : { providerRef: files[index]?.providerRef }
|
|
31328
|
-
}));
|
|
31329
|
-
try {
|
|
31330
|
-
const kept = await messages.keepDownloaded(chat, message, downloaded);
|
|
31331
|
-
if (kept < downloaded.length && downloaded.some(({ providerRef }) => Object.keys(providerRef ?? {}).length > 0))
|
|
31332
|
-
warn(`message ${message}: a new file reference from the messenger was not saved; the next download asks again`);
|
|
31333
|
-
return kept;
|
|
31334
|
-
} catch (error) {
|
|
31335
|
-
onFailure?.(error);
|
|
31336
|
-
warn(`not recorded in the local store where message ${message}'s files went: ${error.message}`);
|
|
31337
|
-
return 0;
|
|
31338
|
-
}
|
|
31339
|
-
}, "recordPaths");
|
|
31340
|
-
var downloadMessage = /* @__PURE__ */ __name(async (messages, chat, message, output, warn) => {
|
|
31341
|
-
const { files } = await messages.download(chat, message);
|
|
31342
|
-
mkdirSync(output, { recursive: true });
|
|
31343
|
-
const result = await saveFiles(messages, chat, message, files, output, { unique: true, warn });
|
|
31344
|
-
if (result.batch.failed > 0)
|
|
31345
|
-
throw new CliError("provider_error", "some attachments failed; completed downloads are retained", {
|
|
31346
|
-
batch: result.batch,
|
|
31347
|
-
saved: result.saved
|
|
31348
|
-
});
|
|
31349
|
-
return result.saved;
|
|
31350
|
-
}, "downloadMessage");
|
|
31351
|
-
var saveFiles = /* @__PURE__ */ __name(async (messages, chat, message, files, output, { unique = false, warn, onSaved, batch = batchProgress() }) => {
|
|
31352
|
-
const saved = [];
|
|
31353
|
-
const successful = [];
|
|
31354
|
-
for (const [index, file] of files.entries()) {
|
|
31355
|
-
if (batch.stopped)
|
|
31356
|
-
break;
|
|
31357
|
-
try {
|
|
31358
|
-
const one = await save(file, output, `${message}-${index + 1}`, { unique });
|
|
31359
|
-
saved.push(one);
|
|
31360
|
-
successful.push(file);
|
|
31361
|
-
batch.ok();
|
|
31362
|
-
onSaved?.(one);
|
|
31363
|
-
} catch (error) {
|
|
31364
|
-
const issue = batch.fail(message, "download", error, (file.position ?? index) + 1);
|
|
31365
|
-
warn(`message ${message}, attachment ${(file.position ?? index) + 1}: ${issue.code} \u2014 ${issue.message}`);
|
|
31366
|
-
}
|
|
31367
|
-
}
|
|
31368
|
-
await recordPaths(messages, chat, message, successful, saved, warn, (error) => batch.fail(message, "record_downloads", error));
|
|
31369
|
-
return { saved, batch: batch.result() };
|
|
31370
|
-
}, "saveFiles");
|
|
31371
|
-
var EXTENSIONS = {
|
|
31372
|
-
"image/jpeg": "jpg",
|
|
31373
|
-
"image/png": "png",
|
|
31374
|
-
"image/webp": "webp",
|
|
31375
|
-
"image/gif": "gif",
|
|
31376
|
-
"video/mp4": "mp4",
|
|
31377
|
-
"video/webm": "webm",
|
|
31378
|
-
"audio/mpeg": "mp3",
|
|
31379
|
-
"audio/ogg": "ogg",
|
|
31380
|
-
"audio/mp4": "m4a",
|
|
31381
|
-
"application/pdf": "pdf"
|
|
31382
|
-
};
|
|
31383
|
-
var BY_KIND = { photo: "jpg" };
|
|
31384
|
-
var safeName2 = /* @__PURE__ */ __name((name, platform = process.platform) => {
|
|
31385
|
-
let plain2 = name === void 0 ? "" : basename6(name.replaceAll("\\", "/")).replace(/[\p{Cc}---]/gu, "").replace(/^\.+/, "");
|
|
31386
|
-
if (platform === "win32") {
|
|
31387
|
-
plain2 = plain2.replace(/[<>:"|?*]/g, "_").replace(/[. ]+$/, "");
|
|
31388
|
-
if (/^(con|prn|aux|nul|com[1-9]|lpt[1-9])(?:\.|$)/i.test(plain2))
|
|
31389
|
-
return void 0;
|
|
31390
|
-
}
|
|
31391
|
-
return plain2 === "" ? void 0 : plain2;
|
|
31392
|
-
}, "safeName");
|
|
31393
|
-
var save = /* @__PURE__ */ __name(async (file, directory2, fallbackName, { unique = false } = {}) => {
|
|
31394
|
-
const own = safeName2(file.name);
|
|
31395
|
-
const fileName = /* @__PURE__ */ __name(() => {
|
|
31396
|
-
const extension = EXTENSIONS[file.mime ?? ""] ?? BY_KIND[file.kind];
|
|
31397
|
-
return own ?? (extension ? `${fallbackName}.${extension}` : fallbackName);
|
|
31398
|
-
}, "fileName");
|
|
31399
|
-
const partial = join10(directory2, `.${fileName()}.${process.pid}.part`);
|
|
31400
|
-
let bytes2 = 0;
|
|
31401
|
-
const counting = new Transform({
|
|
31402
|
-
transform(chunk, _encoding, done2) {
|
|
31403
|
-
bytes2 += chunk.length;
|
|
31404
|
-
done2(null, chunk);
|
|
31405
|
-
}
|
|
31406
|
-
});
|
|
31407
|
-
try {
|
|
31408
|
-
await pipeline(Readable.from(file.bytes()), counting, createWriteStream(partial, { flags: "wx", mode: 384 }));
|
|
31409
|
-
const name = fileName();
|
|
31410
|
-
const names2 = unique && own ? [name, `${fallbackName}-${own}`] : [name];
|
|
31411
|
-
for (const candidate of names2) {
|
|
31412
|
-
const path2 = resolve6(join10(directory2, candidate));
|
|
31413
|
-
const taken = await link3(partial, path2).then(() => false, (error) => {
|
|
31414
|
-
if (error.code === "EEXIST")
|
|
31415
|
-
return true;
|
|
31416
|
-
throw error;
|
|
31417
|
-
});
|
|
31418
|
-
if (!taken)
|
|
31419
|
-
return { kind: file.kind, path: path2, bytes: bytes2 };
|
|
31420
|
-
}
|
|
31421
|
-
const path = resolve6(join10(directory2, names2.at(-1) ?? name));
|
|
31422
|
-
if (unique)
|
|
31423
|
-
return { kind: file.kind, path, bytes: bytes2, existing: true };
|
|
31424
|
-
throw new CliError("validation_error", `${path} already exists \u2014 nothing was overwritten; choose --output-dir`);
|
|
31425
|
-
} finally {
|
|
31426
|
-
await rm(partial, { force: true });
|
|
31427
|
-
}
|
|
31428
|
-
}, "save");
|
|
31429
|
-
|
|
31430
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.521.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_66d5ccffb8b88e4b24c051b84ef1952a/node_modules/@wirecat/cli-core/dist/services/pictures.js
|
|
31480
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.537.0_@wirecat+cli-base@0.71.0_commander@15.0.0_esbuild@0.28.2_type_e3a3074c051d1ca759b7e8b914e3af6d/node_modules/@wirecat/cli-core/dist/services/pictures.js
|
|
31431
31481
|
var PICTURE_MAX_BYTES = 25 * 1024 * 1024;
|
|
31432
31482
|
var PICTURE_FLOOR = 0.25;
|
|
31433
31483
|
var PAGE4 = 50;
|
|
@@ -31444,7 +31494,7 @@ var picturesService = /* @__PURE__ */ __name((deps) => {
|
|
|
31444
31494
|
const directory2 = imageModelsDirectory(deps.env);
|
|
31445
31495
|
if (!isImageModelInstalled(model2, directory2))
|
|
31446
31496
|
throw new CliError("not_found", missingModel(model2.id), { reason: "model.not-downloaded", model: model2.id });
|
|
31447
|
-
const { openPictureEmbedder } = await import("./embedder-
|
|
31497
|
+
const { openPictureEmbedder } = await import("./embedder-3G4BQQ6X.js");
|
|
31448
31498
|
return openPictureEmbedder(model2, directory2);
|
|
31449
31499
|
}, "open");
|
|
31450
31500
|
const embedder = /* @__PURE__ */ __name(() => {
|
|
@@ -31641,7 +31691,7 @@ var withPictures = /* @__PURE__ */ __name((messages, pictures) => ({
|
|
|
31641
31691
|
}, "search")
|
|
31642
31692
|
}), "withPictures");
|
|
31643
31693
|
|
|
31644
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
31694
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.537.0_@wirecat+cli-base@0.71.0_commander@15.0.0_esbuild@0.28.2_type_e3a3074c051d1ca759b7e8b914e3af6d/node_modules/@wirecat/cli-core/dist/services/messages-meaning.js
|
|
31645
31695
|
var meaningLane = /* @__PURE__ */ __name((deps) => async (question, accounts, shared, within) => {
|
|
31646
31696
|
const target2 = embeddingTarget(deps, DEFAULT_TEXT_MODEL);
|
|
31647
31697
|
const skipped = /* @__PURE__ */ __name((reason, step) => ({
|
|
@@ -31690,7 +31740,7 @@ var meaningLane = /* @__PURE__ */ __name((deps) => async (question, accounts, sh
|
|
|
31690
31740
|
}
|
|
31691
31741
|
}, "meaningLane");
|
|
31692
31742
|
|
|
31693
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
31743
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.537.0_@wirecat+cli-base@0.71.0_commander@15.0.0_esbuild@0.28.2_type_e3a3074c051d1ca759b7e8b914e3af6d/node_modules/@wirecat/cli-core/dist/services/messages-rerank.js
|
|
31694
31744
|
var rerankLane = /* @__PURE__ */ __name((deps) => {
|
|
31695
31745
|
const choice = deps.reranker ?? DEFAULT_RERANK_MODEL;
|
|
31696
31746
|
if (choice === "off")
|
|
@@ -31702,9 +31752,9 @@ var rerankLane = /* @__PURE__ */ __name((deps) => {
|
|
|
31702
31752
|
return { skipped: { reason: `${model.id} is not downloaded`, step: "models.download", model: model.id } };
|
|
31703
31753
|
try {
|
|
31704
31754
|
const warm = deps.embedders;
|
|
31705
|
-
const reranker = warm ? await warm.reranker(`rerank:${model.id}`, async () => (await import("./process-
|
|
31755
|
+
const reranker = warm ? await warm.reranker(`rerank:${model.id}`, async () => (await import("./process-VVEQIHPE.js")).openRerankerProcess(model, directory2, {
|
|
31706
31756
|
threads: defaultThreads()
|
|
31707
|
-
})) : await (await import("./rerank-
|
|
31757
|
+
})) : await (await import("./rerank-GO24HJPF.js")).openReranker(model, directory2);
|
|
31708
31758
|
return {
|
|
31709
31759
|
model: model.id,
|
|
31710
31760
|
score: /* @__PURE__ */ __name((question, passages) => reranker.score(plainWords(question), passages), "score"),
|
|
@@ -31724,17 +31774,17 @@ var rerankLane = /* @__PURE__ */ __name((deps) => {
|
|
|
31724
31774
|
};
|
|
31725
31775
|
}, "rerankLane");
|
|
31726
31776
|
|
|
31727
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
31777
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.537.0_@wirecat+cli-base@0.71.0_commander@15.0.0_esbuild@0.28.2_type_e3a3074c051d1ca759b7e8b914e3af6d/node_modules/@wirecat/cli-core/dist/services/document-pictures.js
|
|
31728
31778
|
var openPictureEmbedderFor = /* @__PURE__ */ __name(async ({ env, command } = {}) => {
|
|
31729
31779
|
const model = imageModel(DEFAULT_IMAGE_MODEL);
|
|
31730
31780
|
const directory2 = imageModelsDirectory(env);
|
|
31731
31781
|
if (!isImageModelInstalled(model, directory2))
|
|
31732
31782
|
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 });
|
|
31733
|
-
const { openPictureEmbedder } = await import("./embedder-
|
|
31783
|
+
const { openPictureEmbedder } = await import("./embedder-3G4BQQ6X.js");
|
|
31734
31784
|
return openPictureEmbedder(model, directory2);
|
|
31735
31785
|
}, "openPictureEmbedderFor");
|
|
31736
31786
|
|
|
31737
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
31787
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.537.0_@wirecat+cli-base@0.71.0_commander@15.0.0_esbuild@0.28.2_type_e3a3074c051d1ca759b7e8b914e3af6d/node_modules/@wirecat/cli-core/dist/services/document-source.js
|
|
31738
31788
|
var documentSource = /* @__PURE__ */ __name((note, accounts, profiles, file) => {
|
|
31739
31789
|
const metadata = note.frontMatter;
|
|
31740
31790
|
const account = accounts.find(({ id: id2 }) => String(id2) === note.folderId);
|
|
@@ -31749,7 +31799,7 @@ var documentSource = /* @__PURE__ */ __name((note, accounts, profiles, file) =>
|
|
|
31749
31799
|
};
|
|
31750
31800
|
}, "documentSource");
|
|
31751
31801
|
|
|
31752
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
31802
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.537.0_@wirecat+cli-base@0.71.0_commander@15.0.0_esbuild@0.28.2_type_e3a3074c051d1ca759b7e8b914e3af6d/node_modules/@wirecat/cli-core/dist/services/notes-title-tier.js
|
|
31753
31803
|
var plainQueryWords = /* @__PURE__ */ __name((query) => {
|
|
31754
31804
|
let root;
|
|
31755
31805
|
try {
|
|
@@ -31776,7 +31826,7 @@ var titleTiers = /* @__PURE__ */ __name((hits, words2) => {
|
|
|
31776
31826
|
return [...hits].sort((a, b) => rank(a) - rank(b));
|
|
31777
31827
|
}, "titleTiers");
|
|
31778
31828
|
|
|
31779
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
31829
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.537.0_@wirecat+cli-base@0.71.0_commander@15.0.0_esbuild@0.28.2_type_e3a3074c051d1ca759b7e8b914e3af6d/node_modules/@wirecat/cli-core/dist/services/notes-search.js
|
|
31780
31830
|
var storeQuery = /* @__PURE__ */ __name(async (store, text2, { exact, timezone } = {}) => resolvedQuery(store, parsedQuery(text2, exact), timezone), "storeQuery");
|
|
31781
31831
|
var parsedQuery = /* @__PURE__ */ __name((text2, exact) => validateFields(parseLucene(text2, { ...SEARCH_QUERY, defaultField: exact ? "exact" : "text" })).root, "parsedQuery");
|
|
31782
31832
|
var resolvedQuery = /* @__PURE__ */ __name(async (store, root, timezone) => {
|
|
@@ -32186,7 +32236,7 @@ var searchNotesOf = /* @__PURE__ */ __name(async (store, account, text2, { accou
|
|
|
32186
32236
|
};
|
|
32187
32237
|
}, "searchNotesOf");
|
|
32188
32238
|
|
|
32189
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
32239
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.537.0_@wirecat+cli-base@0.71.0_commander@15.0.0_esbuild@0.28.2_type_e3a3074c051d1ca759b7e8b914e3af6d/node_modules/@wirecat/cli-core/dist/services/events-search.js
|
|
32190
32240
|
var MAX_EVENTS_OFFSET = 1e3;
|
|
32191
32241
|
var iso3 = /* @__PURE__ */ __name((at) => at === null ? null : new Date(at).toISOString(), "iso");
|
|
32192
32242
|
var accountIdsOf = /* @__PURE__ */ __name(async (store, accounts) => {
|
|
@@ -32298,7 +32348,7 @@ var searchEvents = /* @__PURE__ */ __name(async (store, query, { limit = 20, off
|
|
|
32298
32348
|
};
|
|
32299
32349
|
}, "searchEvents");
|
|
32300
32350
|
|
|
32301
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
32351
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.537.0_@wirecat+cli-base@0.71.0_commander@15.0.0_esbuild@0.28.2_type_e3a3074c051d1ca759b7e8b914e3af6d/node_modules/@wirecat/cli-core/dist/services/search-all.js
|
|
32302
32352
|
var RESOURCES_SEARCHED = ["messages", "mail", "notes", "events"];
|
|
32303
32353
|
var skippable = /* @__PURE__ */ __name((error) => error instanceof CliError && (error.code === "validation_error" || error.code === "not_found"), "skippable");
|
|
32304
32354
|
var filtersBeside = /* @__PURE__ */ __name((text2) => {
|
|
@@ -32367,6 +32417,7 @@ var searchAll = /* @__PURE__ */ __name(async (store, account, request, messenger
|
|
|
32367
32417
|
from: hit.email?.from ? { name: hit.email.from.name ?? hit.email.from.address, ref: hit.email.from.ref } : { name: hit.senderName, ref: null },
|
|
32368
32418
|
senderIsMe: senderIsMe(hit, at.account),
|
|
32369
32419
|
...hit.email ? { email: hit.email } : {},
|
|
32420
|
+
attachments: hitFiles(hit.attachments),
|
|
32370
32421
|
foundBy
|
|
32371
32422
|
};
|
|
32372
32423
|
}, "itemOf");
|
|
@@ -32506,7 +32557,7 @@ var searchAll = /* @__PURE__ */ __name(async (store, account, request, messenger
|
|
|
32506
32557
|
};
|
|
32507
32558
|
}, "searchAll");
|
|
32508
32559
|
|
|
32509
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
32560
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.537.0_@wirecat+cli-base@0.71.0_commander@15.0.0_esbuild@0.28.2_type_e3a3074c051d1ca759b7e8b914e3af6d/node_modules/@wirecat/cli-core/dist/services/search-all-meetings.js
|
|
32510
32561
|
var RESOURCES_SEARCHED_WITH_MEETINGS = [...RESOURCES_SEARCHED, "meetings"];
|
|
32511
32562
|
var whole2 = /* @__PURE__ */ __name((value, minimum, maximum, label) => {
|
|
32512
32563
|
if (!Number.isSafeInteger(value) || value < minimum || value > maximum)
|
|
@@ -32599,7 +32650,8 @@ var collectMeetings = /* @__PURE__ */ __name(async (store, account, request, que
|
|
|
32599
32650
|
meetingId: hit.meetingId,
|
|
32600
32651
|
scope: hit.scope,
|
|
32601
32652
|
id: hit.id,
|
|
32602
|
-
startMs: hit.startMs
|
|
32653
|
+
startMs: hit.startMs,
|
|
32654
|
+
...hit.scope === "transcript" && hit.ref !== void 0 ? { cueRef: hit.ref, speakerName: hit.speakerName ?? null } : {}
|
|
32603
32655
|
}
|
|
32604
32656
|
});
|
|
32605
32657
|
if (collected.items.length > request.limit) {
|
|
@@ -32753,7 +32805,7 @@ var searchAllOfSource = /* @__PURE__ */ __name(async (store, account, source, re
|
|
|
32753
32805
|
return { ...found, skipped: [...skipped, ...empty2, ...unnamed, ...found.skipped] };
|
|
32754
32806
|
}, "searchAllOfSource");
|
|
32755
32807
|
|
|
32756
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
32808
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.537.0_@wirecat+cli-base@0.71.0_commander@15.0.0_esbuild@0.28.2_type_e3a3074c051d1ca759b7e8b914e3af6d/node_modules/@wirecat/cli-core/dist/services/server-search.js
|
|
32757
32809
|
var SERVER_SEARCH_KEY = "messages.server-search";
|
|
32758
32810
|
var SERVER_BOUNDS = { timeMs: 5e3, perCall: 100, maxCalls: 3 };
|
|
32759
32811
|
var DEFAULT_BACKEND = "both";
|
|
@@ -32942,8 +32994,12 @@ var searchServer = /* @__PURE__ */ __name(async (deps, request) => {
|
|
|
32942
32994
|
return { report, sources };
|
|
32943
32995
|
}, "searchServer");
|
|
32944
32996
|
|
|
32945
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
32997
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.537.0_@wirecat+cli-base@0.71.0_commander@15.0.0_esbuild@0.28.2_type_e3a3074c051d1ca759b7e8b914e3af6d/node_modules/@wirecat/cli-core/dist/services/messages.js
|
|
32946
32998
|
var DELETE_AT_ONCE = 10;
|
|
32999
|
+
var filesOf = /* @__PURE__ */ __name(({ attachments }) => {
|
|
33000
|
+
const files = fileLinks(attachments);
|
|
33001
|
+
return files.length > 0 ? { files } : {};
|
|
33002
|
+
}, "filesOf");
|
|
32947
33003
|
var messagesService = /* @__PURE__ */ __name((deps) => {
|
|
32948
33004
|
const { guard } = deps;
|
|
32949
33005
|
const inStore = /* @__PURE__ */ __name(async (read) => read(await deps.store(), await deps.account()), "inStore");
|
|
@@ -33093,13 +33149,15 @@ var messagesService = /* @__PURE__ */ __name((deps) => {
|
|
|
33093
33149
|
const store = await deps.store();
|
|
33094
33150
|
const chat2 = await readChatId(deps, target2.chat, store, account);
|
|
33095
33151
|
const found2 = await store.messages.around(account, chat2, target2.message, { before: 0, after: 0 });
|
|
33096
|
-
|
|
33152
|
+
const held2 = found2.find((item) => item.id === target2.message && item.chatId === chat2);
|
|
33153
|
+
if (!held2)
|
|
33097
33154
|
throw new CliError("not_found", "no such message in this account's stored chat");
|
|
33098
33155
|
return {
|
|
33099
33156
|
locator: formatLocator({ ...account, chat: chat2, message: target2.message }),
|
|
33100
33157
|
url: null,
|
|
33101
33158
|
access: "unavailable",
|
|
33102
|
-
reason: deps.offline ? "offline" : "unsupported_provider"
|
|
33159
|
+
reason: deps.offline ? "offline" : "unsupported_provider",
|
|
33160
|
+
...filesOf(held2)
|
|
33103
33161
|
};
|
|
33104
33162
|
}
|
|
33105
33163
|
const connection = await deps.connection();
|
|
@@ -33107,20 +33165,27 @@ var messagesService = /* @__PURE__ */ __name((deps) => {
|
|
|
33107
33165
|
throw new CliError("authentication_error", "the connected account differs from the recorded profile; refresh the session before linking");
|
|
33108
33166
|
const { id: chat } = await connection.resolve(target2.chat);
|
|
33109
33167
|
const locator = formatLocator({ ...account, chat, message: target2.message });
|
|
33110
|
-
if (connection.permalink)
|
|
33111
|
-
|
|
33168
|
+
if (connection.permalink) {
|
|
33169
|
+
const permalink = validatePermalink(await connection.permalink(chat, target2.message));
|
|
33170
|
+
const held2 = await deps.store().then((store) => store.messages.around(account, chat, target2.message, { before: 0, after: 0 })).then((found2) => found2.find((item) => item.id === target2.message && item.chatId === chat)).catch(() => void 0);
|
|
33171
|
+
return { locator, ...permalink, ...held2 ? filesOf(held2) : {} };
|
|
33172
|
+
}
|
|
33112
33173
|
const found = await capability(connection, "around", "read a message")(chat, target2.message, {
|
|
33113
33174
|
before: 0,
|
|
33114
33175
|
after: 0
|
|
33115
33176
|
});
|
|
33116
|
-
|
|
33177
|
+
const held = found.find((item) => item.id === target2.message && item.chatId === chat);
|
|
33178
|
+
if (!held)
|
|
33117
33179
|
throw new CliError("not_found", "no such message in this chat");
|
|
33118
|
-
return { locator, url: null, access: "unavailable", reason: "unsupported_provider" };
|
|
33180
|
+
return { locator, url: null, access: "unavailable", reason: "unsupported_provider", ...filesOf(held) };
|
|
33119
33181
|
}, "link"),
|
|
33120
|
-
download: /* @__PURE__ */ __name(async (
|
|
33182
|
+
download: /* @__PURE__ */ __name(async (reference, message) => {
|
|
33183
|
+
const target2 = messageLinkTarget(reference, message, deps.messenger.provider);
|
|
33184
|
+
if (target2.account !== void 0 && target2.account !== (await deps.account()).account)
|
|
33185
|
+
throw new CliError("validation_error", "that locator belongs to another account; select its profile first");
|
|
33121
33186
|
const connection = await deps.connection();
|
|
33122
33187
|
const download = capability(connection, "download", "download attachments");
|
|
33123
|
-
return download((await connection.resolve(chat)).id, message);
|
|
33188
|
+
return download((await connection.resolve(target2.chat)).id, target2.message);
|
|
33124
33189
|
}, "download"),
|
|
33125
33190
|
keepDownloaded: /* @__PURE__ */ __name((chat, message, files) => inStore(async (store, account) => {
|
|
33126
33191
|
const chatId = await storedChatId(deps.messenger, chat, store, account).catch(() => void 0) ?? (await (await deps.connection()).resolve(chat)).id;
|
|
@@ -33368,7 +33433,7 @@ var checkMediaOptions = /* @__PURE__ */ __name((messenger, asked, attachments) =
|
|
|
33368
33433
|
throw new CliError("validation_error", `${MEDIA_FLAGS[first2]} needs a --photo or --file`);
|
|
33369
33434
|
}, "checkMediaOptions");
|
|
33370
33435
|
|
|
33371
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
33436
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.537.0_@wirecat+cli-base@0.71.0_commander@15.0.0_esbuild@0.28.2_type_e3a3074c051d1ca759b7e8b914e3af6d/node_modules/@wirecat/cli-core/dist/domain/channel-tags.js
|
|
33372
33437
|
var CHANNEL_TAG_RULES_VERSION = "keywords-v1";
|
|
33373
33438
|
var RULES = {
|
|
33374
33439
|
ai: [/\b(ai|gpt|llm|machine learning|artificial intelligence)\b/iu, /нейросет|искусственн/iu],
|
|
@@ -33383,7 +33448,7 @@ var classifyChannel = /* @__PURE__ */ __name((metadata) => Object.entries(RULES)
|
|
|
33383
33448
|
return fields.length ? [{ tag, score: fields.length / 3, fields }] : [];
|
|
33384
33449
|
}), "classifyChannel");
|
|
33385
33450
|
|
|
33386
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
33451
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.537.0_@wirecat+cli-base@0.71.0_commander@15.0.0_esbuild@0.28.2_type_e3a3074c051d1ca759b7e8b914e3af6d/node_modules/@wirecat/cli-core/dist/services/metadata.js
|
|
33387
33452
|
var metadataService = /* @__PURE__ */ __name((deps) => {
|
|
33388
33453
|
const held = /* @__PURE__ */ __name(async (reference, { includeLeft = false } = {}) => {
|
|
33389
33454
|
const store = await deps.store();
|
|
@@ -33469,7 +33534,7 @@ var metadataService = /* @__PURE__ */ __name((deps) => {
|
|
|
33469
33534
|
};
|
|
33470
33535
|
}, "metadataService");
|
|
33471
33536
|
|
|
33472
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
33537
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.537.0_@wirecat+cli-base@0.71.0_commander@15.0.0_esbuild@0.28.2_type_e3a3074c051d1ca759b7e8b914e3af6d/node_modules/@wirecat/cli-core/dist/moderation/run.js
|
|
33473
33538
|
var FIRST_LOOK_MS = 24 * 36e5;
|
|
33474
33539
|
var moderateWith = /* @__PURE__ */ __name(async (run) => {
|
|
33475
33540
|
const { chatId, title, rules, point, since, dryRun } = run;
|
|
@@ -33506,7 +33571,7 @@ var moderateWith = /* @__PURE__ */ __name(async (run) => {
|
|
|
33506
33571
|
return { chatId, rows, notes };
|
|
33507
33572
|
}, "moderateWith");
|
|
33508
33573
|
|
|
33509
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
33574
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.537.0_@wirecat+cli-base@0.71.0_commander@15.0.0_esbuild@0.28.2_type_e3a3074c051d1ca759b7e8b914e3af6d/node_modules/@wirecat/cli-core/dist/services/moderation.js
|
|
33510
33575
|
var moderationService = /* @__PURE__ */ __name((deps) => {
|
|
33511
33576
|
const file = /* @__PURE__ */ __name(() => new ModerationRules(moderationPathFor(deps.messenger.app, deps.profile ?? "default", deps.env ?? process.env)), "file");
|
|
33512
33577
|
const group = /* @__PURE__ */ __name(async (chat) => {
|
|
@@ -33584,7 +33649,7 @@ var moderatorOf = /* @__PURE__ */ __name((adapter, deps) => ({
|
|
|
33584
33649
|
}, "removePerson")
|
|
33585
33650
|
}), "moderatorOf");
|
|
33586
33651
|
|
|
33587
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
33652
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.537.0_@wirecat+cli-base@0.71.0_commander@15.0.0_esbuild@0.28.2_type_e3a3074c051d1ca759b7e8b914e3af6d/node_modules/@wirecat/cli-core/dist/services/private-people.js
|
|
33588
33653
|
var noteItem = /* @__PURE__ */ __name((provider, note) => ({
|
|
33589
33654
|
id: note.id,
|
|
33590
33655
|
contact: formatReference({ type: "contact", provider, id: note.personId }),
|
|
@@ -33628,7 +33693,7 @@ var privatePeopleService = /* @__PURE__ */ __name((deps) => {
|
|
|
33628
33693
|
};
|
|
33629
33694
|
}, "privatePeopleService");
|
|
33630
33695
|
|
|
33631
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
33696
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.537.0_@wirecat+cli-base@0.71.0_commander@15.0.0_esbuild@0.28.2_type_e3a3074c051d1ca759b7e8b914e3af6d/node_modules/@wirecat/cli-core/dist/services/rankings.js
|
|
33632
33697
|
var empty = /* @__PURE__ */ __name(() => ({
|
|
33633
33698
|
total: 0,
|
|
33634
33699
|
population: 0,
|
|
@@ -33884,7 +33949,7 @@ var rankingsService = /* @__PURE__ */ __name((deps) => ({
|
|
|
33884
33949
|
}, "evidence")
|
|
33885
33950
|
}), "rankingsService");
|
|
33886
33951
|
|
|
33887
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
33952
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.537.0_@wirecat+cli-base@0.71.0_commander@15.0.0_esbuild@0.28.2_type_e3a3074c051d1ca759b7e8b914e3af6d/node_modules/@wirecat/cli-core/dist/services/searches.js
|
|
33888
33953
|
var savedSearchItem = /* @__PURE__ */ __name((one) => ({
|
|
33889
33954
|
id: one.id,
|
|
33890
33955
|
name: one.name,
|
|
@@ -34013,7 +34078,7 @@ var searchesService = /* @__PURE__ */ __name((deps) => {
|
|
|
34013
34078
|
};
|
|
34014
34079
|
}, "searchesService");
|
|
34015
34080
|
|
|
34016
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34081
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.537.0_@wirecat+cli-base@0.71.0_commander@15.0.0_esbuild@0.28.2_type_e3a3074c051d1ca759b7e8b914e3af6d/node_modules/@wirecat/cli-core/dist/services/tags.js
|
|
34017
34082
|
var TAGGING_QUERY = {
|
|
34018
34083
|
entity: "tagging",
|
|
34019
34084
|
backend: "sql",
|
|
@@ -34097,10 +34162,10 @@ var tagsService = /* @__PURE__ */ __name((deps) => {
|
|
|
34097
34162
|
};
|
|
34098
34163
|
}, "tagsService");
|
|
34099
34164
|
|
|
34100
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34101
|
-
var actionOf = /* @__PURE__ */ __name(({ title, closed, pinned, hidden }) => {
|
|
34165
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.537.0_@wirecat+cli-base@0.71.0_commander@15.0.0_esbuild@0.28.2_type_e3a3074c051d1ca759b7e8b914e3af6d/node_modules/@wirecat/cli-core/dist/services/topics.js
|
|
34166
|
+
var actionOf = /* @__PURE__ */ __name(({ title, closed, pinned, hidden, icon }) => {
|
|
34102
34167
|
const set = [closed, pinned, hidden].filter((one) => one !== void 0).length;
|
|
34103
|
-
if (title !== void 0 || set !== 1)
|
|
34168
|
+
if (title !== void 0 || icon !== void 0 || set !== 1)
|
|
34104
34169
|
return "topic-edit";
|
|
34105
34170
|
if (closed !== void 0)
|
|
34106
34171
|
return closed ? "topic-close" : "topic-reopen";
|
|
@@ -34112,6 +34177,12 @@ var validTitle = /* @__PURE__ */ __name((title) => {
|
|
|
34112
34177
|
if (title.trim() === "" || new TextEncoder().encode(title).byteLength > 128)
|
|
34113
34178
|
throw new CliError("validation_error", "a topic title needs 1\u2013128 UTF-8 bytes");
|
|
34114
34179
|
}, "validTitle");
|
|
34180
|
+
var validIcon = /* @__PURE__ */ __name((icon) => {
|
|
34181
|
+
const emoji = icon.trim();
|
|
34182
|
+
if (emoji === "")
|
|
34183
|
+
throw new CliError("validation_error", "which icon? give an emoji from `topics icons list`");
|
|
34184
|
+
return emoji;
|
|
34185
|
+
}, "validIcon");
|
|
34115
34186
|
var topicsService = /* @__PURE__ */ __name((deps) => {
|
|
34116
34187
|
const online = /* @__PURE__ */ __name(async () => {
|
|
34117
34188
|
if (deps.offline)
|
|
@@ -34127,6 +34198,11 @@ var topicsService = /* @__PURE__ */ __name((deps) => {
|
|
|
34127
34198
|
throw new CliError("validation_error", "which topic? give its id, from `topics list`");
|
|
34128
34199
|
return capability(await deps.connection(), "topic", "show a forum topic")(chat, id2);
|
|
34129
34200
|
}, "show"),
|
|
34201
|
+
icons: /* @__PURE__ */ __name(async () => {
|
|
34202
|
+
if (deps.offline)
|
|
34203
|
+
throw new CliError("validation_error", "`topics icons list` asks the messenger; not with --offline");
|
|
34204
|
+
return capability(await deps.connection(), "topicIcons", "list topic icons")();
|
|
34205
|
+
}, "icons"),
|
|
34130
34206
|
enable: /* @__PURE__ */ __name(async (chat, { upgrade }) => {
|
|
34131
34207
|
const connection = await online();
|
|
34132
34208
|
const probe = capability(connection, "forumState", "configure forum topics");
|
|
@@ -34203,8 +34279,9 @@ var topicsService = /* @__PURE__ */ __name((deps) => {
|
|
|
34203
34279
|
forum: true
|
|
34204
34280
|
};
|
|
34205
34281
|
}, "enable"),
|
|
34206
|
-
create: /* @__PURE__ */ __name(async (chat, title, { sendId }) => {
|
|
34282
|
+
create: /* @__PURE__ */ __name(async (chat, title, { sendId, icon: typedIcon }) => {
|
|
34207
34283
|
validTitle(title);
|
|
34284
|
+
const icon = typedIcon === void 0 ? void 0 : validIcon(typedIcon);
|
|
34208
34285
|
const connection = await online();
|
|
34209
34286
|
const create = capability(connection, "createTopic", "create forum topics");
|
|
34210
34287
|
const probe = capability(connection, "forumState", "read forum settings");
|
|
@@ -34219,7 +34296,7 @@ var topicsService = /* @__PURE__ */ __name((deps) => {
|
|
|
34219
34296
|
action: "topic-create",
|
|
34220
34297
|
key: "topics.create",
|
|
34221
34298
|
length: title.length
|
|
34222
|
-
}, () => create(target2, title, { sendId: id2 }), (done2) => ({ threadId: done2.id, resultChatId: target2 }), async () => {
|
|
34299
|
+
}, () => create(target2, title, { sendId: id2, ...icon === void 0 ? {} : { icon } }), (done2) => ({ threadId: done2.id, resultChatId: target2 }), async () => {
|
|
34223
34300
|
const state = await probe(chatId);
|
|
34224
34301
|
if (!state.forum)
|
|
34225
34302
|
throw new CliError("validation_error", "enable topics first with `topics enable`; creating a topic never upgrades a group");
|
|
@@ -34233,8 +34310,9 @@ var topicsService = /* @__PURE__ */ __name((deps) => {
|
|
|
34233
34310
|
}, "create"),
|
|
34234
34311
|
edit: /* @__PURE__ */ __name(async (chat, typedTopic, change) => {
|
|
34235
34312
|
const { title, closed, pinned, hidden } = change;
|
|
34236
|
-
|
|
34237
|
-
|
|
34313
|
+
const icon = change.icon == null ? change.icon : validIcon(change.icon);
|
|
34314
|
+
if ([title, closed, pinned, hidden, icon].every((one) => one === void 0))
|
|
34315
|
+
throw new CliError("validation_error", "nothing to change \u2014 rename, close, reopen, pin, unpin, hide or give an icon");
|
|
34238
34316
|
if (title !== void 0)
|
|
34239
34317
|
validTitle(title);
|
|
34240
34318
|
const topicId = typedTopic.trim();
|
|
@@ -34249,7 +34327,8 @@ var topicsService = /* @__PURE__ */ __name((deps) => {
|
|
|
34249
34327
|
...title === void 0 ? {} : { title },
|
|
34250
34328
|
...closed === void 0 ? {} : { closed },
|
|
34251
34329
|
...pinned === void 0 ? {} : { pinned },
|
|
34252
|
-
...hidden === void 0 ? {} : { hidden }
|
|
34330
|
+
...hidden === void 0 ? {} : { hidden },
|
|
34331
|
+
...icon === void 0 ? {} : { icon }
|
|
34253
34332
|
}));
|
|
34254
34333
|
return { operationId, chatId, topic };
|
|
34255
34334
|
}, "edit"),
|
|
@@ -34282,7 +34361,7 @@ var topicsService = /* @__PURE__ */ __name((deps) => {
|
|
|
34282
34361
|
};
|
|
34283
34362
|
}, "topicsService");
|
|
34284
34363
|
|
|
34285
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34364
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.537.0_@wirecat+cli-base@0.71.0_commander@15.0.0_esbuild@0.28.2_type_e3a3074c051d1ca759b7e8b914e3af6d/node_modules/@wirecat/cli-core/dist/services/evidence.js
|
|
34286
34365
|
import { createHash as createHash11, randomUUID as randomUUID5 } from "node:crypto";
|
|
34287
34366
|
var hash2 = /* @__PURE__ */ __name((value) => createHash11("sha256").update(JSON.stringify(value)).digest("hex"), "hash");
|
|
34288
34367
|
var positive = /* @__PURE__ */ __name((value, name, minimum = 1) => {
|
|
@@ -34356,7 +34435,7 @@ var prepareEvidencePacket = /* @__PURE__ */ __name(({ kind, source, page, limits
|
|
|
34356
34435
|
return { ...content, id: randomUUID5(), fingerprint: hash2(content) };
|
|
34357
34436
|
}, "prepareEvidencePacket");
|
|
34358
34437
|
|
|
34359
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34438
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.537.0_@wirecat+cli-base@0.71.0_commander@15.0.0_esbuild@0.28.2_type_e3a3074c051d1ca759b7e8b914e3af6d/node_modules/@wirecat/cli-core/dist/services/evidence-read.js
|
|
34360
34439
|
var readEvidencePacket = /* @__PURE__ */ __name(async (store, account, { chat, limit, before: before2 }, messenger = {}) => {
|
|
34361
34440
|
if (!Number.isSafeInteger(limit) || limit < 1 || limit > 100)
|
|
34362
34441
|
throw new CliError("validation_error", "evidence message limit must be an integer from 1 to 100");
|
|
@@ -34376,7 +34455,7 @@ var readEvidencePacket = /* @__PURE__ */ __name(async (store, account, { chat, l
|
|
|
34376
34455
|
return { ...packet, nextBeforeId: older && last ? last.id : null };
|
|
34377
34456
|
}, "readEvidencePacket");
|
|
34378
34457
|
|
|
34379
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34458
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.537.0_@wirecat+cli-base@0.71.0_commander@15.0.0_esbuild@0.28.2_type_e3a3074c051d1ca759b7e8b914e3af6d/node_modules/@wirecat/cli-core/dist/services/meeting-project-discovery.js
|
|
34380
34459
|
var scopeKeys = [
|
|
34381
34460
|
"accountId",
|
|
34382
34461
|
"meetingId",
|
|
@@ -34398,7 +34477,7 @@ var optionKeys = /* @__PURE__ */ new Set([
|
|
|
34398
34477
|
"maxVocabularyReadBytes"
|
|
34399
34478
|
]);
|
|
34400
34479
|
|
|
34401
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34480
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.537.0_@wirecat+cli-base@0.71.0_commander@15.0.0_esbuild@0.28.2_type_e3a3074c051d1ca759b7e8b914e3af6d/node_modules/@wirecat/cli-core/dist/context/communication-selection.js
|
|
34402
34481
|
var communicationFields = {
|
|
34403
34482
|
sources: pipe(array(strictObject({
|
|
34404
34483
|
id: pipe(string(), regex(/^[A-Za-z0-9][A-Za-z0-9._-]{0,127}$/)),
|
|
@@ -34430,7 +34509,7 @@ var communicationRequest = /* @__PURE__ */ __name((value, preparationAfter) => {
|
|
|
34430
34509
|
return { ...input, after, before: before2 };
|
|
34431
34510
|
}, "communicationRequest");
|
|
34432
34511
|
|
|
34433
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34512
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.537.0_@wirecat+cli-base@0.71.0_commander@15.0.0_esbuild@0.28.2_type_e3a3074c051d1ca759b7e8b914e3af6d/node_modules/@wirecat/cli-core/dist/services/meeting-preparation-validation.js
|
|
34434
34513
|
var MEETING_PREPARATION_LIMITS = {
|
|
34435
34514
|
meetings: { min: 1, max: 20, default: 5 },
|
|
34436
34515
|
cues: { min: 1, max: 100, default: 10 },
|
|
@@ -34503,7 +34582,7 @@ var validateMeetingPreparationRequest = /* @__PURE__ */ __name((externalId, orig
|
|
|
34503
34582
|
};
|
|
34504
34583
|
}, "validateMeetingPreparationRequest");
|
|
34505
34584
|
|
|
34506
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34585
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.537.0_@wirecat+cli-base@0.71.0_commander@15.0.0_esbuild@0.28.2_type_e3a3074c051d1ca759b7e8b914e3af6d/node_modules/@wirecat/cli-core/dist/services/meeting-communications-selection.js
|
|
34507
34586
|
var validatePreparationCommunications = /* @__PURE__ */ __name((section, request, after) => {
|
|
34508
34587
|
const fail2 = /* @__PURE__ */ __name(() => {
|
|
34509
34588
|
throw new CliError("invalid_response", "Preparation communications returned another selection or invalid evidence");
|
|
@@ -34551,7 +34630,7 @@ var validatePreparationCommunications = /* @__PURE__ */ __name((section, request
|
|
|
34551
34630
|
}
|
|
34552
34631
|
}, "validatePreparationCommunications");
|
|
34553
34632
|
|
|
34554
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34633
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.537.0_@wirecat+cli-base@0.71.0_commander@15.0.0_esbuild@0.28.2_type_e3a3074c051d1ca759b7e8b914e3af6d/node_modules/@wirecat/cli-core/dist/services/package-upgrade.js
|
|
34555
34634
|
var upgradePackage = /* @__PURE__ */ __name(async ({ current, command, packageName, check: check2 }, ports) => {
|
|
34556
34635
|
const installer = ports.installer();
|
|
34557
34636
|
const argv = updateCommand(installer, packageName);
|
|
@@ -34616,7 +34695,7 @@ var dayAfter = /* @__PURE__ */ __name((published) => {
|
|
|
34616
34695
|
return Number.isNaN(time) ? null : new Date(time + 24 * 60 * 60 * 1e3).toISOString();
|
|
34617
34696
|
}, "dayAfter");
|
|
34618
34697
|
|
|
34619
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34698
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.537.0_@wirecat+cli-base@0.71.0_commander@15.0.0_esbuild@0.28.2_type_e3a3074c051d1ca759b7e8b914e3af6d/node_modules/@wirecat/cli-core/dist/services/index.js
|
|
34620
34699
|
var servicesFor = /* @__PURE__ */ __name((deps) => {
|
|
34621
34700
|
const pictures = picturesService(deps);
|
|
34622
34701
|
const base = {
|
|
@@ -34652,9 +34731,9 @@ var servicesFor = /* @__PURE__ */ __name((deps) => {
|
|
|
34652
34731
|
return deps.messenger.services ? { ...base, ...deps.messenger.services(base, deps) } : base;
|
|
34653
34732
|
}, "servicesFor");
|
|
34654
34733
|
|
|
34655
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34734
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.537.0_@wirecat+cli-base@0.71.0_commander@15.0.0_esbuild@0.28.2_type_e3a3074c051d1ca759b7e8b914e3af6d/node_modules/@wirecat/cli-core/dist/background/relay.js
|
|
34656
34735
|
import { createHash as createHash12 } from "node:crypto";
|
|
34657
|
-
import { chmodSync, lstatSync, mkdirSync as
|
|
34736
|
+
import { chmodSync, lstatSync, mkdirSync as mkdirSync3, rmSync } from "node:fs";
|
|
34658
34737
|
import { createConnection, createServer } from "node:net";
|
|
34659
34738
|
import { tmpdir } from "node:os";
|
|
34660
34739
|
import { dirname as dirname5, isAbsolute as isAbsolute3, join as join11 } from "node:path";
|
|
@@ -34682,7 +34761,7 @@ var relayPath = /* @__PURE__ */ __name((lockPath) => {
|
|
|
34682
34761
|
return join11("/tmp", name);
|
|
34683
34762
|
}, "relayPath");
|
|
34684
34763
|
var privateDirectory = /* @__PURE__ */ __name((dir) => {
|
|
34685
|
-
|
|
34764
|
+
mkdirSync3(dir, { recursive: true, mode: 448 });
|
|
34686
34765
|
const stat4 = lstatSync(dir);
|
|
34687
34766
|
const mine = process.getuid === void 0 || stat4.uid === process.getuid();
|
|
34688
34767
|
if (!stat4.isDirectory() || !mine || (stat4.mode & 63) !== 0) {
|
|
@@ -34873,7 +34952,7 @@ var relayCommand = /* @__PURE__ */ __name((path, request, options) => new Promis
|
|
|
34873
34952
|
}, () => finish({ error: stopped() }));
|
|
34874
34953
|
}), "relayCommand");
|
|
34875
34954
|
|
|
34876
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34955
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.537.0_@wirecat+cli-base@0.71.0_commander@15.0.0_esbuild@0.28.2_type_e3a3074c051d1ca759b7e8b914e3af6d/node_modules/@wirecat/cli-core/dist/cli/messenger/serve-relay.js
|
|
34877
34956
|
var lentConnection = /* @__PURE__ */ __name((connection, watchers) => throughWrapper(connection, {
|
|
34878
34957
|
close: /* @__PURE__ */ __name(async () => {
|
|
34879
34958
|
}, "close"),
|
|
@@ -35028,12 +35107,16 @@ export {
|
|
|
35028
35107
|
engineHint,
|
|
35029
35108
|
engineStates,
|
|
35030
35109
|
imageSize,
|
|
35110
|
+
refreshedFiles,
|
|
35111
|
+
downloadMessage,
|
|
35112
|
+
saveFiles,
|
|
35031
35113
|
ATTACHMENT_QUERY,
|
|
35032
35114
|
isRetentionSelection,
|
|
35033
35115
|
REVIEW_DAYS,
|
|
35034
35116
|
UNANSWERED_HOURS,
|
|
35035
35117
|
reviewStart,
|
|
35036
35118
|
kindsOf,
|
|
35119
|
+
messageLinkTarget,
|
|
35037
35120
|
pinLengthHelp,
|
|
35038
35121
|
pinDurationOf,
|
|
35039
35122
|
sendAsCheck,
|
|
@@ -35046,10 +35129,11 @@ export {
|
|
|
35046
35129
|
ADMIN_RIGHTS,
|
|
35047
35130
|
senderIsMe,
|
|
35048
35131
|
MEDIA_KINDS,
|
|
35049
|
-
refreshedFiles,
|
|
35050
|
-
downloadMessage,
|
|
35051
|
-
saveFiles,
|
|
35052
35132
|
searchNotesOf,
|
|
35133
|
+
SERVER_SEARCH_KEY,
|
|
35134
|
+
SERVER_BOUNDS,
|
|
35135
|
+
DEFAULT_BACKEND,
|
|
35136
|
+
sourceKey,
|
|
35053
35137
|
DELETE_AT_ONCE,
|
|
35054
35138
|
moderateWith,
|
|
35055
35139
|
CONTEXT_MESSAGES,
|