@wirecat/cli-memo 0.131.22 → 0.131.24
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin/memo.js +2 -2
- package/dist/bundle/{all-profiles-EZLU6CY7.js → all-profiles-ZCJTYGOL.js} +7 -7
- package/dist/bundle/{anthropic-XC34PJH5.js → anthropic-7WVLAKTX.js} +5 -5
- package/dist/bundle/{app-server-PRQVGA5X.js → app-server-6G3SXEHO.js} +38 -38
- package/dist/bundle/auto-JWPM5654.js +86 -0
- package/dist/bundle/{bun-CKGKUKW5.js → bun-JVBDJKBB.js} +2 -2
- package/dist/bundle/{bun-sqlite-S6KUSMTC.js → bun-sqlite-P4I7NVMQ.js} +4 -4
- package/dist/bundle/{chunk-7F6FGMCC.js → chunk-2IRCJT4O.js} +7 -7
- package/dist/bundle/{chunk-SO2YVKBK.js → chunk-3KNXQZMO.js} +28 -28
- package/dist/bundle/{chunk-WEOFWTWZ.js → chunk-3MER7NE6.js} +3 -3
- package/dist/bundle/{chunk-DNGHE2Q4.js → chunk-3U7OUQV2.js} +1 -1
- package/dist/bundle/{chunk-AIIQ7YU4.js → chunk-5YCNCXL5.js} +1 -1
- package/dist/bundle/{chunk-2NJUPIAO.js → chunk-AIGMYGEL.js} +1 -1
- package/dist/bundle/{chunk-7W3RCCRR.js → chunk-AIVUS6WA.js} +10 -10
- package/dist/bundle/{chunk-KUNA6MQZ.js → chunk-ALGIPJ6L.js} +1 -1
- package/dist/bundle/{chunk-IFWBFYXN.js → chunk-AWGV4VOA.js} +11 -11
- package/dist/bundle/{chunk-QMMUPDRK.js → chunk-BTQSFPIM.js} +4 -4
- package/dist/bundle/{chunk-SMDWUPXE.js → chunk-CM2H7NRC.js} +3 -3
- package/dist/bundle/{chunk-CBYZW5CC.js → chunk-CPJEQK4V.js} +45 -45
- package/dist/bundle/{chunk-ILC7NFS2.js → chunk-DIMX5AEE.js} +4 -4
- package/dist/bundle/{program-ZIRYOO2T.js → chunk-DMQ3342A.js} +881 -11256
- package/dist/bundle/{chunk-VQM3H422.js → chunk-EACY2ULS.js} +428 -204
- package/dist/bundle/{chunk-IRDGD3QQ.js → chunk-EB7LKK4K.js} +1 -1
- package/dist/bundle/{chunk-XA6YO24S.js → chunk-EGG3PGCM.js} +1 -1
- package/dist/bundle/{chunk-J35OGOCI.js → chunk-EKTZEF3Q.js} +2 -2
- package/dist/bundle/{chunk-SXGAIQ5X.js → chunk-ELKYINWL.js} +12 -12
- package/dist/bundle/{chunk-VECICKTE.js → chunk-F2ED6KG6.js} +2 -2
- package/dist/bundle/{chunk-RG6ITTLQ.js → chunk-FXHN2UZW.js} +19 -14
- package/dist/bundle/{chunk-YAUDFROV.js → chunk-GQOXFZBX.js} +673 -371
- package/dist/bundle/{chunk-PF3ALSAV.js → chunk-GRXVN2X7.js} +1 -1
- package/dist/bundle/{chunk-6JOT5KWM.js → chunk-GSEDSGJF.js} +358 -266
- package/dist/bundle/{chunk-XPRYBLTS.js → chunk-IC2TL7RW.js} +2 -2
- package/dist/bundle/{chunk-MHDLZCEO.js → chunk-IJC6MFLP.js} +8 -8
- package/dist/bundle/{chunk-CCOYC6HL.js → chunk-INTF3YPV.js} +2 -2
- package/dist/bundle/{chunk-WUCQ56RP.js → chunk-ITQBXFMC.js} +2 -2
- package/dist/bundle/{chunk-ZKWE5MCA.js → chunk-J6D34BFP.js} +803 -351
- package/dist/bundle/{chunk-3V4WIGWC.js → chunk-JCCL7RGH.js} +2 -2
- package/dist/bundle/{chunk-VDBFSLHP.js → chunk-JDDVGGUV.js} +5 -5
- package/dist/bundle/{chunk-EG2OMKWH.js → chunk-JY4LVWGZ.js} +12 -0
- package/dist/bundle/{chunk-RNXYDBQO.js → chunk-KQSHIQSV.js} +134 -59
- package/dist/bundle/{chunk-KXERKAID.js → chunk-LNXFM4FD.js} +13 -13
- package/dist/bundle/{chunk-RHJC4PHV.js → chunk-LWIMGWKB.js} +3 -3
- package/dist/bundle/{chunk-ZD3STMY7.js → chunk-M43DAAZ7.js} +1 -1
- package/dist/bundle/{chunk-5UOOH7VG.js → chunk-MLMSQK76.js} +1 -1
- package/dist/bundle/{chunk-LGNS4JVK.js → chunk-MPVW7BQZ.js} +5 -5
- package/dist/bundle/{chunk-HXRIV2TV.js → chunk-MROFZXAB.js} +63 -30
- package/dist/bundle/{chunk-UCINAEIA.js → chunk-N5H6I7WQ.js} +5 -5
- package/dist/bundle/{chunk-OJRLTJRS.js → chunk-NAH473ZR.js} +1 -1
- package/dist/bundle/{chunk-DZSWKA3K.js → chunk-ND3GBFEY.js} +1 -1
- package/dist/bundle/{chunk-7MLWSUEK.js → chunk-OQK2IKPB.js} +1 -1
- package/dist/bundle/{chunk-3B645KUY.js → chunk-Q6MFBH6Q.js} +9 -9
- package/dist/bundle/{chunk-BB2MGFOZ.js → chunk-R2LJDDZP.js} +3 -3
- package/dist/bundle/{chunk-NELE7AIX.js → chunk-R3LNQ3I4.js} +1 -1
- package/dist/bundle/{chunk-LR5EY5JY.js → chunk-RTESJ5O2.js} +3 -3
- package/dist/bundle/{chunk-5RBLNI6C.js → chunk-SKTGBVYC.js} +4 -4
- package/dist/bundle/{chunk-CDZZ2DZO.js → chunk-T4LW6UYQ.js} +1 -1
- package/dist/bundle/{chunk-RC7TIYUZ.js → chunk-UA2C4BCH.js} +8 -8
- package/dist/bundle/{chunk-2TBIVKBH.js → chunk-UPXUE27A.js} +5 -5
- package/dist/bundle/{chunk-OUF6RCRZ.js → chunk-UVR6U55E.js} +5 -5
- package/dist/bundle/{chunk-VXHN3SWW.js → chunk-UXCDBNAY.js} +2 -2
- package/dist/bundle/{chunk-MCPDL5YU.js → chunk-UY2VH3QK.js} +1 -1
- package/dist/bundle/{chunk-CP5N3KH3.js → chunk-VLPMB3UU.js} +4 -4
- package/dist/bundle/{chunk-UG2V7BQY.js → chunk-VVEFQEWP.js} +21 -21
- package/dist/bundle/{chunk-THGFFQCK.js → chunk-XF3LZ32F.js} +2 -2
- package/dist/bundle/{chunk-GV2FSWFS.js → chunk-XSI5NYGB.js} +7 -7
- package/dist/bundle/{chunk-4SGCOUQ6.js → chunk-ZDOVR4PA.js} +6 -6
- package/dist/bundle/{chunk-OFYKXQMS.js → chunk-ZLZE5P6M.js} +7 -7
- package/dist/bundle/{chunk-E5FQ7U7L.js → chunk-ZOYGY2PN.js} +2 -2
- package/dist/bundle/{command-contract-TMVGYSQQ.js → command-contract-543RRFNU.js} +13 -13
- package/dist/bundle/{decode-6XSZIZAA.js → decode-YHX3DQG2.js} +4 -4
- package/dist/bundle/{dispatch-VUMQPYMA.js → dispatch-MELZFYOS.js} +1 -1
- package/dist/bundle/{echarts-NGS4QG4E.js → echarts-FBVAP7BR.js} +2 -2
- package/dist/bundle/{embed-YNH5M6UL.js → embed-CQJ42S5C.js} +5 -5
- package/dist/bundle/{embedder-LLNK4JF4.js → embedder-EDXLEJ27.js} +8 -8
- package/dist/bundle/{entry-L42C5CHF.js → entry-HZEA7QFK.js} +6 -6
- package/dist/bundle/failure-62G7QSPX.js +66 -0
- package/dist/bundle/{failure-Z2FXWIBY.js → failure-RBNZBCZJ.js} +1 -1
- package/dist/bundle/{first-run-TT6KMHKA.js → first-run-JZQN7R6M.js} +8 -8
- package/dist/bundle/first-screen-56V3UOQE.js +30 -0
- package/dist/bundle/{instructions-4EJ4BBWD.js → instructions-NYVYNWVU.js} +1 -1
- package/dist/bundle/mcp-Y6IPYDS2.js +90 -0
- package/dist/bundle/memo.js +9 -9
- package/dist/bundle/{node-QQXKQWNC.js → node-2QE6UPGS.js} +2 -2
- package/dist/bundle/{node-sqlite-GJI2GMLW.js → node-sqlite-SDHZJNY7.js} +5 -5
- package/dist/bundle/{oauth-Q5VGUPUR.js → oauth-FFUJREKS.js} +6 -6
- package/dist/bundle/{open-NSXIYF3N.js → open-NT2GYX6N.js} +4 -4
- package/dist/bundle/{openai-LHH7MSGQ.js → openai-IQA2XR6Z.js} +9 -9
- package/dist/bundle/{process-PI6XUJWP.js → process-HIEJXYW6.js} +1 -1
- package/dist/bundle/program-DEMRKCZY.js +10972 -0
- package/dist/bundle/{prompt-VFXA7IKL.js → prompt-IOZAME2R.js} +4 -4
- package/dist/bundle/{recognize-UWAARXOH.js → recognize-2XOAZJ5N.js} +3 -3
- package/dist/bundle/{remote-KGEVCB2Q.js → remote-2LE7OTDA.js} +6 -6
- package/dist/bundle/{rerank-SCBTCBPO.js → rerank-UKOVVZM6.js} +6 -6
- package/dist/bundle/{serve-WPVKVR24.js → serve-S2UHPEBP.js} +8 -8
- package/dist/bundle/server-3YNOEPWU.js +61 -0
- package/dist/bundle/{server-VO5SXU5A.js → server-BG4WWQHY.js} +53 -53
- package/dist/bundle/server-EZWQ5KP4.js +48 -0
- package/dist/bundle/{setup-X6OJ3K4F.js → setup-2X7ADKFH.js} +42 -42
- package/dist/bundle/{state-KGHS4C6J.js → state-F5KT3CBD.js} +5 -5
- package/dist/bundle/{store-VCVOIQES.js → store-WBUUS7FO.js} +11 -11
- package/dist/bundle/store-maintenance-command-KLST56XF.js +48 -0
- package/dist/bundle/update-WH4CGJGP.js +69 -0
- package/dist/config-command.d.ts.map +1 -1
- package/dist/config-command.js +23 -2
- package/dist/config-command.js.map +1 -1
- package/dist/config.d.ts +11 -2
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +50 -3
- package/dist/config.js.map +1 -1
- package/dist/examples.d.ts.map +1 -1
- package/dist/examples.js +2 -0
- package/dist/examples.js.map +1 -1
- package/dist/mail/review-command.d.ts.map +1 -1
- package/dist/mail/review-command.js +6 -0
- package/dist/mail/review-command.js.map +1 -1
- package/dist/review/kinds.js +2 -2
- package/dist/review/kinds.js.map +1 -1
- package/dist/tasks/command.js +2 -2
- package/dist/tasks/command.js.map +1 -1
- package/dist/tasks/tasks.d.ts +1 -1
- package/dist/tasks/tasks.d.ts.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +3 -3
- package/dist/bundle/auto-S3AYMAGB.js +0 -86
- package/dist/bundle/chunk-XW4KGSAA.js +0 -412
- package/dist/bundle/failure-TQJGSWRU.js +0 -66
- package/dist/bundle/first-screen-56KZKY77.js +0 -30
- package/dist/bundle/mcp-PNC3TI7O.js +0 -90
- package/dist/bundle/server-F2PSE6LG.js +0 -48
- package/dist/bundle/server-K5JYA3ZT.js +0 -61
- package/dist/bundle/store-maintenance-command-R4CP6AZN.js +0 -48
- package/dist/bundle/update-M6AIJ2SZ.js +0 -69
- /package/dist/bundle/{chunk-YYQN5ES2.js → chunk-CWOKGEL3.js} +0 -0
|
@@ -21,6 +21,7 @@ import {
|
|
|
21
21
|
TASK_TYPES,
|
|
22
22
|
TASK_VERDICTS,
|
|
23
23
|
WORK_TASK_TYPES,
|
|
24
|
+
aggregateMeetingCounts,
|
|
24
25
|
aggregateMeetingStats,
|
|
25
26
|
calendarText,
|
|
26
27
|
canonicalMeetingReference,
|
|
@@ -70,11 +71,11 @@ import {
|
|
|
70
71
|
validateQuery,
|
|
71
72
|
walkQuery,
|
|
72
73
|
zonedMoment
|
|
73
|
-
} from "./chunk-
|
|
74
|
+
} from "./chunk-KQSHIQSV.js";
|
|
74
75
|
import {
|
|
75
76
|
holdsCredential,
|
|
76
77
|
secretNamed
|
|
77
|
-
} from "./chunk-
|
|
78
|
+
} from "./chunk-GRXVN2X7.js";
|
|
78
79
|
import {
|
|
79
80
|
DEFAULT_STEMMERS,
|
|
80
81
|
DEFAULT_STEMMERS_VERSION,
|
|
@@ -87,26 +88,26 @@ import {
|
|
|
87
88
|
fold,
|
|
88
89
|
normalize,
|
|
89
90
|
parseStemmers
|
|
90
|
-
} from "./chunk-
|
|
91
|
+
} from "./chunk-2IRCJT4O.js";
|
|
91
92
|
import {
|
|
92
93
|
DEFAULT_TASK_CATEGORIES,
|
|
93
94
|
sharedConfigPath,
|
|
94
95
|
storedTaskCategories,
|
|
95
96
|
taskCategoriesReader
|
|
96
|
-
} from "./chunk-
|
|
97
|
+
} from "./chunk-UPXUE27A.js";
|
|
97
98
|
import {
|
|
98
99
|
refuseOwnerStoreInTests,
|
|
99
100
|
storePath
|
|
100
|
-
} from "./chunk-
|
|
101
|
+
} from "./chunk-UXCDBNAY.js";
|
|
101
102
|
import {
|
|
102
103
|
quietSqliteWarning,
|
|
103
104
|
storeCapable
|
|
104
|
-
} from "./chunk-
|
|
105
|
+
} from "./chunk-UVR6U55E.js";
|
|
105
106
|
import {
|
|
106
107
|
PRAGMAS,
|
|
107
108
|
TIME_LIMIT_FUNCTION,
|
|
108
109
|
TimeLimitReached
|
|
109
|
-
} from "./chunk-
|
|
110
|
+
} from "./chunk-AIGMYGEL.js";
|
|
110
111
|
import {
|
|
111
112
|
array,
|
|
112
113
|
boolean,
|
|
@@ -123,7 +124,7 @@ import {
|
|
|
123
124
|
safeParse,
|
|
124
125
|
strictObject,
|
|
125
126
|
string
|
|
126
|
-
} from "./chunk-
|
|
127
|
+
} from "./chunk-JY4LVWGZ.js";
|
|
127
128
|
import {
|
|
128
129
|
resolveFrom
|
|
129
130
|
} from "./chunk-Y5E2WNWB.js";
|
|
@@ -156,12 +157,12 @@ import {
|
|
|
156
157
|
sql,
|
|
157
158
|
sqliteTable,
|
|
158
159
|
text
|
|
159
|
-
} from "./chunk-
|
|
160
|
+
} from "./chunk-OQK2IKPB.js";
|
|
160
161
|
import {
|
|
161
162
|
__name
|
|
162
163
|
} from "./chunk-ZVVMGPBJ.js";
|
|
163
164
|
|
|
164
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
165
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.564.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_0a4d79b5da58b1179a36aa928f36b150/node_modules/@wirecat/cli-core/dist/store/account-store.js
|
|
165
166
|
var bindArea = /* @__PURE__ */ __name(({ keyed, whole }, account) => {
|
|
166
167
|
const methods = whole;
|
|
167
168
|
return Object.fromEntries(Object.keys(keyed).map((name) => [
|
|
@@ -289,7 +290,7 @@ var bindAccount = /* @__PURE__ */ __name((store, account, areas, owners) => {
|
|
|
289
290
|
};
|
|
290
291
|
}, "bindAccount");
|
|
291
292
|
|
|
292
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
293
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.564.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_0a4d79b5da58b1179a36aa928f36b150/node_modules/@wirecat/cli-core/dist/domain/locator.js
|
|
293
294
|
var SCHEME = "msg:";
|
|
294
295
|
var formatLocator = /* @__PURE__ */ __name(({ provider, account, chat: chat2, message: message2 }) => SCHEME + [provider, account, chat2, message2].map(encodeURIComponent).join("/"), "formatLocator");
|
|
295
296
|
var isLocator = /* @__PURE__ */ __name((reference2) => reference2.trim().startsWith(SCHEME), "isLocator");
|
|
@@ -303,7 +304,7 @@ var parseLocator = /* @__PURE__ */ __name((reference2) => {
|
|
|
303
304
|
return { provider, account, chat: chat2, message: message2 };
|
|
304
305
|
}, "parseLocator");
|
|
305
306
|
|
|
306
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
307
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.564.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_0a4d79b5da58b1179a36aa928f36b150/node_modules/@wirecat/cli-core/dist/domain/references.js
|
|
307
308
|
var SIMPLE_REFERENCES = [
|
|
308
309
|
"note",
|
|
309
310
|
"document",
|
|
@@ -450,7 +451,7 @@ var looksLikeReference = /* @__PURE__ */ __name((text6) => {
|
|
|
450
451
|
return match !== null && byPrefix.has(match[1]);
|
|
451
452
|
}, "looksLikeReference");
|
|
452
453
|
|
|
453
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
454
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.564.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_0a4d79b5da58b1179a36aa928f36b150/node_modules/@wirecat/cli-core/dist/domain/providers.js
|
|
454
455
|
var KINDS = ["messages", "mail", "notes", "documents", "meetings", "events"];
|
|
455
456
|
var MESSENGER_OPENS = { chat: "messages list", message: "messages show", contact: "contacts show" };
|
|
456
457
|
var PROVIDERS = [
|
|
@@ -566,7 +567,7 @@ var providerNamed = /* @__PURE__ */ __name((word) => {
|
|
|
566
567
|
var kindIn = /* @__PURE__ */ __name((provider) => isFolderProvider(provider) ? "notes" : registry.find(({ name }) => name === provider)?.kind, "kindIn");
|
|
567
568
|
var kindOf = /* @__PURE__ */ __name((provider) => kindIn(provider) ?? "messages", "kindOf");
|
|
568
569
|
|
|
569
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
570
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.564.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_0a4d79b5da58b1179a36aa928f36b150/node_modules/@wirecat/cli-core/dist/search/query.js
|
|
570
571
|
var isBotProvider = /* @__PURE__ */ __name((provider) => provider.endsWith("-bot"), "isBotProvider");
|
|
571
572
|
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");
|
|
572
573
|
var fail = /* @__PURE__ */ __name((message2) => {
|
|
@@ -589,7 +590,7 @@ var sourceOf = /* @__PURE__ */ __name((name, value, providers2) => {
|
|
|
589
590
|
return fail(`${name} takes ${[...sources, "messages", "mail"].join(", ")} \u2014 not "${value}"`);
|
|
590
591
|
}, "sourceOf");
|
|
591
592
|
|
|
592
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
593
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.564.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_0a4d79b5da58b1179a36aa928f36b150/node_modules/@wirecat/cli-core/dist/search/account-list.js
|
|
593
594
|
var ACCOUNT_GROUPS = "accountGroups";
|
|
594
595
|
var ACCOUNT_GROUPS_SETTING = "account_groups";
|
|
595
596
|
var GROUP_NAME = /^[a-z0-9][a-z0-9_-]*$/i;
|
|
@@ -776,7 +777,7 @@ var fitting = /* @__PURE__ */ __name((entries, kinds2, what, reasonOf2 = (kind4)
|
|
|
776
777
|
return { accounts: [...chosen.values()], skipped };
|
|
777
778
|
}, "fitting");
|
|
778
779
|
|
|
779
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
780
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.564.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_0a4d79b5da58b1179a36aa928f36b150/node_modules/@wirecat/cli-core/dist/store/sqlite/drizzle/core.js
|
|
780
781
|
var IndexBuilderOn = class {
|
|
781
782
|
static {
|
|
782
783
|
__name(this, "IndexBuilderOn");
|
|
@@ -971,7 +972,7 @@ function alias(table, alias2) {
|
|
|
971
972
|
}
|
|
972
973
|
__name(alias, "alias");
|
|
973
974
|
|
|
974
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
975
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.564.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_0a4d79b5da58b1179a36aa928f36b150/node_modules/@wirecat/cli-core/dist/store/sqlite/entity-types.js
|
|
975
976
|
var ENTITY_TABLES = {
|
|
976
977
|
account: "accounts",
|
|
977
978
|
attachment: "attachments",
|
|
@@ -1013,7 +1014,7 @@ var orphanPointers = /* @__PURE__ */ __name((database) => pointerPairs(database)
|
|
|
1013
1014
|
return { table, pointer, type, count, known: known2 };
|
|
1014
1015
|
}).filter(({ count }) => count > 0)), "orphanPointers");
|
|
1015
1016
|
|
|
1016
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
1017
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.564.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_0a4d79b5da58b1179a36aa928f36b150/node_modules/@wirecat/cli-core/dist/store/sqlite/schema/canonical-tags.js
|
|
1017
1018
|
var canonicalTags = sqliteTable("canonical_tags", {
|
|
1018
1019
|
id: integer("id").primaryKey(),
|
|
1019
1020
|
name: text("name").notNull().unique(),
|
|
@@ -1022,7 +1023,7 @@ var canonicalTags = sqliteTable("canonical_tags", {
|
|
|
1022
1023
|
updatedAt: integer("updated_at").notNull()
|
|
1023
1024
|
});
|
|
1024
1025
|
|
|
1025
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
1026
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.564.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_0a4d79b5da58b1179a36aa928f36b150/node_modules/@wirecat/cli-core/dist/store/sqlite/schema/document-transfers.js
|
|
1026
1027
|
var documentAnnotationTransfers = sqliteTable("document_annotation_transfers", {
|
|
1027
1028
|
sourceKey: text("source_key").notNull(),
|
|
1028
1029
|
collection: text("collection").notNull(),
|
|
@@ -1032,13 +1033,13 @@ var documentAnnotationTransfers = sqliteTable("document_annotation_transfers", {
|
|
|
1032
1033
|
createdAt: integer("created_at").notNull()
|
|
1033
1034
|
}, (table) => [primaryKey({ columns: [table.sourceKey, table.collection] })]);
|
|
1034
1035
|
|
|
1035
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
1036
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.564.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_0a4d79b5da58b1179a36aa928f36b150/node_modules/@wirecat/cli-core/dist/store/sqlite/schema/document-index-pending.js
|
|
1036
1037
|
var documentIndexPending = sqliteTable("document_index_pending", {
|
|
1037
1038
|
id: integer("id").notNull(),
|
|
1038
1039
|
indexableType: text("indexable_type").notNull()
|
|
1039
1040
|
}, (table) => [primaryKey({ columns: [table.indexableType, table.id] })]);
|
|
1040
1041
|
|
|
1041
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
1042
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.564.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_0a4d79b5da58b1179a36aa928f36b150/node_modules/@wirecat/cli-core/dist/store/sqlite/schema/tag-consolidations.js
|
|
1042
1043
|
var tagRedirects = sqliteTable("tag_redirects", {
|
|
1043
1044
|
sourceId: integer("source_id").primaryKey().references(() => canonicalTags.id),
|
|
1044
1045
|
survivorId: integer("survivor_id").notNull().references(() => canonicalTags.id),
|
|
@@ -1064,7 +1065,7 @@ var tagConsolidations = sqliteTable("tag_consolidations", {
|
|
|
1064
1065
|
index("tag_consolidations_by_actor_type_actor_id").on(table.actorType, table.actorId)
|
|
1065
1066
|
]);
|
|
1066
1067
|
|
|
1067
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
1068
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.564.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_0a4d79b5da58b1179a36aa928f36b150/node_modules/@wirecat/cli-core/dist/store/sqlite/schema.js
|
|
1068
1069
|
var accounts = sqliteTable("accounts", {
|
|
1069
1070
|
id: integer("id").primaryKey(),
|
|
1070
1071
|
provider: text("provider").notNull(),
|
|
@@ -2687,7 +2688,7 @@ var storeSettings = sqliteTable("store_settings", {
|
|
|
2687
2688
|
at: integer("at").notNull()
|
|
2688
2689
|
});
|
|
2689
2690
|
|
|
2690
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
2691
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.564.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_0a4d79b5da58b1179a36aa928f36b150/node_modules/@wirecat/cli-core/dist/store/sqlite/involvement-queue.js
|
|
2691
2692
|
var ARMS = [
|
|
2692
2693
|
[
|
|
2693
2694
|
"message",
|
|
@@ -2814,7 +2815,7 @@ var drainInvolvementQueue = /* @__PURE__ */ __name((database, cap = QUEUE_CAP) =
|
|
|
2814
2815
|
return recomputed;
|
|
2815
2816
|
}, "drainInvolvementQueue");
|
|
2816
2817
|
|
|
2817
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
2818
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.564.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_0a4d79b5da58b1179a36aa928f36b150/node_modules/@wirecat/cli-core/dist/domain/mentions.js
|
|
2818
2819
|
import { domainToUnicode } from "node:url";
|
|
2819
2820
|
|
|
2820
2821
|
// node_modules/.pnpm/psl@1.15.0/node_modules/psl/dist/psl.mjs
|
|
@@ -12836,7 +12837,7 @@ var oa = /* @__PURE__ */ __name((e) => {
|
|
|
12836
12837
|
}, "oa");
|
|
12837
12838
|
var na = { parse: O, get: aa, isValid: oa };
|
|
12838
12839
|
|
|
12839
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
12840
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.564.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_0a4d79b5da58b1179a36aa928f36b150/node_modules/@wirecat/cli-core/dist/domain/google-documents.js
|
|
12840
12841
|
var LINK = /https?:\/\/(?:(?:docs|drive|sheets|slides)\.google\.com|forms\.gle)(?:[/?#][^\s<>"'`]*)?/gi;
|
|
12841
12842
|
var ID = /^[\w-]{10,}$/;
|
|
12842
12843
|
var trimUrl = /* @__PURE__ */ __name((url) => {
|
|
@@ -12877,7 +12878,7 @@ var googleDocumentLinks = /* @__PURE__ */ __name((text6) => [...text6.matchAll(L
|
|
|
12877
12878
|
return { url, documentId: googleDocumentId(url) };
|
|
12878
12879
|
}), "googleDocumentLinks");
|
|
12879
12880
|
|
|
12880
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
12881
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.564.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_0a4d79b5da58b1179a36aa928f36b150/node_modules/@wirecat/cli-core/dist/domain/phone-plans.generated.js
|
|
12881
12882
|
var PHONE_PLANS = [
|
|
12882
12883
|
{
|
|
12883
12884
|
country: "us",
|
|
@@ -13257,7 +13258,7 @@ var PHONE_PLANS = [
|
|
|
13257
13258
|
}
|
|
13258
13259
|
];
|
|
13259
13260
|
|
|
13260
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
13261
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.564.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_0a4d79b5da58b1179a36aa928f36b150/node_modules/@wirecat/cli-core/dist/domain/phones.js
|
|
13261
13262
|
var PHONE_COUNTRIES = PHONE_PLANS.map((plan) => plan.country);
|
|
13262
13263
|
var DEFAULT_PHONE_COUNTRIES = ["ru"];
|
|
13263
13264
|
var parsePhoneCountries = /* @__PURE__ */ __name((value) => {
|
|
@@ -13298,7 +13299,7 @@ var nationalPhone = /* @__PURE__ */ __name((digits, countries, { anyType }) => {
|
|
|
13298
13299
|
return void 0;
|
|
13299
13300
|
}, "nationalPhone");
|
|
13300
13301
|
|
|
13301
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
13302
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.564.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_0a4d79b5da58b1179a36aa928f36b150/node_modules/@wirecat/cli-core/dist/domain/places.js
|
|
13302
13303
|
var BEFORE = [
|
|
13303
13304
|
[/^(?:ул\.?|улиц[аеыу]|улицей)$/iu, "\u0443\u043B\u0438\u0446\u0430"],
|
|
13304
13305
|
[/^(?:пр-т|просп\.?|проспект[аеу]?)$/iu, "\u043F\u0440\u043E\u0441\u043F\u0435\u043A\u0442"],
|
|
@@ -13558,7 +13559,7 @@ var findPlaces = /* @__PURE__ */ __name((text6) => {
|
|
|
13558
13559
|
return found2.sort((a, b) => a.start - b.start);
|
|
13559
13560
|
}, "findPlaces");
|
|
13560
13561
|
|
|
13561
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
13562
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.564.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_0a4d79b5da58b1179a36aa928f36b150/node_modules/@wirecat/cli-core/dist/domain/mentions.js
|
|
13562
13563
|
var MENTION_KINDS = ["phone", "email", "url", "document", "person-name", "place"];
|
|
13563
13564
|
var MENTION_VERSIONS = {
|
|
13564
13565
|
phone: 1,
|
|
@@ -13748,7 +13749,7 @@ var typedPhone = /* @__PURE__ */ __name((typed, { phoneCountries = DEFAULT_PHONE
|
|
|
13748
13749
|
};
|
|
13749
13750
|
}, "typedPhone");
|
|
13750
13751
|
|
|
13751
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
13752
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.564.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_0a4d79b5da58b1179a36aa928f36b150/node_modules/@wirecat/cli-core/dist/domain/first-names.js
|
|
13752
13753
|
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";
|
|
13753
13754
|
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";
|
|
13754
13755
|
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";
|
|
@@ -13756,7 +13757,7 @@ var NOT_NAMES = ["\u0436\u0435\u043D\u0430", "\u0436\u0435\u043D\u044B", "\u0436
|
|
|
13756
13757
|
var FIRST_NAMES = [...new Set(`${RUSSIAN} ${EUROPEAN}`.split(" "))];
|
|
13757
13758
|
var NAME_WORDS = WORDS.split(" ");
|
|
13758
13759
|
|
|
13759
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
13760
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.564.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_0a4d79b5da58b1179a36aa928f36b150/node_modules/@wirecat/cli-core/dist/domain/person-names.js
|
|
13760
13761
|
var LATIN_TO_CYRILLIC = {
|
|
13761
13762
|
shch: "\u0449",
|
|
13762
13763
|
sch: "\u0449",
|
|
@@ -13964,7 +13965,7 @@ var findUnknownNames = /* @__PURE__ */ __name((text6, stem, taken) => {
|
|
|
13964
13965
|
return found2;
|
|
13965
13966
|
}, "findUnknownNames");
|
|
13966
13967
|
|
|
13967
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
13968
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.564.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_0a4d79b5da58b1179a36aa928f36b150/node_modules/@wirecat/cli-core/dist/domain/attachments.js
|
|
13968
13969
|
var NOT_FILES = /* @__PURE__ */ new Set([
|
|
13969
13970
|
"webpage",
|
|
13970
13971
|
"share",
|
|
@@ -14004,7 +14005,7 @@ var matchDownloads = /* @__PURE__ */ __name((stored3, files2) => {
|
|
|
14004
14005
|
});
|
|
14005
14006
|
}, "matchDownloads");
|
|
14006
14007
|
|
|
14007
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
14008
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.564.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_0a4d79b5da58b1179a36aa928f36b150/node_modules/@wirecat/cli-core/dist/search/lucene/types.js
|
|
14008
14009
|
var QUERY_VERSION = 1;
|
|
14009
14010
|
var QUERY_LIMITS2 = {
|
|
14010
14011
|
...QUERY_LIMITS,
|
|
@@ -14040,7 +14041,7 @@ function exhausted(budget) {
|
|
|
14040
14041
|
}
|
|
14041
14042
|
__name(exhausted, "exhausted");
|
|
14042
14043
|
|
|
14043
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
14044
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.564.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_0a4d79b5da58b1179a36aa928f36b150/node_modules/@wirecat/cli-core/dist/search/lucene/automaton.js
|
|
14044
14045
|
var any = { kind: "char", ranges: [[0, 1114111]], negate: false };
|
|
14045
14046
|
var literal2 = /* @__PURE__ */ __name((c) => ({
|
|
14046
14047
|
kind: "char",
|
|
@@ -14440,7 +14441,7 @@ var foldRegex = /* @__PURE__ */ __name((pattern, span) => {
|
|
|
14440
14441
|
return out;
|
|
14441
14442
|
}, "foldRegex");
|
|
14442
14443
|
|
|
14443
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
14444
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.564.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_0a4d79b5da58b1179a36aa928f36b150/node_modules/@wirecat/cli-core/dist/search/lucene/presets.js
|
|
14444
14445
|
var PRESET_VERSION = 1;
|
|
14445
14446
|
var PRESETS = {
|
|
14446
14447
|
password: {
|
|
@@ -14494,7 +14495,7 @@ var PRESETS = {
|
|
|
14494
14495
|
}
|
|
14495
14496
|
};
|
|
14496
14497
|
|
|
14497
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
14498
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.564.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_0a4d79b5da58b1179a36aa928f36b150/node_modules/@wirecat/cli-core/dist/search/lucene/registry.js
|
|
14498
14499
|
var FIELD_VERSION = 2;
|
|
14499
14500
|
var UNITS = {
|
|
14500
14501
|
"": 1,
|
|
@@ -14684,7 +14685,7 @@ var QUERY_FIELDS = [
|
|
|
14684
14685
|
{
|
|
14685
14686
|
name: "has",
|
|
14686
14687
|
example: "has:file",
|
|
14687
|
-
index: "attachments / messages_fts links",
|
|
14688
|
+
index: "attachments / messages_fts links / message_transcripts",
|
|
14688
14689
|
aliases: [],
|
|
14689
14690
|
type: "enum",
|
|
14690
14691
|
operators: terms,
|
|
@@ -14703,7 +14704,8 @@ var QUERY_FIELDS = [
|
|
|
14703
14704
|
"sticker",
|
|
14704
14705
|
"contact",
|
|
14705
14706
|
"location",
|
|
14706
|
-
"poll"
|
|
14707
|
+
"poll",
|
|
14708
|
+
"transcript"
|
|
14707
14709
|
]
|
|
14708
14710
|
},
|
|
14709
14711
|
{
|
|
@@ -14954,12 +14956,12 @@ var validateAst = /* @__PURE__ */ __name((input) => {
|
|
|
14954
14956
|
return validateFields(parsed3.output);
|
|
14955
14957
|
}, "validateAst");
|
|
14956
14958
|
|
|
14957
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
14959
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.564.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_0a4d79b5da58b1179a36aa928f36b150/node_modules/@wirecat/cli-core/dist/search/lucene/resolved.js
|
|
14958
14960
|
var hasText = /* @__PURE__ */ __name((node) => node.kind === "predicate" ? node.field === "text" || node.field === "exact" : node.clauses.some(({ node: node2 }) => hasText(node2)), "hasText");
|
|
14959
14961
|
var isStemmed = /* @__PURE__ */ __name((node) => node.field === "text" && (node.operator === "term" || node.operator === "phrase") && node.value !== "", "isStemmed");
|
|
14960
14962
|
var hasStems = /* @__PURE__ */ __name((node) => node.kind === "predicate" ? isStemmed(node) : node.clauses.some(({ node: node2 }) => hasStems(node2)), "hasStems");
|
|
14961
14963
|
|
|
14962
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
14964
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.564.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_0a4d79b5da58b1179a36aa928f36b150/node_modules/@wirecat/cli-core/dist/store/sqlite/mention-links.js
|
|
14963
14965
|
var LIVE = "mn.kind = 'url' AND mn.status <> 'dismissed'";
|
|
14964
14966
|
var MAIL_ROWS = `SELECT mn.source_id FROM mentions mn WHERE mn.source_type = 'email' AND ${LIVE}`;
|
|
14965
14967
|
var linkMatch = /* @__PURE__ */ __name((field4, typed, mail, mentioned2) => {
|
|
@@ -14983,7 +14985,7 @@ var linkMatch = /* @__PURE__ */ __name((field4, typed, mail, mentioned2) => {
|
|
|
14983
14985
|
};
|
|
14984
14986
|
}, "linkMatch");
|
|
14985
14987
|
|
|
14986
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
14988
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.564.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_0a4d79b5da58b1179a36aa928f36b150/node_modules/@wirecat/cli-core/dist/store/sqlite/phone-countries.js
|
|
14987
14989
|
var SETTING = "phoneCountries";
|
|
14988
14990
|
var savedPhoneCountries = /* @__PURE__ */ __name((database) => {
|
|
14989
14991
|
const row2 = database.prepare("SELECT value FROM store_settings WHERE key = ?").get(SETTING);
|
|
@@ -15014,7 +15016,7 @@ var valueMatch = /* @__PURE__ */ __name((database, typed) => {
|
|
|
15014
15016
|
return { sql: "mn.value = ?", params: [phone?.value ?? normalizedValue(typed, { phoneCountries })] };
|
|
15015
15017
|
}, "valueMatch");
|
|
15016
15018
|
|
|
15017
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
15019
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.564.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_0a4d79b5da58b1179a36aa928f36b150/node_modules/@wirecat/cli-core/dist/domain/vocabulary.js
|
|
15018
15020
|
var normalizeVocabularyName = /* @__PURE__ */ __name((input) => {
|
|
15019
15021
|
if (typeof input !== "string" || input.length > 200 || /[\p{Cc}\p{Cf}]/u.test(input))
|
|
15020
15022
|
throw new CliError("validation_error", "a vocabulary name takes 1\u2013200 characters without control characters");
|
|
@@ -15042,7 +15044,7 @@ var vocabularySimilarity = /* @__PURE__ */ __name((left, right) => {
|
|
|
15042
15044
|
return 2 * intersection2 / (aa2.size + bb.size);
|
|
15043
15045
|
}, "vocabularySimilarity");
|
|
15044
15046
|
|
|
15045
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
15047
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.564.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_0a4d79b5da58b1179a36aa928f36b150/node_modules/@wirecat/cli-core/dist/store/sqlite/tag-creation.js
|
|
15046
15048
|
import { createHash } from "node:crypto";
|
|
15047
15049
|
var folded2 = /* @__PURE__ */ __name((name) => {
|
|
15048
15050
|
try {
|
|
@@ -15108,7 +15110,7 @@ var guardTagCreation = /* @__PURE__ */ __name((context, name, kind4, by, options
|
|
|
15108
15110
|
});
|
|
15109
15111
|
}, "guardTagCreation");
|
|
15110
15112
|
|
|
15111
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
15113
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.564.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_0a4d79b5da58b1179a36aa928f36b150/node_modules/@wirecat/cli-core/dist/domain/tag-redirects.js
|
|
15112
15114
|
var invalid2 = /* @__PURE__ */ __name((message2) => {
|
|
15113
15115
|
throw new CliError("validation_error", message2);
|
|
15114
15116
|
}, "invalid");
|
|
@@ -15185,7 +15187,7 @@ var createTagRedirectIndex = /* @__PURE__ */ __name((snapshot2) => {
|
|
|
15185
15187
|
};
|
|
15186
15188
|
}, "createTagRedirectIndex");
|
|
15187
15189
|
|
|
15188
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
15190
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.564.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_0a4d79b5da58b1179a36aa928f36b150/node_modules/@wirecat/cli-core/dist/store/sqlite/tag-resolution.js
|
|
15189
15191
|
var tagCanonicalId = /* @__PURE__ */ __name((database, id2) => {
|
|
15190
15192
|
const row2 = database.prepare("SELECT canonical_id FROM resolved_tags WHERE id=?").get(id2);
|
|
15191
15193
|
if (!row2)
|
|
@@ -15213,7 +15215,7 @@ var tagRedirectSnapshot = /* @__PURE__ */ __name((database) => {
|
|
|
15213
15215
|
return snapshot2;
|
|
15214
15216
|
}, "tagRedirectSnapshot");
|
|
15215
15217
|
|
|
15216
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
15218
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.564.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_0a4d79b5da58b1179a36aa928f36b150/node_modules/@wirecat/cli-core/dist/store/sqlite/task-keys.js
|
|
15217
15219
|
import { createHash as createHash2 } from "node:crypto";
|
|
15218
15220
|
var TASK_KEY_PREFIXES = {
|
|
15219
15221
|
question: "Q",
|
|
@@ -15241,7 +15243,7 @@ var taskAccountOf = /* @__PURE__ */ __name((database, rowId) => {
|
|
|
15241
15243
|
return row2 && String(row2.key) === inboxKey(String(row2.name)) ? String(row2.name) : void 0;
|
|
15242
15244
|
}, "taskAccountOf");
|
|
15243
15245
|
|
|
15244
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
15246
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.564.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_0a4d79b5da58b1179a36aa928f36b150/node_modules/@wirecat/cli-core/dist/store/sqlite/things.js
|
|
15245
15247
|
var storedThing = /* @__PURE__ */ __name((type, id2) => ({ type: String(type), id: Number(id2) }), "storedThing");
|
|
15246
15248
|
var REFERABLE = {
|
|
15247
15249
|
note: { tombstone: true },
|
|
@@ -15405,7 +15407,7 @@ var taskIdOf = /* @__PURE__ */ __name((database, rowId) => {
|
|
|
15405
15407
|
return row2 ? String(row2.id ?? row2.key) : void 0;
|
|
15406
15408
|
}, "taskIdOf");
|
|
15407
15409
|
|
|
15408
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
15410
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.564.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_0a4d79b5da58b1179a36aa928f36b150/node_modules/@wirecat/cli-core/dist/store/sqlite/values.js
|
|
15409
15411
|
var toMs = /* @__PURE__ */ __name((iso13) => {
|
|
15410
15412
|
if (iso13 === null || iso13 === void 0)
|
|
15411
15413
|
return null;
|
|
@@ -15419,7 +15421,7 @@ var present = /* @__PURE__ */ __name((entries) => Object.fromEntries(Object.entr
|
|
|
15419
15421
|
var DELIVERY = { delivered: 1, read: 2 };
|
|
15420
15422
|
var deliveryOf = /* @__PURE__ */ __name((stored3) => stored3 === DELIVERY.read ? "read" : stored3 === DELIVERY.delivered ? "delivered" : void 0, "deliveryOf");
|
|
15421
15423
|
|
|
15422
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
15424
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.564.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_0a4d79b5da58b1179a36aa928f36b150/node_modules/@wirecat/cli-core/dist/store/sqlite/tags.js
|
|
15423
15425
|
var TAG_KINDS = ["tag", "topic"];
|
|
15424
15426
|
var TAGGABLE = { chat: "chat", contact: "identity", message: "message", task: "task" };
|
|
15425
15427
|
var TAG_TYPE = {
|
|
@@ -15622,7 +15624,7 @@ var tagsOf = /* @__PURE__ */ __name(({ database }, key2, filter) => {
|
|
|
15622
15624
|
return result;
|
|
15623
15625
|
}, "tagsOf");
|
|
15624
15626
|
|
|
15625
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
15627
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.564.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_0a4d79b5da58b1179a36aa928f36b150/node_modules/@wirecat/cli-core/dist/store/sqlite/lucene-fields.js
|
|
15626
15628
|
var speech = /* @__PURE__ */ __name((alias2) => `(coalesce(${alias2}.extractor,'') LIKE 'speech:%' OR ${alias2}.kind IN ('voice','video_note') OR coalesce(${alias2}.mime,'')='audio/ogg')`, "speech");
|
|
15627
15629
|
var SPEECH = speech("att");
|
|
15628
15630
|
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");
|
|
@@ -15896,9 +15898,12 @@ var messengerOnly = /* @__PURE__ */ __name((compile2) => (node, scope3) => {
|
|
|
15896
15898
|
return compile2(node, scope3);
|
|
15897
15899
|
}, "messengerOnly");
|
|
15898
15900
|
var topic = messengerOnly(({ value }) => always(bound("m.thread_external_id = ?", value)));
|
|
15899
|
-
var
|
|
15901
|
+
var PEER_KIND = "CASE WHEN json_extract(c.metadata,'$.peerKind') IN ('private','saved','bot','service','group','channel','unknown') THEN json_extract(c.metadata,'$.peerKind') WHEN c.kind='dialog' AND json_extract(c.metadata,'$.isBot')=1 THEN 'bot' WHEN c.kind='dialog' THEN 'private' ELSE c.kind END";
|
|
15902
|
+
var kind2 = messengerOnly(({ value }) => always(bound(`${PEER_KIND} = ?`, value.toLowerCase())));
|
|
15900
15903
|
var has = /* @__PURE__ */ __name(({ value }, { corpus, mail }) => {
|
|
15901
15904
|
const wanted = value.toLowerCase();
|
|
15905
|
+
if (wanted === "transcript")
|
|
15906
|
+
return always(bound(mail ? "0" : "EXISTS (SELECT 1 FROM message_transcripts t WHERE t.message_id = m.id)"));
|
|
15902
15907
|
return always(wanted === "text" ? bound("length(trim(coalesce(m.text,''))) > 0") : wanted === "link" ? bound(`(${mail ? "m.text LIKE '%' || ? || '%'" : "m.id IN (SELECT rowid FROM messages_fts WHERE messages_fts MATCH ?)"} OR EXISTS (SELECT 1 FROM attachments att WHERE att.attachable_type='${corpus.item}' AND att.attachable_id=m.id AND att.kind IN ('share','webpage')))`, mail ? "://" : quoted("://")) : wanted === "attachment" ? bound(`EXISTS (SELECT 1 FROM attachments att WHERE att.attachable_type='${corpus.item}' AND att.attachable_id=m.id)`) : bound(`EXISTS (SELECT 1 FROM attachments att WHERE att.attachable_type='${corpus.item}' AND att.attachable_id=m.id AND att.kind IN (${storedKinds(wanted).map(() => "?").join(",")}))`, ...storedKinds(wanted)));
|
|
15903
15908
|
}, "has");
|
|
15904
15909
|
var inSourceField = /* @__PURE__ */ __name(({ value }, { execution }) => {
|
|
@@ -15983,7 +15988,7 @@ var FIELD_COMPILERS = {
|
|
|
15983
15988
|
subject
|
|
15984
15989
|
};
|
|
15985
15990
|
|
|
15986
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
15991
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.564.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_0a4d79b5da58b1179a36aa928f36b150/node_modules/@wirecat/cli-core/dist/store/sqlite/place-key.js
|
|
15987
15992
|
var placeOf = /* @__PURE__ */ __name((database) => {
|
|
15988
15993
|
const exact = database.prepare("SELECT id FROM places WHERE folded = ?");
|
|
15989
15994
|
const onStreet = database.prepare("SELECT id FROM places WHERE substr(folded, 1, ?) = ? LIMIT 2");
|
|
@@ -15999,7 +16004,7 @@ var placeOf = /* @__PURE__ */ __name((database) => {
|
|
|
15999
16004
|
};
|
|
16000
16005
|
}, "placeOf");
|
|
16001
16006
|
|
|
16002
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
16007
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.564.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_0a4d79b5da58b1179a36aa928f36b150/node_modules/@wirecat/cli-core/dist/store/sqlite/mention-drain.js
|
|
16003
16008
|
var DRAIN_ON_WRITE = 500;
|
|
16004
16009
|
var METHOD = "rules";
|
|
16005
16010
|
var telegramLink = /* @__PURE__ */ __name((database) => {
|
|
@@ -16162,7 +16167,7 @@ var drainMentions = /* @__PURE__ */ __name((database, now2, limit = DRAIN_ON_WRI
|
|
|
16162
16167
|
return queued.length;
|
|
16163
16168
|
}, "drainMentions");
|
|
16164
16169
|
|
|
16165
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
16170
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.564.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_0a4d79b5da58b1179a36aa928f36b150/node_modules/@wirecat/cli-core/dist/store/sqlite/index-state.js
|
|
16166
16171
|
var indexRow = /* @__PURE__ */ __name((database, name) => {
|
|
16167
16172
|
const exists2 = database.prepare("SELECT 1 FROM sqlite_master WHERE name = 'search_index_state'").get();
|
|
16168
16173
|
if (!exists2)
|
|
@@ -16170,7 +16175,7 @@ var indexRow = /* @__PURE__ */ __name((database, name) => {
|
|
|
16170
16175
|
return database.prepare("SELECT * FROM search_index_state WHERE name = ?").get(name);
|
|
16171
16176
|
}, "indexRow");
|
|
16172
16177
|
|
|
16173
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
16178
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.564.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_0a4d79b5da58b1179a36aa928f36b150/node_modules/@wirecat/cli-core/dist/store/sqlite/stems.js
|
|
16174
16179
|
var INDEX = "message_stems";
|
|
16175
16180
|
var SETTING2 = "searchStemmers";
|
|
16176
16181
|
var DRAIN_ON_WRITE2 = 500;
|
|
@@ -16292,7 +16297,7 @@ var stemmerCache = /* @__PURE__ */ __name(() => {
|
|
|
16292
16297
|
};
|
|
16293
16298
|
}, "stemmerCache");
|
|
16294
16299
|
|
|
16295
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
16300
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.564.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_0a4d79b5da58b1179a36aa928f36b150/node_modules/@wirecat/cli-core/dist/store/sqlite/transaction.js
|
|
16296
16301
|
var SQLITE_BUSY = 5;
|
|
16297
16302
|
var pause = new Int32Array(new SharedArrayBuffer(4));
|
|
16298
16303
|
var isBusy = /* @__PURE__ */ __name((error) => {
|
|
@@ -16387,7 +16392,7 @@ var read = /* @__PURE__ */ __name((database, body2) => {
|
|
|
16387
16392
|
}
|
|
16388
16393
|
}, "read");
|
|
16389
16394
|
|
|
16390
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
16395
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.564.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_0a4d79b5da58b1179a36aa928f36b150/node_modules/@wirecat/cli-core/dist/store/sqlite/vector-index.js
|
|
16391
16396
|
var source = /* @__PURE__ */ __name((model, dims) => `SELECT k.id, k.chunkable_type,
|
|
16392
16397
|
coalesce(CASE k.chunkable_type
|
|
16393
16398
|
WHEN 'image' THEN (SELECT ch.account_id FROM attachments a JOIN messages m ON m.id = a.attachable_id
|
|
@@ -16529,7 +16534,7 @@ var dropUnusedVectors = /* @__PURE__ */ __name((database, hashes) => {
|
|
|
16529
16534
|
}, "dropUnusedVectors");
|
|
16530
16535
|
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");
|
|
16531
16536
|
|
|
16532
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
16537
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.564.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_0a4d79b5da58b1179a36aa928f36b150/node_modules/@wirecat/cli-core/dist/store/sqlite/accounts.js
|
|
16533
16538
|
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({
|
|
16534
16539
|
target: [accounts.provider, accounts.externalId],
|
|
16535
16540
|
set: {
|
|
@@ -16638,7 +16643,7 @@ var dropOrphanPeople = /* @__PURE__ */ __name((database, unseenBefore) => {
|
|
|
16638
16643
|
AND id NOT IN (SELECT id FROM (${referencesTo(database, "persons", /* @__PURE__ */ new Set(["identity_links"]))}) WHERE id IS NOT NULL)`).run(JSON.stringify(persons2));
|
|
16639
16644
|
}, "dropOrphanPeople");
|
|
16640
16645
|
|
|
16641
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
16646
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.564.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_0a4d79b5da58b1179a36aa928f36b150/node_modules/@wirecat/cli-core/dist/store/sqlite/folded.js
|
|
16642
16647
|
var FOLDED = [
|
|
16643
16648
|
{ table: "tasks", column: "title" },
|
|
16644
16649
|
{ table: "tasks", column: "close_reason" },
|
|
@@ -16675,7 +16680,7 @@ var fillFolded = /* @__PURE__ */ __name((database, { batch = 2e3 } = {}) => {
|
|
|
16675
16680
|
return filled2;
|
|
16676
16681
|
}, "fillFolded");
|
|
16677
16682
|
|
|
16678
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
16683
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.564.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_0a4d79b5da58b1179a36aa928f36b150/node_modules/@wirecat/cli-core/dist/store/sqlite/history-skips.js
|
|
16679
16684
|
var HISTORY_KEY = "$history";
|
|
16680
16685
|
var objectOf = /* @__PURE__ */ __name((text6) => {
|
|
16681
16686
|
if (typeof text6 !== "string")
|
|
@@ -16751,7 +16756,7 @@ var withoutHistory = /* @__PURE__ */ __name((metadata3) => {
|
|
|
16751
16756
|
return rest;
|
|
16752
16757
|
}, "withoutHistory");
|
|
16753
16758
|
|
|
16754
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
16759
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.564.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_0a4d79b5da58b1179a36aa928f36b150/node_modules/@wirecat/cli-core/dist/conversations/chunks.js
|
|
16755
16760
|
import { createHash as createHash3 } from "node:crypto";
|
|
16756
16761
|
var CHUNK_CHARS = 1200;
|
|
16757
16762
|
var CHUNK_OVERLAP = 150;
|
|
@@ -16856,7 +16861,7 @@ var cutChunks = /* @__PURE__ */ __name((members2, limit = CHUNK_CHARS, check3, c
|
|
|
16856
16861
|
return chunks2;
|
|
16857
16862
|
}, "cutChunks");
|
|
16858
16863
|
|
|
16859
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
16864
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.564.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_0a4d79b5da58b1179a36aa928f36b150/node_modules/@wirecat/cli-core/dist/search/task-signature.js
|
|
16860
16865
|
var DAY = 864e5;
|
|
16861
16866
|
var CURRENCY = [
|
|
16862
16867
|
[/^(₽|руб.*|р\.?|rub)$/u, "RUB"],
|
|
@@ -16982,7 +16987,7 @@ var dueDayOf = /* @__PURE__ */ __name((text6, createdMs) => {
|
|
|
16982
16987
|
return best?.day ?? null;
|
|
16983
16988
|
}, "dueDayOf");
|
|
16984
16989
|
|
|
16985
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
16990
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.564.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_0a4d79b5da58b1179a36aa928f36b150/node_modules/@wirecat/cli-core/dist/search/task-similarity.js
|
|
16986
16991
|
var DAY2 = 864e5;
|
|
16987
16992
|
var STOP_WORDS = new Set([
|
|
16988
16993
|
// Russian and English as the test set ran them, already folded (пожалуйста → пожалуиста).
|
|
@@ -17137,7 +17142,7 @@ var rankCandidates = /* @__PURE__ */ __name((views, candidates) => candidates.ma
|
|
|
17137
17142
|
...compareViews(subjectViews ?? views, candidate, replyChain === void 0 ? {} : { replyChain })
|
|
17138
17143
|
})).sort((a, b) => b.score - a.score), "rankCandidates");
|
|
17139
17144
|
|
|
17140
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
17145
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.564.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_0a4d79b5da58b1179a36aa928f36b150/node_modules/@wirecat/cli-core/dist/store/sqlite/vectors.js
|
|
17141
17146
|
var currentChunks = /* @__PURE__ */ __name((chatKey) => sql`SELECT k.content_hash, k.chunkable_id AS conversation_id, r.first_message_id,
|
|
17142
17147
|
r.last_message_id, r.text_start, r.text_end FROM chunks k JOIN chunk_messages r ON r.chunk_id = k.id
|
|
17143
17148
|
JOIN conversations c ON k.chunkable_type = 'conversation' AND c.id = k.chunkable_id
|
|
@@ -17408,7 +17413,7 @@ var readiness = /* @__PURE__ */ __name(({ orm }, chatKey, model) => {
|
|
|
17408
17413
|
};
|
|
17409
17414
|
}, "readiness");
|
|
17410
17415
|
|
|
17411
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
17416
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.564.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_0a4d79b5da58b1179a36aa928f36b150/node_modules/@wirecat/cli-core/dist/store/sqlite/document-pictures.js
|
|
17412
17417
|
var DOCUMENT_PICTURE = "document_picture";
|
|
17413
17418
|
var SCAN_PAGE2 = 5e3;
|
|
17414
17419
|
var idOf = /* @__PURE__ */ __name((ref3) => {
|
|
@@ -17471,7 +17476,7 @@ var documentPicturesOver = /* @__PURE__ */ __name(({ database, now: now2 }) => (
|
|
|
17471
17476
|
}, "nearestPictures")
|
|
17472
17477
|
}), "documentPicturesOver");
|
|
17473
17478
|
|
|
17474
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
17479
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.564.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_0a4d79b5da58b1179a36aa928f36b150/node_modules/@wirecat/cli-core/dist/store/sqlite/query-filter.js
|
|
17475
17480
|
var glob = /* @__PURE__ */ __name((value) => [...fold(value).matchAll(/\\(.)|([*?])|(.)/gsu)].map(([, escaped2, wildcard, plain2]) => {
|
|
17476
17481
|
const literal4 = escaped2 ?? plain2 ?? "";
|
|
17477
17482
|
return wildcard ?? (/[*?[]/u.test(literal4) ? `[${literal4}]` : literal4);
|
|
@@ -17536,7 +17541,7 @@ var compile = /* @__PURE__ */ __name((node, columns, options) => {
|
|
|
17536
17541
|
var queryFilter = /* @__PURE__ */ __name((ast, columns, options = {}) => compile(ast.root, columns, options), "queryFilter");
|
|
17537
17542
|
var bound2 = /* @__PURE__ */ __name(({ sql: text6, params }) => sql.join(text6.split("?").map((part, at) => at < params.length ? sql`${sql.raw(part)}${params[at]}` : sql.raw(part)), sql``), "bound");
|
|
17538
17543
|
|
|
17539
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
17544
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.564.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_0a4d79b5da58b1179a36aa928f36b150/node_modules/@wirecat/cli-core/dist/store/sqlite/events.js
|
|
17540
17545
|
var toJson = /* @__PURE__ */ __name((value) => value === null || value === void 0 ? null : JSON.stringify(value), "toJson");
|
|
17541
17546
|
var fromJson = /* @__PURE__ */ __name((value) => value === null || value === void 0 ? null : JSON.parse(String(value)), "fromJson");
|
|
17542
17547
|
var int = /* @__PURE__ */ __name((value) => value === null || value === void 0 ? null : Number(value), "int");
|
|
@@ -17626,7 +17631,7 @@ var linkMeeting = /* @__PURE__ */ __name((database, id2, eventId, now2, mode = "
|
|
|
17626
17631
|
});
|
|
17627
17632
|
}, "linkMeeting");
|
|
17628
17633
|
|
|
17629
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
17634
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.564.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_0a4d79b5da58b1179a36aa928f36b150/node_modules/@wirecat/cli-core/dist/store/sqlite/note-index.js
|
|
17630
17635
|
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), ''))";
|
|
17631
17636
|
var UNSEARCHED_EVENT_TYPES = [
|
|
17632
17637
|
"working-location",
|
|
@@ -17856,7 +17861,7 @@ var resetNoteIndex = /* @__PURE__ */ __name((database) => {
|
|
|
17856
17861
|
return true;
|
|
17857
17862
|
}, "resetNoteIndex");
|
|
17858
17863
|
|
|
17859
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
17864
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.564.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_0a4d79b5da58b1179a36aa928f36b150/node_modules/@wirecat/cli-core/dist/store/sqlite/person-resolution.js
|
|
17860
17865
|
var keyOf3 = /* @__PURE__ */ __name((name) => fold(name).trim().replace(/^@/, ""), "keyOf");
|
|
17861
17866
|
var resolvePersonLinks = /* @__PURE__ */ __name((database, names) => {
|
|
17862
17867
|
for (const key2 of new Set(names.filter((name) => !!name?.trim()).map(keyOf3))) {
|
|
@@ -17875,7 +17880,7 @@ var resolvePersonLinks = /* @__PURE__ */ __name((database, names) => {
|
|
|
17875
17880
|
}
|
|
17876
17881
|
}, "resolvePersonLinks");
|
|
17877
17882
|
|
|
17878
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
17883
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.564.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_0a4d79b5da58b1179a36aa928f36b150/node_modules/@wirecat/cli-core/dist/store/sqlite/identities.js
|
|
17879
17884
|
var flag2 = /* @__PURE__ */ __name((value) => value === void 0 || value === null ? null : Number(value), "flag");
|
|
17880
17885
|
var prepare = /* @__PURE__ */ __name((orm) => ({
|
|
17881
17886
|
find: orm.select({
|
|
@@ -18100,7 +18105,7 @@ var meetingIdentityPk = /* @__PURE__ */ __name((context, accountId, identity) =>
|
|
|
18100
18105
|
}, "meetingIdentityPk");
|
|
18101
18106
|
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");
|
|
18102
18107
|
|
|
18103
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
18108
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.564.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_0a4d79b5da58b1179a36aa928f36b150/node_modules/@wirecat/cli-core/dist/store/sqlite/chats.js
|
|
18104
18109
|
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");
|
|
18105
18110
|
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");
|
|
18106
18111
|
var chatPkFor = /* @__PURE__ */ __name((context, accountKey, chatId) => findChatPk(context, accountKey, chatId) ?? Number(context.orm.insert(chats).values({
|
|
@@ -18380,7 +18385,7 @@ var replaceAutoTags = /* @__PURE__ */ __name((context, key2, chatId, algorithm,
|
|
|
18380
18385
|
}
|
|
18381
18386
|
}, "replaceAutoTags");
|
|
18382
18387
|
|
|
18383
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
18388
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.564.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_0a4d79b5da58b1179a36aa928f36b150/node_modules/@wirecat/cli-core/dist/domain/counters.js
|
|
18384
18389
|
var COUNTER_FIELDS = ["views", "reactions", "comments"];
|
|
18385
18390
|
var validCounter = /* @__PURE__ */ __name((value) => typeof value === "number" && Number.isFinite(value) && value >= 0, "validCounter");
|
|
18386
18391
|
var counterObservationTime = /* @__PURE__ */ __name((observation, now2) => {
|
|
@@ -18399,7 +18404,7 @@ var counterFreshness = /* @__PURE__ */ __name((states) => {
|
|
|
18399
18404
|
return states.some((one2) => one2.freshness === "stale") ? "stale" : "fresh";
|
|
18400
18405
|
}, "counterFreshness");
|
|
18401
18406
|
|
|
18402
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
18407
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.564.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_0a4d79b5da58b1179a36aa928f36b150/node_modules/@wirecat/cli-core/dist/context/evidence.js
|
|
18403
18408
|
import { createHash as createHash4 } from "node:crypto";
|
|
18404
18409
|
var CONTEXT_MAX_READ_BYTES = 262144;
|
|
18405
18410
|
var CONTEXT_SOURCE_KINDS = ["message", "mail", "document", "meeting"];
|
|
@@ -18497,7 +18502,7 @@ var contextEvidenceRequest = /* @__PURE__ */ __name((input) => {
|
|
|
18497
18502
|
return { source: source2, query, chat: chat2, senders, words: words3, after: after2, before: before2, limit, maxReadBytes, cursor, signal: input.signal };
|
|
18498
18503
|
}, "contextEvidenceRequest");
|
|
18499
18504
|
|
|
18500
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
18505
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.564.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_0a4d79b5da58b1179a36aa928f36b150/node_modules/@wirecat/cli-core/dist/store/sqlite/email-activity.js
|
|
18501
18506
|
var MAIL_AGENDA_COLUMNS = { chat_kind: { type: "enum", sql: "'dialog'" } };
|
|
18502
18507
|
var ACTIVITY = `
|
|
18503
18508
|
SELECT t.external_id AS thread, t.subject, t.last_email_at, t.emails_count,
|
|
@@ -18613,7 +18618,7 @@ var mailActivity = /* @__PURE__ */ __name((database) => ({
|
|
|
18613
18618
|
threadActivity: /* @__PURE__ */ __name(async (accountId, since, where) => threadActivity(database, accountId, since, where), "threadActivity")
|
|
18614
18619
|
}), "mailActivity");
|
|
18615
18620
|
|
|
18616
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
18621
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.564.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_0a4d79b5da58b1179a36aa928f36b150/node_modules/@wirecat/cli-core/dist/conversations/mail-text.js
|
|
18617
18622
|
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");
|
|
18618
18623
|
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;
|
|
18619
18624
|
var ATTRIBUTION = /(wrote|написал[аи]?|escribió|a écrit|schrieb)\s*:\s*$/iu;
|
|
@@ -18693,8 +18698,68 @@ var mailCore = /* @__PURE__ */ __name((body2, earlier) => {
|
|
|
18693
18698
|
const kept = trimEdges(lines.filter((_, i) => !drop.has(i)));
|
|
18694
18699
|
return withoutSignOff(withoutGreeting(kept)).join("\n").trim();
|
|
18695
18700
|
}, "mailCore");
|
|
18696
|
-
|
|
18697
|
-
|
|
18701
|
+
var QUOTED = /^\s*>/;
|
|
18702
|
+
var ATTRIBUTION_END = /(wrote|написал(\(а\)|а|и)?|escribió|a écrit|schrieb\s.+|<[^<>\s]+@[^<>\s]+>)\s*:\s*$/iu;
|
|
18703
|
+
var ATTRIBUTION_START = /^(on|le|am|el|в)\s/iu;
|
|
18704
|
+
var DATED = /^(on|le|am|el|в|\d)/iu;
|
|
18705
|
+
var ORIGINAL = /^-{2,}\s*(original message|ursprüngliche nachricht|message d'origine|mensaje original|исходное сообщение)\s*-{2,}$/iu;
|
|
18706
|
+
var FROM_LINE = /^(from|von|de|от)\s?:\s*\S/iu;
|
|
18707
|
+
var DATE_LINE = /^(sent|date|gesendet|datum|envoyé|enviado|fecha|отправлено|дата)\s?:/iu;
|
|
18708
|
+
var FORWARD = /^(-{2,}\s*(forwarded message|weitergeleitete nachricht|message transféré|mensaje reenviado|пересылаемое сообщение)\s*-{2,}|begin forwarded message:)$/iu;
|
|
18709
|
+
var RULE = /^_{5,}$/;
|
|
18710
|
+
var MOBILE = /^(sent from my |von meinem .+ gesendet$|envoyé de mon |отправлено с |enviado desde mi )/iu;
|
|
18711
|
+
var attributionAt = /* @__PURE__ */ __name((lines, i) => {
|
|
18712
|
+
const line = (lines[i] ?? "").trim();
|
|
18713
|
+
if (!ATTRIBUTION_END.test(line))
|
|
18714
|
+
return -1;
|
|
18715
|
+
const prior = (lines[i - 1] ?? "").trim();
|
|
18716
|
+
return prior && ATTRIBUTION_START.test(prior) && !ATTRIBUTION_START.test(line) ? i - 1 : i;
|
|
18717
|
+
}, "attributionAt");
|
|
18718
|
+
var outlookAt = /* @__PURE__ */ __name((lines, i) => {
|
|
18719
|
+
const line = (lines[i] ?? "").trim();
|
|
18720
|
+
if (ORIGINAL.test(line))
|
|
18721
|
+
return true;
|
|
18722
|
+
return FROM_LINE.test(line) && lines.slice(i + 1, i + 4).some((next) => DATE_LINE.test(next.trim()));
|
|
18723
|
+
}, "outlookAt");
|
|
18724
|
+
var nextText = /* @__PURE__ */ __name((lines, from2) => lines.slice(from2).find((line) => line.trim()) ?? "", "nextText");
|
|
18725
|
+
var ownLines = /* @__PURE__ */ __name((lines) => {
|
|
18726
|
+
const kept = [];
|
|
18727
|
+
for (let i = 0; i < lines.length; i++) {
|
|
18728
|
+
const line = lines[i] ?? "";
|
|
18729
|
+
if (QUOTED.test(line))
|
|
18730
|
+
continue;
|
|
18731
|
+
if (outlookAt(lines, i)) {
|
|
18732
|
+
const last = kept.findLastIndex((one2) => one2.trim());
|
|
18733
|
+
return last !== -1 && RULE.test((kept[last] ?? "").trim()) ? kept.slice(0, last) : kept;
|
|
18734
|
+
}
|
|
18735
|
+
const start = attributionAt(lines, i);
|
|
18736
|
+
if (start === -1) {
|
|
18737
|
+
kept.push(line);
|
|
18738
|
+
continue;
|
|
18739
|
+
}
|
|
18740
|
+
if (start < i)
|
|
18741
|
+
kept.pop();
|
|
18742
|
+
if (QUOTED.test(nextText(lines, i + 1)))
|
|
18743
|
+
continue;
|
|
18744
|
+
const header = lines.slice(start, i + 1).join(" ").trim();
|
|
18745
|
+
if (/\d/.test(header) && (header.includes("@") || DATED.test(header)) && header.length <= 300)
|
|
18746
|
+
return kept;
|
|
18747
|
+
if (start < i)
|
|
18748
|
+
kept.push(lines[start] ?? "");
|
|
18749
|
+
kept.push(line);
|
|
18750
|
+
}
|
|
18751
|
+
return kept;
|
|
18752
|
+
}, "ownLines");
|
|
18753
|
+
var mailOwnText = /* @__PURE__ */ __name((body2) => {
|
|
18754
|
+
const lines = body2.replace(/\r\n?/g, "\n").split("\n");
|
|
18755
|
+
const forward = lines.findIndex((line) => FORWARD.test(line.trim()));
|
|
18756
|
+
const head = forward === -1 ? lines : lines.slice(0, forward);
|
|
18757
|
+
const own = withoutSignOff(trimEdges(ownLines(head).filter((line) => !MOBILE.test(line.trim()))));
|
|
18758
|
+
const text6 = [...own, ...forward === -1 ? [] : ["", ...lines.slice(forward)]].join("\n").trim();
|
|
18759
|
+
return text6 || body2.trim();
|
|
18760
|
+
}, "mailOwnText");
|
|
18761
|
+
|
|
18762
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.564.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_0a4d79b5da58b1179a36aa928f36b150/node_modules/@wirecat/cli-core/dist/store/sqlite/email-index.js
|
|
18698
18763
|
var titleOf = /* @__PURE__ */ __name((subject2) => subject2?.replace(/^\s*((re|fwd?|aw|wg)\s*:\s*)+/i, "").trim() || null, "titleOf");
|
|
18699
18764
|
var MAIL_PIECES = `(SELECT k.id, k.content_hash, k.chunkable_type AS type, k.chunkable_id AS owner, k.position,
|
|
18700
18765
|
k.start_offset, k.end_offset, k.account_id, k.occurred_at, a.attachable_id AS email_id,
|
|
@@ -18804,7 +18869,7 @@ var drainEmailIndex = /* @__PURE__ */ __name((database, stemmerFor2) => {
|
|
|
18804
18869
|
return emails3 + threads;
|
|
18805
18870
|
}, "drainEmailIndex");
|
|
18806
18871
|
|
|
18807
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
18872
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.564.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_0a4d79b5da58b1179a36aa928f36b150/node_modules/@wirecat/cli-core/dist/store/sqlite/email-locations.js
|
|
18808
18873
|
var locate = /* @__PURE__ */ __name((database, accountId, emailId, where) => database.prepare(`INSERT OR REPLACE INTO email_locations (mailbox_id, uidvalidity, uid, email_id)
|
|
18809
18874
|
SELECT id, ?, ?, ? FROM mailboxes WHERE account_id = ? AND external_id = ?`).run(where.uidvalidity, where.uid, emailId, accountId, where.folder), "locate");
|
|
18810
18875
|
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,
|
|
@@ -18823,6 +18888,17 @@ var folderEmails = /* @__PURE__ */ __name((database, accountId, folder, uidvalid
|
|
|
18823
18888
|
locations: Number(row2.locations),
|
|
18824
18889
|
folders: Number(row2.folders)
|
|
18825
18890
|
})), "folderEmails");
|
|
18891
|
+
var placed = /* @__PURE__ */ __name((row2) => ({
|
|
18892
|
+
externalId: String(row2.external_id),
|
|
18893
|
+
threadExternalId: String(row2.thread),
|
|
18894
|
+
receivedAt: row2.at === null ? null : Number(row2.at),
|
|
18895
|
+
metadata: fromJson(row2.metadata),
|
|
18896
|
+
locations: JSON.parse(String(row2.places)).map((place) => ({
|
|
18897
|
+
folder: String(place.folder),
|
|
18898
|
+
uidvalidity: String(place.uidvalidity),
|
|
18899
|
+
uid: Number(place.uid)
|
|
18900
|
+
}))
|
|
18901
|
+
}), "placed");
|
|
18826
18902
|
var partialEmails = /* @__PURE__ */ __name((database, accountId, limit) => {
|
|
18827
18903
|
const rows = database.prepare(`SELECT e.external_id, t.external_id AS thread, coalesce(e.received_at, e.sent_at) AS at, e.metadata,
|
|
18828
18904
|
count(*) OVER () AS total,
|
|
@@ -18839,23 +18915,24 @@ var partialEmails = /* @__PURE__ */ __name((database, accountId, limit) => {
|
|
|
18839
18915
|
return {
|
|
18840
18916
|
total: rows.length ? Number(rows[0]?.total) : 0,
|
|
18841
18917
|
stuck: Number(stuck?.n ?? 0),
|
|
18842
|
-
emails: rows.map(
|
|
18843
|
-
externalId: String(row2.external_id),
|
|
18844
|
-
threadExternalId: String(row2.thread),
|
|
18845
|
-
receivedAt: row2.at === null ? null : Number(row2.at),
|
|
18846
|
-
metadata: fromJson(row2.metadata),
|
|
18847
|
-
locations: JSON.parse(String(row2.places)).map((place) => ({
|
|
18848
|
-
folder: String(place.folder),
|
|
18849
|
-
uidvalidity: String(place.uidvalidity),
|
|
18850
|
-
uid: Number(place.uid)
|
|
18851
|
-
}))
|
|
18852
|
-
}))
|
|
18918
|
+
emails: rows.map(placed)
|
|
18853
18919
|
};
|
|
18854
18920
|
}, "partialEmails");
|
|
18921
|
+
var emailPlace = /* @__PURE__ */ __name((database, accountId, externalId) => {
|
|
18922
|
+
const row2 = database.prepare(`SELECT e.external_id, t.external_id AS thread, coalesce(e.received_at, e.sent_at) AS at, e.metadata,
|
|
18923
|
+
(SELECT json_group_array(json_object('folder', folder, 'uidvalidity', uidvalidity, 'uid', uid))
|
|
18924
|
+
FROM (SELECT b.external_id AS folder, l.uidvalidity, l.uid
|
|
18925
|
+
FROM email_locations l JOIN mailboxes b ON b.id = l.mailbox_id
|
|
18926
|
+
WHERE l.email_id = e.id ORDER BY l.rowid DESC)) AS places
|
|
18927
|
+
FROM emails e JOIN email_threads t ON t.id = e.email_thread_id
|
|
18928
|
+
WHERE e.account_id = ? AND e.external_id = ? AND e.deleted_at IS NULL`).get(accountId, externalId);
|
|
18929
|
+
return row2 ? placed(row2) : null;
|
|
18930
|
+
}, "emailPlace");
|
|
18855
18931
|
var markPartial = /* @__PURE__ */ __name((database, accountId, externalId, mark) => database.prepare(`UPDATE emails SET metadata = json_set(metadata, '$.partial', json(?)) WHERE account_id = ? AND external_id = ?
|
|
18856
18932
|
AND json_extract(metadata, '$.partial') IS NOT NULL`).run(JSON.stringify(mark), accountId, externalId), "markPartial");
|
|
18857
18933
|
var partialMail = /* @__PURE__ */ __name((database) => ({
|
|
18858
18934
|
partialEmails: /* @__PURE__ */ __name(async (accountId, limit) => partialEmails(database, accountId, limit), "partialEmails"),
|
|
18935
|
+
emailPlace: /* @__PURE__ */ __name(async (accountId, externalId) => emailPlace(database, accountId, externalId), "emailPlace"),
|
|
18859
18936
|
markPartial: /* @__PURE__ */ __name(async (accountId, externalId, mark) => {
|
|
18860
18937
|
write(database, () => markPartial(database, accountId, externalId, mark));
|
|
18861
18938
|
}, "markPartial")
|
|
@@ -18890,7 +18967,7 @@ var forgetLocations = /* @__PURE__ */ __name((database, accountId, folder, uidva
|
|
|
18890
18967
|
var backfillSentAt = /* @__PURE__ */ __name((database, accountId, limit) => Number(database.prepare(`UPDATE emails SET sent_at = received_at WHERE id IN (
|
|
18891
18968
|
SELECT id FROM emails WHERE account_id = ? AND sent_at IS NULL AND received_at IS NOT NULL LIMIT ?)`).run(accountId, limit).changes), "backfillSentAt");
|
|
18892
18969
|
|
|
18893
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
18970
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.564.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_0a4d79b5da58b1179a36aa928f36b150/node_modules/@wirecat/cli-core/dist/store/sqlite/email-state.js
|
|
18894
18971
|
var recountEmailThread = /* @__PURE__ */ __name((database, threadId, now2) => database.prepare(`UPDATE email_threads SET
|
|
18895
18972
|
emails_count = (SELECT count(*) FROM emails WHERE email_thread_id = ? AND deleted_at IS NULL),
|
|
18896
18973
|
last_email_at = (SELECT max(coalesce(sent_at, received_at)) FROM emails
|
|
@@ -18940,7 +19017,7 @@ var markEmailsRestored = /* @__PURE__ */ __name((database, accountId, externalId
|
|
|
18940
19017
|
return threads.length;
|
|
18941
19018
|
}, "markEmailsRestored");
|
|
18942
19019
|
|
|
18943
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
19020
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.564.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_0a4d79b5da58b1179a36aa928f36b150/node_modules/@wirecat/cli-core/dist/store/sqlite/mail-rules.js
|
|
18944
19021
|
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");
|
|
18945
19022
|
var conditionsKey = /* @__PURE__ */ __name((conditions) => JSON.stringify(sorted(conditions)), "conditionsKey");
|
|
18946
19023
|
var ruleOf = /* @__PURE__ */ __name((row2) => ({
|
|
@@ -19007,7 +19084,7 @@ var mailRulesOver = /* @__PURE__ */ __name((database) => ({
|
|
|
19007
19084
|
}
|
|
19008
19085
|
}), "mailRulesOver");
|
|
19009
19086
|
|
|
19010
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
19087
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.564.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_0a4d79b5da58b1179a36aa928f36b150/node_modules/@wirecat/cli-core/dist/store/sqlite/link-reviews.js
|
|
19011
19088
|
var reviewLink = /* @__PURE__ */ __name((database, linkable, entity, candidates, reason, now2) => {
|
|
19012
19089
|
database.prepare(`INSERT INTO link_reviews (linkable_type, linkable_id, entity_type, candidates, reason, status, created_at, updated_at)
|
|
19013
19090
|
VALUES (?, ?, ?, ?, ?, 'open', ?, ?)
|
|
@@ -19015,7 +19092,7 @@ var reviewLink = /* @__PURE__ */ __name((database, linkable, entity, candidates,
|
|
|
19015
19092
|
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);
|
|
19016
19093
|
}, "reviewLink");
|
|
19017
19094
|
|
|
19018
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
19095
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.564.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_0a4d79b5da58b1179a36aa928f36b150/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-operation.js
|
|
19019
19096
|
function checkMeetingCancelled(signal) {
|
|
19020
19097
|
if (!signal?.aborted)
|
|
19021
19098
|
return;
|
|
@@ -19026,7 +19103,7 @@ function checkMeetingCancelled(signal) {
|
|
|
19026
19103
|
}
|
|
19027
19104
|
__name(checkMeetingCancelled, "checkMeetingCancelled");
|
|
19028
19105
|
|
|
19029
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
19106
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.564.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_0a4d79b5da58b1179a36aa928f36b150/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-values.js
|
|
19030
19107
|
var meetingOf = /* @__PURE__ */ __name((row2) => ({
|
|
19031
19108
|
id: Number(row2.id),
|
|
19032
19109
|
accountId: Number(row2.account_id),
|
|
@@ -19076,7 +19153,7 @@ var transcriptRowOf = /* @__PURE__ */ __name((row2) => ({
|
|
|
19076
19153
|
createdAt: Number(row2.created_at)
|
|
19077
19154
|
}), "transcriptRowOf");
|
|
19078
19155
|
|
|
19079
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
19156
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.564.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_0a4d79b5da58b1179a36aa928f36b150/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-reads.js
|
|
19080
19157
|
var MEETING_TEXT = ["external_id", "title", "description", "location", "join_url", "timezone", "metadata"];
|
|
19081
19158
|
var TRANSCRIPT_TEXT = ["source", "format", "language", "content_hash", "metadata"];
|
|
19082
19159
|
var ROW_TEXT = ["speaker_name", "text", "normalized_text", "metadata"];
|
|
@@ -19243,7 +19320,7 @@ var meetingReadsOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
|
19243
19320
|
}
|
|
19244
19321
|
}), "meetingReadsOver");
|
|
19245
19322
|
|
|
19246
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
19323
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.564.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_0a4d79b5da58b1179a36aa928f36b150/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-selection.js
|
|
19247
19324
|
var meetingSelectionSql = /* @__PURE__ */ __name((input) => {
|
|
19248
19325
|
const clauses = ["m.account_id=?", "m.deleted_at IS NULL"];
|
|
19249
19326
|
const params = [input.accountId];
|
|
@@ -19286,7 +19363,7 @@ var meetingSelectionSql = /* @__PURE__ */ __name((input) => {
|
|
|
19286
19363
|
return { clauses, params };
|
|
19287
19364
|
}, "meetingSelectionSql");
|
|
19288
19365
|
|
|
19289
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
19366
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.564.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_0a4d79b5da58b1179a36aa928f36b150/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-chat-lines.js
|
|
19290
19367
|
var meetingChatLinesOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
19291
19368
|
async meetingChatLines(input) {
|
|
19292
19369
|
checkMeetingCancelled(input.signal);
|
|
@@ -19314,7 +19391,7 @@ var meetingChatLinesOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
|
19314
19391
|
}
|
|
19315
19392
|
}), "meetingChatLinesOver");
|
|
19316
19393
|
|
|
19317
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
19394
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.564.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_0a4d79b5da58b1179a36aa928f36b150/node_modules/@wirecat/cli-core/dist/store/sqlite/reads.js
|
|
19318
19395
|
var MESSAGE_FIELDS = {
|
|
19319
19396
|
pk: messages.id,
|
|
19320
19397
|
nativeId: messages.externalId,
|
|
@@ -19485,7 +19562,7 @@ var chatActivity = /* @__PURE__ */ __name(({ database }, accountKey, since, wher
|
|
|
19485
19562
|
storedAt: toIso(Number(database.prepare("SELECT max(created_at) AS at FROM messages WHERE account_id = ?").get(accountKey)?.at) || null)
|
|
19486
19563
|
}), "chatActivity");
|
|
19487
19564
|
|
|
19488
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
19565
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.564.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_0a4d79b5da58b1179a36aa928f36b150/node_modules/@wirecat/cli-core/dist/store/sqlite/search.js
|
|
19489
19566
|
var HIT_FIELDS = {
|
|
19490
19567
|
...MESSAGE_FIELDS,
|
|
19491
19568
|
chatTitle: sql`${chats.title}`.as("chat_title"),
|
|
@@ -19584,7 +19661,7 @@ var directReplies = /* @__PURE__ */ __name((context, parents, limit) => {
|
|
|
19584
19661
|
};
|
|
19585
19662
|
}, "directReplies");
|
|
19586
19663
|
|
|
19587
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
19664
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.564.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_0a4d79b5da58b1179a36aa928f36b150/node_modules/@wirecat/cli-core/dist/store/sqlite/person-links.js
|
|
19588
19665
|
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");
|
|
19589
19666
|
var required = /* @__PURE__ */ __name((context, ref3) => {
|
|
19590
19667
|
const found2 = identityRow(context, ref3);
|
|
@@ -19715,7 +19792,7 @@ var mentioning = /* @__PURE__ */ __name((context, accountKey, { id: id2, usernam
|
|
|
19715
19792
|
}, "mentioning");
|
|
19716
19793
|
var escaped = /* @__PURE__ */ __name((text6) => text6.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), "escaped");
|
|
19717
19794
|
|
|
19718
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
19795
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.564.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_0a4d79b5da58b1179a36aa928f36b150/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-context-links.js
|
|
19719
19796
|
var missing2 = /* @__PURE__ */ __name(() => {
|
|
19720
19797
|
throw new CliError("not_found", "Meeting, participant or selected target not found");
|
|
19721
19798
|
}, "missing");
|
|
@@ -19837,7 +19914,7 @@ function meetingContextLinksOver(context) {
|
|
|
19837
19914
|
}
|
|
19838
19915
|
__name(meetingContextLinksOver, "meetingContextLinksOver");
|
|
19839
19916
|
|
|
19840
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
19917
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.564.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_0a4d79b5da58b1179a36aa928f36b150/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-index-values.js
|
|
19841
19918
|
var INDEX_CODES = { meeting_transcript_row: 1, meeting_chat_message: 2, meeting_summary: 3 };
|
|
19842
19919
|
var meetingRowid = /* @__PURE__ */ __name((type, id2) => id2 * 4 + INDEX_CODES[type], "meetingRowid");
|
|
19843
19920
|
var summaryOf = /* @__PURE__ */ __name((row2) => ({
|
|
@@ -19866,7 +19943,7 @@ var indexedText = /* @__PURE__ */ __name((database, type, id2) => {
|
|
|
19866
19943
|
return row2 ? summaryText(summaryOf(row2)) : null;
|
|
19867
19944
|
}, "indexedText");
|
|
19868
19945
|
|
|
19869
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
19946
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.564.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_0a4d79b5da58b1179a36aa928f36b150/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-stem-state.js
|
|
19870
19947
|
var summaryBytes = ["title", "overview", "sections", "next_steps", "content"].map((key2) => `coalesce(length(CAST(s.${key2} AS BLOB)),0)`).join("+");
|
|
19871
19948
|
var meetingCurrentIndexRows = `
|
|
19872
19949
|
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
|
|
@@ -19897,7 +19974,7 @@ var invalidateMeetingStems = /* @__PURE__ */ __name((database, type, id2) => {
|
|
|
19897
19974
|
}, "invalidateMeetingStems");
|
|
19898
19975
|
var meetingStemmableText = /* @__PURE__ */ __name((text6) => text6.replace(/[\p{L}\p{N}\p{M}\p{Co}]+/gu, (token) => token.length <= 1024 ? token : ""), "meetingStemmableText");
|
|
19899
19976
|
|
|
19900
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
19977
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.564.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_0a4d79b5da58b1179a36aa928f36b150/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-hit-index.js
|
|
19901
19978
|
function meetingHitIndexOver({ database, now: now2 }) {
|
|
19902
19979
|
return {
|
|
19903
19980
|
async indexSearch(original) {
|
|
@@ -19965,10 +20042,10 @@ function meetingHitIndexOver({ database, now: now2 }) {
|
|
|
19965
20042
|
}
|
|
19966
20043
|
__name(meetingHitIndexOver, "meetingHitIndexOver");
|
|
19967
20044
|
|
|
19968
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
20045
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.564.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_0a4d79b5da58b1179a36aa928f36b150/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-hit-search.js
|
|
19969
20046
|
import { createHash as createHash5 } from "node:crypto";
|
|
19970
20047
|
|
|
19971
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
20048
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.564.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_0a4d79b5da58b1179a36aa928f36b150/node_modules/@wirecat/cli-core/dist/search/trigrams.js
|
|
19972
20049
|
var trigrams = /* @__PURE__ */ __name((term) => {
|
|
19973
20050
|
const padded = ` ${term} `;
|
|
19974
20051
|
const pieces = /* @__PURE__ */ new Set();
|
|
@@ -19977,7 +20054,7 @@ var trigrams = /* @__PURE__ */ __name((term) => {
|
|
|
19977
20054
|
return [...pieces];
|
|
19978
20055
|
}, "trigrams");
|
|
19979
20056
|
|
|
19980
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
20057
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.564.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_0a4d79b5da58b1179a36aa928f36b150/node_modules/@wirecat/cli-core/dist/search/correct.js
|
|
19981
20058
|
var SHORTEST_CORRECTION = 3;
|
|
19982
20059
|
var maxEdits = /* @__PURE__ */ __name((word) => word.length <= 4 ? 1 : 2, "maxEdits");
|
|
19983
20060
|
var editDistance = /* @__PURE__ */ __name((a, b, max) => {
|
|
@@ -20024,7 +20101,7 @@ var correctWords = /* @__PURE__ */ __name(async (vocabulary, words3) => {
|
|
|
20024
20101
|
return corrections;
|
|
20025
20102
|
}, "correctWords");
|
|
20026
20103
|
|
|
20027
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
20104
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.564.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_0a4d79b5da58b1179a36aa928f36b150/node_modules/@wirecat/cli-core/dist/search/garbled.js
|
|
20028
20105
|
var SHORTEST_GARBLED = 4;
|
|
20029
20106
|
var MOST_WIDENED = 64;
|
|
20030
20107
|
var plain = /* @__PURE__ */ __name((word) => word.replaceAll("\u044D", "\u0435"), "plain");
|
|
@@ -20116,7 +20193,7 @@ var widenWords = /* @__PURE__ */ __name((probes, vocabulary, stem, known2) => {
|
|
|
20116
20193
|
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));
|
|
20117
20194
|
}, "widenWords");
|
|
20118
20195
|
|
|
20119
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
20196
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.564.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_0a4d79b5da58b1179a36aa928f36b150/node_modules/@wirecat/cli-core/dist/search/russian-dictionary.js
|
|
20120
20197
|
import { readFileSync } from "node:fs";
|
|
20121
20198
|
var loaded;
|
|
20122
20199
|
var dictionary = /* @__PURE__ */ __name(() => {
|
|
@@ -20175,7 +20252,7 @@ var knownRussianWord = /* @__PURE__ */ __name((word) => {
|
|
|
20175
20252
|
return false;
|
|
20176
20253
|
}, "knownRussianWord");
|
|
20177
20254
|
|
|
20178
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
20255
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.564.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_0a4d79b5da58b1179a36aa928f36b150/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-hit-query.js
|
|
20179
20256
|
var WORD3 = /[\p{L}\p{N}\p{M}]+/gu;
|
|
20180
20257
|
var MOST_WORDS = 128;
|
|
20181
20258
|
var quote = /* @__PURE__ */ __name((word) => `"${word.replaceAll('"', '""')}"`, "quote");
|
|
@@ -20402,7 +20479,7 @@ var matchMeetingText = /* @__PURE__ */ __name((tree, text6, stemmer) => {
|
|
|
20402
20479
|
return check3(tree);
|
|
20403
20480
|
}, "matchMeetingText");
|
|
20404
20481
|
|
|
20405
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
20482
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.564.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_0a4d79b5da58b1179a36aa928f36b150/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-hit-search.js
|
|
20406
20483
|
var fail3 = /* @__PURE__ */ __name((message2) => {
|
|
20407
20484
|
throw new CliError("validation_error", message2);
|
|
20408
20485
|
}, "fail");
|
|
@@ -20584,7 +20661,7 @@ function meetingHitSearchOver({ database }) {
|
|
|
20584
20661
|
}
|
|
20585
20662
|
__name(meetingHitSearchOver, "meetingHitSearchOver");
|
|
20586
20663
|
|
|
20587
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
20664
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.564.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_0a4d79b5da58b1179a36aa928f36b150/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-languages.js
|
|
20588
20665
|
var meetingLanguagesOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
20589
20666
|
async fillTranscriptLanguages({ accountId, apply, now: now2 }) {
|
|
20590
20667
|
positiveReadInteger(accountId, "accountId");
|
|
@@ -20616,7 +20693,7 @@ var meetingLanguagesOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
|
20616
20693
|
}
|
|
20617
20694
|
}), "meetingLanguagesOver");
|
|
20618
20695
|
|
|
20619
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
20696
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.564.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_0a4d79b5da58b1179a36aa928f36b150/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-participant-search.js
|
|
20620
20697
|
import { createHash as createHash6 } from "node:crypto";
|
|
20621
20698
|
var cursorOf2 = /* @__PURE__ */ __name((value, key2) => {
|
|
20622
20699
|
if (value === void 0)
|
|
@@ -20706,7 +20783,7 @@ var meetingParticipantSearchOver = /* @__PURE__ */ __name((context) => ({
|
|
|
20706
20783
|
}
|
|
20707
20784
|
}), "meetingParticipantSearchOver");
|
|
20708
20785
|
|
|
20709
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
20786
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.564.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_0a4d79b5da58b1179a36aa928f36b150/node_modules/@wirecat/cli-core/dist/store/sqlite/preparation-context-queries.js
|
|
20710
20787
|
var preparationQueries = {
|
|
20711
20788
|
participants: {
|
|
20712
20789
|
fields: "p.id, p.identity_id, p.display_name, l.person_id",
|
|
@@ -20756,7 +20833,7 @@ var preparationQueries = {
|
|
|
20756
20833
|
}
|
|
20757
20834
|
};
|
|
20758
20835
|
|
|
20759
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
20836
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.564.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_0a4d79b5da58b1179a36aa928f36b150/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-preparation-context.js
|
|
20760
20837
|
var meetingPreparationContextOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
20761
20838
|
async preparationContext(original) {
|
|
20762
20839
|
const input = validateMeetingPreparationContext(original);
|
|
@@ -20797,7 +20874,7 @@ var meetingPreparationContextOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
|
20797
20874
|
}
|
|
20798
20875
|
}), "meetingPreparationContextOver");
|
|
20799
20876
|
|
|
20800
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
20877
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.564.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_0a4d79b5da58b1179a36aa928f36b150/node_modules/@wirecat/cli-core/dist/store/sqlite/preparation-subjects.js
|
|
20801
20878
|
var preparationSubjects = /* @__PURE__ */ __name((anchors) => `WITH anchors AS (
|
|
20802
20879
|
SELECT m.id FROM meetings m JOIN meeting_series s ON s.id=m.meeting_series_id
|
|
20803
20880
|
WHERE m.id IN (${Array.from({ length: anchors }, () => "?").join(",")}) AND m.account_id=? AND s.account_id=?
|
|
@@ -20811,7 +20888,7 @@ var preparationSubjects = /* @__PURE__ */ __name((anchors) => `WITH anchors AS (
|
|
|
20811
20888
|
JOIN main.projects p ON p.id=l.to_id WHERE p.account_id IS NULL AND p.deleted_at IS NULL
|
|
20812
20889
|
)`, "preparationSubjects");
|
|
20813
20890
|
|
|
20814
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
20891
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.564.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_0a4d79b5da58b1179a36aa928f36b150/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-preparation-knowledge.js
|
|
20815
20892
|
var meetingPreparationKnowledgeOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
20816
20893
|
async preparationKnowledge(original) {
|
|
20817
20894
|
const { accountId, seriesId, anchorIds, after: after2, before: before2, limit, maxReadBytes, signal } = validateMeetingRelatedHistory(original);
|
|
@@ -20856,7 +20933,7 @@ var meetingPreparationKnowledgeOver = /* @__PURE__ */ __name(({ database }) => (
|
|
|
20856
20933
|
}
|
|
20857
20934
|
}), "meetingPreparationKnowledgeOver");
|
|
20858
20935
|
|
|
20859
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
20936
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.564.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_0a4d79b5da58b1179a36aa928f36b150/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-preparation-notes.js
|
|
20860
20937
|
var meetingPreparationNotesOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
20861
20938
|
async preparationNotes(original) {
|
|
20862
20939
|
const { accountId, seriesId, anchorIds, after: after2, before: before2, limit, maxReadBytes, signal } = validateMeetingRelatedHistory(original);
|
|
@@ -20909,7 +20986,7 @@ var meetingPreparationNotesOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
|
20909
20986
|
}
|
|
20910
20987
|
}), "meetingPreparationNotesOver");
|
|
20911
20988
|
|
|
20912
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
20989
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.564.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_0a4d79b5da58b1179a36aa928f36b150/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-related-history.js
|
|
20913
20990
|
var meetingRelatedHistoryOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
20914
20991
|
async relatedHistory(original) {
|
|
20915
20992
|
const input = validateMeetingRelatedHistory(original);
|
|
@@ -20980,7 +21057,7 @@ var meetingRelatedHistoryOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
|
20980
21057
|
}
|
|
20981
21058
|
}), "meetingRelatedHistoryOver");
|
|
20982
21059
|
|
|
20983
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
21060
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.564.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_0a4d79b5da58b1179a36aa928f36b150/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-review.js
|
|
20984
21061
|
var number2 = /* @__PURE__ */ __name((value) => value === null || value === void 0 ? null : Number(value), "number");
|
|
20985
21062
|
var text2 = /* @__PURE__ */ __name((value) => value === null || value === void 0 ? null : String(value), "text");
|
|
20986
21063
|
var meetingReviewOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
@@ -21061,7 +21138,7 @@ var meetingReviewOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
|
21061
21138
|
}
|
|
21062
21139
|
}), "meetingReviewOver");
|
|
21063
21140
|
|
|
21064
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
21141
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.564.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_0a4d79b5da58b1179a36aa928f36b150/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-series-history.js
|
|
21065
21142
|
var bytes2 = "length(CAST(external_id AS BLOB)) + coalesce(length(CAST(title AS BLOB)), 0)";
|
|
21066
21143
|
var ensureBytes2 = /* @__PURE__ */ __name((size2, budget) => {
|
|
21067
21144
|
if (!Number.isSafeInteger(size2) || size2 < 0 || size2 > budget)
|
|
@@ -21115,8 +21192,14 @@ var meetingSeriesHistoryOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
|
21115
21192
|
}
|
|
21116
21193
|
}), "meetingSeriesHistoryOver");
|
|
21117
21194
|
|
|
21118
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
21195
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.564.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_0a4d79b5da58b1179a36aa928f36b150/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-stats.js
|
|
21119
21196
|
var MOST_ROWS = 5e5;
|
|
21197
|
+
var meetingCountsSql = /* @__PURE__ */ __name((where) => `SELECT m.started_at, coalesce(m.duration_ms, m.ended_at - m.started_at) AS duration_ms,
|
|
21198
|
+
EXISTS (SELECT 1 FROM meeting_transcripts t WHERE t.meeting_id = m.id AND t.deleted_at IS NULL
|
|
21199
|
+
AND t.superseded_at IS NULL) AS transcribed,
|
|
21200
|
+
s.external_id AS series_key, CASE WHEN s.id IS NULL THEN NULL ELSE coalesce(s.title, m.title) END AS series_title
|
|
21201
|
+
FROM meetings m LEFT JOIN meeting_series s ON s.id = m.meeting_series_id
|
|
21202
|
+
WHERE ${where} ORDER BY m.started_at DESC`, "meetingCountsSql");
|
|
21120
21203
|
var meetingStatsOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
21121
21204
|
async meetingStats(input) {
|
|
21122
21205
|
checkMeetingCancelled(input.signal);
|
|
@@ -21159,10 +21242,26 @@ var meetingStatsOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
|
21159
21242
|
speakerName: text6(row2.speaker_name)
|
|
21160
21243
|
})), input.timeZone);
|
|
21161
21244
|
});
|
|
21245
|
+
},
|
|
21246
|
+
async meetingCounts(input) {
|
|
21247
|
+
checkMeetingCancelled(input.signal);
|
|
21248
|
+
positiveReadInteger(input.accountId, "accountId");
|
|
21249
|
+
return read(database, () => {
|
|
21250
|
+
const { clauses, params } = meetingSelectionSql(input);
|
|
21251
|
+
const meetings2 = database.prepare(meetingCountsSql(clauses.join(" AND "))).all(...params).map((row2) => ({
|
|
21252
|
+
startedAt: row2.started_at === null ? null : Number(row2.started_at),
|
|
21253
|
+
durationMs: row2.duration_ms === null ? null : Number(row2.duration_ms),
|
|
21254
|
+
transcribed: Number(row2.transcribed) === 1,
|
|
21255
|
+
seriesKey: row2.series_key === null ? null : String(row2.series_key),
|
|
21256
|
+
seriesTitle: row2.series_title === null ? null : String(row2.series_title)
|
|
21257
|
+
}));
|
|
21258
|
+
checkMeetingCancelled(input.signal);
|
|
21259
|
+
return aggregateMeetingCounts(meetings2, input.by, input.timeZone, input.limit);
|
|
21260
|
+
});
|
|
21162
21261
|
}
|
|
21163
21262
|
}), "meetingStatsOver");
|
|
21164
21263
|
|
|
21165
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
21264
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.564.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_0a4d79b5da58b1179a36aa928f36b150/node_modules/@wirecat/cli-core/dist/store/sqlite/meetings.js
|
|
21166
21265
|
var CURSOR_KEY = "meetings";
|
|
21167
21266
|
var seriesOf2 = /* @__PURE__ */ __name((row2) => ({
|
|
21168
21267
|
id: Number(row2.id),
|
|
@@ -21731,7 +21830,7 @@ var meetingStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
21731
21830
|
};
|
|
21732
21831
|
}, "meetingStoreOver");
|
|
21733
21832
|
|
|
21734
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
21833
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.564.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_0a4d79b5da58b1179a36aa928f36b150/node_modules/@wirecat/cli-core/dist/store/sqlite/sync.js
|
|
21735
21834
|
var syncStateOf = /* @__PURE__ */ __name(({ orm }, accountKey, name) => {
|
|
21736
21835
|
const row2 = orm.select({ value: syncCursors.value, at: syncCursors.updatedAt }).from(syncCursors).where(and(eq(syncCursors.accountId, accountKey), eq(syncCursors.key, name))).get();
|
|
21737
21836
|
return row2 ? { value: row2.value, at: toIso(row2.at) } : void 0;
|
|
@@ -21757,7 +21856,7 @@ var release = /* @__PURE__ */ __name(({ orm }, chatKey, anchor, holder) => {
|
|
|
21757
21856
|
orm.delete(fetchLeases).where(and(eq(fetchLeases.chatId, chatKey), eq(fetchLeases.anchor, anchor), eq(fetchLeases.holder, holder))).run();
|
|
21758
21857
|
}, "release");
|
|
21759
21858
|
|
|
21760
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
21859
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.564.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_0a4d79b5da58b1179a36aa928f36b150/node_modules/@wirecat/cli-core/dist/store/sqlite/thread-columns.js
|
|
21761
21860
|
var THREAD_COLUMNS = {
|
|
21762
21861
|
subject: {
|
|
21763
21862
|
where: /* @__PURE__ */ __name(({ value }) => ({
|
|
@@ -21774,7 +21873,7 @@ var threadRows = /* @__PURE__ */ __name((database, filter) => {
|
|
|
21774
21873
|
AND (${filter.where?.sql ?? "1"}) ORDER BY coalesce(last_email_at, 0) DESC, id DESC LIMIT ? OFFSET ?`).all(filter.accountId ?? null, filter.accountId ?? null, filter.includeDeleted ? 1 : 0, ...filter.where?.params ?? [], limit, offset);
|
|
21775
21874
|
}, "threadRows");
|
|
21776
21875
|
|
|
21777
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
21876
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.564.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_0a4d79b5da58b1179a36aa928f36b150/node_modules/@wirecat/cli-core/dist/store/sqlite/emails.js
|
|
21778
21877
|
var threadConversation = /* @__PURE__ */ __name((place, builtAt) => ({
|
|
21779
21878
|
id: `email:${place.emailId}`,
|
|
21780
21879
|
chatId: place.threadExternalId,
|
|
@@ -22330,7 +22429,7 @@ var mailStoreOver = /* @__PURE__ */ __name(({ database, orm, now: now2 }, stemme
|
|
|
22330
22429
|
}
|
|
22331
22430
|
}), "mailStoreOver");
|
|
22332
22431
|
|
|
22333
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
22432
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.564.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_0a4d79b5da58b1179a36aa928f36b150/node_modules/@wirecat/cli-core/dist/search/dictionary.js
|
|
22334
22433
|
import { readFileSync as readFileSync2 } from "node:fs";
|
|
22335
22434
|
var DICTIONARIES = Object.fromEntries(LANGUAGES.map(({ name, dictionary: dictionary3 }) => [name, dictionary3]));
|
|
22336
22435
|
var folded4 = /* @__PURE__ */ __name((word) => /^[а-яё'-]*$/.test(word) ? word.replaceAll("\u0451", "\u0435").replaceAll("\u0439", "\u0438") : fold(word), "folded");
|
|
@@ -22420,7 +22519,7 @@ var knownWord = /* @__PURE__ */ __name((languages) => {
|
|
|
22420
22519
|
}, "knownWord");
|
|
22421
22520
|
var dictionaryLanguages = /* @__PURE__ */ __name((stemmers) => [stemmers.cyrillic, ...stemmers.latin.split(",")].filter((name) => Object.hasOwn(DICTIONARIES, name)), "dictionaryLanguages");
|
|
22422
22521
|
|
|
22423
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
22522
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.564.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_0a4d79b5da58b1179a36aa928f36b150/node_modules/@wirecat/cli-core/dist/store/sqlite/transcript-query.js
|
|
22424
22523
|
var predicates = /* @__PURE__ */ __name((node) => node.kind === "predicate" ? [node] : node.clauses.flatMap(({ node: node2 }) => predicates(node2)), "predicates");
|
|
22425
22524
|
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");
|
|
22426
22525
|
var LATIN_NUMBERS = new Set(`zero one two three four five six seven eight nine ten eleven twelve twenty thirty forty fifty sixty seventy
|
|
@@ -22506,7 +22605,7 @@ var spokenTranscripts = /* @__PURE__ */ __name((database, item, speaking, keys)
|
|
|
22506
22605
|
return found2;
|
|
22507
22606
|
}, "spokenTranscripts");
|
|
22508
22607
|
|
|
22509
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
22608
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.564.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_0a4d79b5da58b1179a36aa928f36b150/node_modules/@wirecat/cli-core/dist/store/sqlite/hit-places.js
|
|
22510
22609
|
var placeHits = /* @__PURE__ */ __name((database, corpus, leaves, transcripts, found2, pks) => {
|
|
22511
22610
|
const placeLeaves = leaves.filter(({ node }) => (node.operator === "term" || node.operator === "phrase") && (node.implicit || node.field === "content" || node.field === "transcript"));
|
|
22512
22611
|
if (!placeLeaves.length || !pks.length || found2.length !== pks.length)
|
|
@@ -22553,7 +22652,29 @@ var placeHits = /* @__PURE__ */ __name((database, corpus, leaves, transcripts, f
|
|
|
22553
22652
|
});
|
|
22554
22653
|
}, "placeHits");
|
|
22555
22654
|
|
|
22556
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
22655
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.564.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_0a4d79b5da58b1179a36aa928f36b150/node_modules/@wirecat/cli-core/dist/store/sqlite/lucene-groups.js
|
|
22656
|
+
var GROUPS = {
|
|
22657
|
+
chat: {
|
|
22658
|
+
key: "m.chat_id",
|
|
22659
|
+
select: "ac.provider AS provider, ac.external_id AS account, c.external_id AS id, c.title AS name"
|
|
22660
|
+
},
|
|
22661
|
+
sender: {
|
|
22662
|
+
key: "coalesce(m.sender_identity_id, -m.account_id)",
|
|
22663
|
+
select: "ac.provider AS provider, ac.external_id AS account, i.external_id AS id, i.name AS name, max(m.outgoing) AS outgoing"
|
|
22664
|
+
},
|
|
22665
|
+
// Quarter hours, so a calendar day or hour in any zone (+05:30, +05:45) is a whole number of buckets.
|
|
22666
|
+
time: { key: "m.sent_at / 900000", select: "CAST(min(m.sent_at / 900000) * 900000 AS TEXT) AS id, NULL AS name" },
|
|
22667
|
+
sender_direction: {
|
|
22668
|
+
key: "coalesce(m.sender_identity_id, -m.account_id), coalesce(m.outgoing, 0)",
|
|
22669
|
+
select: "ac.provider AS provider, ac.external_id AS account, i.external_id AS id, i.name AS name, coalesce(m.outgoing, 0) AS outgoing"
|
|
22670
|
+
},
|
|
22671
|
+
time_direction: {
|
|
22672
|
+
key: "m.sent_at / 900000, coalesce(m.outgoing, 0)",
|
|
22673
|
+
select: "CAST(min(m.sent_at / 900000) * 900000 AS TEXT) AS id, NULL AS name, coalesce(m.outgoing, 0) AS outgoing"
|
|
22674
|
+
}
|
|
22675
|
+
};
|
|
22676
|
+
|
|
22677
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.564.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_0a4d79b5da58b1179a36aa928f36b150/node_modules/@wirecat/cli-core/dist/store/sqlite/lucene.js
|
|
22557
22678
|
var MESSAGES2 = {
|
|
22558
22679
|
rows: "messages",
|
|
22559
22680
|
threads: "chats",
|
|
@@ -22574,18 +22695,6 @@ var MAIL = {
|
|
|
22574
22695
|
item: "email",
|
|
22575
22696
|
thread: "email_thread"
|
|
22576
22697
|
};
|
|
22577
|
-
var GROUPS = {
|
|
22578
|
-
chat: {
|
|
22579
|
-
key: "m.chat_id",
|
|
22580
|
-
select: "ac.provider AS provider, ac.external_id AS account, c.external_id AS id, c.title AS name"
|
|
22581
|
-
},
|
|
22582
|
-
sender: {
|
|
22583
|
-
key: "coalesce(m.sender_identity_id, -m.account_id)",
|
|
22584
|
-
select: "ac.provider AS provider, ac.external_id AS account, i.external_id AS id, i.name AS name, max(m.outgoing) AS outgoing"
|
|
22585
|
-
},
|
|
22586
|
-
// Quarter hours, so a calendar day or hour in any zone (+05:30, +05:45) is a whole number of buckets.
|
|
22587
|
-
time: { key: "m.sent_at / 900000", select: "CAST(min(m.sent_at / 900000) * 900000 AS TEXT) AS id, NULL AS name" }
|
|
22588
|
-
};
|
|
22589
22698
|
var matchQuery = /* @__PURE__ */ __name((context, execution) => runQuery(context, execution), "matchQuery");
|
|
22590
22699
|
var countQuery = /* @__PURE__ */ __name((context, execution, by) => runQuery(context, execution, by), "countQuery");
|
|
22591
22700
|
var queryMessagePks = /* @__PURE__ */ __name((context, execution) => runQuery(context, execution, "pks"), "queryMessagePks");
|
|
@@ -22883,8 +22992,8 @@ var compileQuery = /* @__PURE__ */ __name((context, execution, boundedAttachment
|
|
|
22883
22992
|
count: Number(row2.count)
|
|
22884
22993
|
}));
|
|
22885
22994
|
}, "grouped");
|
|
22886
|
-
const
|
|
22887
|
-
const hits = /* @__PURE__ */ __name((pks) =>
|
|
22995
|
+
const placed2 = /* @__PURE__ */ __name((found2, pks) => placeHits(database, corpus, [...fragments.values()], transcripts, found2, pks), "placed");
|
|
22996
|
+
const hits = /* @__PURE__ */ __name((pks) => placed2(mail ? emailHitsByPk(database, pks) : hitsByPk(context, pks), pks), "hits");
|
|
22888
22997
|
return {
|
|
22889
22998
|
corpus,
|
|
22890
22999
|
rowsFrom,
|
|
@@ -23048,7 +23157,7 @@ var runCompiled = /* @__PURE__ */ __name(async (context, execution, by) => {
|
|
|
23048
23157
|
};
|
|
23049
23158
|
}, "runCompiled");
|
|
23050
23159
|
|
|
23051
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
23160
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.564.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_0a4d79b5da58b1179a36aa928f36b150/node_modules/@wirecat/cli-core/dist/store/sqlite/counters.js
|
|
23052
23161
|
function invalidMetadata() {
|
|
23053
23162
|
throw new CliError("validation_error", "stored counter metadata is malformed \u2014 check the store before refreshing");
|
|
23054
23163
|
}
|
|
@@ -23150,7 +23259,7 @@ var counterTargets = /* @__PURE__ */ __name((context, execution, options) => wit
|
|
|
23150
23259
|
};
|
|
23151
23260
|
}), "counterTargets");
|
|
23152
23261
|
|
|
23153
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
23262
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.564.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_0a4d79b5da58b1179a36aa928f36b150/node_modules/@wirecat/cli-core/dist/store/sqlite/attachment-texts.js
|
|
23154
23263
|
var NOT_FILE_LIST = [...NOT_FILES].map((kind4) => `'${kind4}'`).join(",");
|
|
23155
23264
|
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,
|
|
23156
23265
|
att.size, att.local_path, att.extraction AS origin, att.size AS read_bytes, att.extraction_error AS error, att.content_sha256, att.extractor
|
|
@@ -23269,7 +23378,7 @@ var attachmentViews = /* @__PURE__ */ __name(({ database }, accountKey, { chatKe
|
|
|
23269
23378
|
}));
|
|
23270
23379
|
}, "attachmentViews");
|
|
23271
23380
|
|
|
23272
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
23381
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.564.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_0a4d79b5da58b1179a36aa928f36b150/node_modules/@wirecat/cli-core/dist/store/sqlite/transcripts.js
|
|
23273
23382
|
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");
|
|
23274
23383
|
var keepTranscript = /* @__PURE__ */ __name((context, chatKey, messageId, text6, source2) => {
|
|
23275
23384
|
const { orm, database, now: now2 } = context;
|
|
@@ -23307,7 +23416,7 @@ var intoVoiceAttachment = /* @__PURE__ */ __name((context, messagePk) => {
|
|
|
23307
23416
|
keepText(context, Number(row2.id), { text: String(row2.text), origin: "extracted", extractor: `speech:${row2.source}` });
|
|
23308
23417
|
}, "intoVoiceAttachment");
|
|
23309
23418
|
|
|
23310
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
23419
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.564.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_0a4d79b5da58b1179a36aa928f36b150/node_modules/@wirecat/cli-core/dist/store/sqlite/messages.js
|
|
23311
23420
|
var FIELDS = [
|
|
23312
23421
|
"threadExternalId",
|
|
23313
23422
|
"senderIdentityId",
|
|
@@ -23624,7 +23733,7 @@ var writeDerivedReactions = /* @__PURE__ */ __name((context, chatKey, messageId)
|
|
|
23624
23733
|
reactionStatementsOf(context.database).total.run(JSON.stringify(derived), chatKey, messageId);
|
|
23625
23734
|
}, "writeDerivedReactions");
|
|
23626
23735
|
|
|
23627
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
23736
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.564.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_0a4d79b5da58b1179a36aa928f36b150/node_modules/@wirecat/cli-core/dist/store/keys.js
|
|
23628
23737
|
var keysOver = /* @__PURE__ */ __name((context) => {
|
|
23629
23738
|
const findAccountPk2 = /* @__PURE__ */ __name((key2) => findAccountPk(context, key2), "findAccountPk");
|
|
23630
23739
|
const findChatPk2 = /* @__PURE__ */ __name((accountKey, chatId) => findChatPk(context, accountKey, chatId), "findChatPk");
|
|
@@ -23645,7 +23754,7 @@ var keysOver = /* @__PURE__ */ __name((context) => {
|
|
|
23645
23754
|
};
|
|
23646
23755
|
}, "keysOver");
|
|
23647
23756
|
|
|
23648
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
23757
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.564.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_0a4d79b5da58b1179a36aa928f36b150/node_modules/@wirecat/cli-core/dist/store/sqlite/account-groups.js
|
|
23649
23758
|
var accountGroupsOf = /* @__PURE__ */ __name((database) => {
|
|
23650
23759
|
const row2 = database.prepare("SELECT value FROM store_settings WHERE key = ?").get(ACCOUNT_GROUPS);
|
|
23651
23760
|
if (!row2)
|
|
@@ -23680,7 +23789,7 @@ var saveProfile = /* @__PURE__ */ __name((database, app, profile, key2, now2) =>
|
|
|
23680
23789
|
database.prepare("INSERT OR REPLACE INTO store_settings (key, value, at) VALUES (?, ?, ?)").run(PROFILES, JSON.stringify(profiles), now2);
|
|
23681
23790
|
}, "saveProfile");
|
|
23682
23791
|
|
|
23683
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
23792
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.564.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_0a4d79b5da58b1179a36aa928f36b150/node_modules/@wirecat/cli-core/dist/store/sqlite/actors.js
|
|
23684
23793
|
var BOT_KINDS = ["agent", "rule", "script", "integration"];
|
|
23685
23794
|
var ownerPerson = /* @__PURE__ */ __name((database) => {
|
|
23686
23795
|
const found2 = database.prepare("SELECT id FROM persons WHERE owner = 1 ORDER BY id LIMIT 1").get();
|
|
@@ -23737,7 +23846,7 @@ var proposedBySql = /* @__PURE__ */ __name((type, id2, by) => {
|
|
|
23737
23846
|
return { sql: bot("pb.name = ?"), params: [by.bot] };
|
|
23738
23847
|
}, "proposedBySql");
|
|
23739
23848
|
|
|
23740
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
23849
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.564.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_0a4d79b5da58b1179a36aa928f36b150/node_modules/@wirecat/cli-core/dist/store/sqlite/own-identities.js
|
|
23741
23850
|
var linkOwnIdentities = /* @__PURE__ */ __name((context) => {
|
|
23742
23851
|
const owner = ownerPerson(context.database).id;
|
|
23743
23852
|
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);
|
|
@@ -23758,7 +23867,7 @@ var linkToOwner = /* @__PURE__ */ __name((context, ref3) => {
|
|
|
23758
23867
|
return personOf(context, ref3);
|
|
23759
23868
|
}, "linkToOwner");
|
|
23760
23869
|
|
|
23761
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
23870
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.564.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_0a4d79b5da58b1179a36aa928f36b150/node_modules/@wirecat/cli-core/dist/store/sqlite/providers.js
|
|
23762
23871
|
var PROVIDERS_SETTING = "providers";
|
|
23763
23872
|
var storedProvidersOf = /* @__PURE__ */ __name((database) => {
|
|
23764
23873
|
const row2 = database.prepare("SELECT value FROM store_settings WHERE key = ?").get(PROVIDERS_SETTING);
|
|
@@ -23793,7 +23902,7 @@ var registerProvider = /* @__PURE__ */ __name((database, value, now2) => {
|
|
|
23793
23902
|
});
|
|
23794
23903
|
}, "registerProvider");
|
|
23795
23904
|
|
|
23796
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
23905
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.564.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_0a4d79b5da58b1179a36aa928f36b150/node_modules/@wirecat/cli-core/dist/store/sqlite/task-candidates.js
|
|
23797
23906
|
var DAY3 = 864e5;
|
|
23798
23907
|
var RECENTLY_CLOSED_MS = 14 * DAY3;
|
|
23799
23908
|
var TEXT_LIMIT = 20;
|
|
@@ -23992,7 +24101,7 @@ var taskSimilarityOver = /* @__PURE__ */ __name((context) => {
|
|
|
23992
24101
|
};
|
|
23993
24102
|
}, "taskSimilarityOver");
|
|
23994
24103
|
|
|
23995
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
24104
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.564.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_0a4d79b5da58b1179a36aa928f36b150/node_modules/@wirecat/cli-core/dist/store/sqlite/task-category-settings.js
|
|
23996
24105
|
var SETTING3 = "taskCategories";
|
|
23997
24106
|
var savedTaskCategories = /* @__PURE__ */ __name((database) => {
|
|
23998
24107
|
const row2 = database.prepare("SELECT value FROM store_settings WHERE key = ?").get(SETTING3);
|
|
@@ -24011,7 +24120,7 @@ var saveTaskCategories = /* @__PURE__ */ __name((database, categories, now2) =>
|
|
|
24011
24120
|
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);
|
|
24012
24121
|
}, "saveTaskCategories");
|
|
24013
24122
|
|
|
24014
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
24123
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.564.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_0a4d79b5da58b1179a36aa928f36b150/node_modules/@wirecat/cli-core/dist/store/sqlite/task-close.js
|
|
24015
24124
|
var DEFAULT_AGENT_CLOSE = { allowed: true, min: 0.8 };
|
|
24016
24125
|
var ALLOWED = "taskAgentClose";
|
|
24017
24126
|
var MIN = "taskAgentCloseMin";
|
|
@@ -24067,8 +24176,13 @@ var SUGGESTION_COLUMNS = [
|
|
|
24067
24176
|
];
|
|
24068
24177
|
var CLEAR_SUGGESTION = SUGGESTION_COLUMNS.map((column2) => `${column2} = NULL`).join(", ");
|
|
24069
24178
|
|
|
24070
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
24179
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.564.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_0a4d79b5da58b1179a36aa928f36b150/node_modules/@wirecat/cli-core/dist/store/mail-findings.js
|
|
24180
|
+
var MAIL_FINDINGS_KIND = "mail_findings";
|
|
24181
|
+
|
|
24182
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.564.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_0a4d79b5da58b1179a36aa928f36b150/node_modules/@wirecat/cli-core/dist/store/decisions.js
|
|
24183
|
+
var TASK_CLOSE_KIND = "task_close";
|
|
24071
24184
|
var DEFAULT_DECISION_POLICY = { agentDecisions: false, ruleProposalsOwnerOnly: true };
|
|
24185
|
+
var isOwnerOnlyKind = /* @__PURE__ */ __name((kind4) => kind4 === MAIL_FINDINGS_KIND || kind4 === MEETING_FINDINGS_KIND || kind4 === TASK_CLOSE_KIND, "isOwnerOnlyKind");
|
|
24072
24186
|
var mayDecide = /* @__PURE__ */ __name((row2, by, policy = DEFAULT_DECISION_POLICY) => {
|
|
24073
24187
|
if (by === "owner")
|
|
24074
24188
|
return null;
|
|
@@ -24078,7 +24192,7 @@ var mayDecide = /* @__PURE__ */ __name((row2, by, policy = DEFAULT_DECISION_POLI
|
|
|
24078
24192
|
reason,
|
|
24079
24193
|
message: message2
|
|
24080
24194
|
}), "refuse");
|
|
24081
|
-
if (row2.ownerOnly)
|
|
24195
|
+
if (row2.ownerOnly || isOwnerOnlyKind(row2.kind))
|
|
24082
24196
|
return refuse4("permission_error", "proposal.owner-only", `only the owner decides ${row2.id}`);
|
|
24083
24197
|
if (!policy.agentDecisions)
|
|
24084
24198
|
return refuse4("permission_error", "proposals.agent-decisions-off", "agent decisions are turned off; the owner decides");
|
|
@@ -24113,7 +24227,7 @@ var assertMayDecide = /* @__PURE__ */ __name((row2, by, policy = DEFAULT_DECISIO
|
|
|
24113
24227
|
}, "assertMayDecide");
|
|
24114
24228
|
var deciderAuthor = /* @__PURE__ */ __name((by) => by === "owner" ? "owner" : { bot: by.bot, ...by.model === void 0 ? {} : { model: by.model } }, "deciderAuthor");
|
|
24115
24229
|
|
|
24116
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
24230
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.564.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_0a4d79b5da58b1179a36aa928f36b150/node_modules/@wirecat/cli-core/dist/domain/money.js
|
|
24117
24231
|
var CURRENCY_SCALES = {
|
|
24118
24232
|
AED: 2,
|
|
24119
24233
|
AMD: 2,
|
|
@@ -24198,7 +24312,7 @@ var quantityOf = /* @__PURE__ */ __name((text6) => {
|
|
|
24198
24312
|
}, "quantityOf");
|
|
24199
24313
|
var lineUnits = /* @__PURE__ */ __name((thousandths, unitPrice) => Number((thousandths * BigInt(unitPrice) + 500n) / 1000n), "lineUnits");
|
|
24200
24314
|
|
|
24201
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
24315
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.564.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_0a4d79b5da58b1179a36aa928f36b150/node_modules/@wirecat/cli-core/dist/domain/finance.js
|
|
24202
24316
|
var INVOICE_DIRECTIONS = ["receivable", "payable"];
|
|
24203
24317
|
var INVOICE_STATUSES = ["draft", "issued", "partly_paid", "paid", "void"];
|
|
24204
24318
|
var MONEY_DIRECTIONS = ["in", "out"];
|
|
@@ -24227,7 +24341,7 @@ var paymentLine = /* @__PURE__ */ __name((payment) => {
|
|
|
24227
24341
|
var invoiceTitle = /* @__PURE__ */ __name((invoice) => `Invoice ${invoiceLine(invoice)}`, "invoiceTitle");
|
|
24228
24342
|
var paymentEntryTitle = /* @__PURE__ */ __name((payment) => `Payment \xB7 ${paymentLine(payment)}`, "paymentEntryTitle");
|
|
24229
24343
|
|
|
24230
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
24344
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.564.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_0a4d79b5da58b1179a36aa928f36b150/node_modules/@wirecat/cli-core/dist/domain/ref-summaries.js
|
|
24231
24345
|
var PROFILE_PLACEHOLDER = "<profile>";
|
|
24232
24346
|
var oneLine = /* @__PURE__ */ __name((text6) => singleLine(text6.replace(/\s+/g, " ").trim()), "oneLine");
|
|
24233
24347
|
var openKind = /* @__PURE__ */ __name((kind4) => kind4 === "email" ? "message" : kind4 === "email_thread" ? "chat" : kind4 === "unknown" ? void 0 : kind4, "openKind");
|
|
@@ -24279,7 +24393,7 @@ var refLabel = /* @__PURE__ */ __name((summary) => {
|
|
|
24279
24393
|
return `${WORDS2[summary.kind]} ${named2}${notes3 === "" ? "" : ` (${notes3})`}`;
|
|
24280
24394
|
}, "refLabel");
|
|
24281
24395
|
|
|
24282
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
24396
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.564.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_0a4d79b5da58b1179a36aa928f36b150/node_modules/@wirecat/cli-core/dist/store/sqlite/ref-summaries.js
|
|
24283
24397
|
var EXCERPT_CHARS = 280;
|
|
24284
24398
|
var TITLE_CHARS = 120;
|
|
24285
24399
|
var MEMORY_TITLE_CHARS = 80;
|
|
@@ -24632,7 +24746,7 @@ var refReadsOf = /* @__PURE__ */ __name((database, texts2, { excerpt = false } =
|
|
|
24632
24746
|
var summaryOf2 = /* @__PURE__ */ __name(({ sender, excerpt, ...summary }, withExcerpt) => withExcerpt ? { ...summary, excerpt } : summary, "summaryOf");
|
|
24633
24747
|
var refSummariesOf = /* @__PURE__ */ __name((database, texts2, options = {}) => new Map([...refReadsOf(database, texts2, options)].map(([text6, read2]) => [text6, summaryOf2(read2, options.excerpt === true)])), "refSummariesOf");
|
|
24634
24748
|
|
|
24635
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
24749
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.564.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_0a4d79b5da58b1179a36aa928f36b150/node_modules/@wirecat/cli-core/dist/store/sqlite/evidence-sources.js
|
|
24636
24750
|
var sourceOf3 = /* @__PURE__ */ __name((read2, ref3) => ({
|
|
24637
24751
|
ref: ref3,
|
|
24638
24752
|
kind: read2.kind,
|
|
@@ -24668,7 +24782,7 @@ var evidenceSourcesOf = /* @__PURE__ */ __name((database, from2) => {
|
|
|
24668
24782
|
});
|
|
24669
24783
|
}, "evidenceSourcesOf");
|
|
24670
24784
|
|
|
24671
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
24785
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.564.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_0a4d79b5da58b1179a36aa928f36b150/node_modules/@wirecat/cli-core/dist/attachments/limits.js
|
|
24672
24786
|
var MAX_FILE_BYTES = 50 * 1024 * 1024;
|
|
24673
24787
|
var MAX_TEXT_CHARS = 2e6;
|
|
24674
24788
|
var ATTACHMENT_LIMIT_ENV = [
|
|
@@ -24694,7 +24808,7 @@ var pdfPreviewLimits = /* @__PURE__ */ __name((env = process.env) => {
|
|
|
24694
24808
|
return { pixels, bytes: positive(env, "MESSAGING_PDF_PREVIEW_MAX_MIB", 8 * 1024 * 1024, 1024 * 1024) };
|
|
24695
24809
|
}, "pdfPreviewLimits");
|
|
24696
24810
|
|
|
24697
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
24811
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.564.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_0a4d79b5da58b1179a36aa928f36b150/node_modules/@wirecat/cli-core/dist/store/ulid.js
|
|
24698
24812
|
import { randomBytes } from "node:crypto";
|
|
24699
24813
|
var CROCKFORD = "0123456789ABCDEFGHJKMNPQRSTVWXYZ";
|
|
24700
24814
|
var ulid = /* @__PURE__ */ __name((now2 = Date.now()) => {
|
|
@@ -24707,7 +24821,7 @@ var ulid = /* @__PURE__ */ __name((now2 = Date.now()) => {
|
|
|
24707
24821
|
return time3 + random;
|
|
24708
24822
|
}, "ulid");
|
|
24709
24823
|
|
|
24710
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
24824
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.564.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_0a4d79b5da58b1179a36aa928f36b150/node_modules/@wirecat/cli-core/dist/store/sqlite/document-metadata.js
|
|
24711
24825
|
var FOLDED_FIELDS = ["title", "site", "language", "author"];
|
|
24712
24826
|
var encodeDocumentMetadata = /* @__PURE__ */ __name((meta, sections) => {
|
|
24713
24827
|
if (!meta && !sections?.length)
|
|
@@ -24728,7 +24842,7 @@ var languageOf = /* @__PURE__ */ __name((meta) => {
|
|
|
24728
24842
|
return typeof language === "string" && language !== "" ? language : null;
|
|
24729
24843
|
}, "languageOf");
|
|
24730
24844
|
|
|
24731
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
24845
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.564.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_0a4d79b5da58b1179a36aa928f36b150/node_modules/@wirecat/cli-core/dist/store/sqlite/files.js
|
|
24732
24846
|
var isObject = /* @__PURE__ */ __name((value) => value !== null && typeof value === "object" && !Array.isArray(value), "isObject");
|
|
24733
24847
|
var objectOf2 = /* @__PURE__ */ __name((value) => {
|
|
24734
24848
|
if (isObject(value))
|
|
@@ -24839,13 +24953,13 @@ var syncFile = /* @__PURE__ */ __name((database, now2, documentId, { seen = true
|
|
|
24839
24953
|
if (!existing) {
|
|
24840
24954
|
const columns = Object.keys(values);
|
|
24841
24955
|
const row2 = database.prepare(`INSERT INTO files (${columns.join(", ")}, created_at, updated_at) VALUES (${columns.map(() => "?").join(", ")}, ?, ?) RETURNING id`).get(...Object.values(values), Number(doc.created_at), now2);
|
|
24842
|
-
const
|
|
24843
|
-
logFileLink(database, now2,
|
|
24956
|
+
const placed2 = { id: Number(row2?.id), path };
|
|
24957
|
+
logFileLink(database, now2, placed2.id, null, documentId, method);
|
|
24844
24958
|
if (remote)
|
|
24845
24959
|
linkAttached(database, now2, externalId);
|
|
24846
24960
|
if (remote && kind4 === "folder")
|
|
24847
24961
|
placeChildren(database, now2, accountId, String(doc.external_id), depth);
|
|
24848
|
-
return
|
|
24962
|
+
return placed2;
|
|
24849
24963
|
}
|
|
24850
24964
|
const id2 = Number(existing.id);
|
|
24851
24965
|
if (existing.document_id !== documentId)
|
|
@@ -24971,7 +25085,7 @@ var filesStoreOver = /* @__PURE__ */ __name(({ database, now: now2 }) => {
|
|
|
24971
25085
|
};
|
|
24972
25086
|
}, "filesStoreOver");
|
|
24973
25087
|
|
|
24974
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
25088
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.564.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_0a4d79b5da58b1179a36aa928f36b150/node_modules/@wirecat/cli-core/dist/store/sqlite/imported-documents.js
|
|
24975
25089
|
var IMPORTED_DOCUMENT_QUERY = defineQuery({
|
|
24976
25090
|
entity: "document",
|
|
24977
25091
|
backend: "sql",
|
|
@@ -25017,7 +25131,7 @@ var importedDocumentWhere = /* @__PURE__ */ __name((database, query) => {
|
|
|
25017
25131
|
return queryFilter(validateQuery(query, IMPORTED_DOCUMENT_QUERY), columns);
|
|
25018
25132
|
}, "importedDocumentWhere");
|
|
25019
25133
|
|
|
25020
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
25134
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.564.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_0a4d79b5da58b1179a36aa928f36b150/node_modules/@wirecat/cli-core/dist/store/sqlite/notes.js
|
|
25021
25135
|
var NOTE_FORMATS = ["obsidian", "markdown"];
|
|
25022
25136
|
var iso2 = /* @__PURE__ */ __name((value) => new Date(Number(value)).toISOString(), "iso");
|
|
25023
25137
|
var optionalIso = /* @__PURE__ */ __name((value) => value == null ? null : iso2(value), "optionalIso");
|
|
@@ -25543,7 +25657,7 @@ var notesStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
25543
25657
|
};
|
|
25544
25658
|
}, "notesStoreOver");
|
|
25545
25659
|
|
|
25546
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
25660
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.564.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_0a4d79b5da58b1179a36aa928f36b150/node_modules/@wirecat/cli-core/dist/store/sqlite/memories.js
|
|
25547
25661
|
var NAMED = "SELECT m.*, b.name AS author_name, b.kind AS author_kind FROM memories m LEFT JOIN bots b ON m.author_type = 'bot' AND b.id = m.author_id";
|
|
25548
25662
|
var iso3 = /* @__PURE__ */ __name((value) => new Date(Number(value)).toISOString(), "iso");
|
|
25549
25663
|
var oneOf2 = /* @__PURE__ */ __name((value, allowed, what) => {
|
|
@@ -25765,7 +25879,7 @@ var memoriesStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
25765
25879
|
};
|
|
25766
25880
|
}, "memoriesStoreOver");
|
|
25767
25881
|
|
|
25768
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
25882
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.564.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_0a4d79b5da58b1179a36aa928f36b150/node_modules/@wirecat/cli-core/dist/store/sqlite/task-first-pass.js
|
|
25769
25883
|
var DEFAULT_FIRST_PASS_PER_CHAT = 0;
|
|
25770
25884
|
var KEY = "taskFirstPassPerChat";
|
|
25771
25885
|
var firstPassPerChatOf = /* @__PURE__ */ __name((value, setting = "task_first_pass_per_chat") => {
|
|
@@ -25785,7 +25899,7 @@ var saveFirstPassPerChat = /* @__PURE__ */ __name((database, value, now2) => {
|
|
|
25785
25899
|
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);
|
|
25786
25900
|
}, "saveFirstPassPerChat");
|
|
25787
25901
|
|
|
25788
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
25902
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.564.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_0a4d79b5da58b1179a36aa928f36b150/node_modules/@wirecat/cli-core/dist/store/sqlite/task-board.js
|
|
25789
25903
|
var TASK_SORTS = ["priority", "due", "created", "updated", "key", "state"];
|
|
25790
25904
|
var field = /* @__PURE__ */ __name((name, type, example, more = {}) => ({
|
|
25791
25905
|
name,
|
|
@@ -25817,6 +25931,7 @@ var PROJECT_TASK_FIELDS = [
|
|
|
25817
25931
|
values: ["overdue", "today", "upcoming", "later", "none"],
|
|
25818
25932
|
relation: "the due date as a board groups it: overdue (open work due before today), today, upcoming (the next 7 days after today), later, or none"
|
|
25819
25933
|
}),
|
|
25934
|
+
field("created", "time", "created:>=30d", { relation: "when it was opened" }),
|
|
25820
25935
|
field("closed", "time", "closed:>=14d", { relation: "when it was done or dismissed" }),
|
|
25821
25936
|
field("ready", "bool", "ready:true", { relation: "open work whose blocked-by tasks are all done" }),
|
|
25822
25937
|
field("text", "txt", "text:invoice", { relation: "words of the title and description; a bare word means this" })
|
|
@@ -25950,6 +26065,7 @@ var projectTaskColumns = /* @__PURE__ */ __name((now2, zone) => ({
|
|
|
25950
26065
|
agent: { where: agentWhere },
|
|
25951
26066
|
parent: { where: parentWhere },
|
|
25952
26067
|
due: { type: "time", sql: "t.due_at" },
|
|
26068
|
+
created: { type: "time", sql: "t.created_at" },
|
|
25953
26069
|
closed: { type: "time", sql: "t.closed_at" },
|
|
25954
26070
|
overdue: { where: /* @__PURE__ */ __name((node) => truth(node, dueGroups(now2, zone).overdue), "where") },
|
|
25955
26071
|
when: {
|
|
@@ -26006,7 +26122,7 @@ var withoutField = /* @__PURE__ */ __name((query, name) => {
|
|
|
26006
26122
|
return root === void 0 ? void 0 : { ...query, root };
|
|
26007
26123
|
}, "withoutField");
|
|
26008
26124
|
|
|
26009
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
26125
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.564.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_0a4d79b5da58b1179a36aa928f36b150/node_modules/@wirecat/cli-core/dist/store/sqlite/task-comments.js
|
|
26010
26126
|
var authorNamed = /* @__PURE__ */ __name((database, row2) => {
|
|
26011
26127
|
if (row2.author_type == null)
|
|
26012
26128
|
return null;
|
|
@@ -26034,7 +26150,7 @@ var addComment = /* @__PURE__ */ __name((context, task, body2, by) => {
|
|
|
26034
26150
|
return commentsOf(database, task).find((one2) => one2.ref === `note:${made}`);
|
|
26035
26151
|
}, "addComment");
|
|
26036
26152
|
|
|
26037
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
26153
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.564.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_0a4d79b5da58b1179a36aa928f36b150/node_modules/@wirecat/cli-core/dist/store/sqlite/task-relations.js
|
|
26038
26154
|
var TASK_RELATION_KINDS = [
|
|
26039
26155
|
"blocked-by",
|
|
26040
26156
|
"follow-up-of",
|
|
@@ -26164,7 +26280,7 @@ var taskRelationsStoreOver = /* @__PURE__ */ __name((context, record4) => {
|
|
|
26164
26280
|
};
|
|
26165
26281
|
}, "taskRelationsStoreOver");
|
|
26166
26282
|
|
|
26167
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
26283
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.564.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_0a4d79b5da58b1179a36aa928f36b150/node_modules/@wirecat/cli-core/dist/store/sqlite/work-tasks.js
|
|
26168
26284
|
var TASK_ROLES = ["assignee", "reviewer", "watcher"];
|
|
26169
26285
|
var iso4 = /* @__PURE__ */ __name((value) => value == null ? null : new Date(Number(value)).toISOString(), "iso");
|
|
26170
26286
|
var recordTaskEvent = /* @__PURE__ */ __name((database, task, actor, kind4, changes, at) => {
|
|
@@ -26282,7 +26398,7 @@ var workTaskOperationsOver = /* @__PURE__ */ __name((context) => {
|
|
|
26282
26398
|
const onBoard = /* @__PURE__ */ __name((task) => Boolean(database.prepare(`SELECT 1 FROM tasks t WHERE t.id = ? AND ${BOARD_SCOPE}`).get(task)), "onBoard");
|
|
26283
26399
|
const moveToProject = /* @__PURE__ */ __name((task, before2, target, actor, at, detach) => {
|
|
26284
26400
|
if (target === Number(before2.project_id))
|
|
26285
|
-
return;
|
|
26401
|
+
return [];
|
|
26286
26402
|
if (!onBoard(task))
|
|
26287
26403
|
throw new CliError("validation_error", "only a project task moves to another project");
|
|
26288
26404
|
const targetRow = database.prepare("SELECT key FROM projects WHERE id = ?").get(target);
|
|
@@ -26292,18 +26408,28 @@ var workTaskOperationsOver = /* @__PURE__ */ __name((context) => {
|
|
|
26292
26408
|
const parent2 = taskIdOf(database, Number(before2.parent_id));
|
|
26293
26409
|
throw new CliError("validation_error", `${String(before2.key)} is a subtask of ${parent2}; detach it in the same write (parent none) to move it alone`, { reason: "task.is-subtask", parent: parent2 });
|
|
26294
26410
|
}
|
|
26295
|
-
const
|
|
26296
|
-
|
|
26297
|
-
|
|
26298
|
-
|
|
26299
|
-
|
|
26300
|
-
|
|
26301
|
-
|
|
26302
|
-
|
|
26303
|
-
|
|
26304
|
-
|
|
26305
|
-
|
|
26306
|
-
},
|
|
26411
|
+
const renumber = /* @__PURE__ */ __name((row2, parent2) => {
|
|
26412
|
+
const counted = database.prepare("UPDATE projects SET tasks_count = tasks_count + 1, updated_at = ? WHERE id = ? RETURNING key, tasks_count").get(at, target);
|
|
26413
|
+
const number3 = Number(counted.tasks_count);
|
|
26414
|
+
const key2 = `${String(counted.key)}-${number3}`;
|
|
26415
|
+
database.prepare("UPDATE tasks SET project_id = ?, number = ?, key = ?, parent_id = ?, updated_at = ? WHERE id = ?").run(target, number3, key2, parent2, at, Number(row2.id));
|
|
26416
|
+
recordTaskEvent(database, Number(row2.id), actor, "project", {
|
|
26417
|
+
project: [`project:${row2.project_id}`, `project:${target}`],
|
|
26418
|
+
key: [String(row2.key), key2],
|
|
26419
|
+
...row2.parent_id === parent2 ? {} : { parent: [`task:${taskIdOf(database, Number(row2.parent_id))}`, null] }
|
|
26420
|
+
}, at);
|
|
26421
|
+
return key2;
|
|
26422
|
+
}, "renumber");
|
|
26423
|
+
renumber(before2, null);
|
|
26424
|
+
const moved = [];
|
|
26425
|
+
const childrenOf = database.prepare("SELECT * FROM tasks WHERE parent_id = ? AND deleted_at IS NULL ORDER BY id");
|
|
26426
|
+
for (const queue = [task]; queue.length > 0; ) {
|
|
26427
|
+
for (const child of childrenOf.all(queue.shift())) {
|
|
26428
|
+
moved.push({ from: String(child.key), to: renumber(child, child.parent_id) });
|
|
26429
|
+
queue.push(Number(child.id));
|
|
26430
|
+
}
|
|
26431
|
+
}
|
|
26432
|
+
return moved;
|
|
26307
26433
|
}, "moveToProject");
|
|
26308
26434
|
const edit = /* @__PURE__ */ __name((task, fields4, actor, created = false) => {
|
|
26309
26435
|
const before2 = rowById(task);
|
|
@@ -26381,16 +26507,16 @@ var workTaskOperationsOver = /* @__PURE__ */ __name((context) => {
|
|
|
26381
26507
|
change("type", fields4.type, "type");
|
|
26382
26508
|
bump = true;
|
|
26383
26509
|
}
|
|
26384
|
-
|
|
26385
|
-
moveToProject(task, before2, projectOf2(fields4.project), actor, at, fields4.parent === null);
|
|
26510
|
+
const moved = fields4.project === void 0 ? [] : moveToProject(task, before2, projectOf2(fields4.project), actor, at, fields4.parent === null);
|
|
26386
26511
|
if (set.length === 0) {
|
|
26387
26512
|
if (bump)
|
|
26388
26513
|
database.prepare("UPDATE tasks SET revision = revision + 1 WHERE id = ?").run(task);
|
|
26389
|
-
return;
|
|
26514
|
+
return moved;
|
|
26390
26515
|
}
|
|
26391
26516
|
if (bump)
|
|
26392
26517
|
set.push("revision = revision + 1");
|
|
26393
26518
|
database.prepare(`UPDATE tasks SET ${set.join(", ")}, updated_at = ? WHERE id = ?`).run(...values, at, task);
|
|
26519
|
+
return moved;
|
|
26394
26520
|
}, "edit");
|
|
26395
26521
|
const columnOf = /* @__PURE__ */ __name((task, status) => database.prepare(`SELECT t.id, t.key, coalesce(t.priority_score, 0) AS score FROM tasks t WHERE ${BOARD_SCOPE} AND t.status = ? AND t.id <> ? ORDER BY ${boardOrder("priority", false)}`).all(status, task).map((row2) => ({ id: Number(row2.id), key: String(row2.key), score: Number(row2.score) })), "columnOf");
|
|
26396
26522
|
const moveTask = /* @__PURE__ */ __name((task, row2, move2, actor) => {
|
|
@@ -26473,11 +26599,11 @@ var workTaskOperationsOver = /* @__PURE__ */ __name((context) => {
|
|
|
26473
26599
|
}, "create"),
|
|
26474
26600
|
edit: /* @__PURE__ */ __name(async (id2, fields4, by, check3 = {}) => {
|
|
26475
26601
|
const task = required3(id2);
|
|
26476
|
-
write(database, () => {
|
|
26602
|
+
const moved = write(database, () => {
|
|
26477
26603
|
checkRevision(rowById(task), check3.revision);
|
|
26478
|
-
edit(task, fields4, authorActor(context, by).actor);
|
|
26604
|
+
return edit(task, fields4, authorActor(context, by).actor);
|
|
26479
26605
|
});
|
|
26480
|
-
return details2(task);
|
|
26606
|
+
return moved.length > 0 ? { ...details2(task), movedSubtasks: moved } : details2(task);
|
|
26481
26607
|
}, "edit"),
|
|
26482
26608
|
/** `edit` inside the caller's write, so a decision that edits a task rolls back with it. */
|
|
26483
26609
|
editNow: /* @__PURE__ */ __name((id2, fields4, by) => {
|
|
@@ -26674,7 +26800,7 @@ var workTasksOver = /* @__PURE__ */ __name((context) => {
|
|
|
26674
26800
|
};
|
|
26675
26801
|
}, "workTasksOver");
|
|
26676
26802
|
|
|
26677
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
26803
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.564.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_0a4d79b5da58b1179a36aa928f36b150/node_modules/@wirecat/cli-core/dist/store/sqlite/task-close-store.js
|
|
26678
26804
|
var taskCloseOver = /* @__PURE__ */ __name((context) => {
|
|
26679
26805
|
const { database, now: now2 } = context;
|
|
26680
26806
|
const liveRow = /* @__PURE__ */ __name((id2) => {
|
|
@@ -26723,7 +26849,7 @@ var taskCloseOver = /* @__PURE__ */ __name((context) => {
|
|
|
26723
26849
|
};
|
|
26724
26850
|
}, "taskCloseOver");
|
|
26725
26851
|
|
|
26726
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
26852
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.564.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_0a4d79b5da58b1179a36aa928f36b150/node_modules/@wirecat/cli-core/dist/store/sqlite/task-pairs.js
|
|
26727
26853
|
var taskPairsOver = /* @__PURE__ */ __name((context, similarity) => {
|
|
26728
26854
|
const { database, now: now2 } = context;
|
|
26729
26855
|
const required3 = /* @__PURE__ */ __name((id2) => {
|
|
@@ -26941,7 +27067,46 @@ var taskPairsOver = /* @__PURE__ */ __name((context, similarity) => {
|
|
|
26941
27067
|
};
|
|
26942
27068
|
}, "taskPairsOver");
|
|
26943
27069
|
|
|
26944
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
27070
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.564.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_0a4d79b5da58b1179a36aa928f36b150/node_modules/@wirecat/cli-core/dist/store/sqlite/task-stats.js
|
|
27071
|
+
var ACCOUNT_SCOPE = "t.package_id IS NOT NULL AND t.deleted_at IS NULL AND t.project_id = ?";
|
|
27072
|
+
var TASK_STATS_SQL = {
|
|
27073
|
+
rows: /* @__PURE__ */ __name((board, filter) => `SELECT t.source_group, t.source_kind, t.project_id, t.status, t.created_at, t.closed_at FROM tasks t WHERE ${board ? BOARD_SCOPE : ACCOUNT_SCOPE}${filter} ORDER BY t.created_at, t.id`, "rows"),
|
|
27074
|
+
chat: "SELECT c.external_id AS id, c.title AS name FROM chats c JOIN accounts a ON a.id = c.account_id WHERE a.provider = ? AND a.external_id = ? AND c.external_id IN (SELECT value FROM json_each(?))",
|
|
27075
|
+
meeting: "SELECT CAST(id AS TEXT) AS id, title AS name FROM meetings WHERE id IN (SELECT value FROM json_each(?))",
|
|
27076
|
+
project: "SELECT CAST(id AS TEXT) AS id, name FROM projects WHERE id IN (SELECT value FROM json_each(?))"
|
|
27077
|
+
};
|
|
27078
|
+
var taskStatsOver = /* @__PURE__ */ __name(({ database }, inbox) => ({
|
|
27079
|
+
statRows: /* @__PURE__ */ __name(async (scope3, where) => {
|
|
27080
|
+
const filter = where === void 0 ? "" : ` AND (${where.sql})`;
|
|
27081
|
+
const board = !("account" in scope3);
|
|
27082
|
+
const project = board ? void 0 : inbox(scope3.account);
|
|
27083
|
+
if (!board && project === void 0)
|
|
27084
|
+
return [];
|
|
27085
|
+
return database.prepare(TASK_STATS_SQL.rows(board, filter)).all(...project === void 0 ? [] : [project], ...where?.params ?? []).map((row2) => ({
|
|
27086
|
+
group: row2.source_group == null ? null : String(row2.source_group),
|
|
27087
|
+
sourceKind: row2.source_kind == null ? null : String(row2.source_kind),
|
|
27088
|
+
projectId: Number(row2.project_id),
|
|
27089
|
+
state: String(row2.status),
|
|
27090
|
+
createdAt: Number(row2.created_at),
|
|
27091
|
+
closedAt: row2.closed_at == null ? null : Number(row2.closed_at)
|
|
27092
|
+
}));
|
|
27093
|
+
}, "statRows"),
|
|
27094
|
+
statNames: /* @__PURE__ */ __name(async (kind4, ids, account) => {
|
|
27095
|
+
if (ids.length === 0)
|
|
27096
|
+
return /* @__PURE__ */ new Map();
|
|
27097
|
+
let params = [JSON.stringify(ids.map(Number))];
|
|
27098
|
+
if (kind4 === "chat") {
|
|
27099
|
+
if (account === void 0)
|
|
27100
|
+
return /* @__PURE__ */ new Map();
|
|
27101
|
+
const at = account.indexOf(":");
|
|
27102
|
+
params = [account.slice(0, at), account.slice(at + 1), JSON.stringify(ids)];
|
|
27103
|
+
}
|
|
27104
|
+
const rows = database.prepare(TASK_STATS_SQL[kind4]).all(...params);
|
|
27105
|
+
return new Map(rows.filter((row2) => row2.name != null).map((row2) => [String(row2.id), String(row2.name)]));
|
|
27106
|
+
}, "statNames")
|
|
27107
|
+
}), "taskStatsOver");
|
|
27108
|
+
|
|
27109
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.564.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_0a4d79b5da58b1179a36aa928f36b150/node_modules/@wirecat/cli-core/dist/store/sqlite/tasks.js
|
|
26945
27110
|
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";
|
|
26946
27111
|
var inboxProject = /* @__PURE__ */ __name(({ database, now: now2 }, account, create) => {
|
|
26947
27112
|
const key2 = inboxKey(account);
|
|
@@ -27006,6 +27171,7 @@ var taskStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
27006
27171
|
...workTasksOver(context),
|
|
27007
27172
|
...similarity,
|
|
27008
27173
|
...taskPairsOver(context, similarity),
|
|
27174
|
+
...taskStatsOver(context, (account) => inbox(account, false)),
|
|
27009
27175
|
...taskCloseOver(context),
|
|
27010
27176
|
rowOf: /* @__PURE__ */ __name((id2) => taskRowOf(database, id2), "rowOf"),
|
|
27011
27177
|
categories: /* @__PURE__ */ __name(async () => listOf(), "categories"),
|
|
@@ -27147,7 +27313,7 @@ var oneOf3 = /* @__PURE__ */ __name((values, value, column2) => {
|
|
|
27147
27313
|
throw new CliError("configuration_error", `the store holds a task with an unknown ${column2} "${String(value)}"`);
|
|
27148
27314
|
}, "oneOf");
|
|
27149
27315
|
|
|
27150
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
27316
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.564.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_0a4d79b5da58b1179a36aa928f36b150/node_modules/@wirecat/cli-core/dist/store/accounts.js
|
|
27151
27317
|
var accountAccountsOver = /* @__PURE__ */ __name((context) => {
|
|
27152
27318
|
const { database } = context;
|
|
27153
27319
|
const { accountPk: accountPk2, findAccountPk: findAccountPk2 } = keysOver(context);
|
|
@@ -27192,7 +27358,7 @@ var accountsStoreOver = /* @__PURE__ */ __name((context, keyed) => {
|
|
|
27192
27358
|
};
|
|
27193
27359
|
}, "accountsStoreOver");
|
|
27194
27360
|
|
|
27195
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
27361
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.564.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_0a4d79b5da58b1179a36aa928f36b150/node_modules/@wirecat/cli-core/dist/store/sqlite/attachments.js
|
|
27196
27362
|
var refColumn = /* @__PURE__ */ __name((ref3) => ref3 && Object.keys(ref3).length > 0 ? { providerRef: JSON.stringify(ref3) } : {}, "refColumn");
|
|
27197
27363
|
var updatePlaced = /* @__PURE__ */ __name(({ orm }, chatKey, messageId, files2, change) => {
|
|
27198
27364
|
const message2 = orm.select({ pk: messages.id }).from(messages).where(and(eq(messages.chatId, chatKey), eq(messages.externalId, messageId))).get();
|
|
@@ -27216,7 +27382,7 @@ var keepDownloads = /* @__PURE__ */ __name((context, chatKey, messageId, files2)
|
|
|
27216
27382
|
})), "keepDownloads");
|
|
27217
27383
|
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");
|
|
27218
27384
|
|
|
27219
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
27385
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.564.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_0a4d79b5da58b1179a36aa928f36b150/node_modules/@wirecat/cli-core/dist/store/attachments.js
|
|
27220
27386
|
var accountAttachmentsOver = /* @__PURE__ */ __name((context) => {
|
|
27221
27387
|
const { database } = context;
|
|
27222
27388
|
const { findAccountPk: findAccountPk2, findChatPk: findChatPk2, chatKeyOf } = keysOver(context);
|
|
@@ -27273,7 +27439,7 @@ var attachmentsStoreOver = /* @__PURE__ */ __name((context, keyed) => ({
|
|
|
27273
27439
|
}, "keepAttachmentText")
|
|
27274
27440
|
}), "attachmentsStoreOver");
|
|
27275
27441
|
|
|
27276
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
27442
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.564.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_0a4d79b5da58b1179a36aa928f36b150/node_modules/@wirecat/cli-core/dist/store/sqlite/chat-rekey.js
|
|
27277
27443
|
var chatRow = /* @__PURE__ */ __name((context, accountKey, chatId) => context.database.prepare("SELECT * FROM chats WHERE account_id = ? AND external_id = ?").get(accountKey, chatId), "chatRow");
|
|
27278
27444
|
var pointerMover = /* @__PURE__ */ __name((context, type) => {
|
|
27279
27445
|
const statements = pointerPairs(context.database).filter(({ table }) => table !== "involvements").map(({ table, pointer }) => {
|
|
@@ -27453,7 +27619,7 @@ var rekeyChats = /* @__PURE__ */ __name((context, key2, accountKey, pairs, lockM
|
|
|
27453
27619
|
return done;
|
|
27454
27620
|
}, "rekeyChats");
|
|
27455
27621
|
|
|
27456
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
27622
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.564.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_0a4d79b5da58b1179a36aa928f36b150/node_modules/@wirecat/cli-core/dist/store/sqlite/completeness.js
|
|
27457
27623
|
var historyStartKey = /* @__PURE__ */ __name((chatId) => `history_start:${chatId}`, "historyStartKey");
|
|
27458
27624
|
var fetchedKey = /* @__PURE__ */ __name((chatId) => `fetched:${chatId}`, "fetchedKey");
|
|
27459
27625
|
var CHAT_LIST_KEY = "chat_list_complete";
|
|
@@ -27469,23 +27635,49 @@ var chatCompleteness = /* @__PURE__ */ __name(({ database }, accountKey, chatIds
|
|
|
27469
27635
|
(SELECT s.updated_at FROM sync_cursors s WHERE s.account_id = c.account_id AND s.key = 'fetched:' || c.external_id)
|
|
27470
27636
|
AS fetched
|
|
27471
27637
|
FROM chats c WHERE c.account_id = ? AND c.external_id IN (SELECT value FROM json_each(?))`).all(accountKey, JSON.stringify(chatIds)).map((row2) => {
|
|
27472
|
-
const
|
|
27473
|
-
|
|
27474
|
-
const upToDate = row2.newest === null ? null : row2.held !== null && Number(row2.held) >= Number(row2.newest);
|
|
27475
|
-
const gaps = stretches > 1;
|
|
27476
|
-
const fetched = stretches > 0 || reachesStart;
|
|
27477
|
-
return {
|
|
27478
|
-
chatId: String(row2.chat),
|
|
27479
|
-
state: !fetched ? "unknown" : upToDate !== false && !gaps && reachesStart ? "complete" : "partial",
|
|
27480
|
-
upToDate,
|
|
27481
|
-
gaps,
|
|
27482
|
-
reachesStart,
|
|
27483
|
-
fetchedAt: toIso(row2.fetched)
|
|
27484
|
-
};
|
|
27638
|
+
const facts2 = factsOf(row2);
|
|
27639
|
+
return { chatId: String(row2.chat), ...facts2, fetchedAt: toIso(row2.fetched) };
|
|
27485
27640
|
});
|
|
27486
27641
|
}, "chatCompleteness");
|
|
27642
|
+
var factsOf = /* @__PURE__ */ __name((row2) => {
|
|
27643
|
+
const stretches = Number(row2.stretches);
|
|
27644
|
+
const reachesStart = Number(row2.start) === 1;
|
|
27645
|
+
const upToDate = row2.newest === null ? null : row2.held !== null && Number(row2.held) >= Number(row2.newest);
|
|
27646
|
+
const gaps = stretches > 1;
|
|
27647
|
+
const fetched = stretches > 0 || reachesStart;
|
|
27648
|
+
const state = !fetched ? "unknown" : upToDate !== false && !gaps && reachesStart ? "complete" : "partial";
|
|
27649
|
+
return { state, upToDate, gaps, reachesStart };
|
|
27650
|
+
}, "factsOf");
|
|
27651
|
+
var COVERAGE_SQL = `SELECT c.last_message_at AS newest, c.message_count AS messages,
|
|
27652
|
+
(SELECT m.sent_at FROM messages m WHERE m.chat_id = c.id AND m.deleted_at IS NULL
|
|
27653
|
+
ORDER BY m.sent_at DESC LIMIT 1) AS held,
|
|
27654
|
+
(SELECT m.sent_at FROM messages m WHERE m.chat_id = c.id AND m.deleted_at IS NULL
|
|
27655
|
+
ORDER BY m.sent_at ASC LIMIT 1) AS oldest,
|
|
27656
|
+
(SELECT count(*) FROM sync_ranges r WHERE r.chat_id = c.id) AS stretches,
|
|
27657
|
+
EXISTS (SELECT 1 FROM sync_cursors s WHERE s.account_id = c.account_id AND s.key = 'history_start:' || c.external_id
|
|
27658
|
+
AND NOT EXISTS (SELECT 1 FROM sync_ranges r WHERE r.chat_id = c.id AND r.from_key < CAST(s.value AS INTEGER)))
|
|
27659
|
+
AS start,
|
|
27660
|
+
EXISTS (SELECT 1 FROM sync_cursors s WHERE s.account_id = c.account_id
|
|
27661
|
+
AND s.key IN ('history_start:' || c.external_id, 'fetched:' || c.external_id)) AS recorded
|
|
27662
|
+
FROM chats c WHERE c.account_id = ? AND c.searchable = 1`;
|
|
27663
|
+
var chatCoverage = /* @__PURE__ */ __name(({ database }, accountKey) => {
|
|
27664
|
+
const rows = database.prepare(COVERAGE_SQL).all(accountKey);
|
|
27665
|
+
const coverage = { chats: rows.length, fetched: 0, partial: 0, never: 0, oldestMessageAt: null };
|
|
27666
|
+
let oldest = null;
|
|
27667
|
+
for (const row2 of rows) {
|
|
27668
|
+
if (row2.oldest !== null && (oldest === null || Number(row2.oldest) < oldest))
|
|
27669
|
+
oldest = Number(row2.oldest);
|
|
27670
|
+
if (factsOf(row2).state === "complete")
|
|
27671
|
+
coverage.fetched += 1;
|
|
27672
|
+
else if (Number(row2.stretches) === 0 && Number(row2.recorded) === 0 && Number(row2.messages) === 0)
|
|
27673
|
+
coverage.never += 1;
|
|
27674
|
+
else
|
|
27675
|
+
coverage.partial += 1;
|
|
27676
|
+
}
|
|
27677
|
+
return { ...coverage, oldestMessageAt: toIso(oldest) };
|
|
27678
|
+
}, "chatCoverage");
|
|
27487
27679
|
|
|
27488
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
27680
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.564.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_0a4d79b5da58b1179a36aa928f36b150/node_modules/@wirecat/cli-core/dist/store/chats.js
|
|
27489
27681
|
var chatsStoreOver = /* @__PURE__ */ __name((context) => {
|
|
27490
27682
|
const { database } = context;
|
|
27491
27683
|
const { accountPk: accountPk2, findAccountPk: findAccountPk2, writeState: writeState2 } = keysOver(context);
|
|
@@ -27554,6 +27746,10 @@ var chatsStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
27554
27746
|
const accountKey = findAccountPk2(key2);
|
|
27555
27747
|
return accountKey === void 0 ? [] : chatCompleteness(context, accountKey, chatIds);
|
|
27556
27748
|
}, "chatCompleteness"),
|
|
27749
|
+
chatCoverage: /* @__PURE__ */ __name(async (key2) => {
|
|
27750
|
+
const accountKey = findAccountPk2(key2);
|
|
27751
|
+
return accountKey === void 0 ? { chats: 0, fetched: 0, partial: 0, never: 0, oldestMessageAt: null } : chatCoverage(context, accountKey);
|
|
27752
|
+
}, "chatCoverage"),
|
|
27557
27753
|
chatStats: /* @__PURE__ */ __name(async (key2, chatId) => {
|
|
27558
27754
|
const accountKey = findAccountPk2(key2);
|
|
27559
27755
|
return accountKey === void 0 ? [] : chatStats(context, accountKey, chatId);
|
|
@@ -27616,7 +27812,7 @@ var chatsStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
27616
27812
|
};
|
|
27617
27813
|
}, "chatsStoreOver");
|
|
27618
27814
|
|
|
27619
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
27815
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.564.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_0a4d79b5da58b1179a36aa928f36b150/node_modules/@wirecat/cli-core/dist/store/sqlite/batches.js
|
|
27620
27816
|
import { createHash as createHash7 } from "node:crypto";
|
|
27621
27817
|
var BATCH_CONTEXT = 50;
|
|
27622
27818
|
var replied = /* @__PURE__ */ __name((m) => sql`EXISTS (SELECT 1 FROM messages p WHERE p.chat_id = ${m}.chat_id
|
|
@@ -27754,7 +27950,7 @@ var saveAnswers = /* @__PURE__ */ __name((context, id2, answer) => {
|
|
|
27754
27950
|
var clearAnswers = /* @__PURE__ */ __name(({ orm }, chatKey, model) => Number(orm.all(sql`DELETE FROM message_links WHERE chat_id = ${chatKey} AND source = 'agent'
|
|
27755
27951
|
${model === void 0 ? sql`` : sql`AND method = ${model}`} RETURNING 1 AS n`).length), "clearAnswers");
|
|
27756
27952
|
|
|
27757
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
27953
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.564.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_0a4d79b5da58b1179a36aa928f36b150/node_modules/@wirecat/cli-core/dist/store/sqlite/conversations.js
|
|
27758
27954
|
import { setTimeout } from "node:timers/promises";
|
|
27759
27955
|
var position = /* @__PURE__ */ __name((sentAt, pk) => `${sentAt}:${pk}`, "position");
|
|
27760
27956
|
var linkInputs = /* @__PURE__ */ __name(({ orm }, chatKey, { after: after2, limit }) => {
|
|
@@ -28066,7 +28262,7 @@ var agentAnswers = /* @__PURE__ */ __name(({ orm }, chatKey) => new Map(orm.all(
|
|
|
28066
28262
|
AND NOT EXISTS (SELECT 1 FROM messages d
|
|
28067
28263
|
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");
|
|
28068
28264
|
|
|
28069
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
28265
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.564.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_0a4d79b5da58b1179a36aa928f36b150/node_modules/@wirecat/cli-core/dist/store/conversations.js
|
|
28070
28266
|
var conversationsStoreOver = /* @__PURE__ */ __name((context) => {
|
|
28071
28267
|
const { database } = context;
|
|
28072
28268
|
const { findAccountPk: findAccountPk2, findChatPk: findChatPk2, chatKeyOf } = keysOver(context);
|
|
@@ -28173,7 +28369,7 @@ var conversationsStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
28173
28369
|
};
|
|
28174
28370
|
}, "conversationsStoreOver");
|
|
28175
28371
|
|
|
28176
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
28372
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.564.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_0a4d79b5da58b1179a36aa928f36b150/node_modules/@wirecat/cli-core/dist/store/counters.js
|
|
28177
28373
|
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";
|
|
28178
28374
|
var accountCountersOver = /* @__PURE__ */ __name((context) => {
|
|
28179
28375
|
const { database } = context;
|
|
@@ -28198,7 +28394,7 @@ var countersStoreOver = /* @__PURE__ */ __name((context, keyed) => ({
|
|
|
28198
28394
|
counterTargets: /* @__PURE__ */ __name(async (execution, options) => counterTargets(context, execution, options), "counterTargets")
|
|
28199
28395
|
}), "countersStoreOver");
|
|
28200
28396
|
|
|
28201
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
28397
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.564.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_0a4d79b5da58b1179a36aa928f36b150/node_modules/@wirecat/cli-core/dist/store/sqlite/mentions.js
|
|
28202
28398
|
var MENTION_STATUSES = ["found", "linked", "dismissed"];
|
|
28203
28399
|
var MENTION_QUERY = defineQuery({
|
|
28204
28400
|
entity: "mention",
|
|
@@ -28414,7 +28610,7 @@ var listPlaces = /* @__PURE__ */ __name((database, { limit, offset }) => {
|
|
|
28414
28610
|
return { items: hasMore ? rows.slice(0, limit) : rows, hasMore };
|
|
28415
28611
|
}, "listPlaces");
|
|
28416
28612
|
|
|
28417
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
28613
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.564.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_0a4d79b5da58b1179a36aa928f36b150/node_modules/@wirecat/cli-core/dist/store/mentions.js
|
|
28418
28614
|
var accountMentionsOver = /* @__PURE__ */ __name((context) => {
|
|
28419
28615
|
const { database } = context;
|
|
28420
28616
|
const { findAccountPk: findAccountPk2 } = keysOver(context);
|
|
@@ -28449,7 +28645,7 @@ var mentionsStoreOver = /* @__PURE__ */ __name((context, keyed) => ({
|
|
|
28449
28645
|
places: /* @__PURE__ */ __name(async (window) => listPlaces(context.database, window), "places")
|
|
28450
28646
|
}), "mentionsStoreOver");
|
|
28451
28647
|
|
|
28452
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
28648
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.564.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_0a4d79b5da58b1179a36aa928f36b150/node_modules/@wirecat/cli-core/dist/store/sqlite/document-links.js
|
|
28453
28649
|
var documentLinkMessages = /* @__PURE__ */ __name(({ database }, chatKey, messageId) => {
|
|
28454
28650
|
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");
|
|
28455
28651
|
const rows = messageId === void 0 ? read2.all(chatKey) : read2.all(chatKey, messageId);
|
|
@@ -28464,7 +28660,7 @@ var documentLinkMessages = /* @__PURE__ */ __name(({ database }, chatKey, messag
|
|
|
28464
28660
|
}));
|
|
28465
28661
|
}, "documentLinkMessages");
|
|
28466
28662
|
|
|
28467
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
28663
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.564.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_0a4d79b5da58b1179a36aa928f36b150/node_modules/@wirecat/cli-core/dist/store/sqlite/follow-ups.js
|
|
28468
28664
|
var stemmerFor = stemmerCache();
|
|
28469
28665
|
var laterSharingRare = /* @__PURE__ */ __name((context, wanted, { rareAt, limit }) => {
|
|
28470
28666
|
if (wanted.length > 50 || !Number.isInteger(limit) || limit < 1 || limit > 100)
|
|
@@ -28508,7 +28704,7 @@ var laterSharingRare = /* @__PURE__ */ __name((context, wanted, { rareAt, limit
|
|
|
28508
28704
|
});
|
|
28509
28705
|
}, "laterSharingRare");
|
|
28510
28706
|
|
|
28511
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
28707
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.564.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_0a4d79b5da58b1179a36aa928f36b150/node_modules/@wirecat/cli-core/dist/store/messages.js
|
|
28512
28708
|
var accountMessagesOver = /* @__PURE__ */ __name((context) => {
|
|
28513
28709
|
const { database } = context;
|
|
28514
28710
|
const { accountPk: accountPk2, findAccountPk: findAccountPk2, findChatPk: findChatPk2, chatKeyOf, chatPkFor: chatPkFor2, answeredChatPk: answeredChatPk2, upsertMessage: upsertMessage2 } = keysOver(context);
|
|
@@ -28643,7 +28839,7 @@ var messagesStoreOver = /* @__PURE__ */ __name((context, keyed) => ({
|
|
|
28643
28839
|
laterSharingRare: /* @__PURE__ */ __name(async (wanted, options) => laterSharingRare(context, wanted, options), "laterSharingRare")
|
|
28644
28840
|
}), "messagesStoreOver");
|
|
28645
28841
|
|
|
28646
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
28842
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.564.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_0a4d79b5da58b1179a36aa928f36b150/node_modules/@wirecat/cli-core/dist/store/sqlite/person-preparation.js
|
|
28647
28843
|
var GLOBAL_PROJECT = "SELECT id FROM main.projects WHERE account_id IS NULL AND deleted_at IS NULL";
|
|
28648
28844
|
var iso5 = /* @__PURE__ */ __name((value) => value == null ? null : new Date(Number(value)).toISOString(), "iso");
|
|
28649
28845
|
var personPreparation = /* @__PURE__ */ __name(({ database }, uid, { accounts: accounts2, limit }) => {
|
|
@@ -28700,7 +28896,7 @@ var personPreparation = /* @__PURE__ */ __name(({ database }, uid, { accounts: a
|
|
|
28700
28896
|
});
|
|
28701
28897
|
}, "personPreparation");
|
|
28702
28898
|
|
|
28703
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
28899
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.564.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_0a4d79b5da58b1179a36aa928f36b150/node_modules/@wirecat/cli-core/dist/store/sqlite/person-scope.js
|
|
28704
28900
|
var personSeenInAccounts = /* @__PURE__ */ __name(({ database }, uid, accountIds) => {
|
|
28705
28901
|
const id2 = Number(uid);
|
|
28706
28902
|
if (!/^[1-9]\d*$/.test(uid) || !Number.isSafeInteger(id2) || !accountIds.length || accountIds.length > 1e3 || accountIds.some((account) => !Number.isSafeInteger(account) || account <= 0))
|
|
@@ -28708,7 +28904,7 @@ var personSeenInAccounts = /* @__PURE__ */ __name(({ database }, uid, accountIds
|
|
|
28708
28904
|
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)));
|
|
28709
28905
|
}, "personSeenInAccounts");
|
|
28710
28906
|
|
|
28711
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
28907
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.564.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_0a4d79b5da58b1179a36aa928f36b150/node_modules/@wirecat/cli-core/dist/store/sqlite/private-people.js
|
|
28712
28908
|
var required2 = /* @__PURE__ */ __name(({ database }, key2, personId) => {
|
|
28713
28909
|
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);
|
|
28714
28910
|
if (!row2)
|
|
@@ -28774,7 +28970,7 @@ var removeNote = /* @__PURE__ */ __name((context, key2, personId, id2) => {
|
|
|
28774
28970
|
return { id: id2, personId, removed: true };
|
|
28775
28971
|
}, "removeNote");
|
|
28776
28972
|
|
|
28777
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
28973
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.564.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_0a4d79b5da58b1179a36aa928f36b150/node_modules/@wirecat/cli-core/dist/store/people.js
|
|
28778
28974
|
var accountPeopleOver = /* @__PURE__ */ __name((context) => {
|
|
28779
28975
|
const { database } = context;
|
|
28780
28976
|
const { accountPk: accountPk2, findAccountPk: findAccountPk2, identityPk: identityPk2 } = keysOver(context);
|
|
@@ -28859,13 +29055,13 @@ var peopleStoreOver = /* @__PURE__ */ __name((context, keyed) => {
|
|
|
28859
29055
|
};
|
|
28860
29056
|
}, "peopleStoreOver");
|
|
28861
29057
|
|
|
28862
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
29058
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.564.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_0a4d79b5da58b1179a36aa928f36b150/node_modules/@wirecat/cli-core/dist/store/sqlite/admin-statistics.js
|
|
28863
29059
|
import { createHash as createHash9 } from "node:crypto";
|
|
28864
29060
|
|
|
28865
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
29061
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.564.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_0a4d79b5da58b1179a36aa928f36b150/node_modules/@wirecat/cli-core/dist/domain/admin-statistics.js
|
|
28866
29062
|
import { createHash as createHash8 } from "node:crypto";
|
|
28867
29063
|
|
|
28868
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
29064
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.564.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_0a4d79b5da58b1179a36aa928f36b150/node_modules/@wirecat/cli-core/dist/domain/rankings-options.js
|
|
28869
29065
|
var MESSAGE_MEASURES = ["views", "reactions", "forwards", "comments", "replies", "thread-size"];
|
|
28870
29066
|
var AUTHOR_MEASURES = [
|
|
28871
29067
|
"messages",
|
|
@@ -29005,7 +29201,7 @@ var withoutUrls = /* @__PURE__ */ __name((text6) => text6.replace(/\S+/gu, (toke
|
|
|
29005
29201
|
var rankingWords = /* @__PURE__ */ __name((text6) => withoutUrls(text6).match(/[\p{L}\p{N}]+/gu)?.length ?? 0, "rankingWords");
|
|
29006
29202
|
var rankingQuestion = /* @__PURE__ */ __name((text6) => withoutUrls(text6).includes("?"), "rankingQuestion");
|
|
29007
29203
|
|
|
29008
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
29204
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.564.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_0a4d79b5da58b1179a36aa928f36b150/node_modules/@wirecat/cli-core/dist/domain/rankings-graph.js
|
|
29009
29205
|
var RANKING_GRAPH_LIMITS = { nodes: 5e4, depth: 256, work: 1e7, bytes: 8388608 };
|
|
29010
29206
|
var exhausted2 = /* @__PURE__ */ __name((budget) => {
|
|
29011
29207
|
throw new CliError("validation_error", `ranking exceeded ${budget} \u2014 narrow its chat or date scope`, {
|
|
@@ -29227,18 +29423,18 @@ var rankReplyGraph = /* @__PURE__ */ __name((nodes, check3 = () => {
|
|
|
29227
29423
|
};
|
|
29228
29424
|
}, "rankReplyGraph");
|
|
29229
29425
|
|
|
29230
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
29426
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.564.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_0a4d79b5da58b1179a36aa928f36b150/node_modules/@wirecat/cli-core/dist/domain/admin-statistics.js
|
|
29231
29427
|
var adminEntityKey = /* @__PURE__ */ __name((row2) => JSON.stringify([row2.account.provider, row2.account.account, row2.id]), "adminEntityKey");
|
|
29232
29428
|
var personKey = /* @__PURE__ */ __name((node) => JSON.stringify([node.account.provider, node.account.account, node.sender]), "personKey");
|
|
29233
29429
|
var locator = /* @__PURE__ */ __name((node) => formatLocator({ ...node.account, chat: node.chatId, message: node.id }), "locator");
|
|
29234
|
-
var
|
|
29430
|
+
var delayStats = /* @__PURE__ */ __name((delays) => {
|
|
29235
29431
|
const sorted2 = delays.toSorted((a, b) => a - b);
|
|
29236
29432
|
const middle = Math.floor(sorted2.length / 2);
|
|
29237
29433
|
return {
|
|
29238
29434
|
medianMilliseconds: sorted2.length ? sorted2.length % 2 ? sorted2[middle] : (sorted2[middle - 1] + sorted2[middle]) / 2 : null,
|
|
29239
29435
|
p90Milliseconds: sorted2.length ? sorted2[Math.ceil(sorted2.length * 0.9) - 1] : null
|
|
29240
29436
|
};
|
|
29241
|
-
}, "
|
|
29437
|
+
}, "delayStats");
|
|
29242
29438
|
var calculateAdminStatistics = /* @__PURE__ */ __name((nodes, stays, options, inspect) => {
|
|
29243
29439
|
let work = 0;
|
|
29244
29440
|
const check3 = /* @__PURE__ */ __name(() => {
|
|
@@ -29316,7 +29512,7 @@ var calculateAdminStatistics = /* @__PURE__ */ __name((nodes, stays, options, in
|
|
|
29316
29512
|
account: { provider: person2.provider, account: person2.account },
|
|
29317
29513
|
questions: eligible.filter((node) => node.account.provider === person2.provider && node.account.account === person2.account).length,
|
|
29318
29514
|
answered: rows.length,
|
|
29319
|
-
...
|
|
29515
|
+
...delayStats(rows.map((row2) => row2.contribution)),
|
|
29320
29516
|
status: "observed"
|
|
29321
29517
|
}, rows);
|
|
29322
29518
|
}
|
|
@@ -29361,7 +29557,7 @@ var calculateAdminStatistics = /* @__PURE__ */ __name((nodes, stays, options, in
|
|
|
29361
29557
|
pending: end > options.cutoff,
|
|
29362
29558
|
questions: held.length,
|
|
29363
29559
|
answered: delays.length,
|
|
29364
|
-
...
|
|
29560
|
+
...delayStats(delays),
|
|
29365
29561
|
status: "partial"
|
|
29366
29562
|
}, contributions);
|
|
29367
29563
|
}
|
|
@@ -29401,7 +29597,7 @@ var calculateAdminStatistics = /* @__PURE__ */ __name((nodes, stays, options, in
|
|
|
29401
29597
|
return { items, evidence, summary, graph: graph.quality };
|
|
29402
29598
|
}, "calculateAdminStatistics");
|
|
29403
29599
|
|
|
29404
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
29600
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.564.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_0a4d79b5da58b1179a36aa928f36b150/node_modules/@wirecat/cli-core/dist/domain/rankings-range.js
|
|
29405
29601
|
var rankingContextRange = /* @__PURE__ */ __name((root) => {
|
|
29406
29602
|
const dates = [];
|
|
29407
29603
|
const visit = /* @__PURE__ */ __name((node, required3) => {
|
|
@@ -29423,7 +29619,7 @@ var rankingContextRange = /* @__PURE__ */ __name((root) => {
|
|
|
29423
29619
|
return dates[0].node.resolution.date;
|
|
29424
29620
|
}, "rankingContextRange");
|
|
29425
29621
|
|
|
29426
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
29622
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.564.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_0a4d79b5da58b1179a36aa928f36b150/node_modules/@wirecat/cli-core/dist/store/sqlite/rankings.js
|
|
29427
29623
|
var reactionCounts = /* @__PURE__ */ __name((stored3) => {
|
|
29428
29624
|
let counts;
|
|
29429
29625
|
try {
|
|
@@ -29718,7 +29914,7 @@ var rankQuery = /* @__PURE__ */ __name((context, execution, request, inspect) =>
|
|
|
29718
29914
|
});
|
|
29719
29915
|
}, "rankQuery");
|
|
29720
29916
|
|
|
29721
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
29917
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.564.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_0a4d79b5da58b1179a36aa928f36b150/node_modules/@wirecat/cli-core/dist/store/sqlite/admin-statistics.js
|
|
29722
29918
|
function fail4(message2, reason = "query.too-large") {
|
|
29723
29919
|
throw new CliError("validation_error", message2, { reason, complete: false });
|
|
29724
29920
|
}
|
|
@@ -29895,7 +30091,7 @@ var adminStatisticsQuery = /* @__PURE__ */ __name((context, execution, request)
|
|
|
29895
30091
|
return result;
|
|
29896
30092
|
}), "adminStatisticsQuery");
|
|
29897
30093
|
|
|
29898
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
30094
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.564.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_0a4d79b5da58b1179a36aa928f36b150/node_modules/@wirecat/cli-core/dist/store/sqlite/conversation-eligibility.js
|
|
29899
30095
|
var conversationEligibility = /* @__PURE__ */ __name(async (context, execution) => {
|
|
29900
30096
|
if (!execution.accounts.length)
|
|
29901
30097
|
return { conversations: [], chats: [] };
|
|
@@ -29913,7 +30109,7 @@ var conversationEligibility = /* @__PURE__ */ __name(async (context, execution)
|
|
|
29913
30109
|
return { conversations: conversations2, chats: chats2 };
|
|
29914
30110
|
}, "conversationEligibility");
|
|
29915
30111
|
|
|
29916
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
30112
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.564.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_0a4d79b5da58b1179a36aa928f36b150/node_modules/@wirecat/cli-core/dist/store/sqlite/ranking-evidence.js
|
|
29917
30113
|
import { createHash as createHash10 } from "node:crypto";
|
|
29918
30114
|
var EVIDENCE_BYTES = 64 * 1024;
|
|
29919
30115
|
var FINGERPRINT_BYTES = 8 * 1024 * 1024;
|
|
@@ -30063,7 +30259,101 @@ var rankingEvidence = /* @__PURE__ */ __name((context, execution, request) => {
|
|
|
30063
30259
|
return result;
|
|
30064
30260
|
}, "rankingEvidence");
|
|
30065
30261
|
|
|
30066
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
30262
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.564.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_0a4d79b5da58b1179a36aa928f36b150/node_modules/@wirecat/cli-core/dist/store/sqlite/reply-times.js
|
|
30263
|
+
var FAR = Number.MAX_SAFE_INTEGER;
|
|
30264
|
+
var chatsIn = /* @__PURE__ */ __name((scope3, kinds2) => {
|
|
30265
|
+
const params = [...scope3.accounts.flatMap(({ provider, account }) => [provider, account]), ...kinds2];
|
|
30266
|
+
const parts2 = [
|
|
30267
|
+
`(${scope3.accounts.map(() => "(ac.provider=? AND ac.external_id=?)").join(" OR ") || "0"})`,
|
|
30268
|
+
`${PEER_KIND} IN (${kinds2.map(() => "?").join(",")})`
|
|
30269
|
+
];
|
|
30270
|
+
for (const { account, chatId } of scope3.chats) {
|
|
30271
|
+
parts2.push("ac.provider=? AND ac.external_id=? AND c.external_id=?");
|
|
30272
|
+
params.push(account.provider, account.account, chatId);
|
|
30273
|
+
}
|
|
30274
|
+
for (const kind4 of scope3.kinds) {
|
|
30275
|
+
parts2.push(`${PEER_KIND}=?`);
|
|
30276
|
+
params.push(kind4);
|
|
30277
|
+
}
|
|
30278
|
+
if (scope3.chats.length === 0)
|
|
30279
|
+
parts2.push("c.searchable=1");
|
|
30280
|
+
return { sql: parts2.join(" AND "), params };
|
|
30281
|
+
}, "chatsIn");
|
|
30282
|
+
var replyDelaysQuery = /* @__PURE__ */ __name((scope3, who) => {
|
|
30283
|
+
const since = scope3.since ?? -FAR;
|
|
30284
|
+
const until = scope3.until ?? FAR;
|
|
30285
|
+
const chats2 = chatsIn(scope3, ["private"]);
|
|
30286
|
+
return {
|
|
30287
|
+
sql: `WITH scoped AS MATERIALIZED (
|
|
30288
|
+
SELECT c.id AS chat_id, coalesce((
|
|
30289
|
+
SELECT p.sent_at FROM messages p WHERE p.chat_id=c.id AND p.sent_at<? AND p.deleted_at IS NULL
|
|
30290
|
+
AND coalesce(p.outgoing,0)<>(SELECT coalesce(l.outgoing,0) FROM messages l
|
|
30291
|
+
WHERE l.chat_id=c.id AND l.sent_at<? AND l.deleted_at IS NULL ORDER BY l.sent_at DESC LIMIT 1)
|
|
30292
|
+
ORDER BY p.sent_at DESC LIMIT 1), ?) AS since
|
|
30293
|
+
FROM chats c JOIN accounts ac ON ac.id=c.account_id WHERE ${chats2.sql}
|
|
30294
|
+
), sides AS (
|
|
30295
|
+
SELECT m.chat_id, m.id, m.sent_at, coalesce(m.outgoing,0) AS mine,
|
|
30296
|
+
lag(coalesce(m.outgoing,0)) OVER (PARTITION BY m.chat_id ORDER BY m.sent_at, m.id) AS before
|
|
30297
|
+
FROM scoped s JOIN messages m ON m.chat_id=s.chat_id AND m.sent_at>=s.since AND m.sent_at<=?
|
|
30298
|
+
WHERE m.deleted_at IS NULL
|
|
30299
|
+
), runs AS (
|
|
30300
|
+
SELECT sent_at, mine, lag(sent_at) OVER (PARTITION BY chat_id ORDER BY sent_at, id) AS asked_at
|
|
30301
|
+
FROM sides WHERE before IS NULL OR before<>mine
|
|
30302
|
+
)
|
|
30303
|
+
SELECT sent_at AS replied_at, sent_at-asked_at AS delay_ms FROM runs
|
|
30304
|
+
WHERE asked_at IS NOT NULL AND mine=? AND sent_at>=? AND sent_at<=?`,
|
|
30305
|
+
params: [since, since, -FAR, ...chats2.params, until, who === "me" ? 1 : 0, since, until]
|
|
30306
|
+
};
|
|
30307
|
+
}, "replyDelaysQuery");
|
|
30308
|
+
var replyDelays = /* @__PURE__ */ __name((context, scope3, who) => {
|
|
30309
|
+
const { sql: sql2, params } = replyDelaysQuery(scope3, who);
|
|
30310
|
+
return read(context.database, () => context.database.prepare(sql2).all(...params).map((row2) => ({ repliedAt: Number(row2.replied_at), delayMs: Number(row2.delay_ms) })));
|
|
30311
|
+
}, "replyDelays");
|
|
30312
|
+
var newestMessagesQuery = /* @__PURE__ */ __name((scope3, now2) => {
|
|
30313
|
+
const chats2 = chatsIn(scope3, ["private", "group"]);
|
|
30314
|
+
return {
|
|
30315
|
+
sql: `SELECT c.id AS chat_id, ${PEER_KIND} AS kind, m.sent_at, coalesce(m.outgoing,0) AS mine, m.text,
|
|
30316
|
+
(EXISTS (SELECT 1 FROM json_each(CASE WHEN json_valid(m.mentions) THEN m.mentions ELSE '[]' END) WHERE value=ac.external_id)
|
|
30317
|
+
OR coalesce(json_extract(CASE WHEN json_valid(m.reply_to) THEN m.reply_to ELSE '{}' END,'$.outgoing'),0)=1
|
|
30318
|
+
OR EXISTS (SELECT 1 FROM messages q WHERE q.chat_id=c.id AND q.external_id=m.reply_to_external_id AND q.outgoing=1)
|
|
30319
|
+
) AS addressed,
|
|
30320
|
+
(SELECT i.username FROM identities i WHERE i.provider=ac.provider AND i.external_id=ac.external_id) AS owner_username,
|
|
30321
|
+
((coalesce(c.muted,0)=1 AND (c.muted_until IS NULL OR c.muted_until>?)) OR coalesce(c.archived,0)=1)
|
|
30322
|
+
AND coalesce(c.marked_unread,0)=0 AS quiet
|
|
30323
|
+
FROM chats c JOIN accounts ac ON ac.id=c.account_id
|
|
30324
|
+
JOIN messages m ON m.id=(SELECT n.id FROM messages n WHERE n.chat_id=c.id AND n.deleted_at IS NULL ORDER BY n.sent_at DESC LIMIT 1)
|
|
30325
|
+
WHERE ${chats2.sql} AND m.sent_at>=? AND m.sent_at<=?`,
|
|
30326
|
+
params: [now2, ...chats2.params, scope3.since ?? -FAR, scope3.until ?? FAR]
|
|
30327
|
+
};
|
|
30328
|
+
}, "newestMessagesQuery");
|
|
30329
|
+
var TAIL_SQL = "SELECT sent_at, coalesce(outgoing,0) AS mine FROM messages WHERE chat_id=? AND deleted_at IS NULL ORDER BY sent_at DESC LIMIT ?";
|
|
30330
|
+
var waitingChats = /* @__PURE__ */ __name((context, scope3, waits, cap) => {
|
|
30331
|
+
const { sql: sql2, params } = newestMessagesQuery(scope3, context.now());
|
|
30332
|
+
const { database } = context;
|
|
30333
|
+
return read(database, () => {
|
|
30334
|
+
const tail = database.prepare(TAIL_SQL);
|
|
30335
|
+
return database.prepare(sql2).all(...params).map((row2) => ({
|
|
30336
|
+
chatId: Number(row2.chat_id),
|
|
30337
|
+
kind: String(row2.kind),
|
|
30338
|
+
sentAt: Number(row2.sent_at),
|
|
30339
|
+
mine: Number(row2.mine) === 1,
|
|
30340
|
+
text: String(row2.text),
|
|
30341
|
+
addressed: Number(row2.addressed) === 1,
|
|
30342
|
+
ownerUsername: row2.owner_username === null ? null : String(row2.owner_username),
|
|
30343
|
+
quiet: Number(row2.quiet) === 1
|
|
30344
|
+
})).filter(waits).map(({ chatId, kind: kind4 }) => {
|
|
30345
|
+
const unanswered = [];
|
|
30346
|
+
for (const row2 of tail.all(chatId, cap)) {
|
|
30347
|
+
if (Number(row2.mine) === 1)
|
|
30348
|
+
break;
|
|
30349
|
+
unanswered.push(Number(row2.sent_at));
|
|
30350
|
+
}
|
|
30351
|
+
return { kind: kind4, unanswered };
|
|
30352
|
+
});
|
|
30353
|
+
});
|
|
30354
|
+
}, "waitingChats");
|
|
30355
|
+
|
|
30356
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.564.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_0a4d79b5da58b1179a36aa928f36b150/node_modules/@wirecat/cli-core/dist/store/queries.js
|
|
30067
30357
|
var queriesStoreOver = /* @__PURE__ */ __name((context, stemmerFor2) => {
|
|
30068
30358
|
const mailIndexed = /* @__PURE__ */ __name((execution) => {
|
|
30069
30359
|
if (execution.corpus === "mail")
|
|
@@ -30078,11 +30368,13 @@ var queriesStoreOver = /* @__PURE__ */ __name((context, stemmerFor2) => {
|
|
|
30078
30368
|
conversationEligibility: /* @__PURE__ */ __name(async (execution) => conversationEligibility(context, execution), "conversationEligibility"),
|
|
30079
30369
|
rankQuery: /* @__PURE__ */ __name(async (execution, request) => rankQuery(context, execution, request), "rankQuery"),
|
|
30080
30370
|
rankingEvidence: /* @__PURE__ */ __name(async (execution, request) => rankingEvidence(context, execution, request), "rankingEvidence"),
|
|
30081
|
-
adminStatisticsQuery: /* @__PURE__ */ __name(async (execution, request) => adminStatisticsQuery(context, execution, request), "adminStatisticsQuery")
|
|
30371
|
+
adminStatisticsQuery: /* @__PURE__ */ __name(async (execution, request) => adminStatisticsQuery(context, execution, request), "adminStatisticsQuery"),
|
|
30372
|
+
replyDelays: /* @__PURE__ */ __name(async (scope3, who) => replyDelays(context, scope3, who), "replyDelays"),
|
|
30373
|
+
waitingChats: /* @__PURE__ */ __name(async (scope3, waits, cap) => waitingChats(context, scope3, waits, cap), "waitingChats")
|
|
30082
30374
|
};
|
|
30083
30375
|
}, "queriesStoreOver");
|
|
30084
30376
|
|
|
30085
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
30377
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.564.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_0a4d79b5da58b1179a36aa928f36b150/node_modules/@wirecat/cli-core/dist/store/sqlite/chat-events.js
|
|
30086
30378
|
var saveChatEvents = /* @__PURE__ */ __name((context, accountKey, provider, chatKey, events3) => {
|
|
30087
30379
|
const { database, now: now2 } = context;
|
|
30088
30380
|
const insert = database.prepare(`INSERT INTO chat_events (chat_id, source_id, action, actor_identity_id, title, happened_at, created_at, updated_at)
|
|
@@ -30121,10 +30413,10 @@ var chatEventsOf = /* @__PURE__ */ __name(({ database }, chatKey, { since = 0, l
|
|
|
30121
30413
|
}));
|
|
30122
30414
|
}, "chatEventsOf");
|
|
30123
30415
|
|
|
30124
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
30416
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.564.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_0a4d79b5da58b1179a36aa928f36b150/node_modules/@wirecat/cli-core/dist/store/sqlite/retention.js
|
|
30125
30417
|
import { createHash as createHash11 } from "node:crypto";
|
|
30126
30418
|
|
|
30127
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
30419
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.564.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_0a4d79b5da58b1179a36aa928f36b150/node_modules/@wirecat/cli-core/dist/domain/calendar.js
|
|
30128
30420
|
var calendarKey = /* @__PURE__ */ __name((zone, by) => {
|
|
30129
30421
|
const format = new Intl.DateTimeFormat("en-CA", {
|
|
30130
30422
|
timeZone: zone,
|
|
@@ -30138,8 +30430,13 @@ var calendarKey = /* @__PURE__ */ __name((zone, by) => {
|
|
|
30138
30430
|
return `${part.year}-${part.month}-${part.day}${by === "hour" ? `T${part.hour}` : ""}`;
|
|
30139
30431
|
};
|
|
30140
30432
|
}, "calendarKey");
|
|
30433
|
+
var weekKey = /* @__PURE__ */ __name((day) => {
|
|
30434
|
+
const date3 = /* @__PURE__ */ new Date(`${day}T00:00:00Z`);
|
|
30435
|
+
date3.setUTCDate(date3.getUTCDate() - (date3.getUTCDay() + 6) % 7);
|
|
30436
|
+
return date3.toISOString().slice(0, 10);
|
|
30437
|
+
}, "weekKey");
|
|
30141
30438
|
|
|
30142
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
30439
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.564.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_0a4d79b5da58b1179a36aa928f36b150/node_modules/@wirecat/cli-core/dist/domain/retention.js
|
|
30143
30440
|
var RETENTION_TOLERANCE = 864e5;
|
|
30144
30441
|
var validateRetentionOptions = /* @__PURE__ */ __name((options) => {
|
|
30145
30442
|
const { since, until, cutoff, checkpoints, within, limit, by } = options;
|
|
@@ -30193,13 +30490,8 @@ var retentionCohorts = /* @__PURE__ */ __name((stays, options) => {
|
|
|
30193
30490
|
return [...groups.values()].sort((a, b) => a.cohort.localeCompare(b.cohort));
|
|
30194
30491
|
}, "retentionCohorts");
|
|
30195
30492
|
|
|
30196
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
30493
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.564.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_0a4d79b5da58b1179a36aa928f36b150/node_modules/@wirecat/cli-core/dist/store/sqlite/retention.js
|
|
30197
30494
|
var iso6 = /* @__PURE__ */ __name((at) => new Date(at).toISOString(), "iso");
|
|
30198
|
-
var week = /* @__PURE__ */ __name((day) => {
|
|
30199
|
-
const date3 = /* @__PURE__ */ new Date(`${day}T00:00:00Z`);
|
|
30200
|
-
date3.setUTCDate(date3.getUTCDate() - (date3.getUTCDay() + 6) % 7);
|
|
30201
|
-
return date3.toISOString().slice(0, 10);
|
|
30202
|
-
}, "week");
|
|
30203
30495
|
var retentionQuery = /* @__PURE__ */ __name((context, accountPk2, chatPk, chatId, options, evidence) => {
|
|
30204
30496
|
validateRetentionOptions(options);
|
|
30205
30497
|
if (options.cutoff > context.now())
|
|
@@ -30220,7 +30512,7 @@ var retentionQuery = /* @__PURE__ */ __name((context, accountPk2, chatPk, chatId
|
|
|
30220
30512
|
const activityStatement = database.prepare(`SELECT min(sent_at) AS at FROM messages WHERE chat_id=? AND sender_identity_id=? AND deleted_at IS NULL AND sent_at >= ? AND sent_at < ?`);
|
|
30221
30513
|
const stays = raw.map((row2) => {
|
|
30222
30514
|
const joinedAt = Number(row2.joined_at), pk = Number(row2.pk), end = joinedAt + options.within;
|
|
30223
|
-
const day = dayOf2(joinedAt), cohort = options.by === "week" ?
|
|
30515
|
+
const day = dayOf2(joinedAt), cohort = options.by === "week" ? weekKey(day) : day;
|
|
30224
30516
|
const absence = departureStatement.get(chatPk, Math.max(joinedAt, Number(row2.first_seen_at)), options.cutoff, pk);
|
|
30225
30517
|
const upper = absence ? Number(absence.observed_at) : null;
|
|
30226
30518
|
const positive2 = lastPositiveStatement.get(pk, upper ?? options.cutoff + 1);
|
|
@@ -30329,7 +30621,7 @@ var retentionQuery = /* @__PURE__ */ __name((context, accountPk2, chatPk, chatId
|
|
|
30329
30621
|
};
|
|
30330
30622
|
}, "retentionQuery");
|
|
30331
30623
|
|
|
30332
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
30624
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.564.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_0a4d79b5da58b1179a36aa928f36b150/node_modules/@wirecat/cli-core/dist/store/sqlite/roster.js
|
|
30333
30625
|
var iso7 = /* @__PURE__ */ __name((ms) => ms === null ? null : new Date(ms).toISOString(), "iso");
|
|
30334
30626
|
var marksOf = /* @__PURE__ */ __name(({ isBot, flagged, deleted, hasPhoto }) => ({
|
|
30335
30627
|
...isBot === void 0 ? {} : { bot: isBot },
|
|
@@ -30460,7 +30752,7 @@ var trackedChats = /* @__PURE__ */ __name((context, accountKey, where) => contex
|
|
|
30460
30752
|
lastCount: memberCountsOf(context, pk).at(-1) ?? null
|
|
30461
30753
|
})), "trackedChats");
|
|
30462
30754
|
|
|
30463
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
30755
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.564.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_0a4d79b5da58b1179a36aa928f36b150/node_modules/@wirecat/cli-core/dist/store/roster.js
|
|
30464
30756
|
var rosterStoreOver = /* @__PURE__ */ __name((context) => {
|
|
30465
30757
|
const { database } = context;
|
|
30466
30758
|
const { accountPk: accountPk2, findAccountPk: findAccountPk2, chatKeyOf, chatPkFor: chatPkFor2, writeMembers: writeMembers2 } = keysOver(context);
|
|
@@ -30516,7 +30808,7 @@ var rosterStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
30516
30808
|
};
|
|
30517
30809
|
}, "rosterStoreOver");
|
|
30518
30810
|
|
|
30519
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
30811
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.564.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_0a4d79b5da58b1179a36aa928f36b150/node_modules/@wirecat/cli-core/dist/store/sqlite/backfill.js
|
|
30520
30812
|
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");
|
|
30521
30813
|
var backfillNormalized = /* @__PURE__ */ __name((database, { batch = 5e3, onBatch, until = /* @__PURE__ */ __name(() => false, "until") } = {}) => {
|
|
30522
30814
|
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 ?`);
|
|
@@ -30540,7 +30832,7 @@ var backfillNormalized = /* @__PURE__ */ __name((database, { batch = 5e3, onBatc
|
|
|
30540
30832
|
}
|
|
30541
30833
|
}, "backfillNormalized");
|
|
30542
30834
|
|
|
30543
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
30835
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.564.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_0a4d79b5da58b1179a36aa928f36b150/node_modules/@wirecat/cli-core/dist/store/sqlite/search-index.js
|
|
30544
30836
|
var INDEX2 = "message_words";
|
|
30545
30837
|
var searchIndexState2 = /* @__PURE__ */ __name((database) => {
|
|
30546
30838
|
const row2 = indexRow(database, INDEX2);
|
|
@@ -30667,7 +30959,7 @@ var resetSearchIndex = /* @__PURE__ */ __name((database) => {
|
|
|
30667
30959
|
});
|
|
30668
30960
|
}, "resetSearchIndex");
|
|
30669
30961
|
|
|
30670
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
30962
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.564.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_0a4d79b5da58b1179a36aa928f36b150/node_modules/@wirecat/cli-core/dist/store/sqlite/stems-fill.js
|
|
30671
30963
|
var fillStems = /* @__PURE__ */ __name((database, { batch = 5e3, until = /* @__PURE__ */ __name(() => false, "until"), onBatch, now: now2 = Date.now } = {}) => {
|
|
30672
30964
|
const filled2 = { stemmed: 0, drained: 0 };
|
|
30673
30965
|
const before2 = stemsState(database);
|
|
@@ -30762,7 +31054,7 @@ var followDefaultStemmers = /* @__PURE__ */ __name((database, now2 = Date.now) =
|
|
|
30762
31054
|
return resetStems(database, { now: now2 });
|
|
30763
31055
|
}, "followDefaultStemmers");
|
|
30764
31056
|
|
|
30765
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
31057
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.564.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_0a4d79b5da58b1179a36aa928f36b150/node_modules/@wirecat/cli-core/dist/store/sqlite/words.js
|
|
30766
31058
|
var VOCABULARY = "SELECT term, doc FROM message_words_vocab WHERE col = 'normalized_text'";
|
|
30767
31059
|
var knownTerms = /* @__PURE__ */ __name(({ database }, terms2) => {
|
|
30768
31060
|
const lookup = database.prepare(`${VOCABULARY} AND term >= ? AND term <= ? LIMIT 1`);
|
|
@@ -30784,7 +31076,7 @@ var termCandidates = /* @__PURE__ */ __name(({ database }, pieces, { shortest, l
|
|
|
30784
31076
|
});
|
|
30785
31077
|
}, "termCandidates");
|
|
30786
31078
|
|
|
30787
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
31079
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.564.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_0a4d79b5da58b1179a36aa928f36b150/node_modules/@wirecat/cli-core/dist/store/search-index.js
|
|
30788
31080
|
var searchIndexStoreOver = /* @__PURE__ */ __name((context) => {
|
|
30789
31081
|
const { database } = context;
|
|
30790
31082
|
const stemmerFor2 = stemmerCache();
|
|
@@ -30806,7 +31098,7 @@ var searchIndexStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
30806
31098
|
};
|
|
30807
31099
|
}, "searchIndexStoreOver");
|
|
30808
31100
|
|
|
30809
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
31101
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.564.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_0a4d79b5da58b1179a36aa928f36b150/node_modules/@wirecat/cli-core/dist/store/sqlite/searches.js
|
|
30810
31102
|
var HISTORY_KEPT = 1e3;
|
|
30811
31103
|
var commandFilter = /* @__PURE__ */ __name((commands) => commands ? { sql: ` AND command IN (${commands.map(() => "?").join(", ")})`, values: [...commands] } : { sql: "", values: [] }, "commandFilter");
|
|
30812
31104
|
var COLUMNS5 = "id, name, command, params, language, version, fields_version, created_at, updated_at, last_run_at, runs";
|
|
@@ -30875,7 +31167,7 @@ var clearHistory = /* @__PURE__ */ __name(({ database }, commands) => {
|
|
|
30875
31167
|
return database.prepare(`DELETE FROM searches WHERE name IS NULL${only.sql}`).run(...only.values).changes;
|
|
30876
31168
|
}, "clearHistory");
|
|
30877
31169
|
|
|
30878
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
31170
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.564.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_0a4d79b5da58b1179a36aa928f36b150/node_modules/@wirecat/cli-core/dist/store/searches.js
|
|
30879
31171
|
var searchesStoreOver = /* @__PURE__ */ __name((context) => {
|
|
30880
31172
|
const { database } = context;
|
|
30881
31173
|
return {
|
|
@@ -30899,7 +31191,7 @@ var searchesStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
30899
31191
|
};
|
|
30900
31192
|
}, "searchesStoreOver");
|
|
30901
31193
|
|
|
30902
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
31194
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.564.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_0a4d79b5da58b1179a36aa928f36b150/node_modules/@wirecat/cli-core/dist/store/sqlite/agent-actions.js
|
|
30903
31195
|
var ACTION_TIERS = ["read", "draft", "write-private", "write-public", "destructive", "admin"];
|
|
30904
31196
|
var ACTION_OUTCOMES = ["ok", "refused", "failed"];
|
|
30905
31197
|
var CODE = /^[a-z][a-z0-9_]{0,63}$/;
|
|
@@ -30942,7 +31234,7 @@ var agentActionsStoreOver = /* @__PURE__ */ __name((context, afterRecord = () =>
|
|
|
30942
31234
|
};
|
|
30943
31235
|
}, "agentActionsStoreOver");
|
|
30944
31236
|
|
|
30945
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
31237
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.564.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_0a4d79b5da58b1179a36aa928f36b150/node_modules/@wirecat/cli-core/dist/store/sqlite/bot-updates.js
|
|
30946
31238
|
var botUpdateStoreOver = /* @__PURE__ */ __name((context, afterSave = () => {
|
|
30947
31239
|
}) => {
|
|
30948
31240
|
const { database, now: now2 } = context;
|
|
@@ -31001,7 +31293,7 @@ var botUpdateStoreOver = /* @__PURE__ */ __name((context, afterSave = () => {
|
|
|
31001
31293
|
};
|
|
31002
31294
|
}, "botUpdateStoreOver");
|
|
31003
31295
|
|
|
31004
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
31296
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.564.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_0a4d79b5da58b1179a36aa928f36b150/node_modules/@wirecat/cli-core/dist/store/sqlite/calendar-events.js
|
|
31005
31297
|
var DAY4 = 864e5;
|
|
31006
31298
|
var accountsOf = /* @__PURE__ */ __name((filter) => {
|
|
31007
31299
|
if (filter.accountIds !== void 0 && filter.accountId !== void 0)
|
|
@@ -31110,7 +31402,7 @@ var listEvents = /* @__PURE__ */ __name((database, filter) => {
|
|
|
31110
31402
|
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);
|
|
31111
31403
|
}, "listEvents");
|
|
31112
31404
|
|
|
31113
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
31405
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.564.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_0a4d79b5da58b1179a36aa928f36b150/node_modules/@wirecat/cli-core/dist/store/sqlite/calendar-forget.js
|
|
31114
31406
|
var distinctIds = /* @__PURE__ */ __name((rows) => [...new Set(rows.map((row2) => Number(row2.id)))], "distinctIds");
|
|
31115
31407
|
var forgetCalendarRows = /* @__PURE__ */ __name((database, { calendarId, accountId, cursorKey: cursorKey2, now: now2 }, refresh) => {
|
|
31116
31408
|
const unseenBefore = unreferenced(database, "identities");
|
|
@@ -31165,7 +31457,7 @@ var forgetCalendarRows = /* @__PURE__ */ __name((database, { calendarId, account
|
|
|
31165
31457
|
return { entries: entryIds.length, events: goneEvents.length };
|
|
31166
31458
|
}, "forgetCalendarRows");
|
|
31167
31459
|
|
|
31168
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
31460
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.564.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_0a4d79b5da58b1179a36aa928f36b150/node_modules/@wirecat/cli-core/dist/store/sqlite/calendar.js
|
|
31169
31461
|
var calendarOf = /* @__PURE__ */ __name((row2) => ({
|
|
31170
31462
|
id: Number(row2.id),
|
|
31171
31463
|
accountId: Number(row2.account_id),
|
|
@@ -31752,7 +32044,7 @@ var eventStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
31752
32044
|
};
|
|
31753
32045
|
}, "eventStoreOver");
|
|
31754
32046
|
|
|
31755
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
32047
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.564.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_0a4d79b5da58b1179a36aa928f36b150/node_modules/@wirecat/cli-core/dist/store/sqlite/catalog.js
|
|
31756
32048
|
var CATALOG_QUERY = defineQuery({
|
|
31757
32049
|
entity: "document",
|
|
31758
32050
|
backend: "sql",
|
|
@@ -31994,7 +32286,7 @@ var catalogStoreOver = /* @__PURE__ */ __name(({ database, now: now2 }) => {
|
|
|
31994
32286
|
};
|
|
31995
32287
|
}, "catalogStoreOver");
|
|
31996
32288
|
|
|
31997
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
32289
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.564.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_0a4d79b5da58b1179a36aa928f36b150/node_modules/@wirecat/cli-core/dist/store/sqlite/context-document-source.js
|
|
31998
32290
|
var drive = "CASE WHEN json_valid(n.front_matter) THEN json_extract(n.front_matter,'$.source')='google-drive' ELSE 0 END";
|
|
31999
32291
|
var field3 = /* @__PURE__ */ __name((name) => `CASE WHEN (${drive}) THEN
|
|
32000
32292
|
CASE WHEN json_type(n.front_matter,'$.${name}')='text' THEN json_extract(n.front_matter,'$.${name}') END END`, "field");
|
|
@@ -32007,7 +32299,7 @@ var contextDocumentTimeKind = `CASE WHEN (${remoteTime}) IS NOT NULL
|
|
|
32007
32299
|
THEN 'source-modified' ELSE 'stored-update' END`;
|
|
32008
32300
|
var contextDocumentUrl = `coalesce(${preferred("url")},n.url,${field3("sourceUrl")})`;
|
|
32009
32301
|
|
|
32010
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
32302
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.564.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_0a4d79b5da58b1179a36aa928f36b150/node_modules/@wirecat/cli-core/dist/store/sqlite/context-meeting-source.js
|
|
32011
32303
|
var readMeetingContextEvidence = /* @__PURE__ */ __name((database, request) => {
|
|
32012
32304
|
const { source: source2, words: words3, after: after2, before: before2, limit, maxReadBytes, cursor, signal } = request;
|
|
32013
32305
|
signal?.throwIfAborted();
|
|
@@ -32106,7 +32398,7 @@ var readMeetingContextEvidence = /* @__PURE__ */ __name((database, request) => {
|
|
|
32106
32398
|
});
|
|
32107
32399
|
}, "readMeetingContextEvidence");
|
|
32108
32400
|
|
|
32109
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
32401
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.564.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_0a4d79b5da58b1179a36aa928f36b150/node_modules/@wirecat/cli-core/dist/store/sqlite/context-evidence.js
|
|
32110
32402
|
var corpora = {
|
|
32111
32403
|
message: {
|
|
32112
32404
|
table: "messages",
|
|
@@ -32345,7 +32637,7 @@ var contextRecordsOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
|
32345
32637
|
}
|
|
32346
32638
|
}), "contextRecordsOver");
|
|
32347
32639
|
|
|
32348
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
32640
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.564.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_0a4d79b5da58b1179a36aa928f36b150/node_modules/@wirecat/cli-core/dist/store/sqlite/note-search.js
|
|
32349
32641
|
var NOTE_FIELDS = [
|
|
32350
32642
|
"text",
|
|
32351
32643
|
"exact",
|
|
@@ -32775,7 +33067,7 @@ var noteSearchOver = /* @__PURE__ */ __name((context) => {
|
|
|
32775
33067
|
};
|
|
32776
33068
|
}, "noteSearchOver");
|
|
32777
33069
|
|
|
32778
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
33070
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.564.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_0a4d79b5da58b1179a36aa928f36b150/node_modules/@wirecat/cli-core/dist/store/sqlite/event-search.js
|
|
32779
33071
|
var EVENT_FIELDS = ["text", "exact", "body", "title", "date", "in"];
|
|
32780
33072
|
var inEventAccounts = /* @__PURE__ */ __name((event) => searchableCopy(event, "c.account_id IN (SELECT CAST(value AS INTEGER) FROM json_each(?))"), "inEventAccounts");
|
|
32781
33073
|
var EVENT_CORPUS = {
|
|
@@ -32907,7 +33199,7 @@ var eventSearchOver = /* @__PURE__ */ __name((context) => {
|
|
|
32907
33199
|
};
|
|
32908
33200
|
}, "eventSearchOver");
|
|
32909
33201
|
|
|
32910
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
33202
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.564.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_0a4d79b5da58b1179a36aa928f36b150/node_modules/@wirecat/cli-core/dist/store/sqlite/finance.js
|
|
32911
33203
|
var refuse2 = /* @__PURE__ */ __name((message2, reason, code = "validation_error") => {
|
|
32912
33204
|
throw new CliError(code, message2, { reason });
|
|
32913
33205
|
}, "refuse");
|
|
@@ -33342,7 +33634,7 @@ var financeStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
33342
33634
|
};
|
|
33343
33635
|
}, "financeStoreOver");
|
|
33344
33636
|
|
|
33345
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
33637
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.564.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_0a4d79b5da58b1179a36aa928f36b150/node_modules/@wirecat/cli-core/dist/store/sqlite/payment-entries.js
|
|
33346
33638
|
var refuse3 = /* @__PURE__ */ __name((message2, reason) => {
|
|
33347
33639
|
throw new CliError("validation_error", message2, { reason });
|
|
33348
33640
|
}, "refuse");
|
|
@@ -33420,7 +33712,7 @@ var paymentEntriesOver = /* @__PURE__ */ __name((context) => {
|
|
|
33420
33712
|
};
|
|
33421
33713
|
}, "paymentEntriesOver");
|
|
33422
33714
|
|
|
33423
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
33715
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.564.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_0a4d79b5da58b1179a36aa928f36b150/node_modules/@wirecat/cli-core/dist/store/evidence-findings.js
|
|
33424
33716
|
var EVIDENCE_FINDINGS_KIND = "evidence_findings";
|
|
33425
33717
|
var reference = /* @__PURE__ */ __name((raw) => {
|
|
33426
33718
|
if (/^(document|note):[1-9]\d*$/.test(raw))
|
|
@@ -33446,7 +33738,7 @@ var validateEvidenceFindings = /* @__PURE__ */ __name((input) => {
|
|
|
33446
33738
|
return valid;
|
|
33447
33739
|
}, "validateEvidenceFindings");
|
|
33448
33740
|
|
|
33449
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
33741
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.564.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_0a4d79b5da58b1179a36aa928f36b150/node_modules/@wirecat/cli-core/dist/domain/moment.js
|
|
33450
33742
|
var calendarMoment = /* @__PURE__ */ __name((wanted, flag6, { zone, end = false } = {}) => {
|
|
33451
33743
|
try {
|
|
33452
33744
|
return zonedMoment(wanted, timezoneOf(zone), { start: 0, end: wanted.length }, { end });
|
|
@@ -33458,7 +33750,7 @@ var calendarMoment = /* @__PURE__ */ __name((wanted, flag6, { zone, end = false
|
|
|
33458
33750
|
}
|
|
33459
33751
|
}, "calendarMoment");
|
|
33460
33752
|
|
|
33461
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
33753
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.564.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_0a4d79b5da58b1179a36aa928f36b150/node_modules/@wirecat/cli-core/dist/store/sqlite/facts.js
|
|
33462
33754
|
var NAMED3 = "SELECT f.*, b.name AS author_name, b.kind AS author_kind FROM facts f LEFT JOIN bots b ON f.author_type = 'bot' AND b.id = f.author_id";
|
|
33463
33755
|
var iso9 = /* @__PURE__ */ __name((value) => new Date(Number(value)).toISOString(), "iso");
|
|
33464
33756
|
var oneOf5 = /* @__PURE__ */ __name((value, allowed, what) => {
|
|
@@ -33640,7 +33932,7 @@ var factsStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
33640
33932
|
};
|
|
33641
33933
|
}, "factsStoreOver");
|
|
33642
33934
|
|
|
33643
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
33935
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.564.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_0a4d79b5da58b1179a36aa928f36b150/node_modules/@wirecat/cli-core/dist/store/sqlite/findings-core.js
|
|
33644
33936
|
var invalid4 = /* @__PURE__ */ __name((message2) => {
|
|
33645
33937
|
throw new CliError("validation_error", message2);
|
|
33646
33938
|
}, "invalid");
|
|
@@ -33742,10 +34034,7 @@ var findingsCoreOver = /* @__PURE__ */ __name((context, kind4) => {
|
|
|
33742
34034
|
return { snapshot: snapshot2, snapshotParts, previous, outcomes, create };
|
|
33743
34035
|
}, "findingsCoreOver");
|
|
33744
34036
|
|
|
33745
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
33746
|
-
var MAIL_FINDINGS_KIND = "mail_findings";
|
|
33747
|
-
|
|
33748
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.560.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5702f943a9224d209a94753f662cf36c/node_modules/@wirecat/cli-core/dist/store/sqlite/proposed-actions.js
|
|
34037
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.564.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_0a4d79b5da58b1179a36aa928f36b150/node_modules/@wirecat/cli-core/dist/store/sqlite/proposed-actions.js
|
|
33749
34038
|
var PROPOSAL_STATUSES = ["proposed", "approved", "rejected", "executed", "failed"];
|
|
33750
34039
|
var PROPOSAL_VERDICTS = ["useful", "not_useful"];
|
|
33751
34040
|
var iso10 = /* @__PURE__ */ __name((value) => value == null ? null : new Date(Number(value)).toISOString(), "iso");
|
|
@@ -33859,38 +34148,43 @@ var proposalOperationsOver = /* @__PURE__ */ __name((context) => {
|
|
|
33859
34148
|
}, "judge")
|
|
33860
34149
|
};
|
|
33861
34150
|
}, "proposalOperationsOver");
|
|
34151
|
+
var DEDICATED_REVIEW = {
|
|
34152
|
+
[MEETING_FINDINGS_KIND]: { what: "meeting findings", reason: "meeting-findings.dedicated-review" },
|
|
34153
|
+
[EVIDENCE_FINDINGS_KIND]: { what: "evidence findings", reason: "evidence-findings.dedicated-review" },
|
|
34154
|
+
[MAIL_FINDINGS_KIND]: { what: "mail findings", reason: "mail-findings.dedicated-review" }
|
|
34155
|
+
};
|
|
34156
|
+
var assertGenericAction = /* @__PURE__ */ __name((kind4) => {
|
|
34157
|
+
const dedicated = DEDICATED_REVIEW[kind4];
|
|
34158
|
+
if (dedicated)
|
|
34159
|
+
throw new CliError("validation_error", `review ${dedicated.what} through the dedicated findings command`, {
|
|
34160
|
+
reason: dedicated.reason
|
|
34161
|
+
});
|
|
34162
|
+
}, "assertGenericAction");
|
|
33862
34163
|
var proposedActionsStoreOver = /* @__PURE__ */ __name((context) => {
|
|
33863
34164
|
const operations = proposalOperationsOver(context);
|
|
33864
34165
|
const generic = /* @__PURE__ */ __name((id2) => {
|
|
33865
|
-
const kind4 = operations.get(id2)
|
|
33866
|
-
|
|
33867
|
-
|
|
33868
|
-
reason: "meeting-findings.dedicated-review"
|
|
33869
|
-
});
|
|
33870
|
-
if (kind4 === EVIDENCE_FINDINGS_KIND)
|
|
33871
|
-
throw new CliError("validation_error", "review evidence findings through the dedicated findings command", {
|
|
33872
|
-
reason: "evidence-findings.dedicated-review"
|
|
33873
|
-
});
|
|
34166
|
+
const { kind: kind4 } = operations.get(id2);
|
|
34167
|
+
assertGenericAction(kind4);
|
|
34168
|
+
return kind4;
|
|
33874
34169
|
}, "generic");
|
|
33875
34170
|
return {
|
|
33876
34171
|
propose: /* @__PURE__ */ __name(async (input) => {
|
|
33877
|
-
|
|
33878
|
-
|
|
33879
|
-
|
|
33880
|
-
throw new CliError("validation_error", "stage evidence findings through the dedicated findings command");
|
|
34172
|
+
const dedicated = DEDICATED_REVIEW[input.kind];
|
|
34173
|
+
if (dedicated)
|
|
34174
|
+
throw new CliError("validation_error", `stage ${dedicated.what} through the dedicated findings command`);
|
|
33881
34175
|
return operations.propose(input);
|
|
33882
34176
|
}, "propose"),
|
|
33883
34177
|
get: /* @__PURE__ */ __name(async (id2) => operations.get(id2), "get"),
|
|
33884
34178
|
pending: /* @__PURE__ */ __name(async (options) => operations.pending(options), "pending"),
|
|
33885
34179
|
list: /* @__PURE__ */ __name(async (options) => operations.list(options), "list"),
|
|
33886
34180
|
approve: /* @__PURE__ */ __name(async (id2, by, result) => {
|
|
33887
|
-
generic(id2);
|
|
33888
|
-
assertMayDecide({ id: id2, proposedBy: operations.proposer(id2) }, by, context.decisions);
|
|
34181
|
+
const kind4 = generic(id2);
|
|
34182
|
+
assertMayDecide({ id: id2, kind: kind4, proposedBy: operations.proposer(id2) }, by, context.decisions);
|
|
33889
34183
|
return operations.approve(id2, result, deciderAuthor(by));
|
|
33890
34184
|
}, "approve"),
|
|
33891
34185
|
reject: /* @__PURE__ */ __name(async (id2, by, reason) => {
|
|
33892
|
-
generic(id2);
|
|
33893
|
-
assertMayDecide({ id: id2, proposedBy: operations.proposer(id2) }, by, context.decisions);
|
|
34186
|
+
const kind4 = generic(id2);
|
|
34187
|
+
assertMayDecide({ id: id2, kind: kind4, proposedBy: operations.proposer(id2) }, by, context.decisions);
|
|
33894
34188
|
return operations.reject(id2, deciderAuthor(by), reason?.trim() ? { reason: reason.trim() } : void 0);
|
|
33895
34189
|
}, "reject"),
|
|
33896
34190
|
executed: /* @__PURE__ */ __name(async (id2, result) => {
|
|
@@ -33905,7 +34199,7 @@ var proposedActionsStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
33905
34199
|
};
|
|
33906
34200
|
}, "proposedActionsStoreOver");
|
|
33907
34201
|
|
|
33908
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34202
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.564.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_0a4d79b5da58b1179a36aa928f36b150/node_modules/@wirecat/cli-core/dist/store/sqlite/evidence-findings.js
|
|
33909
34203
|
var stale = /* @__PURE__ */ __name(() => {
|
|
33910
34204
|
throw new CliError("validation_error", "evidence findings changed since they were read; stage a new batch", {
|
|
33911
34205
|
reason: "evidence-findings.stale"
|
|
@@ -34086,7 +34380,7 @@ var evidenceFindingsStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
34086
34380
|
};
|
|
34087
34381
|
}, "evidenceFindingsStoreOver");
|
|
34088
34382
|
|
|
34089
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34383
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.564.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_0a4d79b5da58b1179a36aa928f36b150/node_modules/@wirecat/cli-core/dist/store/sqlite/involvements.js
|
|
34090
34384
|
var pendingInvolvements = /* @__PURE__ */ __name((database) => Number(database.prepare("SELECT count(*) AS n FROM involvement_pending").get()?.n ?? 0), "pendingInvolvements");
|
|
34091
34385
|
var involvementStoreOver = /* @__PURE__ */ __name(({ database, now: now2 }) => ({
|
|
34092
34386
|
rebuild: /* @__PURE__ */ __name((personId) => write(database, () => {
|
|
@@ -34139,7 +34433,7 @@ var involvementStoreOver = /* @__PURE__ */ __name(({ database, now: now2 }) => (
|
|
|
34139
34433
|
}, "forPerson")
|
|
34140
34434
|
}), "involvementStoreOver");
|
|
34141
34435
|
|
|
34142
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34436
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.564.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_0a4d79b5da58b1179a36aa928f36b150/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-projects.js
|
|
34143
34437
|
import { createHash as createHash12 } from "node:crypto";
|
|
34144
34438
|
var fields3 = "id,from_id,to_id,source,confirmed,updated_at,length(evidence) AS evidenceLength,substr(evidence,1,2000) AS evidence";
|
|
34145
34439
|
var id = /* @__PURE__ */ __name((value) => {
|
|
@@ -34225,7 +34519,7 @@ var meetingProjectsStoreOver = /* @__PURE__ */ __name(({ database, now: now2 })
|
|
|
34225
34519
|
};
|
|
34226
34520
|
}, "meetingProjectsStoreOver");
|
|
34227
34521
|
|
|
34228
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34522
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.564.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_0a4d79b5da58b1179a36aa928f36b150/node_modules/@wirecat/cli-core/dist/store/sqlite/relation-proposals.js
|
|
34229
34523
|
var relationOf = /* @__PURE__ */ __name((link3) => ({
|
|
34230
34524
|
id: link3.id,
|
|
34231
34525
|
from: link3.from,
|
|
@@ -34451,16 +34745,16 @@ var decidedOrigin = /* @__PURE__ */ __name((by) => by === "owner" ? { origin: "o
|
|
|
34451
34745
|
provenance: `agent:${by.bot} for the owner: ${by.reason.trim()}`
|
|
34452
34746
|
}, "decidedOrigin");
|
|
34453
34747
|
|
|
34454
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34748
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.564.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_0a4d79b5da58b1179a36aa928f36b150/node_modules/@wirecat/cli-core/dist/store/sqlite/vocabulary.js
|
|
34455
34749
|
import { createHash as createHash15 } from "node:crypto";
|
|
34456
34750
|
|
|
34457
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34751
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.564.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_0a4d79b5da58b1179a36aa928f36b150/node_modules/@wirecat/cli-core/dist/store/sqlite/tag-consolidation.js
|
|
34458
34752
|
import { createHash as createHash14 } from "node:crypto";
|
|
34459
34753
|
|
|
34460
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34754
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.564.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_0a4d79b5da58b1179a36aa928f36b150/node_modules/@wirecat/cli-core/dist/store/sqlite/tag-consolidation-apply.js
|
|
34461
34755
|
import { createHash as createHash13 } from "node:crypto";
|
|
34462
34756
|
|
|
34463
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34757
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.564.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_0a4d79b5da58b1179a36aa928f36b150/node_modules/@wirecat/cli-core/dist/store/sqlite/tag-consolidation-input.js
|
|
34464
34758
|
var consolidationId = /* @__PURE__ */ __name((value, field4) => {
|
|
34465
34759
|
if (typeof value !== "string" || !/^[1-9]\d*$/.test(value) || !Number.isSafeInteger(Number(value)))
|
|
34466
34760
|
throw new CliError("validation_error", `${field4} must be a positive canonical tag id`);
|
|
@@ -34511,7 +34805,7 @@ var consolidationApplyInput = /* @__PURE__ */ __name((options) => {
|
|
|
34511
34805
|
return input;
|
|
34512
34806
|
}, "consolidationApplyInput");
|
|
34513
34807
|
|
|
34514
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34808
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.564.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_0a4d79b5da58b1179a36aa928f36b150/node_modules/@wirecat/cli-core/dist/store/sqlite/tag-consolidation-apply.js
|
|
34515
34809
|
var receiptOf = /* @__PURE__ */ __name((row2) => ({
|
|
34516
34810
|
id: String(row2.id),
|
|
34517
34811
|
sourceId: String(row2.source_id),
|
|
@@ -34586,7 +34880,7 @@ var applyTagConsolidation = /* @__PURE__ */ __name((context, preview, options) =
|
|
|
34586
34880
|
}, { beforeCommit: check3 });
|
|
34587
34881
|
}, "applyTagConsolidation");
|
|
34588
34882
|
|
|
34589
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34883
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.564.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_0a4d79b5da58b1179a36aa928f36b150/node_modules/@wirecat/cli-core/dist/store/sqlite/tag-consolidation.js
|
|
34590
34884
|
var selections = [
|
|
34591
34885
|
["taggings", "tag_id IN (SELECT value FROM json_each(?))"],
|
|
34592
34886
|
["aliases", "aliasable_type='tag' AND aliasable_id IN (SELECT value FROM json_each(?))"],
|
|
@@ -34730,7 +35024,7 @@ var previewRows = /* @__PURE__ */ __name((context, options, source2, survivor, m
|
|
|
34730
35024
|
};
|
|
34731
35025
|
}, "previewRows");
|
|
34732
35026
|
|
|
34733
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
35027
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.564.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_0a4d79b5da58b1179a36aa928f36b150/node_modules/@wirecat/cli-core/dist/store/sqlite/vocabulary.js
|
|
34734
35028
|
var kinds = ["project", "tag", "topic"];
|
|
34735
35029
|
var cancelled2 = /* @__PURE__ */ __name((signal) => {
|
|
34736
35030
|
if (signal?.aborted)
|
|
@@ -34994,7 +35288,7 @@ var vocabularyStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
34994
35288
|
};
|
|
34995
35289
|
}, "vocabularyStoreOver");
|
|
34996
35290
|
|
|
34997
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
35291
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.564.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_0a4d79b5da58b1179a36aa928f36b150/node_modules/@wirecat/cli-core/dist/store/sqlite/knowledge.js
|
|
34998
35292
|
var TYPED_KEY_PREFIXES = new Set(Object.values(TASK_KEY_PREFIXES));
|
|
34999
35293
|
var ORGANIZATION_KINDS = ["company", "team", "family", "community"];
|
|
35000
35294
|
var PROJECT_TYPES = ["work", "client", "personal", "oss", "other"];
|
|
@@ -35551,7 +35845,7 @@ var projectKey = /* @__PURE__ */ __name((name) => {
|
|
|
35551
35845
|
return key2.padEnd(3, "X");
|
|
35552
35846
|
}, "projectKey");
|
|
35553
35847
|
|
|
35554
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
35848
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.564.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_0a4d79b5da58b1179a36aa928f36b150/node_modules/@wirecat/cli-core/dist/store/sqlite/log-pruning.js
|
|
35555
35849
|
var DAY5 = 864e5;
|
|
35556
35850
|
var SETTING4 = "logs_pruned_at";
|
|
35557
35851
|
var LOG_RETENTION = { agentActionsMs: 90 * DAY5, botUpdatePayloadsMs: 30 * DAY5 };
|
|
@@ -35578,7 +35872,7 @@ var logPruner = /* @__PURE__ */ __name((database, now2) => {
|
|
|
35578
35872
|
};
|
|
35579
35873
|
}, "logPruner");
|
|
35580
35874
|
|
|
35581
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
35875
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.564.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_0a4d79b5da58b1179a36aa928f36b150/node_modules/@wirecat/cli-core/dist/mail/findings.js
|
|
35582
35876
|
var MAIL_FINDINGS_PER_RUN = 30;
|
|
35583
35877
|
var MAIL_FINDINGS_PER_SENDER = 5;
|
|
35584
35878
|
var invalid6 = /* @__PURE__ */ __name((message2) => {
|
|
@@ -35704,7 +35998,7 @@ var validateMailFindings = /* @__PURE__ */ __name((input) => {
|
|
|
35704
35998
|
}, "validateMailFindings");
|
|
35705
35999
|
var mailFindingFingerprint = /* @__PURE__ */ __name(({ id: _id, ...finding }) => findingHash(finding), "mailFindingFingerprint");
|
|
35706
36000
|
|
|
35707
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
36001
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.564.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_0a4d79b5da58b1179a36aa928f36b150/node_modules/@wirecat/cli-core/dist/store/sqlite/mail-findings.js
|
|
35708
36002
|
var stale2 = /* @__PURE__ */ __name(() => {
|
|
35709
36003
|
throw new CliError("validation_error", "mail findings cite mail that changed since it was read; stage a new batch", {
|
|
35710
36004
|
reason: "mail-findings.stale"
|
|
@@ -35954,7 +36248,7 @@ ${evidence.join("\n")}`, agent);
|
|
|
35954
36248
|
return invalid7("accept only unique IDs shown in this batch");
|
|
35955
36249
|
if (decision.by === void 0)
|
|
35956
36250
|
return invalid7("a findings review names who decides: the owner");
|
|
35957
|
-
assertMayDecide({ id: id2, proposedBy: proposals.proposer(id2)
|
|
36251
|
+
assertMayDecide({ id: id2, kind: MAIL_FINDINGS_KIND, proposedBy: proposals.proposer(id2) }, decision.by, context.decisions);
|
|
35958
36252
|
const accepted = [...decision.accept].sort();
|
|
35959
36253
|
if (batch.receipt) {
|
|
35960
36254
|
if (JSON.stringify(batch.receipt.accepted) !== JSON.stringify(accepted))
|
|
@@ -35994,7 +36288,7 @@ ${evidence.join("\n")}`, agent);
|
|
|
35994
36288
|
};
|
|
35995
36289
|
}, "mailFindingsStoreOver");
|
|
35996
36290
|
|
|
35997
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
36291
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.564.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_0a4d79b5da58b1179a36aa928f36b150/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-findings.js
|
|
35998
36292
|
var stale3 = /* @__PURE__ */ __name(() => {
|
|
35999
36293
|
throw new CliError("validation_error", "meeting findings changed since they were read; stage a new batch", {
|
|
36000
36294
|
reason: "meeting-findings.stale"
|
|
@@ -36141,7 +36435,7 @@ var meetingFindingsStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
36141
36435
|
const accepted = [...decision.accept].sort();
|
|
36142
36436
|
if (decision.by === void 0)
|
|
36143
36437
|
return invalid8("a findings review names who decides: the owner or an agent");
|
|
36144
|
-
assertMayDecide({ id: id2, proposedBy: proposals.proposer(id2) }, decision.by, context.decisions);
|
|
36438
|
+
assertMayDecide({ id: id2, kind: MEETING_FINDINGS_KIND, proposedBy: proposals.proposer(id2) }, decision.by, context.decisions);
|
|
36145
36439
|
if (batch.receipt) {
|
|
36146
36440
|
if (JSON.stringify(batch.receipt.accepted) !== JSON.stringify(accepted))
|
|
36147
36441
|
return invalid8("this findings batch was already reviewed with a different decision");
|
|
@@ -36162,7 +36456,7 @@ var meetingFindingsStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
36162
36456
|
};
|
|
36163
36457
|
}, "meetingFindingsStoreOver");
|
|
36164
36458
|
|
|
36165
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
36459
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.564.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_0a4d79b5da58b1179a36aa928f36b150/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-vectors.js
|
|
36166
36460
|
var RANK_BATCH = 512;
|
|
36167
36461
|
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";
|
|
36168
36462
|
var limitOf = /* @__PURE__ */ __name((value, name, max = 1e3) => {
|
|
@@ -36433,7 +36727,7 @@ var meetingVectorsOver = /* @__PURE__ */ __name((context) => ({
|
|
|
36433
36727
|
}
|
|
36434
36728
|
}), "meetingVectorsOver");
|
|
36435
36729
|
|
|
36436
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
36730
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.564.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_0a4d79b5da58b1179a36aa928f36b150/node_modules/@wirecat/cli-core/dist/store/sqlite/mention-sources.js
|
|
36437
36731
|
var OTHER_SOURCES = ["document", "note", "email"];
|
|
36438
36732
|
var TEXTS = {
|
|
36439
36733
|
document: "JOIN documents s ON mn.source_type = 'document' AND s.id = mn.source_id AND s.deleted_at IS NULL WHERE 1 ",
|
|
@@ -36534,11 +36828,11 @@ var sourceMentionStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
36534
36828
|
};
|
|
36535
36829
|
}, "sourceMentionStoreOver");
|
|
36536
36830
|
|
|
36537
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
36831
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.564.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_0a4d79b5da58b1179a36aa928f36b150/node_modules/@wirecat/cli-core/dist/store/sqlite/open-store.js
|
|
36538
36832
|
import { mkdirSync, statSync, writeFileSync } from "node:fs";
|
|
36539
36833
|
import { dirname } from "node:path";
|
|
36540
36834
|
|
|
36541
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
36835
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.564.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_0a4d79b5da58b1179a36aa928f36b150/node_modules/@wirecat/cli-core/dist/store/sqlite/clients.js
|
|
36542
36836
|
import { readFileSync as readFileSync3 } from "node:fs";
|
|
36543
36837
|
var CLIENTS_SETTING = "clients";
|
|
36544
36838
|
var coreVersion = (() => {
|
|
@@ -36596,7 +36890,7 @@ var refusalAdvice = /* @__PURE__ */ __name((clients, command, schema) => {
|
|
|
36596
36890
|
return mover ? `${own} (${mover.command} ${mover.version} moved the store to schema ${schema})` : own;
|
|
36597
36891
|
}, "refusalAdvice");
|
|
36598
36892
|
|
|
36599
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
36893
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.564.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_0a4d79b5da58b1179a36aa928f36b150/node_modules/@wirecat/cli-core/dist/store/sqlite/migrations.generated.js
|
|
36600
36894
|
var GENERATED = [
|
|
36601
36895
|
{
|
|
36602
36896
|
"name": "20261010184427_initial",
|
|
@@ -37563,7 +37857,7 @@ WHERE json_type(params, '$.selection') = 'object';`
|
|
|
37563
37857
|
}
|
|
37564
37858
|
];
|
|
37565
37859
|
|
|
37566
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
37860
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.564.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_0a4d79b5da58b1179a36aa928f36b150/node_modules/@wirecat/cli-core/dist/store/sqlite/manifest.js
|
|
37567
37861
|
var MANIFEST = [
|
|
37568
37862
|
{ name: "20261010184427_initial", version: 1, minCompatible: 1 },
|
|
37569
37863
|
{ name: "20261011035353_version-2-facts", version: 2, minCompatible: 1 },
|
|
@@ -37651,7 +37945,7 @@ var generatedMigrations = /* @__PURE__ */ __name((manifest = MANIFEST, generated
|
|
|
37651
37945
|
return migrations;
|
|
37652
37946
|
}, "generatedMigrations");
|
|
37653
37947
|
|
|
37654
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
37948
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.564.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_0a4d79b5da58b1179a36aa928f36b150/node_modules/@wirecat/cli-core/dist/store/migrations.js
|
|
37655
37949
|
var MIGRATIONS = generatedMigrations();
|
|
37656
37950
|
var HISTORY = `CREATE TABLE IF NOT EXISTS schema_migrations (
|
|
37657
37951
|
version INTEGER PRIMARY KEY,
|
|
@@ -37704,7 +37998,7 @@ var migrate = /* @__PURE__ */ __name((database, { migrations = MIGRATIONS, now:
|
|
|
37704
37998
|
}
|
|
37705
37999
|
}, "migrate");
|
|
37706
38000
|
|
|
37707
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
38001
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.564.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_0a4d79b5da58b1179a36aa928f36b150/node_modules/@wirecat/cli-core/dist/store/sqlite/join-keys.js
|
|
37708
38002
|
var fillJoinKeys = /* @__PURE__ */ __name((database, { batch = 2e3 } = {}) => {
|
|
37709
38003
|
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 ?");
|
|
37710
38004
|
if (pending.get(0, 1) === void 0)
|
|
@@ -37726,7 +38020,7 @@ var fillJoinKeys = /* @__PURE__ */ __name((database, { batch = 2e3 } = {}) => {
|
|
|
37726
38020
|
}
|
|
37727
38021
|
}, "fillJoinKeys");
|
|
37728
38022
|
|
|
37729
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
38023
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.564.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_0a4d79b5da58b1179a36aa928f36b150/node_modules/@wirecat/cli-core/dist/store/sqlite/open.js
|
|
37730
38024
|
var openSqlite = /* @__PURE__ */ __name(async (path, { readOnly = false } = {}) => {
|
|
37731
38025
|
refuseOwnerStoreInTests(path);
|
|
37732
38026
|
const opened = "Bun" in globalThis ? await openUnderBun(path, readOnly) : await openUnderNode(path, readOnly);
|
|
@@ -37740,8 +38034,8 @@ var openSqlite = /* @__PURE__ */ __name(async (path, { readOnly = false } = {})
|
|
|
37740
38034
|
}, "openSqlite");
|
|
37741
38035
|
var openUnderNode = /* @__PURE__ */ __name(async (path, readOnly) => {
|
|
37742
38036
|
quietSqliteWarning();
|
|
37743
|
-
const { drizzle } = await import("./node-
|
|
37744
|
-
const { cacheOverNodeSqlite, nodeClient } = await import("./node-sqlite-
|
|
38037
|
+
const { drizzle } = await import("./node-2QE6UPGS.js");
|
|
38038
|
+
const { cacheOverNodeSqlite, nodeClient } = await import("./node-sqlite-SDHZJNY7.js");
|
|
37745
38039
|
const client = await nodeClient(path, { readOnly });
|
|
37746
38040
|
try {
|
|
37747
38041
|
return { database: cacheOverNodeSqlite(client), orm: drizzle({ client }) };
|
|
@@ -37751,8 +38045,8 @@ var openUnderNode = /* @__PURE__ */ __name(async (path, readOnly) => {
|
|
|
37751
38045
|
}
|
|
37752
38046
|
}, "openUnderNode");
|
|
37753
38047
|
var openUnderBun = /* @__PURE__ */ __name(async (path, readOnly) => {
|
|
37754
|
-
const { bunClient, cacheOverBunSqlite } = await import("./bun-sqlite-
|
|
37755
|
-
const { drizzle } = await import("./bun-
|
|
38048
|
+
const { bunClient, cacheOverBunSqlite } = await import("./bun-sqlite-P4I7NVMQ.js");
|
|
38049
|
+
const { drizzle } = await import("./bun-JVBDJKBB.js");
|
|
37756
38050
|
const client = await bunClient(path, readOnly ? { readonly: true, create: false } : void 0);
|
|
37757
38051
|
try {
|
|
37758
38052
|
return { database: cacheOverBunSqlite(client), orm: drizzle({ client }) };
|
|
@@ -37762,7 +38056,7 @@ var openUnderBun = /* @__PURE__ */ __name(async (path, readOnly) => {
|
|
|
37762
38056
|
}
|
|
37763
38057
|
}, "openUnderBun");
|
|
37764
38058
|
|
|
37765
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
38059
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.564.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_0a4d79b5da58b1179a36aa928f36b150/node_modules/@wirecat/cli-core/dist/store/sqlite/payment-facts.js
|
|
37766
38060
|
var PAYMENT_FACTS_TO_MOVE = "payment_facts_to_move";
|
|
37767
38061
|
var paymentOf = /* @__PURE__ */ __name((metadata3) => {
|
|
37768
38062
|
try {
|
|
@@ -37830,7 +38124,7 @@ var movePaymentFacts = /* @__PURE__ */ __name((context) => {
|
|
|
37830
38124
|
});
|
|
37831
38125
|
}, "movePaymentFacts");
|
|
37832
38126
|
|
|
37833
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
38127
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.564.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_0a4d79b5da58b1179a36aa928f36b150/node_modules/@wirecat/cli-core/dist/store/sqlite/read-compatibility.js
|
|
37834
38128
|
var assertReadCompatible = /* @__PURE__ */ __name((database, command) => {
|
|
37835
38129
|
const ours = MIGRATIONS.at(-1)?.version ?? 0;
|
|
37836
38130
|
if (!database.prepare("SELECT 1 FROM sqlite_master WHERE type='table' AND name='schema_migrations'").get())
|
|
@@ -37845,7 +38139,7 @@ var assertReadCompatible = /* @__PURE__ */ __name((database, command) => {
|
|
|
37845
38139
|
throw new CliError("configuration_error", `The store requires schema ${minCompatible}, but this tool supports ${ours}; ${refusalAdvice(storeClients(database), command, version)}`);
|
|
37846
38140
|
}, "assertReadCompatible");
|
|
37847
38141
|
|
|
37848
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
38142
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.564.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_0a4d79b5da58b1179a36aa928f36b150/node_modules/@wirecat/cli-core/dist/store/sqlite/suggested-links.js
|
|
37849
38143
|
var SUGGESTED_LINKS_TO_MOVE = "suggested_links_to_move";
|
|
37850
38144
|
var proposerOf2 = /* @__PURE__ */ __name((provenance2) => {
|
|
37851
38145
|
if (provenance2?.startsWith("rule:"))
|
|
@@ -37891,7 +38185,7 @@ var moveSuggestedLinks = /* @__PURE__ */ __name((database, now2) => {
|
|
|
37891
38185
|
});
|
|
37892
38186
|
}, "moveSuggestedLinks");
|
|
37893
38187
|
|
|
37894
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
38188
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.564.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_0a4d79b5da58b1179a36aa928f36b150/node_modules/@wirecat/cli-core/dist/store/sqlite/test-accounts.js
|
|
37895
38189
|
var TEST_ACCOUNTS_TO_PURGE = "test_accounts_to_purge";
|
|
37896
38190
|
var TEST_PROVIDER = "chat";
|
|
37897
38191
|
var purgeTestAccounts = /* @__PURE__ */ __name((context, warn) => {
|
|
@@ -37912,7 +38206,7 @@ var purgeTestAccounts = /* @__PURE__ */ __name((context, warn) => {
|
|
|
37912
38206
|
}
|
|
37913
38207
|
}, "purgeTestAccounts");
|
|
37914
38208
|
|
|
37915
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
38209
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.564.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_0a4d79b5da58b1179a36aa928f36b150/node_modules/@wirecat/cli-core/dist/store/sqlite/open-store.js
|
|
37916
38210
|
var BACKFILL_ON_OPEN = 5e3;
|
|
37917
38211
|
var NOT_WRITABLE = /* @__PURE__ */ new Set(["EACCES", "EPERM", "EROFS"]);
|
|
37918
38212
|
var createWritable = /* @__PURE__ */ __name((file) => {
|
|
@@ -37977,10 +38271,10 @@ var openStoreContext = /* @__PURE__ */ __name(async ({ path, env, now: now2 = Da
|
|
|
37977
38271
|
}
|
|
37978
38272
|
}, "openStoreContext");
|
|
37979
38273
|
|
|
37980
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
38274
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.564.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_0a4d79b5da58b1179a36aa928f36b150/node_modules/@wirecat/cli-core/dist/store/project-transfer/plan.js
|
|
37981
38275
|
import { createHash as createHash16 } from "node:crypto";
|
|
37982
38276
|
|
|
37983
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
38277
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.564.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_0a4d79b5da58b1179a36aa928f36b150/node_modules/@wirecat/cli-core/dist/store/project-transfer/schema.js
|
|
37984
38278
|
var text4 = /* @__PURE__ */ __name((max) => pipe(string(), minLength(1), maxLength(max)), "text");
|
|
37985
38279
|
var ref = text4(2048);
|
|
37986
38280
|
var timestamp2 = pipe(number(), safeInteger(), minValue(0));
|
|
@@ -38046,7 +38340,7 @@ var projectAnnotationsSchema = strictObject({
|
|
|
38046
38340
|
}))
|
|
38047
38341
|
});
|
|
38048
38342
|
|
|
38049
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
38343
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.564.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_0a4d79b5da58b1179a36aa928f36b150/node_modules/@wirecat/cli-core/dist/store/project-transfer/manifest.js
|
|
38050
38344
|
var PROJECT_ANNOTATIONS_MAX_BYTES = 4 * 1024 * 1024;
|
|
38051
38345
|
var invalid9 = /* @__PURE__ */ __name((field4) => {
|
|
38052
38346
|
throw new CliError("validation_error", `invalid project annotations.${field4}`);
|
|
@@ -38150,7 +38444,7 @@ var validateProjectAnnotationsGraph = /* @__PURE__ */ __name((manifest, addition
|
|
|
38150
38444
|
invalid9("external.unused");
|
|
38151
38445
|
}, "validateProjectAnnotationsGraph");
|
|
38152
38446
|
|
|
38153
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
38447
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.564.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_0a4d79b5da58b1179a36aa928f36b150/node_modules/@wirecat/cli-core/dist/store/project-transfer/plan.js
|
|
38154
38448
|
var hash = pipe(string(), regex(/^[a-f0-9]{64}$/));
|
|
38155
38449
|
var ref2 = pipe(string(), minLength(1), maxLength(2048));
|
|
38156
38450
|
var targetSchema = strictObject({
|
|
@@ -38256,7 +38550,7 @@ var planBoundProjectAnnotations = /* @__PURE__ */ __name((manifest, manifest_fin
|
|
|
38256
38550
|
};
|
|
38257
38551
|
}, "planBoundProjectAnnotations");
|
|
38258
38552
|
|
|
38259
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
38553
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.564.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_0a4d79b5da58b1179a36aa928f36b150/node_modules/@wirecat/cli-core/dist/store/project-transfer/snapshot-model.js
|
|
38260
38554
|
import { createHash as createHash17 } from "node:crypto";
|
|
38261
38555
|
var text5 = /* @__PURE__ */ __name((max) => pipe(string(), minLength(1), maxLength(max)), "text");
|
|
38262
38556
|
var timestamp3 = pipe(number(), safeInteger(), minValue(0));
|
|
@@ -38350,7 +38644,7 @@ var projectAnnotationSnapshotFingerprint = /* @__PURE__ */ __name((json3) => {
|
|
|
38350
38644
|
})).digest("hex");
|
|
38351
38645
|
}, "projectAnnotationSnapshotFingerprint");
|
|
38352
38646
|
|
|
38353
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
38647
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.564.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_0a4d79b5da58b1179a36aa928f36b150/node_modules/@wirecat/cli-core/dist/store/project-transfer/request.js
|
|
38354
38648
|
var projectAnnotationRequest = /* @__PURE__ */ __name((request, restore = false) => {
|
|
38355
38649
|
if (!request || typeof request !== "object" || Array.isArray(request))
|
|
38356
38650
|
throw new CliError("validation_error", "project annotation request is required");
|
|
@@ -38367,7 +38661,7 @@ var projectAnnotationRequest = /* @__PURE__ */ __name((request, restore = false)
|
|
|
38367
38661
|
return { snapshot: snapshot2, projectId: Number(request.project.slice(8)) };
|
|
38368
38662
|
}, "projectAnnotationRequest");
|
|
38369
38663
|
|
|
38370
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
38664
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.564.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_0a4d79b5da58b1179a36aa928f36b150/node_modules/@wirecat/cli-core/dist/store/sqlite/project-transfer/budget.js
|
|
38371
38665
|
var SnapshotBudget = class {
|
|
38372
38666
|
static {
|
|
38373
38667
|
__name(this, "SnapshotBudget");
|
|
@@ -38393,13 +38687,13 @@ var SnapshotBudget = class {
|
|
|
38393
38687
|
}
|
|
38394
38688
|
};
|
|
38395
38689
|
|
|
38396
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
38690
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.564.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_0a4d79b5da58b1179a36aa928f36b150/node_modules/@wirecat/cli-core/dist/store/sqlite/project-transfer/preview.js
|
|
38397
38691
|
import { createHash as createHash19 } from "node:crypto";
|
|
38398
38692
|
|
|
38399
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
38693
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.564.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_0a4d79b5da58b1179a36aa928f36b150/node_modules/@wirecat/cli-core/dist/store/project-transfer/snapshot-plan.js
|
|
38400
38694
|
var planProjectAnnotationSnapshot = /* @__PURE__ */ __name((json3, target, bindings) => planBoundProjectAnnotations(decodeProjectAnnotationSnapshot(json3), projectAnnotationSnapshotFingerprint(json3), target, bindings), "planProjectAnnotationSnapshot");
|
|
38401
38695
|
|
|
38402
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
38696
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.564.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_0a4d79b5da58b1179a36aa928f36b150/node_modules/@wirecat/cli-core/dist/store/sqlite/project-transfer/sources.js
|
|
38403
38697
|
import { createHash as createHash18 } from "node:crypto";
|
|
38404
38698
|
var invalid11 = /* @__PURE__ */ __name(() => {
|
|
38405
38699
|
throw new CliError("configuration_error", "project snapshot has an unavailable or unsupported dependency");
|
|
@@ -38542,7 +38836,7 @@ var ProjectSnapshotSources = class {
|
|
|
38542
38836
|
}
|
|
38543
38837
|
};
|
|
38544
38838
|
|
|
38545
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
38839
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.564.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_0a4d79b5da58b1179a36aa928f36b150/node_modules/@wirecat/cli-core/dist/store/sqlite/project-transfer/snapshot.js
|
|
38546
38840
|
var unsupported = /* @__PURE__ */ __name(() => {
|
|
38547
38841
|
throw new CliError("configuration_error", "project snapshot has unsupported metadata, deletion or account scope");
|
|
38548
38842
|
}, "unsupported");
|
|
@@ -38713,7 +39007,7 @@ var projectAnnotationSnapshot = /* @__PURE__ */ __name((database, projectId2, bu
|
|
|
38713
39007
|
return { snapshot: snapshot2, read_bytes: budget.bytes, records: budget.records };
|
|
38714
39008
|
}), "projectAnnotationSnapshot");
|
|
38715
39009
|
|
|
38716
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
39010
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.564.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_0a4d79b5da58b1179a36aa928f36b150/node_modules/@wirecat/cli-core/dist/store/sqlite/project-transfer/preview.js
|
|
38717
39011
|
var previewAnnotationSnapshot = /* @__PURE__ */ __name((database, projectId2, manifest, bindings, budget) => read(database, () => {
|
|
38718
39012
|
const current = projectAnnotationSnapshot(database, projectId2, budget).snapshot;
|
|
38719
39013
|
const sources = new ProjectSnapshotSources(database, budget);
|
|
@@ -38775,7 +39069,7 @@ var previewAnnotationSnapshot = /* @__PURE__ */ __name((database, projectId2, ma
|
|
|
38775
39069
|
};
|
|
38776
39070
|
}), "previewAnnotationSnapshot");
|
|
38777
39071
|
|
|
38778
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
39072
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.564.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_0a4d79b5da58b1179a36aa928f36b150/node_modules/@wirecat/cli-core/dist/store/sqlite/project-transfer/records.js
|
|
38779
39073
|
var restoreAnnotationRecords = /* @__PURE__ */ __name((database, projectId2, snapshot2, bindings) => {
|
|
38780
39074
|
const mappings = { ...bindings };
|
|
38781
39075
|
const resolve = /* @__PURE__ */ __name((ref3) => {
|
|
@@ -38817,7 +39111,7 @@ var restoreAnnotationRecords = /* @__PURE__ */ __name((database, projectId2, sna
|
|
|
38817
39111
|
return mappings;
|
|
38818
39112
|
}, "restoreAnnotationRecords");
|
|
38819
39113
|
|
|
38820
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
39114
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.564.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_0a4d79b5da58b1179a36aa928f36b150/node_modules/@wirecat/cli-core/dist/store/sqlite/project-transfer/store.js
|
|
38821
39115
|
var projectAnnotationStoreOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
38822
39116
|
async preview(request) {
|
|
38823
39117
|
const { snapshot: snapshot2, projectId: projectId2 } = projectAnnotationRequest(request);
|
|
@@ -38847,7 +39141,7 @@ var projectAnnotationStoreOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
|
38847
39141
|
}
|
|
38848
39142
|
}), "projectAnnotationStoreOver");
|
|
38849
39143
|
|
|
38850
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
39144
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.564.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_0a4d79b5da58b1179a36aa928f36b150/node_modules/@wirecat/cli-core/dist/domain/records.js
|
|
38851
39145
|
import { createHash as createHash20 } from "node:crypto";
|
|
38852
39146
|
var RECORDS_SCHEMA_VERSION = 1;
|
|
38853
39147
|
var RECORD_OPERATIONS = ["upsert", "delete"];
|
|
@@ -39063,7 +39357,7 @@ var envelopeOfJsonl = /* @__PURE__ */ __name((text6) => {
|
|
|
39063
39357
|
return isObject2(header) ? { ...header, records: records2 } : header;
|
|
39064
39358
|
}, "envelopeOfJsonl");
|
|
39065
39359
|
|
|
39066
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
39360
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.564.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_0a4d79b5da58b1179a36aa928f36b150/node_modules/@wirecat/cli-core/dist/store/sqlite/records.js
|
|
39067
39361
|
var PROJECTED = {
|
|
39068
39362
|
invoice: { roles: ["issuer", "counterparty", "project"], many: [] },
|
|
39069
39363
|
payment: { roles: ["payer", "payee", "project", "settles"], many: ["settles"] }
|
|
@@ -39403,7 +39697,7 @@ var recordStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
39403
39697
|
};
|
|
39404
39698
|
}, "recordStoreOver");
|
|
39405
39699
|
|
|
39406
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
39700
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.564.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_0a4d79b5da58b1179a36aa928f36b150/node_modules/@wirecat/cli-core/dist/store/sqlite/ranges.js
|
|
39407
39701
|
var markRange = /* @__PURE__ */ __name(({ orm, now: now2 }, chatKey, from2, to) => {
|
|
39408
39702
|
const touching = and(eq(syncRanges.chatId, chatKey), lte(syncRanges.fromKey, to + 1), gte(syncRanges.toKey, from2 - 1));
|
|
39409
39703
|
let merged = { from: from2, to };
|
|
@@ -39416,7 +39710,7 @@ var markRange = /* @__PURE__ */ __name(({ orm, now: now2 }, chatKey, from2, to)
|
|
|
39416
39710
|
}, "markRange");
|
|
39417
39711
|
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");
|
|
39418
39712
|
|
|
39419
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
39713
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.564.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_0a4d79b5da58b1179a36aa928f36b150/node_modules/@wirecat/cli-core/dist/store/sqlite/task-analysis-marks.js
|
|
39420
39714
|
var prefixOf2 = /* @__PURE__ */ __name(({ provider, account }) => `task_analysis:${provider}:${account}:`, "prefixOf");
|
|
39421
39715
|
var markOf = /* @__PURE__ */ __name((prefix, row2) => ({
|
|
39422
39716
|
chatId: String(row2.key).slice(prefix.length),
|
|
@@ -39437,7 +39731,7 @@ var setTaskAnalysisMark = /* @__PURE__ */ __name((database, account, { chatId, c
|
|
|
39437
39731
|
database.prepare("INSERT INTO store_settings (key, value, at) VALUES (?, ?, ?) ON CONFLICT (key) DO UPDATE SET value = excluded.value, at = excluded.at").run(prefixOf2(account) + chatId, JSON.stringify({ ...saved, checkedAt: checkedAt ?? new Date(now2).toISOString() }), now2);
|
|
39438
39732
|
}, "setTaskAnalysisMark");
|
|
39439
39733
|
|
|
39440
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
39734
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.564.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_0a4d79b5da58b1179a36aa928f36b150/node_modules/@wirecat/cli-core/dist/store/sqlite/task-rule-stops.js
|
|
39441
39735
|
var keyOf4 = /* @__PURE__ */ __name(({ provider, account }) => `task_rules_until:${provider}:${account}`, "keyOf");
|
|
39442
39736
|
var taskRulesStop = /* @__PURE__ */ __name((database, account) => {
|
|
39443
39737
|
const row2 = database.prepare("SELECT value FROM store_settings WHERE key = ?").get(keyOf4(account));
|
|
@@ -39447,7 +39741,7 @@ var setTaskRulesStop = /* @__PURE__ */ __name((database, account, until, now2) =
|
|
|
39447
39741
|
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);
|
|
39448
39742
|
}, "setTaskRulesStop");
|
|
39449
39743
|
|
|
39450
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
39744
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.564.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_0a4d79b5da58b1179a36aa928f36b150/node_modules/@wirecat/cli-core/dist/store/sync.js
|
|
39451
39745
|
var syncStoreOver = /* @__PURE__ */ __name((context) => {
|
|
39452
39746
|
const { database } = context;
|
|
39453
39747
|
const { accountPk: accountPk2, findAccountPk: findAccountPk2, chatKeyOf, chatPkFor: chatPkFor2, identityPk: identityPk2, writeMembers: writeMembers2, writeState: writeState2 } = keysOver(context);
|
|
@@ -39506,7 +39800,7 @@ var syncStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
39506
39800
|
};
|
|
39507
39801
|
}, "syncStoreOver");
|
|
39508
39802
|
|
|
39509
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
39803
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.564.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_0a4d79b5da58b1179a36aa928f36b150/node_modules/@wirecat/cli-core/dist/store/tags.js
|
|
39510
39804
|
var tagsStoreOver = /* @__PURE__ */ __name((context) => {
|
|
39511
39805
|
const { database } = context;
|
|
39512
39806
|
return {
|
|
@@ -39528,7 +39822,7 @@ var tagsStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
39528
39822
|
};
|
|
39529
39823
|
}, "tagsStoreOver");
|
|
39530
39824
|
|
|
39531
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
39825
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.564.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_0a4d79b5da58b1179a36aa928f36b150/node_modules/@wirecat/cli-core/dist/store/sqlite/image-chunks.js
|
|
39532
39826
|
var IS_IMAGE = sql`(a.kind = 'photo' OR a.mime LIKE 'image/%')`;
|
|
39533
39827
|
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
|
|
39534
39828
|
WHERE chat_id = ${chatKey} AND deleted_at IS NULL AND trim(text) <> '' AND id <> ${messagePk}
|
|
@@ -39655,7 +39949,7 @@ var savePictureChunks = /* @__PURE__ */ __name(({ orm, now: now2, database }, ac
|
|
|
39655
39949
|
dropUnusedVectors(database, released.map(({ hash: hash2 }) => hash2));
|
|
39656
39950
|
}, "savePictureChunks");
|
|
39657
39951
|
|
|
39658
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
39952
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.564.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_0a4d79b5da58b1179a36aa928f36b150/node_modules/@wirecat/cli-core/dist/store/sqlite/message-chunks.js
|
|
39659
39953
|
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,
|
|
39660
39954
|
EXISTS (SELECT 1 FROM embeddings v WHERE v.model = ${model} AND v.content_hash = k.content_hash) AS embedded
|
|
39661
39955
|
FROM messages m
|
|
@@ -39744,7 +40038,7 @@ var nearestMessages = /* @__PURE__ */ __name((context, accountPk2, { limit, quer
|
|
|
39744
40038
|
return plain2(best(found2));
|
|
39745
40039
|
}, "nearestMessages");
|
|
39746
40040
|
|
|
39747
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
40041
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.564.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_0a4d79b5da58b1179a36aa928f36b150/node_modules/@wirecat/cli-core/dist/store/vectors.js
|
|
39748
40042
|
var accountVectorsOver = /* @__PURE__ */ __name((context, mail) => {
|
|
39749
40043
|
const { database } = context;
|
|
39750
40044
|
const { findAccountPk: findAccountPk2, findChatPk: findChatPk2, chatKeyOf } = keysOver(context);
|
|
@@ -40002,7 +40296,7 @@ var vectorsStoreOver = /* @__PURE__ */ __name((context, keyed) => ({
|
|
|
40002
40296
|
embeddedHashes: /* @__PURE__ */ __name(async (model, hashes) => embeddedHashes(context, model, hashes), "embeddedHashes")
|
|
40003
40297
|
}), "vectorsStoreOver");
|
|
40004
40298
|
|
|
40005
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
40299
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.564.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_0a4d79b5da58b1179a36aa928f36b150/node_modules/@wirecat/cli-core/dist/store/sqlite/store-tables.js
|
|
40006
40300
|
import { existsSync, readFileSync as readFileSync4 } from "node:fs";
|
|
40007
40301
|
import { dirname as dirname2, join as join2 } from "node:path";
|
|
40008
40302
|
var BOOKKEEPING = ["schema_migrations", "store_settings"];
|
|
@@ -40090,10 +40384,10 @@ var lastBackup = /* @__PURE__ */ __name((path) => {
|
|
|
40090
40384
|
}
|
|
40091
40385
|
}, "lastBackup");
|
|
40092
40386
|
|
|
40093
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
40387
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.564.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_0a4d79b5da58b1179a36aa928f36b150/node_modules/@wirecat/cli-core/dist/store/providers.js
|
|
40094
40388
|
var registerProvider2 = /* @__PURE__ */ __name((store, entry2) => store.accounts.registerProvider(entry2), "registerProvider");
|
|
40095
40389
|
|
|
40096
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
40390
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.564.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_0a4d79b5da58b1179a36aa928f36b150/node_modules/@wirecat/cli-core/dist/store/sqlite/store-contents.js
|
|
40097
40391
|
var COUNTED_TABLES = [
|
|
40098
40392
|
"accounts",
|
|
40099
40393
|
"chats",
|
|
@@ -40178,7 +40472,7 @@ var storeContents = /* @__PURE__ */ __name((database) => {
|
|
|
40178
40472
|
};
|
|
40179
40473
|
}, "storeContents");
|
|
40180
40474
|
|
|
40181
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
40475
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.564.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_0a4d79b5da58b1179a36aa928f36b150/node_modules/@wirecat/cli-core/dist/store/store.js
|
|
40182
40476
|
var openStore = /* @__PURE__ */ __name(async (options = {}) => {
|
|
40183
40477
|
const context = await openStoreContext(options);
|
|
40184
40478
|
try {
|
|
@@ -40458,6 +40752,7 @@ export {
|
|
|
40458
40752
|
contextSource,
|
|
40459
40753
|
contextEvidenceRequest,
|
|
40460
40754
|
MAIL_AGENDA_COLUMNS,
|
|
40755
|
+
mailOwnText,
|
|
40461
40756
|
AGENDA_COLUMNS,
|
|
40462
40757
|
correctWords,
|
|
40463
40758
|
THREAD_COLUMNS,
|
|
@@ -40470,9 +40765,13 @@ export {
|
|
|
40470
40765
|
DEFAULT_AGENT_CLOSE,
|
|
40471
40766
|
certaintyOf,
|
|
40472
40767
|
savedAgentClose,
|
|
40768
|
+
MAIL_FINDINGS_KIND,
|
|
40769
|
+
TASK_CLOSE_KIND,
|
|
40473
40770
|
DEFAULT_DECISION_POLICY,
|
|
40771
|
+
isOwnerOnlyKind,
|
|
40474
40772
|
mayDecide,
|
|
40475
40773
|
assertMayDecide,
|
|
40774
|
+
deciderAuthor,
|
|
40476
40775
|
minorUnits,
|
|
40477
40776
|
moneyOf,
|
|
40478
40777
|
INVOICE_DIRECTIONS,
|
|
@@ -40491,6 +40790,7 @@ export {
|
|
|
40491
40790
|
savedFirstPassPerChat,
|
|
40492
40791
|
TASK_SORTS,
|
|
40493
40792
|
PROJECT_TASK_FIELDS,
|
|
40793
|
+
withoutField,
|
|
40494
40794
|
TASK_RELATION_KINDS,
|
|
40495
40795
|
TASK_ROLES,
|
|
40496
40796
|
historyStartKey,
|
|
@@ -40503,6 +40803,8 @@ export {
|
|
|
40503
40803
|
AUTHOR_MEASURES,
|
|
40504
40804
|
rankingOptions,
|
|
40505
40805
|
RANKING_TOKENIZER_VERSION,
|
|
40806
|
+
rankingQuestion,
|
|
40807
|
+
delayStats,
|
|
40506
40808
|
rankingContextRange,
|
|
40507
40809
|
calendarKey,
|
|
40508
40810
|
pendingNormalization,
|
|
@@ -40514,9 +40816,9 @@ export {
|
|
|
40514
40816
|
EVIDENCE_FINDINGS_KIND,
|
|
40515
40817
|
validateEvidenceFindings,
|
|
40516
40818
|
calendarMoment,
|
|
40517
|
-
MAIL_FINDINGS_KIND,
|
|
40518
40819
|
PROPOSAL_STATUSES,
|
|
40519
40820
|
proposerOfAction,
|
|
40821
|
+
assertGenericAction,
|
|
40520
40822
|
involvementStoreOver,
|
|
40521
40823
|
ORGANIZATION_KINDS,
|
|
40522
40824
|
PROJECT_TYPES,
|