@wirecat/zoom-cli 0.71.0 → 0.73.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/contracts/wirecat.json +1478 -0
- package/dist/account-removal.d.ts.map +1 -1
- package/dist/account-removal.js +0 -2
- package/dist/account-removal.js.map +1 -1
- package/dist/answers.d.ts +57 -3
- package/dist/answers.d.ts.map +1 -1
- package/dist/answers.js +0 -3
- package/dist/answers.js.map +1 -1
- package/dist/bin/main.js +13 -5
- package/dist/bin/main.js.map +1 -1
- package/dist/bin/zm.js +2 -2
- package/dist/bundle/{all-profiles-O4YNVPZX.js → all-profiles-V47CUJFK.js} +12 -12
- package/dist/bundle/answer-policy-W6H72X2R.js +112 -0
- package/dist/bundle/{anthropic-7GGRX3RX.js → anthropic-SID7Z3QN.js} +19 -12
- package/dist/bundle/{app-server-CPMKM3HI.js → app-server-KCMUSY4A.js} +75 -57
- package/dist/bundle/{bun-POHZKEPV.js → bun-PWMM6L45.js} +2 -2
- package/dist/bundle/{bun-sqlite-PGYMBPEL.js → bun-sqlite-3TLKUN5A.js} +10 -6
- package/dist/bundle/{chunk-Q3XLZIY3.js → chunk-2BAZRRJP.js} +29 -23
- package/dist/bundle/{chunk-OWEBWDHV.js → chunk-2NQPB6MT.js} +103 -9
- package/dist/bundle/chunk-2PYZTRRC.js +84 -0
- package/dist/bundle/chunk-2VYEGKQ3.js +13 -0
- package/dist/bundle/{chunk-I4DFFR7F.js → chunk-35CYSRGJ.js} +14 -5
- package/dist/bundle/{chunk-GGS6D4W4.js → chunk-3ADFJ3UP.js} +3 -3
- package/dist/bundle/{chunk-EOSVN2ER.js → chunk-3HTJBGNP.js} +242 -242
- package/dist/bundle/{chunk-2KESWII5.js → chunk-44YVZIA4.js} +3 -3
- package/dist/bundle/{chunk-GXF5HFFP.js → chunk-4LFFDUUW.js} +4 -4
- package/dist/bundle/{chunk-WOIHSQAL.js → chunk-4RJL32PF.js} +49 -10
- package/dist/bundle/{chunk-7ROXXRGG.js → chunk-6AO2RSYH.js} +7031 -5279
- package/dist/bundle/{chunk-DIQLXAAZ.js → chunk-6NI4FE5G.js} +6 -8
- package/dist/bundle/{chunk-X277FBTF.js → chunk-6WUTUCKH.js} +3 -3
- package/dist/bundle/{chunk-77TCCHMP.js → chunk-AIEMFRBU.js} +1 -1
- package/dist/bundle/{chunk-MRI6QMZ3.js → chunk-CIUJEQH4.js} +27 -19
- package/dist/bundle/{chunk-CRFOGYDG.js → chunk-CMWFYZ45.js} +2 -2
- package/dist/bundle/{chunk-LE7MDAQG.js → chunk-CQBLPBZU.js} +2 -2
- package/dist/bundle/{chunk-RQG5VOGH.js → chunk-DPSTOVKC.js} +185 -34
- package/dist/bundle/{chunk-4QUFFB2U.js → chunk-DYLYH7VE.js} +4 -4
- package/dist/bundle/{chunk-FEM2JQN2.js → chunk-EA2OB75T.js} +1 -1
- package/dist/bundle/chunk-ERQRY6WZ.js +54 -0
- package/dist/bundle/{chunk-P3XC6EDU.js → chunk-ETQNHS3A.js} +10 -129
- package/dist/bundle/{chunk-IAV5BG3I.js → chunk-EXWZCI5G.js} +1 -1
- package/dist/bundle/{chunk-VW6BF6M7.js → chunk-FIVFP53N.js} +1 -1
- package/dist/bundle/{chunk-DSVZEXYJ.js → chunk-FJMRDRPN.js} +3573 -3347
- package/dist/bundle/{chunk-7QC4M4HS.js → chunk-FT7X74RT.js} +4 -4
- package/dist/bundle/{chunk-ADLS6FVG.js → chunk-FXBHOCJK.js} +1 -1
- package/dist/bundle/{chunk-ZBFL5JPT.js → chunk-FZLJ2G7A.js} +22 -120
- package/dist/bundle/{chunk-GL3MYFMX.js → chunk-G2TSDMTA.js} +5 -5
- package/dist/bundle/{chunk-2FV5JUQU.js → chunk-G3SIY4MQ.js} +47 -40
- package/dist/bundle/{chunk-2U27KIKU.js → chunk-GCZMYDKU.js} +6 -6
- package/dist/bundle/{chunk-CKPCVEXU.js → chunk-HAMDPWEZ.js} +6 -6
- package/dist/bundle/{chunk-OE7EIP5L.js → chunk-HCZYJMBP.js} +1 -1
- package/dist/bundle/{chunk-OORMSM6O.js → chunk-HNWDEDMU.js} +61 -30
- package/dist/bundle/{chunk-FSHCAWZS.js → chunk-HO3GBTIT.js} +13464 -10422
- package/dist/bundle/chunk-IE7YBRUO.js +25 -0
- package/dist/bundle/{chunk-RGJ7OWHU.js → chunk-IJCUAKR5.js} +61 -21
- package/dist/bundle/{chunk-ULDXZ6LH.js → chunk-IKNOTHG2.js} +116 -70
- package/dist/bundle/{chunk-633QXP57.js → chunk-ILDGZBZD.js} +14 -9
- package/dist/bundle/{chunk-CFQF6IGY.js → chunk-JIS34MLC.js} +69 -6
- package/dist/bundle/{chunk-DHWBSXG3.js → chunk-JQF4LM3V.js} +415 -66
- package/dist/bundle/{chunk-4LAQDZXU.js → chunk-K5JFX5TK.js} +953 -210
- package/dist/bundle/{chunk-5LJTU4LY.js → chunk-K7EMVFJ7.js} +115 -113
- package/dist/bundle/chunk-KHBZ4OEP.js +16 -0
- package/dist/bundle/chunk-KK2IVZUQ.js +185 -0
- package/dist/bundle/{chunk-SELXER2Q.js → chunk-KQD4ZVNC.js} +7 -7
- package/dist/bundle/{chunk-VJXHIUFP.js → chunk-KSNJK4QM.js} +13 -13
- package/dist/bundle/{chunk-X4GWR6GO.js → chunk-KUL7S5Y3.js} +376 -10
- package/dist/bundle/{chunk-M76MXMLY.js → chunk-L6YSKCC3.js} +1 -1
- package/dist/bundle/chunk-LQYMN36C.js +73 -0
- package/dist/bundle/{chunk-USQ23X5V.js → chunk-LSVQCI6V.js} +751 -735
- package/dist/bundle/{chunk-DRBQDCDU.js → chunk-LVDTSCIN.js} +39 -122
- package/dist/bundle/{chunk-P3ASN72F.js → chunk-M4OP5ASJ.js} +1 -1
- package/dist/bundle/chunk-MAE5UGRQ.js +301 -0
- package/dist/bundle/{chunk-CT4WVR4N.js → chunk-MG2CCAVG.js} +3 -3
- package/dist/bundle/chunk-MOKEB656.js +71 -0
- package/dist/bundle/{chunk-BGTEVIW4.js → chunk-N3SOTKXC.js} +6 -6
- package/dist/bundle/{chunk-VRH7VRTK.js → chunk-NBA2V6LB.js} +10 -15
- package/dist/bundle/{chunk-5J4AMBMM.js → chunk-OFA22L4G.js} +4 -4
- package/dist/bundle/chunk-OKOJEBHK.js +106 -0
- package/dist/bundle/{chunk-Q5PI72CR.js → chunk-OMLVWOEF.js} +7 -2
- package/dist/bundle/{chunk-DK6ICIGL.js → chunk-OU5OXA6Q.js} +2150 -1312
- package/dist/bundle/{chunk-QVSLSWAL.js → chunk-P4FU6R3Z.js} +27 -152
- package/dist/bundle/{chunk-YPO2U2YB.js → chunk-PACLT6IW.js} +363 -115
- package/dist/bundle/{chunk-BBTQIVFP.js → chunk-PGPHEC2X.js} +2 -2
- package/dist/bundle/chunk-PJ3FKBXG.js +18 -0
- package/dist/bundle/{chunk-X3ZDN3U7.js → chunk-PKON63JH.js} +2 -2
- package/dist/bundle/{chunk-Q2SUFGSH.js → chunk-Q43KX56Z.js} +2 -2
- package/dist/bundle/{chunk-XI3VIQKW.js → chunk-QS6DWXDB.js} +569 -537
- package/dist/bundle/{chunk-INVTDIF6.js → chunk-QVJMFZFW.js} +1 -1
- package/dist/bundle/{chunk-QTHIU7CO.js → chunk-QWGEOQHA.js} +3 -2
- package/dist/bundle/{chunk-N2FNMION.js → chunk-R5FTCNLJ.js} +1 -1
- package/dist/bundle/{chunk-MW4EGDDV.js → chunk-SO52EJ2W.js} +2 -2
- package/dist/bundle/{chunk-HB6XJQ3Y.js → chunk-SYIOT45G.js} +5 -5
- package/dist/bundle/{chunk-4QPQ7MDA.js → chunk-TI2OANJZ.js} +1 -1
- package/dist/bundle/{chunk-ALIT5QFT.js → chunk-UIKVP23D.js} +1 -1
- package/dist/bundle/{chunk-OHWMIUCT.js → chunk-USIMMGWS.js} +244 -245
- package/dist/bundle/{chunk-MEED7YFG.js → chunk-UYBLNGZ2.js} +8 -2
- package/dist/bundle/{chunk-IED3NS7G.js → chunk-V5Q2QKYM.js} +29 -36
- package/dist/bundle/{chunk-54YDWBYG.js → chunk-VJVYGTPM.js} +15 -2
- package/dist/bundle/{chunk-5K7OGPGA.js → chunk-VPPNYUQM.js} +8 -8
- package/dist/bundle/{chunk-ZBKWRYRS.js → chunk-X2FILY5F.js} +3 -3
- package/dist/bundle/{chunk-2RUAMDVV.js → chunk-XLY7V2LB.js} +14 -14
- package/dist/bundle/chunk-XWBPP2HX.js +2 -0
- package/dist/bundle/{chunk-ZVI6TFQR.js → chunk-Y3IH7EZC.js} +17 -17
- package/dist/bundle/{chunk-YD2RYVMK.js → chunk-Z5XCU4S7.js} +46 -40
- package/dist/bundle/{chunk-RN4EHCC5.js → chunk-ZAIE3G5I.js} +3 -3
- package/dist/bundle/{chunk-2U6SER67.js → chunk-ZMHZ6CQS.js} +2 -2
- package/dist/bundle/{chunk-64ZHF6PJ.js → chunk-ZVQDOKDY.js} +3 -1
- package/dist/bundle/{chunk-TM4JSVGQ.js → chunk-ZX4QWTMQ.js} +42 -43
- package/dist/bundle/{cli-KHMEUXNG.js → cli-4ZYJ6OZE.js} +158 -88
- package/dist/bundle/command-contract-FJDDCHYP.js +43 -0
- package/dist/bundle/command-server-entry-CASONRIJ.js +173 -0
- package/dist/bundle/config-4DZHX2WX.js +99 -0
- package/dist/bundle/{decode-7RP4HSVE.js → decode-KEFCVGEB.js} +6 -6
- package/dist/bundle/{dispatch-IZCAK47P.js → dispatch-EU67WGME.js} +11 -11
- package/dist/bundle/{dist-BFT2SUBV.js → dist-GCQ7KCKN.js} +55 -30
- package/dist/bundle/{echarts-T2BSQ2YV.js → echarts-SDZA2SWG.js} +2 -2
- package/dist/bundle/{embed-BAS6YPDT.js → embed-43VJEPM6.js} +7 -7
- package/dist/bundle/{embedder-5XD5FCAO.js → embedder-Q4ZHAGRP.js} +10 -10
- package/dist/bundle/{failure-R2OIHCE5.js → failure-CTJLEB2R.js} +3 -3
- package/dist/bundle/first-run-CPOLQVNA.js +29 -0
- package/dist/bundle/first-screen-XYESRGWW.js +41 -0
- package/dist/bundle/folders-MSBTAPAG.js +24 -0
- package/dist/bundle/{instructions-XZPROPKY.js → instructions-7T6JJIFS.js} +1 -1
- package/dist/bundle/{main-TZXKGL3L.js → main-NA3QVPXS.js} +39 -25
- package/dist/bundle/{mcp-M4QN2E7R.js → mcp-TDKGDB4V.js} +2 -2
- package/dist/bundle/{meetings-JB2ISPND.js → meetings-7CVIQJTA.js} +9 -7
- package/dist/bundle/{node-A3B3MJWX.js → node-BZDMUFTW.js} +2 -2
- package/dist/bundle/{node-P4E63KXA.js → node-KM3CUABH.js} +9 -9
- package/dist/bundle/{node-sqlite-QVWDLGDX.js → node-sqlite-QHGB23B4.js} +11 -7
- package/dist/bundle/{oauth-YA6IYV4O.js → oauth-BMEMCM2I.js} +8 -8
- package/dist/bundle/{open-SY7TXJBS.js → open-JGU2NRJP.js} +6 -6
- package/dist/bundle/openai-VTXXFNCS.js +28 -0
- package/dist/bundle/{output-file-YGQYZCBJ.js → output-file-VDOCYH2G.js} +6 -6
- package/dist/bundle/{process-6HNBTJIY.js → process-756VBE7E.js} +1 -1
- package/dist/bundle/{program-77BUCJ4H.js → program-XM6CDIJ2.js} +134 -129
- package/dist/bundle/{prompt-YDG73YDS.js → prompt-2IPFXJ4B.js} +6 -6
- package/dist/bundle/{recognize-ECXDGTB7.js → recognize-672E2RIB.js} +5 -5
- package/dist/bundle/{remote-K4JHGBVJ.js → remote-YLHRVPDS.js} +11 -8
- package/dist/bundle/{rerank-IU2YYD4T.js → rerank-NBXQG3OS.js} +8 -8
- package/dist/bundle/run-log-3WITBT2F.js +126 -0
- package/dist/bundle/{serve-3XWIF3HI.js → serve-FNLOUMYP.js} +10 -10
- package/dist/bundle/{server-56VYOHWP.js → server-7ZB5AK5H.js} +53 -47
- package/dist/bundle/server-GGRGD4SH.js +77 -0
- package/dist/bundle/{services-X7IPEGQ5.js → services-Z4UWN64R.js} +56 -37
- package/dist/bundle/{speech-E2OBQWYA.js → speech-XSYVCKR3.js} +17 -14
- package/dist/bundle/sqlite-runtime-GAPXJNWU.js +20 -0
- package/dist/bundle/{state-4GMJYK4H.js → state-QSA53EF5.js} +7 -7
- package/dist/bundle/{store-LA4TV4DM.js → store-EKI4OAJH.js} +22 -19
- package/dist/bundle/{store-KPI7GB5Y.js → store-NOF5EYUC.js} +38 -21
- package/dist/bundle/store-connection-2OZQGEIO.js +92 -0
- package/dist/bundle/store-maintenance-command-GNX3SOZ6.js +67 -0
- package/dist/bundle/{streaming-EJ3NM2C2.js → streaming-PQEXKTE5.js} +7 -7
- package/dist/bundle/tokens-WJQYQ3FK.js +24 -0
- package/dist/bundle/zm.js +34 -10
- package/dist/bundle/{zoom-app-QEJBTIJ4.js → zoom-app-Y7RMWLVU.js} +9 -8
- package/dist/folders.d.ts +12 -2
- package/dist/folders.d.ts.map +1 -1
- package/dist/folders.js +81 -3
- package/dist/folders.js.map +1 -1
- package/dist/identity.d.ts +5 -0
- package/dist/identity.d.ts.map +1 -1
- package/dist/identity.js +14 -0
- package/dist/identity.js.map +1 -1
- package/dist/recording-schedule-setup.d.ts.map +1 -1
- package/dist/recording-schedule-setup.js +4 -7
- package/dist/recording-schedule-setup.js.map +1 -1
- package/dist/remote-http.d.ts +1 -1
- package/dist/remote-http.d.ts.map +1 -1
- package/dist/remote-http.js +21 -23
- package/dist/remote-http.js.map +1 -1
- package/dist/setup-commands.d.ts.map +1 -1
- package/dist/setup-commands.js +2 -4
- package/dist/setup-commands.js.map +1 -1
- package/dist/tokens.d.ts +17 -2
- package/dist/tokens.d.ts.map +1 -1
- package/dist/tokens.js +109 -29
- package/dist/tokens.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/dist/wcat.d.ts +3 -0
- package/dist/wcat.d.ts.map +1 -0
- package/dist/wcat.js +4 -0
- package/dist/wcat.js.map +1 -0
- package/package.json +15 -14
- package/dist/bundle/answer-policy-PPSPMCLH.js +0 -104
- package/dist/bundle/chunk-KMV7GZB6.js +0 -35
- package/dist/bundle/chunk-UG447QY2.js +0 -27
- package/dist/bundle/chunk-XRFHQGOD.js +0 -17
- package/dist/bundle/command-contract-4K6XXZYE.js +0 -41
- package/dist/bundle/config-EEDB632I.js +0 -90
- package/dist/bundle/first-run-23WWZ2PW.js +0 -28
- package/dist/bundle/first-screen-6HFUYVFR.js +0 -39
- package/dist/bundle/folders-ZXTOFY4T.js +0 -16
- package/dist/bundle/openai-2AU24NRN.js +0 -25
- package/dist/bundle/run-log-LFEXNZ74.js +0 -118
- package/dist/bundle/server-YSTMUZ22.js +0 -72
- package/dist/bundle/store-connection-AZTIF6IH.js +0 -83
- package/dist/bundle/store-maintenance-command-LR572PS4.js +0 -61
- package/dist/bundle/tokens-BE6CJMR5.js +0 -20
- /package/dist/bundle/{chunk-VOXIGICJ.js → chunk-7O7XM37N.js} +0 -0
|
@@ -1,12 +1,9 @@
|
|
|
1
1
|
import { createRequire as __bundleRequire } from "node:module";
|
|
2
2
|
const require = __bundleRequire(import.meta.url);
|
|
3
|
-
import {
|
|
4
|
-
renderMessages
|
|
5
|
-
} from "./chunk-X3ZDN3U7.js";
|
|
6
3
|
import {
|
|
7
4
|
answerOf,
|
|
8
5
|
messengerContext
|
|
9
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-G3SIY4MQ.js";
|
|
10
7
|
import {
|
|
11
8
|
chatEventAnswer,
|
|
12
9
|
memberAnswer,
|
|
@@ -15,14 +12,17 @@ import {
|
|
|
15
12
|
serveRelay,
|
|
16
13
|
typedQuery,
|
|
17
14
|
withQuery
|
|
18
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-2BAZRRJP.js";
|
|
16
|
+
import {
|
|
17
|
+
renderMessages
|
|
18
|
+
} from "./chunk-PKON63JH.js";
|
|
19
19
|
import {
|
|
20
20
|
holdLock,
|
|
21
21
|
lockPath,
|
|
22
22
|
releaseLock,
|
|
23
23
|
servingProfiles,
|
|
24
24
|
takeLock
|
|
25
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-3ADFJ3UP.js";
|
|
26
26
|
import {
|
|
27
27
|
FETCHING,
|
|
28
28
|
RULES_VERSION,
|
|
@@ -35,11 +35,14 @@ import {
|
|
|
35
35
|
onlineDeps,
|
|
36
36
|
openRequestTask,
|
|
37
37
|
patiently,
|
|
38
|
+
refuseLockedOutput,
|
|
38
39
|
senderIsMe,
|
|
39
40
|
servicesFor,
|
|
40
|
-
syncsOneChat
|
|
41
|
+
syncsOneChat
|
|
42
|
+
} from "./chunk-OU5OXA6Q.js";
|
|
43
|
+
import {
|
|
41
44
|
withTimeLimit
|
|
42
|
-
} from "./chunk-
|
|
45
|
+
} from "./chunk-IE7YBRUO.js";
|
|
43
46
|
import {
|
|
44
47
|
QUICK_HEALTH_CHECKS,
|
|
45
48
|
fts5Tables,
|
|
@@ -47,7 +50,7 @@ import {
|
|
|
47
50
|
lossUnknown,
|
|
48
51
|
storeDamageReport,
|
|
49
52
|
storeHealth
|
|
50
|
-
} from "./chunk-
|
|
53
|
+
} from "./chunk-Y3IH7EZC.js";
|
|
51
54
|
import {
|
|
52
55
|
Command,
|
|
53
56
|
LOCAL_READ,
|
|
@@ -55,8 +58,10 @@ import {
|
|
|
55
58
|
REMOTE_READ,
|
|
56
59
|
REMOTE_WRITE,
|
|
57
60
|
annotate,
|
|
61
|
+
commandAt,
|
|
58
62
|
destroysNothing,
|
|
59
63
|
environmentOf,
|
|
64
|
+
grantsAuthority,
|
|
60
65
|
itemOf,
|
|
61
66
|
jsonlRecords,
|
|
62
67
|
lineOf,
|
|
@@ -69,18 +74,25 @@ import {
|
|
|
69
74
|
snakeKeys,
|
|
70
75
|
storeTable,
|
|
71
76
|
withoutProviderRefs
|
|
72
|
-
} from "./chunk-
|
|
77
|
+
} from "./chunk-FJMRDRPN.js";
|
|
73
78
|
import {
|
|
74
79
|
holdersOf
|
|
75
|
-
} from "./chunk-
|
|
80
|
+
} from "./chunk-UIKVP23D.js";
|
|
76
81
|
import {
|
|
77
82
|
codeOf,
|
|
78
83
|
modelTarget,
|
|
79
84
|
parseDuration
|
|
80
|
-
} from "./chunk-
|
|
85
|
+
} from "./chunk-USIMMGWS.js";
|
|
81
86
|
import {
|
|
82
87
|
levelFor
|
|
83
|
-
} from "./chunk-
|
|
88
|
+
} from "./chunk-OMLVWOEF.js";
|
|
89
|
+
import {
|
|
90
|
+
modelAddressAllowed,
|
|
91
|
+
onThisComputer
|
|
92
|
+
} from "./chunk-LQYMN36C.js";
|
|
93
|
+
import {
|
|
94
|
+
readSecret
|
|
95
|
+
} from "./chunk-ZAIE3G5I.js";
|
|
84
96
|
import {
|
|
85
97
|
CORPORA,
|
|
86
98
|
MIGRATIONS,
|
|
@@ -115,44 +127,49 @@ import {
|
|
|
115
127
|
storeClients,
|
|
116
128
|
storeContents,
|
|
117
129
|
vectorIndexCounts
|
|
118
|
-
} from "./chunk-
|
|
130
|
+
} from "./chunk-HO3GBTIT.js";
|
|
119
131
|
import {
|
|
120
132
|
currentRun,
|
|
121
133
|
readDamageMark,
|
|
122
134
|
readHealthMark,
|
|
123
135
|
readJournalMark,
|
|
124
136
|
recordDeepCheck
|
|
125
|
-
} from "./chunk-
|
|
137
|
+
} from "./chunk-LSVQCI6V.js";
|
|
126
138
|
import {
|
|
127
139
|
failureKey,
|
|
128
140
|
isStoreDamage
|
|
129
|
-
} from "./chunk-
|
|
141
|
+
} from "./chunk-UYBLNGZ2.js";
|
|
130
142
|
import {
|
|
131
143
|
formatLocator,
|
|
132
144
|
parseLocator
|
|
133
|
-
} from "./chunk-
|
|
145
|
+
} from "./chunk-QS6DWXDB.js";
|
|
134
146
|
import {
|
|
135
|
-
|
|
136
|
-
|
|
147
|
+
readSharedSection,
|
|
148
|
+
sharedConfigPath,
|
|
149
|
+
writeSharedSection
|
|
150
|
+
} from "./chunk-VPPNYUQM.js";
|
|
137
151
|
import {
|
|
138
152
|
storePath
|
|
139
|
-
} from "./chunk-
|
|
153
|
+
} from "./chunk-ERQRY6WZ.js";
|
|
140
154
|
import {
|
|
141
155
|
openCache
|
|
142
|
-
} from "./chunk-
|
|
156
|
+
} from "./chunk-N3SOTKXC.js";
|
|
143
157
|
import {
|
|
144
158
|
queryFieldsOf
|
|
145
|
-
} from "./chunk-
|
|
159
|
+
} from "./chunk-3HTJBGNP.js";
|
|
146
160
|
import {
|
|
161
|
+
Credentials,
|
|
162
|
+
isMovedRun,
|
|
147
163
|
resolvePaths,
|
|
148
164
|
writeSecurely
|
|
149
|
-
} from "./chunk-
|
|
165
|
+
} from "./chunk-HNWDEDMU.js";
|
|
150
166
|
import {
|
|
151
167
|
array,
|
|
152
168
|
boolean,
|
|
153
169
|
check,
|
|
154
170
|
forward,
|
|
155
171
|
getDotPath,
|
|
172
|
+
maxLength,
|
|
156
173
|
minLength,
|
|
157
174
|
nullable,
|
|
158
175
|
object,
|
|
@@ -167,10 +184,10 @@ import {
|
|
|
167
184
|
string,
|
|
168
185
|
transform,
|
|
169
186
|
trim
|
|
170
|
-
} from "./chunk-
|
|
187
|
+
} from "./chunk-4RJL32PF.js";
|
|
171
188
|
import {
|
|
172
189
|
CliError
|
|
173
|
-
} from "./chunk-
|
|
190
|
+
} from "./chunk-EA2OB75T.js";
|
|
174
191
|
import {
|
|
175
192
|
__commonJS,
|
|
176
193
|
__name,
|
|
@@ -5510,11 +5527,11 @@ var require_liquid_node = __commonJS({
|
|
|
5510
5527
|
}
|
|
5511
5528
|
});
|
|
5512
5529
|
|
|
5513
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
5530
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.656.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_dceb8977715cf47b69a8fd97c630c977/node_modules/@wirecat/cli-core/dist/cli/messenger/store-maintenance-command.js
|
|
5514
5531
|
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";
|
|
5515
5532
|
import { dirname as dirname3, resolve } from "node:path";
|
|
5516
5533
|
|
|
5517
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
5534
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.656.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_dceb8977715cf47b69a8fd97c630c977/node_modules/@wirecat/cli-core/dist/sealed.js
|
|
5518
5535
|
import { createCipheriv, createDecipheriv, createHash, randomBytes, scrypt, timingSafeEqual } from "node:crypto";
|
|
5519
5536
|
import { closeSync, createReadStream, createWriteStream, existsSync, openSync, readSync, renameSync, rmSync, statSync } from "node:fs";
|
|
5520
5537
|
import { Transform } from "node:stream";
|
|
@@ -5621,7 +5638,7 @@ var unsealFile = /* @__PURE__ */ __name(async (from, to, password) => {
|
|
|
5621
5638
|
renameSync(pending, to);
|
|
5622
5639
|
}, "unsealFile");
|
|
5623
5640
|
|
|
5624
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
5641
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.656.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_dceb8977715cf47b69a8fd97c630c977/node_modules/@wirecat/cli-core/dist/store/compatibility.js
|
|
5625
5642
|
var SPEAKS = MIGRATIONS.at(-1)?.version ?? 0;
|
|
5626
5643
|
var fileSchemaOf = /* @__PURE__ */ __name((database) => {
|
|
5627
5644
|
const tracked = database.prepare("SELECT 1 FROM sqlite_master WHERE name = 'schema_migrations'").get();
|
|
@@ -5645,7 +5662,7 @@ var compatibilityOf = /* @__PURE__ */ __name((file2, migrations = MIGRATIONS) =>
|
|
|
5645
5662
|
};
|
|
5646
5663
|
}, "compatibilityOf");
|
|
5647
5664
|
|
|
5648
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
5665
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.656.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_dceb8977715cf47b69a8fd97c630c977/node_modules/@wirecat/cli-core/dist/store/repair.js
|
|
5649
5666
|
import { createHash as createHash2 } from "node:crypto";
|
|
5650
5667
|
var COPY_MARK = "__repair_";
|
|
5651
5668
|
var COPY_NAME = /__repair_[0-9a-f]{8}(_\d+)?$/;
|
|
@@ -5899,19 +5916,19 @@ var deleteCopy = /* @__PURE__ */ __name((database, name) => {
|
|
|
5899
5916
|
return found;
|
|
5900
5917
|
}, "deleteCopy");
|
|
5901
5918
|
|
|
5902
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
5919
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.656.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_dceb8977715cf47b69a8fd97c630c977/node_modules/@wirecat/cli-core/dist/cli/store-info.js
|
|
5903
5920
|
import { existsSync as existsSync4, statSync as statSync3 } from "node:fs";
|
|
5904
5921
|
|
|
5905
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
5922
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.656.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_dceb8977715cf47b69a8fd97c630c977/node_modules/@wirecat/cli-core/dist/cli/store-recover.js
|
|
5906
5923
|
import { existsSync as existsSync3 } from "node:fs";
|
|
5907
5924
|
|
|
5908
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
5925
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.656.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_dceb8977715cf47b69a8fd97c630c977/node_modules/@wirecat/cli-core/dist/store/recover.js
|
|
5909
5926
|
import { execFileSync, spawn } from "node:child_process";
|
|
5910
5927
|
import { existsSync as existsSync2, readFileSync, realpathSync, renameSync as renameSync2, rmSync as rmSync2, statfsSync, statSync as statSync2, writeFileSync } from "node:fs";
|
|
5911
5928
|
import { basename, dirname, join } from "node:path";
|
|
5912
5929
|
import { Transform as Transform2 } from "node:stream";
|
|
5913
5930
|
|
|
5914
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
5931
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.656.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_dceb8977715cf47b69a8fd97c630c977/node_modules/@wirecat/cli-core/dist/store/refill.js
|
|
5915
5932
|
var REFILL_MARGIN_MS = 864e5;
|
|
5916
5933
|
var TIME_KEYS = 1e12;
|
|
5917
5934
|
var integerId = `external_id GLOB '[0-9]*' AND NOT external_id GLOB '*[^0-9]*'`;
|
|
@@ -5991,7 +6008,7 @@ var forgetMail = /* @__PURE__ */ __name((database, cutoff, now) => {
|
|
|
5991
6008
|
return [...folders].map(([account, count3]) => ({ account, folders: count3 }));
|
|
5992
6009
|
}, "forgetMail");
|
|
5993
6010
|
|
|
5994
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
6011
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.656.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_dceb8977715cf47b69a8fd97c630c977/node_modules/@wirecat/cli-core/dist/store/recover.js
|
|
5995
6012
|
var SQLITE3_MINIMUM = [3, 43, 0];
|
|
5996
6013
|
var STORE_PARTS = ["", "-wal", "-shm"];
|
|
5997
6014
|
var RECOVER_LOCK = ".recover-lock";
|
|
@@ -6519,7 +6536,7 @@ var recoverLocked = /* @__PURE__ */ __name(async ({ path, command, version, sqli
|
|
|
6519
6536
|
}
|
|
6520
6537
|
}, "recoverLocked");
|
|
6521
6538
|
|
|
6522
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
6539
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.656.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_dceb8977715cf47b69a8fd97c630c977/node_modules/@wirecat/cli-core/dist/cli/store-recover.js
|
|
6523
6540
|
var COUNTED = [
|
|
6524
6541
|
"accounts",
|
|
6525
6542
|
"chats",
|
|
@@ -6660,7 +6677,7 @@ var storeRecoverCommand = /* @__PURE__ */ __name(({ command, version }) => {
|
|
|
6660
6677
|
for (const line of recoveryNotes(answer))
|
|
6661
6678
|
output.renderer.note(line);
|
|
6662
6679
|
});
|
|
6663
|
-
recover.addCommand(annotate(new Command("run"), { effects: LOCAL_WRITE, examples: [`${command} store recover run`] }).summary("rebuild a damaged store from every row it can read").description("copy every readable row into a new file with the sqlite3 program, rebuild the search indexes, mentions and vector index, check it, and put it in place of the store; the damaged file is kept beside it. Refuses while a WireCat timer or process has the store").action(async function() {
|
|
6680
|
+
recover.addCommand(grantsAuthority(annotate(new Command("run"), { effects: LOCAL_WRITE, examples: [`${command} store recover run`] })).summary("rebuild a damaged store from every row it can read").description("copy every readable row into a new file with the sqlite3 program, rebuild the search indexes, mentions and vector index, check it, and put it in place of the store; the damaged file is kept beside it. Refuses while a WireCat timer or process has the store").action(async function() {
|
|
6664
6681
|
const output = outputFor(this);
|
|
6665
6682
|
const answer = await storeRecoveryRun(environmentOf(this).env ?? process.env, {
|
|
6666
6683
|
command,
|
|
@@ -6675,7 +6692,7 @@ var storeRecoverCommand = /* @__PURE__ */ __name(({ command, version }) => {
|
|
|
6675
6692
|
return recover;
|
|
6676
6693
|
}, "storeRecoverCommand");
|
|
6677
6694
|
|
|
6678
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
6695
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.656.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_dceb8977715cf47b69a8fd97c630c977/node_modules/@wirecat/cli-core/dist/cli/store-info.js
|
|
6679
6696
|
var pendingIfKnown = /* @__PURE__ */ __name((database) => database.prepare("SELECT 1 FROM pragma_table_info('messages') WHERE name = 'normalized_text'").get() ? pendingNormalization(database) : null, "pendingIfKnown");
|
|
6680
6697
|
var bytesOf = /* @__PURE__ */ __name((path) => existsSync4(path) ? statSync3(path).size : 0, "bytesOf");
|
|
6681
6698
|
var messageOf = /* @__PURE__ */ __name((error) => error instanceof Error ? error.message : String(error), "messageOf");
|
|
@@ -6725,7 +6742,7 @@ var sharedStoreCommand = /* @__PURE__ */ __name((app) => {
|
|
|
6725
6742
|
return app ? store.addCommand(storeRecoverCommand(app)) : store;
|
|
6726
6743
|
}, "sharedStoreCommand");
|
|
6727
6744
|
|
|
6728
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
6745
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.656.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_dceb8977715cf47b69a8fd97c630c977/node_modules/@wirecat/cli-core/dist/cli/messenger/password.js
|
|
6729
6746
|
var ENCRYPT_OPTION = [
|
|
6730
6747
|
"--encrypt",
|
|
6731
6748
|
"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"
|
|
@@ -6744,7 +6761,7 @@ var passwordOf = /* @__PURE__ */ __name(async (command, { twice }) => {
|
|
|
6744
6761
|
return password;
|
|
6745
6762
|
}, "passwordOf");
|
|
6746
6763
|
|
|
6747
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
6764
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.656.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_dceb8977715cf47b69a8fd97c630c977/node_modules/@wirecat/cli-core/dist/replies/rules.js
|
|
6748
6765
|
import { existsSync as existsSync5, readFileSync as readFileSync2 } from "node:fs";
|
|
6749
6766
|
import { join as join2 } from "node:path";
|
|
6750
6767
|
var REPLY_ACTIONS = ["reply", "task"];
|
|
@@ -6915,7 +6932,7 @@ var problem = /* @__PURE__ */ __name((issue) => {
|
|
|
6915
6932
|
}, "problem");
|
|
6916
6933
|
var broken = /* @__PURE__ */ __name((path, why) => new CliError("configuration_error", `the reply rules ${path} cannot be read (${why}) \u2014 fix the file`), "broken");
|
|
6917
6934
|
|
|
6918
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
6935
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.656.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_dceb8977715cf47b69a8fd97c630c977/node_modules/@wirecat/cli-core/dist/replies/state.js
|
|
6919
6936
|
import { existsSync as existsSync6, readFileSync as readFileSync3 } from "node:fs";
|
|
6920
6937
|
import { join as join3 } from "node:path";
|
|
6921
6938
|
var ANSWERED_KEPT = 1e3;
|
|
@@ -6968,7 +6985,7 @@ var recordReply = /* @__PURE__ */ __name((state, rule2, message, now) => {
|
|
|
6968
6985
|
}, "recordReply");
|
|
6969
6986
|
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");
|
|
6970
6987
|
|
|
6971
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
6988
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.656.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_dceb8977715cf47b69a8fd97c630c977/node_modules/@wirecat/cli-core/dist/replies/decide.js
|
|
6972
6989
|
var skip = /* @__PURE__ */ __name((why) => ({ skip: why }), "skip");
|
|
6973
6990
|
var decide = /* @__PURE__ */ __name((rule2, incoming, state, now) => {
|
|
6974
6991
|
const { message, chat, owner, sender } = incoming;
|
|
@@ -7074,10 +7091,10 @@ var filled = /* @__PURE__ */ __name((template2, senderName) => {
|
|
|
7074
7091
|
return template2.replaceAll("{firstName}", name.split(/\s+/)[0] ?? name).replaceAll("{name}", name);
|
|
7075
7092
|
}, "filled");
|
|
7076
7093
|
|
|
7077
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
7094
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.656.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_dceb8977715cf47b69a8fd97c630c977/node_modules/@wirecat/cli-core/dist/replies/template.js
|
|
7078
7095
|
var import_liquidjs2 = __toESM(require_liquid_node(), 1);
|
|
7079
7096
|
|
|
7080
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
7097
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.656.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_dceb8977715cf47b69a8fd97c630c977/node_modules/@wirecat/cli-core/dist/render/liquid.js
|
|
7081
7098
|
var import_liquidjs = __toESM(require_liquid_node(), 1);
|
|
7082
7099
|
var safeLiquid = /* @__PURE__ */ __name((limits) => {
|
|
7083
7100
|
const engine = new import_liquidjs.Liquid({
|
|
@@ -7104,7 +7121,7 @@ var safeLiquid = /* @__PURE__ */ __name((limits) => {
|
|
|
7104
7121
|
return engine;
|
|
7105
7122
|
}, "safeLiquid");
|
|
7106
7123
|
|
|
7107
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
7124
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.656.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_dceb8977715cf47b69a8fd97c630c977/node_modules/@wirecat/cli-core/dist/replies/template.js
|
|
7108
7125
|
var TEMPLATE_LIMITS = {
|
|
7109
7126
|
parse: 32768,
|
|
7110
7127
|
renders: 2e3,
|
|
@@ -7243,7 +7260,7 @@ var renderReplyTemplate = /* @__PURE__ */ __name(async (reply, input) => {
|
|
|
7243
7260
|
}
|
|
7244
7261
|
}, "renderReplyTemplate");
|
|
7245
7262
|
|
|
7246
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
7263
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.656.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_dceb8977715cf47b69a8fd97c630c977/node_modules/@wirecat/cli-core/dist/replies/dry-run.js
|
|
7247
7264
|
var DRY_RUN_DAYS = 7;
|
|
7248
7265
|
var PAGE = 500;
|
|
7249
7266
|
var dryRun = /* @__PURE__ */ __name(async (store, account, rules, { since, until = Date.now(), only, audience, render }) => {
|
|
@@ -7357,7 +7374,192 @@ var storedSince = /* @__PURE__ */ __name(async (store, account, chat, since) =>
|
|
|
7357
7374
|
}
|
|
7358
7375
|
}, "storedSince");
|
|
7359
7376
|
|
|
7360
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
7377
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.656.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_dceb8977715cf47b69a8fd97c630c977/node_modules/@wirecat/cli-core/dist/models/ai.js
|
|
7378
|
+
var AI_PROVIDERS = ["anthropic", "openai", "ollama"];
|
|
7379
|
+
var DEFAULT_BASE_URL = {
|
|
7380
|
+
anthropic: "https://api.anthropic.com",
|
|
7381
|
+
openai: "https://api.openai.com/v1",
|
|
7382
|
+
ollama: "http://127.0.0.1:11434/v1"
|
|
7383
|
+
};
|
|
7384
|
+
var OFFICIAL = {
|
|
7385
|
+
"https://api.openai.com": "openai",
|
|
7386
|
+
"https://api.anthropic.com": "anthropic"
|
|
7387
|
+
};
|
|
7388
|
+
var SECTION = "ai";
|
|
7389
|
+
var aiAddressAllowed = modelAddressAllowed;
|
|
7390
|
+
var consentShape = strictObject({
|
|
7391
|
+
origin: string(),
|
|
7392
|
+
model: string(),
|
|
7393
|
+
at: string()
|
|
7394
|
+
});
|
|
7395
|
+
var settingShape = strictObject({
|
|
7396
|
+
provider: picklist(AI_PROVIDERS),
|
|
7397
|
+
model: pipe(string(), trim(), minLength(1), maxLength(200)),
|
|
7398
|
+
base_url: optional(pipe(string(), check(aiAddressAllowed, "use https, or http only on this computer"))),
|
|
7399
|
+
images: optional(consentShape)
|
|
7400
|
+
});
|
|
7401
|
+
var aiSettingPath = /* @__PURE__ */ __name((env) => sharedConfigPath(storePath(env), env), "aiSettingPath");
|
|
7402
|
+
var readAiSetting = /* @__PURE__ */ __name((path) => {
|
|
7403
|
+
const section = readSharedSection(path, SECTION);
|
|
7404
|
+
if (section === void 0)
|
|
7405
|
+
return void 0;
|
|
7406
|
+
const checked = safeParse(settingShape, section);
|
|
7407
|
+
if (!checked.success)
|
|
7408
|
+
throw new CliError("configuration_error", `${path}: ai.${getDotPath(checked.issues[0]) ?? "setting"} is invalid`, {
|
|
7409
|
+
reason: "ai.setting-invalid"
|
|
7410
|
+
});
|
|
7411
|
+
return checked.output;
|
|
7412
|
+
}, "readAiSetting");
|
|
7413
|
+
var writeAiSetting = /* @__PURE__ */ __name((path, setting) => writeSharedSection(path, SECTION, setting), "writeAiSetting");
|
|
7414
|
+
var aiSettingOf = /* @__PURE__ */ __name((given) => {
|
|
7415
|
+
const draft = {
|
|
7416
|
+
provider: given.provider,
|
|
7417
|
+
model: given.model,
|
|
7418
|
+
...given.baseUrl?.trim() ? { base_url: given.baseUrl.trim().replace(/\/+$/, "") } : {}
|
|
7419
|
+
};
|
|
7420
|
+
const checked = safeParse(settingShape, draft);
|
|
7421
|
+
if (!checked.success) {
|
|
7422
|
+
const field = getDotPath(checked.issues[0]);
|
|
7423
|
+
throw new CliError("validation_error", field === "provider" ? `the provider is one of ${AI_PROVIDERS.join(", ")}` : field === "base_url" ? "this address is not allowed: use https, or http only on this computer" : "name the model, 1 to 200 characters", { reason: field === "base_url" ? "model.address-refused" : "ai.setting-invalid" });
|
|
7424
|
+
}
|
|
7425
|
+
if (checked.output.provider === "ollama" && !onThisComputer(aiBaseUrl(checked.output)))
|
|
7426
|
+
throw new CliError("validation_error", "Ollama is read only on this computer", { reason: "model.address-refused" });
|
|
7427
|
+
return given.allowImages ? {
|
|
7428
|
+
...checked.output,
|
|
7429
|
+
images: { origin: aiOrigin(checked.output), model: checked.output.model, at: (/* @__PURE__ */ new Date()).toISOString() }
|
|
7430
|
+
} : checked.output;
|
|
7431
|
+
}, "aiSettingOf");
|
|
7432
|
+
var aiBaseUrl = /* @__PURE__ */ __name((setting) => setting.base_url ?? DEFAULT_BASE_URL[setting.provider], "aiBaseUrl");
|
|
7433
|
+
var aiOrigin = /* @__PURE__ */ __name((setting) => new URL(aiBaseUrl(setting)).origin, "aiOrigin");
|
|
7434
|
+
var aiTarget = /* @__PURE__ */ __name((setting) => ({
|
|
7435
|
+
provider: setting.provider === "anthropic" ? "anthropic" : "openai",
|
|
7436
|
+
model: setting.model,
|
|
7437
|
+
baseUrl: aiBaseUrl(setting)
|
|
7438
|
+
}), "aiTarget");
|
|
7439
|
+
var aiImagesAllowed = /* @__PURE__ */ __name((setting) => setting.images?.origin === aiOrigin(setting) && setting.images.model === setting.model, "aiImagesAllowed");
|
|
7440
|
+
var aiKeys = /* @__PURE__ */ __name((app, env, keyring) => {
|
|
7441
|
+
const where = { appName: "WireCat", prefix: "WIRECAT", env };
|
|
7442
|
+
const credentials = new Credentials({
|
|
7443
|
+
configDir: resolvePaths(where).config,
|
|
7444
|
+
service: "WireCat",
|
|
7445
|
+
// A tool run with its own folders moved (MEMO_CONFIG_DIR…) is a test or a sandbox, not the owner.
|
|
7446
|
+
isolated: isMovedRun(where) || isMovedRun({ appName: app.appName, prefix: app.envPrefix, env }),
|
|
7447
|
+
env,
|
|
7448
|
+
...keyring ? { keyring } : {},
|
|
7449
|
+
warn: /* @__PURE__ */ __name((message) => process.stderr.write(`${message}
|
|
7450
|
+
`), "warn")
|
|
7451
|
+
});
|
|
7452
|
+
const account = /* @__PURE__ */ __name((origin) => `ai:${origin}`, "account");
|
|
7453
|
+
return {
|
|
7454
|
+
read: /* @__PURE__ */ __name((origin) => {
|
|
7455
|
+
const stored = credentials.read(account(origin));
|
|
7456
|
+
if (stored)
|
|
7457
|
+
return { key: stored.secret, source: stored.source };
|
|
7458
|
+
const official = OFFICIAL[origin];
|
|
7459
|
+
const legacy = official ?? (origin.startsWith("https://") ? endpointKeyName(origin) : void 0);
|
|
7460
|
+
const found = legacy === void 0 ? void 0 : embeddingKeys(app, env, keyring).read(legacy);
|
|
7461
|
+
return found ? { key: found.key, source: found.source === "env" ? "environment" : found.source } : void 0;
|
|
7462
|
+
}, "read"),
|
|
7463
|
+
write: /* @__PURE__ */ __name((origin, key) => credentials.write(account(origin), key, { signIn: true }), "write"),
|
|
7464
|
+
remove: /* @__PURE__ */ __name((origin) => credentials.remove(account(origin)), "remove")
|
|
7465
|
+
};
|
|
7466
|
+
}, "aiKeys");
|
|
7467
|
+
var aiNeedsKey = /* @__PURE__ */ __name((setting) => aiLeavesComputer(setting), "aiNeedsKey");
|
|
7468
|
+
var aiTakesKey = /* @__PURE__ */ __name((setting) => setting.provider !== "ollama", "aiTakesKey");
|
|
7469
|
+
var keyFor = /* @__PURE__ */ __name((setting, deps) => aiTakesKey(setting) ? aiKeys(deps.app, deps.env, deps.keyring).read(aiOrigin(setting))?.key : void 0, "keyFor");
|
|
7470
|
+
var gatewayFor = /* @__PURE__ */ __name((setting, deps, key) => modelGateway({
|
|
7471
|
+
resolve: /* @__PURE__ */ __name(() => aiTarget(setting), "resolve"),
|
|
7472
|
+
consent: /* @__PURE__ */ __name(() => true, "consent"),
|
|
7473
|
+
key: /* @__PURE__ */ __name(() => key, "key"),
|
|
7474
|
+
env: deps.env,
|
|
7475
|
+
...deps.fetch ? { fetch: deps.fetch } : {},
|
|
7476
|
+
...deps.signal ? { signal: deps.signal } : {}
|
|
7477
|
+
}), "gatewayFor");
|
|
7478
|
+
var aiLeavesComputer = /* @__PURE__ */ __name((setting) => !onThisComputer(aiBaseUrl(setting)), "aiLeavesComputer");
|
|
7479
|
+
var sharedModel = /* @__PURE__ */ __name((deps) => {
|
|
7480
|
+
const setting = readAiSetting(aiSettingPath(deps.env));
|
|
7481
|
+
if (!setting)
|
|
7482
|
+
return void 0;
|
|
7483
|
+
return { target: { ...aiTarget(setting), baseUrl: aiBaseUrl(setting) }, key: keyFor(setting, deps), setting };
|
|
7484
|
+
}, "sharedModel");
|
|
7485
|
+
var aiTextReader = /* @__PURE__ */ __name((deps) => {
|
|
7486
|
+
const setting = readAiSetting(aiSettingPath(deps.env));
|
|
7487
|
+
if (!setting)
|
|
7488
|
+
return { refused: "ai.not-set" };
|
|
7489
|
+
const key = keyFor(setting, deps);
|
|
7490
|
+
if (aiNeedsKey(setting) && !key)
|
|
7491
|
+
return { refused: "ai.key-missing" };
|
|
7492
|
+
const gateway = gatewayFor(setting, deps, key);
|
|
7493
|
+
return {
|
|
7494
|
+
by: `${setting.provider}/${setting.model}`,
|
|
7495
|
+
leavesComputer: aiLeavesComputer(setting),
|
|
7496
|
+
complete: /* @__PURE__ */ __name(async (request) => (await gateway.complete(request)).text, "complete")
|
|
7497
|
+
};
|
|
7498
|
+
}, "aiTextReader");
|
|
7499
|
+
var reasonOf = /* @__PURE__ */ __name((error) => {
|
|
7500
|
+
if (!(error instanceof CliError))
|
|
7501
|
+
return "ai.failed";
|
|
7502
|
+
if (error.code === "rate_limited")
|
|
7503
|
+
return "ai.rate-limited";
|
|
7504
|
+
const { reason, status } = error.details;
|
|
7505
|
+
if (reason === "model.key-rejected")
|
|
7506
|
+
return "ai.key-rejected";
|
|
7507
|
+
if (reason === "model.unreachable")
|
|
7508
|
+
return "ai.unreachable";
|
|
7509
|
+
if (reason === "model.empty-answer")
|
|
7510
|
+
return "ai.empty-answer";
|
|
7511
|
+
if (status === 402)
|
|
7512
|
+
return "ai.no-credit";
|
|
7513
|
+
if (status === 404)
|
|
7514
|
+
return "ai.model-unknown";
|
|
7515
|
+
if (typeof status === "number" && status >= 500)
|
|
7516
|
+
return "ai.provider-error";
|
|
7517
|
+
return "ai.failed";
|
|
7518
|
+
}, "reasonOf");
|
|
7519
|
+
var checkAi = /* @__PURE__ */ __name(async (deps) => {
|
|
7520
|
+
const setting = readAiSetting(aiSettingPath(deps.env));
|
|
7521
|
+
if (!setting)
|
|
7522
|
+
return { ok: false, reason: "ai.not-set", ms: null };
|
|
7523
|
+
const key = keyFor(setting, deps);
|
|
7524
|
+
if (aiNeedsKey(setting) && !key)
|
|
7525
|
+
return { ok: false, reason: "ai.key-missing", ms: null };
|
|
7526
|
+
const started = Date.now();
|
|
7527
|
+
try {
|
|
7528
|
+
await gatewayFor(setting, deps, key).complete({
|
|
7529
|
+
purpose: "check",
|
|
7530
|
+
system: "Reply with the word OK.",
|
|
7531
|
+
prompt: "OK?",
|
|
7532
|
+
// Reasoning models spend tokens before they answer; too low a cap reads as a broken setup.
|
|
7533
|
+
maxTokens: 2048
|
|
7534
|
+
});
|
|
7535
|
+
return { ok: true, reason: "ai.ok", ms: Date.now() - started };
|
|
7536
|
+
} catch (error) {
|
|
7537
|
+
return { ok: false, reason: reasonOf(error), ms: null };
|
|
7538
|
+
}
|
|
7539
|
+
}, "checkAi");
|
|
7540
|
+
|
|
7541
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.656.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_dceb8977715cf47b69a8fd97c630c977/node_modules/@wirecat/cli-core/dist/models/purpose.js
|
|
7542
|
+
var HOSTED = {
|
|
7543
|
+
openai: "https://api.openai.com/v1",
|
|
7544
|
+
anthropic: "https://api.anthropic.com"
|
|
7545
|
+
};
|
|
7546
|
+
var purposeModel = /* @__PURE__ */ __name((settings, purpose, deps) => {
|
|
7547
|
+
const configured = modelTarget(settings, purpose);
|
|
7548
|
+
if (configured) {
|
|
7549
|
+
const baseUrl = configured.baseUrl ?? HOSTED[configured.provider] ?? "";
|
|
7550
|
+
return {
|
|
7551
|
+
target: { ...configured, baseUrl },
|
|
7552
|
+
key: /* @__PURE__ */ __name(() => embeddingKeys(deps.app, deps.env, deps.keyring).read(configured.baseUrl === void 0 ? configured.provider : endpointKeyName(configured.baseUrl))?.key, "key")
|
|
7553
|
+
};
|
|
7554
|
+
}
|
|
7555
|
+
const provider = settings.models?.[purpose]?.provider ?? settings.models?.default?.provider;
|
|
7556
|
+
if (provider === "off")
|
|
7557
|
+
return void 0;
|
|
7558
|
+
const shared = sharedModel(deps);
|
|
7559
|
+
return shared ? { target: shared.target, key: /* @__PURE__ */ __name(() => shared.key, "key"), shared: shared.setting } : void 0;
|
|
7560
|
+
}, "purposeModel");
|
|
7561
|
+
|
|
7562
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.656.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_dceb8977715cf47b69a8fd97c630c977/node_modules/@wirecat/cli-core/dist/replies/consents.js
|
|
7361
7563
|
import { existsSync as existsSync7, readFileSync as readFileSync4 } from "node:fs";
|
|
7362
7564
|
import { join as join4 } from "node:path";
|
|
7363
7565
|
var shape = strictObject({
|
|
@@ -7382,19 +7584,21 @@ var mayModelReply = /* @__PURE__ */ __name((path, provider, chat) => {
|
|
|
7382
7584
|
return consent.provider === provider && !consent.deniedChats.includes(chat);
|
|
7383
7585
|
}, "mayModelReply");
|
|
7384
7586
|
|
|
7385
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
7587
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.656.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_dceb8977715cf47b69a8fd97c630c977/node_modules/@wirecat/cli-core/dist/replies/rendering.js
|
|
7386
7588
|
var replyRenderer = /* @__PURE__ */ __name((app, profile, settings, env, warn, options = {
|
|
7387
7589
|
ai: true
|
|
7388
7590
|
}) => async (rule2, message, chat, now) => {
|
|
7591
|
+
const deps = { app, env, keyring: options.keyring };
|
|
7389
7592
|
let called;
|
|
7390
7593
|
const gateway = modelGateway({
|
|
7391
7594
|
signal: options.signal,
|
|
7595
|
+
env,
|
|
7392
7596
|
resolve: /* @__PURE__ */ __name((purpose) => {
|
|
7393
|
-
called =
|
|
7394
|
-
return called;
|
|
7597
|
+
called = purposeModel(settings(), purpose, deps);
|
|
7598
|
+
return called?.target;
|
|
7395
7599
|
}, "resolve"),
|
|
7396
7600
|
consent: /* @__PURE__ */ __name((_request, target) => mayModelReply(replyConsentPathFor(app, profile, env), replyModelIdentity(target.provider, target.baseUrl ?? ""), message.chatId), "consent"),
|
|
7397
|
-
key: /* @__PURE__ */ __name((
|
|
7601
|
+
key: /* @__PURE__ */ __name(() => called?.key(), "key")
|
|
7398
7602
|
});
|
|
7399
7603
|
if (options.signal?.aborted)
|
|
7400
7604
|
throw new CliError("cancelled", "reply rendering cancelled");
|
|
@@ -7416,9 +7620,8 @@ var replyRenderer = /* @__PURE__ */ __name((app, profile, settings, env, warn, o
|
|
|
7416
7620
|
});
|
|
7417
7621
|
if (options.signal?.aborted)
|
|
7418
7622
|
throw new CliError("cancelled", "reply rendering cancelled");
|
|
7419
|
-
const current =
|
|
7420
|
-
|
|
7421
|
-
if (!called || JSON.stringify(current) !== JSON.stringify(called) || !mayModelReply(replyConsentPathFor(app, profile, env), replyModelIdentity(called.provider, baseUrl), message.chatId)) {
|
|
7623
|
+
const current = purposeModel(settings(), "replies", deps)?.target;
|
|
7624
|
+
if (!called || JSON.stringify(current) !== JSON.stringify(called.target) || !mayModelReply(replyConsentPathFor(app, profile, env), replyModelIdentity(called.target.provider, called.target.baseUrl), message.chatId)) {
|
|
7422
7625
|
throw new CliError("permission_error", "reply model consent or configuration changed during rendering");
|
|
7423
7626
|
}
|
|
7424
7627
|
return result3;
|
|
@@ -7429,7 +7632,7 @@ var replyRenderer = /* @__PURE__ */ __name((app, profile, settings, env, warn, o
|
|
|
7429
7632
|
return result2;
|
|
7430
7633
|
}, "replyRenderer");
|
|
7431
7634
|
|
|
7432
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
7635
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.656.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_dceb8977715cf47b69a8fd97c630c977/node_modules/@wirecat/cli-core/dist/replies/serve.js
|
|
7433
7636
|
var NOT_ALLOWED = "replies.send is not allow";
|
|
7434
7637
|
var NO_RULES = "no rules";
|
|
7435
7638
|
var ONLY_TASK = "opened a task, sent nothing";
|
|
@@ -7522,7 +7725,7 @@ var replyTo = /* @__PURE__ */ __name(async (deps, message) => {
|
|
|
7522
7725
|
return { skip: why };
|
|
7523
7726
|
}, "replyTo");
|
|
7524
7727
|
|
|
7525
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
7728
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.656.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_dceb8977715cf47b69a8fd97c630c977/node_modules/@wirecat/cli-core/dist/cli/messenger/serve-catch-up.js
|
|
7526
7729
|
var START_SYNC_DELAY_MS = 3e4;
|
|
7527
7730
|
var START_SYNC_BUDGET_MS = 5 * 6e4;
|
|
7528
7731
|
var START_SYNC_WINDOW_MS = 7 * 864e5;
|
|
@@ -7599,7 +7802,7 @@ var startSync = /* @__PURE__ */ __name(({ chats, newestHeld, fetch, note, warn,
|
|
|
7599
7802
|
};
|
|
7600
7803
|
}, "startSync");
|
|
7601
7804
|
|
|
7602
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
7805
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.656.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_dceb8977715cf47b69a8fd97c630c977/node_modules/@wirecat/cli-core/dist/cli/messenger/serve-members.js
|
|
7603
7806
|
var FIRST_FETCH_MS = 6e4;
|
|
7604
7807
|
var DAY_MS = 864e5;
|
|
7605
7808
|
var memberFetches = /* @__PURE__ */ __name(({ withStore, fetch, warn, firstMs = FIRST_FETCH_MS, everyMs = DAY_MS }) => {
|
|
@@ -7653,7 +7856,7 @@ var memberFetches = /* @__PURE__ */ __name(({ withStore, fetch, warn, firstMs =
|
|
|
7653
7856
|
};
|
|
7654
7857
|
}, "memberFetches");
|
|
7655
7858
|
|
|
7656
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
7859
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.656.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_dceb8977715cf47b69a8fd97c630c977/node_modules/@wirecat/cli-core/dist/cli/messenger/serve-notice.js
|
|
7657
7860
|
var record2 = /* @__PURE__ */ __name((context, app, severity, attributes) => recordLogFor(context.streams.diagnostic, app, { command: currentRun().command || "serve" })[severity](attributes), "record");
|
|
7658
7861
|
var noticeFor = /* @__PURE__ */ __name((context, app, severity = "warn") => ({ text, ...attributes }) => {
|
|
7659
7862
|
if (context.format === "pretty") {
|
|
@@ -7686,7 +7889,7 @@ var recordDiagnostics = /* @__PURE__ */ __name((context, app) => {
|
|
|
7686
7889
|
return context;
|
|
7687
7890
|
}, "recordDiagnostics");
|
|
7688
7891
|
|
|
7689
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
7892
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.656.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_dceb8977715cf47b69a8fd97c630c977/node_modules/@wirecat/cli-core/dist/cli/messenger/serve-outdated.js
|
|
7690
7893
|
import { existsSync as existsSync8, readFileSync as readFileSync5, realpathSync as realpathSync2 } from "node:fs";
|
|
7691
7894
|
import { dirname as dirname2, join as join5 } from "node:path";
|
|
7692
7895
|
var OUTDATED_CHECK_MS = 6e4;
|
|
@@ -7772,7 +7975,7 @@ var watchOutdated = /* @__PURE__ */ __name(({ check: check2, onOutdated, everyMs
|
|
|
7772
7975
|
};
|
|
7773
7976
|
}, "watchOutdated");
|
|
7774
7977
|
|
|
7775
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
7978
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.656.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_dceb8977715cf47b69a8fd97c630c977/node_modules/@wirecat/cli-core/dist/cli/messenger/serve-stems.js
|
|
7776
7979
|
var STEMS_EVERY_MS = 3e4;
|
|
7777
7980
|
var STEMS_SLICE_MS = 2e3;
|
|
7778
7981
|
var stemFills = /* @__PURE__ */ __name(({ withStore, warn, everyMs = STEMS_EVERY_MS, sliceMs = STEMS_SLICE_MS }) => {
|
|
@@ -7812,7 +8015,7 @@ var stemFills = /* @__PURE__ */ __name(({ withStore, warn, everyMs = STEMS_EVERY
|
|
|
7812
8015
|
};
|
|
7813
8016
|
}, "stemFills");
|
|
7814
8017
|
|
|
7815
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
8018
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.656.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_dceb8977715cf47b69a8fd97c630c977/node_modules/@wirecat/cli-core/dist/cli/messenger/message-items.js
|
|
7816
8019
|
var defined = /* @__PURE__ */ __name((value) => Object.fromEntries(Object.entries(value).filter(([, one]) => one !== void 0)), "defined");
|
|
7817
8020
|
var attachmentItem = /* @__PURE__ */ __name((attachment) => defined({
|
|
7818
8021
|
kind: attachment.kind,
|
|
@@ -7824,6 +8027,7 @@ var attachmentItem = /* @__PURE__ */ __name((attachment) => defined({
|
|
|
7824
8027
|
width: attachment.width,
|
|
7825
8028
|
height: attachment.height,
|
|
7826
8029
|
duration: attachment.duration,
|
|
8030
|
+
local_path: attachment.localPath,
|
|
7827
8031
|
contact: attachment.contact && defined({
|
|
7828
8032
|
name: attachment.contact.name,
|
|
7829
8033
|
first_name: attachment.contact.firstName,
|
|
@@ -7907,7 +8111,7 @@ var viewOf = /* @__PURE__ */ __name((context, messenger) => ({
|
|
|
7907
8111
|
locale: messenger.app.locale
|
|
7908
8112
|
}), "viewOf");
|
|
7909
8113
|
|
|
7910
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
8114
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.656.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_dceb8977715cf47b69a8fd97c630c977/node_modules/@wirecat/cli-core/dist/cli/messenger/watch-answers.js
|
|
7911
8115
|
var observed = /* @__PURE__ */ __name((value) => ({
|
|
7912
8116
|
value: value.value,
|
|
7913
8117
|
observed_at: value.observedAt,
|
|
@@ -7974,7 +8178,7 @@ var watchEventItem = /* @__PURE__ */ __name((value, account) => {
|
|
|
7974
8178
|
}
|
|
7975
8179
|
}, "watchEventItem");
|
|
7976
8180
|
|
|
7977
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
8181
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.656.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_dceb8977715cf47b69a8fd97c630c977/node_modules/@wirecat/cli-core/dist/cli/messenger/watch-command.js
|
|
7978
8182
|
var watchCommand = /* @__PURE__ */ __name((messenger) => annotate(new Command("watch"), {
|
|
7979
8183
|
output: { entity: "watch_item" },
|
|
7980
8184
|
effects: REMOTE_READ,
|
|
@@ -8129,7 +8333,7 @@ var describe = /* @__PURE__ */ __name((event, render) => {
|
|
|
8129
8333
|
}
|
|
8130
8334
|
}, "describe");
|
|
8131
8335
|
|
|
8132
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
8336
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.656.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_dceb8977715cf47b69a8fd97c630c977/node_modules/@wirecat/cli-core/dist/cli/messenger/serve-command.js
|
|
8133
8337
|
var serveCommand = /* @__PURE__ */ __name((messenger) => {
|
|
8134
8338
|
const command = annotate(new Command("serve"), {
|
|
8135
8339
|
output: { entity: "serve_summary" },
|
|
@@ -8412,7 +8616,7 @@ var tasking = /* @__PURE__ */ __name((context, warn) => {
|
|
|
8412
8616
|
};
|
|
8413
8617
|
}, "tasking");
|
|
8414
8618
|
|
|
8415
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
8619
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.656.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_dceb8977715cf47b69a8fd97c630c977/node_modules/@wirecat/cli-core/dist/cli/messenger/store-tables-command.js
|
|
8416
8620
|
import { existsSync as existsSync9 } from "node:fs";
|
|
8417
8621
|
var PATH = "store tables list";
|
|
8418
8622
|
var STORE_TABLES_QUERY = {
|
|
@@ -8429,14 +8633,14 @@ var filterOf = /* @__PURE__ */ __name((words) => {
|
|
|
8429
8633
|
const kind = terms.get("kind");
|
|
8430
8634
|
return { ...name === void 0 ? {} : { name }, ...kind === void 0 ? {} : { kind } };
|
|
8431
8635
|
}, "filterOf");
|
|
8432
|
-
var storeTablesCommand = /* @__PURE__ */ __name((
|
|
8433
|
-
const tables = new Command("tables").description("the tables of the local
|
|
8636
|
+
var storeTablesCommand = /* @__PURE__ */ __name((owner) => {
|
|
8637
|
+
const tables = new Command("tables").description("the tables of the local store");
|
|
8434
8638
|
withQuery(annotate(tables.command("list"), {
|
|
8435
8639
|
effects: LOCAL_READ,
|
|
8436
8640
|
examples: [
|
|
8437
|
-
`${
|
|
8438
|
-
`${
|
|
8439
|
-
`${
|
|
8641
|
+
`${owner.app.command} store tables list`,
|
|
8642
|
+
`${owner.app.command} store tables list kind:data`,
|
|
8643
|
+
`${owner.app.command} store tables list --full --json`
|
|
8440
8644
|
]
|
|
8441
8645
|
}), STORE_TABLES_QUERY).summary("every table of the local archive, with its kind and row count").description("every table of the local archive: its kind (data, search index, part of a search index, internal) and its rows, a search index's rows not counted; --full adds each table's size on disk, which reads the whole file (about ten seconds for 3 GB); changes nothing").action(async function(words) {
|
|
8442
8646
|
const filter = filterOf(words);
|
|
@@ -8455,7 +8659,7 @@ var storeTablesCommand = /* @__PURE__ */ __name((messenger) => {
|
|
|
8455
8659
|
return tables;
|
|
8456
8660
|
}, "storeTablesCommand");
|
|
8457
8661
|
|
|
8458
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
8662
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.656.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_dceb8977715cf47b69a8fd97c630c977/node_modules/@wirecat/cli-core/dist/cli/messenger/store-maintenance-command.js
|
|
8459
8663
|
var SEARCH_INDEXES = ["messages_fts", "chats_fts", "identities_fts"];
|
|
8460
8664
|
var WORD_INDEX = "message_words";
|
|
8461
8665
|
var schemaOf = /* @__PURE__ */ __name((database) => {
|
|
@@ -8540,27 +8744,52 @@ var storeSummary = /* @__PURE__ */ __name(async (env, { deep = false, command, v
|
|
|
8540
8744
|
}
|
|
8541
8745
|
}, "storeSummary");
|
|
8542
8746
|
var result = /* @__PURE__ */ __name((command, value, next = []) => renderAnswer(command, outputFor(command), itemOf(snakeKeys(value), { next })), "result");
|
|
8543
|
-
var
|
|
8747
|
+
var chatty = /* @__PURE__ */ __name((owner) => owner.provider !== void 0, "chatty");
|
|
8748
|
+
var archive = /* @__PURE__ */ __name((owner) => chatty(owner) ? "local archive" : "local store", "archive");
|
|
8749
|
+
var createdBy = /* @__PURE__ */ __name((owner) => chatty(owner) ? `the first \`${owner.app.command}\` command that reads a chat creates it` : `the first \`${owner.app.command}\` command that saves anything creates it`, "createdBy");
|
|
8750
|
+
var storeMaintenanceCommands = /* @__PURE__ */ __name((owner) => [
|
|
8544
8751
|
storeInfoCommand(),
|
|
8545
|
-
checkCommand(
|
|
8546
|
-
migrateCommand(
|
|
8547
|
-
reindexCommand(
|
|
8752
|
+
checkCommand(owner),
|
|
8753
|
+
migrateCommand(owner),
|
|
8754
|
+
reindexCommand(owner),
|
|
8548
8755
|
backupCommand(),
|
|
8549
|
-
restoreCommand(
|
|
8756
|
+
restoreCommand(owner),
|
|
8550
8757
|
decryptCommand(),
|
|
8551
|
-
repairCommand(
|
|
8552
|
-
resetCommand(
|
|
8758
|
+
repairCommand(owner),
|
|
8759
|
+
resetCommand(owner),
|
|
8553
8760
|
copiesCommand(),
|
|
8554
|
-
storeTablesCommand(
|
|
8555
|
-
storeRecoverCommand({ command:
|
|
8761
|
+
storeTablesCommand(owner),
|
|
8762
|
+
storeRecoverCommand({ command: owner.app.command, version: owner.app.version })
|
|
8556
8763
|
], "storeMaintenanceCommands");
|
|
8557
|
-
var
|
|
8558
|
-
|
|
8764
|
+
var EXAMPLES = {
|
|
8765
|
+
backup: "./backup.db",
|
|
8766
|
+
check: "",
|
|
8767
|
+
"copies delete": "messages_copy_1",
|
|
8768
|
+
decrypt: "./backup.enc --output ./restored.db",
|
|
8769
|
+
info: "",
|
|
8770
|
+
migrate: "",
|
|
8771
|
+
rebuild: "",
|
|
8772
|
+
repair: "--dry-run",
|
|
8773
|
+
reset: "",
|
|
8774
|
+
restore: "./backup.db"
|
|
8775
|
+
};
|
|
8776
|
+
var addStoreMaintenanceCommands = /* @__PURE__ */ __name((store, owner, profile) => {
|
|
8777
|
+
for (const command of storeMaintenanceCommands(owner))
|
|
8778
|
+
store.addCommand(command);
|
|
8779
|
+
for (const [path, args] of Object.entries(EXAMPLES)) {
|
|
8780
|
+
const command = commandAt(store, path);
|
|
8781
|
+
if (command)
|
|
8782
|
+
annotate(command, { examples: [`${owner.app.command} ${profile} store ${path} ${args}`.trimEnd()] });
|
|
8783
|
+
}
|
|
8784
|
+
return store;
|
|
8785
|
+
}, "addStoreMaintenanceCommands");
|
|
8786
|
+
var refuseWhileServing = /* @__PURE__ */ __name((command, owner) => {
|
|
8787
|
+
const serving = servingProfiles(owner.app, environmentOf(command).env ?? process.env);
|
|
8559
8788
|
if (serving.length > 0) {
|
|
8560
|
-
throw new CliError("validation_error", `${
|
|
8789
|
+
throw new CliError("validation_error", `${owner.app.command} serve is running for ${serving.join(", ")} \u2014 ${serving.map((profile) => `\`${owner.app.command} ${profile} server stop\``).join(", ")} first`);
|
|
8561
8790
|
}
|
|
8562
8791
|
}, "refuseWhileServing");
|
|
8563
|
-
var repairCommand = /* @__PURE__ */ __name((
|
|
8792
|
+
var repairCommand = /* @__PURE__ */ __name((owner) => annotate(new Command("repair"), { output: { entity: "store_repair" }, effects: LOCAL_WRITE }).summary("repair table shapes while keeping the old tables").description("bring every table to this build's shape, deleting nothing: a table of the wrong shape is kept as a copy beside a new one").option("--dry-run", "say what it would do, and change nothing").action(async function() {
|
|
8564
8793
|
const { renderer, format } = outputFor(this);
|
|
8565
8794
|
const { dryRun: dryRun2 } = this.opts();
|
|
8566
8795
|
const path = storePath(environmentOf(this).env ?? process.env);
|
|
@@ -8569,13 +8798,13 @@ var repairCommand = /* @__PURE__ */ __name((messenger) => annotate(new Command("
|
|
|
8569
8798
|
return;
|
|
8570
8799
|
}
|
|
8571
8800
|
if (!dryRun2)
|
|
8572
|
-
refuseWhileServing(this,
|
|
8801
|
+
refuseWhileServing(this, owner);
|
|
8573
8802
|
const fresh = await openCache(":memory:");
|
|
8574
8803
|
try {
|
|
8575
8804
|
const report = await reading(path, (database) => repairStore(database, fresh, { dryRun: dryRun2 === true }));
|
|
8576
8805
|
result(this, { path, ...report });
|
|
8577
8806
|
if (format === "pretty")
|
|
8578
|
-
for (const note of notesOf(report,
|
|
8807
|
+
for (const note of notesOf(report, owner.app.command))
|
|
8579
8808
|
renderer.note(note);
|
|
8580
8809
|
} finally {
|
|
8581
8810
|
fresh.close();
|
|
@@ -8609,7 +8838,7 @@ var copiesCommand = /* @__PURE__ */ __name(() => new Command("copies").descripti
|
|
|
8609
8838
|
const deleted = await reading(path, (database) => deleteCopy(database, name));
|
|
8610
8839
|
result(this, { path, deleted });
|
|
8611
8840
|
})), "copiesCommand");
|
|
8612
|
-
var checkCommand = /* @__PURE__ */ __name((
|
|
8841
|
+
var checkCommand = /* @__PURE__ */ __name((owner) => annotate(new Command("check"), { output: { entity: "store_check" }, effects: LOCAL_READ }).summary(`check the ${archive(owner)} for problems`).description(`whether the store is healthy \u2014 integrity, search indexes, disk${chatty(owner) ? ", and which chats are behind" : ""}`).action(async function() {
|
|
8613
8842
|
const { renderer } = outputFor(this);
|
|
8614
8843
|
const path = storePath(environmentOf(this).env ?? process.env);
|
|
8615
8844
|
if (!existsSync10(path)) {
|
|
@@ -8623,7 +8852,7 @@ var checkCommand = /* @__PURE__ */ __name((messenger) => annotate(new Command("c
|
|
|
8623
8852
|
result(this, { path, exists: true, ok: false, opens: false, error: messageOf2(error) });
|
|
8624
8853
|
return;
|
|
8625
8854
|
}
|
|
8626
|
-
const { command } =
|
|
8855
|
+
const { command } = owner.app;
|
|
8627
8856
|
const next = /* @__PURE__ */ new Map();
|
|
8628
8857
|
const step = /* @__PURE__ */ __name((id, args = {}) => {
|
|
8629
8858
|
if (!next.has(id))
|
|
@@ -8639,10 +8868,10 @@ var checkCommand = /* @__PURE__ */ __name((messenger) => annotate(new Command("c
|
|
|
8639
8868
|
step("store.reindex");
|
|
8640
8869
|
else if (stems && !stems.ready)
|
|
8641
8870
|
step("store.migrate");
|
|
8642
|
-
const behind = answer.chatsBehind.find((chat) => chat.provider ===
|
|
8643
|
-
if (behind &&
|
|
8871
|
+
const behind = answer.chatsBehind.find((chat) => chat.provider === owner.provider);
|
|
8872
|
+
if (behind && owner.history !== "store")
|
|
8644
8873
|
step("messages.sync");
|
|
8645
|
-
else if (behind && syncsOneChat(
|
|
8874
|
+
else if (behind && syncsOneChat(owner))
|
|
8646
8875
|
step("messages.sync", { chat: behind.chat });
|
|
8647
8876
|
result(this, answer, [...next.values()]);
|
|
8648
8877
|
if (answer.schema.version < SPEAKS) {
|
|
@@ -8657,7 +8886,7 @@ var checkCommand = /* @__PURE__ */ __name((messenger) => annotate(new Command("c
|
|
|
8657
8886
|
renderer.note(`${orphans} pointers name a row that is gone or a type the store does not know \u2014 see orphan_pointers`);
|
|
8658
8887
|
if (answer.vectors && answer.vectors.unused > 0)
|
|
8659
8888
|
renderer.note(`${answer.vectors.unused} vectors belong to no text the store still holds \u2014 \`${command} store rebuild\` drops them`);
|
|
8660
|
-
const older = answer.conversations.filter((chat) => chat.provider ===
|
|
8889
|
+
const older = answer.conversations.filter((chat) => chat.provider === owner.provider && !chat.current).length;
|
|
8661
8890
|
if (older > 0) {
|
|
8662
8891
|
renderer.note(`${older} chats' conversations were built by older rules \u2014 \`${command} conversations links rebuild --chat <chat>\``);
|
|
8663
8892
|
}
|
|
@@ -8760,19 +8989,19 @@ var chatsBehind = /* @__PURE__ */ __name((database) => database.prepare(`SELECT
|
|
|
8760
8989
|
held: row.held === null ? null : isoOf(row.held),
|
|
8761
8990
|
refreshed: isoOf(row.refreshed)
|
|
8762
8991
|
})), "chatsBehind");
|
|
8763
|
-
var migrateCommand = /* @__PURE__ */ __name((
|
|
8992
|
+
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() {
|
|
8764
8993
|
const { renderer } = outputFor(this);
|
|
8765
8994
|
const path = storePath(environmentOf(this).env ?? process.env);
|
|
8766
8995
|
if (!existsSync10(path)) {
|
|
8767
8996
|
result(this, { path, exists: false });
|
|
8768
|
-
renderer.note(`no store yet \u2014
|
|
8997
|
+
renderer.note(`no store yet \u2014 ${createdBy(owner)}`);
|
|
8769
8998
|
return;
|
|
8770
8999
|
}
|
|
8771
9000
|
const answer = await reading(path, (database) => {
|
|
8772
9001
|
const from = schemaOf(database).version;
|
|
8773
9002
|
migrate(database, {
|
|
8774
|
-
command:
|
|
8775
|
-
version:
|
|
9003
|
+
command: owner.app.command,
|
|
9004
|
+
version: owner.app.version,
|
|
8776
9005
|
rollback: { store: path, warn: /* @__PURE__ */ __name((line) => renderer.warn(line), "warn") }
|
|
8777
9006
|
});
|
|
8778
9007
|
const { normalized, indexed, terms } = buildWordIndex(database, (note) => renderer.note(note));
|
|
@@ -8824,7 +9053,7 @@ var buildNoteIndex = /* @__PURE__ */ __name((database, note, { reset = false } =
|
|
|
8824
9053
|
note(`indexing ${pending} notes`);
|
|
8825
9054
|
return { notesIndexed: drainNoteIndex(database, stemmerCache()) };
|
|
8826
9055
|
}, "buildNoteIndex");
|
|
8827
|
-
var reindexCommand = /* @__PURE__ */ __name((
|
|
9056
|
+
var reindexCommand = /* @__PURE__ */ __name((owner) => destroysNothing(annotate(new Command("rebuild"), { output: { entity: "store_reindex" }, effects: LOCAL_WRITE })).summary(`rebuild the ${archive(owner)}'s search indexes`).description("rebuild the word index, its typo vocabulary, the stems, the files' word index, the notes' indexes and who took part in what, from what is stored, and drop the vectors no stored text uses; loses nothing").action(async function() {
|
|
8828
9057
|
const { renderer } = outputFor(this);
|
|
8829
9058
|
const path = storePath(environmentOf(this).env ?? process.env);
|
|
8830
9059
|
if (!existsSync10(path)) {
|
|
@@ -8869,6 +9098,9 @@ var backupCommand = /* @__PURE__ */ __name(() => destroysNothing(annotate(new Co
|
|
|
8869
9098
|
const { encrypt } = this.opts();
|
|
8870
9099
|
const path = storePath(environmentOf(this).env ?? process.env);
|
|
8871
9100
|
const target = resolve(file2);
|
|
9101
|
+
const { app, env } = environmentOf(this);
|
|
9102
|
+
if (app)
|
|
9103
|
+
refuseLockedOutput(target, app, env ?? process.env, "<file>");
|
|
8872
9104
|
if (!existsSync10(path))
|
|
8873
9105
|
throw new CliError("not_found", `no store at ${path} to back up`);
|
|
8874
9106
|
if (existsSync10(target))
|
|
@@ -8913,37 +9145,37 @@ var decryptCommand = /* @__PURE__ */ __name(() => annotate(new Command("decrypt"
|
|
|
8913
9145
|
await unsealFile(from, to, await passwordOf(this, { twice: false }));
|
|
8914
9146
|
result(this, { path: to, from, bytes: bytesOf2(to) });
|
|
8915
9147
|
}), "decryptCommand");
|
|
8916
|
-
var restoreCommand = /* @__PURE__ */ __name((
|
|
9148
|
+
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) {
|
|
8917
9149
|
const path = storePath(environmentOf(this).env ?? process.env);
|
|
8918
9150
|
const given = resolve(file2);
|
|
8919
9151
|
if (!existsSync10(given))
|
|
8920
9152
|
throw new CliError("not_found", `no file at ${given}`);
|
|
8921
|
-
refuseWhileServing(this,
|
|
9153
|
+
refuseWhileServing(this, owner);
|
|
8922
9154
|
if (!isSealed(given))
|
|
8923
|
-
return restoreFrom(this,
|
|
9155
|
+
return restoreFrom(this, owner, given, given);
|
|
8924
9156
|
const opened = `${path}.unsealing-${process.pid}`;
|
|
8925
9157
|
mkdirSync(dirname3(path), { recursive: true, mode: 448 });
|
|
8926
9158
|
try {
|
|
8927
9159
|
await unsealFile(given, opened, await passwordOf(this, { twice: false }));
|
|
8928
|
-
await restoreFrom(this,
|
|
9160
|
+
await restoreFrom(this, owner, opened, given);
|
|
8929
9161
|
} finally {
|
|
8930
9162
|
rmSync3(opened, { force: true });
|
|
8931
9163
|
}
|
|
8932
9164
|
}), "restoreCommand");
|
|
8933
|
-
var restoreFrom = /* @__PURE__ */ __name(async (command,
|
|
9165
|
+
var restoreFrom = /* @__PURE__ */ __name(async (command, owner, backup, given) => {
|
|
8934
9166
|
const { renderer } = outputFor(command);
|
|
8935
9167
|
const path = storePath(environmentOf(command).env ?? process.env);
|
|
8936
9168
|
if (existsSync10(path) && realpathSync3(backup) === realpathSync3(path)) {
|
|
8937
9169
|
throw new CliError("validation_error", `${backup} is the store itself`);
|
|
8938
9170
|
}
|
|
8939
9171
|
if (await isRollbackCopy(backup))
|
|
8940
|
-
return rollBackFrom(command,
|
|
9172
|
+
return rollBackFrom(command, owner, backup);
|
|
8941
9173
|
const schema = await backupSchema(backup);
|
|
8942
9174
|
const stamp = stampNow();
|
|
8943
9175
|
const kept = existsSync10(path) ? `${path}.before-restore-${stamp}` : null;
|
|
8944
9176
|
if (kept) {
|
|
8945
9177
|
const waitMs = environmentOf(command).storeLockWaitMs;
|
|
8946
|
-
await quiesce(path,
|
|
9178
|
+
await quiesce(path, owner, "restore", (message) => renderer.warn(message), waitMs);
|
|
8947
9179
|
} else
|
|
8948
9180
|
mkdirSync(dirname3(path), { recursive: true, mode: 448 });
|
|
8949
9181
|
const incoming = `${path}.restoring-${stamp}`;
|
|
@@ -8971,13 +9203,13 @@ var isRollbackCopy = /* @__PURE__ */ __name(async (file2) => {
|
|
|
8971
9203
|
return false;
|
|
8972
9204
|
}
|
|
8973
9205
|
}, "isRollbackCopy");
|
|
8974
|
-
var rollBackFrom = /* @__PURE__ */ __name(async (command,
|
|
9206
|
+
var rollBackFrom = /* @__PURE__ */ __name(async (command, owner, copy) => {
|
|
8975
9207
|
const { renderer } = outputFor(command);
|
|
8976
9208
|
const path = storePath(environmentOf(command).env ?? process.env);
|
|
8977
9209
|
if (!existsSync10(path))
|
|
8978
9210
|
throw new CliError("not_found", `no store at ${path} to roll back`);
|
|
8979
9211
|
const waitMs = environmentOf(command).storeLockWaitMs;
|
|
8980
|
-
await quiesce(path,
|
|
9212
|
+
await quiesce(path, owner, "restore", (message) => renderer.warn(message), waitMs);
|
|
8981
9213
|
const { database } = await openSqlite(path);
|
|
8982
9214
|
let rolled;
|
|
8983
9215
|
try {
|
|
@@ -9022,8 +9254,8 @@ var backupSchema = /* @__PURE__ */ __name(async (backup) => {
|
|
|
9022
9254
|
return schema;
|
|
9023
9255
|
}, "backupSchema");
|
|
9024
9256
|
var STORE_LOCK_WAIT_MS = 1e3;
|
|
9025
|
-
var quiesce = /* @__PURE__ */ __name(async (path,
|
|
9026
|
-
const { command } =
|
|
9257
|
+
var quiesce = /* @__PURE__ */ __name(async (path, owner, then, warn, waitMs = STORE_LOCK_WAIT_MS) => {
|
|
9258
|
+
const { command } = owner.app;
|
|
9027
9259
|
const files = [path, `${path}-wal`, `${path}-shm`].filter((file2) => existsSync10(file2)).map((file2) => realpathSync3(file2));
|
|
9028
9260
|
const holders = holdersOf(files);
|
|
9029
9261
|
if (holders === void 0) {
|
|
@@ -9045,21 +9277,21 @@ var quiesce = /* @__PURE__ */ __name(async (path, messenger, then, warn, waitMs
|
|
|
9045
9277
|
database.close();
|
|
9046
9278
|
}
|
|
9047
9279
|
}, "quiesce");
|
|
9048
|
-
var resetCommand = /* @__PURE__ */ __name((
|
|
9280
|
+
var resetCommand = /* @__PURE__ */ __name((owner) => annotate(new Command("reset"), { output: { entity: "store_reset" }, effects: LOCAL_WRITE, mcp: false }).summary(`back up the ${archive(owner)} and replace it with an empty one`).description("back the store up beside itself, then delete it and start an empty one at this build's schema; asks first, or --yes").option("--no-backup", "delete the store without backing it up first").option("--dry-run", "list every table it would empty, with its rows, and delete nothing").action(async function({ backup: keep, dryRun: dryRun2 }) {
|
|
9049
9281
|
const { renderer } = outputFor(this);
|
|
9050
|
-
const { command } =
|
|
9282
|
+
const { command } = owner.app;
|
|
9051
9283
|
const env = environmentOf(this).env ?? process.env;
|
|
9052
9284
|
const path = storePath(env);
|
|
9053
9285
|
if (!existsSync10(path)) {
|
|
9054
9286
|
result(this, { path, exists: false, reset: false });
|
|
9055
|
-
renderer.note(`no store at ${path} \u2014 nothing to reset;
|
|
9287
|
+
renderer.note(`no store at ${path} \u2014 nothing to reset; ${createdBy(owner)}`);
|
|
9056
9288
|
return;
|
|
9057
9289
|
}
|
|
9058
9290
|
if (dryRun2) {
|
|
9059
|
-
result(this, await resetPreview(path,
|
|
9291
|
+
result(this, await resetPreview(path, owner, env, keep));
|
|
9060
9292
|
return;
|
|
9061
9293
|
}
|
|
9062
|
-
refuseWhileServing(this,
|
|
9294
|
+
refuseWhileServing(this, owner);
|
|
9063
9295
|
if (this.optsWithGlobals().yes !== true) {
|
|
9064
9296
|
const what = `this deletes the store at ${path} and starts an empty one, ${keep ? "after a backup beside it" : "with no backup"}`;
|
|
9065
9297
|
const answer = await answerOf(this, `${what}. Go ahead? [y/N] `);
|
|
@@ -9068,7 +9300,7 @@ var resetCommand = /* @__PURE__ */ __name((messenger) => annotate(new Command("r
|
|
|
9068
9300
|
if (!/^\s*y(es)?\s*$/i.test(answer))
|
|
9069
9301
|
throw new CliError("cancelled", "cancelled \u2014 the store is unchanged");
|
|
9070
9302
|
}
|
|
9071
|
-
await quiesce(path,
|
|
9303
|
+
await quiesce(path, owner, "reset", (message) => renderer.warn(message), environmentOf(this).storeLockWaitMs);
|
|
9072
9304
|
const backup = keep ? `${path}.backup-${stampNow()}` : null;
|
|
9073
9305
|
let backedUp = null;
|
|
9074
9306
|
if (backup) {
|
|
@@ -9094,10 +9326,10 @@ var resetCommand = /* @__PURE__ */ __name((messenger) => annotate(new Command("r
|
|
|
9094
9326
|
renderer.note(backup ? `the store is empty at schema ${schema}; \`${command} store restore ${backup}\` puts the old one back once a build can read it` : `the store is empty at schema ${schema}; there is no backup`);
|
|
9095
9327
|
}), "resetCommand");
|
|
9096
9328
|
var STORE_PARTS2 = ["", "-wal", "-shm"];
|
|
9097
|
-
var resetPreview = /* @__PURE__ */ __name(async (path,
|
|
9329
|
+
var resetPreview = /* @__PURE__ */ __name(async (path, owner, env, keep) => {
|
|
9098
9330
|
const files = STORE_PARTS2.map((suffix) => `${path}${suffix}`).filter((file2) => existsSync10(file2));
|
|
9099
9331
|
const holders = holdersOf(files.map((file2) => realpathSync3(file2)));
|
|
9100
|
-
const serving = servingProfiles(
|
|
9332
|
+
const serving = servingProfiles(owner.app, env).length > 0;
|
|
9101
9333
|
const read = await readingOnly(path, (database) => ({
|
|
9102
9334
|
schema: schemaOf(database).version,
|
|
9103
9335
|
tables: emptiedTables(database)
|
|
@@ -9153,6 +9385,21 @@ export {
|
|
|
9153
9385
|
DRY_RUN_DAYS,
|
|
9154
9386
|
dryRun,
|
|
9155
9387
|
senderFacts,
|
|
9388
|
+
AI_PROVIDERS,
|
|
9389
|
+
aiSettingPath,
|
|
9390
|
+
readAiSetting,
|
|
9391
|
+
writeAiSetting,
|
|
9392
|
+
aiSettingOf,
|
|
9393
|
+
aiBaseUrl,
|
|
9394
|
+
aiOrigin,
|
|
9395
|
+
aiImagesAllowed,
|
|
9396
|
+
aiKeys,
|
|
9397
|
+
aiTakesKey,
|
|
9398
|
+
aiLeavesComputer,
|
|
9399
|
+
sharedModel,
|
|
9400
|
+
aiTextReader,
|
|
9401
|
+
checkAi,
|
|
9402
|
+
purposeModel,
|
|
9156
9403
|
replyConsentPathFor,
|
|
9157
9404
|
readReplyConsent,
|
|
9158
9405
|
writeReplyConsent,
|
|
@@ -9181,5 +9428,6 @@ export {
|
|
|
9181
9428
|
serveCommand,
|
|
9182
9429
|
storeSummary,
|
|
9183
9430
|
storeMaintenanceCommands,
|
|
9431
|
+
addStoreMaintenanceCommands,
|
|
9184
9432
|
buildStems
|
|
9185
9433
|
};
|