@wirecat/mail-cli 0.36.0 → 0.38.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 +55 -0
- package/contracts/wirecat.json +1 -0
- package/dist/bin/mail.js +2 -2
- package/dist/bundle/agent-U43CYLAP.js +41 -0
- package/dist/bundle/{all-profiles-RS6OV3YO.js → all-profiles-OCUZMXMI.js} +11 -11
- package/dist/bundle/{anthropic-PPQ7DTXN.js → anthropic-CABWJABQ.js} +5 -5
- package/dist/bundle/{app-server-EBFBMFQC.js → app-server-TTWPIGWG.js} +70 -67
- package/dist/bundle/{bun-J7HAT7MW.js → bun-F4M4KCNA.js} +2 -2
- package/dist/bundle/{bun-sqlite-PCSNAXIQ.js → bun-sqlite-YKYG25CR.js} +6 -6
- package/dist/bundle/{chunk-6FZPFNEU.js → chunk-24UGTK32.js} +9 -9
- package/dist/bundle/{chunk-RJUVWJTA.js → chunk-2HDXD6LM.js} +7 -7
- package/dist/bundle/{chunk-VIDPFLFM.js → chunk-2SQLHBDP.js} +2 -2
- package/dist/bundle/{chunk-WZFGZBGD.js → chunk-2YO3PLOE.js} +19 -19
- package/dist/bundle/{chunk-3ZKNXKM7.js → chunk-3TYER5IK.js} +14 -6
- package/dist/bundle/{chunk-AVR4FPYG.js → chunk-4FXDUXZP.js} +8 -8
- package/dist/bundle/{chunk-MQ6DQRRI.js → chunk-5ICUC66S.js} +4 -4
- package/dist/bundle/{chunk-WNQECDIP.js → chunk-725OPCHI.js} +61 -61
- package/dist/bundle/{chunk-Q6TPXXOS.js → chunk-77YTUOKN.js} +35 -176
- package/dist/bundle/chunk-7ECP5ZQR.js +2 -0
- package/dist/bundle/{chunk-5G4MDFZ2.js → chunk-7EJWHADX.js} +14 -10
- package/dist/bundle/{chunk-GEU3WR75.js → chunk-7KO5FSAW.js} +3 -3
- package/dist/bundle/{chunk-NSH2UHJR.js → chunk-A3KNH3Q4.js} +8 -8
- package/dist/bundle/{chunk-SCJVKWMV.js → chunk-AGO3OVKW.js} +2145 -902
- package/dist/bundle/{chunk-TV634B6T.js → chunk-AQ5RIOUE.js} +1 -1
- package/dist/bundle/{chunk-ROK7Z5LQ.js → chunk-BA5B5ZF4.js} +274 -182
- package/dist/bundle/{chunk-ZV57PIPE.js → chunk-C4PUDTGD.js} +2 -2
- package/dist/bundle/{chunk-IBOWSQ7X.js → chunk-C7JPYWYQ.js} +1 -1
- package/dist/bundle/{chunk-BBQERXQX.js → chunk-CJJFOT7W.js} +3 -3
- package/dist/bundle/{chunk-645FQC4G.js → chunk-CLTFTGBP.js} +18 -17
- package/dist/bundle/{chunk-XRVZMM5B.js → chunk-DKGKPJA3.js} +164 -36
- package/dist/bundle/{chunk-HPSESLOZ.js → chunk-DNCLQPOM.js} +1 -1
- package/dist/bundle/{chunk-EGR3YUWD.js → chunk-DPV53EZC.js} +4 -4
- package/dist/bundle/{chunk-GI6DNX7Q.js → chunk-DYCE72XB.js} +36 -36
- package/dist/bundle/{chunk-42XY6D5C.js → chunk-EDWY73H7.js} +5 -5
- package/dist/bundle/{chunk-L4QLZDBZ.js → chunk-EJQAP6A6.js} +6 -6
- package/dist/bundle/{chunk-REWV37HQ.js → chunk-ESNZL7SB.js} +6 -6
- package/dist/bundle/{chunk-DVJPEZGV.js → chunk-FFER7KJI.js} +13 -13
- package/dist/bundle/{chunk-NJZR3OFK.js → chunk-FTH6WGYO.js} +1 -1
- package/dist/bundle/{chunk-SJNFPBPF.js → chunk-FWGNDKJK.js} +2 -2
- package/dist/bundle/{chunk-5VPLQS4S.js → chunk-G46PNDWL.js} +2 -2
- package/dist/bundle/chunk-G5HG7ZWQ.js +1169 -0
- package/dist/bundle/{chunk-RMWS7IQ4.js → chunk-G6NY7LFB.js} +4 -4
- package/dist/bundle/{chunk-PPIMXOBT.js → chunk-GMWKNWWY.js} +6 -6
- package/dist/bundle/{chunk-774VG5WZ.js → chunk-GZ7WBU5Y.js} +1 -1
- package/dist/bundle/{chunk-LQQIYBHN.js → chunk-HFDDVGDH.js} +201 -113
- package/dist/bundle/{chunk-NYYMMIVW.js → chunk-HFRH5YJ6.js} +16 -3
- package/dist/bundle/{chunk-3BYKGMRM.js → chunk-HI6MTNID.js} +6 -6
- package/dist/bundle/{chunk-PF7ZNIVP.js → chunk-HIKPVWCL.js} +3 -3
- package/dist/bundle/{chunk-U3BO342P.js → chunk-HO4JGD4Q.js} +1 -1
- package/dist/bundle/chunk-HUAHLO6N.js +29 -0
- package/dist/bundle/{chunk-QI2XGTFH.js → chunk-HYUUAH2N.js} +8 -8
- package/dist/bundle/chunk-I4AWLFYH.js +377 -0
- package/dist/bundle/{chunk-MRWV5VNQ.js → chunk-I4PZOWYG.js} +6 -6
- package/dist/bundle/chunk-IDCZ4LWS.js +150 -0
- package/dist/bundle/{chunk-NTUP5RCP.js → chunk-ISQ23VKV.js} +8 -1
- package/dist/bundle/{chunk-2VEFNFYZ.js → chunk-KLRCTMES.js} +3 -3
- package/dist/bundle/{chunk-C3JSQ7UJ.js → chunk-KP5JDYY6.js} +27 -8
- package/dist/bundle/{chunk-CMOO4INK.js → chunk-KYRYD4CR.js} +1 -1
- package/dist/bundle/{chunk-KTVQIKU5.js → chunk-LB2CF3GG.js} +19 -15
- package/dist/bundle/{chunk-6PKMUKUF.js → chunk-LC7ZD2RW.js} +1 -1
- package/dist/bundle/{chunk-2UNZ3L2H.js → chunk-M65NILSA.js} +6 -6
- package/dist/bundle/{chunk-PMSZBUC7.js → chunk-NQFG7AES.js} +8 -8
- package/dist/bundle/chunk-OAO3JKQD.js +463 -0
- package/dist/bundle/{chunk-JCILSTFK.js → chunk-OEEWVKJX.js} +1 -1
- package/dist/bundle/{chunk-6VMJLOYO.js → chunk-OVHC7OV4.js} +12 -12
- package/dist/bundle/{chunk-OEL4DQTT.js → chunk-PT4VLN3K.js} +4 -4
- package/dist/bundle/chunk-QETNCUWB.js +1703 -0
- package/dist/bundle/{chunk-ZRSLG3B3.js → chunk-QK3Z7BCC.js} +6 -6
- package/dist/bundle/{chunk-CJHO6B3M.js → chunk-QWF3TFW4.js} +43 -29
- package/dist/bundle/{chunk-NYR7PIAG.js → chunk-RHEDE7D4.js} +3 -3
- package/dist/bundle/{chunk-KP7JHJVP.js → chunk-RI5YZ23Y.js} +27 -27
- package/dist/bundle/{chunk-2RV4V55B.js → chunk-ROUZN6UQ.js} +20 -85
- package/dist/bundle/{chunk-4WSTWZUB.js → chunk-RQD7CAGF.js} +2 -2
- package/dist/bundle/{chunk-PMGAU6AP.js → chunk-S6JG4YUH.js} +2 -2
- package/dist/bundle/{chunk-KLPFPNZP.js → chunk-SBLHQAH3.js} +11 -11
- package/dist/bundle/{chunk-6UYIWQLU.js → chunk-SXLIADMY.js} +4 -4
- package/dist/bundle/{chunk-5JEKBYIH.js → chunk-SYCM6SQ5.js} +14 -14
- package/dist/bundle/{chunk-3NOXZZJV.js → chunk-T3W4V4A6.js} +1 -1
- package/dist/bundle/{chunk-6NDPOY4N.js → chunk-TCT5D2X2.js} +1 -1
- package/dist/bundle/{chunk-YPB5BEAD.js → chunk-TES7MB6I.js} +2 -2
- package/dist/bundle/chunk-TQDSBLQB.js +2 -0
- package/dist/bundle/{chunk-VIJV474N.js → chunk-TXDR6YSF.js} +1 -1
- package/dist/bundle/{chunk-QDNYJOWJ.js → chunk-TY7NDMFY.js} +1 -1
- package/dist/bundle/{chunk-437UHSIO.js → chunk-UGFMQWAZ.js} +210 -62
- package/dist/bundle/{chunk-KVFBSOCV.js → chunk-VA6PHTMV.js} +9 -9
- package/dist/bundle/{chunk-WPPPO427.js → chunk-VK24UQSD.js} +4 -4
- package/dist/bundle/{chunk-MT3LYU4T.js → chunk-VUHH4MQW.js} +21768 -12322
- package/dist/bundle/{chunk-CJMZQ2MZ.js → chunk-W3BOR6AT.js} +8 -8
- package/dist/bundle/chunk-WA53OJ7V.js +160 -0
- package/dist/bundle/{chunk-HH34WRQE.js → chunk-XGVMQMTS.js} +7 -7
- package/dist/bundle/{chunk-GBZIWCEP.js → chunk-YP4FYLFI.js} +3 -3
- package/dist/bundle/{chunk-V5I7QP4T.js → chunk-ZDBWBCEO.js} +2 -2
- package/dist/bundle/{chunk-GCTHVCJU.js → chunk-ZKVUAH5N.js} +4 -4
- package/dist/bundle/command-contract-V2WIL6RL.js +40 -0
- package/dist/bundle/{command-server-entry-73RJELAV.js → command-server-entry-ZC5YF4EC.js} +29 -28
- package/dist/bundle/{decode-7BUWBDPT.js → decode-NXAGEUAD.js} +5 -5
- package/dist/bundle/{dispatch-IBOMVWZA.js → dispatch-USKS7J74.js} +8 -8
- package/dist/bundle/{dist-MULVCVSR.js → dist-XN2CRP3U.js} +49 -48
- package/dist/bundle/{echarts-VLWFC322.js → echarts-QMAA7HH5.js} +2 -2
- package/dist/bundle/{embed-W3VH4HPY.js → embed-3P3LSM2O.js} +6 -6
- package/dist/bundle/{embedder-I7ERQZJV.js → embedder-2SANUF2X.js} +9 -9
- package/dist/bundle/{failure-QMAPSQ7X.js → failure-D4FGOIWF.js} +2 -2
- package/dist/bundle/{first-run-LCVER6QN.js → first-run-HEZKQLJL.js} +12 -12
- package/dist/bundle/first-screen-7TQZ4I6X.js +41 -0
- package/dist/bundle/{instructions-BNCVLSYQ.js → instructions-4H7UREH2.js} +1 -1
- package/dist/bundle/mail.js +12 -12
- package/dist/bundle/{mcp-Z2KZNCXB.js → mcp-5HFPWC3W.js} +2 -2
- package/dist/bundle/meeting-combined-HF2NL4PU.js +26 -0
- package/dist/bundle/{meeting-model-BWLSTNXA.js → meeting-model-B7RVFB7L.js} +11 -11
- package/dist/bundle/{meeting-semantic-ZIEHXN2R.js → meeting-semantic-YQTL7YVQ.js} +6 -6
- package/dist/bundle/{node-RYFTRSG4.js → node-P3PUHKYH.js} +2 -2
- package/dist/bundle/{node-sqlite-XCHVNTGQ.js → node-sqlite-OFHTCHJH.js} +7 -7
- package/dist/bundle/{oauth-FNUJSKKJ.js → oauth-IVB5RP7T.js} +7 -7
- package/dist/bundle/{open-WVWSJ3WI.js → open-KDGDLCWV.js} +5 -5
- package/dist/bundle/{openai-QOUTYYTF.js → openai-NVUBKA7Z.js} +15 -15
- package/dist/bundle/{process-W5KPID53.js → process-AFIXYXWL.js} +1 -1
- package/dist/bundle/{program-L5UANM3I.js → program-JQ7EFODJ.js} +2825 -7739
- package/dist/bundle/{prompt-JSBAPNJE.js → prompt-QG7FC2SA.js} +5 -5
- package/dist/bundle/public-FBD7MQUM.js +204 -0
- package/dist/bundle/{recognize-FDX4SJ6Q.js → recognize-ZBR5KNID.js} +4 -4
- package/dist/bundle/{remote-MYOXOQHM.js → remote-QOTHNO2M.js} +9 -9
- package/dist/bundle/{rerank-NY5MSZCR.js → rerank-JD2NIUW6.js} +7 -7
- package/dist/bundle/{serve-URI6NZA3.js → serve-QZT3FKK7.js} +9 -9
- package/dist/bundle/{server-HQ25RHQM.js → server-M6JJ7IKS.js} +62 -59
- package/dist/bundle/server-TAMXMWK6.js +87 -0
- package/dist/bundle/{sqlite-runtime-6UUPSSKG.js → sqlite-runtime-N2PY7C7J.js} +6 -6
- package/dist/bundle/{state-NDDVFPCI.js → state-OGRUMU7P.js} +6 -6
- package/dist/bundle/{store-2RDOICVN.js → store-7UE63OQR.js} +61 -43
- package/dist/bundle/{store-PKYWPKKR.js → store-DGJKE4ZJ.js} +25 -23
- package/dist/bundle/store-maintenance-command-WIDKMZLK.js +74 -0
- package/dist/bundle/surface-LTEEEZU4.js +73 -0
- package/dist/commands/import.js +2 -2
- package/dist/commands/import.js.map +1 -1
- package/dist/commands/messages.js +3 -3
- package/dist/commands/messages.js.map +1 -1
- package/dist/commands/read.js +2 -2
- package/dist/commands/read.js.map +1 -1
- package/dist/commands/send.d.ts.map +1 -1
- package/dist/commands/send.js +1 -0
- package/dist/commands/send.js.map +1 -1
- package/dist/commands/session.d.ts.map +1 -1
- package/dist/commands/session.js +2 -2
- package/dist/commands/session.js.map +1 -1
- package/dist/commands/sync.d.ts.map +1 -1
- package/dist/commands/sync.js +28 -4
- package/dist/commands/sync.js.map +1 -1
- package/dist/commands/tags.d.ts.map +1 -1
- package/dist/commands/tags.js.map +1 -1
- package/dist/commands/words.js +1 -1
- package/dist/commands/words.js.map +1 -1
- package/dist/config.d.ts +2 -0
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +7 -0
- package/dist/config.js.map +1 -1
- package/dist/identity.d.ts.map +1 -1
- package/dist/identity.js +1 -0
- package/dist/identity.js.map +1 -1
- package/dist/mail/imap/account.d.ts.map +1 -1
- package/dist/mail/imap/account.js +2 -1
- package/dist/mail/imap/account.js.map +1 -1
- package/dist/mail/send-as.d.ts +21 -0
- package/dist/mail/send-as.d.ts.map +1 -0
- package/dist/mail/send-as.js +66 -0
- package/dist/mail/send-as.js.map +1 -0
- package/dist/mail/send.d.ts +2 -0
- package/dist/mail/send.d.ts.map +1 -1
- package/dist/mail/send.js +3 -1
- package/dist/mail/send.js.map +1 -1
- package/dist/profile.js +1 -1
- package/dist/profile.js.map +1 -1
- package/dist/program.d.ts.map +1 -1
- package/dist/program.js +4 -4
- package/dist/program.js.map +1 -1
- package/dist/reasons.d.ts.map +1 -1
- package/dist/reasons.js +0 -1
- package/dist/reasons.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +3 -3
- package/dist/bundle/agent-MW7YWUIY.js +0 -39
- package/dist/bundle/chunk-5TIWO6AR.js +0 -787
- package/dist/bundle/chunk-6LJIENVT.js +0 -29
- package/dist/bundle/chunk-6TT62IUW.js +0 -1264
- package/dist/bundle/chunk-NCY55XIT.js +0 -721
- package/dist/bundle/chunk-U67XMAEE.js +0 -72
- package/dist/bundle/command-contract-WFTIRPL5.js +0 -39
- package/dist/bundle/first-screen-DCTHI4NQ.js +0 -39
- package/dist/bundle/meeting-combined-ITU7SZ7E.js +0 -24
- package/dist/bundle/server-UVYFU2JN.js +0 -84
- package/dist/bundle/store-maintenance-command-Y5XTO47X.js +0 -71
- package/dist/bundle/surface-3XKM3MQ2.js +0 -70
|
@@ -2,49 +2,53 @@ import { createRequire as __bundleRequire } from "node:module";
|
|
|
2
2
|
const require = __bundleRequire(import.meta.url);
|
|
3
3
|
import {
|
|
4
4
|
renderMessages
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-FWGNDKJK.js";
|
|
6
6
|
import {
|
|
7
|
-
answerOf,
|
|
8
7
|
messengerContext
|
|
9
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-77YTUOKN.js";
|
|
10
9
|
import {
|
|
11
10
|
chatEventAnswer,
|
|
12
11
|
memberAnswer,
|
|
13
12
|
pollVoteAnswer
|
|
14
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-A3KNH3Q4.js";
|
|
15
14
|
import {
|
|
16
15
|
serveRelay
|
|
17
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-HI6MTNID.js";
|
|
18
17
|
import {
|
|
19
18
|
FETCHING,
|
|
20
19
|
RULES_VERSION,
|
|
20
|
+
answerOf,
|
|
21
21
|
applyTaskRulesOnArrival,
|
|
22
22
|
embeddingKeys,
|
|
23
23
|
endpointKeyName,
|
|
24
|
+
inside,
|
|
24
25
|
modelGateway,
|
|
25
26
|
newSendId,
|
|
26
27
|
onlineDeps,
|
|
27
28
|
openRequestTask,
|
|
28
29
|
patiently,
|
|
30
|
+
realPathOf,
|
|
29
31
|
refuseLockedOutput,
|
|
32
|
+
refusedPlace,
|
|
30
33
|
senderIsMe,
|
|
31
34
|
servicesFor,
|
|
32
35
|
syncsOneChat,
|
|
33
36
|
withTimeLimit
|
|
34
|
-
} from "./chunk-
|
|
37
|
+
} from "./chunk-AGO3OVKW.js";
|
|
35
38
|
import {
|
|
36
39
|
capability,
|
|
37
40
|
queryTerms,
|
|
38
41
|
typedQuery,
|
|
39
42
|
withQuery
|
|
40
|
-
} from "./chunk-
|
|
43
|
+
} from "./chunk-LB2CF3GG.js";
|
|
41
44
|
import {
|
|
42
45
|
holdLock,
|
|
43
46
|
lockPath,
|
|
47
|
+
markCurrent,
|
|
44
48
|
releaseLock,
|
|
45
49
|
servingProfiles,
|
|
46
50
|
takeLock
|
|
47
|
-
} from "./chunk-
|
|
51
|
+
} from "./chunk-HFRH5YJ6.js";
|
|
48
52
|
import {
|
|
49
53
|
Command,
|
|
50
54
|
LOCAL_READ,
|
|
@@ -71,16 +75,16 @@ import {
|
|
|
71
75
|
snakeKeys,
|
|
72
76
|
storeTable,
|
|
73
77
|
withoutProviderRefs
|
|
74
|
-
} from "./chunk-
|
|
78
|
+
} from "./chunk-BA5B5ZF4.js";
|
|
75
79
|
import {
|
|
76
80
|
levelFor
|
|
77
|
-
} from "./chunk-
|
|
81
|
+
} from "./chunk-2HDXD6LM.js";
|
|
78
82
|
import {
|
|
79
83
|
holdersOf
|
|
80
|
-
} from "./chunk-
|
|
84
|
+
} from "./chunk-T3W4V4A6.js";
|
|
81
85
|
import {
|
|
82
86
|
readSecret
|
|
83
|
-
} from "./chunk-
|
|
87
|
+
} from "./chunk-KLRCTMES.js";
|
|
84
88
|
import {
|
|
85
89
|
QUICK_HEALTH_CHECKS,
|
|
86
90
|
fts5Tables,
|
|
@@ -88,7 +92,7 @@ import {
|
|
|
88
92
|
lossUnknown,
|
|
89
93
|
storeDamageReport,
|
|
90
94
|
storeHealth
|
|
91
|
-
} from "./chunk-
|
|
95
|
+
} from "./chunk-RI5YZ23Y.js";
|
|
92
96
|
import {
|
|
93
97
|
CORPORA,
|
|
94
98
|
MIGRATIONS,
|
|
@@ -126,46 +130,46 @@ import {
|
|
|
126
130
|
storeClients,
|
|
127
131
|
storeContents,
|
|
128
132
|
vectorIndexCounts
|
|
129
|
-
} from "./chunk-
|
|
133
|
+
} from "./chunk-VUHH4MQW.js";
|
|
130
134
|
import {
|
|
131
135
|
currentRun,
|
|
132
136
|
readDamageMark,
|
|
133
137
|
readHealthMark,
|
|
134
138
|
readJournalMark,
|
|
135
139
|
recordDeepCheck
|
|
136
|
-
} from "./chunk-
|
|
137
|
-
import {
|
|
138
|
-
formatLocator,
|
|
139
|
-
parseLocator
|
|
140
|
-
} from "./chunk-5TIWO6AR.js";
|
|
140
|
+
} from "./chunk-G5HG7ZWQ.js";
|
|
141
141
|
import {
|
|
142
142
|
failureKey,
|
|
143
143
|
isStoreDamage
|
|
144
|
-
} from "./chunk-
|
|
144
|
+
} from "./chunk-3TYER5IK.js";
|
|
145
|
+
import {
|
|
146
|
+
formatLocator,
|
|
147
|
+
parseLocator
|
|
148
|
+
} from "./chunk-OAO3JKQD.js";
|
|
145
149
|
import {
|
|
146
150
|
queryFieldsOf
|
|
147
|
-
} from "./chunk-
|
|
151
|
+
} from "./chunk-725OPCHI.js";
|
|
148
152
|
import {
|
|
149
153
|
modelAddressAllowed,
|
|
150
154
|
onThisComputer
|
|
151
|
-
} from "./chunk-
|
|
155
|
+
} from "./chunk-ESNZL7SB.js";
|
|
152
156
|
import {
|
|
153
157
|
readSharedSection,
|
|
154
158
|
sharedConfigPath,
|
|
155
159
|
writeSharedSection
|
|
156
|
-
} from "./chunk-
|
|
160
|
+
} from "./chunk-XGVMQMTS.js";
|
|
157
161
|
import {
|
|
158
162
|
storePath
|
|
159
|
-
} from "./chunk-
|
|
163
|
+
} from "./chunk-2SQLHBDP.js";
|
|
160
164
|
import {
|
|
161
165
|
openCache
|
|
162
|
-
} from "./chunk-
|
|
166
|
+
} from "./chunk-QK3Z7BCC.js";
|
|
163
167
|
import {
|
|
164
168
|
Credentials,
|
|
165
169
|
isMovedRun,
|
|
166
170
|
resolvePaths,
|
|
167
171
|
writeSecurely
|
|
168
|
-
} from "./chunk-
|
|
172
|
+
} from "./chunk-2YO3PLOE.js";
|
|
169
173
|
import {
|
|
170
174
|
array,
|
|
171
175
|
boolean,
|
|
@@ -187,10 +191,10 @@ import {
|
|
|
187
191
|
string,
|
|
188
192
|
transform,
|
|
189
193
|
trim
|
|
190
|
-
} from "./chunk-
|
|
194
|
+
} from "./chunk-KP5JDYY6.js";
|
|
191
195
|
import {
|
|
192
196
|
CliError
|
|
193
|
-
} from "./chunk-
|
|
197
|
+
} from "./chunk-S6JG4YUH.js";
|
|
194
198
|
import {
|
|
195
199
|
__commonJS,
|
|
196
200
|
__name,
|
|
@@ -265,9 +269,9 @@ var require_liquid_node = __commonJS({
|
|
|
265
269
|
__name(isIterator, "isIterator");
|
|
266
270
|
function promisify(fn) {
|
|
267
271
|
return function(...args) {
|
|
268
|
-
return new Promise((
|
|
272
|
+
return new Promise((resolve4, reject2) => {
|
|
269
273
|
fn(...args, (err, result2) => {
|
|
270
|
-
err ? reject2(err) :
|
|
274
|
+
err ? reject2(err) : resolve4(result2);
|
|
271
275
|
});
|
|
272
276
|
});
|
|
273
277
|
};
|
|
@@ -1857,12 +1861,12 @@ var require_liquid_node = __commonJS({
|
|
|
1857
1861
|
return fs$1.readFileSync(filepath, "utf8");
|
|
1858
1862
|
}
|
|
1859
1863
|
__name(readFileSync6, "readFileSync");
|
|
1860
|
-
function
|
|
1864
|
+
function resolve3(root, file2, ext) {
|
|
1861
1865
|
if (!path.extname(file2))
|
|
1862
1866
|
file2 += ext;
|
|
1863
1867
|
return path.resolve(root, file2);
|
|
1864
1868
|
}
|
|
1865
|
-
__name(
|
|
1869
|
+
__name(resolve3, "resolve");
|
|
1866
1870
|
function fallback(file2) {
|
|
1867
1871
|
try {
|
|
1868
1872
|
return requireResolve(file2);
|
|
@@ -1870,10 +1874,10 @@ var require_liquid_node = __commonJS({
|
|
|
1870
1874
|
}
|
|
1871
1875
|
}
|
|
1872
1876
|
__name(fallback, "fallback");
|
|
1873
|
-
function
|
|
1877
|
+
function dirname5(filepath) {
|
|
1874
1878
|
return path.dirname(filepath);
|
|
1875
1879
|
}
|
|
1876
|
-
__name(
|
|
1880
|
+
__name(dirname5, "dirname");
|
|
1877
1881
|
var realpathAsync = promisify(fs$1.realpath);
|
|
1878
1882
|
async function contains(root, file2) {
|
|
1879
1883
|
try {
|
|
@@ -1903,9 +1907,9 @@ var require_liquid_node = __commonJS({
|
|
|
1903
1907
|
readFile,
|
|
1904
1908
|
existsSync: existsSync11,
|
|
1905
1909
|
readFileSync: readFileSync6,
|
|
1906
|
-
resolve:
|
|
1910
|
+
resolve: resolve3,
|
|
1907
1911
|
fallback,
|
|
1908
|
-
dirname:
|
|
1912
|
+
dirname: dirname5,
|
|
1909
1913
|
contains,
|
|
1910
1914
|
containsSync,
|
|
1911
1915
|
sep: path.sep
|
|
@@ -3630,7 +3634,7 @@ var require_liquid_node = __commonJS({
|
|
|
3630
3634
|
uri_escape,
|
|
3631
3635
|
slugify
|
|
3632
3636
|
});
|
|
3633
|
-
var
|
|
3637
|
+
var join7 = argumentsToValue(function(v, arg) {
|
|
3634
3638
|
const array2 = toArray(v);
|
|
3635
3639
|
const sep = isNil(arg) ? " " : stringify(arg);
|
|
3636
3640
|
let outputSize = sep.length * Math.max(array2.length - 1, 0);
|
|
@@ -3906,7 +3910,7 @@ var require_liquid_node = __commonJS({
|
|
|
3906
3910
|
__name(sample, "sample");
|
|
3907
3911
|
var arrayFilters = /* @__PURE__ */ Object.freeze({
|
|
3908
3912
|
__proto__: null,
|
|
3909
|
-
join:
|
|
3913
|
+
join: join7,
|
|
3910
3914
|
last,
|
|
3911
3915
|
first,
|
|
3912
3916
|
reverse,
|
|
@@ -5530,11 +5534,11 @@ var require_liquid_node = __commonJS({
|
|
|
5530
5534
|
}
|
|
5531
5535
|
});
|
|
5532
5536
|
|
|
5533
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
5537
|
+
// node_modules/.pnpm/@wirecat+cli-core@2.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_a82f624c57005d53c3f072e45c3a3a86/node_modules/@wirecat/cli-core/dist/cli/messenger/store-maintenance-command.js
|
|
5534
5538
|
import { chmodSync, constants, copyFileSync, existsSync as existsSync10, mkdirSync, realpathSync as realpathSync3, renameSync as renameSync3, rmSync as rmSync3, statfsSync as statfsSync2, statSync as statSync4, writeFileSync as writeFileSync2 } from "node:fs";
|
|
5535
|
-
import { dirname as
|
|
5539
|
+
import { dirname as dirname4, resolve as resolve2 } from "node:path";
|
|
5536
5540
|
|
|
5537
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
5541
|
+
// node_modules/.pnpm/@wirecat+cli-core@2.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_a82f624c57005d53c3f072e45c3a3a86/node_modules/@wirecat/cli-core/dist/sealed.js
|
|
5538
5542
|
import { createCipheriv, createDecipheriv, createHash, randomBytes, scrypt, timingSafeEqual } from "node:crypto";
|
|
5539
5543
|
import { closeSync, createReadStream, createWriteStream, existsSync, openSync, readSync, renameSync, rmSync, statSync } from "node:fs";
|
|
5540
5544
|
import { Transform } from "node:stream";
|
|
@@ -5546,7 +5550,7 @@ var NONCE = 12;
|
|
|
5546
5550
|
var TAG = 16;
|
|
5547
5551
|
var HEADER = MAGIC.length + 3 + SALT + NONCE;
|
|
5548
5552
|
var COST = { log2N: 17, r: 8, p: 1 };
|
|
5549
|
-
var keyOf = /* @__PURE__ */ __name((password, salt, { log2N, r, p }) => new Promise((
|
|
5553
|
+
var keyOf = /* @__PURE__ */ __name((password, salt, { log2N, r, p }) => new Promise((resolve3, reject) => scrypt(password, salt, 32, { N: 2 ** log2N, r, p, maxmem: 2 * 128 * r * 2 ** log2N }, (error, key) => error ? reject(error) : resolve3(key))), "keyOf");
|
|
5550
5554
|
var checkFor = /* @__PURE__ */ __name(async (password, cost = COST) => {
|
|
5551
5555
|
refuseEmpty(password);
|
|
5552
5556
|
const salt = randomBytes(SALT);
|
|
@@ -5641,7 +5645,7 @@ var unsealFile = /* @__PURE__ */ __name(async (from, to, password) => {
|
|
|
5641
5645
|
renameSync(pending, to);
|
|
5642
5646
|
}, "unsealFile");
|
|
5643
5647
|
|
|
5644
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
5648
|
+
// node_modules/.pnpm/@wirecat+cli-core@2.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_a82f624c57005d53c3f072e45c3a3a86/node_modules/@wirecat/cli-core/dist/store/compatibility.js
|
|
5645
5649
|
var SPEAKS = MIGRATIONS.at(-1)?.version ?? 0;
|
|
5646
5650
|
var fileSchemaOf = /* @__PURE__ */ __name((database) => {
|
|
5647
5651
|
const tracked = database.prepare("SELECT 1 FROM sqlite_master WHERE name = 'schema_migrations'").get();
|
|
@@ -5665,7 +5669,7 @@ var compatibilityOf = /* @__PURE__ */ __name((file2, migrations = MIGRATIONS) =>
|
|
|
5665
5669
|
};
|
|
5666
5670
|
}, "compatibilityOf");
|
|
5667
5671
|
|
|
5668
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
5672
|
+
// node_modules/.pnpm/@wirecat+cli-core@2.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_a82f624c57005d53c3f072e45c3a3a86/node_modules/@wirecat/cli-core/dist/store/repair.js
|
|
5669
5673
|
import { createHash as createHash2 } from "node:crypto";
|
|
5670
5674
|
var COPY_MARK = "__repair_";
|
|
5671
5675
|
var COPY_NAME = /__repair_[0-9a-f]{8}(_\d+)?$/;
|
|
@@ -5919,19 +5923,79 @@ var deleteCopy = /* @__PURE__ */ __name((database, name) => {
|
|
|
5919
5923
|
return found;
|
|
5920
5924
|
}, "deleteCopy");
|
|
5921
5925
|
|
|
5922
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
5926
|
+
// node_modules/.pnpm/@wirecat+cli-core@2.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_a82f624c57005d53c3f072e45c3a3a86/node_modules/@wirecat/cli-core/dist/cli/path-options.js
|
|
5927
|
+
import { dirname, isAbsolute, join, resolve } from "node:path";
|
|
5928
|
+
var PATH_NAME = /^([a-z]+-)*(file|path|dir|directory|folder)s?$/;
|
|
5929
|
+
var PATH_PLACEHOLDER = /[<[]([a-z]+-)*(file|path|dir|directory|folder)s?(\.\.\.)?[>\]]/;
|
|
5930
|
+
var NOT_LOCAL = /* @__PURE__ */ new WeakMap();
|
|
5931
|
+
var IN_BACKUPS = /* @__PURE__ */ new WeakMap();
|
|
5932
|
+
var mark = /* @__PURE__ */ __name((marks, command, names) => {
|
|
5933
|
+
marks.set(command, /* @__PURE__ */ new Set([...marks.get(command) ?? [], ...names]));
|
|
5934
|
+
return command;
|
|
5935
|
+
}, "mark");
|
|
5936
|
+
var notLocalPaths = /* @__PURE__ */ __name((command, ...names) => mark(NOT_LOCAL, command, names), "notLocalPaths");
|
|
5937
|
+
var inStoreBackups = /* @__PURE__ */ __name((command, ...names) => mark(IN_BACKUPS, command, names), "inStoreBackups");
|
|
5938
|
+
var marked = /* @__PURE__ */ __name((marks, command, name) => {
|
|
5939
|
+
for (let at = command; at; at = at.parent)
|
|
5940
|
+
if (marks.get(at)?.has(name))
|
|
5941
|
+
return true;
|
|
5942
|
+
return false;
|
|
5943
|
+
}, "marked");
|
|
5944
|
+
var isLocalPathOption = /* @__PURE__ */ __name((command, option) => PATH_PLACEHOLDER.test(option.flags) && !marked(NOT_LOCAL, command, option.attributeName()), "isLocalPathOption");
|
|
5945
|
+
var isLocalPathArgument = /* @__PURE__ */ __name((command, argument) => PATH_NAME.test(argument.name()) && !marked(NOT_LOCAL, command, argument.name()), "isLocalPathArgument");
|
|
5946
|
+
var isNamed = /* @__PURE__ */ __name((value) => value !== "" && value !== "-" && !value.includes("://"), "isNamed");
|
|
5947
|
+
var valuesOf = /* @__PURE__ */ __name((value) => (Array.isArray(value) ? value : [value]).filter((one) => typeof one === "string" && isNamed(one)), "valuesOf");
|
|
5948
|
+
var localPathsOf = /* @__PURE__ */ __name((action) => {
|
|
5949
|
+
const found = [];
|
|
5950
|
+
for (let at = action; at; at = at.parent) {
|
|
5951
|
+
for (const option of at.options) {
|
|
5952
|
+
const key = option.attributeName();
|
|
5953
|
+
if (!isLocalPathOption(at, option) || at.getOptionValueSource(key) !== "cli")
|
|
5954
|
+
continue;
|
|
5955
|
+
const flag = option.long ?? option.flags;
|
|
5956
|
+
for (const value of valuesOf(at.getOptionValue(key)))
|
|
5957
|
+
found.push({ flag, value, inBackups: marked(IN_BACKUPS, at, key) });
|
|
5958
|
+
}
|
|
5959
|
+
}
|
|
5960
|
+
action.registeredArguments.forEach((argument, index) => {
|
|
5961
|
+
const value = action.processedArgs[index];
|
|
5962
|
+
if (!isLocalPathArgument(action, argument) || value === argument.defaultValue)
|
|
5963
|
+
return;
|
|
5964
|
+
for (const one of valuesOf(value))
|
|
5965
|
+
found.push({ flag: `<${argument.name()}>`, value: one, inBackups: marked(IN_BACKUPS, action, argument.name()) });
|
|
5966
|
+
});
|
|
5967
|
+
return found;
|
|
5968
|
+
}, "localPathsOf");
|
|
5969
|
+
var refuseAgentPaths = /* @__PURE__ */ __name((action, app, env) => {
|
|
5970
|
+
const backups = join(dirname(resolve(storePath(env))), "backups");
|
|
5971
|
+
for (const { flag, value, inBackups } of localPathsOf(action)) {
|
|
5972
|
+
if (inBackups && inside(realPathOf(value), realPathOf(backups)))
|
|
5973
|
+
continue;
|
|
5974
|
+
if (refusedPlace(value, app, env))
|
|
5975
|
+
throw new CliError("permission_error", `${flag} ${value}: an agent's call reads and writes no credential folder, no folder of a WireCat tool and not the message store \u2014 the owner runs it in a terminal`, { param: flag, sent: false });
|
|
5976
|
+
}
|
|
5977
|
+
}, "refuseAgentPaths");
|
|
5978
|
+
var absoluteFrom = /* @__PURE__ */ __name((cwd, value) => {
|
|
5979
|
+
if (Array.isArray(value))
|
|
5980
|
+
return value.map((one) => absoluteFrom(cwd, one));
|
|
5981
|
+
if (typeof value !== "string" || !isNamed(value) || isAbsolute(value))
|
|
5982
|
+
return value;
|
|
5983
|
+
return resolve(cwd, value);
|
|
5984
|
+
}, "absoluteFrom");
|
|
5985
|
+
|
|
5986
|
+
// node_modules/.pnpm/@wirecat+cli-core@2.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_a82f624c57005d53c3f072e45c3a3a86/node_modules/@wirecat/cli-core/dist/cli/store-info.js
|
|
5923
5987
|
import { existsSync as existsSync4, statSync as statSync3 } from "node:fs";
|
|
5924
5988
|
|
|
5925
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
5989
|
+
// node_modules/.pnpm/@wirecat+cli-core@2.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_a82f624c57005d53c3f072e45c3a3a86/node_modules/@wirecat/cli-core/dist/cli/store-recover.js
|
|
5926
5990
|
import { existsSync as existsSync3 } from "node:fs";
|
|
5927
5991
|
|
|
5928
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
5992
|
+
// node_modules/.pnpm/@wirecat+cli-core@2.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_a82f624c57005d53c3f072e45c3a3a86/node_modules/@wirecat/cli-core/dist/store/recover.js
|
|
5929
5993
|
import { execFileSync, spawn } from "node:child_process";
|
|
5930
5994
|
import { existsSync as existsSync2, readFileSync, realpathSync, renameSync as renameSync2, rmSync as rmSync2, statfsSync, statSync as statSync2, writeFileSync } from "node:fs";
|
|
5931
|
-
import { basename, dirname, join } from "node:path";
|
|
5995
|
+
import { basename, dirname as dirname2, join as join2 } from "node:path";
|
|
5932
5996
|
import { Transform as Transform2 } from "node:stream";
|
|
5933
5997
|
|
|
5934
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
5998
|
+
// node_modules/.pnpm/@wirecat+cli-core@2.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_a82f624c57005d53c3f072e45c3a3a86/node_modules/@wirecat/cli-core/dist/store/refill.js
|
|
5935
5999
|
var REFILL_MARGIN_MS = 864e5;
|
|
5936
6000
|
var TIME_KEYS = 1e12;
|
|
5937
6001
|
var integerId = `external_id GLOB '[0-9]*' AND NOT external_id GLOB '*[^0-9]*'`;
|
|
@@ -6011,7 +6075,7 @@ var forgetMail = /* @__PURE__ */ __name((database, cutoff, now) => {
|
|
|
6011
6075
|
return [...folders].map(([account, count3]) => ({ account, folders: count3 }));
|
|
6012
6076
|
}, "forgetMail");
|
|
6013
6077
|
|
|
6014
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
6078
|
+
// node_modules/.pnpm/@wirecat+cli-core@2.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_a82f624c57005d53c3f072e45c3a3a86/node_modules/@wirecat/cli-core/dist/store/recover.js
|
|
6015
6079
|
var SQLITE3_MINIMUM = [3, 43, 0];
|
|
6016
6080
|
var STORE_PARTS = ["", "-wal", "-shm"];
|
|
6017
6081
|
var RECOVER_LOCK = ".recover-lock";
|
|
@@ -6087,8 +6151,8 @@ var takeRecoverLock = /* @__PURE__ */ __name((path) => {
|
|
|
6087
6151
|
return () => rmSync2(lock, { force: true });
|
|
6088
6152
|
}, "takeRecoverLock");
|
|
6089
6153
|
var storeHolders = /* @__PURE__ */ __name((path) => {
|
|
6090
|
-
const folder = realpathSync(
|
|
6091
|
-
const files = STORE_PARTS.map((suffix) =>
|
|
6154
|
+
const folder = realpathSync(dirname2(path));
|
|
6155
|
+
const files = STORE_PARTS.map((suffix) => join2(folder, `${basename(path)}${suffix}`));
|
|
6092
6156
|
const wanted = process.platform === "linux" ? files.flatMap((file2) => [file2, `${file2} (deleted)`]) : files.filter(existsSync2);
|
|
6093
6157
|
const recovering = runningRecovery(path);
|
|
6094
6158
|
const pids = holdersOf(wanted);
|
|
@@ -6231,7 +6295,7 @@ var placeLostRows = /* @__PURE__ */ __name((database) => {
|
|
|
6231
6295
|
}
|
|
6232
6296
|
return Object.fromEntries(Object.entries(placed).filter(([, rows2]) => rows2 > 0));
|
|
6233
6297
|
}, "placeLostRows");
|
|
6234
|
-
var copyReadableRows = /* @__PURE__ */ __name((path, target, program = "sqlite3") => new Promise((
|
|
6298
|
+
var copyReadableRows = /* @__PURE__ */ __name((path, target, program = "sqlite3") => new Promise((resolve3, reject) => {
|
|
6235
6299
|
const reader = spawn(program, ["-readonly", path, `.recover --ignore-freelist --lost-and-found ${LOST_AND_FOUND}`], {
|
|
6236
6300
|
stdio: ["ignore", "pipe", "pipe"]
|
|
6237
6301
|
});
|
|
@@ -6268,7 +6332,7 @@ var copyReadableRows = /* @__PURE__ */ __name((path, target, program = "sqlite3"
|
|
|
6268
6332
|
if (readerCode !== 0)
|
|
6269
6333
|
reject(new CliError("validation_error", `sqlite3 could not read the store: ${errors.join("; ")}`));
|
|
6270
6334
|
else
|
|
6271
|
-
|
|
6335
|
+
resolve3({ errors, read });
|
|
6272
6336
|
}, "exited");
|
|
6273
6337
|
reader.on("error", reject);
|
|
6274
6338
|
writer.on("error", reject);
|
|
@@ -6404,7 +6468,7 @@ var recoverStore = /* @__PURE__ */ __name(async ({ path, command, version, sqlit
|
|
|
6404
6468
|
try {
|
|
6405
6469
|
refuseInUse(path);
|
|
6406
6470
|
const bytes = STORE_PARTS.reduce((sum, suffix) => sum + (statSync2(`${path}${suffix}`, { throwIfNoEntry: false })?.size ?? 0), 0);
|
|
6407
|
-
const { bavail, bsize } = statfsSync(
|
|
6471
|
+
const { bavail, bsize } = statfsSync(dirname2(path));
|
|
6408
6472
|
if (Number(bavail) * Number(bsize) < bytes * 1.2)
|
|
6409
6473
|
throw new CliError("validation_error", `the recovery needs about ${Math.ceil(bytes * 1.2 / 1e9)} GB free beside the store`);
|
|
6410
6474
|
return await recoverLocked({ path, command, version, sqlite3, now, note, copy, started, program });
|
|
@@ -6542,7 +6606,7 @@ var recoverLocked = /* @__PURE__ */ __name(async ({ path, command, version, sqli
|
|
|
6542
6606
|
}
|
|
6543
6607
|
}, "recoverLocked");
|
|
6544
6608
|
|
|
6545
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
6609
|
+
// node_modules/.pnpm/@wirecat+cli-core@2.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_a82f624c57005d53c3f072e45c3a3a86/node_modules/@wirecat/cli-core/dist/cli/store-recover.js
|
|
6546
6610
|
var COUNTED = [
|
|
6547
6611
|
"accounts",
|
|
6548
6612
|
"chats",
|
|
@@ -6577,7 +6641,7 @@ var storeRecoveryCheck = /* @__PURE__ */ __name(async (env, command, version) =>
|
|
|
6577
6641
|
}
|
|
6578
6642
|
const journal = readJournalMark(path);
|
|
6579
6643
|
recordDeepCheck(path, health, { cli: command, ...version ? { version } : {}, schema });
|
|
6580
|
-
const
|
|
6644
|
+
const mark2 = readDamageMark(path);
|
|
6581
6645
|
const lastKnownGood = readHealthMark(path)?.last_ok_at ?? null;
|
|
6582
6646
|
const inUse = storeHolders(path) ?? null;
|
|
6583
6647
|
const timers = activeTimers() ?? null;
|
|
@@ -6585,7 +6649,7 @@ var storeRecoveryCheck = /* @__PURE__ */ __name(async (env, command, version) =>
|
|
|
6585
6649
|
const report = storeDamageReport({
|
|
6586
6650
|
health,
|
|
6587
6651
|
command,
|
|
6588
|
-
mark,
|
|
6652
|
+
mark: mark2,
|
|
6589
6653
|
journal,
|
|
6590
6654
|
lastOkAt: lastKnownGood,
|
|
6591
6655
|
holders: inUse,
|
|
@@ -6603,7 +6667,7 @@ var storeRecoveryCheck = /* @__PURE__ */ __name(async (env, command, version) =>
|
|
|
6603
6667
|
invalidJson: health.invalidJson ?? [],
|
|
6604
6668
|
rows,
|
|
6605
6669
|
report,
|
|
6606
|
-
damageMark:
|
|
6670
|
+
damageMark: mark2 ? (({ inode: _, ...seen }) => seen)(mark2) : null,
|
|
6607
6671
|
lastKnownGood,
|
|
6608
6672
|
inUse,
|
|
6609
6673
|
timers,
|
|
@@ -6636,12 +6700,12 @@ var storeRecoveryRun = /* @__PURE__ */ __name(async (env, { command, version, no
|
|
|
6636
6700
|
}, "storeRecoveryRun");
|
|
6637
6701
|
var refetchNotes = /* @__PURE__ */ __name(({ since, chats, mail }) => {
|
|
6638
6702
|
const from = since === null ? "from the start" : `from ${since} on`;
|
|
6639
|
-
const
|
|
6703
|
+
const marked2 = [
|
|
6640
6704
|
...chats.map(({ provider, account, chats: chats2 }) => `${chats2} chats of ${provider} ${account}`),
|
|
6641
6705
|
...mail.map(({ account, folders }) => `${folders} mail folders of ${account}`)
|
|
6642
6706
|
];
|
|
6643
6707
|
return [
|
|
6644
|
-
|
|
6708
|
+
marked2.length > 0 ? `marked as not fetched ${from}, so the next sync or serve fetches it again: ${marked2.join(", ")}` : `nothing held ${from} was marked as fetched, so there is nothing to fetch again`,
|
|
6645
6709
|
...chats.filter(({ provider }) => provider === "whatsapp").map(({ account }) => `whatsapp ${account}: WhatsApp cannot be asked for its chats, so only what the phone pushes while serve runs comes back`),
|
|
6646
6710
|
"notes, memories, tags and whatever else only this store held cannot be fetched again"
|
|
6647
6711
|
];
|
|
@@ -6698,7 +6762,7 @@ var storeRecoverCommand = /* @__PURE__ */ __name(({ command, version }) => {
|
|
|
6698
6762
|
return recover;
|
|
6699
6763
|
}, "storeRecoverCommand");
|
|
6700
6764
|
|
|
6701
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
6765
|
+
// node_modules/.pnpm/@wirecat+cli-core@2.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_a82f624c57005d53c3f072e45c3a3a86/node_modules/@wirecat/cli-core/dist/cli/store-info.js
|
|
6702
6766
|
var pendingIfKnown = /* @__PURE__ */ __name((database) => database.prepare("SELECT 1 FROM pragma_table_info('messages') WHERE name = 'normalized_text'").get() ? pendingNormalization(database) : null, "pendingIfKnown");
|
|
6703
6767
|
var bytesOf = /* @__PURE__ */ __name((path) => existsSync4(path) ? statSync3(path).size : 0, "bytesOf");
|
|
6704
6768
|
var messageOf = /* @__PURE__ */ __name((error) => error instanceof Error ? error.message : String(error), "messageOf");
|
|
@@ -6744,7 +6808,7 @@ var storeInfoCommand = /* @__PURE__ */ __name(() => annotate(new Command("info")
|
|
|
6744
6808
|
renderAnswer(this, outputFor(this), itemOf(answer));
|
|
6745
6809
|
}), "storeInfoCommand");
|
|
6746
6810
|
|
|
6747
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
6811
|
+
// node_modules/.pnpm/@wirecat+cli-core@2.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_a82f624c57005d53c3f072e45c3a3a86/node_modules/@wirecat/cli-core/dist/cli/messenger/password.js
|
|
6748
6812
|
var ENCRYPT_OPTION = [
|
|
6749
6813
|
"--encrypt",
|
|
6750
6814
|
"compress and encrypt with a password, typed at a hidden prompt or piped on stdin; it is never kept \u2014 lose it and the file cannot be opened"
|
|
@@ -6763,9 +6827,9 @@ var passwordOf = /* @__PURE__ */ __name(async (command, { twice }) => {
|
|
|
6763
6827
|
return password;
|
|
6764
6828
|
}, "passwordOf");
|
|
6765
6829
|
|
|
6766
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
6830
|
+
// node_modules/.pnpm/@wirecat+cli-core@2.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_a82f624c57005d53c3f072e45c3a3a86/node_modules/@wirecat/cli-core/dist/replies/rules.js
|
|
6767
6831
|
import { existsSync as existsSync5, readFileSync as readFileSync2 } from "node:fs";
|
|
6768
|
-
import { join as
|
|
6832
|
+
import { join as join3 } from "node:path";
|
|
6769
6833
|
var REPLY_ACTIONS = ["reply", "task"];
|
|
6770
6834
|
var REPLY_MODELS = ["fill-only", "may-reword"];
|
|
6771
6835
|
var REPLY_KINDS = ["dialog", "group"];
|
|
@@ -6851,7 +6915,7 @@ var defaultRule = /* @__PURE__ */ __name((id) => ({
|
|
|
6851
6915
|
reply: { template: "", asReply: true },
|
|
6852
6916
|
limits: { perChat: "1/1d", perPerson: "1/1d" }
|
|
6853
6917
|
}), "defaultRule");
|
|
6854
|
-
var repliesPathFor = /* @__PURE__ */ __name((app, profile, env = process.env) =>
|
|
6918
|
+
var repliesPathFor = /* @__PURE__ */ __name((app, profile, env = process.env) => join3(resolvePaths({ appName: app.appName, prefix: app.envPrefix, env }).config, `${profile}.replies.json`), "repliesPathFor");
|
|
6855
6919
|
var EVERYONE = { reply: "all", allow: { people: [], chats: [] }, deny: { people: [], chats: [] } };
|
|
6856
6920
|
var outsideAudience = /* @__PURE__ */ __name((audience, person, chat) => {
|
|
6857
6921
|
if (person !== null && audience.deny.people.includes(person))
|
|
@@ -6934,9 +6998,9 @@ var problem = /* @__PURE__ */ __name((issue) => {
|
|
|
6934
6998
|
}, "problem");
|
|
6935
6999
|
var broken = /* @__PURE__ */ __name((path, why) => new CliError("configuration_error", `the reply rules ${path} cannot be read (${why}) \u2014 fix the file`), "broken");
|
|
6936
7000
|
|
|
6937
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
7001
|
+
// node_modules/.pnpm/@wirecat+cli-core@2.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_a82f624c57005d53c3f072e45c3a3a86/node_modules/@wirecat/cli-core/dist/replies/state.js
|
|
6938
7002
|
import { existsSync as existsSync6, readFileSync as readFileSync3 } from "node:fs";
|
|
6939
|
-
import { join as
|
|
7003
|
+
import { join as join4 } from "node:path";
|
|
6940
7004
|
var ANSWERED_KEPT = 1e3;
|
|
6941
7005
|
var times = record(string(), array(string()));
|
|
6942
7006
|
var stateFile = object({
|
|
@@ -6948,7 +7012,7 @@ var stateFile = object({
|
|
|
6948
7012
|
});
|
|
6949
7013
|
var emptyState = /* @__PURE__ */ __name(() => ({ paused: false, answered: [], sent: {} }), "emptyState");
|
|
6950
7014
|
var answeredKey = /* @__PURE__ */ __name((message) => `${message.chatId}:${message.id}`, "answeredKey");
|
|
6951
|
-
var repliesStatePathFor = /* @__PURE__ */ __name((app, profile, env = process.env) =>
|
|
7015
|
+
var repliesStatePathFor = /* @__PURE__ */ __name((app, profile, env = process.env) => join4(resolvePaths({ appName: app.appName, prefix: app.envPrefix, env }).state, `${profile}.replies-state.json`), "repliesStatePathFor");
|
|
6952
7016
|
var readRepliesState = /* @__PURE__ */ __name((path) => {
|
|
6953
7017
|
if (!existsSync6(path))
|
|
6954
7018
|
return emptyState();
|
|
@@ -6987,7 +7051,7 @@ var recordReply = /* @__PURE__ */ __name((state, rule2, message, now) => {
|
|
|
6987
7051
|
}, "recordReply");
|
|
6988
7052
|
var broken2 = /* @__PURE__ */ __name((path, why) => new CliError("configuration_error", `the reply state ${path} cannot be read (${why}) \u2014 fix or move the file`), "broken");
|
|
6989
7053
|
|
|
6990
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
7054
|
+
// node_modules/.pnpm/@wirecat+cli-core@2.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_a82f624c57005d53c3f072e45c3a3a86/node_modules/@wirecat/cli-core/dist/replies/decide.js
|
|
6991
7055
|
var skip = /* @__PURE__ */ __name((why) => ({ skip: why }), "skip");
|
|
6992
7056
|
var decide = /* @__PURE__ */ __name((rule2, incoming, state, now) => {
|
|
6993
7057
|
const { message, chat, owner, sender } = incoming;
|
|
@@ -7093,10 +7157,10 @@ var filled = /* @__PURE__ */ __name((template2, senderName) => {
|
|
|
7093
7157
|
return template2.replaceAll("{firstName}", name.split(/\s+/)[0] ?? name).replaceAll("{name}", name);
|
|
7094
7158
|
}, "filled");
|
|
7095
7159
|
|
|
7096
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
7160
|
+
// node_modules/.pnpm/@wirecat+cli-core@2.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_a82f624c57005d53c3f072e45c3a3a86/node_modules/@wirecat/cli-core/dist/replies/template.js
|
|
7097
7161
|
var import_liquidjs2 = __toESM(require_liquid_node(), 1);
|
|
7098
7162
|
|
|
7099
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
7163
|
+
// node_modules/.pnpm/@wirecat+cli-core@2.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_a82f624c57005d53c3f072e45c3a3a86/node_modules/@wirecat/cli-core/dist/render/liquid.js
|
|
7100
7164
|
var import_liquidjs = __toESM(require_liquid_node(), 1);
|
|
7101
7165
|
var safeLiquid = /* @__PURE__ */ __name((limits) => {
|
|
7102
7166
|
const engine = new import_liquidjs.Liquid({
|
|
@@ -7123,7 +7187,7 @@ var safeLiquid = /* @__PURE__ */ __name((limits) => {
|
|
|
7123
7187
|
return engine;
|
|
7124
7188
|
}, "safeLiquid");
|
|
7125
7189
|
|
|
7126
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
7190
|
+
// node_modules/.pnpm/@wirecat+cli-core@2.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_a82f624c57005d53c3f072e45c3a3a86/node_modules/@wirecat/cli-core/dist/replies/template.js
|
|
7127
7191
|
var TEMPLATE_LIMITS = {
|
|
7128
7192
|
parse: 32768,
|
|
7129
7193
|
renders: 2e3,
|
|
@@ -7262,7 +7326,7 @@ var renderReplyTemplate = /* @__PURE__ */ __name(async (reply, input) => {
|
|
|
7262
7326
|
}
|
|
7263
7327
|
}, "renderReplyTemplate");
|
|
7264
7328
|
|
|
7265
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
7329
|
+
// node_modules/.pnpm/@wirecat+cli-core@2.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_a82f624c57005d53c3f072e45c3a3a86/node_modules/@wirecat/cli-core/dist/replies/dry-run.js
|
|
7266
7330
|
var DRY_RUN_DAYS = 7;
|
|
7267
7331
|
var PAGE = 500;
|
|
7268
7332
|
var dryRun = /* @__PURE__ */ __name(async (store, account, rules, { since, until = Date.now(), only, audience, render }) => {
|
|
@@ -7376,7 +7440,7 @@ var storedSince = /* @__PURE__ */ __name(async (store, account, chat, since) =>
|
|
|
7376
7440
|
}
|
|
7377
7441
|
}, "storedSince");
|
|
7378
7442
|
|
|
7379
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
7443
|
+
// node_modules/.pnpm/@wirecat+cli-core@2.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_a82f624c57005d53c3f072e45c3a3a86/node_modules/@wirecat/cli-core/dist/models/ai.js
|
|
7380
7444
|
var AI_PROVIDERS = ["anthropic", "openai", "ollama"];
|
|
7381
7445
|
var DEFAULT_BASE_URL = {
|
|
7382
7446
|
anthropic: "https://api.anthropic.com",
|
|
@@ -7544,7 +7608,7 @@ var checkAi = /* @__PURE__ */ __name(async (deps) => {
|
|
|
7544
7608
|
}
|
|
7545
7609
|
}, "checkAi");
|
|
7546
7610
|
|
|
7547
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
7611
|
+
// node_modules/.pnpm/@wirecat+cli-core@2.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_a82f624c57005d53c3f072e45c3a3a86/node_modules/@wirecat/cli-core/dist/models/purpose.js
|
|
7548
7612
|
var HOSTED = {
|
|
7549
7613
|
openai: "https://api.openai.com/v1",
|
|
7550
7614
|
anthropic: "https://api.anthropic.com"
|
|
@@ -7565,14 +7629,14 @@ var purposeModel = /* @__PURE__ */ __name((settings, purpose, deps) => {
|
|
|
7565
7629
|
return shared ? { target: shared.target, key: /* @__PURE__ */ __name(() => shared.key, "key"), shared: shared.setting } : void 0;
|
|
7566
7630
|
}, "purposeModel");
|
|
7567
7631
|
|
|
7568
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
7632
|
+
// node_modules/.pnpm/@wirecat+cli-core@2.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_a82f624c57005d53c3f072e45c3a3a86/node_modules/@wirecat/cli-core/dist/replies/consents.js
|
|
7569
7633
|
import { existsSync as existsSync7, readFileSync as readFileSync4 } from "node:fs";
|
|
7570
|
-
import { join as
|
|
7634
|
+
import { join as join5 } from "node:path";
|
|
7571
7635
|
var shape = strictObject({
|
|
7572
7636
|
provider: nullable(pipe(string(), minLength(1))),
|
|
7573
7637
|
deniedChats: array(pipe(string(), minLength(1)))
|
|
7574
7638
|
});
|
|
7575
|
-
var replyConsentPathFor = /* @__PURE__ */ __name((app, profile, env = process.env) =>
|
|
7639
|
+
var replyConsentPathFor = /* @__PURE__ */ __name((app, profile, env = process.env) => join5(resolvePaths({ appName: app.appName, prefix: app.envPrefix, env }).config, `${profile}.replies-consents.json`), "replyConsentPathFor");
|
|
7576
7640
|
var readReplyConsent = /* @__PURE__ */ __name((path) => {
|
|
7577
7641
|
if (!existsSync7(path))
|
|
7578
7642
|
return { provider: null, deniedChats: [] };
|
|
@@ -7590,7 +7654,7 @@ var mayModelReply = /* @__PURE__ */ __name((path, provider, chat) => {
|
|
|
7590
7654
|
return consent.provider === provider && !consent.deniedChats.includes(chat);
|
|
7591
7655
|
}, "mayModelReply");
|
|
7592
7656
|
|
|
7593
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
7657
|
+
// node_modules/.pnpm/@wirecat+cli-core@2.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_a82f624c57005d53c3f072e45c3a3a86/node_modules/@wirecat/cli-core/dist/replies/rendering.js
|
|
7594
7658
|
var replyRenderer = /* @__PURE__ */ __name((app, profile, settings, env, warn, options = {
|
|
7595
7659
|
ai: true
|
|
7596
7660
|
}) => async (rule2, message, chat, now) => {
|
|
@@ -7638,7 +7702,7 @@ var replyRenderer = /* @__PURE__ */ __name((app, profile, settings, env, warn, o
|
|
|
7638
7702
|
return result2;
|
|
7639
7703
|
}, "replyRenderer");
|
|
7640
7704
|
|
|
7641
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
7705
|
+
// node_modules/.pnpm/@wirecat+cli-core@2.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_a82f624c57005d53c3f072e45c3a3a86/node_modules/@wirecat/cli-core/dist/replies/serve.js
|
|
7642
7706
|
var NOT_ALLOWED = "replies.send is not allow";
|
|
7643
7707
|
var NO_RULES = "no rules";
|
|
7644
7708
|
var ONLY_TASK = "opened a task, sent nothing";
|
|
@@ -7731,7 +7795,7 @@ var replyTo = /* @__PURE__ */ __name(async (deps, message) => {
|
|
|
7731
7795
|
return { skip: why };
|
|
7732
7796
|
}, "replyTo");
|
|
7733
7797
|
|
|
7734
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
7798
|
+
// node_modules/.pnpm/@wirecat+cli-core@2.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_a82f624c57005d53c3f072e45c3a3a86/node_modules/@wirecat/cli-core/dist/cli/messenger/serve-catch-up.js
|
|
7735
7799
|
var START_SYNC_DELAY_MS = 3e4;
|
|
7736
7800
|
var START_SYNC_BUDGET_MS = 5 * 6e4;
|
|
7737
7801
|
var START_SYNC_WINDOW_MS = 7 * 864e5;
|
|
@@ -7808,7 +7872,7 @@ var startSync = /* @__PURE__ */ __name(({ chats, newestHeld, fetch, note, warn,
|
|
|
7808
7872
|
};
|
|
7809
7873
|
}, "startSync");
|
|
7810
7874
|
|
|
7811
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
7875
|
+
// node_modules/.pnpm/@wirecat+cli-core@2.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_a82f624c57005d53c3f072e45c3a3a86/node_modules/@wirecat/cli-core/dist/cli/messenger/serve-members.js
|
|
7812
7876
|
var FIRST_FETCH_MS = 6e4;
|
|
7813
7877
|
var DAY_MS = 864e5;
|
|
7814
7878
|
var memberFetches = /* @__PURE__ */ __name(({ withStore, fetch, warn, firstMs = FIRST_FETCH_MS, everyMs = DAY_MS }) => {
|
|
@@ -7862,7 +7926,7 @@ var memberFetches = /* @__PURE__ */ __name(({ withStore, fetch, warn, firstMs =
|
|
|
7862
7926
|
};
|
|
7863
7927
|
}, "memberFetches");
|
|
7864
7928
|
|
|
7865
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
7929
|
+
// node_modules/.pnpm/@wirecat+cli-core@2.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_a82f624c57005d53c3f072e45c3a3a86/node_modules/@wirecat/cli-core/dist/cli/messenger/serve-notice.js
|
|
7866
7930
|
var record2 = /* @__PURE__ */ __name((context, app, severity, attributes) => recordLogFor(context.streams.diagnostic, app, { command: currentRun().command || "serve" })[severity](attributes), "record");
|
|
7867
7931
|
var noticeFor = /* @__PURE__ */ __name((context, app, severity = "warn") => ({ text, ...attributes }) => {
|
|
7868
7932
|
if (context.format === "pretty") {
|
|
@@ -7895,22 +7959,22 @@ var recordDiagnostics = /* @__PURE__ */ __name((context, app) => {
|
|
|
7895
7959
|
return context;
|
|
7896
7960
|
}, "recordDiagnostics");
|
|
7897
7961
|
|
|
7898
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
7962
|
+
// node_modules/.pnpm/@wirecat+cli-core@2.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_a82f624c57005d53c3f072e45c3a3a86/node_modules/@wirecat/cli-core/dist/cli/messenger/serve-outdated.js
|
|
7899
7963
|
import { existsSync as existsSync8, readFileSync as readFileSync5, realpathSync as realpathSync2 } from "node:fs";
|
|
7900
|
-
import { dirname as
|
|
7964
|
+
import { dirname as dirname3, join as join6 } from "node:path";
|
|
7901
7965
|
var OUTDATED_CHECK_MS = 6e4;
|
|
7902
7966
|
var ownPackageRoot = /* @__PURE__ */ __name((running, script = process.argv[1]) => {
|
|
7903
7967
|
let dir;
|
|
7904
7968
|
try {
|
|
7905
|
-
dir =
|
|
7969
|
+
dir = dirname3(realpathSync2(script ?? ""));
|
|
7906
7970
|
} catch {
|
|
7907
7971
|
return void 0;
|
|
7908
7972
|
}
|
|
7909
7973
|
for (let up = 0; up < 8; up++) {
|
|
7910
|
-
const manifest =
|
|
7974
|
+
const manifest = join6(dir, "package.json");
|
|
7911
7975
|
if (existsSync8(manifest))
|
|
7912
7976
|
return installedVersion(dir) === running ? dir : void 0;
|
|
7913
|
-
const parent =
|
|
7977
|
+
const parent = dirname3(dir);
|
|
7914
7978
|
if (parent === dir)
|
|
7915
7979
|
return void 0;
|
|
7916
7980
|
dir = parent;
|
|
@@ -7919,7 +7983,7 @@ var ownPackageRoot = /* @__PURE__ */ __name((running, script = process.argv[1])
|
|
|
7919
7983
|
}, "ownPackageRoot");
|
|
7920
7984
|
var installedVersion = /* @__PURE__ */ __name((root) => {
|
|
7921
7985
|
try {
|
|
7922
|
-
const { version } = JSON.parse(readFileSync5(
|
|
7986
|
+
const { version } = JSON.parse(readFileSync5(join6(root, "package.json"), "utf8"));
|
|
7923
7987
|
return typeof version === "string" ? version : void 0;
|
|
7924
7988
|
} catch {
|
|
7925
7989
|
return void 0;
|
|
@@ -7981,7 +8045,7 @@ var watchOutdated = /* @__PURE__ */ __name(({ check: check2, onOutdated, everyMs
|
|
|
7981
8045
|
};
|
|
7982
8046
|
}, "watchOutdated");
|
|
7983
8047
|
|
|
7984
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
8048
|
+
// node_modules/.pnpm/@wirecat+cli-core@2.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_a82f624c57005d53c3f072e45c3a3a86/node_modules/@wirecat/cli-core/dist/cli/messenger/serve-stems.js
|
|
7985
8049
|
var STEMS_EVERY_MS = 3e4;
|
|
7986
8050
|
var STEMS_SLICE_MS = 2e3;
|
|
7987
8051
|
var stemFills = /* @__PURE__ */ __name(({ withStore, warn, everyMs = STEMS_EVERY_MS, sliceMs = STEMS_SLICE_MS }) => {
|
|
@@ -8021,7 +8085,7 @@ var stemFills = /* @__PURE__ */ __name(({ withStore, warn, everyMs = STEMS_EVERY
|
|
|
8021
8085
|
};
|
|
8022
8086
|
}, "stemFills");
|
|
8023
8087
|
|
|
8024
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
8088
|
+
// node_modules/.pnpm/@wirecat+cli-core@2.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_a82f624c57005d53c3f072e45c3a3a86/node_modules/@wirecat/cli-core/dist/cli/messenger/message-items.js
|
|
8025
8089
|
var defined = /* @__PURE__ */ __name((value) => Object.fromEntries(Object.entries(value).filter(([, one]) => one !== void 0)), "defined");
|
|
8026
8090
|
var attachmentItem = /* @__PURE__ */ __name((attachment) => defined({
|
|
8027
8091
|
kind: attachment.kind,
|
|
@@ -8096,6 +8160,8 @@ var messageItem = /* @__PURE__ */ __name((message, reader) => {
|
|
|
8096
8160
|
thread: message.email.thread,
|
|
8097
8161
|
read: message.email.read,
|
|
8098
8162
|
flagged: message.email.flagged,
|
|
8163
|
+
mail_type: message.email.mailType,
|
|
8164
|
+
reach: message.email.reach,
|
|
8099
8165
|
sender_score: message.email.senderScore
|
|
8100
8166
|
},
|
|
8101
8167
|
provider_metadata: message.providerMetadata
|
|
@@ -8117,7 +8183,7 @@ var viewOf = /* @__PURE__ */ __name((context, messenger) => ({
|
|
|
8117
8183
|
locale: messenger.app.locale
|
|
8118
8184
|
}), "viewOf");
|
|
8119
8185
|
|
|
8120
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
8186
|
+
// node_modules/.pnpm/@wirecat+cli-core@2.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_a82f624c57005d53c3f072e45c3a3a86/node_modules/@wirecat/cli-core/dist/cli/messenger/watch-answers.js
|
|
8121
8187
|
var observed = /* @__PURE__ */ __name((value) => ({
|
|
8122
8188
|
value: value.value,
|
|
8123
8189
|
observed_at: value.observedAt,
|
|
@@ -8184,7 +8250,7 @@ var watchEventItem = /* @__PURE__ */ __name((value, account) => {
|
|
|
8184
8250
|
}
|
|
8185
8251
|
}, "watchEventItem");
|
|
8186
8252
|
|
|
8187
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
8253
|
+
// node_modules/.pnpm/@wirecat+cli-core@2.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_a82f624c57005d53c3f072e45c3a3a86/node_modules/@wirecat/cli-core/dist/cli/messenger/watch-command.js
|
|
8188
8254
|
var watchCommand = /* @__PURE__ */ __name((messenger) => annotate(new Command("watch"), {
|
|
8189
8255
|
output: { entity: "watch_item" },
|
|
8190
8256
|
effects: REMOTE_READ,
|
|
@@ -8339,7 +8405,8 @@ var describe = /* @__PURE__ */ __name((event, render) => {
|
|
|
8339
8405
|
}
|
|
8340
8406
|
}, "describe");
|
|
8341
8407
|
|
|
8342
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
8408
|
+
// node_modules/.pnpm/@wirecat+cli-core@2.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_a82f624c57005d53c3f072e45c3a3a86/node_modules/@wirecat/cli-core/dist/cli/messenger/serve-command.js
|
|
8409
|
+
var CURRENT_EVERY_MS = 6e4;
|
|
8343
8410
|
var serveCommand = /* @__PURE__ */ __name((messenger) => {
|
|
8344
8411
|
const command = annotate(new Command("serve"), {
|
|
8345
8412
|
output: { entity: "serve_summary" },
|
|
@@ -8362,9 +8429,18 @@ var serveCommand = /* @__PURE__ */ __name((messenger) => {
|
|
|
8362
8429
|
throw new CliError("validation_error", `${messenger.app.command} serve is already running for profile ${context.profile} (PID ${held.pid}, since ${held.startedAt})`);
|
|
8363
8430
|
}
|
|
8364
8431
|
let relaying;
|
|
8432
|
+
let current;
|
|
8433
|
+
const stamp = /* @__PURE__ */ __name(() => {
|
|
8434
|
+
try {
|
|
8435
|
+
markCurrent(path);
|
|
8436
|
+
} catch {
|
|
8437
|
+
}
|
|
8438
|
+
}, "stamp");
|
|
8365
8439
|
const onReady = /* @__PURE__ */ __name(() => {
|
|
8366
8440
|
const listening2 = { pid: process.pid, startedAt, version, listeningAt: (/* @__PURE__ */ new Date()).toISOString() };
|
|
8367
8441
|
holdLock(path, listening2);
|
|
8442
|
+
stamp();
|
|
8443
|
+
current ??= setInterval(stamp, CURRENT_EVERY_MS).unref();
|
|
8368
8444
|
note({
|
|
8369
8445
|
code: "listening",
|
|
8370
8446
|
text: `listening for profile ${context.profile}, catching up on what arrived while it was down`
|
|
@@ -8485,6 +8561,10 @@ var serveCommand = /* @__PURE__ */ __name((messenger) => {
|
|
|
8485
8561
|
}, "connected")
|
|
8486
8562
|
});
|
|
8487
8563
|
} finally {
|
|
8564
|
+
if (current) {
|
|
8565
|
+
clearInterval(current);
|
|
8566
|
+
stamp();
|
|
8567
|
+
}
|
|
8488
8568
|
watch.stop();
|
|
8489
8569
|
await relaying;
|
|
8490
8570
|
await relay?.close();
|
|
@@ -8625,7 +8705,7 @@ var tasking = /* @__PURE__ */ __name((context, warn) => {
|
|
|
8625
8705
|
};
|
|
8626
8706
|
}, "tasking");
|
|
8627
8707
|
|
|
8628
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
8708
|
+
// node_modules/.pnpm/@wirecat+cli-core@2.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_a82f624c57005d53c3f072e45c3a3a86/node_modules/@wirecat/cli-core/dist/cli/messenger/store-tables-command.js
|
|
8629
8709
|
import { existsSync as existsSync9 } from "node:fs";
|
|
8630
8710
|
var PATH = "store tables list";
|
|
8631
8711
|
var STORE_TABLES_QUERY = {
|
|
@@ -8668,7 +8748,7 @@ var storeTablesCommand = /* @__PURE__ */ __name((owner) => {
|
|
|
8668
8748
|
return tables;
|
|
8669
8749
|
}, "storeTablesCommand");
|
|
8670
8750
|
|
|
8671
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
8751
|
+
// node_modules/.pnpm/@wirecat+cli-core@2.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_a82f624c57005d53c3f072e45c3a3a86/node_modules/@wirecat/cli-core/dist/cli/messenger/store-maintenance-command.js
|
|
8672
8752
|
var SEARCH_INDEXES = ["messages_fts", "chats_fts", "identities_fts"];
|
|
8673
8753
|
var WORD_INDEX = "message_words";
|
|
8674
8754
|
var schemaOf = /* @__PURE__ */ __name((database) => {
|
|
@@ -8694,7 +8774,7 @@ var readingOnly = /* @__PURE__ */ __name(async (path, read) => {
|
|
|
8694
8774
|
database.close();
|
|
8695
8775
|
}
|
|
8696
8776
|
}, "readingOnly");
|
|
8697
|
-
var withoutInode = /* @__PURE__ */ __name(({ inode: _, ...
|
|
8777
|
+
var withoutInode = /* @__PURE__ */ __name(({ inode: _, ...mark2 }) => mark2, "withoutInode");
|
|
8698
8778
|
var fileSchema = /* @__PURE__ */ __name(async (path) => {
|
|
8699
8779
|
try {
|
|
8700
8780
|
return await readingOnly(path, (database) => fileSchemaOf(database).version);
|
|
@@ -8713,7 +8793,7 @@ var storeSummary = /* @__PURE__ */ __name(async (env, { deep = false, command, v
|
|
|
8713
8793
|
...version ? { version } : {},
|
|
8714
8794
|
schema: await fileSchema(path)
|
|
8715
8795
|
}) : null;
|
|
8716
|
-
const
|
|
8796
|
+
const mark2 = readDamageMark(path);
|
|
8717
8797
|
const lastKnownGood = readHealthMark(path)?.last_ok_at ?? null;
|
|
8718
8798
|
const health = {
|
|
8719
8799
|
checked: checked.checked,
|
|
@@ -8725,11 +8805,11 @@ var storeSummary = /* @__PURE__ */ __name(async (env, { deep = false, command, v
|
|
|
8725
8805
|
...checked.invalidJson?.length ? { invalidJson: checked.invalidJson } : {},
|
|
8726
8806
|
...checked.searchIndexes?.some((index) => !index.ok) ? { damagedSearchIndexes: checked.searchIndexes.filter((index) => !index.ok).map((index) => index.name) } : {}
|
|
8727
8807
|
};
|
|
8728
|
-
const damage = command ? storeDamageReport({ health: checked, command, mark, journal, lastOkAt: lastKnownGood }) : null;
|
|
8808
|
+
const damage = command ? storeDamageReport({ health: checked, command, mark: mark2, journal, lastOkAt: lastKnownGood }) : null;
|
|
8729
8809
|
const healthOf = {
|
|
8730
8810
|
health,
|
|
8731
8811
|
lastKnownGood,
|
|
8732
|
-
...
|
|
8812
|
+
...mark2 ? { damageMark: withoutInode(mark2) } : {},
|
|
8733
8813
|
...journal ? { journalMark: journal } : {},
|
|
8734
8814
|
...recorded?.cleared ? { damageMarkCleared: withoutInode(recorded.cleared) } : {},
|
|
8735
8815
|
// `what` keeps memo's doctor, which reads it, compiling until it moves to `whatHappened`.
|
|
@@ -8916,7 +8996,7 @@ var inspect = /* @__PURE__ */ __name((path) => reading(path, (database) => {
|
|
|
8916
8996
|
...schema.version >= 71 ? [["content_post_words", indexIntegrity(database, "content_post_words", 0)]] : []
|
|
8917
8997
|
]);
|
|
8918
8998
|
const size = bytesOf2(path) + bytesOf2(`${path}-wal`);
|
|
8919
|
-
const { bavail, bsize } = statfsSync2(
|
|
8999
|
+
const { bavail, bsize } = statfsSync2(dirname4(path));
|
|
8920
9000
|
const free = Number(bavail) * Number(bsize);
|
|
8921
9001
|
const behind = schema.version > 0 ? chatsBehind(database) : [];
|
|
8922
9002
|
const vectorIndexes = schema.version >= 34 ? vectorIndexCounts(database) : [];
|
|
@@ -9001,8 +9081,9 @@ var chatsBehind = /* @__PURE__ */ __name((database) => database.prepare(`SELECT
|
|
|
9001
9081
|
held: row.held === null ? null : isoOf(row.held),
|
|
9002
9082
|
refreshed: isoOf(row.refreshed)
|
|
9003
9083
|
})), "chatsBehind");
|
|
9004
|
-
var migrateCommand = /* @__PURE__ */ __name((owner) => annotate(new Command("migrate"), { output: { entity: "store_migration" }, effects: LOCAL_WRITE }).summary(`migrate an older ${archive(owner)}`).description("bring the store up to this build's schema, then normalize, index and stem the messages and notes stored before it").action(async function() {
|
|
9084
|
+
var migrateCommand = /* @__PURE__ */ __name((owner) => annotate(new Command("migrate"), { output: { entity: "store_migration" }, effects: LOCAL_WRITE }).summary(`migrate an older ${archive(owner)}`).description("bring the store up to this build's schema, then normalize, index and stem the messages and notes stored before it").option("--no-backup", "migrate even when no rollback copy can be written; older tools then cannot open the store again").action(async function() {
|
|
9005
9085
|
const { renderer } = outputFor(this);
|
|
9086
|
+
const { backup = true } = this.opts();
|
|
9006
9087
|
const path = storePath(environmentOf(this).env ?? process.env);
|
|
9007
9088
|
if (!existsSync10(path)) {
|
|
9008
9089
|
result(this, { path, exists: false });
|
|
@@ -9011,11 +9092,13 @@ var migrateCommand = /* @__PURE__ */ __name((owner) => annotate(new Command("mig
|
|
|
9011
9092
|
}
|
|
9012
9093
|
const answer = await reading(path, (database) => {
|
|
9013
9094
|
const from = schemaOf(database).version;
|
|
9014
|
-
migrate(database, {
|
|
9095
|
+
const notice = migrate(database, {
|
|
9015
9096
|
command: owner.app.command,
|
|
9016
9097
|
version: owner.app.version,
|
|
9017
|
-
rollback: { store: path, warn: /* @__PURE__ */ __name((line) => renderer.warn(line), "warn") }
|
|
9098
|
+
rollback: { store: path, warn: /* @__PURE__ */ __name((line) => renderer.warn(line), "warn"), withoutCopy: !backup }
|
|
9018
9099
|
});
|
|
9100
|
+
if (notice)
|
|
9101
|
+
renderer.warn(notice);
|
|
9019
9102
|
const { normalized, indexed, terms } = buildWordIndex(database, (note) => renderer.note(note));
|
|
9020
9103
|
const stemmed = buildStems(database, (note) => renderer.note(note));
|
|
9021
9104
|
const notes = buildNoteIndex(database, (note) => renderer.note(note));
|
|
@@ -9106,10 +9189,10 @@ var vacuumInto = /* @__PURE__ */ __name(async (path, target) => {
|
|
|
9106
9189
|
}
|
|
9107
9190
|
}, "vacuumInto");
|
|
9108
9191
|
var stampNow = /* @__PURE__ */ __name(() => (/* @__PURE__ */ new Date()).toISOString().replace(/[:.]/g, "-"), "stampNow");
|
|
9109
|
-
var backupCommand = /* @__PURE__ */ __name(() => destroysNothing(annotate(new Command("backup"), { output: { entity: "store_backup" }, effects: LOCAL_WRITE })).description("copy the store into a new file, while it is in use; never overwrites a file").argument("<file>", "the new file").option(...ENCRYPT_OPTION).action(async function(file2) {
|
|
9192
|
+
var backupCommand = /* @__PURE__ */ __name(() => inStoreBackups(destroysNothing(annotate(new Command("backup"), { output: { entity: "store_backup" }, effects: LOCAL_WRITE })), "file").description("copy the store into a new file, while it is in use; never overwrites a file").argument("<file>", "the new file").option(...ENCRYPT_OPTION).action(async function(file2) {
|
|
9110
9193
|
const { encrypt } = this.opts();
|
|
9111
9194
|
const path = storePath(environmentOf(this).env ?? process.env);
|
|
9112
|
-
const target =
|
|
9195
|
+
const target = resolve2(file2);
|
|
9113
9196
|
const { app, env } = environmentOf(this);
|
|
9114
9197
|
if (app)
|
|
9115
9198
|
refuseLockedOutput(target, app, env ?? process.env, "<file>");
|
|
@@ -9146,8 +9229,8 @@ var backupCommand = /* @__PURE__ */ __name(() => destroysNothing(annotate(new Co
|
|
|
9146
9229
|
}), "backupCommand");
|
|
9147
9230
|
var decryptCommand = /* @__PURE__ */ __name(() => annotate(new Command("decrypt"), { output: { entity: "store_decrypt" }, effects: LOCAL_WRITE }).description("open a file written with --encrypt into a new file; asks for its password").argument("<file>", "a file `store backup --encrypt` or `store export --encrypt` wrote").requiredOption("--output <file>", "the new file, readable only by you").action(async function(file2) {
|
|
9148
9231
|
const { output } = this.opts();
|
|
9149
|
-
const from =
|
|
9150
|
-
const to =
|
|
9232
|
+
const from = resolve2(file2);
|
|
9233
|
+
const to = resolve2(output);
|
|
9151
9234
|
if (!existsSync10(from))
|
|
9152
9235
|
throw new CliError("not_found", `no file at ${from}`);
|
|
9153
9236
|
if (!isSealed(from))
|
|
@@ -9157,16 +9240,16 @@ var decryptCommand = /* @__PURE__ */ __name(() => annotate(new Command("decrypt"
|
|
|
9157
9240
|
await unsealFile(from, to, await passwordOf(this, { twice: false }));
|
|
9158
9241
|
result(this, { path: to, from, bytes: bytesOf2(to) });
|
|
9159
9242
|
}), "decryptCommand");
|
|
9160
|
-
var restoreCommand = /* @__PURE__ */ __name((owner) => grantsAuthority(annotate(new Command("restore"), { output: { entity: "store_restore" }, effects: LOCAL_WRITE })).summary("restore a backup and keep the current store, or roll back a breaking upgrade").description("put a backup in place of the store; the store it replaces is kept beside it, never deleted. Given a rollback copy (backups/<store>-rollback-schema-<version>-<time>.db, kept for a day before an upgrade older tools cannot open), put its tables back in the store and return it to that version instead").argument("<file>", "a file `store backup` wrote, or a rollback copy; one written with --encrypt asks for its password").action(async function(file2) {
|
|
9243
|
+
var restoreCommand = /* @__PURE__ */ __name((owner) => inStoreBackups(grantsAuthority(annotate(new Command("restore"), { output: { entity: "store_restore" }, effects: LOCAL_WRITE })), "file").summary("restore a backup and keep the current store, or roll back a breaking upgrade").description("put a backup in place of the store; the store it replaces is kept beside it, never deleted. Given a rollback copy (backups/<store>-rollback-schema-<version>-<time>.db, kept for a day before an upgrade older tools cannot open), put its tables back in the store and return it to that version instead").argument("<file>", "a file `store backup` wrote, or a rollback copy; one written with --encrypt asks for its password").action(async function(file2) {
|
|
9161
9244
|
const path = storePath(environmentOf(this).env ?? process.env);
|
|
9162
|
-
const given =
|
|
9245
|
+
const given = resolve2(file2);
|
|
9163
9246
|
if (!existsSync10(given))
|
|
9164
9247
|
throw new CliError("not_found", `no file at ${given}`);
|
|
9165
9248
|
refuseWhileServing(this, owner);
|
|
9166
9249
|
if (!isSealed(given))
|
|
9167
9250
|
return restoreFrom(this, owner, given, given);
|
|
9168
9251
|
const opened = `${path}.unsealing-${process.pid}`;
|
|
9169
|
-
mkdirSync(
|
|
9252
|
+
mkdirSync(dirname4(path), { recursive: true, mode: 448 });
|
|
9170
9253
|
try {
|
|
9171
9254
|
await unsealFile(given, opened, await passwordOf(this, { twice: false }));
|
|
9172
9255
|
await restoreFrom(this, owner, opened, given);
|
|
@@ -9189,7 +9272,7 @@ var restoreFrom = /* @__PURE__ */ __name(async (command, owner, backup, given) =
|
|
|
9189
9272
|
const waitMs = environmentOf(command).storeLockWaitMs;
|
|
9190
9273
|
await quiesce(path, owner, "restore", (message) => renderer.warn(message), waitMs);
|
|
9191
9274
|
} else
|
|
9192
|
-
mkdirSync(
|
|
9275
|
+
mkdirSync(dirname4(path), { recursive: true, mode: 448 });
|
|
9193
9276
|
const incoming = `${path}.restoring-${stamp}`;
|
|
9194
9277
|
copyFileSync(backup, incoming, constants.COPYFILE_EXCL);
|
|
9195
9278
|
chmodSync(incoming, 384);
|
|
@@ -9407,6 +9490,11 @@ export {
|
|
|
9407
9490
|
checkFor,
|
|
9408
9491
|
passes,
|
|
9409
9492
|
seal,
|
|
9493
|
+
notLocalPaths,
|
|
9494
|
+
isLocalPathOption,
|
|
9495
|
+
isLocalPathArgument,
|
|
9496
|
+
refuseAgentPaths,
|
|
9497
|
+
absoluteFrom,
|
|
9410
9498
|
ENCRYPT_OPTION,
|
|
9411
9499
|
passwordOf,
|
|
9412
9500
|
DAY_MS,
|