@wirecat/zoom-cli 0.60.0 → 0.61.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/README.md +7 -6
- package/dist/answers.d.ts +16 -0
- package/dist/answers.d.ts.map +1 -1
- package/dist/bin/main.js +1 -0
- package/dist/bin/main.js.map +1 -1
- package/dist/bin/zm.js +2 -2
- package/dist/bundle/{chunk-PUOBYJFI.js → all-profiles-HZLIU6RZ.js} +11 -7
- package/dist/bundle/answer-policy-GRODO2DY.js +96 -0
- package/dist/bundle/{anthropic-TT2XV74T.js → anthropic-O2YYPCVK.js} +4 -4
- package/dist/bundle/{app-server-POMYD6QV.js → app-server-YYCANTUE.js} +50 -50
- package/dist/bundle/{bun-JVDJVDHL.js → bun-UEFRULAT.js} +2 -2
- package/dist/bundle/{bun-sqlite-BBOPAQVG.js → bun-sqlite-VVYKOY7S.js} +3 -3
- package/dist/bundle/{chunk-KVPYI52N.js → chunk-2M2U43IF.js} +2 -2
- package/dist/bundle/{chunk-7GVNQOV6.js → chunk-35X6G276.js} +1 -1
- package/dist/bundle/{chunk-RH5YXXAB.js → chunk-3TGR4RDD.js} +32 -34
- package/dist/bundle/{chunk-YZZ6NBXC.js → chunk-4XI4PDEH.js} +31 -21
- package/dist/bundle/{chunk-W5EUHV3J.js → chunk-4XPIOW5L.js} +1 -1
- package/dist/bundle/{chunk-PU4FKK5T.js → chunk-5NRBNGR3.js} +2 -2
- package/dist/bundle/{chunk-LYZNVNJA.js → chunk-67WW33JB.js} +49 -24
- package/dist/bundle/{chunk-3P4LUGXI.js → chunk-6LHTWR3X.js} +2 -2
- package/dist/bundle/{chunk-SG3WSP7Y.js → chunk-6RV7KXDF.js} +7 -7
- package/dist/bundle/{chunk-VYUSEJE4.js → chunk-6SLGIPLT.js} +2 -2
- package/dist/bundle/{chunk-EOZWDEJL.js → chunk-77GJITSU.js} +2 -2
- package/dist/bundle/{chunk-72A7CIPL.js → chunk-7ATLKYBN.js} +17 -17
- package/dist/bundle/{chunk-YSZQ5SZK.js → chunk-7DMMNCY2.js} +3 -3
- package/dist/bundle/chunk-ABCHE4YP.js +217 -0
- package/dist/bundle/{chunk-G3MXAGF2.js → chunk-AOSIU5T6.js} +51 -38
- package/dist/bundle/{chunk-TAQKNWCD.js → chunk-B3PTSX5D.js} +2 -2
- package/dist/bundle/{chunk-J3N2LL37.js → chunk-B45MFBBF.js} +6 -6
- package/dist/bundle/{chunk-GNRYFESK.js → chunk-BNUNZTOU.js} +25 -25
- package/dist/bundle/{chunk-SK3K2VHF.js → chunk-BPQNTYLN.js} +388 -299
- package/dist/bundle/{chunk-LKV3NRCJ.js → chunk-CMG54Q4X.js} +120 -32
- package/dist/bundle/{chunk-DP5DX45H.js → chunk-COU66X3X.js} +7 -5
- package/dist/bundle/{chunk-NKFRV2LB.js → chunk-CUSGSXSR.js} +2 -2
- package/dist/bundle/{chunk-MFS52LTZ.js → chunk-DLAFGSTN.js} +1 -1
- package/dist/bundle/{chunk-DKIIKMSE.js → chunk-E4QPLXZT.js} +47 -47
- package/dist/bundle/{chunk-MGYFSXI5.js → chunk-E4T7IJJO.js} +26 -26
- package/dist/bundle/{chunk-AJA5ZAV6.js → chunk-F32GKBMF.js} +22 -5
- package/dist/bundle/{chunk-DN7VHENQ.js → chunk-FAOVUALC.js} +13 -13
- package/dist/bundle/{chunk-EF2RCQ3L.js → chunk-FBJC7OCI.js} +1 -1
- package/dist/bundle/{chunk-HIAO4MPA.js → chunk-FQ54A7GI.js} +1 -1
- package/dist/bundle/{chunk-EXFAA4N3.js → chunk-FXY45HU7.js} +6 -6
- package/dist/bundle/{chunk-2EVRKK75.js → chunk-GNHPYQMM.js} +2 -2
- package/dist/bundle/{chunk-M5WLBRL7.js → chunk-H5EAHMQN.js} +11 -11
- package/dist/bundle/chunk-HF233RN4.js +335 -0
- package/dist/bundle/{chunk-24DLFGES.js → chunk-HTGBUE2U.js} +2 -2
- package/dist/bundle/{chunk-RSLXLUTS.js → chunk-IKZFR645.js} +10 -10
- package/dist/bundle/chunk-JKWYXBGK.js +380 -0
- package/dist/bundle/{chunk-DAQXO6SM.js → chunk-KGZHRJ7H.js} +4 -4
- package/dist/bundle/{chunk-ZK7Y5K63.js → chunk-KPZIQKOF.js} +1 -1
- package/dist/bundle/{chunk-7T3BUWJK.js → chunk-KXYURHVE.js} +118 -95
- package/dist/bundle/{chunk-4HZRZDMC.js → chunk-KZGHGU2M.js} +4 -4
- package/dist/bundle/{chunk-2TV7UTHK.js → chunk-KZV5GU7G.js} +8 -8
- package/dist/bundle/{chunk-YIMI6O7R.js → chunk-L7VIPVHL.js} +263 -199
- package/dist/bundle/{chunk-XLJV3ZOH.js → chunk-LPJ3S6GE.js} +1 -1
- package/dist/bundle/{chunk-HBYE4EP2.js → chunk-LX6DO44O.js} +1 -1
- package/dist/bundle/{chunk-3UMXCNDI.js → chunk-LXOSBFWW.js} +7 -7
- package/dist/bundle/{chunk-KUBCUE6T.js → chunk-M3EVVGR6.js} +2 -2
- package/dist/bundle/{chunk-WVXAQVLG.js → chunk-MBMDF5EL.js} +6 -6
- package/dist/bundle/{chunk-KUBWRI5E.js → chunk-MTAVA2LS.js} +2 -2
- package/dist/bundle/{chunk-AQDWGJZT.js → chunk-MVRCLMQL.js} +39 -2
- package/dist/bundle/{chunk-UOFOMU3T.js → chunk-NVN4O5IC.js} +14 -10
- package/dist/bundle/{chunk-SKENSSY2.js → chunk-O3WVOAT7.js} +408 -420
- package/dist/bundle/{chunk-EROQ5SC7.js → chunk-OLZE27RS.js} +2 -2
- package/dist/bundle/{chunk-22UBF6U6.js → chunk-OMUX4LSS.js} +4 -4
- package/dist/bundle/{chunk-QJCVOVNR.js → chunk-OU46OTTE.js} +3 -3
- package/dist/bundle/{chunk-JBGYI5BY.js → chunk-OVVDOVLN.js} +2 -2
- package/dist/bundle/{chunk-I45V6AFG.js → chunk-P2NRA7E5.js} +2 -2
- package/dist/bundle/{chunk-7PQY4ISY.js → chunk-PCUPOGKR.js} +6 -4
- package/dist/bundle/{chunk-4MC4Z45G.js → chunk-QHT2LZRW.js} +6 -6
- package/dist/bundle/{decode-UBPIHVNG.js → chunk-RGOBGHWE.js} +21 -18
- package/dist/bundle/{chunk-UOL4ILXT.js → chunk-RSXLI5GP.js} +79 -59
- package/dist/bundle/{chunk-RNX73QCL.js → chunk-S726LZCH.js} +6 -6
- package/dist/bundle/{chunk-TB72GE55.js → chunk-SVBM6F4Z.js} +1 -1
- package/dist/bundle/{chunk-GXACHTB2.js → chunk-T7IQMYPW.js} +15 -3
- package/dist/bundle/{chunk-Q4NDCDFG.js → chunk-TD4Y5LXG.js} +25 -22
- package/dist/bundle/{chunk-V2QOLHPM.js → chunk-U4Y2QQ2D.js} +3 -3
- package/dist/bundle/{chunk-ODFIV4OS.js → chunk-UPWHCUVA.js} +617 -380
- package/dist/bundle/{chunk-E3AMUYNB.js → chunk-UYAKSUT5.js} +5 -5
- package/dist/bundle/{chunk-J5ZVGKSZ.js → chunk-VARX3SBT.js} +1 -1
- package/dist/bundle/{chunk-IFXPNXAH.js → chunk-WVYSOV3C.js} +16 -4
- package/dist/bundle/{chunk-LZBWU2IA.js → chunk-XOJGXWTK.js} +8 -8
- package/dist/bundle/{chunk-4FTPE5SB.js → chunk-XX2PDQ54.js} +31 -211
- package/dist/bundle/{chunk-D6L35XQS.js → chunk-XZ4OVTA5.js} +9 -9
- package/dist/bundle/{chunk-XAF2LHZG.js → chunk-YESOQEOB.js} +735 -826
- package/dist/bundle/{cli-WIMAOCXF.js → cli-O4LAGYXI.js} +60 -54
- package/dist/bundle/command-contract-67QKBY6M.js +38 -0
- package/dist/bundle/config-ABURZDD2.js +78 -0
- package/dist/bundle/decode-WRMZJJCR.js +20 -0
- package/dist/bundle/{dist-YYDTME5J.js → dist-SQK4GIJT.js} +14 -14
- package/dist/bundle/{echarts-4OQHS575.js → echarts-3DOOJSQR.js} +2 -2
- package/dist/bundle/{embed-7JHEPBFD.js → embed-OYRHTMFI.js} +4 -4
- package/dist/bundle/{embedder-HTRPWR6T.js → embedder-ZAYCL22W.js} +7 -7
- package/dist/bundle/{first-run-I52ADRJ2.js → first-run-QXSPIXOQ.js} +8 -8
- package/dist/bundle/first-screen-MD6HWIJW.js +36 -0
- package/dist/bundle/{folders-5ZBUQHAM.js → folders-EXQLKXVK.js} +2 -2
- package/dist/bundle/{instructions-3QZBKKPF.js → instructions-GFEOB7XJ.js} +1 -1
- package/dist/bundle/{main-64VVZ5QG.js → main-RADF3CRI.js} +17 -16
- package/dist/bundle/{mcp-OQBZXELQ.js → mcp-WSGVVZWI.js} +2 -2
- package/dist/bundle/{meetings-RD3NU6NN.js → meetings-6BIIT42H.js} +4 -4
- package/dist/bundle/{node-R2BLYUSB.js → node-A3B2YRQI.js} +2 -2
- package/dist/bundle/{node-sqlite-DGEEDBXV.js → node-sqlite-XRP5FUDY.js} +3 -3
- package/dist/bundle/{oauth-NRZMCFH3.js → oauth-YICY4AN4.js} +5 -5
- package/dist/bundle/{open-SUGCOCAU.js → open-4CNKSQRB.js} +2 -2
- package/dist/bundle/openai-YYRO3X7I.js +22 -0
- package/dist/bundle/{output-file-SXV2ANW7.js → output-file-7BXYV6OL.js} +3 -3
- package/dist/bundle/{process-IX5YWGDP.js → process-A45QXKID.js} +1 -1
- package/dist/bundle/{program-WGNTV7NS.js → program-DTP7BRTW.js} +422 -431
- package/dist/bundle/{prompt-NICXDWN3.js → prompt-5LMKO7SE.js} +3 -3
- package/dist/bundle/{recognize-6DAHO6X6.js → recognize-MB6WRGUD.js} +4 -2
- package/dist/bundle/{remote-JZ3TXP6I.js → remote-PD7WMTTS.js} +5 -5
- package/dist/bundle/{rerank-YSXWCAGZ.js → rerank-7E6GQ5Y6.js} +5 -5
- package/dist/bundle/{run-log-APHZZWC7.js → run-log-TCFK4LEC.js} +53 -53
- package/dist/bundle/{chunk-HWZXQLR5.js → serve-JBT2BWHK.js} +8 -6
- package/dist/bundle/server-CFIKEPLG.js +66 -0
- package/dist/bundle/{chunk-EH6G2LEU.js → server-H2UPGGBI.js} +43 -10
- package/dist/bundle/{services-D64U72OE.js → services-SJOTKL5V.js} +33 -26
- package/dist/bundle/{speech-QLCQAT4O.js → speech-4SL25GSC.js} +28 -5
- package/dist/bundle/{state-KAD3R27T.js → state-FVMTDZ6B.js} +4 -4
- package/dist/bundle/{store-7UNPRLZ3.js → store-DNPKBUVO.js} +13 -13
- package/dist/bundle/{store-2BHHS77S.js → store-TI77SCNL.js} +15 -15
- package/dist/bundle/store-connection-GIFWWMNO.js +76 -0
- package/dist/bundle/store-maintenance-command-WBKGF2CZ.js +55 -0
- package/dist/bundle/{streaming-AK6Q2ZGQ.js → streaming-UHAHGPH5.js} +4 -4
- package/dist/bundle/{tokens-CCM3D4ZT.js → tokens-Y2MX6JBL.js} +4 -4
- package/dist/bundle/zm.js +1 -1
- package/dist/commands.d.ts +1 -2
- package/dist/commands.d.ts.map +1 -1
- package/dist/commands.js +3 -16
- package/dist/commands.js.map +1 -1
- package/dist/contract-overrides.d.ts +0 -2
- package/dist/contract-overrides.d.ts.map +1 -1
- package/dist/contract-overrides.js +0 -158
- package/dist/contract-overrides.js.map +1 -1
- package/dist/login.d.ts +1 -0
- package/dist/login.d.ts.map +1 -1
- package/dist/login.js +1 -1
- package/dist/login.js.map +1 -1
- package/dist/program-bindings.d.ts +1 -1
- package/dist/program-bindings.d.ts.map +1 -1
- package/dist/program-bindings.js +16 -18
- package/dist/program-bindings.js.map +1 -1
- package/dist/program.d.ts +2 -4
- package/dist/program.d.ts.map +1 -1
- package/dist/program.js.map +1 -1
- package/dist/read-only.d.ts.map +1 -1
- package/dist/read-only.js +3 -0
- package/dist/read-only.js.map +1 -1
- package/dist/recording-schedule-setup.d.ts.map +1 -1
- package/dist/recording-schedule-setup.js +1 -0
- package/dist/recording-schedule-setup.js.map +1 -1
- package/dist/run.d.ts.map +1 -1
- package/dist/run.js +82 -32
- package/dist/run.js.map +1 -1
- package/dist/setup-commands.d.ts.map +1 -1
- package/dist/setup-commands.js +14 -47
- package/dist/setup-commands.js.map +1 -1
- package/dist/store-commands.d.ts.map +1 -1
- package/dist/store-commands.js +4 -1
- package/dist/store-commands.js.map +1 -1
- package/dist/tokens.d.ts +15 -0
- package/dist/tokens.d.ts.map +1 -1
- package/dist/tokens.js +40 -1
- 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/all-profiles-7OZPJY76.js +0 -25
- package/dist/bundle/answer-policy-PVWMA2QC.js +0 -96
- package/dist/bundle/chunk-57LT4A2E.js +0 -48
- package/dist/bundle/chunk-XMCVB4Q4.js +0 -390
- package/dist/bundle/chunk-YLBNPI7H.js +0 -2
- package/dist/bundle/command-contract-J7PDZQMC.js +0 -38
- package/dist/bundle/config-G62PBNZF.js +0 -79
- package/dist/bundle/first-screen-XNCFWOLC.js +0 -36
- package/dist/bundle/mcp-5SJXWEJW.js +0 -92
- package/dist/bundle/mcp-ZMIPDB4R.js +0 -189
- package/dist/bundle/serve-7VWL475U.js +0 -19
- package/dist/bundle/server-7LABFAA5.js +0 -53
- package/dist/bundle/server-VFXB5WRG.js +0 -66
- package/dist/bundle/store-connection-QTMLZ7LR.js +0 -76
- package/dist/bundle/store-maintenance-command-ND6PQCVZ.js +0 -54
- package/dist/mcp-command.d.ts +0 -33
- package/dist/mcp-command.d.ts.map +0 -1
- package/dist/mcp-command.js +0 -143
- package/dist/mcp-command.js.map +0 -1
- package/dist/mcp.d.ts +0 -30
- package/dist/mcp.d.ts.map +0 -1
- package/dist/mcp.js +0 -110
- package/dist/mcp.js.map +0 -1
- /package/dist/bundle/{chunk-O5EHUB2V.js → chunk-62EDJKGP.js} +0 -0
|
@@ -16,7 +16,7 @@ import {
|
|
|
16
16
|
WORK_TASK_TYPES,
|
|
17
17
|
linkKind,
|
|
18
18
|
matches
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-6RV7KXDF.js";
|
|
20
20
|
import {
|
|
21
21
|
DEFAULT_STEMMERS,
|
|
22
22
|
DEFAULT_STEMMERS_VERSION,
|
|
@@ -29,13 +29,13 @@ import {
|
|
|
29
29
|
fold,
|
|
30
30
|
normalize,
|
|
31
31
|
parseStemmers
|
|
32
|
-
} from "./chunk-
|
|
32
|
+
} from "./chunk-KZV5GU7G.js";
|
|
33
33
|
import {
|
|
34
34
|
DEFAULT_TASK_CATEGORIES,
|
|
35
35
|
sharedConfigPath,
|
|
36
36
|
storedTaskCategories,
|
|
37
37
|
taskCategoriesReader
|
|
38
|
-
} from "./chunk-
|
|
38
|
+
} from "./chunk-UYAKSUT5.js";
|
|
39
39
|
import {
|
|
40
40
|
COUNTER_FIELDS,
|
|
41
41
|
DOCUMENT_ACCOUNT_PROVIDERS,
|
|
@@ -67,19 +67,19 @@ import {
|
|
|
67
67
|
rankingWords,
|
|
68
68
|
useStoredProviders,
|
|
69
69
|
validCounter
|
|
70
|
-
} from "./chunk-
|
|
70
|
+
} from "./chunk-FXY45HU7.js";
|
|
71
71
|
import {
|
|
72
72
|
normalizeTag,
|
|
73
73
|
tagOf
|
|
74
|
-
} from "./chunk-
|
|
74
|
+
} from "./chunk-OVVDOVLN.js";
|
|
75
75
|
import {
|
|
76
76
|
storePath
|
|
77
|
-
} from "./chunk-
|
|
77
|
+
} from "./chunk-M3EVVGR6.js";
|
|
78
78
|
import {
|
|
79
79
|
PRAGMAS,
|
|
80
80
|
quietSqliteWarning,
|
|
81
81
|
storeCapable
|
|
82
|
-
} from "./chunk-
|
|
82
|
+
} from "./chunk-MBMDF5EL.js";
|
|
83
83
|
import {
|
|
84
84
|
CHAT_MESSAGES_READ,
|
|
85
85
|
MEETING_FINDINGS_KIND,
|
|
@@ -106,7 +106,7 @@ import {
|
|
|
106
106
|
validateMeetingPreparationContext,
|
|
107
107
|
validateMeetingRelatedHistory,
|
|
108
108
|
validateMeetingSeriesHistory
|
|
109
|
-
} from "./chunk-
|
|
109
|
+
} from "./chunk-RSXLI5GP.js";
|
|
110
110
|
import {
|
|
111
111
|
QUERY_LIMITS,
|
|
112
112
|
dateRange,
|
|
@@ -117,7 +117,7 @@ import {
|
|
|
117
117
|
validateQuery,
|
|
118
118
|
walkQuery,
|
|
119
119
|
zonedMoment
|
|
120
|
-
} from "./chunk-
|
|
120
|
+
} from "./chunk-NVN4O5IC.js";
|
|
121
121
|
import {
|
|
122
122
|
CliError,
|
|
123
123
|
array,
|
|
@@ -136,7 +136,7 @@ import {
|
|
|
136
136
|
singleLine,
|
|
137
137
|
strictObject,
|
|
138
138
|
string
|
|
139
|
-
} from "./chunk-
|
|
139
|
+
} from "./chunk-L7VIPVHL.js";
|
|
140
140
|
import {
|
|
141
141
|
resolveFrom
|
|
142
142
|
} from "./chunk-Y5E2WNWB.js";
|
|
@@ -164,12 +164,12 @@ import {
|
|
|
164
164
|
sql,
|
|
165
165
|
sqliteTable,
|
|
166
166
|
text
|
|
167
|
-
} from "./chunk-
|
|
167
|
+
} from "./chunk-FQ54A7GI.js";
|
|
168
168
|
import {
|
|
169
169
|
__name
|
|
170
170
|
} from "./chunk-ZVVMGPBJ.js";
|
|
171
171
|
|
|
172
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
172
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.503.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e5d4ab9592406842b4a214ba16b749bd/node_modules/@wirecat/cli-core/dist/store/account-store.js
|
|
173
173
|
var bindArea = /* @__PURE__ */ __name(({ keyed, whole }, account) => {
|
|
174
174
|
const methods = whole;
|
|
175
175
|
return Object.fromEntries(Object.keys(keyed).map((name) => [
|
|
@@ -297,7 +297,7 @@ var bindAccount = /* @__PURE__ */ __name((store, account, areas, owners) => {
|
|
|
297
297
|
};
|
|
298
298
|
}, "bindAccount");
|
|
299
299
|
|
|
300
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
300
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.503.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e5d4ab9592406842b4a214ba16b749bd/node_modules/@wirecat/cli-core/dist/search/query.js
|
|
301
301
|
var isBotProvider = /* @__PURE__ */ __name((provider) => provider.endsWith("-bot"), "isBotProvider");
|
|
302
302
|
var inSource = /* @__PURE__ */ __name((source2, provider) => source2 === "all" || source2 === "bots" && isBotProvider(provider) || source2 === "personal" && !isBotProvider(provider) || source2 === provider || providerNamed(source2)?.name === provider || isKind(source2) && kindOf(provider) === source2, "inSource");
|
|
303
303
|
var fail = /* @__PURE__ */ __name((message2) => {
|
|
@@ -320,7 +320,7 @@ var sourceOf = /* @__PURE__ */ __name((name, value, providers2) => {
|
|
|
320
320
|
return fail(`${name} takes ${[...sources, "messages", "mail"].join(", ")} \u2014 not "${value}"`);
|
|
321
321
|
}, "sourceOf");
|
|
322
322
|
|
|
323
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
323
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.503.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e5d4ab9592406842b4a214ba16b749bd/node_modules/@wirecat/cli-core/dist/search/account-list.js
|
|
324
324
|
var ACCOUNT_GROUPS = "accountGroups";
|
|
325
325
|
var ACCOUNT_GROUPS_SETTING = "account_groups";
|
|
326
326
|
var GROUP_NAME = /^[a-z0-9][a-z0-9_-]*$/i;
|
|
@@ -507,7 +507,7 @@ var fitting = /* @__PURE__ */ __name((entries, kinds2, what, reasonOf = (kind3)
|
|
|
507
507
|
return { accounts: [...chosen.values()], skipped };
|
|
508
508
|
}, "fitting");
|
|
509
509
|
|
|
510
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
510
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.503.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e5d4ab9592406842b4a214ba16b749bd/node_modules/@wirecat/cli-core/dist/store/sqlite/drizzle/core.js
|
|
511
511
|
var IndexBuilderOn = class {
|
|
512
512
|
static {
|
|
513
513
|
__name(this, "IndexBuilderOn");
|
|
@@ -702,7 +702,7 @@ function alias(table, alias2) {
|
|
|
702
702
|
}
|
|
703
703
|
__name(alias, "alias");
|
|
704
704
|
|
|
705
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
705
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.503.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e5d4ab9592406842b4a214ba16b749bd/node_modules/@wirecat/cli-core/dist/store/sqlite/entity-types.js
|
|
706
706
|
var ENTITY_TABLES = {
|
|
707
707
|
account: "accounts",
|
|
708
708
|
attachment: "attachments",
|
|
@@ -742,7 +742,7 @@ var orphanPointers = /* @__PURE__ */ __name((database) => pointerPairs(database)
|
|
|
742
742
|
return { table, pointer, type, count, known: known2 };
|
|
743
743
|
}).filter(({ count }) => count > 0)), "orphanPointers");
|
|
744
744
|
|
|
745
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
745
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.503.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e5d4ab9592406842b4a214ba16b749bd/node_modules/@wirecat/cli-core/dist/store/sqlite/schema/canonical-tags.js
|
|
746
746
|
var canonicalTags = sqliteTable("canonical_tags", {
|
|
747
747
|
id: integer("id").primaryKey(),
|
|
748
748
|
name: text("name").notNull().unique(),
|
|
@@ -751,7 +751,7 @@ var canonicalTags = sqliteTable("canonical_tags", {
|
|
|
751
751
|
updatedAt: integer("updated_at").notNull()
|
|
752
752
|
});
|
|
753
753
|
|
|
754
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
754
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.503.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e5d4ab9592406842b4a214ba16b749bd/node_modules/@wirecat/cli-core/dist/store/sqlite/schema/document-transfers.js
|
|
755
755
|
var documentAnnotationTransfers = sqliteTable("document_annotation_transfers", {
|
|
756
756
|
sourceKey: text("source_key").notNull(),
|
|
757
757
|
collection: text("collection").notNull(),
|
|
@@ -761,13 +761,13 @@ var documentAnnotationTransfers = sqliteTable("document_annotation_transfers", {
|
|
|
761
761
|
createdAt: integer("created_at").notNull()
|
|
762
762
|
}, (table) => [primaryKey({ columns: [table.sourceKey, table.collection] })]);
|
|
763
763
|
|
|
764
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
764
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.503.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e5d4ab9592406842b4a214ba16b749bd/node_modules/@wirecat/cli-core/dist/store/sqlite/schema/document-index-pending.js
|
|
765
765
|
var documentIndexPending = sqliteTable("document_index_pending", {
|
|
766
766
|
id: integer("id").notNull(),
|
|
767
767
|
indexableType: text("indexable_type").notNull()
|
|
768
768
|
}, (table) => [primaryKey({ columns: [table.indexableType, table.id] })]);
|
|
769
769
|
|
|
770
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
770
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.503.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e5d4ab9592406842b4a214ba16b749bd/node_modules/@wirecat/cli-core/dist/store/sqlite/schema/tag-consolidations.js
|
|
771
771
|
var tagRedirects = sqliteTable("tag_redirects", {
|
|
772
772
|
sourceId: integer("source_id").primaryKey().references(() => canonicalTags.id),
|
|
773
773
|
survivorId: integer("survivor_id").notNull().references(() => canonicalTags.id),
|
|
@@ -793,7 +793,7 @@ var tagConsolidations = sqliteTable("tag_consolidations", {
|
|
|
793
793
|
index("tag_consolidations_by_actor_type_actor_id").on(table.actorType, table.actorId)
|
|
794
794
|
]);
|
|
795
795
|
|
|
796
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
796
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.503.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e5d4ab9592406842b4a214ba16b749bd/node_modules/@wirecat/cli-core/dist/store/sqlite/schema.js
|
|
797
797
|
var accounts = sqliteTable("accounts", {
|
|
798
798
|
id: integer("id").primaryKey(),
|
|
799
799
|
provider: text("provider").notNull(),
|
|
@@ -2289,7 +2289,7 @@ var storeSettings = sqliteTable("store_settings", {
|
|
|
2289
2289
|
at: integer("at").notNull()
|
|
2290
2290
|
});
|
|
2291
2291
|
|
|
2292
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
2292
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.503.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e5d4ab9592406842b4a214ba16b749bd/node_modules/@wirecat/cli-core/dist/store/sqlite/involvement-queue.js
|
|
2293
2293
|
var ARMS = [
|
|
2294
2294
|
[
|
|
2295
2295
|
"message",
|
|
@@ -2416,7 +2416,7 @@ var drainInvolvementQueue = /* @__PURE__ */ __name((database, cap = QUEUE_CAP) =
|
|
|
2416
2416
|
return recomputed;
|
|
2417
2417
|
}, "drainInvolvementQueue");
|
|
2418
2418
|
|
|
2419
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
2419
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.503.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e5d4ab9592406842b4a214ba16b749bd/node_modules/@wirecat/cli-core/dist/domain/mentions.js
|
|
2420
2420
|
import { domainToUnicode } from "node:url";
|
|
2421
2421
|
|
|
2422
2422
|
// node_modules/.pnpm/psl@1.15.0/node_modules/psl/dist/psl.mjs
|
|
@@ -12438,7 +12438,7 @@ var oa = /* @__PURE__ */ __name((e) => {
|
|
|
12438
12438
|
}, "oa");
|
|
12439
12439
|
var na = { parse: O, get: aa, isValid: oa };
|
|
12440
12440
|
|
|
12441
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
12441
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.503.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e5d4ab9592406842b4a214ba16b749bd/node_modules/@wirecat/cli-core/dist/domain/google-documents.js
|
|
12442
12442
|
var LINK = /https?:\/\/(?:(?:docs|drive|sheets|slides)\.google\.com|forms\.gle)(?:[/?#][^\s<>"'`]*)?/gi;
|
|
12443
12443
|
var ID = /^[\w-]{10,}$/;
|
|
12444
12444
|
var trimUrl = /* @__PURE__ */ __name((url) => {
|
|
@@ -12479,7 +12479,7 @@ var googleDocumentLinks = /* @__PURE__ */ __name((text5) => [...text5.matchAll(L
|
|
|
12479
12479
|
return { url, documentId: googleDocumentId(url) };
|
|
12480
12480
|
}), "googleDocumentLinks");
|
|
12481
12481
|
|
|
12482
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
12482
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.503.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e5d4ab9592406842b4a214ba16b749bd/node_modules/@wirecat/cli-core/dist/domain/phone-plans.generated.js
|
|
12483
12483
|
var PHONE_PLANS = [
|
|
12484
12484
|
{
|
|
12485
12485
|
country: "us",
|
|
@@ -12859,7 +12859,7 @@ var PHONE_PLANS = [
|
|
|
12859
12859
|
}
|
|
12860
12860
|
];
|
|
12861
12861
|
|
|
12862
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
12862
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.503.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e5d4ab9592406842b4a214ba16b749bd/node_modules/@wirecat/cli-core/dist/domain/phones.js
|
|
12863
12863
|
var PHONE_COUNTRIES = PHONE_PLANS.map((plan) => plan.country);
|
|
12864
12864
|
var DEFAULT_PHONE_COUNTRIES = ["ru"];
|
|
12865
12865
|
var parsePhoneCountries = /* @__PURE__ */ __name((value) => {
|
|
@@ -12900,7 +12900,7 @@ var nationalPhone = /* @__PURE__ */ __name((digits, countries, { anyType }) => {
|
|
|
12900
12900
|
return void 0;
|
|
12901
12901
|
}, "nationalPhone");
|
|
12902
12902
|
|
|
12903
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
12903
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.503.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e5d4ab9592406842b4a214ba16b749bd/node_modules/@wirecat/cli-core/dist/domain/places.js
|
|
12904
12904
|
var BEFORE = [
|
|
12905
12905
|
[/^(?:ул\.?|улиц[аеыу]|улицей)$/iu, "\u0443\u043B\u0438\u0446\u0430"],
|
|
12906
12906
|
[/^(?:пр-т|просп\.?|проспект[аеу]?)$/iu, "\u043F\u0440\u043E\u0441\u043F\u0435\u043A\u0442"],
|
|
@@ -13160,7 +13160,7 @@ var findPlaces = /* @__PURE__ */ __name((text5) => {
|
|
|
13160
13160
|
return found2.sort((a, b) => a.start - b.start);
|
|
13161
13161
|
}, "findPlaces");
|
|
13162
13162
|
|
|
13163
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
13163
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.503.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e5d4ab9592406842b4a214ba16b749bd/node_modules/@wirecat/cli-core/dist/domain/mentions.js
|
|
13164
13164
|
var MENTION_KINDS = ["phone", "email", "url", "document", "person-name", "place"];
|
|
13165
13165
|
var MENTION_VERSIONS = {
|
|
13166
13166
|
phone: 1,
|
|
@@ -13350,7 +13350,7 @@ var typedPhone = /* @__PURE__ */ __name((typed, { phoneCountries = DEFAULT_PHONE
|
|
|
13350
13350
|
};
|
|
13351
13351
|
}, "typedPhone");
|
|
13352
13352
|
|
|
13353
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
13353
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.503.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e5d4ab9592406842b4a214ba16b749bd/node_modules/@wirecat/cli-core/dist/domain/first-names.js
|
|
13354
13354
|
var RUSSIAN = "\u0410\u043B\u0435\u043A\u0441\u0430\u043D\u0434\u0440 \u0410\u043B\u0435\u043A\u0441\u0435\u0439 \u0410\u043D\u0430\u0442\u043E\u043B\u0438\u0439 \u0410\u043D\u0434\u0440\u0435\u0439 \u0410\u043D\u0442\u043E\u043D \u0410\u0440\u043A\u0430\u0434\u0438\u0439 \u0410\u0440\u0441\u0435\u043D\u0438\u0439 \u0410\u0440\u0442\u0451\u043C \u0410\u0440\u0442\u0435\u043C \u0410\u0440\u0442\u0443\u0440 \u0411\u043E\u0440\u0438\u0441 \u0412\u0430\u0434\u0438\u043C \u0412\u0430\u043B\u0435\u043D\u0442\u0438\u043D \u0412\u0430\u043B\u0435\u0440\u0438\u0439 \u0412\u0430\u0441\u0438\u043B\u0438\u0439 \u0412\u0438\u043A\u0442\u043E\u0440 \u0412\u0438\u0442\u0430\u043B\u0438\u0439 \u0412\u043B\u0430\u0434\u0438\u043C\u0438\u0440 \u0412\u043B\u0430\u0434\u0438\u0441\u043B\u0430\u0432 \u0412\u0441\u0435\u0432\u043E\u043B\u043E\u0434 \u0412\u044F\u0447\u0435\u0441\u043B\u0430\u0432 \u0413\u0435\u043D\u043D\u0430\u0434\u0438\u0439 \u0413\u0435\u043E\u0440\u0433\u0438\u0439 \u0413\u043B\u0435\u0431 \u0413\u0440\u0438\u0433\u043E\u0440\u0438\u0439 \u0414\u0430\u043D\u0438\u0438\u043B \u0414\u0430\u043D\u0438\u043B\u0430 \u0414\u0435\u043D\u0438\u0441 \u0414\u043C\u0438\u0442\u0440\u0438\u0439 \u0415\u0432\u0433\u0435\u043D\u0438\u0439 \u0415\u0433\u043E\u0440 \u0418\u0432\u0430\u043D \u0418\u0433\u043E\u0440\u044C \u0418\u043B\u044C\u044F \u041A\u0438\u0440\u0438\u043B\u043B \u041A\u043E\u043D\u0441\u0442\u0430\u043D\u0442\u0438\u043D \u041B\u0435\u043E\u043D\u0438\u0434 \u041C\u0430\u043A\u0441\u0438\u043C \u041C\u0430\u0440\u0430\u0442 \u041C\u0430\u0442\u0432\u0435\u0439 \u041C\u0438\u0445\u0430\u0438\u043B \u041D\u0438\u043A\u0438\u0442\u0430 \u041D\u0438\u043A\u043E\u043B\u0430\u0439 \u041E\u043B\u0435\u0433 \u041F\u0430\u0432\u0435\u043B \u041F\u0451\u0442\u0440 \u041F\u0435\u0442\u0440 \u0420\u043E\u0434\u0438\u043E\u043D \u0420\u043E\u0441\u0442\u0438\u0441\u043B\u0430\u0432 \u0420\u0443\u0441\u043B\u0430\u043D \u0420\u0443\u0441\u0442\u0430\u043C \u0421\u0435\u043C\u0451\u043D \u0421\u0435\u043C\u0435\u043D \u0421\u0435\u0440\u0433\u0435\u0439 \u0421\u0442\u0430\u043D\u0438\u0441\u043B\u0430\u0432 \u0421\u0442\u0435\u043F\u0430\u043D \u0422\u0438\u043C\u043E\u0444\u0435\u0439 \u0422\u0438\u043C\u0443\u0440 \u0424\u0451\u0434\u043E\u0440 \u0424\u0435\u0434\u043E\u0440 \u0424\u0438\u043B\u0438\u043F\u043F \u042D\u0434\u0443\u0430\u0440\u0434 \u042E\u0440\u0438\u0439 \u042F\u0440\u043E\u0441\u043B\u0430\u0432 \u042F\u043A\u043E\u0432 \u042D\u043B\u044C\u0434\u0430\u0440 \u0414\u0430\u0432\u0438\u0434 \u0417\u0430\u0445\u0430\u0440 \u0421\u0430\u0432\u0435\u043B\u0438\u0439 \u041C\u0438\u0440\u043E\u043D \u041F\u043B\u0430\u0442\u043E\u043D \u0414\u0435\u043C\u0438\u0434 \u0410\u0440\u0441\u0435\u043D \u041D\u0443\u0440\u043B\u0430\u043D \u0410\u043D\u0437\u043E\u0440 \u0410\u043B\u0435\u043A\u0441\u0430\u043D\u0434\u0440\u0430 \u0410\u043B\u0438\u043D\u0430 \u0410\u043B\u0438\u0441\u0430 \u0410\u043B\u043B\u0430 \u0410\u043D\u0430\u0441\u0442\u0430\u0441\u0438\u044F \u0410\u043D\u0433\u0435\u043B\u0438\u043D\u0430 \u0410\u043D\u043D\u0430 \u0410\u043D\u0442\u043E\u043D\u0438\u043D\u0430 \u0412\u0430\u043B\u0435\u043D\u0442\u0438\u043D\u0430 \u0412\u0430\u043B\u0435\u0440\u0438\u044F \u0412\u0430\u0440\u0432\u0430\u0440\u0430 \u0412\u0435\u0440\u043E\u043D\u0438\u043A\u0430 \u0412\u0438\u043A\u0442\u043E\u0440\u0438\u044F \u0413\u0430\u043B\u0438\u043D\u0430 \u0414\u0430\u0440\u044C\u044F \u0414\u0438\u0430\u043D\u0430 \u0415\u0432\u0433\u0435\u043D\u0438\u044F \u0415\u043A\u0430\u0442\u0435\u0440\u0438\u043D\u0430 \u0415\u043B\u0435\u043D\u0430 \u0415\u043B\u0438\u0437\u0430\u0432\u0435\u0442\u0430 \u0416\u0430\u043D\u043D\u0430 \u0417\u0438\u043D\u0430\u0438\u0434\u0430 \u041A\u0430\u0440\u0438\u043D\u0430 \u041A\u0438\u0440\u0430 \u041A\u043B\u0430\u0432\u0434\u0438\u044F \u041A\u0440\u0438\u0441\u0442\u0438\u043D\u0430 \u041A\u0441\u0435\u043D\u0438\u044F \u041B\u0430\u0440\u0438\u0441\u0430 \u041B\u0438\u0434\u0438\u044F \u041B\u044E\u0434\u043C\u0438\u043B\u0430 \u041C\u0430\u0440\u0433\u0430\u0440\u0438\u0442\u0430 \u041C\u0430\u0440\u0438\u043D\u0430 \u041C\u0430\u0440\u0438\u044F \u041C\u0438\u043B\u0430\u043D\u0430 \u041D\u0430\u0442\u0430\u043B\u044C\u044F \u041D\u0430\u0442\u0430\u043B\u0438\u044F \u041D\u0438\u043D\u0430 \u041E\u043A\u0441\u0430\u043D\u0430 \u041E\u043B\u0435\u0441\u044F \u041E\u043B\u044C\u0433\u0430 \u041F\u043E\u043B\u0438\u043D\u0430 \u0420\u0430\u0438\u0441\u0430 \u0421\u0432\u0435\u0442\u043B\u0430\u043D\u0430 \u0421\u043E\u0444\u0438\u044F \u0421\u043E\u0444\u044C\u044F \u0422\u0430\u0438\u0441\u0438\u044F \u0422\u0430\u043C\u0430\u0440\u0430 \u0422\u0430\u0442\u044C\u044F\u043D\u0430 \u0423\u043B\u044C\u044F\u043D\u0430 \u042E\u043B\u0438\u044F \u042D\u043B\u044C\u0432\u0438\u0440\u0430 \u0420\u0435\u0433\u0438\u043D\u0430 \u0421\u043D\u0435\u0436\u0430\u043D\u0430 \u0410\u043B\u0451\u043D\u0430 \u0410\u043B\u0435\u043D\u0430 \u0412\u0430\u0441\u0438\u043B\u0438\u0441\u0430 \u0410\u0440\u0438\u043D\u0430 \u0415\u0441\u0435\u043D\u0438\u044F \u042D\u0432\u0435\u043B\u0438\u043D\u0430 \u0421\u0430\u0448\u0430 \u0416\u0435\u043D\u044F \u0412\u0430\u043B\u044F \u0414\u0438\u043C\u0430 \u041C\u0438\u0448\u0430 \u041A\u043E\u043B\u044F \u041F\u0435\u0442\u044F \u0412\u0430\u0441\u044F \u0421\u0435\u0440\u0451\u0436\u0430 \u0421\u0435\u0440\u0435\u0436\u0430 \u041F\u0430\u0448\u0430 \u041B\u0451\u0448\u0430 \u041B\u0435\u0448\u0430 \u0412\u0438\u0442\u044F \u041A\u043E\u0441\u0442\u044F \u0412\u043E\u0432\u0430 \u0412\u043E\u043B\u043E\u0434\u044F \u0412\u0430\u043D\u044F \u0413\u043E\u0448\u0430 \u0413\u0440\u0438\u0448\u0430 \u0422\u043E\u043B\u044F \u0411\u043E\u0440\u044F \u0421\u0442\u0430\u0441 \u0422\u0451\u043C\u0430 \u0422\u0430\u043D\u044F \u041A\u0430\u0442\u044F \u041B\u0435\u043D\u0430 \u041D\u0430\u0442\u0430\u0448\u0430 \u0421\u0432\u0435\u0442\u0430 \u042E\u043B\u044F \u041D\u0430\u0441\u0442\u044F \u0414\u0430\u0448\u0430 \u041C\u0430\u0448\u0430 \u041B\u044E\u0434\u0430 \u0413\u0430\u043B\u044F \u0412\u0438\u043A\u0430 \u041A\u0441\u044E\u0448\u0430 \u041B\u0438\u0437\u0430 \u0421\u043E\u043D\u044F \u041D\u0430\u0434\u044F \u041B\u0435\u0440\u0430 \u0410\u043B\u0451\u0448\u0430 \u0410\u043B\u0435\u0448\u0430 \u041C\u0438\u0442\u044F \u0421\u0435\u043D\u044F \u0424\u0435\u0434\u044F \u0416\u0435\u043D\u0435\u0447\u043A\u0430 \u041E\u043B\u0435\u043D\u044C\u043A\u0430 \u0422\u0430\u043D\u0435\u0447\u043A\u0430";
|
|
13355
13355
|
var EUROPEAN = "James John Robert Michael William David Richard Joseph Thomas Charles Christopher Daniel Matthew Anthony Donald Steven Paul Andrew Joshua Kenneth Kevin Brian George Timothy Ronald Edward Jason Jeffrey Ryan Jacob Gary Nicholas Eric Jonathan Stephen Larry Justin Scott Brandon Benjamin Samuel Gregory Alexander Patrick Raymond Dennis Jerry Tyler Aaron Nathan Henry Peter Zachary Douglas Harold Kyle Noah Ethan Oliver Harry Lucas Liam Mary Patricia Jennifer Linda Elizabeth Barbara Susan Jessica Sarah Karen Lisa Nancy Betty Margaret Sandra Ashley Kimberly Emily Donna Michelle Carol Amanda Dorothy Melissa Deborah Stephanie Rebecca Sharon Laura Cynthia Kathleen Angela Shirley Anna Brenda Pamela Emma Nicole Helen Samantha Katherine Christine Rachel Carolyn Janet Catherine Maria Heather Diane Ruth Julie Olivia Joyce Kelly Lauren Christina Joan Evelyn Judith Megan Andrea Cheryl Hannah Jacqueline Martha Teresa Sara Madison Frances Kathryn Janice Abigail Alice Julia Judy Sophia Denise Doris Marilyn Danielle Beverly Isabella Theresa Diana Natalie Charlotte Marie Kayla Alexis Javier Carlos Antonio Manuel Francisco Juan Pedro Alejandro Miguel Rafael Pablo Sergio Fernando Jorge Luis Alberto \xC1lvaro Diego Adri\xE1n Rub\xE9n Iv\xE1n \xD3scar Andr\xE9s Ra\xFAl Enrique Vicente Joaqu\xEDn Ignacio Gonzalo Marcos V\xEDctor Jaime Alfonso Guillermo Tom\xE1s Emilio Gabriel Nicol\xE1s Mart\xEDn Jordi Josep Xavier Luc\xEDa Carmen Isabel Cristina Marta Elena Raquel Silvia Beatriz Paula Nuria N\xFAria Sonia Alicia Irene Montserrat Inmaculada Noelia Lorena Sof\xEDa Valeria Claudia Natalia Sandra Ver\xF3nica Esther Yolanda Vanesa Laia Klaus J\xFCrgen Wolfgang Stefan Andreas Matthias Markus Tobias Florian Lukas Jonas Maximilian Sebastian Dirk Sabine Ursula Petra Monika Katrin Anja Pierre Michel Philippe Alain Fran\xE7ois Christophe Laurent Olivier Julien Mathieu S\xE9bastien Guillaume Antoine Camille Nathalie Isabelle Sylvie Sophie C\xE9line Aur\xE9lie Chlo\xE9 Manon Giuseppe Giovanni Marco Luca Francesco Alessandro Matteo Lorenzo Stefano Paolo Roberto Davide Simone Federico Giulia Francesca Chiara Valentina Alessia Martina Elisa Jo\xE3o Pedro Tiago Beatriz In\xEAs Mariana Piotr Krzysztof Tomasz Marcin Agnieszka Katarzyna Ma\u0142gorzata Magdalena";
|
|
13356
13356
|
var WORDS = "\u0412\u0435\u0440\u0430 \u041D\u0430\u0434\u0435\u0436\u0434\u0430 \u041B\u044E\u0431\u043E\u0432\u044C \u0421\u043B\u0430\u0432\u0430 \u0420\u043E\u043C\u0430\u043D \u0420\u043E\u0437\u0430 \u041C\u0430\u0439\u044F \u041B\u0438\u043B\u0438\u044F \u0417\u043B\u0430\u0442\u0430 \u041C\u0438\u043B\u0430 \u041D\u0438\u043A\u0430 \u041B\u0435\u0432 \u0413\u043B\u043E\u0440\u0438\u044F Will Mark Rose Grace Hope Faith Bill Frank Jack June April Summer Amber Ruby Lily Daisy Victoria Virginia Georgia Florence Sydney Chelsea Jordan Austin Dallas Mercedes Dolores Rosa Pilar Marina Esperanza Gloria Amparo Consuelo Roc\xEDo Salvador Santiago Jes\xFAs \xC1ngeles Hugo Ram\xF3n Christian Felix F\xE9lix Mario Martin Victor Pierre Paz Merc\xE8 Estrella Aurora Concepci\xF3n Remedios Soledad Milagros Angel \xC1ngel Dawn Joy Holly Ivy Iris Violet Pearl";
|
|
@@ -13358,7 +13358,7 @@ var NOT_NAMES = ["\u0436\u0435\u043D\u0430", "\u0436\u0435\u043D\u044B", "\u0436
|
|
|
13358
13358
|
var FIRST_NAMES = [...new Set(`${RUSSIAN} ${EUROPEAN}`.split(" "))];
|
|
13359
13359
|
var NAME_WORDS = WORDS.split(" ");
|
|
13360
13360
|
|
|
13361
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
13361
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.503.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e5d4ab9592406842b4a214ba16b749bd/node_modules/@wirecat/cli-core/dist/domain/person-names.js
|
|
13362
13362
|
var LATIN_TO_CYRILLIC = {
|
|
13363
13363
|
shch: "\u0449",
|
|
13364
13364
|
sch: "\u0449",
|
|
@@ -13566,7 +13566,7 @@ var findUnknownNames = /* @__PURE__ */ __name((text5, stem, taken) => {
|
|
|
13566
13566
|
return found2;
|
|
13567
13567
|
}, "findUnknownNames");
|
|
13568
13568
|
|
|
13569
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
13569
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.503.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e5d4ab9592406842b4a214ba16b749bd/node_modules/@wirecat/cli-core/dist/domain/attachments.js
|
|
13570
13570
|
var NOT_FILES = /* @__PURE__ */ new Set([
|
|
13571
13571
|
"webpage",
|
|
13572
13572
|
"share",
|
|
@@ -13598,7 +13598,7 @@ var matchDownloads = /* @__PURE__ */ __name((stored3, files2) => {
|
|
|
13598
13598
|
});
|
|
13599
13599
|
}, "matchDownloads");
|
|
13600
13600
|
|
|
13601
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
13601
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.503.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e5d4ab9592406842b4a214ba16b749bd/node_modules/@wirecat/cli-core/dist/search/lucene/types.js
|
|
13602
13602
|
var QUERY_VERSION = 1;
|
|
13603
13603
|
var QUERY_LIMITS2 = {
|
|
13604
13604
|
...QUERY_LIMITS,
|
|
@@ -13629,7 +13629,7 @@ function exhausted(budget) {
|
|
|
13629
13629
|
}
|
|
13630
13630
|
__name(exhausted, "exhausted");
|
|
13631
13631
|
|
|
13632
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
13632
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.503.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e5d4ab9592406842b4a214ba16b749bd/node_modules/@wirecat/cli-core/dist/search/lucene/automaton.js
|
|
13633
13633
|
var any = { kind: "char", ranges: [[0, 1114111]], negate: false };
|
|
13634
13634
|
var literal2 = /* @__PURE__ */ __name((c) => ({
|
|
13635
13635
|
kind: "char",
|
|
@@ -14029,7 +14029,7 @@ var foldRegex = /* @__PURE__ */ __name((pattern, span) => {
|
|
|
14029
14029
|
return out;
|
|
14030
14030
|
}, "foldRegex");
|
|
14031
14031
|
|
|
14032
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
14032
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.503.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e5d4ab9592406842b4a214ba16b749bd/node_modules/@wirecat/cli-core/dist/search/lucene/presets.js
|
|
14033
14033
|
var PRESET_VERSION = 1;
|
|
14034
14034
|
var PRESETS = {
|
|
14035
14035
|
password: {
|
|
@@ -14083,7 +14083,7 @@ var PRESETS = {
|
|
|
14083
14083
|
}
|
|
14084
14084
|
};
|
|
14085
14085
|
|
|
14086
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
14086
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.503.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e5d4ab9592406842b4a214ba16b749bd/node_modules/@wirecat/cli-core/dist/search/lucene/registry.js
|
|
14087
14087
|
var FIELD_VERSION = 2;
|
|
14088
14088
|
var UNITS = {
|
|
14089
14089
|
"": 1,
|
|
@@ -14583,12 +14583,12 @@ var QUERY_OPERATORS = [
|
|
|
14583
14583
|
{ name: "boost / minimum / intervals", example: "invoice^2", semantics: "query.unsupported-operator" }
|
|
14584
14584
|
];
|
|
14585
14585
|
|
|
14586
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
14586
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.503.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e5d4ab9592406842b4a214ba16b749bd/node_modules/@wirecat/cli-core/dist/search/lucene/resolved.js
|
|
14587
14587
|
var hasText = /* @__PURE__ */ __name((node) => node.kind === "predicate" ? node.field === "text" || node.field === "exact" : node.clauses.some(({ node: node2 }) => hasText(node2)), "hasText");
|
|
14588
14588
|
var isStemmed = /* @__PURE__ */ __name((node) => node.field === "text" && (node.operator === "term" || node.operator === "phrase") && node.value !== "", "isStemmed");
|
|
14589
14589
|
var hasStems = /* @__PURE__ */ __name((node) => node.kind === "predicate" ? isStemmed(node) : node.clauses.some(({ node: node2 }) => hasStems(node2)), "hasStems");
|
|
14590
14590
|
|
|
14591
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
14591
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.503.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e5d4ab9592406842b4a214ba16b749bd/node_modules/@wirecat/cli-core/dist/store/sqlite/mention-links.js
|
|
14592
14592
|
var LIVE = "mn.kind = 'url' AND mn.status <> 'dismissed'";
|
|
14593
14593
|
var MAIL_ROWS = `SELECT mn.source_id FROM mentions mn WHERE mn.source_type = 'email' AND ${LIVE}`;
|
|
14594
14594
|
var linkMatch = /* @__PURE__ */ __name((field3, typed, mail, mentioned2) => {
|
|
@@ -14612,7 +14612,7 @@ var linkMatch = /* @__PURE__ */ __name((field3, typed, mail, mentioned2) => {
|
|
|
14612
14612
|
};
|
|
14613
14613
|
}, "linkMatch");
|
|
14614
14614
|
|
|
14615
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
14615
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.503.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e5d4ab9592406842b4a214ba16b749bd/node_modules/@wirecat/cli-core/dist/store/sqlite/phone-countries.js
|
|
14616
14616
|
var SETTING = "phoneCountries";
|
|
14617
14617
|
var savedPhoneCountries = /* @__PURE__ */ __name((database) => {
|
|
14618
14618
|
const row2 = database.prepare("SELECT value FROM store_settings WHERE key = ?").get(SETTING);
|
|
@@ -14643,7 +14643,7 @@ var valueMatch = /* @__PURE__ */ __name((database, typed) => {
|
|
|
14643
14643
|
return { sql: "mn.value = ?", params: [phone?.value ?? normalizedValue(typed, { phoneCountries })] };
|
|
14644
14644
|
}, "valueMatch");
|
|
14645
14645
|
|
|
14646
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
14646
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.503.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e5d4ab9592406842b4a214ba16b749bd/node_modules/@wirecat/cli-core/dist/domain/vocabulary.js
|
|
14647
14647
|
var normalizeVocabularyName = /* @__PURE__ */ __name((input) => {
|
|
14648
14648
|
if (typeof input !== "string" || input.length > 200 || /[\p{Cc}\p{Cf}]/u.test(input))
|
|
14649
14649
|
throw new CliError("validation_error", "a vocabulary name takes 1\u2013200 characters without control characters");
|
|
@@ -14671,7 +14671,7 @@ var vocabularySimilarity = /* @__PURE__ */ __name((left, right) => {
|
|
|
14671
14671
|
return 2 * intersection2 / (aa2.size + bb.size);
|
|
14672
14672
|
}, "vocabularySimilarity");
|
|
14673
14673
|
|
|
14674
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
14674
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.503.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e5d4ab9592406842b4a214ba16b749bd/node_modules/@wirecat/cli-core/dist/store/sqlite/tag-creation.js
|
|
14675
14675
|
import { createHash } from "node:crypto";
|
|
14676
14676
|
var folded2 = /* @__PURE__ */ __name((name) => {
|
|
14677
14677
|
try {
|
|
@@ -14737,7 +14737,7 @@ var guardTagCreation = /* @__PURE__ */ __name((context, name, kind3, by, options
|
|
|
14737
14737
|
});
|
|
14738
14738
|
}, "guardTagCreation");
|
|
14739
14739
|
|
|
14740
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
14740
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.503.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e5d4ab9592406842b4a214ba16b749bd/node_modules/@wirecat/cli-core/dist/domain/tag-redirects.js
|
|
14741
14741
|
var invalid = /* @__PURE__ */ __name((message2) => {
|
|
14742
14742
|
throw new CliError("validation_error", message2);
|
|
14743
14743
|
}, "invalid");
|
|
@@ -14814,7 +14814,7 @@ var createTagRedirectIndex = /* @__PURE__ */ __name((snapshot2) => {
|
|
|
14814
14814
|
};
|
|
14815
14815
|
}, "createTagRedirectIndex");
|
|
14816
14816
|
|
|
14817
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
14817
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.503.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e5d4ab9592406842b4a214ba16b749bd/node_modules/@wirecat/cli-core/dist/store/sqlite/tag-resolution.js
|
|
14818
14818
|
var tagCanonicalId = /* @__PURE__ */ __name((database, id2) => {
|
|
14819
14819
|
const row2 = database.prepare("SELECT canonical_id FROM resolved_tags WHERE id=?").get(id2);
|
|
14820
14820
|
if (!row2)
|
|
@@ -14842,7 +14842,7 @@ var tagRedirectSnapshot = /* @__PURE__ */ __name((database) => {
|
|
|
14842
14842
|
return snapshot2;
|
|
14843
14843
|
}, "tagRedirectSnapshot");
|
|
14844
14844
|
|
|
14845
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
14845
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.503.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e5d4ab9592406842b4a214ba16b749bd/node_modules/@wirecat/cli-core/dist/store/sqlite/task-keys.js
|
|
14846
14846
|
import { createHash as createHash2 } from "node:crypto";
|
|
14847
14847
|
var TASK_KEY_PREFIXES = {
|
|
14848
14848
|
question: "Q",
|
|
@@ -14870,7 +14870,7 @@ var taskAccountOf = /* @__PURE__ */ __name((database, rowId) => {
|
|
|
14870
14870
|
return row2 && String(row2.key) === inboxKey(String(row2.name)) ? String(row2.name) : void 0;
|
|
14871
14871
|
}, "taskAccountOf");
|
|
14872
14872
|
|
|
14873
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
14873
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.503.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e5d4ab9592406842b4a214ba16b749bd/node_modules/@wirecat/cli-core/dist/store/sqlite/things.js
|
|
14874
14874
|
var storedThing = /* @__PURE__ */ __name((type, id2) => ({ type: String(type), id: Number(id2) }), "storedThing");
|
|
14875
14875
|
var REFERABLE = {
|
|
14876
14876
|
note: { tombstone: true },
|
|
@@ -15028,11 +15028,11 @@ var taskIdOf = /* @__PURE__ */ __name((database, rowId) => {
|
|
|
15028
15028
|
}, "taskIdOf");
|
|
15029
15029
|
var canonicalThingReference = /* @__PURE__ */ __name((reference2) => reference2.trim().startsWith("meeting:") ? canonicalMeetingReference(reference2) : canonicalReference(reference2), "canonicalThingReference");
|
|
15030
15030
|
|
|
15031
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
15032
|
-
var toMs = /* @__PURE__ */ __name((
|
|
15033
|
-
if (
|
|
15031
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.503.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e5d4ab9592406842b4a214ba16b749bd/node_modules/@wirecat/cli-core/dist/store/sqlite/values.js
|
|
15032
|
+
var toMs = /* @__PURE__ */ __name((iso11) => {
|
|
15033
|
+
if (iso11 === null || iso11 === void 0)
|
|
15034
15034
|
return null;
|
|
15035
|
-
const ms = Date.parse(
|
|
15035
|
+
const ms = Date.parse(iso11);
|
|
15036
15036
|
return Number.isNaN(ms) ? null : ms;
|
|
15037
15037
|
}, "toMs");
|
|
15038
15038
|
var toIso = /* @__PURE__ */ __name((ms) => typeof ms === "number" ? new Date(ms).toISOString() : null, "toIso");
|
|
@@ -15042,7 +15042,7 @@ var present = /* @__PURE__ */ __name((entries) => Object.fromEntries(Object.entr
|
|
|
15042
15042
|
var DELIVERY = { delivered: 1, read: 2 };
|
|
15043
15043
|
var deliveryOf = /* @__PURE__ */ __name((stored3) => stored3 === DELIVERY.read ? "read" : stored3 === DELIVERY.delivered ? "delivered" : void 0, "deliveryOf");
|
|
15044
15044
|
|
|
15045
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
15045
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.503.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e5d4ab9592406842b4a214ba16b749bd/node_modules/@wirecat/cli-core/dist/store/sqlite/tags.js
|
|
15046
15046
|
var TAG_KINDS = ["tag", "topic"];
|
|
15047
15047
|
var TAGGABLE = { chat: "chat", contact: "identity", message: "message", task: "task" };
|
|
15048
15048
|
var TAG_TYPE = {
|
|
@@ -15233,7 +15233,7 @@ var tagsOf = /* @__PURE__ */ __name(({ database }, key2, filter) => {
|
|
|
15233
15233
|
return result;
|
|
15234
15234
|
}, "tagsOf");
|
|
15235
15235
|
|
|
15236
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
15236
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.503.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e5d4ab9592406842b4a214ba16b749bd/node_modules/@wirecat/cli-core/dist/store/sqlite/lucene-fields.js
|
|
15237
15237
|
var speech = /* @__PURE__ */ __name((alias2) => `(coalesce(${alias2}.extractor,'') LIKE 'speech:%' OR ${alias2}.kind IN ('voice','video_note') OR coalesce(${alias2}.mime,'')='audio/ogg')`, "speech");
|
|
15238
15238
|
var SPEECH = speech("att");
|
|
15239
15239
|
var mentionText = /* @__PURE__ */ __name((alias2) => `CASE WHEN coalesce(json_extract(${alias2}.contact, '$.phone'), '') <> '' THEN 'phone: ' || json_extract(${alias2}.contact, '$.phone') ELSE ${alias2}.text END`, "mentionText");
|
|
@@ -15588,7 +15588,7 @@ var FIELD_COMPILERS = {
|
|
|
15588
15588
|
subject
|
|
15589
15589
|
};
|
|
15590
15590
|
|
|
15591
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
15591
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.503.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e5d4ab9592406842b4a214ba16b749bd/node_modules/@wirecat/cli-core/dist/store/sqlite/place-key.js
|
|
15592
15592
|
var placeOf = /* @__PURE__ */ __name((database) => {
|
|
15593
15593
|
const exact = database.prepare("SELECT id FROM places WHERE folded = ?");
|
|
15594
15594
|
const onStreet = database.prepare("SELECT id FROM places WHERE substr(folded, 1, ?) = ? LIMIT 2");
|
|
@@ -15604,7 +15604,7 @@ var placeOf = /* @__PURE__ */ __name((database) => {
|
|
|
15604
15604
|
};
|
|
15605
15605
|
}, "placeOf");
|
|
15606
15606
|
|
|
15607
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
15607
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.503.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e5d4ab9592406842b4a214ba16b749bd/node_modules/@wirecat/cli-core/dist/store/sqlite/mention-drain.js
|
|
15608
15608
|
var DRAIN_ON_WRITE = 500;
|
|
15609
15609
|
var METHOD = "rules";
|
|
15610
15610
|
var telegramLink = /* @__PURE__ */ __name((database) => {
|
|
@@ -15767,7 +15767,7 @@ var drainMentions = /* @__PURE__ */ __name((database, now2, limit = DRAIN_ON_WRI
|
|
|
15767
15767
|
return queued.length;
|
|
15768
15768
|
}, "drainMentions");
|
|
15769
15769
|
|
|
15770
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
15770
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.503.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e5d4ab9592406842b4a214ba16b749bd/node_modules/@wirecat/cli-core/dist/store/sqlite/index-state.js
|
|
15771
15771
|
var indexRow = /* @__PURE__ */ __name((database, name) => {
|
|
15772
15772
|
const exists2 = database.prepare("SELECT 1 FROM sqlite_master WHERE name = 'search_index_state'").get();
|
|
15773
15773
|
if (!exists2)
|
|
@@ -15775,7 +15775,7 @@ var indexRow = /* @__PURE__ */ __name((database, name) => {
|
|
|
15775
15775
|
return database.prepare("SELECT * FROM search_index_state WHERE name = ?").get(name);
|
|
15776
15776
|
}, "indexRow");
|
|
15777
15777
|
|
|
15778
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
15778
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.503.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e5d4ab9592406842b4a214ba16b749bd/node_modules/@wirecat/cli-core/dist/store/sqlite/stems.js
|
|
15779
15779
|
var INDEX = "message_stems";
|
|
15780
15780
|
var SETTING2 = "searchStemmers";
|
|
15781
15781
|
var DRAIN_ON_WRITE2 = 500;
|
|
@@ -15878,14 +15878,14 @@ var stemWriter = /* @__PURE__ */ __name((database, stemmer) => {
|
|
|
15878
15878
|
};
|
|
15879
15879
|
}, "stemWriter");
|
|
15880
15880
|
var nextQueued = /* @__PURE__ */ __name((database, limit) => database.prepare("SELECT id AS pk FROM message_stems_pending ORDER BY id LIMIT ?").all(limit).map((row2) => Number(row2.pk)), "nextQueued");
|
|
15881
|
-
var drainStems = /* @__PURE__ */ __name((database,
|
|
15881
|
+
var drainStems = /* @__PURE__ */ __name((database, stemmerFor2, limit = DRAIN_ON_WRITE2) => {
|
|
15882
15882
|
const pks = nextQueued(database, limit);
|
|
15883
15883
|
if (pks.length === 0)
|
|
15884
15884
|
return 0;
|
|
15885
15885
|
const stemmers = storeStemmers(database);
|
|
15886
15886
|
if (!stemmers)
|
|
15887
15887
|
return 0;
|
|
15888
|
-
const stemmer =
|
|
15888
|
+
const stemmer = stemmerFor2(stemmers);
|
|
15889
15889
|
return claim(database, stemmer.identity) ? stemWriter(database, stemmer).queued(pks) : 0;
|
|
15890
15890
|
}, "drainStems");
|
|
15891
15891
|
var stemmerCache = /* @__PURE__ */ __name(() => {
|
|
@@ -15897,7 +15897,7 @@ var stemmerCache = /* @__PURE__ */ __name(() => {
|
|
|
15897
15897
|
};
|
|
15898
15898
|
}, "stemmerCache");
|
|
15899
15899
|
|
|
15900
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
15900
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.503.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e5d4ab9592406842b4a214ba16b749bd/node_modules/@wirecat/cli-core/dist/store/sqlite/transaction.js
|
|
15901
15901
|
var SQLITE_BUSY = 5;
|
|
15902
15902
|
var pause = new Int32Array(new SharedArrayBuffer(4));
|
|
15903
15903
|
var isBusy = /* @__PURE__ */ __name((error) => {
|
|
@@ -15985,7 +15985,7 @@ var read = /* @__PURE__ */ __name((database, body2) => {
|
|
|
15985
15985
|
}
|
|
15986
15986
|
}, "read");
|
|
15987
15987
|
|
|
15988
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
15988
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.503.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e5d4ab9592406842b4a214ba16b749bd/node_modules/@wirecat/cli-core/dist/store/sqlite/vector-index.js
|
|
15989
15989
|
var source = /* @__PURE__ */ __name((model, dims) => `SELECT k.id, k.chunkable_type,
|
|
15990
15990
|
coalesce(CASE k.chunkable_type
|
|
15991
15991
|
WHEN 'image' THEN (SELECT ch.account_id FROM attachments a JOIN messages m ON m.id = a.attachable_id
|
|
@@ -16127,7 +16127,7 @@ var dropUnusedVectors = /* @__PURE__ */ __name((database, hashes) => {
|
|
|
16127
16127
|
}, "dropUnusedVectors");
|
|
16128
16128
|
var dropAllUnusedVectors = /* @__PURE__ */ __name((database) => database.prepare("DELETE FROM embeddings WHERE NOT EXISTS (SELECT 1 FROM chunks k WHERE k.content_hash = embeddings.content_hash) RETURNING 1").all().length, "dropAllUnusedVectors");
|
|
16129
16129
|
|
|
16130
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
16130
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.503.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e5d4ab9592406842b4a214ba16b749bd/node_modules/@wirecat/cli-core/dist/store/sqlite/accounts.js
|
|
16131
16131
|
var accountPk = /* @__PURE__ */ __name(({ orm, now: now2 }, { provider, account, scope: scope3 }, name = null) => Number(orm.insert(accounts).values({ provider, externalId: account, name, scope: scope3 ?? "personal", createdAt: now2(), updatedAt: now2() }).onConflictDoUpdate({
|
|
16132
16132
|
target: [accounts.provider, accounts.externalId],
|
|
16133
16133
|
set: {
|
|
@@ -16233,7 +16233,7 @@ var dropOrphanPeople = /* @__PURE__ */ __name((database, unseenBefore) => {
|
|
|
16233
16233
|
AND id NOT IN (SELECT id FROM (${referencesTo(database, "persons", /* @__PURE__ */ new Set(["identity_links"]))}) WHERE id IS NOT NULL)`).run(JSON.stringify(persons2));
|
|
16234
16234
|
}, "dropOrphanPeople");
|
|
16235
16235
|
|
|
16236
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
16236
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.503.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e5d4ab9592406842b4a214ba16b749bd/node_modules/@wirecat/cli-core/dist/store/sqlite/folded.js
|
|
16237
16237
|
var FOLDED = [
|
|
16238
16238
|
{ table: "tasks", column: "title" },
|
|
16239
16239
|
{ table: "tasks", column: "close_reason" },
|
|
@@ -16270,7 +16270,7 @@ var fillFolded = /* @__PURE__ */ __name((database, { batch = 2e3 } = {}) => {
|
|
|
16270
16270
|
return filled2;
|
|
16271
16271
|
}, "fillFolded");
|
|
16272
16272
|
|
|
16273
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
16273
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.503.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e5d4ab9592406842b4a214ba16b749bd/node_modules/@wirecat/cli-core/dist/conversations/chunks.js
|
|
16274
16274
|
import { createHash as createHash3 } from "node:crypto";
|
|
16275
16275
|
var CHUNK_CHARS = 1200;
|
|
16276
16276
|
var CHUNK_OVERLAP = 150;
|
|
@@ -16375,7 +16375,7 @@ var cutChunks = /* @__PURE__ */ __name((members2, limit = CHUNK_CHARS, check3, c
|
|
|
16375
16375
|
return chunks2;
|
|
16376
16376
|
}, "cutChunks");
|
|
16377
16377
|
|
|
16378
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
16378
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.503.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e5d4ab9592406842b4a214ba16b749bd/node_modules/@wirecat/cli-core/dist/search/task-signature.js
|
|
16379
16379
|
var DAY = 864e5;
|
|
16380
16380
|
var CURRENCY = [
|
|
16381
16381
|
[/^(₽|руб.*|р\.?|rub)$/u, "RUB"],
|
|
@@ -16492,7 +16492,7 @@ var dueDayOf = /* @__PURE__ */ __name((text5, createdMs) => {
|
|
|
16492
16492
|
return best?.day ?? null;
|
|
16493
16493
|
}, "dueDayOf");
|
|
16494
16494
|
|
|
16495
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
16495
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.503.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e5d4ab9592406842b4a214ba16b749bd/node_modules/@wirecat/cli-core/dist/search/task-similarity.js
|
|
16496
16496
|
var DAY2 = 864e5;
|
|
16497
16497
|
var STOP_WORDS = new Set([
|
|
16498
16498
|
// Russian and English as the test set ran them, already folded (пожалуйста → пожалуиста).
|
|
@@ -16647,7 +16647,7 @@ var rankCandidates = /* @__PURE__ */ __name((views, candidates) => candidates.ma
|
|
|
16647
16647
|
...compareViews(subjectViews ?? views, candidate, replyChain === void 0 ? {} : { replyChain })
|
|
16648
16648
|
})).sort((a, b) => b.score - a.score), "rankCandidates");
|
|
16649
16649
|
|
|
16650
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
16650
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.503.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e5d4ab9592406842b4a214ba16b749bd/node_modules/@wirecat/cli-core/dist/store/sqlite/vectors.js
|
|
16651
16651
|
var currentChunks = /* @__PURE__ */ __name((chatKey) => sql`SELECT k.content_hash, k.chunkable_id AS conversation_id, r.first_message_id,
|
|
16652
16652
|
r.last_message_id, r.text_start, r.text_end FROM chunks k JOIN chunk_messages r ON r.chunk_id = k.id
|
|
16653
16653
|
JOIN conversations c ON k.chunkable_type = 'conversation' AND c.id = k.chunkable_id
|
|
@@ -16918,7 +16918,7 @@ var readiness = /* @__PURE__ */ __name(({ orm }, chatKey, model) => {
|
|
|
16918
16918
|
};
|
|
16919
16919
|
}, "readiness");
|
|
16920
16920
|
|
|
16921
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
16921
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.503.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e5d4ab9592406842b4a214ba16b749bd/node_modules/@wirecat/cli-core/dist/store/sqlite/document-pictures.js
|
|
16922
16922
|
var DOCUMENT_PICTURE = "document_picture";
|
|
16923
16923
|
var SCAN_PAGE2 = 5e3;
|
|
16924
16924
|
var idOf = /* @__PURE__ */ __name((ref3) => {
|
|
@@ -16981,7 +16981,7 @@ var documentPicturesOver = /* @__PURE__ */ __name(({ database, now: now2 }) => (
|
|
|
16981
16981
|
}, "nearestPictures")
|
|
16982
16982
|
}), "documentPicturesOver");
|
|
16983
16983
|
|
|
16984
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
16984
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.503.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e5d4ab9592406842b4a214ba16b749bd/node_modules/@wirecat/cli-core/dist/store/sqlite/query-filter.js
|
|
16985
16985
|
var glob = /* @__PURE__ */ __name((value) => [...fold(value).matchAll(/\\(.)|([*?])|(.)/gsu)].map(([, escaped2, wildcard, plain2]) => {
|
|
16986
16986
|
const literal4 = escaped2 ?? plain2 ?? "";
|
|
16987
16987
|
return wildcard ?? (/[*?[]/u.test(literal4) ? `[${literal4}]` : literal4);
|
|
@@ -17046,7 +17046,7 @@ var compile = /* @__PURE__ */ __name((node, columns, options) => {
|
|
|
17046
17046
|
var queryFilter = /* @__PURE__ */ __name((ast, columns, options = {}) => compile(ast.root, columns, options), "queryFilter");
|
|
17047
17047
|
var bound2 = /* @__PURE__ */ __name(({ sql: text5, params }) => sql.join(text5.split("?").map((part, at) => at < params.length ? sql`${sql.raw(part)}${params[at]}` : sql.raw(part)), sql``), "bound");
|
|
17048
17048
|
|
|
17049
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
17049
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.503.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e5d4ab9592406842b4a214ba16b749bd/node_modules/@wirecat/cli-core/dist/store/sqlite/events.js
|
|
17050
17050
|
var toJson = /* @__PURE__ */ __name((value) => value === null || value === void 0 ? null : JSON.stringify(value), "toJson");
|
|
17051
17051
|
var fromJson = /* @__PURE__ */ __name((value) => value === null || value === void 0 ? null : JSON.parse(String(value)), "fromJson");
|
|
17052
17052
|
var int = /* @__PURE__ */ __name((value) => value === null || value === void 0 ? null : Number(value), "int");
|
|
@@ -17136,7 +17136,7 @@ var linkMeeting = /* @__PURE__ */ __name((database, id2, eventId, now2, mode = "
|
|
|
17136
17136
|
});
|
|
17137
17137
|
}, "linkMeeting");
|
|
17138
17138
|
|
|
17139
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
17139
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.503.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e5d4ab9592406842b4a214ba16b749bd/node_modules/@wirecat/cli-core/dist/store/sqlite/note-index.js
|
|
17140
17140
|
var EVENT_TEXT = "trim(coalesce(e.description, '') || ' ' || coalesce(e.location, '') || ' ' || coalesce((SELECT group_concat(p.name, ' ') FROM calendar_entries ce JOIN calendar_entry_participants p ON p.entry_id = ce.id WHERE ce.event_id = e.id AND ce.deleted_at IS NULL AND p.resource = 0 AND p.name IS NOT NULL), ''))";
|
|
17141
17141
|
var UNSEARCHED_EVENT_TYPES = [
|
|
17142
17142
|
"working-location",
|
|
@@ -17320,7 +17320,7 @@ var writer2 = /* @__PURE__ */ __name((database, corpus, stemmer) => {
|
|
|
17320
17320
|
statements.dequeue.run(queuedAs(corpus), id2);
|
|
17321
17321
|
};
|
|
17322
17322
|
}, "writer");
|
|
17323
|
-
var drainCorpus = /* @__PURE__ */ __name((database, corpus,
|
|
17323
|
+
var drainCorpus = /* @__PURE__ */ __name((database, corpus, stemmerFor2, { batch = 200, until = /* @__PURE__ */ __name(() => false, "until") } = {}) => {
|
|
17324
17324
|
if (corpus.type === "email" || corpus.type === "document")
|
|
17325
17325
|
database.prepare(`UPDATE chunks SET account_id = (SELECT account_id FROM ${corpus.table} WHERE id = chunks.chunkable_id)
|
|
17326
17326
|
WHERE chunkable_type = ? AND account_id IS NULL`).run(corpus.type);
|
|
@@ -17328,7 +17328,7 @@ var drainCorpus = /* @__PURE__ */ __name((database, corpus, stemmerFor, { batch
|
|
|
17328
17328
|
const state = corpusIndexState(database, corpus);
|
|
17329
17329
|
if (state.wanted === null)
|
|
17330
17330
|
return 0;
|
|
17331
|
-
const stemmer =
|
|
17331
|
+
const stemmer = stemmerFor2(savedStemmers(database) ?? DEFAULT_STEMMERS);
|
|
17332
17332
|
const queue = `${corpus.type}_index_pending`;
|
|
17333
17333
|
if (state.built !== stemmer.identity) {
|
|
17334
17334
|
write(database, () => {
|
|
@@ -17357,7 +17357,7 @@ var drainCorpus = /* @__PURE__ */ __name((database, corpus, stemmerFor, { batch
|
|
|
17357
17357
|
}
|
|
17358
17358
|
return done;
|
|
17359
17359
|
}, "drainCorpus");
|
|
17360
|
-
var drainNoteIndex = /* @__PURE__ */ __name((database,
|
|
17360
|
+
var drainNoteIndex = /* @__PURE__ */ __name((database, stemmerFor2, options = {}) => drainCorpus(database, CORPORA.document, stemmerFor2, options) + drainCorpus(database, CORPORA.note, stemmerFor2, options) + fillTrigrams(database, options), "drainNoteIndex");
|
|
17361
17361
|
var resetNoteIndex = /* @__PURE__ */ __name((database) => {
|
|
17362
17362
|
write(database, () => {
|
|
17363
17363
|
for (const corpus of Object.values(CORPORA))
|
|
@@ -17366,7 +17366,7 @@ var resetNoteIndex = /* @__PURE__ */ __name((database) => {
|
|
|
17366
17366
|
return true;
|
|
17367
17367
|
}, "resetNoteIndex");
|
|
17368
17368
|
|
|
17369
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
17369
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.503.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e5d4ab9592406842b4a214ba16b749bd/node_modules/@wirecat/cli-core/dist/store/sqlite/person-resolution.js
|
|
17370
17370
|
var keyOf3 = /* @__PURE__ */ __name((name) => fold(name).trim().replace(/^@/, ""), "keyOf");
|
|
17371
17371
|
var resolvePersonLinks = /* @__PURE__ */ __name((database, names) => {
|
|
17372
17372
|
for (const key2 of new Set(names.filter((name) => !!name?.trim()).map(keyOf3))) {
|
|
@@ -17385,7 +17385,7 @@ var resolvePersonLinks = /* @__PURE__ */ __name((database, names) => {
|
|
|
17385
17385
|
}
|
|
17386
17386
|
}, "resolvePersonLinks");
|
|
17387
17387
|
|
|
17388
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
17388
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.503.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e5d4ab9592406842b4a214ba16b749bd/node_modules/@wirecat/cli-core/dist/store/sqlite/identities.js
|
|
17389
17389
|
var flag2 = /* @__PURE__ */ __name((value) => value === void 0 || value === null ? null : Number(value), "flag");
|
|
17390
17390
|
var prepare = /* @__PURE__ */ __name((orm) => ({
|
|
17391
17391
|
find: orm.select({
|
|
@@ -17610,7 +17610,7 @@ var meetingIdentityPk = /* @__PURE__ */ __name((context, accountId, identity) =>
|
|
|
17610
17610
|
}, "meetingIdentityPk");
|
|
17611
17611
|
var phoneOf = /* @__PURE__ */ __name(({ orm }, provider, nativeId) => orm.select({ phone: identities.phone }).from(identities).where(and(eq(identities.provider, provider), eq(identities.externalId, nativeId))).get()?.phone ?? null, "phoneOf");
|
|
17612
17612
|
|
|
17613
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
17613
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.503.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e5d4ab9592406842b4a214ba16b749bd/node_modules/@wirecat/cli-core/dist/store/sqlite/chats.js
|
|
17614
17614
|
var chatOf = /* @__PURE__ */ __name(({ orm }, accountKey, chatKey) => orm.select({ id: chats.externalId }).from(chats).where(and(eq(chats.id, chatKey), eq(chats.accountId, accountKey))).get()?.id, "chatOf");
|
|
17615
17615
|
var findChatPk = /* @__PURE__ */ __name(({ orm }, accountKey, chatId) => orm.select({ pk: chats.id }).from(chats).where(and(eq(chats.accountId, accountKey), eq(chats.externalId, chatId))).get()?.pk, "findChatPk");
|
|
17616
17616
|
var chatPkFor = /* @__PURE__ */ __name((context, accountKey, chatId) => findChatPk(context, accountKey, chatId) ?? Number(context.orm.insert(chats).values({
|
|
@@ -17890,7 +17890,7 @@ var replaceAutoTags = /* @__PURE__ */ __name((context, key2, chatId, algorithm,
|
|
|
17890
17890
|
}
|
|
17891
17891
|
}, "replaceAutoTags");
|
|
17892
17892
|
|
|
17893
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
17893
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.503.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e5d4ab9592406842b4a214ba16b749bd/node_modules/@wirecat/cli-core/dist/conversations/mail-text.js
|
|
17894
17894
|
var GREETING = new RegExp("^(hi|hello|hey|dear|greetings|good (morning|afternoon|evening)|\u043F\u0440\u0438\u0432\u0435\u0442|\u0437\u0434\u0440\u0430\u0432\u0441\u0442\u0432\u0443\u0439(\u0442\u0435)?|\u0434\u043E\u0431\u0440(\u044B\u0439|\u043E\u0435|\u043E\u0433\u043E) (\u0434\u0435\u043D\u044C|\u0432\u0435\u0447\u0435\u0440|\u0443\u0442\u0440\u043E|\u0443\u0442\u0440\u0430|\u0434\u043D\u044F)|hola|buen(os|as) (d\xEDas|dias|tardes|noches)|estimad[oa]s?|querid[oa]s?)(?![\\p{L}\\p{N}])([\\s,]+\\p{L}[\\p{L}.'\u2019-]*){0,3}\\s*[,!.:]?$", "iu");
|
|
17895
17895
|
var SIGN_OFF = /^(best|best regards|best wishes|kind regards|warm regards|regards|thanks|thanks again|thanks a lot|thank you|many thanks|cheers|sincerely|yours|yours truly|yours sincerely|br|с уважением|спасибо|заранее спасибо|всего доброго|всего хорошего|un saludo|saludos|saludos cordiales|atentamente|gracias|muchas gracias)[\s,.!]*$/iu;
|
|
17896
17896
|
var ATTRIBUTION = /(wrote|написал[аи]?|escribió|a écrit|schrieb)\s*:\s*$/iu;
|
|
@@ -17971,7 +17971,7 @@ var mailCore = /* @__PURE__ */ __name((body2, earlier) => {
|
|
|
17971
17971
|
return withoutSignOff(withoutGreeting(kept)).join("\n").trim();
|
|
17972
17972
|
}, "mailCore");
|
|
17973
17973
|
|
|
17974
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
17974
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.503.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e5d4ab9592406842b4a214ba16b749bd/node_modules/@wirecat/cli-core/dist/store/sqlite/email-index.js
|
|
17975
17975
|
var titleOf = /* @__PURE__ */ __name((subject2) => subject2?.replace(/^\s*((re|fwd?|aw|wg)\s*:\s*)+/i, "").trim() || null, "titleOf");
|
|
17976
17976
|
var MAIL_PIECES = `(SELECT k.id, k.content_hash, k.chunkable_type AS type, k.chunkable_id AS owner, k.position,
|
|
17977
17977
|
k.start_offset, k.end_offset, k.account_id, k.occurred_at, a.attachable_id AS email_id,
|
|
@@ -18038,7 +18038,7 @@ var chunkAttachments = /* @__PURE__ */ __name((database, accountId, emailId, now
|
|
|
18038
18038
|
}, "chunkAttachments");
|
|
18039
18039
|
var MAIL_CUT = "mail_pieces_cut";
|
|
18040
18040
|
var CUT = "email";
|
|
18041
|
-
var drainEmailIndex = /* @__PURE__ */ __name((database,
|
|
18041
|
+
var drainEmailIndex = /* @__PURE__ */ __name((database, stemmerFor2) => {
|
|
18042
18042
|
if (database.prepare("SELECT value FROM store_settings WHERE key = ?").get(MAIL_CUT)?.value !== CUT)
|
|
18043
18043
|
write(database, () => {
|
|
18044
18044
|
const single = database.prepare("SELECT DISTINCT content_hash AS hash FROM chunks WHERE chunkable_type = 'email'").all().map(({ hash: hash2 }) => String(hash2));
|
|
@@ -18061,7 +18061,7 @@ var drainEmailIndex = /* @__PURE__ */ __name((database, stemmerFor) => {
|
|
|
18061
18061
|
dropUnusedVectors(database, before2);
|
|
18062
18062
|
}
|
|
18063
18063
|
});
|
|
18064
|
-
const emails3 = drainCorpus(database, CORPORA.email,
|
|
18064
|
+
const emails3 = drainCorpus(database, CORPORA.email, stemmerFor2);
|
|
18065
18065
|
const next = database.prepare("SELECT id FROM email_index_pending WHERE indexable_type = 'email_thread' ORDER BY id LIMIT 50");
|
|
18066
18066
|
const done = database.prepare("DELETE FROM email_index_pending WHERE indexable_type = 'email_thread' AND id = ?");
|
|
18067
18067
|
let threads = 0;
|
|
@@ -18081,7 +18081,7 @@ var drainEmailIndex = /* @__PURE__ */ __name((database, stemmerFor) => {
|
|
|
18081
18081
|
return emails3 + threads;
|
|
18082
18082
|
}, "drainEmailIndex");
|
|
18083
18083
|
|
|
18084
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
18084
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.503.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e5d4ab9592406842b4a214ba16b749bd/node_modules/@wirecat/cli-core/dist/store/sqlite/email-locations.js
|
|
18085
18085
|
var locate = /* @__PURE__ */ __name((database, accountId, emailId, where) => database.prepare(`INSERT OR REPLACE INTO email_locations (mailbox_id, uidvalidity, uid, email_id)
|
|
18086
18086
|
SELECT id, ?, ?, ? FROM mailboxes WHERE account_id = ? AND external_id = ?`).run(where.uidvalidity, where.uid, emailId, accountId, where.folder), "locate");
|
|
18087
18087
|
var folderEmails = /* @__PURE__ */ __name((database, accountId, folder, uidvalidity) => database.prepare(`SELECT l.uid, e.external_id, coalesce(e.received_at, e.sent_at) AS at, e.read, e.flagged,
|
|
@@ -18127,7 +18127,7 @@ var forgetLocations = /* @__PURE__ */ __name((database, accountId, folder, uidva
|
|
|
18127
18127
|
leave.run(emailId, Number(box.id), emailId, Number(box.id));
|
|
18128
18128
|
}, "forgetLocations");
|
|
18129
18129
|
|
|
18130
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
18130
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.503.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e5d4ab9592406842b4a214ba16b749bd/node_modules/@wirecat/cli-core/dist/store/sqlite/email-state.js
|
|
18131
18131
|
var recountEmailThread = /* @__PURE__ */ __name((database, threadId, now2) => database.prepare(`UPDATE email_threads SET
|
|
18132
18132
|
emails_count = (SELECT count(*) FROM emails WHERE email_thread_id = ? AND deleted_at IS NULL),
|
|
18133
18133
|
last_email_at = (SELECT max(coalesce(sent_at, received_at)) FROM emails
|
|
@@ -18177,7 +18177,7 @@ var markEmailsRestored = /* @__PURE__ */ __name((database, accountId, externalId
|
|
|
18177
18177
|
return threads.length;
|
|
18178
18178
|
}, "markEmailsRestored");
|
|
18179
18179
|
|
|
18180
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
18180
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.503.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e5d4ab9592406842b4a214ba16b749bd/node_modules/@wirecat/cli-core/dist/store/sqlite/mail-rules.js
|
|
18181
18181
|
var sorted = /* @__PURE__ */ __name((value) => Array.isArray(value) ? value.map(sorted) : value !== null && typeof value === "object" ? Object.fromEntries(Object.keys(value).sort().map((key2) => [key2, sorted(value[key2])])) : value, "sorted");
|
|
18182
18182
|
var conditionsKey = /* @__PURE__ */ __name((conditions) => JSON.stringify(sorted(conditions)), "conditionsKey");
|
|
18183
18183
|
var ruleOf = /* @__PURE__ */ __name((row2) => ({
|
|
@@ -18244,7 +18244,7 @@ var mailRulesOver = /* @__PURE__ */ __name((database) => ({
|
|
|
18244
18244
|
}
|
|
18245
18245
|
}), "mailRulesOver");
|
|
18246
18246
|
|
|
18247
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
18247
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.503.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e5d4ab9592406842b4a214ba16b749bd/node_modules/@wirecat/cli-core/dist/store/sqlite/link-reviews.js
|
|
18248
18248
|
var reviewLink = /* @__PURE__ */ __name((database, linkable, entity, candidates, reason, now2) => {
|
|
18249
18249
|
database.prepare(`INSERT INTO link_reviews (linkable_type, linkable_id, entity_type, candidates, reason, status, created_at, updated_at)
|
|
18250
18250
|
VALUES (?, ?, ?, ?, ?, 'open', ?, ?)
|
|
@@ -18252,7 +18252,7 @@ var reviewLink = /* @__PURE__ */ __name((database, linkable, entity, candidates,
|
|
|
18252
18252
|
reason = excluded.reason, updated_at = excluded.updated_at WHERE link_reviews.status = 'open'`).run(linkable.type, linkable.id, entity, JSON.stringify([...candidates].sort((a, b) => a - b)), reason, now2, now2);
|
|
18253
18253
|
}, "reviewLink");
|
|
18254
18254
|
|
|
18255
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
18255
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.503.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e5d4ab9592406842b4a214ba16b749bd/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-operation.js
|
|
18256
18256
|
function checkMeetingCancelled(signal) {
|
|
18257
18257
|
if (!signal?.aborted)
|
|
18258
18258
|
return;
|
|
@@ -18263,7 +18263,7 @@ function checkMeetingCancelled(signal) {
|
|
|
18263
18263
|
}
|
|
18264
18264
|
__name(checkMeetingCancelled, "checkMeetingCancelled");
|
|
18265
18265
|
|
|
18266
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
18266
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.503.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e5d4ab9592406842b4a214ba16b749bd/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-values.js
|
|
18267
18267
|
var meetingOf = /* @__PURE__ */ __name((row2) => ({
|
|
18268
18268
|
id: Number(row2.id),
|
|
18269
18269
|
accountId: Number(row2.account_id),
|
|
@@ -18313,7 +18313,7 @@ var transcriptRowOf = /* @__PURE__ */ __name((row2) => ({
|
|
|
18313
18313
|
createdAt: Number(row2.created_at)
|
|
18314
18314
|
}), "transcriptRowOf");
|
|
18315
18315
|
|
|
18316
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
18316
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.503.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e5d4ab9592406842b4a214ba16b749bd/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-reads.js
|
|
18317
18317
|
var MEETING_TEXT = ["external_id", "title", "description", "location", "join_url", "timezone", "metadata"];
|
|
18318
18318
|
var TRANSCRIPT_TEXT = ["source", "format", "language", "content_hash", "metadata"];
|
|
18319
18319
|
var ROW_TEXT = ["speaker_name", "text", "normalized_text", "metadata"];
|
|
@@ -18480,7 +18480,7 @@ var meetingReadsOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
|
18480
18480
|
}
|
|
18481
18481
|
}), "meetingReadsOver");
|
|
18482
18482
|
|
|
18483
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
18483
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.503.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e5d4ab9592406842b4a214ba16b749bd/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-selection.js
|
|
18484
18484
|
var meetingSelectionSql = /* @__PURE__ */ __name((input) => {
|
|
18485
18485
|
const clauses = ["m.account_id=?", "m.deleted_at IS NULL"];
|
|
18486
18486
|
const params = [input.accountId];
|
|
@@ -18523,7 +18523,7 @@ var meetingSelectionSql = /* @__PURE__ */ __name((input) => {
|
|
|
18523
18523
|
return { clauses, params };
|
|
18524
18524
|
}, "meetingSelectionSql");
|
|
18525
18525
|
|
|
18526
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
18526
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.503.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e5d4ab9592406842b4a214ba16b749bd/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-chat-lines.js
|
|
18527
18527
|
var meetingChatLinesOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
18528
18528
|
async meetingChatLines(input) {
|
|
18529
18529
|
checkMeetingCancelled(input.signal);
|
|
@@ -18551,7 +18551,7 @@ var meetingChatLinesOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
|
18551
18551
|
}
|
|
18552
18552
|
}), "meetingChatLinesOver");
|
|
18553
18553
|
|
|
18554
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
18554
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.503.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e5d4ab9592406842b4a214ba16b749bd/node_modules/@wirecat/cli-core/dist/store/sqlite/reads.js
|
|
18555
18555
|
var MESSAGE_FIELDS = {
|
|
18556
18556
|
pk: messages.id,
|
|
18557
18557
|
nativeId: messages.externalId,
|
|
@@ -18718,7 +18718,7 @@ var chatActivity = /* @__PURE__ */ __name(({ database }, accountKey, since, wher
|
|
|
18718
18718
|
storedAt: toIso(Number(database.prepare("SELECT max(created_at) AS at FROM messages WHERE account_id = ?").get(accountKey)?.at) || null)
|
|
18719
18719
|
}), "chatActivity");
|
|
18720
18720
|
|
|
18721
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
18721
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.503.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e5d4ab9592406842b4a214ba16b749bd/node_modules/@wirecat/cli-core/dist/store/sqlite/search.js
|
|
18722
18722
|
var HIT_FIELDS = {
|
|
18723
18723
|
...MESSAGE_FIELDS,
|
|
18724
18724
|
chatTitle: sql`${chats.title}`.as("chat_title"),
|
|
@@ -18817,7 +18817,7 @@ var directReplies = /* @__PURE__ */ __name((context, parents, limit) => {
|
|
|
18817
18817
|
};
|
|
18818
18818
|
}, "directReplies");
|
|
18819
18819
|
|
|
18820
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
18820
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.503.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e5d4ab9592406842b4a214ba16b749bd/node_modules/@wirecat/cli-core/dist/store/sqlite/person-links.js
|
|
18821
18821
|
var identityRow = /* @__PURE__ */ __name(({ orm }, { provider, id: id2 }) => orm.select({ pk: identities.id, personPk: identityLinks.personId }).from(identities).innerJoin(identityLinks, eq(identityLinks.identityId, identities.id)).where(and(eq(identities.provider, provider), eq(identities.externalId, id2))).get(), "identityRow");
|
|
18822
18822
|
var required = /* @__PURE__ */ __name((context, ref3) => {
|
|
18823
18823
|
const found2 = identityRow(context, ref3);
|
|
@@ -18948,7 +18948,7 @@ var mentioning = /* @__PURE__ */ __name((context, accountKey, { id: id2, usernam
|
|
|
18948
18948
|
}, "mentioning");
|
|
18949
18949
|
var escaped = /* @__PURE__ */ __name((text5) => text5.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), "escaped");
|
|
18950
18950
|
|
|
18951
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
18951
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.503.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e5d4ab9592406842b4a214ba16b749bd/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-context-links.js
|
|
18952
18952
|
var missing2 = /* @__PURE__ */ __name(() => {
|
|
18953
18953
|
throw new CliError("not_found", "Meeting, participant or selected target not found");
|
|
18954
18954
|
}, "missing");
|
|
@@ -19070,7 +19070,7 @@ function meetingContextLinksOver(context) {
|
|
|
19070
19070
|
}
|
|
19071
19071
|
__name(meetingContextLinksOver, "meetingContextLinksOver");
|
|
19072
19072
|
|
|
19073
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
19073
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.503.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e5d4ab9592406842b4a214ba16b749bd/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-index-values.js
|
|
19074
19074
|
var INDEX_CODES = { meeting_transcript_row: 1, meeting_chat_message: 2, meeting_summary: 3 };
|
|
19075
19075
|
var meetingRowid = /* @__PURE__ */ __name((type, id2) => id2 * 4 + INDEX_CODES[type], "meetingRowid");
|
|
19076
19076
|
var summaryOf = /* @__PURE__ */ __name((row2) => ({
|
|
@@ -19099,7 +19099,7 @@ var indexedText = /* @__PURE__ */ __name((database, type, id2) => {
|
|
|
19099
19099
|
return row2 ? summaryText(summaryOf(row2)) : null;
|
|
19100
19100
|
}, "indexedText");
|
|
19101
19101
|
|
|
19102
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
19102
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.503.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e5d4ab9592406842b4a214ba16b749bd/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-stem-state.js
|
|
19103
19103
|
var summaryBytes = ["title", "overview", "sections", "next_steps", "content"].map((key2) => `coalesce(length(CAST(s.${key2} AS BLOB)),0)`).join("+");
|
|
19104
19104
|
var meetingCurrentIndexRows = `
|
|
19105
19105
|
SELECT 'meeting_transcript_row' AS indexable_type,r.id,r.id*4+1 AS rid,1 AS live,coalesce(length(CAST(r.text AS BLOB)),0) AS bytes FROM meeting_transcript_rows r JOIN meeting_transcripts t ON t.id=r.meeting_transcript_id JOIN meetings m ON m.id=t.meeting_id WHERE m.account_id=? AND m.deleted_at IS NULL AND t.deleted_at IS NULL AND t.superseded_at IS NULL
|
|
@@ -19130,7 +19130,7 @@ var invalidateMeetingStems = /* @__PURE__ */ __name((database, type, id2) => {
|
|
|
19130
19130
|
}, "invalidateMeetingStems");
|
|
19131
19131
|
var meetingStemmableText = /* @__PURE__ */ __name((text5) => text5.replace(/[\p{L}\p{N}\p{M}\p{Co}]+/gu, (token) => token.length <= 1024 ? token : ""), "meetingStemmableText");
|
|
19132
19132
|
|
|
19133
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
19133
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.503.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e5d4ab9592406842b4a214ba16b749bd/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-hit-index.js
|
|
19134
19134
|
function meetingHitIndexOver({ database, now: now2 }) {
|
|
19135
19135
|
return {
|
|
19136
19136
|
async indexSearch(original) {
|
|
@@ -19198,10 +19198,10 @@ function meetingHitIndexOver({ database, now: now2 }) {
|
|
|
19198
19198
|
}
|
|
19199
19199
|
__name(meetingHitIndexOver, "meetingHitIndexOver");
|
|
19200
19200
|
|
|
19201
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
19201
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.503.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e5d4ab9592406842b4a214ba16b749bd/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-hit-search.js
|
|
19202
19202
|
import { createHash as createHash4 } from "node:crypto";
|
|
19203
19203
|
|
|
19204
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
19204
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.503.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e5d4ab9592406842b4a214ba16b749bd/node_modules/@wirecat/cli-core/dist/search/trigrams.js
|
|
19205
19205
|
var trigrams = /* @__PURE__ */ __name((term) => {
|
|
19206
19206
|
const padded = ` ${term} `;
|
|
19207
19207
|
const pieces = /* @__PURE__ */ new Set();
|
|
@@ -19210,7 +19210,7 @@ var trigrams = /* @__PURE__ */ __name((term) => {
|
|
|
19210
19210
|
return [...pieces];
|
|
19211
19211
|
}, "trigrams");
|
|
19212
19212
|
|
|
19213
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
19213
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.503.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e5d4ab9592406842b4a214ba16b749bd/node_modules/@wirecat/cli-core/dist/search/correct.js
|
|
19214
19214
|
var SHORTEST_CORRECTION = 3;
|
|
19215
19215
|
var maxEdits = /* @__PURE__ */ __name((word) => word.length <= 4 ? 1 : 2, "maxEdits");
|
|
19216
19216
|
var editDistance = /* @__PURE__ */ __name((a, b, max) => {
|
|
@@ -19257,7 +19257,7 @@ var correctWords = /* @__PURE__ */ __name(async (vocabulary, words3) => {
|
|
|
19257
19257
|
return corrections;
|
|
19258
19258
|
}, "correctWords");
|
|
19259
19259
|
|
|
19260
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
19260
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.503.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e5d4ab9592406842b4a214ba16b749bd/node_modules/@wirecat/cli-core/dist/search/garbled.js
|
|
19261
19261
|
var SHORTEST_GARBLED = 4;
|
|
19262
19262
|
var MOST_WIDENED = 64;
|
|
19263
19263
|
var plain = /* @__PURE__ */ __name((word) => word.replaceAll("\u044D", "\u0435"), "plain");
|
|
@@ -19349,7 +19349,7 @@ var widenWords = /* @__PURE__ */ __name((probes, vocabulary, stem, known2) => {
|
|
|
19349
19349
|
return found2.map((words3) => words3.sort((a, b) => a.distance - b.distance || b.docs - a.docs || a.term.localeCompare(b.term)).slice(0, MOST_WIDENED).map((word) => word.term));
|
|
19350
19350
|
}, "widenWords");
|
|
19351
19351
|
|
|
19352
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
19352
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.503.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e5d4ab9592406842b4a214ba16b749bd/node_modules/@wirecat/cli-core/dist/search/russian-dictionary.js
|
|
19353
19353
|
import { readFileSync } from "node:fs";
|
|
19354
19354
|
var loaded;
|
|
19355
19355
|
var dictionary = /* @__PURE__ */ __name(() => {
|
|
@@ -19408,7 +19408,7 @@ var knownRussianWord = /* @__PURE__ */ __name((word) => {
|
|
|
19408
19408
|
return false;
|
|
19409
19409
|
}, "knownRussianWord");
|
|
19410
19410
|
|
|
19411
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
19411
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.503.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e5d4ab9592406842b4a214ba16b749bd/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-hit-query.js
|
|
19412
19412
|
var WORD2 = /[\p{L}\p{N}\p{M}]+/gu;
|
|
19413
19413
|
var MOST_WORDS = 128;
|
|
19414
19414
|
var quote = /* @__PURE__ */ __name((word) => `"${word.replaceAll('"', '""')}"`, "quote");
|
|
@@ -19635,7 +19635,7 @@ var matchMeetingText = /* @__PURE__ */ __name((tree, text5, stemmer) => {
|
|
|
19635
19635
|
return check3(tree);
|
|
19636
19636
|
}, "matchMeetingText");
|
|
19637
19637
|
|
|
19638
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
19638
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.503.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e5d4ab9592406842b4a214ba16b749bd/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-hit-search.js
|
|
19639
19639
|
var fail3 = /* @__PURE__ */ __name((message2) => {
|
|
19640
19640
|
throw new CliError("validation_error", message2);
|
|
19641
19641
|
}, "fail");
|
|
@@ -19812,7 +19812,7 @@ function meetingHitSearchOver({ database }) {
|
|
|
19812
19812
|
}
|
|
19813
19813
|
__name(meetingHitSearchOver, "meetingHitSearchOver");
|
|
19814
19814
|
|
|
19815
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
19815
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.503.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e5d4ab9592406842b4a214ba16b749bd/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-participant-search.js
|
|
19816
19816
|
import { createHash as createHash5 } from "node:crypto";
|
|
19817
19817
|
var cursorOf2 = /* @__PURE__ */ __name((value, key2) => {
|
|
19818
19818
|
if (value === void 0)
|
|
@@ -19902,7 +19902,7 @@ var meetingParticipantSearchOver = /* @__PURE__ */ __name((context) => ({
|
|
|
19902
19902
|
}
|
|
19903
19903
|
}), "meetingParticipantSearchOver");
|
|
19904
19904
|
|
|
19905
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
19905
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.503.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e5d4ab9592406842b4a214ba16b749bd/node_modules/@wirecat/cli-core/dist/store/sqlite/preparation-context-queries.js
|
|
19906
19906
|
var preparationQueries = {
|
|
19907
19907
|
participants: {
|
|
19908
19908
|
fields: "p.id, p.identity_id, p.display_name, l.person_id",
|
|
@@ -19952,7 +19952,7 @@ var preparationQueries = {
|
|
|
19952
19952
|
}
|
|
19953
19953
|
};
|
|
19954
19954
|
|
|
19955
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
19955
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.503.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e5d4ab9592406842b4a214ba16b749bd/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-preparation-context.js
|
|
19956
19956
|
var meetingPreparationContextOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
19957
19957
|
async preparationContext(original) {
|
|
19958
19958
|
const input = validateMeetingPreparationContext(original);
|
|
@@ -19993,7 +19993,7 @@ var meetingPreparationContextOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
|
19993
19993
|
}
|
|
19994
19994
|
}), "meetingPreparationContextOver");
|
|
19995
19995
|
|
|
19996
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
19996
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.503.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e5d4ab9592406842b4a214ba16b749bd/node_modules/@wirecat/cli-core/dist/store/sqlite/preparation-subjects.js
|
|
19997
19997
|
var preparationSubjects = /* @__PURE__ */ __name((anchors) => `WITH anchors AS (
|
|
19998
19998
|
SELECT m.id FROM meetings m JOIN meeting_series s ON s.id=m.meeting_series_id
|
|
19999
19999
|
WHERE m.id IN (${Array.from({ length: anchors }, () => "?").join(",")}) AND m.account_id=? AND s.account_id=?
|
|
@@ -20007,7 +20007,7 @@ var preparationSubjects = /* @__PURE__ */ __name((anchors) => `WITH anchors AS (
|
|
|
20007
20007
|
JOIN main.projects p ON p.id=l.to_id WHERE p.account_id IS NULL AND p.deleted_at IS NULL
|
|
20008
20008
|
)`, "preparationSubjects");
|
|
20009
20009
|
|
|
20010
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
20010
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.503.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e5d4ab9592406842b4a214ba16b749bd/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-preparation-knowledge.js
|
|
20011
20011
|
var meetingPreparationKnowledgeOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
20012
20012
|
async preparationKnowledge(original) {
|
|
20013
20013
|
const { accountId, seriesId, anchorIds, after: after2, before: before2, limit, maxReadBytes, signal } = validateMeetingRelatedHistory(original);
|
|
@@ -20052,7 +20052,7 @@ var meetingPreparationKnowledgeOver = /* @__PURE__ */ __name(({ database }) => (
|
|
|
20052
20052
|
}
|
|
20053
20053
|
}), "meetingPreparationKnowledgeOver");
|
|
20054
20054
|
|
|
20055
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
20055
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.503.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e5d4ab9592406842b4a214ba16b749bd/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-preparation-notes.js
|
|
20056
20056
|
var meetingPreparationNotesOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
20057
20057
|
async preparationNotes(original) {
|
|
20058
20058
|
const { accountId, seriesId, anchorIds, after: after2, before: before2, limit, maxReadBytes, signal } = validateMeetingRelatedHistory(original);
|
|
@@ -20105,7 +20105,7 @@ var meetingPreparationNotesOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
|
20105
20105
|
}
|
|
20106
20106
|
}), "meetingPreparationNotesOver");
|
|
20107
20107
|
|
|
20108
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
20108
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.503.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e5d4ab9592406842b4a214ba16b749bd/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-related-history.js
|
|
20109
20109
|
var meetingRelatedHistoryOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
20110
20110
|
async relatedHistory(original) {
|
|
20111
20111
|
const input = validateMeetingRelatedHistory(original);
|
|
@@ -20176,7 +20176,7 @@ var meetingRelatedHistoryOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
|
20176
20176
|
}
|
|
20177
20177
|
}), "meetingRelatedHistoryOver");
|
|
20178
20178
|
|
|
20179
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
20179
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.503.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e5d4ab9592406842b4a214ba16b749bd/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-review.js
|
|
20180
20180
|
var number2 = /* @__PURE__ */ __name((value) => value === null || value === void 0 ? null : Number(value), "number");
|
|
20181
20181
|
var text2 = /* @__PURE__ */ __name((value) => value === null || value === void 0 ? null : String(value), "text");
|
|
20182
20182
|
var meetingReviewOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
@@ -20257,7 +20257,7 @@ var meetingReviewOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
|
20257
20257
|
}
|
|
20258
20258
|
}), "meetingReviewOver");
|
|
20259
20259
|
|
|
20260
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
20260
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.503.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e5d4ab9592406842b4a214ba16b749bd/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-series-history.js
|
|
20261
20261
|
var bytes2 = "length(CAST(external_id AS BLOB)) + coalesce(length(CAST(title AS BLOB)), 0)";
|
|
20262
20262
|
var ensureBytes2 = /* @__PURE__ */ __name((size2, budget) => {
|
|
20263
20263
|
if (!Number.isSafeInteger(size2) || size2 < 0 || size2 > budget)
|
|
@@ -20311,7 +20311,7 @@ var meetingSeriesHistoryOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
|
20311
20311
|
}
|
|
20312
20312
|
}), "meetingSeriesHistoryOver");
|
|
20313
20313
|
|
|
20314
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
20314
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.503.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e5d4ab9592406842b4a214ba16b749bd/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-stats.js
|
|
20315
20315
|
var MOST_ROWS = 5e5;
|
|
20316
20316
|
var meetingStatsOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
20317
20317
|
async meetingStats(input) {
|
|
@@ -20358,7 +20358,7 @@ var meetingStatsOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
|
20358
20358
|
}
|
|
20359
20359
|
}), "meetingStatsOver");
|
|
20360
20360
|
|
|
20361
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
20361
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.503.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e5d4ab9592406842b4a214ba16b749bd/node_modules/@wirecat/cli-core/dist/store/sqlite/meetings.js
|
|
20362
20362
|
var CURSOR_KEY = "meetings";
|
|
20363
20363
|
var seriesOf2 = /* @__PURE__ */ __name((row2) => ({
|
|
20364
20364
|
id: Number(row2.id),
|
|
@@ -20910,7 +20910,7 @@ var meetingStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
20910
20910
|
};
|
|
20911
20911
|
}, "meetingStoreOver");
|
|
20912
20912
|
|
|
20913
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
20913
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.503.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e5d4ab9592406842b4a214ba16b749bd/node_modules/@wirecat/cli-core/dist/store/sqlite/emails.js
|
|
20914
20914
|
var threadConversation = /* @__PURE__ */ __name((place, builtAt) => ({
|
|
20915
20915
|
id: `email:${place.emailId}`,
|
|
20916
20916
|
chatId: place.threadExternalId,
|
|
@@ -21243,7 +21243,7 @@ var emailHitsByPk = /* @__PURE__ */ __name((database, pks) => {
|
|
|
21243
21243
|
];
|
|
21244
21244
|
});
|
|
21245
21245
|
}, "emailHitsByPk");
|
|
21246
|
-
var mailStoreOver = /* @__PURE__ */ __name(({ database, orm },
|
|
21246
|
+
var mailStoreOver = /* @__PURE__ */ __name(({ database, orm }, stemmerFor2 = stemmerCache()) => ({
|
|
21247
21247
|
rules: mailRulesOver(database),
|
|
21248
21248
|
async saveThread(input) {
|
|
21249
21249
|
const id2 = write(database, () => saveThread(database, orm, input));
|
|
@@ -21365,7 +21365,7 @@ var mailStoreOver = /* @__PURE__ */ __name(({ database, orm }, stemmerFor = stem
|
|
|
21365
21365
|
markDeleted: /* @__PURE__ */ __name(async (accountId, externalIds, now2) => write(database, () => markEmailsDeleted(database, accountId, externalIds, now2)), "markDeleted"),
|
|
21366
21366
|
markRestored: /* @__PURE__ */ __name(async (accountId, externalIds, now2) => write(database, () => markEmailsRestored(database, accountId, externalIds, now2)), "markRestored"),
|
|
21367
21367
|
async chunksToEmbed(model, { after: after2, limit }) {
|
|
21368
|
-
drainEmailIndex(database,
|
|
21368
|
+
drainEmailIndex(database, stemmerFor2);
|
|
21369
21369
|
const file = database.prepare("SELECT text FROM attachments WHERE id = ?");
|
|
21370
21370
|
const threads = /* @__PURE__ */ new Map();
|
|
21371
21371
|
return database.prepare(`SELECT p.content_hash AS hash, min(p.type || ':' || p.owner) AS owner, p.position, p.start_offset AS start,
|
|
@@ -21387,7 +21387,7 @@ var mailStoreOver = /* @__PURE__ */ __name(({ database, orm }, stemmerFor = stem
|
|
|
21387
21387
|
});
|
|
21388
21388
|
},
|
|
21389
21389
|
async nearest(model, query, { accountId, limit, threadExternalId, since }) {
|
|
21390
|
-
drainEmailIndex(database,
|
|
21390
|
+
drainEmailIndex(database, stemmerFor2);
|
|
21391
21391
|
const page3 = database.prepare(`SELECT p.id, p.type, p.owner, p.position, p.email_id AS email, v.vector FROM ${MAIL_PIECES}
|
|
21392
21392
|
JOIN embeddings v ON v.model = ? AND v.content_hash = p.content_hash
|
|
21393
21393
|
WHERE p.id > ? AND p.account_id = ?
|
|
@@ -21450,7 +21450,7 @@ var mailStoreOver = /* @__PURE__ */ __name(({ database, orm }, stemmerFor = stem
|
|
|
21450
21450
|
if (match === null)
|
|
21451
21451
|
return [];
|
|
21452
21452
|
const [limit, offset] = page(filter);
|
|
21453
|
-
drainEmailIndex(database,
|
|
21453
|
+
drainEmailIndex(database, stemmerFor2);
|
|
21454
21454
|
const [where, params] = emailWhere({ ...filter, includeDeleted: false });
|
|
21455
21455
|
return database.prepare(`SELECT e.* FROM email_words w JOIN emails e ON e.id = w.rowid
|
|
21456
21456
|
WHERE email_words MATCH ? AND ${where}
|
|
@@ -21458,7 +21458,7 @@ var mailStoreOver = /* @__PURE__ */ __name(({ database, orm }, stemmerFor = stem
|
|
|
21458
21458
|
}
|
|
21459
21459
|
}), "mailStoreOver");
|
|
21460
21460
|
|
|
21461
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
21461
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.503.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e5d4ab9592406842b4a214ba16b749bd/node_modules/@wirecat/cli-core/dist/search/dictionary.js
|
|
21462
21462
|
import { readFileSync as readFileSync2 } from "node:fs";
|
|
21463
21463
|
var DICTIONARIES = Object.fromEntries(LANGUAGES.map(({ name, dictionary: dictionary3 }) => [name, dictionary3]));
|
|
21464
21464
|
var folded4 = /* @__PURE__ */ __name((word) => /^[а-яё'-]*$/.test(word) ? word.replaceAll("\u0451", "\u0435").replaceAll("\u0439", "\u0438") : fold(word), "folded");
|
|
@@ -21548,7 +21548,7 @@ var knownWord = /* @__PURE__ */ __name((languages) => {
|
|
|
21548
21548
|
}, "knownWord");
|
|
21549
21549
|
var dictionaryLanguages = /* @__PURE__ */ __name((stemmers) => [stemmers.cyrillic, ...stemmers.latin.split(",")].filter((name) => Object.hasOwn(DICTIONARIES, name)), "dictionaryLanguages");
|
|
21550
21550
|
|
|
21551
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
21551
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.503.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e5d4ab9592406842b4a214ba16b749bd/node_modules/@wirecat/cli-core/dist/store/sqlite/transcript-query.js
|
|
21552
21552
|
var predicates = /* @__PURE__ */ __name((node) => node.kind === "predicate" ? [node] : node.clauses.flatMap(({ node: node2 }) => predicates(node2)), "predicates");
|
|
21553
21553
|
var readsTranscripts = /* @__PURE__ */ __name((node) => (node.operator === "term" || node.operator === "phrase") && /[\p{L}\p{N}]/u.test(normalize(node.value)) && (node.field === "transcript" || node.implicit === true && (node.field === "text" || node.field === "exact")), "readsTranscripts");
|
|
21554
21554
|
var LATIN_NUMBERS = new Set(`zero one two three four five six seven eight nine ten eleven twelve twenty thirty forty fifty sixty seventy
|
|
@@ -21634,7 +21634,7 @@ var spokenTranscripts = /* @__PURE__ */ __name((database, item, speaking, keys)
|
|
|
21634
21634
|
return found2;
|
|
21635
21635
|
}, "spokenTranscripts");
|
|
21636
21636
|
|
|
21637
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
21637
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.503.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e5d4ab9592406842b4a214ba16b749bd/node_modules/@wirecat/cli-core/dist/store/sqlite/hit-places.js
|
|
21638
21638
|
var placeHits = /* @__PURE__ */ __name((database, corpus, leaves, transcripts, found2, pks) => {
|
|
21639
21639
|
const placeLeaves = leaves.filter(({ node }) => (node.operator === "term" || node.operator === "phrase") && (node.implicit || node.field === "content" || node.field === "transcript"));
|
|
21640
21640
|
if (!placeLeaves.length || !pks.length || found2.length !== pks.length)
|
|
@@ -21681,7 +21681,7 @@ var placeHits = /* @__PURE__ */ __name((database, corpus, leaves, transcripts, f
|
|
|
21681
21681
|
});
|
|
21682
21682
|
}, "placeHits");
|
|
21683
21683
|
|
|
21684
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
21684
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.503.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e5d4ab9592406842b4a214ba16b749bd/node_modules/@wirecat/cli-core/dist/store/sqlite/lucene.js
|
|
21685
21685
|
var MESSAGES2 = {
|
|
21686
21686
|
rows: "messages",
|
|
21687
21687
|
threads: "chats",
|
|
@@ -21717,6 +21717,17 @@ var GROUPS = {
|
|
|
21717
21717
|
var matchQuery = /* @__PURE__ */ __name((context, execution) => runQuery(context, execution), "matchQuery");
|
|
21718
21718
|
var countQuery = /* @__PURE__ */ __name((context, execution, by) => runQuery(context, execution, by), "countQuery");
|
|
21719
21719
|
var queryMessagePks = /* @__PURE__ */ __name((context, execution) => runQuery(context, execution, "pks"), "queryMessagePks");
|
|
21720
|
+
var countMatches = /* @__PURE__ */ __name((context, execution, cap) => {
|
|
21721
|
+
const { database, check: check3, where, from: from2, withRanking, ranked, leaves } = compileQuery(context, {
|
|
21722
|
+
...execution,
|
|
21723
|
+
newest: true
|
|
21724
|
+
});
|
|
21725
|
+
if (leaves.some(({ test }) => test))
|
|
21726
|
+
return void 0;
|
|
21727
|
+
const row2 = database.prepare(`SELECT count(*) AS n FROM (${withRanking}SELECT m.id ${from2} WHERE ${where.sql} LIMIT ?)`).get(...ranked.params, ...where.params, cap + 1);
|
|
21728
|
+
check3();
|
|
21729
|
+
return Number(row2?.n ?? 0);
|
|
21730
|
+
}, "countMatches");
|
|
21720
21731
|
var compileQuery = /* @__PURE__ */ __name((context, execution, boundedAttachments = false) => {
|
|
21721
21732
|
const { database } = context;
|
|
21722
21733
|
const corpus = execution.corpus === "mail" ? MAIL : MESSAGES2;
|
|
@@ -22143,7 +22154,7 @@ var runQuery = /* @__PURE__ */ __name(async (context, execution, by) => {
|
|
|
22143
22154
|
};
|
|
22144
22155
|
}, "runQuery");
|
|
22145
22156
|
|
|
22146
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
22157
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.503.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e5d4ab9592406842b4a214ba16b749bd/node_modules/@wirecat/cli-core/dist/store/sqlite/counters.js
|
|
22147
22158
|
function invalidMetadata() {
|
|
22148
22159
|
throw new CliError("validation_error", "stored counter metadata is malformed \u2014 check the store before refreshing");
|
|
22149
22160
|
}
|
|
@@ -22245,7 +22256,7 @@ var counterTargets = /* @__PURE__ */ __name((context, execution, options) => wit
|
|
|
22245
22256
|
};
|
|
22246
22257
|
}), "counterTargets");
|
|
22247
22258
|
|
|
22248
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
22259
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.503.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e5d4ab9592406842b4a214ba16b749bd/node_modules/@wirecat/cli-core/dist/store/sqlite/attachment-texts.js
|
|
22249
22260
|
var NOT_FILE_LIST = [...NOT_FILES].map((kind3) => `'${kind3}'`).join(",");
|
|
22250
22261
|
var fileAttachments = /* @__PURE__ */ __name(({ database }, accountKey, { chatKey, messageId, beforePk, limit }) => database.prepare(`SELECT att.id AS pk, c.external_id AS chat_id, m.external_id AS message_id, att.position, att.kind, att.name, att.mime,
|
|
22251
22262
|
att.size, att.local_path, att.extraction AS origin, att.size AS read_bytes, att.extraction_error AS error, att.content_sha256, att.extractor
|
|
@@ -22364,7 +22375,7 @@ var attachmentViews = /* @__PURE__ */ __name(({ database }, accountKey, { chatKe
|
|
|
22364
22375
|
}));
|
|
22365
22376
|
}, "attachmentViews");
|
|
22366
22377
|
|
|
22367
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
22378
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.503.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e5d4ab9592406842b4a214ba16b749bd/node_modules/@wirecat/cli-core/dist/store/sqlite/transcripts.js
|
|
22368
22379
|
var transcript = /* @__PURE__ */ __name(({ orm }, chatKey, messageId) => orm.select({ text: messageTranscripts.text, source: messageTranscripts.source }).from(messageTranscripts).where(and(eq(messageTranscripts.chatId, chatKey), eq(messageTranscripts.messageExternalId, messageId))).get(), "transcript");
|
|
22369
22380
|
var keepTranscript = /* @__PURE__ */ __name((context, chatKey, messageId, text5, source2) => {
|
|
22370
22381
|
const { orm, database, now: now2 } = context;
|
|
@@ -22402,7 +22413,7 @@ var intoVoiceAttachment = /* @__PURE__ */ __name((context, messagePk) => {
|
|
|
22402
22413
|
keepText(context, Number(row2.id), { text: String(row2.text), origin: "extracted", extractor: `speech:${row2.source}` });
|
|
22403
22414
|
}, "intoVoiceAttachment");
|
|
22404
22415
|
|
|
22405
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
22416
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.503.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e5d4ab9592406842b4a214ba16b749bd/node_modules/@wirecat/cli-core/dist/store/sqlite/messages.js
|
|
22406
22417
|
var FIELDS = [
|
|
22407
22418
|
"threadExternalId",
|
|
22408
22419
|
"senderIdentityId",
|
|
@@ -22719,7 +22730,7 @@ var writeDerivedReactions = /* @__PURE__ */ __name((context, chatKey, messageId)
|
|
|
22719
22730
|
reactionStatementsOf(context.database).total.run(JSON.stringify(derived), chatKey, messageId);
|
|
22720
22731
|
}, "writeDerivedReactions");
|
|
22721
22732
|
|
|
22722
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
22733
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.503.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e5d4ab9592406842b4a214ba16b749bd/node_modules/@wirecat/cli-core/dist/store/sqlite/sync.js
|
|
22723
22734
|
var syncStateOf = /* @__PURE__ */ __name(({ orm }, accountKey, name) => {
|
|
22724
22735
|
const row2 = orm.select({ value: syncCursors.value, at: syncCursors.updatedAt }).from(syncCursors).where(and(eq(syncCursors.accountId, accountKey), eq(syncCursors.key, name))).get();
|
|
22725
22736
|
return row2 ? { value: row2.value, at: toIso(row2.at) } : void 0;
|
|
@@ -22745,7 +22756,7 @@ var release = /* @__PURE__ */ __name(({ orm }, chatKey, anchor, holder) => {
|
|
|
22745
22756
|
orm.delete(fetchLeases).where(and(eq(fetchLeases.chatId, chatKey), eq(fetchLeases.anchor, anchor), eq(fetchLeases.holder, holder))).run();
|
|
22746
22757
|
}, "release");
|
|
22747
22758
|
|
|
22748
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
22759
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.503.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e5d4ab9592406842b4a214ba16b749bd/node_modules/@wirecat/cli-core/dist/store/keys.js
|
|
22749
22760
|
var keysOver = /* @__PURE__ */ __name((context) => {
|
|
22750
22761
|
const findAccountPk2 = /* @__PURE__ */ __name((key2) => findAccountPk(context, key2), "findAccountPk");
|
|
22751
22762
|
const findChatPk2 = /* @__PURE__ */ __name((accountKey, chatId) => findChatPk(context, accountKey, chatId), "findChatPk");
|
|
@@ -22766,7 +22777,7 @@ var keysOver = /* @__PURE__ */ __name((context) => {
|
|
|
22766
22777
|
};
|
|
22767
22778
|
}, "keysOver");
|
|
22768
22779
|
|
|
22769
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
22780
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.503.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e5d4ab9592406842b4a214ba16b749bd/node_modules/@wirecat/cli-core/dist/store/sqlite/account-groups.js
|
|
22770
22781
|
var accountGroupsOf = /* @__PURE__ */ __name((database) => {
|
|
22771
22782
|
const row2 = database.prepare("SELECT value FROM store_settings WHERE key = ?").get(ACCOUNT_GROUPS);
|
|
22772
22783
|
if (!row2)
|
|
@@ -22801,7 +22812,7 @@ var saveProfile = /* @__PURE__ */ __name((database, app, profile, key2, now2) =>
|
|
|
22801
22812
|
database.prepare("INSERT OR REPLACE INTO store_settings (key, value, at) VALUES (?, ?, ?)").run(PROFILES, JSON.stringify(profiles), now2);
|
|
22802
22813
|
}, "saveProfile");
|
|
22803
22814
|
|
|
22804
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
22815
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.503.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e5d4ab9592406842b4a214ba16b749bd/node_modules/@wirecat/cli-core/dist/store/sqlite/actors.js
|
|
22805
22816
|
var BOT_KINDS = ["agent", "script", "integration"];
|
|
22806
22817
|
var ownerPerson = /* @__PURE__ */ __name((database) => {
|
|
22807
22818
|
const found2 = database.prepare("SELECT id FROM persons WHERE owner = 1 ORDER BY id LIMIT 1").get();
|
|
@@ -22837,7 +22848,7 @@ var originOfActor = /* @__PURE__ */ __name((database, type, id2) => {
|
|
|
22837
22848
|
return database.prepare("SELECT name FROM bots WHERE id = ?").get(Number(id2))?.name === "rule" ? "rule" : "agent";
|
|
22838
22849
|
}, "originOfActor");
|
|
22839
22850
|
|
|
22840
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
22851
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.503.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e5d4ab9592406842b4a214ba16b749bd/node_modules/@wirecat/cli-core/dist/store/sqlite/own-identities.js
|
|
22841
22852
|
var linkOwnIdentities = /* @__PURE__ */ __name((context) => {
|
|
22842
22853
|
const owner = ownerPerson(context.database).id;
|
|
22843
22854
|
const strays = context.database.prepare("SELECT DISTINCT l.person_id AS person FROM identity_links l JOIN identities i ON i.id = l.identity_id JOIN accounts a ON a.provider = i.provider AND a.external_id = i.external_id WHERE l.person_id <> ?").all(owner);
|
|
@@ -22858,7 +22869,7 @@ var linkToOwner = /* @__PURE__ */ __name((context, ref3) => {
|
|
|
22858
22869
|
return personOf(context, ref3);
|
|
22859
22870
|
}, "linkToOwner");
|
|
22860
22871
|
|
|
22861
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
22872
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.503.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e5d4ab9592406842b4a214ba16b749bd/node_modules/@wirecat/cli-core/dist/store/sqlite/providers.js
|
|
22862
22873
|
var PROVIDERS_SETTING = "providers";
|
|
22863
22874
|
var storedProvidersOf = /* @__PURE__ */ __name((database) => {
|
|
22864
22875
|
const row2 = database.prepare("SELECT value FROM store_settings WHERE key = ?").get(PROVIDERS_SETTING);
|
|
@@ -22893,7 +22904,7 @@ var registerProvider = /* @__PURE__ */ __name((database, value, now2) => {
|
|
|
22893
22904
|
});
|
|
22894
22905
|
}, "registerProvider");
|
|
22895
22906
|
|
|
22896
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
22907
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.503.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e5d4ab9592406842b4a214ba16b749bd/node_modules/@wirecat/cli-core/dist/store/sqlite/task-candidates.js
|
|
22897
22908
|
var DAY3 = 864e5;
|
|
22898
22909
|
var RECENTLY_CLOSED_MS = 14 * DAY3;
|
|
22899
22910
|
var TEXT_LIMIT = 20;
|
|
@@ -22906,7 +22917,7 @@ var ABOUT_TASK = ["related-to", "evidence", "created-from"];
|
|
|
22906
22917
|
var PLACEHOLDER = /* @__PURE__ */ __name((row2) => `${String(row2.type)} \u2014 ${String(row2.source_locator ?? "")}`, "PLACEHOLDER");
|
|
22907
22918
|
var taskSimilarityOver = /* @__PURE__ */ __name((context) => {
|
|
22908
22919
|
const { database, now: now2 } = context;
|
|
22909
|
-
const
|
|
22920
|
+
const stemmerFor2 = stemmerCache();
|
|
22910
22921
|
const MESSAGE = "SELECT m.id, m.text, m.sent_at, m.outgoing, p.id AS person, p.owner FROM messages m LEFT JOIN identity_links il ON il.identity_id = m.sender_identity_id LEFT JOIN persons p ON p.id = il.person_id";
|
|
22911
22922
|
const messageOf = /* @__PURE__ */ __name((row2) => {
|
|
22912
22923
|
const own = Number(row2.outgoing) === 1 || Number(row2.owner) === 1;
|
|
@@ -22980,7 +22991,7 @@ var taskSimilarityOver = /* @__PURE__ */ __name((context) => {
|
|
|
22980
22991
|
}, "replyChain");
|
|
22981
22992
|
const COLUMNS7 = "t.id, t.project_id, t.key, t.package_id, t.title, t.description, t.type, t.status, t.source_locator, t.created_at, t.due_at, t.category";
|
|
22982
22993
|
const rowOf = /* @__PURE__ */ __name((id2) => database.prepare(`SELECT ${COLUMNS7} FROM tasks t WHERE t.id = ? AND t.deleted_at IS NULL`).get(id2), "rowOf");
|
|
22983
|
-
const
|
|
22994
|
+
const subjectOf2 = /* @__PURE__ */ __name((subject2) => {
|
|
22984
22995
|
if ("task" in subject2) {
|
|
22985
22996
|
const bare = subject2.task.startsWith("task:") ? subject2.task.slice("task:".length) : subject2.task;
|
|
22986
22997
|
const id2 = taskRowOf(database, bare);
|
|
@@ -23009,12 +23020,12 @@ var taskSimilarityOver = /* @__PURE__ */ __name((context) => {
|
|
|
23009
23020
|
}, "subjectOf");
|
|
23010
23021
|
return {
|
|
23011
23022
|
compare: /* @__PURE__ */ __name(async (subject2, other) => {
|
|
23012
|
-
const side =
|
|
23023
|
+
const side = subjectOf2(subject2);
|
|
23013
23024
|
const id2 = taskRowOf(database, other.startsWith("task:") ? other.slice("task:".length) : other);
|
|
23014
23025
|
const row2 = id2 === void 0 ? void 0 : rowOf(id2);
|
|
23015
23026
|
if (!side || !row2)
|
|
23016
23027
|
throw new CliError("not_found", `no task ${other}`);
|
|
23017
|
-
const stemmer =
|
|
23028
|
+
const stemmer = stemmerFor2(storeStemmers(database) ?? DEFAULT_STEMMERS);
|
|
23018
23029
|
const one = linkedOf(side);
|
|
23019
23030
|
const otherSide = linkedOf(sideOf(row2));
|
|
23020
23031
|
const chain = chainOf(one);
|
|
@@ -23025,12 +23036,12 @@ var taskSimilarityOver = /* @__PURE__ */ __name((context) => {
|
|
|
23025
23036
|
});
|
|
23026
23037
|
}, "compare"),
|
|
23027
23038
|
similar: /* @__PURE__ */ __name(async (subject2, { limit = 10 } = {}) => {
|
|
23028
|
-
const named2 =
|
|
23039
|
+
const named2 = subjectOf2(subject2);
|
|
23029
23040
|
if (!named2)
|
|
23030
23041
|
return [];
|
|
23031
23042
|
const side = linkedOf(named2);
|
|
23032
|
-
drainCorpus(database, CORPORA.task,
|
|
23033
|
-
const stemmer =
|
|
23043
|
+
drainCorpus(database, CORPORA.task, stemmerFor2);
|
|
23044
|
+
const stemmer = stemmerFor2(storeStemmers(database) ?? DEFAULT_STEMMERS);
|
|
23034
23045
|
const since = now2() - RECENTLY_CLOSED_MS;
|
|
23035
23046
|
const live2 = "t.project_id = ? AND t.deleted_at IS NULL AND t.id <> ? AND (t.status = 'open' OR t.closed_at >= ?)";
|
|
23036
23047
|
const scope3 = [side.project, side.row ?? -1, since];
|
|
@@ -23092,7 +23103,7 @@ var taskSimilarityOver = /* @__PURE__ */ __name((context) => {
|
|
|
23092
23103
|
};
|
|
23093
23104
|
}, "taskSimilarityOver");
|
|
23094
23105
|
|
|
23095
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
23106
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.503.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e5d4ab9592406842b4a214ba16b749bd/node_modules/@wirecat/cli-core/dist/store/sqlite/task-category-settings.js
|
|
23096
23107
|
var SETTING3 = "taskCategories";
|
|
23097
23108
|
var savedTaskCategories = /* @__PURE__ */ __name((database) => {
|
|
23098
23109
|
const row2 = database.prepare("SELECT value FROM store_settings WHERE key = ?").get(SETTING3);
|
|
@@ -23111,7 +23122,7 @@ var saveTaskCategories = /* @__PURE__ */ __name((database, categories, now2) =>
|
|
|
23111
23122
|
database.prepare("INSERT INTO store_settings (key, value, at) VALUES (?, ?, ?) ON CONFLICT (key) DO UPDATE SET value = excluded.value, at = excluded.at").run(SETTING3, JSON.stringify(categories), now2);
|
|
23112
23123
|
}, "saveTaskCategories");
|
|
23113
23124
|
|
|
23114
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
23125
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.503.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e5d4ab9592406842b4a214ba16b749bd/node_modules/@wirecat/cli-core/dist/store/sqlite/task-close.js
|
|
23115
23126
|
var DEFAULT_AGENT_CLOSE = { allowed: true, min: 0.8 };
|
|
23116
23127
|
var ALLOWED = "taskAgentClose";
|
|
23117
23128
|
var MIN = "taskAgentCloseMin";
|
|
@@ -23167,7 +23178,50 @@ var SUGGESTION_COLUMNS = [
|
|
|
23167
23178
|
];
|
|
23168
23179
|
var CLEAR_SUGGESTION = SUGGESTION_COLUMNS.map((column2) => `${column2} = NULL`).join(", ");
|
|
23169
23180
|
|
|
23170
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
23181
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.503.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e5d4ab9592406842b4a214ba16b749bd/node_modules/@wirecat/cli-core/dist/store/sqlite/evidence-sources.js
|
|
23182
|
+
var EXCERPT_CHARS = 280;
|
|
23183
|
+
var excerptOf = /* @__PURE__ */ __name((text5) => {
|
|
23184
|
+
if (text5 == null)
|
|
23185
|
+
return null;
|
|
23186
|
+
const flat2 = String(text5).replace(/\s+/g, " ").trim();
|
|
23187
|
+
if (!flat2)
|
|
23188
|
+
return null;
|
|
23189
|
+
return flat2.length > EXCERPT_CHARS ? `${flat2.slice(0, EXCERPT_CHARS - 1)}\u2026` : flat2;
|
|
23190
|
+
}, "excerptOf");
|
|
23191
|
+
var iso = /* @__PURE__ */ __name((value) => value == null ? null : new Date(Number(value)).toISOString(), "iso");
|
|
23192
|
+
var textOf = /* @__PURE__ */ __name((value) => value == null || String(value).trim() === "" ? null : String(value), "textOf");
|
|
23193
|
+
var READS2 = {
|
|
23194
|
+
message: "SELECT c.title, coalesce(m.sender_name, i.name) AS sender, m.sent_at AS at, m.text AS body, a.provider AS tool FROM messages m JOIN chats c ON c.id = m.chat_id JOIN accounts a ON a.id = c.account_id LEFT JOIN identities i ON i.id = m.sender_identity_id WHERE m.id = ?",
|
|
23195
|
+
email: "SELECT e.subject AS title, coalesce(e.from_name, e.from_address) AS sender, e.sent_at AS at, coalesce(e.body_text, e.snippet) AS body, 'email' AS tool FROM emails e WHERE e.id = ?",
|
|
23196
|
+
note: "SELECT title, NULL AS sender, updated_at AS at, body, 'notes' AS tool FROM notes WHERE id = ?",
|
|
23197
|
+
document: "SELECT d.title, NULL AS sender, coalesce(d.external_updated_at, d.updated_at) AS at, d.body, a.provider AS tool FROM documents d JOIN accounts a ON a.id = d.account_id WHERE d.id = ?",
|
|
23198
|
+
meeting: "SELECT m.title, NULL AS sender, m.started_at AS at, m.description AS body, a.provider AS tool FROM meetings m JOIN accounts a ON a.id = m.account_id WHERE m.id = ?",
|
|
23199
|
+
meeting_transcript: "SELECT m.title, NULL AS sender, m.started_at AS at, NULL AS body, a.provider AS tool FROM meeting_transcripts t JOIN meetings m ON m.id = t.meeting_id JOIN accounts a ON a.id = m.account_id WHERE t.id = ?",
|
|
23200
|
+
meeting_transcript_row: "SELECT m.title, r.speaker_name AS sender, m.started_at + coalesce(r.start_ms, 0) AS at, r.text AS body, a.provider AS tool FROM meeting_transcript_rows r JOIN meeting_transcripts t ON t.id = r.meeting_transcript_id JOIN meetings m ON m.id = t.meeting_id JOIN accounts a ON a.id = m.account_id WHERE r.id = ?"
|
|
23201
|
+
};
|
|
23202
|
+
var KIND = {
|
|
23203
|
+
meeting_transcript: "meeting",
|
|
23204
|
+
meeting_transcript_row: "meeting"
|
|
23205
|
+
};
|
|
23206
|
+
var evidenceSourcesOf = /* @__PURE__ */ __name((database, from2) => database.prepare(`SELECT to_type, to_id FROM links WHERE from_type = ? AND from_id = ? AND kind = ${linkKind("evidence")} AND to_id IS NOT NULL ORDER BY id`).all(from2.type, from2.id).map((link3) => {
|
|
23207
|
+
const thing = storedThing(link3.to_type, link3.to_id);
|
|
23208
|
+
const state = stateOfThing(database, thing);
|
|
23209
|
+
const read2 = READS2[thing.type];
|
|
23210
|
+
const row2 = read2 === void 0 || state === "unavailable" ? void 0 : database.prepare(read2).get(thing.id);
|
|
23211
|
+
const gone = state !== "available";
|
|
23212
|
+
return {
|
|
23213
|
+
ref: referenceOfThing(database, thing) ?? null,
|
|
23214
|
+
kind: KIND[thing.type] ?? thing.type,
|
|
23215
|
+
title: textOf(row2?.title),
|
|
23216
|
+
sender: textOf(row2?.sender),
|
|
23217
|
+
at: iso(row2?.at),
|
|
23218
|
+
excerpt: gone ? null : excerptOf(row2?.body),
|
|
23219
|
+
tool: textOf(row2?.tool),
|
|
23220
|
+
missing: gone
|
|
23221
|
+
};
|
|
23222
|
+
}), "evidenceSourcesOf");
|
|
23223
|
+
|
|
23224
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.503.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e5d4ab9592406842b4a214ba16b749bd/node_modules/@wirecat/cli-core/dist/attachments/limits.js
|
|
23171
23225
|
var MAX_FILE_BYTES = 50 * 1024 * 1024;
|
|
23172
23226
|
var MAX_TEXT_CHARS = 2e6;
|
|
23173
23227
|
var ATTACHMENT_LIMIT_ENV = [
|
|
@@ -23193,7 +23247,7 @@ var pdfPreviewLimits = /* @__PURE__ */ __name((env = process.env) => {
|
|
|
23193
23247
|
return { pixels, bytes: positive(env, "MESSAGING_PDF_PREVIEW_MAX_MIB", 8 * 1024 * 1024, 1024 * 1024) };
|
|
23194
23248
|
}, "pdfPreviewLimits");
|
|
23195
23249
|
|
|
23196
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
23250
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.503.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e5d4ab9592406842b4a214ba16b749bd/node_modules/@wirecat/cli-core/dist/store/ulid.js
|
|
23197
23251
|
import { randomBytes } from "node:crypto";
|
|
23198
23252
|
var CROCKFORD = "0123456789ABCDEFGHJKMNPQRSTVWXYZ";
|
|
23199
23253
|
var ulid = /* @__PURE__ */ __name((now2 = Date.now()) => {
|
|
@@ -23206,7 +23260,7 @@ var ulid = /* @__PURE__ */ __name((now2 = Date.now()) => {
|
|
|
23206
23260
|
return time3 + random;
|
|
23207
23261
|
}, "ulid");
|
|
23208
23262
|
|
|
23209
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
23263
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.503.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e5d4ab9592406842b4a214ba16b749bd/node_modules/@wirecat/cli-core/dist/store/sqlite/document-metadata.js
|
|
23210
23264
|
var FOLDED_FIELDS = ["title", "site", "language", "author"];
|
|
23211
23265
|
var encodeDocumentMetadata = /* @__PURE__ */ __name((meta, sections) => {
|
|
23212
23266
|
if (!meta && !sections?.length)
|
|
@@ -23227,7 +23281,7 @@ var languageOf = /* @__PURE__ */ __name((meta) => {
|
|
|
23227
23281
|
return typeof language === "string" && language !== "" ? language : null;
|
|
23228
23282
|
}, "languageOf");
|
|
23229
23283
|
|
|
23230
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
23284
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.503.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e5d4ab9592406842b4a214ba16b749bd/node_modules/@wirecat/cli-core/dist/store/sqlite/files.js
|
|
23231
23285
|
var isObject = /* @__PURE__ */ __name((value) => value !== null && typeof value === "object" && !Array.isArray(value), "isObject");
|
|
23232
23286
|
var objectOf = /* @__PURE__ */ __name((value) => {
|
|
23233
23287
|
if (isObject(value))
|
|
@@ -23470,7 +23524,7 @@ var filesStoreOver = /* @__PURE__ */ __name(({ database, now: now2 }) => {
|
|
|
23470
23524
|
};
|
|
23471
23525
|
}, "filesStoreOver");
|
|
23472
23526
|
|
|
23473
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
23527
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.503.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e5d4ab9592406842b4a214ba16b749bd/node_modules/@wirecat/cli-core/dist/store/sqlite/imported-documents.js
|
|
23474
23528
|
var IMPORTED_DOCUMENT_QUERY = defineQuery({
|
|
23475
23529
|
entity: "document",
|
|
23476
23530
|
backend: "sql",
|
|
@@ -23516,11 +23570,11 @@ var importedDocumentWhere = /* @__PURE__ */ __name((database, query) => {
|
|
|
23516
23570
|
return queryFilter(validateQuery(query, IMPORTED_DOCUMENT_QUERY), columns);
|
|
23517
23571
|
}, "importedDocumentWhere");
|
|
23518
23572
|
|
|
23519
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
23573
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.503.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e5d4ab9592406842b4a214ba16b749bd/node_modules/@wirecat/cli-core/dist/store/sqlite/notes.js
|
|
23520
23574
|
var NOTE_FORMATS = ["obsidian", "markdown"];
|
|
23521
|
-
var
|
|
23522
|
-
var optionalIso = /* @__PURE__ */ __name((value) => value == null ? null :
|
|
23523
|
-
var
|
|
23575
|
+
var iso2 = /* @__PURE__ */ __name((value) => new Date(Number(value)).toISOString(), "iso");
|
|
23576
|
+
var optionalIso = /* @__PURE__ */ __name((value) => value == null ? null : iso2(value), "optionalIso");
|
|
23577
|
+
var textOf2 = /* @__PURE__ */ __name((text5, what, max = 1e5, allowEmpty = false) => {
|
|
23524
23578
|
const value = text5.trim();
|
|
23525
23579
|
if (!value && !allowEmpty || value.length > max)
|
|
23526
23580
|
throw new CliError("validation_error", `${what} takes ${allowEmpty ? 0 : 1}\u2013${max} characters`);
|
|
@@ -23544,8 +23598,8 @@ var documentOf = /* @__PURE__ */ __name((row2) => ({
|
|
|
23544
23598
|
contentHash: row2.content_hash == null ? null : String(row2.content_hash),
|
|
23545
23599
|
revision: Number(row2.revision),
|
|
23546
23600
|
exportPath: row2.export_path == null ? null : String(row2.export_path),
|
|
23547
|
-
createdAt:
|
|
23548
|
-
updatedAt:
|
|
23601
|
+
createdAt: iso2(row2.created_at),
|
|
23602
|
+
updatedAt: iso2(row2.updated_at),
|
|
23549
23603
|
deletedAt: optionalIso(row2.deleted_at)
|
|
23550
23604
|
}), "documentOf");
|
|
23551
23605
|
var noteOf = /* @__PURE__ */ __name((row2) => ({
|
|
@@ -23560,8 +23614,8 @@ var noteOf = /* @__PURE__ */ __name((row2) => ({
|
|
|
23560
23614
|
contentHash: null,
|
|
23561
23615
|
revision: Number(row2.revision),
|
|
23562
23616
|
exportPath: null,
|
|
23563
|
-
createdAt:
|
|
23564
|
-
updatedAt:
|
|
23617
|
+
createdAt: iso2(row2.created_at),
|
|
23618
|
+
updatedAt: iso2(row2.updated_at),
|
|
23565
23619
|
deletedAt: optionalIso(row2.deleted_at)
|
|
23566
23620
|
}), "noteOf");
|
|
23567
23621
|
var noteRowOf = /* @__PURE__ */ __name((database, reference2) => {
|
|
@@ -23587,7 +23641,7 @@ var linkOf = /* @__PURE__ */ __name((database, row2) => {
|
|
|
23587
23641
|
evidence: row2.evidence == null ? null : String(row2.evidence),
|
|
23588
23642
|
provenance: metadata3.provenance ?? null,
|
|
23589
23643
|
confirmed: Number(row2.confirmed) === 1,
|
|
23590
|
-
createdAt:
|
|
23644
|
+
createdAt: iso2(row2.created_at)
|
|
23591
23645
|
};
|
|
23592
23646
|
}, "linkOf");
|
|
23593
23647
|
var requiredThing = /* @__PURE__ */ __name((database, reference2, what = "the target") => {
|
|
@@ -23626,7 +23680,7 @@ var insertLink = /* @__PURE__ */ __name((context, input) => {
|
|
|
23626
23680
|
const origin = oneOf(input.origin ?? "owner", LINK_ORIGINS, "a link's origin");
|
|
23627
23681
|
const from2 = requiredThing(database, input.from, "a link's source");
|
|
23628
23682
|
const to = input.to === void 0 ? null : requiredThing(database, input.to, "a link's target");
|
|
23629
|
-
const targetText = input.targetText === void 0 ? null :
|
|
23683
|
+
const targetText = input.targetText === void 0 ? null : textOf2(input.targetText, "a link's target", 500);
|
|
23630
23684
|
if (to === null && targetText === null)
|
|
23631
23685
|
throw new CliError("validation_error", "a link needs a target");
|
|
23632
23686
|
if (to !== null) {
|
|
@@ -23635,8 +23689,8 @@ var insertLink = /* @__PURE__ */ __name((context, input) => {
|
|
|
23635
23689
|
return linkOf(database, existing);
|
|
23636
23690
|
}
|
|
23637
23691
|
const at = now2();
|
|
23638
|
-
const provenance2 = input.provenance === void 0 ? void 0 :
|
|
23639
|
-
const row2 = database.prepare("INSERT INTO links (from_type, from_id, to_type, to_id, kind, anchor, source, target_text, target_folded, role, evidence, metadata, confirmed, created_at, author, updated_at) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) RETURNING id").get(from2.type, from2.id, to?.type ?? null, to?.id ?? null, kind3, input.anchor ?? null, origin, targetText, targetText === null ? null : targetKey(targetText), input.role === void 0 ? null :
|
|
23692
|
+
const provenance2 = input.provenance === void 0 ? void 0 : textOf2(input.provenance, "provenance", 2e3);
|
|
23693
|
+
const row2 = database.prepare("INSERT INTO links (from_type, from_id, to_type, to_id, kind, anchor, source, target_text, target_folded, role, evidence, metadata, confirmed, created_at, author, updated_at) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) RETURNING id").get(from2.type, from2.id, to?.type ?? null, to?.id ?? null, kind3, input.anchor ?? null, origin, targetText, targetText === null ? null : targetKey(targetText), input.role === void 0 ? null : textOf2(input.role, "a role", 200), input.evidence === void 0 ? null : textOf2(input.evidence, "evidence", 2e3), provenance2 === void 0 ? null : JSON.stringify({ provenance: provenance2 }), input.confirmed === false ? 0 : 1, at, origin === "owner" ? "owner" : null, at);
|
|
23640
23694
|
if (to === null && targetText !== null)
|
|
23641
23695
|
resolveKey(database, targetKey(targetText));
|
|
23642
23696
|
return linkOf(database, database.prepare("SELECT * FROM links WHERE id = ?").get(Number(row2?.id)));
|
|
@@ -23649,7 +23703,7 @@ var folderOf = /* @__PURE__ */ __name((row2) => {
|
|
|
23649
23703
|
name: folder ? String(row2.name) : `${String(row2.provider)}:${String(row2.external_id)}`,
|
|
23650
23704
|
provider: String(row2.provider),
|
|
23651
23705
|
format: settings.format ?? (folder ? "obsidian" : "markdown"),
|
|
23652
|
-
createdAt:
|
|
23706
|
+
createdAt: iso2(row2.created_at),
|
|
23653
23707
|
...folder ? {} : { account: { provider: String(row2.provider), account: String(row2.external_id) } }
|
|
23654
23708
|
};
|
|
23655
23709
|
}, "folderOf");
|
|
@@ -23754,7 +23808,7 @@ var notesStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
23754
23808
|
addFolder: /* @__PURE__ */ __name(async ({ name, format = "obsidian" }) => {
|
|
23755
23809
|
const at = now2();
|
|
23756
23810
|
const checked = oneOf(format, NOTE_FORMATS, "a folder's format");
|
|
23757
|
-
const row2 = database.prepare("INSERT INTO accounts (provider, external_id, name, settings, created_at, updated_at) VALUES (?, ?, ?, ?, ?, ?) RETURNING id").get(folderProviderOf(checked), ulid(at),
|
|
23811
|
+
const row2 = database.prepare("INSERT INTO accounts (provider, external_id, name, settings, created_at, updated_at) VALUES (?, ?, ?, ?, ?, ?) RETURNING id").get(folderProviderOf(checked), ulid(at), textOf2(name, "a folder's name", 200), JSON.stringify({ format: checked }), at, at);
|
|
23758
23812
|
return folderOf(folderRow(String(row2?.id)));
|
|
23759
23813
|
}, "addFolder"),
|
|
23760
23814
|
folders: /* @__PURE__ */ __name(async () => database.prepare(`SELECT * FROM accounts WHERE ${folderProviderSql()} ORDER BY name, id`).all().map(folderOf), "folders"),
|
|
@@ -23766,14 +23820,14 @@ var notesStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
23766
23820
|
if (found2 || !create)
|
|
23767
23821
|
return found2 ? folderOf(found2) : void 0;
|
|
23768
23822
|
const at = now2();
|
|
23769
|
-
database.prepare("INSERT OR IGNORE INTO accounts (provider, external_id, name, settings, created_at, updated_at) VALUES (?, ?, NULL, ?, ?, ?)").run(provider,
|
|
23823
|
+
database.prepare("INSERT OR IGNORE INTO accounts (provider, external_id, name, settings, created_at, updated_at) VALUES (?, ?, NULL, ?, ?, ?)").run(provider, textOf2(account, "an account's id", 200), JSON.stringify({ format: "markdown" }), at, at);
|
|
23770
23824
|
return folderOf(find2());
|
|
23771
23825
|
}, "documentsAccount"),
|
|
23772
23826
|
documentsAccounts: /* @__PURE__ */ __name(async () => database.prepare(`SELECT * FROM accounts WHERE provider IN (${DOCUMENT_ACCOUNT_PROVIDERS.map(() => "?").join(", ")}) ORDER BY provider, external_id`).all(...DOCUMENT_ACCOUNT_PROVIDERS).map(folderOf), "documentsAccounts"),
|
|
23773
23827
|
saveFileNote: /* @__PURE__ */ __name(async (input) => write(database, () => {
|
|
23774
23828
|
const folder = Number(folderRow(input.folderId).id);
|
|
23775
|
-
const path =
|
|
23776
|
-
const text5 =
|
|
23829
|
+
const path = textOf2(input.path, "a note's path", 4096);
|
|
23830
|
+
const text5 = textOf2(input.text, "a note's text", MAX_TEXT_CHARS, true);
|
|
23777
23831
|
const frontMatter = input.frontMatter == null ? null : JSON.stringify(input.frontMatter);
|
|
23778
23832
|
let metadata3 = encodeDocumentMetadata(input.metadata, input.sections);
|
|
23779
23833
|
const language = languageOf(input.metadata);
|
|
@@ -23824,7 +23878,7 @@ var notesStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
23824
23878
|
}), "saveFileNote"),
|
|
23825
23879
|
renameFileNote: /* @__PURE__ */ __name(async (folderId, from2, to) => write(database, () => {
|
|
23826
23880
|
const folder = Number(folderRow(folderId).id);
|
|
23827
|
-
const target =
|
|
23881
|
+
const target = textOf2(to, "a note's path", 4096);
|
|
23828
23882
|
const at = now2();
|
|
23829
23883
|
const place = fileAt(folder, from2, true);
|
|
23830
23884
|
const legacy = database.prepare("SELECT id FROM documents WHERE account_id = ? AND external_id = ? AND deleted_at IS NULL").get(folder, from2);
|
|
@@ -23891,7 +23945,7 @@ var notesStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
23891
23945
|
const owner = ownerPerson(database);
|
|
23892
23946
|
const [subject2] = about.map((reference2) => requiredThing(database, reference2));
|
|
23893
23947
|
const notable = subject2 ?? owner;
|
|
23894
|
-
const row2 = database.prepare("INSERT INTO notes (notable_type, notable_id, title, body, author_type, author_id, revision, created_at, updated_at) VALUES (?, ?, ?, ?, ?, ?, 1, ?, ?) RETURNING id").get(notable.type, notable.id, title === void 0 ? null :
|
|
23948
|
+
const row2 = database.prepare("INSERT INTO notes (notable_type, notable_id, title, body, author_type, author_id, revision, created_at, updated_at) VALUES (?, ?, ?, ?, ?, ?, 1, ?, ?) RETURNING id").get(notable.type, notable.id, title === void 0 ? null : textOf2(title, "a title", 500), textOf2(text5, "a note"), owner.type, owner.id, at, at);
|
|
23895
23949
|
const id2 = Number(row2?.id);
|
|
23896
23950
|
for (const reference2 of about.slice(1))
|
|
23897
23951
|
insertLink(context, { from: `note:${id2}`, to: reference2, kind: "about", origin: "owner" });
|
|
@@ -23936,7 +23990,7 @@ var notesStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
23936
23990
|
throw new CliError("validation_error", "a file note is edited in its file; the next import reads it");
|
|
23937
23991
|
const bare = id2.replace(/^note:/, "");
|
|
23938
23992
|
const found2 = noteRow(bare);
|
|
23939
|
-
const changed = database.prepare("UPDATE notes SET body = ?, revision = revision + 1, updated_at = ? WHERE id = ? AND revision = ? AND deleted_at IS NULL").run(
|
|
23993
|
+
const changed = database.prepare("UPDATE notes SET body = ?, revision = revision + 1, updated_at = ? WHERE id = ? AND revision = ? AND deleted_at IS NULL").run(textOf2(text5, "a note"), now2(), Number(bare), revision2).changes;
|
|
23940
23994
|
if (!changed)
|
|
23941
23995
|
throw new CliError("validation_error", "the note changed; read its current revision before editing");
|
|
23942
23996
|
database.prepare("INSERT INTO note_revisions (note_id, body, revision, created_at) VALUES (?, ?, ?, ?)").run(Number(bare), String(found2.body), revision2, now2());
|
|
@@ -24026,9 +24080,9 @@ var notesStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
24026
24080
|
};
|
|
24027
24081
|
}, "notesStoreOver");
|
|
24028
24082
|
|
|
24029
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
24083
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.503.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e5d4ab9592406842b4a214ba16b749bd/node_modules/@wirecat/cli-core/dist/store/sqlite/memories.js
|
|
24030
24084
|
var NAMED = "SELECT m.*, b.name AS author_name FROM memories m LEFT JOIN bots b ON m.author_type = 'bot' AND b.id = m.author_id";
|
|
24031
|
-
var
|
|
24085
|
+
var iso3 = /* @__PURE__ */ __name((value) => new Date(Number(value)).toISOString(), "iso");
|
|
24032
24086
|
var oneOf2 = /* @__PURE__ */ __name((value, allowed, what) => {
|
|
24033
24087
|
if (typeof value !== "string" || !allowed.includes(value))
|
|
24034
24088
|
throw new CliError("validation_error", `${what} is one of ${allowed.join(", ")}`);
|
|
@@ -24056,15 +24110,52 @@ var linkEvidence = /* @__PURE__ */ __name((context, from2, references, author) =
|
|
|
24056
24110
|
}
|
|
24057
24111
|
}, "linkEvidence");
|
|
24058
24112
|
var evidenceOf = /* @__PURE__ */ __name((context, from2) => context.database.prepare(`SELECT to_type, to_id FROM links WHERE from_type = ? AND from_id = ? AND kind = ${linkKind("evidence")} AND to_id IS NOT NULL ORDER BY id`).all(from2.type, from2.id).flatMap((row2) => referenceOfThing(context.database, storedThing(row2.to_type, row2.to_id)) ?? []), "evidenceOf");
|
|
24113
|
+
var SUBJECT_NAMES = {
|
|
24114
|
+
person: "SELECT p.owner, coalesce(p.name, (SELECT a.name FROM aliases a WHERE a.aliasable_type = 'person' AND a.aliasable_id = p.id ORDER BY a.display DESC, a.id LIMIT 1), (SELECT i.name FROM identity_links l JOIN identities i ON i.id = l.identity_id WHERE l.person_id = p.id AND i.name IS NOT NULL ORDER BY i.id LIMIT 1)) AS name FROM persons p WHERE p.id = ?",
|
|
24115
|
+
project: "SELECT 0 AS owner, name FROM projects WHERE id = ?",
|
|
24116
|
+
organization: "SELECT 0 AS owner, name FROM organizations WHERE id = ?"
|
|
24117
|
+
};
|
|
24118
|
+
var subjectOf = /* @__PURE__ */ __name((database, row2) => {
|
|
24119
|
+
if (row2.subject_type == null)
|
|
24120
|
+
return { subject: null, subjectName: null, subjectIsOwner: false };
|
|
24121
|
+
const thing = storedThing(row2.subject_type, row2.subject_id);
|
|
24122
|
+
const read2 = SUBJECT_NAMES[thing.type];
|
|
24123
|
+
const named2 = read2 === void 0 ? void 0 : database.prepare(read2).get(thing.id);
|
|
24124
|
+
return {
|
|
24125
|
+
subject: referenceOfThing(database, thing) ?? null,
|
|
24126
|
+
subjectName: named2?.name == null ? null : String(named2.name),
|
|
24127
|
+
subjectIsOwner: Number(named2?.owner) === 1
|
|
24128
|
+
};
|
|
24129
|
+
}, "subjectOf");
|
|
24130
|
+
var dropLinksOf = /* @__PURE__ */ __name((database, thing) => {
|
|
24131
|
+
const count = Number(database.prepare("SELECT count(*) AS n FROM links WHERE (from_type = ? AND from_id = ?) OR (to_type = ? AND to_id = ?)").get(thing.type, thing.id, thing.type, thing.id)?.n);
|
|
24132
|
+
database.prepare("DELETE FROM links WHERE to_type = ? AND to_id = ?").run(thing.type, thing.id);
|
|
24133
|
+
return count;
|
|
24134
|
+
}, "dropLinksOf");
|
|
24135
|
+
var erase = /* @__PURE__ */ __name((database, work) => {
|
|
24136
|
+
database.exec("PRAGMA secure_delete = ON");
|
|
24137
|
+
try {
|
|
24138
|
+
const done = write(database, () => {
|
|
24139
|
+
const result = work();
|
|
24140
|
+
for (const index2 of ["memory_words", "memory_stems"])
|
|
24141
|
+
database.prepare(`INSERT INTO ${index2} (${index2}) VALUES ('optimize')`).run();
|
|
24142
|
+
return result;
|
|
24143
|
+
});
|
|
24144
|
+
database.exec("PRAGMA wal_checkpoint(TRUNCATE)");
|
|
24145
|
+
return done;
|
|
24146
|
+
} finally {
|
|
24147
|
+
database.exec("PRAGMA secure_delete = OFF");
|
|
24148
|
+
}
|
|
24149
|
+
}, "erase");
|
|
24059
24150
|
var memoriesStoreOver = /* @__PURE__ */ __name((context) => {
|
|
24060
24151
|
const { database, now: now2 } = context;
|
|
24061
|
-
const
|
|
24152
|
+
const stemmerFor2 = stemmerCache();
|
|
24062
24153
|
const memoryOf = /* @__PURE__ */ __name((row2) => ({
|
|
24063
24154
|
id: String(row2.id),
|
|
24064
24155
|
ref: `memory:${row2.id}`,
|
|
24065
24156
|
kind: row2.kind,
|
|
24066
24157
|
body: String(row2.body),
|
|
24067
|
-
|
|
24158
|
+
...subjectOf(database, row2),
|
|
24068
24159
|
author: authorOf(row2),
|
|
24069
24160
|
model: row2.model == null ? null : String(row2.model),
|
|
24070
24161
|
confidence: row2.confidence == null ? null : Number(row2.confidence),
|
|
@@ -24072,9 +24163,9 @@ var memoriesStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
24072
24163
|
scope: row2.scope,
|
|
24073
24164
|
supersedes: row2.supersedes_id == null ? null : `memory:${row2.supersedes_id}`,
|
|
24074
24165
|
evidence: evidenceOf(context, { type: "memory", id: Number(row2.id) }),
|
|
24075
|
-
lastVerifiedAt: row2.last_verified_at == null ? null :
|
|
24076
|
-
createdAt:
|
|
24077
|
-
updatedAt:
|
|
24166
|
+
lastVerifiedAt: row2.last_verified_at == null ? null : iso3(row2.last_verified_at),
|
|
24167
|
+
createdAt: iso3(row2.created_at),
|
|
24168
|
+
updatedAt: iso3(row2.updated_at)
|
|
24078
24169
|
}), "memoryOf");
|
|
24079
24170
|
const rowOf = /* @__PURE__ */ __name((reference2) => {
|
|
24080
24171
|
const thing = requiredThing(database, reference2.includes(":") ? reference2 : `memory:${reference2}`, "the memory");
|
|
@@ -24129,9 +24220,20 @@ var memoriesStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
24129
24220
|
}, "list"),
|
|
24130
24221
|
confirm: /* @__PURE__ */ __name(async (reference2) => setStatus(reference2, "confirmed", true), "confirm"),
|
|
24131
24222
|
markStale: /* @__PURE__ */ __name(async (reference2) => setStatus(reference2, "stale", false), "markStale"),
|
|
24223
|
+
remove: /* @__PURE__ */ __name(async (reference2) => {
|
|
24224
|
+
const id2 = Number(rowOf(reference2).id);
|
|
24225
|
+
const links2 = erase(database, () => {
|
|
24226
|
+
database.prepare("UPDATE memories SET supersedes_id = NULL WHERE supersedes_id = ?").run(id2);
|
|
24227
|
+
const count = dropLinksOf(database, { type: "memory", id: id2 });
|
|
24228
|
+
database.prepare("DELETE FROM memories WHERE id = ?").run(id2);
|
|
24229
|
+
return count;
|
|
24230
|
+
});
|
|
24231
|
+
return { ref: `memory:${id2}`, removed: true, links: links2 };
|
|
24232
|
+
}, "remove"),
|
|
24233
|
+
sources: /* @__PURE__ */ __name(async (reference2) => evidenceSourcesOf(database, { type: "memory", id: Number(rowOf(reference2).id) }), "sources"),
|
|
24132
24234
|
search: /* @__PURE__ */ __name(async (text5, { subject: subjectRef, scope: scope3, limit = 20 } = {}) => {
|
|
24133
24235
|
const subject2 = subjectRef === void 0 ? void 0 : requiredThing(database, subjectRef);
|
|
24134
|
-
drainCorpus(database, CORPORA.memory,
|
|
24236
|
+
drainCorpus(database, CORPORA.memory, stemmerFor2);
|
|
24135
24237
|
const words3 = normalize(text5).split(/\s+/).filter((word) => /[\p{L}\p{N}]/u.test(word));
|
|
24136
24238
|
if (words3.length === 0)
|
|
24137
24239
|
throw new CliError("validation_error", "say what to find in the memories");
|
|
@@ -24142,7 +24244,7 @@ var memoriesStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
24142
24244
|
};
|
|
24143
24245
|
}, "memoriesStoreOver");
|
|
24144
24246
|
|
|
24145
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
24247
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.503.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e5d4ab9592406842b4a214ba16b749bd/node_modules/@wirecat/cli-core/dist/store/sqlite/task-first-pass.js
|
|
24146
24248
|
var DEFAULT_FIRST_PASS_PER_CHAT = 0;
|
|
24147
24249
|
var KEY = "taskFirstPassPerChat";
|
|
24148
24250
|
var firstPassPerChatOf = /* @__PURE__ */ __name((value, setting = "task_first_pass_per_chat") => {
|
|
@@ -24162,7 +24264,7 @@ var saveFirstPassPerChat = /* @__PURE__ */ __name((database, value, now2) => {
|
|
|
24162
24264
|
database.prepare("INSERT INTO store_settings (key, value, at) VALUES (?, ?, ?) ON CONFLICT (key) DO UPDATE SET value = excluded.value, at = excluded.at").run(KEY, String(value), now2);
|
|
24163
24265
|
}, "saveFirstPassPerChat");
|
|
24164
24266
|
|
|
24165
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
24267
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.503.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e5d4ab9592406842b4a214ba16b749bd/node_modules/@wirecat/cli-core/dist/store/sqlite/task-relations.js
|
|
24166
24268
|
var TASK_RELATION_KINDS = [
|
|
24167
24269
|
"blocked-by",
|
|
24168
24270
|
"follow-up-of",
|
|
@@ -24292,7 +24394,7 @@ var taskRelationsStoreOver = /* @__PURE__ */ __name((context, record4) => {
|
|
|
24292
24394
|
};
|
|
24293
24395
|
}, "taskRelationsStoreOver");
|
|
24294
24396
|
|
|
24295
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
24397
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.503.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e5d4ab9592406842b4a214ba16b749bd/node_modules/@wirecat/cli-core/dist/store/sqlite/work-tasks.js
|
|
24296
24398
|
var TASK_ROLES = ["assignee", "reviewer", "watcher"];
|
|
24297
24399
|
var TASK_EVENT_KINDS = [
|
|
24298
24400
|
"created",
|
|
@@ -24309,17 +24411,17 @@ var TASK_EVENT_KINDS = [
|
|
|
24309
24411
|
"category",
|
|
24310
24412
|
"close-suggestion"
|
|
24311
24413
|
];
|
|
24312
|
-
var
|
|
24414
|
+
var iso4 = /* @__PURE__ */ __name((value) => value == null ? null : new Date(Number(value)).toISOString(), "iso");
|
|
24313
24415
|
var recordTaskEvent = /* @__PURE__ */ __name((database, task, actor, kind3, changes, at) => {
|
|
24314
24416
|
database.prepare("INSERT INTO task_events (task_id, actor_type, actor_id, kind, changes, created_at) VALUES (?, ?, ?, ?, ?, ?)").run(task, actor?.type ?? null, actor?.id ?? null, kind3, changes === null ? null : JSON.stringify(changes), at);
|
|
24315
24417
|
}, "recordTaskEvent");
|
|
24316
|
-
var
|
|
24418
|
+
var textOf3 = /* @__PURE__ */ __name((value, what, max) => {
|
|
24317
24419
|
const text5 = value.trim();
|
|
24318
24420
|
if (!text5 || text5.length > max)
|
|
24319
24421
|
throw new CliError("validation_error", `${what} takes 1\u2013${max} characters`);
|
|
24320
24422
|
return text5;
|
|
24321
24423
|
}, "textOf");
|
|
24322
|
-
var claimOf = /* @__PURE__ */ __name((row2, at) => row2.claimed_by != null && Number(row2.claimed_until) >= at ? { claimedBy: String(row2.claimed_by), claimedUntil:
|
|
24424
|
+
var claimOf = /* @__PURE__ */ __name((row2, at) => row2.claimed_by != null && Number(row2.claimed_until) >= at ? { claimedBy: String(row2.claimed_by), claimedUntil: iso4(row2.claimed_until) } : { claimedBy: null, claimedUntil: null }, "claimOf");
|
|
24323
24425
|
var priorityOf = /* @__PURE__ */ __name((value) => {
|
|
24324
24426
|
if (value !== null && !(Number.isInteger(value) && value >= 0 && value <= 4))
|
|
24325
24427
|
throw new CliError("validation_error", "a priority is 0 (urgent) to 4 (low)");
|
|
@@ -24380,9 +24482,9 @@ var workTaskOperationsOver = /* @__PURE__ */ __name((context) => {
|
|
|
24380
24482
|
priority: row2.priority == null ? null : Number(row2.priority),
|
|
24381
24483
|
parent: row2.parent_id == null ? null : reference2(Number(row2.parent_id)),
|
|
24382
24484
|
source: row2.source_locator == null ? null : String(row2.source_locator),
|
|
24383
|
-
dueAt:
|
|
24384
|
-
nextCheckAt:
|
|
24385
|
-
closedAt:
|
|
24485
|
+
dueAt: iso4(row2.due_at),
|
|
24486
|
+
nextCheckAt: iso4(row2.next_check_at),
|
|
24487
|
+
closedAt: iso4(row2.closed_at),
|
|
24386
24488
|
reason: row2.close_reason == null ? null : String(row2.close_reason),
|
|
24387
24489
|
verdict: row2.verdict == null ? null : row2.verdict,
|
|
24388
24490
|
category: row2.category == null ? null : String(row2.category),
|
|
@@ -24390,8 +24492,8 @@ var workTaskOperationsOver = /* @__PURE__ */ __name((context) => {
|
|
|
24390
24492
|
closeCertainty: row2.close_certainty == null ? null : Number(row2.close_certainty),
|
|
24391
24493
|
closeSuggestion: closeSuggestionOf(database, row2),
|
|
24392
24494
|
assignments: database.prepare("SELECT assignee_id, role FROM task_assignments WHERE task_id = ? AND assignee_type = 'person' ORDER BY id").all(id2).map((assigned) => ({ to: `person:${assigned.assignee_id}`, role: assigned.role })),
|
|
24393
|
-
createdAt:
|
|
24394
|
-
updatedAt:
|
|
24495
|
+
createdAt: iso4(row2.created_at),
|
|
24496
|
+
updatedAt: iso4(row2.updated_at)
|
|
24395
24497
|
};
|
|
24396
24498
|
}, "detailsOf");
|
|
24397
24499
|
const rowById = /* @__PURE__ */ __name((id2) => database.prepare("SELECT * FROM tasks WHERE id = ?").get(id2), "rowById");
|
|
@@ -24410,12 +24512,12 @@ var workTaskOperationsOver = /* @__PURE__ */ __name((context) => {
|
|
|
24410
24512
|
recordTaskEvent(database, task, actor, event, { [column2]: [before2[column2] ?? null, value] }, at);
|
|
24411
24513
|
}, "change");
|
|
24412
24514
|
if (fields4.title !== void 0) {
|
|
24413
|
-
const title =
|
|
24515
|
+
const title = textOf3(fields4.title, "a task's title", 300);
|
|
24414
24516
|
change("title", title, created ? void 0 : "title");
|
|
24415
24517
|
change("title_folded", folded3(title));
|
|
24416
24518
|
}
|
|
24417
24519
|
if (fields4.description !== void 0)
|
|
24418
|
-
change("description", fields4.description === null ? null :
|
|
24520
|
+
change("description", fields4.description === null ? null : textOf3(fields4.description, "a description", 2e4), created ? void 0 : "description");
|
|
24419
24521
|
if (fields4.priority !== void 0)
|
|
24420
24522
|
change("priority", priorityOf(fields4.priority), "priority");
|
|
24421
24523
|
if (fields4.parent !== void 0)
|
|
@@ -24443,7 +24545,7 @@ var workTaskOperationsOver = /* @__PURE__ */ __name((context) => {
|
|
|
24443
24545
|
}
|
|
24444
24546
|
}
|
|
24445
24547
|
if (fields4.reason !== void 0) {
|
|
24446
|
-
const reason = fields4.reason === null ? null :
|
|
24548
|
+
const reason = fields4.reason === null ? null : textOf3(fields4.reason, "a reason", 500);
|
|
24447
24549
|
change("close_reason", reason);
|
|
24448
24550
|
change("close_reason_folded", folded3(reason));
|
|
24449
24551
|
}
|
|
@@ -24466,7 +24568,7 @@ var workTaskOperationsOver = /* @__PURE__ */ __name((context) => {
|
|
|
24466
24568
|
const number3 = Number(counted.tasks_count);
|
|
24467
24569
|
if (!Number.isSafeInteger(number3) || number3 < 1)
|
|
24468
24570
|
throw new CliError("configuration_error", "the project task counter exceeds the safe numbering range");
|
|
24469
|
-
const id2 = Number(database.prepare("INSERT INTO tasks (project_id, number, key, title, title_folded, type, status, author_type, author_id, source, created_at, updated_at) VALUES (?, ?, ?, ?, ?, ?, 'open', ?, ?, ?, ?, ?) RETURNING id").get(project, number3, `${String(counted.key)}-${number3}`,
|
|
24571
|
+
const id2 = Number(database.prepare("INSERT INTO tasks (project_id, number, key, title, title_folded, type, status, author_type, author_id, source, created_at, updated_at) VALUES (?, ?, ?, ?, ?, ?, 'open', ?, ?, ?, ?, ?) RETURNING id").get(project, number3, `${String(counted.key)}-${number3}`, textOf3(input.title, "a task's title", 300), folded3(textOf3(input.title, "a task's title", 300)), input.type, actor.type, actor.id, by === "owner" ? "owner" : "agent", at, at)?.id);
|
|
24470
24572
|
recordTaskEvent(database, id2, actor, "created", null, at);
|
|
24471
24573
|
const { title: _title, project: _project, type: _type, ...fields4 } = input;
|
|
24472
24574
|
edit(id2, fields4, actor, true);
|
|
@@ -24545,7 +24647,7 @@ var workTaskOperationsOver = /* @__PURE__ */ __name((context) => {
|
|
|
24545
24647
|
const row2 = rowById(task);
|
|
24546
24648
|
if (row2.status !== "open")
|
|
24547
24649
|
throw new CliError("validation_error", `task ${String(row2.key)} is ${String(row2.status)}; only an open task is claimed`);
|
|
24548
|
-
throw new CliError("validation_error", `${String(row2.claimed_by)} holds task ${String(row2.key)} until ${
|
|
24650
|
+
throw new CliError("validation_error", `${String(row2.claimed_by)} holds task ${String(row2.key)} until ${iso4(row2.claimed_until)}; wait for it, or ask them to release it`, { reason: "task.claimed", holder: String(row2.claimed_by), until: iso4(row2.claimed_until) });
|
|
24549
24651
|
}
|
|
24550
24652
|
return details2(task);
|
|
24551
24653
|
}, "claim"),
|
|
@@ -24566,7 +24668,7 @@ var workTaskOperationsOver = /* @__PURE__ */ __name((context) => {
|
|
|
24566
24668
|
kind: row2.kind,
|
|
24567
24669
|
actor: row2.actor_type == null ? null : { type: row2.actor_type, id: Number(row2.actor_id) },
|
|
24568
24670
|
changes: row2.changes == null ? null : JSON.parse(String(row2.changes)),
|
|
24569
|
-
at:
|
|
24671
|
+
at: iso4(row2.created_at)
|
|
24570
24672
|
})), "events")
|
|
24571
24673
|
};
|
|
24572
24674
|
}, "workTaskOperationsOver");
|
|
@@ -24579,7 +24681,7 @@ var workTasksOver = /* @__PURE__ */ __name((context) => {
|
|
|
24579
24681
|
};
|
|
24580
24682
|
}, "workTasksOver");
|
|
24581
24683
|
|
|
24582
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
24684
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.503.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e5d4ab9592406842b4a214ba16b749bd/node_modules/@wirecat/cli-core/dist/store/sqlite/task-close-store.js
|
|
24583
24685
|
var taskCloseOver = /* @__PURE__ */ __name((context) => {
|
|
24584
24686
|
const { database, now: now2 } = context;
|
|
24585
24687
|
const liveRow = /* @__PURE__ */ __name((id2) => {
|
|
@@ -24625,7 +24727,7 @@ var taskCloseOver = /* @__PURE__ */ __name((context) => {
|
|
|
24625
24727
|
};
|
|
24626
24728
|
}, "taskCloseOver");
|
|
24627
24729
|
|
|
24628
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
24730
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.503.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e5d4ab9592406842b4a214ba16b749bd/node_modules/@wirecat/cli-core/dist/store/sqlite/task-pairs.js
|
|
24629
24731
|
var TASK_PAIR_DECISIONS = ["review", "unsure", "merged", "rejected", "unmerged", "attached", "new"];
|
|
24630
24732
|
var taskPairsOver = /* @__PURE__ */ __name((context, similarity) => {
|
|
24631
24733
|
const { database, now: now2 } = context;
|
|
@@ -24844,7 +24946,7 @@ var taskPairsOver = /* @__PURE__ */ __name((context, similarity) => {
|
|
|
24844
24946
|
};
|
|
24845
24947
|
}, "taskPairsOver");
|
|
24846
24948
|
|
|
24847
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
24949
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.503.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e5d4ab9592406842b4a214ba16b749bd/node_modules/@wirecat/cli-core/dist/store/sqlite/tasks.js
|
|
24848
24950
|
var COLUMNS3 = "t.id AS row_id, t.package_id, t.source_locator, t.source_kind, t.source_group, t.type, t.status, t.close_reason, t.source, t.created_at, t.due_at, t.closed_at, t.closed_by_type, t.closed_by_id, t.key, t.category, t.claimed_by, t.claimed_until, p.name AS account";
|
|
24849
24951
|
var taskStoreOver = /* @__PURE__ */ __name((context) => {
|
|
24850
24952
|
const { database, now: now2 } = context;
|
|
@@ -25039,7 +25141,7 @@ var oneOf3 = /* @__PURE__ */ __name((values, value, column2) => {
|
|
|
25039
25141
|
throw new CliError("configuration_error", `the store holds a task with an unknown ${column2} "${String(value)}"`);
|
|
25040
25142
|
}, "oneOf");
|
|
25041
25143
|
|
|
25042
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
25144
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.503.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e5d4ab9592406842b4a214ba16b749bd/node_modules/@wirecat/cli-core/dist/store/accounts.js
|
|
25043
25145
|
var accountAccountsOver = /* @__PURE__ */ __name((context) => {
|
|
25044
25146
|
const { database } = context;
|
|
25045
25147
|
const { accountPk: accountPk2, findAccountPk: findAccountPk2 } = keysOver(context);
|
|
@@ -25084,7 +25186,7 @@ var accountsStoreOver = /* @__PURE__ */ __name((context, keyed) => {
|
|
|
25084
25186
|
};
|
|
25085
25187
|
}, "accountsStoreOver");
|
|
25086
25188
|
|
|
25087
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
25189
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.503.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e5d4ab9592406842b4a214ba16b749bd/node_modules/@wirecat/cli-core/dist/store/sqlite/attachments.js
|
|
25088
25190
|
var refColumn = /* @__PURE__ */ __name((ref3) => ref3 && Object.keys(ref3).length > 0 ? { providerRef: JSON.stringify(ref3) } : {}, "refColumn");
|
|
25089
25191
|
var updatePlaced = /* @__PURE__ */ __name(({ orm }, chatKey, messageId, files2, change) => {
|
|
25090
25192
|
const message2 = orm.select({ pk: messages.id }).from(messages).where(and(eq(messages.chatId, chatKey), eq(messages.externalId, messageId))).get();
|
|
@@ -25108,7 +25210,7 @@ var keepDownloads = /* @__PURE__ */ __name((context, chatKey, messageId, files2)
|
|
|
25108
25210
|
})), "keepDownloads");
|
|
25109
25211
|
var keepProviderRefs = /* @__PURE__ */ __name((context, chatKey, messageId, files2) => updatePlaced(context, chatKey, messageId, files2.filter((file) => Object.keys(file.providerRef).length > 0), (file) => refColumn(file.providerRef)), "keepProviderRefs");
|
|
25110
25212
|
|
|
25111
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
25213
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.503.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e5d4ab9592406842b4a214ba16b749bd/node_modules/@wirecat/cli-core/dist/store/attachments.js
|
|
25112
25214
|
var accountAttachmentsOver = /* @__PURE__ */ __name((context) => {
|
|
25113
25215
|
const { database } = context;
|
|
25114
25216
|
const { findAccountPk: findAccountPk2, findChatPk: findChatPk2, chatKeyOf } = keysOver(context);
|
|
@@ -25165,7 +25267,7 @@ var attachmentsStoreOver = /* @__PURE__ */ __name((context, keyed) => ({
|
|
|
25165
25267
|
}, "keepAttachmentText")
|
|
25166
25268
|
}), "attachmentsStoreOver");
|
|
25167
25269
|
|
|
25168
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
25270
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.503.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e5d4ab9592406842b4a214ba16b749bd/node_modules/@wirecat/cli-core/dist/store/sqlite/chat-rekey.js
|
|
25169
25271
|
var chatRow = /* @__PURE__ */ __name((context, accountKey, chatId) => context.database.prepare("SELECT * FROM chats WHERE account_id = ? AND external_id = ?").get(accountKey, chatId), "chatRow");
|
|
25170
25272
|
var pointerMover = /* @__PURE__ */ __name((context, type) => {
|
|
25171
25273
|
const statements = pointerPairs(context.database).filter(({ table }) => table !== "involvements").map(({ table, pointer }) => {
|
|
@@ -25345,7 +25447,7 @@ var rekeyChats = /* @__PURE__ */ __name((context, key2, accountKey, pairs, lockM
|
|
|
25345
25447
|
return done;
|
|
25346
25448
|
}, "rekeyChats");
|
|
25347
25449
|
|
|
25348
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
25450
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.503.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e5d4ab9592406842b4a214ba16b749bd/node_modules/@wirecat/cli-core/dist/store/sqlite/completeness.js
|
|
25349
25451
|
var historyStartKey = /* @__PURE__ */ __name((chatId) => `history_start:${chatId}`, "historyStartKey");
|
|
25350
25452
|
var fetchedKey = /* @__PURE__ */ __name((chatId) => `fetched:${chatId}`, "fetchedKey");
|
|
25351
25453
|
var CHAT_LIST_KEY = "chat_list_complete";
|
|
@@ -25377,7 +25479,7 @@ var chatCompleteness = /* @__PURE__ */ __name(({ database }, accountKey, chatIds
|
|
|
25377
25479
|
});
|
|
25378
25480
|
}, "chatCompleteness");
|
|
25379
25481
|
|
|
25380
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
25482
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.503.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e5d4ab9592406842b4a214ba16b749bd/node_modules/@wirecat/cli-core/dist/store/chats.js
|
|
25381
25483
|
var chatsStoreOver = /* @__PURE__ */ __name((context) => {
|
|
25382
25484
|
const { database } = context;
|
|
25383
25485
|
const { accountPk: accountPk2, findAccountPk: findAccountPk2, writeState: writeState2 } = keysOver(context);
|
|
@@ -25461,6 +25563,13 @@ var chatsStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
25461
25563
|
const row2 = context.database.prepare("SELECT kind FROM chats WHERE account_id = ? AND external_id = ?").get(accountKey, chatId);
|
|
25462
25564
|
return row2 ? String(row2.kind) : void 0;
|
|
25463
25565
|
}, "chatKind"),
|
|
25566
|
+
chatTitle: /* @__PURE__ */ __name(async (key2, chatId) => {
|
|
25567
|
+
const accountKey = findAccountPk2(key2);
|
|
25568
|
+
if (accountKey === void 0)
|
|
25569
|
+
return null;
|
|
25570
|
+
const row2 = context.database.prepare("SELECT title FROM chats WHERE account_id = ? AND external_id = ?").get(accountKey, chatId);
|
|
25571
|
+
return row2?.title == null ? null : String(row2.title);
|
|
25572
|
+
}, "chatTitle"),
|
|
25464
25573
|
chatActivity: /* @__PURE__ */ __name(async (key2, since, where) => {
|
|
25465
25574
|
const accountKey = findAccountPk2(key2);
|
|
25466
25575
|
return accountKey === void 0 ? { chats: [], storedAt: null } : chatActivity(context, accountKey, since, where);
|
|
@@ -25477,7 +25586,7 @@ var chatsStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
25477
25586
|
};
|
|
25478
25587
|
}, "chatsStoreOver");
|
|
25479
25588
|
|
|
25480
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
25589
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.503.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e5d4ab9592406842b4a214ba16b749bd/node_modules/@wirecat/cli-core/dist/store/sqlite/batches.js
|
|
25481
25590
|
import { createHash as createHash6 } from "node:crypto";
|
|
25482
25591
|
var BATCH_CONTEXT = 50;
|
|
25483
25592
|
var replied = /* @__PURE__ */ __name((m) => sql`EXISTS (SELECT 1 FROM messages p WHERE p.chat_id = ${m}.chat_id
|
|
@@ -25615,7 +25724,7 @@ var saveAnswers = /* @__PURE__ */ __name((context, id2, answer) => {
|
|
|
25615
25724
|
var clearAnswers = /* @__PURE__ */ __name(({ orm }, chatKey, model) => Number(orm.all(sql`DELETE FROM message_links WHERE chat_id = ${chatKey} AND source = 'agent'
|
|
25616
25725
|
${model === void 0 ? sql`` : sql`AND method = ${model}`} RETURNING 1 AS n`).length), "clearAnswers");
|
|
25617
25726
|
|
|
25618
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
25727
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.503.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e5d4ab9592406842b4a214ba16b749bd/node_modules/@wirecat/cli-core/dist/store/sqlite/conversations.js
|
|
25619
25728
|
import { setTimeout } from "node:timers/promises";
|
|
25620
25729
|
var position = /* @__PURE__ */ __name((sentAt, pk) => `${sentAt}:${pk}`, "position");
|
|
25621
25730
|
var linkInputs = /* @__PURE__ */ __name(({ orm }, chatKey, { after: after2, limit }) => {
|
|
@@ -25927,7 +26036,7 @@ var agentAnswers = /* @__PURE__ */ __name(({ orm }, chatKey) => new Map(orm.all(
|
|
|
25927
26036
|
AND NOT EXISTS (SELECT 1 FROM messages d
|
|
25928
26037
|
WHERE d.id IN (l.message_id, l.parent_id) AND d.deleted_at > l.created_at)`).map(({ id: id2, parent: parent2 }) => [id2, parent2])), "agentAnswers");
|
|
25929
26038
|
|
|
25930
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
26039
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.503.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e5d4ab9592406842b4a214ba16b749bd/node_modules/@wirecat/cli-core/dist/store/conversations.js
|
|
25931
26040
|
var conversationsStoreOver = /* @__PURE__ */ __name((context) => {
|
|
25932
26041
|
const { database } = context;
|
|
25933
26042
|
const { findAccountPk: findAccountPk2, findChatPk: findChatPk2, chatKeyOf } = keysOver(context);
|
|
@@ -26034,7 +26143,7 @@ var conversationsStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
26034
26143
|
};
|
|
26035
26144
|
}, "conversationsStoreOver");
|
|
26036
26145
|
|
|
26037
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
26146
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.503.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e5d4ab9592406842b4a214ba16b749bd/node_modules/@wirecat/cli-core/dist/store/counters.js
|
|
26038
26147
|
var LIVE_MESSAGE = "SELECT m.id AS pk FROM messages m JOIN chats c ON c.id=m.chat_id JOIN accounts ac ON ac.id=m.account_id WHERE ac.provider=? AND ac.external_id=? AND c.external_id=? AND m.external_id=? AND m.deleted_at IS NULL";
|
|
26039
26148
|
var accountCountersOver = /* @__PURE__ */ __name((context) => {
|
|
26040
26149
|
const { database } = context;
|
|
@@ -26059,7 +26168,7 @@ var countersStoreOver = /* @__PURE__ */ __name((context, keyed) => ({
|
|
|
26059
26168
|
counterTargets: /* @__PURE__ */ __name(async (execution, options) => counterTargets(context, execution, options), "counterTargets")
|
|
26060
26169
|
}), "countersStoreOver");
|
|
26061
26170
|
|
|
26062
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
26171
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.503.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e5d4ab9592406842b4a214ba16b749bd/node_modules/@wirecat/cli-core/dist/store/sqlite/mentions.js
|
|
26063
26172
|
var MENTION_STATUSES = ["found", "linked", "dismissed"];
|
|
26064
26173
|
var MENTION_QUERY = defineQuery({
|
|
26065
26174
|
entity: "mention",
|
|
@@ -26275,7 +26384,7 @@ var listPlaces = /* @__PURE__ */ __name((database, { limit, offset }) => {
|
|
|
26275
26384
|
return { items: hasMore ? rows.slice(0, limit) : rows, hasMore };
|
|
26276
26385
|
}, "listPlaces");
|
|
26277
26386
|
|
|
26278
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
26387
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.503.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e5d4ab9592406842b4a214ba16b749bd/node_modules/@wirecat/cli-core/dist/store/mentions.js
|
|
26279
26388
|
var accountMentionsOver = /* @__PURE__ */ __name((context) => {
|
|
26280
26389
|
const { database } = context;
|
|
26281
26390
|
const { findAccountPk: findAccountPk2 } = keysOver(context);
|
|
@@ -26310,7 +26419,7 @@ var mentionsStoreOver = /* @__PURE__ */ __name((context, keyed) => ({
|
|
|
26310
26419
|
places: /* @__PURE__ */ __name(async (window) => listPlaces(context.database, window), "places")
|
|
26311
26420
|
}), "mentionsStoreOver");
|
|
26312
26421
|
|
|
26313
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
26422
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.503.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e5d4ab9592406842b4a214ba16b749bd/node_modules/@wirecat/cli-core/dist/store/sqlite/document-links.js
|
|
26314
26423
|
var documentLinkMessages = /* @__PURE__ */ __name(({ database }, chatKey, messageId) => {
|
|
26315
26424
|
const read2 = database.prepare("SELECT m.id, m.external_id, m.text, m.sent_at, m.sender_name, coalesce(m.sender_chat_external_id, i.external_id) AS sender_id FROM messages m LEFT JOIN identities i ON i.id = m.sender_identity_id WHERE m.chat_id = ? AND m.deleted_at IS NULL AND (m.text LIKE '%google.com%' OR m.text LIKE '%forms.gle%') " + (messageId === void 0 ? "" : "AND m.external_id = ? ") + "ORDER BY m.sent_at DESC, m.id DESC");
|
|
26316
26425
|
const rows = messageId === void 0 ? read2.all(chatKey) : read2.all(chatKey, messageId);
|
|
@@ -26325,7 +26434,52 @@ var documentLinkMessages = /* @__PURE__ */ __name(({ database }, chatKey, messag
|
|
|
26325
26434
|
}));
|
|
26326
26435
|
}, "documentLinkMessages");
|
|
26327
26436
|
|
|
26328
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
26437
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.503.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e5d4ab9592406842b4a214ba16b749bd/node_modules/@wirecat/cli-core/dist/store/sqlite/follow-ups.js
|
|
26438
|
+
var stemmerFor = stemmerCache();
|
|
26439
|
+
var laterSharingRare = /* @__PURE__ */ __name((context, wanted, { rareAt, limit }) => {
|
|
26440
|
+
if (wanted.length > 50 || !Number.isInteger(limit) || limit < 1 || limit > 100)
|
|
26441
|
+
throw new CliError("validation_error", "a follow-up lookup takes at most 50 messages and 1\u2013100 results each");
|
|
26442
|
+
const { database } = context;
|
|
26443
|
+
const stemmers = storeStemmers(database);
|
|
26444
|
+
if (!wanted.length || !stemmers || !stemsState(database)?.ready)
|
|
26445
|
+
return wanted.map(() => []);
|
|
26446
|
+
const stemmer = stemmerFor(stemmers);
|
|
26447
|
+
database.exec("CREATE VIRTUAL TABLE IF NOT EXISTS temp.message_stem_counts USING fts5vocab(main, message_stems, col)");
|
|
26448
|
+
const count = database.prepare("SELECT doc FROM temp.message_stem_counts WHERE term = ? AND col = 'stems'");
|
|
26449
|
+
const counts = /* @__PURE__ */ new Map();
|
|
26450
|
+
const countOf = /* @__PURE__ */ __name((stem) => {
|
|
26451
|
+
let found2 = counts.get(stem);
|
|
26452
|
+
if (found2 === void 0) {
|
|
26453
|
+
found2 = Number(count.get(stem)?.doc ?? 0);
|
|
26454
|
+
counts.set(stem, found2);
|
|
26455
|
+
}
|
|
26456
|
+
return found2;
|
|
26457
|
+
}, "countOf");
|
|
26458
|
+
const message2 = database.prepare(`
|
|
26459
|
+
SELECT m.text, m.sent_at FROM accounts ac
|
|
26460
|
+
JOIN chats c ON c.account_id = ac.id AND c.external_id = ?
|
|
26461
|
+
JOIN messages m ON m.chat_id = c.id AND m.external_id = ?
|
|
26462
|
+
WHERE ac.provider = ? AND ac.external_id = ? AND m.deleted_at IS NULL
|
|
26463
|
+
`);
|
|
26464
|
+
const later = database.prepare(`
|
|
26465
|
+
SELECT m.id FROM message_stems s JOIN messages m ON m.id = s.rowid
|
|
26466
|
+
WHERE message_stems MATCH ? AND m.deleted_at IS NULL AND m.sent_at > ?
|
|
26467
|
+
ORDER BY m.sent_at DESC, m.id DESC LIMIT ?
|
|
26468
|
+
`);
|
|
26469
|
+
return wanted.map(({ account, chatId, id: id2 }) => {
|
|
26470
|
+
const row2 = message2.get(chatId, id2, account.provider, account.account);
|
|
26471
|
+
if (!row2)
|
|
26472
|
+
return [];
|
|
26473
|
+
const stems = new Set(stemmer.explain(String(row2.text)).filter(({ word }) => new RegExp("^\\p{L}{3,}$", "u").test(word)).map(({ word }) => stemmer.stemToken(word)).filter(Boolean));
|
|
26474
|
+
const rare = [...stems].filter((stem) => countOf(stem) <= rareAt);
|
|
26475
|
+
if (!rare.length)
|
|
26476
|
+
return [];
|
|
26477
|
+
const match = `stems : (${rare.map((stem) => `"${stem.replaceAll('"', '""')}"`).join(" OR ")})`;
|
|
26478
|
+
return hitsByPk(context, later.all(match, Number(row2.sent_at), limit).map((one) => Number(one.id)));
|
|
26479
|
+
});
|
|
26480
|
+
}, "laterSharingRare");
|
|
26481
|
+
|
|
26482
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.503.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e5d4ab9592406842b4a214ba16b749bd/node_modules/@wirecat/cli-core/dist/store/messages.js
|
|
26329
26483
|
var accountMessagesOver = /* @__PURE__ */ __name((context) => {
|
|
26330
26484
|
const { database } = context;
|
|
26331
26485
|
const { accountPk: accountPk2, findAccountPk: findAccountPk2, findChatPk: findChatPk2, chatKeyOf, chatPkFor: chatPkFor2, answeredChatPk: answeredChatPk2, upsertMessage: upsertMessage2 } = keysOver(context);
|
|
@@ -26456,12 +26610,13 @@ var messagesStoreOver = /* @__PURE__ */ __name((context, keyed) => ({
|
|
|
26456
26610
|
...keyed,
|
|
26457
26611
|
search: /* @__PURE__ */ __name(async (query, { limit, account }) => find(context, { text: query, limit, ...account ? { account } : {} }), "search"),
|
|
26458
26612
|
find: /* @__PURE__ */ __name(async (filter) => find(context, filter), "find"),
|
|
26459
|
-
directReplies: /* @__PURE__ */ __name(async (parents, limit) => directReplies(context, parents, limit), "directReplies")
|
|
26613
|
+
directReplies: /* @__PURE__ */ __name(async (parents, limit) => directReplies(context, parents, limit), "directReplies"),
|
|
26614
|
+
laterSharingRare: /* @__PURE__ */ __name(async (wanted, options) => laterSharingRare(context, wanted, options), "laterSharingRare")
|
|
26460
26615
|
}), "messagesStoreOver");
|
|
26461
26616
|
|
|
26462
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
26617
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.503.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e5d4ab9592406842b4a214ba16b749bd/node_modules/@wirecat/cli-core/dist/store/sqlite/person-preparation.js
|
|
26463
26618
|
var GLOBAL_PROJECT = "SELECT id FROM main.projects WHERE account_id IS NULL AND deleted_at IS NULL";
|
|
26464
|
-
var
|
|
26619
|
+
var iso5 = /* @__PURE__ */ __name((value) => value == null ? null : new Date(Number(value)).toISOString(), "iso");
|
|
26465
26620
|
var personPreparation = /* @__PURE__ */ __name(({ database }, uid, { accounts: accounts2, limit }) => {
|
|
26466
26621
|
const person2 = Number(uid);
|
|
26467
26622
|
if (!/^[1-9]\d*$/.test(uid) || !Number.isSafeInteger(person2) || !Number.isSafeInteger(limit) || limit < 1)
|
|
@@ -26482,7 +26637,7 @@ var personPreparation = /* @__PURE__ */ __name(({ database }, uid, { accounts: a
|
|
|
26482
26637
|
statement: String(row2.statement),
|
|
26483
26638
|
subject: row2.subject_type == null ? null : `${row2.subject_type}:${row2.subject_id}`,
|
|
26484
26639
|
project: row2.project_id == null ? null : `project:${row2.project_id}`,
|
|
26485
|
-
updatedAt:
|
|
26640
|
+
updatedAt: iso5(row2.updated_at)
|
|
26486
26641
|
}));
|
|
26487
26642
|
const notes2 = database.prepare(`SELECT n.id,n.title,n.body,n.revision,n.updated_at FROM notes n
|
|
26488
26643
|
JOIN persons owner ON n.author_type='person' AND n.author_id=owner.id AND owner.owner=1
|
|
@@ -26495,7 +26650,7 @@ var personPreparation = /* @__PURE__ */ __name(({ database }, uid, { accounts: a
|
|
|
26495
26650
|
title: row2.title == null ? null : String(row2.title),
|
|
26496
26651
|
text: String(row2.body),
|
|
26497
26652
|
revision: Number(row2.revision),
|
|
26498
|
-
updatedAt:
|
|
26653
|
+
updatedAt: iso5(row2.updated_at)
|
|
26499
26654
|
}));
|
|
26500
26655
|
const tasks2 = database.prepare(`SELECT t.id,t.title,t.due_at,t.project_id,t.source_locator,t.created_at,group_concat(DISTINCT ta.role) AS role
|
|
26501
26656
|
FROM task_assignments ta JOIN tasks t ON t.id=ta.task_id JOIN main.projects p ON p.id=t.project_id
|
|
@@ -26507,16 +26662,16 @@ var personPreparation = /* @__PURE__ */ __name(({ database }, uid, { accounts: a
|
|
|
26507
26662
|
ref: `task:${taskIdOf(database, Number(row2.id))}`,
|
|
26508
26663
|
title: String(row2.title),
|
|
26509
26664
|
role: String(row2.role),
|
|
26510
|
-
dueAt:
|
|
26665
|
+
dueAt: iso5(row2.due_at),
|
|
26511
26666
|
project: `project:${row2.project_id}`,
|
|
26512
26667
|
source: row2.source_locator == null ? null : String(row2.source_locator),
|
|
26513
|
-
createdAt:
|
|
26668
|
+
createdAt: iso5(row2.created_at)
|
|
26514
26669
|
}));
|
|
26515
26670
|
return { facts: page3(facts2), notes: page3(notes2), tasks: page3(tasks2) };
|
|
26516
26671
|
});
|
|
26517
26672
|
}, "personPreparation");
|
|
26518
26673
|
|
|
26519
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
26674
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.503.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e5d4ab9592406842b4a214ba16b749bd/node_modules/@wirecat/cli-core/dist/store/sqlite/person-scope.js
|
|
26520
26675
|
var personSeenInAccounts = /* @__PURE__ */ __name(({ database }, uid, accountIds) => {
|
|
26521
26676
|
const id2 = Number(uid);
|
|
26522
26677
|
if (!/^[1-9]\d*$/.test(uid) || !Number.isSafeInteger(id2) || !accountIds.length || accountIds.length > 1e3 || accountIds.some((account) => !Number.isSafeInteger(account) || account <= 0))
|
|
@@ -26524,7 +26679,7 @@ var personSeenInAccounts = /* @__PURE__ */ __name(({ database }, uid, accountIds
|
|
|
26524
26679
|
return Boolean(database.prepare("SELECT 1 FROM persons p JOIN identity_links l ON l.person_id=p.id JOIN account_identities a ON a.identity_id=l.identity_id WHERE p.id=? AND a.account_id IN (SELECT value FROM json_each(?)) LIMIT 1").get(id2, JSON.stringify(accountIds)));
|
|
26525
26680
|
}, "personSeenInAccounts");
|
|
26526
26681
|
|
|
26527
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
26682
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.503.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e5d4ab9592406842b4a214ba16b749bd/node_modules/@wirecat/cli-core/dist/store/sqlite/private-people.js
|
|
26528
26683
|
var required2 = /* @__PURE__ */ __name(({ database }, key2, personId) => {
|
|
26529
26684
|
const row2 = database.prepare("SELECT a.id AS account_id, i.id AS identity_id FROM accounts a JOIN account_identities ai ON ai.account_id=a.id JOIN identities i ON i.id=ai.identity_id WHERE a.provider=? AND a.external_id=? AND i.provider=? AND i.external_id=?").get(key2.provider, key2.account, key2.provider, personId);
|
|
26530
26685
|
if (!row2)
|
|
@@ -26590,7 +26745,7 @@ var removeNote = /* @__PURE__ */ __name((context, key2, personId, id2) => {
|
|
|
26590
26745
|
return { id: id2, personId, removed: true };
|
|
26591
26746
|
}, "removeNote");
|
|
26592
26747
|
|
|
26593
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
26748
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.503.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e5d4ab9592406842b4a214ba16b749bd/node_modules/@wirecat/cli-core/dist/store/people.js
|
|
26594
26749
|
var accountPeopleOver = /* @__PURE__ */ __name((context) => {
|
|
26595
26750
|
const { database } = context;
|
|
26596
26751
|
const { accountPk: accountPk2, findAccountPk: findAccountPk2, identityPk: identityPk2 } = keysOver(context);
|
|
@@ -26665,13 +26820,13 @@ var peopleStoreOver = /* @__PURE__ */ __name((context, keyed) => {
|
|
|
26665
26820
|
};
|
|
26666
26821
|
}, "peopleStoreOver");
|
|
26667
26822
|
|
|
26668
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
26823
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.503.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e5d4ab9592406842b4a214ba16b749bd/node_modules/@wirecat/cli-core/dist/store/sqlite/admin-statistics.js
|
|
26669
26824
|
import { createHash as createHash8 } from "node:crypto";
|
|
26670
26825
|
|
|
26671
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
26826
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.503.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e5d4ab9592406842b4a214ba16b749bd/node_modules/@wirecat/cli-core/dist/domain/admin-statistics.js
|
|
26672
26827
|
import { createHash as createHash7 } from "node:crypto";
|
|
26673
26828
|
|
|
26674
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
26829
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.503.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e5d4ab9592406842b4a214ba16b749bd/node_modules/@wirecat/cli-core/dist/domain/rankings-graph.js
|
|
26675
26830
|
var RANKING_GRAPH_LIMITS = { nodes: 5e4, depth: 256, work: 1e7, bytes: 8388608 };
|
|
26676
26831
|
var exhausted2 = /* @__PURE__ */ __name((budget) => {
|
|
26677
26832
|
throw new CliError("validation_error", `ranking exceeded ${budget} \u2014 narrow its chat or date scope`, {
|
|
@@ -26893,7 +27048,7 @@ var rankReplyGraph = /* @__PURE__ */ __name((nodes, check3 = () => {
|
|
|
26893
27048
|
};
|
|
26894
27049
|
}, "rankReplyGraph");
|
|
26895
27050
|
|
|
26896
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
27051
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.503.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e5d4ab9592406842b4a214ba16b749bd/node_modules/@wirecat/cli-core/dist/domain/admin-statistics.js
|
|
26897
27052
|
var adminEntityKey = /* @__PURE__ */ __name((row2) => JSON.stringify([row2.account.provider, row2.account.account, row2.id]), "adminEntityKey");
|
|
26898
27053
|
var personKey = /* @__PURE__ */ __name((node) => JSON.stringify([node.account.provider, node.account.account, node.sender]), "personKey");
|
|
26899
27054
|
var locator = /* @__PURE__ */ __name((node) => formatLocator({ ...node.account, chat: node.chatId, message: node.id }), "locator");
|
|
@@ -27067,7 +27222,7 @@ var calculateAdminStatistics = /* @__PURE__ */ __name((nodes, stays, options, in
|
|
|
27067
27222
|
return { items, evidence, summary, graph: graph.quality };
|
|
27068
27223
|
}, "calculateAdminStatistics");
|
|
27069
27224
|
|
|
27070
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
27225
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.503.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e5d4ab9592406842b4a214ba16b749bd/node_modules/@wirecat/cli-core/dist/domain/rankings-range.js
|
|
27071
27226
|
var rankingContextRange = /* @__PURE__ */ __name((root) => {
|
|
27072
27227
|
const dates = [];
|
|
27073
27228
|
const visit = /* @__PURE__ */ __name((node, required3) => {
|
|
@@ -27089,7 +27244,7 @@ var rankingContextRange = /* @__PURE__ */ __name((root) => {
|
|
|
27089
27244
|
return dates[0].node.resolution.date;
|
|
27090
27245
|
}, "rankingContextRange");
|
|
27091
27246
|
|
|
27092
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
27247
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.503.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e5d4ab9592406842b4a214ba16b749bd/node_modules/@wirecat/cli-core/dist/store/sqlite/rankings.js
|
|
27093
27248
|
var reactionCounts = /* @__PURE__ */ __name((stored3) => {
|
|
27094
27249
|
let counts;
|
|
27095
27250
|
try {
|
|
@@ -27384,7 +27539,7 @@ var rankQuery = /* @__PURE__ */ __name((context, execution, request, inspect) =>
|
|
|
27384
27539
|
});
|
|
27385
27540
|
}, "rankQuery");
|
|
27386
27541
|
|
|
27387
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
27542
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.503.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e5d4ab9592406842b4a214ba16b749bd/node_modules/@wirecat/cli-core/dist/store/sqlite/admin-statistics.js
|
|
27388
27543
|
function fail4(message2, reason = "query.too-large") {
|
|
27389
27544
|
throw new CliError("validation_error", message2, { reason, complete: false });
|
|
27390
27545
|
}
|
|
@@ -27561,7 +27716,7 @@ var adminStatisticsQuery = /* @__PURE__ */ __name((context, execution, request)
|
|
|
27561
27716
|
return result;
|
|
27562
27717
|
}), "adminStatisticsQuery");
|
|
27563
27718
|
|
|
27564
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
27719
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.503.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e5d4ab9592406842b4a214ba16b749bd/node_modules/@wirecat/cli-core/dist/store/sqlite/conversation-eligibility.js
|
|
27565
27720
|
var conversationEligibility = /* @__PURE__ */ __name(async (context, execution) => {
|
|
27566
27721
|
if (!execution.accounts.length)
|
|
27567
27722
|
return { conversations: [], chats: [] };
|
|
@@ -27579,7 +27734,7 @@ var conversationEligibility = /* @__PURE__ */ __name(async (context, execution)
|
|
|
27579
27734
|
return { conversations: conversations2, chats: chats2 };
|
|
27580
27735
|
}, "conversationEligibility");
|
|
27581
27736
|
|
|
27582
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
27737
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.503.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e5d4ab9592406842b4a214ba16b749bd/node_modules/@wirecat/cli-core/dist/store/sqlite/ranking-evidence.js
|
|
27583
27738
|
import { createHash as createHash9 } from "node:crypto";
|
|
27584
27739
|
var EVIDENCE_BYTES = 64 * 1024;
|
|
27585
27740
|
var FINGERPRINT_BYTES = 8 * 1024 * 1024;
|
|
@@ -27729,16 +27884,17 @@ var rankingEvidence = /* @__PURE__ */ __name((context, execution, request) => {
|
|
|
27729
27884
|
return result;
|
|
27730
27885
|
}, "rankingEvidence");
|
|
27731
27886
|
|
|
27732
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
27733
|
-
var queriesStoreOver = /* @__PURE__ */ __name((context,
|
|
27887
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.503.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e5d4ab9592406842b4a214ba16b749bd/node_modules/@wirecat/cli-core/dist/store/queries.js
|
|
27888
|
+
var queriesStoreOver = /* @__PURE__ */ __name((context, stemmerFor2) => {
|
|
27734
27889
|
const mailIndexed = /* @__PURE__ */ __name((execution) => {
|
|
27735
27890
|
if (execution.corpus === "mail")
|
|
27736
|
-
drainEmailIndex(context.database,
|
|
27891
|
+
drainEmailIndex(context.database, stemmerFor2);
|
|
27737
27892
|
return execution;
|
|
27738
27893
|
}, "mailIndexed");
|
|
27739
27894
|
return {
|
|
27740
27895
|
matchQuery: /* @__PURE__ */ __name(async (execution) => matchQuery(context, mailIndexed(execution)), "matchQuery"),
|
|
27741
27896
|
countQuery: /* @__PURE__ */ __name(async (execution, by) => countQuery(context, mailIndexed(execution), by), "countQuery"),
|
|
27897
|
+
countMatches: /* @__PURE__ */ __name(async (execution, cap) => countMatches(context, mailIndexed(execution), cap), "countMatches"),
|
|
27742
27898
|
conversationEligibility: /* @__PURE__ */ __name(async (execution) => conversationEligibility(context, execution), "conversationEligibility"),
|
|
27743
27899
|
rankQuery: /* @__PURE__ */ __name(async (execution, request) => rankQuery(context, execution, request), "rankQuery"),
|
|
27744
27900
|
rankingEvidence: /* @__PURE__ */ __name(async (execution, request) => rankingEvidence(context, execution, request), "rankingEvidence"),
|
|
@@ -27746,7 +27902,7 @@ var queriesStoreOver = /* @__PURE__ */ __name((context, stemmerFor) => {
|
|
|
27746
27902
|
};
|
|
27747
27903
|
}, "queriesStoreOver");
|
|
27748
27904
|
|
|
27749
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
27905
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.503.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e5d4ab9592406842b4a214ba16b749bd/node_modules/@wirecat/cli-core/dist/store/sqlite/chat-events.js
|
|
27750
27906
|
var saveChatEvents = /* @__PURE__ */ __name((context, accountKey, provider, chatKey, events3) => {
|
|
27751
27907
|
const { database, now: now2 } = context;
|
|
27752
27908
|
const insert = database.prepare(`INSERT INTO chat_events (chat_id, source_id, action, actor_identity_id, title, happened_at, created_at, updated_at)
|
|
@@ -27785,10 +27941,10 @@ var chatEventsOf = /* @__PURE__ */ __name(({ database }, chatKey, { since = 0, l
|
|
|
27785
27941
|
}));
|
|
27786
27942
|
}, "chatEventsOf");
|
|
27787
27943
|
|
|
27788
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
27944
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.503.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e5d4ab9592406842b4a214ba16b749bd/node_modules/@wirecat/cli-core/dist/store/sqlite/retention.js
|
|
27789
27945
|
import { createHash as createHash10 } from "node:crypto";
|
|
27790
27946
|
|
|
27791
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
27947
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.503.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e5d4ab9592406842b4a214ba16b749bd/node_modules/@wirecat/cli-core/dist/domain/calendar.js
|
|
27792
27948
|
var calendarKey = /* @__PURE__ */ __name((zone, by) => {
|
|
27793
27949
|
const format = new Intl.DateTimeFormat("en-CA", {
|
|
27794
27950
|
timeZone: zone,
|
|
@@ -27803,7 +27959,7 @@ var calendarKey = /* @__PURE__ */ __name((zone, by) => {
|
|
|
27803
27959
|
};
|
|
27804
27960
|
}, "calendarKey");
|
|
27805
27961
|
|
|
27806
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
27962
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.503.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e5d4ab9592406842b4a214ba16b749bd/node_modules/@wirecat/cli-core/dist/domain/retention.js
|
|
27807
27963
|
var RETENTION_TOLERANCE = 864e5;
|
|
27808
27964
|
var validateRetentionOptions = /* @__PURE__ */ __name((options) => {
|
|
27809
27965
|
const { since, until, cutoff, checkpoints, within, limit, by } = options;
|
|
@@ -27857,8 +28013,8 @@ var retentionCohorts = /* @__PURE__ */ __name((stays, options) => {
|
|
|
27857
28013
|
return [...groups.values()].sort((a, b) => a.cohort.localeCompare(b.cohort));
|
|
27858
28014
|
}, "retentionCohorts");
|
|
27859
28015
|
|
|
27860
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
27861
|
-
var
|
|
28016
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.503.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e5d4ab9592406842b4a214ba16b749bd/node_modules/@wirecat/cli-core/dist/store/sqlite/retention.js
|
|
28017
|
+
var iso6 = /* @__PURE__ */ __name((at) => new Date(at).toISOString(), "iso");
|
|
27862
28018
|
var week = /* @__PURE__ */ __name((day) => {
|
|
27863
28019
|
const date3 = /* @__PURE__ */ new Date(`${day}T00:00:00Z`);
|
|
27864
28020
|
date3.setUTCDate(date3.getUTCDate() - (date3.getUTCDay() + 6) % 7);
|
|
@@ -27895,14 +28051,14 @@ var retentionQuery = /* @__PURE__ */ __name((context, accountPk2, chatPk, chatId
|
|
|
27895
28051
|
return {
|
|
27896
28052
|
stay: pk,
|
|
27897
28053
|
person: String(row2.person),
|
|
27898
|
-
joinedAt:
|
|
28054
|
+
joinedAt: iso6(joinedAt),
|
|
27899
28055
|
cohort,
|
|
27900
28056
|
checkpoints: options.checkpoints.map((checkpoint) => {
|
|
27901
28057
|
const target = joinedAt + checkpoint;
|
|
27902
28058
|
if (target > options.cutoff)
|
|
27903
28059
|
return {
|
|
27904
28060
|
checkpoint,
|
|
27905
|
-
targetAt:
|
|
28061
|
+
targetAt: iso6(target),
|
|
27906
28062
|
state: "pending",
|
|
27907
28063
|
observedAt: null,
|
|
27908
28064
|
lagMilliseconds: null,
|
|
@@ -27911,22 +28067,22 @@ var retentionQuery = /* @__PURE__ */ __name((context, accountPk2, chatPk, chatId
|
|
|
27911
28067
|
const read2 = observationStatement.get(pk, chatPk, target, Math.min(target + RETENTION_TOLERANCE, options.cutoff));
|
|
27912
28068
|
return {
|
|
27913
28069
|
checkpoint,
|
|
27914
|
-
targetAt:
|
|
28070
|
+
targetAt: iso6(target),
|
|
27915
28071
|
state: !read2 ? "unknown" : Number(read2.present) === 1 ? "present" : Number(read2.complete) === 1 ? "absent" : "unknown",
|
|
27916
|
-
observedAt: read2 ?
|
|
28072
|
+
observedAt: read2 ? iso6(Number(read2.observed_at)) : null,
|
|
27917
28073
|
lagMilliseconds: read2 ? Number(read2.observed_at) - target : null,
|
|
27918
28074
|
complete: read2 ? Number(read2.complete) === 1 : null
|
|
27919
28075
|
};
|
|
27920
28076
|
}),
|
|
27921
28077
|
activity: {
|
|
27922
28078
|
state: first !== null && first !== void 0 ? "observed-message" : end > options.cutoff ? "pending" : "no-observed-message",
|
|
27923
|
-
firstMessageAt: first === null || first === void 0 ? null :
|
|
27924
|
-
windowEnd:
|
|
28079
|
+
firstMessageAt: first === null || first === void 0 ? null : iso6(Number(first)),
|
|
28080
|
+
windowEnd: iso6(end),
|
|
27925
28081
|
archiveCovered: covered === true
|
|
27926
28082
|
},
|
|
27927
28083
|
departure: {
|
|
27928
|
-
after: lower === null ? null :
|
|
27929
|
-
atOrBefore: upper === null ? null :
|
|
28084
|
+
after: lower === null ? null : iso6(lower),
|
|
28085
|
+
atOrBefore: upper === null ? null : iso6(upper),
|
|
27930
28086
|
early: upper !== null && upper <= end ? "observed" : lower !== null && lower >= end ? "not-observed" : end > options.cutoff ? "pending" : "unknown"
|
|
27931
28087
|
}
|
|
27932
28088
|
};
|
|
@@ -27970,7 +28126,7 @@ var retentionQuery = /* @__PURE__ */ __name((context, accountPk2, chatPk, chatId
|
|
|
27970
28126
|
const nextCursor = next < selected.length ? Buffer.from(JSON.stringify({ offset: next, fingerprint: fingerprint2, cohort: evidence?.cohort ?? null })).toString("base64url") : null;
|
|
27971
28127
|
return {
|
|
27972
28128
|
chatId,
|
|
27973
|
-
cutoff:
|
|
28129
|
+
cutoff: iso6(options.cutoff),
|
|
27974
28130
|
options,
|
|
27975
28131
|
items: cohorts.slice(0, options.limit),
|
|
27976
28132
|
total: cohorts.length,
|
|
@@ -27993,8 +28149,8 @@ var retentionQuery = /* @__PURE__ */ __name((context, accountPk2, chatPk, chatId
|
|
|
27993
28149
|
};
|
|
27994
28150
|
}, "retentionQuery");
|
|
27995
28151
|
|
|
27996
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
27997
|
-
var
|
|
28152
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.503.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e5d4ab9592406842b4a214ba16b749bd/node_modules/@wirecat/cli-core/dist/store/sqlite/roster.js
|
|
28153
|
+
var iso7 = /* @__PURE__ */ __name((ms) => ms === null ? null : new Date(ms).toISOString(), "iso");
|
|
27998
28154
|
var marksOf = /* @__PURE__ */ __name(({ isBot, flagged, deleted, hasPhoto }) => ({
|
|
27999
28155
|
...isBot === void 0 ? {} : { bot: isBot },
|
|
28000
28156
|
...flagged === void 0 ? {} : { [flagged]: true },
|
|
@@ -28088,10 +28244,10 @@ var memberStaysOf = /* @__PURE__ */ __name(({ orm }, chatKey, since) => orm.sele
|
|
|
28088
28244
|
goneAt: memberStays.leftAt
|
|
28089
28245
|
}).from(memberStays).innerJoin(identities, eq(identities.id, memberStays.identityId)).where(and(eq(memberStays.chatId, chatKey), since === void 0 ? void 0 : or(isNull(memberStays.leftAt), gte(memberStays.leftAt, since)))).orderBy(asc(memberStays.firstSeenAt), asc(memberStays.id)).all().map((row2) => ({
|
|
28090
28246
|
...row2,
|
|
28091
|
-
firstSeenAt:
|
|
28092
|
-
lastSeenAt:
|
|
28093
|
-
joinedAt:
|
|
28094
|
-
goneAt:
|
|
28247
|
+
firstSeenAt: iso7(row2.firstSeenAt),
|
|
28248
|
+
lastSeenAt: iso7(row2.lastSeenAt),
|
|
28249
|
+
joinedAt: iso7(row2.joinedAt),
|
|
28250
|
+
goneAt: iso7(row2.goneAt)
|
|
28095
28251
|
})), "memberStaysOf");
|
|
28096
28252
|
var memberCountsOf = /* @__PURE__ */ __name(({ orm }, chatKey, since) => orm.select({
|
|
28097
28253
|
day: memberCounts.date,
|
|
@@ -28111,7 +28267,7 @@ var profileRevisionsOf = /* @__PURE__ */ __name(({ orm }, chatKey, since) => {
|
|
|
28111
28267
|
}).from(identityRevisions).innerJoin(identities, eq(identities.id, identityRevisions.identityId)).where(and(inArray(identityRevisions.identityId, people2), since === void 0 ? void 0 : gte(identityRevisions.createdAt, since))).orderBy(asc(identityRevisions.createdAt), asc(identityRevisions.id)).all().map((row2) => ({
|
|
28112
28268
|
...row2,
|
|
28113
28269
|
marks: row2.marks ? JSON.parse(row2.marks) : {},
|
|
28114
|
-
capturedAt:
|
|
28270
|
+
capturedAt: iso7(row2.capturedAt)
|
|
28115
28271
|
}));
|
|
28116
28272
|
}, "profileRevisionsOf");
|
|
28117
28273
|
var setTracked = /* @__PURE__ */ __name(({ orm, now: now2 }, chatKey, tracked) => {
|
|
@@ -28120,11 +28276,11 @@ var setTracked = /* @__PURE__ */ __name(({ orm, now: now2 }, chatKey, tracked) =
|
|
|
28120
28276
|
var trackedChats = /* @__PURE__ */ __name((context, accountKey, where) => context.orm.select({ pk: chats.id, chatId: chats.externalId, title: chats.title, trackedAt: chats.membersTrackedAt }).from(chats).where(and(eq(chats.accountId, accountKey), isNotNull(chats.membersTrackedAt), where ? bound2(where) : void 0)).orderBy(asc(chats.membersTrackedAt)).all().map(({ pk, chatId, title, trackedAt }) => ({
|
|
28121
28277
|
chatId,
|
|
28122
28278
|
title,
|
|
28123
|
-
trackedAt:
|
|
28279
|
+
trackedAt: iso7(trackedAt),
|
|
28124
28280
|
lastCount: memberCountsOf(context, pk).at(-1) ?? null
|
|
28125
28281
|
})), "trackedChats");
|
|
28126
28282
|
|
|
28127
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
28283
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.503.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e5d4ab9592406842b4a214ba16b749bd/node_modules/@wirecat/cli-core/dist/store/roster.js
|
|
28128
28284
|
var rosterStoreOver = /* @__PURE__ */ __name((context) => {
|
|
28129
28285
|
const { database } = context;
|
|
28130
28286
|
const { accountPk: accountPk2, findAccountPk: findAccountPk2, chatKeyOf, chatPkFor: chatPkFor2, writeMembers: writeMembers2 } = keysOver(context);
|
|
@@ -28180,7 +28336,7 @@ var rosterStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
28180
28336
|
};
|
|
28181
28337
|
}, "rosterStoreOver");
|
|
28182
28338
|
|
|
28183
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
28339
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.503.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e5d4ab9592406842b4a214ba16b749bd/node_modules/@wirecat/cli-core/dist/store/sqlite/backfill.js
|
|
28184
28340
|
var pendingNormalization = /* @__PURE__ */ __name((database) => Number(database.prepare("SELECT count(*) AS n FROM messages WHERE normalized_text IS NULL AND deleted_at IS NULL").get()?.n), "pendingNormalization");
|
|
28185
28341
|
var backfillNormalized = /* @__PURE__ */ __name((database, { batch = 5e3, onBatch, until = /* @__PURE__ */ __name(() => false, "until") } = {}) => {
|
|
28186
28342
|
const next = database.prepare(`SELECT id AS pk, text FROM messages WHERE normalized_text IS NULL AND deleted_at IS NULL AND id > ? ORDER BY id LIMIT ?`);
|
|
@@ -28204,7 +28360,7 @@ var backfillNormalized = /* @__PURE__ */ __name((database, { batch = 5e3, onBatc
|
|
|
28204
28360
|
}
|
|
28205
28361
|
}, "backfillNormalized");
|
|
28206
28362
|
|
|
28207
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
28363
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.503.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e5d4ab9592406842b4a214ba16b749bd/node_modules/@wirecat/cli-core/dist/store/sqlite/search-index.js
|
|
28208
28364
|
var INDEX2 = "message_words";
|
|
28209
28365
|
var searchIndexState2 = /* @__PURE__ */ __name((database) => {
|
|
28210
28366
|
const row2 = indexRow(database, INDEX2);
|
|
@@ -28331,7 +28487,7 @@ var resetSearchIndex = /* @__PURE__ */ __name((database) => {
|
|
|
28331
28487
|
});
|
|
28332
28488
|
}, "resetSearchIndex");
|
|
28333
28489
|
|
|
28334
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
28490
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.503.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e5d4ab9592406842b4a214ba16b749bd/node_modules/@wirecat/cli-core/dist/store/sqlite/stems-fill.js
|
|
28335
28491
|
var fillStems = /* @__PURE__ */ __name((database, { batch = 5e3, until = /* @__PURE__ */ __name(() => false, "until"), onBatch, now: now2 = Date.now } = {}) => {
|
|
28336
28492
|
const filled2 = { stemmed: 0, drained: 0 };
|
|
28337
28493
|
const before2 = stemsState(database);
|
|
@@ -28426,7 +28582,7 @@ var followDefaultStemmers = /* @__PURE__ */ __name((database, now2 = Date.now) =
|
|
|
28426
28582
|
return resetStems(database, { now: now2 });
|
|
28427
28583
|
}, "followDefaultStemmers");
|
|
28428
28584
|
|
|
28429
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
28585
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.503.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e5d4ab9592406842b4a214ba16b749bd/node_modules/@wirecat/cli-core/dist/store/sqlite/words.js
|
|
28430
28586
|
var VOCABULARY = "SELECT term, doc FROM message_words_vocab WHERE col = 'normalized_text'";
|
|
28431
28587
|
var knownTerms = /* @__PURE__ */ __name(({ database }, terms2) => {
|
|
28432
28588
|
const lookup = database.prepare(`${VOCABULARY} AND term >= ? AND term <= ? LIMIT 1`);
|
|
@@ -28448,10 +28604,10 @@ var termCandidates = /* @__PURE__ */ __name(({ database }, pieces, { shortest, l
|
|
|
28448
28604
|
});
|
|
28449
28605
|
}, "termCandidates");
|
|
28450
28606
|
|
|
28451
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
28607
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.503.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e5d4ab9592406842b4a214ba16b749bd/node_modules/@wirecat/cli-core/dist/store/search-index.js
|
|
28452
28608
|
var searchIndexStoreOver = /* @__PURE__ */ __name((context) => {
|
|
28453
28609
|
const { database } = context;
|
|
28454
|
-
const
|
|
28610
|
+
const stemmerFor2 = stemmerCache();
|
|
28455
28611
|
return {
|
|
28456
28612
|
knownTerms: /* @__PURE__ */ __name(async (terms2) => knownTerms(context, terms2), "knownTerms"),
|
|
28457
28613
|
termCandidates: /* @__PURE__ */ __name(async (trigrams2, lengths) => termCandidates(context, trigrams2, lengths), "termCandidates"),
|
|
@@ -28462,7 +28618,7 @@ var searchIndexStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
28462
28618
|
const filled2 = fillStems(database, { now: context.now, ...until ? { until } : {} });
|
|
28463
28619
|
const transcripts = corpusIndexState(database, CORPORA.transcript);
|
|
28464
28620
|
if (transcripts.wanted !== null && (transcripts.pending > 0 || transcripts.built !== transcripts.wanted))
|
|
28465
|
-
drainCorpus(database, CORPORA.transcript,
|
|
28621
|
+
drainCorpus(database, CORPORA.transcript, stemmerFor2, until ? { until } : {});
|
|
28466
28622
|
return filled2;
|
|
28467
28623
|
}, "fillStems"),
|
|
28468
28624
|
stemmers: /* @__PURE__ */ __name(async () => savedStemmers(database), "stemmers"),
|
|
@@ -28470,7 +28626,7 @@ var searchIndexStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
28470
28626
|
};
|
|
28471
28627
|
}, "searchIndexStoreOver");
|
|
28472
28628
|
|
|
28473
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
28629
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.503.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e5d4ab9592406842b4a214ba16b749bd/node_modules/@wirecat/cli-core/dist/store/sqlite/searches.js
|
|
28474
28630
|
var HISTORY_KEPT = 1e3;
|
|
28475
28631
|
var commandFilter = /* @__PURE__ */ __name((commands) => commands ? { sql: ` AND command IN (${commands.map(() => "?").join(", ")})`, values: [...commands] } : { sql: "", values: [] }, "commandFilter");
|
|
28476
28632
|
var COLUMNS5 = "id, name, command, params, language, version, fields_version, created_at, updated_at, last_run_at, runs";
|
|
@@ -28539,7 +28695,7 @@ var clearHistory = /* @__PURE__ */ __name(({ database }, commands) => {
|
|
|
28539
28695
|
return database.prepare(`DELETE FROM searches WHERE name IS NULL${only.sql}`).run(...only.values).changes;
|
|
28540
28696
|
}, "clearHistory");
|
|
28541
28697
|
|
|
28542
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
28698
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.503.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e5d4ab9592406842b4a214ba16b749bd/node_modules/@wirecat/cli-core/dist/store/searches.js
|
|
28543
28699
|
var searchesStoreOver = /* @__PURE__ */ __name((context) => {
|
|
28544
28700
|
const { database } = context;
|
|
28545
28701
|
return {
|
|
@@ -28563,7 +28719,7 @@ var searchesStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
28563
28719
|
};
|
|
28564
28720
|
}, "searchesStoreOver");
|
|
28565
28721
|
|
|
28566
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
28722
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.503.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e5d4ab9592406842b4a214ba16b749bd/node_modules/@wirecat/cli-core/dist/store/sqlite/agent-actions.js
|
|
28567
28723
|
var ACTION_TIERS = ["read", "draft", "write-private", "write-public", "destructive", "admin"];
|
|
28568
28724
|
var ACTION_OUTCOMES = ["ok", "refused", "failed"];
|
|
28569
28725
|
var CODE = /^[a-z][a-z0-9_]{0,63}$/;
|
|
@@ -28606,7 +28762,7 @@ var agentActionsStoreOver = /* @__PURE__ */ __name((context, afterRecord = () =>
|
|
|
28606
28762
|
};
|
|
28607
28763
|
}, "agentActionsStoreOver");
|
|
28608
28764
|
|
|
28609
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
28765
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.503.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e5d4ab9592406842b4a214ba16b749bd/node_modules/@wirecat/cli-core/dist/store/sqlite/bot-updates.js
|
|
28610
28766
|
var botUpdateStoreOver = /* @__PURE__ */ __name((context, afterSave = () => {
|
|
28611
28767
|
}) => {
|
|
28612
28768
|
const { database, now: now2 } = context;
|
|
@@ -28665,7 +28821,7 @@ var botUpdateStoreOver = /* @__PURE__ */ __name((context, afterSave = () => {
|
|
|
28665
28821
|
};
|
|
28666
28822
|
}, "botUpdateStoreOver");
|
|
28667
28823
|
|
|
28668
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
28824
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.503.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e5d4ab9592406842b4a214ba16b749bd/node_modules/@wirecat/cli-core/dist/store/sqlite/calendar-events.js
|
|
28669
28825
|
var DAY4 = 864e5;
|
|
28670
28826
|
var listEvents = /* @__PURE__ */ __name((database, filter) => {
|
|
28671
28827
|
const clauses = ["e.deleted_at IS NULL"];
|
|
@@ -28684,6 +28840,7 @@ var listEvents = /* @__PURE__ */ __name((database, filter) => {
|
|
|
28684
28840
|
}, "dated");
|
|
28685
28841
|
dated("end_date > ?", filter.fromDate, "coalesce(e.ends_at, e.starts_at + 1) > ?", filter.from);
|
|
28686
28842
|
dated("start_date < ?", filter.toDate, "e.starts_at < ?", filter.to);
|
|
28843
|
+
dated("start_date >= ?", filter.startsFromDate, "e.starts_at >= ?", filter.startsFrom);
|
|
28687
28844
|
const longest = /* @__PURE__ */ __name(() => Number(database.prepare("SELECT coalesce(max(ends_at - starts_at), 0) AS ms FROM events WHERE deleted_at IS NULL").get()?.ms ?? 0), "longest");
|
|
28688
28845
|
if (filter.from !== void 0) {
|
|
28689
28846
|
clauses.push("e.starts_at >= ?");
|
|
@@ -28693,6 +28850,10 @@ var listEvents = /* @__PURE__ */ __name((database, filter) => {
|
|
|
28693
28850
|
clauses.push("e.starts_at < ?");
|
|
28694
28851
|
params.push(filter.to + DAY4);
|
|
28695
28852
|
}
|
|
28853
|
+
if (filter.startsFrom !== void 0 && filter.startsFromDate !== void 0) {
|
|
28854
|
+
clauses.push("e.starts_at >= ?");
|
|
28855
|
+
params.push(filter.startsFrom - DAY4);
|
|
28856
|
+
}
|
|
28696
28857
|
if (filter.calendarId !== void 0) {
|
|
28697
28858
|
clauses.push(entries("ce.calendar_id = ?"));
|
|
28698
28859
|
params.push(filter.calendarId);
|
|
@@ -28745,7 +28906,7 @@ var listEvents = /* @__PURE__ */ __name((database, filter) => {
|
|
|
28745
28906
|
return database.prepare(`SELECT e.* FROM events e WHERE ${clauses.join(" AND ")} ORDER BY ${filter.newest ? "e.starts_at DESC, e.id DESC" : "e.starts_at, e.id"} LIMIT ? OFFSET ?`).all(...params, limit, offset).map(eventOf);
|
|
28746
28907
|
}, "listEvents");
|
|
28747
28908
|
|
|
28748
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
28909
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.503.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e5d4ab9592406842b4a214ba16b749bd/node_modules/@wirecat/cli-core/dist/store/sqlite/calendar.js
|
|
28749
28910
|
var calendarOf = /* @__PURE__ */ __name((row2) => ({
|
|
28750
28911
|
id: Number(row2.id),
|
|
28751
28912
|
accountId: Number(row2.account_id),
|
|
@@ -29325,7 +29486,7 @@ var eventStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
29325
29486
|
};
|
|
29326
29487
|
}, "eventStoreOver");
|
|
29327
29488
|
|
|
29328
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
29489
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.503.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e5d4ab9592406842b4a214ba16b749bd/node_modules/@wirecat/cli-core/dist/store/sqlite/catalog.js
|
|
29329
29490
|
var CATALOG_QUERY = defineQuery({
|
|
29330
29491
|
entity: "document",
|
|
29331
29492
|
backend: "sql",
|
|
@@ -29567,7 +29728,7 @@ var catalogStoreOver = /* @__PURE__ */ __name(({ database, now: now2 }) => {
|
|
|
29567
29728
|
};
|
|
29568
29729
|
}, "catalogStoreOver");
|
|
29569
29730
|
|
|
29570
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
29731
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.503.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e5d4ab9592406842b4a214ba16b749bd/node_modules/@wirecat/cli-core/dist/context/evidence.js
|
|
29571
29732
|
import { createHash as createHash11 } from "node:crypto";
|
|
29572
29733
|
var CONTEXT_MAX_READ_BYTES = 262144;
|
|
29573
29734
|
var CONTEXT_SOURCE_KINDS = ["message", "mail", "document", "meeting"];
|
|
@@ -29665,7 +29826,7 @@ var contextEvidenceRequest = /* @__PURE__ */ __name((input) => {
|
|
|
29665
29826
|
return { source: source2, query, chat: chat2, senders, words: words3, after: after2, before: before2, limit, maxReadBytes, cursor, signal: input.signal };
|
|
29666
29827
|
}, "contextEvidenceRequest");
|
|
29667
29828
|
|
|
29668
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
29829
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.503.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e5d4ab9592406842b4a214ba16b749bd/node_modules/@wirecat/cli-core/dist/store/sqlite/context-document-source.js
|
|
29669
29830
|
var drive = "CASE WHEN json_valid(n.front_matter) THEN json_extract(n.front_matter,'$.source')='google-drive' ELSE 0 END";
|
|
29670
29831
|
var field2 = /* @__PURE__ */ __name((name) => `CASE WHEN (${drive}) THEN
|
|
29671
29832
|
CASE WHEN json_type(n.front_matter,'$.${name}')='text' THEN json_extract(n.front_matter,'$.${name}') END END`, "field");
|
|
@@ -29678,7 +29839,7 @@ var contextDocumentTimeKind = `CASE WHEN (${remoteTime}) IS NOT NULL
|
|
|
29678
29839
|
THEN 'source-modified' ELSE 'stored-update' END`;
|
|
29679
29840
|
var contextDocumentUrl = `coalesce(${preferred("url")},n.url,${field2("sourceUrl")})`;
|
|
29680
29841
|
|
|
29681
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
29842
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.503.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e5d4ab9592406842b4a214ba16b749bd/node_modules/@wirecat/cli-core/dist/store/sqlite/context-meeting-source.js
|
|
29682
29843
|
var readMeetingContextEvidence = /* @__PURE__ */ __name((database, request) => {
|
|
29683
29844
|
const { source: source2, words: words3, after: after2, before: before2, limit, maxReadBytes, cursor, signal } = request;
|
|
29684
29845
|
signal?.throwIfAborted();
|
|
@@ -29777,7 +29938,7 @@ var readMeetingContextEvidence = /* @__PURE__ */ __name((database, request) => {
|
|
|
29777
29938
|
});
|
|
29778
29939
|
}, "readMeetingContextEvidence");
|
|
29779
29940
|
|
|
29780
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
29941
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.503.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e5d4ab9592406842b4a214ba16b749bd/node_modules/@wirecat/cli-core/dist/store/sqlite/context-evidence.js
|
|
29781
29942
|
var corpora = {
|
|
29782
29943
|
message: {
|
|
29783
29944
|
table: "messages",
|
|
@@ -29964,12 +30125,12 @@ var contextEvidenceOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
|
29964
30125
|
});
|
|
29965
30126
|
}
|
|
29966
30127
|
}), "contextEvidenceOver");
|
|
29967
|
-
var contextIndexOver = /* @__PURE__ */ __name(({ database },
|
|
30128
|
+
var contextIndexOver = /* @__PURE__ */ __name(({ database }, stemmerFor2) => ({
|
|
29968
30129
|
async catchUp({ kinds: kinds2, signal }) {
|
|
29969
30130
|
signal?.throwIfAborted();
|
|
29970
|
-
const mail = kinds2.includes("mail") ? drainEmailIndex(database,
|
|
30131
|
+
const mail = kinds2.includes("mail") ? drainEmailIndex(database, stemmerFor2) : 0;
|
|
29971
30132
|
signal?.throwIfAborted();
|
|
29972
|
-
const documents2 = kinds2.includes("document") ? drainNoteIndex(database,
|
|
30133
|
+
const documents2 = kinds2.includes("document") ? drainNoteIndex(database, stemmerFor2) : 0;
|
|
29973
30134
|
return { mail, documents: documents2 };
|
|
29974
30135
|
}
|
|
29975
30136
|
}), "contextIndexOver");
|
|
@@ -30006,7 +30167,7 @@ var contextRecordsOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
|
30006
30167
|
}
|
|
30007
30168
|
}), "contextRecordsOver");
|
|
30008
30169
|
|
|
30009
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
30170
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.503.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e5d4ab9592406842b4a214ba16b749bd/node_modules/@wirecat/cli-core/dist/store/sqlite/note-search.js
|
|
30010
30171
|
var NOTE_FIELDS = [
|
|
30011
30172
|
"text",
|
|
30012
30173
|
"exact",
|
|
@@ -30034,7 +30195,7 @@ var CORPORA2 = [
|
|
|
30034
30195
|
type: "document",
|
|
30035
30196
|
noun: "note",
|
|
30036
30197
|
fields: NOTE_FIELDS,
|
|
30037
|
-
view:
|
|
30198
|
+
view: `(SELECT n.id, n.account_id AS folder_id, n.external_id AS path, n.title, coalesce(n.body, '') AS text, n.metadata, ${contextDocumentTime} AS at, n.deleted_at FROM documents n)`,
|
|
30038
30199
|
words: "document_words",
|
|
30039
30200
|
stems: "document_stems",
|
|
30040
30201
|
live: "coalesce(json_extract(n.metadata, '$.catalog.active'), 1)=1",
|
|
@@ -30051,12 +30212,22 @@ var CORPORA2 = [
|
|
|
30051
30212
|
tagged: /* @__PURE__ */ __name((tag2) => bound3("n.id IN (SELECT g.taggable_id FROM taggings g JOIN resolved_tags t ON t.id=g.tag_id WHERE t.name = ? AND g.taggable_type = 'note')", tag2), "tagged")
|
|
30052
30213
|
}
|
|
30053
30214
|
];
|
|
30054
|
-
var
|
|
30055
|
-
const offset = query.offset ?? 0;
|
|
30215
|
+
var matchedRows = /* @__PURE__ */ __name((context, query) => {
|
|
30056
30216
|
const chosen = CORPORA2.filter(({ type }) => (query.source === void 0 || query.source === "file" === (type === "document")) && (!query.folderIds?.length || query.withInternal === true || type === "document"));
|
|
30057
|
-
const
|
|
30217
|
+
const idsOf = /* @__PURE__ */ __name((type) => query.refs?.flatMap((ref3) => ref3.startsWith(`${type}:`) ? [Number(ref3.slice(type.length + 1))] : []), "idsOf");
|
|
30218
|
+
const rows = chosen.flatMap((corpus) => {
|
|
30219
|
+
const ids = idsOf(corpus.type);
|
|
30220
|
+
if (ids?.length === 0)
|
|
30221
|
+
return [];
|
|
30222
|
+
return searchCorpus(context, { ...query, ...query.folderIds ? { accountIds: query.folderIds } : {}, ...ids ? { ids } : {} }, corpus);
|
|
30223
|
+
});
|
|
30058
30224
|
const exactFirst = rows.some((row2) => row2.exact !== void 0);
|
|
30059
30225
|
rows.sort((a, b) => query.newest ? (b.at ?? 0) - (a.at ?? 0) || a.id - b.id : (exactFirst ? Number(b.exact === true) - Number(a.exact === true) : 0) || Number(a.relevance === null) - Number(b.relevance === null) || (a.relevance ?? 0) - (b.relevance ?? 0) || (b.at ?? 0) - (a.at ?? 0) || a.id - b.id);
|
|
30226
|
+
return rows;
|
|
30227
|
+
}, "matchedRows");
|
|
30228
|
+
var searchNotes = /* @__PURE__ */ __name((context, query) => {
|
|
30229
|
+
const offset = query.offset ?? 0;
|
|
30230
|
+
const rows = matchedRows(context, query);
|
|
30060
30231
|
const read2 = {
|
|
30061
30232
|
document: context.database.prepare("SELECT * FROM documents WHERE id = ?"),
|
|
30062
30233
|
note: context.database.prepare("SELECT * FROM notes WHERE id = ?")
|
|
@@ -30069,12 +30240,17 @@ var searchNotes = /* @__PURE__ */ __name((context, query) => {
|
|
|
30069
30240
|
ref: note2.ref,
|
|
30070
30241
|
note: note2,
|
|
30071
30242
|
relevance: row2.relevance,
|
|
30072
|
-
...row2.exact === void 0 ? {} : { exact: row2.exact }
|
|
30243
|
+
...row2.exact === void 0 ? {} : { exact: row2.exact },
|
|
30244
|
+
at: new Date(row2.at ?? 0).toISOString()
|
|
30073
30245
|
};
|
|
30074
30246
|
}),
|
|
30075
30247
|
hasMore: rows.length > offset + query.limit
|
|
30076
30248
|
};
|
|
30077
30249
|
}, "searchNotes");
|
|
30250
|
+
var matchingNoteRefs = /* @__PURE__ */ __name((context, query) => {
|
|
30251
|
+
const rows = matchedRows(context, { ...query, newest: true });
|
|
30252
|
+
return { refs: rows.slice(0, query.limit).map(({ type, id: id2 }) => `${type}:${id2}`), hasMore: rows.length > query.limit };
|
|
30253
|
+
}, "matchingNoteRefs");
|
|
30078
30254
|
var searchCorpus = /* @__PURE__ */ __name((context, query, corpus) => {
|
|
30079
30255
|
const { database } = context;
|
|
30080
30256
|
const wordMatch2 = /* @__PURE__ */ __name((match) => ({
|
|
@@ -30215,7 +30391,8 @@ var searchCorpus = /* @__PURE__ */ __name((context, query, corpus) => {
|
|
|
30215
30391
|
const scope3 = combine2([
|
|
30216
30392
|
bound3("n.deleted_at IS NULL"),
|
|
30217
30393
|
...corpus.live ? [bound3(corpus.live)] : [],
|
|
30218
|
-
...query.accountIds?.length && corpus.inAccounts ? [corpus.inAccounts(JSON.stringify(query.accountIds))] : []
|
|
30394
|
+
...query.accountIds?.length && corpus.inAccounts ? [corpus.inAccounts(JSON.stringify(query.accountIds))] : [],
|
|
30395
|
+
...query.ids ? [bound3("n.id IN (SELECT value FROM json_each(?))", JSON.stringify(query.ids))] : []
|
|
30219
30396
|
], "AND");
|
|
30220
30397
|
const where = combine2([scope3, expression], "AND");
|
|
30221
30398
|
const ranking = query.newest ? void 0 : required3(query.root, stemmed ? "stems" : "fts");
|
|
@@ -30236,7 +30413,7 @@ var searchCorpus = /* @__PURE__ */ __name((context, query, corpus) => {
|
|
|
30236
30413
|
const leaves = [...fragments.entries()].filter(([node]) => !tests.has(node));
|
|
30237
30414
|
const projection = tests.size ? leaves.map(([, fragment], index2) => `, coalesce(${fragment.sql}, 0) AS q${index2}`).join("") : "";
|
|
30238
30415
|
const window = tests.size ? QUERY_LIMITS2.candidates + 1 : query.limit + offset + 1;
|
|
30239
|
-
const rows = database.prepare(`${ctes.length ? `WITH ${ctes.join(", ")} ` : ""}SELECT n
|
|
30416
|
+
const rows = database.prepare(`${ctes.length ? `WITH ${ctes.join(", ")} ` : ""}SELECT ${tests.size ? "n.*" : "n.id, n.at"}, ${ranking ? "f.rank" : "NULL"} AS relevance${exactTier ? ", n.id IN (SELECT id FROM x) AS exact" : ""}${projection}
|
|
30240
30417
|
FROM ${corpus.view} n${ranking ? " LEFT JOIN f ON f.id = n.id" : ""} WHERE ${where.sql} ORDER BY ${order} LIMIT ?`).all(...cteParams, ...leaves.flatMap(([, fragment]) => tests.size ? fragment.params : []), ...where.params, window);
|
|
30241
30418
|
if (tests.size && rows.length > QUERY_LIMITS2.candidates)
|
|
30242
30419
|
exhausted("candidates");
|
|
@@ -30271,8 +30448,8 @@ var SCAN_PAGE3 = 5e3;
|
|
|
30271
30448
|
var LIVE2 = "((k.chunkable_type = 'document' AND EXISTS (SELECT 1 FROM documents d WHERE d.id = k.chunkable_id AND d.deleted_at IS NULL AND coalesce(json_extract(d.metadata, '$.catalog.active'), 1)=1 AND (? IS NULL OR d.account_id IN (SELECT CAST(value AS INTEGER) FROM json_each(?))))) OR (k.chunkable_type = 'note' AND ? IS NULL AND EXISTS (SELECT 1 FROM notes n WHERE n.id = k.chunkable_id AND n.deleted_at IS NULL)))";
|
|
30272
30449
|
var noteSearchOver = /* @__PURE__ */ __name((context) => {
|
|
30273
30450
|
const { database } = context;
|
|
30274
|
-
const
|
|
30275
|
-
const drain = /* @__PURE__ */ __name(() => drainNoteIndex(database,
|
|
30451
|
+
const stemmerFor2 = stemmerCache();
|
|
30452
|
+
const drain = /* @__PURE__ */ __name(() => drainNoteIndex(database, stemmerFor2), "drain");
|
|
30276
30453
|
const read2 = /* @__PURE__ */ __name((type, id2) => {
|
|
30277
30454
|
const row2 = database.prepare(`SELECT * FROM ${type === "document" ? "documents" : "notes"} WHERE id = ?`).get(id2);
|
|
30278
30455
|
return row2 ? type === "document" ? documentOf(row2) : noteOf(row2) : void 0;
|
|
@@ -30291,12 +30468,16 @@ var noteSearchOver = /* @__PURE__ */ __name((context) => {
|
|
|
30291
30468
|
drain();
|
|
30292
30469
|
return searchNotes(context, query);
|
|
30293
30470
|
}, "search"),
|
|
30471
|
+
matchingRefs: /* @__PURE__ */ __name(async (query) => {
|
|
30472
|
+
drain();
|
|
30473
|
+
return matchingNoteRefs(context, query);
|
|
30474
|
+
}, "matchingRefs"),
|
|
30294
30475
|
indexState: /* @__PURE__ */ __name(async () => noteIndexState(database), "indexState"),
|
|
30295
30476
|
chunksToEmbed: /* @__PURE__ */ __name(async (model, { after: after2, limit }) => {
|
|
30296
30477
|
drain();
|
|
30297
30478
|
const scope3 = live2(void 0, void 0);
|
|
30298
30479
|
const texts2 = /* @__PURE__ */ new Map();
|
|
30299
|
-
const
|
|
30480
|
+
const textOf6 = /* @__PURE__ */ __name((owner) => {
|
|
30300
30481
|
if (!texts2.has(owner)) {
|
|
30301
30482
|
const [type, id2] = owner.split(":");
|
|
30302
30483
|
const note2 = read2(String(type), Number(id2));
|
|
@@ -30309,7 +30490,7 @@ var noteSearchOver = /* @__PURE__ */ __name((context) => {
|
|
|
30309
30490
|
WHERE k.content_hash > ?${scope3.sql}
|
|
30310
30491
|
AND NOT EXISTS (SELECT 1 FROM embeddings v WHERE v.model = ? AND v.content_hash = k.content_hash)
|
|
30311
30492
|
GROUP BY k.content_hash ORDER BY k.content_hash LIMIT ?`).all(after2 ?? "", ...scope3.params, model, limit).flatMap((row2) => {
|
|
30312
|
-
const text5 =
|
|
30493
|
+
const text5 = textOf6(String(row2.owner));
|
|
30313
30494
|
return text5 === void 0 ? [] : [{ hash: String(row2.hash), text: text5.slice(Number(row2.start), Number(row2.end)) }];
|
|
30314
30495
|
});
|
|
30315
30496
|
}, "chunksToEmbed"),
|
|
@@ -30391,11 +30572,32 @@ var noteSearchOver = /* @__PURE__ */ __name((context) => {
|
|
|
30391
30572
|
const note2 = read2(String(type), Number(id2));
|
|
30392
30573
|
return note2 ? [{ ref: note2.ref, note: note2, score, range: { start, end } }] : [];
|
|
30393
30574
|
});
|
|
30394
|
-
}, "nearest")
|
|
30575
|
+
}, "nearest"),
|
|
30576
|
+
scoreNotes: /* @__PURE__ */ __name(async (model, query, refs) => {
|
|
30577
|
+
drain();
|
|
30578
|
+
const scope3 = live2(void 0, void 0, true);
|
|
30579
|
+
const owned = database.prepare(`SELECT k.chunkable_type AS type, k.chunkable_id AS owner, v.vector
|
|
30580
|
+
FROM chunks k JOIN embeddings v ON v.model = ? AND v.content_hash = k.content_hash
|
|
30581
|
+
WHERE k.chunkable_type = ? AND k.chunkable_id IN (SELECT value FROM json_each(?))${scope3.sql}`);
|
|
30582
|
+
const best = /* @__PURE__ */ new Map();
|
|
30583
|
+
for (const type of ["document", "note"]) {
|
|
30584
|
+
const ids = refs.flatMap((ref3) => ref3.startsWith(`${type}:`) ? [Number(ref3.slice(type.length + 1))] : []);
|
|
30585
|
+
if (!ids.length)
|
|
30586
|
+
continue;
|
|
30587
|
+
for (const row2 of owned.all(model, type, JSON.stringify(ids), ...scope3.params)) {
|
|
30588
|
+
const key2 = `${row2.type}:${row2.owner}`;
|
|
30589
|
+
const score = dot(query, row2.vector);
|
|
30590
|
+
if (score > (best.get(key2) ?? Number.NEGATIVE_INFINITY))
|
|
30591
|
+
best.set(key2, score);
|
|
30592
|
+
}
|
|
30593
|
+
}
|
|
30594
|
+
const order = new Map(refs.map((ref3, index2) => [ref3, index2]));
|
|
30595
|
+
return [...best].map(([ref3, score]) => ({ ref: ref3, score })).sort((a, b) => b.score - a.score || (order.get(a.ref) ?? 0) - (order.get(b.ref) ?? 0));
|
|
30596
|
+
}, "scoreNotes")
|
|
30395
30597
|
};
|
|
30396
30598
|
}, "noteSearchOver");
|
|
30397
30599
|
|
|
30398
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
30600
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.503.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e5d4ab9592406842b4a214ba16b749bd/node_modules/@wirecat/cli-core/dist/store/sqlite/event-search.js
|
|
30399
30601
|
var EVENT_FIELDS = ["text", "exact", "body", "title", "date", "in"];
|
|
30400
30602
|
var inEventAccounts = /* @__PURE__ */ __name((event) => searchableCopy(event, "c.account_id IN (SELECT CAST(value AS INTEGER) FROM json_each(?))"), "inEventAccounts");
|
|
30401
30603
|
var EVENT_CORPUS = {
|
|
@@ -30415,8 +30617,8 @@ var EVENT_CORPUS = {
|
|
|
30415
30617
|
var SCAN_PAGE4 = 5e3;
|
|
30416
30618
|
var eventSearchOver = /* @__PURE__ */ __name((context) => {
|
|
30417
30619
|
const { database } = context;
|
|
30418
|
-
const
|
|
30419
|
-
const drain = /* @__PURE__ */ __name(() => drainCorpus(database, CORPORA.event,
|
|
30620
|
+
const stemmerFor2 = stemmerCache();
|
|
30621
|
+
const drain = /* @__PURE__ */ __name(() => drainCorpus(database, CORPORA.event, stemmerFor2), "drain");
|
|
30420
30622
|
const live2 = /* @__PURE__ */ __name((accountIds) => {
|
|
30421
30623
|
const sql2 = ` AND k.chunkable_type = 'event' AND EXISTS (SELECT 1 FROM events e WHERE e.id = k.chunkable_id AND ${EVENT_LIVE})`;
|
|
30422
30624
|
return accountIds?.length ? { sql: `${sql2} AND ${inEventAccounts("k.chunkable_id")}`, params: [JSON.stringify(accountIds)] } : { sql: sql2, params: [] };
|
|
@@ -30527,7 +30729,7 @@ var eventSearchOver = /* @__PURE__ */ __name((context) => {
|
|
|
30527
30729
|
};
|
|
30528
30730
|
}, "eventSearchOver");
|
|
30529
30731
|
|
|
30530
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
30732
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.503.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e5d4ab9592406842b4a214ba16b749bd/node_modules/@wirecat/cli-core/dist/store/evidence-findings.js
|
|
30531
30733
|
var EVIDENCE_FINDINGS_KIND = "evidence_findings";
|
|
30532
30734
|
var reference = /* @__PURE__ */ __name((raw) => {
|
|
30533
30735
|
if (/^document:[1-9]\d*$/.test(raw))
|
|
@@ -30540,7 +30742,7 @@ var reference = /* @__PURE__ */ __name((raw) => {
|
|
|
30540
30742
|
}, "reference");
|
|
30541
30743
|
var validateEvidenceFindings = /* @__PURE__ */ __name((input) => validateFindings(input, { plural: "evidence findings", singular: "evidence finding", cited: "reference", reference }), "validateEvidenceFindings");
|
|
30542
30744
|
|
|
30543
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
30745
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.503.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e5d4ab9592406842b4a214ba16b749bd/node_modules/@wirecat/cli-core/dist/domain/moment.js
|
|
30544
30746
|
var calendarMoment = /* @__PURE__ */ __name((wanted, flag6, { zone, end = false } = {}) => {
|
|
30545
30747
|
try {
|
|
30546
30748
|
return zonedMoment(wanted, timezoneOf(zone), { start: 0, end: wanted.length }, { end });
|
|
@@ -30552,9 +30754,9 @@ var calendarMoment = /* @__PURE__ */ __name((wanted, flag6, { zone, end = false
|
|
|
30552
30754
|
}
|
|
30553
30755
|
}, "calendarMoment");
|
|
30554
30756
|
|
|
30555
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
30757
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.503.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e5d4ab9592406842b4a214ba16b749bd/node_modules/@wirecat/cli-core/dist/store/sqlite/facts.js
|
|
30556
30758
|
var NAMED3 = "SELECT f.*, b.name AS author_name FROM facts f LEFT JOIN bots b ON f.author_type = 'bot' AND b.id = f.author_id";
|
|
30557
|
-
var
|
|
30759
|
+
var iso8 = /* @__PURE__ */ __name((value) => new Date(Number(value)).toISOString(), "iso");
|
|
30558
30760
|
var oneOf4 = /* @__PURE__ */ __name((value, allowed, what) => {
|
|
30559
30761
|
if (typeof value !== "string" || !allowed.includes(value))
|
|
30560
30762
|
throw new CliError("validation_error", `${what} is one of ${allowed.join(", ")}`);
|
|
@@ -30569,8 +30771,8 @@ var factOperationsOver = /* @__PURE__ */ __name((context) => {
|
|
|
30569
30771
|
statement: String(row2.statement),
|
|
30570
30772
|
status: row2.status,
|
|
30571
30773
|
project: row2.project_id == null ? null : `project:${row2.project_id}`,
|
|
30572
|
-
|
|
30573
|
-
occurredAt: row2.occurred_at == null ? null :
|
|
30774
|
+
...subjectOf(database, row2),
|
|
30775
|
+
occurredAt: row2.occurred_at == null ? null : iso8(row2.occurred_at),
|
|
30574
30776
|
supersedes: row2.supersedes_id == null ? null : `fact:${row2.supersedes_id}`,
|
|
30575
30777
|
author: authorOf(row2),
|
|
30576
30778
|
model: row2.model == null ? null : String(row2.model),
|
|
@@ -30578,8 +30780,8 @@ var factOperationsOver = /* @__PURE__ */ __name((context) => {
|
|
|
30578
30780
|
scope: row2.scope == null ? null : row2.scope,
|
|
30579
30781
|
source: String(row2.source),
|
|
30580
30782
|
evidence: evidenceOf(context, { type: "fact", id: Number(row2.id) }),
|
|
30581
|
-
createdAt:
|
|
30582
|
-
updatedAt:
|
|
30783
|
+
createdAt: iso8(row2.created_at),
|
|
30784
|
+
updatedAt: iso8(row2.updated_at)
|
|
30583
30785
|
}), "factOf");
|
|
30584
30786
|
const rowOf = /* @__PURE__ */ __name((reference2) => {
|
|
30585
30787
|
const thing = requiredThing(database, reference2.includes(":") ? reference2 : `fact:${reference2}`, "the fact");
|
|
@@ -30651,9 +30853,41 @@ var factOperationsOver = /* @__PURE__ */ __name((context) => {
|
|
|
30651
30853
|
throw new CliError("validation_error", "only an accepted decision can be reversed");
|
|
30652
30854
|
database.prepare("UPDATE facts SET status = 'reversed', updated_at = ? WHERE id = ?").run(now2(), Number(row2.id));
|
|
30653
30855
|
return factOf(rowOf(reference2));
|
|
30654
|
-
}, "reverse")
|
|
30856
|
+
}, "reverse"),
|
|
30857
|
+
reject: /* @__PURE__ */ __name((reference2) => {
|
|
30858
|
+
const row2 = rowOf(reference2);
|
|
30859
|
+
if (row2.status !== "proposed")
|
|
30860
|
+
throw new CliError("validation_error", `only a proposed fact can be rejected; this one is ${String(row2.status)}`);
|
|
30861
|
+
database.prepare("UPDATE facts SET status = 'rejected', updated_at = ? WHERE id = ?").run(now2(), Number(row2.id));
|
|
30862
|
+
return factOf(rowOf(reference2));
|
|
30863
|
+
}, "reject"),
|
|
30864
|
+
remove: /* @__PURE__ */ __name((reference2) => {
|
|
30865
|
+
const row2 = rowOf(reference2);
|
|
30866
|
+
const id2 = Number(row2.id);
|
|
30867
|
+
const twin = row2.source === "memory" && row2.metadata != null ? migratedFrom(String(row2.metadata)) : void 0;
|
|
30868
|
+
const links2 = erase(database, () => {
|
|
30869
|
+
database.prepare("UPDATE facts SET supersedes_id = NULL WHERE supersedes_id = ?").run(id2);
|
|
30870
|
+
const count = dropLinksOf(database, { type: "fact", id: id2 });
|
|
30871
|
+
database.prepare("DELETE FROM links WHERE from_type = 'fact' AND from_id = ?").run(id2);
|
|
30872
|
+
database.prepare("DELETE FROM taggings WHERE taggable_type = 'fact' AND taggable_id = ?").run(id2);
|
|
30873
|
+
database.prepare("DELETE FROM facts WHERE id = ?").run(id2);
|
|
30874
|
+
if (twin !== void 0)
|
|
30875
|
+
database.prepare("DELETE FROM memories WHERE id = ? AND deleted_at IS NOT NULL").run(twin);
|
|
30876
|
+
return count;
|
|
30877
|
+
});
|
|
30878
|
+
return { ref: `fact:${id2}`, removed: true, links: links2 };
|
|
30879
|
+
}, "remove"),
|
|
30880
|
+
sources: /* @__PURE__ */ __name((reference2) => evidenceSourcesOf(database, { type: "fact", id: Number(rowOf(reference2).id) }), "sources")
|
|
30655
30881
|
};
|
|
30656
30882
|
}, "factOperationsOver");
|
|
30883
|
+
var migratedFrom = /* @__PURE__ */ __name((metadata3) => {
|
|
30884
|
+
try {
|
|
30885
|
+
const { memory } = JSON.parse(metadata3);
|
|
30886
|
+
return Number.isInteger(memory) ? Number(memory) : void 0;
|
|
30887
|
+
} catch {
|
|
30888
|
+
return void 0;
|
|
30889
|
+
}
|
|
30890
|
+
}, "migratedFrom");
|
|
30657
30891
|
var factsStoreOver = /* @__PURE__ */ __name((context) => {
|
|
30658
30892
|
const operations = factOperationsOver(context);
|
|
30659
30893
|
return {
|
|
@@ -30661,11 +30895,14 @@ var factsStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
30661
30895
|
get: /* @__PURE__ */ __name(async (reference2) => operations.get(reference2), "get"),
|
|
30662
30896
|
list: /* @__PURE__ */ __name(async (options) => operations.list(options), "list"),
|
|
30663
30897
|
accept: /* @__PURE__ */ __name(async (reference2) => operations.accept(reference2), "accept"),
|
|
30664
|
-
reverse: /* @__PURE__ */ __name(async (reference2) => operations.reverse(reference2), "reverse")
|
|
30898
|
+
reverse: /* @__PURE__ */ __name(async (reference2) => operations.reverse(reference2), "reverse"),
|
|
30899
|
+
reject: /* @__PURE__ */ __name(async (reference2) => operations.reject(reference2), "reject"),
|
|
30900
|
+
remove: /* @__PURE__ */ __name(async (reference2) => operations.remove(reference2), "remove"),
|
|
30901
|
+
sources: /* @__PURE__ */ __name(async (reference2) => operations.sources(reference2), "sources")
|
|
30665
30902
|
};
|
|
30666
30903
|
}, "factsStoreOver");
|
|
30667
30904
|
|
|
30668
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
30905
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.503.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e5d4ab9592406842b4a214ba16b749bd/node_modules/@wirecat/cli-core/dist/store/sqlite/findings-core.js
|
|
30669
30906
|
var invalid2 = /* @__PURE__ */ __name((message2) => {
|
|
30670
30907
|
throw new CliError("validation_error", message2);
|
|
30671
30908
|
}, "invalid");
|
|
@@ -30755,10 +30992,10 @@ var findingsCoreOver = /* @__PURE__ */ __name((context, kind3) => {
|
|
|
30755
30992
|
return { snapshot: snapshot2, snapshotParts, previous, outcomes };
|
|
30756
30993
|
}, "findingsCoreOver");
|
|
30757
30994
|
|
|
30758
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
30995
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.503.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e5d4ab9592406842b4a214ba16b749bd/node_modules/@wirecat/cli-core/dist/store/sqlite/proposed-actions.js
|
|
30759
30996
|
var PROPOSAL_STATUSES = ["proposed", "approved", "rejected", "executed", "failed"];
|
|
30760
30997
|
var PROPOSAL_VERDICTS = ["useful", "not_useful"];
|
|
30761
|
-
var
|
|
30998
|
+
var iso9 = /* @__PURE__ */ __name((value) => value == null ? null : new Date(Number(value)).toISOString(), "iso");
|
|
30762
30999
|
var NAMED4 = "SELECT p.*, b.name AS proposer_name FROM proposed_actions p LEFT JOIN bots b ON p.proposed_by_type = 'bot' AND b.id = p.proposed_by_id";
|
|
30763
31000
|
var json2 = /* @__PURE__ */ __name((value) => value == null ? null : JSON.parse(String(value)), "json");
|
|
30764
31001
|
var proposalOperationsOver = /* @__PURE__ */ __name((context) => {
|
|
@@ -30779,12 +31016,12 @@ var proposalOperationsOver = /* @__PURE__ */ __name((context) => {
|
|
|
30779
31016
|
name: row2.proposer_name == null ? null : String(row2.proposer_name)
|
|
30780
31017
|
},
|
|
30781
31018
|
decidedBy: row2.decided_by_type == null ? null : { type: row2.decided_by_type, id: String(row2.decided_by_id) },
|
|
30782
|
-
decidedAt:
|
|
30783
|
-
executedAt:
|
|
31019
|
+
decidedAt: iso9(row2.decided_at),
|
|
31020
|
+
executedAt: iso9(row2.executed_at),
|
|
30784
31021
|
result: json2(row2.result),
|
|
30785
31022
|
error: row2.error == null ? null : String(row2.error),
|
|
30786
31023
|
verdict: row2.verdict ?? null,
|
|
30787
|
-
createdAt:
|
|
31024
|
+
createdAt: iso9(row2.created_at)
|
|
30788
31025
|
};
|
|
30789
31026
|
}, "actionOf");
|
|
30790
31027
|
const rowOf = /* @__PURE__ */ __name((id2) => {
|
|
@@ -30901,7 +31138,7 @@ var proposedActionsStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
30901
31138
|
};
|
|
30902
31139
|
}, "proposedActionsStoreOver");
|
|
30903
31140
|
|
|
30904
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
31141
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.503.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e5d4ab9592406842b4a214ba16b749bd/node_modules/@wirecat/cli-core/dist/store/sqlite/evidence-findings.js
|
|
30905
31142
|
var stale = /* @__PURE__ */ __name(() => {
|
|
30906
31143
|
throw new CliError("validation_error", "evidence findings changed since they were read; stage a new batch", {
|
|
30907
31144
|
reason: "evidence-findings.stale"
|
|
@@ -31067,7 +31304,7 @@ var evidenceFindingsStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
31067
31304
|
};
|
|
31068
31305
|
}, "evidenceFindingsStoreOver");
|
|
31069
31306
|
|
|
31070
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
31307
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.503.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e5d4ab9592406842b4a214ba16b749bd/node_modules/@wirecat/cli-core/dist/store/sqlite/involvements.js
|
|
31071
31308
|
var pendingInvolvements = /* @__PURE__ */ __name((database) => Number(database.prepare("SELECT count(*) AS n FROM involvement_pending").get()?.n ?? 0), "pendingInvolvements");
|
|
31072
31309
|
var involvementStoreOver = /* @__PURE__ */ __name(({ database, now: now2 }) => ({
|
|
31073
31310
|
rebuild: /* @__PURE__ */ __name((personId) => write(database, () => {
|
|
@@ -31120,7 +31357,7 @@ var involvementStoreOver = /* @__PURE__ */ __name(({ database, now: now2 }) => (
|
|
|
31120
31357
|
}, "forPerson")
|
|
31121
31358
|
}), "involvementStoreOver");
|
|
31122
31359
|
|
|
31123
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
31360
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.503.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e5d4ab9592406842b4a214ba16b749bd/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-projects.js
|
|
31124
31361
|
import { createHash as createHash12 } from "node:crypto";
|
|
31125
31362
|
var fields3 = "id,from_id,to_id,source,confirmed,updated_at,length(evidence) AS evidenceLength,substr(evidence,1,2000) AS evidence";
|
|
31126
31363
|
var id = /* @__PURE__ */ __name((value) => {
|
|
@@ -31206,16 +31443,16 @@ var meetingProjectsStoreOver = /* @__PURE__ */ __name(({ database, now: now2 })
|
|
|
31206
31443
|
};
|
|
31207
31444
|
}, "meetingProjectsStoreOver");
|
|
31208
31445
|
|
|
31209
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
31446
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.503.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e5d4ab9592406842b4a214ba16b749bd/node_modules/@wirecat/cli-core/dist/store/sqlite/vocabulary.js
|
|
31210
31447
|
import { createHash as createHash15 } from "node:crypto";
|
|
31211
31448
|
|
|
31212
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
31449
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.503.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e5d4ab9592406842b4a214ba16b749bd/node_modules/@wirecat/cli-core/dist/store/sqlite/tag-consolidation.js
|
|
31213
31450
|
import { createHash as createHash14 } from "node:crypto";
|
|
31214
31451
|
|
|
31215
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
31452
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.503.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e5d4ab9592406842b4a214ba16b749bd/node_modules/@wirecat/cli-core/dist/store/sqlite/tag-consolidation-apply.js
|
|
31216
31453
|
import { createHash as createHash13 } from "node:crypto";
|
|
31217
31454
|
|
|
31218
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
31455
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.503.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e5d4ab9592406842b4a214ba16b749bd/node_modules/@wirecat/cli-core/dist/store/sqlite/tag-consolidation-input.js
|
|
31219
31456
|
var consolidationId = /* @__PURE__ */ __name((value, field3) => {
|
|
31220
31457
|
if (typeof value !== "string" || !/^[1-9]\d*$/.test(value) || !Number.isSafeInteger(Number(value)))
|
|
31221
31458
|
throw new CliError("validation_error", `${field3} must be a positive canonical tag id`);
|
|
@@ -31266,7 +31503,7 @@ var consolidationApplyInput = /* @__PURE__ */ __name((options) => {
|
|
|
31266
31503
|
return input;
|
|
31267
31504
|
}, "consolidationApplyInput");
|
|
31268
31505
|
|
|
31269
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
31506
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.503.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e5d4ab9592406842b4a214ba16b749bd/node_modules/@wirecat/cli-core/dist/store/sqlite/tag-consolidation-apply.js
|
|
31270
31507
|
var receiptOf = /* @__PURE__ */ __name((row2) => ({
|
|
31271
31508
|
id: String(row2.id),
|
|
31272
31509
|
sourceId: String(row2.source_id),
|
|
@@ -31341,7 +31578,7 @@ var applyTagConsolidation = /* @__PURE__ */ __name((context, preview, options) =
|
|
|
31341
31578
|
}, { beforeCommit: check3 });
|
|
31342
31579
|
}, "applyTagConsolidation");
|
|
31343
31580
|
|
|
31344
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
31581
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.503.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e5d4ab9592406842b4a214ba16b749bd/node_modules/@wirecat/cli-core/dist/store/sqlite/tag-consolidation.js
|
|
31345
31582
|
var selections = [
|
|
31346
31583
|
["taggings", "tag_id IN (SELECT value FROM json_each(?))"],
|
|
31347
31584
|
["aliases", "aliasable_type='tag' AND aliasable_id IN (SELECT value FROM json_each(?))"],
|
|
@@ -31485,7 +31722,7 @@ var previewRows = /* @__PURE__ */ __name((context, options, source2, survivor, m
|
|
|
31485
31722
|
};
|
|
31486
31723
|
}, "previewRows");
|
|
31487
31724
|
|
|
31488
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
31725
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.503.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e5d4ab9592406842b4a214ba16b749bd/node_modules/@wirecat/cli-core/dist/store/sqlite/vocabulary.js
|
|
31489
31726
|
var kinds = ["project", "tag", "topic"];
|
|
31490
31727
|
var cancelled2 = /* @__PURE__ */ __name((signal) => {
|
|
31491
31728
|
if (signal?.aborted)
|
|
@@ -31749,18 +31986,18 @@ var vocabularyStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
31749
31986
|
};
|
|
31750
31987
|
}, "vocabularyStoreOver");
|
|
31751
31988
|
|
|
31752
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
31989
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.503.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e5d4ab9592406842b4a214ba16b749bd/node_modules/@wirecat/cli-core/dist/store/sqlite/knowledge.js
|
|
31753
31990
|
var TYPED_KEY_PREFIXES = new Set(Object.values(TASK_KEY_PREFIXES));
|
|
31754
31991
|
var ORGANIZATION_KINDS = ["company", "team", "family", "community"];
|
|
31755
31992
|
var PROJECT_TYPES = ["work", "client", "personal", "oss", "other"];
|
|
31756
31993
|
var SCOPES = ["personal", "work"];
|
|
31757
|
-
var
|
|
31994
|
+
var iso10 = /* @__PURE__ */ __name((value) => new Date(Number(value)).toISOString(), "iso");
|
|
31758
31995
|
var bounded2 = /* @__PURE__ */ __name((limit = 100, offset = 0) => {
|
|
31759
31996
|
if (!Number.isInteger(limit) || limit < 1 || limit > 500 || !Number.isInteger(offset) || offset < 0 || offset > 1e5)
|
|
31760
31997
|
throw new CliError("validation_error", "limit takes 1\u2013500 and offset takes 0\u2013100000");
|
|
31761
31998
|
return { limit, offset };
|
|
31762
31999
|
}, "bounded");
|
|
31763
|
-
var
|
|
32000
|
+
var textOf4 = /* @__PURE__ */ __name((text5, max = 1e5) => {
|
|
31764
32001
|
const value = text5.trim();
|
|
31765
32002
|
if (!value || value.length > max)
|
|
31766
32003
|
throw new CliError("validation_error", `text takes 1\u2013${max} characters`);
|
|
@@ -31887,8 +32124,8 @@ var knowledgeStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
31887
32124
|
text: String(row2.body),
|
|
31888
32125
|
revision: Number(row2.revision),
|
|
31889
32126
|
authoredBy: "owner",
|
|
31890
|
-
createdAt:
|
|
31891
|
-
updatedAt:
|
|
32127
|
+
createdAt: iso10(row2.created_at),
|
|
32128
|
+
updatedAt: iso10(row2.updated_at)
|
|
31892
32129
|
};
|
|
31893
32130
|
}, "annotationOf");
|
|
31894
32131
|
const noteRow = /* @__PURE__ */ __name((id2) => /^\d+$/.test(id2) ? database.prepare("SELECT * FROM notes WHERE id = ? AND deleted_at IS NULL").get(Number(id2)) : void 0, "noteRow");
|
|
@@ -31906,7 +32143,7 @@ var knowledgeStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
31906
32143
|
kind: row2.kind,
|
|
31907
32144
|
name: String(row2.name),
|
|
31908
32145
|
scope: row2.scope,
|
|
31909
|
-
createdAt:
|
|
32146
|
+
createdAt: iso10(row2.created_at)
|
|
31910
32147
|
}), "organizationOf");
|
|
31911
32148
|
const projectOf = /* @__PURE__ */ __name((row2) => ({
|
|
31912
32149
|
id: String(row2.id),
|
|
@@ -31917,7 +32154,7 @@ var knowledgeStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
31917
32154
|
type: row2.type,
|
|
31918
32155
|
organizationId: row2.organization_id == null ? null : String(row2.organization_id),
|
|
31919
32156
|
scope: row2.scope,
|
|
31920
|
-
createdAt:
|
|
32157
|
+
createdAt: iso10(row2.created_at)
|
|
31921
32158
|
}), "projectOf");
|
|
31922
32159
|
const relationOf = /* @__PURE__ */ __name((link3) => ({
|
|
31923
32160
|
id: link3.id,
|
|
@@ -31954,7 +32191,7 @@ var knowledgeStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
31954
32191
|
const reminderOf = /* @__PURE__ */ __name((row2) => ({
|
|
31955
32192
|
id: String(row2.id),
|
|
31956
32193
|
task: taskIdOf(database, Number(row2.task_id)) ?? String(row2.task_id),
|
|
31957
|
-
dueAt:
|
|
32194
|
+
dueAt: iso10(row2.due_at),
|
|
31958
32195
|
timezone: String(row2.timezone),
|
|
31959
32196
|
state: row2.state,
|
|
31960
32197
|
revision: Number(row2.revision),
|
|
@@ -31996,7 +32233,7 @@ var knowledgeStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
31996
32233
|
return { items: rows.slice(0, limit).map((row2) => String(row2.id ?? row2.key)), hasMore: rows.length > limit };
|
|
31997
32234
|
}, "taskIds"),
|
|
31998
32235
|
addAnnotation: /* @__PURE__ */ __name(async (key2, target, text5) => {
|
|
31999
|
-
const body2 =
|
|
32236
|
+
const body2 = textOf4(text5);
|
|
32000
32237
|
if (subfolder(target) !== null)
|
|
32001
32238
|
throw new CliError("validation_error", "annotate a folder, not one of its subfolders");
|
|
32002
32239
|
const thing = available(key2, target);
|
|
@@ -32021,7 +32258,7 @@ var knowledgeStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
32021
32258
|
annotation: /* @__PURE__ */ __name(async (key2, id2) => annotation(key2, id2), "annotation"),
|
|
32022
32259
|
editAnnotation: /* @__PURE__ */ __name(async (key2, id2, text5, revision2) => {
|
|
32023
32260
|
const held = annotation(key2, id2);
|
|
32024
|
-
const changed = database.prepare("UPDATE notes SET body=?, revision=revision+1, updated_at=? WHERE id=? AND revision=?").run(
|
|
32261
|
+
const changed = database.prepare("UPDATE notes SET body=?, revision=revision+1, updated_at=? WHERE id=? AND revision=?").run(textOf4(text5), now2(), Number(id2), revision2).changes;
|
|
32025
32262
|
if (!changed)
|
|
32026
32263
|
throw new CliError("validation_error", "annotation changed; read the current revision before editing");
|
|
32027
32264
|
database.prepare("INSERT INTO note_revisions (note_id, body, revision, created_at) VALUES (?, ?, ?, ?)").run(Number(id2), held.text, held.revision, now2());
|
|
@@ -32094,7 +32331,7 @@ var knowledgeStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
32094
32331
|
}, "labelled"),
|
|
32095
32332
|
addOrganization: /* @__PURE__ */ __name(async ({ kind: kind3, name, scope: scope3 = "personal" }) => {
|
|
32096
32333
|
const at = now2();
|
|
32097
|
-
const row2 = database.prepare("INSERT INTO organizations (kind, name, scope, created_at, updated_at) VALUES (?, ?, ?, ?, ?) RETURNING *").get(oneOf5(kind3, ORGANIZATION_KINDS, "an organization's kind"),
|
|
32334
|
+
const row2 = database.prepare("INSERT INTO organizations (kind, name, scope, created_at, updated_at) VALUES (?, ?, ?, ?, ?) RETURNING *").get(oneOf5(kind3, ORGANIZATION_KINDS, "an organization's kind"), textOf4(name, 200), oneOf5(scope3, SCOPES, "a scope"), at, at);
|
|
32098
32335
|
return organizationOf(row2);
|
|
32099
32336
|
}, "addOrganization"),
|
|
32100
32337
|
organizations: /* @__PURE__ */ __name(async (query) => {
|
|
@@ -32107,7 +32344,7 @@ var knowledgeStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
32107
32344
|
return database.prepare(`SELECT * FROM organizations WHERE deleted_at IS NULL${where ? ` AND (${where.sql})` : ""} ORDER BY name, id LIMIT 500`).all(...where?.params ?? []).map(organizationOf);
|
|
32108
32345
|
}, "organizations"),
|
|
32109
32346
|
addProject: /* @__PURE__ */ __name(async ({ name, key: key2, type = "other", organization, scope: scope3 = "personal", description }) => write(database, () => {
|
|
32110
|
-
const title =
|
|
32347
|
+
const title = textOf4(name, 200);
|
|
32111
32348
|
const organizationId = organization === void 0 ? null : (() => {
|
|
32112
32349
|
const thing = thingOf(database, organization);
|
|
32113
32350
|
if (thing?.type !== "organization")
|
|
@@ -32142,7 +32379,7 @@ var knowledgeStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
32142
32379
|
chosen = `${wanted.slice(0, 4 - suffix.length)}${suffix}`;
|
|
32143
32380
|
}
|
|
32144
32381
|
const at = now2();
|
|
32145
|
-
const row2 = database.prepare("INSERT INTO projects (key, name, name_folded, description, type, organization_id, scope, tasks_count, status, created_at, updated_at) VALUES (?, ?, ?, ?, ?, ?, ?, 0, 'active', ?, ?) RETURNING *").get(chosen, title, fold(title), description === void 0 ? null :
|
|
32382
|
+
const row2 = database.prepare("INSERT INTO projects (key, name, name_folded, description, type, organization_id, scope, tasks_count, status, created_at, updated_at) VALUES (?, ?, ?, ?, ?, ?, ?, 0, 'active', ?, ?) RETURNING *").get(chosen, title, fold(title), description === void 0 ? null : textOf4(description, 2e3), oneOf5(type, PROJECT_TYPES, "a project's type"), organizationId, oneOf5(scope3, SCOPES, "a scope"), at, at);
|
|
32146
32383
|
return projectOf(row2);
|
|
32147
32384
|
}), "addProject"),
|
|
32148
32385
|
projects: /* @__PURE__ */ __name(async (query) => {
|
|
@@ -32271,7 +32508,7 @@ var projectKey = /* @__PURE__ */ __name((name) => {
|
|
|
32271
32508
|
return key2.padEnd(3, "X");
|
|
32272
32509
|
}, "projectKey");
|
|
32273
32510
|
|
|
32274
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
32511
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.503.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e5d4ab9592406842b4a214ba16b749bd/node_modules/@wirecat/cli-core/dist/store/sqlite/log-pruning.js
|
|
32275
32512
|
var DAY5 = 864e5;
|
|
32276
32513
|
var SETTING4 = "logs_pruned_at";
|
|
32277
32514
|
var LOG_RETENTION = { agentActionsMs: 90 * DAY5, botUpdatePayloadsMs: 30 * DAY5 };
|
|
@@ -32298,7 +32535,7 @@ var logPruner = /* @__PURE__ */ __name((database, now2) => {
|
|
|
32298
32535
|
};
|
|
32299
32536
|
}, "logPruner");
|
|
32300
32537
|
|
|
32301
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
32538
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.503.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e5d4ab9592406842b4a214ba16b749bd/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-findings.js
|
|
32302
32539
|
var stale2 = /* @__PURE__ */ __name(() => {
|
|
32303
32540
|
throw new CliError("validation_error", "meeting findings changed since they were read; stage a new batch", {
|
|
32304
32541
|
reason: "meeting-findings.stale"
|
|
@@ -32467,7 +32704,7 @@ var meetingFindingsStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
32467
32704
|
};
|
|
32468
32705
|
}, "meetingFindingsStoreOver");
|
|
32469
32706
|
|
|
32470
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
32707
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.503.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e5d4ab9592406842b4a214ba16b749bd/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-vectors.js
|
|
32471
32708
|
var RANK_BATCH = 512;
|
|
32472
32709
|
var LIVE3 = "FROM chunks k JOIN meeting_transcripts t ON k.chunkable_type = 'meeting_transcript' AND t.id = k.chunkable_id JOIN meetings m ON m.id = t.meeting_id WHERE m.account_id = ? AND m.deleted_at IS NULL AND t.deleted_at IS NULL AND t.superseded_at IS NULL";
|
|
32473
32710
|
var limitOf = /* @__PURE__ */ __name((value, name, max = 1e3) => {
|
|
@@ -32487,7 +32724,7 @@ var modelOf = /* @__PURE__ */ __name((model) => {
|
|
|
32487
32724
|
var missing3 = /* @__PURE__ */ __name(() => {
|
|
32488
32725
|
throw new CliError("not_found", "Current transcript not found");
|
|
32489
32726
|
}, "missing");
|
|
32490
|
-
var
|
|
32727
|
+
var textOf5 = /* @__PURE__ */ __name((context, accountId, transcriptId, budget, signal) => {
|
|
32491
32728
|
const maxRows = limitOf(budget.maxRows ?? 1e4, "maxRows", 1e5);
|
|
32492
32729
|
const maxBytes = limitOf(budget.maxTextBytes ?? 4 * 1024 * 1024, "maxTextBytes", 64 * 1024 * 1024);
|
|
32493
32730
|
const parent2 = context.database.prepare("SELECT m.id AS meeting_id FROM meeting_transcripts t JOIN meetings m ON m.id=t.meeting_id WHERE t.id=? AND m.account_id=? AND m.deleted_at IS NULL AND t.deleted_at IS NULL AND t.superseded_at IS NULL").get(transcriptId, accountId) ?? missing3();
|
|
@@ -32521,14 +32758,14 @@ var textLoader = /* @__PURE__ */ __name((context, input) => {
|
|
|
32521
32758
|
return existing;
|
|
32522
32759
|
if (remaining <= 0)
|
|
32523
32760
|
throw new CliError("validation_error", "Vector operation exceeds its aggregate text read budget");
|
|
32524
|
-
const document =
|
|
32761
|
+
const document = textOf5(context, input.accountId, id2, { ...input, maxTextBytes: remaining }, input.signal);
|
|
32525
32762
|
remaining -= document.readBytes;
|
|
32526
32763
|
loaded3.set(id2, document);
|
|
32527
32764
|
return document;
|
|
32528
32765
|
};
|
|
32529
32766
|
}, "textLoader");
|
|
32530
32767
|
var chunkText = /* @__PURE__ */ __name((context, accountId, row2, budget, signal, loaded3) => {
|
|
32531
|
-
const document = loaded3 ??
|
|
32768
|
+
const document = loaded3 ?? textOf5(context, accountId, Number(row2.chunkable_id), budget, signal);
|
|
32532
32769
|
const start = Number(row2.start_offset), end = Number(row2.end_offset);
|
|
32533
32770
|
const text5 = document.text.slice(start, end);
|
|
32534
32771
|
if (chunkHash(text5) !== String(row2.content_hash))
|
|
@@ -32738,7 +32975,7 @@ var meetingVectorsOver = /* @__PURE__ */ __name((context) => ({
|
|
|
32738
32975
|
}
|
|
32739
32976
|
}), "meetingVectorsOver");
|
|
32740
32977
|
|
|
32741
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
32978
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.503.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e5d4ab9592406842b4a214ba16b749bd/node_modules/@wirecat/cli-core/dist/store/sqlite/mention-sources.js
|
|
32742
32979
|
var OTHER_SOURCES = ["document", "note", "email"];
|
|
32743
32980
|
var TEXTS = {
|
|
32744
32981
|
document: "JOIN documents s ON mn.source_type = 'document' AND s.id = mn.source_id AND s.deleted_at IS NULL WHERE 1 ",
|
|
@@ -32839,11 +33076,11 @@ var sourceMentionStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
32839
33076
|
};
|
|
32840
33077
|
}, "sourceMentionStoreOver");
|
|
32841
33078
|
|
|
32842
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
33079
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.503.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e5d4ab9592406842b4a214ba16b749bd/node_modules/@wirecat/cli-core/dist/store/sqlite/open-store.js
|
|
32843
33080
|
import { mkdirSync, statSync, writeFileSync } from "node:fs";
|
|
32844
33081
|
import { dirname } from "node:path";
|
|
32845
33082
|
|
|
32846
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
33083
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.503.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e5d4ab9592406842b4a214ba16b749bd/node_modules/@wirecat/cli-core/dist/store/sqlite/clients.js
|
|
32847
33084
|
import { readFileSync as readFileSync3 } from "node:fs";
|
|
32848
33085
|
var CLIENTS_SETTING = "clients";
|
|
32849
33086
|
var coreVersion = (() => {
|
|
@@ -32901,7 +33138,7 @@ var refusalAdvice = /* @__PURE__ */ __name((clients, command, schema) => {
|
|
|
32901
33138
|
return mover ? `${own} (${mover.command} ${mover.version} moved the store to schema ${schema})` : own;
|
|
32902
33139
|
}, "refusalAdvice");
|
|
32903
33140
|
|
|
32904
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
33141
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.503.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e5d4ab9592406842b4a214ba16b749bd/node_modules/@wirecat/cli-core/dist/store/sqlite/migrations.generated.js
|
|
32905
33142
|
var GENERATED = [
|
|
32906
33143
|
{
|
|
32907
33144
|
"name": "20261010184427_initial",
|
|
@@ -33767,7 +34004,7 @@ WHERE json_type(params, '$.selection') = 'object';`
|
|
|
33767
34004
|
}
|
|
33768
34005
|
];
|
|
33769
34006
|
|
|
33770
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34007
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.503.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e5d4ab9592406842b4a214ba16b749bd/node_modules/@wirecat/cli-core/dist/store/sqlite/manifest.js
|
|
33771
34008
|
var MANIFEST = [
|
|
33772
34009
|
{ name: "20261010184427_initial", version: 1, minCompatible: 1 },
|
|
33773
34010
|
{ name: "20261011035353_version-2-facts", version: 2, minCompatible: 1 },
|
|
@@ -33845,7 +34082,7 @@ var generatedMigrations = /* @__PURE__ */ __name((manifest = MANIFEST, generated
|
|
|
33845
34082
|
return migrations;
|
|
33846
34083
|
}, "generatedMigrations");
|
|
33847
34084
|
|
|
33848
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34085
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.503.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e5d4ab9592406842b4a214ba16b749bd/node_modules/@wirecat/cli-core/dist/store/migrations.js
|
|
33849
34086
|
var MIGRATIONS = generatedMigrations();
|
|
33850
34087
|
var HISTORY = `CREATE TABLE IF NOT EXISTS schema_migrations (
|
|
33851
34088
|
version INTEGER PRIMARY KEY,
|
|
@@ -33898,7 +34135,7 @@ var migrate = /* @__PURE__ */ __name((database, { migrations = MIGRATIONS, now:
|
|
|
33898
34135
|
}
|
|
33899
34136
|
}, "migrate");
|
|
33900
34137
|
|
|
33901
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34138
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.503.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e5d4ab9592406842b4a214ba16b749bd/node_modules/@wirecat/cli-core/dist/store/sqlite/join-keys.js
|
|
33902
34139
|
var fillJoinKeys = /* @__PURE__ */ __name((database, { batch = 2e3 } = {}) => {
|
|
33903
34140
|
const pending = database.prepare("SELECT id, join_url FROM meetings WHERE join_url IS NOT NULL AND join_key IS NULL AND id > ? ORDER BY id LIMIT ?");
|
|
33904
34141
|
if (pending.get(0, 1) === void 0)
|
|
@@ -33920,7 +34157,7 @@ var fillJoinKeys = /* @__PURE__ */ __name((database, { batch = 2e3 } = {}) => {
|
|
|
33920
34157
|
}
|
|
33921
34158
|
}, "fillJoinKeys");
|
|
33922
34159
|
|
|
33923
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34160
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.503.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e5d4ab9592406842b4a214ba16b749bd/node_modules/@wirecat/cli-core/dist/store/sqlite/open.js
|
|
33924
34161
|
var openSqlite = /* @__PURE__ */ __name(async (path, { readOnly = false } = {}) => {
|
|
33925
34162
|
const opened = "Bun" in globalThis ? await openUnderBun(path, readOnly) : await openUnderNode(path, readOnly);
|
|
33926
34163
|
try {
|
|
@@ -33933,8 +34170,8 @@ var openSqlite = /* @__PURE__ */ __name(async (path, { readOnly = false } = {})
|
|
|
33933
34170
|
}, "openSqlite");
|
|
33934
34171
|
var openUnderNode = /* @__PURE__ */ __name(async (path, readOnly) => {
|
|
33935
34172
|
quietSqliteWarning();
|
|
33936
|
-
const { drizzle } = await import("./node-
|
|
33937
|
-
const { cacheOverNodeSqlite, nodeClient } = await import("./node-sqlite-
|
|
34173
|
+
const { drizzle } = await import("./node-A3B2YRQI.js");
|
|
34174
|
+
const { cacheOverNodeSqlite, nodeClient } = await import("./node-sqlite-XRP5FUDY.js");
|
|
33938
34175
|
const client = await nodeClient(path, { readOnly });
|
|
33939
34176
|
try {
|
|
33940
34177
|
return { database: cacheOverNodeSqlite(client), orm: drizzle({ client }) };
|
|
@@ -33944,8 +34181,8 @@ var openUnderNode = /* @__PURE__ */ __name(async (path, readOnly) => {
|
|
|
33944
34181
|
}
|
|
33945
34182
|
}, "openUnderNode");
|
|
33946
34183
|
var openUnderBun = /* @__PURE__ */ __name(async (path, readOnly) => {
|
|
33947
|
-
const { bunClient, cacheOverBunSqlite } = await import("./bun-sqlite-
|
|
33948
|
-
const { drizzle } = await import("./bun-
|
|
34184
|
+
const { bunClient, cacheOverBunSqlite } = await import("./bun-sqlite-VVYKOY7S.js");
|
|
34185
|
+
const { drizzle } = await import("./bun-UEFRULAT.js");
|
|
33949
34186
|
const client = await bunClient(path, readOnly ? { readonly: true, create: false } : void 0);
|
|
33950
34187
|
try {
|
|
33951
34188
|
return { database: cacheOverBunSqlite(client), orm: drizzle({ client }) };
|
|
@@ -33955,7 +34192,7 @@ var openUnderBun = /* @__PURE__ */ __name(async (path, readOnly) => {
|
|
|
33955
34192
|
}
|
|
33956
34193
|
}, "openUnderBun");
|
|
33957
34194
|
|
|
33958
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34195
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.503.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e5d4ab9592406842b4a214ba16b749bd/node_modules/@wirecat/cli-core/dist/store/sqlite/read-compatibility.js
|
|
33959
34196
|
var assertReadCompatible = /* @__PURE__ */ __name((database, command) => {
|
|
33960
34197
|
const ours = MIGRATIONS.at(-1)?.version ?? 0;
|
|
33961
34198
|
if (!database.prepare("SELECT 1 FROM sqlite_master WHERE type='table' AND name='schema_migrations'").get())
|
|
@@ -33970,7 +34207,7 @@ var assertReadCompatible = /* @__PURE__ */ __name((database, command) => {
|
|
|
33970
34207
|
throw new CliError("configuration_error", `The store requires schema ${minCompatible}, but this tool supports ${ours}; ${refusalAdvice(storeClients(database), command, version)}`);
|
|
33971
34208
|
}, "assertReadCompatible");
|
|
33972
34209
|
|
|
33973
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34210
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.503.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e5d4ab9592406842b4a214ba16b749bd/node_modules/@wirecat/cli-core/dist/store/sqlite/open-store.js
|
|
33974
34211
|
var BACKFILL_ON_OPEN = 5e3;
|
|
33975
34212
|
var NOT_WRITABLE = /* @__PURE__ */ new Set(["EACCES", "EPERM", "EROFS"]);
|
|
33976
34213
|
var createWritable = /* @__PURE__ */ __name((file) => {
|
|
@@ -34026,13 +34263,13 @@ var openStoreContext = /* @__PURE__ */ __name(async ({ path, env, now: now2 = Da
|
|
|
34026
34263
|
}
|
|
34027
34264
|
}, "openStoreContext");
|
|
34028
34265
|
|
|
34029
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34266
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.503.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e5d4ab9592406842b4a214ba16b749bd/node_modules/@wirecat/cli-core/dist/store/project-transfer/plan.js
|
|
34030
34267
|
import { createHash as createHash17 } from "node:crypto";
|
|
34031
34268
|
|
|
34032
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34269
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.503.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e5d4ab9592406842b4a214ba16b749bd/node_modules/@wirecat/cli-core/dist/store/project-transfer/manifest.js
|
|
34033
34270
|
import { createHash as createHash16 } from "node:crypto";
|
|
34034
34271
|
|
|
34035
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34272
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.503.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e5d4ab9592406842b4a214ba16b749bd/node_modules/@wirecat/cli-core/dist/store/project-transfer/schema.js
|
|
34036
34273
|
var text3 = /* @__PURE__ */ __name((max) => pipe(string(), minLength(1), maxLength(max)), "text");
|
|
34037
34274
|
var ref = text3(2048);
|
|
34038
34275
|
var timestamp2 = pipe(number(), safeInteger(), minValue(0));
|
|
@@ -34098,7 +34335,7 @@ var projectAnnotationsSchema = strictObject({
|
|
|
34098
34335
|
}))
|
|
34099
34336
|
});
|
|
34100
34337
|
|
|
34101
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34338
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.503.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e5d4ab9592406842b4a214ba16b749bd/node_modules/@wirecat/cli-core/dist/store/project-transfer/manifest.js
|
|
34102
34339
|
var PROJECT_ANNOTATIONS_MAX_BYTES = 4 * 1024 * 1024;
|
|
34103
34340
|
var invalid5 = /* @__PURE__ */ __name((field3) => {
|
|
34104
34341
|
throw new CliError("validation_error", `invalid project annotations.${field3}`);
|
|
@@ -34231,7 +34468,7 @@ var projectAnnotationsFingerprint = /* @__PURE__ */ __name((json3) => {
|
|
|
34231
34468
|
return createHash16("sha256").update(JSON.stringify(normalized)).digest("hex");
|
|
34232
34469
|
}, "projectAnnotationsFingerprint");
|
|
34233
34470
|
|
|
34234
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34471
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.503.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e5d4ab9592406842b4a214ba16b749bd/node_modules/@wirecat/cli-core/dist/store/project-transfer/plan.js
|
|
34235
34472
|
var hash = pipe(string(), regex(/^[a-f0-9]{64}$/));
|
|
34236
34473
|
var ref2 = pipe(string(), minLength(1), maxLength(2048));
|
|
34237
34474
|
var targetSchema = strictObject({
|
|
@@ -34338,7 +34575,7 @@ var planBoundProjectAnnotations = /* @__PURE__ */ __name((manifest, manifest_fin
|
|
|
34338
34575
|
}, "planBoundProjectAnnotations");
|
|
34339
34576
|
var planProjectAnnotations = /* @__PURE__ */ __name((json3, target, bindings) => planBoundProjectAnnotations(decodeProjectAnnotations(json3), projectAnnotationsFingerprint(json3), target, bindings), "planProjectAnnotations");
|
|
34340
34577
|
|
|
34341
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34578
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.503.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e5d4ab9592406842b4a214ba16b749bd/node_modules/@wirecat/cli-core/dist/store/project-transfer/snapshot-model.js
|
|
34342
34579
|
import { createHash as createHash18 } from "node:crypto";
|
|
34343
34580
|
var text4 = /* @__PURE__ */ __name((max) => pipe(string(), minLength(1), maxLength(max)), "text");
|
|
34344
34581
|
var timestamp3 = pipe(number(), safeInteger(), minValue(0));
|
|
@@ -34432,7 +34669,7 @@ var projectAnnotationSnapshotFingerprint = /* @__PURE__ */ __name((json3) => {
|
|
|
34432
34669
|
})).digest("hex");
|
|
34433
34670
|
}, "projectAnnotationSnapshotFingerprint");
|
|
34434
34671
|
|
|
34435
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34672
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.503.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e5d4ab9592406842b4a214ba16b749bd/node_modules/@wirecat/cli-core/dist/store/project-transfer/request.js
|
|
34436
34673
|
var projectAnnotationRequest = /* @__PURE__ */ __name((request, restore = false) => {
|
|
34437
34674
|
if (!request || typeof request !== "object" || Array.isArray(request))
|
|
34438
34675
|
throw new CliError("validation_error", "project annotation request is required");
|
|
@@ -34449,7 +34686,7 @@ var projectAnnotationRequest = /* @__PURE__ */ __name((request, restore = false)
|
|
|
34449
34686
|
return { snapshot: snapshot2, projectId: Number(request.project.slice(8)) };
|
|
34450
34687
|
}, "projectAnnotationRequest");
|
|
34451
34688
|
|
|
34452
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34689
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.503.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e5d4ab9592406842b4a214ba16b749bd/node_modules/@wirecat/cli-core/dist/store/sqlite/project-transfer/budget.js
|
|
34453
34690
|
var SnapshotBudget = class {
|
|
34454
34691
|
static {
|
|
34455
34692
|
__name(this, "SnapshotBudget");
|
|
@@ -34475,13 +34712,13 @@ var SnapshotBudget = class {
|
|
|
34475
34712
|
}
|
|
34476
34713
|
};
|
|
34477
34714
|
|
|
34478
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34715
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.503.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e5d4ab9592406842b4a214ba16b749bd/node_modules/@wirecat/cli-core/dist/store/sqlite/project-transfer/preview.js
|
|
34479
34716
|
import { createHash as createHash20 } from "node:crypto";
|
|
34480
34717
|
|
|
34481
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34718
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.503.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e5d4ab9592406842b4a214ba16b749bd/node_modules/@wirecat/cli-core/dist/store/project-transfer/snapshot-plan.js
|
|
34482
34719
|
var planProjectAnnotationSnapshot = /* @__PURE__ */ __name((json3, target, bindings) => planBoundProjectAnnotations(decodeProjectAnnotationSnapshot(json3), projectAnnotationSnapshotFingerprint(json3), target, bindings), "planProjectAnnotationSnapshot");
|
|
34483
34720
|
|
|
34484
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34721
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.503.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e5d4ab9592406842b4a214ba16b749bd/node_modules/@wirecat/cli-core/dist/store/sqlite/project-transfer/sources.js
|
|
34485
34722
|
import { createHash as createHash19 } from "node:crypto";
|
|
34486
34723
|
var invalid7 = /* @__PURE__ */ __name(() => {
|
|
34487
34724
|
throw new CliError("configuration_error", "project snapshot has an unavailable or unsupported dependency");
|
|
@@ -34624,7 +34861,7 @@ var ProjectSnapshotSources = class {
|
|
|
34624
34861
|
}
|
|
34625
34862
|
};
|
|
34626
34863
|
|
|
34627
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34864
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.503.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e5d4ab9592406842b4a214ba16b749bd/node_modules/@wirecat/cli-core/dist/store/sqlite/project-transfer/snapshot.js
|
|
34628
34865
|
var unsupported = /* @__PURE__ */ __name(() => {
|
|
34629
34866
|
throw new CliError("configuration_error", "project snapshot has unsupported metadata, deletion or account scope");
|
|
34630
34867
|
}, "unsupported");
|
|
@@ -34795,7 +35032,7 @@ var projectAnnotationSnapshot = /* @__PURE__ */ __name((database, projectId, bud
|
|
|
34795
35032
|
return { snapshot: snapshot2, read_bytes: budget.bytes, records: budget.records };
|
|
34796
35033
|
}), "projectAnnotationSnapshot");
|
|
34797
35034
|
|
|
34798
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
35035
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.503.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e5d4ab9592406842b4a214ba16b749bd/node_modules/@wirecat/cli-core/dist/store/sqlite/project-transfer/preview.js
|
|
34799
35036
|
var previewAnnotationSnapshot = /* @__PURE__ */ __name((database, projectId, manifest, bindings, budget) => read(database, () => {
|
|
34800
35037
|
const current = projectAnnotationSnapshot(database, projectId, budget).snapshot;
|
|
34801
35038
|
const sources = new ProjectSnapshotSources(database, budget);
|
|
@@ -34857,7 +35094,7 @@ var previewAnnotationSnapshot = /* @__PURE__ */ __name((database, projectId, man
|
|
|
34857
35094
|
};
|
|
34858
35095
|
}), "previewAnnotationSnapshot");
|
|
34859
35096
|
|
|
34860
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
35097
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.503.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e5d4ab9592406842b4a214ba16b749bd/node_modules/@wirecat/cli-core/dist/store/sqlite/project-transfer/records.js
|
|
34861
35098
|
var restoreAnnotationRecords = /* @__PURE__ */ __name((database, projectId, snapshot2, bindings) => {
|
|
34862
35099
|
const mappings = { ...bindings };
|
|
34863
35100
|
const resolve = /* @__PURE__ */ __name((ref3) => {
|
|
@@ -34899,7 +35136,7 @@ var restoreAnnotationRecords = /* @__PURE__ */ __name((database, projectId, snap
|
|
|
34899
35136
|
return mappings;
|
|
34900
35137
|
}, "restoreAnnotationRecords");
|
|
34901
35138
|
|
|
34902
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
35139
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.503.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e5d4ab9592406842b4a214ba16b749bd/node_modules/@wirecat/cli-core/dist/store/sqlite/project-transfer/store.js
|
|
34903
35140
|
var projectAnnotationStoreOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
34904
35141
|
async preview(request) {
|
|
34905
35142
|
const { snapshot: snapshot2, projectId } = projectAnnotationRequest(request);
|
|
@@ -34929,7 +35166,7 @@ var projectAnnotationStoreOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
|
34929
35166
|
}
|
|
34930
35167
|
}), "projectAnnotationStoreOver");
|
|
34931
35168
|
|
|
34932
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
35169
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.503.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e5d4ab9592406842b4a214ba16b749bd/node_modules/@wirecat/cli-core/dist/store/sqlite/ranges.js
|
|
34933
35170
|
var markRange = /* @__PURE__ */ __name(({ orm, now: now2 }, chatKey, from2, to) => {
|
|
34934
35171
|
const touching = and(eq(syncRanges.chatId, chatKey), lte(syncRanges.fromKey, to + 1), gte(syncRanges.toKey, from2 - 1));
|
|
34935
35172
|
let merged = { from: from2, to };
|
|
@@ -34942,7 +35179,7 @@ var markRange = /* @__PURE__ */ __name(({ orm, now: now2 }, chatKey, from2, to)
|
|
|
34942
35179
|
}, "markRange");
|
|
34943
35180
|
var ranges = /* @__PURE__ */ __name(({ orm }, chatKey) => orm.select({ from: syncRanges.fromKey, to: syncRanges.toKey }).from(syncRanges).where(eq(syncRanges.chatId, chatKey)).orderBy(syncRanges.fromKey).all(), "ranges");
|
|
34944
35181
|
|
|
34945
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
35182
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.503.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e5d4ab9592406842b4a214ba16b749bd/node_modules/@wirecat/cli-core/dist/store/sqlite/task-rule-stops.js
|
|
34946
35183
|
var keyOf4 = /* @__PURE__ */ __name(({ provider, account }) => `task_rules_until:${provider}:${account}`, "keyOf");
|
|
34947
35184
|
var taskRulesStop = /* @__PURE__ */ __name((database, account) => {
|
|
34948
35185
|
const row2 = database.prepare("SELECT value FROM store_settings WHERE key = ?").get(keyOf4(account));
|
|
@@ -34952,7 +35189,7 @@ var setTaskRulesStop = /* @__PURE__ */ __name((database, account, until, now2) =
|
|
|
34952
35189
|
database.prepare("INSERT INTO store_settings (key, value, at) VALUES (?, ?, ?) ON CONFLICT (key) DO UPDATE SET value = excluded.value, at = excluded.at").run(keyOf4(account), JSON.stringify(until), now2);
|
|
34953
35190
|
}, "setTaskRulesStop");
|
|
34954
35191
|
|
|
34955
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
35192
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.503.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e5d4ab9592406842b4a214ba16b749bd/node_modules/@wirecat/cli-core/dist/store/sync.js
|
|
34956
35193
|
var syncStoreOver = /* @__PURE__ */ __name((context) => {
|
|
34957
35194
|
const { database } = context;
|
|
34958
35195
|
const { accountPk: accountPk2, findAccountPk: findAccountPk2, chatKeyOf, chatPkFor: chatPkFor2, identityPk: identityPk2, writeMembers: writeMembers2, writeState: writeState2 } = keysOver(context);
|
|
@@ -35008,7 +35245,7 @@ var syncStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
35008
35245
|
};
|
|
35009
35246
|
}, "syncStoreOver");
|
|
35010
35247
|
|
|
35011
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
35248
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.503.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e5d4ab9592406842b4a214ba16b749bd/node_modules/@wirecat/cli-core/dist/store/tags.js
|
|
35012
35249
|
var tagsStoreOver = /* @__PURE__ */ __name((context) => {
|
|
35013
35250
|
const { database } = context;
|
|
35014
35251
|
return {
|
|
@@ -35030,7 +35267,7 @@ var tagsStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
35030
35267
|
};
|
|
35031
35268
|
}, "tagsStoreOver");
|
|
35032
35269
|
|
|
35033
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
35270
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.503.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e5d4ab9592406842b4a214ba16b749bd/node_modules/@wirecat/cli-core/dist/store/sqlite/image-chunks.js
|
|
35034
35271
|
var IS_IMAGE = sql`(a.kind = 'photo' OR a.mime LIKE 'image/%')`;
|
|
35035
35272
|
var neighbours = /* @__PURE__ */ __name(({ orm }, chatKey, messagePk, sentAt, { messages: messages2, withinMs }, side) => orm.all(sql`SELECT sender_name AS sender, text, sent_at AS sentAt FROM messages
|
|
35036
35273
|
WHERE chat_id = ${chatKey} AND deleted_at IS NULL AND trim(text) <> '' AND id <> ${messagePk}
|
|
@@ -35157,7 +35394,7 @@ var savePictureChunks = /* @__PURE__ */ __name(({ orm, now: now2, database }, ac
|
|
|
35157
35394
|
dropUnusedVectors(database, released.map(({ hash: hash2 }) => hash2));
|
|
35158
35395
|
}, "savePictureChunks");
|
|
35159
35396
|
|
|
35160
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
35397
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.503.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e5d4ab9592406842b4a214ba16b749bd/node_modules/@wirecat/cli-core/dist/store/sqlite/message-chunks.js
|
|
35161
35398
|
var messagesToEmbed = /* @__PURE__ */ __name(({ orm }, accountPk2, { chatKey, model, after: after2, limit }) => orm.all(sql`SELECT m.id AS messagePk, m.text, m.sent_at AS sentAt, k.content_hash AS hash,
|
|
35162
35399
|
EXISTS (SELECT 1 FROM embeddings v WHERE v.model = ${model} AND v.content_hash = k.content_hash) AS embedded
|
|
35163
35400
|
FROM messages m
|
|
@@ -35240,7 +35477,7 @@ var nearestMessages = /* @__PURE__ */ __name((context, accountPk2, { limit, quer
|
|
|
35240
35477
|
return plain2(best(found2));
|
|
35241
35478
|
}, "nearestMessages");
|
|
35242
35479
|
|
|
35243
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
35480
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.503.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e5d4ab9592406842b4a214ba16b749bd/node_modules/@wirecat/cli-core/dist/store/vectors.js
|
|
35244
35481
|
var accountVectorsOver = /* @__PURE__ */ __name((context, mail) => {
|
|
35245
35482
|
const { database } = context;
|
|
35246
35483
|
const { findAccountPk: findAccountPk2, findChatPk: findChatPk2, chatKeyOf } = keysOver(context);
|
|
@@ -35494,7 +35731,7 @@ var vectorsStoreOver = /* @__PURE__ */ __name((context, keyed) => ({
|
|
|
35494
35731
|
embeddedHashes: /* @__PURE__ */ __name(async (model, hashes) => embeddedHashes(context, model, hashes), "embeddedHashes")
|
|
35495
35732
|
}), "vectorsStoreOver");
|
|
35496
35733
|
|
|
35497
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
35734
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.503.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e5d4ab9592406842b4a214ba16b749bd/node_modules/@wirecat/cli-core/dist/store/sqlite/store-tables.js
|
|
35498
35735
|
import { existsSync, readFileSync as readFileSync4 } from "node:fs";
|
|
35499
35736
|
import { dirname as dirname2, join as join2 } from "node:path";
|
|
35500
35737
|
var BOOKKEEPING = ["schema_migrations", "store_settings"];
|
|
@@ -35582,10 +35819,10 @@ var lastBackup = /* @__PURE__ */ __name((path) => {
|
|
|
35582
35819
|
}
|
|
35583
35820
|
}, "lastBackup");
|
|
35584
35821
|
|
|
35585
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
35822
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.503.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e5d4ab9592406842b4a214ba16b749bd/node_modules/@wirecat/cli-core/dist/store/providers.js
|
|
35586
35823
|
var registerProvider2 = /* @__PURE__ */ __name((store, entry2) => store.accounts.registerProvider(entry2), "registerProvider");
|
|
35587
35824
|
|
|
35588
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
35825
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.503.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e5d4ab9592406842b4a214ba16b749bd/node_modules/@wirecat/cli-core/dist/store/sqlite/store-contents.js
|
|
35589
35826
|
var COUNTED_TABLES = [
|
|
35590
35827
|
"accounts",
|
|
35591
35828
|
"chats",
|
|
@@ -35670,7 +35907,7 @@ var storeContents = /* @__PURE__ */ __name((database) => {
|
|
|
35670
35907
|
};
|
|
35671
35908
|
}, "storeContents");
|
|
35672
35909
|
|
|
35673
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
35910
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.503.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e5d4ab9592406842b4a214ba16b749bd/node_modules/@wirecat/cli-core/dist/store/store.js
|
|
35674
35911
|
var openStore = /* @__PURE__ */ __name(async (options = {}) => {
|
|
35675
35912
|
const context = await openStoreContext(options);
|
|
35676
35913
|
try {
|
|
@@ -35693,10 +35930,10 @@ var areaOf = /* @__PURE__ */ __name((keyed, whole) => once3(() => {
|
|
|
35693
35930
|
}), "areaOf");
|
|
35694
35931
|
var storeOver = /* @__PURE__ */ __name((context) => {
|
|
35695
35932
|
const { database } = context;
|
|
35696
|
-
const
|
|
35933
|
+
const stemmerFor2 = stemmerCache();
|
|
35697
35934
|
const pruneLogsWhenDue = logPruner(database, context.now);
|
|
35698
35935
|
const own = /* @__PURE__ */ __name((keyed) => ({ ...keyed }), "own");
|
|
35699
|
-
const mail = once3(() => mailStoreOver(context,
|
|
35936
|
+
const mail = once3(() => mailStoreOver(context, stemmerFor2));
|
|
35700
35937
|
const areas = {
|
|
35701
35938
|
accounts: areaOf(() => accountAccountsOver(context), (keyed) => accountsStoreOver(context, keyed)),
|
|
35702
35939
|
chats: areaOf(() => chatsStoreOver(context), own),
|
|
@@ -35713,10 +35950,10 @@ var storeOver = /* @__PURE__ */ __name((context) => {
|
|
|
35713
35950
|
};
|
|
35714
35951
|
const contextEvidence = once3(() => contextEvidenceOver(context));
|
|
35715
35952
|
const projectAnnotations = once3(() => projectAnnotationStoreOver(context));
|
|
35716
|
-
const contextIndex = once3(() => contextIndexOver(context,
|
|
35953
|
+
const contextIndex = once3(() => contextIndexOver(context, stemmerFor2));
|
|
35717
35954
|
const contextRecords = once3(() => contextRecordsOver(context));
|
|
35718
35955
|
const searches2 = once3(() => searchesStoreOver(context));
|
|
35719
|
-
const queries = once3(() => queriesStoreOver(context,
|
|
35956
|
+
const queries = once3(() => queriesStoreOver(context, stemmerFor2));
|
|
35720
35957
|
const searchIndex2 = once3(() => searchIndexStoreOver(context));
|
|
35721
35958
|
const botUpdates2 = once3(() => botUpdateStoreOver(context, pruneLogsWhenDue));
|
|
35722
35959
|
const involvements2 = once3(() => involvementStoreOver(context));
|