@wirecat/zoom-cli 0.80.0 → 0.82.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/contracts/wirecat.json +71 -3
- package/dist/answers.d.ts +100 -0
- package/dist/answers.d.ts.map +1 -1
- package/dist/bin/zm.js +2 -2
- package/dist/bundle/agent-F4TRJWWS.js +46 -0
- package/dist/bundle/{all-profiles-5GOKWOT4.js → all-profiles-RULEKTDQ.js} +64 -22
- package/dist/bundle/answer-policy-6XC57AEZ.js +131 -0
- package/dist/bundle/{anthropic-NHXMOFYS.js → anthropic-4NAQBZFL.js} +6 -6
- package/dist/bundle/{app-server-HFW5Z5PI.js → app-server-VLR42U5L.js} +92 -80
- package/dist/bundle/{bun-M5IGY2TG.js → bun-OPDGMZZQ.js} +2 -2
- package/dist/bundle/{bun-sqlite-MTP5JJQ2.js → bun-sqlite-HC6X4AOX.js} +7 -7
- package/dist/bundle/{chunk-TNL3YQ33.js → chunk-274SLQNW.js} +2 -2
- package/dist/bundle/{chunk-5CJ6AAUI.js → chunk-2CI2OEZQ.js} +4 -4
- package/dist/bundle/{chunk-GVKZZT7E.js → chunk-2DBF2IIC.js} +7 -78
- package/dist/bundle/{chunk-NRVMK5H3.js → chunk-2GP573Q4.js} +15748 -11939
- package/dist/bundle/{chunk-4OAR7BGU.js → chunk-2JHVQMVC.js} +1 -1
- package/dist/bundle/{chunk-XKLU5KV2.js → chunk-2SWKQ7C4.js} +1 -1
- package/dist/bundle/{chunk-W3GZ7JUO.js → chunk-2XBDILVW.js} +1 -1
- package/dist/bundle/{chunk-3UONR5HW.js → chunk-3HC5F3P7.js} +1 -1
- package/dist/bundle/{chunk-VN7TKMOW.js → chunk-3YM4B2GT.js} +1 -1
- package/dist/bundle/{chunk-PCPOO5FS.js → chunk-434YFJAE.js} +2 -2
- package/dist/bundle/{chunk-CW6CPQHI.js → chunk-4HLQ2JGK.js} +4 -4
- package/dist/bundle/{chunk-RT7C3SSJ.js → chunk-4N7PP76S.js} +1 -1
- package/dist/bundle/{chunk-JJX4HKDV.js → chunk-52Y4ETKU.js} +4 -4
- package/dist/bundle/{chunk-BIKHHFD2.js → chunk-5HAUK3I4.js} +2166 -2760
- package/dist/bundle/{chunk-W2QDYMAM.js → chunk-5KYQ53EF.js} +13 -9
- package/dist/bundle/{chunk-BW5JEOBE.js → chunk-5TU7Y5UW.js} +12 -12
- package/dist/bundle/{chunk-P2JTVRGU.js → chunk-66ALX4ZI.js} +168 -168
- package/dist/bundle/{chunk-EPIA2UUM.js → chunk-676C2LE6.js} +12 -12
- package/dist/bundle/{chunk-BNEJKGG7.js → chunk-6CWL5BKG.js} +78 -76
- package/dist/bundle/{chunk-TDBVM2SS.js → chunk-6QYZP4E2.js} +3 -3
- package/dist/bundle/{chunk-JXSEH64A.js → chunk-6VK332XS.js} +3 -3
- package/dist/bundle/{chunk-W7M4JYEE.js → chunk-73MOMNLL.js} +1 -1
- package/dist/bundle/{chunk-K672XJ2P.js → chunk-7QPIUMUG.js} +12 -12
- package/dist/bundle/{chunk-CWCDCNXA.js → chunk-7UVDPRFK.js} +6 -6
- package/dist/bundle/{chunk-RMX2WPWS.js → chunk-A6EZK5RG.js} +4 -4
- package/dist/bundle/{chunk-ONJPUFLX.js → chunk-AC6VJNMJ.js} +1 -1
- package/dist/bundle/{chunk-QIK2IBJ4.js → chunk-ACI4YIEH.js} +23 -7
- package/dist/bundle/{chunk-UX4JZMA4.js → chunk-AIKFOBDO.js} +278 -59
- package/dist/bundle/{chunk-GCPO7T2X.js → chunk-ASBDFXLS.js} +3 -3
- package/dist/bundle/{chunk-O4ZBFATF.js → chunk-B32KZRQM.js} +12 -12
- package/dist/bundle/{chunk-5RVXXDN7.js → chunk-BBGJQMRI.js} +1 -1
- package/dist/bundle/chunk-BDKVOU3I.js +52 -0
- package/dist/bundle/{chunk-GCUOZ2OA.js → chunk-BP4FYANF.js} +6 -6
- package/dist/bundle/{chunk-XTCAWNBP.js → chunk-DCYFT3FR.js} +4 -4
- package/dist/bundle/{chunk-FPUGMDJV.js → chunk-DNCLQPOM.js} +1 -1
- package/dist/bundle/{chunk-PKW3TPNP.js → chunk-DSZYABYL.js} +38 -19
- package/dist/bundle/{chunk-6MDL2LZA.js → chunk-E745WZKY.js} +8 -8
- package/dist/bundle/chunk-EGTCQKHV.js +340 -0
- package/dist/bundle/chunk-EQG3PIH2.js +108 -0
- package/dist/bundle/{chunk-ZPZT46O6.js → chunk-ESN3W2MZ.js} +48 -12
- package/dist/bundle/{chunk-7U5X37TE.js → chunk-G46WJ7YO.js} +6 -6
- package/dist/bundle/{chunk-L6FM5RQY.js → chunk-G6PETRMV.js} +3 -3
- package/dist/bundle/chunk-GBHMT2IU.js +755 -0
- package/dist/bundle/{chunk-6QCBTBDA.js → chunk-GGMAIIVE.js} +1 -1
- package/dist/bundle/{chunk-6I4C4ZFT.js → chunk-GTKPMYK7.js} +2 -2
- package/dist/bundle/{chunk-N5YUHN6S.js → chunk-GWGHH56B.js} +12 -12
- package/dist/bundle/{chunk-5XO2AY6D.js → chunk-HC6VN5CO.js} +10 -10
- package/dist/bundle/{chunk-ARL2TTPZ.js → chunk-HP7A2ZOP.js} +9 -9
- package/dist/bundle/chunk-HZENBDW2.js +209 -0
- package/dist/bundle/{chunk-ST3ZB7LS.js → chunk-IANKXHSE.js} +1 -1
- package/dist/bundle/{chunk-GGKEQQME.js → chunk-ICPJT672.js} +13 -9
- package/dist/bundle/chunk-JQ54DYAQ.js +80 -0
- package/dist/bundle/chunk-K5JGJIV2.js +640 -0
- package/dist/bundle/{chunk-DYRISFHZ.js → chunk-KJ6USQDZ.js} +19 -9
- package/dist/bundle/{chunk-TMYZKDQ7.js → chunk-KKFY23AK.js} +65 -65
- package/dist/bundle/chunk-KQPUVXKX.js +84 -0
- package/dist/bundle/{chunk-BPSURRAD.js → chunk-KVJ3I7UL.js} +43 -64
- package/dist/bundle/{chunk-NXFKZFTC.js → chunk-KWU46LNK.js} +3 -3
- package/dist/bundle/chunk-KXJ3JEDH.js +2 -0
- package/dist/bundle/{chunk-YAA2D6RP.js → chunk-L75SMSJR.js} +5 -5
- package/dist/bundle/{chunk-OXPHJEJ2.js → chunk-LAYYO4WD.js} +3 -3
- package/dist/bundle/{chunk-6PIXP5IH.js → chunk-LEKKTJKK.js} +40 -26
- package/dist/bundle/{chunk-3AOESMW6.js → chunk-M7H4MCAX.js} +18 -259
- package/dist/bundle/{chunk-DZ6H3YJH.js → chunk-MAJJ4PG3.js} +19 -16
- package/dist/bundle/{chunk-G5VH4WUF.js → chunk-MQLPZBMQ.js} +2 -2
- package/dist/bundle/{chunk-3Z7CFQTI.js → chunk-N3JLO63O.js} +1 -1
- package/dist/bundle/{chunk-NMETTKCV.js → chunk-N46F72AF.js} +14 -14
- package/dist/bundle/{chunk-A3TUG2DP.js → chunk-NB7EOAUZ.js} +36 -1
- package/dist/bundle/{chunk-BRMV33MO.js → chunk-NEMX3UNN.js} +4 -4
- package/dist/bundle/{chunk-6CDMGT6Q.js → chunk-OBXQLFT5.js} +2 -2
- package/dist/bundle/{chunk-HH7GR6TN.js → chunk-OGNO35A2.js} +6 -6
- package/dist/bundle/{chunk-Q6MISDKJ.js → chunk-OIPYBF43.js} +3 -3
- package/dist/bundle/{chunk-6LY4LBSD.js → chunk-OO4TRVPB.js} +7 -7
- package/dist/bundle/{chunk-CHEHK6IW.js → chunk-OQFQ77AY.js} +214 -118
- package/dist/bundle/{chunk-5D4AEUVA.js → chunk-PL5P7UKW.js} +434 -1
- package/dist/bundle/{chunk-Q5LUGY2V.js → chunk-PMUPN6JW.js} +9 -9
- package/dist/bundle/chunk-PSKTMMCO.js +561 -0
- package/dist/bundle/{chunk-U5N2PKKM.js → chunk-PWVJUIDQ.js} +2 -2
- package/dist/bundle/{chunk-475P3LWG.js → chunk-Q7ICVP25.js} +1 -1
- package/dist/bundle/{chunk-JGSVWLL2.js → chunk-QG6PILDO.js} +2 -2
- package/dist/bundle/{chunk-5K54M6RD.js → chunk-QPHBK63S.js} +1 -1
- package/dist/bundle/{chunk-RFXJLG5V.js → chunk-QVSL5WJ7.js} +5173 -3077
- package/dist/bundle/{chunk-IQWBGMCR.js → chunk-QVYAV7F2.js} +4 -4
- package/dist/bundle/{chunk-XIHENZW6.js → chunk-R2B6PUVI.js} +4 -4
- package/dist/bundle/{chunk-MH4L5LL6.js → chunk-RQOZBTNI.js} +16 -3
- package/dist/bundle/{chunk-FSLR2YGR.js → chunk-T7IAWEBU.js} +7 -7
- package/dist/bundle/{chunk-D4HKTC2T.js → chunk-TKNM22OH.js} +2 -2
- package/dist/bundle/{chunk-EI37UXDR.js → chunk-TKVBFJ5C.js} +1 -1
- package/dist/bundle/{chunk-O3DYRCIT.js → chunk-TXDR6YSF.js} +1 -1
- package/dist/bundle/{chunk-CWXOXIWS.js → chunk-TY7NDMFY.js} +1 -1
- package/dist/bundle/{chunk-Z3CPZ4I4.js → chunk-UAWSINMC.js} +306 -306
- package/dist/bundle/{chunk-4F7Q5CET.js → chunk-UKAAAOPC.js} +31 -180
- package/dist/bundle/{chunk-XL4ND7CZ.js → chunk-UL2PXLKT.js} +26 -26
- package/dist/bundle/{chunk-GRYXOSN6.js → chunk-UQCTXZEP.js} +10 -10
- package/dist/bundle/{chunk-E3JVLVVB.js → chunk-UR5DBODY.js} +37 -30
- package/dist/bundle/{chunk-SUG6YGAF.js → chunk-V5EJSF2B.js} +237 -167
- package/dist/bundle/{chunk-HGSBLY6M.js → chunk-VB72LTSZ.js} +12 -12
- package/dist/bundle/{chunk-2XZ2YKW4.js → chunk-VB7FZOYX.js} +2 -100
- package/dist/bundle/{chunk-PMO2Z6DQ.js → chunk-VS6WURLX.js} +3 -3
- package/dist/bundle/{chunk-5QXQIZJY.js → chunk-VZ5PPYDG.js} +3 -4
- package/dist/bundle/{chunk-YR5TRWT2.js → chunk-W5QHB53X.js} +287 -580
- package/dist/bundle/{chunk-2P6MQH4V.js → chunk-WMANRJR5.js} +6 -6
- package/dist/bundle/chunk-WOPVBRPV.js +29 -0
- package/dist/bundle/{chunk-W32HK7KG.js → chunk-XQ2WL3HB.js} +2 -2
- package/dist/bundle/{chunk-FIJREKLA.js → chunk-XQQVMECZ.js} +3 -3
- package/dist/bundle/{chunk-75JW7X2W.js → chunk-Y6PVS55U.js} +71 -61
- package/dist/bundle/{chunk-EMYRUJCV.js → chunk-YJXJJ2XP.js} +8 -8
- package/dist/bundle/{chunk-L2TURFT6.js → chunk-YY7XKHDY.js} +10 -3
- package/dist/bundle/chunk-ZED2CJW5.js +353 -0
- package/dist/bundle/chunk-ZOYOXWJB.js +746 -0
- package/dist/bundle/{cli-QNBYDOKV.js → cli-U4O5XB7J.js} +171 -124
- package/dist/bundle/command-contract-FBTK6GQX.js +45 -0
- package/dist/bundle/{command-server-entry-WMA4SWJ5.js → command-server-entry-KKH6ZWJV.js} +35 -35
- package/dist/bundle/config-FRJSIZNN.js +118 -0
- package/dist/bundle/{decode-7PXUXNIP.js → decode-TPCNXEK4.js} +6 -6
- package/dist/bundle/{dispatch-AWDROXWN.js → dispatch-FKMIPCPQ.js} +9 -9
- package/dist/bundle/{dist-TSBH4FOU.js → dist-7CLBCYZN.js} +23 -21
- package/dist/bundle/dist-PAKDDIBT.js +191 -0
- package/dist/bundle/{echarts-WIDIUEO6.js → echarts-O3TNDAXJ.js} +2 -2
- package/dist/bundle/{embed-EIRVQF5E.js → embed-WCJSFVSK.js} +7 -7
- package/dist/bundle/{embedder-MXPM6OXK.js → embedder-TBBUPXBX.js} +10 -10
- package/dist/bundle/{failure-JZW73RP7.js → failure-XTWBYI2A.js} +3 -3
- package/dist/bundle/first-run-ELEMFW42.js +29 -0
- package/dist/bundle/first-screen-DIOBWMKP.js +46 -0
- package/dist/bundle/{folders-TGFOE7DY.js → folders-LXOL4N4S.js} +5 -5
- package/dist/bundle/{instructions-D5LNE6NJ.js → instructions-AMH5RWVJ.js} +1 -1
- package/dist/bundle/{main-OHW5Z56X.js → main-YAA7WQ23.js} +24 -24
- package/dist/bundle/{mcp-RGNRW77S.js → mcp-5HFPWC3W.js} +2 -2
- package/dist/bundle/meeting-combined-UXCF4SJ3.js +26 -0
- package/dist/bundle/meeting-model-3BZJ3EQP.js +26 -0
- package/dist/bundle/{meeting-semantic-FYOVY4S2.js → meeting-semantic-3HU7I2SJ.js} +8 -8
- package/dist/bundle/{meetings-WI4SXPBJ.js → meetings-XWMB6FOH.js} +7 -7
- package/dist/bundle/{node-UEWUFR7N.js → node-EGMCBAO7.js} +2 -2
- package/dist/bundle/{node-sqlite-FJWKJHYU.js → node-sqlite-IJBWENFX.js} +8 -8
- package/dist/bundle/oauth-SZDDAP7A.js +20 -0
- package/dist/bundle/{open-EFYTWUGC.js → open-NS3TMKZX.js} +6 -6
- package/dist/bundle/openai-4DN6WI3B.js +28 -0
- package/dist/bundle/{output-file-J4SU6X4I.js → output-file-2UB5JP3R.js} +6 -6
- package/dist/bundle/{process-U5PLNIDC.js → process-SGHEN6MQ.js} +1 -1
- package/dist/bundle/{program-3JICCSA6.js → program-GVCGZP27.js} +170 -160
- package/dist/bundle/{prompt-YPDMSOKC.js → prompt-HJFMPFVC.js} +6 -6
- package/dist/bundle/public-C2ZB2AGQ.js +198 -0
- package/dist/bundle/{recognize-Z2SSWUKH.js → recognize-2SEI5PPM.js} +5 -5
- package/dist/bundle/{remote-R5HMDHOG.js → remote-2DMS74XE.js} +11 -11
- package/dist/bundle/{rerank-6NGBEMQ2.js → rerank-H6GCYVIA.js} +8 -8
- package/dist/bundle/run-log-QU26SUZP.js +145 -0
- package/dist/bundle/{serve-CU3RMWU7.js → serve-ODVRPFJO.js} +11 -11
- package/dist/bundle/server-NBPF6IDZ.js +95 -0
- package/dist/bundle/{server-SOQSVX2Q.js → server-PCLIO24L.js} +82 -69
- package/dist/bundle/{services-LROZ3RDT.js → services-4QAPXBLO.js} +60 -54
- package/dist/bundle/{speech-AS77HFIF.js → speech-MA6ZT3WE.js} +28 -28
- package/dist/bundle/{sqlite-runtime-U25NS6BK.js → sqlite-runtime-PVMAUXRN.js} +7 -7
- package/dist/bundle/{state-CPEVKK66.js → state-QFMTYUME.js} +7 -7
- package/dist/bundle/{store-6CHRMJM7.js → store-25OTAQC3.js} +31 -24
- package/dist/bundle/{store-QKHCZOYR.js → store-F724QIKJ.js} +34 -26
- package/dist/bundle/store-connection-OGPXANGB.js +111 -0
- package/dist/bundle/store-maintenance-command-2CM7LLNQ.js +83 -0
- package/dist/bundle/{streaming-VDJOYGMO.js → streaming-S22C4DG5.js} +7 -7
- package/dist/bundle/surface-7PXHWCF6.js +81 -0
- package/dist/bundle/{tokens-JBN2OHQB.js → tokens-NLUHA2DW.js} +11 -10
- package/dist/bundle/zm.js +9 -9
- package/dist/bundle/{zoom-app-Q4IKYNG3.js → zoom-app-YWFB367P.js} +8 -8
- package/dist/commands.d.ts +1 -0
- package/dist/commands.d.ts.map +1 -1
- package/dist/commands.js +8 -2
- package/dist/commands.js.map +1 -1
- package/dist/setup-commands.d.ts +1 -1
- package/dist/setup-commands.d.ts.map +1 -1
- package/dist/setup-commands.js +31 -5
- package/dist/setup-commands.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/dist/zoom-api/types.d.ts +5 -0
- package/dist/zoom-api/types.d.ts.map +1 -1
- package/package.json +3 -3
- package/dist/bundle/answer-policy-7PYXHK2I.js +0 -122
- package/dist/bundle/chunk-3BTRJYIT.js +0 -729
- package/dist/bundle/chunk-M4LAF627.js +0 -719
- package/dist/bundle/command-contract-CT6MV6YG.js +0 -45
- package/dist/bundle/config-ZFQFDEVL.js +0 -109
- package/dist/bundle/first-run-K6EHRAIM.js +0 -29
- package/dist/bundle/first-screen-C6AF4KT4.js +0 -45
- package/dist/bundle/meeting-combined-3OKFXZNA.js +0 -26
- package/dist/bundle/meeting-model-4XNF725D.js +0 -26
- package/dist/bundle/oauth-KOONTGLW.js +0 -20
- package/dist/bundle/openai-6Y2JRDNY.js +0 -28
- package/dist/bundle/run-log-LG3TI3WI.js +0 -136
- package/dist/bundle/server-X7JYRMKX.js +0 -85
- package/dist/bundle/store-connection-FCDVOPWB.js +0 -102
- package/dist/bundle/store-maintenance-command-6HVOAHOZ.js +0 -77
|
@@ -2,14 +2,18 @@ import { createRequire as __bundleRequire } from "node:module";
|
|
|
2
2
|
const require = __bundleRequire(import.meta.url);
|
|
3
3
|
import {
|
|
4
4
|
WIRECAT_TOOLS
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-NB7EOAUZ.js";
|
|
6
|
+
import {
|
|
7
|
+
hasOwnAction,
|
|
8
|
+
isHidden
|
|
9
|
+
} from "./chunk-WOPVBRPV.js";
|
|
6
10
|
import {
|
|
7
11
|
wrapAnsi
|
|
8
12
|
} from "./chunk-HTQTIKWP.js";
|
|
9
13
|
import {
|
|
10
14
|
commandPathOf,
|
|
11
15
|
outputOf
|
|
12
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-L75SMSJR.js";
|
|
13
17
|
import {
|
|
14
18
|
Command,
|
|
15
19
|
Help,
|
|
@@ -20,18 +24,18 @@ import {
|
|
|
20
24
|
environmentOf,
|
|
21
25
|
metaOf,
|
|
22
26
|
takesProfile
|
|
23
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-V5EJSF2B.js";
|
|
24
28
|
import {
|
|
25
29
|
writes
|
|
26
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-ESN3W2MZ.js";
|
|
27
31
|
import {
|
|
28
32
|
CliError
|
|
29
|
-
} from "./chunk-
|
|
33
|
+
} from "./chunk-IANKXHSE.js";
|
|
30
34
|
import {
|
|
31
35
|
__name
|
|
32
36
|
} from "./chunk-ZVVMGPBJ.js";
|
|
33
37
|
|
|
34
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
38
|
+
// 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/help/command-help.js
|
|
35
39
|
var ARGUMENT_KINDS = {
|
|
36
40
|
chat: "chat",
|
|
37
41
|
chats: "chat",
|
|
@@ -109,8 +113,8 @@ var nextUsually = /* @__PURE__ */ __name((command, choice) => {
|
|
|
109
113
|
return command;
|
|
110
114
|
}, "nextUsually");
|
|
111
115
|
var kindOfArgument = /* @__PURE__ */ __name((argument) => ARGUMENT_KINDS[argument.name()], "kindOfArgument");
|
|
112
|
-
var runs = /* @__PURE__ */ __name((command) => command.commands.length === 0 ||
|
|
113
|
-
var leaves = /* @__PURE__ */ __name((command) => command.commands.filter((child) => !child
|
|
116
|
+
var runs = /* @__PURE__ */ __name((command) => command.commands.length === 0 || hasOwnAction(command), "runs");
|
|
117
|
+
var leaves = /* @__PURE__ */ __name((command) => command.commands.filter((child) => !isHidden(child)).flatMap((child) => [...runs(child) ? [child] : [], ...leaves(child)]), "leaves");
|
|
114
118
|
var rootOf = /* @__PURE__ */ __name((command) => {
|
|
115
119
|
let at = command;
|
|
116
120
|
while (at.parent)
|
|
@@ -253,7 +257,7 @@ var exampleReport = /* @__PURE__ */ __name((program) => {
|
|
|
253
257
|
return { written, generated, text };
|
|
254
258
|
}, "exampleReport");
|
|
255
259
|
|
|
256
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
260
|
+
// 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/help/first-screen.js
|
|
257
261
|
var WIDTH = 100;
|
|
258
262
|
var widest = /* @__PURE__ */ __name((texts) => texts.reduce((most, text) => Math.max(most, text.length), 0), "widest");
|
|
259
263
|
var block = /* @__PURE__ */ __name((title, rows, column) => rows.length === 0 ? [] : ["", `${title}:`, ...rows.map(([left, right]) => ` ${left.padEnd(column)}${right}`)], "block");
|
|
@@ -2,31 +2,31 @@ import { createRequire as __bundleRequire } from "node:module";
|
|
|
2
2
|
const require = __bundleRequire(import.meta.url);
|
|
3
3
|
import {
|
|
4
4
|
updateCommand
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-A6EZK5RG.js";
|
|
6
6
|
import {
|
|
7
7
|
QUESTIONS,
|
|
8
8
|
readSetupAnswers,
|
|
9
9
|
unanswered,
|
|
10
10
|
writeSetupAnswers
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-QVYAV7F2.js";
|
|
12
12
|
import {
|
|
13
13
|
DEFAULT_STEMMERS,
|
|
14
14
|
LANGUAGES
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-YJXJJ2XP.js";
|
|
16
16
|
import {
|
|
17
17
|
sharedConfigPath
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-E745WZKY.js";
|
|
19
19
|
import {
|
|
20
20
|
installerOf
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-TXDR6YSF.js";
|
|
22
22
|
import {
|
|
23
23
|
storePath
|
|
24
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-274SLQNW.js";
|
|
25
25
|
import {
|
|
26
26
|
__name
|
|
27
27
|
} from "./chunk-ZVVMGPBJ.js";
|
|
28
28
|
|
|
29
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
29
|
+
// 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/first-run.js
|
|
30
30
|
import { spawnSync } from "node:child_process";
|
|
31
31
|
import { accessSync, constants, realpathSync } from "node:fs";
|
|
32
32
|
import { delimiter, join } from "node:path";
|
|
@@ -84,7 +84,7 @@ var suggested = /* @__PURE__ */ __name((env, contentLanguages) => {
|
|
|
84
84
|
return (own.length ? own : LANGUAGES.filter(({ code }) => code === "en" || code === system)).map(({ name }) => name);
|
|
85
85
|
}, "suggested");
|
|
86
86
|
var askLanguages = /* @__PURE__ */ __name(async ({ command, env, io, contentLanguages }) => {
|
|
87
|
-
const { openStore } = await import("./store-
|
|
87
|
+
const { openStore } = await import("./store-25OTAQC3.js");
|
|
88
88
|
const store = await openStore({ env });
|
|
89
89
|
let rebuild = false;
|
|
90
90
|
try {
|
|
@@ -113,8 +113,8 @@ var askLanguages = /* @__PURE__ */ __name(async ({ command, env, io, contentLang
|
|
|
113
113
|
if (!rebuild)
|
|
114
114
|
return;
|
|
115
115
|
const [{ openCache }, { buildStems }] = await Promise.all([
|
|
116
|
-
import("./open-
|
|
117
|
-
import("./store-maintenance-command-
|
|
116
|
+
import("./open-NS3TMKZX.js"),
|
|
117
|
+
import("./store-maintenance-command-2CM7LLNQ.js")
|
|
118
118
|
]);
|
|
119
119
|
const database = await openCache(storePath(env));
|
|
120
120
|
try {
|
|
@@ -126,7 +126,7 @@ var askLanguages = /* @__PURE__ */ __name(async ({ command, env, io, contentLang
|
|
|
126
126
|
var askTools = /* @__PURE__ */ __name(async (run) => {
|
|
127
127
|
const { command, env, io } = run;
|
|
128
128
|
const installed = run.installed ?? ((name) => onPath(name, env));
|
|
129
|
-
const { WIRECAT_TOOLS } = await import("./first-screen-
|
|
129
|
+
const { WIRECAT_TOOLS } = await import("./first-screen-DIOBWMKP.js");
|
|
130
130
|
const others = WIRECAT_TOOLS.filter((tool) => tool.command !== command);
|
|
131
131
|
const missing = others.filter((tool) => !installed(tool.command));
|
|
132
132
|
io.say("Other WireCat tools \u2014 they share this store, so one search finds everything:");
|
|
@@ -200,7 +200,7 @@ var setupAtStart = /* @__PURE__ */ __name(async (start) => {
|
|
|
200
200
|
// `setup describe` and `setup apply` are a program's; only the bare walk-through asks everything again.
|
|
201
201
|
all: start.path.length === 1 && start.path[0] === "setup",
|
|
202
202
|
io: {
|
|
203
|
-
ask: /* @__PURE__ */ __name(async (prompt) => (await import("./prompt-
|
|
203
|
+
ask: /* @__PURE__ */ __name(async (prompt) => (await import("./prompt-HJFMPFVC.js")).readSecret(prompt, { input, echo: true }), "ask"),
|
|
204
204
|
say: /* @__PURE__ */ __name((text) => process.stderr.write(`${text}
|
|
205
205
|
`), "say")
|
|
206
206
|
}
|
|
@@ -23,28 +23,28 @@ import {
|
|
|
23
23
|
tagMemberIds,
|
|
24
24
|
thingOf,
|
|
25
25
|
write
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-2GP573Q4.js";
|
|
27
27
|
import {
|
|
28
28
|
fold
|
|
29
|
-
} from "./chunk-
|
|
29
|
+
} from "./chunk-2JHVQMVC.js";
|
|
30
30
|
import {
|
|
31
31
|
damagedFile
|
|
32
|
-
} from "./chunk-
|
|
32
|
+
} from "./chunk-GTKPMYK7.js";
|
|
33
33
|
import {
|
|
34
34
|
ADDED_PROVIDER,
|
|
35
35
|
filesAccountSql,
|
|
36
36
|
folderProviderOf,
|
|
37
37
|
folderProviderSql,
|
|
38
38
|
isDocumentAccountProvider
|
|
39
|
-
} from "./chunk-
|
|
39
|
+
} from "./chunk-DSZYABYL.js";
|
|
40
40
|
import {
|
|
41
41
|
CliError
|
|
42
|
-
} from "./chunk-
|
|
42
|
+
} from "./chunk-IANKXHSE.js";
|
|
43
43
|
import {
|
|
44
44
|
__name
|
|
45
45
|
} from "./chunk-ZVVMGPBJ.js";
|
|
46
46
|
|
|
47
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
47
|
+
// 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/damage.js
|
|
48
48
|
var DERIVED = /* @__PURE__ */ new Set(["mentions", "involvements", "embeddings"]);
|
|
49
49
|
var named = /* @__PURE__ */ __name((tables) => tables.length <= 5 ? tables.join(", ") : `${tables.slice(0, 5).join(", ")} and ${tables.length - 5} more`, "named");
|
|
50
50
|
var isDerivedTable = /* @__PURE__ */ __name((table, searchIndexes) => DERIVED.has(table) || table.startsWith("vector_index_") || searchIndexes.some((index) => table === index || table.startsWith(`${index}_`)), "isDerivedTable");
|
|
@@ -147,11 +147,153 @@ var storeDamageReport = /* @__PURE__ */ __name(({ health, command, mark = null,
|
|
|
147
147
|
};
|
|
148
148
|
}, "storeDamageReport");
|
|
149
149
|
|
|
150
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
151
|
-
import {
|
|
150
|
+
// 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/health.js
|
|
151
|
+
import { existsSync, statSync } from "node:fs";
|
|
152
|
+
var JSON_COLUMNS = {
|
|
153
|
+
accounts: ["settings"],
|
|
154
|
+
account_identities: ["mail_signals"],
|
|
155
|
+
bot_updates: ["payload"],
|
|
156
|
+
documents: ["front_matter"],
|
|
157
|
+
emails: ["headers"],
|
|
158
|
+
meeting_participants: ["sessions"],
|
|
159
|
+
messages: ["mentions", "reply_to"],
|
|
160
|
+
proposed_actions: ["payload", "result"],
|
|
161
|
+
searches: ["params"],
|
|
162
|
+
tag_consolidations: ["source_member_ids", "survivor_member_ids"],
|
|
163
|
+
task_events: ["changes"]
|
|
164
|
+
};
|
|
165
|
+
var jsonColumns = /* @__PURE__ */ __name((database) => database.prepare(`SELECT m.name AS "table", c.name AS "column", c."notnull" AS required FROM sqlite_master m, pragma_table_info(m.name) c
|
|
166
|
+
WHERE m.type = 'table' AND m.sql NOT LIKE 'CREATE VIRTUAL%' ORDER BY 1, 2`).all().map((row) => ({ table: String(row.table), column: String(row.column), required: Number(row.required) === 1 })).filter(({ table, column }) => column === "metadata" || JSON_COLUMNS[table]?.includes(column)), "jsonColumns");
|
|
167
|
+
var invalidJson = /* @__PURE__ */ __name((database) => jsonColumns(database).map((one) => ({
|
|
168
|
+
...one,
|
|
169
|
+
rows: Number(database.prepare(`SELECT count(*) AS n FROM "${one.table}" WHERE "${one.column}" IS NOT NULL AND NOT json_valid("${one.column}")`).get()?.n)
|
|
170
|
+
})).filter(({ rows }) => rows > 0), "invalidJson");
|
|
171
|
+
var QUICK_CHECK_LIMIT = 1e4;
|
|
172
|
+
var QUICK_HEALTH_CHECKS = "the file header, its size against its page count, and the schema's own pages";
|
|
173
|
+
var FTS5 = /^\s*CREATE\s+VIRTUAL\s+TABLE\s+\S+\s+USING\s+fts5\s*\(/i;
|
|
174
|
+
var fts5Tables = /* @__PURE__ */ __name((database) => database.prepare("SELECT name, sql FROM sqlite_master WHERE type = 'table' AND sql LIKE 'CREATE VIRTUAL TABLE%' ORDER BY name").all().filter((row) => FTS5.test(String(row.sql))).map((row) => {
|
|
175
|
+
const sql = String(row.sql);
|
|
176
|
+
return { name: String(row.name), sql, external: /content\s*=\s*'[^']+'/i.test(sql) };
|
|
177
|
+
}), "fts5Tables");
|
|
178
|
+
var messageOf = /* @__PURE__ */ __name((error) => error instanceof Error ? error.message : String(error), "messageOf");
|
|
179
|
+
var bytesOf = /* @__PURE__ */ __name((path) => statSync(path, { throwIfNoEntry: false })?.size ?? 0, "bytesOf");
|
|
180
|
+
var damagedTables = /* @__PURE__ */ __name((database, lines) => {
|
|
181
|
+
const roots = new Map(database.prepare("SELECT rootpage, tbl_name FROM sqlite_master WHERE rootpage > 0").all().map((row) => [Number(row.rootpage), String(row.tbl_name)]));
|
|
182
|
+
const owners = new Map(database.prepare("SELECT name, tbl_name FROM sqlite_master WHERE type = 'index'").all().map((row) => [String(row.name), String(row.tbl_name)]));
|
|
183
|
+
const virtual = database.prepare("SELECT name FROM sqlite_master WHERE type = 'table' AND sql LIKE 'CREATE VIRTUAL TABLE%'").all().map((row) => String(row.name));
|
|
184
|
+
const ownerOf = /* @__PURE__ */ __name((table) => table === null ? null : virtual.find((name) => table.startsWith(`${name}_`)) ?? table, "ownerOf");
|
|
185
|
+
const tables = /* @__PURE__ */ new Map();
|
|
186
|
+
for (const raw of lines) {
|
|
187
|
+
const line = raw.replace(/^\*\*\* in database \w+ \*\*\*\s*/, "");
|
|
188
|
+
const tree = /^Tree (\d+) /.exec(line);
|
|
189
|
+
const column = /value in (\w+)\.\w+/.exec(line) ?? /^table (\w+): /.exec(line);
|
|
190
|
+
const index = /index (\w+)/.exec(line)?.[1];
|
|
191
|
+
const table = ownerOf(tree ? roots.get(Number(tree[1])) ?? null : column ? column[1] ?? null : index ? owners.get(index) ?? null : null);
|
|
192
|
+
const known = tables.get(table);
|
|
193
|
+
if (known)
|
|
194
|
+
known.problems += 1;
|
|
195
|
+
else
|
|
196
|
+
tables.set(table, { table, problems: 1, sample: line.slice(0, 200) });
|
|
197
|
+
}
|
|
198
|
+
return [...tables.values()].sort((a, b) => b.problems - a.problems);
|
|
199
|
+
}, "damagedTables");
|
|
200
|
+
var searchIndexHealth = /* @__PURE__ */ __name((database) => fts5Tables(database).map(({ name }) => {
|
|
201
|
+
try {
|
|
202
|
+
database.exec("BEGIN");
|
|
203
|
+
try {
|
|
204
|
+
database.exec(`INSERT INTO "${name}" ("${name}", rank) VALUES ('integrity-check', 0)`);
|
|
205
|
+
} finally {
|
|
206
|
+
database.exec("ROLLBACK");
|
|
207
|
+
}
|
|
208
|
+
return { name, ok: true };
|
|
209
|
+
} catch (error) {
|
|
210
|
+
return { name, ok: false, error: messageOf(error) };
|
|
211
|
+
}
|
|
212
|
+
}), "searchIndexHealth");
|
|
213
|
+
var pragmaLines = /* @__PURE__ */ __name((database, sql) => database.prepare(sql).all().flatMap((row) => String(Object.values(row)[0]).split("\n")), "pragmaLines");
|
|
214
|
+
var checkLines = /* @__PURE__ */ __name((database) => {
|
|
215
|
+
try {
|
|
216
|
+
return pragmaLines(database, `PRAGMA quick_check(${QUICK_CHECK_LIMIT})`);
|
|
217
|
+
} catch {
|
|
218
|
+
const tables = database.prepare("SELECT name FROM sqlite_master WHERE type = 'table' AND rootpage > 0 ORDER BY name").all().map((row) => String(row.name));
|
|
219
|
+
return tables.flatMap((table) => {
|
|
220
|
+
try {
|
|
221
|
+
return pragmaLines(database, `PRAGMA quick_check("${table}")`).filter((line) => line !== "ok");
|
|
222
|
+
} catch (error) {
|
|
223
|
+
return [`table ${table}: ${messageOf(error)}`];
|
|
224
|
+
}
|
|
225
|
+
});
|
|
226
|
+
}
|
|
227
|
+
}, "checkLines");
|
|
228
|
+
var quickHealth = /* @__PURE__ */ __name((database, path) => {
|
|
229
|
+
const pragma = /* @__PURE__ */ __name((name) => Number(Object.values(database.prepare(`PRAGMA ${name}`).get() ?? {})[0] ?? 0), "pragma");
|
|
230
|
+
const file = {
|
|
231
|
+
bytes: bytesOf(path),
|
|
232
|
+
pages: pragma("page_count"),
|
|
233
|
+
pageSize: pragma("page_size"),
|
|
234
|
+
freePages: pragma("freelist_count")
|
|
235
|
+
};
|
|
236
|
+
const schema = database.prepare("PRAGMA quick_check('sqlite_schema')").all().map((row) => String(Object.values(row)[0]));
|
|
237
|
+
const walFrames = existsSync(`${path}-wal`) && bytesOf(`${path}-wal`) > 0;
|
|
238
|
+
const sized = walFrames || file.bytes === file.pages * file.pageSize;
|
|
239
|
+
const problems = [
|
|
240
|
+
...schema.length === 1 && schema[0] === "ok" ? [] : schema,
|
|
241
|
+
...sized ? [] : [`the file holds ${file.bytes} bytes, its header says ${file.pages * file.pageSize}`]
|
|
242
|
+
];
|
|
243
|
+
return { file, problems };
|
|
244
|
+
}, "quickHealth");
|
|
245
|
+
var storeHealth = /* @__PURE__ */ __name(async (path, { deep = false } = {}) => {
|
|
246
|
+
const started = Date.now();
|
|
247
|
+
const checked = deep ? "deep" : "quick";
|
|
248
|
+
const done = /* @__PURE__ */ __name((health) => ({
|
|
249
|
+
path,
|
|
250
|
+
checked,
|
|
251
|
+
...health,
|
|
252
|
+
ms: Date.now() - started
|
|
253
|
+
}), "done");
|
|
254
|
+
let database;
|
|
255
|
+
try {
|
|
256
|
+
database = (await openSqlite(path, { readOnly: !deep })).database;
|
|
257
|
+
} catch (error) {
|
|
258
|
+
return done({ ok: false, error: messageOf(error) });
|
|
259
|
+
}
|
|
260
|
+
try {
|
|
261
|
+
const { file, problems } = quickHealth(database, path);
|
|
262
|
+
if (!deep) {
|
|
263
|
+
return done({
|
|
264
|
+
ok: problems.length === 0,
|
|
265
|
+
file,
|
|
266
|
+
...problems.length ? {
|
|
267
|
+
problems: problems.length,
|
|
268
|
+
damagedTables: [{ table: null, problems: problems.length, sample: problems[0] }]
|
|
269
|
+
} : {}
|
|
270
|
+
});
|
|
271
|
+
}
|
|
272
|
+
database.exec("PRAGMA busy_timeout = 30000");
|
|
273
|
+
const lines = checkLines(database);
|
|
274
|
+
const pagesOk = lines.length === 1 && lines[0] === "ok";
|
|
275
|
+
const indexes = searchIndexHealth(database);
|
|
276
|
+
const json = pagesOk ? invalidJson(database) : [];
|
|
277
|
+
return done({
|
|
278
|
+
ok: pagesOk && problems.length === 0 && indexes.every((index) => index.ok) && json.length === 0,
|
|
279
|
+
file,
|
|
280
|
+
problems: pagesOk ? 0 : lines.length,
|
|
281
|
+
damagedTables: pagesOk ? [] : damagedTables(database, lines),
|
|
282
|
+
searchIndexes: indexes,
|
|
283
|
+
invalidJson: json
|
|
284
|
+
});
|
|
285
|
+
} catch (error) {
|
|
286
|
+
return done({ ok: false, error: messageOf(error) });
|
|
287
|
+
} finally {
|
|
288
|
+
database.close();
|
|
289
|
+
}
|
|
290
|
+
}, "storeHealth");
|
|
291
|
+
|
|
292
|
+
// 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/document-transfer/index.js
|
|
293
|
+
import { realpathSync, statSync as statSync2 } from "node:fs";
|
|
152
294
|
import { resolve } from "node:path";
|
|
153
295
|
|
|
154
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
296
|
+
// 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/sqlite/document-transfer/people.js
|
|
155
297
|
var planPeople = /* @__PURE__ */ __name((database, snapshot, mappings, bindings, conflicts) => {
|
|
156
298
|
const creatable = /* @__PURE__ */ new Set();
|
|
157
299
|
let people = 0, identities = 0;
|
|
@@ -214,11 +356,11 @@ var copyPeople = /* @__PURE__ */ __name((database, snapshot, mappings, now) => {
|
|
|
214
356
|
}
|
|
215
357
|
}, "copyPeople");
|
|
216
358
|
|
|
217
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
359
|
+
// 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/document-transfer/digest.js
|
|
218
360
|
import { createHash } from "node:crypto";
|
|
219
361
|
var digest = /* @__PURE__ */ __name((value) => createHash("sha256").update(JSON.stringify(value)).digest("hex"), "digest");
|
|
220
362
|
|
|
221
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
363
|
+
// 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/sqlite/document-transfer/collection.js
|
|
222
364
|
var documentsKeyOf = /* @__PURE__ */ __name((collection) => {
|
|
223
365
|
const colon = collection.indexOf(":");
|
|
224
366
|
const provider = collection.slice(0, colon);
|
|
@@ -262,7 +404,7 @@ var currentCollection = /* @__PURE__ */ __name((row) => {
|
|
|
262
404
|
};
|
|
263
405
|
}, "currentCollection");
|
|
264
406
|
|
|
265
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
407
|
+
// 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/sqlite/document-transfer/plan.js
|
|
266
408
|
var planTransfer = /* @__PURE__ */ __name((database, snapshot, sourceKey, bindings) => {
|
|
267
409
|
const mappings = /* @__PURE__ */ new Map();
|
|
268
410
|
const missing = /* @__PURE__ */ new Set(), conflicts = /* @__PURE__ */ new Set();
|
|
@@ -344,8 +486,8 @@ var planTransfer = /* @__PURE__ */ __name((database, snapshot, sourceKey, bindin
|
|
|
344
486
|
else
|
|
345
487
|
missing.add(external.reference);
|
|
346
488
|
}
|
|
347
|
-
const
|
|
348
|
-
if (target && target.organization_id !==
|
|
489
|
+
const organization = snapshot.collection.organization_id == null ? null : mappings.get(`organization:${String(snapshot.collection.organization_id)}`)?.id;
|
|
490
|
+
if (target && target.organization_id !== organization)
|
|
349
491
|
conflicts.add("the destination collection has a different organization binding");
|
|
350
492
|
for (const tagging of snapshot.taggings) {
|
|
351
493
|
if (Number(tagging.tag_group_size ?? 1) > 1)
|
|
@@ -429,7 +571,7 @@ var planTransfer = /* @__PURE__ */ __name((database, snapshot, sourceKey, bindin
|
|
|
429
571
|
};
|
|
430
572
|
}, "planTransfer");
|
|
431
573
|
|
|
432
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
574
|
+
// 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/sqlite/document-transfer/snapshot.js
|
|
433
575
|
var TRANSFER_TABLES = { document: "documents", note: "notes", memory: "memories", fact: "facts" };
|
|
434
576
|
var MAX_ENTITIES = 1e3;
|
|
435
577
|
var MAX_AUXILIARY = 1e4;
|
|
@@ -591,7 +733,7 @@ var transferSnapshot = /* @__PURE__ */ __name((database, collection) => read(dat
|
|
|
591
733
|
};
|
|
592
734
|
}), "transferSnapshot");
|
|
593
735
|
|
|
594
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
736
|
+
// 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/sqlite/document-transfer/apply.js
|
|
595
737
|
var providerHere = /* @__PURE__ */ __name(({ provider, name, settings }) => {
|
|
596
738
|
if (provider !== "folder" || String(name ?? "").startsWith("google-drive:"))
|
|
597
739
|
return provider ?? null;
|
|
@@ -645,11 +787,11 @@ var applyTransfer = /* @__PURE__ */ __name((database, snapshot, sourceKey, bindi
|
|
|
645
787
|
mappings.set(external.key, botNamed(database, external.bot.name, now(), external.bot.kind));
|
|
646
788
|
let collectionId = plan.collectionId;
|
|
647
789
|
if (collectionId === void 0) {
|
|
648
|
-
const
|
|
790
|
+
const organization = snapshot.collection.organization_id == null ? void 0 : mapped(mappings, "organization", snapshot.collection.organization_id);
|
|
649
791
|
collectionId = insert(database, "accounts", "provider external_id name created_at settings updated_at scope organization_id", {
|
|
650
792
|
...snapshot.collection,
|
|
651
793
|
provider: providerHere(snapshot.collection),
|
|
652
|
-
organization_id:
|
|
794
|
+
organization_id: organization?.id ?? null
|
|
653
795
|
});
|
|
654
796
|
}
|
|
655
797
|
mappings.set(`account:${String(snapshot.collection.id)}`, { type: "account", id: collectionId });
|
|
@@ -763,15 +905,15 @@ var remapEntity = /* @__PURE__ */ __name((database, entity, id, mappings) => {
|
|
|
763
905
|
database.prepare(`UPDATE ${TRANSFER_TABLES[entity.kind]} SET ${columns.join(",")} WHERE id=?`).run(...values, id);
|
|
764
906
|
}, "remapEntity");
|
|
765
907
|
|
|
766
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
908
|
+
// 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/document-transfer/index.js
|
|
767
909
|
var locations = /* @__PURE__ */ __name((options) => {
|
|
768
910
|
for (const value of [options.source, options.destination, options.collection])
|
|
769
911
|
if (typeof value !== "string" || !value.trim())
|
|
770
912
|
throw new CliError("validation_error", "transfer source, destination and collection are required");
|
|
771
|
-
if (!
|
|
913
|
+
if (!statSync2(options.source, { throwIfNoEntry: false })?.isFile())
|
|
772
914
|
throw new CliError("not_found", "the source store does not exist as a file");
|
|
773
915
|
const source = realpathSync(options.source), destination = resolve(options.destination);
|
|
774
|
-
const left =
|
|
916
|
+
const left = statSync2(source), right = statSync2(destination, { throwIfNoEntry: false });
|
|
775
917
|
if (right && (!right.isFile() || left.dev === right.dev && left.ino === right.ino))
|
|
776
918
|
throw new CliError("validation_error", "the source and destination must be different ordinary store files");
|
|
777
919
|
const bindings = options.bindings ?? {};
|
|
@@ -795,7 +937,7 @@ var openSource = /* @__PURE__ */ __name(async (path) => {
|
|
|
795
937
|
}
|
|
796
938
|
}, "openSource");
|
|
797
939
|
var openPreviewTarget = /* @__PURE__ */ __name(async (path) => {
|
|
798
|
-
if (
|
|
940
|
+
if (statSync2(path, { throwIfNoEntry: false })) {
|
|
799
941
|
const opened = await openSource(path);
|
|
800
942
|
try {
|
|
801
943
|
assertReadCompatible(opened.database);
|
|
@@ -865,149 +1007,7 @@ var applyWith = /* @__PURE__ */ __name(async (location, options) => {
|
|
|
865
1007
|
}
|
|
866
1008
|
}, "applyWith");
|
|
867
1009
|
|
|
868
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
869
|
-
import { existsSync, statSync as statSync2 } from "node:fs";
|
|
870
|
-
var JSON_COLUMNS = {
|
|
871
|
-
accounts: ["settings"],
|
|
872
|
-
account_identities: ["mail_signals"],
|
|
873
|
-
bot_updates: ["payload"],
|
|
874
|
-
documents: ["front_matter"],
|
|
875
|
-
emails: ["headers"],
|
|
876
|
-
meeting_participants: ["sessions"],
|
|
877
|
-
messages: ["mentions", "reply_to"],
|
|
878
|
-
proposed_actions: ["payload", "result"],
|
|
879
|
-
searches: ["params"],
|
|
880
|
-
tag_consolidations: ["source_member_ids", "survivor_member_ids"],
|
|
881
|
-
task_events: ["changes"]
|
|
882
|
-
};
|
|
883
|
-
var jsonColumns = /* @__PURE__ */ __name((database) => database.prepare(`SELECT m.name AS "table", c.name AS "column", c."notnull" AS required FROM sqlite_master m, pragma_table_info(m.name) c
|
|
884
|
-
WHERE m.type = 'table' AND m.sql NOT LIKE 'CREATE VIRTUAL%' ORDER BY 1, 2`).all().map((row) => ({ table: String(row.table), column: String(row.column), required: Number(row.required) === 1 })).filter(({ table, column }) => column === "metadata" || JSON_COLUMNS[table]?.includes(column)), "jsonColumns");
|
|
885
|
-
var invalidJson = /* @__PURE__ */ __name((database) => jsonColumns(database).map((one) => ({
|
|
886
|
-
...one,
|
|
887
|
-
rows: Number(database.prepare(`SELECT count(*) AS n FROM "${one.table}" WHERE "${one.column}" IS NOT NULL AND NOT json_valid("${one.column}")`).get()?.n)
|
|
888
|
-
})).filter(({ rows }) => rows > 0), "invalidJson");
|
|
889
|
-
var QUICK_CHECK_LIMIT = 1e4;
|
|
890
|
-
var QUICK_HEALTH_CHECKS = "the file header, its size against its page count, and the schema's own pages";
|
|
891
|
-
var FTS5 = /^\s*CREATE\s+VIRTUAL\s+TABLE\s+\S+\s+USING\s+fts5\s*\(/i;
|
|
892
|
-
var fts5Tables = /* @__PURE__ */ __name((database) => database.prepare("SELECT name, sql FROM sqlite_master WHERE type = 'table' AND sql LIKE 'CREATE VIRTUAL TABLE%' ORDER BY name").all().filter((row) => FTS5.test(String(row.sql))).map((row) => {
|
|
893
|
-
const sql = String(row.sql);
|
|
894
|
-
return { name: String(row.name), sql, external: /content\s*=\s*'[^']+'/i.test(sql) };
|
|
895
|
-
}), "fts5Tables");
|
|
896
|
-
var messageOf = /* @__PURE__ */ __name((error) => error instanceof Error ? error.message : String(error), "messageOf");
|
|
897
|
-
var bytesOf = /* @__PURE__ */ __name((path) => statSync2(path, { throwIfNoEntry: false })?.size ?? 0, "bytesOf");
|
|
898
|
-
var damagedTables = /* @__PURE__ */ __name((database, lines) => {
|
|
899
|
-
const roots = new Map(database.prepare("SELECT rootpage, tbl_name FROM sqlite_master WHERE rootpage > 0").all().map((row) => [Number(row.rootpage), String(row.tbl_name)]));
|
|
900
|
-
const owners = new Map(database.prepare("SELECT name, tbl_name FROM sqlite_master WHERE type = 'index'").all().map((row) => [String(row.name), String(row.tbl_name)]));
|
|
901
|
-
const virtual = database.prepare("SELECT name FROM sqlite_master WHERE type = 'table' AND sql LIKE 'CREATE VIRTUAL TABLE%'").all().map((row) => String(row.name));
|
|
902
|
-
const ownerOf = /* @__PURE__ */ __name((table) => table === null ? null : virtual.find((name) => table.startsWith(`${name}_`)) ?? table, "ownerOf");
|
|
903
|
-
const tables = /* @__PURE__ */ new Map();
|
|
904
|
-
for (const raw of lines) {
|
|
905
|
-
const line = raw.replace(/^\*\*\* in database \w+ \*\*\*\s*/, "");
|
|
906
|
-
const tree = /^Tree (\d+) /.exec(line);
|
|
907
|
-
const column = /value in (\w+)\.\w+/.exec(line) ?? /^table (\w+): /.exec(line);
|
|
908
|
-
const index = /index (\w+)/.exec(line)?.[1];
|
|
909
|
-
const table = ownerOf(tree ? roots.get(Number(tree[1])) ?? null : column ? column[1] ?? null : index ? owners.get(index) ?? null : null);
|
|
910
|
-
const known = tables.get(table);
|
|
911
|
-
if (known)
|
|
912
|
-
known.problems += 1;
|
|
913
|
-
else
|
|
914
|
-
tables.set(table, { table, problems: 1, sample: line.slice(0, 200) });
|
|
915
|
-
}
|
|
916
|
-
return [...tables.values()].sort((a, b) => b.problems - a.problems);
|
|
917
|
-
}, "damagedTables");
|
|
918
|
-
var searchIndexHealth = /* @__PURE__ */ __name((database) => fts5Tables(database).map(({ name }) => {
|
|
919
|
-
try {
|
|
920
|
-
database.exec("BEGIN");
|
|
921
|
-
try {
|
|
922
|
-
database.exec(`INSERT INTO "${name}" ("${name}", rank) VALUES ('integrity-check', 0)`);
|
|
923
|
-
} finally {
|
|
924
|
-
database.exec("ROLLBACK");
|
|
925
|
-
}
|
|
926
|
-
return { name, ok: true };
|
|
927
|
-
} catch (error) {
|
|
928
|
-
return { name, ok: false, error: messageOf(error) };
|
|
929
|
-
}
|
|
930
|
-
}), "searchIndexHealth");
|
|
931
|
-
var pragmaLines = /* @__PURE__ */ __name((database, sql) => database.prepare(sql).all().flatMap((row) => String(Object.values(row)[0]).split("\n")), "pragmaLines");
|
|
932
|
-
var checkLines = /* @__PURE__ */ __name((database) => {
|
|
933
|
-
try {
|
|
934
|
-
return pragmaLines(database, `PRAGMA quick_check(${QUICK_CHECK_LIMIT})`);
|
|
935
|
-
} catch {
|
|
936
|
-
const tables = database.prepare("SELECT name FROM sqlite_master WHERE type = 'table' AND rootpage > 0 ORDER BY name").all().map((row) => String(row.name));
|
|
937
|
-
return tables.flatMap((table) => {
|
|
938
|
-
try {
|
|
939
|
-
return pragmaLines(database, `PRAGMA quick_check("${table}")`).filter((line) => line !== "ok");
|
|
940
|
-
} catch (error) {
|
|
941
|
-
return [`table ${table}: ${messageOf(error)}`];
|
|
942
|
-
}
|
|
943
|
-
});
|
|
944
|
-
}
|
|
945
|
-
}, "checkLines");
|
|
946
|
-
var quickHealth = /* @__PURE__ */ __name((database, path) => {
|
|
947
|
-
const pragma = /* @__PURE__ */ __name((name) => Number(Object.values(database.prepare(`PRAGMA ${name}`).get() ?? {})[0] ?? 0), "pragma");
|
|
948
|
-
const file = {
|
|
949
|
-
bytes: bytesOf(path),
|
|
950
|
-
pages: pragma("page_count"),
|
|
951
|
-
pageSize: pragma("page_size"),
|
|
952
|
-
freePages: pragma("freelist_count")
|
|
953
|
-
};
|
|
954
|
-
const schema = database.prepare("PRAGMA quick_check('sqlite_schema')").all().map((row) => String(Object.values(row)[0]));
|
|
955
|
-
const walFrames = existsSync(`${path}-wal`) && bytesOf(`${path}-wal`) > 0;
|
|
956
|
-
const sized = walFrames || file.bytes === file.pages * file.pageSize;
|
|
957
|
-
const problems = [
|
|
958
|
-
...schema.length === 1 && schema[0] === "ok" ? [] : schema,
|
|
959
|
-
...sized ? [] : [`the file holds ${file.bytes} bytes, its header says ${file.pages * file.pageSize}`]
|
|
960
|
-
];
|
|
961
|
-
return { file, problems };
|
|
962
|
-
}, "quickHealth");
|
|
963
|
-
var storeHealth = /* @__PURE__ */ __name(async (path, { deep = false } = {}) => {
|
|
964
|
-
const started = Date.now();
|
|
965
|
-
const checked = deep ? "deep" : "quick";
|
|
966
|
-
const done = /* @__PURE__ */ __name((health) => ({
|
|
967
|
-
path,
|
|
968
|
-
checked,
|
|
969
|
-
...health,
|
|
970
|
-
ms: Date.now() - started
|
|
971
|
-
}), "done");
|
|
972
|
-
let database;
|
|
973
|
-
try {
|
|
974
|
-
database = (await openSqlite(path, { readOnly: !deep })).database;
|
|
975
|
-
} catch (error) {
|
|
976
|
-
return done({ ok: false, error: messageOf(error) });
|
|
977
|
-
}
|
|
978
|
-
try {
|
|
979
|
-
const { file, problems } = quickHealth(database, path);
|
|
980
|
-
if (!deep) {
|
|
981
|
-
return done({
|
|
982
|
-
ok: problems.length === 0,
|
|
983
|
-
file,
|
|
984
|
-
...problems.length ? {
|
|
985
|
-
problems: problems.length,
|
|
986
|
-
damagedTables: [{ table: null, problems: problems.length, sample: problems[0] }]
|
|
987
|
-
} : {}
|
|
988
|
-
});
|
|
989
|
-
}
|
|
990
|
-
database.exec("PRAGMA busy_timeout = 30000");
|
|
991
|
-
const lines = checkLines(database);
|
|
992
|
-
const pagesOk = lines.length === 1 && lines[0] === "ok";
|
|
993
|
-
const indexes = searchIndexHealth(database);
|
|
994
|
-
const json = pagesOk ? invalidJson(database) : [];
|
|
995
|
-
return done({
|
|
996
|
-
ok: pagesOk && problems.length === 0 && indexes.every((index) => index.ok) && json.length === 0,
|
|
997
|
-
file,
|
|
998
|
-
problems: pagesOk ? 0 : lines.length,
|
|
999
|
-
damagedTables: pagesOk ? [] : damagedTables(database, lines),
|
|
1000
|
-
searchIndexes: indexes,
|
|
1001
|
-
invalidJson: json
|
|
1002
|
-
});
|
|
1003
|
-
} catch (error) {
|
|
1004
|
-
return done({ ok: false, error: messageOf(error) });
|
|
1005
|
-
} finally {
|
|
1006
|
-
database.close();
|
|
1007
|
-
}
|
|
1008
|
-
}, "storeHealth");
|
|
1009
|
-
|
|
1010
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.691.0_@wirecat+cli-base@0.109.0_commander@15.0.0_esbuild@0.28.2_typ_d368e4a5540cfb6719e97dbe530c5868/node_modules/@wirecat/cli-core/dist/store/project-transfer/preview.js
|
|
1010
|
+
// 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/project-transfer/preview.js
|
|
1011
1011
|
var previewProjectAnnotationSnapshot = /* @__PURE__ */ __name(async (options) => {
|
|
1012
1012
|
if (!options || typeof options !== "object" || Array.isArray(options))
|
|
1013
1013
|
throw new CliError("validation_error", "project preview options are required");
|
|
@@ -1022,18 +1022,18 @@ var previewProjectAnnotationSnapshot = /* @__PURE__ */ __name(async (options) =>
|
|
|
1022
1022
|
throw new CliError("validation_error", "project preview project is a project:<safe integer id> reference");
|
|
1023
1023
|
const budget = new SnapshotBudget(options.maxReadBytes ?? 4 * 1024 * 1024);
|
|
1024
1024
|
const target = options.target;
|
|
1025
|
-
const
|
|
1025
|
+
const project = options.project;
|
|
1026
1026
|
return damagedFile([target], async () => {
|
|
1027
1027
|
const context = await openStoreContext({ path: target, env: options.env, readOnly: true });
|
|
1028
1028
|
try {
|
|
1029
|
-
return previewAnnotationSnapshot(context.database, Number(
|
|
1029
|
+
return previewAnnotationSnapshot(context.database, Number(project.slice(8)), snapshot, options.bindings, budget);
|
|
1030
1030
|
} finally {
|
|
1031
1031
|
context.database.close();
|
|
1032
1032
|
}
|
|
1033
1033
|
});
|
|
1034
1034
|
}, "previewProjectAnnotationSnapshot");
|
|
1035
1035
|
|
|
1036
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
1036
|
+
// 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/project-transfer/snapshot.js
|
|
1037
1037
|
var snapshotProjectAnnotations = /* @__PURE__ */ __name(async (options) => {
|
|
1038
1038
|
if (!options || typeof options !== "object" || Array.isArray(options))
|
|
1039
1039
|
throw new CliError("validation_error", "snapshot options are required");
|