@wirecat/zoom-cli 0.68.0 → 0.70.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/README.md +1 -1
- package/dist/account-removal.d.ts +6 -0
- package/dist/account-removal.d.ts.map +1 -0
- package/dist/account-removal.js +43 -0
- package/dist/account-removal.js.map +1 -0
- package/dist/bin/zm.js +2 -2
- package/dist/bundle/{all-profiles-R66UM3HM.js → all-profiles-GE2TFJJP.js} +9 -9
- package/dist/bundle/answer-policy-GOXSDYDD.js +104 -0
- package/dist/bundle/{anthropic-4ZI2BPLG.js → anthropic-FA6NHENI.js} +9 -7
- package/dist/bundle/{app-server-64O5IQI5.js → app-server-IRADMSNX.js} +50 -50
- package/dist/bundle/{bun-HUHQD76Z.js → bun-ZYZGGCX5.js} +2 -2
- package/dist/bundle/{bun-sqlite-VOVHPTIF.js → bun-sqlite-Y24TUIGS.js} +4 -4
- package/dist/bundle/{chunk-W42BJ65M.js → chunk-2JEM2YNV.js} +1 -1
- package/dist/bundle/{chunk-3BRV2YU2.js → chunk-2QFPVUM3.js} +2 -2
- package/dist/bundle/{chunk-KAPJQGHE.js → chunk-2U6SER67.js} +1 -1
- package/dist/bundle/{chunk-77I67HWF.js → chunk-3KC7C465.js} +7 -7
- package/dist/bundle/{chunk-YQRNFG2E.js → chunk-4DSIWYGO.js} +7661 -13544
- package/dist/bundle/{chunk-7DUYFITC.js → chunk-56OV5ASY.js} +11 -11
- package/dist/bundle/{chunk-AVEIQMHZ.js → chunk-5XWCBLUR.js} +1 -1
- package/dist/bundle/{chunk-HXOAPH47.js → chunk-6HJFIMT7.js} +1 -1
- package/dist/bundle/{chunk-SSPSNSC5.js → chunk-6IF5ZHDS.js} +1 -1
- package/dist/bundle/{chunk-BOAMDYLY.js → chunk-7QC4M4HS.js} +2 -2
- package/dist/bundle/{chunk-6T3P226D.js → chunk-AISJCF7A.js} +4 -4
- package/dist/bundle/chunk-AT2XKNFN.js +342 -0
- package/dist/bundle/{chunk-BSM43OMN.js → chunk-AUNW7N4I.js} +1 -1
- package/dist/bundle/{chunk-R7LFGEDE.js → chunk-BSS6HX4O.js} +2 -2
- package/dist/bundle/{chunk-FMQS7HCC.js → chunk-BVWF4B33.js} +251 -10
- package/dist/bundle/{chunk-DGNPJGD3.js → chunk-CEJJBZAE.js} +9 -15
- package/dist/bundle/{chunk-L4WVLRXM.js → chunk-CHGUNZ3L.js} +3 -3
- package/dist/bundle/{chunk-LBOSTBAY.js → chunk-CIZ25UPK.js} +3841 -2497
- package/dist/bundle/{chunk-TN3FH2GQ.js → chunk-CSEBB4OP.js} +8 -8
- package/dist/bundle/{chunk-JO4YADNV.js → chunk-D3PNCJD5.js} +5 -5
- package/dist/bundle/{chunk-US5C3WAY.js → chunk-DCUWJITQ.js} +30 -30
- package/dist/bundle/{chunk-QXTREL2M.js → chunk-DNR4B5YV.js} +2 -2
- package/dist/bundle/{chunk-PUTGTW6W.js → chunk-DXCTW3MV.js} +1 -1
- package/dist/bundle/{chunk-B6JMVB6R.js → chunk-EOSVN2ER.js} +1 -1
- package/dist/bundle/{chunk-ZRD3NDOX.js → chunk-GB5X3GBE.js} +23 -1
- package/dist/bundle/{chunk-32FPA7P2.js → chunk-GVT5363M.js} +2 -2
- package/dist/bundle/{chunk-EWIBLDQQ.js → chunk-IINZIP73.js} +7 -7
- package/dist/bundle/{chunk-5JAYUG3X.js → chunk-IS3ZTT2Z.js} +5 -5
- package/dist/bundle/{chunk-LYWUG43B.js → chunk-IWPXWGF7.js} +34 -34
- package/dist/bundle/{chunk-JRCYFCPL.js → chunk-J3SKXICS.js} +350 -136
- package/dist/bundle/{chunk-UDJTRFRV.js → chunk-JRO2FWO2.js} +1 -1
- package/dist/bundle/chunk-JULBAECW.js +126 -0
- package/dist/bundle/{chunk-FNQASORM.js → chunk-KM736RMJ.js} +1 -1
- package/dist/bundle/{chunk-4TLPOY22.js → chunk-KWRCP55G.js} +11 -11
- package/dist/bundle/{chunk-SRP6SFFD.js → chunk-L24UOUWG.js} +1 -1
- package/dist/bundle/{chunk-AJ7CMUGD.js → chunk-LAG5O2FV.js} +218 -231
- package/dist/bundle/{chunk-UU5PLDRA.js → chunk-LXXCLQCW.js} +2 -2
- package/dist/bundle/{chunk-65T3PU75.js → chunk-M6JIXMQZ.js} +5 -1
- package/dist/bundle/{chunk-LV7QRR5S.js → chunk-M7E44TMT.js} +5 -5
- package/dist/bundle/{chunk-6XO7RTJY.js → chunk-M7VUXXGS.js} +110 -8
- package/dist/bundle/{chunk-A63ZFOQJ.js → chunk-MVOMLJYQ.js} +3 -3
- package/dist/bundle/{chunk-DVA6MQWK.js → chunk-OA37BWE5.js} +1 -1
- package/dist/bundle/{chunk-77KFLU5F.js → chunk-OAQLVV6W.js} +2 -2
- package/dist/bundle/{chunk-KNE6VFHZ.js → chunk-OORMSM6O.js} +1 -1
- package/dist/bundle/{chunk-TZUKDM72.js → chunk-PV6OHXHN.js} +16 -16
- package/dist/bundle/{chunk-2OSBCYJT.js → chunk-QL7EMFIC.js} +18 -18
- package/dist/bundle/{chunk-4YFJYSSK.js → chunk-QO2KPU26.js} +45 -29
- package/dist/bundle/{chunk-GOXDBCDM.js → chunk-RB33VTUW.js} +297 -397
- package/dist/bundle/{chunk-TDGZMC6K.js → chunk-RIPAUCKJ.js} +59 -55
- package/dist/bundle/{chunk-6CJ7NHIP.js → chunk-RO3ZR4VP.js} +12 -12
- package/dist/bundle/{chunk-BL36NSV5.js → chunk-RQG5VOGH.js} +12 -2
- package/dist/bundle/{chunk-YTF2WPV4.js → chunk-RRRJCHUC.js} +2162 -1250
- package/dist/bundle/chunk-RWIILYKW.js +66 -0
- package/dist/bundle/{chunk-YJY3W2ZT.js → chunk-SNIY3JDN.js} +21 -18
- package/dist/bundle/{chunk-EH5QGQFR.js → chunk-SVF3NDAO.js} +3 -3
- package/dist/bundle/{chunk-VLD7Y4SY.js → chunk-UVPL7YAY.js} +5 -5
- package/dist/bundle/{chunk-2T6XHWDX.js → chunk-V2E7QFZ3.js} +1 -1
- package/dist/bundle/{chunk-K67V24AT.js → chunk-V5GRSOCZ.js} +4 -4
- package/dist/bundle/{chunk-DWSUSWAX.js → chunk-VE2VNECR.js} +131 -12
- package/dist/bundle/{chunk-RRYUD2EF.js → chunk-VJ5ZU4UF.js} +22 -4
- package/dist/bundle/{chunk-7QNJICKZ.js → chunk-VNU5L37V.js} +26 -26
- package/dist/bundle/{chunk-6TJ62LZQ.js → chunk-VSLDWT4E.js} +3 -3
- package/dist/bundle/{chunk-P2TISY3R.js → chunk-W7ZEEC4K.js} +1 -1
- package/dist/bundle/{chunk-NRRI37NJ.js → chunk-WOIHSQAL.js} +44 -0
- package/dist/bundle/{chunk-EJDV5IIF.js → chunk-X4ZF4XXI.js} +1 -1
- package/dist/bundle/{chunk-FBLUKCIR.js → chunk-XRFHQGOD.js} +1 -1
- package/dist/bundle/{chunk-KUB2U5NT.js → chunk-XWQNJKTP.js} +5 -5
- package/dist/bundle/chunk-Y6C3N7YG.js +12434 -0
- package/dist/bundle/{chunk-474WF55M.js → chunk-YJSPBUGB.js} +63 -32
- package/dist/bundle/{chunk-RP3U3J53.js → chunk-YTN2JN6N.js} +7 -7
- package/dist/bundle/{chunk-Y5LP5SHV.js → chunk-YUHM2OJM.js} +10 -10
- package/dist/bundle/{chunk-7AUP2WT3.js → chunk-ZBKWRYRS.js} +2 -2
- package/dist/bundle/{chunk-355PHJYX.js → chunk-ZS55EERO.js} +1 -1
- package/dist/bundle/{chunk-TUNQ6NE2.js → chunk-ZSKE7N2U.js} +3 -3
- package/dist/bundle/{chunk-PIHBD3YS.js → chunk-ZV3INEKM.js} +4 -4
- package/dist/bundle/{cli-VQJ7ZRYR.js → cli-VRSQ7HAE.js} +76 -60
- package/dist/bundle/command-contract-RPRKHVU6.js +41 -0
- package/dist/bundle/config-QU6A6VIO.js +90 -0
- package/dist/bundle/{decode-L3ENO2XH.js → decode-523PUQMR.js} +4 -4
- package/dist/bundle/{dispatch-5MGDLOK4.js → dispatch-IZCAK47P.js} +1 -1
- package/dist/bundle/{dist-WQLS7U23.js → dist-6WWKPEVW.js} +98 -22
- package/dist/bundle/{echarts-5LLJ6JXC.js → echarts-S5UMX2D3.js} +2 -2
- package/dist/bundle/{embed-37MYTCU7.js → embed-ODPDVHUK.js} +5 -5
- package/dist/bundle/{embedder-GNGHVJAO.js → embedder-PAXRBSZE.js} +8 -8
- package/dist/bundle/{failure-CR64C4XA.js → failure-R2OIHCE5.js} +1 -1
- package/dist/bundle/{first-run-NR5JKYP3.js → first-run-NVTDR5VO.js} +8 -8
- package/dist/bundle/first-screen-5RWZDWLK.js +39 -0
- package/dist/bundle/{folders-VU4IN35Y.js → folders-ZXTOFY4T.js} +3 -3
- package/dist/bundle/{instructions-P72XX4AK.js → instructions-DUB7E6C5.js} +1 -1
- package/dist/bundle/{main-QYFCYSTW.js → main-A7JSYQI6.js} +18 -18
- package/dist/bundle/{meetings-66UQINKI.js → meetings-BDZQV3HR.js} +4 -4
- package/dist/bundle/{node-ZB4RNICS.js → node-E25KP53H.js} +2 -2
- package/dist/bundle/{node-sqlite-XPRKBDF3.js → node-sqlite-PHWDFZCP.js} +5 -5
- package/dist/bundle/{oauth-WJRDUU5J.js → oauth-G2K46IYP.js} +6 -6
- package/dist/bundle/{open-S2YSIEOW.js → open-INWS5HIZ.js} +4 -4
- package/dist/bundle/{openai-CRNZFNZD.js → openai-T44ORVGQ.js} +10 -10
- package/dist/bundle/{output-file-6COFGPUL.js → output-file-YGQYZCBJ.js} +4 -4
- package/dist/bundle/{process-XNN4WG6N.js → process-UJ2JHMJN.js} +1 -1
- package/dist/bundle/{program-BRPJKRCX.js → program-LYTGFV6L.js} +115 -72
- package/dist/bundle/{prompt-7RQOL25I.js → prompt-VTUCRCE4.js} +6 -4
- package/dist/bundle/{recognize-N5WADGQB.js → recognize-3CEPOW2F.js} +3 -3
- package/dist/bundle/{remote-WHYV35IF.js → remote-DRQEXEZL.js} +6 -6
- package/dist/bundle/{rerank-FBMZVWSH.js → rerank-UL4KNNVN.js} +6 -6
- package/dist/bundle/{run-log-TOCHREH2.js → run-log-UZAB5CWF.js} +54 -54
- package/dist/bundle/{serve-4BABX4WS.js → serve-P5UWUOWQ.js} +8 -8
- package/dist/bundle/server-F3NPVMS2.js +72 -0
- package/dist/bundle/{server-CDVI6LOB.js → server-M6XK2Y3X.js} +42 -42
- package/dist/bundle/{services-PIY33I7R.js → services-4HRYNY62.js} +66 -30
- package/dist/bundle/{speech-LS5Q4FL2.js → speech-BBPBMFAO.js} +12 -12
- package/dist/bundle/{state-YUX5R2R7.js → state-GDSUNUSY.js} +5 -5
- package/dist/bundle/{store-BD7HAXAA.js → store-LBQ6FZP2.js} +41 -15
- package/dist/bundle/{store-ERMGBF2B.js → store-VWLABMLF.js} +57 -17
- package/dist/bundle/store-connection-XEBFP56U.js +83 -0
- package/dist/bundle/store-maintenance-command-G43JN57J.js +61 -0
- package/dist/bundle/{streaming-O53PIORL.js → streaming-EJ3NM2C2.js} +5 -5
- package/dist/bundle/{tokens-QKNEP2GJ.js → tokens-BE6CJMR5.js} +5 -5
- package/dist/bundle/zm.js +3 -3
- package/dist/bundle/{zoom-app-XJXZ4ZBX.js → zoom-app-YIEJLWCW.js} +6 -6
- package/dist/first-screen.d.ts.map +1 -1
- package/dist/first-screen.js +1 -0
- package/dist/first-screen.js.map +1 -1
- package/dist/permissions.js +1 -1
- package/dist/permissions.js.map +1 -1
- package/dist/setup-commands.d.ts.map +1 -1
- package/dist/setup-commands.js +11 -0
- package/dist/setup-commands.js.map +1 -1
- package/dist/tokens.d.ts +2 -0
- package/dist/tokens.d.ts.map +1 -1
- package/dist/tokens.js +11 -0
- package/dist/tokens.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +2 -2
- package/dist/bundle/answer-policy-UCGUO53A.js +0 -104
- package/dist/bundle/chunk-AYEVBAGO.js +0 -178
- package/dist/bundle/chunk-EZRPSZJS.js +0 -33
- package/dist/bundle/chunk-NUJMJQXV.js +0 -787
- package/dist/bundle/chunk-YOAEZSDG.js +0 -22
- package/dist/bundle/command-contract-JPUWWYIV.js +0 -41
- package/dist/bundle/config-YGLLR77A.js +0 -90
- package/dist/bundle/first-screen-RCR7ATO2.js +0 -39
- package/dist/bundle/server-XOFQKFVO.js +0 -72
- package/dist/bundle/store-connection-JBR6CMTJ.js +0 -83
- package/dist/bundle/store-maintenance-command-I5DUSO2C.js +0 -62
|
@@ -2,11 +2,11 @@ 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-KM736RMJ.js";
|
|
6
6
|
import {
|
|
7
7
|
answerOf,
|
|
8
8
|
messengerContext
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-DCUWJITQ.js";
|
|
10
10
|
import {
|
|
11
11
|
chatEventAnswer,
|
|
12
12
|
memberAnswer,
|
|
@@ -15,19 +15,22 @@ import {
|
|
|
15
15
|
serveRelay,
|
|
16
16
|
typedQuery,
|
|
17
17
|
withQuery
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-QL7EMFIC.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-SVF3NDAO.js";
|
|
26
26
|
import {
|
|
27
27
|
FETCHING,
|
|
28
28
|
RULES_VERSION,
|
|
29
29
|
applyTaskRulesOnArrival,
|
|
30
30
|
capability,
|
|
31
|
+
embeddingKeys,
|
|
32
|
+
endpointKeyName,
|
|
33
|
+
modelGateway,
|
|
31
34
|
newSendId,
|
|
32
35
|
onlineDeps,
|
|
33
36
|
openRequestTask,
|
|
@@ -36,14 +39,14 @@ import {
|
|
|
36
39
|
servicesFor,
|
|
37
40
|
syncsOneChat,
|
|
38
41
|
withTimeLimit
|
|
39
|
-
} from "./chunk-
|
|
42
|
+
} from "./chunk-RRRJCHUC.js";
|
|
40
43
|
import {
|
|
41
44
|
QUICK_HEALTH_CHECKS,
|
|
42
45
|
explainDamage,
|
|
43
46
|
fts5Tables,
|
|
44
47
|
invalidJson,
|
|
45
48
|
storeHealth
|
|
46
|
-
} from "./chunk-
|
|
49
|
+
} from "./chunk-QO2KPU26.js";
|
|
47
50
|
import {
|
|
48
51
|
Command,
|
|
49
52
|
LOCAL_READ,
|
|
@@ -52,13 +55,11 @@ import {
|
|
|
52
55
|
REMOTE_WRITE,
|
|
53
56
|
annotate,
|
|
54
57
|
destroysNothing,
|
|
55
|
-
endpoint,
|
|
56
58
|
environmentOf,
|
|
57
59
|
itemOf,
|
|
58
60
|
jsonlRecords,
|
|
59
61
|
lineOf,
|
|
60
62
|
listOf,
|
|
61
|
-
modelTarget,
|
|
62
63
|
nextStep,
|
|
63
64
|
outputFor,
|
|
64
65
|
recalledAccount,
|
|
@@ -67,24 +68,19 @@ import {
|
|
|
67
68
|
snakeKeys,
|
|
68
69
|
storeTable,
|
|
69
70
|
withoutProviderRefs
|
|
70
|
-
} from "./chunk-
|
|
71
|
-
import {
|
|
72
|
-
envName
|
|
73
|
-
} from "./chunk-AVEIQMHZ.js";
|
|
71
|
+
} from "./chunk-LAG5O2FV.js";
|
|
74
72
|
import {
|
|
75
73
|
holdersOf
|
|
76
|
-
} from "./chunk-
|
|
74
|
+
} from "./chunk-OA37BWE5.js";
|
|
77
75
|
import {
|
|
78
76
|
codeOf,
|
|
79
77
|
currentRun,
|
|
78
|
+
modelTarget,
|
|
80
79
|
parseDuration
|
|
81
|
-
} from "./chunk-
|
|
82
|
-
import {
|
|
83
|
-
failureKey
|
|
84
|
-
} from "./chunk-YOAEZSDG.js";
|
|
80
|
+
} from "./chunk-J3SKXICS.js";
|
|
85
81
|
import {
|
|
86
82
|
levelFor
|
|
87
|
-
} from "./chunk-
|
|
83
|
+
} from "./chunk-M6JIXMQZ.js";
|
|
88
84
|
import {
|
|
89
85
|
CORPORA,
|
|
90
86
|
MIGRATIONS,
|
|
@@ -118,48 +114,44 @@ import {
|
|
|
118
114
|
storeClients,
|
|
119
115
|
storeContents,
|
|
120
116
|
vectorIndexCounts
|
|
121
|
-
} from "./chunk-
|
|
117
|
+
} from "./chunk-4DSIWYGO.js";
|
|
122
118
|
import {
|
|
123
119
|
formatLocator,
|
|
124
120
|
parseLocator
|
|
125
|
-
} from "./chunk-
|
|
121
|
+
} from "./chunk-Y6C3N7YG.js";
|
|
126
122
|
import {
|
|
127
|
-
|
|
128
|
-
|
|
123
|
+
readDamageMark,
|
|
124
|
+
readHealthMark,
|
|
125
|
+
recordDeepCheck
|
|
126
|
+
} from "./chunk-VE2VNECR.js";
|
|
129
127
|
import {
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
} from "./chunk-
|
|
128
|
+
failureKey,
|
|
129
|
+
isStoreDamage
|
|
130
|
+
} from "./chunk-RWIILYKW.js";
|
|
133
131
|
import {
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
validateImages
|
|
137
|
-
} from "./chunk-ZRD3NDOX.js";
|
|
132
|
+
readSecret
|
|
133
|
+
} from "./chunk-VJ5ZU4UF.js";
|
|
138
134
|
import {
|
|
139
135
|
storePath
|
|
140
|
-
} from "./chunk-
|
|
136
|
+
} from "./chunk-GVT5363M.js";
|
|
141
137
|
import {
|
|
142
138
|
openCache
|
|
143
|
-
} from "./chunk-
|
|
139
|
+
} from "./chunk-M7E44TMT.js";
|
|
144
140
|
import {
|
|
145
141
|
queryFieldsOf
|
|
146
|
-
} from "./chunk-
|
|
142
|
+
} from "./chunk-EOSVN2ER.js";
|
|
147
143
|
import {
|
|
148
|
-
Credentials,
|
|
149
|
-
pathsAreOverridden,
|
|
150
144
|
resolvePaths,
|
|
151
145
|
writeSecurely
|
|
152
|
-
} from "./chunk-
|
|
146
|
+
} from "./chunk-OORMSM6O.js";
|
|
153
147
|
import {
|
|
154
148
|
array,
|
|
155
149
|
boolean,
|
|
156
150
|
check,
|
|
157
151
|
forward,
|
|
158
152
|
getDotPath,
|
|
159
|
-
integer,
|
|
160
153
|
minLength,
|
|
161
154
|
nullable,
|
|
162
|
-
number,
|
|
163
155
|
object,
|
|
164
156
|
optional,
|
|
165
157
|
parse,
|
|
@@ -171,9 +163,8 @@ import {
|
|
|
171
163
|
strictObject,
|
|
172
164
|
string,
|
|
173
165
|
transform,
|
|
174
|
-
trim
|
|
175
|
-
|
|
176
|
-
} from "./chunk-NRRI37NJ.js";
|
|
166
|
+
trim
|
|
167
|
+
} from "./chunk-WOIHSQAL.js";
|
|
177
168
|
import {
|
|
178
169
|
CliError
|
|
179
170
|
} from "./chunk-FEM2JQN2.js";
|
|
@@ -354,14 +345,14 @@ var require_liquid_node = __commonJS({
|
|
|
354
345
|
return value !== null && (type === "object" || type === "function");
|
|
355
346
|
}
|
|
356
347
|
__name(isObject, "isObject");
|
|
357
|
-
function
|
|
348
|
+
function range(start, stop, step = 1) {
|
|
358
349
|
const arr = [];
|
|
359
350
|
for (let i = start; i < stop; i += step) {
|
|
360
351
|
arr.push(i);
|
|
361
352
|
}
|
|
362
353
|
return arr;
|
|
363
354
|
}
|
|
364
|
-
__name(
|
|
355
|
+
__name(range, "range");
|
|
365
356
|
function padStart(str, length, ch = " ") {
|
|
366
357
|
return pad(str, length, ch, (str2, ch2) => ch2 + str2);
|
|
367
358
|
}
|
|
@@ -555,7 +546,7 @@ var require_liquid_node = __commonJS({
|
|
|
555
546
|
const lines = token.input.split("\n");
|
|
556
547
|
const begin = Math.max(line - 2, 1);
|
|
557
548
|
const end = Math.min(line + 3, lines.length);
|
|
558
|
-
const context =
|
|
549
|
+
const context = range(begin, end + 1).map((lineNumber) => {
|
|
559
550
|
const rowIndicator = lineNumber === line ? ">> " : " ";
|
|
560
551
|
const num = padStart(String(lineNumber), String(end).length);
|
|
561
552
|
let text = `${rowIndicator}${num}| `;
|
|
@@ -1133,8 +1124,8 @@ var require_liquid_node = __commonJS({
|
|
|
1133
1124
|
valid() {
|
|
1134
1125
|
return !isNaN(this.getTime());
|
|
1135
1126
|
}
|
|
1136
|
-
format(
|
|
1137
|
-
return this.DateTimeFormat && this.DateTimeFormat(this.locale,
|
|
1127
|
+
format(options) {
|
|
1128
|
+
return this.DateTimeFormat && this.DateTimeFormat(this.locale, options).format(this.displayDate);
|
|
1138
1129
|
}
|
|
1139
1130
|
/**
|
|
1140
1131
|
* Create a Date object fixed to it's declared Timezone. Both
|
|
@@ -1218,11 +1209,11 @@ var require_liquid_node = __commonJS({
|
|
|
1218
1209
|
static {
|
|
1219
1210
|
__name(this, "TagToken");
|
|
1220
1211
|
}
|
|
1221
|
-
constructor(input, begin, end,
|
|
1222
|
-
const { trimTagLeft, trimTagRight, tagDelimiterLeft, tagDelimiterRight } =
|
|
1212
|
+
constructor(input, begin, end, options, file2) {
|
|
1213
|
+
const { trimTagLeft, trimTagRight, tagDelimiterLeft, tagDelimiterRight } = options;
|
|
1223
1214
|
const [valueBegin, valueEnd] = [begin + tagDelimiterLeft.length, end - tagDelimiterRight.length];
|
|
1224
1215
|
super(exports.TokenKind.Tag, [valueBegin, valueEnd], input, begin, end, trimTagLeft, trimTagRight, file2);
|
|
1225
|
-
this.tokenizer = new Tokenizer(input,
|
|
1216
|
+
this.tokenizer = new Tokenizer(input, options.operators, file2, this.contentRange, options.groupedExpressions);
|
|
1226
1217
|
this.name = this.tokenizer.readTagName();
|
|
1227
1218
|
this.tokenizer.assert(this.name, `illegal tag syntax, tag name expected`);
|
|
1228
1219
|
this.tokenizer.skipBlank();
|
|
@@ -1233,8 +1224,8 @@ var require_liquid_node = __commonJS({
|
|
|
1233
1224
|
static {
|
|
1234
1225
|
__name(this, "OutputToken");
|
|
1235
1226
|
}
|
|
1236
|
-
constructor(input, begin, end,
|
|
1237
|
-
const { trimOutputLeft, trimOutputRight, outputDelimiterLeft, outputDelimiterRight } =
|
|
1227
|
+
constructor(input, begin, end, options, file2) {
|
|
1228
|
+
const { trimOutputLeft, trimOutputRight, outputDelimiterLeft, outputDelimiterRight } = options;
|
|
1238
1229
|
const valueRange = [begin + outputDelimiterLeft.length, end - outputDelimiterRight.length];
|
|
1239
1230
|
super(exports.TokenKind.Output, valueRange, input, begin, end, trimOutputLeft, trimOutputRight, file2);
|
|
1240
1231
|
}
|
|
@@ -1453,9 +1444,9 @@ var require_liquid_node = __commonJS({
|
|
|
1453
1444
|
static {
|
|
1454
1445
|
__name(this, "LiquidTagToken");
|
|
1455
1446
|
}
|
|
1456
|
-
constructor(input, begin, end,
|
|
1447
|
+
constructor(input, begin, end, options, file2) {
|
|
1457
1448
|
super(exports.TokenKind.Tag, [begin, end], input, begin, end, false, false, file2);
|
|
1458
|
-
this.tokenizer = new Tokenizer(input,
|
|
1449
|
+
this.tokenizer = new Tokenizer(input, options.operators, file2, this.contentRange, options.groupedExpressions);
|
|
1459
1450
|
this.name = this.tokenizer.readTagName();
|
|
1460
1451
|
this.tokenizer.assert(this.name, "illegal liquid tag syntax");
|
|
1461
1452
|
this.tokenizer.skipBlank();
|
|
@@ -1529,11 +1520,11 @@ var require_liquid_node = __commonJS({
|
|
|
1529
1520
|
static {
|
|
1530
1521
|
__name(this, "Filter");
|
|
1531
1522
|
}
|
|
1532
|
-
constructor(token,
|
|
1523
|
+
constructor(token, options, liquid) {
|
|
1533
1524
|
this.token = token;
|
|
1534
1525
|
this.name = token.name;
|
|
1535
|
-
this.handler = isFunction(
|
|
1536
|
-
this.raw = !isFunction(
|
|
1526
|
+
this.handler = isFunction(options) ? options : isFunction(options?.handler) ? options.handler : identify;
|
|
1527
|
+
this.raw = !isFunction(options) && !!options?.raw;
|
|
1537
1528
|
this.args = token.args;
|
|
1538
1529
|
this.liquid = liquid;
|
|
1539
1530
|
}
|
|
@@ -1636,7 +1627,7 @@ var require_liquid_node = __commonJS({
|
|
|
1636
1627
|
const low = yield evalTokenValue(token.lhs, ctx);
|
|
1637
1628
|
const high = yield evalTokenValue(token.rhs, ctx);
|
|
1638
1629
|
ctx.memoryLimit.use(high - low + 1);
|
|
1639
|
-
return
|
|
1630
|
+
return range(+low, +high + 1);
|
|
1640
1631
|
}
|
|
1641
1632
|
__name(evalRangeToken, "evalRangeToken");
|
|
1642
1633
|
function* toPostfix(tokens) {
|
|
@@ -2117,41 +2108,41 @@ var require_liquid_node = __commonJS({
|
|
|
2117
2108
|
parseLimit: Infinity,
|
|
2118
2109
|
renderLimit: Infinity
|
|
2119
2110
|
};
|
|
2120
|
-
function normalize(
|
|
2121
|
-
if (
|
|
2122
|
-
if (!
|
|
2123
|
-
|
|
2124
|
-
if (!
|
|
2125
|
-
|
|
2126
|
-
}
|
|
2127
|
-
if (
|
|
2111
|
+
function normalize(options) {
|
|
2112
|
+
if (options.hasOwnProperty("root")) {
|
|
2113
|
+
if (!options.hasOwnProperty("partials"))
|
|
2114
|
+
options.partials = options.root;
|
|
2115
|
+
if (!options.hasOwnProperty("layouts"))
|
|
2116
|
+
options.layouts = options.root;
|
|
2117
|
+
}
|
|
2118
|
+
if (options.hasOwnProperty("cache")) {
|
|
2128
2119
|
let cache;
|
|
2129
|
-
if (typeof
|
|
2130
|
-
cache =
|
|
2131
|
-
else if (typeof
|
|
2132
|
-
cache =
|
|
2120
|
+
if (typeof options.cache === "number")
|
|
2121
|
+
cache = options.cache > 0 ? new LRU(options.cache) : void 0;
|
|
2122
|
+
else if (typeof options.cache === "object")
|
|
2123
|
+
cache = options.cache;
|
|
2133
2124
|
else
|
|
2134
|
-
cache =
|
|
2135
|
-
|
|
2125
|
+
cache = options.cache ? new LRU(1024) : void 0;
|
|
2126
|
+
options.cache = cache;
|
|
2136
2127
|
}
|
|
2137
|
-
|
|
2138
|
-
if ((!
|
|
2128
|
+
options = { ...defaultOptions, ...options.jekyllInclude ? { dynamicPartials: false } : {}, ...options };
|
|
2129
|
+
if ((!options.fs.dirname || !options.fs.sep) && options.relativeReference) {
|
|
2139
2130
|
console.warn("[LiquidJS] `fs.dirname` and `fs.sep` are required for relativeReference, set relativeReference to `false` to suppress this warning");
|
|
2140
|
-
|
|
2131
|
+
options.relativeReference = false;
|
|
2141
2132
|
}
|
|
2142
|
-
|
|
2143
|
-
|
|
2144
|
-
|
|
2145
|
-
|
|
2146
|
-
if (!
|
|
2147
|
-
|
|
2133
|
+
options.root = normalizeDirectoryList(options.root);
|
|
2134
|
+
options.partials = normalizeDirectoryList(options.partials);
|
|
2135
|
+
options.layouts = normalizeDirectoryList(options.layouts);
|
|
2136
|
+
options.outputEscape = options.outputEscape && getOutputEscapeFunction(options.outputEscape);
|
|
2137
|
+
if (!options.locale) {
|
|
2138
|
+
options.locale = getDateTimeFormat()?.().resolvedOptions().locale ?? "en-US";
|
|
2148
2139
|
}
|
|
2149
|
-
if (
|
|
2150
|
-
|
|
2151
|
-
|
|
2152
|
-
|
|
2140
|
+
if (options.templates) {
|
|
2141
|
+
options.fs = new MapFS(options.templates);
|
|
2142
|
+
options.relativeReference = true;
|
|
2143
|
+
options.root = options.partials = options.layouts = ".";
|
|
2153
2144
|
}
|
|
2154
|
-
return
|
|
2145
|
+
return options;
|
|
2155
2146
|
}
|
|
2156
2147
|
__name(normalize, "normalize");
|
|
2157
2148
|
function getOutputEscapeFunction(nameOrFunction) {
|
|
@@ -2172,14 +2163,14 @@ var require_liquid_node = __commonJS({
|
|
|
2172
2163
|
return list;
|
|
2173
2164
|
}
|
|
2174
2165
|
__name(normalizeDirectoryList, "normalizeDirectoryList");
|
|
2175
|
-
function whiteSpaceCtrl(tokens,
|
|
2166
|
+
function whiteSpaceCtrl(tokens, options) {
|
|
2176
2167
|
let inRaw = false;
|
|
2177
2168
|
for (let i = 0; i < tokens.length; i++) {
|
|
2178
2169
|
const token = tokens[i];
|
|
2179
2170
|
if (!isDelimitedToken(token))
|
|
2180
2171
|
continue;
|
|
2181
2172
|
if (!inRaw && token.trimLeft) {
|
|
2182
|
-
trimLeft(tokens[i - 1],
|
|
2173
|
+
trimLeft(tokens[i - 1], options.greedy);
|
|
2183
2174
|
}
|
|
2184
2175
|
if (isTagToken(token)) {
|
|
2185
2176
|
if (token.name === "raw")
|
|
@@ -2188,7 +2179,7 @@ var require_liquid_node = __commonJS({
|
|
|
2188
2179
|
inRaw = false;
|
|
2189
2180
|
}
|
|
2190
2181
|
if (!inRaw && token.trimRight) {
|
|
2191
|
-
trimRight(tokens[i + 1],
|
|
2182
|
+
trimRight(tokens[i + 1], options.greedy);
|
|
2192
2183
|
}
|
|
2193
2184
|
}
|
|
2194
2185
|
}
|
|
@@ -2215,12 +2206,12 @@ var require_liquid_node = __commonJS({
|
|
|
2215
2206
|
static {
|
|
2216
2207
|
__name(this, "Tokenizer");
|
|
2217
2208
|
}
|
|
2218
|
-
constructor(input, operators = defaultOptions.operators, file2,
|
|
2209
|
+
constructor(input, operators = defaultOptions.operators, file2, range2, groupedExpressions = false) {
|
|
2219
2210
|
this.input = input;
|
|
2220
2211
|
this.file = file2;
|
|
2221
2212
|
this.rawBeginAt = -1;
|
|
2222
|
-
this.p =
|
|
2223
|
-
this.N =
|
|
2213
|
+
this.p = range2 ? range2[0] : 0;
|
|
2214
|
+
this.N = range2 ? range2[1] : input.length;
|
|
2224
2215
|
this.opTrie = createTrie(operators);
|
|
2225
2216
|
this.literalTrie = createTrie(literalValues);
|
|
2226
2217
|
this.groupedExpressions = groupedExpressions;
|
|
@@ -2320,23 +2311,23 @@ var require_liquid_node = __commonJS({
|
|
|
2320
2311
|
const value = this.readValue();
|
|
2321
2312
|
return [key.getText(), value];
|
|
2322
2313
|
}
|
|
2323
|
-
readTopLevelTokens(
|
|
2314
|
+
readTopLevelTokens(options = defaultOptions) {
|
|
2324
2315
|
const tokens = [];
|
|
2325
2316
|
while (this.p < this.N) {
|
|
2326
|
-
const token = this.readTopLevelToken(
|
|
2317
|
+
const token = this.readTopLevelToken(options);
|
|
2327
2318
|
tokens.push(token);
|
|
2328
2319
|
}
|
|
2329
|
-
whiteSpaceCtrl(tokens,
|
|
2320
|
+
whiteSpaceCtrl(tokens, options);
|
|
2330
2321
|
return tokens;
|
|
2331
2322
|
}
|
|
2332
|
-
readTopLevelToken(
|
|
2333
|
-
const { tagDelimiterLeft, outputDelimiterLeft } =
|
|
2323
|
+
readTopLevelToken(options) {
|
|
2324
|
+
const { tagDelimiterLeft, outputDelimiterLeft } = options;
|
|
2334
2325
|
if (this.rawBeginAt > -1)
|
|
2335
|
-
return this.readEndrawOrRawContent(
|
|
2326
|
+
return this.readEndrawOrRawContent(options);
|
|
2336
2327
|
if (this.match(tagDelimiterLeft))
|
|
2337
|
-
return this.readTagToken(
|
|
2328
|
+
return this.readTagToken(options);
|
|
2338
2329
|
if (this.match(outputDelimiterLeft))
|
|
2339
|
-
return this.readOutputToken(
|
|
2330
|
+
return this.readOutputToken(options);
|
|
2340
2331
|
return this.readHTMLToken([tagDelimiterLeft, outputDelimiterLeft]);
|
|
2341
2332
|
}
|
|
2342
2333
|
readHTMLToken(stopStrings) {
|
|
@@ -2348,13 +2339,13 @@ var require_liquid_node = __commonJS({
|
|
|
2348
2339
|
}
|
|
2349
2340
|
return new HTMLToken(this.input, begin, this.p, this.file);
|
|
2350
2341
|
}
|
|
2351
|
-
readTagToken(
|
|
2342
|
+
readTagToken(options) {
|
|
2352
2343
|
const { file: file2, input } = this;
|
|
2353
2344
|
const begin = this.p;
|
|
2354
|
-
if (this.readToDelimiter(
|
|
2345
|
+
if (this.readToDelimiter(options.tagDelimiterRight) === -1) {
|
|
2355
2346
|
throw this.error(`tag ${this.snapshot(begin)} not closed`, begin);
|
|
2356
2347
|
}
|
|
2357
|
-
const token = new TagToken(input, begin, this.p,
|
|
2348
|
+
const token = new TagToken(input, begin, this.p, options, file2);
|
|
2358
2349
|
if (token.name === "raw")
|
|
2359
2350
|
this.rawBeginAt = begin;
|
|
2360
2351
|
return token;
|
|
@@ -2372,17 +2363,17 @@ var require_liquid_node = __commonJS({
|
|
|
2372
2363
|
}
|
|
2373
2364
|
return -1;
|
|
2374
2365
|
}
|
|
2375
|
-
readOutputToken(
|
|
2366
|
+
readOutputToken(options = defaultOptions) {
|
|
2376
2367
|
const { file: file2, input } = this;
|
|
2377
|
-
const { outputDelimiterRight } =
|
|
2368
|
+
const { outputDelimiterRight } = options;
|
|
2378
2369
|
const begin = this.p;
|
|
2379
2370
|
if (this.readToDelimiter(outputDelimiterRight, true) === -1) {
|
|
2380
2371
|
throw this.error(`output ${this.snapshot(begin)} not closed`, begin);
|
|
2381
2372
|
}
|
|
2382
|
-
return new OutputToken(input, begin, this.p,
|
|
2373
|
+
return new OutputToken(input, begin, this.p, options, file2);
|
|
2383
2374
|
}
|
|
2384
|
-
readEndrawOrRawContent(
|
|
2385
|
-
const { tagDelimiterLeft, tagDelimiterRight } =
|
|
2375
|
+
readEndrawOrRawContent(options) {
|
|
2376
|
+
const { tagDelimiterLeft, tagDelimiterRight } = options;
|
|
2386
2377
|
const begin = this.p;
|
|
2387
2378
|
let leftPos = this.readTo(tagDelimiterLeft) - tagDelimiterLeft.length;
|
|
2388
2379
|
while (this.p < this.N) {
|
|
@@ -2395,7 +2386,7 @@ var require_liquid_node = __commonJS({
|
|
|
2395
2386
|
const end = this.p;
|
|
2396
2387
|
if (begin === leftPos) {
|
|
2397
2388
|
this.rawBeginAt = -1;
|
|
2398
|
-
return new TagToken(this.input, begin, end,
|
|
2389
|
+
return new TagToken(this.input, begin, end, options, this.file);
|
|
2399
2390
|
} else {
|
|
2400
2391
|
this.p = leftPos;
|
|
2401
2392
|
return new HTMLToken(this.input, begin, leftPos, this.file);
|
|
@@ -2408,22 +2399,22 @@ var require_liquid_node = __commonJS({
|
|
|
2408
2399
|
}
|
|
2409
2400
|
throw this.error(`raw ${this.snapshot(this.rawBeginAt)} not closed`, begin);
|
|
2410
2401
|
}
|
|
2411
|
-
readLiquidTagTokens(
|
|
2402
|
+
readLiquidTagTokens(options = defaultOptions) {
|
|
2412
2403
|
const tokens = [];
|
|
2413
2404
|
while (this.p < this.N) {
|
|
2414
|
-
const token = this.readLiquidTagToken(
|
|
2405
|
+
const token = this.readLiquidTagToken(options);
|
|
2415
2406
|
token && tokens.push(token);
|
|
2416
2407
|
}
|
|
2417
2408
|
return tokens;
|
|
2418
2409
|
}
|
|
2419
|
-
readLiquidTagToken(
|
|
2410
|
+
readLiquidTagToken(options) {
|
|
2420
2411
|
this.skipBlank();
|
|
2421
2412
|
if (this.end())
|
|
2422
2413
|
return;
|
|
2423
2414
|
const begin = this.p;
|
|
2424
2415
|
this.readToDelimiter("\n");
|
|
2425
2416
|
const end = this.p;
|
|
2426
|
-
return new LiquidTagToken(this.input, begin, end,
|
|
2417
|
+
return new LiquidTagToken(this.input, begin, end, options, this.file);
|
|
2427
2418
|
}
|
|
2428
2419
|
error(msg, pos = this.p) {
|
|
2429
2420
|
return new TokenizationError(msg, new IdentifierToken(this.input, pos, this.N, this.file));
|
|
@@ -2635,12 +2626,12 @@ var require_liquid_node = __commonJS({
|
|
|
2635
2626
|
}
|
|
2636
2627
|
return new QuotedToken(this.input, begin, this.p, this.file);
|
|
2637
2628
|
}
|
|
2638
|
-
*readFileNameTemplate(
|
|
2639
|
-
const { outputDelimiterLeft } =
|
|
2629
|
+
*readFileNameTemplate(options) {
|
|
2630
|
+
const { outputDelimiterLeft } = options;
|
|
2640
2631
|
const htmlStopStrings = [",", " ", "\r", "\n", " ", outputDelimiterLeft];
|
|
2641
2632
|
const htmlStopStringSet = new Set(htmlStopStrings);
|
|
2642
2633
|
while (this.p < this.N && !htmlStopStringSet.has(this.peek())) {
|
|
2643
|
-
yield this.match(outputDelimiterLeft) ? this.readOutputToken(
|
|
2634
|
+
yield this.match(outputDelimiterLeft) ? this.readOutputToken(options) : this.readHTMLToken(htmlStopStrings);
|
|
2644
2635
|
}
|
|
2645
2636
|
}
|
|
2646
2637
|
match(word) {
|
|
@@ -2715,7 +2706,7 @@ var require_liquid_node = __commonJS({
|
|
|
2715
2706
|
this.token = token;
|
|
2716
2707
|
}
|
|
2717
2708
|
};
|
|
2718
|
-
var
|
|
2709
|
+
var Tag3 = class extends TemplateImpl {
|
|
2719
2710
|
static {
|
|
2720
2711
|
__name(this, "Tag");
|
|
2721
2712
|
}
|
|
@@ -2745,17 +2736,17 @@ var require_liquid_node = __commonJS({
|
|
|
2745
2736
|
return hash;
|
|
2746
2737
|
}
|
|
2747
2738
|
};
|
|
2748
|
-
function createTagClass(
|
|
2749
|
-
return class extends
|
|
2739
|
+
function createTagClass(options) {
|
|
2740
|
+
return class extends Tag3 {
|
|
2750
2741
|
constructor(token, tokens, liquid) {
|
|
2751
2742
|
super(token, tokens, liquid);
|
|
2752
|
-
if (isFunction(
|
|
2753
|
-
|
|
2743
|
+
if (isFunction(options.parse)) {
|
|
2744
|
+
options.parse.call(this, token, tokens);
|
|
2754
2745
|
}
|
|
2755
2746
|
}
|
|
2756
2747
|
*render(ctx, emitter) {
|
|
2757
2748
|
const hash = yield new Hash(this.token.args, ctx.opts.keyValueSeparator).render(ctx);
|
|
2758
|
-
return yield
|
|
2749
|
+
return yield options.render.call(this, ctx, emitter, hash);
|
|
2759
2750
|
}
|
|
2760
2751
|
};
|
|
2761
2752
|
}
|
|
@@ -2972,13 +2963,13 @@ var require_liquid_node = __commonJS({
|
|
|
2972
2963
|
};
|
|
2973
2964
|
}
|
|
2974
2965
|
__name(_analyze, "_analyze");
|
|
2975
|
-
function analyze(template2,
|
|
2976
|
-
const opts = { ...defaultStaticAnalysisOptions, ...
|
|
2966
|
+
function analyze(template2, options = {}) {
|
|
2967
|
+
const opts = { ...defaultStaticAnalysisOptions, ...options };
|
|
2977
2968
|
return toPromise(_analyze(template2, opts.partials, false));
|
|
2978
2969
|
}
|
|
2979
2970
|
__name(analyze, "analyze");
|
|
2980
|
-
function analyzeSync(template2,
|
|
2981
|
-
const opts = { ...defaultStaticAnalysisOptions, ...
|
|
2971
|
+
function analyzeSync(template2, options = {}) {
|
|
2972
|
+
const opts = { ...defaultStaticAnalysisOptions, ...options };
|
|
2982
2973
|
return toValueSync(_analyze(template2, opts.partials, true));
|
|
2983
2974
|
}
|
|
2984
2975
|
__name(analyzeSync, "analyzeSync");
|
|
@@ -3154,17 +3145,17 @@ var require_liquid_node = __commonJS({
|
|
|
3154
3145
|
static {
|
|
3155
3146
|
__name(this, "Loader");
|
|
3156
3147
|
}
|
|
3157
|
-
constructor(
|
|
3158
|
-
this.options =
|
|
3159
|
-
if (
|
|
3160
|
-
const sep =
|
|
3148
|
+
constructor(options) {
|
|
3149
|
+
this.options = options;
|
|
3150
|
+
if (options.relativeReference) {
|
|
3151
|
+
const sep = options.fs.sep;
|
|
3161
3152
|
assert(sep, "`fs.sep` is required for relative reference");
|
|
3162
3153
|
const prefixes = ["." + sep, ".." + sep, "./", "../"];
|
|
3163
3154
|
this.shouldLoadRelative = (referencedFile) => prefixes.some((prefix) => referencedFile.startsWith(prefix));
|
|
3164
3155
|
} else {
|
|
3165
3156
|
this.shouldLoadRelative = (_referencedFile) => false;
|
|
3166
3157
|
}
|
|
3167
|
-
const fs2 =
|
|
3158
|
+
const fs2 = options.fs;
|
|
3168
3159
|
this.contains = toLiquidAsync(fs2.contains?.bind(fs2) || (async () => true), fs2.containsSync?.bind(fs2) || (() => true));
|
|
3169
3160
|
this.exists = toLiquidAsync(fs2.exists?.bind(fs2) || (async () => false), fs2.existsSync?.bind(fs2));
|
|
3170
3161
|
}
|
|
@@ -4314,7 +4305,7 @@ var require_liquid_node = __commonJS({
|
|
|
4314
4305
|
...cryptoFilters,
|
|
4315
4306
|
...misc
|
|
4316
4307
|
};
|
|
4317
|
-
var AssignTag = class extends
|
|
4308
|
+
var AssignTag = class extends Tag3 {
|
|
4318
4309
|
static {
|
|
4319
4310
|
__name(this, "AssignTag");
|
|
4320
4311
|
}
|
|
@@ -4339,7 +4330,7 @@ var require_liquid_node = __commonJS({
|
|
|
4339
4330
|
}
|
|
4340
4331
|
};
|
|
4341
4332
|
var MODIFIERS = ["offset", "limit", "reversed"];
|
|
4342
|
-
var ForTag = class extends
|
|
4333
|
+
var ForTag = class extends Tag3 {
|
|
4343
4334
|
static {
|
|
4344
4335
|
__name(this, "ForTag");
|
|
4345
4336
|
}
|
|
@@ -4432,7 +4423,7 @@ var require_liquid_node = __commonJS({
|
|
|
4432
4423
|
return arr.slice(0, count3);
|
|
4433
4424
|
}
|
|
4434
4425
|
__name(limit2, "limit");
|
|
4435
|
-
var CaptureTag = class extends
|
|
4426
|
+
var CaptureTag = class extends Tag3 {
|
|
4436
4427
|
static {
|
|
4437
4428
|
__name(this, "CaptureTag");
|
|
4438
4429
|
}
|
|
@@ -4470,7 +4461,7 @@ var require_liquid_node = __commonJS({
|
|
|
4470
4461
|
yield this.identifier;
|
|
4471
4462
|
}
|
|
4472
4463
|
};
|
|
4473
|
-
var CaseTag = class extends
|
|
4464
|
+
var CaseTag = class extends Tag3 {
|
|
4474
4465
|
static {
|
|
4475
4466
|
__name(this, "CaseTag");
|
|
4476
4467
|
}
|
|
@@ -4543,7 +4534,7 @@ var require_liquid_node = __commonJS({
|
|
|
4543
4534
|
return templates;
|
|
4544
4535
|
}
|
|
4545
4536
|
};
|
|
4546
|
-
var CommentTag = class extends
|
|
4537
|
+
var CommentTag = class extends Tag3 {
|
|
4547
4538
|
static {
|
|
4548
4539
|
__name(this, "CommentTag");
|
|
4549
4540
|
}
|
|
@@ -4559,7 +4550,7 @@ var require_liquid_node = __commonJS({
|
|
|
4559
4550
|
render() {
|
|
4560
4551
|
}
|
|
4561
4552
|
};
|
|
4562
|
-
var RenderTag = class extends
|
|
4553
|
+
var RenderTag = class extends Tag3 {
|
|
4563
4554
|
static {
|
|
4564
4555
|
__name(this, "RenderTag");
|
|
4565
4556
|
}
|
|
@@ -4706,7 +4697,7 @@ var require_liquid_node = __commonJS({
|
|
|
4706
4697
|
return yield evalToken(file2, ctx);
|
|
4707
4698
|
}
|
|
4708
4699
|
__name(renderFilePath, "renderFilePath");
|
|
4709
|
-
var IncludeTag = class extends
|
|
4700
|
+
var IncludeTag = class extends Tag3 {
|
|
4710
4701
|
static {
|
|
4711
4702
|
__name(this, "IncludeTag");
|
|
4712
4703
|
}
|
|
@@ -4774,7 +4765,7 @@ var require_liquid_node = __commonJS({
|
|
|
4774
4765
|
}
|
|
4775
4766
|
}
|
|
4776
4767
|
};
|
|
4777
|
-
var DecrementTag = class extends
|
|
4768
|
+
var DecrementTag = class extends Tag3 {
|
|
4778
4769
|
static {
|
|
4779
4770
|
__name(this, "DecrementTag");
|
|
4780
4771
|
}
|
|
@@ -4794,7 +4785,7 @@ var require_liquid_node = __commonJS({
|
|
|
4794
4785
|
yield this.identifier;
|
|
4795
4786
|
}
|
|
4796
4787
|
};
|
|
4797
|
-
var CycleTag = class extends
|
|
4788
|
+
var CycleTag = class extends Tag3 {
|
|
4798
4789
|
static {
|
|
4799
4790
|
__name(this, "CycleTag");
|
|
4800
4791
|
}
|
|
@@ -4838,7 +4829,7 @@ var require_liquid_node = __commonJS({
|
|
|
4838
4829
|
}
|
|
4839
4830
|
}
|
|
4840
4831
|
};
|
|
4841
|
-
var IfTag = class extends
|
|
4832
|
+
var IfTag = class extends Tag3 {
|
|
4842
4833
|
static {
|
|
4843
4834
|
__name(this, "IfTag");
|
|
4844
4835
|
}
|
|
@@ -4888,7 +4879,7 @@ var require_liquid_node = __commonJS({
|
|
|
4888
4879
|
return this.branches.map((b) => b.value);
|
|
4889
4880
|
}
|
|
4890
4881
|
};
|
|
4891
|
-
var IncrementTag = class extends
|
|
4882
|
+
var IncrementTag = class extends Tag3 {
|
|
4892
4883
|
static {
|
|
4893
4884
|
__name(this, "IncrementTag");
|
|
4894
4885
|
}
|
|
@@ -4910,7 +4901,7 @@ var require_liquid_node = __commonJS({
|
|
|
4910
4901
|
yield this.identifier;
|
|
4911
4902
|
}
|
|
4912
4903
|
};
|
|
4913
|
-
var LayoutTag = class extends
|
|
4904
|
+
var LayoutTag = class extends Tag3 {
|
|
4914
4905
|
static {
|
|
4915
4906
|
__name(this, "LayoutTag");
|
|
4916
4907
|
}
|
|
@@ -4965,7 +4956,7 @@ var require_liquid_node = __commonJS({
|
|
|
4965
4956
|
}
|
|
4966
4957
|
}
|
|
4967
4958
|
};
|
|
4968
|
-
var BlockTag = class extends
|
|
4959
|
+
var BlockTag = class extends Tag3 {
|
|
4969
4960
|
static {
|
|
4970
4961
|
__name(this, "BlockTag");
|
|
4971
4962
|
}
|
|
@@ -5014,7 +5005,7 @@ var require_liquid_node = __commonJS({
|
|
|
5014
5005
|
return ["block"];
|
|
5015
5006
|
}
|
|
5016
5007
|
};
|
|
5017
|
-
var RawTag = class extends
|
|
5008
|
+
var RawTag = class extends Tag3 {
|
|
5018
5009
|
static {
|
|
5019
5010
|
__name(this, "RawTag");
|
|
5020
5011
|
}
|
|
@@ -5058,7 +5049,7 @@ var require_liquid_node = __commonJS({
|
|
|
5058
5049
|
return this.col() === this.cols;
|
|
5059
5050
|
}
|
|
5060
5051
|
};
|
|
5061
|
-
var TablerowTag = class extends
|
|
5052
|
+
var TablerowTag = class extends Tag3 {
|
|
5062
5053
|
static {
|
|
5063
5054
|
__name(this, "TablerowTag");
|
|
5064
5055
|
}
|
|
@@ -5122,7 +5113,7 @@ var require_liquid_node = __commonJS({
|
|
|
5122
5113
|
return [this.variable, "tablerowloop"];
|
|
5123
5114
|
}
|
|
5124
5115
|
};
|
|
5125
|
-
var UnlessTag = class extends
|
|
5116
|
+
var UnlessTag = class extends Tag3 {
|
|
5126
5117
|
static {
|
|
5127
5118
|
__name(this, "UnlessTag");
|
|
5128
5119
|
}
|
|
@@ -5181,7 +5172,7 @@ var require_liquid_node = __commonJS({
|
|
|
5181
5172
|
return this.branches.map((b) => b.value);
|
|
5182
5173
|
}
|
|
5183
5174
|
};
|
|
5184
|
-
var BreakTag = class extends
|
|
5175
|
+
var BreakTag = class extends Tag3 {
|
|
5185
5176
|
static {
|
|
5186
5177
|
__name(this, "BreakTag");
|
|
5187
5178
|
}
|
|
@@ -5189,7 +5180,7 @@ var require_liquid_node = __commonJS({
|
|
|
5189
5180
|
ctx.breakCalled = true;
|
|
5190
5181
|
}
|
|
5191
5182
|
};
|
|
5192
|
-
var ContinueTag = class extends
|
|
5183
|
+
var ContinueTag = class extends Tag3 {
|
|
5193
5184
|
static {
|
|
5194
5185
|
__name(this, "ContinueTag");
|
|
5195
5186
|
}
|
|
@@ -5197,7 +5188,7 @@ var require_liquid_node = __commonJS({
|
|
|
5197
5188
|
ctx.continueCalled = true;
|
|
5198
5189
|
}
|
|
5199
5190
|
};
|
|
5200
|
-
var EchoTag = class extends
|
|
5191
|
+
var EchoTag = class extends Tag3 {
|
|
5201
5192
|
static {
|
|
5202
5193
|
__name(this, "EchoTag");
|
|
5203
5194
|
}
|
|
@@ -5220,7 +5211,7 @@ var require_liquid_node = __commonJS({
|
|
|
5220
5211
|
}
|
|
5221
5212
|
}
|
|
5222
5213
|
};
|
|
5223
|
-
var LiquidTag = class extends
|
|
5214
|
+
var LiquidTag = class extends Tag3 {
|
|
5224
5215
|
static {
|
|
5225
5216
|
__name(this, "LiquidTag");
|
|
5226
5217
|
}
|
|
@@ -5236,7 +5227,7 @@ var require_liquid_node = __commonJS({
|
|
|
5236
5227
|
return this.templates;
|
|
5237
5228
|
}
|
|
5238
5229
|
};
|
|
5239
|
-
var InlineCommentTag = class extends
|
|
5230
|
+
var InlineCommentTag = class extends Tag3 {
|
|
5240
5231
|
static {
|
|
5241
5232
|
__name(this, "InlineCommentTag");
|
|
5242
5233
|
}
|
|
@@ -5379,76 +5370,76 @@ var require_liquid_node = __commonJS({
|
|
|
5379
5370
|
self.renderFile(filePath, ctx).then((html) => callback(null, html), callback);
|
|
5380
5371
|
};
|
|
5381
5372
|
}
|
|
5382
|
-
async analyze(template2,
|
|
5383
|
-
return analyze(template2,
|
|
5373
|
+
async analyze(template2, options = {}) {
|
|
5374
|
+
return analyze(template2, options);
|
|
5384
5375
|
}
|
|
5385
|
-
analyzeSync(template2,
|
|
5386
|
-
return analyzeSync(template2,
|
|
5376
|
+
analyzeSync(template2, options = {}) {
|
|
5377
|
+
return analyzeSync(template2, options);
|
|
5387
5378
|
}
|
|
5388
|
-
async parseAndAnalyze(html, filename,
|
|
5389
|
-
return analyze(this.parse(html, filename),
|
|
5379
|
+
async parseAndAnalyze(html, filename, options = {}) {
|
|
5380
|
+
return analyze(this.parse(html, filename), options);
|
|
5390
5381
|
}
|
|
5391
|
-
parseAndAnalyzeSync(html, filename,
|
|
5392
|
-
return analyzeSync(this.parse(html, filename),
|
|
5382
|
+
parseAndAnalyzeSync(html, filename, options = {}) {
|
|
5383
|
+
return analyzeSync(this.parse(html, filename), options);
|
|
5393
5384
|
}
|
|
5394
5385
|
/** Return an array of all variables without their properties. */
|
|
5395
|
-
async variables(template2,
|
|
5396
|
-
const analysis = await analyze(isString(template2) ? this.parse(template2) : template2,
|
|
5386
|
+
async variables(template2, options = {}) {
|
|
5387
|
+
const analysis = await analyze(isString(template2) ? this.parse(template2) : template2, options);
|
|
5397
5388
|
return Object.keys(analysis.variables);
|
|
5398
5389
|
}
|
|
5399
5390
|
/** Return an array of all variables without their properties. */
|
|
5400
|
-
variablesSync(template2,
|
|
5401
|
-
const analysis = analyzeSync(isString(template2) ? this.parse(template2) : template2,
|
|
5391
|
+
variablesSync(template2, options = {}) {
|
|
5392
|
+
const analysis = analyzeSync(isString(template2) ? this.parse(template2) : template2, options);
|
|
5402
5393
|
return Object.keys(analysis.variables);
|
|
5403
5394
|
}
|
|
5404
5395
|
/** Return an array of all variables including their properties/paths. */
|
|
5405
|
-
async fullVariables(template2,
|
|
5406
|
-
const analysis = await analyze(isString(template2) ? this.parse(template2) : template2,
|
|
5396
|
+
async fullVariables(template2, options = {}) {
|
|
5397
|
+
const analysis = await analyze(isString(template2) ? this.parse(template2) : template2, options);
|
|
5407
5398
|
return Array.from(new Set(Object.values(analysis.variables).flatMap((a) => a.map((v) => String(v)))));
|
|
5408
5399
|
}
|
|
5409
5400
|
/** Return an array of all variables including their properties/paths. */
|
|
5410
|
-
fullVariablesSync(template2,
|
|
5411
|
-
const analysis = analyzeSync(isString(template2) ? this.parse(template2) : template2,
|
|
5401
|
+
fullVariablesSync(template2, options = {}) {
|
|
5402
|
+
const analysis = analyzeSync(isString(template2) ? this.parse(template2) : template2, options);
|
|
5412
5403
|
return Array.from(new Set(Object.values(analysis.variables).flatMap((a) => a.map((v) => String(v)))));
|
|
5413
5404
|
}
|
|
5414
5405
|
/** Return an array of all variables, each as an array of properties/segments. */
|
|
5415
|
-
async variableSegments(template2,
|
|
5416
|
-
const analysis = await analyze(isString(template2) ? this.parse(template2) : template2,
|
|
5406
|
+
async variableSegments(template2, options = {}) {
|
|
5407
|
+
const analysis = await analyze(isString(template2) ? this.parse(template2) : template2, options);
|
|
5417
5408
|
return Array.from(strictUniq(Object.values(analysis.variables).flatMap((a) => a.map((v) => v.toArray()))));
|
|
5418
5409
|
}
|
|
5419
5410
|
/** Return an array of all variables, each as an array of properties/segments. */
|
|
5420
|
-
variableSegmentsSync(template2,
|
|
5421
|
-
const analysis = analyzeSync(isString(template2) ? this.parse(template2) : template2,
|
|
5411
|
+
variableSegmentsSync(template2, options = {}) {
|
|
5412
|
+
const analysis = analyzeSync(isString(template2) ? this.parse(template2) : template2, options);
|
|
5422
5413
|
return Array.from(strictUniq(Object.values(analysis.variables).flatMap((a) => a.map((v) => v.toArray()))));
|
|
5423
5414
|
}
|
|
5424
5415
|
/** Return an array of all expected context variables without their properties. */
|
|
5425
|
-
async globalVariables(template2,
|
|
5426
|
-
const analysis = await analyze(isString(template2) ? this.parse(template2) : template2,
|
|
5416
|
+
async globalVariables(template2, options = {}) {
|
|
5417
|
+
const analysis = await analyze(isString(template2) ? this.parse(template2) : template2, options);
|
|
5427
5418
|
return Object.keys(analysis.globals);
|
|
5428
5419
|
}
|
|
5429
5420
|
/** Return an array of all expected context variables without their properties. */
|
|
5430
|
-
globalVariablesSync(template2,
|
|
5431
|
-
const analysis = analyzeSync(isString(template2) ? this.parse(template2) : template2,
|
|
5421
|
+
globalVariablesSync(template2, options = {}) {
|
|
5422
|
+
const analysis = analyzeSync(isString(template2) ? this.parse(template2) : template2, options);
|
|
5432
5423
|
return Object.keys(analysis.globals);
|
|
5433
5424
|
}
|
|
5434
5425
|
/** Return an array of all expected context variables including their properties/paths. */
|
|
5435
|
-
async globalFullVariables(template2,
|
|
5436
|
-
const analysis = await analyze(isString(template2) ? this.parse(template2) : template2,
|
|
5426
|
+
async globalFullVariables(template2, options = {}) {
|
|
5427
|
+
const analysis = await analyze(isString(template2) ? this.parse(template2) : template2, options);
|
|
5437
5428
|
return Array.from(new Set(Object.values(analysis.globals).flatMap((a) => a.map((v) => String(v)))));
|
|
5438
5429
|
}
|
|
5439
5430
|
/** Return an array of all expected context variables including their properties/paths. */
|
|
5440
|
-
globalFullVariablesSync(template2,
|
|
5441
|
-
const analysis = analyzeSync(isString(template2) ? this.parse(template2) : template2,
|
|
5431
|
+
globalFullVariablesSync(template2, options = {}) {
|
|
5432
|
+
const analysis = analyzeSync(isString(template2) ? this.parse(template2) : template2, options);
|
|
5442
5433
|
return Array.from(new Set(Object.values(analysis.globals).flatMap((a) => a.map((v) => String(v)))));
|
|
5443
5434
|
}
|
|
5444
5435
|
/** Return an array of all expected context variables, each as an array of properties/segments. */
|
|
5445
|
-
async globalVariableSegments(template2,
|
|
5446
|
-
const analysis = await analyze(isString(template2) ? this.parse(template2) : template2,
|
|
5436
|
+
async globalVariableSegments(template2, options = {}) {
|
|
5437
|
+
const analysis = await analyze(isString(template2) ? this.parse(template2) : template2, options);
|
|
5447
5438
|
return Array.from(strictUniq(Object.values(analysis.globals).flatMap((a) => a.map((v) => v.toArray()))));
|
|
5448
5439
|
}
|
|
5449
5440
|
/** Return an array of all expected context variables, each as an array of properties/segments. */
|
|
5450
|
-
globalVariableSegmentsSync(template2,
|
|
5451
|
-
const analysis = analyzeSync(isString(template2) ? this.parse(template2) : template2,
|
|
5441
|
+
globalVariableSegmentsSync(template2, options = {}) {
|
|
5442
|
+
const analysis = analyzeSync(isString(template2) ? this.parse(template2) : template2, options);
|
|
5452
5443
|
return Array.from(strictUniq(Object.values(analysis.globals).flatMap((a) => a.map((v) => v.toArray()))));
|
|
5453
5444
|
}
|
|
5454
5445
|
};
|
|
@@ -5486,7 +5477,7 @@ var require_liquid_node = __commonJS({
|
|
|
5486
5477
|
exports.RenderError = RenderError;
|
|
5487
5478
|
exports.RenderTag = RenderTag;
|
|
5488
5479
|
exports.TablerowTag = TablerowTag;
|
|
5489
|
-
exports.Tag =
|
|
5480
|
+
exports.Tag = Tag3;
|
|
5490
5481
|
exports.TagToken = TagToken;
|
|
5491
5482
|
exports.Token = Token;
|
|
5492
5483
|
exports.TokenizationError = TokenizationError;
|
|
@@ -5516,11 +5507,11 @@ var require_liquid_node = __commonJS({
|
|
|
5516
5507
|
}
|
|
5517
5508
|
});
|
|
5518
5509
|
|
|
5519
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
5510
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.614.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_3bb6323e04e526bd9df39f840434b06b/node_modules/@wirecat/cli-core/dist/cli/messenger/store-maintenance-command.js
|
|
5520
5511
|
import { chmodSync, constants, copyFileSync, existsSync as existsSync9, mkdirSync, realpathSync as realpathSync2, renameSync as renameSync3, rmSync as rmSync3, statfsSync as statfsSync2, statSync as statSync4, writeFileSync as writeFileSync2 } from "node:fs";
|
|
5521
5512
|
import { dirname as dirname2, resolve } from "node:path";
|
|
5522
5513
|
|
|
5523
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
5514
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.614.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_3bb6323e04e526bd9df39f840434b06b/node_modules/@wirecat/cli-core/dist/sealed.js
|
|
5524
5515
|
import { createCipheriv, createDecipheriv, createHash, randomBytes, scrypt, timingSafeEqual } from "node:crypto";
|
|
5525
5516
|
import { closeSync, createReadStream, createWriteStream, existsSync, openSync, readSync, renameSync, rmSync, statSync } from "node:fs";
|
|
5526
5517
|
import { Transform } from "node:stream";
|
|
@@ -5627,7 +5618,7 @@ var unsealFile = /* @__PURE__ */ __name(async (from, to, password) => {
|
|
|
5627
5618
|
renameSync(pending, to);
|
|
5628
5619
|
}, "unsealFile");
|
|
5629
5620
|
|
|
5630
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
5621
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.614.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_3bb6323e04e526bd9df39f840434b06b/node_modules/@wirecat/cli-core/dist/store/compatibility.js
|
|
5631
5622
|
var SPEAKS = MIGRATIONS.at(-1)?.version ?? 0;
|
|
5632
5623
|
var fileSchemaOf = /* @__PURE__ */ __name((database) => {
|
|
5633
5624
|
const tracked = database.prepare("SELECT 1 FROM sqlite_master WHERE name = 'schema_migrations'").get();
|
|
@@ -5651,7 +5642,7 @@ var compatibilityOf = /* @__PURE__ */ __name((file2, migrations = MIGRATIONS) =>
|
|
|
5651
5642
|
};
|
|
5652
5643
|
}, "compatibilityOf");
|
|
5653
5644
|
|
|
5654
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
5645
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.614.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_3bb6323e04e526bd9df39f840434b06b/node_modules/@wirecat/cli-core/dist/store/repair.js
|
|
5655
5646
|
import { createHash as createHash2 } from "node:crypto";
|
|
5656
5647
|
var COPY_MARK = "__repair_";
|
|
5657
5648
|
var COPY_NAME = /__repair_[0-9a-f]{8}(_\d+)?$/;
|
|
@@ -5905,13 +5896,13 @@ var deleteCopy = /* @__PURE__ */ __name((database, name) => {
|
|
|
5905
5896
|
return found;
|
|
5906
5897
|
}, "deleteCopy");
|
|
5907
5898
|
|
|
5908
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
5899
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.614.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_3bb6323e04e526bd9df39f840434b06b/node_modules/@wirecat/cli-core/dist/cli/store-info.js
|
|
5909
5900
|
import { existsSync as existsSync4, statSync as statSync3 } from "node:fs";
|
|
5910
5901
|
|
|
5911
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
5902
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.614.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_3bb6323e04e526bd9df39f840434b06b/node_modules/@wirecat/cli-core/dist/cli/store-recover.js
|
|
5912
5903
|
import { existsSync as existsSync3 } from "node:fs";
|
|
5913
5904
|
|
|
5914
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
5905
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.614.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_3bb6323e04e526bd9df39f840434b06b/node_modules/@wirecat/cli-core/dist/store/recover.js
|
|
5915
5906
|
import { execFileSync, spawn } from "node:child_process";
|
|
5916
5907
|
import { existsSync as existsSync2, readFileSync, realpathSync, renameSync as renameSync2, rmSync as rmSync2, statfsSync, statSync as statSync2, writeFileSync } from "node:fs";
|
|
5917
5908
|
import { basename, dirname, join } from "node:path";
|
|
@@ -6209,7 +6200,14 @@ var recoverLocked = /* @__PURE__ */ __name(async ({ path, command, version, sqli
|
|
|
6209
6200
|
}, "stopWatching");
|
|
6210
6201
|
try {
|
|
6211
6202
|
const dataVersion = /* @__PURE__ */ __name(() => Number(watch.prepare("PRAGMA data_version").get()?.data_version), "dataVersion");
|
|
6212
|
-
|
|
6203
|
+
let rowsBefore;
|
|
6204
|
+
try {
|
|
6205
|
+
rowsBefore = tableRows(watch);
|
|
6206
|
+
} catch (error) {
|
|
6207
|
+
if (!isStoreDamage(error))
|
|
6208
|
+
throw error;
|
|
6209
|
+
throw new CliError("configuration_error", "the store file's header or schema is damaged, so its tables cannot be listed and it cannot be recovered; the file was left as it was", { reason: "store.unreadable" });
|
|
6210
|
+
}
|
|
6213
6211
|
const before = { data: dataVersion(), inode: statSync2(path).ino };
|
|
6214
6212
|
const stamp = new Date(now()).toISOString().replace(/[:.]/g, "-");
|
|
6215
6213
|
const target = `${path}.recovering-${stamp}`;
|
|
@@ -6236,7 +6234,8 @@ var recoverLocked = /* @__PURE__ */ __name(async ({ path, command, version, sqli
|
|
|
6236
6234
|
let kept;
|
|
6237
6235
|
let dangling;
|
|
6238
6236
|
let json;
|
|
6239
|
-
let
|
|
6237
|
+
let fetch;
|
|
6238
|
+
let schema;
|
|
6240
6239
|
try {
|
|
6241
6240
|
kept = tableRows(opened.database);
|
|
6242
6241
|
migrate(opened.database, { command, ...version ? { version } : {} });
|
|
@@ -6245,7 +6244,8 @@ var recoverLocked = /* @__PURE__ */ __name(async ({ path, command, version, sqli
|
|
|
6245
6244
|
rebuilt = rebuildDerived(opened.database, { now, note });
|
|
6246
6245
|
note("looking for rows that point at rows that were lost");
|
|
6247
6246
|
dangling = danglingRows(opened.database);
|
|
6248
|
-
|
|
6247
|
+
fetch = mailToFetch(opened.database);
|
|
6248
|
+
schema = fileSchemaOf(opened.database).version;
|
|
6249
6249
|
opened.database.exec("PRAGMA wal_checkpoint(TRUNCATE)");
|
|
6250
6250
|
} catch (error) {
|
|
6251
6251
|
opened.database.close();
|
|
@@ -6273,6 +6273,7 @@ var recoverLocked = /* @__PURE__ */ __name(async ({ path, command, version, sqli
|
|
|
6273
6273
|
for (const suffix of STORE_PARTS)
|
|
6274
6274
|
if (existsSync2(`${target}${suffix}`))
|
|
6275
6275
|
renameSync2(`${target}${suffix}`, `${path}${suffix}`);
|
|
6276
|
+
recordDeepCheck(path, health, { cli: command, ...version ? { version } : {}, schema, now });
|
|
6276
6277
|
const lost = Object.entries(rowsBefore).map(([table, before2]) => ({ table, before: before2, read: read[table] ?? 0, kept: kept[table] ?? 0 })).filter(({ before: before2, read: read2, kept: kept2 }) => before2 === null || before2 > kept2 || read2 > kept2);
|
|
6277
6278
|
const seconds = /* @__PURE__ */ __name((from, to) => Math.round((to - from) / 100) / 10, "seconds");
|
|
6278
6279
|
return {
|
|
@@ -6282,7 +6283,7 @@ var recoverLocked = /* @__PURE__ */ __name(async ({ path, command, version, sqli
|
|
|
6282
6283
|
lost,
|
|
6283
6284
|
dangling,
|
|
6284
6285
|
invalidJson: json,
|
|
6285
|
-
mailToFetch:
|
|
6286
|
+
mailToFetch: fetch,
|
|
6286
6287
|
rebuilt,
|
|
6287
6288
|
copyErrors,
|
|
6288
6289
|
health,
|
|
@@ -6298,7 +6299,7 @@ var recoverLocked = /* @__PURE__ */ __name(async ({ path, command, version, sqli
|
|
|
6298
6299
|
}
|
|
6299
6300
|
}, "recoverLocked");
|
|
6300
6301
|
|
|
6301
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
6302
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.614.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_3bb6323e04e526bd9df39f840434b06b/node_modules/@wirecat/cli-core/dist/cli/store-recover.js
|
|
6302
6303
|
var COUNTED = [
|
|
6303
6304
|
"accounts",
|
|
6304
6305
|
"chats",
|
|
@@ -6313,15 +6314,17 @@ var COUNTED = [
|
|
|
6313
6314
|
"mentions"
|
|
6314
6315
|
];
|
|
6315
6316
|
var stopTimers = /* @__PURE__ */ __name((timers) => `systemctl --user stop ${timers.join(" ")}`, "stopTimers");
|
|
6316
|
-
var storeRecoveryCheck = /* @__PURE__ */ __name(async (env, command) => {
|
|
6317
|
+
var storeRecoveryCheck = /* @__PURE__ */ __name(async (env, command, version) => {
|
|
6317
6318
|
const path = storePath(env);
|
|
6318
6319
|
if (!existsSync3(path))
|
|
6319
6320
|
return { path, exists: false, ok: true, next: [] };
|
|
6320
6321
|
const health = await storeHealth(path, { deep: true });
|
|
6321
6322
|
let rows = {};
|
|
6323
|
+
let schema = null;
|
|
6322
6324
|
try {
|
|
6323
6325
|
const { database } = await openSqlite(path, { readOnly: true });
|
|
6324
6326
|
try {
|
|
6327
|
+
schema = fileSchemaOf(database).version;
|
|
6325
6328
|
const all = tableRows(database);
|
|
6326
6329
|
rows = Object.fromEntries(COUNTED.filter((table) => table in all).map((table) => [table, all[table] ?? null]));
|
|
6327
6330
|
} finally {
|
|
@@ -6329,7 +6332,9 @@ var storeRecoveryCheck = /* @__PURE__ */ __name(async (env, command) => {
|
|
|
6329
6332
|
}
|
|
6330
6333
|
} catch {
|
|
6331
6334
|
}
|
|
6332
|
-
|
|
6335
|
+
recordDeepCheck(path, health, { cli: command, ...version ? { version } : {}, schema });
|
|
6336
|
+
const mark = readDamageMark(path);
|
|
6337
|
+
const explanation = explainDamage(health, command, mark);
|
|
6333
6338
|
const inUse = storeHolders(path) ?? null;
|
|
6334
6339
|
const timers = activeTimers() ?? null;
|
|
6335
6340
|
const sqlite3 = sqlite3Program();
|
|
@@ -6350,6 +6355,8 @@ var storeRecoveryCheck = /* @__PURE__ */ __name(async (env, command) => {
|
|
|
6350
6355
|
invalidJson: health.invalidJson ?? [],
|
|
6351
6356
|
rows,
|
|
6352
6357
|
explanation,
|
|
6358
|
+
damageMark: mark ? (({ inode: _, ...seen }) => seen)(mark) : null,
|
|
6359
|
+
lastKnownGood: readHealthMark(path)?.last_ok_at ?? null,
|
|
6353
6360
|
inUse,
|
|
6354
6361
|
timers,
|
|
6355
6362
|
sqlite3: { version: sqlite3.version, usable: sqlite3.usable },
|
|
@@ -6397,13 +6404,14 @@ var recoveryNotes = /* @__PURE__ */ __name((answer) => {
|
|
|
6397
6404
|
const why = answer.explanation;
|
|
6398
6405
|
return [
|
|
6399
6406
|
...why ? [why.what, ...why.impact, why.externalUnaffected] : [],
|
|
6407
|
+
answer.lastKnownGood ? `the store last passed a deep check at ${answer.lastKnownGood}` : "no deep check that passed is on record for this store",
|
|
6400
6408
|
...answer.next.map((line) => `next: ${line}`)
|
|
6401
6409
|
];
|
|
6402
6410
|
}, "recoveryNotes");
|
|
6403
6411
|
var storeRecoverCommand = /* @__PURE__ */ __name(({ command, version }) => {
|
|
6404
6412
|
const recover = annotate(new Command("recover"), { effects: LOCAL_READ, examples: [`${command} store recover`] }).summary("what is damaged in the store and how to recover it").description("check every page and search index of the store, say what is damaged, what it means and the commands that recover it; changes nothing").action(async function() {
|
|
6405
6413
|
const output = outputFor(this);
|
|
6406
|
-
const answer = await storeRecoveryCheck(environmentOf(this).env ?? process.env, command);
|
|
6414
|
+
const answer = await storeRecoveryCheck(environmentOf(this).env ?? process.env, command, version);
|
|
6407
6415
|
renderAnswer(this, output, itemOf(snakeKeys(answer)));
|
|
6408
6416
|
if (output.format === "pretty")
|
|
6409
6417
|
for (const line of recoveryNotes(answer))
|
|
@@ -6424,7 +6432,7 @@ var storeRecoverCommand = /* @__PURE__ */ __name(({ command, version }) => {
|
|
|
6424
6432
|
return recover;
|
|
6425
6433
|
}, "storeRecoverCommand");
|
|
6426
6434
|
|
|
6427
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
6435
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.614.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_3bb6323e04e526bd9df39f840434b06b/node_modules/@wirecat/cli-core/dist/cli/store-info.js
|
|
6428
6436
|
var pendingIfKnown = /* @__PURE__ */ __name((database) => database.prepare("SELECT 1 FROM pragma_table_info('messages') WHERE name = 'normalized_text'").get() ? pendingNormalization(database) : null, "pendingIfKnown");
|
|
6429
6437
|
var bytesOf = /* @__PURE__ */ __name((path) => existsSync4(path) ? statSync3(path).size : 0, "bytesOf");
|
|
6430
6438
|
var messageOf = /* @__PURE__ */ __name((error) => error instanceof Error ? error.message : String(error), "messageOf");
|
|
@@ -6474,7 +6482,7 @@ var sharedStoreCommand = /* @__PURE__ */ __name((app) => {
|
|
|
6474
6482
|
return app ? store.addCommand(storeRecoverCommand(app)) : store;
|
|
6475
6483
|
}, "sharedStoreCommand");
|
|
6476
6484
|
|
|
6477
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
6485
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.614.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_3bb6323e04e526bd9df39f840434b06b/node_modules/@wirecat/cli-core/dist/cli/messenger/password.js
|
|
6478
6486
|
var ENCRYPT_OPTION = [
|
|
6479
6487
|
"--encrypt",
|
|
6480
6488
|
"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"
|
|
@@ -6493,7 +6501,7 @@ var passwordOf = /* @__PURE__ */ __name(async (command, { twice }) => {
|
|
|
6493
6501
|
return password;
|
|
6494
6502
|
}, "passwordOf");
|
|
6495
6503
|
|
|
6496
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
6504
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.614.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_3bb6323e04e526bd9df39f840434b06b/node_modules/@wirecat/cli-core/dist/replies/rules.js
|
|
6497
6505
|
import { existsSync as existsSync5, readFileSync as readFileSync2 } from "node:fs";
|
|
6498
6506
|
import { join as join2 } from "node:path";
|
|
6499
6507
|
var REPLY_ACTIONS = ["reply", "task"];
|
|
@@ -6664,7 +6672,7 @@ var problem = /* @__PURE__ */ __name((issue) => {
|
|
|
6664
6672
|
}, "problem");
|
|
6665
6673
|
var broken = /* @__PURE__ */ __name((path, why) => new CliError("configuration_error", `the reply rules ${path} cannot be read (${why}) \u2014 fix the file`), "broken");
|
|
6666
6674
|
|
|
6667
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
6675
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.614.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_3bb6323e04e526bd9df39f840434b06b/node_modules/@wirecat/cli-core/dist/replies/state.js
|
|
6668
6676
|
import { existsSync as existsSync6, readFileSync as readFileSync3 } from "node:fs";
|
|
6669
6677
|
import { join as join3 } from "node:path";
|
|
6670
6678
|
var ANSWERED_KEPT = 1e3;
|
|
@@ -6717,7 +6725,7 @@ var recordReply = /* @__PURE__ */ __name((state, rule2, message, now) => {
|
|
|
6717
6725
|
}, "recordReply");
|
|
6718
6726
|
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");
|
|
6719
6727
|
|
|
6720
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
6728
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.614.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_3bb6323e04e526bd9df39f840434b06b/node_modules/@wirecat/cli-core/dist/replies/decide.js
|
|
6721
6729
|
var skip = /* @__PURE__ */ __name((why) => ({ skip: why }), "skip");
|
|
6722
6730
|
var decide = /* @__PURE__ */ __name((rule2, incoming, state, now) => {
|
|
6723
6731
|
const { message, chat, owner, sender } = incoming;
|
|
@@ -6823,8 +6831,37 @@ var filled = /* @__PURE__ */ __name((template2, senderName) => {
|
|
|
6823
6831
|
return template2.replaceAll("{firstName}", name.split(/\s+/)[0] ?? name).replaceAll("{name}", name);
|
|
6824
6832
|
}, "filled");
|
|
6825
6833
|
|
|
6826
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
6834
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.614.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_3bb6323e04e526bd9df39f840434b06b/node_modules/@wirecat/cli-core/dist/replies/template.js
|
|
6835
|
+
var import_liquidjs2 = __toESM(require_liquid_node(), 1);
|
|
6836
|
+
|
|
6837
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.614.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_3bb6323e04e526bd9df39f840434b06b/node_modules/@wirecat/cli-core/dist/render/liquid.js
|
|
6827
6838
|
var import_liquidjs = __toESM(require_liquid_node(), 1);
|
|
6839
|
+
var safeLiquid = /* @__PURE__ */ __name((limits) => {
|
|
6840
|
+
const engine = new import_liquidjs.Liquid({
|
|
6841
|
+
ownPropertyOnly: true,
|
|
6842
|
+
strictVariables: true,
|
|
6843
|
+
strictFilters: true,
|
|
6844
|
+
lenientIf: false,
|
|
6845
|
+
parseLimit: limits.parse,
|
|
6846
|
+
renderLimit: limits.milliseconds,
|
|
6847
|
+
memoryLimit: limits.memory,
|
|
6848
|
+
preserveTimezones: true
|
|
6849
|
+
});
|
|
6850
|
+
for (const name of ["include", "render", "layout"]) {
|
|
6851
|
+
engine.registerTag(name, class extends import_liquidjs.Tag {
|
|
6852
|
+
constructor(token, tokens, liquid) {
|
|
6853
|
+
super(token, tokens, liquid);
|
|
6854
|
+
throw new Error("templates cannot read files");
|
|
6855
|
+
}
|
|
6856
|
+
render() {
|
|
6857
|
+
return "";
|
|
6858
|
+
}
|
|
6859
|
+
});
|
|
6860
|
+
}
|
|
6861
|
+
return engine;
|
|
6862
|
+
}, "safeLiquid");
|
|
6863
|
+
|
|
6864
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.614.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_3bb6323e04e526bd9df39f840434b06b/node_modules/@wirecat/cli-core/dist/replies/template.js
|
|
6828
6865
|
var TEMPLATE_LIMITS = {
|
|
6829
6866
|
parse: 32768,
|
|
6830
6867
|
renders: 2e3,
|
|
@@ -6878,28 +6915,8 @@ var renderReplyTemplate = /* @__PURE__ */ __name(async (reply, input) => {
|
|
|
6878
6915
|
hourCycle: "h23"
|
|
6879
6916
|
}).formatToParts(input.now).map(({ type, value }) => [type, value]));
|
|
6880
6917
|
const localTime = `${parts.year}-${parts.month}-${parts.day}T${parts.hour}:${parts.minute}:${parts.second}${parts.timeZoneName?.replace("GMT", "") || "+00:00"}`;
|
|
6881
|
-
const engine =
|
|
6882
|
-
|
|
6883
|
-
strictVariables: true,
|
|
6884
|
-
strictFilters: true,
|
|
6885
|
-
lenientIf: false,
|
|
6886
|
-
parseLimit: limits.parse,
|
|
6887
|
-
renderLimit: limits.milliseconds,
|
|
6888
|
-
memoryLimit: limits.memory,
|
|
6889
|
-
preserveTimezones: true
|
|
6890
|
-
});
|
|
6891
|
-
for (const name2 of ["include", "render", "layout"]) {
|
|
6892
|
-
engine.registerTag(name2, class extends import_liquidjs.Tag {
|
|
6893
|
-
constructor(token, tokens, liquid) {
|
|
6894
|
-
super(token, tokens, liquid);
|
|
6895
|
-
throw new Error("reply templates cannot read files");
|
|
6896
|
-
}
|
|
6897
|
-
render() {
|
|
6898
|
-
return "";
|
|
6899
|
-
}
|
|
6900
|
-
});
|
|
6901
|
-
}
|
|
6902
|
-
engine.registerTag("ai", class extends import_liquidjs.Tag {
|
|
6918
|
+
const engine = safeLiquid({ parse: limits.parse, memory: limits.memory, milliseconds: limits.milliseconds });
|
|
6919
|
+
engine.registerTag("ai", class extends import_liquidjs2.Tag {
|
|
6903
6920
|
body = [];
|
|
6904
6921
|
fallback = null;
|
|
6905
6922
|
constructor(token, tokens, liquid, parser) {
|
|
@@ -6960,7 +6977,7 @@ var renderReplyTemplate = /* @__PURE__ */ __name(async (reply, input) => {
|
|
|
6960
6977
|
});
|
|
6961
6978
|
const templates = engine.parse(source);
|
|
6962
6979
|
const name = input.senderName?.trim() ?? "";
|
|
6963
|
-
const context = new
|
|
6980
|
+
const context = new import_liquidjs2.Context({
|
|
6964
6981
|
sender: { firstName: name.split(/\s+/)[0] ?? "", name },
|
|
6965
6982
|
chat: { title: input.chat.title ?? "", kind: input.chat.kind },
|
|
6966
6983
|
now: localTime
|
|
@@ -6983,7 +7000,7 @@ var renderReplyTemplate = /* @__PURE__ */ __name(async (reply, input) => {
|
|
|
6983
7000
|
}
|
|
6984
7001
|
}, "renderReplyTemplate");
|
|
6985
7002
|
|
|
6986
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
7003
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.614.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_3bb6323e04e526bd9df39f840434b06b/node_modules/@wirecat/cli-core/dist/replies/dry-run.js
|
|
6987
7004
|
var DRY_RUN_DAYS = 7;
|
|
6988
7005
|
var PAGE = 500;
|
|
6989
7006
|
var dryRun = /* @__PURE__ */ __name(async (store, account, rules, { since, until = Date.now(), only, audience, render }) => {
|
|
@@ -7097,143 +7114,7 @@ var storedSince = /* @__PURE__ */ __name(async (store, account, chat, since) =>
|
|
|
7097
7114
|
}
|
|
7098
7115
|
}, "storedSince");
|
|
7099
7116
|
|
|
7100
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
7101
|
-
var endpointKeyName = /* @__PURE__ */ __name((baseUrl) => {
|
|
7102
|
-
const host = new URL(baseUrl).host;
|
|
7103
|
-
return ["openai", "anthropic"].includes(host) ? `endpoint:${host}` : host;
|
|
7104
|
-
}, "endpointKeyName");
|
|
7105
|
-
var embeddingKeys = /* @__PURE__ */ __name((app, env = process.env, keyring) => {
|
|
7106
|
-
const where = { appName: app.appName, prefix: app.envPrefix, env };
|
|
7107
|
-
const credentials = /* @__PURE__ */ __name((provider) => new Credentials({
|
|
7108
|
-
configDir: resolvePaths(where).config,
|
|
7109
|
-
service: app.appName,
|
|
7110
|
-
...["openai", "anthropic"].includes(provider) ? { envVar: envName(app, `${provider.toUpperCase()}_API_KEY`) } : {},
|
|
7111
|
-
isolated: pathsAreOverridden(where),
|
|
7112
|
-
env,
|
|
7113
|
-
...keyring ? { keyring } : {},
|
|
7114
|
-
warn: /* @__PURE__ */ __name((message) => process.stderr.write(`${message}
|
|
7115
|
-
`), "warn")
|
|
7116
|
-
}), "credentials");
|
|
7117
|
-
const account = /* @__PURE__ */ __name((provider) => `embeddings:${provider}`, "account");
|
|
7118
|
-
return {
|
|
7119
|
-
read: /* @__PURE__ */ __name((provider) => {
|
|
7120
|
-
const stored = credentials(provider).read(account(provider));
|
|
7121
|
-
if (stored)
|
|
7122
|
-
return { key: stored.secret, source: stored.source };
|
|
7123
|
-
const shared = ["openai", "anthropic"].includes(provider) ? env[`${provider.toUpperCase()}_API_KEY`]?.trim() : void 0;
|
|
7124
|
-
return shared ? { key: shared, source: "env" } : void 0;
|
|
7125
|
-
}, "read"),
|
|
7126
|
-
write: /* @__PURE__ */ __name((provider, key) => credentials(provider).write(account(provider), key, { signIn: true }), "write"),
|
|
7127
|
-
remove: /* @__PURE__ */ __name((provider) => credentials(provider).remove(account(provider)), "remove")
|
|
7128
|
-
};
|
|
7129
|
-
}, "embeddingKeys");
|
|
7130
|
-
|
|
7131
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.604.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_90db47d7f41d7a563eea7bc9cc13c345/node_modules/@wirecat/cli-core/dist/models/openai.js
|
|
7132
|
-
var options = strictObject({
|
|
7133
|
-
temperature: range(0, 2),
|
|
7134
|
-
top_p: range(0, 1),
|
|
7135
|
-
presence_penalty: range(-2, 2),
|
|
7136
|
-
frequency_penalty: range(-2, 2),
|
|
7137
|
-
seed: optional(pipe(number(), integer())),
|
|
7138
|
-
stop: optional(union([string(), array(string())])),
|
|
7139
|
-
response_format: optional(strictObject({ type: picklist(["text", "json_object"]) }))
|
|
7140
|
-
});
|
|
7141
|
-
var openai = {
|
|
7142
|
-
images: true,
|
|
7143
|
-
baseUrl: "https://api.openai.com/v1",
|
|
7144
|
-
validate: /* @__PURE__ */ __name((given) => checkedOptions("openai", options, given), "validate"),
|
|
7145
|
-
complete: /* @__PURE__ */ __name((target, request, checked, apiKey, fetcher) => withTimeLimit(12e4, async (deadline) => {
|
|
7146
|
-
const response = await fetcher(`${target.baseUrl.replace(/\/+$/, "")}/chat/completions`, {
|
|
7147
|
-
method: "POST",
|
|
7148
|
-
headers: { "Content-Type": "application/json", ...apiKey ? { Authorization: `Bearer ${apiKey}` } : {} },
|
|
7149
|
-
body: JSON.stringify({
|
|
7150
|
-
...checked,
|
|
7151
|
-
model: target.model,
|
|
7152
|
-
messages: [
|
|
7153
|
-
{ role: "system", content: systemFor(request) },
|
|
7154
|
-
...messagesFor(request),
|
|
7155
|
-
...request.images === void 0 ? [] : [
|
|
7156
|
-
{
|
|
7157
|
-
role: "user",
|
|
7158
|
-
content: request.images.map((image) => ({
|
|
7159
|
-
type: "image_url",
|
|
7160
|
-
image_url: { url: `data:${image.mimeType};base64,${image.data}`, detail: "high" }
|
|
7161
|
-
}))
|
|
7162
|
-
}
|
|
7163
|
-
]
|
|
7164
|
-
],
|
|
7165
|
-
...new URL(target.baseUrl).hostname === "api.openai.com" ? { max_completion_tokens: request.maxTokens } : { max_tokens: request.maxTokens }
|
|
7166
|
-
}),
|
|
7167
|
-
signal: deadline,
|
|
7168
|
-
redirect: "error"
|
|
7169
|
-
});
|
|
7170
|
-
if (!response.ok)
|
|
7171
|
-
throw new Error("provider rejected request");
|
|
7172
|
-
const body = await response.json();
|
|
7173
|
-
const choice = body.choices?.[0];
|
|
7174
|
-
if (choice?.finish_reason !== "stop" || typeof choice.message?.content !== "string" || !Number.isInteger(body.usage?.total_tokens) || (body.usage?.total_tokens ?? 0) < 1)
|
|
7175
|
-
throw new Error("incomplete response");
|
|
7176
|
-
return { text: choice.message.content, tokens: body.usage?.total_tokens };
|
|
7177
|
-
}), "complete")
|
|
7178
|
-
};
|
|
7179
|
-
|
|
7180
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.604.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_90db47d7f41d7a563eea7bc9cc13c345/node_modules/@wirecat/cli-core/dist/models/index.js
|
|
7181
|
-
var modelGateway = /* @__PURE__ */ __name((deps) => ({
|
|
7182
|
-
complete: /* @__PURE__ */ __name(async (request) => {
|
|
7183
|
-
if (deps.signal?.aborted)
|
|
7184
|
-
throw new CliError("cancelled", "model request cancelled");
|
|
7185
|
-
const target = deps.resolve(request.purpose);
|
|
7186
|
-
if (!target || target.provider === "off")
|
|
7187
|
-
throw new CliError("configuration_error", `models.${request.purpose}.provider is not configured; no model was called`);
|
|
7188
|
-
if (!request.purpose || !Number.isSafeInteger(request.maxTokens) || request.maxTokens < 1 || typeof request.prompt !== "string")
|
|
7189
|
-
throw new CliError("validation_error", "a model request needs a purpose, prompt and positive whole maxTokens");
|
|
7190
|
-
validateImages(request.images);
|
|
7191
|
-
let adapter = deps.adapters?.[target.provider];
|
|
7192
|
-
if (!adapter && target.provider === "openai")
|
|
7193
|
-
adapter = openai;
|
|
7194
|
-
if (!adapter && target.provider === "anthropic")
|
|
7195
|
-
adapter = (await import("./anthropic-4ZI2BPLG.js")).anthropic;
|
|
7196
|
-
if (!adapter)
|
|
7197
|
-
throw new CliError("validation_error", `no model adapter for ${target.provider}`);
|
|
7198
|
-
if (request.images !== void 0 && adapter.images !== true)
|
|
7199
|
-
throw new CliError("validation_error", "the model adapter does not support image inputs");
|
|
7200
|
-
const options2 = adapter.validate(request.options ?? {});
|
|
7201
|
-
const baseUrl = target.baseUrl ?? adapter.baseUrl;
|
|
7202
|
-
if (!target.model.trim() || !endpoint(baseUrl))
|
|
7203
|
-
throw new CliError("validation_error", "a model target needs a model and an HTTP/S endpoint without credentials, query or fragment");
|
|
7204
|
-
if (!await deps.consent(request, { ...target, baseUrl }))
|
|
7205
|
-
throw new CliError("permission_error", `model consent for ${request.purpose} is missing; no data was sent`);
|
|
7206
|
-
const apiKey = await deps.key?.(target.provider, target);
|
|
7207
|
-
if (deps.signal?.aborted)
|
|
7208
|
-
throw new CliError("cancelled", "model request cancelled");
|
|
7209
|
-
const fetcher = deps.fetch ?? fetch;
|
|
7210
|
-
let limited = false;
|
|
7211
|
-
const cancellable = /* @__PURE__ */ __name(async (input, init) => {
|
|
7212
|
-
const signal = init?.signal ?? (input instanceof Request ? input.signal : void 0);
|
|
7213
|
-
const response = await fetcher(input, {
|
|
7214
|
-
...init,
|
|
7215
|
-
signal: deps.signal ? AbortSignal.any([deps.signal, ...signal ? [signal] : []]) : signal
|
|
7216
|
-
});
|
|
7217
|
-
if (response.status === 429)
|
|
7218
|
-
limited = true;
|
|
7219
|
-
return response;
|
|
7220
|
-
}, "cancellable");
|
|
7221
|
-
try {
|
|
7222
|
-
const answer = await adapter.complete({ ...target, baseUrl }, request, options2, apiKey, cancellable);
|
|
7223
|
-
if (deps.signal?.aborted)
|
|
7224
|
-
throw new Error("cancelled");
|
|
7225
|
-
if (typeof answer.text !== "string" || !Number.isSafeInteger(answer.tokens) || answer.tokens < 1)
|
|
7226
|
-
throw new Error("incomplete");
|
|
7227
|
-
return { ...answer, provider: target.provider, model: target.model };
|
|
7228
|
-
} catch {
|
|
7229
|
-
if (limited)
|
|
7230
|
-
throw new CliError("rate_limited", `${request.purpose} provider rate limit reached; no result was stored`);
|
|
7231
|
-
throw new CliError("invalid_response", `${request.purpose} provider failed or returned an incomplete response; no result was stored`);
|
|
7232
|
-
}
|
|
7233
|
-
}, "complete")
|
|
7234
|
-
}), "modelGateway");
|
|
7235
|
-
|
|
7236
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.604.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_90db47d7f41d7a563eea7bc9cc13c345/node_modules/@wirecat/cli-core/dist/replies/consents.js
|
|
7117
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.614.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_3bb6323e04e526bd9df39f840434b06b/node_modules/@wirecat/cli-core/dist/replies/consents.js
|
|
7237
7118
|
import { existsSync as existsSync7, readFileSync as readFileSync4 } from "node:fs";
|
|
7238
7119
|
import { join as join4 } from "node:path";
|
|
7239
7120
|
var shape = strictObject({
|
|
@@ -7258,21 +7139,21 @@ var mayModelReply = /* @__PURE__ */ __name((path, provider, chat) => {
|
|
|
7258
7139
|
return consent.provider === provider && !consent.deniedChats.includes(chat);
|
|
7259
7140
|
}, "mayModelReply");
|
|
7260
7141
|
|
|
7261
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
7262
|
-
var replyRenderer = /* @__PURE__ */ __name((app, profile, settings, env, warn,
|
|
7142
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.614.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_3bb6323e04e526bd9df39f840434b06b/node_modules/@wirecat/cli-core/dist/replies/rendering.js
|
|
7143
|
+
var replyRenderer = /* @__PURE__ */ __name((app, profile, settings, env, warn, options = {
|
|
7263
7144
|
ai: true
|
|
7264
7145
|
}) => async (rule2, message, chat, now) => {
|
|
7265
7146
|
let called;
|
|
7266
7147
|
const gateway = modelGateway({
|
|
7267
|
-
signal:
|
|
7148
|
+
signal: options.signal,
|
|
7268
7149
|
resolve: /* @__PURE__ */ __name((purpose) => {
|
|
7269
7150
|
called = modelTarget(settings(), purpose);
|
|
7270
7151
|
return called;
|
|
7271
7152
|
}, "resolve"),
|
|
7272
7153
|
consent: /* @__PURE__ */ __name((_request, target) => mayModelReply(replyConsentPathFor(app, profile, env), replyModelIdentity(target.provider, target.baseUrl ?? ""), message.chatId), "consent"),
|
|
7273
|
-
key: /* @__PURE__ */ __name((provider, target) => embeddingKeys(app, env,
|
|
7154
|
+
key: /* @__PURE__ */ __name((provider, target) => embeddingKeys(app, env, options.keyring).read(target.baseUrl === void 0 ? provider : endpointKeyName(target.baseUrl))?.key, "key")
|
|
7274
7155
|
});
|
|
7275
|
-
if (
|
|
7156
|
+
if (options.signal?.aborted)
|
|
7276
7157
|
throw new CliError("cancelled", "reply rendering cancelled");
|
|
7277
7158
|
const result2 = await renderReplyTemplate(rule2.reply, {
|
|
7278
7159
|
senderName: message.senderName,
|
|
@@ -7280,8 +7161,8 @@ var replyRenderer = /* @__PURE__ */ __name((app, profile, settings, env, warn, o
|
|
|
7280
7161
|
now,
|
|
7281
7162
|
timezone: rule2.when.hours?.timezone,
|
|
7282
7163
|
data: message.text,
|
|
7283
|
-
allowAI:
|
|
7284
|
-
preview:
|
|
7164
|
+
allowAI: options.ai === true,
|
|
7165
|
+
preview: options.preview === true,
|
|
7285
7166
|
complete: /* @__PURE__ */ __name(async (prompt, data) => {
|
|
7286
7167
|
const result3 = await gateway.complete({
|
|
7287
7168
|
purpose: "replies",
|
|
@@ -7290,7 +7171,7 @@ var replyRenderer = /* @__PURE__ */ __name((app, profile, settings, env, warn, o
|
|
|
7290
7171
|
data,
|
|
7291
7172
|
maxTokens: 512
|
|
7292
7173
|
});
|
|
7293
|
-
if (
|
|
7174
|
+
if (options.signal?.aborted)
|
|
7294
7175
|
throw new CliError("cancelled", "reply rendering cancelled");
|
|
7295
7176
|
const current = modelTarget(settings(), "replies");
|
|
7296
7177
|
const baseUrl = called?.baseUrl ?? (called?.provider === "anthropic" ? "https://api.anthropic.com" : "https://api.openai.com/v1");
|
|
@@ -7305,7 +7186,7 @@ var replyRenderer = /* @__PURE__ */ __name((app, profile, settings, env, warn, o
|
|
|
7305
7186
|
return result2;
|
|
7306
7187
|
}, "replyRenderer");
|
|
7307
7188
|
|
|
7308
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
7189
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.614.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_3bb6323e04e526bd9df39f840434b06b/node_modules/@wirecat/cli-core/dist/replies/serve.js
|
|
7309
7190
|
var NOT_ALLOWED = "replies.send is not allow";
|
|
7310
7191
|
var NO_RULES = "no rules";
|
|
7311
7192
|
var ONLY_TASK = "opened a task, sent nothing";
|
|
@@ -7398,12 +7279,12 @@ var replyTo = /* @__PURE__ */ __name(async (deps, message) => {
|
|
|
7398
7279
|
return { skip: why };
|
|
7399
7280
|
}, "replyTo");
|
|
7400
7281
|
|
|
7401
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
7282
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.614.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_3bb6323e04e526bd9df39f840434b06b/node_modules/@wirecat/cli-core/dist/cli/messenger/serve-catch-up.js
|
|
7402
7283
|
var START_SYNC_DELAY_MS = 3e4;
|
|
7403
7284
|
var START_SYNC_BUDGET_MS = 5 * 6e4;
|
|
7404
7285
|
var START_SYNC_WINDOW_MS = 7 * 864e5;
|
|
7405
7286
|
var START_SYNC_PER_CHAT = 500;
|
|
7406
|
-
var startSync = /* @__PURE__ */ __name(({ chats, newestHeld, fetch
|
|
7287
|
+
var startSync = /* @__PURE__ */ __name(({ chats, newestHeld, fetch, note, warn, delayMs = START_SYNC_DELAY_MS, budgetMs = START_SYNC_BUDGET_MS, windowMs = START_SYNC_WINDOW_MS, now = Date.now }) => {
|
|
7407
7288
|
const controller = new AbortController();
|
|
7408
7289
|
let timer;
|
|
7409
7290
|
let pass = Promise.resolve();
|
|
@@ -7431,7 +7312,7 @@ var startSync = /* @__PURE__ */ __name(({ chats, newestHeld, fetch: fetch2, note
|
|
|
7431
7312
|
if (stop.aborted)
|
|
7432
7313
|
break;
|
|
7433
7314
|
try {
|
|
7434
|
-
summary.fetched += (await
|
|
7315
|
+
summary.fetched += (await fetch(chat.id, Math.max(held ?? anywhere, floor), stop)).fetched;
|
|
7435
7316
|
summary.chats += 1;
|
|
7436
7317
|
} catch (error) {
|
|
7437
7318
|
if (stop.aborted)
|
|
@@ -7475,10 +7356,10 @@ var startSync = /* @__PURE__ */ __name(({ chats, newestHeld, fetch: fetch2, note
|
|
|
7475
7356
|
};
|
|
7476
7357
|
}, "startSync");
|
|
7477
7358
|
|
|
7478
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
7359
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.614.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_3bb6323e04e526bd9df39f840434b06b/node_modules/@wirecat/cli-core/dist/cli/messenger/serve-members.js
|
|
7479
7360
|
var FIRST_FETCH_MS = 6e4;
|
|
7480
7361
|
var DAY_MS = 864e5;
|
|
7481
|
-
var memberFetches = /* @__PURE__ */ __name(({ withStore, fetch
|
|
7362
|
+
var memberFetches = /* @__PURE__ */ __name(({ withStore, fetch, warn, firstMs = FIRST_FETCH_MS, everyMs = DAY_MS }) => {
|
|
7482
7363
|
let timer;
|
|
7483
7364
|
let round = Promise.resolve();
|
|
7484
7365
|
let stopped = false;
|
|
@@ -7491,7 +7372,7 @@ var memberFetches = /* @__PURE__ */ __name(({ withStore, fetch: fetch2, warn, fi
|
|
|
7491
7372
|
if (lastCount?.day === today)
|
|
7492
7373
|
continue;
|
|
7493
7374
|
try {
|
|
7494
|
-
await
|
|
7375
|
+
await fetch(store, account, chatId);
|
|
7495
7376
|
done.fetched += 1;
|
|
7496
7377
|
} catch (error) {
|
|
7497
7378
|
done.failed += 1;
|
|
@@ -7529,7 +7410,7 @@ var memberFetches = /* @__PURE__ */ __name(({ withStore, fetch: fetch2, warn, fi
|
|
|
7529
7410
|
};
|
|
7530
7411
|
}, "memberFetches");
|
|
7531
7412
|
|
|
7532
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
7413
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.614.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_3bb6323e04e526bd9df39f840434b06b/node_modules/@wirecat/cli-core/dist/cli/messenger/serve-notice.js
|
|
7533
7414
|
var record2 = /* @__PURE__ */ __name((context, app, severity, attributes) => recordLogFor(context.streams.diagnostic, app, { command: currentRun().command || "serve" })[severity](attributes), "record");
|
|
7534
7415
|
var noticeFor = /* @__PURE__ */ __name((context, app, severity = "warn") => ({ text, ...attributes }) => {
|
|
7535
7416
|
if (context.format === "pretty") {
|
|
@@ -7562,7 +7443,7 @@ var recordDiagnostics = /* @__PURE__ */ __name((context, app) => {
|
|
|
7562
7443
|
return context;
|
|
7563
7444
|
}, "recordDiagnostics");
|
|
7564
7445
|
|
|
7565
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
7446
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.614.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_3bb6323e04e526bd9df39f840434b06b/node_modules/@wirecat/cli-core/dist/cli/messenger/serve-stems.js
|
|
7566
7447
|
var STEMS_EVERY_MS = 3e4;
|
|
7567
7448
|
var STEMS_SLICE_MS = 2e3;
|
|
7568
7449
|
var stemFills = /* @__PURE__ */ __name(({ withStore, warn, everyMs = STEMS_EVERY_MS, sliceMs = STEMS_SLICE_MS }) => {
|
|
@@ -7602,7 +7483,7 @@ var stemFills = /* @__PURE__ */ __name(({ withStore, warn, everyMs = STEMS_EVERY
|
|
|
7602
7483
|
};
|
|
7603
7484
|
}, "stemFills");
|
|
7604
7485
|
|
|
7605
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
7486
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.614.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_3bb6323e04e526bd9df39f840434b06b/node_modules/@wirecat/cli-core/dist/cli/messenger/message-items.js
|
|
7606
7487
|
var defined = /* @__PURE__ */ __name((value) => Object.fromEntries(Object.entries(value).filter(([, one]) => one !== void 0)), "defined");
|
|
7607
7488
|
var attachmentItem = /* @__PURE__ */ __name((attachment) => defined({
|
|
7608
7489
|
kind: attachment.kind,
|
|
@@ -7697,7 +7578,7 @@ var viewOf = /* @__PURE__ */ __name((context, messenger) => ({
|
|
|
7697
7578
|
locale: messenger.app.locale
|
|
7698
7579
|
}), "viewOf");
|
|
7699
7580
|
|
|
7700
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
7581
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.614.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_3bb6323e04e526bd9df39f840434b06b/node_modules/@wirecat/cli-core/dist/cli/messenger/watch-answers.js
|
|
7701
7582
|
var observed = /* @__PURE__ */ __name((value) => ({
|
|
7702
7583
|
value: value.value,
|
|
7703
7584
|
observed_at: value.observedAt,
|
|
@@ -7764,7 +7645,7 @@ var watchEventItem = /* @__PURE__ */ __name((value, account) => {
|
|
|
7764
7645
|
}
|
|
7765
7646
|
}, "watchEventItem");
|
|
7766
7647
|
|
|
7767
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
7648
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.614.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_3bb6323e04e526bd9df39f840434b06b/node_modules/@wirecat/cli-core/dist/cli/messenger/watch-command.js
|
|
7768
7649
|
var watchCommand = /* @__PURE__ */ __name((messenger) => annotate(new Command("watch"), {
|
|
7769
7650
|
output: { entity: "watch_item" },
|
|
7770
7651
|
effects: REMOTE_READ,
|
|
@@ -7919,7 +7800,7 @@ var describe = /* @__PURE__ */ __name((event, render) => {
|
|
|
7919
7800
|
}
|
|
7920
7801
|
}, "describe");
|
|
7921
7802
|
|
|
7922
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
7803
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.614.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_3bb6323e04e526bd9df39f840434b06b/node_modules/@wirecat/cli-core/dist/cli/messenger/serve-command.js
|
|
7923
7804
|
var serveCommand = /* @__PURE__ */ __name((messenger) => {
|
|
7924
7805
|
const command = annotate(new Command("serve"), {
|
|
7925
7806
|
output: { entity: "serve_summary" },
|
|
@@ -8183,7 +8064,7 @@ var tasking = /* @__PURE__ */ __name((context, warn) => {
|
|
|
8183
8064
|
};
|
|
8184
8065
|
}, "tasking");
|
|
8185
8066
|
|
|
8186
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
8067
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.614.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_3bb6323e04e526bd9df39f840434b06b/node_modules/@wirecat/cli-core/dist/cli/messenger/store-tables-command.js
|
|
8187
8068
|
import { existsSync as existsSync8 } from "node:fs";
|
|
8188
8069
|
var PATH = "store tables list";
|
|
8189
8070
|
var STORE_TABLES_QUERY = {
|
|
@@ -8226,7 +8107,7 @@ var storeTablesCommand = /* @__PURE__ */ __name((messenger) => {
|
|
|
8226
8107
|
return tables;
|
|
8227
8108
|
}, "storeTablesCommand");
|
|
8228
8109
|
|
|
8229
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
8110
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.614.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_3bb6323e04e526bd9df39f840434b06b/node_modules/@wirecat/cli-core/dist/cli/messenger/store-maintenance-command.js
|
|
8230
8111
|
var SEARCH_INDEXES = ["messages_fts", "chats_fts", "identities_fts"];
|
|
8231
8112
|
var WORD_INDEX = "message_words";
|
|
8232
8113
|
var schemaOf = /* @__PURE__ */ __name((database) => {
|
|
@@ -8252,11 +8133,26 @@ var readingOnly = /* @__PURE__ */ __name(async (path, read) => {
|
|
|
8252
8133
|
database.close();
|
|
8253
8134
|
}
|
|
8254
8135
|
}, "readingOnly");
|
|
8255
|
-
var
|
|
8136
|
+
var withoutInode = /* @__PURE__ */ __name(({ inode: _, ...mark }) => mark, "withoutInode");
|
|
8137
|
+
var fileSchema = /* @__PURE__ */ __name(async (path) => {
|
|
8138
|
+
try {
|
|
8139
|
+
return await readingOnly(path, (database) => fileSchemaOf(database).version);
|
|
8140
|
+
} catch {
|
|
8141
|
+
return null;
|
|
8142
|
+
}
|
|
8143
|
+
}, "fileSchema");
|
|
8144
|
+
var storeSummary = /* @__PURE__ */ __name(async (env, { deep = false, command, version } = {}) => {
|
|
8256
8145
|
const path = storePath(env);
|
|
8257
8146
|
if (!existsSync9(path))
|
|
8258
8147
|
return { path, exists: false };
|
|
8259
8148
|
const checked = await storeHealth(path, { deep });
|
|
8149
|
+
const recorded = deep ? recordDeepCheck(path, checked, {
|
|
8150
|
+
cli: command ?? "unknown",
|
|
8151
|
+
...version ? { version } : {},
|
|
8152
|
+
schema: await fileSchema(path)
|
|
8153
|
+
}) : null;
|
|
8154
|
+
const mark = readDamageMark(path);
|
|
8155
|
+
const lastKnownGood = readHealthMark(path)?.last_ok_at ?? null;
|
|
8260
8156
|
const health = {
|
|
8261
8157
|
checked: checked.checked,
|
|
8262
8158
|
covers: deep ? "every page and every search index" : QUICK_HEALTH_CHECKS,
|
|
@@ -8267,18 +8163,24 @@ var storeSummary = /* @__PURE__ */ __name(async (env, { deep = false, command }
|
|
|
8267
8163
|
...checked.invalidJson?.length ? { invalidJson: checked.invalidJson } : {},
|
|
8268
8164
|
...checked.searchIndexes?.some((index) => !index.ok) ? { damagedSearchIndexes: checked.searchIndexes.filter((index) => !index.ok).map((index) => index.name) } : {}
|
|
8269
8165
|
};
|
|
8270
|
-
const damage = command ? explainDamage(checked, command) : null;
|
|
8271
|
-
const healthOf = {
|
|
8166
|
+
const damage = command ? explainDamage(checked, command, mark) : null;
|
|
8167
|
+
const healthOf = {
|
|
8168
|
+
health,
|
|
8169
|
+
lastKnownGood,
|
|
8170
|
+
...mark ? { damageMark: withoutInode(mark) } : {},
|
|
8171
|
+
...recorded?.cleared ? { damageMarkCleared: withoutInode(recorded.cleared) } : {},
|
|
8172
|
+
...damage ? { damage } : {}
|
|
8173
|
+
};
|
|
8272
8174
|
try {
|
|
8273
8175
|
return await reading(path, (database) => {
|
|
8274
|
-
const { version, writable } = schemaOf(database);
|
|
8176
|
+
const { version: version2, writable } = schemaOf(database);
|
|
8275
8177
|
return {
|
|
8276
8178
|
path,
|
|
8277
8179
|
exists: true,
|
|
8278
|
-
schema:
|
|
8180
|
+
schema: version2,
|
|
8279
8181
|
speaks: SPEAKS,
|
|
8280
8182
|
writable,
|
|
8281
|
-
...
|
|
8183
|
+
...version2 > 0 ? { chats: count2(database, "chats"), messages: count2(database, "messages") } : {},
|
|
8282
8184
|
...healthOf
|
|
8283
8185
|
};
|
|
8284
8186
|
});
|
|
@@ -8896,12 +8798,10 @@ export {
|
|
|
8896
8798
|
readRepliesState,
|
|
8897
8799
|
writeRepliesState,
|
|
8898
8800
|
paused,
|
|
8801
|
+
safeLiquid,
|
|
8899
8802
|
DRY_RUN_DAYS,
|
|
8900
8803
|
dryRun,
|
|
8901
8804
|
senderFacts,
|
|
8902
|
-
endpointKeyName,
|
|
8903
|
-
embeddingKeys,
|
|
8904
|
-
modelGateway,
|
|
8905
8805
|
replyConsentPathFor,
|
|
8906
8806
|
readReplyConsent,
|
|
8907
8807
|
writeReplyConsent,
|