@wirecat/attio-cli 0.5.3 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +29 -0
- package/README.md +4 -4
- package/contracts/wirecat.json +45 -0
- package/dist/activities.d.ts +4 -0
- package/dist/activities.d.ts.map +1 -0
- package/dist/activities.js +83 -0
- package/dist/activities.js.map +1 -0
- package/dist/bin/attio.js +2 -2
- package/dist/bundle/agent-GUXXSLT5.js +38 -0
- package/dist/bundle/{all-profiles-ONLZNT2O.js → all-profiles-63N3EQ46.js} +10 -10
- package/dist/bundle/{anthropic-7NHDUCS7.js → anthropic-B4W7MZQE.js} +5 -5
- package/dist/bundle/{app-server-76UZBJNR.js → app-server-EXNGTHWO.js} +62 -61
- package/dist/bundle/attio.js +11 -11
- package/dist/bundle/{bun-3M7LDMJY.js → bun-OPDGMZZQ.js} +2 -2
- package/dist/bundle/{bun-sqlite-WWPYULNT.js → bun-sqlite-NBAY7FR2.js} +6 -6
- package/dist/bundle/{chunk-H7RYW7CD.js → chunk-2JHVQMVC.js} +1 -1
- package/dist/bundle/{chunk-GHT7KPTC.js → chunk-2QDUP74I.js} +34 -34
- package/dist/bundle/{chunk-LQDZSJ3V.js → chunk-2XBDILVW.js} +1 -1
- package/dist/bundle/{chunk-TL7NUBVM.js → chunk-3HC5F3P7.js} +1 -1
- package/dist/bundle/{chunk-3MZREGLN.js → chunk-3MSHGNVE.js} +12 -12
- package/dist/bundle/{chunk-A5A2I2DY.js → chunk-3YM4B2GT.js} +1 -1
- package/dist/bundle/{chunk-2HU7TYQK.js → chunk-4N7PP76S.js} +1 -1
- package/dist/bundle/{chunk-3TFPJCTB.js → chunk-4RBMCXZT.js} +25 -25
- package/dist/bundle/{chunk-TVDBAZFO.js → chunk-4RSWOPKL.js} +13 -9
- package/dist/bundle/{chunk-SCBLAAZU.js → chunk-5JKTVAXX.js} +19 -19
- package/dist/bundle/chunk-5N2V6XO7.js +119 -0
- package/dist/bundle/{chunk-RDXB7HFB.js → chunk-5WD22IXQ.js} +3 -3
- package/dist/bundle/{chunk-RUNJPSJ3.js → chunk-6K4Z6CAM.js} +574 -599
- package/dist/bundle/{chunk-6MPA7CKD.js → chunk-6TD3DCWC.js} +2 -2
- package/dist/bundle/{chunk-Y2HZQMNK.js → chunk-7Z53MLQP.js} +7 -7
- package/dist/bundle/chunk-AATTOFNY.js +2045 -0
- package/dist/bundle/{chunk-OLKDUVWD.js → chunk-APARYILG.js} +19 -15
- package/dist/bundle/{chunk-S3SA2XXD.js → chunk-DM7KWVDZ.js} +47 -31
- package/dist/bundle/{chunk-VHPNTMJJ.js → chunk-DNCLQPOM.js} +1 -1
- package/dist/bundle/{chunk-PYFVVNAD.js → chunk-DPD4FMHN.js} +6 -6
- package/dist/bundle/{chunk-LJLUYRPY.js → chunk-DPV53EZC.js} +4 -4
- package/dist/bundle/{chunk-NN7Z5RK6.js → chunk-DURNR4RO.js} +8 -8
- package/dist/bundle/{chunk-PZBQH5B7.js → chunk-EVUMQKV7.js} +3 -3
- package/dist/bundle/{chunk-3QYMX2QX.js → chunk-EY36BTKZ.js} +2 -2
- package/dist/bundle/{chunk-ABMNYUSQ.js → chunk-FH6OEGGN.js} +14 -14
- package/dist/bundle/{chunk-M62QM7VF.js → chunk-FOP6G45D.js} +10 -10
- package/dist/bundle/{chunk-PQHS4Z5G.js → chunk-GGMAIIVE.js} +1 -1
- package/dist/bundle/{chunk-UFFAPBAP.js → chunk-GTEX4IUO.js} +5 -5
- package/dist/bundle/{chunk-INCLKCAJ.js → chunk-HZ3C4WXD.js} +3 -3
- package/dist/bundle/{chunk-764RTGNI.js → chunk-IA7LLLEI.js} +3 -3
- package/dist/bundle/{chunk-WVXEVCMY.js → chunk-J6GVVISK.js} +8 -8
- package/dist/bundle/{chunk-T3QKHFGB.js → chunk-JG6LCSEX.js} +13 -13
- package/dist/bundle/{chunk-KTGIA7CC.js → chunk-JIGEJZ4I.js} +6650 -4822
- package/dist/bundle/{chunk-BSPMRKPS.js → chunk-KVTNYRDO.js} +6 -6
- package/dist/bundle/{chunk-LSFZSGQK.js → chunk-L45WN3AR.js} +3 -3
- package/dist/bundle/{chunk-FVBZHGFE.js → chunk-L72WUJAS.js} +2 -2
- package/dist/bundle/{chunk-KWJ4GAYR.js → chunk-LKH3UKLO.js} +4 -4
- package/dist/bundle/{chunk-V6RWAUX7.js → chunk-LM3W7YOM.js} +4 -4
- package/dist/bundle/{chunk-6MEPMDWU.js → chunk-M4AC55ZB.js} +165 -158
- package/dist/bundle/{chunk-STEUWWU5.js → chunk-MCLQTCGH.js} +91 -55
- package/dist/bundle/{chunk-X6NSSCMF.js → chunk-NB7EOAUZ.js} +1 -1
- package/dist/bundle/{chunk-WUECAFAJ.js → chunk-NISH4UXM.js} +2 -2
- package/dist/bundle/{chunk-VNGG6O5T.js → chunk-OYEVYOCL.js} +6 -6
- package/dist/bundle/{chunk-NCYBA5FH.js → chunk-P7G5HFY3.js} +2 -2
- package/dist/bundle/{chunk-T2TW53JB.js → chunk-PAEKXVJW.js} +8 -8
- package/dist/bundle/{chunk-HPYDPVGU.js → chunk-PLPBEWD4.js} +3 -3
- package/dist/bundle/{chunk-PZE4D63W.js → chunk-PMQ7GP6X.js} +6 -6
- package/dist/bundle/{chunk-TF33UDFE.js → chunk-Q7ICVP25.js} +1 -1
- package/dist/bundle/{chunk-DDFQEOLX.js → chunk-QPPOIWPY.js} +8 -8
- package/dist/bundle/{chunk-MUDJABVF.js → chunk-QSJKSPWF.js} +4 -4
- package/dist/bundle/{chunk-PVZK2COW.js → chunk-RDVTHFPP.js} +5 -5
- package/dist/bundle/{chunk-N6VLRVCC.js → chunk-RQORQN2V.js} +61 -61
- package/dist/bundle/{chunk-U3KTIE6B.js → chunk-RRTMPSQR.js} +2 -2
- package/dist/bundle/{chunk-TSHMRHL6.js → chunk-S6JG4YUH.js} +2 -2
- package/dist/bundle/{chunk-YQNZFXOW.js → chunk-SCI7QEHF.js} +7 -7
- package/dist/bundle/{chunk-VIXMK7ZG.js → chunk-SSA6JBPA.js} +7 -7
- package/dist/bundle/{chunk-V2AF7BYP.js → chunk-T4J7XFXT.js} +181 -110
- package/dist/bundle/{chunk-F5IGO45Z.js → chunk-TTF5DP4V.js} +7 -7
- package/dist/bundle/{chunk-K34B37AP.js → chunk-TXDR6YSF.js} +1 -1
- package/dist/bundle/{chunk-BFESDJPU.js → chunk-TY7NDMFY.js} +1 -1
- package/dist/bundle/{chunk-EKRO2AYG.js → chunk-UDSL3MUU.js} +8 -8
- package/dist/bundle/{chunk-NGVO2UTA.js → chunk-UKHF37ZU.js} +17 -17
- package/dist/bundle/{chunk-MFPYCWMY.js → chunk-V57E7PJQ.js} +4 -4
- package/dist/bundle/{chunk-DOTBJMPB.js → chunk-V7IF2K3P.js} +3 -3
- package/dist/bundle/{chunk-S552I4P7.js → chunk-VB7FZOYX.js} +1 -1
- package/dist/bundle/{chunk-7ONN7UCC.js → chunk-VZ5PPYDG.js} +1 -1
- package/dist/bundle/chunk-WOPVBRPV.js +29 -0
- package/dist/bundle/{chunk-AYF2JNHE.js → chunk-WXQGA6XK.js} +3 -3
- package/dist/bundle/{chunk-NKVJV5GN.js → chunk-X5UPBSTP.js} +1 -1
- package/dist/bundle/{chunk-65OPLJBL.js → chunk-XQGN2D44.js} +3 -3
- package/dist/bundle/{chunk-HGD4JW37.js → chunk-YNGU36GW.js} +12 -12
- package/dist/bundle/{chunk-JRHDYND7.js → chunk-YWDFYQOU.js} +2 -2
- package/dist/bundle/{chunk-QRHPXZST.js → chunk-ZZD2YPOX.js} +3 -3
- package/dist/bundle/command-contract-KCCW4LNI.js +37 -0
- package/dist/bundle/{command-server-entry-6UEGWYW7.js → command-server-entry-3NPPABQQ.js} +25 -25
- package/dist/bundle/{decode-BF2CNTOP.js → decode-26M7XE2B.js} +5 -5
- package/dist/bundle/{dispatch-ZRVKJENQ.js → dispatch-2FTOHA5D.js} +8 -8
- package/dist/bundle/{echarts-ELZMS7DC.js → echarts-O3TNDAXJ.js} +2 -2
- package/dist/bundle/{embed-SXU7JVUG.js → embed-XJLEAWXE.js} +6 -6
- package/dist/bundle/{embedder-ZVNBHGXC.js → embedder-OEL6PXEH.js} +9 -9
- package/dist/bundle/{failure-C2B7PYPJ.js → failure-OHIXWTR6.js} +2 -2
- package/dist/bundle/{first-run-SLIPSHPE.js → first-run-CIXGBXY6.js} +12 -12
- package/dist/bundle/first-screen-5FK4D45F.js +38 -0
- package/dist/bundle/{instructions-Q6QKH7MV.js → instructions-AMH5RWVJ.js} +1 -1
- package/dist/bundle/{mcp-VNOYBWW2.js → mcp-5HFPWC3W.js} +2 -2
- package/dist/bundle/meeting-combined-DMVGQNJ7.js +24 -0
- package/dist/bundle/{meeting-model-XJ6OWIAP.js → meeting-model-2THAT7OH.js} +11 -11
- package/dist/bundle/{meeting-semantic-7TJE4HX6.js → meeting-semantic-Q6XYFYUD.js} +6 -6
- package/dist/bundle/{node-YNLEE4BB.js → node-EGMCBAO7.js} +2 -2
- package/dist/bundle/{node-sqlite-24VK6J3W.js → node-sqlite-2SWWGW6H.js} +7 -7
- package/dist/bundle/{oauth-4TLSBITF.js → oauth-V5LGTXF2.js} +7 -7
- package/dist/bundle/{open-U6M2RLYK.js → open-25EKOTZA.js} +5 -5
- package/dist/bundle/{openai-UKD2XQ5J.js → openai-VX3OLIHM.js} +15 -15
- package/dist/bundle/{process-UIE2CRFP.js → process-SGHEN6MQ.js} +1 -1
- package/dist/bundle/{program-HXMBQWIM.js → program-F37JH2SO.js} +728 -644
- package/dist/bundle/{prompt-TSDXFP3E.js → prompt-2VSPX5S7.js} +5 -5
- package/dist/bundle/{recognize-Y534SZIK.js → recognize-NA5XUFKK.js} +4 -4
- package/dist/bundle/{remote-PJNOYKXU.js → remote-BOME6XOE.js} +9 -9
- package/dist/bundle/{rerank-TE4HIS5A.js → rerank-NG3XMFCV.js} +7 -7
- package/dist/bundle/{schemas-7JX36UC7.js → schemas-YGSTNU6F.js} +1 -1
- package/dist/bundle/{serve-ZOZWJKHB.js → serve-MR67OBED.js} +9 -9
- package/dist/bundle/server-4BWAGJQO.js +80 -0
- package/dist/bundle/{server-3K4IC4OA.js → server-OP2HJNXD.js} +54 -53
- package/dist/bundle/{sqlite-runtime-6R6CHLEM.js → sqlite-runtime-V5U6F5EB.js} +6 -6
- package/dist/bundle/{state-DFAH57DP.js → state-L4MWAATO.js} +6 -6
- package/dist/bundle/{store-LPO5SHGK.js → store-2ALTEH55.js} +18 -18
- package/dist/bundle/{store-6B5JF2LC.js → store-CXZFRG5D.js} +22 -20
- package/dist/bundle/store-maintenance-command-LC55DRQA.js +67 -0
- package/dist/bundle/surface-3GRJ7473.js +66 -0
- package/dist/commands/crm.d.ts.map +1 -1
- package/dist/commands/crm.js +4 -1
- package/dist/commands/crm.js.map +1 -1
- package/dist/config.d.ts +4 -4
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +6 -2
- package/dist/config.js.map +1 -1
- package/dist/generated/definitions.d.ts +1 -1
- package/dist/generated/definitions.d.ts.map +1 -1
- package/dist/generated/manifest.d.ts +1 -1
- package/dist/generated/manifest.d.ts.map +1 -1
- package/dist/generated/manifest.js.map +1 -1
- package/dist/hooks.d.ts +37 -0
- package/dist/hooks.d.ts.map +1 -1
- package/dist/hooks.js +3 -3
- package/dist/hooks.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +3 -3
- package/skills/attio-cli/SKILL.md +8 -7
- package/dist/bundle/agent-YCPGDAWJ.js +0 -37
- package/dist/bundle/chunk-J3ZQ4JWD.js +0 -2021
- package/dist/bundle/chunk-YJKP6UZC.js +0 -37
- package/dist/bundle/command-contract-7BABQLZN.js +0 -37
- package/dist/bundle/first-screen-UPNPU4MF.js +0 -37
- package/dist/bundle/meeting-combined-DLXVVC5J.js +0 -24
- package/dist/bundle/server-HPHPHKNF.js +0 -79
- package/dist/bundle/store-maintenance-command-UBNM3ADW.js +0 -66
- package/dist/bundle/surface-WQ7UR2NJ.js +0 -65
|
@@ -2,19 +2,19 @@ import { createRequire as __bundleRequire } from "node:module";
|
|
|
2
2
|
const require = __bundleRequire(import.meta.url);
|
|
3
3
|
import {
|
|
4
4
|
messengerContext
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-3MSHGNVE.js";
|
|
6
6
|
import {
|
|
7
7
|
chatEventAnswer,
|
|
8
8
|
memberAnswer,
|
|
9
9
|
pollVoteAnswer
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-DURNR4RO.js";
|
|
11
11
|
import {
|
|
12
12
|
stringWidth,
|
|
13
13
|
wrapAnsi
|
|
14
14
|
} from "./chunk-EH6ZEJGT.js";
|
|
15
15
|
import {
|
|
16
16
|
serveRelay
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-RDVTHFPP.js";
|
|
18
18
|
import {
|
|
19
19
|
FETCHING,
|
|
20
20
|
RULES_VERSION,
|
|
@@ -22,23 +22,26 @@ import {
|
|
|
22
22
|
applyTaskRulesOnArrival,
|
|
23
23
|
embeddingKeys,
|
|
24
24
|
endpointKeyName,
|
|
25
|
+
inside,
|
|
25
26
|
modelGateway,
|
|
26
27
|
newSendId,
|
|
27
28
|
onlineDeps,
|
|
28
29
|
openRequestTask,
|
|
29
30
|
patiently,
|
|
31
|
+
realPathOf,
|
|
30
32
|
refuseLockedOutput,
|
|
33
|
+
refusedPlace,
|
|
31
34
|
senderIsMe,
|
|
32
35
|
servicesFor,
|
|
33
36
|
syncsOneChat,
|
|
34
37
|
withTimeLimit
|
|
35
|
-
} from "./chunk-
|
|
38
|
+
} from "./chunk-6K4Z6CAM.js";
|
|
36
39
|
import {
|
|
37
40
|
capability,
|
|
38
41
|
queryTerms,
|
|
39
42
|
typedQuery,
|
|
40
43
|
withQuery
|
|
41
|
-
} from "./chunk-
|
|
44
|
+
} from "./chunk-APARYILG.js";
|
|
42
45
|
import {
|
|
43
46
|
holdLock,
|
|
44
47
|
lockPath,
|
|
@@ -46,7 +49,7 @@ import {
|
|
|
46
49
|
releaseLock,
|
|
47
50
|
servingProfiles,
|
|
48
51
|
takeLock
|
|
49
|
-
} from "./chunk-
|
|
52
|
+
} from "./chunk-XQGN2D44.js";
|
|
50
53
|
import {
|
|
51
54
|
Command,
|
|
52
55
|
LOCAL_READ,
|
|
@@ -74,13 +77,13 @@ import {
|
|
|
74
77
|
snakeKeys,
|
|
75
78
|
storeTable,
|
|
76
79
|
withoutProviderRefs
|
|
77
|
-
} from "./chunk-
|
|
80
|
+
} from "./chunk-M4AC55ZB.js";
|
|
78
81
|
import {
|
|
79
82
|
holdersOf
|
|
80
|
-
} from "./chunk-
|
|
83
|
+
} from "./chunk-3YM4B2GT.js";
|
|
81
84
|
import {
|
|
82
85
|
readSecret
|
|
83
|
-
} from "./chunk-
|
|
86
|
+
} from "./chunk-IA7LLLEI.js";
|
|
84
87
|
import {
|
|
85
88
|
QUICK_HEALTH_CHECKS,
|
|
86
89
|
fts5Tables,
|
|
@@ -88,7 +91,7 @@ import {
|
|
|
88
91
|
lossUnknown,
|
|
89
92
|
storeDamageReport,
|
|
90
93
|
storeHealth
|
|
91
|
-
} from "./chunk-
|
|
94
|
+
} from "./chunk-UKHF37ZU.js";
|
|
92
95
|
import {
|
|
93
96
|
CORPORA,
|
|
94
97
|
MIGRATIONS,
|
|
@@ -126,7 +129,7 @@ import {
|
|
|
126
129
|
storeClients,
|
|
127
130
|
storeContents,
|
|
128
131
|
vectorIndexCounts
|
|
129
|
-
} from "./chunk-
|
|
132
|
+
} from "./chunk-JIGEJZ4I.js";
|
|
130
133
|
import {
|
|
131
134
|
currentRun,
|
|
132
135
|
formatLocator,
|
|
@@ -135,35 +138,35 @@ import {
|
|
|
135
138
|
readHealthMark,
|
|
136
139
|
readJournalMark,
|
|
137
140
|
recordDeepCheck
|
|
138
|
-
} from "./chunk-
|
|
141
|
+
} from "./chunk-AATTOFNY.js";
|
|
139
142
|
import {
|
|
140
143
|
failureKey,
|
|
141
144
|
isStoreDamage
|
|
142
|
-
} from "./chunk-
|
|
145
|
+
} from "./chunk-ZZD2YPOX.js";
|
|
143
146
|
import {
|
|
144
147
|
queryFieldsOf
|
|
145
|
-
} from "./chunk-
|
|
148
|
+
} from "./chunk-RQORQN2V.js";
|
|
146
149
|
import {
|
|
147
150
|
modelAddressAllowed,
|
|
148
151
|
onThisComputer
|
|
149
|
-
} from "./chunk-
|
|
152
|
+
} from "./chunk-7Z53MLQP.js";
|
|
150
153
|
import {
|
|
151
154
|
readSharedSection,
|
|
152
155
|
sharedConfigPath,
|
|
153
156
|
writeSharedSection
|
|
154
|
-
} from "./chunk-
|
|
157
|
+
} from "./chunk-TTF5DP4V.js";
|
|
155
158
|
import {
|
|
156
159
|
storePath
|
|
157
|
-
} from "./chunk-
|
|
160
|
+
} from "./chunk-L72WUJAS.js";
|
|
158
161
|
import {
|
|
159
162
|
openCache
|
|
160
|
-
} from "./chunk-
|
|
163
|
+
} from "./chunk-PMQ7GP6X.js";
|
|
161
164
|
import {
|
|
162
165
|
Credentials,
|
|
163
166
|
isMovedRun,
|
|
164
167
|
resolvePaths,
|
|
165
168
|
writeSecurely
|
|
166
|
-
} from "./chunk-
|
|
169
|
+
} from "./chunk-5JKTVAXX.js";
|
|
167
170
|
import {
|
|
168
171
|
array,
|
|
169
172
|
boolean,
|
|
@@ -190,7 +193,7 @@ import {
|
|
|
190
193
|
CliError,
|
|
191
194
|
singleLine,
|
|
192
195
|
visibleControls
|
|
193
|
-
} from "./chunk-
|
|
196
|
+
} from "./chunk-S6JG4YUH.js";
|
|
194
197
|
import {
|
|
195
198
|
__commonJS,
|
|
196
199
|
__name,
|
|
@@ -265,9 +268,9 @@ var require_liquid_node = __commonJS({
|
|
|
265
268
|
__name(isIterator, "isIterator");
|
|
266
269
|
function promisify(fn) {
|
|
267
270
|
return function(...args) {
|
|
268
|
-
return new Promise((
|
|
271
|
+
return new Promise((resolve4, reject2) => {
|
|
269
272
|
fn(...args, (err, result2) => {
|
|
270
|
-
err ? reject2(err) :
|
|
273
|
+
err ? reject2(err) : resolve4(result2);
|
|
271
274
|
});
|
|
272
275
|
});
|
|
273
276
|
};
|
|
@@ -1857,12 +1860,12 @@ var require_liquid_node = __commonJS({
|
|
|
1857
1860
|
return fs$1.readFileSync(filepath, "utf8");
|
|
1858
1861
|
}
|
|
1859
1862
|
__name(readFileSync6, "readFileSync");
|
|
1860
|
-
function
|
|
1863
|
+
function resolve3(root, file2, ext) {
|
|
1861
1864
|
if (!path.extname(file2))
|
|
1862
1865
|
file2 += ext;
|
|
1863
1866
|
return path.resolve(root, file2);
|
|
1864
1867
|
}
|
|
1865
|
-
__name(
|
|
1868
|
+
__name(resolve3, "resolve");
|
|
1866
1869
|
function fallback(file2) {
|
|
1867
1870
|
try {
|
|
1868
1871
|
return requireResolve(file2);
|
|
@@ -1870,10 +1873,10 @@ var require_liquid_node = __commonJS({
|
|
|
1870
1873
|
}
|
|
1871
1874
|
}
|
|
1872
1875
|
__name(fallback, "fallback");
|
|
1873
|
-
function
|
|
1876
|
+
function dirname5(filepath) {
|
|
1874
1877
|
return path.dirname(filepath);
|
|
1875
1878
|
}
|
|
1876
|
-
__name(
|
|
1879
|
+
__name(dirname5, "dirname");
|
|
1877
1880
|
var realpathAsync = promisify(fs$1.realpath);
|
|
1878
1881
|
async function contains(root, file2) {
|
|
1879
1882
|
try {
|
|
@@ -1903,9 +1906,9 @@ var require_liquid_node = __commonJS({
|
|
|
1903
1906
|
readFile,
|
|
1904
1907
|
existsSync: existsSync11,
|
|
1905
1908
|
readFileSync: readFileSync6,
|
|
1906
|
-
resolve:
|
|
1909
|
+
resolve: resolve3,
|
|
1907
1910
|
fallback,
|
|
1908
|
-
dirname:
|
|
1911
|
+
dirname: dirname5,
|
|
1909
1912
|
contains,
|
|
1910
1913
|
containsSync,
|
|
1911
1914
|
sep: path.sep
|
|
@@ -3630,7 +3633,7 @@ var require_liquid_node = __commonJS({
|
|
|
3630
3633
|
uri_escape,
|
|
3631
3634
|
slugify
|
|
3632
3635
|
});
|
|
3633
|
-
var
|
|
3636
|
+
var join7 = argumentsToValue(function(v, arg) {
|
|
3634
3637
|
const array2 = toArray(v);
|
|
3635
3638
|
const sep = isNil(arg) ? " " : stringify(arg);
|
|
3636
3639
|
let outputSize = sep.length * Math.max(array2.length - 1, 0);
|
|
@@ -3906,7 +3909,7 @@ var require_liquid_node = __commonJS({
|
|
|
3906
3909
|
__name(sample, "sample");
|
|
3907
3910
|
var arrayFilters = /* @__PURE__ */ Object.freeze({
|
|
3908
3911
|
__proto__: null,
|
|
3909
|
-
join:
|
|
3912
|
+
join: join7,
|
|
3910
3913
|
last,
|
|
3911
3914
|
first,
|
|
3912
3915
|
reverse,
|
|
@@ -5530,11 +5533,11 @@ var require_liquid_node = __commonJS({
|
|
|
5530
5533
|
}
|
|
5531
5534
|
});
|
|
5532
5535
|
|
|
5533
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
5536
|
+
// node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/cli/messenger/store-maintenance-command.js
|
|
5534
5537
|
import { chmodSync, constants, copyFileSync, existsSync as existsSync10, mkdirSync, realpathSync as realpathSync3, renameSync as renameSync3, rmSync as rmSync3, statfsSync as statfsSync2, statSync as statSync4, writeFileSync as writeFileSync2 } from "node:fs";
|
|
5535
|
-
import { dirname as
|
|
5538
|
+
import { dirname as dirname4, resolve as resolve2 } from "node:path";
|
|
5536
5539
|
|
|
5537
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
5540
|
+
// node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/sealed.js
|
|
5538
5541
|
import { createCipheriv, createDecipheriv, createHash, randomBytes, scrypt, timingSafeEqual } from "node:crypto";
|
|
5539
5542
|
import { closeSync, createReadStream, createWriteStream, existsSync, openSync, readSync, renameSync, rmSync, statSync } from "node:fs";
|
|
5540
5543
|
import { Transform } from "node:stream";
|
|
@@ -5546,7 +5549,7 @@ var NONCE = 12;
|
|
|
5546
5549
|
var TAG = 16;
|
|
5547
5550
|
var HEADER = MAGIC.length + 3 + SALT + NONCE;
|
|
5548
5551
|
var COST = { log2N: 17, r: 8, p: 1 };
|
|
5549
|
-
var keyOf = /* @__PURE__ */ __name((password, salt, { log2N, r, p }) => new Promise((
|
|
5552
|
+
var keyOf = /* @__PURE__ */ __name((password, salt, { log2N, r, p }) => new Promise((resolve3, reject) => scrypt(password, salt, 32, { N: 2 ** log2N, r, p, maxmem: 2 * 128 * r * 2 ** log2N }, (error, key) => error ? reject(error) : resolve3(key))), "keyOf");
|
|
5550
5553
|
var checkFor = /* @__PURE__ */ __name(async (password, cost = COST) => {
|
|
5551
5554
|
refuseEmpty(password);
|
|
5552
5555
|
const salt = randomBytes(SALT);
|
|
@@ -5641,7 +5644,7 @@ var unsealFile = /* @__PURE__ */ __name(async (from, to, password) => {
|
|
|
5641
5644
|
renameSync(pending, to);
|
|
5642
5645
|
}, "unsealFile");
|
|
5643
5646
|
|
|
5644
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
5647
|
+
// node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/store/compatibility.js
|
|
5645
5648
|
var SPEAKS = MIGRATIONS.at(-1)?.version ?? 0;
|
|
5646
5649
|
var fileSchemaOf = /* @__PURE__ */ __name((database) => {
|
|
5647
5650
|
const tracked = database.prepare("SELECT 1 FROM sqlite_master WHERE name = 'schema_migrations'").get();
|
|
@@ -5665,7 +5668,7 @@ var compatibilityOf = /* @__PURE__ */ __name((file2, migrations = MIGRATIONS) =>
|
|
|
5665
5668
|
};
|
|
5666
5669
|
}, "compatibilityOf");
|
|
5667
5670
|
|
|
5668
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
5671
|
+
// node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/store/repair.js
|
|
5669
5672
|
import { createHash as createHash2 } from "node:crypto";
|
|
5670
5673
|
var COPY_MARK = "__repair_";
|
|
5671
5674
|
var COPY_NAME = /__repair_[0-9a-f]{8}(_\d+)?$/;
|
|
@@ -5919,19 +5922,79 @@ var deleteCopy = /* @__PURE__ */ __name((database, name) => {
|
|
|
5919
5922
|
return found;
|
|
5920
5923
|
}, "deleteCopy");
|
|
5921
5924
|
|
|
5922
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
5925
|
+
// node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/cli/path-options.js
|
|
5926
|
+
import { dirname, isAbsolute, join, resolve } from "node:path";
|
|
5927
|
+
var PATH_NAME = /^([a-z]+-)*(file|path|dir|directory|folder)s?$/;
|
|
5928
|
+
var PATH_PLACEHOLDER = /[<[]([a-z]+-)*(file|path|dir|directory|folder)s?(\.\.\.)?[>\]]/;
|
|
5929
|
+
var NOT_LOCAL = /* @__PURE__ */ new WeakMap();
|
|
5930
|
+
var IN_BACKUPS = /* @__PURE__ */ new WeakMap();
|
|
5931
|
+
var mark = /* @__PURE__ */ __name((marks, command, names) => {
|
|
5932
|
+
marks.set(command, /* @__PURE__ */ new Set([...marks.get(command) ?? [], ...names]));
|
|
5933
|
+
return command;
|
|
5934
|
+
}, "mark");
|
|
5935
|
+
var notLocalPaths = /* @__PURE__ */ __name((command, ...names) => mark(NOT_LOCAL, command, names), "notLocalPaths");
|
|
5936
|
+
var inStoreBackups = /* @__PURE__ */ __name((command, ...names) => mark(IN_BACKUPS, command, names), "inStoreBackups");
|
|
5937
|
+
var marked = /* @__PURE__ */ __name((marks, command, name) => {
|
|
5938
|
+
for (let at = command; at; at = at.parent)
|
|
5939
|
+
if (marks.get(at)?.has(name))
|
|
5940
|
+
return true;
|
|
5941
|
+
return false;
|
|
5942
|
+
}, "marked");
|
|
5943
|
+
var isLocalPathOption = /* @__PURE__ */ __name((command, option) => PATH_PLACEHOLDER.test(option.flags) && !marked(NOT_LOCAL, command, option.attributeName()), "isLocalPathOption");
|
|
5944
|
+
var isLocalPathArgument = /* @__PURE__ */ __name((command, argument) => PATH_NAME.test(argument.name()) && !marked(NOT_LOCAL, command, argument.name()), "isLocalPathArgument");
|
|
5945
|
+
var isNamed = /* @__PURE__ */ __name((value) => value !== "" && value !== "-" && !value.includes("://"), "isNamed");
|
|
5946
|
+
var valuesOf = /* @__PURE__ */ __name((value) => (Array.isArray(value) ? value : [value]).filter((one) => typeof one === "string" && isNamed(one)), "valuesOf");
|
|
5947
|
+
var localPathsOf = /* @__PURE__ */ __name((action) => {
|
|
5948
|
+
const found = [];
|
|
5949
|
+
for (let at = action; at; at = at.parent) {
|
|
5950
|
+
for (const option of at.options) {
|
|
5951
|
+
const key = option.attributeName();
|
|
5952
|
+
if (!isLocalPathOption(at, option) || at.getOptionValueSource(key) !== "cli")
|
|
5953
|
+
continue;
|
|
5954
|
+
const flag = option.long ?? option.flags;
|
|
5955
|
+
for (const value of valuesOf(at.getOptionValue(key)))
|
|
5956
|
+
found.push({ flag, value, inBackups: marked(IN_BACKUPS, at, key) });
|
|
5957
|
+
}
|
|
5958
|
+
}
|
|
5959
|
+
action.registeredArguments.forEach((argument, index) => {
|
|
5960
|
+
const value = action.processedArgs[index];
|
|
5961
|
+
if (!isLocalPathArgument(action, argument) || value === argument.defaultValue)
|
|
5962
|
+
return;
|
|
5963
|
+
for (const one of valuesOf(value))
|
|
5964
|
+
found.push({ flag: `<${argument.name()}>`, value: one, inBackups: marked(IN_BACKUPS, action, argument.name()) });
|
|
5965
|
+
});
|
|
5966
|
+
return found;
|
|
5967
|
+
}, "localPathsOf");
|
|
5968
|
+
var refuseAgentPaths = /* @__PURE__ */ __name((action, app, env) => {
|
|
5969
|
+
const backups = join(dirname(resolve(storePath(env))), "backups");
|
|
5970
|
+
for (const { flag, value, inBackups } of localPathsOf(action)) {
|
|
5971
|
+
if (inBackups && inside(realPathOf(value), realPathOf(backups)))
|
|
5972
|
+
continue;
|
|
5973
|
+
if (refusedPlace(value, app, env))
|
|
5974
|
+
throw new CliError("permission_error", `${flag} ${value}: an agent's call reads and writes no credential folder, no folder of a WireCat tool and not the message store \u2014 the owner runs it in a terminal`, { param: flag, sent: false });
|
|
5975
|
+
}
|
|
5976
|
+
}, "refuseAgentPaths");
|
|
5977
|
+
var absoluteFrom = /* @__PURE__ */ __name((cwd, value) => {
|
|
5978
|
+
if (Array.isArray(value))
|
|
5979
|
+
return value.map((one) => absoluteFrom(cwd, one));
|
|
5980
|
+
if (typeof value !== "string" || !isNamed(value) || isAbsolute(value))
|
|
5981
|
+
return value;
|
|
5982
|
+
return resolve(cwd, value);
|
|
5983
|
+
}, "absoluteFrom");
|
|
5984
|
+
|
|
5985
|
+
// node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/cli/store-info.js
|
|
5923
5986
|
import { existsSync as existsSync4, statSync as statSync3 } from "node:fs";
|
|
5924
5987
|
|
|
5925
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
5988
|
+
// node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/cli/store-recover.js
|
|
5926
5989
|
import { existsSync as existsSync3 } from "node:fs";
|
|
5927
5990
|
|
|
5928
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
5991
|
+
// node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/store/recover.js
|
|
5929
5992
|
import { execFileSync, spawn } from "node:child_process";
|
|
5930
5993
|
import { existsSync as existsSync2, readFileSync, realpathSync, renameSync as renameSync2, rmSync as rmSync2, statfsSync, statSync as statSync2, writeFileSync } from "node:fs";
|
|
5931
|
-
import { basename, dirname, join } from "node:path";
|
|
5994
|
+
import { basename, dirname as dirname2, join as join2 } from "node:path";
|
|
5932
5995
|
import { Transform as Transform2 } from "node:stream";
|
|
5933
5996
|
|
|
5934
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
5997
|
+
// node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/store/refill.js
|
|
5935
5998
|
var REFILL_MARGIN_MS = 864e5;
|
|
5936
5999
|
var TIME_KEYS = 1e12;
|
|
5937
6000
|
var integerId = `external_id GLOB '[0-9]*' AND NOT external_id GLOB '*[^0-9]*'`;
|
|
@@ -6011,7 +6074,7 @@ var forgetMail = /* @__PURE__ */ __name((database, cutoff, now) => {
|
|
|
6011
6074
|
return [...folders].map(([account, count3]) => ({ account, folders: count3 }));
|
|
6012
6075
|
}, "forgetMail");
|
|
6013
6076
|
|
|
6014
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
6077
|
+
// node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/store/recover.js
|
|
6015
6078
|
var SQLITE3_MINIMUM = [3, 43, 0];
|
|
6016
6079
|
var STORE_PARTS = ["", "-wal", "-shm"];
|
|
6017
6080
|
var RECOVER_LOCK = ".recover-lock";
|
|
@@ -6087,8 +6150,8 @@ var takeRecoverLock = /* @__PURE__ */ __name((path) => {
|
|
|
6087
6150
|
return () => rmSync2(lock, { force: true });
|
|
6088
6151
|
}, "takeRecoverLock");
|
|
6089
6152
|
var storeHolders = /* @__PURE__ */ __name((path) => {
|
|
6090
|
-
const folder = realpathSync(
|
|
6091
|
-
const files = STORE_PARTS.map((suffix) =>
|
|
6153
|
+
const folder = realpathSync(dirname2(path));
|
|
6154
|
+
const files = STORE_PARTS.map((suffix) => join2(folder, `${basename(path)}${suffix}`));
|
|
6092
6155
|
const wanted = process.platform === "linux" ? files.flatMap((file2) => [file2, `${file2} (deleted)`]) : files.filter(existsSync2);
|
|
6093
6156
|
const recovering = runningRecovery(path);
|
|
6094
6157
|
const pids = holdersOf(wanted);
|
|
@@ -6231,7 +6294,7 @@ var placeLostRows = /* @__PURE__ */ __name((database) => {
|
|
|
6231
6294
|
}
|
|
6232
6295
|
return Object.fromEntries(Object.entries(placed).filter(([, rows2]) => rows2 > 0));
|
|
6233
6296
|
}, "placeLostRows");
|
|
6234
|
-
var copyReadableRows = /* @__PURE__ */ __name((path, target, program = "sqlite3") => new Promise((
|
|
6297
|
+
var copyReadableRows = /* @__PURE__ */ __name((path, target, program = "sqlite3") => new Promise((resolve3, reject) => {
|
|
6235
6298
|
const reader = spawn(program, ["-readonly", path, `.recover --ignore-freelist --lost-and-found ${LOST_AND_FOUND}`], {
|
|
6236
6299
|
stdio: ["ignore", "pipe", "pipe"]
|
|
6237
6300
|
});
|
|
@@ -6268,7 +6331,7 @@ var copyReadableRows = /* @__PURE__ */ __name((path, target, program = "sqlite3"
|
|
|
6268
6331
|
if (readerCode !== 0)
|
|
6269
6332
|
reject(new CliError("validation_error", `sqlite3 could not read the store: ${errors.join("; ")}`));
|
|
6270
6333
|
else
|
|
6271
|
-
|
|
6334
|
+
resolve3({ errors, read });
|
|
6272
6335
|
}, "exited");
|
|
6273
6336
|
reader.on("error", reject);
|
|
6274
6337
|
writer.on("error", reject);
|
|
@@ -6404,7 +6467,7 @@ var recoverStore = /* @__PURE__ */ __name(async ({ path, command, version, sqlit
|
|
|
6404
6467
|
try {
|
|
6405
6468
|
refuseInUse(path);
|
|
6406
6469
|
const bytes = STORE_PARTS.reduce((sum, suffix) => sum + (statSync2(`${path}${suffix}`, { throwIfNoEntry: false })?.size ?? 0), 0);
|
|
6407
|
-
const { bavail, bsize } = statfsSync(
|
|
6470
|
+
const { bavail, bsize } = statfsSync(dirname2(path));
|
|
6408
6471
|
if (Number(bavail) * Number(bsize) < bytes * 1.2)
|
|
6409
6472
|
throw new CliError("validation_error", `the recovery needs about ${Math.ceil(bytes * 1.2 / 1e9)} GB free beside the store`);
|
|
6410
6473
|
return await recoverLocked({ path, command, version, sqlite3, now, note, copy, started, program });
|
|
@@ -6542,7 +6605,7 @@ var recoverLocked = /* @__PURE__ */ __name(async ({ path, command, version, sqli
|
|
|
6542
6605
|
}
|
|
6543
6606
|
}, "recoverLocked");
|
|
6544
6607
|
|
|
6545
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
6608
|
+
// node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/cli/store-recover.js
|
|
6546
6609
|
var COUNTED = [
|
|
6547
6610
|
"accounts",
|
|
6548
6611
|
"chats",
|
|
@@ -6577,7 +6640,7 @@ var storeRecoveryCheck = /* @__PURE__ */ __name(async (env, command, version) =>
|
|
|
6577
6640
|
}
|
|
6578
6641
|
const journal = readJournalMark(path);
|
|
6579
6642
|
recordDeepCheck(path, health, { cli: command, ...version ? { version } : {}, schema });
|
|
6580
|
-
const
|
|
6643
|
+
const mark2 = readDamageMark(path);
|
|
6581
6644
|
const lastKnownGood = readHealthMark(path)?.last_ok_at ?? null;
|
|
6582
6645
|
const inUse = storeHolders(path) ?? null;
|
|
6583
6646
|
const timers = activeTimers() ?? null;
|
|
@@ -6585,7 +6648,7 @@ var storeRecoveryCheck = /* @__PURE__ */ __name(async (env, command, version) =>
|
|
|
6585
6648
|
const report = storeDamageReport({
|
|
6586
6649
|
health,
|
|
6587
6650
|
command,
|
|
6588
|
-
mark,
|
|
6651
|
+
mark: mark2,
|
|
6589
6652
|
journal,
|
|
6590
6653
|
lastOkAt: lastKnownGood,
|
|
6591
6654
|
holders: inUse,
|
|
@@ -6603,7 +6666,7 @@ var storeRecoveryCheck = /* @__PURE__ */ __name(async (env, command, version) =>
|
|
|
6603
6666
|
invalidJson: health.invalidJson ?? [],
|
|
6604
6667
|
rows,
|
|
6605
6668
|
report,
|
|
6606
|
-
damageMark:
|
|
6669
|
+
damageMark: mark2 ? (({ inode: _, ...seen }) => seen)(mark2) : null,
|
|
6607
6670
|
lastKnownGood,
|
|
6608
6671
|
inUse,
|
|
6609
6672
|
timers,
|
|
@@ -6636,12 +6699,12 @@ var storeRecoveryRun = /* @__PURE__ */ __name(async (env, { command, version, no
|
|
|
6636
6699
|
}, "storeRecoveryRun");
|
|
6637
6700
|
var refetchNotes = /* @__PURE__ */ __name(({ since, chats, mail }) => {
|
|
6638
6701
|
const from = since === null ? "from the start" : `from ${since} on`;
|
|
6639
|
-
const
|
|
6702
|
+
const marked2 = [
|
|
6640
6703
|
...chats.map(({ provider, account, chats: chats2 }) => `${chats2} chats of ${provider} ${account}`),
|
|
6641
6704
|
...mail.map(({ account, folders }) => `${folders} mail folders of ${account}`)
|
|
6642
6705
|
];
|
|
6643
6706
|
return [
|
|
6644
|
-
|
|
6707
|
+
marked2.length > 0 ? `marked as not fetched ${from}, so the next sync or serve fetches it again: ${marked2.join(", ")}` : `nothing held ${from} was marked as fetched, so there is nothing to fetch again`,
|
|
6645
6708
|
...chats.filter(({ provider }) => provider === "whatsapp").map(({ account }) => `whatsapp ${account}: WhatsApp cannot be asked for its chats, so only what the phone pushes while serve runs comes back`),
|
|
6646
6709
|
"notes, memories, tags and whatever else only this store held cannot be fetched again"
|
|
6647
6710
|
];
|
|
@@ -6698,7 +6761,7 @@ var storeRecoverCommand = /* @__PURE__ */ __name(({ command, version }) => {
|
|
|
6698
6761
|
return recover;
|
|
6699
6762
|
}, "storeRecoverCommand");
|
|
6700
6763
|
|
|
6701
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
6764
|
+
// node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/cli/store-info.js
|
|
6702
6765
|
var pendingIfKnown = /* @__PURE__ */ __name((database) => database.prepare("SELECT 1 FROM pragma_table_info('messages') WHERE name = 'normalized_text'").get() ? pendingNormalization(database) : null, "pendingIfKnown");
|
|
6703
6766
|
var bytesOf = /* @__PURE__ */ __name((path) => existsSync4(path) ? statSync3(path).size : 0, "bytesOf");
|
|
6704
6767
|
var messageOf = /* @__PURE__ */ __name((error) => error instanceof Error ? error.message : String(error), "messageOf");
|
|
@@ -6744,7 +6807,7 @@ var storeInfoCommand = /* @__PURE__ */ __name(() => annotate(new Command("info")
|
|
|
6744
6807
|
renderAnswer(this, outputFor(this), itemOf(answer));
|
|
6745
6808
|
}), "storeInfoCommand");
|
|
6746
6809
|
|
|
6747
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
6810
|
+
// node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/cli/messenger/password.js
|
|
6748
6811
|
var ENCRYPT_OPTION = [
|
|
6749
6812
|
"--encrypt",
|
|
6750
6813
|
"compress and encrypt with a password, typed at a hidden prompt or piped on stdin; it is never kept \u2014 lose it and the file cannot be opened"
|
|
@@ -6763,9 +6826,9 @@ var passwordOf = /* @__PURE__ */ __name(async (command, { twice }) => {
|
|
|
6763
6826
|
return password;
|
|
6764
6827
|
}, "passwordOf");
|
|
6765
6828
|
|
|
6766
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
6829
|
+
// node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/replies/rules.js
|
|
6767
6830
|
import { existsSync as existsSync5, readFileSync as readFileSync2 } from "node:fs";
|
|
6768
|
-
import { join as
|
|
6831
|
+
import { join as join3 } from "node:path";
|
|
6769
6832
|
var REPLY_ACTIONS = ["reply", "task"];
|
|
6770
6833
|
var REPLY_MODELS = ["fill-only", "may-reword"];
|
|
6771
6834
|
var REPLY_KINDS = ["dialog", "group"];
|
|
@@ -6851,7 +6914,7 @@ var defaultRule = /* @__PURE__ */ __name((id) => ({
|
|
|
6851
6914
|
reply: { template: "", asReply: true },
|
|
6852
6915
|
limits: { perChat: "1/1d", perPerson: "1/1d" }
|
|
6853
6916
|
}), "defaultRule");
|
|
6854
|
-
var repliesPathFor = /* @__PURE__ */ __name((app, profile, env = process.env) =>
|
|
6917
|
+
var repliesPathFor = /* @__PURE__ */ __name((app, profile, env = process.env) => join3(resolvePaths({ appName: app.appName, prefix: app.envPrefix, env }).config, `${profile}.replies.json`), "repliesPathFor");
|
|
6855
6918
|
var EVERYONE = { reply: "all", allow: { people: [], chats: [] }, deny: { people: [], chats: [] } };
|
|
6856
6919
|
var outsideAudience = /* @__PURE__ */ __name((audience, person, chat) => {
|
|
6857
6920
|
if (person !== null && audience.deny.people.includes(person))
|
|
@@ -6934,9 +6997,9 @@ var problem = /* @__PURE__ */ __name((issue) => {
|
|
|
6934
6997
|
}, "problem");
|
|
6935
6998
|
var broken = /* @__PURE__ */ __name((path, why) => new CliError("configuration_error", `the reply rules ${path} cannot be read (${why}) \u2014 fix the file`), "broken");
|
|
6936
6999
|
|
|
6937
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
7000
|
+
// node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/replies/state.js
|
|
6938
7001
|
import { existsSync as existsSync6, readFileSync as readFileSync3 } from "node:fs";
|
|
6939
|
-
import { join as
|
|
7002
|
+
import { join as join4 } from "node:path";
|
|
6940
7003
|
var ANSWERED_KEPT = 1e3;
|
|
6941
7004
|
var times = record(string(), array(string()));
|
|
6942
7005
|
var stateFile = object({
|
|
@@ -6948,7 +7011,7 @@ var stateFile = object({
|
|
|
6948
7011
|
});
|
|
6949
7012
|
var emptyState = /* @__PURE__ */ __name(() => ({ paused: false, answered: [], sent: {} }), "emptyState");
|
|
6950
7013
|
var answeredKey = /* @__PURE__ */ __name((message) => `${message.chatId}:${message.id}`, "answeredKey");
|
|
6951
|
-
var repliesStatePathFor = /* @__PURE__ */ __name((app, profile, env = process.env) =>
|
|
7014
|
+
var repliesStatePathFor = /* @__PURE__ */ __name((app, profile, env = process.env) => join4(resolvePaths({ appName: app.appName, prefix: app.envPrefix, env }).state, `${profile}.replies-state.json`), "repliesStatePathFor");
|
|
6952
7015
|
var readRepliesState = /* @__PURE__ */ __name((path) => {
|
|
6953
7016
|
if (!existsSync6(path))
|
|
6954
7017
|
return emptyState();
|
|
@@ -6987,7 +7050,7 @@ var recordReply = /* @__PURE__ */ __name((state, rule2, message, now) => {
|
|
|
6987
7050
|
}, "recordReply");
|
|
6988
7051
|
var broken2 = /* @__PURE__ */ __name((path, why) => new CliError("configuration_error", `the reply state ${path} cannot be read (${why}) \u2014 fix or move the file`), "broken");
|
|
6989
7052
|
|
|
6990
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
7053
|
+
// node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/replies/decide.js
|
|
6991
7054
|
var skip = /* @__PURE__ */ __name((why) => ({ skip: why }), "skip");
|
|
6992
7055
|
var decide = /* @__PURE__ */ __name((rule2, incoming, state, now) => {
|
|
6993
7056
|
const { message, chat, owner, sender } = incoming;
|
|
@@ -7093,10 +7156,10 @@ var filled = /* @__PURE__ */ __name((template2, senderName) => {
|
|
|
7093
7156
|
return template2.replaceAll("{firstName}", name.split(/\s+/)[0] ?? name).replaceAll("{name}", name);
|
|
7094
7157
|
}, "filled");
|
|
7095
7158
|
|
|
7096
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
7159
|
+
// node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/replies/template.js
|
|
7097
7160
|
var import_liquidjs2 = __toESM(require_liquid_node(), 1);
|
|
7098
7161
|
|
|
7099
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
7162
|
+
// node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/render/liquid.js
|
|
7100
7163
|
var import_liquidjs = __toESM(require_liquid_node(), 1);
|
|
7101
7164
|
var safeLiquid = /* @__PURE__ */ __name((limits) => {
|
|
7102
7165
|
const engine = new import_liquidjs.Liquid({
|
|
@@ -7123,7 +7186,7 @@ var safeLiquid = /* @__PURE__ */ __name((limits) => {
|
|
|
7123
7186
|
return engine;
|
|
7124
7187
|
}, "safeLiquid");
|
|
7125
7188
|
|
|
7126
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
7189
|
+
// node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/replies/template.js
|
|
7127
7190
|
var TEMPLATE_LIMITS = {
|
|
7128
7191
|
parse: 32768,
|
|
7129
7192
|
renders: 2e3,
|
|
@@ -7262,7 +7325,7 @@ var renderReplyTemplate = /* @__PURE__ */ __name(async (reply, input) => {
|
|
|
7262
7325
|
}
|
|
7263
7326
|
}, "renderReplyTemplate");
|
|
7264
7327
|
|
|
7265
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
7328
|
+
// node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/replies/dry-run.js
|
|
7266
7329
|
var DRY_RUN_DAYS = 7;
|
|
7267
7330
|
var PAGE = 500;
|
|
7268
7331
|
var dryRun = /* @__PURE__ */ __name(async (store, account, rules, { since, until = Date.now(), only, audience, render }) => {
|
|
@@ -7376,7 +7439,7 @@ var storedSince = /* @__PURE__ */ __name(async (store, account, chat, since) =>
|
|
|
7376
7439
|
}
|
|
7377
7440
|
}, "storedSince");
|
|
7378
7441
|
|
|
7379
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
7442
|
+
// node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/models/ai.js
|
|
7380
7443
|
var AI_PROVIDERS = ["anthropic", "openai", "ollama"];
|
|
7381
7444
|
var DEFAULT_BASE_URL = {
|
|
7382
7445
|
anthropic: "https://api.anthropic.com",
|
|
@@ -7526,7 +7589,7 @@ var checkAi = /* @__PURE__ */ __name(async (deps) => {
|
|
|
7526
7589
|
}
|
|
7527
7590
|
}, "checkAi");
|
|
7528
7591
|
|
|
7529
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
7592
|
+
// node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/models/purpose.js
|
|
7530
7593
|
var HOSTED = {
|
|
7531
7594
|
openai: "https://api.openai.com/v1",
|
|
7532
7595
|
anthropic: "https://api.anthropic.com"
|
|
@@ -7547,14 +7610,14 @@ var purposeModel = /* @__PURE__ */ __name((settings, purpose, deps) => {
|
|
|
7547
7610
|
return shared ? { target: shared.target, key: /* @__PURE__ */ __name(() => shared.key, "key"), shared: shared.setting } : void 0;
|
|
7548
7611
|
}, "purposeModel");
|
|
7549
7612
|
|
|
7550
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
7613
|
+
// node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/replies/consents.js
|
|
7551
7614
|
import { existsSync as existsSync7, readFileSync as readFileSync4 } from "node:fs";
|
|
7552
|
-
import { join as
|
|
7615
|
+
import { join as join5 } from "node:path";
|
|
7553
7616
|
var shape = strictObject({
|
|
7554
7617
|
provider: nullable(pipe(string(), minLength(1))),
|
|
7555
7618
|
deniedChats: array(pipe(string(), minLength(1)))
|
|
7556
7619
|
});
|
|
7557
|
-
var replyConsentPathFor = /* @__PURE__ */ __name((app, profile, env = process.env) =>
|
|
7620
|
+
var replyConsentPathFor = /* @__PURE__ */ __name((app, profile, env = process.env) => join5(resolvePaths({ appName: app.appName, prefix: app.envPrefix, env }).config, `${profile}.replies-consents.json`), "replyConsentPathFor");
|
|
7558
7621
|
var readReplyConsent = /* @__PURE__ */ __name((path) => {
|
|
7559
7622
|
if (!existsSync7(path))
|
|
7560
7623
|
return { provider: null, deniedChats: [] };
|
|
@@ -7572,7 +7635,7 @@ var mayModelReply = /* @__PURE__ */ __name((path, provider, chat) => {
|
|
|
7572
7635
|
return consent.provider === provider && !consent.deniedChats.includes(chat);
|
|
7573
7636
|
}, "mayModelReply");
|
|
7574
7637
|
|
|
7575
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
7638
|
+
// node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/replies/rendering.js
|
|
7576
7639
|
var replyRenderer = /* @__PURE__ */ __name((app, profile, settings, env, warn, options = {
|
|
7577
7640
|
ai: true
|
|
7578
7641
|
}) => async (rule2, message, chat, now) => {
|
|
@@ -7620,7 +7683,7 @@ var replyRenderer = /* @__PURE__ */ __name((app, profile, settings, env, warn, o
|
|
|
7620
7683
|
return result2;
|
|
7621
7684
|
}, "replyRenderer");
|
|
7622
7685
|
|
|
7623
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
7686
|
+
// node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/replies/serve.js
|
|
7624
7687
|
var NOT_ALLOWED = "replies.send is not allow";
|
|
7625
7688
|
var NO_RULES = "no rules";
|
|
7626
7689
|
var ONLY_TASK = "opened a task, sent nothing";
|
|
@@ -7713,7 +7776,7 @@ var replyTo = /* @__PURE__ */ __name(async (deps, message) => {
|
|
|
7713
7776
|
return { skip: why };
|
|
7714
7777
|
}, "replyTo");
|
|
7715
7778
|
|
|
7716
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
7779
|
+
// node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/cli/messenger/serve-catch-up.js
|
|
7717
7780
|
var START_SYNC_DELAY_MS = 3e4;
|
|
7718
7781
|
var START_SYNC_BUDGET_MS = 5 * 6e4;
|
|
7719
7782
|
var START_SYNC_WINDOW_MS = 7 * 864e5;
|
|
@@ -7790,7 +7853,7 @@ var startSync = /* @__PURE__ */ __name(({ chats, newestHeld, fetch, note, warn,
|
|
|
7790
7853
|
};
|
|
7791
7854
|
}, "startSync");
|
|
7792
7855
|
|
|
7793
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
7856
|
+
// node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/cli/messenger/serve-members.js
|
|
7794
7857
|
var FIRST_FETCH_MS = 6e4;
|
|
7795
7858
|
var DAY_MS = 864e5;
|
|
7796
7859
|
var memberFetches = /* @__PURE__ */ __name(({ withStore, fetch, warn, firstMs = FIRST_FETCH_MS, everyMs = DAY_MS }) => {
|
|
@@ -7844,7 +7907,7 @@ var memberFetches = /* @__PURE__ */ __name(({ withStore, fetch, warn, firstMs =
|
|
|
7844
7907
|
};
|
|
7845
7908
|
}, "memberFetches");
|
|
7846
7909
|
|
|
7847
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
7910
|
+
// node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/cli/messenger/serve-notice.js
|
|
7848
7911
|
var record2 = /* @__PURE__ */ __name((context, app, severity, attributes) => recordLogFor(context.streams.diagnostic, app, { command: currentRun().command || "serve" })[severity](attributes), "record");
|
|
7849
7912
|
var noticeFor = /* @__PURE__ */ __name((context, app, severity = "warn") => ({ text, ...attributes }) => {
|
|
7850
7913
|
if (context.format === "pretty") {
|
|
@@ -7877,22 +7940,22 @@ var recordDiagnostics = /* @__PURE__ */ __name((context, app) => {
|
|
|
7877
7940
|
return context;
|
|
7878
7941
|
}, "recordDiagnostics");
|
|
7879
7942
|
|
|
7880
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
7943
|
+
// node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/cli/messenger/serve-outdated.js
|
|
7881
7944
|
import { existsSync as existsSync8, readFileSync as readFileSync5, realpathSync as realpathSync2 } from "node:fs";
|
|
7882
|
-
import { dirname as
|
|
7945
|
+
import { dirname as dirname3, join as join6 } from "node:path";
|
|
7883
7946
|
var OUTDATED_CHECK_MS = 6e4;
|
|
7884
7947
|
var ownPackageRoot = /* @__PURE__ */ __name((running, script = process.argv[1]) => {
|
|
7885
7948
|
let dir;
|
|
7886
7949
|
try {
|
|
7887
|
-
dir =
|
|
7950
|
+
dir = dirname3(realpathSync2(script ?? ""));
|
|
7888
7951
|
} catch {
|
|
7889
7952
|
return void 0;
|
|
7890
7953
|
}
|
|
7891
7954
|
for (let up = 0; up < 8; up++) {
|
|
7892
|
-
const manifest =
|
|
7955
|
+
const manifest = join6(dir, "package.json");
|
|
7893
7956
|
if (existsSync8(manifest))
|
|
7894
7957
|
return installedVersion(dir) === running ? dir : void 0;
|
|
7895
|
-
const parent =
|
|
7958
|
+
const parent = dirname3(dir);
|
|
7896
7959
|
if (parent === dir)
|
|
7897
7960
|
return void 0;
|
|
7898
7961
|
dir = parent;
|
|
@@ -7901,7 +7964,7 @@ var ownPackageRoot = /* @__PURE__ */ __name((running, script = process.argv[1])
|
|
|
7901
7964
|
}, "ownPackageRoot");
|
|
7902
7965
|
var installedVersion = /* @__PURE__ */ __name((root) => {
|
|
7903
7966
|
try {
|
|
7904
|
-
const { version } = JSON.parse(readFileSync5(
|
|
7967
|
+
const { version } = JSON.parse(readFileSync5(join6(root, "package.json"), "utf8"));
|
|
7905
7968
|
return typeof version === "string" ? version : void 0;
|
|
7906
7969
|
} catch {
|
|
7907
7970
|
return void 0;
|
|
@@ -7963,7 +8026,7 @@ var watchOutdated = /* @__PURE__ */ __name(({ check: check2, onOutdated, everyMs
|
|
|
7963
8026
|
};
|
|
7964
8027
|
}, "watchOutdated");
|
|
7965
8028
|
|
|
7966
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
8029
|
+
// node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/cli/messenger/serve-stems.js
|
|
7967
8030
|
var STEMS_EVERY_MS = 3e4;
|
|
7968
8031
|
var STEMS_SLICE_MS = 2e3;
|
|
7969
8032
|
var stemFills = /* @__PURE__ */ __name(({ withStore, warn, everyMs = STEMS_EVERY_MS, sliceMs = STEMS_SLICE_MS }) => {
|
|
@@ -8003,7 +8066,7 @@ var stemFills = /* @__PURE__ */ __name(({ withStore, warn, everyMs = STEMS_EVERY
|
|
|
8003
8066
|
};
|
|
8004
8067
|
}, "stemFills");
|
|
8005
8068
|
|
|
8006
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
8069
|
+
// node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/render/messages.js
|
|
8007
8070
|
import { styleText } from "node:util";
|
|
8008
8071
|
var TIME_WIDTH = 8;
|
|
8009
8072
|
var INDENT = " ".repeat(TIME_WIDTH + 2);
|
|
@@ -8032,8 +8095,8 @@ var renderMessage = /* @__PURE__ */ __name((message, options = {}) => {
|
|
|
8032
8095
|
const time = timeFormatter(options);
|
|
8033
8096
|
const verbosity = options.verbosity ?? 0;
|
|
8034
8097
|
const chat = "chatTitle" in message ? paint("dim", ` \xB7 ${singleLine(message.chatTitle ?? message.chatId)}`) : "";
|
|
8035
|
-
const
|
|
8036
|
-
const lines = [`${paint("dim", time(message.timestamp))} ${senderOf(message, options)}${chat}${
|
|
8098
|
+
const mark2 = "anchor" in message && message.anchor ? paint("bold", " \u25C0") : "";
|
|
8099
|
+
const lines = [`${paint("dim", time(message.timestamp))} ${senderOf(message, options)}${chat}${mark2}`];
|
|
8037
8100
|
const body = /* @__PURE__ */ __name((text) => wrapAnsi(visibleControls(text), room, { hard: true }).split("\n"), "body");
|
|
8038
8101
|
const email = message.email;
|
|
8039
8102
|
if (email)
|
|
@@ -8093,9 +8156,9 @@ var nameOf = /* @__PURE__ */ __name(({ senderName, senderId, outgoing }, options
|
|
|
8093
8156
|
var DEFAULT_LOCALE = "ru-RU";
|
|
8094
8157
|
var you = /* @__PURE__ */ __name(({ locale = DEFAULT_LOCALE }) => locale.startsWith("ru") ? "\u0432\u044B" : "you", "you");
|
|
8095
8158
|
var hash = /* @__PURE__ */ __name((value) => [...value].reduce((sum, char) => sum * 31 + char.charCodeAt(0) >>> 0, 7), "hash");
|
|
8096
|
-
var preview = /* @__PURE__ */ __name((
|
|
8159
|
+
var preview = /* @__PURE__ */ __name((mark2, quoted, room, options) => {
|
|
8097
8160
|
const text = singleLine(quoted.text.split("\n")[0] ?? "") || (quoted.attachments[0] ? `\u{1F4CE} ${quoted.attachments[0].kind}` : "");
|
|
8098
|
-
const line = text ? `${
|
|
8161
|
+
const line = text ? `${mark2} ${nameOf(quoted, options)}: ${text}` : `${mark2} message ${quoted.id}`;
|
|
8099
8162
|
if (stringWidth(line) <= room)
|
|
8100
8163
|
return line;
|
|
8101
8164
|
return `${wrapAnsi(line, room - 1, { hard: true }).split("\n")[0]}\u2026`;
|
|
@@ -8179,7 +8242,7 @@ var editedAt = /* @__PURE__ */ __name((message, options) => {
|
|
|
8179
8242
|
return day(edited) === day(message.timestamp) ? time : `${day(edited)} ${time}`;
|
|
8180
8243
|
}, "editedAt");
|
|
8181
8244
|
|
|
8182
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
8245
|
+
// node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/cli/messenger/message-items.js
|
|
8183
8246
|
var defined = /* @__PURE__ */ __name((value) => Object.fromEntries(Object.entries(value).filter(([, one]) => one !== void 0)), "defined");
|
|
8184
8247
|
var attachmentItem = /* @__PURE__ */ __name((attachment) => defined({
|
|
8185
8248
|
kind: attachment.kind,
|
|
@@ -8275,7 +8338,7 @@ var viewOf = /* @__PURE__ */ __name((context, messenger) => ({
|
|
|
8275
8338
|
locale: messenger.app.locale
|
|
8276
8339
|
}), "viewOf");
|
|
8277
8340
|
|
|
8278
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
8341
|
+
// node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/cli/messenger/watch-answers.js
|
|
8279
8342
|
var observed = /* @__PURE__ */ __name((value) => ({
|
|
8280
8343
|
value: value.value,
|
|
8281
8344
|
observed_at: value.observedAt,
|
|
@@ -8342,7 +8405,7 @@ var watchEventItem = /* @__PURE__ */ __name((value, account) => {
|
|
|
8342
8405
|
}
|
|
8343
8406
|
}, "watchEventItem");
|
|
8344
8407
|
|
|
8345
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
8408
|
+
// node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/cli/messenger/watch-command.js
|
|
8346
8409
|
var watchCommand = /* @__PURE__ */ __name((messenger) => annotate(new Command("watch"), {
|
|
8347
8410
|
output: { entity: "watch_item" },
|
|
8348
8411
|
effects: REMOTE_READ,
|
|
@@ -8497,7 +8560,7 @@ var describe = /* @__PURE__ */ __name((event, render) => {
|
|
|
8497
8560
|
}
|
|
8498
8561
|
}, "describe");
|
|
8499
8562
|
|
|
8500
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
8563
|
+
// node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/cli/messenger/serve-command.js
|
|
8501
8564
|
var CURRENT_EVERY_MS = 6e4;
|
|
8502
8565
|
var serveCommand = /* @__PURE__ */ __name((messenger) => {
|
|
8503
8566
|
const command = annotate(new Command("serve"), {
|
|
@@ -8797,7 +8860,7 @@ var tasking = /* @__PURE__ */ __name((context, warn) => {
|
|
|
8797
8860
|
};
|
|
8798
8861
|
}, "tasking");
|
|
8799
8862
|
|
|
8800
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
8863
|
+
// node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/cli/messenger/store-tables-command.js
|
|
8801
8864
|
import { existsSync as existsSync9 } from "node:fs";
|
|
8802
8865
|
var PATH = "store tables list";
|
|
8803
8866
|
var STORE_TABLES_QUERY = {
|
|
@@ -8840,7 +8903,7 @@ var storeTablesCommand = /* @__PURE__ */ __name((owner) => {
|
|
|
8840
8903
|
return tables;
|
|
8841
8904
|
}, "storeTablesCommand");
|
|
8842
8905
|
|
|
8843
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
8906
|
+
// node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/cli/messenger/store-maintenance-command.js
|
|
8844
8907
|
var SEARCH_INDEXES = ["messages_fts", "chats_fts", "identities_fts"];
|
|
8845
8908
|
var WORD_INDEX = "message_words";
|
|
8846
8909
|
var schemaOf = /* @__PURE__ */ __name((database) => {
|
|
@@ -8866,7 +8929,7 @@ var readingOnly = /* @__PURE__ */ __name(async (path, read) => {
|
|
|
8866
8929
|
database.close();
|
|
8867
8930
|
}
|
|
8868
8931
|
}, "readingOnly");
|
|
8869
|
-
var withoutInode = /* @__PURE__ */ __name(({ inode: _, ...
|
|
8932
|
+
var withoutInode = /* @__PURE__ */ __name(({ inode: _, ...mark2 }) => mark2, "withoutInode");
|
|
8870
8933
|
var fileSchema = /* @__PURE__ */ __name(async (path) => {
|
|
8871
8934
|
try {
|
|
8872
8935
|
return await readingOnly(path, (database) => fileSchemaOf(database).version);
|
|
@@ -8885,7 +8948,7 @@ var storeSummary = /* @__PURE__ */ __name(async (env, { deep = false, command, v
|
|
|
8885
8948
|
...version ? { version } : {},
|
|
8886
8949
|
schema: await fileSchema(path)
|
|
8887
8950
|
}) : null;
|
|
8888
|
-
const
|
|
8951
|
+
const mark2 = readDamageMark(path);
|
|
8889
8952
|
const lastKnownGood = readHealthMark(path)?.last_ok_at ?? null;
|
|
8890
8953
|
const health = {
|
|
8891
8954
|
checked: checked.checked,
|
|
@@ -8897,11 +8960,11 @@ var storeSummary = /* @__PURE__ */ __name(async (env, { deep = false, command, v
|
|
|
8897
8960
|
...checked.invalidJson?.length ? { invalidJson: checked.invalidJson } : {},
|
|
8898
8961
|
...checked.searchIndexes?.some((index) => !index.ok) ? { damagedSearchIndexes: checked.searchIndexes.filter((index) => !index.ok).map((index) => index.name) } : {}
|
|
8899
8962
|
};
|
|
8900
|
-
const damage = command ? storeDamageReport({ health: checked, command, mark, journal, lastOkAt: lastKnownGood }) : null;
|
|
8963
|
+
const damage = command ? storeDamageReport({ health: checked, command, mark: mark2, journal, lastOkAt: lastKnownGood }) : null;
|
|
8901
8964
|
const healthOf = {
|
|
8902
8965
|
health,
|
|
8903
8966
|
lastKnownGood,
|
|
8904
|
-
...
|
|
8967
|
+
...mark2 ? { damageMark: withoutInode(mark2) } : {},
|
|
8905
8968
|
...journal ? { journalMark: journal } : {},
|
|
8906
8969
|
...recorded?.cleared ? { damageMarkCleared: withoutInode(recorded.cleared) } : {},
|
|
8907
8970
|
// `what` keeps memo's doctor, which reads it, compiling until it moves to `whatHappened`.
|
|
@@ -9088,7 +9151,7 @@ var inspect = /* @__PURE__ */ __name((path) => reading(path, (database) => {
|
|
|
9088
9151
|
...schema.version >= 71 ? [["content_post_words", indexIntegrity(database, "content_post_words", 0)]] : []
|
|
9089
9152
|
]);
|
|
9090
9153
|
const size = bytesOf2(path) + bytesOf2(`${path}-wal`);
|
|
9091
|
-
const { bavail, bsize } = statfsSync2(
|
|
9154
|
+
const { bavail, bsize } = statfsSync2(dirname4(path));
|
|
9092
9155
|
const free = Number(bavail) * Number(bsize);
|
|
9093
9156
|
const behind = schema.version > 0 ? chatsBehind(database) : [];
|
|
9094
9157
|
const vectorIndexes = schema.version >= 34 ? vectorIndexCounts(database) : [];
|
|
@@ -9173,8 +9236,9 @@ var chatsBehind = /* @__PURE__ */ __name((database) => database.prepare(`SELECT
|
|
|
9173
9236
|
held: row.held === null ? null : isoOf(row.held),
|
|
9174
9237
|
refreshed: isoOf(row.refreshed)
|
|
9175
9238
|
})), "chatsBehind");
|
|
9176
|
-
var migrateCommand = /* @__PURE__ */ __name((owner) => annotate(new Command("migrate"), { output: { entity: "store_migration" }, effects: LOCAL_WRITE }).summary(`migrate an older ${archive(owner)}`).description("bring the store up to this build's schema, then normalize, index and stem the messages and notes stored before it").action(async function() {
|
|
9239
|
+
var migrateCommand = /* @__PURE__ */ __name((owner) => annotate(new Command("migrate"), { output: { entity: "store_migration" }, effects: LOCAL_WRITE }).summary(`migrate an older ${archive(owner)}`).description("bring the store up to this build's schema, then normalize, index and stem the messages and notes stored before it").option("--no-backup", "migrate even when no rollback copy can be written; older tools then cannot open the store again").action(async function() {
|
|
9177
9240
|
const { renderer } = outputFor(this);
|
|
9241
|
+
const { backup = true } = this.opts();
|
|
9178
9242
|
const path = storePath(environmentOf(this).env ?? process.env);
|
|
9179
9243
|
if (!existsSync10(path)) {
|
|
9180
9244
|
result(this, { path, exists: false });
|
|
@@ -9183,11 +9247,13 @@ var migrateCommand = /* @__PURE__ */ __name((owner) => annotate(new Command("mig
|
|
|
9183
9247
|
}
|
|
9184
9248
|
const answer = await reading(path, (database) => {
|
|
9185
9249
|
const from = schemaOf(database).version;
|
|
9186
|
-
migrate(database, {
|
|
9250
|
+
const notice = migrate(database, {
|
|
9187
9251
|
command: owner.app.command,
|
|
9188
9252
|
version: owner.app.version,
|
|
9189
|
-
rollback: { store: path, warn: /* @__PURE__ */ __name((line) => renderer.warn(line), "warn") }
|
|
9253
|
+
rollback: { store: path, warn: /* @__PURE__ */ __name((line) => renderer.warn(line), "warn"), withoutCopy: !backup }
|
|
9190
9254
|
});
|
|
9255
|
+
if (notice)
|
|
9256
|
+
renderer.warn(notice);
|
|
9191
9257
|
const { normalized, indexed, terms } = buildWordIndex(database, (note) => renderer.note(note));
|
|
9192
9258
|
const stemmed = buildStems(database, (note) => renderer.note(note));
|
|
9193
9259
|
const notes = buildNoteIndex(database, (note) => renderer.note(note));
|
|
@@ -9278,10 +9344,10 @@ var vacuumInto = /* @__PURE__ */ __name(async (path, target) => {
|
|
|
9278
9344
|
}
|
|
9279
9345
|
}, "vacuumInto");
|
|
9280
9346
|
var stampNow = /* @__PURE__ */ __name(() => (/* @__PURE__ */ new Date()).toISOString().replace(/[:.]/g, "-"), "stampNow");
|
|
9281
|
-
var backupCommand = /* @__PURE__ */ __name(() => destroysNothing(annotate(new Command("backup"), { output: { entity: "store_backup" }, effects: LOCAL_WRITE })).description("copy the store into a new file, while it is in use; never overwrites a file").argument("<file>", "the new file").option(...ENCRYPT_OPTION).action(async function(file2) {
|
|
9347
|
+
var backupCommand = /* @__PURE__ */ __name(() => inStoreBackups(destroysNothing(annotate(new Command("backup"), { output: { entity: "store_backup" }, effects: LOCAL_WRITE })), "file").description("copy the store into a new file, while it is in use; never overwrites a file").argument("<file>", "the new file").option(...ENCRYPT_OPTION).action(async function(file2) {
|
|
9282
9348
|
const { encrypt } = this.opts();
|
|
9283
9349
|
const path = storePath(environmentOf(this).env ?? process.env);
|
|
9284
|
-
const target =
|
|
9350
|
+
const target = resolve2(file2);
|
|
9285
9351
|
const { app, env } = environmentOf(this);
|
|
9286
9352
|
if (app)
|
|
9287
9353
|
refuseLockedOutput(target, app, env ?? process.env, "<file>");
|
|
@@ -9318,8 +9384,8 @@ var backupCommand = /* @__PURE__ */ __name(() => destroysNothing(annotate(new Co
|
|
|
9318
9384
|
}), "backupCommand");
|
|
9319
9385
|
var decryptCommand = /* @__PURE__ */ __name(() => annotate(new Command("decrypt"), { output: { entity: "store_decrypt" }, effects: LOCAL_WRITE }).description("open a file written with --encrypt into a new file; asks for its password").argument("<file>", "a file `store backup --encrypt` or `store export --encrypt` wrote").requiredOption("--output <file>", "the new file, readable only by you").action(async function(file2) {
|
|
9320
9386
|
const { output } = this.opts();
|
|
9321
|
-
const from =
|
|
9322
|
-
const to =
|
|
9387
|
+
const from = resolve2(file2);
|
|
9388
|
+
const to = resolve2(output);
|
|
9323
9389
|
if (!existsSync10(from))
|
|
9324
9390
|
throw new CliError("not_found", `no file at ${from}`);
|
|
9325
9391
|
if (!isSealed(from))
|
|
@@ -9329,16 +9395,16 @@ var decryptCommand = /* @__PURE__ */ __name(() => annotate(new Command("decrypt"
|
|
|
9329
9395
|
await unsealFile(from, to, await passwordOf(this, { twice: false }));
|
|
9330
9396
|
result(this, { path: to, from, bytes: bytesOf2(to) });
|
|
9331
9397
|
}), "decryptCommand");
|
|
9332
|
-
var restoreCommand = /* @__PURE__ */ __name((owner) => grantsAuthority(annotate(new Command("restore"), { output: { entity: "store_restore" }, effects: LOCAL_WRITE })).summary("restore a backup and keep the current store, or roll back a breaking upgrade").description("put a backup in place of the store; the store it replaces is kept beside it, never deleted. Given a rollback copy (backups/<store>-rollback-schema-<version>-<time>.db, kept for a day before an upgrade older tools cannot open), put its tables back in the store and return it to that version instead").argument("<file>", "a file `store backup` wrote, or a rollback copy; one written with --encrypt asks for its password").action(async function(file2) {
|
|
9398
|
+
var restoreCommand = /* @__PURE__ */ __name((owner) => inStoreBackups(grantsAuthority(annotate(new Command("restore"), { output: { entity: "store_restore" }, effects: LOCAL_WRITE })), "file").summary("restore a backup and keep the current store, or roll back a breaking upgrade").description("put a backup in place of the store; the store it replaces is kept beside it, never deleted. Given a rollback copy (backups/<store>-rollback-schema-<version>-<time>.db, kept for a day before an upgrade older tools cannot open), put its tables back in the store and return it to that version instead").argument("<file>", "a file `store backup` wrote, or a rollback copy; one written with --encrypt asks for its password").action(async function(file2) {
|
|
9333
9399
|
const path = storePath(environmentOf(this).env ?? process.env);
|
|
9334
|
-
const given =
|
|
9400
|
+
const given = resolve2(file2);
|
|
9335
9401
|
if (!existsSync10(given))
|
|
9336
9402
|
throw new CliError("not_found", `no file at ${given}`);
|
|
9337
9403
|
refuseWhileServing(this, owner);
|
|
9338
9404
|
if (!isSealed(given))
|
|
9339
9405
|
return restoreFrom(this, owner, given, given);
|
|
9340
9406
|
const opened = `${path}.unsealing-${process.pid}`;
|
|
9341
|
-
mkdirSync(
|
|
9407
|
+
mkdirSync(dirname4(path), { recursive: true, mode: 448 });
|
|
9342
9408
|
try {
|
|
9343
9409
|
await unsealFile(given, opened, await passwordOf(this, { twice: false }));
|
|
9344
9410
|
await restoreFrom(this, owner, opened, given);
|
|
@@ -9361,7 +9427,7 @@ var restoreFrom = /* @__PURE__ */ __name(async (command, owner, backup, given) =
|
|
|
9361
9427
|
const waitMs = environmentOf(command).storeLockWaitMs;
|
|
9362
9428
|
await quiesce(path, owner, "restore", (message) => renderer.warn(message), waitMs);
|
|
9363
9429
|
} else
|
|
9364
|
-
mkdirSync(
|
|
9430
|
+
mkdirSync(dirname4(path), { recursive: true, mode: 448 });
|
|
9365
9431
|
const incoming = `${path}.restoring-${stamp}`;
|
|
9366
9432
|
copyFileSync(backup, incoming, constants.COPYFILE_EXCL);
|
|
9367
9433
|
chmodSync(incoming, 384);
|
|
@@ -9578,6 +9644,11 @@ export {
|
|
|
9578
9644
|
checkFor,
|
|
9579
9645
|
passes,
|
|
9580
9646
|
seal,
|
|
9647
|
+
notLocalPaths,
|
|
9648
|
+
isLocalPathOption,
|
|
9649
|
+
isLocalPathArgument,
|
|
9650
|
+
refuseAgentPaths,
|
|
9651
|
+
absoluteFrom,
|
|
9581
9652
|
ENCRYPT_OPTION,
|
|
9582
9653
|
passwordOf,
|
|
9583
9654
|
DAY_MS,
|