@wirecat/cli-memo 0.131.51 → 0.131.52
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/memo.js +2 -2
- package/dist/bundle/{all-profiles-3R3VE3W2.js → all-profiles-ZFVBLT2D.js} +5 -5
- package/dist/bundle/{anthropic-QVYJRACM.js → anthropic-UG2YHOT7.js} +3 -3
- package/dist/bundle/{app-server-T3D2PIGZ.js → app-server-AQYA4TB6.js} +35 -35
- package/dist/bundle/auto-2AY6K6DI.js +86 -0
- package/dist/bundle/{bun-DTDD2OHK.js → bun-QJUFWKEZ.js} +2 -2
- package/dist/bundle/{bun-sqlite-DWICJAH3.js → bun-sqlite-GWVRHYF4.js} +2 -2
- package/dist/bundle/{chunk-SXVPRYEF.js → chunk-2CBOPOC7.js} +15 -12
- package/dist/bundle/{chunk-ECLBZGWI.js → chunk-2GEV2TXW.js} +3 -3
- package/dist/bundle/{chunk-PX2B5ZRL.js → chunk-3O46NA2H.js} +102 -60
- package/dist/bundle/{chunk-6MEVHKIO.js → chunk-4ISZPK6D.js} +1 -1
- package/dist/bundle/{chunk-JBSMBHTM.js → chunk-55GFDV24.js} +5 -5
- package/dist/bundle/{chunk-QIFK3EZM.js → chunk-5WT6SEXS.js} +25 -9
- package/dist/bundle/{chunk-4MWP6Z3W.js → chunk-65576OCE.js} +1 -1
- package/dist/bundle/{chunk-5ZGOT57S.js → chunk-6BVWU2UM.js} +2 -2
- package/dist/bundle/{chunk-REROHDUR.js → chunk-6GF4TIVM.js} +1 -1
- package/dist/bundle/{chunk-RL2DSQCD.js → chunk-6PQIXQFD.js} +8 -8
- package/dist/bundle/{chunk-PWYCF76F.js → chunk-6ZQK3L35.js} +2 -2
- package/dist/bundle/{chunk-E3WIMCV5.js → chunk-7SVHEGRO.js} +1 -1
- package/dist/bundle/{chunk-XN5YDZY7.js → chunk-A36ASW3I.js} +1 -1
- package/dist/bundle/{chunk-ZC2LNXGO.js → chunk-A7DXLOMS.js} +1 -1
- package/dist/bundle/{chunk-6O37NSG6.js → chunk-AGOUP5AH.js} +4 -4
- package/dist/bundle/{chunk-OBVKXHOH.js → chunk-AU5GAMGM.js} +413 -357
- package/dist/bundle/{chunk-H65NWA3X.js → chunk-EEEZGK2J.js} +1 -1
- package/dist/bundle/{chunk-O5Z74SBZ.js → chunk-EKQNL6VJ.js} +23 -21
- package/dist/bundle/{chunk-7C3MP5LH.js → chunk-EQUPZVV6.js} +5 -5
- package/dist/bundle/{chunk-LYUVULFK.js → chunk-ERZBEQAY.js} +267 -259
- package/dist/bundle/{chunk-HRLQQLVD.js → chunk-ETYAJPIT.js} +20 -20
- package/dist/bundle/{chunk-GSCGRBEQ.js → chunk-FWCFEJWD.js} +173 -153
- package/dist/bundle/{chunk-E7TMOUWZ.js → chunk-G4Z4WSIG.js} +1 -1
- package/dist/bundle/{chunk-56BBTOS2.js → chunk-G52Y3KOO.js} +1 -1
- package/dist/bundle/{chunk-GBWOMPZ7.js → chunk-G7K4J3NS.js} +3 -3
- package/dist/bundle/{chunk-ROP27ZJU.js → chunk-GJWNHWG7.js} +31 -31
- package/dist/bundle/{chunk-4A6JOJLR.js → chunk-I4LXP4HQ.js} +4 -4
- package/dist/bundle/{chunk-XGNNI3S3.js → chunk-IALGFO44.js} +2 -2
- package/dist/bundle/{chunk-MVV32ZTO.js → chunk-IKG2OPHU.js} +7 -15
- package/dist/bundle/{chunk-JCNBJ3FN.js → chunk-KGPD3OCD.js} +170 -57
- package/dist/bundle/{chunk-PNNM72BO.js → chunk-LUHMRW3P.js} +7 -4
- package/dist/bundle/{chunk-YPLKNKAD.js → chunk-LX65W7IK.js} +4 -4
- package/dist/bundle/{chunk-OJFRMK2W.js → chunk-M64NVDB4.js} +3 -3
- package/dist/bundle/{chunk-5JY464PN.js → chunk-MICF3K6S.js} +12 -12
- package/dist/bundle/{chunk-AEVTXHTY.js → chunk-N5J6GT7C.js} +4 -4
- package/dist/bundle/{chunk-4RHIJMRX.js → chunk-NIUWQP7F.js} +30 -28
- package/dist/bundle/{chunk-O5UP2KZL.js → chunk-NNUP36UQ.js} +1 -1
- package/dist/bundle/{chunk-UDAATSWZ.js → chunk-NOEXRGYH.js} +10 -10
- package/dist/bundle/{chunk-CZOBBAXM.js → chunk-NUQ3N3V3.js} +7 -7
- package/dist/bundle/{chunk-ETD2DRJD.js → chunk-NZKDNBYE.js} +6 -6
- package/dist/bundle/{chunk-CPLYNBAJ.js → chunk-OIPJYDLZ.js} +1 -1
- package/dist/bundle/{chunk-526KVXRI.js → chunk-OWS67HTV.js} +2 -2
- package/dist/bundle/{chunk-FZ4GVE36.js → chunk-PBM5GH7S.js} +2 -2
- package/dist/bundle/{chunk-4GWFRZ2U.js → chunk-PKVXZZTM.js} +58 -1
- package/dist/bundle/{chunk-QFC7V5VW.js → chunk-RYY4YRKQ.js} +5 -5
- package/dist/bundle/{chunk-WPW6ULD7.js → chunk-S7X5ZMQN.js} +2 -2
- package/dist/bundle/{chunk-BUHTAMPF.js → chunk-TM6R3Z45.js} +1 -1
- package/dist/bundle/{chunk-H7RSMNHL.js → chunk-TQS6ZKC3.js} +483 -402
- package/dist/bundle/{chunk-V3TELYLZ.js → chunk-U4ZD5SYO.js} +1 -1
- package/dist/bundle/{chunk-N3UA5PO4.js → chunk-U6E3BGHO.js} +9 -9
- package/dist/bundle/{chunk-FJ3DAE4M.js → chunk-VOWEZBOJ.js} +1 -1
- package/dist/bundle/{chunk-3OL3QRFS.js → chunk-X6XIW76O.js} +5 -5
- package/dist/bundle/{chunk-JINNS3FI.js → chunk-XIHQOSCT.js} +1 -1
- package/dist/bundle/{chunk-UQ2OA6EM.js → chunk-ZKXIZD4C.js} +4 -4
- package/dist/bundle/{chunk-AWLAMVNY.js → chunk-ZVJAZXME.js} +4 -4
- package/dist/bundle/{chunk-66A646SL.js → chunk-ZVR6S4XB.js} +7 -7
- package/dist/bundle/{chunk-YZB5IL4L.js → chunk-ZYQEWB6P.js} +2 -2
- package/dist/bundle/{command-contract-OTVOQLZS.js → command-contract-7AADJ3UC.js} +11 -11
- package/dist/bundle/{decode-ISKRNDDM.js → decode-XMIBTI5O.js} +2 -2
- package/dist/bundle/{echarts-TINXXXCB.js → echarts-W7DPDJA5.js} +2 -2
- package/dist/bundle/{embed-R2KJDGEX.js → embed-EP3KKO6Y.js} +3 -3
- package/dist/bundle/{embedder-X2Y5RLKE.js → embedder-ENGCALJ7.js} +6 -6
- package/dist/bundle/{entry-2MUKT36Z.js → entry-BGSKREOS.js} +4 -4
- package/dist/bundle/failure-ZKQVXWAB.js +66 -0
- package/dist/bundle/{first-run-6BSAM4BD.js → first-run-4EBMV2EM.js} +5 -5
- package/dist/bundle/{first-screen-ALXB4ONR.js → first-screen-2TM3BF2Y.js} +12 -12
- package/dist/bundle/{instructions-E5NBM2NJ.js → instructions-A42XETMK.js} +1 -1
- package/dist/bundle/{mcp-YUPBMZPV.js → mcp-5LAWRSJK.js} +35 -35
- package/dist/bundle/memo.js +6 -6
- package/dist/bundle/{node-NBHZ4XWV.js → node-IRL66JK2.js} +2 -2
- package/dist/bundle/{node-sqlite-3CBWCPNC.js → node-sqlite-SOGTH72B.js} +3 -3
- package/dist/bundle/{oauth-L5XC2THD.js → oauth-RB5W3AC7.js} +4 -4
- package/dist/bundle/{open-WR6QQPVB.js → open-552EJ4JC.js} +2 -2
- package/dist/bundle/{openai-MCPELYCJ.js → openai-ZLOHEEDH.js} +7 -7
- package/dist/bundle/{process-EAEC2FBD.js → process-46SUXGWW.js} +1 -1
- package/dist/bundle/{program-WKKBFQIW.js → program-ZLWKMT65.js} +59 -57
- package/dist/bundle/{prompt-M4Z35LQ5.js → prompt-2NHJSYKX.js} +2 -2
- package/dist/bundle/{recognize-VT6NKW6D.js → recognize-2LDM6KHL.js} +1 -1
- package/dist/bundle/{remote-6QTPH5PJ.js → remote-DBYHHENF.js} +4 -4
- package/dist/bundle/{rerank-MJYLXZ4K.js → rerank-N5T2TIIY.js} +4 -4
- package/dist/bundle/{serve-KQ6OL3OH.js → serve-S6B54R2F.js} +6 -6
- package/dist/bundle/server-KZZHFPTZ.js +61 -0
- package/dist/bundle/{server-UJIH2SBV.js → server-QH6AKPRV.js} +50 -50
- package/dist/bundle/server-WAIPBBM7.js +48 -0
- package/dist/bundle/{state-2PDCOSJN.js → state-ZXZGIIJW.js} +3 -3
- package/dist/bundle/{store-SXYAS5EI.js → store-PNJNDMQ4.js} +9 -9
- package/dist/bundle/store-maintenance-command-2ZVV3DGA.js +48 -0
- package/dist/bundle/update-6HXLLGTQ.js +69 -0
- package/dist/doctor/command.d.ts +30 -0
- package/dist/doctor/command.d.ts.map +1 -1
- package/dist/doctor/command.js +1 -1
- package/dist/doctor/command.js.map +1 -1
- package/dist/failure.js +2 -2
- package/dist/failure.js.map +1 -1
- package/dist/knowledge/relationships-scan.d.ts.map +1 -1
- package/dist/knowledge/relationships-scan.js +4 -3
- package/dist/knowledge/relationships-scan.js.map +1 -1
- package/dist/run/import.d.ts.map +1 -1
- package/dist/run/import.js +3 -2
- package/dist/run/import.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +2 -2
- package/dist/bundle/auto-XJCSM7WE.js +0 -86
- package/dist/bundle/failure-KYUARIL2.js +0 -66
- package/dist/bundle/server-AVAJTC5G.js +0 -61
- package/dist/bundle/server-QAFF3RP5.js +0 -48
- package/dist/bundle/store-maintenance-command-ARTXRVYD.js +0 -48
- package/dist/bundle/update-MOZKRB2Z.js +0 -69
- /package/dist/bundle/{chunk-4ZSY3MKL.js → chunk-DPRGC5YX.js} +0 -0
|
@@ -3,7 +3,7 @@ const require = __bundleRequire(import.meta.url);
|
|
|
3
3
|
import {
|
|
4
4
|
answerOf,
|
|
5
5
|
messengerContext
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-EKQNL6VJ.js";
|
|
7
7
|
import {
|
|
8
8
|
FETCHING,
|
|
9
9
|
QUICK_HEALTH_CHECKS,
|
|
@@ -29,7 +29,7 @@ import {
|
|
|
29
29
|
typedQuery,
|
|
30
30
|
withQuery,
|
|
31
31
|
withTimeLimit
|
|
32
|
-
} from "./chunk-
|
|
32
|
+
} from "./chunk-TQS6ZKC3.js";
|
|
33
33
|
import {
|
|
34
34
|
stringWidth,
|
|
35
35
|
wrapAnsi
|
|
@@ -61,23 +61,20 @@ import {
|
|
|
61
61
|
snakeKeys,
|
|
62
62
|
storeTable,
|
|
63
63
|
withoutProviderRefs
|
|
64
|
-
} from "./chunk-
|
|
65
|
-
import {
|
|
66
|
-
failureKey
|
|
67
|
-
} from "./chunk-MVV32ZTO.js";
|
|
64
|
+
} from "./chunk-FWCFEJWD.js";
|
|
68
65
|
import {
|
|
69
66
|
envName
|
|
70
|
-
} from "./chunk-
|
|
67
|
+
} from "./chunk-G52Y3KOO.js";
|
|
71
68
|
import {
|
|
72
69
|
holdLock,
|
|
73
70
|
lockPath,
|
|
74
71
|
releaseLock,
|
|
75
72
|
servingProfiles,
|
|
76
73
|
takeLock
|
|
77
|
-
} from "./chunk-
|
|
74
|
+
} from "./chunk-6ZQK3L35.js";
|
|
78
75
|
import {
|
|
79
76
|
holdersOf
|
|
80
|
-
} from "./chunk-
|
|
77
|
+
} from "./chunk-6GF4TIVM.js";
|
|
81
78
|
import {
|
|
82
79
|
CORPORA,
|
|
83
80
|
MIGRATIONS,
|
|
@@ -113,28 +110,35 @@ import {
|
|
|
113
110
|
storeClients,
|
|
114
111
|
storeContents,
|
|
115
112
|
vectorIndexCounts
|
|
116
|
-
} from "./chunk-
|
|
113
|
+
} from "./chunk-AU5GAMGM.js";
|
|
114
|
+
import {
|
|
115
|
+
queryFieldsOf,
|
|
116
|
+
readDamageMark,
|
|
117
|
+
readHealthMark,
|
|
118
|
+
recordDeepCheck
|
|
119
|
+
} from "./chunk-KGPD3OCD.js";
|
|
117
120
|
import {
|
|
118
|
-
|
|
119
|
-
|
|
121
|
+
failureKey,
|
|
122
|
+
isStoreDamage
|
|
123
|
+
} from "./chunk-PKVXZZTM.js";
|
|
120
124
|
import {
|
|
121
125
|
readSecret
|
|
122
|
-
} from "./chunk-
|
|
126
|
+
} from "./chunk-S7X5ZMQN.js";
|
|
123
127
|
import {
|
|
124
128
|
checkedOptions,
|
|
125
129
|
range
|
|
126
|
-
} from "./chunk-
|
|
130
|
+
} from "./chunk-EEEZGK2J.js";
|
|
127
131
|
import {
|
|
128
132
|
messagesFor,
|
|
129
133
|
systemFor,
|
|
130
134
|
validateImages
|
|
131
|
-
} from "./chunk-
|
|
135
|
+
} from "./chunk-XIHQOSCT.js";
|
|
132
136
|
import {
|
|
133
137
|
storePath
|
|
134
|
-
} from "./chunk-
|
|
138
|
+
} from "./chunk-65576OCE.js";
|
|
135
139
|
import {
|
|
136
140
|
openCache
|
|
137
|
-
} from "./chunk-
|
|
141
|
+
} from "./chunk-X6XIW76O.js";
|
|
138
142
|
import {
|
|
139
143
|
Credentials,
|
|
140
144
|
pathsAreOverridden,
|
|
@@ -5509,11 +5513,11 @@ var require_liquid_node = __commonJS({
|
|
|
5509
5513
|
}
|
|
5510
5514
|
});
|
|
5511
5515
|
|
|
5512
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
5516
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.605.0_@wirecat+cli-base@0.82.0_commander@15.0.0_esbuild@0.28.2_type_eae6fabbffc2c6fec7070a9f7231a4be/node_modules/@wirecat/cli-core/dist/cli/messenger/store-maintenance-command.js
|
|
5513
5517
|
import { chmodSync, constants, copyFileSync, existsSync as existsSync9, mkdirSync, realpathSync as realpathSync2, renameSync as renameSync3, rmSync as rmSync3, statfsSync as statfsSync2, statSync as statSync4, writeFileSync as writeFileSync2 } from "node:fs";
|
|
5514
5518
|
import { dirname as dirname2, resolve } from "node:path";
|
|
5515
5519
|
|
|
5516
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
5520
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.605.0_@wirecat+cli-base@0.82.0_commander@15.0.0_esbuild@0.28.2_type_eae6fabbffc2c6fec7070a9f7231a4be/node_modules/@wirecat/cli-core/dist/sealed.js
|
|
5517
5521
|
import { createCipheriv, createDecipheriv, createHash, randomBytes, scrypt, timingSafeEqual } from "node:crypto";
|
|
5518
5522
|
import { closeSync, createReadStream, createWriteStream, existsSync, openSync, readSync, renameSync, rmSync, statSync } from "node:fs";
|
|
5519
5523
|
import { Transform } from "node:stream";
|
|
@@ -5620,7 +5624,7 @@ var unsealFile = /* @__PURE__ */ __name(async (from, to, password) => {
|
|
|
5620
5624
|
renameSync(pending, to);
|
|
5621
5625
|
}, "unsealFile");
|
|
5622
5626
|
|
|
5623
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
5627
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.605.0_@wirecat+cli-base@0.82.0_commander@15.0.0_esbuild@0.28.2_type_eae6fabbffc2c6fec7070a9f7231a4be/node_modules/@wirecat/cli-core/dist/store/compatibility.js
|
|
5624
5628
|
var SPEAKS = MIGRATIONS.at(-1)?.version ?? 0;
|
|
5625
5629
|
var fileSchemaOf = /* @__PURE__ */ __name((database) => {
|
|
5626
5630
|
const tracked = database.prepare("SELECT 1 FROM sqlite_master WHERE name = 'schema_migrations'").get();
|
|
@@ -5644,7 +5648,7 @@ var compatibilityOf = /* @__PURE__ */ __name((file2, migrations = MIGRATIONS) =>
|
|
|
5644
5648
|
};
|
|
5645
5649
|
}, "compatibilityOf");
|
|
5646
5650
|
|
|
5647
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
5651
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.605.0_@wirecat+cli-base@0.82.0_commander@15.0.0_esbuild@0.28.2_type_eae6fabbffc2c6fec7070a9f7231a4be/node_modules/@wirecat/cli-core/dist/store/repair.js
|
|
5648
5652
|
import { createHash as createHash2 } from "node:crypto";
|
|
5649
5653
|
var COPY_MARK = "__repair_";
|
|
5650
5654
|
var COPY_NAME = /__repair_[0-9a-f]{8}(_\d+)?$/;
|
|
@@ -5898,13 +5902,13 @@ var deleteCopy = /* @__PURE__ */ __name((database, name) => {
|
|
|
5898
5902
|
return found;
|
|
5899
5903
|
}, "deleteCopy");
|
|
5900
5904
|
|
|
5901
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
5905
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.605.0_@wirecat+cli-base@0.82.0_commander@15.0.0_esbuild@0.28.2_type_eae6fabbffc2c6fec7070a9f7231a4be/node_modules/@wirecat/cli-core/dist/cli/store-info.js
|
|
5902
5906
|
import { existsSync as existsSync4, statSync as statSync3 } from "node:fs";
|
|
5903
5907
|
|
|
5904
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
5908
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.605.0_@wirecat+cli-base@0.82.0_commander@15.0.0_esbuild@0.28.2_type_eae6fabbffc2c6fec7070a9f7231a4be/node_modules/@wirecat/cli-core/dist/cli/store-recover.js
|
|
5905
5909
|
import { existsSync as existsSync3 } from "node:fs";
|
|
5906
5910
|
|
|
5907
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
5911
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.605.0_@wirecat+cli-base@0.82.0_commander@15.0.0_esbuild@0.28.2_type_eae6fabbffc2c6fec7070a9f7231a4be/node_modules/@wirecat/cli-core/dist/store/recover.js
|
|
5908
5912
|
import { execFileSync, spawn } from "node:child_process";
|
|
5909
5913
|
import { existsSync as existsSync2, readFileSync, realpathSync, renameSync as renameSync2, rmSync as rmSync2, statfsSync, statSync as statSync2, writeFileSync } from "node:fs";
|
|
5910
5914
|
import { basename, dirname, join } from "node:path";
|
|
@@ -6202,7 +6206,14 @@ var recoverLocked = /* @__PURE__ */ __name(async ({ path, command, version, sqli
|
|
|
6202
6206
|
}, "stopWatching");
|
|
6203
6207
|
try {
|
|
6204
6208
|
const dataVersion = /* @__PURE__ */ __name(() => Number(watch.prepare("PRAGMA data_version").get()?.data_version), "dataVersion");
|
|
6205
|
-
|
|
6209
|
+
let rowsBefore;
|
|
6210
|
+
try {
|
|
6211
|
+
rowsBefore = tableRows(watch);
|
|
6212
|
+
} catch (error) {
|
|
6213
|
+
if (!isStoreDamage(error))
|
|
6214
|
+
throw error;
|
|
6215
|
+
throw new CliError("configuration_error", "the store file's header or schema is damaged, so its tables cannot be listed and it cannot be recovered; the file was left as it was", { reason: "store.unreadable" });
|
|
6216
|
+
}
|
|
6206
6217
|
const before = { data: dataVersion(), inode: statSync2(path).ino };
|
|
6207
6218
|
const stamp = new Date(now()).toISOString().replace(/[:.]/g, "-");
|
|
6208
6219
|
const target = `${path}.recovering-${stamp}`;
|
|
@@ -6230,6 +6241,7 @@ var recoverLocked = /* @__PURE__ */ __name(async ({ path, command, version, sqli
|
|
|
6230
6241
|
let dangling;
|
|
6231
6242
|
let json;
|
|
6232
6243
|
let fetch2;
|
|
6244
|
+
let schema;
|
|
6233
6245
|
try {
|
|
6234
6246
|
kept = tableRows(opened.database);
|
|
6235
6247
|
migrate(opened.database, { command, ...version ? { version } : {} });
|
|
@@ -6239,6 +6251,7 @@ var recoverLocked = /* @__PURE__ */ __name(async ({ path, command, version, sqli
|
|
|
6239
6251
|
note("looking for rows that point at rows that were lost");
|
|
6240
6252
|
dangling = danglingRows(opened.database);
|
|
6241
6253
|
fetch2 = mailToFetch(opened.database);
|
|
6254
|
+
schema = fileSchemaOf(opened.database).version;
|
|
6242
6255
|
opened.database.exec("PRAGMA wal_checkpoint(TRUNCATE)");
|
|
6243
6256
|
} catch (error) {
|
|
6244
6257
|
opened.database.close();
|
|
@@ -6266,6 +6279,7 @@ var recoverLocked = /* @__PURE__ */ __name(async ({ path, command, version, sqli
|
|
|
6266
6279
|
for (const suffix of STORE_PARTS)
|
|
6267
6280
|
if (existsSync2(`${target}${suffix}`))
|
|
6268
6281
|
renameSync2(`${target}${suffix}`, `${path}${suffix}`);
|
|
6282
|
+
recordDeepCheck(path, health, { cli: command, ...version ? { version } : {}, schema, now });
|
|
6269
6283
|
const lost = Object.entries(rowsBefore).map(([table, before2]) => ({ table, before: before2, read: read[table] ?? 0, kept: kept[table] ?? 0 })).filter(({ before: before2, read: read2, kept: kept2 }) => before2 === null || before2 > kept2 || read2 > kept2);
|
|
6270
6284
|
const seconds = /* @__PURE__ */ __name((from, to) => Math.round((to - from) / 100) / 10, "seconds");
|
|
6271
6285
|
return {
|
|
@@ -6291,7 +6305,7 @@ var recoverLocked = /* @__PURE__ */ __name(async ({ path, command, version, sqli
|
|
|
6291
6305
|
}
|
|
6292
6306
|
}, "recoverLocked");
|
|
6293
6307
|
|
|
6294
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
6308
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.605.0_@wirecat+cli-base@0.82.0_commander@15.0.0_esbuild@0.28.2_type_eae6fabbffc2c6fec7070a9f7231a4be/node_modules/@wirecat/cli-core/dist/cli/store-recover.js
|
|
6295
6309
|
var COUNTED = [
|
|
6296
6310
|
"accounts",
|
|
6297
6311
|
"chats",
|
|
@@ -6306,15 +6320,17 @@ var COUNTED = [
|
|
|
6306
6320
|
"mentions"
|
|
6307
6321
|
];
|
|
6308
6322
|
var stopTimers = /* @__PURE__ */ __name((timers) => `systemctl --user stop ${timers.join(" ")}`, "stopTimers");
|
|
6309
|
-
var storeRecoveryCheck = /* @__PURE__ */ __name(async (env, command) => {
|
|
6323
|
+
var storeRecoveryCheck = /* @__PURE__ */ __name(async (env, command, version) => {
|
|
6310
6324
|
const path = storePath(env);
|
|
6311
6325
|
if (!existsSync3(path))
|
|
6312
6326
|
return { path, exists: false, ok: true, next: [] };
|
|
6313
6327
|
const health = await storeHealth(path, { deep: true });
|
|
6314
6328
|
let rows = {};
|
|
6329
|
+
let schema = null;
|
|
6315
6330
|
try {
|
|
6316
6331
|
const { database } = await openSqlite(path, { readOnly: true });
|
|
6317
6332
|
try {
|
|
6333
|
+
schema = fileSchemaOf(database).version;
|
|
6318
6334
|
const all = tableRows(database);
|
|
6319
6335
|
rows = Object.fromEntries(COUNTED.filter((table) => table in all).map((table) => [table, all[table] ?? null]));
|
|
6320
6336
|
} finally {
|
|
@@ -6322,7 +6338,9 @@ var storeRecoveryCheck = /* @__PURE__ */ __name(async (env, command) => {
|
|
|
6322
6338
|
}
|
|
6323
6339
|
} catch {
|
|
6324
6340
|
}
|
|
6325
|
-
|
|
6341
|
+
recordDeepCheck(path, health, { cli: command, ...version ? { version } : {}, schema });
|
|
6342
|
+
const mark = readDamageMark(path);
|
|
6343
|
+
const explanation = explainDamage(health, command, mark);
|
|
6326
6344
|
const inUse = storeHolders(path) ?? null;
|
|
6327
6345
|
const timers = activeTimers() ?? null;
|
|
6328
6346
|
const sqlite3 = sqlite3Program();
|
|
@@ -6343,6 +6361,8 @@ var storeRecoveryCheck = /* @__PURE__ */ __name(async (env, command) => {
|
|
|
6343
6361
|
invalidJson: health.invalidJson ?? [],
|
|
6344
6362
|
rows,
|
|
6345
6363
|
explanation,
|
|
6364
|
+
damageMark: mark ? (({ inode: _, ...seen }) => seen)(mark) : null,
|
|
6365
|
+
lastKnownGood: readHealthMark(path)?.last_ok_at ?? null,
|
|
6346
6366
|
inUse,
|
|
6347
6367
|
timers,
|
|
6348
6368
|
sqlite3: { version: sqlite3.version, usable: sqlite3.usable },
|
|
@@ -6390,13 +6410,14 @@ var recoveryNotes = /* @__PURE__ */ __name((answer) => {
|
|
|
6390
6410
|
const why = answer.explanation;
|
|
6391
6411
|
return [
|
|
6392
6412
|
...why ? [why.what, ...why.impact, why.externalUnaffected] : [],
|
|
6413
|
+
answer.lastKnownGood ? `the store last passed a deep check at ${answer.lastKnownGood}` : "no deep check that passed is on record for this store",
|
|
6393
6414
|
...answer.next.map((line) => `next: ${line}`)
|
|
6394
6415
|
];
|
|
6395
6416
|
}, "recoveryNotes");
|
|
6396
6417
|
var storeRecoverCommand = /* @__PURE__ */ __name(({ command, version }) => {
|
|
6397
6418
|
const recover = annotate(new Command("recover"), { effects: LOCAL_READ, examples: [`${command} store recover`] }).summary("what is damaged in the store and how to recover it").description("check every page and search index of the store, say what is damaged, what it means and the commands that recover it; changes nothing").action(async function() {
|
|
6398
6419
|
const output = outputFor(this);
|
|
6399
|
-
const answer = await storeRecoveryCheck(environmentOf(this).env ?? process.env, command);
|
|
6420
|
+
const answer = await storeRecoveryCheck(environmentOf(this).env ?? process.env, command, version);
|
|
6400
6421
|
renderAnswer(this, output, itemOf(snakeKeys(answer)));
|
|
6401
6422
|
if (output.format === "pretty")
|
|
6402
6423
|
for (const line of recoveryNotes(answer))
|
|
@@ -6417,7 +6438,7 @@ var storeRecoverCommand = /* @__PURE__ */ __name(({ command, version }) => {
|
|
|
6417
6438
|
return recover;
|
|
6418
6439
|
}, "storeRecoverCommand");
|
|
6419
6440
|
|
|
6420
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
6441
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.605.0_@wirecat+cli-base@0.82.0_commander@15.0.0_esbuild@0.28.2_type_eae6fabbffc2c6fec7070a9f7231a4be/node_modules/@wirecat/cli-core/dist/cli/store-info.js
|
|
6421
6442
|
var pendingIfKnown = /* @__PURE__ */ __name((database) => database.prepare("SELECT 1 FROM pragma_table_info('messages') WHERE name = 'normalized_text'").get() ? pendingNormalization(database) : null, "pendingIfKnown");
|
|
6422
6443
|
var bytesOf = /* @__PURE__ */ __name((path) => existsSync4(path) ? statSync3(path).size : 0, "bytesOf");
|
|
6423
6444
|
var messageOf = /* @__PURE__ */ __name((error) => error instanceof Error ? error.message : String(error), "messageOf");
|
|
@@ -6463,7 +6484,7 @@ var storeInfoCommand = /* @__PURE__ */ __name(() => annotate(new Command("info")
|
|
|
6463
6484
|
renderAnswer(this, outputFor(this), itemOf(answer));
|
|
6464
6485
|
}), "storeInfoCommand");
|
|
6465
6486
|
|
|
6466
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
6487
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.605.0_@wirecat+cli-base@0.82.0_commander@15.0.0_esbuild@0.28.2_type_eae6fabbffc2c6fec7070a9f7231a4be/node_modules/@wirecat/cli-core/dist/cli/messenger/password.js
|
|
6467
6488
|
var ENCRYPT_OPTION = [
|
|
6468
6489
|
"--encrypt",
|
|
6469
6490
|
"compress and encrypt with a password, typed at a hidden prompt or piped on stdin; it is never kept \u2014 lose it and the file cannot be opened"
|
|
@@ -6482,7 +6503,7 @@ var passwordOf = /* @__PURE__ */ __name(async (command, { twice }) => {
|
|
|
6482
6503
|
return password;
|
|
6483
6504
|
}, "passwordOf");
|
|
6484
6505
|
|
|
6485
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
6506
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.605.0_@wirecat+cli-base@0.82.0_commander@15.0.0_esbuild@0.28.2_type_eae6fabbffc2c6fec7070a9f7231a4be/node_modules/@wirecat/cli-core/dist/replies/rules.js
|
|
6486
6507
|
import { existsSync as existsSync5, readFileSync as readFileSync2 } from "node:fs";
|
|
6487
6508
|
import { join as join2 } from "node:path";
|
|
6488
6509
|
var REPLY_ACTIONS = ["reply", "task"];
|
|
@@ -6653,7 +6674,7 @@ var problem = /* @__PURE__ */ __name((issue) => {
|
|
|
6653
6674
|
}, "problem");
|
|
6654
6675
|
var broken = /* @__PURE__ */ __name((path, why) => new CliError("configuration_error", `the reply rules ${path} cannot be read (${why}) \u2014 fix the file`), "broken");
|
|
6655
6676
|
|
|
6656
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
6677
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.605.0_@wirecat+cli-base@0.82.0_commander@15.0.0_esbuild@0.28.2_type_eae6fabbffc2c6fec7070a9f7231a4be/node_modules/@wirecat/cli-core/dist/replies/state.js
|
|
6657
6678
|
import { existsSync as existsSync6, readFileSync as readFileSync3 } from "node:fs";
|
|
6658
6679
|
import { join as join3 } from "node:path";
|
|
6659
6680
|
var ANSWERED_KEPT = 1e3;
|
|
@@ -6706,7 +6727,7 @@ var recordReply = /* @__PURE__ */ __name((state, rule2, message, now) => {
|
|
|
6706
6727
|
}, "recordReply");
|
|
6707
6728
|
var broken2 = /* @__PURE__ */ __name((path, why) => new CliError("configuration_error", `the reply state ${path} cannot be read (${why}) \u2014 fix or move the file`), "broken");
|
|
6708
6729
|
|
|
6709
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
6730
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.605.0_@wirecat+cli-base@0.82.0_commander@15.0.0_esbuild@0.28.2_type_eae6fabbffc2c6fec7070a9f7231a4be/node_modules/@wirecat/cli-core/dist/replies/decide.js
|
|
6710
6731
|
var skip = /* @__PURE__ */ __name((why) => ({ skip: why }), "skip");
|
|
6711
6732
|
var decide = /* @__PURE__ */ __name((rule2, incoming, state, now) => {
|
|
6712
6733
|
const { message, chat, owner, sender } = incoming;
|
|
@@ -6812,7 +6833,7 @@ var filled = /* @__PURE__ */ __name((template2, senderName) => {
|
|
|
6812
6833
|
return template2.replaceAll("{firstName}", name.split(/\s+/)[0] ?? name).replaceAll("{name}", name);
|
|
6813
6834
|
}, "filled");
|
|
6814
6835
|
|
|
6815
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
6836
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.605.0_@wirecat+cli-base@0.82.0_commander@15.0.0_esbuild@0.28.2_type_eae6fabbffc2c6fec7070a9f7231a4be/node_modules/@wirecat/cli-core/dist/replies/template.js
|
|
6816
6837
|
var import_liquidjs = __toESM(require_liquid_node(), 1);
|
|
6817
6838
|
var TEMPLATE_LIMITS = {
|
|
6818
6839
|
parse: 32768,
|
|
@@ -6972,7 +6993,7 @@ var renderReplyTemplate = /* @__PURE__ */ __name(async (reply, input) => {
|
|
|
6972
6993
|
}
|
|
6973
6994
|
}, "renderReplyTemplate");
|
|
6974
6995
|
|
|
6975
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
6996
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.605.0_@wirecat+cli-base@0.82.0_commander@15.0.0_esbuild@0.28.2_type_eae6fabbffc2c6fec7070a9f7231a4be/node_modules/@wirecat/cli-core/dist/replies/dry-run.js
|
|
6976
6997
|
var DRY_RUN_DAYS = 7;
|
|
6977
6998
|
var PAGE = 500;
|
|
6978
6999
|
var dryRun = /* @__PURE__ */ __name(async (store, account, rules, { since, until = Date.now(), only, audience, render }) => {
|
|
@@ -7086,7 +7107,7 @@ var storedSince = /* @__PURE__ */ __name(async (store, account, chat, since) =>
|
|
|
7086
7107
|
}
|
|
7087
7108
|
}, "storedSince");
|
|
7088
7109
|
|
|
7089
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
7110
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.605.0_@wirecat+cli-base@0.82.0_commander@15.0.0_esbuild@0.28.2_type_eae6fabbffc2c6fec7070a9f7231a4be/node_modules/@wirecat/cli-core/dist/embeddings/keys.js
|
|
7090
7111
|
var endpointKeyName = /* @__PURE__ */ __name((baseUrl) => {
|
|
7091
7112
|
const host = new URL(baseUrl).host;
|
|
7092
7113
|
return ["openai", "anthropic"].includes(host) ? `endpoint:${host}` : host;
|
|
@@ -7117,7 +7138,7 @@ var embeddingKeys = /* @__PURE__ */ __name((app, env = process.env, keyring) =>
|
|
|
7117
7138
|
};
|
|
7118
7139
|
}, "embeddingKeys");
|
|
7119
7140
|
|
|
7120
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
7141
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.605.0_@wirecat+cli-base@0.82.0_commander@15.0.0_esbuild@0.28.2_type_eae6fabbffc2c6fec7070a9f7231a4be/node_modules/@wirecat/cli-core/dist/models/openai.js
|
|
7121
7142
|
var options = strictObject({
|
|
7122
7143
|
temperature: range(0, 2),
|
|
7123
7144
|
top_p: range(0, 1),
|
|
@@ -7166,7 +7187,7 @@ var openai = {
|
|
|
7166
7187
|
}), "complete")
|
|
7167
7188
|
};
|
|
7168
7189
|
|
|
7169
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
7190
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.605.0_@wirecat+cli-base@0.82.0_commander@15.0.0_esbuild@0.28.2_type_eae6fabbffc2c6fec7070a9f7231a4be/node_modules/@wirecat/cli-core/dist/models/index.js
|
|
7170
7191
|
var modelGateway = /* @__PURE__ */ __name((deps) => ({
|
|
7171
7192
|
complete: /* @__PURE__ */ __name(async (request) => {
|
|
7172
7193
|
if (deps.signal?.aborted)
|
|
@@ -7181,7 +7202,7 @@ var modelGateway = /* @__PURE__ */ __name((deps) => ({
|
|
|
7181
7202
|
if (!adapter && target.provider === "openai")
|
|
7182
7203
|
adapter = openai;
|
|
7183
7204
|
if (!adapter && target.provider === "anthropic")
|
|
7184
|
-
adapter = (await import("./anthropic-
|
|
7205
|
+
adapter = (await import("./anthropic-UG2YHOT7.js")).anthropic;
|
|
7185
7206
|
if (!adapter)
|
|
7186
7207
|
throw new CliError("validation_error", `no model adapter for ${target.provider}`);
|
|
7187
7208
|
if (request.images !== void 0 && adapter.images !== true)
|
|
@@ -7222,7 +7243,7 @@ var modelGateway = /* @__PURE__ */ __name((deps) => ({
|
|
|
7222
7243
|
}, "complete")
|
|
7223
7244
|
}), "modelGateway");
|
|
7224
7245
|
|
|
7225
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
7246
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.605.0_@wirecat+cli-base@0.82.0_commander@15.0.0_esbuild@0.28.2_type_eae6fabbffc2c6fec7070a9f7231a4be/node_modules/@wirecat/cli-core/dist/replies/consents.js
|
|
7226
7247
|
import { existsSync as existsSync7, readFileSync as readFileSync4 } from "node:fs";
|
|
7227
7248
|
import { join as join4 } from "node:path";
|
|
7228
7249
|
var shape = strictObject({
|
|
@@ -7247,7 +7268,7 @@ var mayModelReply = /* @__PURE__ */ __name((path, provider, chat) => {
|
|
|
7247
7268
|
return consent.provider === provider && !consent.deniedChats.includes(chat);
|
|
7248
7269
|
}, "mayModelReply");
|
|
7249
7270
|
|
|
7250
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
7271
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.605.0_@wirecat+cli-base@0.82.0_commander@15.0.0_esbuild@0.28.2_type_eae6fabbffc2c6fec7070a9f7231a4be/node_modules/@wirecat/cli-core/dist/replies/rendering.js
|
|
7251
7272
|
var replyRenderer = /* @__PURE__ */ __name((app, profile, settings, env, warn, options2 = {
|
|
7252
7273
|
ai: true
|
|
7253
7274
|
}) => async (rule2, message, chat, now) => {
|
|
@@ -7294,7 +7315,7 @@ var replyRenderer = /* @__PURE__ */ __name((app, profile, settings, env, warn, o
|
|
|
7294
7315
|
return result2;
|
|
7295
7316
|
}, "replyRenderer");
|
|
7296
7317
|
|
|
7297
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
7318
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.605.0_@wirecat+cli-base@0.82.0_commander@15.0.0_esbuild@0.28.2_type_eae6fabbffc2c6fec7070a9f7231a4be/node_modules/@wirecat/cli-core/dist/replies/serve.js
|
|
7298
7319
|
var NOT_ALLOWED = "replies.send is not allow";
|
|
7299
7320
|
var NO_RULES = "no rules";
|
|
7300
7321
|
var ONLY_TASK = "opened a task, sent nothing";
|
|
@@ -7387,7 +7408,7 @@ var replyTo = /* @__PURE__ */ __name(async (deps, message) => {
|
|
|
7387
7408
|
return { skip: why };
|
|
7388
7409
|
}, "replyTo");
|
|
7389
7410
|
|
|
7390
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
7411
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.605.0_@wirecat+cli-base@0.82.0_commander@15.0.0_esbuild@0.28.2_type_eae6fabbffc2c6fec7070a9f7231a4be/node_modules/@wirecat/cli-core/dist/cli/messenger/serve-catch-up.js
|
|
7391
7412
|
var START_SYNC_DELAY_MS = 3e4;
|
|
7392
7413
|
var START_SYNC_BUDGET_MS = 5 * 6e4;
|
|
7393
7414
|
var START_SYNC_WINDOW_MS = 7 * 864e5;
|
|
@@ -7464,7 +7485,7 @@ var startSync = /* @__PURE__ */ __name(({ chats, newestHeld, fetch: fetch2, note
|
|
|
7464
7485
|
};
|
|
7465
7486
|
}, "startSync");
|
|
7466
7487
|
|
|
7467
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
7488
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.605.0_@wirecat+cli-base@0.82.0_commander@15.0.0_esbuild@0.28.2_type_eae6fabbffc2c6fec7070a9f7231a4be/node_modules/@wirecat/cli-core/dist/cli/messenger/serve-members.js
|
|
7468
7489
|
var FIRST_FETCH_MS = 6e4;
|
|
7469
7490
|
var DAY_MS = 864e5;
|
|
7470
7491
|
var memberFetches = /* @__PURE__ */ __name(({ withStore, fetch: fetch2, warn, firstMs = FIRST_FETCH_MS, everyMs = DAY_MS }) => {
|
|
@@ -7518,7 +7539,7 @@ var memberFetches = /* @__PURE__ */ __name(({ withStore, fetch: fetch2, warn, fi
|
|
|
7518
7539
|
};
|
|
7519
7540
|
}, "memberFetches");
|
|
7520
7541
|
|
|
7521
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
7542
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.605.0_@wirecat+cli-base@0.82.0_commander@15.0.0_esbuild@0.28.2_type_eae6fabbffc2c6fec7070a9f7231a4be/node_modules/@wirecat/cli-core/dist/cli/messenger/serve-notice.js
|
|
7522
7543
|
var record2 = /* @__PURE__ */ __name((context, app, severity, attributes) => recordLogFor(context.streams.diagnostic, app, { command: currentRun().command || "serve" })[severity](attributes), "record");
|
|
7523
7544
|
var noticeFor = /* @__PURE__ */ __name((context, app, severity = "warn") => ({ text, ...attributes }) => {
|
|
7524
7545
|
if (context.format === "pretty") {
|
|
@@ -7551,7 +7572,7 @@ var recordDiagnostics = /* @__PURE__ */ __name((context, app) => {
|
|
|
7551
7572
|
return context;
|
|
7552
7573
|
}, "recordDiagnostics");
|
|
7553
7574
|
|
|
7554
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
7575
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.605.0_@wirecat+cli-base@0.82.0_commander@15.0.0_esbuild@0.28.2_type_eae6fabbffc2c6fec7070a9f7231a4be/node_modules/@wirecat/cli-core/dist/cli/messenger/serve-stems.js
|
|
7555
7576
|
var STEMS_EVERY_MS = 3e4;
|
|
7556
7577
|
var STEMS_SLICE_MS = 2e3;
|
|
7557
7578
|
var stemFills = /* @__PURE__ */ __name(({ withStore, warn, everyMs = STEMS_EVERY_MS, sliceMs = STEMS_SLICE_MS }) => {
|
|
@@ -7591,7 +7612,7 @@ var stemFills = /* @__PURE__ */ __name(({ withStore, warn, everyMs = STEMS_EVERY
|
|
|
7591
7612
|
};
|
|
7592
7613
|
}, "stemFills");
|
|
7593
7614
|
|
|
7594
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
7615
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.605.0_@wirecat+cli-base@0.82.0_commander@15.0.0_esbuild@0.28.2_type_eae6fabbffc2c6fec7070a9f7231a4be/node_modules/@wirecat/cli-core/dist/render/messages.js
|
|
7595
7616
|
import { styleText } from "node:util";
|
|
7596
7617
|
var TIME_WIDTH = 8;
|
|
7597
7618
|
var INDENT = " ".repeat(TIME_WIDTH + 2);
|
|
@@ -7767,7 +7788,7 @@ var editedAt = /* @__PURE__ */ __name((message, options2) => {
|
|
|
7767
7788
|
return day(edited) === day(message.timestamp) ? time : `${day(edited)} ${time}`;
|
|
7768
7789
|
}, "editedAt");
|
|
7769
7790
|
|
|
7770
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
7791
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.605.0_@wirecat+cli-base@0.82.0_commander@15.0.0_esbuild@0.28.2_type_eae6fabbffc2c6fec7070a9f7231a4be/node_modules/@wirecat/cli-core/dist/cli/messenger/message-items.js
|
|
7771
7792
|
var defined = /* @__PURE__ */ __name((value) => Object.fromEntries(Object.entries(value).filter(([, one]) => one !== void 0)), "defined");
|
|
7772
7793
|
var attachmentItem = /* @__PURE__ */ __name((attachment) => defined({
|
|
7773
7794
|
kind: attachment.kind,
|
|
@@ -7862,7 +7883,7 @@ var viewOf = /* @__PURE__ */ __name((context, messenger) => ({
|
|
|
7862
7883
|
locale: messenger.app.locale
|
|
7863
7884
|
}), "viewOf");
|
|
7864
7885
|
|
|
7865
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
7886
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.605.0_@wirecat+cli-base@0.82.0_commander@15.0.0_esbuild@0.28.2_type_eae6fabbffc2c6fec7070a9f7231a4be/node_modules/@wirecat/cli-core/dist/cli/messenger/watch-answers.js
|
|
7866
7887
|
var observed = /* @__PURE__ */ __name((value) => ({
|
|
7867
7888
|
value: value.value,
|
|
7868
7889
|
observed_at: value.observedAt,
|
|
@@ -7929,7 +7950,7 @@ var watchEventItem = /* @__PURE__ */ __name((value, account) => {
|
|
|
7929
7950
|
}
|
|
7930
7951
|
}, "watchEventItem");
|
|
7931
7952
|
|
|
7932
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
7953
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.605.0_@wirecat+cli-base@0.82.0_commander@15.0.0_esbuild@0.28.2_type_eae6fabbffc2c6fec7070a9f7231a4be/node_modules/@wirecat/cli-core/dist/cli/messenger/watch-command.js
|
|
7933
7954
|
var watchCommand = /* @__PURE__ */ __name((messenger) => annotate(new Command("watch"), {
|
|
7934
7955
|
output: { entity: "watch_item" },
|
|
7935
7956
|
effects: REMOTE_READ,
|
|
@@ -8084,7 +8105,7 @@ var describe = /* @__PURE__ */ __name((event, render) => {
|
|
|
8084
8105
|
}
|
|
8085
8106
|
}, "describe");
|
|
8086
8107
|
|
|
8087
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
8108
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.605.0_@wirecat+cli-base@0.82.0_commander@15.0.0_esbuild@0.28.2_type_eae6fabbffc2c6fec7070a9f7231a4be/node_modules/@wirecat/cli-core/dist/cli/messenger/serve-command.js
|
|
8088
8109
|
var serveCommand = /* @__PURE__ */ __name((messenger) => {
|
|
8089
8110
|
const command = annotate(new Command("serve"), {
|
|
8090
8111
|
output: { entity: "serve_summary" },
|
|
@@ -8348,7 +8369,7 @@ var tasking = /* @__PURE__ */ __name((context, warn) => {
|
|
|
8348
8369
|
};
|
|
8349
8370
|
}, "tasking");
|
|
8350
8371
|
|
|
8351
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
8372
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.605.0_@wirecat+cli-base@0.82.0_commander@15.0.0_esbuild@0.28.2_type_eae6fabbffc2c6fec7070a9f7231a4be/node_modules/@wirecat/cli-core/dist/cli/messenger/store-tables-command.js
|
|
8352
8373
|
import { existsSync as existsSync8 } from "node:fs";
|
|
8353
8374
|
var PATH = "store tables list";
|
|
8354
8375
|
var STORE_TABLES_QUERY = {
|
|
@@ -8391,7 +8412,7 @@ var storeTablesCommand = /* @__PURE__ */ __name((messenger) => {
|
|
|
8391
8412
|
return tables;
|
|
8392
8413
|
}, "storeTablesCommand");
|
|
8393
8414
|
|
|
8394
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
8415
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.605.0_@wirecat+cli-base@0.82.0_commander@15.0.0_esbuild@0.28.2_type_eae6fabbffc2c6fec7070a9f7231a4be/node_modules/@wirecat/cli-core/dist/cli/messenger/store-maintenance-command.js
|
|
8395
8416
|
var SEARCH_INDEXES = ["messages_fts", "chats_fts", "identities_fts"];
|
|
8396
8417
|
var WORD_INDEX = "message_words";
|
|
8397
8418
|
var schemaOf = /* @__PURE__ */ __name((database) => {
|
|
@@ -8417,11 +8438,26 @@ var readingOnly = /* @__PURE__ */ __name(async (path, read) => {
|
|
|
8417
8438
|
database.close();
|
|
8418
8439
|
}
|
|
8419
8440
|
}, "readingOnly");
|
|
8420
|
-
var
|
|
8441
|
+
var withoutInode = /* @__PURE__ */ __name(({ inode: _, ...mark }) => mark, "withoutInode");
|
|
8442
|
+
var fileSchema = /* @__PURE__ */ __name(async (path) => {
|
|
8443
|
+
try {
|
|
8444
|
+
return await readingOnly(path, (database) => fileSchemaOf(database).version);
|
|
8445
|
+
} catch {
|
|
8446
|
+
return null;
|
|
8447
|
+
}
|
|
8448
|
+
}, "fileSchema");
|
|
8449
|
+
var storeSummary = /* @__PURE__ */ __name(async (env, { deep = false, command, version } = {}) => {
|
|
8421
8450
|
const path = storePath(env);
|
|
8422
8451
|
if (!existsSync9(path))
|
|
8423
8452
|
return { path, exists: false };
|
|
8424
8453
|
const checked = await storeHealth(path, { deep });
|
|
8454
|
+
const recorded = deep ? recordDeepCheck(path, checked, {
|
|
8455
|
+
cli: command ?? "unknown",
|
|
8456
|
+
...version ? { version } : {},
|
|
8457
|
+
schema: await fileSchema(path)
|
|
8458
|
+
}) : null;
|
|
8459
|
+
const mark = readDamageMark(path);
|
|
8460
|
+
const lastKnownGood = readHealthMark(path)?.last_ok_at ?? null;
|
|
8425
8461
|
const health = {
|
|
8426
8462
|
checked: checked.checked,
|
|
8427
8463
|
covers: deep ? "every page and every search index" : QUICK_HEALTH_CHECKS,
|
|
@@ -8432,18 +8468,24 @@ var storeSummary = /* @__PURE__ */ __name(async (env, { deep = false, command }
|
|
|
8432
8468
|
...checked.invalidJson?.length ? { invalidJson: checked.invalidJson } : {},
|
|
8433
8469
|
...checked.searchIndexes?.some((index) => !index.ok) ? { damagedSearchIndexes: checked.searchIndexes.filter((index) => !index.ok).map((index) => index.name) } : {}
|
|
8434
8470
|
};
|
|
8435
|
-
const damage = command ? explainDamage(checked, command) : null;
|
|
8436
|
-
const healthOf = {
|
|
8471
|
+
const damage = command ? explainDamage(checked, command, mark) : null;
|
|
8472
|
+
const healthOf = {
|
|
8473
|
+
health,
|
|
8474
|
+
lastKnownGood,
|
|
8475
|
+
...mark ? { damageMark: withoutInode(mark) } : {},
|
|
8476
|
+
...recorded?.cleared ? { damageMarkCleared: withoutInode(recorded.cleared) } : {},
|
|
8477
|
+
...damage ? { damage } : {}
|
|
8478
|
+
};
|
|
8437
8479
|
try {
|
|
8438
8480
|
return await reading(path, (database) => {
|
|
8439
|
-
const { version, writable } = schemaOf(database);
|
|
8481
|
+
const { version: version2, writable } = schemaOf(database);
|
|
8440
8482
|
return {
|
|
8441
8483
|
path,
|
|
8442
8484
|
exists: true,
|
|
8443
|
-
schema:
|
|
8485
|
+
schema: version2,
|
|
8444
8486
|
speaks: SPEAKS,
|
|
8445
8487
|
writable,
|
|
8446
|
-
...
|
|
8488
|
+
...version2 > 0 ? { chats: count2(database, "chats"), messages: count2(database, "messages") } : {},
|
|
8447
8489
|
...healthOf
|
|
8448
8490
|
};
|
|
8449
8491
|
});
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
__name
|
|
5
5
|
} from "./chunk-ZVVMGPBJ.js";
|
|
6
6
|
|
|
7
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
7
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.605.0_@wirecat+cli-base@0.82.0_commander@15.0.0_esbuild@0.28.2_type_eae6fabbffc2c6fec7070a9f7231a4be/node_modules/@wirecat/cli-core/dist/mcp/instructions.js
|
|
8
8
|
var instructions = /* @__PURE__ */ __name(({ command, name, profile, writes, skill }) => {
|
|
9
9
|
const all = typeof profile !== "string";
|
|
10
10
|
const offers = /* @__PURE__ */ __name((key) => all || writes.includes(key), "offers");
|
|
@@ -2,15 +2,15 @@ import { createRequire as __bundleRequire } from "node:module";
|
|
|
2
2
|
const require = __bundleRequire(import.meta.url);
|
|
3
3
|
import {
|
|
4
4
|
loadConfig
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-GJWNHWG7.js";
|
|
6
6
|
import {
|
|
7
7
|
upgradeCommand
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-ERZBEQAY.js";
|
|
9
9
|
import {
|
|
10
10
|
FETCH,
|
|
11
11
|
annotate,
|
|
12
12
|
overrideSharedContract
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-FWCFEJWD.js";
|
|
14
14
|
import {
|
|
15
15
|
latestVersion,
|
|
16
16
|
runUpdate,
|
|
@@ -19,7 +19,7 @@ import {
|
|
|
19
19
|
import {
|
|
20
20
|
APP,
|
|
21
21
|
VERSION
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-A7DXLOMS.js";
|
|
23
23
|
import {
|
|
24
24
|
installerOf
|
|
25
25
|
} from "./chunk-IK6KH3RE.js";
|
|
@@ -34,7 +34,7 @@ import {
|
|
|
34
34
|
// dist/update.js
|
|
35
35
|
import { join } from "node:path";
|
|
36
36
|
|
|
37
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
37
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.605.0_@wirecat+cli-base@0.82.0_commander@15.0.0_esbuild@0.28.2_type_eae6fabbffc2c6fec7070a9f7231a4be/node_modules/@wirecat/cli-core/dist/update/index.js
|
|
38
38
|
import { realpathSync } from "node:fs";
|
|
39
39
|
import { fileURLToPath } from "node:url";
|
|
40
40
|
var QUIET_WORDS = [
|