@wirecat/drive-cli 0.61.0 → 0.63.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/bin/drive.js +2 -2
- package/dist/browse.d.ts +20 -0
- package/dist/browse.d.ts.map +1 -0
- package/dist/browse.js +146 -0
- package/dist/browse.js.map +1 -0
- package/dist/bundle/{all-profiles-H4L3Z5UM.js → all-profiles-GZJS3UKC.js} +13 -14
- package/dist/bundle/{anthropic-PPGFISVP.js → anthropic-RGV3WXX5.js} +9 -9
- package/dist/bundle/{app-server-YXVK2FUZ.js → app-server-AA2PJ7PV.js} +57 -55
- package/dist/bundle/{bun-DKZAL6ML.js → bun-OXZYIA3R.js} +2 -2
- package/dist/bundle/{bun-sqlite-MTZY36QK.js → bun-sqlite-D45NSDM3.js} +8 -8
- package/dist/bundle/{chunk-KV4267S4.js → chunk-27YUUGXQ.js} +1 -1
- package/dist/bundle/{chunk-6IBM4Z3V.js → chunk-2HF2MRXI.js} +1 -1
- package/dist/bundle/{chunk-HGOYQUT7.js → chunk-2NIC72HH.js} +4 -2
- package/dist/bundle/{chunk-XZBR2O63.js → chunk-2TDUGC5D.js} +1501 -781
- package/dist/bundle/{chunk-DEPMQHXQ.js → chunk-2TFXK3R4.js} +4 -4
- package/dist/bundle/{chunk-JVBLXSAA.js → chunk-33MGFUED.js} +652 -249
- package/dist/bundle/{chunk-S4YK6TTG.js → chunk-3BZRKLJ6.js} +13 -13
- package/dist/bundle/{chunk-6SUGANRJ.js → chunk-3HK5WMI5.js} +6 -6
- package/dist/bundle/{chunk-YWIU4HOT.js → chunk-3QINVLZI.js} +1 -1
- package/dist/bundle/{chunk-XYCCGGKN.js → chunk-44SBK6KB.js} +1207 -643
- package/dist/bundle/{chunk-LARQTWIL.js → chunk-4CIZWCXV.js} +1 -1
- package/dist/bundle/{chunk-WZ5XK74U.js → chunk-4OSSOWDM.js} +1 -1
- package/dist/bundle/{chunk-XGNC5OJG.js → chunk-4S4JMW6I.js} +1 -1
- package/dist/bundle/{chunk-WIU733D2.js → chunk-534OBX5Y.js} +1 -1
- package/dist/bundle/{chunk-UO2IUDVK.js → chunk-5PPL7JDM.js} +2 -2
- package/dist/bundle/{chunk-OFFA54TW.js → chunk-6EY46GAN.js} +2 -2
- package/dist/bundle/{chunk-RFRCOAWS.js → chunk-6KQJSFYF.js} +22 -22
- package/dist/bundle/{chunk-6DN4VPA7.js → chunk-6MQSQ4LX.js} +33 -31
- package/dist/bundle/{chunk-NIX2MWHZ.js → chunk-7EMQ26BA.js} +39 -25
- package/dist/bundle/{chunk-X2CXW4HM.js → chunk-ABYGSJZ4.js} +7 -7
- package/dist/bundle/{chunk-I26VL4W7.js → chunk-AEX37ETW.js} +2 -2
- package/dist/bundle/{chunk-36CWGEVX.js → chunk-BKYMKVHT.js} +2 -2
- package/dist/bundle/{chunk-3WZH3WV3.js → chunk-CE2TJBLP.js} +3 -3
- package/dist/bundle/{chunk-YMBFZA3H.js → chunk-DJ3SDJZY.js} +8 -8
- package/dist/bundle/{chunk-DXPOVLQC.js → chunk-DJHLVUL6.js} +227 -90
- package/dist/bundle/{chunk-VPDAH7PJ.js → chunk-E4SDKMBJ.js} +59 -1
- package/dist/bundle/{chunk-NZ2EIZLX.js → chunk-EOOGWUTP.js} +10 -10
- package/dist/bundle/{chunk-VYXVPYA3.js → chunk-FEZF3TII.js} +6 -6
- package/dist/bundle/{chunk-Q4XVBKX4.js → chunk-FRIJUILO.js} +3 -3
- package/dist/bundle/{chunk-OLPJRD4S.js → chunk-FUITWY7O.js} +1 -1
- package/dist/bundle/{chunk-AM4RIWOZ.js → chunk-HZZCEQTH.js} +18 -4
- package/dist/bundle/{chunk-2RJA4BQB.js → chunk-J24ZFCWM.js} +39 -26
- package/dist/bundle/{chunk-QSGT4ZH4.js → chunk-J4DIHPZ6.js} +1 -1
- package/dist/bundle/{chunk-ZHYRHERD.js → chunk-L37LMMRJ.js} +2 -2
- package/dist/bundle/{chunk-XLFJLZJL.js → chunk-LMAVCYLQ.js} +22 -14
- package/dist/bundle/{chunk-E6J5YH2N.js → chunk-LZEOQW7S.js} +36 -36
- package/dist/bundle/{chunk-FE5JJXKA.js → chunk-MOTRI3SY.js} +2 -2
- package/dist/bundle/{chunk-PJTX2MOI.js → chunk-ND6LLYGF.js} +98 -81
- package/dist/bundle/{chunk-3I2D5TK2.js → chunk-NEFSGCVA.js} +10 -10
- package/dist/bundle/{chunk-OGNOQDWB.js → chunk-O2XOX4HB.js} +34 -10
- package/dist/bundle/{chunk-DCBFNBEB.js → chunk-OD4U7GUY.js} +20 -20
- package/dist/bundle/{chunk-BXR7BKM3.js → chunk-OTROVC4E.js} +1 -1
- package/dist/bundle/{chunk-UKOYQC5O.js → chunk-OXY6SSZG.js} +184 -29
- package/dist/bundle/{chunk-ZMNYK3FC.js → chunk-PDCCYHCH.js} +5 -5
- package/dist/bundle/{chunk-J5UDQD5S.js → chunk-PO5RQQIG.js} +5 -5
- package/dist/bundle/{chunk-PY7LKNOS.js → chunk-Q5DJTRKV.js} +2 -2
- package/dist/bundle/{chunk-E5EXJ2XS.js → chunk-QCKZ3GAA.js} +4 -4
- package/dist/bundle/{chunk-3SJQNS72.js → chunk-RKELRWH7.js} +5 -5
- package/dist/bundle/{chunk-6Y2FWJZ4.js → chunk-S4RXABDR.js} +3 -3
- package/dist/bundle/{chunk-BQMIDYBA.js → chunk-SXM6MHRR.js} +12 -12
- package/dist/bundle/chunk-TF23BZW5.js +64 -0
- package/dist/bundle/{chunk-N2RLJTIW.js → chunk-TWUH22Z5.js} +4 -4
- package/dist/bundle/chunk-UPOSDTPT.js +87 -0
- package/dist/bundle/{chunk-J4HQVHMN.js → chunk-UQLWMGSD.js} +5 -5
- package/dist/bundle/{chunk-K7LS3NGM.js → chunk-V3NVXIQR.js} +736 -230
- package/dist/bundle/{chunk-TKGAYKXW.js → chunk-VAUMOZU5.js} +228 -66
- package/dist/bundle/{chunk-BF6TQMNB.js → chunk-VJEOGKAN.js} +8 -10
- package/dist/bundle/{chunk-XGMDWIUP.js → chunk-VKPCONDQ.js} +4 -4
- package/dist/bundle/{chunk-73WSULMI.js → chunk-WYGWWHZP.js} +2 -2
- package/dist/bundle/{chunk-5W56YMQS.js → chunk-XDC3TWTL.js} +60 -51
- package/dist/bundle/{chunk-5W7D5H2R.js → chunk-XIUDS3OK.js} +1 -1
- package/dist/bundle/{chunk-3UPIJ7DW.js → chunk-XNVFKMVR.js} +21868 -4533
- package/dist/bundle/{chunk-O5CUFS7T.js → chunk-XR6ESRU6.js} +2 -2
- package/dist/bundle/{chunk-EPCJUL6M.js → chunk-Y6GNA7HE.js} +3 -3
- package/dist/bundle/{chunk-67HS46KM.js → chunk-YGU6ULU5.js} +12 -12
- package/dist/bundle/{chunk-HFM653T3.js → chunk-YIP7ELON.js} +768 -131
- package/dist/bundle/{chunk-3252WXOL.js → chunk-YUWPNG7B.js} +1 -1
- package/dist/bundle/{chunk-QR5VQXQ5.js → chunk-Z42YYLTS.js} +59 -37
- package/dist/bundle/{chunk-AWN22PJK.js → chunk-Z5KC7XBR.js} +3 -3
- package/dist/bundle/{chunk-ECEYAQGN.js → chunk-ZM5J6ZMB.js} +4 -2
- package/dist/bundle/{chunk-YPF6OS37.js → chunk-ZMOUUOT2.js} +1 -1
- package/dist/bundle/{chunk-CACYL36O.js → chunk-ZOJU7ZFI.js} +8 -8
- package/dist/bundle/command-contract-BRW3AP44.js +38 -0
- package/dist/bundle/{decode-62A3HGPW.js → decode-G5YEIPNC.js} +8 -8
- package/dist/bundle/{dispatch-IE7PBEQC.js → dispatch-GEFIXA6X.js} +9 -9
- package/dist/bundle/drive.js +11 -11
- package/dist/bundle/{echarts-BGBPRGR5.js → echarts-W2CWHNXR.js} +2 -2
- package/dist/bundle/{embed-J3IBVV2V.js → embed-OBFFPVF4.js} +9 -9
- package/dist/bundle/{embedder-QFPMDRT2.js → embedder-NGCBQHIG.js} +12 -12
- package/dist/bundle/entry-ET6HGM7A.js +22 -0
- package/dist/bundle/{failure-BKOGBMIC.js → failure-GV77W3CD.js} +4 -4
- package/dist/bundle/first-run-JG52UZVO.js +30 -0
- package/dist/bundle/first-screen-CIL3GFAA.js +36 -0
- package/dist/bundle/{google-RXM2XEPD.js → google-CIWUVJ5C.js} +13 -13
- package/dist/bundle/{google-api-NC65BZO4.js → google-api-Z3NSTBBR.js} +56 -57
- package/dist/bundle/grants-3S4RL3WB.js +104 -0
- package/dist/bundle/{identity-PI6F2GWA.js → identity-OM6GFZ7T.js} +6 -6
- package/dist/bundle/{instructions-6LPDSKAD.js → instructions-YQBQSYSS.js} +1 -1
- package/dist/bundle/{login-HTY7GT2S.js → login-7RYSDVN3.js} +62 -63
- package/dist/bundle/{mcp-PPVOM4SE.js → mcp-GWDA3HOA.js} +2 -2
- package/dist/bundle/{node-IB246NCQ.js → node-IVU33RL7.js} +2 -2
- package/dist/bundle/{node-sqlite-G2Y5SFJM.js → node-sqlite-SIH5BEW2.js} +9 -9
- package/dist/bundle/oauth-PT4JEHLL.js +22 -0
- package/dist/bundle/{open-WD4GFSJD.js → open-IAO2SNII.js} +8 -8
- package/dist/bundle/{openai-QVM4PMY7.js → openai-SGOUBHXP.js} +17 -17
- package/dist/bundle/{process-SWPJGPQC.js → process-BPBMV3AT.js} +1 -1
- package/dist/bundle/{program-WHYFAMXR.js → program-MYKKJ4F6.js} +231 -87
- package/dist/bundle/prompt-3ZM64DCB.js +17 -0
- package/dist/bundle/{reasons-Q34DQWB6.js → reasons-57J2D77K.js} +5 -5
- package/dist/bundle/{recognize-DM3YWHSE.js → recognize-A5C5RPB3.js} +7 -7
- package/dist/bundle/{remote-KXVWRK7J.js → remote-VWYFLRGO.js} +10 -10
- package/dist/bundle/{rerank-TINXM3MY.js → rerank-4NGQWREA.js} +10 -10
- package/dist/bundle/{serve-IY2WL656.js → serve-Y6LQTFH5.js} +12 -12
- package/dist/bundle/{server-VPY3OWPC.js → server-6AUHIIUA.js} +43 -44
- package/dist/bundle/server-PFHI35HA.js +69 -0
- package/dist/bundle/{services-PXNBOCOC.js → services-2W4J7EMW.js} +47 -32
- package/dist/bundle/{sqlite-runtime-5ZK2CV7Y.js → sqlite-runtime-P6BBDX2H.js} +9 -9
- package/dist/bundle/{start-LDVCN3DK.js → start-AFFA3LKM.js} +9 -7
- package/dist/bundle/{state-3MKTT3VS.js → state-PXKKXR3R.js} +9 -9
- package/dist/bundle/{store-4VQOT5IJ.js → store-CN6JEUC4.js} +28 -18
- package/dist/bundle/{store-7M4MSUJV.js → store-IVV2BAGZ.js} +78 -28
- package/dist/bundle/store-maintenance-command-MSY2QNEH.js +59 -0
- package/dist/bundle/tokens-P4LPNUFW.js +102 -0
- package/dist/commands/config.d.ts.map +1 -1
- package/dist/commands/config.js +5 -1
- package/dist/commands/config.js.map +1 -1
- package/dist/commands/folders.d.ts +2 -1
- package/dist/commands/folders.d.ts.map +1 -1
- package/dist/commands/folders.js +16 -3
- package/dist/commands/folders.js.map +1 -1
- package/dist/program.js +1 -1
- package/dist/program.js.map +1 -1
- package/dist/tokens.d.ts.map +1 -1
- package/dist/tokens.js +15 -6
- package/dist/tokens.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +3 -3
- package/dist/bundle/chunk-BCWUDTYQ.js +0 -22
- package/dist/bundle/chunk-W767AUNR.js +0 -132
- package/dist/bundle/chunk-WUP2MJDN.js +0 -42
- package/dist/bundle/command-contract-T3EO5AYD.js +0 -39
- package/dist/bundle/entry-YQSYER66.js +0 -22
- package/dist/bundle/first-run-ZIFPVZAI.js +0 -30
- package/dist/bundle/first-screen-L5U26EY7.js +0 -37
- package/dist/bundle/grants-SEWUYYH3.js +0 -105
- package/dist/bundle/oauth-MWBKBI4T.js +0 -22
- package/dist/bundle/prompt-OVYCGZB7.js +0 -17
- package/dist/bundle/server-EMWVVT2C.js +0 -70
- package/dist/bundle/store-maintenance-command-NRATYBWD.js +0 -60
- package/dist/bundle/tokens-XUKLM3SL.js +0 -103
- /package/dist/bundle/{chunk-LU3WKZBA.js → chunk-ZQ3GWKDQ.js} +0 -0
|
@@ -1,11 +1,7 @@
|
|
|
1
1
|
import { createRequire as __bundleRequire } from "node:module";
|
|
2
2
|
const require = __bundleRequire(import.meta.url);
|
|
3
3
|
import {
|
|
4
|
-
|
|
5
|
-
project,
|
|
6
|
-
reminder
|
|
7
|
-
} from "./chunk-W767AUNR.js";
|
|
8
|
-
import {
|
|
4
|
+
ADDED_PROVIDER,
|
|
9
5
|
MIGRATIONS,
|
|
10
6
|
SnapshotBudget,
|
|
11
7
|
assertReadCompatible,
|
|
@@ -32,25 +28,72 @@ import {
|
|
|
32
28
|
tagMemberIds,
|
|
33
29
|
thingOf,
|
|
34
30
|
write
|
|
35
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-XNVFKMVR.js";
|
|
36
32
|
import {
|
|
37
|
-
|
|
38
|
-
} from "./chunk-
|
|
33
|
+
damagedFile
|
|
34
|
+
} from "./chunk-E4SDKMBJ.js";
|
|
39
35
|
import {
|
|
40
36
|
fold
|
|
41
|
-
} from "./chunk-
|
|
37
|
+
} from "./chunk-ZOJU7ZFI.js";
|
|
42
38
|
import {
|
|
43
39
|
CliError
|
|
44
|
-
} from "./chunk-
|
|
40
|
+
} from "./chunk-4OSSOWDM.js";
|
|
45
41
|
import {
|
|
46
42
|
__name
|
|
47
43
|
} from "./chunk-ZVVMGPBJ.js";
|
|
48
44
|
|
|
49
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
45
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/store/damage.js
|
|
46
|
+
var DERIVED = /* @__PURE__ */ new Set(["mentions", "involvements", "embeddings"]);
|
|
47
|
+
var named = /* @__PURE__ */ __name((tables) => tables.length <= 5 ? tables.join(", ") : `${tables.slice(0, 5).join(", ")} and ${tables.length - 5} more`, "named");
|
|
48
|
+
var isDerivedTable = /* @__PURE__ */ __name((table, searchIndexes) => DERIVED.has(table) || table.startsWith("vector_index_") || searchIndexes.some((index) => table === index || table.startsWith(`${index}_`)), "isDerivedTable");
|
|
49
|
+
var WIRECAT_UNITS = ["memo-*", "mail-*", "tg-*", "max-*", "wirecat-*"];
|
|
50
|
+
var seen = /* @__PURE__ */ __name((mark) => `\`${mark.command}\` found the store damaged at ${mark.at} (${mark.error})`, "seen");
|
|
51
|
+
var explainDamage = /* @__PURE__ */ __name((health, command, mark = null) => {
|
|
52
|
+
if (health.ok && !mark)
|
|
53
|
+
return null;
|
|
54
|
+
const indexNames = (health.searchIndexes ?? []).map((index) => index.name);
|
|
55
|
+
const badIndexes = (health.searchIndexes ?? []).filter((index) => !index.ok).map((index) => index.name);
|
|
56
|
+
const tables = (health.damagedTables ?? []).map((one) => one.table).filter((table) => table !== null);
|
|
57
|
+
const sources = tables.filter((table) => !isDerivedTable(table, indexNames));
|
|
58
|
+
const derived = [.../* @__PURE__ */ new Set([...tables.filter((table) => isDerivedTable(table, indexNames)), ...badIndexes])];
|
|
59
|
+
const unopened = health.error !== void 0;
|
|
60
|
+
const json = (health.invalidJson ?? []).map(({ table, column }) => `${table}.${column}`);
|
|
61
|
+
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)}` : "");
|
|
62
|
+
const what = mark && !health.ok ? `${checked}; ${seen(mark)}` : checked;
|
|
63
|
+
const impact = [
|
|
64
|
+
...sources.length ? [`some rows of ${named(sources)} cannot be read; a recovery keeps every row it can read and names the rest`] : [],
|
|
65
|
+
...derived.length ? [`searches may miss results or fail; ${named(derived)} hold nothing that is not elsewhere, and are rebuilt`] : [],
|
|
66
|
+
...json.length ? [`a read of a row with a broken JSON value fails ("malformed JSON"); a recovery clears those values`] : [],
|
|
67
|
+
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"
|
|
68
|
+
];
|
|
69
|
+
return {
|
|
70
|
+
what,
|
|
71
|
+
causes: [
|
|
72
|
+
"the computer lost power or crashed, or the disk filled up, while a tool was writing",
|
|
73
|
+
"the file was copied, restored or synced while a tool had it open, or it sits in a synced or network folder",
|
|
74
|
+
"a fault of the disk itself"
|
|
75
|
+
],
|
|
76
|
+
investigate: [
|
|
77
|
+
`journalctl --user ${WIRECAT_UNITS.map((unit) => `-u '${unit}'`).join(" ")} --since -14d | grep -i -e malformed -e corrupt -e 'disk full'`,
|
|
78
|
+
"journalctl -k --since -14d | grep -i -e 'I/O error' -e nvme -e ata",
|
|
79
|
+
`df -h ${health.path.replace(/\/[^/]*$/, "")}`,
|
|
80
|
+
...health.checked === "quick" || health.ok ? [`${command} store recover`] : []
|
|
81
|
+
],
|
|
82
|
+
impact,
|
|
83
|
+
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",
|
|
84
|
+
steps: [
|
|
85
|
+
"stop every timer and server of the WireCat tools; `store recover run` lists the ones still running",
|
|
86
|
+
`${command} store recover run`,
|
|
87
|
+
"run the fetch commands it prints, then start the timers again"
|
|
88
|
+
]
|
|
89
|
+
};
|
|
90
|
+
}, "explainDamage");
|
|
91
|
+
|
|
92
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/store/document-transfer/index.js
|
|
50
93
|
import { realpathSync, statSync } from "node:fs";
|
|
51
94
|
import { resolve } from "node:path";
|
|
52
95
|
|
|
53
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
96
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/store/sqlite/document-transfer/people.js
|
|
54
97
|
var planPeople = /* @__PURE__ */ __name((database, snapshot, mappings, bindings, conflicts) => {
|
|
55
98
|
const creatable = /* @__PURE__ */ new Set();
|
|
56
99
|
let people = 0, identities = 0;
|
|
@@ -113,11 +156,11 @@ var copyPeople = /* @__PURE__ */ __name((database, snapshot, mappings, now) => {
|
|
|
113
156
|
}
|
|
114
157
|
}, "copyPeople");
|
|
115
158
|
|
|
116
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
159
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/store/document-transfer/digest.js
|
|
117
160
|
import { createHash } from "node:crypto";
|
|
118
161
|
var digest = /* @__PURE__ */ __name((value) => createHash("sha256").update(JSON.stringify(value)).digest("hex"), "digest");
|
|
119
162
|
|
|
120
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
163
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/store/sqlite/document-transfer/collection.js
|
|
121
164
|
var documentsKeyOf = /* @__PURE__ */ __name((collection) => {
|
|
122
165
|
const colon = collection.indexOf(":");
|
|
123
166
|
const provider = collection.slice(0, colon);
|
|
@@ -161,7 +204,7 @@ var currentCollection = /* @__PURE__ */ __name((row) => {
|
|
|
161
204
|
};
|
|
162
205
|
}, "currentCollection");
|
|
163
206
|
|
|
164
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
207
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/store/sqlite/document-transfer/plan.js
|
|
165
208
|
var planTransfer = /* @__PURE__ */ __name((database, snapshot, sourceKey, bindings) => {
|
|
166
209
|
const mappings = /* @__PURE__ */ new Map();
|
|
167
210
|
const missing = /* @__PURE__ */ new Set(), conflicts = /* @__PURE__ */ new Set();
|
|
@@ -270,9 +313,9 @@ var planTransfer = /* @__PURE__ */ __name((database, snapshot, sourceKey, bindin
|
|
|
270
313
|
}
|
|
271
314
|
for (const alias of snapshot.aliases) {
|
|
272
315
|
const sourceTag = snapshot.taggings.find((tagging) => tagging.tag_id === alias.aliasable_id);
|
|
273
|
-
const
|
|
316
|
+
const named2 = canonicalTagNamed(database, String(alias.name));
|
|
274
317
|
const targetTag = sourceTag && canonicalTagNamed(database, String(sourceTag.tag_name));
|
|
275
|
-
if (
|
|
318
|
+
if (named2 && named2.id !== targetTag?.id)
|
|
276
319
|
conflicts.add(`destination alias conflicts with source tag ${String(alias.aliasable_id)}`);
|
|
277
320
|
if (targetTag && alias.display === 1) {
|
|
278
321
|
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);
|
|
@@ -328,7 +371,7 @@ var planTransfer = /* @__PURE__ */ __name((database, snapshot, sourceKey, bindin
|
|
|
328
371
|
};
|
|
329
372
|
}, "planTransfer");
|
|
330
373
|
|
|
331
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
374
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/store/sqlite/document-transfer/snapshot.js
|
|
332
375
|
var TRANSFER_TABLES = { document: "documents", note: "notes", memory: "memories", fact: "facts" };
|
|
333
376
|
var MAX_ENTITIES = 1e3;
|
|
334
377
|
var MAX_AUXILIARY = 1e4;
|
|
@@ -470,7 +513,7 @@ var transferSnapshot = /* @__PURE__ */ __name((database, collection) => read(dat
|
|
|
470
513
|
item.bot = { name: String(bot.name), kind: String(bot.kind) };
|
|
471
514
|
}
|
|
472
515
|
if (thing.type === "document") {
|
|
473
|
-
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);
|
|
516
|
+
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);
|
|
474
517
|
if (doc) {
|
|
475
518
|
item.collection = collectionNameOf({ provider: doc.provider, external_id: doc.account, name: doc.name });
|
|
476
519
|
item.external_id = String(doc.external_id);
|
|
@@ -490,7 +533,7 @@ var transferSnapshot = /* @__PURE__ */ __name((database, collection) => read(dat
|
|
|
490
533
|
};
|
|
491
534
|
}), "transferSnapshot");
|
|
492
535
|
|
|
493
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
536
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/store/sqlite/document-transfer/apply.js
|
|
494
537
|
var providerHere = /* @__PURE__ */ __name(({ provider, name, settings }) => {
|
|
495
538
|
if (provider !== "folder" || String(name ?? "").startsWith("google-drive:"))
|
|
496
539
|
return provider ?? null;
|
|
@@ -662,7 +705,7 @@ var remapEntity = /* @__PURE__ */ __name((database, entity, id, mappings) => {
|
|
|
662
705
|
database.prepare(`UPDATE ${TRANSFER_TABLES[entity.kind]} SET ${columns.join(",")} WHERE id=?`).run(...values, id);
|
|
663
706
|
}, "remapEntity");
|
|
664
707
|
|
|
665
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
708
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/store/document-transfer/index.js
|
|
666
709
|
var locations = /* @__PURE__ */ __name((options) => {
|
|
667
710
|
for (const value of [options.source, options.destination, options.collection])
|
|
668
711
|
if (typeof value !== "string" || !value.trim())
|
|
@@ -715,6 +758,9 @@ var openPreviewTarget = /* @__PURE__ */ __name(async (path) => {
|
|
|
715
758
|
}, "openPreviewTarget");
|
|
716
759
|
var previewDocumentTransfer = /* @__PURE__ */ __name(async (options) => {
|
|
717
760
|
const location = locations(options);
|
|
761
|
+
return damagedFile([location.source, location.destination], () => previewWith(location, options));
|
|
762
|
+
}, "previewDocumentTransfer");
|
|
763
|
+
var previewWith = /* @__PURE__ */ __name(async (location, options) => {
|
|
718
764
|
const source = await openSource(location.source);
|
|
719
765
|
try {
|
|
720
766
|
const target = await openPreviewTarget(location.destination);
|
|
@@ -726,11 +772,14 @@ var previewDocumentTransfer = /* @__PURE__ */ __name(async (options) => {
|
|
|
726
772
|
} finally {
|
|
727
773
|
source.database.close();
|
|
728
774
|
}
|
|
729
|
-
}, "
|
|
775
|
+
}, "previewWith");
|
|
730
776
|
var applyDocumentTransfer = /* @__PURE__ */ __name(async (options) => {
|
|
731
777
|
if (!/^[a-f0-9]{64}$/.test(options.expected_fingerprint))
|
|
732
778
|
throw new CliError("validation_error", "apply requires the fingerprint returned by a transfer preview");
|
|
733
779
|
const location = locations(options);
|
|
780
|
+
return damagedFile([location.source, location.destination], () => applyWith(location, options));
|
|
781
|
+
}, "applyDocumentTransfer");
|
|
782
|
+
var applyWith = /* @__PURE__ */ __name(async (location, options) => {
|
|
734
783
|
const source = await openSource(location.source);
|
|
735
784
|
try {
|
|
736
785
|
const snapshot = transferSnapshot(source.database, options.collection);
|
|
@@ -756,44 +805,151 @@ var applyDocumentTransfer = /* @__PURE__ */ __name(async (options) => {
|
|
|
756
805
|
} finally {
|
|
757
806
|
source.database.close();
|
|
758
807
|
}
|
|
759
|
-
}, "
|
|
808
|
+
}, "applyWith");
|
|
760
809
|
|
|
761
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
810
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/store/health.js
|
|
811
|
+
import { existsSync, statSync as statSync2 } from "node:fs";
|
|
812
|
+
var JSON_COLUMNS = {
|
|
813
|
+
accounts: ["settings"],
|
|
814
|
+
account_identities: ["mail_signals"],
|
|
815
|
+
bot_updates: ["payload"],
|
|
816
|
+
documents: ["front_matter"],
|
|
817
|
+
emails: ["headers"],
|
|
818
|
+
meeting_participants: ["sessions"],
|
|
819
|
+
messages: ["mentions", "reply_to"],
|
|
820
|
+
proposed_actions: ["payload", "result"],
|
|
821
|
+
searches: ["params"],
|
|
822
|
+
tag_consolidations: ["source_member_ids", "survivor_member_ids"],
|
|
823
|
+
task_events: ["changes"]
|
|
769
824
|
};
|
|
770
|
-
var
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
825
|
+
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
|
|
826
|
+
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");
|
|
827
|
+
var invalidJson = /* @__PURE__ */ __name((database) => jsonColumns(database).map((one) => ({
|
|
828
|
+
...one,
|
|
829
|
+
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)
|
|
830
|
+
})).filter(({ rows }) => rows > 0), "invalidJson");
|
|
831
|
+
var QUICK_CHECK_LIMIT = 1e4;
|
|
832
|
+
var QUICK_HEALTH_CHECKS = "the file header, its size against its page count, and the schema's own pages";
|
|
833
|
+
var FTS5 = /^\s*CREATE\s+VIRTUAL\s+TABLE\s+\S+\s+USING\s+fts5\s*\(/i;
|
|
834
|
+
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) => {
|
|
835
|
+
const sql = String(row.sql);
|
|
836
|
+
return { name: String(row.name), sql, external: /content\s*=\s*'[^']+'/i.test(sql) };
|
|
837
|
+
}), "fts5Tables");
|
|
838
|
+
var messageOf = /* @__PURE__ */ __name((error) => error instanceof Error ? error.message : String(error), "messageOf");
|
|
839
|
+
var bytesOf = /* @__PURE__ */ __name((path) => statSync2(path, { throwIfNoEntry: false })?.size ?? 0, "bytesOf");
|
|
840
|
+
var damagedTables = /* @__PURE__ */ __name((database, lines) => {
|
|
841
|
+
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)]));
|
|
842
|
+
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)]));
|
|
843
|
+
const virtual = database.prepare("SELECT name FROM sqlite_master WHERE type = 'table' AND sql LIKE 'CREATE VIRTUAL TABLE%'").all().map((row) => String(row.name));
|
|
844
|
+
const ownerOf = /* @__PURE__ */ __name((table) => table === null ? null : virtual.find((name) => table.startsWith(`${name}_`)) ?? table, "ownerOf");
|
|
845
|
+
const tables = /* @__PURE__ */ new Map();
|
|
846
|
+
for (const raw of lines) {
|
|
847
|
+
const line = raw.replace(/^\*\*\* in database \w+ \*\*\*\s*/, "");
|
|
848
|
+
const tree = /^Tree (\d+) /.exec(line);
|
|
849
|
+
const column = /value in (\w+)\.\w+/.exec(line) ?? /^table (\w+): /.exec(line);
|
|
850
|
+
const index = /index (\w+)/.exec(line)?.[1];
|
|
851
|
+
const table = ownerOf(tree ? roots.get(Number(tree[1])) ?? null : column ? column[1] ?? null : index ? owners.get(index) ?? null : null);
|
|
852
|
+
const known = tables.get(table);
|
|
853
|
+
if (known)
|
|
854
|
+
known.problems += 1;
|
|
855
|
+
else
|
|
856
|
+
tables.set(table, { table, problems: 1, sample: line.slice(0, 200) });
|
|
857
|
+
}
|
|
858
|
+
return [...tables.values()].sort((a, b) => b.problems - a.problems);
|
|
859
|
+
}, "damagedTables");
|
|
860
|
+
var searchIndexHealth = /* @__PURE__ */ __name((database) => fts5Tables(database).map(({ name }) => {
|
|
861
|
+
try {
|
|
862
|
+
database.exec("BEGIN");
|
|
863
|
+
try {
|
|
864
|
+
database.exec(`INSERT INTO "${name}" ("${name}", rank) VALUES ('integrity-check', 0)`);
|
|
865
|
+
} finally {
|
|
866
|
+
database.exec("ROLLBACK");
|
|
784
867
|
}
|
|
785
|
-
|
|
786
|
-
}
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
}
|
|
868
|
+
return { name, ok: true };
|
|
869
|
+
} catch (error) {
|
|
870
|
+
return { name, ok: false, error: messageOf(error) };
|
|
871
|
+
}
|
|
872
|
+
}), "searchIndexHealth");
|
|
873
|
+
var pragmaLines = /* @__PURE__ */ __name((database, sql) => database.prepare(sql).all().flatMap((row) => String(Object.values(row)[0]).split("\n")), "pragmaLines");
|
|
874
|
+
var checkLines = /* @__PURE__ */ __name((database) => {
|
|
875
|
+
try {
|
|
876
|
+
return pragmaLines(database, `PRAGMA quick_check(${QUICK_CHECK_LIMIT})`);
|
|
877
|
+
} catch {
|
|
878
|
+
const tables = database.prepare("SELECT name FROM sqlite_master WHERE type = 'table' AND rootpage > 0 ORDER BY name").all().map((row) => String(row.name));
|
|
879
|
+
return tables.flatMap((table) => {
|
|
880
|
+
try {
|
|
881
|
+
return pragmaLines(database, `PRAGMA quick_check("${table}")`).filter((line) => line !== "ok");
|
|
882
|
+
} catch (error) {
|
|
883
|
+
return [`table ${table}: ${messageOf(error)}`];
|
|
884
|
+
}
|
|
885
|
+
});
|
|
886
|
+
}
|
|
887
|
+
}, "checkLines");
|
|
888
|
+
var quickHealth = /* @__PURE__ */ __name((database, path) => {
|
|
889
|
+
const pragma = /* @__PURE__ */ __name((name) => Number(Object.values(database.prepare(`PRAGMA ${name}`).get() ?? {})[0] ?? 0), "pragma");
|
|
890
|
+
const file = {
|
|
891
|
+
bytes: bytesOf(path),
|
|
892
|
+
pages: pragma("page_count"),
|
|
893
|
+
pageSize: pragma("page_size"),
|
|
894
|
+
freePages: pragma("freelist_count")
|
|
895
|
+
};
|
|
896
|
+
const schema = database.prepare("PRAGMA quick_check('sqlite_schema')").all().map((row) => String(Object.values(row)[0]));
|
|
897
|
+
const walFrames = existsSync(`${path}-wal`) && bytesOf(`${path}-wal`) > 0;
|
|
898
|
+
const sized = walFrames || file.bytes === file.pages * file.pageSize;
|
|
899
|
+
const problems = [
|
|
900
|
+
...schema.length === 1 && schema[0] === "ok" ? [] : schema,
|
|
901
|
+
...sized ? [] : [`the file holds ${file.bytes} bytes, its header says ${file.pages * file.pageSize}`]
|
|
902
|
+
];
|
|
903
|
+
return { file, problems };
|
|
904
|
+
}, "quickHealth");
|
|
905
|
+
var storeHealth = /* @__PURE__ */ __name(async (path, { deep = false } = {}) => {
|
|
906
|
+
const started = Date.now();
|
|
907
|
+
const checked = deep ? "deep" : "quick";
|
|
908
|
+
const done = /* @__PURE__ */ __name((health) => ({
|
|
909
|
+
path,
|
|
910
|
+
checked,
|
|
911
|
+
...health,
|
|
912
|
+
ms: Date.now() - started
|
|
913
|
+
}), "done");
|
|
914
|
+
let database;
|
|
915
|
+
try {
|
|
916
|
+
database = (await openSqlite(path, { readOnly: !deep })).database;
|
|
917
|
+
} catch (error) {
|
|
918
|
+
return done({ ok: false, error: messageOf(error) });
|
|
919
|
+
}
|
|
920
|
+
try {
|
|
921
|
+
const { file, problems } = quickHealth(database, path);
|
|
922
|
+
if (!deep) {
|
|
923
|
+
return done({
|
|
924
|
+
ok: problems.length === 0,
|
|
925
|
+
file,
|
|
926
|
+
...problems.length ? {
|
|
927
|
+
problems: problems.length,
|
|
928
|
+
damagedTables: [{ table: null, problems: problems.length, sample: problems[0] }]
|
|
929
|
+
} : {}
|
|
930
|
+
});
|
|
931
|
+
}
|
|
932
|
+
database.exec("PRAGMA busy_timeout = 30000");
|
|
933
|
+
const lines = checkLines(database);
|
|
934
|
+
const pagesOk = lines.length === 1 && lines[0] === "ok";
|
|
935
|
+
const indexes = searchIndexHealth(database);
|
|
936
|
+
const json = pagesOk ? invalidJson(database) : [];
|
|
937
|
+
return done({
|
|
938
|
+
ok: pagesOk && problems.length === 0 && indexes.every((index) => index.ok) && json.length === 0,
|
|
939
|
+
file,
|
|
940
|
+
problems: pagesOk ? 0 : lines.length,
|
|
941
|
+
damagedTables: pagesOk ? [] : damagedTables(database, lines),
|
|
942
|
+
searchIndexes: indexes,
|
|
943
|
+
invalidJson: json
|
|
944
|
+
});
|
|
945
|
+
} catch (error) {
|
|
946
|
+
return done({ ok: false, error: messageOf(error) });
|
|
947
|
+
} finally {
|
|
948
|
+
database.close();
|
|
949
|
+
}
|
|
950
|
+
}, "storeHealth");
|
|
795
951
|
|
|
796
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
952
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/store/project-transfer/preview.js
|
|
797
953
|
var previewProjectAnnotationSnapshot = /* @__PURE__ */ __name(async (options) => {
|
|
798
954
|
if (!options || typeof options !== "object" || Array.isArray(options))
|
|
799
955
|
throw new CliError("validation_error", "project preview options are required");
|
|
@@ -807,15 +963,19 @@ var previewProjectAnnotationSnapshot = /* @__PURE__ */ __name(async (options) =>
|
|
|
807
963
|
if (typeof options.project !== "string" || !/^project:[1-9]\d*$/.test(options.project) || !Number.isSafeInteger(Number(options.project.slice(8))))
|
|
808
964
|
throw new CliError("validation_error", "project preview project is a project:<safe integer id> reference");
|
|
809
965
|
const budget = new SnapshotBudget(options.maxReadBytes ?? 4 * 1024 * 1024);
|
|
810
|
-
const
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
966
|
+
const target = options.target;
|
|
967
|
+
const project2 = options.project;
|
|
968
|
+
return damagedFile([target], async () => {
|
|
969
|
+
const context = await openStoreContext({ path: target, env: options.env, readOnly: true });
|
|
970
|
+
try {
|
|
971
|
+
return previewAnnotationSnapshot(context.database, Number(project2.slice(8)), snapshot, options.bindings, budget);
|
|
972
|
+
} finally {
|
|
973
|
+
context.database.close();
|
|
974
|
+
}
|
|
975
|
+
});
|
|
816
976
|
}, "previewProjectAnnotationSnapshot");
|
|
817
977
|
|
|
818
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
978
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/store/project-transfer/snapshot.js
|
|
819
979
|
var snapshotProjectAnnotations = /* @__PURE__ */ __name(async (options) => {
|
|
820
980
|
if (!options || typeof options !== "object" || Array.isArray(options))
|
|
821
981
|
throw new CliError("validation_error", "snapshot options are required");
|
|
@@ -837,11 +997,13 @@ var snapshotProjectAnnotations = /* @__PURE__ */ __name(async (options) => {
|
|
|
837
997
|
}, "snapshotProjectAnnotations");
|
|
838
998
|
|
|
839
999
|
export {
|
|
1000
|
+
explainDamage,
|
|
1001
|
+
invalidJson,
|
|
1002
|
+
QUICK_HEALTH_CHECKS,
|
|
1003
|
+
fts5Tables,
|
|
1004
|
+
storeHealth,
|
|
840
1005
|
previewDocumentTransfer,
|
|
841
1006
|
applyDocumentTransfer,
|
|
842
|
-
ORGANIZATIONS_QUERY,
|
|
843
|
-
PROJECTS_QUERY,
|
|
844
|
-
REMINDERS_QUERY,
|
|
845
1007
|
previewProjectAnnotationSnapshot,
|
|
846
1008
|
snapshotProjectAnnotations
|
|
847
1009
|
};
|
|
@@ -1,27 +1,25 @@
|
|
|
1
1
|
import { createRequire as __bundleRequire } from "node:module";
|
|
2
2
|
const require = __bundleRequire(import.meta.url);
|
|
3
3
|
import {
|
|
4
|
-
isCliFailure
|
|
5
|
-
} from "./chunk-BCWUDTYQ.js";
|
|
6
|
-
import {
|
|
4
|
+
isCliFailure,
|
|
7
5
|
secretNamed,
|
|
8
6
|
withoutSecrets
|
|
9
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-E4SDKMBJ.js";
|
|
10
8
|
import {
|
|
11
9
|
isContentKey
|
|
12
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-6EY46GAN.js";
|
|
13
11
|
import {
|
|
14
12
|
__name
|
|
15
13
|
} from "./chunk-ZVVMGPBJ.js";
|
|
16
14
|
|
|
17
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
15
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/runs/run-context.js
|
|
18
16
|
import { AsyncLocalStorage } from "node:async_hooks";
|
|
19
17
|
import { createHash } from "node:crypto";
|
|
20
18
|
|
|
21
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
19
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/runs/error-detail.js
|
|
22
20
|
import { homedir } from "node:os";
|
|
23
21
|
|
|
24
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
22
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/runs/events.js
|
|
25
23
|
var providerErrorKey = /* @__PURE__ */ __name((value) => typeof value === "string" && /^[A-Za-z][A-Za-z0-9._-]{0,63}$/.test(value) ? value : void 0, "providerErrorKey");
|
|
26
24
|
var renderEvent = /* @__PURE__ */ __name((event) => {
|
|
27
25
|
if (event.event === "warning") {
|
|
@@ -69,7 +67,7 @@ var MARK = { request: "\u2192", response: "\u2190", cache: "\u2022", warning: "!
|
|
|
69
67
|
var age = /* @__PURE__ */ __name((ms) => ms < 1e3 ? `${ms}ms` : `${Math.round(ms / 1e3)}s`, "age");
|
|
70
68
|
var size = /* @__PURE__ */ __name((bytes) => bytes < 1e3 ? `${bytes} B` : `${(bytes / 1e3).toFixed(1)} kB`, "size");
|
|
71
69
|
|
|
72
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
70
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/runs/error-detail.js
|
|
73
71
|
var MESSAGE_AT_MOST = 500;
|
|
74
72
|
var CAUSES_AT_MOST = 5;
|
|
75
73
|
var FRAMES_AT_MOST = 15;
|
|
@@ -178,7 +176,7 @@ var redactText = /* @__PURE__ */ __name((text) => {
|
|
|
178
176
|
return out.length > MESSAGE_AT_MOST ? `${out.slice(0, MESSAGE_AT_MOST)}\u2026` : out;
|
|
179
177
|
}, "redactText");
|
|
180
178
|
|
|
181
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
179
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/runs/run-context.js
|
|
182
180
|
var REDACTED = "[redacted]";
|
|
183
181
|
var keepsSuccess = /* @__PURE__ */ __name(({ record, fromFlag, env, caller, persistent = false }) => {
|
|
184
182
|
if (!record)
|
|
@@ -4,18 +4,18 @@ import {
|
|
|
4
4
|
readSharedSection,
|
|
5
5
|
sharedConfigPath,
|
|
6
6
|
writeSharedSection
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-ABYGSJZ4.js";
|
|
8
8
|
import {
|
|
9
9
|
storePath
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-AEX37ETW.js";
|
|
11
11
|
import {
|
|
12
12
|
CliError
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-4OSSOWDM.js";
|
|
14
14
|
import {
|
|
15
15
|
__name
|
|
16
16
|
} from "./chunk-ZVVMGPBJ.js";
|
|
17
17
|
|
|
18
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
18
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/cli/setup-answers.js
|
|
19
19
|
var PERMISSION_ANSWERS = ["readonly", "allow"];
|
|
20
20
|
var QUESTIONS = ["languages", "tools", "permissions"];
|
|
21
21
|
var SECTION = "setup";
|
|
@@ -29,7 +29,7 @@ import {
|
|
|
29
29
|
agentOf,
|
|
30
30
|
clientHash,
|
|
31
31
|
currentCaller
|
|
32
|
-
} from "./chunk-
|
|
32
|
+
} from "./chunk-VJEOGKAN.js";
|
|
33
33
|
import {
|
|
34
34
|
__name
|
|
35
35
|
} from "./chunk-ZVVMGPBJ.js";
|
|
@@ -541,7 +541,7 @@ function toError(value) {
|
|
|
541
541
|
}
|
|
542
542
|
__name(toError, "toError");
|
|
543
543
|
|
|
544
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
544
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/mcp/caller.js
|
|
545
545
|
var callingAgent = /* @__PURE__ */ __name((fallback, caller = currentCaller()) => {
|
|
546
546
|
const client = caller?.agent?.client?.name;
|
|
547
547
|
if (client && client !== "unknown")
|