@wirecat/drive-cli 0.50.0 → 0.52.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin/drive.js +2 -2
- package/dist/bundle/{all-profiles-WQTVOCIS.js → all-profiles-CYW6XBBS.js} +8 -8
- package/dist/bundle/{anthropic-YCA2AWIJ.js → anthropic-KW6KU36Y.js} +5 -5
- package/dist/bundle/{app-server-ZQOYUQJH.js → app-server-TCJZ333E.js} +53 -52
- package/dist/bundle/{bun-5NFIDHGM.js → bun-7SYKSCLA.js} +2 -2
- package/dist/bundle/{bun-sqlite-OAQE4M2E.js → bun-sqlite-RI7DR6RZ.js} +4 -4
- package/dist/bundle/{chunk-KZEOWOZV.js → chunk-234MHU76.js} +7 -7
- package/dist/bundle/{chunk-IGG4RBIZ.js → chunk-2623YE5I.js} +109 -98
- package/dist/bundle/{chunk-POD2GHQB.js → chunk-2AUXBJRX.js} +19 -19
- package/dist/bundle/{chunk-KEQ35HQQ.js → chunk-2UIMEMWU.js} +3 -3
- package/dist/bundle/{chunk-LNWRRK2H.js → chunk-33NVQGUY.js} +6 -6
- package/dist/bundle/{chunk-ZXD2I5ZQ.js → chunk-43QVYW3K.js} +49 -49
- package/dist/bundle/{chunk-BUALWXBT.js → chunk-4A2PIGC6.js} +1 -1
- package/dist/bundle/{chunk-3HNUH632.js → chunk-4CPLOMRK.js} +6 -6
- package/dist/bundle/{chunk-E656DAZT.js → chunk-4Z6TCU5T.js} +1 -1
- package/dist/bundle/{chunk-INVF3GXW.js → chunk-54O62JWP.js} +10 -10
- package/dist/bundle/{chunk-JA2YY7D4.js → chunk-5PLJKSG4.js} +7 -7
- package/dist/bundle/{chunk-XEETGCOC.js → chunk-6DHQTUB2.js} +1 -1
- package/dist/bundle/{chunk-ZKGYW63J.js → chunk-725OHXKR.js} +9 -9
- package/dist/bundle/chunk-7SH4JHYW.js +379 -0
- package/dist/bundle/{chunk-AO3NCZNT.js → chunk-7XKAVMCF.js} +8 -8
- package/dist/bundle/{chunk-PNUS224S.js → chunk-7YMDL4JQ.js} +8 -6
- package/dist/bundle/{chunk-CEUEXMIR.js → chunk-A4UNTWAX.js} +31 -27
- package/dist/bundle/{chunk-KYMGVMOS.js → chunk-ALJWBGD5.js} +1 -1
- package/dist/bundle/{chunk-QY3LK3OT.js → chunk-BSSCTWWK.js} +12 -12
- package/dist/bundle/{chunk-CCEVICWU.js → chunk-C6Z25IBJ.js} +49 -24
- package/dist/bundle/{chunk-ZJBRKR42.js → chunk-CB7SBYLO.js} +27 -27
- package/dist/bundle/{chunk-4VLUX3V5.js → chunk-CITFEQ6S.js} +1 -1
- package/dist/bundle/{chunk-Y73IZWRI.js → chunk-CKBHR7QO.js} +1 -1
- package/dist/bundle/{chunk-M2D4FXKY.js → chunk-CM7GAXGD.js} +5 -5
- package/dist/bundle/{chunk-OKSS7YUN.js → chunk-DLAFGSTN.js} +1 -1
- package/dist/bundle/{chunk-T7UZHKAS.js → chunk-DO4PDQY5.js} +2 -2
- package/dist/bundle/{chunk-P3T2SZW2.js → chunk-DW46P2DY.js} +1 -1
- package/dist/bundle/{chunk-Q3VG3UYV.js → chunk-F7UUZATI.js} +11 -11
- package/dist/bundle/{chunk-7SYSC7KX.js → chunk-FCJAHD4R.js} +2 -2
- package/dist/bundle/{chunk-QBECV7NO.js → chunk-FDWYPONW.js} +46 -34
- package/dist/bundle/{chunk-4SSUKRO4.js → chunk-FG4XXZZE.js} +2 -2
- package/dist/bundle/{chunk-DTHWL5YU.js → chunk-FJW3DDCF.js} +5 -5
- package/dist/bundle/{chunk-JHBX53SK.js → chunk-G6QF5KWF.js} +35 -35
- package/dist/bundle/{chunk-4J7UGHPK.js → chunk-G7DCVJ4F.js} +5 -5
- package/dist/bundle/{chunk-ZP735UUT.js → chunk-GR5GGZKH.js} +3 -3
- package/dist/bundle/{chunk-OL22OOIW.js → chunk-GVCN3GLZ.js} +16 -4
- package/dist/bundle/{chunk-2M5XEGVE.js → chunk-H47W2J6S.js} +638 -809
- package/dist/bundle/{chunk-HGWMX7BM.js → chunk-HQVJK5E7.js} +44 -22
- package/dist/bundle/{chunk-M6FQOGUW.js → chunk-HX7Y2ASG.js} +351 -282
- package/dist/bundle/{chunk-FSAM4Y2S.js → chunk-I7UH5CTA.js} +8 -8
- package/dist/bundle/{chunk-FABKIQ24.js → chunk-IDUNJCFO.js} +2 -2
- package/dist/bundle/{chunk-652YTDT5.js → chunk-IWFBAWZK.js} +15 -15
- package/dist/bundle/{chunk-3XX52F42.js → chunk-JEOYFKUK.js} +2 -2
- package/dist/bundle/{chunk-RTIMGPLN.js → chunk-KYVXMEBC.js} +3 -3
- package/dist/bundle/{chunk-IFM2APQB.js → chunk-LJAX6YCF.js} +2 -2
- package/dist/bundle/{chunk-R7XMCREL.js → chunk-LONV6HIK.js} +20 -20
- package/dist/bundle/{chunk-G75FZQAZ.js → chunk-NHBUTCNR.js} +10 -10
- package/dist/bundle/{chunk-5ZJHQ4TN.js → chunk-NPSZPUK6.js} +2 -2
- package/dist/bundle/{chunk-53UWCVSU.js → chunk-NSIFQ5OP.js} +1 -1
- package/dist/bundle/{chunk-HURI56SB.js → chunk-O6IOL6RX.js} +21 -21
- package/dist/bundle/{chunk-IA6LNKCF.js → chunk-PAXKALHV.js} +5 -5
- package/dist/bundle/{chunk-Z54E5LKF.js → chunk-PDGECM5D.js} +7 -7
- package/dist/bundle/{chunk-5OMLYNYB.js → chunk-PEOCBV2Z.js} +8 -8
- package/dist/bundle/{chunk-TATRMMOG.js → chunk-PQJYM5ES.js} +3 -3
- package/dist/bundle/{chunk-XGJUEH5C.js → chunk-PQYVPCJ2.js} +26 -26
- package/dist/bundle/{chunk-3CQNJKJT.js → chunk-PSNHPFSK.js} +1 -1
- package/dist/bundle/{chunk-6DDXB5WB.js → chunk-Q765VPZY.js} +2 -2
- package/dist/bundle/{chunk-YOABRW2M.js → chunk-R276546S.js} +1 -1
- package/dist/bundle/{chunk-QSDXVUJG.js → chunk-RNSP57TC.js} +4 -4
- package/dist/bundle/{chunk-VAETCXRI.js → chunk-UC22Q5KU.js} +11 -11
- package/dist/bundle/{chunk-EXYEDKTX.js → chunk-UR32UWTQ.js} +2 -2
- package/dist/bundle/{chunk-YROVFHPJ.js → chunk-VJZST5RD.js} +2 -2
- package/dist/bundle/{chunk-MMOG7ZVF.js → chunk-VSOLLTYT.js} +2 -2
- package/dist/bundle/{chunk-IUZ4PT2V.js → chunk-VZ2I62HN.js} +2 -2
- package/dist/bundle/{chunk-CTIQ77AB.js → chunk-W7IK7E4B.js} +17 -17
- package/dist/bundle/{chunk-C4PNAHI4.js → chunk-WBTVGFXI.js} +11 -11
- package/dist/bundle/{chunk-P6VN5UB4.js → chunk-WLFUBNFX.js} +4 -4
- package/dist/bundle/{chunk-Q27HCATD.js → chunk-WQJBAWQP.js} +534 -348
- package/dist/bundle/{chunk-4OLWMHS6.js → chunk-WQRGA75U.js} +15 -3
- package/dist/bundle/{chunk-5WN7JHQE.js → chunk-WUX7AUOQ.js} +26 -26
- package/dist/bundle/{chunk-VAK2Q2XG.js → chunk-X6ID5EAR.js} +16 -16
- package/dist/bundle/{chunk-5Z63NTC7.js → chunk-XOLQSCMF.js} +6 -6
- package/dist/bundle/{chunk-EY4CUQW2.js → chunk-YKZ4IPLB.js} +26 -9
- package/dist/bundle/{chunk-24TOKSZE.js → chunk-YNFELLNQ.js} +2 -2
- package/dist/bundle/{chunk-JSMPSOEM.js → chunk-YVPHJHIL.js} +3 -3
- package/dist/bundle/{chunk-QNLD7Y6Z.js → chunk-Z47LOJUS.js} +7 -7
- package/dist/bundle/{chunk-NHRJW3PH.js → chunk-ZDLIO76S.js} +2 -2
- package/dist/bundle/{chunk-OQEBGY74.js → chunk-ZNZUZGSV.js} +54 -47
- package/dist/bundle/{chunk-6E4PFCQ4.js → chunk-ZSXRDF6I.js} +1 -1
- package/dist/bundle/{chunk-UVPKSZSC.js → chunk-ZWSG7OCA.js} +4 -4
- package/dist/bundle/command-contract-I2YB5IXI.js +38 -0
- package/dist/bundle/{decode-YZRTP54O.js → decode-EDN2ARXZ.js} +19 -17
- package/dist/bundle/drive.js +7 -7
- package/dist/bundle/{echarts-C6HUK2FL.js → echarts-GXY34GHA.js} +2 -2
- package/dist/bundle/{embed-QRQ7ITFC.js → embed-3GSQIQXE.js} +5 -5
- package/dist/bundle/{embedder-EZDB3JPA.js → embedder-6ULWRG3R.js} +8 -8
- package/dist/bundle/{entry-4WQQKSYG.js → entry-IPRJLFHO.js} +6 -6
- package/dist/bundle/failure-4CVEVY45.js +37 -0
- package/dist/bundle/{first-run-ZAS4OV3T.js → first-run-FGHGWHC2.js} +9 -9
- package/dist/bundle/first-screen-M62KTPZG.js +36 -0
- package/dist/bundle/{google-KNILTIDW.js → google-BD3ZNFVJ.js} +9 -9
- package/dist/bundle/google-api-BDUWZMRV.js +83 -0
- package/dist/bundle/{identity-VBCGUXT5.js → identity-QLBSASO5.js} +2 -2
- package/dist/bundle/{instructions-II4M2WL3.js → instructions-K5BEQM4C.js} +1 -1
- package/dist/bundle/{login-4JACQVMD.js → login-VNZKRSAD.js} +65 -64
- package/dist/bundle/{mcp-6ZIAWU3N.js → mcp-5SNSMI2M.js} +82 -81
- package/dist/bundle/mcp-JZSYPQA4.js +96 -0
- package/dist/bundle/{mcp-ZYZ4DFW2.js → mcp-WSGVVZWI.js} +2 -2
- package/dist/bundle/{node-LIN7L4VQ.js → node-ZYWB7IET.js} +2 -2
- package/dist/bundle/{node-sqlite-VAH4KZN3.js → node-sqlite-J3OODPYK.js} +4 -4
- package/dist/bundle/{oauth-QUE3VCTU.js → oauth-L4VTCBLF.js} +6 -6
- package/dist/bundle/{open-DQ3EVYPB.js → open-SGUN7ZVF.js} +3 -3
- package/dist/bundle/openai-RLVISEDH.js +251 -0
- package/dist/bundle/{process-46XDWPVW.js → process-ZXO2MWRJ.js} +1 -1
- package/dist/bundle/{program-X3CZ4XDN.js → program-6S5EH7BS.js} +105 -103
- package/dist/bundle/{prompt-SAZYCZV3.js → prompt-AUWTBLO7.js} +4 -4
- package/dist/bundle/{reasons-366PI7OV.js → reasons-M5AKCNCU.js} +3 -3
- package/dist/bundle/{recognize-SSBOHOTW.js → recognize-ORX2UBQW.js} +5 -3
- package/dist/bundle/{remote-EL3FWCQE.js → remote-AGIJY73X.js} +6 -6
- package/dist/bundle/{rerank-RPIQRJIW.js → rerank-R6PE44M5.js} +6 -6
- package/dist/bundle/{serve-AX44DIKK.js → serve-VOBAQHAQ.js} +8 -8
- package/dist/bundle/server-24PS4M7U.js +70 -0
- package/dist/bundle/server-G6HFZ2CK.js +57 -0
- package/dist/bundle/{services-K4UOEMQD.js → services-HZFTTZSF.js} +35 -28
- package/dist/bundle/{sqlite-runtime-N7N3EYGH.js → sqlite-runtime-DTGPR2T2.js} +4 -4
- package/dist/bundle/{state-C3S5FD7V.js → state-WG3JKJM3.js} +5 -5
- package/dist/bundle/{store-4N3NBUGX.js → store-33VHIMEO.js} +14 -14
- package/dist/bundle/{store-QV4ZNEQ3.js → store-EV72MT5U.js} +16 -16
- package/dist/bundle/store-maintenance-command-ZTUEI4EC.js +58 -0
- package/dist/bundle/tokens-XDQXUFDQ.js +104 -0
- package/dist/commands/search.js +1 -1
- package/dist/commands/search.js.map +1 -1
- package/dist/contract-overrides.js +1 -1
- package/dist/contract-overrides.js.map +1 -1
- package/dist/knowledge-query.d.ts +1 -1
- package/dist/store.d.ts.map +1 -1
- package/dist/store.js +1 -0
- package/dist/store.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/command-contract-TAWVO2G3.js +0 -38
- package/dist/bundle/failure-EEJGMWEP.js +0 -37
- package/dist/bundle/first-screen-6ICWD2N3.js +0 -36
- package/dist/bundle/google-api-CZACYX5T.js +0 -82
- package/dist/bundle/mcp-2BR2EX7L.js +0 -95
- package/dist/bundle/server-DCJIGUW2.js +0 -56
- package/dist/bundle/server-WWQSQBFT.js +0 -69
- package/dist/bundle/store-maintenance-command-QL4AECBD.js +0 -57
- package/dist/bundle/tokens-Y7HCOXOA.js +0 -103
- /package/dist/bundle/{chunk-2WNDZFGG.js → chunk-62EDJKGP.js} +0 -0
- /package/dist/bundle/{chunk-VDZZ46RT.js → chunk-FQRJWVEB.js} +0 -0
|
@@ -2,7 +2,7 @@ import { createRequire as __bundleRequire } from "node:module";
|
|
|
2
2
|
const require = __bundleRequire(import.meta.url);
|
|
3
3
|
import {
|
|
4
4
|
MAX_TEXT_CHARS
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-JEOYFKUK.js";
|
|
6
6
|
import {
|
|
7
7
|
COUNTER_FIELDS,
|
|
8
8
|
DOCUMENT_ACCOUNT_PROVIDERS,
|
|
@@ -34,7 +34,7 @@ import {
|
|
|
34
34
|
rankingWords,
|
|
35
35
|
useStoredProviders,
|
|
36
36
|
validCounter
|
|
37
|
-
} from "./chunk-
|
|
37
|
+
} from "./chunk-234MHU76.js";
|
|
38
38
|
import {
|
|
39
39
|
FACT_STATUSES,
|
|
40
40
|
FACT_TYPES,
|
|
@@ -51,7 +51,7 @@ import {
|
|
|
51
51
|
WORK_TASK_TYPES,
|
|
52
52
|
linkKind,
|
|
53
53
|
matches
|
|
54
|
-
} from "./chunk-
|
|
54
|
+
} from "./chunk-PDGECM5D.js";
|
|
55
55
|
import {
|
|
56
56
|
CHAT_MESSAGES_READ,
|
|
57
57
|
MEETING_FINDINGS_KIND,
|
|
@@ -80,7 +80,7 @@ import {
|
|
|
80
80
|
validateMeetingPreparationContext,
|
|
81
81
|
validateMeetingRelatedHistory,
|
|
82
82
|
validateMeetingSeriesHistory
|
|
83
|
-
} from "./chunk-
|
|
83
|
+
} from "./chunk-ZNZUZGSV.js";
|
|
84
84
|
import {
|
|
85
85
|
QUERY_LIMITS,
|
|
86
86
|
dateRange,
|
|
@@ -91,7 +91,7 @@ import {
|
|
|
91
91
|
validateQuery,
|
|
92
92
|
walkQuery,
|
|
93
93
|
zonedMoment
|
|
94
|
-
} from "./chunk-
|
|
94
|
+
} from "./chunk-NHBUTCNR.js";
|
|
95
95
|
import {
|
|
96
96
|
DEFAULT_STEMMERS,
|
|
97
97
|
DEFAULT_STEMMERS_VERSION,
|
|
@@ -104,24 +104,24 @@ import {
|
|
|
104
104
|
fold,
|
|
105
105
|
normalize,
|
|
106
106
|
parseStemmers
|
|
107
|
-
} from "./chunk-
|
|
107
|
+
} from "./chunk-7XKAVMCF.js";
|
|
108
108
|
import {
|
|
109
109
|
DEFAULT_TASK_CATEGORIES,
|
|
110
110
|
sharedConfigPath,
|
|
111
111
|
storedTaskCategories,
|
|
112
112
|
taskCategoriesReader
|
|
113
|
-
} from "./chunk-
|
|
113
|
+
} from "./chunk-XOLQSCMF.js";
|
|
114
114
|
import {
|
|
115
115
|
storePath
|
|
116
|
-
} from "./chunk-
|
|
116
|
+
} from "./chunk-VJZST5RD.js";
|
|
117
117
|
import {
|
|
118
118
|
PRAGMAS,
|
|
119
119
|
quietSqliteWarning,
|
|
120
120
|
storeCapable
|
|
121
|
-
} from "./chunk-
|
|
121
|
+
} from "./chunk-33NVQGUY.js";
|
|
122
122
|
import {
|
|
123
123
|
singleLine
|
|
124
|
-
} from "./chunk-
|
|
124
|
+
} from "./chunk-HQVJK5E7.js";
|
|
125
125
|
import {
|
|
126
126
|
CliError,
|
|
127
127
|
array,
|
|
@@ -139,7 +139,7 @@ import {
|
|
|
139
139
|
safeParse,
|
|
140
140
|
strictObject,
|
|
141
141
|
string
|
|
142
|
-
} from "./chunk-
|
|
142
|
+
} from "./chunk-YKZ4IPLB.js";
|
|
143
143
|
import {
|
|
144
144
|
resolveFrom
|
|
145
145
|
} from "./chunk-Y5E2WNWB.js";
|
|
@@ -167,12 +167,12 @@ import {
|
|
|
167
167
|
sql,
|
|
168
168
|
sqliteTable,
|
|
169
169
|
text
|
|
170
|
-
} from "./chunk-
|
|
170
|
+
} from "./chunk-ALJWBGD5.js";
|
|
171
171
|
import {
|
|
172
172
|
__name
|
|
173
173
|
} from "./chunk-ZVVMGPBJ.js";
|
|
174
174
|
|
|
175
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
175
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/store/account-store.js
|
|
176
176
|
var bindArea = /* @__PURE__ */ __name(({ keyed, whole }, account) => {
|
|
177
177
|
const methods = whole;
|
|
178
178
|
return Object.fromEntries(Object.keys(keyed).map((name) => [
|
|
@@ -300,7 +300,7 @@ var bindAccount = /* @__PURE__ */ __name((store, account, areas, owners) => {
|
|
|
300
300
|
};
|
|
301
301
|
}, "bindAccount");
|
|
302
302
|
|
|
303
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
303
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/search/query.js
|
|
304
304
|
var isBotProvider = /* @__PURE__ */ __name((provider) => provider.endsWith("-bot"), "isBotProvider");
|
|
305
305
|
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");
|
|
306
306
|
var fail = /* @__PURE__ */ __name((message2) => {
|
|
@@ -323,7 +323,7 @@ var sourceOf = /* @__PURE__ */ __name((name, value, providers2) => {
|
|
|
323
323
|
return fail(`${name} takes ${[...sources, "messages", "mail"].join(", ")} \u2014 not "${value}"`);
|
|
324
324
|
}, "sourceOf");
|
|
325
325
|
|
|
326
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
326
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/search/account-list.js
|
|
327
327
|
var ACCOUNT_GROUPS = "accountGroups";
|
|
328
328
|
var ACCOUNT_GROUPS_SETTING = "account_groups";
|
|
329
329
|
var GROUP_NAME = /^[a-z0-9][a-z0-9_-]*$/i;
|
|
@@ -510,7 +510,7 @@ var fitting = /* @__PURE__ */ __name((entries, kinds2, what, reasonOf = (kind3)
|
|
|
510
510
|
return { accounts: [...chosen.values()], skipped };
|
|
511
511
|
}, "fitting");
|
|
512
512
|
|
|
513
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
513
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/store/sqlite/drizzle/core.js
|
|
514
514
|
var IndexBuilderOn = class {
|
|
515
515
|
static {
|
|
516
516
|
__name(this, "IndexBuilderOn");
|
|
@@ -705,7 +705,7 @@ function alias(table, alias2) {
|
|
|
705
705
|
}
|
|
706
706
|
__name(alias, "alias");
|
|
707
707
|
|
|
708
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
708
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/store/sqlite/entity-types.js
|
|
709
709
|
var ENTITY_TABLES = {
|
|
710
710
|
account: "accounts",
|
|
711
711
|
attachment: "attachments",
|
|
@@ -745,7 +745,7 @@ var orphanPointers = /* @__PURE__ */ __name((database) => pointerPairs(database)
|
|
|
745
745
|
return { table, pointer, type, count, known: known2 };
|
|
746
746
|
}).filter(({ count }) => count > 0)), "orphanPointers");
|
|
747
747
|
|
|
748
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
748
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/store/sqlite/schema/canonical-tags.js
|
|
749
749
|
var canonicalTags = sqliteTable("canonical_tags", {
|
|
750
750
|
id: integer("id").primaryKey(),
|
|
751
751
|
name: text("name").notNull().unique(),
|
|
@@ -754,7 +754,7 @@ var canonicalTags = sqliteTable("canonical_tags", {
|
|
|
754
754
|
updatedAt: integer("updated_at").notNull()
|
|
755
755
|
});
|
|
756
756
|
|
|
757
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
757
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/store/sqlite/schema/document-transfers.js
|
|
758
758
|
var documentAnnotationTransfers = sqliteTable("document_annotation_transfers", {
|
|
759
759
|
sourceKey: text("source_key").notNull(),
|
|
760
760
|
collection: text("collection").notNull(),
|
|
@@ -764,13 +764,13 @@ var documentAnnotationTransfers = sqliteTable("document_annotation_transfers", {
|
|
|
764
764
|
createdAt: integer("created_at").notNull()
|
|
765
765
|
}, (table) => [primaryKey({ columns: [table.sourceKey, table.collection] })]);
|
|
766
766
|
|
|
767
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
767
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/store/sqlite/schema/document-index-pending.js
|
|
768
768
|
var documentIndexPending = sqliteTable("document_index_pending", {
|
|
769
769
|
id: integer("id").notNull(),
|
|
770
770
|
indexableType: text("indexable_type").notNull()
|
|
771
771
|
}, (table) => [primaryKey({ columns: [table.indexableType, table.id] })]);
|
|
772
772
|
|
|
773
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
773
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/store/sqlite/schema/tag-consolidations.js
|
|
774
774
|
var tagRedirects = sqliteTable("tag_redirects", {
|
|
775
775
|
sourceId: integer("source_id").primaryKey().references(() => canonicalTags.id),
|
|
776
776
|
survivorId: integer("survivor_id").notNull().references(() => canonicalTags.id),
|
|
@@ -796,7 +796,7 @@ var tagConsolidations = sqliteTable("tag_consolidations", {
|
|
|
796
796
|
index("tag_consolidations_by_actor_type_actor_id").on(table.actorType, table.actorId)
|
|
797
797
|
]);
|
|
798
798
|
|
|
799
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
799
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/store/sqlite/schema.js
|
|
800
800
|
var accounts = sqliteTable("accounts", {
|
|
801
801
|
id: integer("id").primaryKey(),
|
|
802
802
|
provider: text("provider").notNull(),
|
|
@@ -2292,7 +2292,7 @@ var storeSettings = sqliteTable("store_settings", {
|
|
|
2292
2292
|
at: integer("at").notNull()
|
|
2293
2293
|
});
|
|
2294
2294
|
|
|
2295
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
2295
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/store/sqlite/involvement-queue.js
|
|
2296
2296
|
var ARMS = [
|
|
2297
2297
|
[
|
|
2298
2298
|
"message",
|
|
@@ -2419,7 +2419,7 @@ var drainInvolvementQueue = /* @__PURE__ */ __name((database, cap = QUEUE_CAP) =
|
|
|
2419
2419
|
return recomputed;
|
|
2420
2420
|
}, "drainInvolvementQueue");
|
|
2421
2421
|
|
|
2422
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
2422
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/domain/mentions.js
|
|
2423
2423
|
import { domainToUnicode } from "node:url";
|
|
2424
2424
|
|
|
2425
2425
|
// node_modules/.pnpm/psl@1.15.0/node_modules/psl/dist/psl.mjs
|
|
@@ -12441,7 +12441,7 @@ var oa = /* @__PURE__ */ __name((e) => {
|
|
|
12441
12441
|
}, "oa");
|
|
12442
12442
|
var na = { parse: O, get: aa, isValid: oa };
|
|
12443
12443
|
|
|
12444
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
12444
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/domain/google-documents.js
|
|
12445
12445
|
var LINK = /https?:\/\/(?:(?:docs|drive|sheets|slides)\.google\.com|forms\.gle)(?:[/?#][^\s<>"'`]*)?/gi;
|
|
12446
12446
|
var ID = /^[\w-]{10,}$/;
|
|
12447
12447
|
var trimUrl = /* @__PURE__ */ __name((url) => {
|
|
@@ -12482,7 +12482,7 @@ var googleDocumentLinks = /* @__PURE__ */ __name((text5) => [...text5.matchAll(L
|
|
|
12482
12482
|
return { url, documentId: googleDocumentId(url) };
|
|
12483
12483
|
}), "googleDocumentLinks");
|
|
12484
12484
|
|
|
12485
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
12485
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/domain/phone-plans.generated.js
|
|
12486
12486
|
var PHONE_PLANS = [
|
|
12487
12487
|
{
|
|
12488
12488
|
country: "us",
|
|
@@ -12862,7 +12862,7 @@ var PHONE_PLANS = [
|
|
|
12862
12862
|
}
|
|
12863
12863
|
];
|
|
12864
12864
|
|
|
12865
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
12865
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/domain/phones.js
|
|
12866
12866
|
var PHONE_COUNTRIES = PHONE_PLANS.map((plan) => plan.country);
|
|
12867
12867
|
var DEFAULT_PHONE_COUNTRIES = ["ru"];
|
|
12868
12868
|
var parsePhoneCountries = /* @__PURE__ */ __name((value) => {
|
|
@@ -12903,7 +12903,7 @@ var nationalPhone = /* @__PURE__ */ __name((digits, countries, { anyType }) => {
|
|
|
12903
12903
|
return void 0;
|
|
12904
12904
|
}, "nationalPhone");
|
|
12905
12905
|
|
|
12906
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
12906
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/domain/places.js
|
|
12907
12907
|
var BEFORE = [
|
|
12908
12908
|
[/^(?:ул\.?|улиц[аеыу]|улицей)$/iu, "\u0443\u043B\u0438\u0446\u0430"],
|
|
12909
12909
|
[/^(?:пр-т|просп\.?|проспект[аеу]?)$/iu, "\u043F\u0440\u043E\u0441\u043F\u0435\u043A\u0442"],
|
|
@@ -13163,7 +13163,7 @@ var findPlaces = /* @__PURE__ */ __name((text5) => {
|
|
|
13163
13163
|
return found2.sort((a, b) => a.start - b.start);
|
|
13164
13164
|
}, "findPlaces");
|
|
13165
13165
|
|
|
13166
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
13166
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/domain/mentions.js
|
|
13167
13167
|
var MENTION_KINDS = ["phone", "email", "url", "document", "person-name", "place"];
|
|
13168
13168
|
var MENTION_VERSIONS = {
|
|
13169
13169
|
phone: 1,
|
|
@@ -13353,7 +13353,7 @@ var typedPhone = /* @__PURE__ */ __name((typed, { phoneCountries = DEFAULT_PHONE
|
|
|
13353
13353
|
};
|
|
13354
13354
|
}, "typedPhone");
|
|
13355
13355
|
|
|
13356
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
13356
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/domain/first-names.js
|
|
13357
13357
|
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";
|
|
13358
13358
|
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";
|
|
13359
13359
|
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";
|
|
@@ -13361,7 +13361,7 @@ var NOT_NAMES = ["\u0436\u0435\u043D\u0430", "\u0436\u0435\u043D\u044B", "\u0436
|
|
|
13361
13361
|
var FIRST_NAMES = [...new Set(`${RUSSIAN} ${EUROPEAN}`.split(" "))];
|
|
13362
13362
|
var NAME_WORDS = WORDS.split(" ");
|
|
13363
13363
|
|
|
13364
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
13364
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/domain/person-names.js
|
|
13365
13365
|
var LATIN_TO_CYRILLIC = {
|
|
13366
13366
|
shch: "\u0449",
|
|
13367
13367
|
sch: "\u0449",
|
|
@@ -13569,7 +13569,7 @@ var findUnknownNames = /* @__PURE__ */ __name((text5, stem, taken) => {
|
|
|
13569
13569
|
return found2;
|
|
13570
13570
|
}, "findUnknownNames");
|
|
13571
13571
|
|
|
13572
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
13572
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/domain/attachments.js
|
|
13573
13573
|
var NOT_FILES = /* @__PURE__ */ new Set([
|
|
13574
13574
|
"webpage",
|
|
13575
13575
|
"share",
|
|
@@ -13601,7 +13601,7 @@ var matchDownloads = /* @__PURE__ */ __name((stored3, files2) => {
|
|
|
13601
13601
|
});
|
|
13602
13602
|
}, "matchDownloads");
|
|
13603
13603
|
|
|
13604
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
13604
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/search/lucene/types.js
|
|
13605
13605
|
var QUERY_VERSION = 1;
|
|
13606
13606
|
var QUERY_LIMITS2 = {
|
|
13607
13607
|
...QUERY_LIMITS,
|
|
@@ -13632,7 +13632,7 @@ function exhausted(budget) {
|
|
|
13632
13632
|
}
|
|
13633
13633
|
__name(exhausted, "exhausted");
|
|
13634
13634
|
|
|
13635
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
13635
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/search/lucene/automaton.js
|
|
13636
13636
|
var any = { kind: "char", ranges: [[0, 1114111]], negate: false };
|
|
13637
13637
|
var literal2 = /* @__PURE__ */ __name((c) => ({
|
|
13638
13638
|
kind: "char",
|
|
@@ -14032,7 +14032,7 @@ var foldRegex = /* @__PURE__ */ __name((pattern, span) => {
|
|
|
14032
14032
|
return out;
|
|
14033
14033
|
}, "foldRegex");
|
|
14034
14034
|
|
|
14035
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
14035
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/search/lucene/presets.js
|
|
14036
14036
|
var PRESET_VERSION = 1;
|
|
14037
14037
|
var PRESETS = {
|
|
14038
14038
|
password: {
|
|
@@ -14086,7 +14086,7 @@ var PRESETS = {
|
|
|
14086
14086
|
}
|
|
14087
14087
|
};
|
|
14088
14088
|
|
|
14089
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
14089
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/search/lucene/registry.js
|
|
14090
14090
|
var FIELD_VERSION = 2;
|
|
14091
14091
|
var UNITS = {
|
|
14092
14092
|
"": 1,
|
|
@@ -14586,12 +14586,12 @@ var QUERY_OPERATORS = [
|
|
|
14586
14586
|
{ name: "boost / minimum / intervals", example: "invoice^2", semantics: "query.unsupported-operator" }
|
|
14587
14587
|
];
|
|
14588
14588
|
|
|
14589
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
14589
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/search/lucene/resolved.js
|
|
14590
14590
|
var hasText = /* @__PURE__ */ __name((node) => node.kind === "predicate" ? node.field === "text" || node.field === "exact" : node.clauses.some(({ node: node2 }) => hasText(node2)), "hasText");
|
|
14591
14591
|
var isStemmed = /* @__PURE__ */ __name((node) => node.field === "text" && (node.operator === "term" || node.operator === "phrase") && node.value !== "", "isStemmed");
|
|
14592
14592
|
var hasStems = /* @__PURE__ */ __name((node) => node.kind === "predicate" ? isStemmed(node) : node.clauses.some(({ node: node2 }) => hasStems(node2)), "hasStems");
|
|
14593
14593
|
|
|
14594
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
14594
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/store/sqlite/mention-links.js
|
|
14595
14595
|
var LIVE = "mn.kind = 'url' AND mn.status <> 'dismissed'";
|
|
14596
14596
|
var MAIL_ROWS = `SELECT mn.source_id FROM mentions mn WHERE mn.source_type = 'email' AND ${LIVE}`;
|
|
14597
14597
|
var linkMatch = /* @__PURE__ */ __name((field3, typed, mail, mentioned2) => {
|
|
@@ -14615,7 +14615,7 @@ var linkMatch = /* @__PURE__ */ __name((field3, typed, mail, mentioned2) => {
|
|
|
14615
14615
|
};
|
|
14616
14616
|
}, "linkMatch");
|
|
14617
14617
|
|
|
14618
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
14618
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/store/sqlite/phone-countries.js
|
|
14619
14619
|
var SETTING = "phoneCountries";
|
|
14620
14620
|
var savedPhoneCountries = /* @__PURE__ */ __name((database) => {
|
|
14621
14621
|
const row2 = database.prepare("SELECT value FROM store_settings WHERE key = ?").get(SETTING);
|
|
@@ -14646,7 +14646,7 @@ var valueMatch = /* @__PURE__ */ __name((database, typed) => {
|
|
|
14646
14646
|
return { sql: "mn.value = ?", params: [phone?.value ?? normalizedValue(typed, { phoneCountries })] };
|
|
14647
14647
|
}, "valueMatch");
|
|
14648
14648
|
|
|
14649
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
14649
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/domain/vocabulary.js
|
|
14650
14650
|
var normalizeVocabularyName = /* @__PURE__ */ __name((input) => {
|
|
14651
14651
|
if (typeof input !== "string" || input.length > 200 || /[\p{Cc}\p{Cf}]/u.test(input))
|
|
14652
14652
|
throw new CliError("validation_error", "a vocabulary name takes 1\u2013200 characters without control characters");
|
|
@@ -14674,7 +14674,7 @@ var vocabularySimilarity = /* @__PURE__ */ __name((left, right) => {
|
|
|
14674
14674
|
return 2 * intersection2 / (aa2.size + bb.size);
|
|
14675
14675
|
}, "vocabularySimilarity");
|
|
14676
14676
|
|
|
14677
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
14677
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/store/sqlite/tag-creation.js
|
|
14678
14678
|
import { createHash } from "node:crypto";
|
|
14679
14679
|
var folded2 = /* @__PURE__ */ __name((name) => {
|
|
14680
14680
|
try {
|
|
@@ -14740,7 +14740,7 @@ var guardTagCreation = /* @__PURE__ */ __name((context, name, kind3, by, options
|
|
|
14740
14740
|
});
|
|
14741
14741
|
}, "guardTagCreation");
|
|
14742
14742
|
|
|
14743
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
14743
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/domain/tag-redirects.js
|
|
14744
14744
|
var invalid = /* @__PURE__ */ __name((message2) => {
|
|
14745
14745
|
throw new CliError("validation_error", message2);
|
|
14746
14746
|
}, "invalid");
|
|
@@ -14817,7 +14817,7 @@ var createTagRedirectIndex = /* @__PURE__ */ __name((snapshot2) => {
|
|
|
14817
14817
|
};
|
|
14818
14818
|
}, "createTagRedirectIndex");
|
|
14819
14819
|
|
|
14820
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
14820
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/store/sqlite/tag-resolution.js
|
|
14821
14821
|
var tagCanonicalId = /* @__PURE__ */ __name((database, id2) => {
|
|
14822
14822
|
const row2 = database.prepare("SELECT canonical_id FROM resolved_tags WHERE id=?").get(id2);
|
|
14823
14823
|
if (!row2)
|
|
@@ -14845,7 +14845,7 @@ var tagRedirectSnapshot = /* @__PURE__ */ __name((database) => {
|
|
|
14845
14845
|
return snapshot2;
|
|
14846
14846
|
}, "tagRedirectSnapshot");
|
|
14847
14847
|
|
|
14848
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
14848
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/store/sqlite/task-keys.js
|
|
14849
14849
|
import { createHash as createHash2 } from "node:crypto";
|
|
14850
14850
|
var TASK_KEY_PREFIXES = {
|
|
14851
14851
|
question: "Q",
|
|
@@ -14873,7 +14873,7 @@ var taskAccountOf = /* @__PURE__ */ __name((database, rowId) => {
|
|
|
14873
14873
|
return row2 && String(row2.key) === inboxKey(String(row2.name)) ? String(row2.name) : void 0;
|
|
14874
14874
|
}, "taskAccountOf");
|
|
14875
14875
|
|
|
14876
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
14876
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/store/sqlite/things.js
|
|
14877
14877
|
var storedThing = /* @__PURE__ */ __name((type, id2) => ({ type: String(type), id: Number(id2) }), "storedThing");
|
|
14878
14878
|
var REFERABLE = {
|
|
14879
14879
|
note: { tombstone: true },
|
|
@@ -15031,11 +15031,11 @@ var taskIdOf = /* @__PURE__ */ __name((database, rowId) => {
|
|
|
15031
15031
|
}, "taskIdOf");
|
|
15032
15032
|
var canonicalThingReference = /* @__PURE__ */ __name((reference2) => reference2.trim().startsWith("meeting:") ? canonicalMeetingReference(reference2) : canonicalReference(reference2), "canonicalThingReference");
|
|
15033
15033
|
|
|
15034
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
15035
|
-
var toMs = /* @__PURE__ */ __name((
|
|
15036
|
-
if (
|
|
15034
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/store/sqlite/values.js
|
|
15035
|
+
var toMs = /* @__PURE__ */ __name((iso11) => {
|
|
15036
|
+
if (iso11 === null || iso11 === void 0)
|
|
15037
15037
|
return null;
|
|
15038
|
-
const ms = Date.parse(
|
|
15038
|
+
const ms = Date.parse(iso11);
|
|
15039
15039
|
return Number.isNaN(ms) ? null : ms;
|
|
15040
15040
|
}, "toMs");
|
|
15041
15041
|
var toIso = /* @__PURE__ */ __name((ms) => typeof ms === "number" ? new Date(ms).toISOString() : null, "toIso");
|
|
@@ -15045,7 +15045,7 @@ var present = /* @__PURE__ */ __name((entries) => Object.fromEntries(Object.entr
|
|
|
15045
15045
|
var DELIVERY = { delivered: 1, read: 2 };
|
|
15046
15046
|
var deliveryOf = /* @__PURE__ */ __name((stored3) => stored3 === DELIVERY.read ? "read" : stored3 === DELIVERY.delivered ? "delivered" : void 0, "deliveryOf");
|
|
15047
15047
|
|
|
15048
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
15048
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/store/sqlite/tags.js
|
|
15049
15049
|
var TAG_KINDS = ["tag", "topic"];
|
|
15050
15050
|
var TAGGABLE = { chat: "chat", contact: "identity", message: "message", task: "task" };
|
|
15051
15051
|
var TAG_TYPE = {
|
|
@@ -15236,7 +15236,7 @@ var tagsOf = /* @__PURE__ */ __name(({ database }, key2, filter) => {
|
|
|
15236
15236
|
return result;
|
|
15237
15237
|
}, "tagsOf");
|
|
15238
15238
|
|
|
15239
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
15239
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/store/sqlite/lucene-fields.js
|
|
15240
15240
|
var speech = /* @__PURE__ */ __name((alias2) => `(coalesce(${alias2}.extractor,'') LIKE 'speech:%' OR ${alias2}.kind IN ('voice','video_note') OR coalesce(${alias2}.mime,'')='audio/ogg')`, "speech");
|
|
15241
15241
|
var SPEECH = speech("att");
|
|
15242
15242
|
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");
|
|
@@ -15591,7 +15591,7 @@ var FIELD_COMPILERS = {
|
|
|
15591
15591
|
subject
|
|
15592
15592
|
};
|
|
15593
15593
|
|
|
15594
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
15594
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/store/sqlite/place-key.js
|
|
15595
15595
|
var placeOf = /* @__PURE__ */ __name((database) => {
|
|
15596
15596
|
const exact = database.prepare("SELECT id FROM places WHERE folded = ?");
|
|
15597
15597
|
const onStreet = database.prepare("SELECT id FROM places WHERE substr(folded, 1, ?) = ? LIMIT 2");
|
|
@@ -15607,7 +15607,7 @@ var placeOf = /* @__PURE__ */ __name((database) => {
|
|
|
15607
15607
|
};
|
|
15608
15608
|
}, "placeOf");
|
|
15609
15609
|
|
|
15610
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
15610
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/store/sqlite/mention-drain.js
|
|
15611
15611
|
var DRAIN_ON_WRITE = 500;
|
|
15612
15612
|
var METHOD = "rules";
|
|
15613
15613
|
var telegramLink = /* @__PURE__ */ __name((database) => {
|
|
@@ -15770,7 +15770,7 @@ var drainMentions = /* @__PURE__ */ __name((database, now2, limit = DRAIN_ON_WRI
|
|
|
15770
15770
|
return queued.length;
|
|
15771
15771
|
}, "drainMentions");
|
|
15772
15772
|
|
|
15773
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
15773
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/store/sqlite/index-state.js
|
|
15774
15774
|
var indexRow = /* @__PURE__ */ __name((database, name) => {
|
|
15775
15775
|
const exists2 = database.prepare("SELECT 1 FROM sqlite_master WHERE name = 'search_index_state'").get();
|
|
15776
15776
|
if (!exists2)
|
|
@@ -15778,7 +15778,7 @@ var indexRow = /* @__PURE__ */ __name((database, name) => {
|
|
|
15778
15778
|
return database.prepare("SELECT * FROM search_index_state WHERE name = ?").get(name);
|
|
15779
15779
|
}, "indexRow");
|
|
15780
15780
|
|
|
15781
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
15781
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/store/sqlite/stems.js
|
|
15782
15782
|
var INDEX = "message_stems";
|
|
15783
15783
|
var SETTING2 = "searchStemmers";
|
|
15784
15784
|
var DRAIN_ON_WRITE2 = 500;
|
|
@@ -15900,7 +15900,7 @@ var stemmerCache = /* @__PURE__ */ __name(() => {
|
|
|
15900
15900
|
};
|
|
15901
15901
|
}, "stemmerCache");
|
|
15902
15902
|
|
|
15903
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
15903
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/store/sqlite/transaction.js
|
|
15904
15904
|
var SQLITE_BUSY = 5;
|
|
15905
15905
|
var pause = new Int32Array(new SharedArrayBuffer(4));
|
|
15906
15906
|
var isBusy = /* @__PURE__ */ __name((error) => {
|
|
@@ -15988,7 +15988,7 @@ var read = /* @__PURE__ */ __name((database, body2) => {
|
|
|
15988
15988
|
}
|
|
15989
15989
|
}, "read");
|
|
15990
15990
|
|
|
15991
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
15991
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/store/sqlite/vector-index.js
|
|
15992
15992
|
var source = /* @__PURE__ */ __name((model, dims) => `SELECT k.id, k.chunkable_type,
|
|
15993
15993
|
coalesce(CASE k.chunkable_type
|
|
15994
15994
|
WHEN 'image' THEN (SELECT ch.account_id FROM attachments a JOIN messages m ON m.id = a.attachable_id
|
|
@@ -16130,7 +16130,7 @@ var dropUnusedVectors = /* @__PURE__ */ __name((database, hashes) => {
|
|
|
16130
16130
|
}, "dropUnusedVectors");
|
|
16131
16131
|
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");
|
|
16132
16132
|
|
|
16133
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
16133
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/store/sqlite/accounts.js
|
|
16134
16134
|
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({
|
|
16135
16135
|
target: [accounts.provider, accounts.externalId],
|
|
16136
16136
|
set: {
|
|
@@ -16236,7 +16236,7 @@ var dropOrphanPeople = /* @__PURE__ */ __name((database, unseenBefore) => {
|
|
|
16236
16236
|
AND id NOT IN (SELECT id FROM (${referencesTo(database, "persons", /* @__PURE__ */ new Set(["identity_links"]))}) WHERE id IS NOT NULL)`).run(JSON.stringify(persons2));
|
|
16237
16237
|
}, "dropOrphanPeople");
|
|
16238
16238
|
|
|
16239
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
16239
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/store/sqlite/folded.js
|
|
16240
16240
|
var FOLDED = [
|
|
16241
16241
|
{ table: "tasks", column: "title" },
|
|
16242
16242
|
{ table: "tasks", column: "close_reason" },
|
|
@@ -16273,7 +16273,7 @@ var fillFolded = /* @__PURE__ */ __name((database, { batch = 2e3 } = {}) => {
|
|
|
16273
16273
|
return filled2;
|
|
16274
16274
|
}, "fillFolded");
|
|
16275
16275
|
|
|
16276
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
16276
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/conversations/chunks.js
|
|
16277
16277
|
import { createHash as createHash3 } from "node:crypto";
|
|
16278
16278
|
var CHUNK_CHARS = 1200;
|
|
16279
16279
|
var CHUNK_OVERLAP = 150;
|
|
@@ -16378,7 +16378,7 @@ var cutChunks = /* @__PURE__ */ __name((members2, limit = CHUNK_CHARS, check3, c
|
|
|
16378
16378
|
return chunks2;
|
|
16379
16379
|
}, "cutChunks");
|
|
16380
16380
|
|
|
16381
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
16381
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/search/task-signature.js
|
|
16382
16382
|
var DAY = 864e5;
|
|
16383
16383
|
var CURRENCY = [
|
|
16384
16384
|
[/^(₽|руб.*|р\.?|rub)$/u, "RUB"],
|
|
@@ -16495,7 +16495,7 @@ var dueDayOf = /* @__PURE__ */ __name((text5, createdMs) => {
|
|
|
16495
16495
|
return best?.day ?? null;
|
|
16496
16496
|
}, "dueDayOf");
|
|
16497
16497
|
|
|
16498
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
16498
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/search/task-similarity.js
|
|
16499
16499
|
var DAY2 = 864e5;
|
|
16500
16500
|
var STOP_WORDS = new Set([
|
|
16501
16501
|
// Russian and English as the test set ran them, already folded (пожалуйста → пожалуиста).
|
|
@@ -16650,7 +16650,7 @@ var rankCandidates = /* @__PURE__ */ __name((views, candidates) => candidates.ma
|
|
|
16650
16650
|
...compareViews(subjectViews ?? views, candidate, replyChain === void 0 ? {} : { replyChain })
|
|
16651
16651
|
})).sort((a, b) => b.score - a.score), "rankCandidates");
|
|
16652
16652
|
|
|
16653
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
16653
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/store/sqlite/vectors.js
|
|
16654
16654
|
var currentChunks = /* @__PURE__ */ __name((chatKey) => sql`SELECT k.content_hash, k.chunkable_id AS conversation_id, r.first_message_id,
|
|
16655
16655
|
r.last_message_id, r.text_start, r.text_end FROM chunks k JOIN chunk_messages r ON r.chunk_id = k.id
|
|
16656
16656
|
JOIN conversations c ON k.chunkable_type = 'conversation' AND c.id = k.chunkable_id
|
|
@@ -16921,7 +16921,7 @@ var readiness = /* @__PURE__ */ __name(({ orm }, chatKey, model) => {
|
|
|
16921
16921
|
};
|
|
16922
16922
|
}, "readiness");
|
|
16923
16923
|
|
|
16924
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
16924
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/store/sqlite/document-pictures.js
|
|
16925
16925
|
var DOCUMENT_PICTURE = "document_picture";
|
|
16926
16926
|
var SCAN_PAGE2 = 5e3;
|
|
16927
16927
|
var idOf = /* @__PURE__ */ __name((ref3) => {
|
|
@@ -16984,7 +16984,7 @@ var documentPicturesOver = /* @__PURE__ */ __name(({ database, now: now2 }) => (
|
|
|
16984
16984
|
}, "nearestPictures")
|
|
16985
16985
|
}), "documentPicturesOver");
|
|
16986
16986
|
|
|
16987
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
16987
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/store/sqlite/query-filter.js
|
|
16988
16988
|
var glob = /* @__PURE__ */ __name((value) => [...fold(value).matchAll(/\\(.)|([*?])|(.)/gsu)].map(([, escaped2, wildcard, plain2]) => {
|
|
16989
16989
|
const literal4 = escaped2 ?? plain2 ?? "";
|
|
16990
16990
|
return wildcard ?? (/[*?[]/u.test(literal4) ? `[${literal4}]` : literal4);
|
|
@@ -17049,7 +17049,7 @@ var compile = /* @__PURE__ */ __name((node, columns, options) => {
|
|
|
17049
17049
|
var queryFilter = /* @__PURE__ */ __name((ast, columns, options = {}) => compile(ast.root, columns, options), "queryFilter");
|
|
17050
17050
|
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");
|
|
17051
17051
|
|
|
17052
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
17052
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/store/sqlite/events.js
|
|
17053
17053
|
var toJson = /* @__PURE__ */ __name((value) => value === null || value === void 0 ? null : JSON.stringify(value), "toJson");
|
|
17054
17054
|
var fromJson = /* @__PURE__ */ __name((value) => value === null || value === void 0 ? null : JSON.parse(String(value)), "fromJson");
|
|
17055
17055
|
var int = /* @__PURE__ */ __name((value) => value === null || value === void 0 ? null : Number(value), "int");
|
|
@@ -17139,7 +17139,7 @@ var linkMeeting = /* @__PURE__ */ __name((database, id2, eventId, now2, mode = "
|
|
|
17139
17139
|
});
|
|
17140
17140
|
}, "linkMeeting");
|
|
17141
17141
|
|
|
17142
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
17142
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/store/sqlite/note-index.js
|
|
17143
17143
|
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), ''))";
|
|
17144
17144
|
var UNSEARCHED_EVENT_TYPES = [
|
|
17145
17145
|
"working-location",
|
|
@@ -17369,7 +17369,7 @@ var resetNoteIndex = /* @__PURE__ */ __name((database) => {
|
|
|
17369
17369
|
return true;
|
|
17370
17370
|
}, "resetNoteIndex");
|
|
17371
17371
|
|
|
17372
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
17372
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/store/sqlite/person-resolution.js
|
|
17373
17373
|
var keyOf3 = /* @__PURE__ */ __name((name) => fold(name).trim().replace(/^@/, ""), "keyOf");
|
|
17374
17374
|
var resolvePersonLinks = /* @__PURE__ */ __name((database, names) => {
|
|
17375
17375
|
for (const key2 of new Set(names.filter((name) => !!name?.trim()).map(keyOf3))) {
|
|
@@ -17388,7 +17388,7 @@ var resolvePersonLinks = /* @__PURE__ */ __name((database, names) => {
|
|
|
17388
17388
|
}
|
|
17389
17389
|
}, "resolvePersonLinks");
|
|
17390
17390
|
|
|
17391
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
17391
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/store/sqlite/identities.js
|
|
17392
17392
|
var flag2 = /* @__PURE__ */ __name((value) => value === void 0 || value === null ? null : Number(value), "flag");
|
|
17393
17393
|
var prepare = /* @__PURE__ */ __name((orm) => ({
|
|
17394
17394
|
find: orm.select({
|
|
@@ -17613,7 +17613,7 @@ var meetingIdentityPk = /* @__PURE__ */ __name((context, accountId, identity) =>
|
|
|
17613
17613
|
}, "meetingIdentityPk");
|
|
17614
17614
|
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");
|
|
17615
17615
|
|
|
17616
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
17616
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/store/sqlite/chats.js
|
|
17617
17617
|
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");
|
|
17618
17618
|
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");
|
|
17619
17619
|
var chatPkFor = /* @__PURE__ */ __name((context, accountKey, chatId) => findChatPk(context, accountKey, chatId) ?? Number(context.orm.insert(chats).values({
|
|
@@ -17893,7 +17893,7 @@ var replaceAutoTags = /* @__PURE__ */ __name((context, key2, chatId, algorithm,
|
|
|
17893
17893
|
}
|
|
17894
17894
|
}, "replaceAutoTags");
|
|
17895
17895
|
|
|
17896
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
17896
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/conversations/mail-text.js
|
|
17897
17897
|
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");
|
|
17898
17898
|
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;
|
|
17899
17899
|
var ATTRIBUTION = /(wrote|написал[аи]?|escribió|a écrit|schrieb)\s*:\s*$/iu;
|
|
@@ -17974,7 +17974,7 @@ var mailCore = /* @__PURE__ */ __name((body2, earlier) => {
|
|
|
17974
17974
|
return withoutSignOff(withoutGreeting(kept)).join("\n").trim();
|
|
17975
17975
|
}, "mailCore");
|
|
17976
17976
|
|
|
17977
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
17977
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/store/sqlite/email-index.js
|
|
17978
17978
|
var titleOf = /* @__PURE__ */ __name((subject2) => subject2?.replace(/^\s*((re|fwd?|aw|wg)\s*:\s*)+/i, "").trim() || null, "titleOf");
|
|
17979
17979
|
var MAIL_PIECES = `(SELECT k.id, k.content_hash, k.chunkable_type AS type, k.chunkable_id AS owner, k.position,
|
|
17980
17980
|
k.start_offset, k.end_offset, k.account_id, k.occurred_at, a.attachable_id AS email_id,
|
|
@@ -18084,7 +18084,7 @@ var drainEmailIndex = /* @__PURE__ */ __name((database, stemmerFor2) => {
|
|
|
18084
18084
|
return emails3 + threads;
|
|
18085
18085
|
}, "drainEmailIndex");
|
|
18086
18086
|
|
|
18087
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
18087
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/store/sqlite/email-locations.js
|
|
18088
18088
|
var locate = /* @__PURE__ */ __name((database, accountId, emailId, where) => database.prepare(`INSERT OR REPLACE INTO email_locations (mailbox_id, uidvalidity, uid, email_id)
|
|
18089
18089
|
SELECT id, ?, ?, ? FROM mailboxes WHERE account_id = ? AND external_id = ?`).run(where.uidvalidity, where.uid, emailId, accountId, where.folder), "locate");
|
|
18090
18090
|
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,
|
|
@@ -18130,7 +18130,7 @@ var forgetLocations = /* @__PURE__ */ __name((database, accountId, folder, uidva
|
|
|
18130
18130
|
leave.run(emailId, Number(box.id), emailId, Number(box.id));
|
|
18131
18131
|
}, "forgetLocations");
|
|
18132
18132
|
|
|
18133
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
18133
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/store/sqlite/email-state.js
|
|
18134
18134
|
var recountEmailThread = /* @__PURE__ */ __name((database, threadId, now2) => database.prepare(`UPDATE email_threads SET
|
|
18135
18135
|
emails_count = (SELECT count(*) FROM emails WHERE email_thread_id = ? AND deleted_at IS NULL),
|
|
18136
18136
|
last_email_at = (SELECT max(coalesce(sent_at, received_at)) FROM emails
|
|
@@ -18180,7 +18180,7 @@ var markEmailsRestored = /* @__PURE__ */ __name((database, accountId, externalId
|
|
|
18180
18180
|
return threads.length;
|
|
18181
18181
|
}, "markEmailsRestored");
|
|
18182
18182
|
|
|
18183
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
18183
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/store/sqlite/mail-rules.js
|
|
18184
18184
|
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");
|
|
18185
18185
|
var conditionsKey = /* @__PURE__ */ __name((conditions) => JSON.stringify(sorted(conditions)), "conditionsKey");
|
|
18186
18186
|
var ruleOf = /* @__PURE__ */ __name((row2) => ({
|
|
@@ -18247,7 +18247,7 @@ var mailRulesOver = /* @__PURE__ */ __name((database) => ({
|
|
|
18247
18247
|
}
|
|
18248
18248
|
}), "mailRulesOver");
|
|
18249
18249
|
|
|
18250
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
18250
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/store/sqlite/link-reviews.js
|
|
18251
18251
|
var reviewLink = /* @__PURE__ */ __name((database, linkable, entity, candidates, reason, now2) => {
|
|
18252
18252
|
database.prepare(`INSERT INTO link_reviews (linkable_type, linkable_id, entity_type, candidates, reason, status, created_at, updated_at)
|
|
18253
18253
|
VALUES (?, ?, ?, ?, ?, 'open', ?, ?)
|
|
@@ -18255,7 +18255,7 @@ var reviewLink = /* @__PURE__ */ __name((database, linkable, entity, candidates,
|
|
|
18255
18255
|
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);
|
|
18256
18256
|
}, "reviewLink");
|
|
18257
18257
|
|
|
18258
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
18258
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-operation.js
|
|
18259
18259
|
function checkMeetingCancelled(signal) {
|
|
18260
18260
|
if (!signal?.aborted)
|
|
18261
18261
|
return;
|
|
@@ -18266,7 +18266,7 @@ function checkMeetingCancelled(signal) {
|
|
|
18266
18266
|
}
|
|
18267
18267
|
__name(checkMeetingCancelled, "checkMeetingCancelled");
|
|
18268
18268
|
|
|
18269
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
18269
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-values.js
|
|
18270
18270
|
var meetingOf = /* @__PURE__ */ __name((row2) => ({
|
|
18271
18271
|
id: Number(row2.id),
|
|
18272
18272
|
accountId: Number(row2.account_id),
|
|
@@ -18316,7 +18316,7 @@ var transcriptRowOf = /* @__PURE__ */ __name((row2) => ({
|
|
|
18316
18316
|
createdAt: Number(row2.created_at)
|
|
18317
18317
|
}), "transcriptRowOf");
|
|
18318
18318
|
|
|
18319
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
18319
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-reads.js
|
|
18320
18320
|
var MEETING_TEXT = ["external_id", "title", "description", "location", "join_url", "timezone", "metadata"];
|
|
18321
18321
|
var TRANSCRIPT_TEXT = ["source", "format", "language", "content_hash", "metadata"];
|
|
18322
18322
|
var ROW_TEXT = ["speaker_name", "text", "normalized_text", "metadata"];
|
|
@@ -18483,7 +18483,7 @@ var meetingReadsOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
|
18483
18483
|
}
|
|
18484
18484
|
}), "meetingReadsOver");
|
|
18485
18485
|
|
|
18486
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
18486
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-selection.js
|
|
18487
18487
|
var meetingSelectionSql = /* @__PURE__ */ __name((input) => {
|
|
18488
18488
|
const clauses = ["m.account_id=?", "m.deleted_at IS NULL"];
|
|
18489
18489
|
const params = [input.accountId];
|
|
@@ -18526,7 +18526,7 @@ var meetingSelectionSql = /* @__PURE__ */ __name((input) => {
|
|
|
18526
18526
|
return { clauses, params };
|
|
18527
18527
|
}, "meetingSelectionSql");
|
|
18528
18528
|
|
|
18529
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
18529
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-chat-lines.js
|
|
18530
18530
|
var meetingChatLinesOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
18531
18531
|
async meetingChatLines(input) {
|
|
18532
18532
|
checkMeetingCancelled(input.signal);
|
|
@@ -18554,7 +18554,7 @@ var meetingChatLinesOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
|
18554
18554
|
}
|
|
18555
18555
|
}), "meetingChatLinesOver");
|
|
18556
18556
|
|
|
18557
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
18557
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/store/sqlite/reads.js
|
|
18558
18558
|
var MESSAGE_FIELDS = {
|
|
18559
18559
|
pk: messages.id,
|
|
18560
18560
|
nativeId: messages.externalId,
|
|
@@ -18721,7 +18721,7 @@ var chatActivity = /* @__PURE__ */ __name(({ database }, accountKey, since, wher
|
|
|
18721
18721
|
storedAt: toIso(Number(database.prepare("SELECT max(created_at) AS at FROM messages WHERE account_id = ?").get(accountKey)?.at) || null)
|
|
18722
18722
|
}), "chatActivity");
|
|
18723
18723
|
|
|
18724
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
18724
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/store/sqlite/search.js
|
|
18725
18725
|
var HIT_FIELDS = {
|
|
18726
18726
|
...MESSAGE_FIELDS,
|
|
18727
18727
|
chatTitle: sql`${chats.title}`.as("chat_title"),
|
|
@@ -18820,7 +18820,7 @@ var directReplies = /* @__PURE__ */ __name((context, parents, limit) => {
|
|
|
18820
18820
|
};
|
|
18821
18821
|
}, "directReplies");
|
|
18822
18822
|
|
|
18823
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
18823
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/store/sqlite/person-links.js
|
|
18824
18824
|
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");
|
|
18825
18825
|
var required = /* @__PURE__ */ __name((context, ref3) => {
|
|
18826
18826
|
const found2 = identityRow(context, ref3);
|
|
@@ -18951,7 +18951,7 @@ var mentioning = /* @__PURE__ */ __name((context, accountKey, { id: id2, usernam
|
|
|
18951
18951
|
}, "mentioning");
|
|
18952
18952
|
var escaped = /* @__PURE__ */ __name((text5) => text5.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), "escaped");
|
|
18953
18953
|
|
|
18954
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
18954
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-context-links.js
|
|
18955
18955
|
var missing2 = /* @__PURE__ */ __name(() => {
|
|
18956
18956
|
throw new CliError("not_found", "Meeting, participant or selected target not found");
|
|
18957
18957
|
}, "missing");
|
|
@@ -19073,7 +19073,7 @@ function meetingContextLinksOver(context) {
|
|
|
19073
19073
|
}
|
|
19074
19074
|
__name(meetingContextLinksOver, "meetingContextLinksOver");
|
|
19075
19075
|
|
|
19076
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
19076
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-index-values.js
|
|
19077
19077
|
var INDEX_CODES = { meeting_transcript_row: 1, meeting_chat_message: 2, meeting_summary: 3 };
|
|
19078
19078
|
var meetingRowid = /* @__PURE__ */ __name((type, id2) => id2 * 4 + INDEX_CODES[type], "meetingRowid");
|
|
19079
19079
|
var summaryOf = /* @__PURE__ */ __name((row2) => ({
|
|
@@ -19102,7 +19102,7 @@ var indexedText = /* @__PURE__ */ __name((database, type, id2) => {
|
|
|
19102
19102
|
return row2 ? summaryText(summaryOf(row2)) : null;
|
|
19103
19103
|
}, "indexedText");
|
|
19104
19104
|
|
|
19105
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
19105
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-stem-state.js
|
|
19106
19106
|
var summaryBytes = ["title", "overview", "sections", "next_steps", "content"].map((key2) => `coalesce(length(CAST(s.${key2} AS BLOB)),0)`).join("+");
|
|
19107
19107
|
var meetingCurrentIndexRows = `
|
|
19108
19108
|
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
|
|
@@ -19133,7 +19133,7 @@ var invalidateMeetingStems = /* @__PURE__ */ __name((database, type, id2) => {
|
|
|
19133
19133
|
}, "invalidateMeetingStems");
|
|
19134
19134
|
var meetingStemmableText = /* @__PURE__ */ __name((text5) => text5.replace(/[\p{L}\p{N}\p{M}\p{Co}]+/gu, (token) => token.length <= 1024 ? token : ""), "meetingStemmableText");
|
|
19135
19135
|
|
|
19136
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
19136
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-hit-index.js
|
|
19137
19137
|
function meetingHitIndexOver({ database, now: now2 }) {
|
|
19138
19138
|
return {
|
|
19139
19139
|
async indexSearch(original) {
|
|
@@ -19201,10 +19201,10 @@ function meetingHitIndexOver({ database, now: now2 }) {
|
|
|
19201
19201
|
}
|
|
19202
19202
|
__name(meetingHitIndexOver, "meetingHitIndexOver");
|
|
19203
19203
|
|
|
19204
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
19204
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-hit-search.js
|
|
19205
19205
|
import { createHash as createHash4 } from "node:crypto";
|
|
19206
19206
|
|
|
19207
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
19207
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/search/trigrams.js
|
|
19208
19208
|
var trigrams = /* @__PURE__ */ __name((term) => {
|
|
19209
19209
|
const padded = ` ${term} `;
|
|
19210
19210
|
const pieces = /* @__PURE__ */ new Set();
|
|
@@ -19213,7 +19213,7 @@ var trigrams = /* @__PURE__ */ __name((term) => {
|
|
|
19213
19213
|
return [...pieces];
|
|
19214
19214
|
}, "trigrams");
|
|
19215
19215
|
|
|
19216
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
19216
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/search/correct.js
|
|
19217
19217
|
var SHORTEST_CORRECTION = 3;
|
|
19218
19218
|
var maxEdits = /* @__PURE__ */ __name((word) => word.length <= 4 ? 1 : 2, "maxEdits");
|
|
19219
19219
|
var editDistance = /* @__PURE__ */ __name((a, b, max) => {
|
|
@@ -19260,7 +19260,7 @@ var correctWords = /* @__PURE__ */ __name(async (vocabulary, words3) => {
|
|
|
19260
19260
|
return corrections;
|
|
19261
19261
|
}, "correctWords");
|
|
19262
19262
|
|
|
19263
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
19263
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/search/garbled.js
|
|
19264
19264
|
var SHORTEST_GARBLED = 4;
|
|
19265
19265
|
var MOST_WIDENED = 64;
|
|
19266
19266
|
var plain = /* @__PURE__ */ __name((word) => word.replaceAll("\u044D", "\u0435"), "plain");
|
|
@@ -19352,7 +19352,7 @@ var widenWords = /* @__PURE__ */ __name((probes, vocabulary, stem, known2) => {
|
|
|
19352
19352
|
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));
|
|
19353
19353
|
}, "widenWords");
|
|
19354
19354
|
|
|
19355
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
19355
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/search/russian-dictionary.js
|
|
19356
19356
|
import { readFileSync } from "node:fs";
|
|
19357
19357
|
var loaded;
|
|
19358
19358
|
var dictionary = /* @__PURE__ */ __name(() => {
|
|
@@ -19411,7 +19411,7 @@ var knownRussianWord = /* @__PURE__ */ __name((word) => {
|
|
|
19411
19411
|
return false;
|
|
19412
19412
|
}, "knownRussianWord");
|
|
19413
19413
|
|
|
19414
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
19414
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-hit-query.js
|
|
19415
19415
|
var WORD2 = /[\p{L}\p{N}\p{M}]+/gu;
|
|
19416
19416
|
var MOST_WORDS = 128;
|
|
19417
19417
|
var quote = /* @__PURE__ */ __name((word) => `"${word.replaceAll('"', '""')}"`, "quote");
|
|
@@ -19638,7 +19638,7 @@ var matchMeetingText = /* @__PURE__ */ __name((tree, text5, stemmer) => {
|
|
|
19638
19638
|
return check3(tree);
|
|
19639
19639
|
}, "matchMeetingText");
|
|
19640
19640
|
|
|
19641
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
19641
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-hit-search.js
|
|
19642
19642
|
var fail3 = /* @__PURE__ */ __name((message2) => {
|
|
19643
19643
|
throw new CliError("validation_error", message2);
|
|
19644
19644
|
}, "fail");
|
|
@@ -19815,7 +19815,7 @@ function meetingHitSearchOver({ database }) {
|
|
|
19815
19815
|
}
|
|
19816
19816
|
__name(meetingHitSearchOver, "meetingHitSearchOver");
|
|
19817
19817
|
|
|
19818
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
19818
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-participant-search.js
|
|
19819
19819
|
import { createHash as createHash5 } from "node:crypto";
|
|
19820
19820
|
var cursorOf2 = /* @__PURE__ */ __name((value, key2) => {
|
|
19821
19821
|
if (value === void 0)
|
|
@@ -19905,7 +19905,7 @@ var meetingParticipantSearchOver = /* @__PURE__ */ __name((context) => ({
|
|
|
19905
19905
|
}
|
|
19906
19906
|
}), "meetingParticipantSearchOver");
|
|
19907
19907
|
|
|
19908
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
19908
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/store/sqlite/preparation-context-queries.js
|
|
19909
19909
|
var preparationQueries = {
|
|
19910
19910
|
participants: {
|
|
19911
19911
|
fields: "p.id, p.identity_id, p.display_name, l.person_id",
|
|
@@ -19955,7 +19955,7 @@ var preparationQueries = {
|
|
|
19955
19955
|
}
|
|
19956
19956
|
};
|
|
19957
19957
|
|
|
19958
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
19958
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-preparation-context.js
|
|
19959
19959
|
var meetingPreparationContextOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
19960
19960
|
async preparationContext(original) {
|
|
19961
19961
|
const input = validateMeetingPreparationContext(original);
|
|
@@ -19996,7 +19996,7 @@ var meetingPreparationContextOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
|
19996
19996
|
}
|
|
19997
19997
|
}), "meetingPreparationContextOver");
|
|
19998
19998
|
|
|
19999
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
19999
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/store/sqlite/preparation-subjects.js
|
|
20000
20000
|
var preparationSubjects = /* @__PURE__ */ __name((anchors) => `WITH anchors AS (
|
|
20001
20001
|
SELECT m.id FROM meetings m JOIN meeting_series s ON s.id=m.meeting_series_id
|
|
20002
20002
|
WHERE m.id IN (${Array.from({ length: anchors }, () => "?").join(",")}) AND m.account_id=? AND s.account_id=?
|
|
@@ -20010,7 +20010,7 @@ var preparationSubjects = /* @__PURE__ */ __name((anchors) => `WITH anchors AS (
|
|
|
20010
20010
|
JOIN main.projects p ON p.id=l.to_id WHERE p.account_id IS NULL AND p.deleted_at IS NULL
|
|
20011
20011
|
)`, "preparationSubjects");
|
|
20012
20012
|
|
|
20013
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
20013
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-preparation-knowledge.js
|
|
20014
20014
|
var meetingPreparationKnowledgeOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
20015
20015
|
async preparationKnowledge(original) {
|
|
20016
20016
|
const { accountId, seriesId, anchorIds, after: after2, before: before2, limit, maxReadBytes, signal } = validateMeetingRelatedHistory(original);
|
|
@@ -20055,7 +20055,7 @@ var meetingPreparationKnowledgeOver = /* @__PURE__ */ __name(({ database }) => (
|
|
|
20055
20055
|
}
|
|
20056
20056
|
}), "meetingPreparationKnowledgeOver");
|
|
20057
20057
|
|
|
20058
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
20058
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-preparation-notes.js
|
|
20059
20059
|
var meetingPreparationNotesOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
20060
20060
|
async preparationNotes(original) {
|
|
20061
20061
|
const { accountId, seriesId, anchorIds, after: after2, before: before2, limit, maxReadBytes, signal } = validateMeetingRelatedHistory(original);
|
|
@@ -20108,7 +20108,7 @@ var meetingPreparationNotesOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
|
20108
20108
|
}
|
|
20109
20109
|
}), "meetingPreparationNotesOver");
|
|
20110
20110
|
|
|
20111
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
20111
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-related-history.js
|
|
20112
20112
|
var meetingRelatedHistoryOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
20113
20113
|
async relatedHistory(original) {
|
|
20114
20114
|
const input = validateMeetingRelatedHistory(original);
|
|
@@ -20179,7 +20179,7 @@ var meetingRelatedHistoryOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
|
20179
20179
|
}
|
|
20180
20180
|
}), "meetingRelatedHistoryOver");
|
|
20181
20181
|
|
|
20182
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
20182
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-review.js
|
|
20183
20183
|
var number2 = /* @__PURE__ */ __name((value) => value === null || value === void 0 ? null : Number(value), "number");
|
|
20184
20184
|
var text2 = /* @__PURE__ */ __name((value) => value === null || value === void 0 ? null : String(value), "text");
|
|
20185
20185
|
var meetingReviewOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
@@ -20260,7 +20260,7 @@ var meetingReviewOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
|
20260
20260
|
}
|
|
20261
20261
|
}), "meetingReviewOver");
|
|
20262
20262
|
|
|
20263
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
20263
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-series-history.js
|
|
20264
20264
|
var bytes2 = "length(CAST(external_id AS BLOB)) + coalesce(length(CAST(title AS BLOB)), 0)";
|
|
20265
20265
|
var ensureBytes2 = /* @__PURE__ */ __name((size2, budget) => {
|
|
20266
20266
|
if (!Number.isSafeInteger(size2) || size2 < 0 || size2 > budget)
|
|
@@ -20314,7 +20314,7 @@ var meetingSeriesHistoryOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
|
20314
20314
|
}
|
|
20315
20315
|
}), "meetingSeriesHistoryOver");
|
|
20316
20316
|
|
|
20317
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
20317
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-stats.js
|
|
20318
20318
|
var MOST_ROWS = 5e5;
|
|
20319
20319
|
var meetingStatsOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
20320
20320
|
async meetingStats(input) {
|
|
@@ -20361,7 +20361,7 @@ var meetingStatsOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
|
20361
20361
|
}
|
|
20362
20362
|
}), "meetingStatsOver");
|
|
20363
20363
|
|
|
20364
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
20364
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/store/sqlite/meetings.js
|
|
20365
20365
|
var CURSOR_KEY = "meetings";
|
|
20366
20366
|
var seriesOf2 = /* @__PURE__ */ __name((row2) => ({
|
|
20367
20367
|
id: Number(row2.id),
|
|
@@ -20913,7 +20913,7 @@ var meetingStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
20913
20913
|
};
|
|
20914
20914
|
}, "meetingStoreOver");
|
|
20915
20915
|
|
|
20916
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
20916
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/store/sqlite/emails.js
|
|
20917
20917
|
var threadConversation = /* @__PURE__ */ __name((place, builtAt) => ({
|
|
20918
20918
|
id: `email:${place.emailId}`,
|
|
20919
20919
|
chatId: place.threadExternalId,
|
|
@@ -21461,7 +21461,7 @@ var mailStoreOver = /* @__PURE__ */ __name(({ database, orm }, stemmerFor2 = ste
|
|
|
21461
21461
|
}
|
|
21462
21462
|
}), "mailStoreOver");
|
|
21463
21463
|
|
|
21464
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
21464
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/search/dictionary.js
|
|
21465
21465
|
import { readFileSync as readFileSync2 } from "node:fs";
|
|
21466
21466
|
var DICTIONARIES = Object.fromEntries(LANGUAGES.map(({ name, dictionary: dictionary3 }) => [name, dictionary3]));
|
|
21467
21467
|
var folded4 = /* @__PURE__ */ __name((word) => /^[а-яё'-]*$/.test(word) ? word.replaceAll("\u0451", "\u0435").replaceAll("\u0439", "\u0438") : fold(word), "folded");
|
|
@@ -21551,7 +21551,7 @@ var knownWord = /* @__PURE__ */ __name((languages) => {
|
|
|
21551
21551
|
}, "knownWord");
|
|
21552
21552
|
var dictionaryLanguages = /* @__PURE__ */ __name((stemmers) => [stemmers.cyrillic, ...stemmers.latin.split(",")].filter((name) => Object.hasOwn(DICTIONARIES, name)), "dictionaryLanguages");
|
|
21553
21553
|
|
|
21554
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
21554
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/store/sqlite/transcript-query.js
|
|
21555
21555
|
var predicates = /* @__PURE__ */ __name((node) => node.kind === "predicate" ? [node] : node.clauses.flatMap(({ node: node2 }) => predicates(node2)), "predicates");
|
|
21556
21556
|
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");
|
|
21557
21557
|
var LATIN_NUMBERS = new Set(`zero one two three four five six seven eight nine ten eleven twelve twenty thirty forty fifty sixty seventy
|
|
@@ -21637,7 +21637,7 @@ var spokenTranscripts = /* @__PURE__ */ __name((database, item, speaking, keys)
|
|
|
21637
21637
|
return found2;
|
|
21638
21638
|
}, "spokenTranscripts");
|
|
21639
21639
|
|
|
21640
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
21640
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/store/sqlite/hit-places.js
|
|
21641
21641
|
var placeHits = /* @__PURE__ */ __name((database, corpus, leaves, transcripts, found2, pks) => {
|
|
21642
21642
|
const placeLeaves = leaves.filter(({ node }) => (node.operator === "term" || node.operator === "phrase") && (node.implicit || node.field === "content" || node.field === "transcript"));
|
|
21643
21643
|
if (!placeLeaves.length || !pks.length || found2.length !== pks.length)
|
|
@@ -21684,7 +21684,7 @@ var placeHits = /* @__PURE__ */ __name((database, corpus, leaves, transcripts, f
|
|
|
21684
21684
|
});
|
|
21685
21685
|
}, "placeHits");
|
|
21686
21686
|
|
|
21687
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
21687
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/store/sqlite/lucene.js
|
|
21688
21688
|
var MESSAGES2 = {
|
|
21689
21689
|
rows: "messages",
|
|
21690
21690
|
threads: "chats",
|
|
@@ -21720,6 +21720,17 @@ var GROUPS = {
|
|
|
21720
21720
|
var matchQuery = /* @__PURE__ */ __name((context, execution) => runQuery(context, execution), "matchQuery");
|
|
21721
21721
|
var countQuery = /* @__PURE__ */ __name((context, execution, by) => runQuery(context, execution, by), "countQuery");
|
|
21722
21722
|
var queryMessagePks = /* @__PURE__ */ __name((context, execution) => runQuery(context, execution, "pks"), "queryMessagePks");
|
|
21723
|
+
var countMatches = /* @__PURE__ */ __name((context, execution, cap) => {
|
|
21724
|
+
const { database, check: check3, where, from: from2, withRanking, ranked, leaves } = compileQuery(context, {
|
|
21725
|
+
...execution,
|
|
21726
|
+
newest: true
|
|
21727
|
+
});
|
|
21728
|
+
if (leaves.some(({ test }) => test))
|
|
21729
|
+
return void 0;
|
|
21730
|
+
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);
|
|
21731
|
+
check3();
|
|
21732
|
+
return Number(row2?.n ?? 0);
|
|
21733
|
+
}, "countMatches");
|
|
21723
21734
|
var compileQuery = /* @__PURE__ */ __name((context, execution, boundedAttachments = false) => {
|
|
21724
21735
|
const { database } = context;
|
|
21725
21736
|
const corpus = execution.corpus === "mail" ? MAIL : MESSAGES2;
|
|
@@ -22146,7 +22157,7 @@ var runQuery = /* @__PURE__ */ __name(async (context, execution, by) => {
|
|
|
22146
22157
|
};
|
|
22147
22158
|
}, "runQuery");
|
|
22148
22159
|
|
|
22149
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
22160
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/store/sqlite/counters.js
|
|
22150
22161
|
function invalidMetadata() {
|
|
22151
22162
|
throw new CliError("validation_error", "stored counter metadata is malformed \u2014 check the store before refreshing");
|
|
22152
22163
|
}
|
|
@@ -22248,7 +22259,7 @@ var counterTargets = /* @__PURE__ */ __name((context, execution, options) => wit
|
|
|
22248
22259
|
};
|
|
22249
22260
|
}), "counterTargets");
|
|
22250
22261
|
|
|
22251
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
22262
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/store/sqlite/attachment-texts.js
|
|
22252
22263
|
var NOT_FILE_LIST = [...NOT_FILES].map((kind3) => `'${kind3}'`).join(",");
|
|
22253
22264
|
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,
|
|
22254
22265
|
att.size, att.local_path, att.extraction AS origin, att.size AS read_bytes, att.extraction_error AS error, att.content_sha256, att.extractor
|
|
@@ -22367,7 +22378,7 @@ var attachmentViews = /* @__PURE__ */ __name(({ database }, accountKey, { chatKe
|
|
|
22367
22378
|
}));
|
|
22368
22379
|
}, "attachmentViews");
|
|
22369
22380
|
|
|
22370
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
22381
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/store/sqlite/transcripts.js
|
|
22371
22382
|
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");
|
|
22372
22383
|
var keepTranscript = /* @__PURE__ */ __name((context, chatKey, messageId, text5, source2) => {
|
|
22373
22384
|
const { orm, database, now: now2 } = context;
|
|
@@ -22405,7 +22416,7 @@ var intoVoiceAttachment = /* @__PURE__ */ __name((context, messagePk) => {
|
|
|
22405
22416
|
keepText(context, Number(row2.id), { text: String(row2.text), origin: "extracted", extractor: `speech:${row2.source}` });
|
|
22406
22417
|
}, "intoVoiceAttachment");
|
|
22407
22418
|
|
|
22408
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
22419
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/store/sqlite/messages.js
|
|
22409
22420
|
var FIELDS = [
|
|
22410
22421
|
"threadExternalId",
|
|
22411
22422
|
"senderIdentityId",
|
|
@@ -22722,7 +22733,7 @@ var writeDerivedReactions = /* @__PURE__ */ __name((context, chatKey, messageId)
|
|
|
22722
22733
|
reactionStatementsOf(context.database).total.run(JSON.stringify(derived), chatKey, messageId);
|
|
22723
22734
|
}, "writeDerivedReactions");
|
|
22724
22735
|
|
|
22725
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
22736
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/store/sqlite/sync.js
|
|
22726
22737
|
var syncStateOf = /* @__PURE__ */ __name(({ orm }, accountKey, name) => {
|
|
22727
22738
|
const row2 = orm.select({ value: syncCursors.value, at: syncCursors.updatedAt }).from(syncCursors).where(and(eq(syncCursors.accountId, accountKey), eq(syncCursors.key, name))).get();
|
|
22728
22739
|
return row2 ? { value: row2.value, at: toIso(row2.at) } : void 0;
|
|
@@ -22748,7 +22759,7 @@ var release = /* @__PURE__ */ __name(({ orm }, chatKey, anchor, holder) => {
|
|
|
22748
22759
|
orm.delete(fetchLeases).where(and(eq(fetchLeases.chatId, chatKey), eq(fetchLeases.anchor, anchor), eq(fetchLeases.holder, holder))).run();
|
|
22749
22760
|
}, "release");
|
|
22750
22761
|
|
|
22751
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
22762
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/store/keys.js
|
|
22752
22763
|
var keysOver = /* @__PURE__ */ __name((context) => {
|
|
22753
22764
|
const findAccountPk2 = /* @__PURE__ */ __name((key2) => findAccountPk(context, key2), "findAccountPk");
|
|
22754
22765
|
const findChatPk2 = /* @__PURE__ */ __name((accountKey, chatId) => findChatPk(context, accountKey, chatId), "findChatPk");
|
|
@@ -22769,7 +22780,7 @@ var keysOver = /* @__PURE__ */ __name((context) => {
|
|
|
22769
22780
|
};
|
|
22770
22781
|
}, "keysOver");
|
|
22771
22782
|
|
|
22772
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
22783
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/store/sqlite/account-groups.js
|
|
22773
22784
|
var accountGroupsOf = /* @__PURE__ */ __name((database) => {
|
|
22774
22785
|
const row2 = database.prepare("SELECT value FROM store_settings WHERE key = ?").get(ACCOUNT_GROUPS);
|
|
22775
22786
|
if (!row2)
|
|
@@ -22804,7 +22815,7 @@ var saveProfile = /* @__PURE__ */ __name((database, app, profile, key2, now2) =>
|
|
|
22804
22815
|
database.prepare("INSERT OR REPLACE INTO store_settings (key, value, at) VALUES (?, ?, ?)").run(PROFILES, JSON.stringify(profiles), now2);
|
|
22805
22816
|
}, "saveProfile");
|
|
22806
22817
|
|
|
22807
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
22818
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/store/sqlite/actors.js
|
|
22808
22819
|
var BOT_KINDS = ["agent", "script", "integration"];
|
|
22809
22820
|
var ownerPerson = /* @__PURE__ */ __name((database) => {
|
|
22810
22821
|
const found2 = database.prepare("SELECT id FROM persons WHERE owner = 1 ORDER BY id LIMIT 1").get();
|
|
@@ -22840,7 +22851,7 @@ var originOfActor = /* @__PURE__ */ __name((database, type, id2) => {
|
|
|
22840
22851
|
return database.prepare("SELECT name FROM bots WHERE id = ?").get(Number(id2))?.name === "rule" ? "rule" : "agent";
|
|
22841
22852
|
}, "originOfActor");
|
|
22842
22853
|
|
|
22843
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
22854
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/store/sqlite/own-identities.js
|
|
22844
22855
|
var linkOwnIdentities = /* @__PURE__ */ __name((context) => {
|
|
22845
22856
|
const owner = ownerPerson(context.database).id;
|
|
22846
22857
|
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);
|
|
@@ -22861,7 +22872,7 @@ var linkToOwner = /* @__PURE__ */ __name((context, ref3) => {
|
|
|
22861
22872
|
return personOf(context, ref3);
|
|
22862
22873
|
}, "linkToOwner");
|
|
22863
22874
|
|
|
22864
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
22875
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/store/sqlite/providers.js
|
|
22865
22876
|
var PROVIDERS_SETTING = "providers";
|
|
22866
22877
|
var storedProvidersOf = /* @__PURE__ */ __name((database) => {
|
|
22867
22878
|
const row2 = database.prepare("SELECT value FROM store_settings WHERE key = ?").get(PROVIDERS_SETTING);
|
|
@@ -22896,7 +22907,7 @@ var registerProvider = /* @__PURE__ */ __name((database, value, now2) => {
|
|
|
22896
22907
|
});
|
|
22897
22908
|
}, "registerProvider");
|
|
22898
22909
|
|
|
22899
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
22910
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/store/sqlite/task-candidates.js
|
|
22900
22911
|
var DAY3 = 864e5;
|
|
22901
22912
|
var RECENTLY_CLOSED_MS = 14 * DAY3;
|
|
22902
22913
|
var TEXT_LIMIT = 20;
|
|
@@ -22983,7 +22994,7 @@ var taskSimilarityOver = /* @__PURE__ */ __name((context) => {
|
|
|
22983
22994
|
}, "replyChain");
|
|
22984
22995
|
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";
|
|
22985
22996
|
const rowOf = /* @__PURE__ */ __name((id2) => database.prepare(`SELECT ${COLUMNS7} FROM tasks t WHERE t.id = ? AND t.deleted_at IS NULL`).get(id2), "rowOf");
|
|
22986
|
-
const
|
|
22997
|
+
const subjectOf2 = /* @__PURE__ */ __name((subject2) => {
|
|
22987
22998
|
if ("task" in subject2) {
|
|
22988
22999
|
const bare = subject2.task.startsWith("task:") ? subject2.task.slice("task:".length) : subject2.task;
|
|
22989
23000
|
const id2 = taskRowOf(database, bare);
|
|
@@ -23012,7 +23023,7 @@ var taskSimilarityOver = /* @__PURE__ */ __name((context) => {
|
|
|
23012
23023
|
}, "subjectOf");
|
|
23013
23024
|
return {
|
|
23014
23025
|
compare: /* @__PURE__ */ __name(async (subject2, other) => {
|
|
23015
|
-
const side =
|
|
23026
|
+
const side = subjectOf2(subject2);
|
|
23016
23027
|
const id2 = taskRowOf(database, other.startsWith("task:") ? other.slice("task:".length) : other);
|
|
23017
23028
|
const row2 = id2 === void 0 ? void 0 : rowOf(id2);
|
|
23018
23029
|
if (!side || !row2)
|
|
@@ -23028,7 +23039,7 @@ var taskSimilarityOver = /* @__PURE__ */ __name((context) => {
|
|
|
23028
23039
|
});
|
|
23029
23040
|
}, "compare"),
|
|
23030
23041
|
similar: /* @__PURE__ */ __name(async (subject2, { limit = 10 } = {}) => {
|
|
23031
|
-
const named2 =
|
|
23042
|
+
const named2 = subjectOf2(subject2);
|
|
23032
23043
|
if (!named2)
|
|
23033
23044
|
return [];
|
|
23034
23045
|
const side = linkedOf(named2);
|
|
@@ -23095,7 +23106,7 @@ var taskSimilarityOver = /* @__PURE__ */ __name((context) => {
|
|
|
23095
23106
|
};
|
|
23096
23107
|
}, "taskSimilarityOver");
|
|
23097
23108
|
|
|
23098
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
23109
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/store/sqlite/task-category-settings.js
|
|
23099
23110
|
var SETTING3 = "taskCategories";
|
|
23100
23111
|
var savedTaskCategories = /* @__PURE__ */ __name((database) => {
|
|
23101
23112
|
const row2 = database.prepare("SELECT value FROM store_settings WHERE key = ?").get(SETTING3);
|
|
@@ -23114,7 +23125,7 @@ var saveTaskCategories = /* @__PURE__ */ __name((database, categories, now2) =>
|
|
|
23114
23125
|
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);
|
|
23115
23126
|
}, "saveTaskCategories");
|
|
23116
23127
|
|
|
23117
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
23128
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/store/sqlite/task-close.js
|
|
23118
23129
|
var DEFAULT_AGENT_CLOSE = { allowed: true, min: 0.8 };
|
|
23119
23130
|
var ALLOWED = "taskAgentClose";
|
|
23120
23131
|
var MIN = "taskAgentCloseMin";
|
|
@@ -23170,7 +23181,50 @@ var SUGGESTION_COLUMNS = [
|
|
|
23170
23181
|
];
|
|
23171
23182
|
var CLEAR_SUGGESTION = SUGGESTION_COLUMNS.map((column2) => `${column2} = NULL`).join(", ");
|
|
23172
23183
|
|
|
23173
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
23184
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/store/sqlite/evidence-sources.js
|
|
23185
|
+
var EXCERPT_CHARS = 280;
|
|
23186
|
+
var excerptOf = /* @__PURE__ */ __name((text5) => {
|
|
23187
|
+
if (text5 == null)
|
|
23188
|
+
return null;
|
|
23189
|
+
const flat2 = String(text5).replace(/\s+/g, " ").trim();
|
|
23190
|
+
if (!flat2)
|
|
23191
|
+
return null;
|
|
23192
|
+
return flat2.length > EXCERPT_CHARS ? `${flat2.slice(0, EXCERPT_CHARS - 1)}\u2026` : flat2;
|
|
23193
|
+
}, "excerptOf");
|
|
23194
|
+
var iso = /* @__PURE__ */ __name((value) => value == null ? null : new Date(Number(value)).toISOString(), "iso");
|
|
23195
|
+
var textOf = /* @__PURE__ */ __name((value) => value == null || String(value).trim() === "" ? null : String(value), "textOf");
|
|
23196
|
+
var READS2 = {
|
|
23197
|
+
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 = ?",
|
|
23198
|
+
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 = ?",
|
|
23199
|
+
note: "SELECT title, NULL AS sender, updated_at AS at, body, 'notes' AS tool FROM notes WHERE id = ?",
|
|
23200
|
+
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 = ?",
|
|
23201
|
+
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 = ?",
|
|
23202
|
+
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 = ?",
|
|
23203
|
+
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 = ?"
|
|
23204
|
+
};
|
|
23205
|
+
var KIND = {
|
|
23206
|
+
meeting_transcript: "meeting",
|
|
23207
|
+
meeting_transcript_row: "meeting"
|
|
23208
|
+
};
|
|
23209
|
+
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) => {
|
|
23210
|
+
const thing = storedThing(link3.to_type, link3.to_id);
|
|
23211
|
+
const state = stateOfThing(database, thing);
|
|
23212
|
+
const read2 = READS2[thing.type];
|
|
23213
|
+
const row2 = read2 === void 0 || state === "unavailable" ? void 0 : database.prepare(read2).get(thing.id);
|
|
23214
|
+
const gone = state !== "available";
|
|
23215
|
+
return {
|
|
23216
|
+
ref: referenceOfThing(database, thing) ?? null,
|
|
23217
|
+
kind: KIND[thing.type] ?? thing.type,
|
|
23218
|
+
title: textOf(row2?.title),
|
|
23219
|
+
sender: textOf(row2?.sender),
|
|
23220
|
+
at: iso(row2?.at),
|
|
23221
|
+
excerpt: gone ? null : excerptOf(row2?.body),
|
|
23222
|
+
tool: textOf(row2?.tool),
|
|
23223
|
+
missing: gone
|
|
23224
|
+
};
|
|
23225
|
+
}), "evidenceSourcesOf");
|
|
23226
|
+
|
|
23227
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/store/ulid.js
|
|
23174
23228
|
import { randomBytes } from "node:crypto";
|
|
23175
23229
|
var CROCKFORD = "0123456789ABCDEFGHJKMNPQRSTVWXYZ";
|
|
23176
23230
|
var ulid = /* @__PURE__ */ __name((now2 = Date.now()) => {
|
|
@@ -23183,7 +23237,7 @@ var ulid = /* @__PURE__ */ __name((now2 = Date.now()) => {
|
|
|
23183
23237
|
return time3 + random;
|
|
23184
23238
|
}, "ulid");
|
|
23185
23239
|
|
|
23186
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
23240
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/store/sqlite/document-metadata.js
|
|
23187
23241
|
var FOLDED_FIELDS = ["title", "site", "language", "author"];
|
|
23188
23242
|
var encodeDocumentMetadata = /* @__PURE__ */ __name((meta, sections) => {
|
|
23189
23243
|
if (!meta && !sections?.length)
|
|
@@ -23204,7 +23258,7 @@ var languageOf = /* @__PURE__ */ __name((meta) => {
|
|
|
23204
23258
|
return typeof language === "string" && language !== "" ? language : null;
|
|
23205
23259
|
}, "languageOf");
|
|
23206
23260
|
|
|
23207
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
23261
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/store/sqlite/files.js
|
|
23208
23262
|
var isObject = /* @__PURE__ */ __name((value) => value !== null && typeof value === "object" && !Array.isArray(value), "isObject");
|
|
23209
23263
|
var objectOf = /* @__PURE__ */ __name((value) => {
|
|
23210
23264
|
if (isObject(value))
|
|
@@ -23447,7 +23501,7 @@ var filesStoreOver = /* @__PURE__ */ __name(({ database, now: now2 }) => {
|
|
|
23447
23501
|
};
|
|
23448
23502
|
}, "filesStoreOver");
|
|
23449
23503
|
|
|
23450
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
23504
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/store/sqlite/imported-documents.js
|
|
23451
23505
|
var IMPORTED_DOCUMENT_QUERY = defineQuery({
|
|
23452
23506
|
entity: "document",
|
|
23453
23507
|
backend: "sql",
|
|
@@ -23493,11 +23547,11 @@ var importedDocumentWhere = /* @__PURE__ */ __name((database, query) => {
|
|
|
23493
23547
|
return queryFilter(validateQuery(query, IMPORTED_DOCUMENT_QUERY), columns);
|
|
23494
23548
|
}, "importedDocumentWhere");
|
|
23495
23549
|
|
|
23496
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
23550
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/store/sqlite/notes.js
|
|
23497
23551
|
var NOTE_FORMATS = ["obsidian", "markdown"];
|
|
23498
|
-
var
|
|
23499
|
-
var optionalIso = /* @__PURE__ */ __name((value) => value == null ? null :
|
|
23500
|
-
var
|
|
23552
|
+
var iso2 = /* @__PURE__ */ __name((value) => new Date(Number(value)).toISOString(), "iso");
|
|
23553
|
+
var optionalIso = /* @__PURE__ */ __name((value) => value == null ? null : iso2(value), "optionalIso");
|
|
23554
|
+
var textOf2 = /* @__PURE__ */ __name((text5, what, max = 1e5, allowEmpty = false) => {
|
|
23501
23555
|
const value = text5.trim();
|
|
23502
23556
|
if (!value && !allowEmpty || value.length > max)
|
|
23503
23557
|
throw new CliError("validation_error", `${what} takes ${allowEmpty ? 0 : 1}\u2013${max} characters`);
|
|
@@ -23521,8 +23575,8 @@ var documentOf = /* @__PURE__ */ __name((row2) => ({
|
|
|
23521
23575
|
contentHash: row2.content_hash == null ? null : String(row2.content_hash),
|
|
23522
23576
|
revision: Number(row2.revision),
|
|
23523
23577
|
exportPath: row2.export_path == null ? null : String(row2.export_path),
|
|
23524
|
-
createdAt:
|
|
23525
|
-
updatedAt:
|
|
23578
|
+
createdAt: iso2(row2.created_at),
|
|
23579
|
+
updatedAt: iso2(row2.updated_at),
|
|
23526
23580
|
deletedAt: optionalIso(row2.deleted_at)
|
|
23527
23581
|
}), "documentOf");
|
|
23528
23582
|
var noteOf = /* @__PURE__ */ __name((row2) => ({
|
|
@@ -23537,8 +23591,8 @@ var noteOf = /* @__PURE__ */ __name((row2) => ({
|
|
|
23537
23591
|
contentHash: null,
|
|
23538
23592
|
revision: Number(row2.revision),
|
|
23539
23593
|
exportPath: null,
|
|
23540
|
-
createdAt:
|
|
23541
|
-
updatedAt:
|
|
23594
|
+
createdAt: iso2(row2.created_at),
|
|
23595
|
+
updatedAt: iso2(row2.updated_at),
|
|
23542
23596
|
deletedAt: optionalIso(row2.deleted_at)
|
|
23543
23597
|
}), "noteOf");
|
|
23544
23598
|
var noteRowOf = /* @__PURE__ */ __name((database, reference2) => {
|
|
@@ -23564,7 +23618,7 @@ var linkOf = /* @__PURE__ */ __name((database, row2) => {
|
|
|
23564
23618
|
evidence: row2.evidence == null ? null : String(row2.evidence),
|
|
23565
23619
|
provenance: metadata3.provenance ?? null,
|
|
23566
23620
|
confirmed: Number(row2.confirmed) === 1,
|
|
23567
|
-
createdAt:
|
|
23621
|
+
createdAt: iso2(row2.created_at)
|
|
23568
23622
|
};
|
|
23569
23623
|
}, "linkOf");
|
|
23570
23624
|
var requiredThing = /* @__PURE__ */ __name((database, reference2, what = "the target") => {
|
|
@@ -23603,7 +23657,7 @@ var insertLink = /* @__PURE__ */ __name((context, input) => {
|
|
|
23603
23657
|
const origin = oneOf(input.origin ?? "owner", LINK_ORIGINS, "a link's origin");
|
|
23604
23658
|
const from2 = requiredThing(database, input.from, "a link's source");
|
|
23605
23659
|
const to = input.to === void 0 ? null : requiredThing(database, input.to, "a link's target");
|
|
23606
|
-
const targetText = input.targetText === void 0 ? null :
|
|
23660
|
+
const targetText = input.targetText === void 0 ? null : textOf2(input.targetText, "a link's target", 500);
|
|
23607
23661
|
if (to === null && targetText === null)
|
|
23608
23662
|
throw new CliError("validation_error", "a link needs a target");
|
|
23609
23663
|
if (to !== null) {
|
|
@@ -23612,8 +23666,8 @@ var insertLink = /* @__PURE__ */ __name((context, input) => {
|
|
|
23612
23666
|
return linkOf(database, existing);
|
|
23613
23667
|
}
|
|
23614
23668
|
const at = now2();
|
|
23615
|
-
const provenance2 = input.provenance === void 0 ? void 0 :
|
|
23616
|
-
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 :
|
|
23669
|
+
const provenance2 = input.provenance === void 0 ? void 0 : textOf2(input.provenance, "provenance", 2e3);
|
|
23670
|
+
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);
|
|
23617
23671
|
if (to === null && targetText !== null)
|
|
23618
23672
|
resolveKey(database, targetKey(targetText));
|
|
23619
23673
|
return linkOf(database, database.prepare("SELECT * FROM links WHERE id = ?").get(Number(row2?.id)));
|
|
@@ -23626,7 +23680,7 @@ var folderOf = /* @__PURE__ */ __name((row2) => {
|
|
|
23626
23680
|
name: folder ? String(row2.name) : `${String(row2.provider)}:${String(row2.external_id)}`,
|
|
23627
23681
|
provider: String(row2.provider),
|
|
23628
23682
|
format: settings.format ?? (folder ? "obsidian" : "markdown"),
|
|
23629
|
-
createdAt:
|
|
23683
|
+
createdAt: iso2(row2.created_at),
|
|
23630
23684
|
...folder ? {} : { account: { provider: String(row2.provider), account: String(row2.external_id) } }
|
|
23631
23685
|
};
|
|
23632
23686
|
}, "folderOf");
|
|
@@ -23731,7 +23785,7 @@ var notesStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
23731
23785
|
addFolder: /* @__PURE__ */ __name(async ({ name, format = "obsidian" }) => {
|
|
23732
23786
|
const at = now2();
|
|
23733
23787
|
const checked = oneOf(format, NOTE_FORMATS, "a folder's format");
|
|
23734
|
-
const row2 = database.prepare("INSERT INTO accounts (provider, external_id, name, settings, created_at, updated_at) VALUES (?, ?, ?, ?, ?, ?) RETURNING id").get(folderProviderOf(checked), ulid(at),
|
|
23788
|
+
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);
|
|
23735
23789
|
return folderOf(folderRow(String(row2?.id)));
|
|
23736
23790
|
}, "addFolder"),
|
|
23737
23791
|
folders: /* @__PURE__ */ __name(async () => database.prepare(`SELECT * FROM accounts WHERE ${folderProviderSql()} ORDER BY name, id`).all().map(folderOf), "folders"),
|
|
@@ -23743,14 +23797,14 @@ var notesStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
23743
23797
|
if (found2 || !create)
|
|
23744
23798
|
return found2 ? folderOf(found2) : void 0;
|
|
23745
23799
|
const at = now2();
|
|
23746
|
-
database.prepare("INSERT OR IGNORE INTO accounts (provider, external_id, name, settings, created_at, updated_at) VALUES (?, ?, NULL, ?, ?, ?)").run(provider,
|
|
23800
|
+
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);
|
|
23747
23801
|
return folderOf(find2());
|
|
23748
23802
|
}, "documentsAccount"),
|
|
23749
23803
|
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"),
|
|
23750
23804
|
saveFileNote: /* @__PURE__ */ __name(async (input) => write(database, () => {
|
|
23751
23805
|
const folder = Number(folderRow(input.folderId).id);
|
|
23752
|
-
const path =
|
|
23753
|
-
const text5 =
|
|
23806
|
+
const path = textOf2(input.path, "a note's path", 4096);
|
|
23807
|
+
const text5 = textOf2(input.text, "a note's text", MAX_TEXT_CHARS, true);
|
|
23754
23808
|
const frontMatter = input.frontMatter == null ? null : JSON.stringify(input.frontMatter);
|
|
23755
23809
|
let metadata3 = encodeDocumentMetadata(input.metadata, input.sections);
|
|
23756
23810
|
const language = languageOf(input.metadata);
|
|
@@ -23801,7 +23855,7 @@ var notesStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
23801
23855
|
}), "saveFileNote"),
|
|
23802
23856
|
renameFileNote: /* @__PURE__ */ __name(async (folderId, from2, to) => write(database, () => {
|
|
23803
23857
|
const folder = Number(folderRow(folderId).id);
|
|
23804
|
-
const target =
|
|
23858
|
+
const target = textOf2(to, "a note's path", 4096);
|
|
23805
23859
|
const at = now2();
|
|
23806
23860
|
const place = fileAt(folder, from2, true);
|
|
23807
23861
|
const legacy = database.prepare("SELECT id FROM documents WHERE account_id = ? AND external_id = ? AND deleted_at IS NULL").get(folder, from2);
|
|
@@ -23868,7 +23922,7 @@ var notesStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
23868
23922
|
const owner = ownerPerson(database);
|
|
23869
23923
|
const [subject2] = about.map((reference2) => requiredThing(database, reference2));
|
|
23870
23924
|
const notable = subject2 ?? owner;
|
|
23871
|
-
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 :
|
|
23925
|
+
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);
|
|
23872
23926
|
const id2 = Number(row2?.id);
|
|
23873
23927
|
for (const reference2 of about.slice(1))
|
|
23874
23928
|
insertLink(context, { from: `note:${id2}`, to: reference2, kind: "about", origin: "owner" });
|
|
@@ -23913,7 +23967,7 @@ var notesStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
23913
23967
|
throw new CliError("validation_error", "a file note is edited in its file; the next import reads it");
|
|
23914
23968
|
const bare = id2.replace(/^note:/, "");
|
|
23915
23969
|
const found2 = noteRow(bare);
|
|
23916
|
-
const changed = database.prepare("UPDATE notes SET body = ?, revision = revision + 1, updated_at = ? WHERE id = ? AND revision = ? AND deleted_at IS NULL").run(
|
|
23970
|
+
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;
|
|
23917
23971
|
if (!changed)
|
|
23918
23972
|
throw new CliError("validation_error", "the note changed; read its current revision before editing");
|
|
23919
23973
|
database.prepare("INSERT INTO note_revisions (note_id, body, revision, created_at) VALUES (?, ?, ?, ?)").run(Number(bare), String(found2.body), revision2, now2());
|
|
@@ -24003,9 +24057,9 @@ var notesStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
24003
24057
|
};
|
|
24004
24058
|
}, "notesStoreOver");
|
|
24005
24059
|
|
|
24006
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
24060
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/store/sqlite/memories.js
|
|
24007
24061
|
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";
|
|
24008
|
-
var
|
|
24062
|
+
var iso3 = /* @__PURE__ */ __name((value) => new Date(Number(value)).toISOString(), "iso");
|
|
24009
24063
|
var oneOf2 = /* @__PURE__ */ __name((value, allowed, what) => {
|
|
24010
24064
|
if (typeof value !== "string" || !allowed.includes(value))
|
|
24011
24065
|
throw new CliError("validation_error", `${what} is one of ${allowed.join(", ")}`);
|
|
@@ -24033,6 +24087,43 @@ var linkEvidence = /* @__PURE__ */ __name((context, from2, references, author) =
|
|
|
24033
24087
|
}
|
|
24034
24088
|
}, "linkEvidence");
|
|
24035
24089
|
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");
|
|
24090
|
+
var SUBJECT_NAMES = {
|
|
24091
|
+
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 = ?",
|
|
24092
|
+
project: "SELECT 0 AS owner, name FROM projects WHERE id = ?",
|
|
24093
|
+
organization: "SELECT 0 AS owner, name FROM organizations WHERE id = ?"
|
|
24094
|
+
};
|
|
24095
|
+
var subjectOf = /* @__PURE__ */ __name((database, row2) => {
|
|
24096
|
+
if (row2.subject_type == null)
|
|
24097
|
+
return { subject: null, subjectName: null, subjectIsOwner: false };
|
|
24098
|
+
const thing = storedThing(row2.subject_type, row2.subject_id);
|
|
24099
|
+
const read2 = SUBJECT_NAMES[thing.type];
|
|
24100
|
+
const named2 = read2 === void 0 ? void 0 : database.prepare(read2).get(thing.id);
|
|
24101
|
+
return {
|
|
24102
|
+
subject: referenceOfThing(database, thing) ?? null,
|
|
24103
|
+
subjectName: named2?.name == null ? null : String(named2.name),
|
|
24104
|
+
subjectIsOwner: Number(named2?.owner) === 1
|
|
24105
|
+
};
|
|
24106
|
+
}, "subjectOf");
|
|
24107
|
+
var dropLinksOf = /* @__PURE__ */ __name((database, thing) => {
|
|
24108
|
+
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);
|
|
24109
|
+
database.prepare("DELETE FROM links WHERE to_type = ? AND to_id = ?").run(thing.type, thing.id);
|
|
24110
|
+
return count;
|
|
24111
|
+
}, "dropLinksOf");
|
|
24112
|
+
var erase = /* @__PURE__ */ __name((database, work) => {
|
|
24113
|
+
database.exec("PRAGMA secure_delete = ON");
|
|
24114
|
+
try {
|
|
24115
|
+
const done = write(database, () => {
|
|
24116
|
+
const result = work();
|
|
24117
|
+
for (const index2 of ["memory_words", "memory_stems"])
|
|
24118
|
+
database.prepare(`INSERT INTO ${index2} (${index2}) VALUES ('optimize')`).run();
|
|
24119
|
+
return result;
|
|
24120
|
+
});
|
|
24121
|
+
database.exec("PRAGMA wal_checkpoint(TRUNCATE)");
|
|
24122
|
+
return done;
|
|
24123
|
+
} finally {
|
|
24124
|
+
database.exec("PRAGMA secure_delete = OFF");
|
|
24125
|
+
}
|
|
24126
|
+
}, "erase");
|
|
24036
24127
|
var memoriesStoreOver = /* @__PURE__ */ __name((context) => {
|
|
24037
24128
|
const { database, now: now2 } = context;
|
|
24038
24129
|
const stemmerFor2 = stemmerCache();
|
|
@@ -24041,7 +24132,7 @@ var memoriesStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
24041
24132
|
ref: `memory:${row2.id}`,
|
|
24042
24133
|
kind: row2.kind,
|
|
24043
24134
|
body: String(row2.body),
|
|
24044
|
-
|
|
24135
|
+
...subjectOf(database, row2),
|
|
24045
24136
|
author: authorOf(row2),
|
|
24046
24137
|
model: row2.model == null ? null : String(row2.model),
|
|
24047
24138
|
confidence: row2.confidence == null ? null : Number(row2.confidence),
|
|
@@ -24049,9 +24140,9 @@ var memoriesStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
24049
24140
|
scope: row2.scope,
|
|
24050
24141
|
supersedes: row2.supersedes_id == null ? null : `memory:${row2.supersedes_id}`,
|
|
24051
24142
|
evidence: evidenceOf(context, { type: "memory", id: Number(row2.id) }),
|
|
24052
|
-
lastVerifiedAt: row2.last_verified_at == null ? null :
|
|
24053
|
-
createdAt:
|
|
24054
|
-
updatedAt:
|
|
24143
|
+
lastVerifiedAt: row2.last_verified_at == null ? null : iso3(row2.last_verified_at),
|
|
24144
|
+
createdAt: iso3(row2.created_at),
|
|
24145
|
+
updatedAt: iso3(row2.updated_at)
|
|
24055
24146
|
}), "memoryOf");
|
|
24056
24147
|
const rowOf = /* @__PURE__ */ __name((reference2) => {
|
|
24057
24148
|
const thing = requiredThing(database, reference2.includes(":") ? reference2 : `memory:${reference2}`, "the memory");
|
|
@@ -24106,6 +24197,17 @@ var memoriesStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
24106
24197
|
}, "list"),
|
|
24107
24198
|
confirm: /* @__PURE__ */ __name(async (reference2) => setStatus(reference2, "confirmed", true), "confirm"),
|
|
24108
24199
|
markStale: /* @__PURE__ */ __name(async (reference2) => setStatus(reference2, "stale", false), "markStale"),
|
|
24200
|
+
remove: /* @__PURE__ */ __name(async (reference2) => {
|
|
24201
|
+
const id2 = Number(rowOf(reference2).id);
|
|
24202
|
+
const links2 = erase(database, () => {
|
|
24203
|
+
database.prepare("UPDATE memories SET supersedes_id = NULL WHERE supersedes_id = ?").run(id2);
|
|
24204
|
+
const count = dropLinksOf(database, { type: "memory", id: id2 });
|
|
24205
|
+
database.prepare("DELETE FROM memories WHERE id = ?").run(id2);
|
|
24206
|
+
return count;
|
|
24207
|
+
});
|
|
24208
|
+
return { ref: `memory:${id2}`, removed: true, links: links2 };
|
|
24209
|
+
}, "remove"),
|
|
24210
|
+
sources: /* @__PURE__ */ __name(async (reference2) => evidenceSourcesOf(database, { type: "memory", id: Number(rowOf(reference2).id) }), "sources"),
|
|
24109
24211
|
search: /* @__PURE__ */ __name(async (text5, { subject: subjectRef, scope: scope3, limit = 20 } = {}) => {
|
|
24110
24212
|
const subject2 = subjectRef === void 0 ? void 0 : requiredThing(database, subjectRef);
|
|
24111
24213
|
drainCorpus(database, CORPORA.memory, stemmerFor2);
|
|
@@ -24119,7 +24221,7 @@ var memoriesStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
24119
24221
|
};
|
|
24120
24222
|
}, "memoriesStoreOver");
|
|
24121
24223
|
|
|
24122
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
24224
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/store/sqlite/task-first-pass.js
|
|
24123
24225
|
var DEFAULT_FIRST_PASS_PER_CHAT = 0;
|
|
24124
24226
|
var KEY = "taskFirstPassPerChat";
|
|
24125
24227
|
var firstPassPerChatOf = /* @__PURE__ */ __name((value, setting = "task_first_pass_per_chat") => {
|
|
@@ -24139,7 +24241,7 @@ var saveFirstPassPerChat = /* @__PURE__ */ __name((database, value, now2) => {
|
|
|
24139
24241
|
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);
|
|
24140
24242
|
}, "saveFirstPassPerChat");
|
|
24141
24243
|
|
|
24142
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
24244
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/store/sqlite/task-relations.js
|
|
24143
24245
|
var TASK_RELATION_KINDS = [
|
|
24144
24246
|
"blocked-by",
|
|
24145
24247
|
"follow-up-of",
|
|
@@ -24269,7 +24371,7 @@ var taskRelationsStoreOver = /* @__PURE__ */ __name((context, record4) => {
|
|
|
24269
24371
|
};
|
|
24270
24372
|
}, "taskRelationsStoreOver");
|
|
24271
24373
|
|
|
24272
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
24374
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/store/sqlite/work-tasks.js
|
|
24273
24375
|
var TASK_ROLES = ["assignee", "reviewer", "watcher"];
|
|
24274
24376
|
var TASK_EVENT_KINDS = [
|
|
24275
24377
|
"created",
|
|
@@ -24286,17 +24388,17 @@ var TASK_EVENT_KINDS = [
|
|
|
24286
24388
|
"category",
|
|
24287
24389
|
"close-suggestion"
|
|
24288
24390
|
];
|
|
24289
|
-
var
|
|
24391
|
+
var iso4 = /* @__PURE__ */ __name((value) => value == null ? null : new Date(Number(value)).toISOString(), "iso");
|
|
24290
24392
|
var recordTaskEvent = /* @__PURE__ */ __name((database, task, actor, kind3, changes, at) => {
|
|
24291
24393
|
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);
|
|
24292
24394
|
}, "recordTaskEvent");
|
|
24293
|
-
var
|
|
24395
|
+
var textOf3 = /* @__PURE__ */ __name((value, what, max) => {
|
|
24294
24396
|
const text5 = value.trim();
|
|
24295
24397
|
if (!text5 || text5.length > max)
|
|
24296
24398
|
throw new CliError("validation_error", `${what} takes 1\u2013${max} characters`);
|
|
24297
24399
|
return text5;
|
|
24298
24400
|
}, "textOf");
|
|
24299
|
-
var claimOf = /* @__PURE__ */ __name((row2, at) => row2.claimed_by != null && Number(row2.claimed_until) >= at ? { claimedBy: String(row2.claimed_by), claimedUntil:
|
|
24401
|
+
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");
|
|
24300
24402
|
var priorityOf = /* @__PURE__ */ __name((value) => {
|
|
24301
24403
|
if (value !== null && !(Number.isInteger(value) && value >= 0 && value <= 4))
|
|
24302
24404
|
throw new CliError("validation_error", "a priority is 0 (urgent) to 4 (low)");
|
|
@@ -24357,9 +24459,9 @@ var workTaskOperationsOver = /* @__PURE__ */ __name((context) => {
|
|
|
24357
24459
|
priority: row2.priority == null ? null : Number(row2.priority),
|
|
24358
24460
|
parent: row2.parent_id == null ? null : reference2(Number(row2.parent_id)),
|
|
24359
24461
|
source: row2.source_locator == null ? null : String(row2.source_locator),
|
|
24360
|
-
dueAt:
|
|
24361
|
-
nextCheckAt:
|
|
24362
|
-
closedAt:
|
|
24462
|
+
dueAt: iso4(row2.due_at),
|
|
24463
|
+
nextCheckAt: iso4(row2.next_check_at),
|
|
24464
|
+
closedAt: iso4(row2.closed_at),
|
|
24363
24465
|
reason: row2.close_reason == null ? null : String(row2.close_reason),
|
|
24364
24466
|
verdict: row2.verdict == null ? null : row2.verdict,
|
|
24365
24467
|
category: row2.category == null ? null : String(row2.category),
|
|
@@ -24367,8 +24469,8 @@ var workTaskOperationsOver = /* @__PURE__ */ __name((context) => {
|
|
|
24367
24469
|
closeCertainty: row2.close_certainty == null ? null : Number(row2.close_certainty),
|
|
24368
24470
|
closeSuggestion: closeSuggestionOf(database, row2),
|
|
24369
24471
|
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 })),
|
|
24370
|
-
createdAt:
|
|
24371
|
-
updatedAt:
|
|
24472
|
+
createdAt: iso4(row2.created_at),
|
|
24473
|
+
updatedAt: iso4(row2.updated_at)
|
|
24372
24474
|
};
|
|
24373
24475
|
}, "detailsOf");
|
|
24374
24476
|
const rowById = /* @__PURE__ */ __name((id2) => database.prepare("SELECT * FROM tasks WHERE id = ?").get(id2), "rowById");
|
|
@@ -24387,12 +24489,12 @@ var workTaskOperationsOver = /* @__PURE__ */ __name((context) => {
|
|
|
24387
24489
|
recordTaskEvent(database, task, actor, event, { [column2]: [before2[column2] ?? null, value] }, at);
|
|
24388
24490
|
}, "change");
|
|
24389
24491
|
if (fields4.title !== void 0) {
|
|
24390
|
-
const title =
|
|
24492
|
+
const title = textOf3(fields4.title, "a task's title", 300);
|
|
24391
24493
|
change("title", title, created ? void 0 : "title");
|
|
24392
24494
|
change("title_folded", folded3(title));
|
|
24393
24495
|
}
|
|
24394
24496
|
if (fields4.description !== void 0)
|
|
24395
|
-
change("description", fields4.description === null ? null :
|
|
24497
|
+
change("description", fields4.description === null ? null : textOf3(fields4.description, "a description", 2e4), created ? void 0 : "description");
|
|
24396
24498
|
if (fields4.priority !== void 0)
|
|
24397
24499
|
change("priority", priorityOf(fields4.priority), "priority");
|
|
24398
24500
|
if (fields4.parent !== void 0)
|
|
@@ -24420,7 +24522,7 @@ var workTaskOperationsOver = /* @__PURE__ */ __name((context) => {
|
|
|
24420
24522
|
}
|
|
24421
24523
|
}
|
|
24422
24524
|
if (fields4.reason !== void 0) {
|
|
24423
|
-
const reason = fields4.reason === null ? null :
|
|
24525
|
+
const reason = fields4.reason === null ? null : textOf3(fields4.reason, "a reason", 500);
|
|
24424
24526
|
change("close_reason", reason);
|
|
24425
24527
|
change("close_reason_folded", folded3(reason));
|
|
24426
24528
|
}
|
|
@@ -24443,7 +24545,7 @@ var workTaskOperationsOver = /* @__PURE__ */ __name((context) => {
|
|
|
24443
24545
|
const number3 = Number(counted.tasks_count);
|
|
24444
24546
|
if (!Number.isSafeInteger(number3) || number3 < 1)
|
|
24445
24547
|
throw new CliError("configuration_error", "the project task counter exceeds the safe numbering range");
|
|
24446
|
-
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}`,
|
|
24548
|
+
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);
|
|
24447
24549
|
recordTaskEvent(database, id2, actor, "created", null, at);
|
|
24448
24550
|
const { title: _title, project: _project, type: _type, ...fields4 } = input;
|
|
24449
24551
|
edit(id2, fields4, actor, true);
|
|
@@ -24522,7 +24624,7 @@ var workTaskOperationsOver = /* @__PURE__ */ __name((context) => {
|
|
|
24522
24624
|
const row2 = rowById(task);
|
|
24523
24625
|
if (row2.status !== "open")
|
|
24524
24626
|
throw new CliError("validation_error", `task ${String(row2.key)} is ${String(row2.status)}; only an open task is claimed`);
|
|
24525
|
-
throw new CliError("validation_error", `${String(row2.claimed_by)} holds task ${String(row2.key)} until ${
|
|
24627
|
+
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) });
|
|
24526
24628
|
}
|
|
24527
24629
|
return details2(task);
|
|
24528
24630
|
}, "claim"),
|
|
@@ -24543,7 +24645,7 @@ var workTaskOperationsOver = /* @__PURE__ */ __name((context) => {
|
|
|
24543
24645
|
kind: row2.kind,
|
|
24544
24646
|
actor: row2.actor_type == null ? null : { type: row2.actor_type, id: Number(row2.actor_id) },
|
|
24545
24647
|
changes: row2.changes == null ? null : JSON.parse(String(row2.changes)),
|
|
24546
|
-
at:
|
|
24648
|
+
at: iso4(row2.created_at)
|
|
24547
24649
|
})), "events")
|
|
24548
24650
|
};
|
|
24549
24651
|
}, "workTaskOperationsOver");
|
|
@@ -24556,7 +24658,7 @@ var workTasksOver = /* @__PURE__ */ __name((context) => {
|
|
|
24556
24658
|
};
|
|
24557
24659
|
}, "workTasksOver");
|
|
24558
24660
|
|
|
24559
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
24661
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/store/sqlite/task-close-store.js
|
|
24560
24662
|
var taskCloseOver = /* @__PURE__ */ __name((context) => {
|
|
24561
24663
|
const { database, now: now2 } = context;
|
|
24562
24664
|
const liveRow = /* @__PURE__ */ __name((id2) => {
|
|
@@ -24602,7 +24704,7 @@ var taskCloseOver = /* @__PURE__ */ __name((context) => {
|
|
|
24602
24704
|
};
|
|
24603
24705
|
}, "taskCloseOver");
|
|
24604
24706
|
|
|
24605
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
24707
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/store/sqlite/task-pairs.js
|
|
24606
24708
|
var TASK_PAIR_DECISIONS = ["review", "unsure", "merged", "rejected", "unmerged", "attached", "new"];
|
|
24607
24709
|
var taskPairsOver = /* @__PURE__ */ __name((context, similarity) => {
|
|
24608
24710
|
const { database, now: now2 } = context;
|
|
@@ -24821,7 +24923,7 @@ var taskPairsOver = /* @__PURE__ */ __name((context, similarity) => {
|
|
|
24821
24923
|
};
|
|
24822
24924
|
}, "taskPairsOver");
|
|
24823
24925
|
|
|
24824
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
24926
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/store/sqlite/tasks.js
|
|
24825
24927
|
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";
|
|
24826
24928
|
var taskStoreOver = /* @__PURE__ */ __name((context) => {
|
|
24827
24929
|
const { database, now: now2 } = context;
|
|
@@ -25016,7 +25118,7 @@ var oneOf3 = /* @__PURE__ */ __name((values, value, column2) => {
|
|
|
25016
25118
|
throw new CliError("configuration_error", `the store holds a task with an unknown ${column2} "${String(value)}"`);
|
|
25017
25119
|
}, "oneOf");
|
|
25018
25120
|
|
|
25019
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
25121
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/store/accounts.js
|
|
25020
25122
|
var accountAccountsOver = /* @__PURE__ */ __name((context) => {
|
|
25021
25123
|
const { database } = context;
|
|
25022
25124
|
const { accountPk: accountPk2, findAccountPk: findAccountPk2 } = keysOver(context);
|
|
@@ -25061,7 +25163,7 @@ var accountsStoreOver = /* @__PURE__ */ __name((context, keyed) => {
|
|
|
25061
25163
|
};
|
|
25062
25164
|
}, "accountsStoreOver");
|
|
25063
25165
|
|
|
25064
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
25166
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/store/sqlite/attachments.js
|
|
25065
25167
|
var refColumn = /* @__PURE__ */ __name((ref3) => ref3 && Object.keys(ref3).length > 0 ? { providerRef: JSON.stringify(ref3) } : {}, "refColumn");
|
|
25066
25168
|
var updatePlaced = /* @__PURE__ */ __name(({ orm }, chatKey, messageId, files2, change) => {
|
|
25067
25169
|
const message2 = orm.select({ pk: messages.id }).from(messages).where(and(eq(messages.chatId, chatKey), eq(messages.externalId, messageId))).get();
|
|
@@ -25085,7 +25187,7 @@ var keepDownloads = /* @__PURE__ */ __name((context, chatKey, messageId, files2)
|
|
|
25085
25187
|
})), "keepDownloads");
|
|
25086
25188
|
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");
|
|
25087
25189
|
|
|
25088
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
25190
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/store/attachments.js
|
|
25089
25191
|
var accountAttachmentsOver = /* @__PURE__ */ __name((context) => {
|
|
25090
25192
|
const { database } = context;
|
|
25091
25193
|
const { findAccountPk: findAccountPk2, findChatPk: findChatPk2, chatKeyOf } = keysOver(context);
|
|
@@ -25142,7 +25244,7 @@ var attachmentsStoreOver = /* @__PURE__ */ __name((context, keyed) => ({
|
|
|
25142
25244
|
}, "keepAttachmentText")
|
|
25143
25245
|
}), "attachmentsStoreOver");
|
|
25144
25246
|
|
|
25145
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
25247
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/store/sqlite/chat-rekey.js
|
|
25146
25248
|
var chatRow = /* @__PURE__ */ __name((context, accountKey, chatId) => context.database.prepare("SELECT * FROM chats WHERE account_id = ? AND external_id = ?").get(accountKey, chatId), "chatRow");
|
|
25147
25249
|
var pointerMover = /* @__PURE__ */ __name((context, type) => {
|
|
25148
25250
|
const statements = pointerPairs(context.database).filter(({ table }) => table !== "involvements").map(({ table, pointer }) => {
|
|
@@ -25322,7 +25424,7 @@ var rekeyChats = /* @__PURE__ */ __name((context, key2, accountKey, pairs, lockM
|
|
|
25322
25424
|
return done;
|
|
25323
25425
|
}, "rekeyChats");
|
|
25324
25426
|
|
|
25325
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
25427
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/store/sqlite/completeness.js
|
|
25326
25428
|
var historyStartKey = /* @__PURE__ */ __name((chatId) => `history_start:${chatId}`, "historyStartKey");
|
|
25327
25429
|
var fetchedKey = /* @__PURE__ */ __name((chatId) => `fetched:${chatId}`, "fetchedKey");
|
|
25328
25430
|
var CHAT_LIST_KEY = "chat_list_complete";
|
|
@@ -25354,7 +25456,7 @@ var chatCompleteness = /* @__PURE__ */ __name(({ database }, accountKey, chatIds
|
|
|
25354
25456
|
});
|
|
25355
25457
|
}, "chatCompleteness");
|
|
25356
25458
|
|
|
25357
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
25459
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/store/chats.js
|
|
25358
25460
|
var chatsStoreOver = /* @__PURE__ */ __name((context) => {
|
|
25359
25461
|
const { database } = context;
|
|
25360
25462
|
const { accountPk: accountPk2, findAccountPk: findAccountPk2, writeState: writeState2 } = keysOver(context);
|
|
@@ -25438,6 +25540,13 @@ var chatsStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
25438
25540
|
const row2 = context.database.prepare("SELECT kind FROM chats WHERE account_id = ? AND external_id = ?").get(accountKey, chatId);
|
|
25439
25541
|
return row2 ? String(row2.kind) : void 0;
|
|
25440
25542
|
}, "chatKind"),
|
|
25543
|
+
chatTitle: /* @__PURE__ */ __name(async (key2, chatId) => {
|
|
25544
|
+
const accountKey = findAccountPk2(key2);
|
|
25545
|
+
if (accountKey === void 0)
|
|
25546
|
+
return null;
|
|
25547
|
+
const row2 = context.database.prepare("SELECT title FROM chats WHERE account_id = ? AND external_id = ?").get(accountKey, chatId);
|
|
25548
|
+
return row2?.title == null ? null : String(row2.title);
|
|
25549
|
+
}, "chatTitle"),
|
|
25441
25550
|
chatActivity: /* @__PURE__ */ __name(async (key2, since, where) => {
|
|
25442
25551
|
const accountKey = findAccountPk2(key2);
|
|
25443
25552
|
return accountKey === void 0 ? { chats: [], storedAt: null } : chatActivity(context, accountKey, since, where);
|
|
@@ -25454,7 +25563,7 @@ var chatsStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
25454
25563
|
};
|
|
25455
25564
|
}, "chatsStoreOver");
|
|
25456
25565
|
|
|
25457
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
25566
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/store/sqlite/batches.js
|
|
25458
25567
|
import { createHash as createHash6 } from "node:crypto";
|
|
25459
25568
|
var BATCH_CONTEXT = 50;
|
|
25460
25569
|
var replied = /* @__PURE__ */ __name((m) => sql`EXISTS (SELECT 1 FROM messages p WHERE p.chat_id = ${m}.chat_id
|
|
@@ -25592,7 +25701,7 @@ var saveAnswers = /* @__PURE__ */ __name((context, id2, answer) => {
|
|
|
25592
25701
|
var clearAnswers = /* @__PURE__ */ __name(({ orm }, chatKey, model) => Number(orm.all(sql`DELETE FROM message_links WHERE chat_id = ${chatKey} AND source = 'agent'
|
|
25593
25702
|
${model === void 0 ? sql`` : sql`AND method = ${model}`} RETURNING 1 AS n`).length), "clearAnswers");
|
|
25594
25703
|
|
|
25595
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
25704
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/store/sqlite/conversations.js
|
|
25596
25705
|
import { setTimeout } from "node:timers/promises";
|
|
25597
25706
|
var position = /* @__PURE__ */ __name((sentAt, pk) => `${sentAt}:${pk}`, "position");
|
|
25598
25707
|
var linkInputs = /* @__PURE__ */ __name(({ orm }, chatKey, { after: after2, limit }) => {
|
|
@@ -25904,7 +26013,7 @@ var agentAnswers = /* @__PURE__ */ __name(({ orm }, chatKey) => new Map(orm.all(
|
|
|
25904
26013
|
AND NOT EXISTS (SELECT 1 FROM messages d
|
|
25905
26014
|
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");
|
|
25906
26015
|
|
|
25907
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
26016
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/store/conversations.js
|
|
25908
26017
|
var conversationsStoreOver = /* @__PURE__ */ __name((context) => {
|
|
25909
26018
|
const { database } = context;
|
|
25910
26019
|
const { findAccountPk: findAccountPk2, findChatPk: findChatPk2, chatKeyOf } = keysOver(context);
|
|
@@ -26011,7 +26120,7 @@ var conversationsStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
26011
26120
|
};
|
|
26012
26121
|
}, "conversationsStoreOver");
|
|
26013
26122
|
|
|
26014
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
26123
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/store/counters.js
|
|
26015
26124
|
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";
|
|
26016
26125
|
var accountCountersOver = /* @__PURE__ */ __name((context) => {
|
|
26017
26126
|
const { database } = context;
|
|
@@ -26036,7 +26145,7 @@ var countersStoreOver = /* @__PURE__ */ __name((context, keyed) => ({
|
|
|
26036
26145
|
counterTargets: /* @__PURE__ */ __name(async (execution, options) => counterTargets(context, execution, options), "counterTargets")
|
|
26037
26146
|
}), "countersStoreOver");
|
|
26038
26147
|
|
|
26039
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
26148
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/store/sqlite/mentions.js
|
|
26040
26149
|
var MENTION_STATUSES = ["found", "linked", "dismissed"];
|
|
26041
26150
|
var MENTION_QUERY = defineQuery({
|
|
26042
26151
|
entity: "mention",
|
|
@@ -26252,7 +26361,7 @@ var listPlaces = /* @__PURE__ */ __name((database, { limit, offset }) => {
|
|
|
26252
26361
|
return { items: hasMore ? rows.slice(0, limit) : rows, hasMore };
|
|
26253
26362
|
}, "listPlaces");
|
|
26254
26363
|
|
|
26255
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
26364
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/store/mentions.js
|
|
26256
26365
|
var accountMentionsOver = /* @__PURE__ */ __name((context) => {
|
|
26257
26366
|
const { database } = context;
|
|
26258
26367
|
const { findAccountPk: findAccountPk2 } = keysOver(context);
|
|
@@ -26287,7 +26396,7 @@ var mentionsStoreOver = /* @__PURE__ */ __name((context, keyed) => ({
|
|
|
26287
26396
|
places: /* @__PURE__ */ __name(async (window) => listPlaces(context.database, window), "places")
|
|
26288
26397
|
}), "mentionsStoreOver");
|
|
26289
26398
|
|
|
26290
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
26399
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/store/sqlite/document-links.js
|
|
26291
26400
|
var documentLinkMessages = /* @__PURE__ */ __name(({ database }, chatKey, messageId) => {
|
|
26292
26401
|
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");
|
|
26293
26402
|
const rows = messageId === void 0 ? read2.all(chatKey) : read2.all(chatKey, messageId);
|
|
@@ -26302,7 +26411,7 @@ var documentLinkMessages = /* @__PURE__ */ __name(({ database }, chatKey, messag
|
|
|
26302
26411
|
}));
|
|
26303
26412
|
}, "documentLinkMessages");
|
|
26304
26413
|
|
|
26305
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
26414
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/store/sqlite/follow-ups.js
|
|
26306
26415
|
var stemmerFor = stemmerCache();
|
|
26307
26416
|
var laterSharingRare = /* @__PURE__ */ __name((context, wanted, { rareAt, limit }) => {
|
|
26308
26417
|
if (wanted.length > 50 || !Number.isInteger(limit) || limit < 1 || limit > 100)
|
|
@@ -26347,7 +26456,7 @@ var laterSharingRare = /* @__PURE__ */ __name((context, wanted, { rareAt, limit
|
|
|
26347
26456
|
});
|
|
26348
26457
|
}, "laterSharingRare");
|
|
26349
26458
|
|
|
26350
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
26459
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/store/messages.js
|
|
26351
26460
|
var accountMessagesOver = /* @__PURE__ */ __name((context) => {
|
|
26352
26461
|
const { database } = context;
|
|
26353
26462
|
const { accountPk: accountPk2, findAccountPk: findAccountPk2, findChatPk: findChatPk2, chatKeyOf, chatPkFor: chatPkFor2, answeredChatPk: answeredChatPk2, upsertMessage: upsertMessage2 } = keysOver(context);
|
|
@@ -26482,9 +26591,9 @@ var messagesStoreOver = /* @__PURE__ */ __name((context, keyed) => ({
|
|
|
26482
26591
|
laterSharingRare: /* @__PURE__ */ __name(async (wanted, options) => laterSharingRare(context, wanted, options), "laterSharingRare")
|
|
26483
26592
|
}), "messagesStoreOver");
|
|
26484
26593
|
|
|
26485
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
26594
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/store/sqlite/person-preparation.js
|
|
26486
26595
|
var GLOBAL_PROJECT = "SELECT id FROM main.projects WHERE account_id IS NULL AND deleted_at IS NULL";
|
|
26487
|
-
var
|
|
26596
|
+
var iso5 = /* @__PURE__ */ __name((value) => value == null ? null : new Date(Number(value)).toISOString(), "iso");
|
|
26488
26597
|
var personPreparation = /* @__PURE__ */ __name(({ database }, uid, { accounts: accounts2, limit }) => {
|
|
26489
26598
|
const person2 = Number(uid);
|
|
26490
26599
|
if (!/^[1-9]\d*$/.test(uid) || !Number.isSafeInteger(person2) || !Number.isSafeInteger(limit) || limit < 1)
|
|
@@ -26505,7 +26614,7 @@ var personPreparation = /* @__PURE__ */ __name(({ database }, uid, { accounts: a
|
|
|
26505
26614
|
statement: String(row2.statement),
|
|
26506
26615
|
subject: row2.subject_type == null ? null : `${row2.subject_type}:${row2.subject_id}`,
|
|
26507
26616
|
project: row2.project_id == null ? null : `project:${row2.project_id}`,
|
|
26508
|
-
updatedAt:
|
|
26617
|
+
updatedAt: iso5(row2.updated_at)
|
|
26509
26618
|
}));
|
|
26510
26619
|
const notes2 = database.prepare(`SELECT n.id,n.title,n.body,n.revision,n.updated_at FROM notes n
|
|
26511
26620
|
JOIN persons owner ON n.author_type='person' AND n.author_id=owner.id AND owner.owner=1
|
|
@@ -26518,7 +26627,7 @@ var personPreparation = /* @__PURE__ */ __name(({ database }, uid, { accounts: a
|
|
|
26518
26627
|
title: row2.title == null ? null : String(row2.title),
|
|
26519
26628
|
text: String(row2.body),
|
|
26520
26629
|
revision: Number(row2.revision),
|
|
26521
|
-
updatedAt:
|
|
26630
|
+
updatedAt: iso5(row2.updated_at)
|
|
26522
26631
|
}));
|
|
26523
26632
|
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
|
|
26524
26633
|
FROM task_assignments ta JOIN tasks t ON t.id=ta.task_id JOIN main.projects p ON p.id=t.project_id
|
|
@@ -26530,16 +26639,16 @@ var personPreparation = /* @__PURE__ */ __name(({ database }, uid, { accounts: a
|
|
|
26530
26639
|
ref: `task:${taskIdOf(database, Number(row2.id))}`,
|
|
26531
26640
|
title: String(row2.title),
|
|
26532
26641
|
role: String(row2.role),
|
|
26533
|
-
dueAt:
|
|
26642
|
+
dueAt: iso5(row2.due_at),
|
|
26534
26643
|
project: `project:${row2.project_id}`,
|
|
26535
26644
|
source: row2.source_locator == null ? null : String(row2.source_locator),
|
|
26536
|
-
createdAt:
|
|
26645
|
+
createdAt: iso5(row2.created_at)
|
|
26537
26646
|
}));
|
|
26538
26647
|
return { facts: page3(facts2), notes: page3(notes2), tasks: page3(tasks2) };
|
|
26539
26648
|
});
|
|
26540
26649
|
}, "personPreparation");
|
|
26541
26650
|
|
|
26542
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
26651
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/store/sqlite/person-scope.js
|
|
26543
26652
|
var personSeenInAccounts = /* @__PURE__ */ __name(({ database }, uid, accountIds) => {
|
|
26544
26653
|
const id2 = Number(uid);
|
|
26545
26654
|
if (!/^[1-9]\d*$/.test(uid) || !Number.isSafeInteger(id2) || !accountIds.length || accountIds.length > 1e3 || accountIds.some((account) => !Number.isSafeInteger(account) || account <= 0))
|
|
@@ -26547,7 +26656,7 @@ var personSeenInAccounts = /* @__PURE__ */ __name(({ database }, uid, accountIds
|
|
|
26547
26656
|
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)));
|
|
26548
26657
|
}, "personSeenInAccounts");
|
|
26549
26658
|
|
|
26550
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
26659
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/store/sqlite/private-people.js
|
|
26551
26660
|
var required2 = /* @__PURE__ */ __name(({ database }, key2, personId) => {
|
|
26552
26661
|
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);
|
|
26553
26662
|
if (!row2)
|
|
@@ -26613,7 +26722,7 @@ var removeNote = /* @__PURE__ */ __name((context, key2, personId, id2) => {
|
|
|
26613
26722
|
return { id: id2, personId, removed: true };
|
|
26614
26723
|
}, "removeNote");
|
|
26615
26724
|
|
|
26616
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
26725
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/store/people.js
|
|
26617
26726
|
var accountPeopleOver = /* @__PURE__ */ __name((context) => {
|
|
26618
26727
|
const { database } = context;
|
|
26619
26728
|
const { accountPk: accountPk2, findAccountPk: findAccountPk2, identityPk: identityPk2 } = keysOver(context);
|
|
@@ -26688,13 +26797,13 @@ var peopleStoreOver = /* @__PURE__ */ __name((context, keyed) => {
|
|
|
26688
26797
|
};
|
|
26689
26798
|
}, "peopleStoreOver");
|
|
26690
26799
|
|
|
26691
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
26800
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/store/sqlite/admin-statistics.js
|
|
26692
26801
|
import { createHash as createHash8 } from "node:crypto";
|
|
26693
26802
|
|
|
26694
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
26803
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/domain/admin-statistics.js
|
|
26695
26804
|
import { createHash as createHash7 } from "node:crypto";
|
|
26696
26805
|
|
|
26697
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
26806
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/domain/rankings-graph.js
|
|
26698
26807
|
var RANKING_GRAPH_LIMITS = { nodes: 5e4, depth: 256, work: 1e7, bytes: 8388608 };
|
|
26699
26808
|
var exhausted2 = /* @__PURE__ */ __name((budget) => {
|
|
26700
26809
|
throw new CliError("validation_error", `ranking exceeded ${budget} \u2014 narrow its chat or date scope`, {
|
|
@@ -26916,7 +27025,7 @@ var rankReplyGraph = /* @__PURE__ */ __name((nodes, check3 = () => {
|
|
|
26916
27025
|
};
|
|
26917
27026
|
}, "rankReplyGraph");
|
|
26918
27027
|
|
|
26919
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
27028
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/domain/admin-statistics.js
|
|
26920
27029
|
var adminEntityKey = /* @__PURE__ */ __name((row2) => JSON.stringify([row2.account.provider, row2.account.account, row2.id]), "adminEntityKey");
|
|
26921
27030
|
var personKey = /* @__PURE__ */ __name((node) => JSON.stringify([node.account.provider, node.account.account, node.sender]), "personKey");
|
|
26922
27031
|
var locator = /* @__PURE__ */ __name((node) => formatLocator({ ...node.account, chat: node.chatId, message: node.id }), "locator");
|
|
@@ -27090,7 +27199,7 @@ var calculateAdminStatistics = /* @__PURE__ */ __name((nodes, stays, options, in
|
|
|
27090
27199
|
return { items, evidence, summary, graph: graph.quality };
|
|
27091
27200
|
}, "calculateAdminStatistics");
|
|
27092
27201
|
|
|
27093
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
27202
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/domain/rankings-range.js
|
|
27094
27203
|
var rankingContextRange = /* @__PURE__ */ __name((root) => {
|
|
27095
27204
|
const dates = [];
|
|
27096
27205
|
const visit = /* @__PURE__ */ __name((node, required3) => {
|
|
@@ -27112,7 +27221,7 @@ var rankingContextRange = /* @__PURE__ */ __name((root) => {
|
|
|
27112
27221
|
return dates[0].node.resolution.date;
|
|
27113
27222
|
}, "rankingContextRange");
|
|
27114
27223
|
|
|
27115
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
27224
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/store/sqlite/rankings.js
|
|
27116
27225
|
var reactionCounts = /* @__PURE__ */ __name((stored3) => {
|
|
27117
27226
|
let counts;
|
|
27118
27227
|
try {
|
|
@@ -27407,7 +27516,7 @@ var rankQuery = /* @__PURE__ */ __name((context, execution, request, inspect) =>
|
|
|
27407
27516
|
});
|
|
27408
27517
|
}, "rankQuery");
|
|
27409
27518
|
|
|
27410
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
27519
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/store/sqlite/admin-statistics.js
|
|
27411
27520
|
function fail4(message2, reason = "query.too-large") {
|
|
27412
27521
|
throw new CliError("validation_error", message2, { reason, complete: false });
|
|
27413
27522
|
}
|
|
@@ -27584,7 +27693,7 @@ var adminStatisticsQuery = /* @__PURE__ */ __name((context, execution, request)
|
|
|
27584
27693
|
return result;
|
|
27585
27694
|
}), "adminStatisticsQuery");
|
|
27586
27695
|
|
|
27587
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
27696
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/store/sqlite/conversation-eligibility.js
|
|
27588
27697
|
var conversationEligibility = /* @__PURE__ */ __name(async (context, execution) => {
|
|
27589
27698
|
if (!execution.accounts.length)
|
|
27590
27699
|
return { conversations: [], chats: [] };
|
|
@@ -27602,7 +27711,7 @@ var conversationEligibility = /* @__PURE__ */ __name(async (context, execution)
|
|
|
27602
27711
|
return { conversations: conversations2, chats: chats2 };
|
|
27603
27712
|
}, "conversationEligibility");
|
|
27604
27713
|
|
|
27605
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
27714
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/store/sqlite/ranking-evidence.js
|
|
27606
27715
|
import { createHash as createHash9 } from "node:crypto";
|
|
27607
27716
|
var EVIDENCE_BYTES = 64 * 1024;
|
|
27608
27717
|
var FINGERPRINT_BYTES = 8 * 1024 * 1024;
|
|
@@ -27752,7 +27861,7 @@ var rankingEvidence = /* @__PURE__ */ __name((context, execution, request) => {
|
|
|
27752
27861
|
return result;
|
|
27753
27862
|
}, "rankingEvidence");
|
|
27754
27863
|
|
|
27755
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
27864
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/store/queries.js
|
|
27756
27865
|
var queriesStoreOver = /* @__PURE__ */ __name((context, stemmerFor2) => {
|
|
27757
27866
|
const mailIndexed = /* @__PURE__ */ __name((execution) => {
|
|
27758
27867
|
if (execution.corpus === "mail")
|
|
@@ -27762,6 +27871,7 @@ var queriesStoreOver = /* @__PURE__ */ __name((context, stemmerFor2) => {
|
|
|
27762
27871
|
return {
|
|
27763
27872
|
matchQuery: /* @__PURE__ */ __name(async (execution) => matchQuery(context, mailIndexed(execution)), "matchQuery"),
|
|
27764
27873
|
countQuery: /* @__PURE__ */ __name(async (execution, by) => countQuery(context, mailIndexed(execution), by), "countQuery"),
|
|
27874
|
+
countMatches: /* @__PURE__ */ __name(async (execution, cap) => countMatches(context, mailIndexed(execution), cap), "countMatches"),
|
|
27765
27875
|
conversationEligibility: /* @__PURE__ */ __name(async (execution) => conversationEligibility(context, execution), "conversationEligibility"),
|
|
27766
27876
|
rankQuery: /* @__PURE__ */ __name(async (execution, request) => rankQuery(context, execution, request), "rankQuery"),
|
|
27767
27877
|
rankingEvidence: /* @__PURE__ */ __name(async (execution, request) => rankingEvidence(context, execution, request), "rankingEvidence"),
|
|
@@ -27769,7 +27879,7 @@ var queriesStoreOver = /* @__PURE__ */ __name((context, stemmerFor2) => {
|
|
|
27769
27879
|
};
|
|
27770
27880
|
}, "queriesStoreOver");
|
|
27771
27881
|
|
|
27772
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
27882
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/store/sqlite/chat-events.js
|
|
27773
27883
|
var saveChatEvents = /* @__PURE__ */ __name((context, accountKey, provider, chatKey, events3) => {
|
|
27774
27884
|
const { database, now: now2 } = context;
|
|
27775
27885
|
const insert = database.prepare(`INSERT INTO chat_events (chat_id, source_id, action, actor_identity_id, title, happened_at, created_at, updated_at)
|
|
@@ -27808,10 +27918,10 @@ var chatEventsOf = /* @__PURE__ */ __name(({ database }, chatKey, { since = 0, l
|
|
|
27808
27918
|
}));
|
|
27809
27919
|
}, "chatEventsOf");
|
|
27810
27920
|
|
|
27811
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
27921
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/store/sqlite/retention.js
|
|
27812
27922
|
import { createHash as createHash10 } from "node:crypto";
|
|
27813
27923
|
|
|
27814
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
27924
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/domain/calendar.js
|
|
27815
27925
|
var calendarKey = /* @__PURE__ */ __name((zone, by) => {
|
|
27816
27926
|
const format = new Intl.DateTimeFormat("en-CA", {
|
|
27817
27927
|
timeZone: zone,
|
|
@@ -27826,7 +27936,7 @@ var calendarKey = /* @__PURE__ */ __name((zone, by) => {
|
|
|
27826
27936
|
};
|
|
27827
27937
|
}, "calendarKey");
|
|
27828
27938
|
|
|
27829
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
27939
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/domain/retention.js
|
|
27830
27940
|
var RETENTION_TOLERANCE = 864e5;
|
|
27831
27941
|
var validateRetentionOptions = /* @__PURE__ */ __name((options) => {
|
|
27832
27942
|
const { since, until, cutoff, checkpoints, within, limit, by } = options;
|
|
@@ -27880,8 +27990,8 @@ var retentionCohorts = /* @__PURE__ */ __name((stays, options) => {
|
|
|
27880
27990
|
return [...groups.values()].sort((a, b) => a.cohort.localeCompare(b.cohort));
|
|
27881
27991
|
}, "retentionCohorts");
|
|
27882
27992
|
|
|
27883
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
27884
|
-
var
|
|
27993
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/store/sqlite/retention.js
|
|
27994
|
+
var iso6 = /* @__PURE__ */ __name((at) => new Date(at).toISOString(), "iso");
|
|
27885
27995
|
var week = /* @__PURE__ */ __name((day) => {
|
|
27886
27996
|
const date3 = /* @__PURE__ */ new Date(`${day}T00:00:00Z`);
|
|
27887
27997
|
date3.setUTCDate(date3.getUTCDate() - (date3.getUTCDay() + 6) % 7);
|
|
@@ -27918,14 +28028,14 @@ var retentionQuery = /* @__PURE__ */ __name((context, accountPk2, chatPk, chatId
|
|
|
27918
28028
|
return {
|
|
27919
28029
|
stay: pk,
|
|
27920
28030
|
person: String(row2.person),
|
|
27921
|
-
joinedAt:
|
|
28031
|
+
joinedAt: iso6(joinedAt),
|
|
27922
28032
|
cohort,
|
|
27923
28033
|
checkpoints: options.checkpoints.map((checkpoint) => {
|
|
27924
28034
|
const target = joinedAt + checkpoint;
|
|
27925
28035
|
if (target > options.cutoff)
|
|
27926
28036
|
return {
|
|
27927
28037
|
checkpoint,
|
|
27928
|
-
targetAt:
|
|
28038
|
+
targetAt: iso6(target),
|
|
27929
28039
|
state: "pending",
|
|
27930
28040
|
observedAt: null,
|
|
27931
28041
|
lagMilliseconds: null,
|
|
@@ -27934,22 +28044,22 @@ var retentionQuery = /* @__PURE__ */ __name((context, accountPk2, chatPk, chatId
|
|
|
27934
28044
|
const read2 = observationStatement.get(pk, chatPk, target, Math.min(target + RETENTION_TOLERANCE, options.cutoff));
|
|
27935
28045
|
return {
|
|
27936
28046
|
checkpoint,
|
|
27937
|
-
targetAt:
|
|
28047
|
+
targetAt: iso6(target),
|
|
27938
28048
|
state: !read2 ? "unknown" : Number(read2.present) === 1 ? "present" : Number(read2.complete) === 1 ? "absent" : "unknown",
|
|
27939
|
-
observedAt: read2 ?
|
|
28049
|
+
observedAt: read2 ? iso6(Number(read2.observed_at)) : null,
|
|
27940
28050
|
lagMilliseconds: read2 ? Number(read2.observed_at) - target : null,
|
|
27941
28051
|
complete: read2 ? Number(read2.complete) === 1 : null
|
|
27942
28052
|
};
|
|
27943
28053
|
}),
|
|
27944
28054
|
activity: {
|
|
27945
28055
|
state: first !== null && first !== void 0 ? "observed-message" : end > options.cutoff ? "pending" : "no-observed-message",
|
|
27946
|
-
firstMessageAt: first === null || first === void 0 ? null :
|
|
27947
|
-
windowEnd:
|
|
28056
|
+
firstMessageAt: first === null || first === void 0 ? null : iso6(Number(first)),
|
|
28057
|
+
windowEnd: iso6(end),
|
|
27948
28058
|
archiveCovered: covered === true
|
|
27949
28059
|
},
|
|
27950
28060
|
departure: {
|
|
27951
|
-
after: lower === null ? null :
|
|
27952
|
-
atOrBefore: upper === null ? null :
|
|
28061
|
+
after: lower === null ? null : iso6(lower),
|
|
28062
|
+
atOrBefore: upper === null ? null : iso6(upper),
|
|
27953
28063
|
early: upper !== null && upper <= end ? "observed" : lower !== null && lower >= end ? "not-observed" : end > options.cutoff ? "pending" : "unknown"
|
|
27954
28064
|
}
|
|
27955
28065
|
};
|
|
@@ -27993,7 +28103,7 @@ var retentionQuery = /* @__PURE__ */ __name((context, accountPk2, chatPk, chatId
|
|
|
27993
28103
|
const nextCursor = next < selected.length ? Buffer.from(JSON.stringify({ offset: next, fingerprint: fingerprint2, cohort: evidence?.cohort ?? null })).toString("base64url") : null;
|
|
27994
28104
|
return {
|
|
27995
28105
|
chatId,
|
|
27996
|
-
cutoff:
|
|
28106
|
+
cutoff: iso6(options.cutoff),
|
|
27997
28107
|
options,
|
|
27998
28108
|
items: cohorts.slice(0, options.limit),
|
|
27999
28109
|
total: cohorts.length,
|
|
@@ -28016,8 +28126,8 @@ var retentionQuery = /* @__PURE__ */ __name((context, accountPk2, chatPk, chatId
|
|
|
28016
28126
|
};
|
|
28017
28127
|
}, "retentionQuery");
|
|
28018
28128
|
|
|
28019
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
28020
|
-
var
|
|
28129
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/store/sqlite/roster.js
|
|
28130
|
+
var iso7 = /* @__PURE__ */ __name((ms) => ms === null ? null : new Date(ms).toISOString(), "iso");
|
|
28021
28131
|
var marksOf = /* @__PURE__ */ __name(({ isBot, flagged, deleted, hasPhoto }) => ({
|
|
28022
28132
|
...isBot === void 0 ? {} : { bot: isBot },
|
|
28023
28133
|
...flagged === void 0 ? {} : { [flagged]: true },
|
|
@@ -28111,10 +28221,10 @@ var memberStaysOf = /* @__PURE__ */ __name(({ orm }, chatKey, since) => orm.sele
|
|
|
28111
28221
|
goneAt: memberStays.leftAt
|
|
28112
28222
|
}).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) => ({
|
|
28113
28223
|
...row2,
|
|
28114
|
-
firstSeenAt:
|
|
28115
|
-
lastSeenAt:
|
|
28116
|
-
joinedAt:
|
|
28117
|
-
goneAt:
|
|
28224
|
+
firstSeenAt: iso7(row2.firstSeenAt),
|
|
28225
|
+
lastSeenAt: iso7(row2.lastSeenAt),
|
|
28226
|
+
joinedAt: iso7(row2.joinedAt),
|
|
28227
|
+
goneAt: iso7(row2.goneAt)
|
|
28118
28228
|
})), "memberStaysOf");
|
|
28119
28229
|
var memberCountsOf = /* @__PURE__ */ __name(({ orm }, chatKey, since) => orm.select({
|
|
28120
28230
|
day: memberCounts.date,
|
|
@@ -28134,7 +28244,7 @@ var profileRevisionsOf = /* @__PURE__ */ __name(({ orm }, chatKey, since) => {
|
|
|
28134
28244
|
}).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) => ({
|
|
28135
28245
|
...row2,
|
|
28136
28246
|
marks: row2.marks ? JSON.parse(row2.marks) : {},
|
|
28137
|
-
capturedAt:
|
|
28247
|
+
capturedAt: iso7(row2.capturedAt)
|
|
28138
28248
|
}));
|
|
28139
28249
|
}, "profileRevisionsOf");
|
|
28140
28250
|
var setTracked = /* @__PURE__ */ __name(({ orm, now: now2 }, chatKey, tracked) => {
|
|
@@ -28143,11 +28253,11 @@ var setTracked = /* @__PURE__ */ __name(({ orm, now: now2 }, chatKey, tracked) =
|
|
|
28143
28253
|
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 }) => ({
|
|
28144
28254
|
chatId,
|
|
28145
28255
|
title,
|
|
28146
|
-
trackedAt:
|
|
28256
|
+
trackedAt: iso7(trackedAt),
|
|
28147
28257
|
lastCount: memberCountsOf(context, pk).at(-1) ?? null
|
|
28148
28258
|
})), "trackedChats");
|
|
28149
28259
|
|
|
28150
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
28260
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/store/roster.js
|
|
28151
28261
|
var rosterStoreOver = /* @__PURE__ */ __name((context) => {
|
|
28152
28262
|
const { database } = context;
|
|
28153
28263
|
const { accountPk: accountPk2, findAccountPk: findAccountPk2, chatKeyOf, chatPkFor: chatPkFor2, writeMembers: writeMembers2 } = keysOver(context);
|
|
@@ -28203,7 +28313,7 @@ var rosterStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
28203
28313
|
};
|
|
28204
28314
|
}, "rosterStoreOver");
|
|
28205
28315
|
|
|
28206
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
28316
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/store/sqlite/backfill.js
|
|
28207
28317
|
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");
|
|
28208
28318
|
var backfillNormalized = /* @__PURE__ */ __name((database, { batch = 5e3, onBatch, until = /* @__PURE__ */ __name(() => false, "until") } = {}) => {
|
|
28209
28319
|
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 ?`);
|
|
@@ -28227,7 +28337,7 @@ var backfillNormalized = /* @__PURE__ */ __name((database, { batch = 5e3, onBatc
|
|
|
28227
28337
|
}
|
|
28228
28338
|
}, "backfillNormalized");
|
|
28229
28339
|
|
|
28230
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
28340
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/store/sqlite/search-index.js
|
|
28231
28341
|
var INDEX2 = "message_words";
|
|
28232
28342
|
var searchIndexState2 = /* @__PURE__ */ __name((database) => {
|
|
28233
28343
|
const row2 = indexRow(database, INDEX2);
|
|
@@ -28354,7 +28464,7 @@ var resetSearchIndex = /* @__PURE__ */ __name((database) => {
|
|
|
28354
28464
|
});
|
|
28355
28465
|
}, "resetSearchIndex");
|
|
28356
28466
|
|
|
28357
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
28467
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/store/sqlite/stems-fill.js
|
|
28358
28468
|
var fillStems = /* @__PURE__ */ __name((database, { batch = 5e3, until = /* @__PURE__ */ __name(() => false, "until"), onBatch, now: now2 = Date.now } = {}) => {
|
|
28359
28469
|
const filled2 = { stemmed: 0, drained: 0 };
|
|
28360
28470
|
const before2 = stemsState(database);
|
|
@@ -28449,7 +28559,7 @@ var followDefaultStemmers = /* @__PURE__ */ __name((database, now2 = Date.now) =
|
|
|
28449
28559
|
return resetStems(database, { now: now2 });
|
|
28450
28560
|
}, "followDefaultStemmers");
|
|
28451
28561
|
|
|
28452
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
28562
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/store/sqlite/words.js
|
|
28453
28563
|
var VOCABULARY = "SELECT term, doc FROM message_words_vocab WHERE col = 'normalized_text'";
|
|
28454
28564
|
var knownTerms = /* @__PURE__ */ __name(({ database }, terms2) => {
|
|
28455
28565
|
const lookup = database.prepare(`${VOCABULARY} AND term >= ? AND term <= ? LIMIT 1`);
|
|
@@ -28471,7 +28581,7 @@ var termCandidates = /* @__PURE__ */ __name(({ database }, pieces, { shortest, l
|
|
|
28471
28581
|
});
|
|
28472
28582
|
}, "termCandidates");
|
|
28473
28583
|
|
|
28474
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
28584
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/store/search-index.js
|
|
28475
28585
|
var searchIndexStoreOver = /* @__PURE__ */ __name((context) => {
|
|
28476
28586
|
const { database } = context;
|
|
28477
28587
|
const stemmerFor2 = stemmerCache();
|
|
@@ -28493,7 +28603,7 @@ var searchIndexStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
28493
28603
|
};
|
|
28494
28604
|
}, "searchIndexStoreOver");
|
|
28495
28605
|
|
|
28496
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
28606
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/store/sqlite/searches.js
|
|
28497
28607
|
var HISTORY_KEPT = 1e3;
|
|
28498
28608
|
var commandFilter = /* @__PURE__ */ __name((commands) => commands ? { sql: ` AND command IN (${commands.map(() => "?").join(", ")})`, values: [...commands] } : { sql: "", values: [] }, "commandFilter");
|
|
28499
28609
|
var COLUMNS5 = "id, name, command, params, language, version, fields_version, created_at, updated_at, last_run_at, runs";
|
|
@@ -28562,7 +28672,7 @@ var clearHistory = /* @__PURE__ */ __name(({ database }, commands) => {
|
|
|
28562
28672
|
return database.prepare(`DELETE FROM searches WHERE name IS NULL${only.sql}`).run(...only.values).changes;
|
|
28563
28673
|
}, "clearHistory");
|
|
28564
28674
|
|
|
28565
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
28675
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/store/searches.js
|
|
28566
28676
|
var searchesStoreOver = /* @__PURE__ */ __name((context) => {
|
|
28567
28677
|
const { database } = context;
|
|
28568
28678
|
return {
|
|
@@ -28586,7 +28696,7 @@ var searchesStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
28586
28696
|
};
|
|
28587
28697
|
}, "searchesStoreOver");
|
|
28588
28698
|
|
|
28589
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
28699
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/store/sqlite/agent-actions.js
|
|
28590
28700
|
var ACTION_TIERS = ["read", "draft", "write-private", "write-public", "destructive", "admin"];
|
|
28591
28701
|
var ACTION_OUTCOMES = ["ok", "refused", "failed"];
|
|
28592
28702
|
var CODE = /^[a-z][a-z0-9_]{0,63}$/;
|
|
@@ -28629,7 +28739,7 @@ var agentActionsStoreOver = /* @__PURE__ */ __name((context, afterRecord = () =>
|
|
|
28629
28739
|
};
|
|
28630
28740
|
}, "agentActionsStoreOver");
|
|
28631
28741
|
|
|
28632
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
28742
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/store/sqlite/bot-updates.js
|
|
28633
28743
|
var botUpdateStoreOver = /* @__PURE__ */ __name((context, afterSave = () => {
|
|
28634
28744
|
}) => {
|
|
28635
28745
|
const { database, now: now2 } = context;
|
|
@@ -28688,7 +28798,7 @@ var botUpdateStoreOver = /* @__PURE__ */ __name((context, afterSave = () => {
|
|
|
28688
28798
|
};
|
|
28689
28799
|
}, "botUpdateStoreOver");
|
|
28690
28800
|
|
|
28691
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
28801
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/store/sqlite/calendar-events.js
|
|
28692
28802
|
var DAY4 = 864e5;
|
|
28693
28803
|
var listEvents = /* @__PURE__ */ __name((database, filter) => {
|
|
28694
28804
|
const clauses = ["e.deleted_at IS NULL"];
|
|
@@ -28768,7 +28878,7 @@ var listEvents = /* @__PURE__ */ __name((database, filter) => {
|
|
|
28768
28878
|
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);
|
|
28769
28879
|
}, "listEvents");
|
|
28770
28880
|
|
|
28771
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
28881
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/store/sqlite/calendar.js
|
|
28772
28882
|
var calendarOf = /* @__PURE__ */ __name((row2) => ({
|
|
28773
28883
|
id: Number(row2.id),
|
|
28774
28884
|
accountId: Number(row2.account_id),
|
|
@@ -29348,7 +29458,7 @@ var eventStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
29348
29458
|
};
|
|
29349
29459
|
}, "eventStoreOver");
|
|
29350
29460
|
|
|
29351
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
29461
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/store/sqlite/catalog.js
|
|
29352
29462
|
var CATALOG_QUERY = defineQuery({
|
|
29353
29463
|
entity: "document",
|
|
29354
29464
|
backend: "sql",
|
|
@@ -29590,7 +29700,7 @@ var catalogStoreOver = /* @__PURE__ */ __name(({ database, now: now2 }) => {
|
|
|
29590
29700
|
};
|
|
29591
29701
|
}, "catalogStoreOver");
|
|
29592
29702
|
|
|
29593
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
29703
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/context/evidence.js
|
|
29594
29704
|
import { createHash as createHash11 } from "node:crypto";
|
|
29595
29705
|
var CONTEXT_MAX_READ_BYTES = 262144;
|
|
29596
29706
|
var CONTEXT_SOURCE_KINDS = ["message", "mail", "document", "meeting"];
|
|
@@ -29688,7 +29798,7 @@ var contextEvidenceRequest = /* @__PURE__ */ __name((input) => {
|
|
|
29688
29798
|
return { source: source2, query, chat: chat2, senders, words: words3, after: after2, before: before2, limit, maxReadBytes, cursor, signal: input.signal };
|
|
29689
29799
|
}, "contextEvidenceRequest");
|
|
29690
29800
|
|
|
29691
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
29801
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/store/sqlite/context-document-source.js
|
|
29692
29802
|
var drive = "CASE WHEN json_valid(n.front_matter) THEN json_extract(n.front_matter,'$.source')='google-drive' ELSE 0 END";
|
|
29693
29803
|
var field2 = /* @__PURE__ */ __name((name) => `CASE WHEN (${drive}) THEN
|
|
29694
29804
|
CASE WHEN json_type(n.front_matter,'$.${name}')='text' THEN json_extract(n.front_matter,'$.${name}') END END`, "field");
|
|
@@ -29701,7 +29811,7 @@ var contextDocumentTimeKind = `CASE WHEN (${remoteTime}) IS NOT NULL
|
|
|
29701
29811
|
THEN 'source-modified' ELSE 'stored-update' END`;
|
|
29702
29812
|
var contextDocumentUrl = `coalesce(${preferred("url")},n.url,${field2("sourceUrl")})`;
|
|
29703
29813
|
|
|
29704
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
29814
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/store/sqlite/context-meeting-source.js
|
|
29705
29815
|
var readMeetingContextEvidence = /* @__PURE__ */ __name((database, request) => {
|
|
29706
29816
|
const { source: source2, words: words3, after: after2, before: before2, limit, maxReadBytes, cursor, signal } = request;
|
|
29707
29817
|
signal?.throwIfAborted();
|
|
@@ -29800,7 +29910,7 @@ var readMeetingContextEvidence = /* @__PURE__ */ __name((database, request) => {
|
|
|
29800
29910
|
});
|
|
29801
29911
|
}, "readMeetingContextEvidence");
|
|
29802
29912
|
|
|
29803
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
29913
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/store/sqlite/context-evidence.js
|
|
29804
29914
|
var corpora = {
|
|
29805
29915
|
message: {
|
|
29806
29916
|
table: "messages",
|
|
@@ -30029,7 +30139,7 @@ var contextRecordsOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
|
30029
30139
|
}
|
|
30030
30140
|
}), "contextRecordsOver");
|
|
30031
30141
|
|
|
30032
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
30142
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/store/sqlite/note-search.js
|
|
30033
30143
|
var NOTE_FIELDS = [
|
|
30034
30144
|
"text",
|
|
30035
30145
|
"exact",
|
|
@@ -30057,7 +30167,7 @@ var CORPORA2 = [
|
|
|
30057
30167
|
type: "document",
|
|
30058
30168
|
noun: "note",
|
|
30059
30169
|
fields: NOTE_FIELDS,
|
|
30060
|
-
view:
|
|
30170
|
+
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)`,
|
|
30061
30171
|
words: "document_words",
|
|
30062
30172
|
stems: "document_stems",
|
|
30063
30173
|
live: "coalesce(json_extract(n.metadata, '$.catalog.active'), 1)=1",
|
|
@@ -30074,12 +30184,22 @@ var CORPORA2 = [
|
|
|
30074
30184
|
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")
|
|
30075
30185
|
}
|
|
30076
30186
|
];
|
|
30077
|
-
var
|
|
30078
|
-
const offset = query.offset ?? 0;
|
|
30187
|
+
var matchedRows = /* @__PURE__ */ __name((context, query) => {
|
|
30079
30188
|
const chosen = CORPORA2.filter(({ type }) => (query.source === void 0 || query.source === "file" === (type === "document")) && (!query.folderIds?.length || query.withInternal === true || type === "document"));
|
|
30080
|
-
const
|
|
30189
|
+
const idsOf = /* @__PURE__ */ __name((type) => query.refs?.flatMap((ref3) => ref3.startsWith(`${type}:`) ? [Number(ref3.slice(type.length + 1))] : []), "idsOf");
|
|
30190
|
+
const rows = chosen.flatMap((corpus) => {
|
|
30191
|
+
const ids = idsOf(corpus.type);
|
|
30192
|
+
if (ids?.length === 0)
|
|
30193
|
+
return [];
|
|
30194
|
+
return searchCorpus(context, { ...query, ...query.folderIds ? { accountIds: query.folderIds } : {}, ...ids ? { ids } : {} }, corpus);
|
|
30195
|
+
});
|
|
30081
30196
|
const exactFirst = rows.some((row2) => row2.exact !== void 0);
|
|
30082
30197
|
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);
|
|
30198
|
+
return rows;
|
|
30199
|
+
}, "matchedRows");
|
|
30200
|
+
var searchNotes = /* @__PURE__ */ __name((context, query) => {
|
|
30201
|
+
const offset = query.offset ?? 0;
|
|
30202
|
+
const rows = matchedRows(context, query);
|
|
30083
30203
|
const read2 = {
|
|
30084
30204
|
document: context.database.prepare("SELECT * FROM documents WHERE id = ?"),
|
|
30085
30205
|
note: context.database.prepare("SELECT * FROM notes WHERE id = ?")
|
|
@@ -30092,12 +30212,17 @@ var searchNotes = /* @__PURE__ */ __name((context, query) => {
|
|
|
30092
30212
|
ref: note2.ref,
|
|
30093
30213
|
note: note2,
|
|
30094
30214
|
relevance: row2.relevance,
|
|
30095
|
-
...row2.exact === void 0 ? {} : { exact: row2.exact }
|
|
30215
|
+
...row2.exact === void 0 ? {} : { exact: row2.exact },
|
|
30216
|
+
at: new Date(row2.at ?? 0).toISOString()
|
|
30096
30217
|
};
|
|
30097
30218
|
}),
|
|
30098
30219
|
hasMore: rows.length > offset + query.limit
|
|
30099
30220
|
};
|
|
30100
30221
|
}, "searchNotes");
|
|
30222
|
+
var matchingNoteRefs = /* @__PURE__ */ __name((context, query) => {
|
|
30223
|
+
const rows = matchedRows(context, { ...query, newest: true });
|
|
30224
|
+
return { refs: rows.slice(0, query.limit).map(({ type, id: id2 }) => `${type}:${id2}`), hasMore: rows.length > query.limit };
|
|
30225
|
+
}, "matchingNoteRefs");
|
|
30101
30226
|
var searchCorpus = /* @__PURE__ */ __name((context, query, corpus) => {
|
|
30102
30227
|
const { database } = context;
|
|
30103
30228
|
const wordMatch2 = /* @__PURE__ */ __name((match) => ({
|
|
@@ -30238,7 +30363,8 @@ var searchCorpus = /* @__PURE__ */ __name((context, query, corpus) => {
|
|
|
30238
30363
|
const scope3 = combine2([
|
|
30239
30364
|
bound3("n.deleted_at IS NULL"),
|
|
30240
30365
|
...corpus.live ? [bound3(corpus.live)] : [],
|
|
30241
|
-
...query.accountIds?.length && corpus.inAccounts ? [corpus.inAccounts(JSON.stringify(query.accountIds))] : []
|
|
30366
|
+
...query.accountIds?.length && corpus.inAccounts ? [corpus.inAccounts(JSON.stringify(query.accountIds))] : [],
|
|
30367
|
+
...query.ids ? [bound3("n.id IN (SELECT value FROM json_each(?))", JSON.stringify(query.ids))] : []
|
|
30242
30368
|
], "AND");
|
|
30243
30369
|
const where = combine2([scope3, expression], "AND");
|
|
30244
30370
|
const ranking = query.newest ? void 0 : required3(query.root, stemmed ? "stems" : "fts");
|
|
@@ -30259,7 +30385,7 @@ var searchCorpus = /* @__PURE__ */ __name((context, query, corpus) => {
|
|
|
30259
30385
|
const leaves = [...fragments.entries()].filter(([node]) => !tests.has(node));
|
|
30260
30386
|
const projection = tests.size ? leaves.map(([, fragment], index2) => `, coalesce(${fragment.sql}, 0) AS q${index2}`).join("") : "";
|
|
30261
30387
|
const window = tests.size ? QUERY_LIMITS2.candidates + 1 : query.limit + offset + 1;
|
|
30262
|
-
const rows = database.prepare(`${ctes.length ? `WITH ${ctes.join(", ")} ` : ""}SELECT n
|
|
30388
|
+
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}
|
|
30263
30389
|
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);
|
|
30264
30390
|
if (tests.size && rows.length > QUERY_LIMITS2.candidates)
|
|
30265
30391
|
exhausted("candidates");
|
|
@@ -30314,12 +30440,16 @@ var noteSearchOver = /* @__PURE__ */ __name((context) => {
|
|
|
30314
30440
|
drain();
|
|
30315
30441
|
return searchNotes(context, query);
|
|
30316
30442
|
}, "search"),
|
|
30443
|
+
matchingRefs: /* @__PURE__ */ __name(async (query) => {
|
|
30444
|
+
drain();
|
|
30445
|
+
return matchingNoteRefs(context, query);
|
|
30446
|
+
}, "matchingRefs"),
|
|
30317
30447
|
indexState: /* @__PURE__ */ __name(async () => noteIndexState(database), "indexState"),
|
|
30318
30448
|
chunksToEmbed: /* @__PURE__ */ __name(async (model, { after: after2, limit }) => {
|
|
30319
30449
|
drain();
|
|
30320
30450
|
const scope3 = live2(void 0, void 0);
|
|
30321
30451
|
const texts2 = /* @__PURE__ */ new Map();
|
|
30322
|
-
const
|
|
30452
|
+
const textOf6 = /* @__PURE__ */ __name((owner) => {
|
|
30323
30453
|
if (!texts2.has(owner)) {
|
|
30324
30454
|
const [type, id2] = owner.split(":");
|
|
30325
30455
|
const note2 = read2(String(type), Number(id2));
|
|
@@ -30332,7 +30462,7 @@ var noteSearchOver = /* @__PURE__ */ __name((context) => {
|
|
|
30332
30462
|
WHERE k.content_hash > ?${scope3.sql}
|
|
30333
30463
|
AND NOT EXISTS (SELECT 1 FROM embeddings v WHERE v.model = ? AND v.content_hash = k.content_hash)
|
|
30334
30464
|
GROUP BY k.content_hash ORDER BY k.content_hash LIMIT ?`).all(after2 ?? "", ...scope3.params, model, limit).flatMap((row2) => {
|
|
30335
|
-
const text5 =
|
|
30465
|
+
const text5 = textOf6(String(row2.owner));
|
|
30336
30466
|
return text5 === void 0 ? [] : [{ hash: String(row2.hash), text: text5.slice(Number(row2.start), Number(row2.end)) }];
|
|
30337
30467
|
});
|
|
30338
30468
|
}, "chunksToEmbed"),
|
|
@@ -30414,11 +30544,32 @@ var noteSearchOver = /* @__PURE__ */ __name((context) => {
|
|
|
30414
30544
|
const note2 = read2(String(type), Number(id2));
|
|
30415
30545
|
return note2 ? [{ ref: note2.ref, note: note2, score, range: { start, end } }] : [];
|
|
30416
30546
|
});
|
|
30417
|
-
}, "nearest")
|
|
30547
|
+
}, "nearest"),
|
|
30548
|
+
scoreNotes: /* @__PURE__ */ __name(async (model, query, refs) => {
|
|
30549
|
+
drain();
|
|
30550
|
+
const scope3 = live2(void 0, void 0, true);
|
|
30551
|
+
const owned = database.prepare(`SELECT k.chunkable_type AS type, k.chunkable_id AS owner, v.vector
|
|
30552
|
+
FROM chunks k JOIN embeddings v ON v.model = ? AND v.content_hash = k.content_hash
|
|
30553
|
+
WHERE k.chunkable_type = ? AND k.chunkable_id IN (SELECT value FROM json_each(?))${scope3.sql}`);
|
|
30554
|
+
const best = /* @__PURE__ */ new Map();
|
|
30555
|
+
for (const type of ["document", "note"]) {
|
|
30556
|
+
const ids = refs.flatMap((ref3) => ref3.startsWith(`${type}:`) ? [Number(ref3.slice(type.length + 1))] : []);
|
|
30557
|
+
if (!ids.length)
|
|
30558
|
+
continue;
|
|
30559
|
+
for (const row2 of owned.all(model, type, JSON.stringify(ids), ...scope3.params)) {
|
|
30560
|
+
const key2 = `${row2.type}:${row2.owner}`;
|
|
30561
|
+
const score = dot(query, row2.vector);
|
|
30562
|
+
if (score > (best.get(key2) ?? Number.NEGATIVE_INFINITY))
|
|
30563
|
+
best.set(key2, score);
|
|
30564
|
+
}
|
|
30565
|
+
}
|
|
30566
|
+
const order = new Map(refs.map((ref3, index2) => [ref3, index2]));
|
|
30567
|
+
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));
|
|
30568
|
+
}, "scoreNotes")
|
|
30418
30569
|
};
|
|
30419
30570
|
}, "noteSearchOver");
|
|
30420
30571
|
|
|
30421
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
30572
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/store/sqlite/event-search.js
|
|
30422
30573
|
var EVENT_FIELDS = ["text", "exact", "body", "title", "date", "in"];
|
|
30423
30574
|
var inEventAccounts = /* @__PURE__ */ __name((event) => searchableCopy(event, "c.account_id IN (SELECT CAST(value AS INTEGER) FROM json_each(?))"), "inEventAccounts");
|
|
30424
30575
|
var EVENT_CORPUS = {
|
|
@@ -30550,7 +30701,7 @@ var eventSearchOver = /* @__PURE__ */ __name((context) => {
|
|
|
30550
30701
|
};
|
|
30551
30702
|
}, "eventSearchOver");
|
|
30552
30703
|
|
|
30553
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
30704
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/store/evidence-findings.js
|
|
30554
30705
|
var EVIDENCE_FINDINGS_KIND = "evidence_findings";
|
|
30555
30706
|
var reference = /* @__PURE__ */ __name((raw) => {
|
|
30556
30707
|
if (/^document:[1-9]\d*$/.test(raw))
|
|
@@ -30563,7 +30714,7 @@ var reference = /* @__PURE__ */ __name((raw) => {
|
|
|
30563
30714
|
}, "reference");
|
|
30564
30715
|
var validateEvidenceFindings = /* @__PURE__ */ __name((input) => validateFindings(input, { plural: "evidence findings", singular: "evidence finding", cited: "reference", reference }), "validateEvidenceFindings");
|
|
30565
30716
|
|
|
30566
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
30717
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/domain/moment.js
|
|
30567
30718
|
var calendarMoment = /* @__PURE__ */ __name((wanted, flag6, { zone, end = false } = {}) => {
|
|
30568
30719
|
try {
|
|
30569
30720
|
return zonedMoment(wanted, timezoneOf(zone), { start: 0, end: wanted.length }, { end });
|
|
@@ -30575,9 +30726,9 @@ var calendarMoment = /* @__PURE__ */ __name((wanted, flag6, { zone, end = false
|
|
|
30575
30726
|
}
|
|
30576
30727
|
}, "calendarMoment");
|
|
30577
30728
|
|
|
30578
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
30729
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/store/sqlite/facts.js
|
|
30579
30730
|
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";
|
|
30580
|
-
var
|
|
30731
|
+
var iso8 = /* @__PURE__ */ __name((value) => new Date(Number(value)).toISOString(), "iso");
|
|
30581
30732
|
var oneOf4 = /* @__PURE__ */ __name((value, allowed, what) => {
|
|
30582
30733
|
if (typeof value !== "string" || !allowed.includes(value))
|
|
30583
30734
|
throw new CliError("validation_error", `${what} is one of ${allowed.join(", ")}`);
|
|
@@ -30592,8 +30743,8 @@ var factOperationsOver = /* @__PURE__ */ __name((context) => {
|
|
|
30592
30743
|
statement: String(row2.statement),
|
|
30593
30744
|
status: row2.status,
|
|
30594
30745
|
project: row2.project_id == null ? null : `project:${row2.project_id}`,
|
|
30595
|
-
|
|
30596
|
-
occurredAt: row2.occurred_at == null ? null :
|
|
30746
|
+
...subjectOf(database, row2),
|
|
30747
|
+
occurredAt: row2.occurred_at == null ? null : iso8(row2.occurred_at),
|
|
30597
30748
|
supersedes: row2.supersedes_id == null ? null : `fact:${row2.supersedes_id}`,
|
|
30598
30749
|
author: authorOf(row2),
|
|
30599
30750
|
model: row2.model == null ? null : String(row2.model),
|
|
@@ -30601,8 +30752,8 @@ var factOperationsOver = /* @__PURE__ */ __name((context) => {
|
|
|
30601
30752
|
scope: row2.scope == null ? null : row2.scope,
|
|
30602
30753
|
source: String(row2.source),
|
|
30603
30754
|
evidence: evidenceOf(context, { type: "fact", id: Number(row2.id) }),
|
|
30604
|
-
createdAt:
|
|
30605
|
-
updatedAt:
|
|
30755
|
+
createdAt: iso8(row2.created_at),
|
|
30756
|
+
updatedAt: iso8(row2.updated_at)
|
|
30606
30757
|
}), "factOf");
|
|
30607
30758
|
const rowOf = /* @__PURE__ */ __name((reference2) => {
|
|
30608
30759
|
const thing = requiredThing(database, reference2.includes(":") ? reference2 : `fact:${reference2}`, "the fact");
|
|
@@ -30674,9 +30825,41 @@ var factOperationsOver = /* @__PURE__ */ __name((context) => {
|
|
|
30674
30825
|
throw new CliError("validation_error", "only an accepted decision can be reversed");
|
|
30675
30826
|
database.prepare("UPDATE facts SET status = 'reversed', updated_at = ? WHERE id = ?").run(now2(), Number(row2.id));
|
|
30676
30827
|
return factOf(rowOf(reference2));
|
|
30677
|
-
}, "reverse")
|
|
30828
|
+
}, "reverse"),
|
|
30829
|
+
reject: /* @__PURE__ */ __name((reference2) => {
|
|
30830
|
+
const row2 = rowOf(reference2);
|
|
30831
|
+
if (row2.status !== "proposed")
|
|
30832
|
+
throw new CliError("validation_error", `only a proposed fact can be rejected; this one is ${String(row2.status)}`);
|
|
30833
|
+
database.prepare("UPDATE facts SET status = 'rejected', updated_at = ? WHERE id = ?").run(now2(), Number(row2.id));
|
|
30834
|
+
return factOf(rowOf(reference2));
|
|
30835
|
+
}, "reject"),
|
|
30836
|
+
remove: /* @__PURE__ */ __name((reference2) => {
|
|
30837
|
+
const row2 = rowOf(reference2);
|
|
30838
|
+
const id2 = Number(row2.id);
|
|
30839
|
+
const twin = row2.source === "memory" && row2.metadata != null ? migratedFrom(String(row2.metadata)) : void 0;
|
|
30840
|
+
const links2 = erase(database, () => {
|
|
30841
|
+
database.prepare("UPDATE facts SET supersedes_id = NULL WHERE supersedes_id = ?").run(id2);
|
|
30842
|
+
const count = dropLinksOf(database, { type: "fact", id: id2 });
|
|
30843
|
+
database.prepare("DELETE FROM links WHERE from_type = 'fact' AND from_id = ?").run(id2);
|
|
30844
|
+
database.prepare("DELETE FROM taggings WHERE taggable_type = 'fact' AND taggable_id = ?").run(id2);
|
|
30845
|
+
database.prepare("DELETE FROM facts WHERE id = ?").run(id2);
|
|
30846
|
+
if (twin !== void 0)
|
|
30847
|
+
database.prepare("DELETE FROM memories WHERE id = ? AND deleted_at IS NOT NULL").run(twin);
|
|
30848
|
+
return count;
|
|
30849
|
+
});
|
|
30850
|
+
return { ref: `fact:${id2}`, removed: true, links: links2 };
|
|
30851
|
+
}, "remove"),
|
|
30852
|
+
sources: /* @__PURE__ */ __name((reference2) => evidenceSourcesOf(database, { type: "fact", id: Number(rowOf(reference2).id) }), "sources")
|
|
30678
30853
|
};
|
|
30679
30854
|
}, "factOperationsOver");
|
|
30855
|
+
var migratedFrom = /* @__PURE__ */ __name((metadata3) => {
|
|
30856
|
+
try {
|
|
30857
|
+
const { memory } = JSON.parse(metadata3);
|
|
30858
|
+
return Number.isInteger(memory) ? Number(memory) : void 0;
|
|
30859
|
+
} catch {
|
|
30860
|
+
return void 0;
|
|
30861
|
+
}
|
|
30862
|
+
}, "migratedFrom");
|
|
30680
30863
|
var factsStoreOver = /* @__PURE__ */ __name((context) => {
|
|
30681
30864
|
const operations = factOperationsOver(context);
|
|
30682
30865
|
return {
|
|
@@ -30684,11 +30867,14 @@ var factsStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
30684
30867
|
get: /* @__PURE__ */ __name(async (reference2) => operations.get(reference2), "get"),
|
|
30685
30868
|
list: /* @__PURE__ */ __name(async (options) => operations.list(options), "list"),
|
|
30686
30869
|
accept: /* @__PURE__ */ __name(async (reference2) => operations.accept(reference2), "accept"),
|
|
30687
|
-
reverse: /* @__PURE__ */ __name(async (reference2) => operations.reverse(reference2), "reverse")
|
|
30870
|
+
reverse: /* @__PURE__ */ __name(async (reference2) => operations.reverse(reference2), "reverse"),
|
|
30871
|
+
reject: /* @__PURE__ */ __name(async (reference2) => operations.reject(reference2), "reject"),
|
|
30872
|
+
remove: /* @__PURE__ */ __name(async (reference2) => operations.remove(reference2), "remove"),
|
|
30873
|
+
sources: /* @__PURE__ */ __name(async (reference2) => operations.sources(reference2), "sources")
|
|
30688
30874
|
};
|
|
30689
30875
|
}, "factsStoreOver");
|
|
30690
30876
|
|
|
30691
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
30877
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/store/sqlite/findings-core.js
|
|
30692
30878
|
var invalid2 = /* @__PURE__ */ __name((message2) => {
|
|
30693
30879
|
throw new CliError("validation_error", message2);
|
|
30694
30880
|
}, "invalid");
|
|
@@ -30778,10 +30964,10 @@ var findingsCoreOver = /* @__PURE__ */ __name((context, kind3) => {
|
|
|
30778
30964
|
return { snapshot: snapshot2, snapshotParts, previous, outcomes };
|
|
30779
30965
|
}, "findingsCoreOver");
|
|
30780
30966
|
|
|
30781
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
30967
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/store/sqlite/proposed-actions.js
|
|
30782
30968
|
var PROPOSAL_STATUSES = ["proposed", "approved", "rejected", "executed", "failed"];
|
|
30783
30969
|
var PROPOSAL_VERDICTS = ["useful", "not_useful"];
|
|
30784
|
-
var
|
|
30970
|
+
var iso9 = /* @__PURE__ */ __name((value) => value == null ? null : new Date(Number(value)).toISOString(), "iso");
|
|
30785
30971
|
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";
|
|
30786
30972
|
var json2 = /* @__PURE__ */ __name((value) => value == null ? null : JSON.parse(String(value)), "json");
|
|
30787
30973
|
var proposalOperationsOver = /* @__PURE__ */ __name((context) => {
|
|
@@ -30802,12 +30988,12 @@ var proposalOperationsOver = /* @__PURE__ */ __name((context) => {
|
|
|
30802
30988
|
name: row2.proposer_name == null ? null : String(row2.proposer_name)
|
|
30803
30989
|
},
|
|
30804
30990
|
decidedBy: row2.decided_by_type == null ? null : { type: row2.decided_by_type, id: String(row2.decided_by_id) },
|
|
30805
|
-
decidedAt:
|
|
30806
|
-
executedAt:
|
|
30991
|
+
decidedAt: iso9(row2.decided_at),
|
|
30992
|
+
executedAt: iso9(row2.executed_at),
|
|
30807
30993
|
result: json2(row2.result),
|
|
30808
30994
|
error: row2.error == null ? null : String(row2.error),
|
|
30809
30995
|
verdict: row2.verdict ?? null,
|
|
30810
|
-
createdAt:
|
|
30996
|
+
createdAt: iso9(row2.created_at)
|
|
30811
30997
|
};
|
|
30812
30998
|
}, "actionOf");
|
|
30813
30999
|
const rowOf = /* @__PURE__ */ __name((id2) => {
|
|
@@ -30924,7 +31110,7 @@ var proposedActionsStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
30924
31110
|
};
|
|
30925
31111
|
}, "proposedActionsStoreOver");
|
|
30926
31112
|
|
|
30927
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
31113
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/store/sqlite/evidence-findings.js
|
|
30928
31114
|
var stale = /* @__PURE__ */ __name(() => {
|
|
30929
31115
|
throw new CliError("validation_error", "evidence findings changed since they were read; stage a new batch", {
|
|
30930
31116
|
reason: "evidence-findings.stale"
|
|
@@ -31090,7 +31276,7 @@ var evidenceFindingsStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
31090
31276
|
};
|
|
31091
31277
|
}, "evidenceFindingsStoreOver");
|
|
31092
31278
|
|
|
31093
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
31279
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/store/sqlite/involvements.js
|
|
31094
31280
|
var pendingInvolvements = /* @__PURE__ */ __name((database) => Number(database.prepare("SELECT count(*) AS n FROM involvement_pending").get()?.n ?? 0), "pendingInvolvements");
|
|
31095
31281
|
var involvementStoreOver = /* @__PURE__ */ __name(({ database, now: now2 }) => ({
|
|
31096
31282
|
rebuild: /* @__PURE__ */ __name((personId) => write(database, () => {
|
|
@@ -31143,7 +31329,7 @@ var involvementStoreOver = /* @__PURE__ */ __name(({ database, now: now2 }) => (
|
|
|
31143
31329
|
}, "forPerson")
|
|
31144
31330
|
}), "involvementStoreOver");
|
|
31145
31331
|
|
|
31146
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
31332
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-projects.js
|
|
31147
31333
|
import { createHash as createHash12 } from "node:crypto";
|
|
31148
31334
|
var fields3 = "id,from_id,to_id,source,confirmed,updated_at,length(evidence) AS evidenceLength,substr(evidence,1,2000) AS evidence";
|
|
31149
31335
|
var id = /* @__PURE__ */ __name((value) => {
|
|
@@ -31229,16 +31415,16 @@ var meetingProjectsStoreOver = /* @__PURE__ */ __name(({ database, now: now2 })
|
|
|
31229
31415
|
};
|
|
31230
31416
|
}, "meetingProjectsStoreOver");
|
|
31231
31417
|
|
|
31232
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
31418
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/store/sqlite/vocabulary.js
|
|
31233
31419
|
import { createHash as createHash15 } from "node:crypto";
|
|
31234
31420
|
|
|
31235
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
31421
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/store/sqlite/tag-consolidation.js
|
|
31236
31422
|
import { createHash as createHash14 } from "node:crypto";
|
|
31237
31423
|
|
|
31238
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
31424
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/store/sqlite/tag-consolidation-apply.js
|
|
31239
31425
|
import { createHash as createHash13 } from "node:crypto";
|
|
31240
31426
|
|
|
31241
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
31427
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/store/sqlite/tag-consolidation-input.js
|
|
31242
31428
|
var consolidationId = /* @__PURE__ */ __name((value, field3) => {
|
|
31243
31429
|
if (typeof value !== "string" || !/^[1-9]\d*$/.test(value) || !Number.isSafeInteger(Number(value)))
|
|
31244
31430
|
throw new CliError("validation_error", `${field3} must be a positive canonical tag id`);
|
|
@@ -31289,7 +31475,7 @@ var consolidationApplyInput = /* @__PURE__ */ __name((options) => {
|
|
|
31289
31475
|
return input;
|
|
31290
31476
|
}, "consolidationApplyInput");
|
|
31291
31477
|
|
|
31292
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
31478
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/store/sqlite/tag-consolidation-apply.js
|
|
31293
31479
|
var receiptOf = /* @__PURE__ */ __name((row2) => ({
|
|
31294
31480
|
id: String(row2.id),
|
|
31295
31481
|
sourceId: String(row2.source_id),
|
|
@@ -31364,7 +31550,7 @@ var applyTagConsolidation = /* @__PURE__ */ __name((context, preview, options) =
|
|
|
31364
31550
|
}, { beforeCommit: check3 });
|
|
31365
31551
|
}, "applyTagConsolidation");
|
|
31366
31552
|
|
|
31367
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
31553
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/store/sqlite/tag-consolidation.js
|
|
31368
31554
|
var selections = [
|
|
31369
31555
|
["taggings", "tag_id IN (SELECT value FROM json_each(?))"],
|
|
31370
31556
|
["aliases", "aliasable_type='tag' AND aliasable_id IN (SELECT value FROM json_each(?))"],
|
|
@@ -31508,7 +31694,7 @@ var previewRows = /* @__PURE__ */ __name((context, options, source2, survivor, m
|
|
|
31508
31694
|
};
|
|
31509
31695
|
}, "previewRows");
|
|
31510
31696
|
|
|
31511
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
31697
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/store/sqlite/vocabulary.js
|
|
31512
31698
|
var kinds = ["project", "tag", "topic"];
|
|
31513
31699
|
var cancelled2 = /* @__PURE__ */ __name((signal) => {
|
|
31514
31700
|
if (signal?.aborted)
|
|
@@ -31772,18 +31958,18 @@ var vocabularyStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
31772
31958
|
};
|
|
31773
31959
|
}, "vocabularyStoreOver");
|
|
31774
31960
|
|
|
31775
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
31961
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/store/sqlite/knowledge.js
|
|
31776
31962
|
var TYPED_KEY_PREFIXES = new Set(Object.values(TASK_KEY_PREFIXES));
|
|
31777
31963
|
var ORGANIZATION_KINDS = ["company", "team", "family", "community"];
|
|
31778
31964
|
var PROJECT_TYPES = ["work", "client", "personal", "oss", "other"];
|
|
31779
31965
|
var SCOPES = ["personal", "work"];
|
|
31780
|
-
var
|
|
31966
|
+
var iso10 = /* @__PURE__ */ __name((value) => new Date(Number(value)).toISOString(), "iso");
|
|
31781
31967
|
var bounded2 = /* @__PURE__ */ __name((limit = 100, offset = 0) => {
|
|
31782
31968
|
if (!Number.isInteger(limit) || limit < 1 || limit > 500 || !Number.isInteger(offset) || offset < 0 || offset > 1e5)
|
|
31783
31969
|
throw new CliError("validation_error", "limit takes 1\u2013500 and offset takes 0\u2013100000");
|
|
31784
31970
|
return { limit, offset };
|
|
31785
31971
|
}, "bounded");
|
|
31786
|
-
var
|
|
31972
|
+
var textOf4 = /* @__PURE__ */ __name((text5, max = 1e5) => {
|
|
31787
31973
|
const value = text5.trim();
|
|
31788
31974
|
if (!value || value.length > max)
|
|
31789
31975
|
throw new CliError("validation_error", `text takes 1\u2013${max} characters`);
|
|
@@ -31910,8 +32096,8 @@ var knowledgeStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
31910
32096
|
text: String(row2.body),
|
|
31911
32097
|
revision: Number(row2.revision),
|
|
31912
32098
|
authoredBy: "owner",
|
|
31913
|
-
createdAt:
|
|
31914
|
-
updatedAt:
|
|
32099
|
+
createdAt: iso10(row2.created_at),
|
|
32100
|
+
updatedAt: iso10(row2.updated_at)
|
|
31915
32101
|
};
|
|
31916
32102
|
}, "annotationOf");
|
|
31917
32103
|
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");
|
|
@@ -31929,7 +32115,7 @@ var knowledgeStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
31929
32115
|
kind: row2.kind,
|
|
31930
32116
|
name: String(row2.name),
|
|
31931
32117
|
scope: row2.scope,
|
|
31932
|
-
createdAt:
|
|
32118
|
+
createdAt: iso10(row2.created_at)
|
|
31933
32119
|
}), "organizationOf");
|
|
31934
32120
|
const projectOf = /* @__PURE__ */ __name((row2) => ({
|
|
31935
32121
|
id: String(row2.id),
|
|
@@ -31940,7 +32126,7 @@ var knowledgeStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
31940
32126
|
type: row2.type,
|
|
31941
32127
|
organizationId: row2.organization_id == null ? null : String(row2.organization_id),
|
|
31942
32128
|
scope: row2.scope,
|
|
31943
|
-
createdAt:
|
|
32129
|
+
createdAt: iso10(row2.created_at)
|
|
31944
32130
|
}), "projectOf");
|
|
31945
32131
|
const relationOf = /* @__PURE__ */ __name((link3) => ({
|
|
31946
32132
|
id: link3.id,
|
|
@@ -31977,7 +32163,7 @@ var knowledgeStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
31977
32163
|
const reminderOf = /* @__PURE__ */ __name((row2) => ({
|
|
31978
32164
|
id: String(row2.id),
|
|
31979
32165
|
task: taskIdOf(database, Number(row2.task_id)) ?? String(row2.task_id),
|
|
31980
|
-
dueAt:
|
|
32166
|
+
dueAt: iso10(row2.due_at),
|
|
31981
32167
|
timezone: String(row2.timezone),
|
|
31982
32168
|
state: row2.state,
|
|
31983
32169
|
revision: Number(row2.revision),
|
|
@@ -32019,7 +32205,7 @@ var knowledgeStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
32019
32205
|
return { items: rows.slice(0, limit).map((row2) => String(row2.id ?? row2.key)), hasMore: rows.length > limit };
|
|
32020
32206
|
}, "taskIds"),
|
|
32021
32207
|
addAnnotation: /* @__PURE__ */ __name(async (key2, target, text5) => {
|
|
32022
|
-
const body2 =
|
|
32208
|
+
const body2 = textOf4(text5);
|
|
32023
32209
|
if (subfolder(target) !== null)
|
|
32024
32210
|
throw new CliError("validation_error", "annotate a folder, not one of its subfolders");
|
|
32025
32211
|
const thing = available(key2, target);
|
|
@@ -32044,7 +32230,7 @@ var knowledgeStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
32044
32230
|
annotation: /* @__PURE__ */ __name(async (key2, id2) => annotation(key2, id2), "annotation"),
|
|
32045
32231
|
editAnnotation: /* @__PURE__ */ __name(async (key2, id2, text5, revision2) => {
|
|
32046
32232
|
const held = annotation(key2, id2);
|
|
32047
|
-
const changed = database.prepare("UPDATE notes SET body=?, revision=revision+1, updated_at=? WHERE id=? AND revision=?").run(
|
|
32233
|
+
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;
|
|
32048
32234
|
if (!changed)
|
|
32049
32235
|
throw new CliError("validation_error", "annotation changed; read the current revision before editing");
|
|
32050
32236
|
database.prepare("INSERT INTO note_revisions (note_id, body, revision, created_at) VALUES (?, ?, ?, ?)").run(Number(id2), held.text, held.revision, now2());
|
|
@@ -32117,7 +32303,7 @@ var knowledgeStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
32117
32303
|
}, "labelled"),
|
|
32118
32304
|
addOrganization: /* @__PURE__ */ __name(async ({ kind: kind3, name, scope: scope3 = "personal" }) => {
|
|
32119
32305
|
const at = now2();
|
|
32120
|
-
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"),
|
|
32306
|
+
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);
|
|
32121
32307
|
return organizationOf(row2);
|
|
32122
32308
|
}, "addOrganization"),
|
|
32123
32309
|
organizations: /* @__PURE__ */ __name(async (query) => {
|
|
@@ -32130,7 +32316,7 @@ var knowledgeStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
32130
32316
|
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);
|
|
32131
32317
|
}, "organizations"),
|
|
32132
32318
|
addProject: /* @__PURE__ */ __name(async ({ name, key: key2, type = "other", organization, scope: scope3 = "personal", description }) => write(database, () => {
|
|
32133
|
-
const title =
|
|
32319
|
+
const title = textOf4(name, 200);
|
|
32134
32320
|
const organizationId = organization === void 0 ? null : (() => {
|
|
32135
32321
|
const thing = thingOf(database, organization);
|
|
32136
32322
|
if (thing?.type !== "organization")
|
|
@@ -32165,7 +32351,7 @@ var knowledgeStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
32165
32351
|
chosen = `${wanted.slice(0, 4 - suffix.length)}${suffix}`;
|
|
32166
32352
|
}
|
|
32167
32353
|
const at = now2();
|
|
32168
|
-
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 :
|
|
32354
|
+
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);
|
|
32169
32355
|
return projectOf(row2);
|
|
32170
32356
|
}), "addProject"),
|
|
32171
32357
|
projects: /* @__PURE__ */ __name(async (query) => {
|
|
@@ -32294,7 +32480,7 @@ var projectKey = /* @__PURE__ */ __name((name) => {
|
|
|
32294
32480
|
return key2.padEnd(3, "X");
|
|
32295
32481
|
}, "projectKey");
|
|
32296
32482
|
|
|
32297
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
32483
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/store/sqlite/log-pruning.js
|
|
32298
32484
|
var DAY5 = 864e5;
|
|
32299
32485
|
var SETTING4 = "logs_pruned_at";
|
|
32300
32486
|
var LOG_RETENTION = { agentActionsMs: 90 * DAY5, botUpdatePayloadsMs: 30 * DAY5 };
|
|
@@ -32321,7 +32507,7 @@ var logPruner = /* @__PURE__ */ __name((database, now2) => {
|
|
|
32321
32507
|
};
|
|
32322
32508
|
}, "logPruner");
|
|
32323
32509
|
|
|
32324
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
32510
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-findings.js
|
|
32325
32511
|
var stale2 = /* @__PURE__ */ __name(() => {
|
|
32326
32512
|
throw new CliError("validation_error", "meeting findings changed since they were read; stage a new batch", {
|
|
32327
32513
|
reason: "meeting-findings.stale"
|
|
@@ -32490,7 +32676,7 @@ var meetingFindingsStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
32490
32676
|
};
|
|
32491
32677
|
}, "meetingFindingsStoreOver");
|
|
32492
32678
|
|
|
32493
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
32679
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-vectors.js
|
|
32494
32680
|
var RANK_BATCH = 512;
|
|
32495
32681
|
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";
|
|
32496
32682
|
var limitOf = /* @__PURE__ */ __name((value, name, max = 1e3) => {
|
|
@@ -32510,7 +32696,7 @@ var modelOf = /* @__PURE__ */ __name((model) => {
|
|
|
32510
32696
|
var missing3 = /* @__PURE__ */ __name(() => {
|
|
32511
32697
|
throw new CliError("not_found", "Current transcript not found");
|
|
32512
32698
|
}, "missing");
|
|
32513
|
-
var
|
|
32699
|
+
var textOf5 = /* @__PURE__ */ __name((context, accountId, transcriptId, budget, signal) => {
|
|
32514
32700
|
const maxRows = limitOf(budget.maxRows ?? 1e4, "maxRows", 1e5);
|
|
32515
32701
|
const maxBytes = limitOf(budget.maxTextBytes ?? 4 * 1024 * 1024, "maxTextBytes", 64 * 1024 * 1024);
|
|
32516
32702
|
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();
|
|
@@ -32544,14 +32730,14 @@ var textLoader = /* @__PURE__ */ __name((context, input) => {
|
|
|
32544
32730
|
return existing;
|
|
32545
32731
|
if (remaining <= 0)
|
|
32546
32732
|
throw new CliError("validation_error", "Vector operation exceeds its aggregate text read budget");
|
|
32547
|
-
const document =
|
|
32733
|
+
const document = textOf5(context, input.accountId, id2, { ...input, maxTextBytes: remaining }, input.signal);
|
|
32548
32734
|
remaining -= document.readBytes;
|
|
32549
32735
|
loaded3.set(id2, document);
|
|
32550
32736
|
return document;
|
|
32551
32737
|
};
|
|
32552
32738
|
}, "textLoader");
|
|
32553
32739
|
var chunkText = /* @__PURE__ */ __name((context, accountId, row2, budget, signal, loaded3) => {
|
|
32554
|
-
const document = loaded3 ??
|
|
32740
|
+
const document = loaded3 ?? textOf5(context, accountId, Number(row2.chunkable_id), budget, signal);
|
|
32555
32741
|
const start = Number(row2.start_offset), end = Number(row2.end_offset);
|
|
32556
32742
|
const text5 = document.text.slice(start, end);
|
|
32557
32743
|
if (chunkHash(text5) !== String(row2.content_hash))
|
|
@@ -32761,7 +32947,7 @@ var meetingVectorsOver = /* @__PURE__ */ __name((context) => ({
|
|
|
32761
32947
|
}
|
|
32762
32948
|
}), "meetingVectorsOver");
|
|
32763
32949
|
|
|
32764
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
32950
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/store/sqlite/mention-sources.js
|
|
32765
32951
|
var OTHER_SOURCES = ["document", "note", "email"];
|
|
32766
32952
|
var TEXTS = {
|
|
32767
32953
|
document: "JOIN documents s ON mn.source_type = 'document' AND s.id = mn.source_id AND s.deleted_at IS NULL WHERE 1 ",
|
|
@@ -32862,11 +33048,11 @@ var sourceMentionStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
32862
33048
|
};
|
|
32863
33049
|
}, "sourceMentionStoreOver");
|
|
32864
33050
|
|
|
32865
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
33051
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/store/sqlite/open-store.js
|
|
32866
33052
|
import { mkdirSync, statSync, writeFileSync } from "node:fs";
|
|
32867
33053
|
import { dirname } from "node:path";
|
|
32868
33054
|
|
|
32869
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
33055
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/store/sqlite/clients.js
|
|
32870
33056
|
import { readFileSync as readFileSync3 } from "node:fs";
|
|
32871
33057
|
var CLIENTS_SETTING = "clients";
|
|
32872
33058
|
var coreVersion = (() => {
|
|
@@ -32924,7 +33110,7 @@ var refusalAdvice = /* @__PURE__ */ __name((clients, command, schema) => {
|
|
|
32924
33110
|
return mover ? `${own} (${mover.command} ${mover.version} moved the store to schema ${schema})` : own;
|
|
32925
33111
|
}, "refusalAdvice");
|
|
32926
33112
|
|
|
32927
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
33113
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/store/sqlite/migrations.generated.js
|
|
32928
33114
|
var GENERATED = [
|
|
32929
33115
|
{
|
|
32930
33116
|
"name": "20261010184427_initial",
|
|
@@ -33790,7 +33976,7 @@ WHERE json_type(params, '$.selection') = 'object';`
|
|
|
33790
33976
|
}
|
|
33791
33977
|
];
|
|
33792
33978
|
|
|
33793
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
33979
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/store/sqlite/manifest.js
|
|
33794
33980
|
var MANIFEST = [
|
|
33795
33981
|
{ name: "20261010184427_initial", version: 1, minCompatible: 1 },
|
|
33796
33982
|
{ name: "20261011035353_version-2-facts", version: 2, minCompatible: 1 },
|
|
@@ -33868,7 +34054,7 @@ var generatedMigrations = /* @__PURE__ */ __name((manifest = MANIFEST, generated
|
|
|
33868
34054
|
return migrations;
|
|
33869
34055
|
}, "generatedMigrations");
|
|
33870
34056
|
|
|
33871
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34057
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/store/migrations.js
|
|
33872
34058
|
var MIGRATIONS = generatedMigrations();
|
|
33873
34059
|
var HISTORY = `CREATE TABLE IF NOT EXISTS schema_migrations (
|
|
33874
34060
|
version INTEGER PRIMARY KEY,
|
|
@@ -33921,7 +34107,7 @@ var migrate = /* @__PURE__ */ __name((database, { migrations = MIGRATIONS, now:
|
|
|
33921
34107
|
}
|
|
33922
34108
|
}, "migrate");
|
|
33923
34109
|
|
|
33924
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34110
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/store/sqlite/join-keys.js
|
|
33925
34111
|
var fillJoinKeys = /* @__PURE__ */ __name((database, { batch = 2e3 } = {}) => {
|
|
33926
34112
|
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 ?");
|
|
33927
34113
|
if (pending.get(0, 1) === void 0)
|
|
@@ -33943,7 +34129,7 @@ var fillJoinKeys = /* @__PURE__ */ __name((database, { batch = 2e3 } = {}) => {
|
|
|
33943
34129
|
}
|
|
33944
34130
|
}, "fillJoinKeys");
|
|
33945
34131
|
|
|
33946
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34132
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/store/sqlite/open.js
|
|
33947
34133
|
var openSqlite = /* @__PURE__ */ __name(async (path, { readOnly = false } = {}) => {
|
|
33948
34134
|
const opened = "Bun" in globalThis ? await openUnderBun(path, readOnly) : await openUnderNode(path, readOnly);
|
|
33949
34135
|
try {
|
|
@@ -33956,8 +34142,8 @@ var openSqlite = /* @__PURE__ */ __name(async (path, { readOnly = false } = {})
|
|
|
33956
34142
|
}, "openSqlite");
|
|
33957
34143
|
var openUnderNode = /* @__PURE__ */ __name(async (path, readOnly) => {
|
|
33958
34144
|
quietSqliteWarning();
|
|
33959
|
-
const { drizzle } = await import("./node-
|
|
33960
|
-
const { cacheOverNodeSqlite, nodeClient } = await import("./node-sqlite-
|
|
34145
|
+
const { drizzle } = await import("./node-ZYWB7IET.js");
|
|
34146
|
+
const { cacheOverNodeSqlite, nodeClient } = await import("./node-sqlite-J3OODPYK.js");
|
|
33961
34147
|
const client = await nodeClient(path, { readOnly });
|
|
33962
34148
|
try {
|
|
33963
34149
|
return { database: cacheOverNodeSqlite(client), orm: drizzle({ client }) };
|
|
@@ -33967,8 +34153,8 @@ var openUnderNode = /* @__PURE__ */ __name(async (path, readOnly) => {
|
|
|
33967
34153
|
}
|
|
33968
34154
|
}, "openUnderNode");
|
|
33969
34155
|
var openUnderBun = /* @__PURE__ */ __name(async (path, readOnly) => {
|
|
33970
|
-
const { bunClient, cacheOverBunSqlite } = await import("./bun-sqlite-
|
|
33971
|
-
const { drizzle } = await import("./bun-
|
|
34156
|
+
const { bunClient, cacheOverBunSqlite } = await import("./bun-sqlite-RI7DR6RZ.js");
|
|
34157
|
+
const { drizzle } = await import("./bun-7SYKSCLA.js");
|
|
33972
34158
|
const client = await bunClient(path, readOnly ? { readonly: true, create: false } : void 0);
|
|
33973
34159
|
try {
|
|
33974
34160
|
return { database: cacheOverBunSqlite(client), orm: drizzle({ client }) };
|
|
@@ -33978,7 +34164,7 @@ var openUnderBun = /* @__PURE__ */ __name(async (path, readOnly) => {
|
|
|
33978
34164
|
}
|
|
33979
34165
|
}, "openUnderBun");
|
|
33980
34166
|
|
|
33981
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34167
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/store/sqlite/read-compatibility.js
|
|
33982
34168
|
var assertReadCompatible = /* @__PURE__ */ __name((database, command) => {
|
|
33983
34169
|
const ours = MIGRATIONS.at(-1)?.version ?? 0;
|
|
33984
34170
|
if (!database.prepare("SELECT 1 FROM sqlite_master WHERE type='table' AND name='schema_migrations'").get())
|
|
@@ -33993,7 +34179,7 @@ var assertReadCompatible = /* @__PURE__ */ __name((database, command) => {
|
|
|
33993
34179
|
throw new CliError("configuration_error", `The store requires schema ${minCompatible}, but this tool supports ${ours}; ${refusalAdvice(storeClients(database), command, version)}`);
|
|
33994
34180
|
}, "assertReadCompatible");
|
|
33995
34181
|
|
|
33996
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34182
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/store/sqlite/open-store.js
|
|
33997
34183
|
var BACKFILL_ON_OPEN = 5e3;
|
|
33998
34184
|
var NOT_WRITABLE = /* @__PURE__ */ new Set(["EACCES", "EPERM", "EROFS"]);
|
|
33999
34185
|
var createWritable = /* @__PURE__ */ __name((file) => {
|
|
@@ -34049,13 +34235,13 @@ var openStoreContext = /* @__PURE__ */ __name(async ({ path, env, now: now2 = Da
|
|
|
34049
34235
|
}
|
|
34050
34236
|
}, "openStoreContext");
|
|
34051
34237
|
|
|
34052
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34238
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/store/project-transfer/plan.js
|
|
34053
34239
|
import { createHash as createHash17 } from "node:crypto";
|
|
34054
34240
|
|
|
34055
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34241
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/store/project-transfer/manifest.js
|
|
34056
34242
|
import { createHash as createHash16 } from "node:crypto";
|
|
34057
34243
|
|
|
34058
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34244
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/store/project-transfer/schema.js
|
|
34059
34245
|
var text3 = /* @__PURE__ */ __name((max) => pipe(string(), minLength(1), maxLength(max)), "text");
|
|
34060
34246
|
var ref = text3(2048);
|
|
34061
34247
|
var timestamp2 = pipe(number(), safeInteger(), minValue(0));
|
|
@@ -34121,7 +34307,7 @@ var projectAnnotationsSchema = strictObject({
|
|
|
34121
34307
|
}))
|
|
34122
34308
|
});
|
|
34123
34309
|
|
|
34124
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34310
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/store/project-transfer/manifest.js
|
|
34125
34311
|
var PROJECT_ANNOTATIONS_MAX_BYTES = 4 * 1024 * 1024;
|
|
34126
34312
|
var invalid5 = /* @__PURE__ */ __name((field3) => {
|
|
34127
34313
|
throw new CliError("validation_error", `invalid project annotations.${field3}`);
|
|
@@ -34254,7 +34440,7 @@ var projectAnnotationsFingerprint = /* @__PURE__ */ __name((json3) => {
|
|
|
34254
34440
|
return createHash16("sha256").update(JSON.stringify(normalized)).digest("hex");
|
|
34255
34441
|
}, "projectAnnotationsFingerprint");
|
|
34256
34442
|
|
|
34257
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34443
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/store/project-transfer/plan.js
|
|
34258
34444
|
var hash = pipe(string(), regex(/^[a-f0-9]{64}$/));
|
|
34259
34445
|
var ref2 = pipe(string(), minLength(1), maxLength(2048));
|
|
34260
34446
|
var targetSchema = strictObject({
|
|
@@ -34361,7 +34547,7 @@ var planBoundProjectAnnotations = /* @__PURE__ */ __name((manifest, manifest_fin
|
|
|
34361
34547
|
}, "planBoundProjectAnnotations");
|
|
34362
34548
|
var planProjectAnnotations = /* @__PURE__ */ __name((json3, target, bindings) => planBoundProjectAnnotations(decodeProjectAnnotations(json3), projectAnnotationsFingerprint(json3), target, bindings), "planProjectAnnotations");
|
|
34363
34549
|
|
|
34364
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34550
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/store/project-transfer/snapshot-model.js
|
|
34365
34551
|
import { createHash as createHash18 } from "node:crypto";
|
|
34366
34552
|
var text4 = /* @__PURE__ */ __name((max) => pipe(string(), minLength(1), maxLength(max)), "text");
|
|
34367
34553
|
var timestamp3 = pipe(number(), safeInteger(), minValue(0));
|
|
@@ -34455,7 +34641,7 @@ var projectAnnotationSnapshotFingerprint = /* @__PURE__ */ __name((json3) => {
|
|
|
34455
34641
|
})).digest("hex");
|
|
34456
34642
|
}, "projectAnnotationSnapshotFingerprint");
|
|
34457
34643
|
|
|
34458
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34644
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/store/project-transfer/request.js
|
|
34459
34645
|
var projectAnnotationRequest = /* @__PURE__ */ __name((request, restore = false) => {
|
|
34460
34646
|
if (!request || typeof request !== "object" || Array.isArray(request))
|
|
34461
34647
|
throw new CliError("validation_error", "project annotation request is required");
|
|
@@ -34472,7 +34658,7 @@ var projectAnnotationRequest = /* @__PURE__ */ __name((request, restore = false)
|
|
|
34472
34658
|
return { snapshot: snapshot2, projectId: Number(request.project.slice(8)) };
|
|
34473
34659
|
}, "projectAnnotationRequest");
|
|
34474
34660
|
|
|
34475
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34661
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/store/sqlite/project-transfer/budget.js
|
|
34476
34662
|
var SnapshotBudget = class {
|
|
34477
34663
|
static {
|
|
34478
34664
|
__name(this, "SnapshotBudget");
|
|
@@ -34498,13 +34684,13 @@ var SnapshotBudget = class {
|
|
|
34498
34684
|
}
|
|
34499
34685
|
};
|
|
34500
34686
|
|
|
34501
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34687
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/store/sqlite/project-transfer/preview.js
|
|
34502
34688
|
import { createHash as createHash20 } from "node:crypto";
|
|
34503
34689
|
|
|
34504
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34690
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/store/project-transfer/snapshot-plan.js
|
|
34505
34691
|
var planProjectAnnotationSnapshot = /* @__PURE__ */ __name((json3, target, bindings) => planBoundProjectAnnotations(decodeProjectAnnotationSnapshot(json3), projectAnnotationSnapshotFingerprint(json3), target, bindings), "planProjectAnnotationSnapshot");
|
|
34506
34692
|
|
|
34507
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34693
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/store/sqlite/project-transfer/sources.js
|
|
34508
34694
|
import { createHash as createHash19 } from "node:crypto";
|
|
34509
34695
|
var invalid7 = /* @__PURE__ */ __name(() => {
|
|
34510
34696
|
throw new CliError("configuration_error", "project snapshot has an unavailable or unsupported dependency");
|
|
@@ -34647,7 +34833,7 @@ var ProjectSnapshotSources = class {
|
|
|
34647
34833
|
}
|
|
34648
34834
|
};
|
|
34649
34835
|
|
|
34650
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34836
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/store/sqlite/project-transfer/snapshot.js
|
|
34651
34837
|
var unsupported = /* @__PURE__ */ __name(() => {
|
|
34652
34838
|
throw new CliError("configuration_error", "project snapshot has unsupported metadata, deletion or account scope");
|
|
34653
34839
|
}, "unsupported");
|
|
@@ -34818,7 +35004,7 @@ var projectAnnotationSnapshot = /* @__PURE__ */ __name((database, projectId, bud
|
|
|
34818
35004
|
return { snapshot: snapshot2, read_bytes: budget.bytes, records: budget.records };
|
|
34819
35005
|
}), "projectAnnotationSnapshot");
|
|
34820
35006
|
|
|
34821
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
35007
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/store/sqlite/project-transfer/preview.js
|
|
34822
35008
|
var previewAnnotationSnapshot = /* @__PURE__ */ __name((database, projectId, manifest, bindings, budget) => read(database, () => {
|
|
34823
35009
|
const current = projectAnnotationSnapshot(database, projectId, budget).snapshot;
|
|
34824
35010
|
const sources = new ProjectSnapshotSources(database, budget);
|
|
@@ -34880,7 +35066,7 @@ var previewAnnotationSnapshot = /* @__PURE__ */ __name((database, projectId, man
|
|
|
34880
35066
|
};
|
|
34881
35067
|
}), "previewAnnotationSnapshot");
|
|
34882
35068
|
|
|
34883
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
35069
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/store/sqlite/project-transfer/records.js
|
|
34884
35070
|
var restoreAnnotationRecords = /* @__PURE__ */ __name((database, projectId, snapshot2, bindings) => {
|
|
34885
35071
|
const mappings = { ...bindings };
|
|
34886
35072
|
const resolve = /* @__PURE__ */ __name((ref3) => {
|
|
@@ -34922,7 +35108,7 @@ var restoreAnnotationRecords = /* @__PURE__ */ __name((database, projectId, snap
|
|
|
34922
35108
|
return mappings;
|
|
34923
35109
|
}, "restoreAnnotationRecords");
|
|
34924
35110
|
|
|
34925
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
35111
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/store/sqlite/project-transfer/store.js
|
|
34926
35112
|
var projectAnnotationStoreOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
34927
35113
|
async preview(request) {
|
|
34928
35114
|
const { snapshot: snapshot2, projectId } = projectAnnotationRequest(request);
|
|
@@ -34952,7 +35138,7 @@ var projectAnnotationStoreOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
|
34952
35138
|
}
|
|
34953
35139
|
}), "projectAnnotationStoreOver");
|
|
34954
35140
|
|
|
34955
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
35141
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/store/sqlite/ranges.js
|
|
34956
35142
|
var markRange = /* @__PURE__ */ __name(({ orm, now: now2 }, chatKey, from2, to) => {
|
|
34957
35143
|
const touching = and(eq(syncRanges.chatId, chatKey), lte(syncRanges.fromKey, to + 1), gte(syncRanges.toKey, from2 - 1));
|
|
34958
35144
|
let merged = { from: from2, to };
|
|
@@ -34965,7 +35151,7 @@ var markRange = /* @__PURE__ */ __name(({ orm, now: now2 }, chatKey, from2, to)
|
|
|
34965
35151
|
}, "markRange");
|
|
34966
35152
|
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");
|
|
34967
35153
|
|
|
34968
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
35154
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/store/sqlite/task-rule-stops.js
|
|
34969
35155
|
var keyOf4 = /* @__PURE__ */ __name(({ provider, account }) => `task_rules_until:${provider}:${account}`, "keyOf");
|
|
34970
35156
|
var taskRulesStop = /* @__PURE__ */ __name((database, account) => {
|
|
34971
35157
|
const row2 = database.prepare("SELECT value FROM store_settings WHERE key = ?").get(keyOf4(account));
|
|
@@ -34975,7 +35161,7 @@ var setTaskRulesStop = /* @__PURE__ */ __name((database, account, until, now2) =
|
|
|
34975
35161
|
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);
|
|
34976
35162
|
}, "setTaskRulesStop");
|
|
34977
35163
|
|
|
34978
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
35164
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/store/sync.js
|
|
34979
35165
|
var syncStoreOver = /* @__PURE__ */ __name((context) => {
|
|
34980
35166
|
const { database } = context;
|
|
34981
35167
|
const { accountPk: accountPk2, findAccountPk: findAccountPk2, chatKeyOf, chatPkFor: chatPkFor2, identityPk: identityPk2, writeMembers: writeMembers2, writeState: writeState2 } = keysOver(context);
|
|
@@ -35031,7 +35217,7 @@ var syncStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
35031
35217
|
};
|
|
35032
35218
|
}, "syncStoreOver");
|
|
35033
35219
|
|
|
35034
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
35220
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/store/tags.js
|
|
35035
35221
|
var tagsStoreOver = /* @__PURE__ */ __name((context) => {
|
|
35036
35222
|
const { database } = context;
|
|
35037
35223
|
return {
|
|
@@ -35053,7 +35239,7 @@ var tagsStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
35053
35239
|
};
|
|
35054
35240
|
}, "tagsStoreOver");
|
|
35055
35241
|
|
|
35056
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
35242
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/store/sqlite/image-chunks.js
|
|
35057
35243
|
var IS_IMAGE = sql`(a.kind = 'photo' OR a.mime LIKE 'image/%')`;
|
|
35058
35244
|
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
|
|
35059
35245
|
WHERE chat_id = ${chatKey} AND deleted_at IS NULL AND trim(text) <> '' AND id <> ${messagePk}
|
|
@@ -35180,7 +35366,7 @@ var savePictureChunks = /* @__PURE__ */ __name(({ orm, now: now2, database }, ac
|
|
|
35180
35366
|
dropUnusedVectors(database, released.map(({ hash: hash2 }) => hash2));
|
|
35181
35367
|
}, "savePictureChunks");
|
|
35182
35368
|
|
|
35183
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
35369
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/store/sqlite/message-chunks.js
|
|
35184
35370
|
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,
|
|
35185
35371
|
EXISTS (SELECT 1 FROM embeddings v WHERE v.model = ${model} AND v.content_hash = k.content_hash) AS embedded
|
|
35186
35372
|
FROM messages m
|
|
@@ -35263,7 +35449,7 @@ var nearestMessages = /* @__PURE__ */ __name((context, accountPk2, { limit, quer
|
|
|
35263
35449
|
return plain2(best(found2));
|
|
35264
35450
|
}, "nearestMessages");
|
|
35265
35451
|
|
|
35266
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
35452
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/store/vectors.js
|
|
35267
35453
|
var accountVectorsOver = /* @__PURE__ */ __name((context, mail) => {
|
|
35268
35454
|
const { database } = context;
|
|
35269
35455
|
const { findAccountPk: findAccountPk2, findChatPk: findChatPk2, chatKeyOf } = keysOver(context);
|
|
@@ -35517,7 +35703,7 @@ var vectorsStoreOver = /* @__PURE__ */ __name((context, keyed) => ({
|
|
|
35517
35703
|
embeddedHashes: /* @__PURE__ */ __name(async (model, hashes) => embeddedHashes(context, model, hashes), "embeddedHashes")
|
|
35518
35704
|
}), "vectorsStoreOver");
|
|
35519
35705
|
|
|
35520
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
35706
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/store/sqlite/store-tables.js
|
|
35521
35707
|
import { existsSync, readFileSync as readFileSync4 } from "node:fs";
|
|
35522
35708
|
import { dirname as dirname2, join as join2 } from "node:path";
|
|
35523
35709
|
var BOOKKEEPING = ["schema_migrations", "store_settings"];
|
|
@@ -35605,10 +35791,10 @@ var lastBackup = /* @__PURE__ */ __name((path) => {
|
|
|
35605
35791
|
}
|
|
35606
35792
|
}, "lastBackup");
|
|
35607
35793
|
|
|
35608
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
35794
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/store/providers.js
|
|
35609
35795
|
var registerProvider2 = /* @__PURE__ */ __name((store, entry2) => store.accounts.registerProvider(entry2), "registerProvider");
|
|
35610
35796
|
|
|
35611
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
35797
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/store/sqlite/store-contents.js
|
|
35612
35798
|
var COUNTED_TABLES = [
|
|
35613
35799
|
"accounts",
|
|
35614
35800
|
"chats",
|
|
@@ -35693,7 +35879,7 @@ var storeContents = /* @__PURE__ */ __name((database) => {
|
|
|
35693
35879
|
};
|
|
35694
35880
|
}, "storeContents");
|
|
35695
35881
|
|
|
35696
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
35882
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.501.0_@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_type_e6af10c98f87b1454255e560646d3ddf/node_modules/@wirecat/cli-core/dist/store/store.js
|
|
35697
35883
|
var openStore = /* @__PURE__ */ __name(async (options = {}) => {
|
|
35698
35884
|
const context = await openStoreContext(options);
|
|
35699
35885
|
try {
|