@wirecat/zoom-cli 0.67.0 → 0.69.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/dist/answer-entities.d.ts +18 -0
- package/dist/answer-entities.d.ts.map +1 -1
- package/dist/answer-entities.js +12 -0
- package/dist/answer-entities.js.map +1 -1
- package/dist/answer-policy.d.ts.map +1 -1
- package/dist/answer-policy.js +2 -1
- package/dist/answer-policy.js.map +1 -1
- package/dist/bin/zm.js +2 -2
- package/dist/bundle/{all-profiles-SEW2VL76.js → all-profiles-ZQWPCJEK.js} +12 -12
- package/dist/bundle/answer-policy-VBDYLUXI.js +104 -0
- package/dist/bundle/{anthropic-FSNASJML.js → anthropic-7FUQ2HYJ.js} +7 -7
- package/dist/bundle/{app-server-EVSRYJ3H.js → app-server-DNPE2EQB.js} +61 -58
- package/dist/bundle/{bun-DACL5SVO.js → bun-ZVQFCFCC.js} +2 -2
- package/dist/bundle/{bun-sqlite-HQ2KOXSI.js → bun-sqlite-EB2UMUPJ.js} +6 -6
- package/dist/bundle/{chunk-4ZR5DJ26.js → chunk-2SYWVIQJ.js} +3 -3
- package/dist/bundle/chunk-37B7A4RP.js +66 -0
- package/dist/bundle/{chunk-WHQ4ZCJI.js → chunk-3TPRYZUW.js} +214 -86
- package/dist/bundle/{chunk-L6CAUVMU.js → chunk-4APZQYCH.js} +5 -5
- package/dist/bundle/{chunk-ASCHAVNW.js → chunk-52DCABMU.js} +27 -27
- package/dist/bundle/{chunk-LM26DJOK.js → chunk-5GOE6PQK.js} +6 -6
- package/dist/bundle/{chunk-QX2MAT6I.js → chunk-5H6VTEEC.js} +3 -3
- package/dist/bundle/{chunk-V33VGWT3.js → chunk-5ZF6QVMC.js} +16 -6
- package/dist/bundle/{chunk-GP4NSYDU.js → chunk-5ZJXKASF.js} +254 -13
- package/dist/bundle/chunk-6AMMTXEA.js +12473 -0
- package/dist/bundle/{chunk-Q65SDEFN.js → chunk-6KMTQX3D.js} +2 -2
- package/dist/bundle/{chunk-TBRG2DPE.js → chunk-6N2D6JGX.js} +2 -2
- package/dist/bundle/{chunk-X67YD3QI.js → chunk-6TICX3MN.js} +2 -2
- package/dist/bundle/{chunk-4GCKDO2H.js → chunk-7AUP2WT3.js} +3 -3
- package/dist/bundle/{chunk-JVCHGI7W.js → chunk-B5D7NZI7.js} +1 -1
- package/dist/bundle/{chunk-AAZFLJSH.js → chunk-B6JMVB6R.js} +10 -10
- package/dist/bundle/{chunk-CRLBTNC4.js → chunk-BL36NSV5.js} +3 -3
- package/dist/bundle/{chunk-4UVT2QCO.js → chunk-BOAMDYLY.js} +4 -4
- package/dist/bundle/{chunk-VQTAU4DV.js → chunk-C6TEYKXV.js} +8 -8
- package/dist/bundle/{chunk-6AJDVJVZ.js → chunk-CKK6JOC4.js} +2 -2
- package/dist/bundle/{chunk-4U2555EQ.js → chunk-CUZHKYC2.js} +30 -28
- package/dist/bundle/{chunk-7LLUUXJB.js → chunk-DHD25JII.js} +1 -1
- package/dist/bundle/{chunk-RYKG6AEH.js → chunk-EPPSMCEV.js} +4 -2
- package/dist/bundle/chunk-F5DYBWH7.js +299 -0
- package/dist/bundle/{chunk-KIJLM5UL.js → chunk-FBLUKCIR.js} +1 -1
- package/dist/bundle/{chunk-WZ5XK74U.js → chunk-FEM2JQN2.js} +1 -1
- package/dist/bundle/{chunk-SSXCOUP3.js → chunk-G6IX2MD2.js} +500 -227
- package/dist/bundle/{chunk-OTMGAKUM.js → chunk-GR3QDHBU.js} +7 -7
- package/dist/bundle/{chunk-QEI55M2F.js → chunk-GXDOTUUO.js} +10 -10
- package/dist/bundle/chunk-H3MFBYTQ.js +261 -0
- package/dist/bundle/{chunk-DFUPETW7.js → chunk-HC56J5LB.js} +135 -76
- package/dist/bundle/{chunk-D6OXI2NV.js → chunk-HSI7YOYK.js} +229 -67
- package/dist/bundle/{chunk-FGTPREAZ.js → chunk-HW5QTRFF.js} +35 -35
- package/dist/bundle/{chunk-VNIBTNV4.js → chunk-IEC4E65G.js} +2 -2
- package/dist/bundle/{chunk-EUPZSR2G.js → chunk-IPBZKUC3.js} +4 -4
- package/dist/bundle/{chunk-EQ7XRRKV.js → chunk-JHFP3Z5S.js} +11 -11
- package/dist/bundle/{chunk-3GO3KME7.js → chunk-JX5JJZC3.js} +3 -3
- package/dist/bundle/{chunk-7HAIM7GV.js → chunk-JZ4YOAHA.js} +963 -622
- package/dist/bundle/{chunk-B3KWAULD.js → chunk-KAPJQGHE.js} +2 -2
- package/dist/bundle/{chunk-T6CZWSHF.js → chunk-KNE6VFHZ.js} +21 -21
- package/dist/bundle/{chunk-I7SOXH64.js → chunk-KX5MZVPX.js} +66 -39
- package/dist/bundle/chunk-L62EJDNZ.js +64 -0
- package/dist/bundle/{chunk-EPDRF66S.js → chunk-LDRQ5NAP.js} +22 -14
- package/dist/bundle/{chunk-7VU5UGRR.js → chunk-LEA4BGK7.js} +16 -16
- package/dist/bundle/{chunk-ZMPTO2WB.js → chunk-LQX74VKG.js} +1 -1
- package/dist/bundle/{chunk-LKJXTACE.js → chunk-MJMVIFSC.js} +7 -7
- package/dist/bundle/{chunk-KWRSC6O6.js → chunk-MNOVYS43.js} +18 -4
- package/dist/bundle/{chunk-M43MBWJX.js → chunk-MOTKS7XG.js} +20741 -14882
- package/dist/bundle/{chunk-MWEOVTIF.js → chunk-MSDCZ6GT.js} +4 -4
- package/dist/bundle/{chunk-SOZVC3SV.js → chunk-MVDPZRFE.js} +1 -1
- package/dist/bundle/{chunk-NTZDM5SJ.js → chunk-NRRI37NJ.js} +9 -9
- package/dist/bundle/{chunk-BKY4XVB4.js → chunk-O7L44JK2.js} +2632 -1870
- package/dist/bundle/{chunk-6IBM4Z3V.js → chunk-OE7EIP5L.js} +1 -1
- package/dist/bundle/{chunk-RAMPYIO2.js → chunk-OSBHEM2A.js} +11 -11
- package/dist/bundle/{chunk-KV4267S4.js → chunk-P3ASN72F.js} +1 -1
- package/dist/bundle/{chunk-DG4DWAU7.js → chunk-QLGG7S6F.js} +3 -3
- package/dist/bundle/{chunk-6UFWFKFH.js → chunk-QW5VPZEH.js} +2 -2
- package/dist/bundle/{chunk-C6UKW7JO.js → chunk-QXM7S3Y3.js} +6 -6
- package/dist/bundle/{chunk-ESFMHBHH.js → chunk-R2ULMWB4.js} +62 -53
- package/dist/bundle/{chunk-L6WUAGPN.js → chunk-R3JYPY3J.js} +3 -3
- package/dist/bundle/{chunk-2UW533HQ.js → chunk-RGJ7OWHU.js} +4 -4
- package/dist/bundle/{chunk-7K5TDTZY.js → chunk-RPQ3JOD3.js} +7 -7
- package/dist/bundle/{chunk-L643D4RJ.js → chunk-S2EAGDS7.js} +12 -12
- package/dist/bundle/{chunk-4KDZ22RA.js → chunk-SQT47CFW.js} +1 -1
- package/dist/bundle/{chunk-CLEZE65P.js → chunk-SZ3Z4ZNO.js} +1 -1
- package/dist/bundle/chunk-T5X4LGXE.js +380 -0
- package/dist/bundle/{chunk-SMVO5R3T.js → chunk-TFFEFEG2.js} +39 -26
- package/dist/bundle/{chunk-LFQ73UFK.js → chunk-TKXLWFM2.js} +3 -3
- package/dist/bundle/{chunk-SCFFCIIP.js → chunk-TN77LX6W.js} +2 -2
- package/dist/bundle/{chunk-VFIEYRYD.js → chunk-TWIC6JJG.js} +8 -8
- package/dist/bundle/{chunk-FXQPK742.js → chunk-UEZ6URJR.js} +29 -15
- package/dist/bundle/{chunk-OZEYFJX2.js → chunk-V4MM6GST.js} +1 -1
- package/dist/bundle/chunk-V74QFMSL.js +31 -0
- package/dist/bundle/{chunk-YPF6OS37.js → chunk-VW6BF6M7.js} +1 -1
- package/dist/bundle/{chunk-6TZF2JP7.js → chunk-WY4NYPPS.js} +13 -13
- package/dist/bundle/{chunk-B5Z4XPVS.js → chunk-XITUFTON.js} +2 -2
- package/dist/bundle/{chunk-FWU3ZYHE.js → chunk-XJBYGMZ4.js} +776 -134
- package/dist/bundle/{chunk-KANH7GBB.js → chunk-XRZDYWF6.js} +2 -2
- package/dist/bundle/{chunk-ZRMZBMOF.js → chunk-Z6TTGTMU.js} +156 -9
- package/dist/bundle/{chunk-IFDO3YPJ.js → chunk-ZRHMB3LQ.js} +1 -1
- package/dist/bundle/{cli-YUATSOLA.js → cli-P3BZUE6S.js} +106 -64
- package/dist/bundle/command-contract-TOLB32NJ.js +41 -0
- package/dist/bundle/config-4KLLIADY.js +90 -0
- package/dist/bundle/{decode-IL44LNC3.js → decode-QWOQXM7M.js} +6 -6
- package/dist/bundle/{dispatch-3BGIXSJR.js → dispatch-5MGDLOK4.js} +9 -9
- package/dist/bundle/{dist-3W27UQ2S.js → dist-OUE4MF37.js} +108 -28
- package/dist/bundle/{echarts-CO4D26JF.js → echarts-65IMPY43.js} +2 -2
- package/dist/bundle/{embed-XH2X4DFM.js → embed-4IULBCKL.js} +7 -7
- package/dist/bundle/{embedder-WTFWDXBJ.js → embedder-JW4W6IZI.js} +10 -10
- package/dist/bundle/{failure-HTIS3NLS.js → failure-CR64C4XA.js} +3 -3
- package/dist/bundle/{first-run-5RBH7FDO.js → first-run-CH6C674R.js} +12 -12
- package/dist/bundle/first-screen-OCAW5ZN6.js +39 -0
- package/dist/bundle/{folders-F4DNQPIY.js → folders-VU4IN35Y.js} +5 -5
- package/dist/bundle/{instructions-EPPBL6TT.js → instructions-G5QIH2TM.js} +1 -1
- package/dist/bundle/{main-LVQTCDZS.js → main-O4ZJIEWP.js} +21 -23
- package/dist/bundle/{mcp-PPVOM4SE.js → mcp-M4QN2E7R.js} +2 -2
- package/dist/bundle/{meetings-BMELXRTR.js → meetings-77CCAVYD.js} +13 -7
- package/dist/bundle/{node-CQVMWVIG.js → node-E6VQHU4Y.js} +2 -2
- package/dist/bundle/{node-sqlite-QQEX7LZT.js → node-sqlite-RJZ4PGLD.js} +7 -7
- package/dist/bundle/{oauth-AYGX7CQS.js → oauth-F4JKNRW4.js} +8 -8
- package/dist/bundle/{open-MIL2TOT6.js → open-NYOGMIAA.js} +6 -6
- package/dist/bundle/openai-5U6EQTFQ.js +25 -0
- package/dist/bundle/{output-file-4XADZPYH.js → output-file-6COFGPUL.js} +6 -6
- package/dist/bundle/{process-NJVQK6GB.js → process-OBWUKBMX.js} +1 -1
- package/dist/bundle/{program-WUYRS6H7.js → program-MU7DEJTO.js} +115 -187
- package/dist/bundle/{prompt-J4QPFLEA.js → prompt-2QWQTHWT.js} +6 -6
- package/dist/bundle/{recognize-OLJZVNWW.js → recognize-SNUNTUC3.js} +5 -5
- package/dist/bundle/{remote-JPUXNYLV.js → remote-2CTCIQGF.js} +8 -8
- package/dist/bundle/{rerank-XVV3X5TT.js → rerank-XDA7NJNH.js} +8 -8
- package/dist/bundle/{run-log-DJXBEVS5.js → run-log-NSG3DJVX.js} +59 -59
- package/dist/bundle/{serve-NYYUO3MR.js → serve-TWQFHOV2.js} +10 -10
- package/dist/bundle/{server-4Z5E4YTT.js → server-RIQ6HMH2.js} +47 -47
- package/dist/bundle/server-XO6XQQTJ.js +72 -0
- package/dist/bundle/{services-EKWM76HP.js → services-NKZQJQIV.js} +49 -33
- package/dist/bundle/{speech-WFJ44ACJ.js → speech-ZOB76SXA.js} +14 -14
- package/dist/bundle/{state-VIRCT4VW.js → state-7YYEIXQ5.js} +7 -7
- package/dist/bundle/{store-ZTDZ6UY5.js → store-E6RTSSNR.js} +29 -18
- package/dist/bundle/{store-2Q4GEZJS.js → store-OX4HRBLO.js} +80 -29
- package/dist/bundle/store-connection-55QPNUDS.js +83 -0
- package/dist/bundle/store-maintenance-command-Q5MSU6OK.js +62 -0
- package/dist/bundle/{streaming-7BPKIGAS.js → streaming-O53PIORL.js} +7 -7
- package/dist/bundle/{tokens-CQHMMKNX.js → tokens-QKNEP2GJ.js} +7 -7
- package/dist/bundle/zm.js +9 -10
- package/dist/bundle/zoom-app-TSI2MGVK.js +41 -0
- package/dist/commands.d.ts.map +1 -1
- package/dist/commands.js +1 -0
- package/dist/commands.js.map +1 -1
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +2 -3
- package/dist/config.js.map +1 -1
- package/dist/identity.d.ts +1 -0
- package/dist/identity.d.ts.map +1 -1
- package/dist/identity.js +11 -0
- package/dist/identity.js.map +1 -1
- package/dist/program-bindings.d.ts.map +1 -1
- package/dist/program-bindings.js +7 -2
- package/dist/program-bindings.js.map +1 -1
- package/dist/setup-commands.d.ts +6 -0
- package/dist/setup-commands.d.ts.map +1 -1
- package/dist/setup-commands.js +24 -9
- package/dist/setup-commands.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/dist/zoom-app.d.ts +32 -0
- package/dist/zoom-app.d.ts.map +1 -1
- package/dist/zoom-app.js +61 -0
- package/dist/zoom-app.js.map +1 -1
- package/package.json +3 -3
- package/dist/bundle/answer-policy-5OYUL6UF.js +0 -103
- package/dist/bundle/chunk-3ZIHUSMM.js +0 -22
- package/dist/bundle/chunk-54RTMQL6.js +0 -132
- package/dist/bundle/chunk-6VFORXL3.js +0 -101
- package/dist/bundle/chunk-D4KBD63W.js +0 -19
- package/dist/bundle/chunk-J3ZBEWQY.js +0 -880
- package/dist/bundle/chunk-SXFODCYK.js +0 -9
- package/dist/bundle/chunk-YRNZT4GQ.js +0 -176
- package/dist/bundle/chunk-Z3WXI4DK.js +0 -31
- package/dist/bundle/command-contract-UWHY55UE.js +0 -41
- package/dist/bundle/config-TGF6E6ZD.js +0 -89
- package/dist/bundle/first-screen-PGFIXJAX.js +0 -39
- package/dist/bundle/openai-7QZZXQW5.js +0 -25
- package/dist/bundle/server-VW5UVCH7.js +0 -72
- package/dist/bundle/store-connection-FKVVQLEF.js +0 -83
- package/dist/bundle/store-maintenance-command-AU73UVUQ.js +0 -62
- package/dist/bundle/zoom-app-OEKFMJS6.js +0 -25
- /package/dist/bundle/{chunk-LU3WKZBA.js → chunk-VOXIGICJ.js} +0 -0
|
@@ -1,10 +1,5 @@
|
|
|
1
1
|
import { createRequire as __bundleRequire } from "node:module";
|
|
2
2
|
const require = __bundleRequire(import.meta.url);
|
|
3
|
-
import {
|
|
4
|
-
organization,
|
|
5
|
-
project,
|
|
6
|
-
reminder
|
|
7
|
-
} from "./chunk-54RTMQL6.js";
|
|
8
3
|
import {
|
|
9
4
|
MIGRATIONS,
|
|
10
5
|
SnapshotBudget,
|
|
@@ -28,31 +23,79 @@ import {
|
|
|
28
23
|
tagMemberIds,
|
|
29
24
|
thingOf,
|
|
30
25
|
write
|
|
31
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-MOTKS7XG.js";
|
|
32
27
|
import {
|
|
33
28
|
fold
|
|
34
|
-
} from "./chunk-
|
|
29
|
+
} from "./chunk-TWIC6JJG.js";
|
|
35
30
|
import {
|
|
31
|
+
ADDED_PROVIDER,
|
|
36
32
|
filesAccountSql,
|
|
37
33
|
folderProviderOf,
|
|
38
34
|
folderProviderSql,
|
|
39
35
|
isDocumentAccountProvider
|
|
40
|
-
} from "./chunk-
|
|
36
|
+
} from "./chunk-6AMMTXEA.js";
|
|
41
37
|
import {
|
|
42
|
-
|
|
43
|
-
} from "./chunk-
|
|
38
|
+
damagedFile
|
|
39
|
+
} from "./chunk-37B7A4RP.js";
|
|
44
40
|
import {
|
|
45
41
|
CliError
|
|
46
|
-
} from "./chunk-
|
|
42
|
+
} from "./chunk-FEM2JQN2.js";
|
|
47
43
|
import {
|
|
48
44
|
__name
|
|
49
45
|
} from "./chunk-ZVVMGPBJ.js";
|
|
50
46
|
|
|
51
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
47
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_3e7ac84c094d466aed903c683c124ab5/node_modules/@wirecat/cli-core/dist/store/damage.js
|
|
48
|
+
var DERIVED = /* @__PURE__ */ new Set(["mentions", "involvements", "embeddings"]);
|
|
49
|
+
var named = /* @__PURE__ */ __name((tables) => tables.length <= 5 ? tables.join(", ") : `${tables.slice(0, 5).join(", ")} and ${tables.length - 5} more`, "named");
|
|
50
|
+
var isDerivedTable = /* @__PURE__ */ __name((table, searchIndexes) => DERIVED.has(table) || table.startsWith("vector_index_") || searchIndexes.some((index) => table === index || table.startsWith(`${index}_`)), "isDerivedTable");
|
|
51
|
+
var WIRECAT_UNITS = ["memo-*", "mail-*", "tg-*", "max-*", "wirecat-*"];
|
|
52
|
+
var seen = /* @__PURE__ */ __name((mark) => `\`${mark.command}\` found the store damaged at ${mark.at} (${mark.error})`, "seen");
|
|
53
|
+
var explainDamage = /* @__PURE__ */ __name((health, command, mark = null) => {
|
|
54
|
+
if (health.ok && !mark)
|
|
55
|
+
return null;
|
|
56
|
+
const indexNames = (health.searchIndexes ?? []).map((index) => index.name);
|
|
57
|
+
const badIndexes = (health.searchIndexes ?? []).filter((index) => !index.ok).map((index) => index.name);
|
|
58
|
+
const tables = (health.damagedTables ?? []).map((one) => one.table).filter((table) => table !== null);
|
|
59
|
+
const sources = tables.filter((table) => !isDerivedTable(table, indexNames));
|
|
60
|
+
const derived = [.../* @__PURE__ */ new Set([...tables.filter((table) => isDerivedTable(table, indexNames)), ...badIndexes])];
|
|
61
|
+
const unopened = health.error !== void 0;
|
|
62
|
+
const json = (health.invalidJson ?? []).map(({ table, column }) => `${table}.${column}`);
|
|
63
|
+
const checked = health.ok ? `${seen(mark)}; the quick check reads too little to see it, and a deep check that passes clears it` : unopened ? `the store file cannot be opened: ${health.error}` : health.checked === "quick" ? "the store file's header or schema is damaged" : `the store file is damaged: ${health.problems ?? 0} problems` + (sources.length ? ` in the data of ${named(sources)}` : "") + (derived.length ? `${sources.length ? ", and" : " in"} the search data of ${named(derived)}` : "") + (json.length ? `; values that are not valid JSON in ${named(json)}` : "");
|
|
64
|
+
const what = mark && !health.ok ? `${checked}; ${seen(mark)}` : checked;
|
|
65
|
+
const impact = [
|
|
66
|
+
...sources.length ? [`some rows of ${named(sources)} cannot be read; a recovery keeps every row it can read and names the rest`] : [],
|
|
67
|
+
...derived.length ? [`searches may miss results or fail; ${named(derived)} hold nothing that is not elsewhere, and are rebuilt`] : [],
|
|
68
|
+
...json.length ? [`a read of a row with a broken JSON value fails ("malformed JSON"); a recovery clears those values`] : [],
|
|
69
|
+
mark ? "reads that do not touch a damaged page work; every command that writes the store refuses until it is recovered" : "reads that do not touch a damaged page work; a write that touches one fails until the store is recovered"
|
|
70
|
+
];
|
|
71
|
+
return {
|
|
72
|
+
what,
|
|
73
|
+
causes: [
|
|
74
|
+
"the computer lost power or crashed, or the disk filled up, while a tool was writing",
|
|
75
|
+
"the file was copied, restored or synced while a tool had it open, or it sits in a synced or network folder",
|
|
76
|
+
"a fault of the disk itself"
|
|
77
|
+
],
|
|
78
|
+
investigate: [
|
|
79
|
+
`journalctl --user ${WIRECAT_UNITS.map((unit) => `-u '${unit}'`).join(" ")} --since -14d | grep -i -e malformed -e corrupt -e 'disk full'`,
|
|
80
|
+
"journalctl -k --since -14d | grep -i -e 'I/O error' -e nvme -e ata",
|
|
81
|
+
`df -h ${health.path.replace(/\/[^/]*$/, "")}`,
|
|
82
|
+
...health.checked === "quick" || health.ok ? [`${command} store recover`] : []
|
|
83
|
+
],
|
|
84
|
+
impact,
|
|
85
|
+
externalUnaffected: "only this computer's copy is damaged: Telegram, MAX, the mail servers and Google Drive keep their own data, so whatever is lost here can be fetched again by a sync",
|
|
86
|
+
steps: [
|
|
87
|
+
"stop every timer and server of the WireCat tools; `store recover run` lists the ones still running",
|
|
88
|
+
`${command} store recover run`,
|
|
89
|
+
"run the fetch commands it prints, then start the timers again"
|
|
90
|
+
]
|
|
91
|
+
};
|
|
92
|
+
}, "explainDamage");
|
|
93
|
+
|
|
94
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_3e7ac84c094d466aed903c683c124ab5/node_modules/@wirecat/cli-core/dist/store/document-transfer/index.js
|
|
52
95
|
import { realpathSync, statSync } from "node:fs";
|
|
53
96
|
import { resolve } from "node:path";
|
|
54
97
|
|
|
55
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
98
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_3e7ac84c094d466aed903c683c124ab5/node_modules/@wirecat/cli-core/dist/store/sqlite/document-transfer/people.js
|
|
56
99
|
var planPeople = /* @__PURE__ */ __name((database, snapshot, mappings, bindings, conflicts) => {
|
|
57
100
|
const creatable = /* @__PURE__ */ new Set();
|
|
58
101
|
let people = 0, identities = 0;
|
|
@@ -115,11 +158,11 @@ var copyPeople = /* @__PURE__ */ __name((database, snapshot, mappings, now) => {
|
|
|
115
158
|
}
|
|
116
159
|
}, "copyPeople");
|
|
117
160
|
|
|
118
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
161
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_3e7ac84c094d466aed903c683c124ab5/node_modules/@wirecat/cli-core/dist/store/document-transfer/digest.js
|
|
119
162
|
import { createHash } from "node:crypto";
|
|
120
163
|
var digest = /* @__PURE__ */ __name((value) => createHash("sha256").update(JSON.stringify(value)).digest("hex"), "digest");
|
|
121
164
|
|
|
122
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
165
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_3e7ac84c094d466aed903c683c124ab5/node_modules/@wirecat/cli-core/dist/store/sqlite/document-transfer/collection.js
|
|
123
166
|
var documentsKeyOf = /* @__PURE__ */ __name((collection) => {
|
|
124
167
|
const colon = collection.indexOf(":");
|
|
125
168
|
const provider = collection.slice(0, colon);
|
|
@@ -163,7 +206,7 @@ var currentCollection = /* @__PURE__ */ __name((row) => {
|
|
|
163
206
|
};
|
|
164
207
|
}, "currentCollection");
|
|
165
208
|
|
|
166
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
209
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_3e7ac84c094d466aed903c683c124ab5/node_modules/@wirecat/cli-core/dist/store/sqlite/document-transfer/plan.js
|
|
167
210
|
var planTransfer = /* @__PURE__ */ __name((database, snapshot, sourceKey, bindings) => {
|
|
168
211
|
const mappings = /* @__PURE__ */ new Map();
|
|
169
212
|
const missing = /* @__PURE__ */ new Set(), conflicts = /* @__PURE__ */ new Set();
|
|
@@ -272,9 +315,9 @@ var planTransfer = /* @__PURE__ */ __name((database, snapshot, sourceKey, bindin
|
|
|
272
315
|
}
|
|
273
316
|
for (const alias of snapshot.aliases) {
|
|
274
317
|
const sourceTag = snapshot.taggings.find((tagging) => tagging.tag_id === alias.aliasable_id);
|
|
275
|
-
const
|
|
318
|
+
const named2 = canonicalTagNamed(database, String(alias.name));
|
|
276
319
|
const targetTag = sourceTag && canonicalTagNamed(database, String(sourceTag.tag_name));
|
|
277
|
-
if (
|
|
320
|
+
if (named2 && named2.id !== targetTag?.id)
|
|
278
321
|
conflicts.add(`destination alias conflicts with source tag ${String(alias.aliasable_id)}`);
|
|
279
322
|
if (targetTag && alias.display === 1) {
|
|
280
323
|
const displayed = database.prepare("SELECT name_folded FROM aliases WHERE aliasable_type='tag' AND aliasable_id=? AND account_id IS NULL AND display=1").get(targetTag.id);
|
|
@@ -330,7 +373,7 @@ var planTransfer = /* @__PURE__ */ __name((database, snapshot, sourceKey, bindin
|
|
|
330
373
|
};
|
|
331
374
|
}, "planTransfer");
|
|
332
375
|
|
|
333
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
376
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_3e7ac84c094d466aed903c683c124ab5/node_modules/@wirecat/cli-core/dist/store/sqlite/document-transfer/snapshot.js
|
|
334
377
|
var TRANSFER_TABLES = { document: "documents", note: "notes", memory: "memories", fact: "facts" };
|
|
335
378
|
var MAX_ENTITIES = 1e3;
|
|
336
379
|
var MAX_AUXILIARY = 1e4;
|
|
@@ -472,7 +515,7 @@ var transferSnapshot = /* @__PURE__ */ __name((database, collection) => read(dat
|
|
|
472
515
|
item.bot = { name: String(bot.name), kind: String(bot.kind) };
|
|
473
516
|
}
|
|
474
517
|
if (thing.type === "document") {
|
|
475
|
-
const doc = database.prepare(`SELECT a.provider,a.external_id AS account,a.name,d.external_id,d.body,d.content_hash,d.deleted_at FROM documents d JOIN accounts a ON a.id=d.account_id WHERE d.id=? AND ${filesAccountSql("a.provider")}`).get(thing.id);
|
|
518
|
+
const doc = database.prepare(`SELECT a.provider,a.external_id AS account,a.name,d.external_id,d.body,d.content_hash,d.deleted_at FROM documents d JOIN accounts a ON a.id=d.account_id WHERE d.id=? AND ${filesAccountSql("a.provider")} AND a.provider<>'${ADDED_PROVIDER}'`).get(thing.id);
|
|
476
519
|
if (doc) {
|
|
477
520
|
item.collection = collectionNameOf({ provider: doc.provider, external_id: doc.account, name: doc.name });
|
|
478
521
|
item.external_id = String(doc.external_id);
|
|
@@ -492,7 +535,7 @@ var transferSnapshot = /* @__PURE__ */ __name((database, collection) => read(dat
|
|
|
492
535
|
};
|
|
493
536
|
}), "transferSnapshot");
|
|
494
537
|
|
|
495
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
538
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_3e7ac84c094d466aed903c683c124ab5/node_modules/@wirecat/cli-core/dist/store/sqlite/document-transfer/apply.js
|
|
496
539
|
var providerHere = /* @__PURE__ */ __name(({ provider, name, settings }) => {
|
|
497
540
|
if (provider !== "folder" || String(name ?? "").startsWith("google-drive:"))
|
|
498
541
|
return provider ?? null;
|
|
@@ -664,7 +707,7 @@ var remapEntity = /* @__PURE__ */ __name((database, entity, id, mappings) => {
|
|
|
664
707
|
database.prepare(`UPDATE ${TRANSFER_TABLES[entity.kind]} SET ${columns.join(",")} WHERE id=?`).run(...values, id);
|
|
665
708
|
}, "remapEntity");
|
|
666
709
|
|
|
667
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
710
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_3e7ac84c094d466aed903c683c124ab5/node_modules/@wirecat/cli-core/dist/store/document-transfer/index.js
|
|
668
711
|
var locations = /* @__PURE__ */ __name((options) => {
|
|
669
712
|
for (const value of [options.source, options.destination, options.collection])
|
|
670
713
|
if (typeof value !== "string" || !value.trim())
|
|
@@ -717,6 +760,9 @@ var openPreviewTarget = /* @__PURE__ */ __name(async (path) => {
|
|
|
717
760
|
}, "openPreviewTarget");
|
|
718
761
|
var previewDocumentTransfer = /* @__PURE__ */ __name(async (options) => {
|
|
719
762
|
const location = locations(options);
|
|
763
|
+
return damagedFile([location.source, location.destination], () => previewWith(location, options));
|
|
764
|
+
}, "previewDocumentTransfer");
|
|
765
|
+
var previewWith = /* @__PURE__ */ __name(async (location, options) => {
|
|
720
766
|
const source = await openSource(location.source);
|
|
721
767
|
try {
|
|
722
768
|
const target = await openPreviewTarget(location.destination);
|
|
@@ -728,11 +774,14 @@ var previewDocumentTransfer = /* @__PURE__ */ __name(async (options) => {
|
|
|
728
774
|
} finally {
|
|
729
775
|
source.database.close();
|
|
730
776
|
}
|
|
731
|
-
}, "
|
|
777
|
+
}, "previewWith");
|
|
732
778
|
var applyDocumentTransfer = /* @__PURE__ */ __name(async (options) => {
|
|
733
779
|
if (!/^[a-f0-9]{64}$/.test(options.expected_fingerprint))
|
|
734
780
|
throw new CliError("validation_error", "apply requires the fingerprint returned by a transfer preview");
|
|
735
781
|
const location = locations(options);
|
|
782
|
+
return damagedFile([location.source, location.destination], () => applyWith(location, options));
|
|
783
|
+
}, "applyDocumentTransfer");
|
|
784
|
+
var applyWith = /* @__PURE__ */ __name(async (location, options) => {
|
|
736
785
|
const source = await openSource(location.source);
|
|
737
786
|
try {
|
|
738
787
|
const snapshot = transferSnapshot(source.database, options.collection);
|
|
@@ -758,44 +807,151 @@ var applyDocumentTransfer = /* @__PURE__ */ __name(async (options) => {
|
|
|
758
807
|
} finally {
|
|
759
808
|
source.database.close();
|
|
760
809
|
}
|
|
761
|
-
}, "
|
|
810
|
+
}, "applyWith");
|
|
762
811
|
|
|
763
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
812
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_3e7ac84c094d466aed903c683c124ab5/node_modules/@wirecat/cli-core/dist/store/health.js
|
|
813
|
+
import { existsSync, statSync as statSync2 } from "node:fs";
|
|
814
|
+
var JSON_COLUMNS = {
|
|
815
|
+
accounts: ["settings"],
|
|
816
|
+
account_identities: ["mail_signals"],
|
|
817
|
+
bot_updates: ["payload"],
|
|
818
|
+
documents: ["front_matter"],
|
|
819
|
+
emails: ["headers"],
|
|
820
|
+
meeting_participants: ["sessions"],
|
|
821
|
+
messages: ["mentions", "reply_to"],
|
|
822
|
+
proposed_actions: ["payload", "result"],
|
|
823
|
+
searches: ["params"],
|
|
824
|
+
tag_consolidations: ["source_member_ids", "survivor_member_ids"],
|
|
825
|
+
task_events: ["changes"]
|
|
771
826
|
};
|
|
772
|
-
var
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
827
|
+
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
|
|
828
|
+
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");
|
|
829
|
+
var invalidJson = /* @__PURE__ */ __name((database) => jsonColumns(database).map((one) => ({
|
|
830
|
+
...one,
|
|
831
|
+
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)
|
|
832
|
+
})).filter(({ rows }) => rows > 0), "invalidJson");
|
|
833
|
+
var QUICK_CHECK_LIMIT = 1e4;
|
|
834
|
+
var QUICK_HEALTH_CHECKS = "the file header, its size against its page count, and the schema's own pages";
|
|
835
|
+
var FTS5 = /^\s*CREATE\s+VIRTUAL\s+TABLE\s+\S+\s+USING\s+fts5\s*\(/i;
|
|
836
|
+
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) => {
|
|
837
|
+
const sql = String(row.sql);
|
|
838
|
+
return { name: String(row.name), sql, external: /content\s*=\s*'[^']+'/i.test(sql) };
|
|
839
|
+
}), "fts5Tables");
|
|
840
|
+
var messageOf = /* @__PURE__ */ __name((error) => error instanceof Error ? error.message : String(error), "messageOf");
|
|
841
|
+
var bytesOf = /* @__PURE__ */ __name((path) => statSync2(path, { throwIfNoEntry: false })?.size ?? 0, "bytesOf");
|
|
842
|
+
var damagedTables = /* @__PURE__ */ __name((database, lines) => {
|
|
843
|
+
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)]));
|
|
844
|
+
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)]));
|
|
845
|
+
const virtual = database.prepare("SELECT name FROM sqlite_master WHERE type = 'table' AND sql LIKE 'CREATE VIRTUAL TABLE%'").all().map((row) => String(row.name));
|
|
846
|
+
const ownerOf = /* @__PURE__ */ __name((table) => table === null ? null : virtual.find((name) => table.startsWith(`${name}_`)) ?? table, "ownerOf");
|
|
847
|
+
const tables = /* @__PURE__ */ new Map();
|
|
848
|
+
for (const raw of lines) {
|
|
849
|
+
const line = raw.replace(/^\*\*\* in database \w+ \*\*\*\s*/, "");
|
|
850
|
+
const tree = /^Tree (\d+) /.exec(line);
|
|
851
|
+
const column = /value in (\w+)\.\w+/.exec(line) ?? /^table (\w+): /.exec(line);
|
|
852
|
+
const index = /index (\w+)/.exec(line)?.[1];
|
|
853
|
+
const table = ownerOf(tree ? roots.get(Number(tree[1])) ?? null : column ? column[1] ?? null : index ? owners.get(index) ?? null : null);
|
|
854
|
+
const known = tables.get(table);
|
|
855
|
+
if (known)
|
|
856
|
+
known.problems += 1;
|
|
857
|
+
else
|
|
858
|
+
tables.set(table, { table, problems: 1, sample: line.slice(0, 200) });
|
|
859
|
+
}
|
|
860
|
+
return [...tables.values()].sort((a, b) => b.problems - a.problems);
|
|
861
|
+
}, "damagedTables");
|
|
862
|
+
var searchIndexHealth = /* @__PURE__ */ __name((database) => fts5Tables(database).map(({ name }) => {
|
|
863
|
+
try {
|
|
864
|
+
database.exec("BEGIN");
|
|
865
|
+
try {
|
|
866
|
+
database.exec(`INSERT INTO "${name}" ("${name}", rank) VALUES ('integrity-check', 0)`);
|
|
867
|
+
} finally {
|
|
868
|
+
database.exec("ROLLBACK");
|
|
786
869
|
}
|
|
787
|
-
|
|
788
|
-
}
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
}
|
|
870
|
+
return { name, ok: true };
|
|
871
|
+
} catch (error) {
|
|
872
|
+
return { name, ok: false, error: messageOf(error) };
|
|
873
|
+
}
|
|
874
|
+
}), "searchIndexHealth");
|
|
875
|
+
var pragmaLines = /* @__PURE__ */ __name((database, sql) => database.prepare(sql).all().flatMap((row) => String(Object.values(row)[0]).split("\n")), "pragmaLines");
|
|
876
|
+
var checkLines = /* @__PURE__ */ __name((database) => {
|
|
877
|
+
try {
|
|
878
|
+
return pragmaLines(database, `PRAGMA quick_check(${QUICK_CHECK_LIMIT})`);
|
|
879
|
+
} catch {
|
|
880
|
+
const tables = database.prepare("SELECT name FROM sqlite_master WHERE type = 'table' AND rootpage > 0 ORDER BY name").all().map((row) => String(row.name));
|
|
881
|
+
return tables.flatMap((table) => {
|
|
882
|
+
try {
|
|
883
|
+
return pragmaLines(database, `PRAGMA quick_check("${table}")`).filter((line) => line !== "ok");
|
|
884
|
+
} catch (error) {
|
|
885
|
+
return [`table ${table}: ${messageOf(error)}`];
|
|
886
|
+
}
|
|
887
|
+
});
|
|
888
|
+
}
|
|
889
|
+
}, "checkLines");
|
|
890
|
+
var quickHealth = /* @__PURE__ */ __name((database, path) => {
|
|
891
|
+
const pragma = /* @__PURE__ */ __name((name) => Number(Object.values(database.prepare(`PRAGMA ${name}`).get() ?? {})[0] ?? 0), "pragma");
|
|
892
|
+
const file = {
|
|
893
|
+
bytes: bytesOf(path),
|
|
894
|
+
pages: pragma("page_count"),
|
|
895
|
+
pageSize: pragma("page_size"),
|
|
896
|
+
freePages: pragma("freelist_count")
|
|
897
|
+
};
|
|
898
|
+
const schema = database.prepare("PRAGMA quick_check('sqlite_schema')").all().map((row) => String(Object.values(row)[0]));
|
|
899
|
+
const walFrames = existsSync(`${path}-wal`) && bytesOf(`${path}-wal`) > 0;
|
|
900
|
+
const sized = walFrames || file.bytes === file.pages * file.pageSize;
|
|
901
|
+
const problems = [
|
|
902
|
+
...schema.length === 1 && schema[0] === "ok" ? [] : schema,
|
|
903
|
+
...sized ? [] : [`the file holds ${file.bytes} bytes, its header says ${file.pages * file.pageSize}`]
|
|
904
|
+
];
|
|
905
|
+
return { file, problems };
|
|
906
|
+
}, "quickHealth");
|
|
907
|
+
var storeHealth = /* @__PURE__ */ __name(async (path, { deep = false } = {}) => {
|
|
908
|
+
const started = Date.now();
|
|
909
|
+
const checked = deep ? "deep" : "quick";
|
|
910
|
+
const done = /* @__PURE__ */ __name((health) => ({
|
|
911
|
+
path,
|
|
912
|
+
checked,
|
|
913
|
+
...health,
|
|
914
|
+
ms: Date.now() - started
|
|
915
|
+
}), "done");
|
|
916
|
+
let database;
|
|
917
|
+
try {
|
|
918
|
+
database = (await openSqlite(path, { readOnly: !deep })).database;
|
|
919
|
+
} catch (error) {
|
|
920
|
+
return done({ ok: false, error: messageOf(error) });
|
|
921
|
+
}
|
|
922
|
+
try {
|
|
923
|
+
const { file, problems } = quickHealth(database, path);
|
|
924
|
+
if (!deep) {
|
|
925
|
+
return done({
|
|
926
|
+
ok: problems.length === 0,
|
|
927
|
+
file,
|
|
928
|
+
...problems.length ? {
|
|
929
|
+
problems: problems.length,
|
|
930
|
+
damagedTables: [{ table: null, problems: problems.length, sample: problems[0] }]
|
|
931
|
+
} : {}
|
|
932
|
+
});
|
|
933
|
+
}
|
|
934
|
+
database.exec("PRAGMA busy_timeout = 30000");
|
|
935
|
+
const lines = checkLines(database);
|
|
936
|
+
const pagesOk = lines.length === 1 && lines[0] === "ok";
|
|
937
|
+
const indexes = searchIndexHealth(database);
|
|
938
|
+
const json = pagesOk ? invalidJson(database) : [];
|
|
939
|
+
return done({
|
|
940
|
+
ok: pagesOk && problems.length === 0 && indexes.every((index) => index.ok) && json.length === 0,
|
|
941
|
+
file,
|
|
942
|
+
problems: pagesOk ? 0 : lines.length,
|
|
943
|
+
damagedTables: pagesOk ? [] : damagedTables(database, lines),
|
|
944
|
+
searchIndexes: indexes,
|
|
945
|
+
invalidJson: json
|
|
946
|
+
});
|
|
947
|
+
} catch (error) {
|
|
948
|
+
return done({ ok: false, error: messageOf(error) });
|
|
949
|
+
} finally {
|
|
950
|
+
database.close();
|
|
951
|
+
}
|
|
952
|
+
}, "storeHealth");
|
|
797
953
|
|
|
798
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
954
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_3e7ac84c094d466aed903c683c124ab5/node_modules/@wirecat/cli-core/dist/store/project-transfer/preview.js
|
|
799
955
|
var previewProjectAnnotationSnapshot = /* @__PURE__ */ __name(async (options) => {
|
|
800
956
|
if (!options || typeof options !== "object" || Array.isArray(options))
|
|
801
957
|
throw new CliError("validation_error", "project preview options are required");
|
|
@@ -809,15 +965,19 @@ var previewProjectAnnotationSnapshot = /* @__PURE__ */ __name(async (options) =>
|
|
|
809
965
|
if (typeof options.project !== "string" || !/^project:[1-9]\d*$/.test(options.project) || !Number.isSafeInteger(Number(options.project.slice(8))))
|
|
810
966
|
throw new CliError("validation_error", "project preview project is a project:<safe integer id> reference");
|
|
811
967
|
const budget = new SnapshotBudget(options.maxReadBytes ?? 4 * 1024 * 1024);
|
|
812
|
-
const
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
968
|
+
const target = options.target;
|
|
969
|
+
const project2 = options.project;
|
|
970
|
+
return damagedFile([target], async () => {
|
|
971
|
+
const context = await openStoreContext({ path: target, env: options.env, readOnly: true });
|
|
972
|
+
try {
|
|
973
|
+
return previewAnnotationSnapshot(context.database, Number(project2.slice(8)), snapshot, options.bindings, budget);
|
|
974
|
+
} finally {
|
|
975
|
+
context.database.close();
|
|
976
|
+
}
|
|
977
|
+
});
|
|
818
978
|
}, "previewProjectAnnotationSnapshot");
|
|
819
979
|
|
|
820
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
980
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_3e7ac84c094d466aed903c683c124ab5/node_modules/@wirecat/cli-core/dist/store/project-transfer/snapshot.js
|
|
821
981
|
var snapshotProjectAnnotations = /* @__PURE__ */ __name(async (options) => {
|
|
822
982
|
if (!options || typeof options !== "object" || Array.isArray(options))
|
|
823
983
|
throw new CliError("validation_error", "snapshot options are required");
|
|
@@ -839,11 +999,13 @@ var snapshotProjectAnnotations = /* @__PURE__ */ __name(async (options) => {
|
|
|
839
999
|
}, "snapshotProjectAnnotations");
|
|
840
1000
|
|
|
841
1001
|
export {
|
|
1002
|
+
explainDamage,
|
|
1003
|
+
invalidJson,
|
|
1004
|
+
QUICK_HEALTH_CHECKS,
|
|
1005
|
+
fts5Tables,
|
|
1006
|
+
storeHealth,
|
|
842
1007
|
previewDocumentTransfer,
|
|
843
1008
|
applyDocumentTransfer,
|
|
844
|
-
ORGANIZATIONS_QUERY,
|
|
845
|
-
PROJECTS_QUERY,
|
|
846
|
-
REMINDERS_QUERY,
|
|
847
1009
|
previewProjectAnnotationSnapshot,
|
|
848
1010
|
snapshotProjectAnnotations
|
|
849
1011
|
};
|
|
@@ -13,10 +13,10 @@ import {
|
|
|
13
13
|
registerPrompts,
|
|
14
14
|
stdinFieldOf,
|
|
15
15
|
syncsFirst
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-KX5MZVPX.js";
|
|
17
17
|
import {
|
|
18
18
|
answeredWire
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-SZ3Z4ZNO.js";
|
|
20
20
|
import {
|
|
21
21
|
BinaryResource,
|
|
22
22
|
Picture,
|
|
@@ -37,45 +37,45 @@ import {
|
|
|
37
37
|
tool,
|
|
38
38
|
toolKey,
|
|
39
39
|
toolsFromCommands
|
|
40
|
-
} from "./chunk-
|
|
40
|
+
} from "./chunk-3TPRYZUW.js";
|
|
41
41
|
import {
|
|
42
42
|
agentJson,
|
|
43
43
|
skillResource
|
|
44
|
-
} from "./chunk-
|
|
44
|
+
} from "./chunk-LEA4BGK7.js";
|
|
45
45
|
import {
|
|
46
46
|
StdioServerTransport,
|
|
47
47
|
callerOf,
|
|
48
48
|
callingAgent,
|
|
49
49
|
serveStdio
|
|
50
|
-
} from "./chunk-
|
|
50
|
+
} from "./chunk-XRZDYWF6.js";
|
|
51
51
|
import {
|
|
52
52
|
instructions
|
|
53
|
-
} from "./chunk-
|
|
53
|
+
} from "./chunk-ZRHMB3LQ.js";
|
|
54
54
|
import {
|
|
55
55
|
McpServer,
|
|
56
56
|
ResourceTemplate
|
|
57
57
|
} from "./chunk-5D4AEUVA.js";
|
|
58
58
|
import {
|
|
59
59
|
mcpHttpMarker
|
|
60
|
-
} from "./chunk-
|
|
60
|
+
} from "./chunk-MSDCZ6GT.js";
|
|
61
61
|
import {
|
|
62
62
|
connectedFor,
|
|
63
63
|
guardFor
|
|
64
|
-
} from "./chunk-
|
|
64
|
+
} from "./chunk-R2ULMWB4.js";
|
|
65
65
|
import {
|
|
66
66
|
lackedNeed,
|
|
67
67
|
wholeList
|
|
68
|
-
} from "./chunk-
|
|
68
|
+
} from "./chunk-TFFEFEG2.js";
|
|
69
69
|
import {
|
|
70
70
|
capability,
|
|
71
71
|
dateWindow,
|
|
72
72
|
imageSize,
|
|
73
73
|
servicesFor,
|
|
74
74
|
storedDeps
|
|
75
|
-
} from "./chunk-
|
|
75
|
+
} from "./chunk-JZ4YOAHA.js";
|
|
76
76
|
import {
|
|
77
77
|
findCommand
|
|
78
|
-
} from "./chunk-
|
|
78
|
+
} from "./chunk-4APZQYCH.js";
|
|
79
79
|
import {
|
|
80
80
|
DEFAULT_OUTPUT_BYTES,
|
|
81
81
|
changesAuthorityAt,
|
|
@@ -88,33 +88,33 @@ import {
|
|
|
88
88
|
rootOf2 as rootOf,
|
|
89
89
|
sealed,
|
|
90
90
|
snakeKeys
|
|
91
|
-
} from "./chunk-
|
|
91
|
+
} from "./chunk-G6IX2MD2.js";
|
|
92
92
|
import {
|
|
93
93
|
readOnlyLockOf
|
|
94
|
-
} from "./chunk-
|
|
94
|
+
} from "./chunk-TN77LX6W.js";
|
|
95
95
|
import {
|
|
96
96
|
withCaller
|
|
97
|
-
} from "./chunk-
|
|
97
|
+
} from "./chunk-MJMVIFSC.js";
|
|
98
98
|
import {
|
|
99
99
|
typedCommand
|
|
100
|
-
} from "./chunk-
|
|
101
|
-
import {
|
|
102
|
-
isCliFailure
|
|
103
|
-
} from "./chunk-3ZIHUSMM.js";
|
|
100
|
+
} from "./chunk-CUZHKYC2.js";
|
|
104
101
|
import {
|
|
105
102
|
levelFor,
|
|
106
103
|
readKeysForCommand
|
|
107
|
-
} from "./chunk-
|
|
104
|
+
} from "./chunk-IEC4E65G.js";
|
|
108
105
|
import {
|
|
109
106
|
openStore,
|
|
110
107
|
pdfPreviewLimits
|
|
111
|
-
} from "./chunk-
|
|
108
|
+
} from "./chunk-MOTKS7XG.js";
|
|
109
|
+
import {
|
|
110
|
+
isCliFailure
|
|
111
|
+
} from "./chunk-37B7A4RP.js";
|
|
112
112
|
import {
|
|
113
113
|
warmEmbedders
|
|
114
|
-
} from "./chunk-
|
|
114
|
+
} from "./chunk-5GOE6PQK.js";
|
|
115
115
|
import {
|
|
116
116
|
timezoneOf
|
|
117
|
-
} from "./chunk-
|
|
117
|
+
} from "./chunk-B6JMVB6R.js";
|
|
118
118
|
import {
|
|
119
119
|
description,
|
|
120
120
|
integer,
|
|
@@ -130,21 +130,21 @@ import {
|
|
|
130
130
|
regex,
|
|
131
131
|
strictObject,
|
|
132
132
|
string
|
|
133
|
-
} from "./chunk-
|
|
133
|
+
} from "./chunk-NRRI37NJ.js";
|
|
134
134
|
import {
|
|
135
135
|
CliError
|
|
136
|
-
} from "./chunk-
|
|
136
|
+
} from "./chunk-FEM2JQN2.js";
|
|
137
137
|
import {
|
|
138
138
|
visibleControls
|
|
139
|
-
} from "./chunk-
|
|
139
|
+
} from "./chunk-OE7EIP5L.js";
|
|
140
140
|
import {
|
|
141
141
|
__name
|
|
142
142
|
} from "./chunk-ZVVMGPBJ.js";
|
|
143
143
|
|
|
144
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
144
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_3e7ac84c094d466aed903c683c124ab5/node_modules/@wirecat/cli-core/dist/mcp/server.js
|
|
145
145
|
import { randomUUID } from "node:crypto";
|
|
146
146
|
|
|
147
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
147
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_3e7ac84c094d466aed903c683c124ab5/node_modules/@wirecat/cli-core/dist/mcp/agent-log.js
|
|
148
148
|
var agentLog = /* @__PURE__ */ __name((open) => {
|
|
149
149
|
let held;
|
|
150
150
|
return {
|
|
@@ -163,7 +163,7 @@ var agentLog = /* @__PURE__ */ __name((open) => {
|
|
|
163
163
|
};
|
|
164
164
|
}, "agentLog");
|
|
165
165
|
|
|
166
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
166
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_3e7ac84c094d466aed903c683c124ab5/node_modules/@wirecat/cli-core/dist/mcp/resources.js
|
|
167
167
|
var LISTED = 100;
|
|
168
168
|
var registerResources = /* @__PURE__ */ __name((server, session, { command, name, limit, recorded, withStore, messenger, guard, assertRead }) => {
|
|
169
169
|
server.registerResource("chat", new ResourceTemplate(`${command}://chat/{id}`, {
|
|
@@ -201,7 +201,7 @@ var registerResources = /* @__PURE__ */ __name((server, session, { command, name
|
|
|
201
201
|
});
|
|
202
202
|
}, "registerResources");
|
|
203
203
|
|
|
204
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
204
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_3e7ac84c094d466aed903c683c124ab5/node_modules/@wirecat/cli-core/dist/mcp/session.js
|
|
205
205
|
var HARMLESS = /* @__PURE__ */ new Set(["validation_error", "not_found", "permission_error", "confirmation_required", "rate_limited"]);
|
|
206
206
|
var harmless = /* @__PURE__ */ __name((code) => HARMLESS.has(code), "harmless");
|
|
207
207
|
var MessengerSession = class {
|
|
@@ -276,7 +276,7 @@ var MessengerSession = class {
|
|
|
276
276
|
}
|
|
277
277
|
};
|
|
278
278
|
|
|
279
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
279
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_3e7ac84c094d466aed903c683c124ab5/node_modules/@wirecat/cli-core/dist/mcp/tools/attachments.js
|
|
280
280
|
var attachmentsTools = /* @__PURE__ */ __name((messenger) => {
|
|
281
281
|
const _command = messenger.app.command;
|
|
282
282
|
return {
|
|
@@ -330,7 +330,7 @@ var attachmentsTools = /* @__PURE__ */ __name((messenger) => {
|
|
|
330
330
|
};
|
|
331
331
|
}, "attachmentsTools");
|
|
332
332
|
|
|
333
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
333
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_3e7ac84c094d466aed903c683c124ab5/node_modules/@wirecat/cli-core/dist/mcp/tools/messages-photo.js
|
|
334
334
|
var PHOTO_LIMIT = 512 * 1024;
|
|
335
335
|
var IMAGE_TYPES = [
|
|
336
336
|
["image/jpeg", (b) => b[0] === 255 && b[1] === 216 && b[2] === 255],
|
|
@@ -384,7 +384,7 @@ var readUpTo = /* @__PURE__ */ __name(async (file, limit, saveIt) => {
|
|
|
384
384
|
return new Uint8Array(Buffer.concat(chunks));
|
|
385
385
|
}, "readUpTo");
|
|
386
386
|
|
|
387
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
387
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_3e7ac84c094d466aed903c683c124ab5/node_modules/@wirecat/cli-core/dist/mcp/tools/stats.js
|
|
388
388
|
var statsTools = /* @__PURE__ */ __name((messenger) => ({
|
|
389
389
|
stats_charts: tool({
|
|
390
390
|
title: "A chart from a chat's statistics",
|
|
@@ -421,14 +421,14 @@ var statsTools = /* @__PURE__ */ __name((messenger) => ({
|
|
|
421
421
|
})
|
|
422
422
|
}), "statsTools");
|
|
423
423
|
|
|
424
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
424
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_3e7ac84c094d466aed903c683c124ab5/node_modules/@wirecat/cli-core/dist/mcp/tools.js
|
|
425
425
|
var pictureTools = /* @__PURE__ */ __name((messenger) => Object.fromEntries(Object.entries({
|
|
426
426
|
...messagesPhotoTools(messenger),
|
|
427
427
|
...attachmentsTools(messenger),
|
|
428
428
|
...statsTools(messenger)
|
|
429
429
|
}).map(([name, definition]) => [name, { ...definition, input: strictObject(definition.input.entries) }])), "pictureTools");
|
|
430
430
|
|
|
431
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
431
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_3e7ac84c094d466aed903c683c124ab5/node_modules/@wirecat/cli-core/dist/mcp/server.js
|
|
432
432
|
var PER_RUN = /* @__PURE__ */ new Set([
|
|
433
433
|
"streams",
|
|
434
434
|
"stdin",
|
|
@@ -752,7 +752,7 @@ var serveOverStdio = /* @__PURE__ */ __name(async (command, context, messenger,
|
|
|
752
752
|
}, "serveOverStdio");
|
|
753
753
|
var serveOverHttpUntilStopped = /* @__PURE__ */ __name(async (command, context, messenger, options, http) => {
|
|
754
754
|
const { session, embedders, build, log } = createServer(command, context, messenger, options);
|
|
755
|
-
const { serveOverHttp } = await import("./serve-
|
|
755
|
+
const { serveOverHttp } = await import("./serve-TWQFHOV2.js");
|
|
756
756
|
const appName = messenger.app.command;
|
|
757
757
|
const appEnvPrefix = messenger.app.envPrefix;
|
|
758
758
|
const listening = await serveOverHttp(build, {
|