@wirecat/tg-cli 0.130.0 → 0.131.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin/tg.js +2 -2
- package/dist/bundle/{adapter-2XFPXBTA.js → adapter-TA637IRT.js} +51 -51
- package/dist/bundle/{all-profiles-GXFPZLYU.js → all-profiles-7M3GBCB6.js} +5 -5
- package/dist/bundle/{anthropic-FHS5XNK5.js → anthropic-P3THLZWO.js} +2 -2
- package/dist/bundle/{app-server-IZMFSFP2.js → app-server-OE5EAXIY.js} +45 -45
- package/dist/bundle/{bot-api-V3ZJ75KE.js → bot-api-WYR2C4A5.js} +52 -52
- package/dist/bundle/{bot-history-EJQOD4AQ.js → bot-history-PKJTHU7L.js} +16 -16
- package/dist/bundle/{bun-GBAZFRCV.js → bun-XMZJDDEA.js} +2 -2
- package/dist/bundle/{bun-sqlite-JB4BX6X7.js → bun-sqlite-F5RWCB2N.js} +3 -3
- package/dist/bundle/{chunk-XXW6PFAX.js → chunk-2OXR2MRV.js} +1 -1
- package/dist/bundle/{chunk-HHUK3XO5.js → chunk-2TOJQQKS.js} +1 -1
- package/dist/bundle/{chunk-TGRB4SSZ.js → chunk-2U6XE4HI.js} +4 -4
- package/dist/bundle/{chunk-6M3FAHPS.js → chunk-34PRGA7E.js} +2 -2
- package/dist/bundle/{chunk-4BJAQNJ5.js → chunk-43KSYUZU.js} +5 -5
- package/dist/bundle/{chunk-66UG67CE.js → chunk-5AJ5RLJW.js} +10 -10
- package/dist/bundle/{chunk-7F3LOHRB.js → chunk-5N7TJ6TJ.js} +154 -151
- package/dist/bundle/{chunk-QJDHRBXL.js → chunk-5ZIT6JXP.js} +6 -6
- package/dist/bundle/{chunk-RZPMFVWM.js → chunk-6BPM3LNR.js} +5 -5
- package/dist/bundle/{chunk-EUL7HMUL.js → chunk-6O5AD3GA.js} +1 -1
- package/dist/bundle/{chunk-PWQKGFS2.js → chunk-6TJTQ4I4.js} +28 -28
- package/dist/bundle/{chunk-KY3JLXW2.js → chunk-76UAXRDY.js} +2 -2
- package/dist/bundle/{chunk-OJMDKWWL.js → chunk-AEIDEIVB.js} +355 -321
- package/dist/bundle/{chunk-M327UNS6.js → chunk-AJQ6JFLY.js} +5 -5
- package/dist/bundle/{chunk-VTJ3AOTT.js → chunk-BFERGEBI.js} +16 -16
- package/dist/bundle/{chunk-42LRWOTT.js → chunk-BXW6FGLD.js} +11 -11
- package/dist/bundle/{chunk-MVFSWKTM.js → chunk-EXMJDHBM.js} +10 -10
- package/dist/bundle/{chunk-S5UTBEV3.js → chunk-EZBMLKBK.js} +35 -34
- package/dist/bundle/{chunk-NRCY3WBC.js → chunk-GNIROVSK.js} +1 -1
- package/dist/bundle/{chunk-C4ALE7CH.js → chunk-H655CMXJ.js} +1 -1
- package/dist/bundle/{chunk-OKTRB4ZQ.js → chunk-ITYDJIRC.js} +1 -1
- package/dist/bundle/{chunk-QDEP2QOA.js → chunk-IULSIKEM.js} +2 -2
- package/dist/bundle/{chunk-FH4YIBBH.js → chunk-J2QQZVEN.js} +2 -2
- package/dist/bundle/{chunk-OWVQMK7G.js → chunk-JDLNI7BU.js} +518 -382
- package/dist/bundle/{chunk-B5RGPZDZ.js → chunk-JF4AJNCE.js} +5 -5
- package/dist/bundle/{chunk-2LPODKIF.js → chunk-JSE4OBYI.js} +16 -114
- package/dist/bundle/{chunk-SZB5WRMI.js → chunk-L2SMUTJY.js} +1 -1
- package/dist/bundle/{chunk-RAFK5KXU.js → chunk-LDSTUBLY.js} +7 -7
- package/dist/bundle/{chunk-XHX5D5VE.js → chunk-LEPDRO3O.js} +147 -62
- package/dist/bundle/{chunk-IV6SIKVH.js → chunk-LJO6MMQG.js} +3 -3
- package/dist/bundle/{chunk-LQPZDDDP.js → chunk-LTP4BYHJ.js} +5 -5
- package/dist/bundle/{chunk-QBNEWEJC.js → chunk-LWSOCKOD.js} +2 -2
- package/dist/bundle/{chunk-F6CV4KUN.js → chunk-MYC3M4BY.js} +2 -2
- package/dist/bundle/{chunk-I5PILOTU.js → chunk-NOZZHEMD.js} +1 -1
- package/dist/bundle/{chunk-ZRQQOGAZ.js → chunk-NTORQXAS.js} +3 -3
- package/dist/bundle/{chunk-LPT5T6PU.js → chunk-NXNSEFGR.js} +22 -22
- package/dist/bundle/{chunk-3XMUP55N.js → chunk-O73DZURO.js} +9 -9
- package/dist/bundle/{chunk-2JZJPVBH.js → chunk-O7X6RM5R.js} +4 -4
- package/dist/bundle/{chunk-FIO5NMK3.js → chunk-OOSX7K7G.js} +6 -6
- package/dist/bundle/{chunk-IRWSZJYL.js → chunk-OPG54IFH.js} +51 -51
- package/dist/bundle/{chunk-O2ULG7OO.js → chunk-OX5EAUKF.js} +2 -2
- package/dist/bundle/{chunk-RPWYTOLI.js → chunk-P6KGEZIS.js} +1 -1
- package/dist/bundle/{chunk-QFVIHBLD.js → chunk-PD4RREQB.js} +1 -1
- package/dist/bundle/{chunk-IBSHQWIJ.js → chunk-PHGH5N4C.js} +1 -1
- package/dist/bundle/{chunk-EB2JE722.js → chunk-QGFUUJPL.js} +1 -1
- package/dist/bundle/{chunk-GYCKRIRK.js → chunk-S2IET7WM.js} +2 -2
- package/dist/bundle/{chunk-BMSS3PCY.js → chunk-SLT2PBFP.js} +13 -13
- package/dist/bundle/{chunk-CKJ73EF3.js → chunk-SQ2JLZFK.js} +1 -1
- package/dist/bundle/{chunk-GSHTLLCJ.js → chunk-SS5H2XAT.js} +2 -2
- package/dist/bundle/{chunk-VSPSHBAC.js → chunk-TT6OHNV2.js} +1 -1
- package/dist/bundle/{chunk-6WGAWISN.js → chunk-UGYC2FV5.js} +1 -1
- package/dist/bundle/{chunk-6JBRQ6PM.js → chunk-UUNQV4YL.js} +48 -13
- package/dist/bundle/{chunk-X5H5NERR.js → chunk-VNJZXV7E.js} +4 -4
- package/dist/bundle/{chunk-MS6YEIG5.js → chunk-VVUUP5NF.js} +12 -12
- package/dist/bundle/{chunk-QJLCEOAP.js → chunk-WG6UZJ3E.js} +1 -1
- package/dist/bundle/{chunk-GGGBPWUS.js → chunk-WUIKJJ5A.js} +7 -7
- package/dist/bundle/{chunk-3KZG63EH.js → chunk-XC2YJDDK.js} +2 -2
- package/dist/bundle/{chunk-SYZXOEHY.js → chunk-YJ4BPNWI.js} +3 -3
- package/dist/bundle/{chunk-G2SMVYBU.js → chunk-YZTMQE62.js} +1 -1
- package/dist/bundle/{chunk-VXWDQDRU.js → chunk-Z2TCTTPJ.js} +497 -410
- package/dist/bundle/command-contract-DAQYQF6R.js +37 -0
- package/dist/bundle/{command-server-entry-YR6ONDWO.js → command-server-entry-6FH3RXJ2.js} +23 -23
- package/dist/bundle/{decode-VUKGWFSW.js → decode-UBRT2QDP.js} +2 -2
- package/dist/bundle/{echarts-GOV5M733.js → echarts-PG45GQLR.js} +2 -2
- package/dist/bundle/{embed-2IVIYNAJ.js → embed-BUQDSZ57.js} +3 -3
- package/dist/bundle/{embedder-2HU7JYZK.js → embedder-TXA3EV7O.js} +6 -6
- package/dist/bundle/{entry-CSTCXYI5.js → entry-JWIEF57D.js} +6 -6
- package/dist/bundle/{first-run-3IZGXZT5.js → first-run-5VTHKMK5.js} +6 -6
- package/dist/bundle/first-screen-PTHIZ5ZF.js +35 -0
- package/dist/bundle/{instructions-YSXV6FAC.js → instructions-ZMEPWTFO.js} +1 -1
- package/dist/bundle/{meeting-combined-X4E3LSIJ.js → meeting-combined-DU3RJR6X.js} +10 -10
- package/dist/bundle/{meeting-model-FQBDHGRU.js → meeting-model-5FVNZCTL.js} +8 -8
- package/dist/bundle/{meeting-semantic-ONNEOJX5.js → meeting-semantic-HUMYFMO7.js} +2 -2
- package/dist/bundle/{node-FMQWCZRS.js → node-N4DQQJKK.js} +2 -2
- package/dist/bundle/{node-sqlite-YN5OKOC6.js → node-sqlite-MG4KFXYY.js} +4 -4
- package/dist/bundle/{oauth-EW7PTZVT.js → oauth-NKDSXEH6.js} +4 -4
- package/dist/bundle/{open-Q2RDY344.js → open-DV2YUU2M.js} +2 -2
- package/dist/bundle/{openai-STON6G3O.js → openai-FEKMZOUJ.js} +12 -12
- package/dist/bundle/{process-OQUC2TW3.js → process-QZS3TE6A.js} +1 -1
- package/dist/bundle/{program-N5BT75OC.js → program-FNDGXEVS.js} +56 -56
- package/dist/bundle/{prompt-WHVF7UTW.js → prompt-C7RSBNH5.js} +2 -2
- package/dist/bundle/{recognize-YDQWMXNI.js → recognize-5BL763FS.js} +1 -1
- package/dist/bundle/{remote-477LQHP6.js → remote-CXAKRC7X.js} +6 -6
- package/dist/bundle/{rerank-4YPB26FG.js → rerank-XAEXY5A4.js} +4 -4
- package/dist/bundle/{serve-FXJNUOTS.js → serve-JLZGFTZH.js} +6 -6
- package/dist/bundle/{server-2S6HFBGR.js → server-GF3TV2U7.js} +37 -37
- package/dist/bundle/server-GLPEWUYT.js +69 -0
- package/dist/bundle/{sqlite-runtime-RXYNJYMC.js → sqlite-runtime-3OVQ7OTM.js} +3 -3
- package/dist/bundle/{state-I2GGYGRL.js → state-FGJKQKC2.js} +3 -3
- package/dist/bundle/{store-VQXIB6KV.js → store-2J5VJZQY.js} +13 -13
- package/dist/bundle/{store-KX3AAQZH.js → store-WYLMNAAQ.js} +15 -15
- package/dist/bundle/store-maintenance-command-QN6QH6RA.js +60 -0
- package/dist/bundle/tg.js +3 -3
- package/dist/program.js +1 -1
- package/dist/program.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +2 -2
- package/skills/tg-cli/SKILL.md +11 -9
- package/dist/bundle/command-contract-G752BLKA.js +0 -37
- package/dist/bundle/first-screen-7QSNCZIK.js +0 -35
- package/dist/bundle/server-UOSUTZNE.js +0 -69
- package/dist/bundle/store-maintenance-command-LW2MMDLY.js +0 -60
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
plainQuery,
|
|
12
12
|
searchError,
|
|
13
13
|
tooWideTerm
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-OOSX7K7G.js";
|
|
15
15
|
import {
|
|
16
16
|
DEFAULT_STEMMERS,
|
|
17
17
|
DEFAULT_STEMMERS_VERSION,
|
|
@@ -21,12 +21,12 @@ import {
|
|
|
21
21
|
analyzerIdentity,
|
|
22
22
|
createStemmer,
|
|
23
23
|
parseStemmers
|
|
24
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-WUIKJJ5A.js";
|
|
25
25
|
import {
|
|
26
26
|
NORMALIZER_VERSION,
|
|
27
27
|
fold,
|
|
28
28
|
normalize
|
|
29
|
-
} from "./chunk-
|
|
29
|
+
} from "./chunk-2OXR2MRV.js";
|
|
30
30
|
import {
|
|
31
31
|
SQLiteTable,
|
|
32
32
|
TableAliasProxyHandler,
|
|
@@ -51,17 +51,17 @@ import {
|
|
|
51
51
|
sql,
|
|
52
52
|
sqliteTable,
|
|
53
53
|
text
|
|
54
|
-
} from "./chunk-
|
|
54
|
+
} from "./chunk-SQ2JLZFK.js";
|
|
55
55
|
import {
|
|
56
56
|
quietSqliteWarning,
|
|
57
57
|
storeCapable
|
|
58
|
-
} from "./chunk-
|
|
58
|
+
} from "./chunk-AJQ6JFLY.js";
|
|
59
59
|
import {
|
|
60
60
|
PRAGMAS,
|
|
61
61
|
TIME_LIMIT_FUNCTION,
|
|
62
62
|
TimeLimitReached,
|
|
63
63
|
isQueryOnly
|
|
64
|
-
} from "./chunk-
|
|
64
|
+
} from "./chunk-H655CMXJ.js";
|
|
65
65
|
import {
|
|
66
66
|
ACCOUNT_GROUPS,
|
|
67
67
|
ADDED_ACCOUNT,
|
|
@@ -187,20 +187,20 @@ import {
|
|
|
187
187
|
usableLinkSql,
|
|
188
188
|
useStoredProviders,
|
|
189
189
|
walletLine
|
|
190
|
-
} from "./chunk-
|
|
190
|
+
} from "./chunk-EZBMLKBK.js";
|
|
191
191
|
import {
|
|
192
192
|
sqliteCode
|
|
193
|
-
} from "./chunk-
|
|
193
|
+
} from "./chunk-LWSOCKOD.js";
|
|
194
194
|
import {
|
|
195
195
|
normalizeTag,
|
|
196
196
|
tagOf
|
|
197
|
-
} from "./chunk-
|
|
197
|
+
} from "./chunk-PHGH5N4C.js";
|
|
198
198
|
import {
|
|
199
199
|
DEFAULT_TASK_CATEGORIES,
|
|
200
200
|
sharedConfigPath,
|
|
201
201
|
storedTaskCategories,
|
|
202
202
|
taskCategoriesReader
|
|
203
|
-
} from "./chunk-
|
|
203
|
+
} from "./chunk-JF4AJNCE.js";
|
|
204
204
|
import {
|
|
205
205
|
CHAT_MESSAGES_READ,
|
|
206
206
|
FACT_TYPES,
|
|
@@ -211,6 +211,7 @@ import {
|
|
|
211
211
|
OPERATORS_BY_TYPE,
|
|
212
212
|
READ_BUDGET_EXCEEDED,
|
|
213
213
|
REVIEW_LIMIT,
|
|
214
|
+
TRANSCRIPT_WORDS,
|
|
214
215
|
aggregateMeetingCounts,
|
|
215
216
|
aggregateMeetingStats,
|
|
216
217
|
calendarText,
|
|
@@ -254,11 +255,11 @@ import {
|
|
|
254
255
|
validateQuery,
|
|
255
256
|
walkQuery,
|
|
256
257
|
zonedMoment
|
|
257
|
-
} from "./chunk-
|
|
258
|
+
} from "./chunk-LEPDRO3O.js";
|
|
258
259
|
import {
|
|
259
260
|
refuseOwnerStoreInTests,
|
|
260
261
|
storePath
|
|
261
|
-
} from "./chunk-
|
|
262
|
+
} from "./chunk-TT6OHNV2.js";
|
|
262
263
|
import {
|
|
263
264
|
array,
|
|
264
265
|
boolean,
|
|
@@ -10028,7 +10029,7 @@ var require_cjs = __commonJS({
|
|
|
10028
10029
|
}
|
|
10029
10030
|
});
|
|
10030
10031
|
|
|
10031
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
10032
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/account-store.js
|
|
10032
10033
|
var bindArea = /* @__PURE__ */ __name(({ keyed, whole }, account) => {
|
|
10033
10034
|
const methods = whole;
|
|
10034
10035
|
return Object.fromEntries(Object.keys(keyed).map((name) => [
|
|
@@ -10156,7 +10157,7 @@ var bindAccount = /* @__PURE__ */ __name((store, account, areas, owners) => {
|
|
|
10156
10157
|
};
|
|
10157
10158
|
}, "bindAccount");
|
|
10158
10159
|
|
|
10159
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
10160
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sqlite/drizzle/core.js
|
|
10160
10161
|
var IndexBuilderOn = class {
|
|
10161
10162
|
static {
|
|
10162
10163
|
__name(this, "IndexBuilderOn");
|
|
@@ -10351,7 +10352,7 @@ function alias(table, alias2) {
|
|
|
10351
10352
|
}
|
|
10352
10353
|
__name(alias, "alias");
|
|
10353
10354
|
|
|
10354
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
10355
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/domain/record-fields.js
|
|
10355
10356
|
var DECIMAL_PATTERN = "^[0-9]{1,16}(\\.[0-9]{1,6})?$";
|
|
10356
10357
|
var SIGNED_DECIMAL = "^-?[0-9]{1,16}(\\.[0-9]{1,6})?$";
|
|
10357
10358
|
var DAY = "^[0-9]{4}-[0-9]{2}-[0-9]{2}$";
|
|
@@ -10401,7 +10402,7 @@ var arrayOf = /* @__PURE__ */ __name((item, maxItems, description) => ({
|
|
|
10401
10402
|
}), "arrayOf");
|
|
10402
10403
|
var isObject = /* @__PURE__ */ __name((value) => typeof value === "object" && value !== null && !Array.isArray(value), "isObject");
|
|
10403
10404
|
|
|
10404
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
10405
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/domain/record-types.js
|
|
10405
10406
|
var kept = /* @__PURE__ */ __name((description) => ({ description }), "kept");
|
|
10406
10407
|
var PARTY = ["person", "organization"];
|
|
10407
10408
|
var ORGANIZATION = ["organization"];
|
|
@@ -10796,7 +10797,7 @@ var hasV1Roles = /* @__PURE__ */ __name((type) => rolesOf2(type).some(([, role])
|
|
|
10796
10797
|
var IDENTITY_TYPES = RECORD_ENTITY_TYPES.filter((type) => RECORD_TYPES[type].review === "identity");
|
|
10797
10798
|
var article = /* @__PURE__ */ __name((word2) => /^[aeiou]/.test(word2) ? "an" : "a", "article");
|
|
10798
10799
|
|
|
10799
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
10800
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sqlite/entity-types.js
|
|
10800
10801
|
var ENTITY_TABLES = {
|
|
10801
10802
|
...RECORD_TABLES,
|
|
10802
10803
|
account: "accounts",
|
|
@@ -10835,11 +10836,11 @@ var orphanPointers = /* @__PURE__ */ __name((database) => pointerPairs(database)
|
|
|
10835
10836
|
return { table, pointer, type, count: count2, known: known2 };
|
|
10836
10837
|
}).filter(({ count: count2 }) => count2 > 0)), "orphanPointers");
|
|
10837
10838
|
|
|
10838
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
10839
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/identity-links.js
|
|
10839
10840
|
var IDENTITY_LINK_KIND = "identity_link";
|
|
10840
10841
|
var IDENTITY_LINK_SIGNALS = ["agent", "phone", "email", "guest-email", "name", "account"];
|
|
10841
10842
|
|
|
10842
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
10843
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sqlite/merged-persons.js
|
|
10843
10844
|
var SEPARATIONS = ["unlink", "split", "undo-merge"];
|
|
10844
10845
|
var mergeSql = /* @__PURE__ */ __name((event2) => `(${event2}.from_person_id IS NOT NULL AND ${event2}.from_person_id <> ${event2}.to_person_id AND ${event2}.method NOT IN (${SEPARATIONS.map((method) => `'${method}'`).join(", ")}) AND NOT EXISTS (SELECT 1 FROM identity_link_events stay WHERE stay.to_person_id = ${event2}.from_person_id AND stay.identity_id <> ${event2}.identity_id AND stay.id < ${event2}.id AND stay.id = (SELECT max(s.id) FROM identity_link_events s WHERE s.identity_id = stay.identity_id AND s.id < ${event2}.id) AND NOT EXISTS (SELECT 1 FROM identity_link_events went WHERE went.identity_id = stay.identity_id AND went.from_person_id = ${event2}.from_person_id AND went.to_person_id = ${event2}.to_person_id AND went.id = (SELECT min(w.id) FROM identity_link_events w WHERE w.identity_id = stay.identity_id AND w.id > ${event2}.id))))`, "mergeSql");
|
|
10845
10846
|
var mergedAwaySql = /* @__PURE__ */ __name((person2) => `(${person2}.owner = 0 AND NOT EXISTS (SELECT 1 FROM identity_links ml WHERE ml.person_id = ${person2}.id) AND EXISTS (SELECT 1 FROM identity_link_events me WHERE me.from_person_id = ${person2}.id AND ${mergeSql("me")}))`, "mergedAwaySql");
|
|
@@ -10871,7 +10872,7 @@ var samePersons = /* @__PURE__ */ __name((database, pk) => {
|
|
|
10871
10872
|
}, "samePersons");
|
|
10872
10873
|
var idsOf = /* @__PURE__ */ __name((database, type, id2) => JSON.stringify(type === "person" ? samePersons(database, id2) : [id2]), "idsOf");
|
|
10873
10874
|
|
|
10874
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
10875
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sqlite/identity-link-rows.js
|
|
10875
10876
|
var pairOf = /* @__PURE__ */ __name((a, b) => [Number(a), Number(b)].sort((x, y) => x - y).join("-"), "pairOf");
|
|
10876
10877
|
var pkOf = /* @__PURE__ */ __name((database, ref3) => {
|
|
10877
10878
|
const at2 = ref3.indexOf(":");
|
|
@@ -10978,13 +10979,13 @@ var forgetErasedLinks = /* @__PURE__ */ __name((database) => {
|
|
|
10978
10979
|
database.prepare("DELETE FROM proposed_actions WHERE id = ?").run(Number(row2.id));
|
|
10979
10980
|
}, "forgetErasedLinks");
|
|
10980
10981
|
|
|
10981
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
10982
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/identity-splits.js
|
|
10982
10983
|
var IDENTITY_SPLIT_KIND = "identity_split";
|
|
10983
10984
|
|
|
10984
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
10985
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/mail-findings.js
|
|
10985
10986
|
var MAIL_FINDINGS_KIND = "mail_findings";
|
|
10986
10987
|
|
|
10987
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
10988
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/decisions.js
|
|
10988
10989
|
var TASK_CLOSE_KIND = "task_close";
|
|
10989
10990
|
var DEFAULT_DECISION_POLICY = { agentDecisions: false, ruleProposalsOwnerOnly: true };
|
|
10990
10991
|
var isOwnerOnlyKind = /* @__PURE__ */ __name((kind3) => kind3 === MAIL_FINDINGS_KIND || kind3 === MEETING_FINDINGS_KIND || kind3 === TASK_CLOSE_KIND || kind3 === SOURCE_REVIEW_KIND || kind3 === IDENTITY_LINK_KIND || kind3 === IDENTITY_SPLIT_KIND, "isOwnerOnlyKind");
|
|
@@ -11032,7 +11033,7 @@ var assertMayDecide = /* @__PURE__ */ __name((row2, by, policy = DEFAULT_DECISIO
|
|
|
11032
11033
|
}, "assertMayDecide");
|
|
11033
11034
|
var deciderAuthor = /* @__PURE__ */ __name((by) => by === "owner" ? "owner" : { bot: by.bot, ...by.model === void 0 ? {} : { model: by.model } }, "deciderAuthor");
|
|
11034
11035
|
|
|
11035
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
11036
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/domain/addresses.js
|
|
11036
11037
|
var EMAIL_ADDRESS = /^[^\s@]+@[^\s@]+\.[^\s@]+$/u;
|
|
11037
11038
|
var isEmailAddress = /* @__PURE__ */ __name((value) => EMAIL_ADDRESS.test(value), "isEmailAddress");
|
|
11038
11039
|
var ROLE_ADDRESS_WORDS = {
|
|
@@ -11094,7 +11095,7 @@ var PERSON_LIKE = /* @__PURE__ */ new Set(["hr"]);
|
|
|
11094
11095
|
var isPersonLikeRoleAddress = /* @__PURE__ */ __name((address) => PERSON_LIKE.has(localWord(address)), "isPersonLikeRoleAddress");
|
|
11095
11096
|
var isNoReplyAddress = /* @__PURE__ */ __name((address) => NO_REPLY.has(localWord(address)), "isNoReplyAddress");
|
|
11096
11097
|
|
|
11097
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
11098
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/mail/score.js
|
|
11098
11099
|
var import_disposable_email_domains_js = __toESM(require_dist(), 1);
|
|
11099
11100
|
var import_tldts = __toESM(require_cjs(), 1);
|
|
11100
11101
|
var FREE_MAIL = /* @__PURE__ */ new Set([
|
|
@@ -11124,7 +11125,7 @@ var FREE_MAIL = /* @__PURE__ */ new Set([
|
|
|
11124
11125
|
]);
|
|
11125
11126
|
var DAY_MS = 24 * 60 * 60 * 1e3;
|
|
11126
11127
|
|
|
11127
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
11128
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sqlite/address-organization.js
|
|
11128
11129
|
var BY_ADDRESS = "SELECT DISTINCT o.id FROM organizations o JOIN organization_identities oi ON oi.organization_id = o.id JOIN identities i ON i.id = oi.identity_id WHERE o.deleted_at IS NULL AND i.provider = 'email' AND ";
|
|
11129
11130
|
var idsOf2 = /* @__PURE__ */ __name((rows) => rows.map((row2) => Number(row2.id)), "idsOf");
|
|
11130
11131
|
var holdAddress = /* @__PURE__ */ __name(({ database, now: now2 }, organization2, email, { method, author }) => {
|
|
@@ -11149,7 +11150,7 @@ var organizationOfAddress = /* @__PURE__ */ __name((context, { name, email, meth
|
|
|
11149
11150
|
return id2;
|
|
11150
11151
|
}, "organizationOfAddress");
|
|
11151
11152
|
|
|
11152
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
11153
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/domain/phone-plans.generated.js
|
|
11153
11154
|
var PHONE_PLANS = [
|
|
11154
11155
|
{
|
|
11155
11156
|
country: "us",
|
|
@@ -11529,7 +11530,7 @@ var PHONE_PLANS = [
|
|
|
11529
11530
|
}
|
|
11530
11531
|
];
|
|
11531
11532
|
|
|
11532
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
11533
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/domain/phones.js
|
|
11533
11534
|
var PHONE_COUNTRIES = PHONE_PLANS.map((plan) => plan.country);
|
|
11534
11535
|
var DEFAULT_PHONE_COUNTRIES = ["ru"];
|
|
11535
11536
|
var parsePhoneCountries = /* @__PURE__ */ __name((value) => {
|
|
@@ -11604,10 +11605,10 @@ var storedPhone = /* @__PURE__ */ __name((raw, provider) => {
|
|
|
11604
11605
|
return found2 ? `+${found2[1]}` : void 0;
|
|
11605
11606
|
}, "storedPhone");
|
|
11606
11607
|
|
|
11607
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
11608
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sqlite/transaction.js
|
|
11608
11609
|
import { AsyncLocalStorage } from "node:async_hooks";
|
|
11609
11610
|
|
|
11610
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
11611
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/journal.js
|
|
11611
11612
|
import { existsSync, statSync } from "node:fs";
|
|
11612
11613
|
var watched = /* @__PURE__ */ new WeakMap();
|
|
11613
11614
|
var walInode = /* @__PURE__ */ __name((store) => statSync(`${store}-wal`, { throwIfNoEntry: false })?.ino, "walInode");
|
|
@@ -11633,7 +11634,7 @@ var checkJournal = /* @__PURE__ */ __name((database) => {
|
|
|
11633
11634
|
throw new CliError("conflict", "the store's journal file was deleted or replaced by another program while this command had the store open, so nothing more is written; `store recover` says what to do", { reason: "store.journal-replaced" });
|
|
11634
11635
|
}, "checkJournal");
|
|
11635
11636
|
|
|
11636
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
11637
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/write-events.js
|
|
11637
11638
|
var WRITE = /^\s*(?:WITH\b[\s\S]*?\)\s*)?(INSERT|REPLACE|UPDATE|DELETE)\b(?:\s+OR\s+[A-Za-z]+)?\s+(?:INTO\s+|FROM\s+)?(?:("?)(\w+)\2\.)?["`[]?(\w+)/i;
|
|
11638
11639
|
var writeTarget = /* @__PURE__ */ __name((sql2) => {
|
|
11639
11640
|
const match = WRITE.exec(sql2);
|
|
@@ -11713,7 +11714,7 @@ var committedWrites = /* @__PURE__ */ __name((database) => {
|
|
|
11713
11714
|
}, "committedWrites");
|
|
11714
11715
|
var droppedWrites = /* @__PURE__ */ __name((database) => tallies.get(database)?.pending.clear(), "droppedWrites");
|
|
11715
11716
|
|
|
11716
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
11717
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sqlite/involvement-queue.js
|
|
11717
11718
|
var ARMS = [
|
|
11718
11719
|
[
|
|
11719
11720
|
"message",
|
|
@@ -11841,7 +11842,7 @@ var drainInvolvementQueue = /* @__PURE__ */ __name((database, cap = QUEUE_CAP) =
|
|
|
11841
11842
|
return recomputed;
|
|
11842
11843
|
}, "drainInvolvementQueue");
|
|
11843
11844
|
|
|
11844
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
11845
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/domain/mentions.js
|
|
11845
11846
|
import { domainToUnicode } from "node:url";
|
|
11846
11847
|
|
|
11847
11848
|
// node_modules/.pnpm/psl@1.15.0/node_modules/psl/dist/psl.mjs
|
|
@@ -21863,7 +21864,7 @@ var oa = /* @__PURE__ */ __name((e) => {
|
|
|
21863
21864
|
}, "oa");
|
|
21864
21865
|
var na = { parse: O, get: aa, isValid: oa };
|
|
21865
21866
|
|
|
21866
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
21867
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/domain/google-documents.js
|
|
21867
21868
|
var LINK = /https?:\/\/(?:(?:docs|drive|sheets|slides)\.google\.com|forms\.gle)(?:[/?#][^\s<>"'`]*)?/gi;
|
|
21868
21869
|
var ID = /^[\w-]{10,}$/;
|
|
21869
21870
|
var trimUrl = /* @__PURE__ */ __name((url) => {
|
|
@@ -21905,7 +21906,7 @@ var googleDocumentLinks = /* @__PURE__ */ __name((text8) => [...text8.matchAll(L
|
|
|
21905
21906
|
return { url, documentId: googleDocumentId(url) };
|
|
21906
21907
|
}), "googleDocumentLinks");
|
|
21907
21908
|
|
|
21908
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
21909
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/domain/places.js
|
|
21909
21910
|
var BEFORE = [
|
|
21910
21911
|
[/^(?:ул\.?|улиц[аеыу]|улицей)$/iu, "\u0443\u043B\u0438\u0446\u0430"],
|
|
21911
21912
|
[/^(?:пр-т|просп\.?|проспект[аеу]?)$/iu, "\u043F\u0440\u043E\u0441\u043F\u0435\u043A\u0442"],
|
|
@@ -22165,7 +22166,7 @@ var findPlaces = /* @__PURE__ */ __name((text8) => {
|
|
|
22165
22166
|
return found2.sort((a, b) => a.start - b.start);
|
|
22166
22167
|
}, "findPlaces");
|
|
22167
22168
|
|
|
22168
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
22169
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/domain/mentions.js
|
|
22169
22170
|
var MENTION_KINDS = ["phone", "email", "url", "document", "person-name", "place"];
|
|
22170
22171
|
var MENTION_VERSIONS = {
|
|
22171
22172
|
phone: 1,
|
|
@@ -22341,7 +22342,7 @@ var exactlyOne = /* @__PURE__ */ __name((text8, options) => {
|
|
|
22341
22342
|
return one2 && one2.start === 0 && one2.end === text8.length ? one2.value : void 0;
|
|
22342
22343
|
}, "exactlyOne");
|
|
22343
22344
|
|
|
22344
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
22345
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/domain/first-names.js
|
|
22345
22346
|
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";
|
|
22346
22347
|
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";
|
|
22347
22348
|
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";
|
|
@@ -22349,7 +22350,7 @@ var NOT_NAMES = ["\u0436\u0435\u043D\u0430", "\u0436\u0435\u043D\u044B", "\u0436
|
|
|
22349
22350
|
var FIRST_NAMES = [...new Set(`${RUSSIAN} ${EUROPEAN}`.split(" "))];
|
|
22350
22351
|
var NAME_WORDS = WORDS.split(" ");
|
|
22351
22352
|
|
|
22352
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
22353
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/domain/person-names.js
|
|
22353
22354
|
var LATIN_TO_CYRILLIC = {
|
|
22354
22355
|
shch: "\u0449",
|
|
22355
22356
|
sch: "\u0449",
|
|
@@ -22557,7 +22558,7 @@ var findUnknownNames = /* @__PURE__ */ __name((text8, stem, taken) => {
|
|
|
22557
22558
|
return found2;
|
|
22558
22559
|
}, "findUnknownNames");
|
|
22559
22560
|
|
|
22560
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
22561
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/domain/attachments.js
|
|
22561
22562
|
var NOT_FILES = /* @__PURE__ */ new Set([
|
|
22562
22563
|
"webpage",
|
|
22563
22564
|
"share",
|
|
@@ -22598,7 +22599,7 @@ var matchDownloads = /* @__PURE__ */ __name((stored4, files2) => {
|
|
|
22598
22599
|
});
|
|
22599
22600
|
}, "matchDownloads");
|
|
22600
22601
|
|
|
22601
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
22602
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/search/lucene/automaton.js
|
|
22602
22603
|
var any = { kind: "char", ranges: [[0, 1114111]], negate: false };
|
|
22603
22604
|
var literal2 = /* @__PURE__ */ __name((c) => ({
|
|
22604
22605
|
kind: "char",
|
|
@@ -22899,7 +22900,7 @@ var foldRegex = /* @__PURE__ */ __name((pattern, span) => {
|
|
|
22899
22900
|
const chars = [...pattern.normalize("NFC")];
|
|
22900
22901
|
let out = "";
|
|
22901
22902
|
let at2 = 0;
|
|
22902
|
-
const
|
|
22903
|
+
const literal5 = /* @__PURE__ */ __name((c) => {
|
|
22903
22904
|
if (!/[\p{L}\p{N}\p{M}]/u.test(c))
|
|
22904
22905
|
return c;
|
|
22905
22906
|
const folded6 = fold(c);
|
|
@@ -22978,7 +22979,7 @@ var foldRegex = /* @__PURE__ */ __name((pattern, span) => {
|
|
|
22978
22979
|
if (next === void 0)
|
|
22979
22980
|
out += c;
|
|
22980
22981
|
else
|
|
22981
|
-
out += (next.codePointAt(0) ?? 0) < 128 ? `${c}${next}` :
|
|
22982
|
+
out += (next.codePointAt(0) ?? 0) < 128 ? `${c}${next}` : literal5(next);
|
|
22982
22983
|
} else if (c === '"') {
|
|
22983
22984
|
const end = chars.indexOf('"', at2);
|
|
22984
22985
|
if (end < 0) {
|
|
@@ -22993,12 +22994,12 @@ var foldRegex = /* @__PURE__ */ __name((pattern, span) => {
|
|
|
22993
22994
|
} else if (c === "[")
|
|
22994
22995
|
characterClass();
|
|
22995
22996
|
else
|
|
22996
|
-
out +=
|
|
22997
|
+
out += literal5(c);
|
|
22997
22998
|
}
|
|
22998
22999
|
return out;
|
|
22999
23000
|
}, "foldRegex");
|
|
23000
23001
|
|
|
23001
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
23002
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/search/lucene/presets.js
|
|
23002
23003
|
var PRESET_VERSION = 1;
|
|
23003
23004
|
var PRESETS = {
|
|
23004
23005
|
password: {
|
|
@@ -23052,12 +23053,12 @@ var PRESETS = {
|
|
|
23052
23053
|
}
|
|
23053
23054
|
};
|
|
23054
23055
|
|
|
23055
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
23056
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/search/lucene/resolved.js
|
|
23056
23057
|
var hasText = /* @__PURE__ */ __name((node) => node.kind === "predicate" ? node.field === "text" || node.field === "exact" : node.clauses.some(({ node: node2 }) => hasText(node2)), "hasText");
|
|
23057
23058
|
var isStemmed = /* @__PURE__ */ __name((node) => node.field === "text" && (node.operator === "term" || node.operator === "phrase") && node.value !== "", "isStemmed");
|
|
23058
23059
|
var hasStems = /* @__PURE__ */ __name((node) => node.kind === "predicate" ? isStemmed(node) : node.clauses.some(({ node: node2 }) => hasStems(node2)), "hasStems");
|
|
23059
23060
|
|
|
23060
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
23061
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sqlite/mention-links.js
|
|
23061
23062
|
var LIVE = "mn.kind = 'url' AND mn.status <> 'dismissed'";
|
|
23062
23063
|
var MAIL_ROWS = `SELECT mn.source_id FROM mentions mn WHERE mn.source_type = 'email' AND ${LIVE}`;
|
|
23063
23064
|
var linkMatch = /* @__PURE__ */ __name((field4, typed, mail, mentioned2) => {
|
|
@@ -23081,7 +23082,7 @@ var linkMatch = /* @__PURE__ */ __name((field4, typed, mail, mentioned2) => {
|
|
|
23081
23082
|
};
|
|
23082
23083
|
}, "linkMatch");
|
|
23083
23084
|
|
|
23084
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
23085
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sqlite/phone-countries.js
|
|
23085
23086
|
var SETTING = "phoneCountries";
|
|
23086
23087
|
var savedPhoneCountries = /* @__PURE__ */ __name((database) => {
|
|
23087
23088
|
const row2 = database.prepare("SELECT value FROM store_settings WHERE key = ?").get(SETTING);
|
|
@@ -23112,7 +23113,7 @@ var valueMatch = /* @__PURE__ */ __name((database, typed) => {
|
|
|
23112
23113
|
return { sql: "mn.value = ?", params: [phone?.value ?? normalizedValue(typed, { phoneCountries })] };
|
|
23113
23114
|
}, "valueMatch");
|
|
23114
23115
|
|
|
23115
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
23116
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/domain/vocabulary.js
|
|
23116
23117
|
var normalizeVocabularyName = /* @__PURE__ */ __name((input) => {
|
|
23117
23118
|
if (typeof input !== "string" || input.length > 200 || /[\p{Cc}\p{Cf}]/u.test(input))
|
|
23118
23119
|
throw new CliError("validation_error", "a vocabulary name takes 1\u2013200 characters without control characters");
|
|
@@ -23140,7 +23141,7 @@ var vocabularySimilarity = /* @__PURE__ */ __name((left, right) => {
|
|
|
23140
23141
|
return 2 * intersection2 / (aa2.size + bb.size);
|
|
23141
23142
|
}, "vocabularySimilarity");
|
|
23142
23143
|
|
|
23143
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
23144
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sqlite/tag-creation.js
|
|
23144
23145
|
import { createHash } from "node:crypto";
|
|
23145
23146
|
var folded2 = /* @__PURE__ */ __name((name) => {
|
|
23146
23147
|
try {
|
|
@@ -23206,7 +23207,7 @@ var guardTagCreation = /* @__PURE__ */ __name((context, name, kind3, by, options
|
|
|
23206
23207
|
});
|
|
23207
23208
|
}, "guardTagCreation");
|
|
23208
23209
|
|
|
23209
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
23210
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/domain/tag-redirects.js
|
|
23210
23211
|
var invalid = /* @__PURE__ */ __name((message3) => {
|
|
23211
23212
|
throw new CliError("validation_error", message3);
|
|
23212
23213
|
}, "invalid");
|
|
@@ -23283,7 +23284,7 @@ var createTagRedirectIndex = /* @__PURE__ */ __name((snapshot2) => {
|
|
|
23283
23284
|
};
|
|
23284
23285
|
}, "createTagRedirectIndex");
|
|
23285
23286
|
|
|
23286
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
23287
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sqlite/tag-resolution.js
|
|
23287
23288
|
var tagCanonicalId = /* @__PURE__ */ __name((database, id2) => {
|
|
23288
23289
|
const row2 = database.prepare("SELECT canonical_id FROM resolved_tags WHERE id=?").get(id2);
|
|
23289
23290
|
if (!row2)
|
|
@@ -23311,7 +23312,7 @@ var tagRedirectSnapshot = /* @__PURE__ */ __name((database) => {
|
|
|
23311
23312
|
return snapshot2;
|
|
23312
23313
|
}, "tagRedirectSnapshot");
|
|
23313
23314
|
|
|
23314
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
23315
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sqlite/task-keys.js
|
|
23315
23316
|
import { createHash as createHash2 } from "node:crypto";
|
|
23316
23317
|
var TASK_KEY_PREFIXES = {
|
|
23317
23318
|
question: "Q",
|
|
@@ -23339,7 +23340,7 @@ var taskAccountOf = /* @__PURE__ */ __name((database, rowId) => {
|
|
|
23339
23340
|
return row2 && String(row2.key) === inboxKey(String(row2.name)) ? String(row2.name) : void 0;
|
|
23340
23341
|
}, "taskAccountOf");
|
|
23341
23342
|
|
|
23342
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
23343
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sqlite/things.js
|
|
23343
23344
|
var storedThing = /* @__PURE__ */ __name((type, id2) => ({ type: String(type), id: Number(id2) }), "storedThing");
|
|
23344
23345
|
var REFERABLE = {
|
|
23345
23346
|
...Object.fromEntries(Object.entries(RECORD_TYPES).map(([type, { tombstone: tombstone2 }]) => [type, { tombstone: tombstone2 }])),
|
|
@@ -23499,7 +23500,7 @@ var taskIdOf = /* @__PURE__ */ __name((database, rowId) => {
|
|
|
23499
23500
|
return row2 ? String(row2.id ?? row2.key) : void 0;
|
|
23500
23501
|
}, "taskIdOf");
|
|
23501
23502
|
|
|
23502
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
23503
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sqlite/values.js
|
|
23503
23504
|
var toMs = /* @__PURE__ */ __name((iso17) => {
|
|
23504
23505
|
if (iso17 === null || iso17 === void 0)
|
|
23505
23506
|
return null;
|
|
@@ -23513,7 +23514,7 @@ var present = /* @__PURE__ */ __name((entries) => Object.fromEntries(Object.entr
|
|
|
23513
23514
|
var DELIVERY = { delivered: 1, read: 2 };
|
|
23514
23515
|
var deliveryOf = /* @__PURE__ */ __name((stored4) => stored4 === DELIVERY.read ? "read" : stored4 === DELIVERY.delivered ? "delivered" : void 0, "deliveryOf");
|
|
23515
23516
|
|
|
23516
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
23517
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sqlite/tags.js
|
|
23517
23518
|
var TAG_KINDS = ["tag", "topic"];
|
|
23518
23519
|
var TAGGABLE = { chat: "chat", contact: "identity", message: "message", task: "task" };
|
|
23519
23520
|
var TAG_TYPE = {
|
|
@@ -23716,7 +23717,7 @@ var tagsOf = /* @__PURE__ */ __name(({ database }, key2, filter) => {
|
|
|
23716
23717
|
return result;
|
|
23717
23718
|
}, "tagsOf");
|
|
23718
23719
|
|
|
23719
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
23720
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sqlite/trigram-match.js
|
|
23720
23721
|
var MOST_YO_SPELLINGS = 64;
|
|
23721
23722
|
var yoSpellings = /* @__PURE__ */ __name((run) => {
|
|
23722
23723
|
let spellings2 = [""];
|
|
@@ -23738,7 +23739,7 @@ var anyCaseGlob = /* @__PURE__ */ __name((word2) => `*${[...word2.normalize("NFC
|
|
|
23738
23739
|
return forms2.size === 1 ? c : `[${[...forms2].join("")}]`;
|
|
23739
23740
|
}).join("")}*`, "anyCaseGlob");
|
|
23740
23741
|
|
|
23741
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
23742
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sqlite/lucene-fields.js
|
|
23742
23743
|
var speech = /* @__PURE__ */ __name((alias2) => `(coalesce(${alias2}.extractor,'') LIKE 'speech:%' OR ${alias2}.kind IN ('voice','video_note') OR coalesce(${alias2}.mime,'')='audio/ogg')`, "speech");
|
|
23743
23744
|
var SPEECH = speech("att");
|
|
23744
23745
|
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");
|
|
@@ -24224,7 +24225,7 @@ var FIELD_COMPILERS = {
|
|
|
24224
24225
|
subject
|
|
24225
24226
|
};
|
|
24226
24227
|
|
|
24227
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
24228
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sqlite/place-key.js
|
|
24228
24229
|
var placeOf = /* @__PURE__ */ __name((database) => {
|
|
24229
24230
|
const exact = database.prepare("SELECT id FROM places WHERE folded = ?");
|
|
24230
24231
|
const onStreet = database.prepare("SELECT id FROM places WHERE substr(folded, 1, ?) = ? LIMIT 2");
|
|
@@ -24240,7 +24241,7 @@ var placeOf = /* @__PURE__ */ __name((database) => {
|
|
|
24240
24241
|
};
|
|
24241
24242
|
}, "placeOf");
|
|
24242
24243
|
|
|
24243
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
24244
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sqlite/mention-drain.js
|
|
24244
24245
|
var DRAIN_ON_WRITE = 500;
|
|
24245
24246
|
var METHOD = "rules";
|
|
24246
24247
|
var telegramLink = /* @__PURE__ */ __name((database) => {
|
|
@@ -24406,7 +24407,7 @@ var drainMentions = /* @__PURE__ */ __name((database, now2, limit = DRAIN_ON_WRI
|
|
|
24406
24407
|
return queued.length;
|
|
24407
24408
|
}, "drainMentions");
|
|
24408
24409
|
|
|
24409
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
24410
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sqlite/index-state.js
|
|
24410
24411
|
var indexRow = /* @__PURE__ */ __name((database, name) => {
|
|
24411
24412
|
const exists2 = database.prepare("SELECT 1 FROM sqlite_master WHERE name = 'search_index_state'").get();
|
|
24412
24413
|
if (!exists2)
|
|
@@ -24414,7 +24415,7 @@ var indexRow = /* @__PURE__ */ __name((database, name) => {
|
|
|
24414
24415
|
return database.prepare("SELECT * FROM search_index_state WHERE name = ?").get(name);
|
|
24415
24416
|
}, "indexRow");
|
|
24416
24417
|
|
|
24417
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
24418
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sqlite/stems.js
|
|
24418
24419
|
var INDEX = "message_stems";
|
|
24419
24420
|
var SETTING2 = "searchStemmers";
|
|
24420
24421
|
var DRAIN_ON_WRITE2 = 500;
|
|
@@ -24536,7 +24537,7 @@ var stemmerCache = /* @__PURE__ */ __name(() => {
|
|
|
24536
24537
|
};
|
|
24537
24538
|
}, "stemmerCache");
|
|
24538
24539
|
|
|
24539
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
24540
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sqlite/transaction.js
|
|
24540
24541
|
var rehearsal = new AsyncLocalStorage();
|
|
24541
24542
|
var SQLITE_BUSY = 5;
|
|
24542
24543
|
var pause = new Int32Array(new SharedArrayBuffer(4));
|
|
@@ -24679,7 +24680,7 @@ var read = /* @__PURE__ */ __name((database, body2) => {
|
|
|
24679
24680
|
}
|
|
24680
24681
|
}, "read");
|
|
24681
24682
|
|
|
24682
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
24683
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sqlite/folded.js
|
|
24683
24684
|
var FOLDED = [
|
|
24684
24685
|
{ table: "tasks", column: "title" },
|
|
24685
24686
|
{ table: "tasks", column: "close_reason" },
|
|
@@ -24716,7 +24717,7 @@ var fillFolded = /* @__PURE__ */ __name((database, { batch = 2e3 } = {}) => {
|
|
|
24716
24717
|
return filled;
|
|
24717
24718
|
}, "fillFolded");
|
|
24718
24719
|
|
|
24719
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
24720
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/conversations/chunks.js
|
|
24720
24721
|
import { createHash as createHash3 } from "node:crypto";
|
|
24721
24722
|
var CHUNK_CHARS = 1200;
|
|
24722
24723
|
var CHUNK_OVERLAP = 150;
|
|
@@ -24821,7 +24822,7 @@ var cutChunks = /* @__PURE__ */ __name((members2, limit = CHUNK_CHARS, check3, c
|
|
|
24821
24822
|
return chunks2;
|
|
24822
24823
|
}, "cutChunks");
|
|
24823
24824
|
|
|
24824
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
24825
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/search/task-signature.js
|
|
24825
24826
|
var DAY2 = 864e5;
|
|
24826
24827
|
var CURRENCY = [
|
|
24827
24828
|
[/^(₽|руб.*|р\.?|rub)$/u, "RUB"],
|
|
@@ -24947,7 +24948,7 @@ var dueDayOf = /* @__PURE__ */ __name((text8, createdMs) => {
|
|
|
24947
24948
|
return best?.day ?? null;
|
|
24948
24949
|
}, "dueDayOf");
|
|
24949
24950
|
|
|
24950
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
24951
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/search/task-similarity.js
|
|
24951
24952
|
var DAY3 = 864e5;
|
|
24952
24953
|
var STOP_WORDS = new Set([
|
|
24953
24954
|
// Russian and English as the test set ran them, already folded (пожалуйста → пожалуиста).
|
|
@@ -25102,7 +25103,7 @@ var rankCandidates = /* @__PURE__ */ __name((views, candidates) => candidates.ma
|
|
|
25102
25103
|
...compareViews(subjectViews ?? views, candidate, replyChain === void 0 ? {} : { replyChain })
|
|
25103
25104
|
})).sort((a, b) => b.score - a.score), "rankCandidates");
|
|
25104
25105
|
|
|
25105
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
25106
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sqlite/vector-index.js
|
|
25106
25107
|
var source = /* @__PURE__ */ __name((model, dims) => `SELECT k.id, k.chunkable_type,
|
|
25107
25108
|
coalesce(CASE k.chunkable_type
|
|
25108
25109
|
WHEN 'image' THEN (SELECT ch.account_id FROM attachments a JOIN messages m ON m.id = a.attachable_id
|
|
@@ -25244,7 +25245,7 @@ var dropUnusedVectors = /* @__PURE__ */ __name((database, hashes) => {
|
|
|
25244
25245
|
}, "dropUnusedVectors");
|
|
25245
25246
|
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");
|
|
25246
25247
|
|
|
25247
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
25248
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sqlite/vectors.js
|
|
25248
25249
|
var currentChunks = /* @__PURE__ */ __name((chatKey) => sql`SELECT k.content_hash, k.chunkable_id AS conversation_id, r.first_message_id,
|
|
25249
25250
|
r.last_message_id, r.text_start, r.text_end FROM chunks k JOIN chunk_messages r ON r.chunk_id = k.id
|
|
25250
25251
|
JOIN conversations c ON k.chunkable_type = 'conversation' AND c.id = k.chunkable_id
|
|
@@ -25519,7 +25520,7 @@ var vectorCounts = /* @__PURE__ */ __name(({ orm }, models) => new Map(models.ma
|
|
|
25519
25520
|
Number(orm.get(sql`SELECT count(*) AS n FROM embeddings WHERE model = ${model}`)?.n ?? 0)
|
|
25520
25521
|
])), "vectorCounts");
|
|
25521
25522
|
|
|
25522
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
25523
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sqlite/document-pictures.js
|
|
25523
25524
|
var DOCUMENT_PICTURE = "document_picture";
|
|
25524
25525
|
var SCAN_PAGE2 = 5e3;
|
|
25525
25526
|
var idOf = /* @__PURE__ */ __name((ref3) => {
|
|
@@ -25582,12 +25583,12 @@ var documentPicturesOver = /* @__PURE__ */ __name(({ database, now: now2 }) => (
|
|
|
25582
25583
|
}, "nearestPictures")
|
|
25583
25584
|
}), "documentPicturesOver");
|
|
25584
25585
|
|
|
25585
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
25586
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sqlite/index-text.js
|
|
25586
25587
|
var noteIndexText = /* @__PURE__ */ __name((title2, text8) => title2 ? `${title2}
|
|
25587
25588
|
|
|
25588
25589
|
${text8}` : text8, "noteIndexText");
|
|
25589
25590
|
|
|
25590
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
25591
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sqlite/enrichments.js
|
|
25591
25592
|
var ENRICHMENT_SUBJECTS = ["document", "note", "email"];
|
|
25592
25593
|
var ENRICHMENT_POSITION = 1e6;
|
|
25593
25594
|
var EMAIL_ENRICHMENT = "email_enrichment";
|
|
@@ -25681,10 +25682,10 @@ var enrichmentsOver = /* @__PURE__ */ __name(({ database, now: now2 }) => ({
|
|
|
25681
25682
|
}), "clear")
|
|
25682
25683
|
}), "enrichmentsOver");
|
|
25683
25684
|
|
|
25684
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
25685
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sqlite/query-filter.js
|
|
25685
25686
|
var glob = /* @__PURE__ */ __name((value) => [...fold(value).matchAll(/\\(.)|([*?])|(.)/gsu)].map(([, escaped2, wildcard, plain2]) => {
|
|
25686
|
-
const
|
|
25687
|
-
return wildcard ?? (/[*?[]/u.test(
|
|
25687
|
+
const literal5 = escaped2 ?? plain2 ?? "";
|
|
25688
|
+
return wildcard ?? (/[*?[]/u.test(literal5) ? `[${literal5}]` : literal5);
|
|
25688
25689
|
}).join(""), "glob");
|
|
25689
25690
|
var foldedWords = /* @__PURE__ */ __name((column2) => ({
|
|
25690
25691
|
where: /* @__PURE__ */ __name((node) => {
|
|
@@ -25757,7 +25758,7 @@ var compile = /* @__PURE__ */ __name((node, columns2, options) => {
|
|
|
25757
25758
|
var queryFilter = /* @__PURE__ */ __name((ast, columns2, options) => compile(ast.root, columns2, options), "queryFilter");
|
|
25758
25759
|
var bound2 = /* @__PURE__ */ __name(({ sql: text8, params }) => sql.join(text8.split("?").map((part2, at2) => at2 < params.length ? sql`${sql.raw(part2)}${params[at2]}` : sql.raw(part2)), sql``), "bound");
|
|
25759
25760
|
|
|
25760
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
25761
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sqlite/events.js
|
|
25761
25762
|
var toJson = /* @__PURE__ */ __name((value) => value === null || value === void 0 ? null : JSON.stringify(value), "toJson");
|
|
25762
25763
|
var fromJson = /* @__PURE__ */ __name((value) => value === null || value === void 0 ? null : JSON.parse(String(value)), "fromJson");
|
|
25763
25764
|
var int = /* @__PURE__ */ __name((value) => value === null || value === void 0 ? null : Number(value), "int");
|
|
@@ -25847,7 +25848,7 @@ var linkMeeting = /* @__PURE__ */ __name((database, id2, eventId, now2, mode = "
|
|
|
25847
25848
|
});
|
|
25848
25849
|
}, "linkMeeting");
|
|
25849
25850
|
|
|
25850
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
25851
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sqlite/task-titles.js
|
|
25851
25852
|
var MAX_TITLE = 120;
|
|
25852
25853
|
var placeholderTitleOf = /* @__PURE__ */ __name((row2) => `${String(row2.type)} \u2014 ${String(row2.source_locator ?? "")}`, "placeholderTitleOf");
|
|
25853
25854
|
var PLACEHOLDER_TITLE_SQL = "title = type || ' \u2014 ' || coalesce(source_locator, '')";
|
|
@@ -25909,7 +25910,7 @@ var fillFoundTaskTitles = /* @__PURE__ */ __name((database, warn, { batch = 500
|
|
|
25909
25910
|
}
|
|
25910
25911
|
}, "fillFoundTaskTitles");
|
|
25911
25912
|
|
|
25912
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
25913
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sqlite/note-index.js
|
|
25913
25914
|
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), ''))";
|
|
25914
25915
|
var UNSEARCHED_EVENT_TYPES = [
|
|
25915
25916
|
"working-location",
|
|
@@ -26156,7 +26157,7 @@ var resetNoteIndex = /* @__PURE__ */ __name((database) => {
|
|
|
26156
26157
|
return true;
|
|
26157
26158
|
}, "resetNoteIndex");
|
|
26158
26159
|
|
|
26159
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
26160
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sqlite/person-resolution.js
|
|
26160
26161
|
var keyOf2 = /* @__PURE__ */ __name((name) => fold(name).trim().replace(/^@/, ""), "keyOf");
|
|
26161
26162
|
var resolvePersonLinks = /* @__PURE__ */ __name((database, names) => {
|
|
26162
26163
|
for (const key2 of new Set(names.filter((name) => !!name?.trim()).map(keyOf2))) {
|
|
@@ -26175,7 +26176,7 @@ var resolvePersonLinks = /* @__PURE__ */ __name((database, names) => {
|
|
|
26175
26176
|
}
|
|
26176
26177
|
}, "resolvePersonLinks");
|
|
26177
26178
|
|
|
26178
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
26179
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sqlite/schema/canonical-tags.js
|
|
26179
26180
|
var canonicalTags = sqliteTable("canonical_tags", {
|
|
26180
26181
|
id: integer("id").primaryKey(),
|
|
26181
26182
|
name: text("name").notNull().unique(),
|
|
@@ -26184,7 +26185,7 @@ var canonicalTags = sqliteTable("canonical_tags", {
|
|
|
26184
26185
|
updatedAt: integer("updated_at").notNull()
|
|
26185
26186
|
});
|
|
26186
26187
|
|
|
26187
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
26188
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sqlite/schema/link-revisions.js
|
|
26188
26189
|
var linkRevisions = sqliteTable("link_revisions", {
|
|
26189
26190
|
id: integer("id").primaryKey(),
|
|
26190
26191
|
linkId: integer("link_id").notNull(),
|
|
@@ -26196,7 +26197,7 @@ var linkRevisions = sqliteTable("link_revisions", {
|
|
|
26196
26197
|
createdAt: integer("created_at").notNull()
|
|
26197
26198
|
}, (table) => [index("link_revisions_by_link_id_created_at").on(table.linkId, table.createdAt)]);
|
|
26198
26199
|
|
|
26199
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
26200
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sqlite/schema/document-transfers.js
|
|
26200
26201
|
var documentAnnotationTransfers = sqliteTable("document_annotation_transfers", {
|
|
26201
26202
|
sourceKey: text("source_key").notNull(),
|
|
26202
26203
|
collection: text("collection").notNull(),
|
|
@@ -26206,13 +26207,13 @@ var documentAnnotationTransfers = sqliteTable("document_annotation_transfers", {
|
|
|
26206
26207
|
createdAt: integer("created_at").notNull()
|
|
26207
26208
|
}, (table) => [primaryKey({ columns: [table.sourceKey, table.collection] })]);
|
|
26208
26209
|
|
|
26209
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
26210
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sqlite/schema/document-index-pending.js
|
|
26210
26211
|
var documentIndexPending = sqliteTable("document_index_pending", {
|
|
26211
26212
|
id: integer("id").notNull(),
|
|
26212
26213
|
indexableType: text("indexable_type").notNull()
|
|
26213
26214
|
}, (table) => [primaryKey({ columns: [table.indexableType, table.id] })]);
|
|
26214
26215
|
|
|
26215
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
26216
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sqlite/schema/decision-requests.js
|
|
26216
26217
|
var decisionRequests = sqliteTable("decision_requests", {
|
|
26217
26218
|
id: integer("id").primaryKey(),
|
|
26218
26219
|
tokenDigest: text("token_digest").notNull().unique(),
|
|
@@ -26232,7 +26233,7 @@ var decisionRequests = sqliteTable("decision_requests", {
|
|
|
26232
26233
|
index("decision_requests_by_channel_bot_profile_chat_id_message_id").on(table.channel, table.botProfile, table.chatId, table.messageId)
|
|
26233
26234
|
]);
|
|
26234
26235
|
|
|
26235
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
26236
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sqlite/schema/enrichments.js
|
|
26236
26237
|
var enrichments = sqliteTable("enrichments", {
|
|
26237
26238
|
subjectType: text("subject_type").notNull(),
|
|
26238
26239
|
subjectId: integer("subject_id").notNull(),
|
|
@@ -26244,7 +26245,7 @@ var enrichments = sqliteTable("enrichments", {
|
|
|
26244
26245
|
createdAt: integer("created_at").notNull()
|
|
26245
26246
|
}, (table) => [primaryKey({ columns: [table.subjectType, table.subjectId] })]);
|
|
26246
26247
|
|
|
26247
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
26248
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sqlite/schema/templates.js
|
|
26248
26249
|
var templates = sqliteTable("templates", {
|
|
26249
26250
|
key: text("key").notNull(),
|
|
26250
26251
|
channel: text("channel").notNull(),
|
|
@@ -26266,7 +26267,7 @@ var templatesHistory = sqliteTable("templates_history", {
|
|
|
26266
26267
|
index("templates_history_by_key_channel_language_id").on(table.key, table.channel, table.language, table.id)
|
|
26267
26268
|
]);
|
|
26268
26269
|
|
|
26269
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
26270
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sqlite/schema/links.js
|
|
26270
26271
|
var links = sqliteTable("links", {
|
|
26271
26272
|
id: integer("id").primaryKey(),
|
|
26272
26273
|
fromType: text("from_type").notNull(),
|
|
@@ -26297,7 +26298,7 @@ var links = sqliteTable("links", {
|
|
|
26297
26298
|
index("links_by_to_type_to_id").on(table.toType, table.toId)
|
|
26298
26299
|
]);
|
|
26299
26300
|
|
|
26300
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
26301
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sqlite/schema/tag-consolidations.js
|
|
26301
26302
|
var tagRedirects = sqliteTable("tag_redirects", {
|
|
26302
26303
|
sourceId: integer("source_id").primaryKey().references(() => canonicalTags.id),
|
|
26303
26304
|
survivorId: integer("survivor_id").notNull().references(() => canonicalTags.id),
|
|
@@ -26323,7 +26324,7 @@ var tagConsolidations = sqliteTable("tag_consolidations", {
|
|
|
26323
26324
|
index("tag_consolidations_by_actor_type_actor_id").on(table.actorType, table.actorId)
|
|
26324
26325
|
]);
|
|
26325
26326
|
|
|
26326
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
26327
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sqlite/schema.js
|
|
26327
26328
|
var accounts = sqliteTable("accounts", {
|
|
26328
26329
|
id: integer("id").primaryKey(),
|
|
26329
26330
|
provider: text("provider").notNull(),
|
|
@@ -28333,7 +28334,7 @@ var storeSettings = sqliteTable("store_settings", {
|
|
|
28333
28334
|
at: integer("at").notNull()
|
|
28334
28335
|
});
|
|
28335
28336
|
|
|
28336
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
28337
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sqlite/identities.js
|
|
28337
28338
|
var contactsOf = /* @__PURE__ */ __name(({ phones: phones2, emails: emails3 }) => {
|
|
28338
28339
|
if (phones2 === void 0 && emails3 === void 0)
|
|
28339
28340
|
return void 0;
|
|
@@ -28579,7 +28580,7 @@ var meetingIdentityPk = /* @__PURE__ */ __name((context, accountId, identity) =>
|
|
|
28579
28580
|
}, "meetingIdentityPk");
|
|
28580
28581
|
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");
|
|
28581
28582
|
|
|
28582
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
28583
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/domain/ref-arguments.js
|
|
28583
28584
|
var TAKES = {
|
|
28584
28585
|
chat: "a chat: chat:<provider>/<account>/<chat>, its id or its title",
|
|
28585
28586
|
message: "a message: msg:<provider>/<account>/<chat>/<message>, or a chat and the message's id"
|
|
@@ -28639,7 +28640,7 @@ var ensureAccount = /* @__PURE__ */ __name(async (reference2, scope3, profilesOn
|
|
|
28639
28640
|
throw wrongAccount(reference2, scope3, profiles);
|
|
28640
28641
|
}, "ensureAccount");
|
|
28641
28642
|
|
|
28642
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
28643
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/search/trigrams.js
|
|
28643
28644
|
var trigrams = /* @__PURE__ */ __name((term) => {
|
|
28644
28645
|
const padded = ` ${term} `;
|
|
28645
28646
|
const pieces = /* @__PURE__ */ new Set();
|
|
@@ -28648,7 +28649,7 @@ var trigrams = /* @__PURE__ */ __name((term) => {
|
|
|
28648
28649
|
return [...pieces];
|
|
28649
28650
|
}, "trigrams");
|
|
28650
28651
|
|
|
28651
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
28652
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/resolve.js
|
|
28652
28653
|
var isId = /* @__PURE__ */ __name((reference2) => /^-?\d+$/.test(reference2.trim()), "isId");
|
|
28653
28654
|
var foldName = /* @__PURE__ */ __name((name) => name.normalize("NFC").replace(/[\uFE0E\uFE0F\u200D]/g, "").toLowerCase().replaceAll("\u0451", "\u0435"), "foldName");
|
|
28654
28655
|
var pickChat = /* @__PURE__ */ __name((reference2, chats2) => {
|
|
@@ -28719,7 +28720,7 @@ ${lines}`, { candidates });
|
|
|
28719
28720
|
}, "ambiguous");
|
|
28720
28721
|
var isPresent = /* @__PURE__ */ __name((value) => value !== null && value !== void 0, "isPresent");
|
|
28721
28722
|
|
|
28722
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
28723
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/domain/display-names.js
|
|
28723
28724
|
var QUOTES = [
|
|
28724
28725
|
['"', '"'],
|
|
28725
28726
|
["'", "'"],
|
|
@@ -28777,7 +28778,7 @@ var nameKey = /* @__PURE__ */ __name((name) => {
|
|
|
28777
28778
|
}, "nameKey");
|
|
28778
28779
|
var isReadable = /* @__PURE__ */ __name((shown2) => shown2 !== null && READABLE.test(shown2), "isReadable");
|
|
28779
28780
|
|
|
28780
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
28781
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sqlite/person-separation.js
|
|
28781
28782
|
var identitiesOf = /* @__PURE__ */ __name(({ database }, person2) => database.prepare("SELECT identity_id AS pk FROM identity_links WHERE person_id = ?").all(person2).map(({ pk }) => Number(pk)), "identitiesOf");
|
|
28782
28783
|
var MOVED_AWAY = `moved.identity_id IN (SELECT value FROM json_each(?))
|
|
28783
28784
|
AND (moved.from_person_id IN (SELECT value FROM json_each(?))
|
|
@@ -28792,7 +28793,7 @@ var apart = /* @__PURE__ */ __name(({ database }, one2, other) => {
|
|
|
28792
28793
|
var separated = /* @__PURE__ */ __name((context, one2, other) => one2 !== other && apart(context, { identities: identitiesOf(context, one2), person: one2 }, { identities: identitiesOf(context, other), person: other }), "separated");
|
|
28793
28794
|
var identitySeparated = /* @__PURE__ */ __name((context, identity, person2) => apart(context, { identities: [identity] }, { identities: identitiesOf(context, person2).filter((pk) => pk !== identity), person: person2 }), "identitySeparated");
|
|
28794
28795
|
|
|
28795
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
28796
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sqlite/reads.js
|
|
28796
28797
|
var MESSAGE_FIELDS = {
|
|
28797
28798
|
pk: messages.id,
|
|
28798
28799
|
nativeId: messages.externalId,
|
|
@@ -28972,7 +28973,7 @@ var chatActivity = /* @__PURE__ */ __name(({ database }, accountKey, since, wher
|
|
|
28972
28973
|
storedAt: toIso(Number(database.prepare("SELECT max(created_at) AS at FROM messages WHERE account_id = ?").get(accountKey)?.at) || null)
|
|
28973
28974
|
}), "chatActivity");
|
|
28974
28975
|
|
|
28975
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
28976
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sqlite/search.js
|
|
28976
28977
|
var HIT_FIELDS = {
|
|
28977
28978
|
...MESSAGE_FIELDS,
|
|
28978
28979
|
chatTitle: sql`${chats.title}`.as("chat_title"),
|
|
@@ -29073,7 +29074,7 @@ var directReplies = /* @__PURE__ */ __name((context, parents, limit) => {
|
|
|
29073
29074
|
};
|
|
29074
29075
|
}, "directReplies");
|
|
29075
29076
|
|
|
29076
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
29077
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sqlite/person-links.js
|
|
29077
29078
|
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");
|
|
29078
29079
|
var required = /* @__PURE__ */ __name((context, ref3) => {
|
|
29079
29080
|
const found2 = identityRow(context, ref3);
|
|
@@ -29286,7 +29287,7 @@ var mentioning = /* @__PURE__ */ __name((context, accountKey, { id: id2, usernam
|
|
|
29286
29287
|
}, "mentioning");
|
|
29287
29288
|
var escaped = /* @__PURE__ */ __name((text8) => text8.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), "escaped");
|
|
29288
29289
|
|
|
29289
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
29290
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sqlite/actors.js
|
|
29290
29291
|
var BOT_KINDS = ["agent", "rule", "script", "integration"];
|
|
29291
29292
|
var ownerPerson = /* @__PURE__ */ __name((database) => {
|
|
29292
29293
|
const found2 = database.prepare("SELECT id FROM persons WHERE owner = 1 ORDER BY id LIMIT 1").get();
|
|
@@ -29343,7 +29344,7 @@ var proposedBySql = /* @__PURE__ */ __name((type, id2, by) => {
|
|
|
29343
29344
|
return { sql: bot("pb.name = ?"), params: [by.bot] };
|
|
29344
29345
|
}, "proposedBySql");
|
|
29345
29346
|
|
|
29346
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
29347
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sqlite/source-review-marks.js
|
|
29347
29348
|
var TABLES = { memory: "memories", fact: "facts" };
|
|
29348
29349
|
var HOLDING = { memory: ["proposed", "confirmed"], fact: ["proposed", "accepted"] };
|
|
29349
29350
|
var KEPT = 20;
|
|
@@ -29438,7 +29439,7 @@ var scrubSourceReviews = /* @__PURE__ */ __name((database, erased, { refs }) =>
|
|
|
29438
29439
|
return scrubbed;
|
|
29439
29440
|
}, "scrubSourceReviews");
|
|
29440
29441
|
|
|
29441
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
29442
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sqlite/evidence-signature.js
|
|
29442
29443
|
var QUOTE_LIMIT = 500;
|
|
29443
29444
|
var GONE = { sig: "gone", rev: null, deleted: true, changedAt: null };
|
|
29444
29445
|
var part = /* @__PURE__ */ __name((value) => value == null ? "" : String(value), "part");
|
|
@@ -29717,11 +29718,11 @@ var deleteDocumentRow = /* @__PURE__ */ __name((database, id2, at2) => {
|
|
|
29717
29718
|
database.prepare("DELETE FROM documents WHERE id = ?").run(id2);
|
|
29718
29719
|
}, "deleteDocumentRow");
|
|
29719
29720
|
|
|
29720
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
29721
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/domain/ref-summaries.js
|
|
29721
29722
|
var profilesOn = /* @__PURE__ */ __name((profiles, app, key2) => Object.entries(profiles[app] ?? {}).filter(([, saved]) => saved.provider === key2.provider && saved.account === key2.account).map(([name]) => name), "profilesOn");
|
|
29722
29723
|
var oneLine = /* @__PURE__ */ __name((text8) => singleLine(text8.replace(/\s+/g, " ").trim()), "oneLine");
|
|
29723
29724
|
|
|
29724
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
29725
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sqlite/ref-accounts.js
|
|
29725
29726
|
var accountKeys = /* @__PURE__ */ __name((database, ids3) => {
|
|
29726
29727
|
const unique2 = [...new Set(ids3)];
|
|
29727
29728
|
if (unique2.length === 0)
|
|
@@ -29810,7 +29811,7 @@ var refEndsOf = /* @__PURE__ */ __name((database, text8) => {
|
|
|
29810
29811
|
}, "refEndsOf");
|
|
29811
29812
|
var refAccountsOf = /* @__PURE__ */ __name((database, text8) => refEndsOf(database, text8)?.flat(), "refAccountsOf");
|
|
29812
29813
|
|
|
29813
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
29814
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sqlite/ref-summaries.js
|
|
29814
29815
|
var EXCERPT_CHARS = 280;
|
|
29815
29816
|
var TITLE_CHARS = 120;
|
|
29816
29817
|
var MEMORY_TITLE_CHARS = 80;
|
|
@@ -30234,7 +30235,7 @@ var refsStoreOver = /* @__PURE__ */ __name((context) => ({
|
|
|
30234
30235
|
ends: /* @__PURE__ */ __name(async (text8) => refEndsOf(context.database, text8), "ends")
|
|
30235
30236
|
}), "refsStoreOver");
|
|
30236
30237
|
|
|
30237
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
30238
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sqlite/evidence-sources.js
|
|
30238
30239
|
var sourceOf3 = /* @__PURE__ */ __name((read2, ref3) => ({
|
|
30239
30240
|
ref: ref3,
|
|
30240
30241
|
kind: read2.kind,
|
|
@@ -30272,7 +30273,7 @@ var evidenceSourcesOf = /* @__PURE__ */ __name((database, from2) => {
|
|
|
30272
30273
|
});
|
|
30273
30274
|
}, "evidenceSourcesOf");
|
|
30274
30275
|
|
|
30275
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
30276
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/attachments/limits.js
|
|
30276
30277
|
var MAX_FILE_BYTES = 50 * 1024 * 1024;
|
|
30277
30278
|
var MAX_TEXT_CHARS = 2e6;
|
|
30278
30279
|
var ATTACHMENT_LIMIT_ENV = [
|
|
@@ -30298,7 +30299,7 @@ var pdfPreviewLimits = /* @__PURE__ */ __name((env = process.env) => {
|
|
|
30298
30299
|
return { pixels, bytes: positive(env, "MESSAGING_PDF_PREVIEW_MAX_MIB", 8 * 1024 * 1024, 1024 * 1024) };
|
|
30299
30300
|
}, "pdfPreviewLimits");
|
|
30300
30301
|
|
|
30301
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
30302
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/ulid.js
|
|
30302
30303
|
import { randomBytes } from "node:crypto";
|
|
30303
30304
|
var CROCKFORD = "0123456789ABCDEFGHJKMNPQRSTVWXYZ";
|
|
30304
30305
|
var ulid = /* @__PURE__ */ __name((now2 = Date.now()) => {
|
|
@@ -30311,7 +30312,7 @@ var ulid = /* @__PURE__ */ __name((now2 = Date.now()) => {
|
|
|
30311
30312
|
return time3 + random;
|
|
30312
30313
|
}, "ulid");
|
|
30313
30314
|
|
|
30314
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
30315
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sqlite/document-metadata.js
|
|
30315
30316
|
var FOLDED_FIELDS = ["title", "site", "language", "author"];
|
|
30316
30317
|
var encodeDocumentMetadata = /* @__PURE__ */ __name((meta, sections) => {
|
|
30317
30318
|
if (!meta && !sections?.length)
|
|
@@ -30332,11 +30333,11 @@ var languageOf = /* @__PURE__ */ __name((meta) => {
|
|
|
30332
30333
|
return typeof language === "string" && language !== "" ? language : null;
|
|
30333
30334
|
}, "languageOf");
|
|
30334
30335
|
|
|
30335
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
30336
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sqlite/file-note.js
|
|
30336
30337
|
var LIVE3 = "f.deleted_at IS NULL AND d.deleted_at IS NULL AND coalesce(json_extract(d.metadata, '$.catalog.active'), 1)=1";
|
|
30337
30338
|
var fileNoteRow = /* @__PURE__ */ __name((database, account, local, path) => database.prepare(local ? `SELECT d.*, f.account_id AS account_id, f.external_id AS external_id, coalesce(f.external_updated_at, d.external_updated_at) AS external_updated_at FROM files f JOIN documents d ON d.id = f.document_id WHERE f.account_id = ? AND f.external_id = ? AND ${LIVE3} ORDER BY d.created_at, d.id LIMIT 1` : `SELECT d.*, f.account_id AS account_id, coalesce(f.external_updated_at, d.external_updated_at) AS external_updated_at FROM documents d JOIN files f ON f.document_id = d.id AND f.account_id = d.account_id WHERE d.account_id = ? AND d.external_id = ? AND ${LIVE3} LIMIT 1`).get(account, path), "fileNoteRow");
|
|
30338
30339
|
|
|
30339
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
30340
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sqlite/files.js
|
|
30340
30341
|
var isObject2 = /* @__PURE__ */ __name((value) => value !== null && typeof value === "object" && !Array.isArray(value), "isObject");
|
|
30341
30342
|
var objectOf2 = /* @__PURE__ */ __name((value) => {
|
|
30342
30343
|
if (isObject2(value))
|
|
@@ -30583,7 +30584,7 @@ var filesStoreOver = /* @__PURE__ */ __name(({ database, now: now2 }) => {
|
|
|
30583
30584
|
};
|
|
30584
30585
|
}, "filesStoreOver");
|
|
30585
30586
|
|
|
30586
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
30587
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sqlite/imported-documents.js
|
|
30587
30588
|
var IMPORTED_DOCUMENT_QUERY = defineQuery({
|
|
30588
30589
|
entity: "document",
|
|
30589
30590
|
backend: "sql",
|
|
@@ -30629,7 +30630,7 @@ var importedDocumentWhere = /* @__PURE__ */ __name((database, query) => {
|
|
|
30629
30630
|
return queryFilter(validateQuery(query, IMPORTED_DOCUMENT_QUERY), columns2, { zone: timezoneOf() });
|
|
30630
30631
|
}, "importedDocumentWhere");
|
|
30631
30632
|
|
|
30632
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
30633
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sqlite/link-reviews.js
|
|
30633
30634
|
var reviewLink = /* @__PURE__ */ __name((database, linkable, entity, candidates, reason, now2) => {
|
|
30634
30635
|
database.prepare(`INSERT INTO link_reviews (linkable_type, linkable_id, entity_type, candidates, reason, status, created_at, updated_at)
|
|
30635
30636
|
VALUES (?, ?, ?, ?, ?, 'open', ?, ?)
|
|
@@ -30637,7 +30638,7 @@ var reviewLink = /* @__PURE__ */ __name((database, linkable, entity, candidates,
|
|
|
30637
30638
|
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);
|
|
30638
30639
|
}, "reviewLink");
|
|
30639
30640
|
|
|
30640
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
30641
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sqlite/link-row.js
|
|
30641
30642
|
var iso3 = /* @__PURE__ */ __name((value) => new Date(Number(value)).toISOString(), "iso");
|
|
30642
30643
|
var thingRef = /* @__PURE__ */ __name((database, type, id2) => type == null || id2 == null ? null : referenceOfThing(database, storedThing(type, id2)) ?? null, "thingRef");
|
|
30643
30644
|
var hasBothEnds = /* @__PURE__ */ __name((link3) => link3.from !== null && link3.to !== null, "hasBothEnds");
|
|
@@ -30671,7 +30672,7 @@ var linkOf = /* @__PURE__ */ __name((database, row2) => {
|
|
|
30671
30672
|
};
|
|
30672
30673
|
}, "linkOf");
|
|
30673
30674
|
|
|
30674
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
30675
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sqlite/note-dates.js
|
|
30675
30676
|
var dateFileNotes = /* @__PURE__ */ __name((database, folder, dates) => {
|
|
30676
30677
|
const fileAt = database.prepare("SELECT id, document_id FROM files WHERE account_id = ? AND external_id = ? AND kind <> 'folder' AND deleted_at IS NULL");
|
|
30677
30678
|
const legacy = database.prepare("SELECT id FROM documents WHERE account_id = ? AND external_id = ? AND deleted_at IS NULL");
|
|
@@ -30692,7 +30693,7 @@ var dateFileNotes = /* @__PURE__ */ __name((database, folder, dates) => {
|
|
|
30692
30693
|
return changed;
|
|
30693
30694
|
}, "dateFileNotes");
|
|
30694
30695
|
|
|
30695
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
30696
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sqlite/text-input.js
|
|
30696
30697
|
var textOf2 = /* @__PURE__ */ __name((text8, what, max = 1e5, allowEmpty = false) => {
|
|
30697
30698
|
const value = text8.trim();
|
|
30698
30699
|
if (!value && !allowEmpty || value.length > max)
|
|
@@ -30705,7 +30706,7 @@ var oneOf = /* @__PURE__ */ __name((value, allowed, what) => {
|
|
|
30705
30706
|
return value;
|
|
30706
30707
|
}, "oneOf");
|
|
30707
30708
|
|
|
30708
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
30709
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sqlite/notes.js
|
|
30709
30710
|
var NOTE_FORMATS = ["obsidian", "markdown"];
|
|
30710
30711
|
var RELATIONSHIPS = RELATION_KINDS.map(linkKind).join(", ");
|
|
30711
30712
|
var iso4 = /* @__PURE__ */ __name((value) => new Date(Number(value)).toISOString(), "iso");
|
|
@@ -31225,10 +31226,10 @@ var notesStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
31225
31226
|
};
|
|
31226
31227
|
}, "notesStoreOver");
|
|
31227
31228
|
|
|
31228
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
31229
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sqlite/rows-page.js
|
|
31229
31230
|
var pageOfRows = /* @__PURE__ */ __name((rows, limit, offset = 0) => rows.length > limit ? { items: rows.slice(0, limit), hasMore: true, nextOffset: offset + limit } : { items: rows, hasMore: false }, "pageOfRows");
|
|
31230
31231
|
|
|
31231
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
31232
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sqlite/memories.js
|
|
31232
31233
|
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";
|
|
31233
31234
|
var iso5 = /* @__PURE__ */ __name((value) => new Date(Number(value)).toISOString(), "iso");
|
|
31234
31235
|
var oneOf2 = /* @__PURE__ */ __name((value, allowed, what) => {
|
|
@@ -31493,7 +31494,7 @@ var memoriesStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
31493
31494
|
};
|
|
31494
31495
|
}, "memoriesStoreOver");
|
|
31495
31496
|
|
|
31496
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
31497
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sqlite/reviewed.js
|
|
31497
31498
|
var prefixesText = /* @__PURE__ */ __name((types) => `${article(types[0] ?? "")} ${types.map((type) => `${type}:`).join(" or ")}`, "prefixesText");
|
|
31498
31499
|
var refuse = /* @__PURE__ */ __name((message3, reason, code = "validation_error") => {
|
|
31499
31500
|
throw new CliError(code, message3, { reason });
|
|
@@ -31641,7 +31642,7 @@ var reviewedRowsOver = /* @__PURE__ */ __name((context) => {
|
|
|
31641
31642
|
return { partyOf, partyThing, reviewedOf, written, keepEvidence, ownerOnly: ownerOnly2, linkedId, ...decisionsOver(context) };
|
|
31642
31643
|
}, "reviewedRowsOver");
|
|
31643
31644
|
|
|
31644
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
31645
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sqlite/money-lines.js
|
|
31645
31646
|
var MAX_LINES = 500;
|
|
31646
31647
|
var PARENTS = {
|
|
31647
31648
|
invoice: {
|
|
@@ -31741,7 +31742,7 @@ var moneyLinesOver = /* @__PURE__ */ __name(({ database }) => {
|
|
|
31741
31742
|
return { linesOf, insertLines, shownLines, appendLine, deleteLine, sumOf, retotal };
|
|
31742
31743
|
}, "moneyLinesOver");
|
|
31743
31744
|
|
|
31744
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
31745
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sqlite/refunds.js
|
|
31745
31746
|
var COUNTED = {
|
|
31746
31747
|
confirmed: "np.review = 'confirmed' AND np.deleted_at IS NULL",
|
|
31747
31748
|
// A proposed refund promises nothing back yet, so it must not free room an import could then fill.
|
|
@@ -31816,7 +31817,7 @@ var refundRulesOver = /* @__PURE__ */ __name((context) => {
|
|
|
31816
31817
|
return { originalFor, refundShare, confirmable, keepsRefunded, keepsShare, keepsInvoice };
|
|
31817
31818
|
}, "refundRulesOver");
|
|
31818
31819
|
|
|
31819
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
31820
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sqlite/finance.js
|
|
31820
31821
|
var FINANCE_TYPES = ["invoice", "payment"];
|
|
31821
31822
|
var isFinanceType = /* @__PURE__ */ __name((type) => FINANCE_TYPES.includes(type), "isFinanceType");
|
|
31822
31823
|
var PAID = netPaidSql("i.id");
|
|
@@ -32220,7 +32221,7 @@ var financeStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
32220
32221
|
};
|
|
32221
32222
|
}, "financeStoreOver");
|
|
32222
32223
|
|
|
32223
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
32224
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sqlite/payment-entries.js
|
|
32224
32225
|
var refuse2 = /* @__PURE__ */ __name((message3, reason) => {
|
|
32225
32226
|
throw new CliError("validation_error", message3, { reason });
|
|
32226
32227
|
}, "refuse");
|
|
@@ -32298,7 +32299,7 @@ var paymentEntriesOver = /* @__PURE__ */ __name((context) => {
|
|
|
32298
32299
|
};
|
|
32299
32300
|
}, "paymentEntriesOver");
|
|
32300
32301
|
|
|
32301
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
32302
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/evidence-findings.js
|
|
32302
32303
|
var EVIDENCE_FINDINGS_KIND = "evidence_findings";
|
|
32303
32304
|
var reference = /* @__PURE__ */ __name((raw) => {
|
|
32304
32305
|
if (/^(document|note):[1-9]\d*$/.test(raw))
|
|
@@ -32325,7 +32326,7 @@ var validateEvidenceFindings = /* @__PURE__ */ __name((input) => {
|
|
|
32325
32326
|
return valid;
|
|
32326
32327
|
}, "validateEvidenceFindings");
|
|
32327
32328
|
|
|
32328
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
32329
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sqlite/proposed-actions.js
|
|
32329
32330
|
var PROPOSAL_STATUSES = ["proposed", "approved", "rejected", "executed", "failed"];
|
|
32330
32331
|
var PROPOSAL_VERDICTS = ["useful", "not_useful"];
|
|
32331
32332
|
var iso7 = /* @__PURE__ */ __name((value) => value == null ? null : new Date(Number(value)).toISOString(), "iso");
|
|
@@ -32519,7 +32520,7 @@ var proposedActionsStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
32519
32520
|
};
|
|
32520
32521
|
}, "proposedActionsStoreOver");
|
|
32521
32522
|
|
|
32522
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
32523
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sqlite/identity-proposals.js
|
|
32523
32524
|
var CONFIRMED = "proposal";
|
|
32524
32525
|
var refOf = /* @__PURE__ */ __name(({ database }, pk) => {
|
|
32525
32526
|
const row2 = database.prepare("SELECT provider, external_id FROM identities WHERE id = ?").get(pk);
|
|
@@ -32869,7 +32870,7 @@ var identityLinkRows = /* @__PURE__ */ __name((context, { person: person2, statu
|
|
|
32869
32870
|
return { items, hasMore: rows.length > limit };
|
|
32870
32871
|
}, "identityLinkRows");
|
|
32871
32872
|
|
|
32872
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
32873
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sqlite/person-merges.js
|
|
32873
32874
|
var mergeId = /* @__PURE__ */ __name((to, from2) => `merge:${to}-${from2}`, "mergeId");
|
|
32874
32875
|
var parseMergeId = /* @__PURE__ */ __name((id2) => {
|
|
32875
32876
|
const found2 = /^merge:([1-9]\d*)-([1-9]\d*)$/.exec(id2.trim());
|
|
@@ -32972,7 +32973,7 @@ var split = /* @__PURE__ */ __name((context, uid, refs, by) => {
|
|
|
32972
32973
|
return recordOf(context, alone);
|
|
32973
32974
|
}, "split");
|
|
32974
32975
|
|
|
32975
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
32976
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sqlite/identity-split-proposals.js
|
|
32976
32977
|
var refOf2 = /* @__PURE__ */ __name(({ provider, id: id2 }) => `${provider}:${id2}`, "refOf");
|
|
32977
32978
|
var keyOf3 = /* @__PURE__ */ __name((split2, person2, identities2) => `${split2} ${person2} ${[...identities2].sort().join(" ")}`, "keyOf");
|
|
32978
32979
|
var planOf = /* @__PURE__ */ __name((context, input) => {
|
|
@@ -33149,7 +33150,7 @@ var forgetErasedSplits = /* @__PURE__ */ __name((database) => {
|
|
|
33149
33150
|
database.prepare("DELETE FROM proposed_actions WHERE id = ?").run(Number(row2.id));
|
|
33150
33151
|
}, "forgetErasedSplits");
|
|
33151
33152
|
|
|
33152
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
33153
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/domain/test-data.js
|
|
33153
33154
|
var SEED_PEOPLE = [
|
|
33154
33155
|
{ name: "Owner", username: "owner" },
|
|
33155
33156
|
{ name: "Ann Lee", username: "ann" },
|
|
@@ -33166,7 +33167,7 @@ var RESERVED_ADDRESS_GLOBS = [
|
|
|
33166
33167
|
];
|
|
33167
33168
|
var SEED_ID_GLOBS = ["person-[0-9]*"];
|
|
33168
33169
|
|
|
33169
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
33170
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sqlite/test-people.js
|
|
33170
33171
|
var TEST_DATA_KIND = "test_data";
|
|
33171
33172
|
var globs = /* @__PURE__ */ __name((column2, patterns) => patterns.map((pattern) => `${column2} GLOB '${pattern}'`).join(" OR "), "globs");
|
|
33172
33173
|
var SURE = `(${globs("i.external_id", SEED_ID_GLOBS)} OR ${globs("lower(i.email)", RESERVED_ADDRESS_GLOBS)})`;
|
|
@@ -33235,7 +33236,7 @@ var forgetErasedTestData = /* @__PURE__ */ __name((database) => {
|
|
|
33235
33236
|
database.prepare("DELETE FROM proposed_actions WHERE id = ?").run(Number(row2.id));
|
|
33236
33237
|
}, "forgetErasedTestData");
|
|
33237
33238
|
|
|
33238
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
33239
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sqlite/accounts.js
|
|
33239
33240
|
var accountPk = /* @__PURE__ */ __name(({ orm, now: now2 }, { provider, account, scope: scope3 }, name = null, startScope) => Number(orm.insert(accounts).values({
|
|
33240
33241
|
provider,
|
|
33241
33242
|
externalId: account,
|
|
@@ -33329,7 +33330,7 @@ var dropOrphanPeople = /* @__PURE__ */ __name((database, unseenBefore) => {
|
|
|
33329
33330
|
AND id NOT IN (SELECT id FROM (${referencesTo(database, "persons", /* @__PURE__ */ new Set(["identity_links"]))}) WHERE id IS NOT NULL)`).run(JSON.stringify(persons2));
|
|
33330
33331
|
}, "dropOrphanPeople");
|
|
33331
33332
|
|
|
33332
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
33333
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sqlite/history-skips.js
|
|
33333
33334
|
var HISTORY_KEY = "$history";
|
|
33334
33335
|
var objectOf3 = /* @__PURE__ */ __name((text8) => {
|
|
33335
33336
|
if (typeof text8 !== "string")
|
|
@@ -33405,7 +33406,7 @@ var withoutHistory = /* @__PURE__ */ __name((metadata3) => {
|
|
|
33405
33406
|
return rest;
|
|
33406
33407
|
}, "withoutHistory");
|
|
33407
33408
|
|
|
33408
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
33409
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sqlite/chats.js
|
|
33409
33410
|
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");
|
|
33410
33411
|
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");
|
|
33411
33412
|
var setChatScope = /* @__PURE__ */ __name((context, accountKey, chatId, scope3) => {
|
|
@@ -33703,7 +33704,7 @@ var replaceAutoTags = /* @__PURE__ */ __name((context, key2, chatId, algorithm,
|
|
|
33703
33704
|
}
|
|
33704
33705
|
}, "replaceAutoTags");
|
|
33705
33706
|
|
|
33706
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
33707
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/domain/counters.js
|
|
33707
33708
|
var COUNTER_FIELDS = ["views", "reactions", "comments"];
|
|
33708
33709
|
var validCounter = /* @__PURE__ */ __name((value) => typeof value === "number" && Number.isFinite(value) && value >= 0, "validCounter");
|
|
33709
33710
|
var counterValue = /* @__PURE__ */ __name((message3, field4) => {
|
|
@@ -33740,7 +33741,7 @@ var counterFreshness = /* @__PURE__ */ __name((states) => {
|
|
|
33740
33741
|
return states.some((one2) => one2.freshness === "stale") ? "stale" : "fresh";
|
|
33741
33742
|
}, "counterFreshness");
|
|
33742
33743
|
|
|
33743
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
33744
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sqlite/bot-tokens.js
|
|
33744
33745
|
var BOT_TOKEN = /(?<!\d)(\d{6,12}):[A-Za-z0-9_-]{30,40}(?![A-Za-z0-9_-])/g;
|
|
33745
33746
|
var MAY_HOLD = "*[0-9][0-9][0-9][0-9][0-9][0-9]:*";
|
|
33746
33747
|
var MASKED_THROUGH = "bot_tokens_masked_through";
|
|
@@ -33780,7 +33781,7 @@ var maskStoredBotTokens = /* @__PURE__ */ __name((context) => {
|
|
|
33780
33781
|
}, "maskStoredBotTokens");
|
|
33781
33782
|
var masks = /* @__PURE__ */ __name((value) => value != null && withoutBotTokens(String(value)) !== value, "masks");
|
|
33782
33783
|
|
|
33783
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
33784
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/context/evidence.js
|
|
33784
33785
|
import { createHash as createHash4 } from "node:crypto";
|
|
33785
33786
|
var CONTEXT_MAX_READ_BYTES = 262144;
|
|
33786
33787
|
var CONTEXT_SOURCE_KINDS = ["message", "mail", "document", "meeting"];
|
|
@@ -33878,7 +33879,7 @@ var contextEvidenceRequest = /* @__PURE__ */ __name((input) => {
|
|
|
33878
33879
|
return { source: source2, query, chat: chat2, senders, words: words4, after: after2, before: before2, limit, maxReadBytes, cursor, signal: input.signal };
|
|
33879
33880
|
}, "contextEvidenceRequest");
|
|
33880
33881
|
|
|
33881
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
33882
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sqlite/email-activity.js
|
|
33882
33883
|
var MAIL_AGENDA_COLUMNS = { chat_kind: { type: "enum", sql: "'dialog'" } };
|
|
33883
33884
|
var ACTIVITY = `
|
|
33884
33885
|
SELECT t.external_id AS thread, t.subject, t.last_email_at, t.emails_count,
|
|
@@ -34008,7 +34009,7 @@ var mailActivity = /* @__PURE__ */ __name((database) => ({
|
|
|
34008
34009
|
threadActivity: /* @__PURE__ */ __name(async (accountId, since, where) => threadActivity(database, accountId, since, where), "threadActivity")
|
|
34009
34010
|
}), "mailActivity");
|
|
34010
34011
|
|
|
34011
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34012
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/conversations/mail-text.js
|
|
34012
34013
|
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");
|
|
34013
34014
|
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;
|
|
34014
34015
|
var ATTRIBUTION = /(wrote|написал[аи]?|escribió|a écrit|schrieb)\s*:\s*$/iu;
|
|
@@ -34089,7 +34090,7 @@ var mailCore = /* @__PURE__ */ __name((body2, earlier) => {
|
|
|
34089
34090
|
return withoutSignOff(withoutGreeting(kept2)).join("\n").trim();
|
|
34090
34091
|
}, "mailCore");
|
|
34091
34092
|
|
|
34092
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34093
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sqlite/email-index.js
|
|
34093
34094
|
var titleOf2 = /* @__PURE__ */ __name((subject2) => subject2?.replace(/^\s*((re|fwd?|aw|wg)\s*:\s*)+/i, "").trim() || null, "titleOf");
|
|
34094
34095
|
var MAIL_PIECES = `(SELECT k.id, k.content_hash, k.chunkable_type AS type, k.chunkable_id AS owner, k.position,
|
|
34095
34096
|
k.start_offset, k.end_offset, k.account_id, k.occurred_at,
|
|
@@ -34202,7 +34203,7 @@ var drainEmailIndex = /* @__PURE__ */ __name((database, stemmerFor2) => {
|
|
|
34202
34203
|
return emails3 + threads;
|
|
34203
34204
|
}, "drainEmailIndex");
|
|
34204
34205
|
|
|
34205
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34206
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sqlite/email-locations.js
|
|
34206
34207
|
var locate = /* @__PURE__ */ __name((database, accountId, emailId, where) => database.prepare(`INSERT OR REPLACE INTO email_locations (mailbox_id, uidvalidity, uid, email_id)
|
|
34207
34208
|
SELECT id, ?, ?, ? FROM mailboxes WHERE account_id = ? AND external_id = ?`).run(where.uidvalidity, where.uid, emailId, accountId, where.folder), "locate");
|
|
34208
34209
|
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,
|
|
@@ -34300,7 +34301,7 @@ var forgetLocations = /* @__PURE__ */ __name((database, accountId, folder, uidva
|
|
|
34300
34301
|
var backfillSentAt = /* @__PURE__ */ __name((database, accountId, limit) => Number(database.prepare(`UPDATE emails SET sent_at = received_at WHERE id IN (
|
|
34301
34302
|
SELECT id FROM emails WHERE account_id = ? AND sent_at IS NULL AND received_at IS NOT NULL LIMIT ?)`).run(accountId, limit).changes), "backfillSentAt");
|
|
34302
34303
|
|
|
34303
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34304
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sqlite/email-state.js
|
|
34304
34305
|
var recountEmailThread = /* @__PURE__ */ __name((database, threadId, now2) => database.prepare(`UPDATE email_threads SET
|
|
34305
34306
|
emails_count = (SELECT count(*) FROM emails WHERE email_thread_id = ? AND deleted_at IS NULL),
|
|
34306
34307
|
last_email_at = (SELECT max(coalesce(sent_at, received_at)) FROM emails
|
|
@@ -34350,7 +34351,7 @@ var markEmailsRestored = /* @__PURE__ */ __name((database, accountId, externalId
|
|
|
34350
34351
|
return threads.length;
|
|
34351
34352
|
}, "markEmailsRestored");
|
|
34352
34353
|
|
|
34353
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34354
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sqlite/mail-nearest.js
|
|
34354
34355
|
var MAIL_PIECE_ROWS = `SELECT p.id, p.content_hash AS hash, p.type, p.owner, p.position, p.email_id AS email, v.vector
|
|
34355
34356
|
FROM ${MAIL_PIECES} JOIN embeddings v ON v.model = ? AND v.content_hash = p.content_hash
|
|
34356
34357
|
WHERE p.account_id = ?
|
|
@@ -34410,7 +34411,7 @@ var indexedMailPieces = /* @__PURE__ */ __name((database, model, query, filter,
|
|
|
34410
34411
|
}, "indexedMailPieces");
|
|
34411
34412
|
var nearestMailPieces = /* @__PURE__ */ __name((database, model, query, filter, depth) => (filter.threadExternalId === void 0 ? indexedMailPieces(database, model, query, filter, depth) : void 0) ?? scannedMailPieces(database, model, query, filter), "nearestMailPieces");
|
|
34412
34413
|
|
|
34413
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34414
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sqlite/mail-rules.js
|
|
34414
34415
|
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");
|
|
34415
34416
|
var conditionsKey = /* @__PURE__ */ __name((conditions) => JSON.stringify(sorted(conditions)), "conditionsKey");
|
|
34416
34417
|
var ruleOf = /* @__PURE__ */ __name((row2) => ({
|
|
@@ -34477,7 +34478,7 @@ var mailRulesOver = /* @__PURE__ */ __name((database) => ({
|
|
|
34477
34478
|
}
|
|
34478
34479
|
}), "mailRulesOver");
|
|
34479
34480
|
|
|
34480
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34481
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-operation.js
|
|
34481
34482
|
function checkMeetingCancelled(signal) {
|
|
34482
34483
|
if (!signal?.aborted)
|
|
34483
34484
|
return;
|
|
@@ -34488,7 +34489,7 @@ function checkMeetingCancelled(signal) {
|
|
|
34488
34489
|
}
|
|
34489
34490
|
__name(checkMeetingCancelled, "checkMeetingCancelled");
|
|
34490
34491
|
|
|
34491
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34492
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-values.js
|
|
34492
34493
|
var meetingOf = /* @__PURE__ */ __name((row2) => ({
|
|
34493
34494
|
id: Number(row2.id),
|
|
34494
34495
|
accountId: Number(row2.account_id),
|
|
@@ -34538,7 +34539,7 @@ var transcriptRowOf = /* @__PURE__ */ __name((row2) => ({
|
|
|
34538
34539
|
createdAt: Number(row2.created_at)
|
|
34539
34540
|
}), "transcriptRowOf");
|
|
34540
34541
|
|
|
34541
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34542
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-reads.js
|
|
34542
34543
|
var MEETING_TEXT = ["external_id", "title", "description", "location", "join_url", "timezone", "metadata"];
|
|
34543
34544
|
var TRANSCRIPT_TEXT = ["source", "format", "language", "content_hash", "metadata"];
|
|
34544
34545
|
var ROW_TEXT = ["speaker_name", "text", "normalized_text", "metadata"];
|
|
@@ -34705,7 +34706,7 @@ var meetingReadsOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
|
34705
34706
|
}
|
|
34706
34707
|
}), "meetingReadsOver");
|
|
34707
34708
|
|
|
34708
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34709
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-selection.js
|
|
34709
34710
|
var meetingSelectionSql = /* @__PURE__ */ __name((input) => {
|
|
34710
34711
|
const clauses = ["m.account_id=?", "m.deleted_at IS NULL"];
|
|
34711
34712
|
const params = [input.accountId];
|
|
@@ -34748,7 +34749,7 @@ var meetingSelectionSql = /* @__PURE__ */ __name((input) => {
|
|
|
34748
34749
|
return { clauses, params };
|
|
34749
34750
|
}, "meetingSelectionSql");
|
|
34750
34751
|
|
|
34751
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34752
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-calls.js
|
|
34752
34753
|
var MOST_CALLS = 2e5;
|
|
34753
34754
|
var parsed3 = /* @__PURE__ */ __name((value) => {
|
|
34754
34755
|
if (typeof value !== "string")
|
|
@@ -34803,7 +34804,7 @@ var meetingCallsOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
|
34803
34804
|
}
|
|
34804
34805
|
}), "meetingCallsOver");
|
|
34805
34806
|
|
|
34806
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34807
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-chat-lines.js
|
|
34807
34808
|
var meetingChatLinesOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
34808
34809
|
async meetingChatLines(input) {
|
|
34809
34810
|
checkMeetingCancelled(input.signal);
|
|
@@ -34831,7 +34832,7 @@ var meetingChatLinesOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
|
34831
34832
|
}
|
|
34832
34833
|
}), "meetingChatLinesOver");
|
|
34833
34834
|
|
|
34834
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34835
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-context-links.js
|
|
34835
34836
|
var missing2 = /* @__PURE__ */ __name(() => {
|
|
34836
34837
|
throw new CliError("not_found", "Meeting, participant or selected target not found");
|
|
34837
34838
|
}, "missing");
|
|
@@ -34954,7 +34955,7 @@ function meetingContextLinksOver(context) {
|
|
|
34954
34955
|
}
|
|
34955
34956
|
__name(meetingContextLinksOver, "meetingContextLinksOver");
|
|
34956
34957
|
|
|
34957
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34958
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-documents.js
|
|
34958
34959
|
var TRANSCRIPT_ROLE = "transcript";
|
|
34959
34960
|
var roleOf3 = /* @__PURE__ */ __name((value) => MEETING_DOCUMENT_ROLES.find((role) => role === value), "roleOf");
|
|
34960
34961
|
var attach = /* @__PURE__ */ __name((database, meetingId, fileId, role, metadata3, listed, now2) => {
|
|
@@ -35028,7 +35029,7 @@ var meetingTranscriptDocumentsOver = /* @__PURE__ */ __name(({ database }) => {
|
|
|
35028
35029
|
};
|
|
35029
35030
|
}, "meetingTranscriptDocumentsOver");
|
|
35030
35031
|
|
|
35031
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
35032
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-index-values.js
|
|
35032
35033
|
var INDEX_CODES = { meeting_transcript_row: 1, meeting_chat_message: 2, meeting_summary: 3 };
|
|
35033
35034
|
var meetingRowid = /* @__PURE__ */ __name((type, id2) => id2 * 4 + INDEX_CODES[type], "meetingRowid");
|
|
35034
35035
|
var summaryOf2 = /* @__PURE__ */ __name((row2) => ({
|
|
@@ -35057,7 +35058,7 @@ var indexedText = /* @__PURE__ */ __name((database, type, id2) => {
|
|
|
35057
35058
|
return row2 ? summaryText(summaryOf2(row2)) : null;
|
|
35058
35059
|
}, "indexedText");
|
|
35059
35060
|
|
|
35060
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
35061
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-stem-state.js
|
|
35061
35062
|
var summaryBytes = ["title", "overview", "sections", "next_steps", "content"].map((key2) => `coalesce(length(CAST(s.${key2} AS BLOB)),0)`).join("+");
|
|
35062
35063
|
var meetingCurrentIndexRows = `
|
|
35063
35064
|
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
|
|
@@ -35088,7 +35089,7 @@ var invalidateMeetingStems = /* @__PURE__ */ __name((database, type, id2) => {
|
|
|
35088
35089
|
}, "invalidateMeetingStems");
|
|
35089
35090
|
var meetingStemmableText = /* @__PURE__ */ __name((text8) => text8.replace(/[\p{L}\p{N}\p{M}\p{Co}]+/gu, (token) => token.length <= 1024 ? token : ""), "meetingStemmableText");
|
|
35090
35091
|
|
|
35091
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
35092
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-hit-index.js
|
|
35092
35093
|
function meetingHitIndexOver({ database, now: now2 }) {
|
|
35093
35094
|
return {
|
|
35094
35095
|
async indexSearch(original) {
|
|
@@ -35156,10 +35157,10 @@ function meetingHitIndexOver({ database, now: now2 }) {
|
|
|
35156
35157
|
}
|
|
35157
35158
|
__name(meetingHitIndexOver, "meetingHitIndexOver");
|
|
35158
35159
|
|
|
35159
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
35160
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-hit-search.js
|
|
35160
35161
|
import { createHash as createHash5 } from "node:crypto";
|
|
35161
35162
|
|
|
35162
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
35163
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/search/correct.js
|
|
35163
35164
|
var SHORTEST_CORRECTION = 3;
|
|
35164
35165
|
var maxEdits = /* @__PURE__ */ __name((word2) => word2.length <= 4 ? 1 : 2, "maxEdits");
|
|
35165
35166
|
var editDistance = /* @__PURE__ */ __name((a, b, max) => {
|
|
@@ -35206,7 +35207,7 @@ var correctWords = /* @__PURE__ */ __name(async (vocabulary, words4) => {
|
|
|
35206
35207
|
return corrections;
|
|
35207
35208
|
}, "correctWords");
|
|
35208
35209
|
|
|
35209
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
35210
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/search/garbled.js
|
|
35210
35211
|
var SHORTEST_GARBLED = 4;
|
|
35211
35212
|
var MOST_WIDENED = 64;
|
|
35212
35213
|
var plain = /* @__PURE__ */ __name((word2) => word2.replaceAll("\u044D", "\u0435"), "plain");
|
|
@@ -35227,14 +35228,14 @@ var garbledDistance = /* @__PURE__ */ __name((probe, word2, stems) => {
|
|
|
35227
35228
|
return null;
|
|
35228
35229
|
if (isNumberWord(probe.literal) || isNumberWord(word2))
|
|
35229
35230
|
return null;
|
|
35230
|
-
const
|
|
35231
|
+
const literal5 = plain(probe.literal);
|
|
35231
35232
|
const stored4 = plain(word2);
|
|
35232
35233
|
let best = null;
|
|
35233
35234
|
for (const queryStem of probe.stems.map(plain))
|
|
35234
35235
|
for (const wordStem of stems.map(plain)) {
|
|
35235
35236
|
if (Math.min(queryStem.length, wordStem.length) < 3)
|
|
35236
35237
|
continue;
|
|
35237
|
-
if (wordStem.startsWith(queryStem) &&
|
|
35238
|
+
if (wordStem.startsWith(queryStem) && literal5.startsWith(wordStem) || queryStem.startsWith(wordStem) && stored4.startsWith(queryStem))
|
|
35238
35239
|
return 0;
|
|
35239
35240
|
if (queryStem.length < SHORTEST_GARBLED)
|
|
35240
35241
|
continue;
|
|
@@ -35244,7 +35245,7 @@ var garbledDistance = /* @__PURE__ */ __name((probe, word2, stems) => {
|
|
|
35244
35245
|
if (distance <= 1)
|
|
35245
35246
|
best = distance;
|
|
35246
35247
|
}
|
|
35247
|
-
if (best === null && stored4.length >= SHORTEST_GARBLED &&
|
|
35248
|
+
if (best === null && stored4.length >= SHORTEST_GARBLED && literal5.startsWith(stored4))
|
|
35248
35249
|
return 1;
|
|
35249
35250
|
return best;
|
|
35250
35251
|
}, "garbledDistance");
|
|
@@ -35298,7 +35299,7 @@ var widenWords = /* @__PURE__ */ __name((probes, vocabulary, stem, known2) => {
|
|
|
35298
35299
|
return found2.map((words4) => words4.sort((a, b) => a.distance - b.distance || b.docs - a.docs || a.term.localeCompare(b.term)).slice(0, MOST_WIDENED).map((word2) => word2.term));
|
|
35299
35300
|
}, "widenWords");
|
|
35300
35301
|
|
|
35301
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
35302
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/search/russian-dictionary.js
|
|
35302
35303
|
import { readFileSync } from "node:fs";
|
|
35303
35304
|
var loaded;
|
|
35304
35305
|
var dictionary = /* @__PURE__ */ __name(() => {
|
|
@@ -35357,7 +35358,7 @@ var knownRussianWord = /* @__PURE__ */ __name((word2) => {
|
|
|
35357
35358
|
return false;
|
|
35358
35359
|
}, "knownRussianWord");
|
|
35359
35360
|
|
|
35360
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
35361
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-hit-query.js
|
|
35361
35362
|
var WORD2 = /[\p{L}\p{N}\p{M}]+/gu;
|
|
35362
35363
|
var MOST_WORDS = 128;
|
|
35363
35364
|
var quote = /* @__PURE__ */ __name((word2) => `"${word2.replaceAll('"', '""')}"`, "quote");
|
|
@@ -35435,11 +35436,11 @@ var resolveMeetingQuery = /* @__PURE__ */ __name((database, accountId, ast, stat
|
|
|
35435
35436
|
const all2 = [];
|
|
35436
35437
|
const wordsOf6 = /* @__PURE__ */ __name((value, exact) => {
|
|
35437
35438
|
const words4 = (value.match(WORD2) ?? []).filter((raw) => normalize(raw)).map((raw) => {
|
|
35438
|
-
const
|
|
35439
|
+
const literal5 = normalize(raw);
|
|
35439
35440
|
return {
|
|
35440
35441
|
raw,
|
|
35441
|
-
literal:
|
|
35442
|
-
whole: exact || isNumberWord(
|
|
35442
|
+
literal: literal5,
|
|
35443
|
+
whole: exact || isNumberWord(literal5),
|
|
35443
35444
|
stems: state.stemmer && raw.length <= 1024 && !exact ? [...new Set(state.stemmer.explain(raw).map((word2) => word2.stem))] : [],
|
|
35444
35445
|
widened: []
|
|
35445
35446
|
};
|
|
@@ -35613,7 +35614,7 @@ var matchedMeetingWords = /* @__PURE__ */ __name((tree, text8, stemmer2) => {
|
|
|
35613
35614
|
return [...found2];
|
|
35614
35615
|
}, "matchedMeetingWords");
|
|
35615
35616
|
|
|
35616
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
35617
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-hit-search.js
|
|
35617
35618
|
var fail = /* @__PURE__ */ __name((message3) => {
|
|
35618
35619
|
throw new CliError("validation_error", message3);
|
|
35619
35620
|
}, "fail");
|
|
@@ -35797,7 +35798,7 @@ function meetingHitSearchOver({ database }) {
|
|
|
35797
35798
|
}
|
|
35798
35799
|
__name(meetingHitSearchOver, "meetingHitSearchOver");
|
|
35799
35800
|
|
|
35800
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
35801
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-languages.js
|
|
35801
35802
|
var meetingLanguagesOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
35802
35803
|
async fillTranscriptLanguages({ accountId, apply, now: now2 }) {
|
|
35803
35804
|
positiveReadInteger(accountId, "accountId");
|
|
@@ -35829,7 +35830,7 @@ var meetingLanguagesOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
|
35829
35830
|
}
|
|
35830
35831
|
}), "meetingLanguagesOver");
|
|
35831
35832
|
|
|
35832
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
35833
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-participant-search.js
|
|
35833
35834
|
import { createHash as createHash6 } from "node:crypto";
|
|
35834
35835
|
var cursorOf2 = /* @__PURE__ */ __name((value, key2) => {
|
|
35835
35836
|
if (value === void 0)
|
|
@@ -35922,7 +35923,7 @@ var meetingParticipantSearchOver = /* @__PURE__ */ __name((context) => ({
|
|
|
35922
35923
|
}
|
|
35923
35924
|
}), "meetingParticipantSearchOver");
|
|
35924
35925
|
|
|
35925
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
35926
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sqlite/preparation-context-queries.js
|
|
35926
35927
|
var preparationQueries = {
|
|
35927
35928
|
participants: {
|
|
35928
35929
|
fields: "p.id, p.identity_id, p.display_name, l.person_id",
|
|
@@ -35972,7 +35973,7 @@ var preparationQueries = {
|
|
|
35972
35973
|
}
|
|
35973
35974
|
};
|
|
35974
35975
|
|
|
35975
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
35976
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-preparation-context.js
|
|
35976
35977
|
var meetingPreparationContextOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
35977
35978
|
async preparationContext(original) {
|
|
35978
35979
|
const input = validateMeetingPreparationContext(original);
|
|
@@ -36013,7 +36014,7 @@ var meetingPreparationContextOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
|
36013
36014
|
}
|
|
36014
36015
|
}), "meetingPreparationContextOver");
|
|
36015
36016
|
|
|
36016
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
36017
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sqlite/preparation-subjects.js
|
|
36017
36018
|
var preparationSubjects = /* @__PURE__ */ __name((anchors) => `WITH anchors AS (
|
|
36018
36019
|
SELECT m.id FROM meetings m JOIN meeting_series s ON s.id=m.meeting_series_id
|
|
36019
36020
|
WHERE m.id IN (${Array.from({ length: anchors }, () => "?").join(",")}) AND m.account_id=? AND s.account_id=?
|
|
@@ -36027,7 +36028,7 @@ var preparationSubjects = /* @__PURE__ */ __name((anchors) => `WITH anchors AS (
|
|
|
36027
36028
|
JOIN main.projects p ON p.id=l.to_id WHERE p.account_id IS NULL AND p.deleted_at IS NULL
|
|
36028
36029
|
)`, "preparationSubjects");
|
|
36029
36030
|
|
|
36030
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
36031
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-preparation-knowledge.js
|
|
36031
36032
|
var meetingPreparationKnowledgeOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
36032
36033
|
async preparationKnowledge(original) {
|
|
36033
36034
|
const { accountId, seriesId, anchorIds, after: after2, before: before2, limit, maxReadBytes, signal } = validateMeetingRelatedHistory(original);
|
|
@@ -36072,7 +36073,7 @@ var meetingPreparationKnowledgeOver = /* @__PURE__ */ __name(({ database }) => (
|
|
|
36072
36073
|
}
|
|
36073
36074
|
}), "meetingPreparationKnowledgeOver");
|
|
36074
36075
|
|
|
36075
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
36076
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-preparation-notes.js
|
|
36076
36077
|
var meetingPreparationNotesOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
36077
36078
|
async preparationNotes(original) {
|
|
36078
36079
|
const { accountId, seriesId, anchorIds, after: after2, before: before2, limit, maxReadBytes, signal } = validateMeetingRelatedHistory(original);
|
|
@@ -36125,7 +36126,7 @@ var meetingPreparationNotesOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
|
36125
36126
|
}
|
|
36126
36127
|
}), "meetingPreparationNotesOver");
|
|
36127
36128
|
|
|
36128
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
36129
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-related-history.js
|
|
36129
36130
|
var meetingRelatedHistoryOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
36130
36131
|
async relatedHistory(original) {
|
|
36131
36132
|
const input = validateMeetingRelatedHistory(original);
|
|
@@ -36196,7 +36197,7 @@ var meetingRelatedHistoryOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
|
36196
36197
|
}
|
|
36197
36198
|
}), "meetingRelatedHistoryOver");
|
|
36198
36199
|
|
|
36199
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
36200
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-review.js
|
|
36200
36201
|
var number2 = /* @__PURE__ */ __name((value) => value === null || value === void 0 ? null : Number(value), "number");
|
|
36201
36202
|
var text4 = /* @__PURE__ */ __name((value) => value === null || value === void 0 ? null : String(value), "text");
|
|
36202
36203
|
var meetingReviewOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
@@ -36277,7 +36278,7 @@ var meetingReviewOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
|
36277
36278
|
}
|
|
36278
36279
|
}), "meetingReviewOver");
|
|
36279
36280
|
|
|
36280
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
36281
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-series-history.js
|
|
36281
36282
|
var bytes2 = "length(CAST(external_id AS BLOB)) + coalesce(length(CAST(title AS BLOB)), 0)";
|
|
36282
36283
|
var ensureBytes2 = /* @__PURE__ */ __name((size2, budget) => {
|
|
36283
36284
|
if (!Number.isSafeInteger(size2) || size2 < 0 || size2 > budget)
|
|
@@ -36331,7 +36332,7 @@ var meetingSeriesHistoryOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
|
36331
36332
|
}
|
|
36332
36333
|
}), "meetingSeriesHistoryOver");
|
|
36333
36334
|
|
|
36334
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
36335
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-stats.js
|
|
36335
36336
|
var MOST_ROWS = 5e5;
|
|
36336
36337
|
var meetingCountsSql = /* @__PURE__ */ __name((where) => `SELECT m.started_at, coalesce(m.duration_ms, m.ended_at - m.started_at) AS duration_ms,
|
|
36337
36338
|
EXISTS (SELECT 1 FROM meeting_transcripts t WHERE t.meeting_id = m.id AND t.deleted_at IS NULL
|
|
@@ -36400,7 +36401,7 @@ var meetingStatsOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
|
36400
36401
|
}
|
|
36401
36402
|
}), "meetingStatsOver");
|
|
36402
36403
|
|
|
36403
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
36404
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/domain/name-variants.js
|
|
36404
36405
|
var CYRILLIC_TO_LATIN = {
|
|
36405
36406
|
\u0430: "a",
|
|
36406
36407
|
\u0431: "b",
|
|
@@ -36622,7 +36623,7 @@ for (const [full, short] of Object.entries(SHORT_FORMS))
|
|
|
36622
36623
|
}
|
|
36623
36624
|
var fullNames = /* @__PURE__ */ __name((skeleton) => [skeleton, ...FULL_NAMES.get(skeleton) ?? []], "fullNames");
|
|
36624
36625
|
|
|
36625
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
36626
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sqlite/name-traces.js
|
|
36626
36627
|
var peopleByNameKey = /* @__PURE__ */ __name((database) => {
|
|
36627
36628
|
const found2 = /* @__PURE__ */ new Map();
|
|
36628
36629
|
for (const row2 of database.prepare("SELECT p.id, p.name FROM persons p WHERE p.owner = 0 AND p.name IS NOT NULL AND EXISTS (SELECT 1 FROM identity_links l WHERE l.person_id = p.id) ORDER BY p.id").all()) {
|
|
@@ -36738,7 +36739,7 @@ function* sharedTraces(database, a, b, name, except) {
|
|
|
36738
36739
|
}
|
|
36739
36740
|
__name(sharedTraces, "sharedTraces");
|
|
36740
36741
|
|
|
36741
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
36742
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sqlite/person-matcher.js
|
|
36742
36743
|
var spellingsOf = /* @__PURE__ */ __name((value) => [value, value.slice(1)], "spellingsOf");
|
|
36743
36744
|
var PERSON_BY = {
|
|
36744
36745
|
// UNION, not OR: each branch reads its own index.
|
|
@@ -36761,7 +36762,7 @@ var personsByIdentifiers = /* @__PURE__ */ __name((database, ids3) => {
|
|
|
36761
36762
|
return [...found2].sort((a, b) => a - b);
|
|
36762
36763
|
}, "personsByIdentifiers");
|
|
36763
36764
|
|
|
36764
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
36765
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sqlite/person-match-scan.js
|
|
36765
36766
|
var BY = "rule";
|
|
36766
36767
|
var RULE = { bot: "rule", kind: "rule" };
|
|
36767
36768
|
var MOST_SHARING = 6;
|
|
@@ -37208,7 +37209,7 @@ var linkPhones = /* @__PURE__ */ __name((context, identities2) => {
|
|
|
37208
37209
|
return pass.result;
|
|
37209
37210
|
}, "linkPhones");
|
|
37210
37211
|
|
|
37211
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
37212
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sqlite/meetings.js
|
|
37212
37213
|
var CURSOR_KEY = "meetings";
|
|
37213
37214
|
var seriesOf2 = /* @__PURE__ */ __name((row2) => ({
|
|
37214
37215
|
id: Number(row2.id),
|
|
@@ -37808,7 +37809,7 @@ var meetingStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
37808
37809
|
};
|
|
37809
37810
|
}, "meetingStoreOver");
|
|
37810
37811
|
|
|
37811
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
37812
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sqlite/sync.js
|
|
37812
37813
|
var syncStateOf = /* @__PURE__ */ __name(({ orm }, accountKey, name) => {
|
|
37813
37814
|
const row2 = orm.select({ value: syncCursors.value, at: syncCursors.updatedAt }).from(syncCursors).where(and(eq(syncCursors.accountId, accountKey), eq(syncCursors.key, name))).get();
|
|
37814
37815
|
return row2 ? { value: row2.value, at: toIso(row2.at) } : void 0;
|
|
@@ -37834,7 +37835,7 @@ var release = /* @__PURE__ */ __name(({ orm }, chatKey, anchor, holder2) => {
|
|
|
37834
37835
|
orm.delete(fetchLeases).where(and(eq(fetchLeases.chatId, chatKey), eq(fetchLeases.anchor, anchor), eq(fetchLeases.holder, holder2))).run();
|
|
37835
37836
|
}, "release");
|
|
37836
37837
|
|
|
37837
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
37838
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sqlite/thread-columns.js
|
|
37838
37839
|
var THREAD_COLUMNS = {
|
|
37839
37840
|
subject: {
|
|
37840
37841
|
where: /* @__PURE__ */ __name(({ value }) => ({
|
|
@@ -37851,7 +37852,7 @@ var threadRows = /* @__PURE__ */ __name((database, filter) => {
|
|
|
37851
37852
|
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);
|
|
37852
37853
|
}, "threadRows");
|
|
37853
37854
|
|
|
37854
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
37855
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sqlite/emails.js
|
|
37855
37856
|
var threadConversation = /* @__PURE__ */ __name((place, builtAt) => ({
|
|
37856
37857
|
id: `email:${place.emailId}`,
|
|
37857
37858
|
chatId: place.threadExternalId,
|
|
@@ -38393,7 +38394,7 @@ var mailStoreOver = /* @__PURE__ */ __name(({ database, orm, now: now2 }, stemme
|
|
|
38393
38394
|
}
|
|
38394
38395
|
}), "mailStoreOver");
|
|
38395
38396
|
|
|
38396
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
38397
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/search/dictionary.js
|
|
38397
38398
|
import { readFileSync as readFileSync2 } from "node:fs";
|
|
38398
38399
|
var DICTIONARIES = Object.fromEntries(LANGUAGES.map(({ name, dictionary: dictionary3 }) => [name, dictionary3]));
|
|
38399
38400
|
var folded5 = /* @__PURE__ */ __name((word2) => /^[а-яё'-]*$/.test(word2) ? word2.replaceAll("\u0451", "\u0435").replaceAll("\u0439", "\u0438") : fold(word2), "folded");
|
|
@@ -38483,7 +38484,7 @@ var knownWord = /* @__PURE__ */ __name((languages) => {
|
|
|
38483
38484
|
}, "knownWord");
|
|
38484
38485
|
var dictionaryLanguages = /* @__PURE__ */ __name((stemmers) => [stemmers.cyrillic, ...stemmers.latin.split(",")].filter((name) => Object.hasOwn(DICTIONARIES, name)), "dictionaryLanguages");
|
|
38485
38486
|
|
|
38486
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
38487
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sqlite/transcript-query.js
|
|
38487
38488
|
var predicates = /* @__PURE__ */ __name((node) => node.kind === "predicate" ? [node] : node.clauses.flatMap(({ node: node2 }) => predicates(node2)), "predicates");
|
|
38488
38489
|
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");
|
|
38489
38490
|
var LATIN_NUMBERS = new Set(`zero one two three four five six seven eight nine ten eleven twelve twenty thirty forty fifty sixty seventy
|
|
@@ -38569,7 +38570,7 @@ var spokenTranscripts = /* @__PURE__ */ __name((database, item, speaking, keys)
|
|
|
38569
38570
|
return found2;
|
|
38570
38571
|
}, "spokenTranscripts");
|
|
38571
38572
|
|
|
38572
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
38573
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sqlite/hit-places.js
|
|
38573
38574
|
var startOf = /* @__PURE__ */ __name((node) => node.operator === "wildcard" && node.implicit ? /^([\p{L}\p{N}]+)\*$/u.exec(normalize(node.value))?.[1] : void 0, "startOf");
|
|
38574
38575
|
var matchOf = /* @__PURE__ */ __name((node) => {
|
|
38575
38576
|
const start = startOf(node);
|
|
@@ -38627,7 +38628,7 @@ var placeHits = /* @__PURE__ */ __name((database, corpus, leaves, transcripts, f
|
|
|
38627
38628
|
});
|
|
38628
38629
|
}, "placeHits");
|
|
38629
38630
|
|
|
38630
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
38631
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sqlite/lucene-groups.js
|
|
38631
38632
|
var GROUPS = {
|
|
38632
38633
|
chat: {
|
|
38633
38634
|
key: "m.chat_id",
|
|
@@ -38649,7 +38650,7 @@ var GROUPS = {
|
|
|
38649
38650
|
}
|
|
38650
38651
|
};
|
|
38651
38652
|
|
|
38652
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
38653
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sqlite/lucene.js
|
|
38653
38654
|
var MESSAGES = {
|
|
38654
38655
|
rows: "messages",
|
|
38655
38656
|
threads: "chats",
|
|
@@ -39142,7 +39143,7 @@ var runCompiled = /* @__PURE__ */ __name(async (context, execution, by) => {
|
|
|
39142
39143
|
};
|
|
39143
39144
|
}, "runCompiled");
|
|
39144
39145
|
|
|
39145
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
39146
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sqlite/counters.js
|
|
39146
39147
|
function invalidMetadata() {
|
|
39147
39148
|
throw new CliError("validation_error", "stored counter metadata is malformed \u2014 check the store before refreshing");
|
|
39148
39149
|
}
|
|
@@ -39244,7 +39245,7 @@ var counterTargets = /* @__PURE__ */ __name((context, execution, options) => wit
|
|
|
39244
39245
|
};
|
|
39245
39246
|
}), "counterTargets");
|
|
39246
39247
|
|
|
39247
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
39248
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sqlite/attachment-texts.js
|
|
39248
39249
|
var NOT_FILE_LIST = [...NOT_FILES].map((kind3) => `'${kind3}'`).join(",");
|
|
39249
39250
|
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,
|
|
39250
39251
|
att.size, att.local_path, att.extraction AS origin, att.size AS read_bytes, att.extraction_error AS error, att.content_sha256, att.extractor
|
|
@@ -39363,7 +39364,7 @@ var attachmentViews = /* @__PURE__ */ __name(({ database }, accountKey, { chatKe
|
|
|
39363
39364
|
}));
|
|
39364
39365
|
}, "attachmentViews");
|
|
39365
39366
|
|
|
39366
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
39367
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sqlite/transcripts.js
|
|
39367
39368
|
var transcript2 = /* @__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");
|
|
39368
39369
|
var keepTranscript = /* @__PURE__ */ __name((context, chatKey, messageId, text8, source2) => {
|
|
39369
39370
|
const { orm, database, now: now2 } = context;
|
|
@@ -39401,7 +39402,7 @@ var intoVoiceAttachment = /* @__PURE__ */ __name((context, messagePk) => {
|
|
|
39401
39402
|
keepText(context, Number(row2.id), { text: String(row2.text), origin: "extracted", extractor: `speech:${row2.source}` });
|
|
39402
39403
|
}, "intoVoiceAttachment");
|
|
39403
39404
|
|
|
39404
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
39405
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sqlite/messages.js
|
|
39405
39406
|
var FIELDS = [
|
|
39406
39407
|
"threadExternalId",
|
|
39407
39408
|
"senderIdentityId",
|
|
@@ -39725,7 +39726,7 @@ var writeDerivedReactions = /* @__PURE__ */ __name((context, chatKey, messageId)
|
|
|
39725
39726
|
reactionStatementsOf(context.database).total.run(JSON.stringify(derived), chatKey, messageId);
|
|
39726
39727
|
}, "writeDerivedReactions");
|
|
39727
39728
|
|
|
39728
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
39729
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/keys.js
|
|
39729
39730
|
var keysOver = /* @__PURE__ */ __name((context) => {
|
|
39730
39731
|
const findAccountPk2 = /* @__PURE__ */ __name((key2) => findAccountPk(context, key2), "findAccountPk");
|
|
39731
39732
|
const findChatPk2 = /* @__PURE__ */ __name((accountKey, chatId) => findChatPk(context, accountKey, chatId), "findChatPk");
|
|
@@ -39746,7 +39747,7 @@ var keysOver = /* @__PURE__ */ __name((context) => {
|
|
|
39746
39747
|
};
|
|
39747
39748
|
}, "keysOver");
|
|
39748
39749
|
|
|
39749
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
39750
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sqlite/account-groups.js
|
|
39750
39751
|
var accountGroupsOf = /* @__PURE__ */ __name((database) => {
|
|
39751
39752
|
const row2 = database.prepare("SELECT value FROM store_settings WHERE key = ?").get(ACCOUNT_GROUPS);
|
|
39752
39753
|
if (!row2)
|
|
@@ -39793,7 +39794,7 @@ var forgetProfile = /* @__PURE__ */ __name((database, app, profile, now2) => {
|
|
|
39793
39794
|
database.prepare("INSERT OR REPLACE INTO store_settings (key, value, at) VALUES (?, ?, ?)").run(PROFILES, JSON.stringify(profiles), now2);
|
|
39794
39795
|
}, "forgetProfile");
|
|
39795
39796
|
|
|
39796
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
39797
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sqlite/calendar-events.js
|
|
39797
39798
|
var DAY4 = 864e5;
|
|
39798
39799
|
var COUNTERPART_LINK = `EXISTS (SELECT 1 FROM links l WHERE l.from_type = 'event' AND l.from_id = e.id AND l.to_type = 'person' AND l.to_id = ? AND l.kind = ${linkKind("related-to")} AND l.role = '${COUNTERPART_ROLE}')`;
|
|
39799
39800
|
var accountsOf = /* @__PURE__ */ __name((filter) => {
|
|
@@ -39909,7 +39910,7 @@ var listEvents = /* @__PURE__ */ __name((database, filter) => {
|
|
|
39909
39910
|
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);
|
|
39910
39911
|
}, "listEvents");
|
|
39911
39912
|
|
|
39912
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
39913
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sqlite/calendar-forget.js
|
|
39913
39914
|
var distinctIds = /* @__PURE__ */ __name((rows) => [...new Set(rows.map((row2) => Number(row2.id)))], "distinctIds");
|
|
39914
39915
|
var forgetCalendarRows = /* @__PURE__ */ __name((database, { calendarId, accountId, cursorKey, now: now2 }, refresh) => {
|
|
39915
39916
|
const unseenBefore = unreferenced(database, "identities");
|
|
@@ -39966,7 +39967,7 @@ var forgetCalendarRows = /* @__PURE__ */ __name((database, { calendarId, account
|
|
|
39966
39967
|
return { entries: entryIds.length, events: goneEvents.length };
|
|
39967
39968
|
}, "forgetCalendarRows");
|
|
39968
39969
|
|
|
39969
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
39970
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sqlite/calendar.js
|
|
39970
39971
|
var calendarOf = /* @__PURE__ */ __name((row2) => ({
|
|
39971
39972
|
id: Number(row2.id),
|
|
39972
39973
|
accountId: Number(row2.account_id),
|
|
@@ -40569,7 +40570,7 @@ var eventStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
40569
40570
|
};
|
|
40570
40571
|
}, "eventStoreOver");
|
|
40571
40572
|
|
|
40572
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
40573
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sqlite/account-purge.js
|
|
40573
40574
|
var purgeAccount = /* @__PURE__ */ __name((context, accountKey) => {
|
|
40574
40575
|
const { orm, database, now: now2 } = context;
|
|
40575
40576
|
const unseenBefore = unreferenced(database, "identities");
|
|
@@ -40684,7 +40685,7 @@ var purgeCrmCopies = /* @__PURE__ */ __name((database, accountKey) => {
|
|
|
40684
40685
|
run("DELETE FROM pipelines WHERE account_id = ?", accountKey);
|
|
40685
40686
|
}, "purgeCrmCopies");
|
|
40686
40687
|
|
|
40687
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
40688
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sqlite/own-identities.js
|
|
40688
40689
|
var ACCOUNT_REASON = "an account you connected, under another name: a mailbox or messenger you read may be someone else's";
|
|
40689
40690
|
var ownerNames = /* @__PURE__ */ __name(({ database }, owner) => database.prepare("SELECT i.name FROM identity_links l JOIN identities i ON i.id = l.identity_id WHERE l.person_id = ?").all(owner).map(({ name }) => new Set(nameSkeletons(displayName(typeof name === "string" ? name : null)))).filter((words4) => words4.size > 0), "ownerNames");
|
|
40690
40691
|
var ownersName = /* @__PURE__ */ __name((name, owner, alone) => {
|
|
@@ -40743,7 +40744,7 @@ var linkToOwner = /* @__PURE__ */ __name((context, ref3) => {
|
|
|
40743
40744
|
return personOf2(context, ref3);
|
|
40744
40745
|
}, "linkToOwner");
|
|
40745
40746
|
|
|
40746
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
40747
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sqlite/providers.js
|
|
40747
40748
|
var PROVIDERS_SETTING = "providers";
|
|
40748
40749
|
var storedProvidersOf = /* @__PURE__ */ __name((database) => {
|
|
40749
40750
|
const row2 = database.prepare("SELECT value FROM store_settings WHERE key = ?").get(PROVIDERS_SETTING);
|
|
@@ -40791,7 +40792,7 @@ var registerProvider = /* @__PURE__ */ __name((database, value, now2) => {
|
|
|
40791
40792
|
});
|
|
40792
40793
|
}, "registerProvider");
|
|
40793
40794
|
|
|
40794
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
40795
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sqlite/task-candidates.js
|
|
40795
40796
|
var DAY5 = 864e5;
|
|
40796
40797
|
var RECENTLY_CLOSED_MS = 14 * DAY5;
|
|
40797
40798
|
var TEXT_LIMIT = 20;
|
|
@@ -40989,7 +40990,7 @@ var taskSimilarityOver = /* @__PURE__ */ __name((context) => {
|
|
|
40989
40990
|
};
|
|
40990
40991
|
}, "taskSimilarityOver");
|
|
40991
40992
|
|
|
40992
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
40993
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sqlite/task-category-settings.js
|
|
40993
40994
|
var SETTING3 = "taskCategories";
|
|
40994
40995
|
var savedTaskCategories = /* @__PURE__ */ __name((database) => {
|
|
40995
40996
|
const row2 = database.prepare("SELECT value FROM store_settings WHERE key = ?").get(SETTING3);
|
|
@@ -41008,7 +41009,7 @@ var saveTaskCategories = /* @__PURE__ */ __name((database, categories, now2) =>
|
|
|
41008
41009
|
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);
|
|
41009
41010
|
}, "saveTaskCategories");
|
|
41010
41011
|
|
|
41011
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
41012
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sqlite/task-close.js
|
|
41012
41013
|
var DEFAULT_AGENT_CLOSE = { allowed: true, min: 0.8 };
|
|
41013
41014
|
var ALLOWED = "taskAgentClose";
|
|
41014
41015
|
var MIN = "taskAgentCloseMin";
|
|
@@ -41064,7 +41065,7 @@ var SUGGESTION_COLUMNS = [
|
|
|
41064
41065
|
];
|
|
41065
41066
|
var CLEAR_SUGGESTION = SUGGESTION_COLUMNS.map((column2) => `${column2} = NULL`).join(", ");
|
|
41066
41067
|
|
|
41067
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
41068
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sqlite/task-first-pass.js
|
|
41068
41069
|
var DEFAULT_FIRST_PASS_PER_CHAT = 0;
|
|
41069
41070
|
var KEY = "taskFirstPassPerChat";
|
|
41070
41071
|
var firstPassPerChatOf = /* @__PURE__ */ __name((value, setting = "task_first_pass_per_chat") => {
|
|
@@ -41084,7 +41085,7 @@ var saveFirstPassPerChat = /* @__PURE__ */ __name((database, value, now2) => {
|
|
|
41084
41085
|
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);
|
|
41085
41086
|
}, "saveFirstPassPerChat");
|
|
41086
41087
|
|
|
41087
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
41088
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/domain/external-links.js
|
|
41088
41089
|
var EXTERNAL_SERVICE = /^[a-z][a-z0-9-]{0,31}$/;
|
|
41089
41090
|
var EXTERNAL_ID_CHARS = 200;
|
|
41090
41091
|
var SOURCE_URL_CHARS = 2e3;
|
|
@@ -41111,7 +41112,7 @@ var sourceUrlOf = /* @__PURE__ */ __name((value, reason = "task.source-url") =>
|
|
|
41111
41112
|
return text8;
|
|
41112
41113
|
}, "sourceUrlOf");
|
|
41113
41114
|
|
|
41114
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
41115
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sqlite/task-board.js
|
|
41115
41116
|
var TASK_SORTS = ["priority", "due", "created", "updated", "key", "state"];
|
|
41116
41117
|
var field = /* @__PURE__ */ __name((name, type, example, more = {}) => ({
|
|
41117
41118
|
name,
|
|
@@ -41363,7 +41364,7 @@ var withoutField = /* @__PURE__ */ __name((query, name) => {
|
|
|
41363
41364
|
var TASK_PEOPLE = `WITH merged AS (SELECT json_extract(value, '$[0]') AS id, json_extract(value, '$[1]') AS now FROM json_each(?)), counts AS (SELECT coalesce(m.now, a.assignee_id) AS person, count(DISTINCT t.id) AS n FROM task_assignments a JOIN tasks t ON t.id = a.task_id AND t.deleted_at IS NULL LEFT JOIN merged m ON m.id = a.assignee_id WHERE a.assignee_type = 'person' GROUP BY 1) SELECT p.id, p.name, p.owner, coalesce(c.n, 0) AS n FROM persons p LEFT JOIN counts c ON c.person = p.id WHERE NOT ${mergedAwaySql("p")} ORDER BY p.owner DESC, n DESC, p.name IS NULL, p.name COLLATE NOCASE, p.id LIMIT ?`;
|
|
41364
41365
|
var mergedAssignees = /* @__PURE__ */ __name((database) => JSON.stringify(database.prepare(`SELECT DISTINCT a.assignee_id AS id FROM task_assignments a JOIN persons p ON p.id = a.assignee_id WHERE a.assignee_type = 'person' AND ${mergedAwaySql("p")}`).all().map(({ id: id2 }) => [Number(id2), currentPerson(database, Number(id2))])), "mergedAssignees");
|
|
41365
41366
|
|
|
41366
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
41367
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sqlite/task-comments.js
|
|
41367
41368
|
var authorNamed = /* @__PURE__ */ __name((database, row2) => {
|
|
41368
41369
|
if (row2.author_type == null)
|
|
41369
41370
|
return null;
|
|
@@ -41391,7 +41392,7 @@ var addComment = /* @__PURE__ */ __name((context, task, body2, by) => {
|
|
|
41391
41392
|
return commentsOf(database, task).find((one2) => one2.ref === `note:${made}`);
|
|
41392
41393
|
}, "addComment");
|
|
41393
41394
|
|
|
41394
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
41395
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sqlite/task-relations.js
|
|
41395
41396
|
var TASK_RELATION_KINDS = [
|
|
41396
41397
|
"blocked-by",
|
|
41397
41398
|
"follow-up-of",
|
|
@@ -41521,7 +41522,7 @@ var taskRelationsStoreOver = /* @__PURE__ */ __name((context, record3) => {
|
|
|
41521
41522
|
};
|
|
41522
41523
|
}, "taskRelationsStoreOver");
|
|
41523
41524
|
|
|
41524
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
41525
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sqlite/work-tasks.js
|
|
41525
41526
|
var TASK_ROLES = ["assignee", "reviewer", "watcher"];
|
|
41526
41527
|
var TASK_EVENT_KINDS = [
|
|
41527
41528
|
"created",
|
|
@@ -42080,7 +42081,7 @@ var workTasksOver = /* @__PURE__ */ __name((context) => {
|
|
|
42080
42081
|
};
|
|
42081
42082
|
}, "workTasksOver");
|
|
42082
42083
|
|
|
42083
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
42084
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sqlite/task-close-store.js
|
|
42084
42085
|
var taskCloseOver = /* @__PURE__ */ __name((context) => {
|
|
42085
42086
|
const { database, now: now2 } = context;
|
|
42086
42087
|
const liveRow = /* @__PURE__ */ __name((id2) => {
|
|
@@ -42129,7 +42130,7 @@ var taskCloseOver = /* @__PURE__ */ __name((context) => {
|
|
|
42129
42130
|
};
|
|
42130
42131
|
}, "taskCloseOver");
|
|
42131
42132
|
|
|
42132
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
42133
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sqlite/task-pairs.js
|
|
42133
42134
|
var TASK_PAIR_DECISIONS = ["review", "unsure", "merged", "rejected", "unmerged", "attached", "new"];
|
|
42134
42135
|
var taskPairsOver = /* @__PURE__ */ __name((context, similarity) => {
|
|
42135
42136
|
const { database, now: now2 } = context;
|
|
@@ -42348,7 +42349,7 @@ var taskPairsOver = /* @__PURE__ */ __name((context, similarity) => {
|
|
|
42348
42349
|
};
|
|
42349
42350
|
}, "taskPairsOver");
|
|
42350
42351
|
|
|
42351
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
42352
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sqlite/task-stats.js
|
|
42352
42353
|
var ACCOUNT_SCOPE = "t.package_id IS NOT NULL AND t.deleted_at IS NULL AND t.project_id = ?";
|
|
42353
42354
|
var TASK_STATS_SQL = {
|
|
42354
42355
|
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 ? PROJECT_SCOPE : ACCOUNT_SCOPE}${filter} ORDER BY t.created_at, t.id`, "rows"),
|
|
@@ -42387,7 +42388,7 @@ var taskStatsOver = /* @__PURE__ */ __name(({ database }, inbox) => ({
|
|
|
42387
42388
|
}, "statNames")
|
|
42388
42389
|
}), "taskStatsOver");
|
|
42389
42390
|
|
|
42390
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
42391
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sqlite/tasks.js
|
|
42391
42392
|
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";
|
|
42392
42393
|
var inboxProject = /* @__PURE__ */ __name(({ database, now: now2 }, account, create) => {
|
|
42393
42394
|
const key2 = inboxKey(account);
|
|
@@ -42603,7 +42604,7 @@ var oneOf4 = /* @__PURE__ */ __name((values, value, column2) => {
|
|
|
42603
42604
|
throw new CliError("configuration_error", `the store holds a task with an unknown ${column2} "${String(value)}"`);
|
|
42604
42605
|
}, "oneOf");
|
|
42605
42606
|
|
|
42606
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
42607
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/accounts.js
|
|
42607
42608
|
var accountAccountsOver = /* @__PURE__ */ __name((context) => {
|
|
42608
42609
|
const { database } = context;
|
|
42609
42610
|
const { accountPk: accountPk2, findAccountPk: findAccountPk2 } = keysOver(context);
|
|
@@ -42673,7 +42674,7 @@ var accountsStoreOver = /* @__PURE__ */ __name((context, keyed) => {
|
|
|
42673
42674
|
};
|
|
42674
42675
|
}, "accountsStoreOver");
|
|
42675
42676
|
|
|
42676
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
42677
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sqlite/attachments.js
|
|
42677
42678
|
var refColumn = /* @__PURE__ */ __name((ref3) => ref3 && Object.keys(ref3).length > 0 ? { providerRef: JSON.stringify(ref3) } : {}, "refColumn");
|
|
42678
42679
|
var updatePlaced = /* @__PURE__ */ __name(({ orm }, chatKey, messageId, files2, change) => {
|
|
42679
42680
|
const message3 = orm.select({ pk: messages.id }).from(messages).where(and(eq(messages.chatId, chatKey), eq(messages.externalId, messageId))).get();
|
|
@@ -42697,7 +42698,7 @@ var keepDownloads = /* @__PURE__ */ __name((context, chatKey, messageId, files2)
|
|
|
42697
42698
|
})), "keepDownloads");
|
|
42698
42699
|
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");
|
|
42699
42700
|
|
|
42700
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
42701
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/attachments.js
|
|
42701
42702
|
var accountAttachmentsOver = /* @__PURE__ */ __name((context) => {
|
|
42702
42703
|
const { database } = context;
|
|
42703
42704
|
const { findAccountPk: findAccountPk2, findChatPk: findChatPk2, chatKeyOf } = keysOver(context);
|
|
@@ -42754,7 +42755,7 @@ var attachmentsStoreOver = /* @__PURE__ */ __name((context, keyed) => ({
|
|
|
42754
42755
|
}, "keepAttachmentText")
|
|
42755
42756
|
}), "attachmentsStoreOver");
|
|
42756
42757
|
|
|
42757
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
42758
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sqlite/chat-rekey.js
|
|
42758
42759
|
var chatRow = /* @__PURE__ */ __name((context, accountKey, chatId) => context.database.prepare("SELECT * FROM chats WHERE account_id = ? AND external_id = ?").get(accountKey, chatId), "chatRow");
|
|
42759
42760
|
var pointerMover = /* @__PURE__ */ __name((context, type) => {
|
|
42760
42761
|
const statements = pointerPairs(context.database).filter(({ table }) => table !== "involvements").map(({ table, pointer }) => {
|
|
@@ -42939,7 +42940,7 @@ var rekeyChats = /* @__PURE__ */ __name((context, key2, accountKey, pairs, lockM
|
|
|
42939
42940
|
return done;
|
|
42940
42941
|
}, "rekeyChats");
|
|
42941
42942
|
|
|
42942
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
42943
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sqlite/completeness.js
|
|
42943
42944
|
var historyStartKey = /* @__PURE__ */ __name((chatId) => `history_start:${chatId}`, "historyStartKey");
|
|
42944
42945
|
var fetchedKey = /* @__PURE__ */ __name((chatId) => `fetched:${chatId}`, "fetchedKey");
|
|
42945
42946
|
var CHAT_LIST_KEY = "chat_list_complete";
|
|
@@ -42997,7 +42998,7 @@ var chatCoverage = /* @__PURE__ */ __name(({ database }, accountKey) => {
|
|
|
42997
42998
|
return { ...coverage, oldestMessageAt: toIso(oldest) };
|
|
42998
42999
|
}, "chatCoverage");
|
|
42999
43000
|
|
|
43000
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
43001
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/chats.js
|
|
43001
43002
|
var chatsStoreOver = /* @__PURE__ */ __name((context) => {
|
|
43002
43003
|
const { database } = context;
|
|
43003
43004
|
const { accountPk: accountPk2, findAccountPk: findAccountPk2, writeState: writeState2 } = keysOver(context);
|
|
@@ -43146,7 +43147,7 @@ var chatsStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
43146
43147
|
};
|
|
43147
43148
|
}, "chatsStoreOver");
|
|
43148
43149
|
|
|
43149
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
43150
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sqlite/batches.js
|
|
43150
43151
|
import { createHash as createHash7 } from "node:crypto";
|
|
43151
43152
|
var BATCH_CONTEXT = 50;
|
|
43152
43153
|
var replied = /* @__PURE__ */ __name((m) => sql`EXISTS (SELECT 1 FROM messages p WHERE p.chat_id = ${m}.chat_id
|
|
@@ -43284,7 +43285,7 @@ var saveAnswers = /* @__PURE__ */ __name((context, id2, answer) => {
|
|
|
43284
43285
|
var clearAnswers = /* @__PURE__ */ __name(({ orm }, chatKey, model) => Number(orm.all(sql`DELETE FROM message_links WHERE chat_id = ${chatKey} AND source = 'agent'
|
|
43285
43286
|
${model === void 0 ? sql`` : sql`AND method = ${model}`} RETURNING 1 AS n`).length), "clearAnswers");
|
|
43286
43287
|
|
|
43287
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
43288
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sqlite/conversations.js
|
|
43288
43289
|
import { setTimeout } from "node:timers/promises";
|
|
43289
43290
|
var position = /* @__PURE__ */ __name((sentAt, pk) => `${sentAt}:${pk}`, "position");
|
|
43290
43291
|
var linkInputs = /* @__PURE__ */ __name(({ orm }, chatKey, { after: after2, limit }) => {
|
|
@@ -43596,7 +43597,7 @@ var agentAnswers = /* @__PURE__ */ __name(({ orm }, chatKey) => new Map(orm.all(
|
|
|
43596
43597
|
AND NOT EXISTS (SELECT 1 FROM messages d
|
|
43597
43598
|
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");
|
|
43598
43599
|
|
|
43599
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
43600
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/conversations.js
|
|
43600
43601
|
var conversationsStoreOver = /* @__PURE__ */ __name((context) => {
|
|
43601
43602
|
const { database } = context;
|
|
43602
43603
|
const { findAccountPk: findAccountPk2, findChatPk: findChatPk2, chatKeyOf } = keysOver(context);
|
|
@@ -43703,7 +43704,7 @@ var conversationsStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
43703
43704
|
};
|
|
43704
43705
|
}, "conversationsStoreOver");
|
|
43705
43706
|
|
|
43706
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
43707
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/counters.js
|
|
43707
43708
|
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";
|
|
43708
43709
|
var accountCountersOver = /* @__PURE__ */ __name((context) => {
|
|
43709
43710
|
const { database } = context;
|
|
@@ -43728,7 +43729,7 @@ var countersStoreOver = /* @__PURE__ */ __name((context, keyed) => ({
|
|
|
43728
43729
|
counterTargets: /* @__PURE__ */ __name(async (execution, options) => counterTargets(context, execution, options), "counterTargets")
|
|
43729
43730
|
}), "countersStoreOver");
|
|
43730
43731
|
|
|
43731
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
43732
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sqlite/mentions.js
|
|
43732
43733
|
var MENTION_STATUSES = ["found", "linked", "proposed", "dismissed"];
|
|
43733
43734
|
var MENTION_QUERY = defineQuery({
|
|
43734
43735
|
entity: "mention",
|
|
@@ -43947,7 +43948,7 @@ var listPlaces = /* @__PURE__ */ __name((database, { limit, offset }) => {
|
|
|
43947
43948
|
return { items: hasMore ? rows.slice(0, limit) : rows, hasMore };
|
|
43948
43949
|
}, "listPlaces");
|
|
43949
43950
|
|
|
43950
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
43951
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/mentions.js
|
|
43951
43952
|
var accountMentionsOver = /* @__PURE__ */ __name((context) => {
|
|
43952
43953
|
const { database } = context;
|
|
43953
43954
|
const { findAccountPk: findAccountPk2 } = keysOver(context);
|
|
@@ -43982,7 +43983,7 @@ var mentionsStoreOver = /* @__PURE__ */ __name((context, keyed) => ({
|
|
|
43982
43983
|
places: /* @__PURE__ */ __name(async (window) => listPlaces(context.database, window), "places")
|
|
43983
43984
|
}), "mentionsStoreOver");
|
|
43984
43985
|
|
|
43985
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
43986
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sqlite/reply-times.js
|
|
43986
43987
|
var FAR = Number.MAX_SAFE_INTEGER;
|
|
43987
43988
|
var MUTED_NOW = "(coalesce(c.muted,0)=1 AND (c.muted_until IS NULL OR c.muted_until>?))";
|
|
43988
43989
|
var chatsIn = /* @__PURE__ */ __name((scope3, kinds2, now2) => {
|
|
@@ -44081,7 +44082,7 @@ var waitingChats = /* @__PURE__ */ __name((context, scope3, waits, cap) => {
|
|
|
44081
44082
|
});
|
|
44082
44083
|
}, "waitingChats");
|
|
44083
44084
|
|
|
44084
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
44085
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sqlite/chat-activity-counts.js
|
|
44085
44086
|
var SQL = `SELECT coalesce(nullif(trim(c.title), ''), (SELECT sender_name FROM messages WHERE chat_id = c.id AND outgoing = 0 AND deleted_at IS NULL ORDER BY sent_at DESC LIMIT 1)) AS title, ${MUTED_NOW} AS muted, w.messages, w.sent, (SELECT max(sent_at) FROM messages WHERE chat_id = c.id AND deleted_at IS NULL AND sent_at < ?) AS last FROM chats c, (SELECT count(*) AS messages, coalesce(sum(outgoing = 1), 0) AS sent FROM messages WHERE chat_id = ? AND deleted_at IS NULL AND sent_at >= ? AND sent_at < ?) w WHERE c.id = ?`;
|
|
44086
44087
|
var chatActivityCounts = /* @__PURE__ */ __name(({ database }, chatKeys, { since, until, now: now2 }) => {
|
|
44087
44088
|
const statement = database.prepare(SQL);
|
|
@@ -44101,7 +44102,7 @@ var chatActivityCounts = /* @__PURE__ */ __name(({ database }, chatKeys, { since
|
|
|
44101
44102
|
return found2;
|
|
44102
44103
|
}, "chatActivityCounts");
|
|
44103
44104
|
|
|
44104
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
44105
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sqlite/document-links.js
|
|
44105
44106
|
var documentLinkMessages = /* @__PURE__ */ __name(({ database }, chatKey, messageId) => {
|
|
44106
44107
|
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");
|
|
44107
44108
|
const rows = messageId === void 0 ? read2.all(chatKey) : read2.all(chatKey, messageId);
|
|
@@ -44116,7 +44117,7 @@ var documentLinkMessages = /* @__PURE__ */ __name(({ database }, chatKey, messag
|
|
|
44116
44117
|
}));
|
|
44117
44118
|
}, "documentLinkMessages");
|
|
44118
44119
|
|
|
44119
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
44120
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sqlite/follow-ups.js
|
|
44120
44121
|
var stemmerFor = stemmerCache();
|
|
44121
44122
|
var laterSharingRare = /* @__PURE__ */ __name((context, wanted, { rareAt, limit }) => {
|
|
44122
44123
|
if (wanted.length > 50 || !Number.isInteger(limit) || limit < 1 || limit > 100)
|
|
@@ -44160,7 +44161,7 @@ var laterSharingRare = /* @__PURE__ */ __name((context, wanted, { rareAt, limit
|
|
|
44160
44161
|
});
|
|
44161
44162
|
}, "laterSharingRare");
|
|
44162
44163
|
|
|
44163
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
44164
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/messages.js
|
|
44164
44165
|
var accountMessagesOver = /* @__PURE__ */ __name((context) => {
|
|
44165
44166
|
const { database } = context;
|
|
44166
44167
|
const { accountPk: accountPk2, findAccountPk: findAccountPk2, findChatPk: findChatPk2, chatKeyOf, chatPkFor: chatPkFor2, answeredChatPk: answeredChatPk2, upsertMessage: upsertMessage2 } = keysOver(context);
|
|
@@ -44301,7 +44302,7 @@ var messagesStoreOver = /* @__PURE__ */ __name((context, keyed) => ({
|
|
|
44301
44302
|
laterSharingRare: /* @__PURE__ */ __name(async (wanted, options) => laterSharingRare(context, wanted, options), "laterSharingRare")
|
|
44302
44303
|
}), "messagesStoreOver");
|
|
44303
44304
|
|
|
44304
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
44305
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/domain/person-kinds.js
|
|
44305
44306
|
var PERSON_KINDS = ["person", "organization", "automated", "stranger", "unsorted", "test"];
|
|
44306
44307
|
var AUTOMATED_WORDS = /* @__PURE__ */ new Set([
|
|
44307
44308
|
"noreply",
|
|
@@ -44364,7 +44365,7 @@ var isCompanyName = /* @__PURE__ */ __name((name) => {
|
|
|
44364
44365
|
return wordsOf3(name.replaceAll(".", "")).some((word2) => LEGAL_FORMS.has(word2) || COMPANY_WORDS.has(word2));
|
|
44365
44366
|
}, "isCompanyName");
|
|
44366
44367
|
|
|
44367
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
44368
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sqlite/person-ties.js
|
|
44368
44369
|
var SMALL_GROUP_MEMBERS = 10;
|
|
44369
44370
|
var PERSON_TIES = ["chat", "small-group", "mail", "meeting", "crm", "phone-book"];
|
|
44370
44371
|
var ALWAYS_SHOWN = ["owner", "added", "task"];
|
|
@@ -44419,7 +44420,7 @@ var shownReasons = /* @__PURE__ */ __name((database, people2) => {
|
|
|
44419
44420
|
return new Map([...found2].map(([person2, reasons]) => [person2, ORDER.filter((one2) => reasons.has(one2))]));
|
|
44420
44421
|
}, "shownReasons");
|
|
44421
44422
|
|
|
44422
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
44423
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sqlite/people-list.js
|
|
44423
44424
|
var PEOPLE_SORTS = ["interactions", "recent", "name", "tasks"];
|
|
44424
44425
|
var MIN_QUERY = 3;
|
|
44425
44426
|
var matching2 = /* @__PURE__ */ __name((query) => {
|
|
@@ -44764,7 +44765,7 @@ var similarPeople = /* @__PURE__ */ __name((database, typed, limit) => {
|
|
|
44764
44765
|
return withLastContact(database, rows).map((person2, at2) => ({ ...person2, sameName: same[at2] === true }));
|
|
44765
44766
|
}, "similarPeople");
|
|
44766
44767
|
|
|
44767
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
44768
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sqlite/person-doubts.js
|
|
44768
44769
|
var DOUBT_REASONS = ["owner-other-name", "test-data", "shared-address", "mixed-names"];
|
|
44769
44770
|
var COLUMNS5 = "l.person_id AS person, p.owner, p.name AS person_name, i.id AS pk, i.provider, i.external_id, i.name, i.phone, i.email, i.username, l.method, l.author, l.created_at, EXISTS (SELECT 1 FROM accounts a WHERE a.provider = i.provider AND a.external_id = i.external_id) AS account FROM identity_links l JOIN identities i ON i.id = l.identity_id JOIN persons p ON p.id = l.person_id";
|
|
44770
44771
|
var text5 = /* @__PURE__ */ __name((value) => typeof value === "string" && value.trim() !== "" ? value : null, "text");
|
|
@@ -45020,7 +45021,7 @@ var markTestData = /* @__PURE__ */ __name((context, uid, by) => {
|
|
|
45020
45021
|
return { person: `person:${person2}`, identities: identities2 };
|
|
45021
45022
|
}, "markTestData");
|
|
45022
45023
|
|
|
45023
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
45024
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sqlite/person-preparation.js
|
|
45024
45025
|
var GLOBAL_PROJECT = "SELECT id FROM main.projects WHERE account_id IS NULL AND deleted_at IS NULL";
|
|
45025
45026
|
var IN_SCOPES = "IN (SELECT value FROM json_each(?))";
|
|
45026
45027
|
var projectScope = /* @__PURE__ */ __name((id2) => `(SELECT p.scope FROM main.projects p WHERE p.id=${id2})`, "projectScope");
|
|
@@ -45089,7 +45090,7 @@ var personPreparation = /* @__PURE__ */ __name(({ database, now: now2 }, uid, {
|
|
|
45089
45090
|
});
|
|
45090
45091
|
}, "personPreparation");
|
|
45091
45092
|
|
|
45092
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
45093
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sqlite/person-scope.js
|
|
45093
45094
|
var personSeenInAccounts = /* @__PURE__ */ __name(({ database }, uid, accountIds) => {
|
|
45094
45095
|
const id2 = Number(uid);
|
|
45095
45096
|
if (!/^[1-9]\d*$/.test(uid) || !Number.isSafeInteger(id2) || !accountIds.length || accountIds.length > 1e3 || accountIds.some((account) => !Number.isSafeInteger(account) || account <= 0))
|
|
@@ -45097,7 +45098,7 @@ var personSeenInAccounts = /* @__PURE__ */ __name(({ database }, uid, accountIds
|
|
|
45097
45098
|
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(currentPerson(database, id2), JSON.stringify(accountIds)));
|
|
45098
45099
|
}, "personSeenInAccounts");
|
|
45099
45100
|
|
|
45100
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
45101
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sqlite/private-people.js
|
|
45101
45102
|
var required2 = /* @__PURE__ */ __name(({ database }, key2, personId) => {
|
|
45102
45103
|
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);
|
|
45103
45104
|
if (!row2)
|
|
@@ -45164,7 +45165,7 @@ var removeNote = /* @__PURE__ */ __name((context, key2, personId, id2) => {
|
|
|
45164
45165
|
return { id: id2, personId, removed: true };
|
|
45165
45166
|
}, "removeNote");
|
|
45166
45167
|
|
|
45167
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
45168
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/people.js
|
|
45168
45169
|
var accountPeopleOver = /* @__PURE__ */ __name((context) => {
|
|
45169
45170
|
const { database } = context;
|
|
45170
45171
|
const { accountPk: accountPk2, findAccountPk: findAccountPk2, identityPk: identityPk2 } = keysOver(context);
|
|
@@ -45291,13 +45292,13 @@ var peopleStoreOver = /* @__PURE__ */ __name((context, keyed) => {
|
|
|
45291
45292
|
};
|
|
45292
45293
|
}, "peopleStoreOver");
|
|
45293
45294
|
|
|
45294
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
45295
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sqlite/admin-statistics.js
|
|
45295
45296
|
import { createHash as createHash9 } from "node:crypto";
|
|
45296
45297
|
|
|
45297
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
45298
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/domain/admin-statistics.js
|
|
45298
45299
|
import { createHash as createHash8 } from "node:crypto";
|
|
45299
45300
|
|
|
45300
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
45301
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/domain/rankings-options.js
|
|
45301
45302
|
var MESSAGE_MEASURES = ["views", "reactions", "forwards", "comments", "replies", "thread-size"];
|
|
45302
45303
|
var AUTHOR_MEASURES = [
|
|
45303
45304
|
"messages",
|
|
@@ -45437,7 +45438,7 @@ var withoutUrls = /* @__PURE__ */ __name((text8) => text8.replace(/\S+/gu, (toke
|
|
|
45437
45438
|
var rankingWords = /* @__PURE__ */ __name((text8) => withoutUrls(text8).match(/[\p{L}\p{N}]+/gu)?.length ?? 0, "rankingWords");
|
|
45438
45439
|
var rankingQuestion = /* @__PURE__ */ __name((text8) => withoutUrls(text8).includes("?"), "rankingQuestion");
|
|
45439
45440
|
|
|
45440
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
45441
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/domain/rankings-graph.js
|
|
45441
45442
|
var RANKING_GRAPH_LIMITS = { nodes: 5e4, depth: 256, work: 1e7, bytes: 8388608 };
|
|
45442
45443
|
var exhausted2 = /* @__PURE__ */ __name((budget) => {
|
|
45443
45444
|
throw new CliError("validation_error", `ranking exceeded ${budget} \u2014 narrow its chat or date scope`, {
|
|
@@ -45659,7 +45660,7 @@ var rankReplyGraph = /* @__PURE__ */ __name((nodes, check3 = () => {
|
|
|
45659
45660
|
};
|
|
45660
45661
|
}, "rankReplyGraph");
|
|
45661
45662
|
|
|
45662
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
45663
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/domain/admin-statistics.js
|
|
45663
45664
|
var adminEntityKey = /* @__PURE__ */ __name((row2) => JSON.stringify([row2.account.provider, row2.account.account, row2.id]), "adminEntityKey");
|
|
45664
45665
|
var personKey = /* @__PURE__ */ __name((node) => JSON.stringify([node.account.provider, node.account.account, node.sender]), "personKey");
|
|
45665
45666
|
var locator = /* @__PURE__ */ __name((node) => formatLocator({ ...node.account, chat: node.chatId, message: node.id }), "locator");
|
|
@@ -45833,7 +45834,7 @@ var calculateAdminStatistics = /* @__PURE__ */ __name((nodes, stays, options, in
|
|
|
45833
45834
|
return { items, evidence, summary, graph: graph.quality };
|
|
45834
45835
|
}, "calculateAdminStatistics");
|
|
45835
45836
|
|
|
45836
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
45837
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/domain/rankings-range.js
|
|
45837
45838
|
var rankingContextRange = /* @__PURE__ */ __name((root) => {
|
|
45838
45839
|
const dates = [];
|
|
45839
45840
|
const visit = /* @__PURE__ */ __name((node, required3) => {
|
|
@@ -45855,7 +45856,7 @@ var rankingContextRange = /* @__PURE__ */ __name((root) => {
|
|
|
45855
45856
|
return dates[0].node.resolution.date;
|
|
45856
45857
|
}, "rankingContextRange");
|
|
45857
45858
|
|
|
45858
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
45859
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sqlite/rankings.js
|
|
45859
45860
|
var reactionCounts = /* @__PURE__ */ __name((stored4) => {
|
|
45860
45861
|
let counts;
|
|
45861
45862
|
try {
|
|
@@ -46150,7 +46151,7 @@ var rankQuery = /* @__PURE__ */ __name((context, execution, request, inspect) =>
|
|
|
46150
46151
|
});
|
|
46151
46152
|
}, "rankQuery");
|
|
46152
46153
|
|
|
46153
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
46154
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sqlite/admin-statistics.js
|
|
46154
46155
|
function fail2(message3, reason = "query.too-large") {
|
|
46155
46156
|
throw new CliError("validation_error", message3, { reason, complete: false });
|
|
46156
46157
|
}
|
|
@@ -46327,7 +46328,7 @@ var adminStatisticsQuery = /* @__PURE__ */ __name((context, execution, request)
|
|
|
46327
46328
|
return result;
|
|
46328
46329
|
}), "adminStatisticsQuery");
|
|
46329
46330
|
|
|
46330
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
46331
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sqlite/conversation-eligibility.js
|
|
46331
46332
|
var conversationEligibility = /* @__PURE__ */ __name(async (context, execution) => {
|
|
46332
46333
|
if (!execution.accounts.length)
|
|
46333
46334
|
return { conversations: [], chats: [] };
|
|
@@ -46345,7 +46346,7 @@ var conversationEligibility = /* @__PURE__ */ __name(async (context, execution)
|
|
|
46345
46346
|
return { conversations: conversations2, chats: chats2 };
|
|
46346
46347
|
}, "conversationEligibility");
|
|
46347
46348
|
|
|
46348
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
46349
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sqlite/ranking-evidence.js
|
|
46349
46350
|
import { createHash as createHash10 } from "node:crypto";
|
|
46350
46351
|
var EVIDENCE_BYTES = 64 * 1024;
|
|
46351
46352
|
var FINGERPRINT_BYTES = 8 * 1024 * 1024;
|
|
@@ -46495,7 +46496,7 @@ var rankingEvidence = /* @__PURE__ */ __name((context, execution, request) => {
|
|
|
46495
46496
|
return result;
|
|
46496
46497
|
}, "rankingEvidence");
|
|
46497
46498
|
|
|
46498
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
46499
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/queries.js
|
|
46499
46500
|
var queriesStoreOver = /* @__PURE__ */ __name((context, stemmerFor2) => {
|
|
46500
46501
|
const mailIndexed = /* @__PURE__ */ __name((execution) => {
|
|
46501
46502
|
if (execution.corpus === "mail")
|
|
@@ -46516,7 +46517,7 @@ var queriesStoreOver = /* @__PURE__ */ __name((context, stemmerFor2) => {
|
|
|
46516
46517
|
};
|
|
46517
46518
|
}, "queriesStoreOver");
|
|
46518
46519
|
|
|
46519
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
46520
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sqlite/chat-events.js
|
|
46520
46521
|
var saveChatEvents = /* @__PURE__ */ __name((context, accountKey, provider, chatKey, events3) => {
|
|
46521
46522
|
const { database, now: now2 } = context;
|
|
46522
46523
|
const insert = database.prepare(`INSERT INTO chat_events (chat_id, source_id, action, actor_identity_id, title, happened_at, created_at, updated_at)
|
|
@@ -46555,10 +46556,10 @@ var chatEventsOf = /* @__PURE__ */ __name(({ database }, chatKey, { since = 0, l
|
|
|
46555
46556
|
}));
|
|
46556
46557
|
}, "chatEventsOf");
|
|
46557
46558
|
|
|
46558
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
46559
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sqlite/retention.js
|
|
46559
46560
|
import { createHash as createHash11 } from "node:crypto";
|
|
46560
46561
|
|
|
46561
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
46562
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/domain/calendar.js
|
|
46562
46563
|
var calendarKey = /* @__PURE__ */ __name((zone, by) => {
|
|
46563
46564
|
const format = new Intl.DateTimeFormat("en-CA", {
|
|
46564
46565
|
timeZone: zone,
|
|
@@ -46578,7 +46579,7 @@ var weekKey = /* @__PURE__ */ __name((day3) => {
|
|
|
46578
46579
|
return date3.toISOString().slice(0, 10);
|
|
46579
46580
|
}, "weekKey");
|
|
46580
46581
|
|
|
46581
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
46582
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/domain/retention.js
|
|
46582
46583
|
var RETENTION_TOLERANCE = 864e5;
|
|
46583
46584
|
var validateRetentionOptions = /* @__PURE__ */ __name((options) => {
|
|
46584
46585
|
const { since, until, cutoff, checkpoints, within, limit, by } = options;
|
|
@@ -46632,7 +46633,7 @@ var retentionCohorts = /* @__PURE__ */ __name((stays, options) => {
|
|
|
46632
46633
|
return [...groups.values()].sort((a, b) => a.cohort.localeCompare(b.cohort));
|
|
46633
46634
|
}, "retentionCohorts");
|
|
46634
46635
|
|
|
46635
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
46636
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sqlite/retention.js
|
|
46636
46637
|
var iso10 = /* @__PURE__ */ __name((at2) => new Date(at2).toISOString(), "iso");
|
|
46637
46638
|
var retentionQuery = /* @__PURE__ */ __name((context, accountPk2, chatPk, chatId, options, evidence) => {
|
|
46638
46639
|
validateRetentionOptions(options);
|
|
@@ -46763,7 +46764,7 @@ var retentionQuery = /* @__PURE__ */ __name((context, accountPk2, chatPk, chatId
|
|
|
46763
46764
|
};
|
|
46764
46765
|
}, "retentionQuery");
|
|
46765
46766
|
|
|
46766
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
46767
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sqlite/roster.js
|
|
46767
46768
|
var iso11 = /* @__PURE__ */ __name((ms) => ms === null ? null : new Date(ms).toISOString(), "iso");
|
|
46768
46769
|
var marksOf = /* @__PURE__ */ __name(({ isBot: isBot2, flagged, deleted, hasPhoto }) => ({
|
|
46769
46770
|
...isBot2 === void 0 ? {} : { bot: isBot2 },
|
|
@@ -46892,7 +46893,7 @@ var trackedChats = /* @__PURE__ */ __name((context, accountKey, where) => contex
|
|
|
46892
46893
|
lastCount: memberCountsOf(context, pk).at(-1) ?? null
|
|
46893
46894
|
})), "trackedChats");
|
|
46894
46895
|
|
|
46895
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
46896
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/roster.js
|
|
46896
46897
|
var rosterStoreOver = /* @__PURE__ */ __name((context) => {
|
|
46897
46898
|
const { database } = context;
|
|
46898
46899
|
const { accountPk: accountPk2, findAccountPk: findAccountPk2, chatKeyOf, chatPkFor: chatPkFor2, writeMembers: writeMembers2 } = keysOver(context);
|
|
@@ -46948,7 +46949,7 @@ var rosterStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
46948
46949
|
};
|
|
46949
46950
|
}, "rosterStoreOver");
|
|
46950
46951
|
|
|
46951
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
46952
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sqlite/backfill.js
|
|
46952
46953
|
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");
|
|
46953
46954
|
var backfillNormalized = /* @__PURE__ */ __name((database, { batch = 5e3, onBatch, until = /* @__PURE__ */ __name(() => false, "until") } = {}) => {
|
|
46954
46955
|
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 ?`);
|
|
@@ -46972,7 +46973,7 @@ var backfillNormalized = /* @__PURE__ */ __name((database, { batch = 5e3, onBatc
|
|
|
46972
46973
|
}
|
|
46973
46974
|
}, "backfillNormalized");
|
|
46974
46975
|
|
|
46975
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
46976
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sqlite/search-index.js
|
|
46976
46977
|
var INDEX2 = "message_words";
|
|
46977
46978
|
var searchIndexState2 = /* @__PURE__ */ __name((database) => {
|
|
46978
46979
|
const row2 = indexRow(database, INDEX2);
|
|
@@ -47099,7 +47100,7 @@ var resetSearchIndex = /* @__PURE__ */ __name((database) => {
|
|
|
47099
47100
|
});
|
|
47100
47101
|
}, "resetSearchIndex");
|
|
47101
47102
|
|
|
47102
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
47103
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sqlite/stems-fill.js
|
|
47103
47104
|
var fillStems = /* @__PURE__ */ __name((database, { batch = 5e3, until = /* @__PURE__ */ __name(() => false, "until"), onBatch, now: now2 = Date.now } = {}) => {
|
|
47104
47105
|
const filled = { stemmed: 0, drained: 0 };
|
|
47105
47106
|
const before2 = stemsState(database);
|
|
@@ -47194,7 +47195,7 @@ var followDefaultStemmers = /* @__PURE__ */ __name((database, now2 = Date.now) =
|
|
|
47194
47195
|
return resetStems(database, { now: now2 });
|
|
47195
47196
|
}, "followDefaultStemmers");
|
|
47196
47197
|
|
|
47197
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
47198
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sqlite/words.js
|
|
47198
47199
|
var VOCABULARY = "SELECT term, doc FROM message_words_vocab WHERE col = 'normalized_text'";
|
|
47199
47200
|
var knownTerms = /* @__PURE__ */ __name(({ database }, terms) => {
|
|
47200
47201
|
const lookup = database.prepare(`${VOCABULARY} AND term >= ? AND term <= ? LIMIT 1`);
|
|
@@ -47216,7 +47217,7 @@ var termCandidates = /* @__PURE__ */ __name(({ database }, pieces, { shortest, l
|
|
|
47216
47217
|
});
|
|
47217
47218
|
}, "termCandidates");
|
|
47218
47219
|
|
|
47219
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
47220
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/search-index.js
|
|
47220
47221
|
var searchIndexStoreOver = /* @__PURE__ */ __name((context) => {
|
|
47221
47222
|
const { database } = context;
|
|
47222
47223
|
const stemmerFor2 = stemmerCache();
|
|
@@ -47240,7 +47241,7 @@ var searchIndexStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
47240
47241
|
};
|
|
47241
47242
|
}, "searchIndexStoreOver");
|
|
47242
47243
|
|
|
47243
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
47244
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sqlite/searches.js
|
|
47244
47245
|
var HISTORY_KEPT = 1e3;
|
|
47245
47246
|
var commandFilter = /* @__PURE__ */ __name((commands) => commands ? { sql: ` AND command IN (${commands.map(() => "?").join(", ")})`, values: [...commands] } : { sql: "", values: [] }, "commandFilter");
|
|
47246
47247
|
var COLUMNS6 = "id, name, command, params, language, version, fields_version, created_at, updated_at, last_run_at, runs";
|
|
@@ -47310,7 +47311,7 @@ var clearHistory = /* @__PURE__ */ __name(({ database }, commands) => {
|
|
|
47310
47311
|
return database.prepare(`DELETE FROM searches WHERE name IS NULL${only.sql}`).run(...only.values).changes;
|
|
47311
47312
|
}, "clearHistory");
|
|
47312
47313
|
|
|
47313
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
47314
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/searches.js
|
|
47314
47315
|
var searchesStoreOver = /* @__PURE__ */ __name((context) => {
|
|
47315
47316
|
const { database } = context;
|
|
47316
47317
|
return {
|
|
@@ -47334,7 +47335,7 @@ var searchesStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
47334
47335
|
};
|
|
47335
47336
|
}, "searchesStoreOver");
|
|
47336
47337
|
|
|
47337
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
47338
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sqlite/added-sources.js
|
|
47338
47339
|
import { createHash as createHash12 } from "node:crypto";
|
|
47339
47340
|
var ADDED_KINDS = ["text", "file", "page"];
|
|
47340
47341
|
var TEXT_COLUMNS = "kind = ?, title = ?, file_name = ?, extension = ?, url = ?, mime = ?, size = ?, content_hash = ?, body = ?, extraction = ?, metadata = ?, language = ?";
|
|
@@ -47576,7 +47577,7 @@ var addedSourcesOver = /* @__PURE__ */ __name((context) => {
|
|
|
47576
47577
|
};
|
|
47577
47578
|
}, "addedSourcesOver");
|
|
47578
47579
|
|
|
47579
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
47580
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sqlite/agent-actions.js
|
|
47580
47581
|
var ACTION_TIERS = ["read", "draft", "write-private", "write-public", "destructive", "admin"];
|
|
47581
47582
|
var ACTION_OUTCOMES = ["ok", "refused", "failed"];
|
|
47582
47583
|
var CODE = /^[a-z][a-z0-9_]{0,63}$/;
|
|
@@ -47624,7 +47625,7 @@ var agentActionsStoreOver = /* @__PURE__ */ __name((context, afterRecord = () =>
|
|
|
47624
47625
|
};
|
|
47625
47626
|
}, "agentActionsStoreOver");
|
|
47626
47627
|
|
|
47627
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
47628
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sqlite/base-suggest.js
|
|
47628
47629
|
var baseSettingKey = /* @__PURE__ */ __name((kind3) => `stages.base.${kind3}`, "baseSettingKey");
|
|
47629
47630
|
var storedPipeline = /* @__PURE__ */ __name((value) => {
|
|
47630
47631
|
if (typeof value !== "string")
|
|
@@ -47670,7 +47671,7 @@ var suggestBaseStages = /* @__PURE__ */ __name((database, kind3, pipelines2, { o
|
|
|
47670
47671
|
}
|
|
47671
47672
|
}, "suggestBaseStages");
|
|
47672
47673
|
|
|
47673
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
47674
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/domain/records.js
|
|
47674
47675
|
import { createHash as createHash13 } from "node:crypto";
|
|
47675
47676
|
var RECORDS_SCHEMA_VERSION = 1;
|
|
47676
47677
|
var RECORD_OPERATIONS = ["upsert", "delete"];
|
|
@@ -47811,8 +47812,39 @@ var fieldReferences = /* @__PURE__ */ __name((record3, options = {}) => {
|
|
|
47811
47812
|
return found2;
|
|
47812
47813
|
}, "fieldReferences");
|
|
47813
47814
|
|
|
47814
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
47815
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sqlite/crm-rows.js
|
|
47815
47816
|
var TABLES2 = { deal: "deals", lead: "leads" };
|
|
47817
|
+
var MONEY_REFUSALS = ["money.currency", "money.amount"];
|
|
47818
|
+
var amountFault = /* @__PURE__ */ __name((item, code) => {
|
|
47819
|
+
const text8 = String(item.amount).trim();
|
|
47820
|
+
const decimal2 = /^\d+(?:\.(\d+))?$/.exec(text8);
|
|
47821
|
+
if (text8.startsWith("-"))
|
|
47822
|
+
return "it is below zero";
|
|
47823
|
+
if (!decimal2)
|
|
47824
|
+
return "it is not a decimal number";
|
|
47825
|
+
if ((decimal2[1] ?? "").length > scaleOf(String(code)))
|
|
47826
|
+
return `it has more decimals than ${code} has`;
|
|
47827
|
+
return "it is too large to keep exactly";
|
|
47828
|
+
}, "amountFault");
|
|
47829
|
+
var moneyOf2 = /* @__PURE__ */ __name((item) => {
|
|
47830
|
+
if (item.amount == null || item.currency == null)
|
|
47831
|
+
return { currency: null, amount: null, amountNote: null };
|
|
47832
|
+
try {
|
|
47833
|
+
const currency2 = currencyOf(item.currency);
|
|
47834
|
+
return { currency: currency2, amount: minorUnits(String(item.amount), currency2), amountNote: null };
|
|
47835
|
+
} catch (error) {
|
|
47836
|
+
const reason = error instanceof CliError ? error.details?.reason : void 0;
|
|
47837
|
+
if (!MONEY_REFUSALS.includes(reason))
|
|
47838
|
+
throw error;
|
|
47839
|
+
const code = textOf4(String(item.currency), 10);
|
|
47840
|
+
const why = reason === "money.currency" ? `the store keeps no amounts in ${code}` : amountFault(item, code);
|
|
47841
|
+
return {
|
|
47842
|
+
currency: null,
|
|
47843
|
+
amount: null,
|
|
47844
|
+
amountNote: `the CRM's amount ${textOf4(String(item.amount), 40)} ${code} is not kept: ${why}`
|
|
47845
|
+
};
|
|
47846
|
+
}
|
|
47847
|
+
}, "moneyOf");
|
|
47816
47848
|
var SOURCE = "crm";
|
|
47817
47849
|
var crmIdentityId = /* @__PURE__ */ __name((key2, externalId, type = "contact") => `${idPart(key2.account)}/${type}/${idPart(externalId)}`, "crmIdentityId");
|
|
47818
47850
|
var idPart = /* @__PURE__ */ __name((value) => value.replaceAll("%", "%25").replaceAll("/", "%2F"), "idPart");
|
|
@@ -47894,11 +47926,7 @@ var crmRowsOver = /* @__PURE__ */ __name((context) => {
|
|
|
47894
47926
|
message: `${kind3} ${item.externalId} stands in stage ${item.stage} of pipeline ${item.pipeline}, which is not stored`
|
|
47895
47927
|
};
|
|
47896
47928
|
const title2 = textOf4(item.title, 200) ?? `${kind3} ${item.externalId}`;
|
|
47897
|
-
const
|
|
47898
|
-
const currency2 = given3 ? currencyOf(item.currency) : null;
|
|
47899
|
-
const amount = currency2 === null ? null : minorUnits(String(item.amount), currency2, `${kind3} ${item.externalId}'s amount`);
|
|
47900
|
-
if (amount !== null && amount < 0)
|
|
47901
|
-
throw new CliError("validation_error", "an amount is 0 or more");
|
|
47929
|
+
const { currency: currency2, amount, amountNote } = moneyOf2(item);
|
|
47902
47930
|
if (item.status != null && !STAGE_OUTCOMES.includes(item.status))
|
|
47903
47931
|
throw new CliError("validation_error", `${kind3} ${item.externalId}'s status is open, won or lost`);
|
|
47904
47932
|
const status2 = item.status ?? String(stage.outcome);
|
|
@@ -47910,7 +47938,8 @@ var crmRowsOver = /* @__PURE__ */ __name((context) => {
|
|
|
47910
47938
|
...item.assignee ? { assignee: crmIdentityId(key2, item.assignee, "user") } : {},
|
|
47911
47939
|
...textOf4(item.contactName, 200) ? { contact_name: textOf4(item.contactName, 200) } : {},
|
|
47912
47940
|
...textOf4(item.companyName, 200) ? { company_name: textOf4(item.companyName, 200) } : {},
|
|
47913
|
-
...item.closedReason && status2 !== "open" ? { closed_reason: textOf4(item.closedReason, 2e3) } : {}
|
|
47941
|
+
...item.closedReason && status2 !== "open" ? { closed_reason: textOf4(item.closedReason, 2e3) } : {},
|
|
47942
|
+
...amountNote ? { amount_note: { label: "Amount not kept", value: amountNote } } : {}
|
|
47914
47943
|
};
|
|
47915
47944
|
const values = {
|
|
47916
47945
|
title: title2,
|
|
@@ -47937,12 +47966,12 @@ var crmRowsOver = /* @__PURE__ */ __name((context) => {
|
|
|
47937
47966
|
}
|
|
47938
47967
|
if (writer3.project !== void 0)
|
|
47939
47968
|
database.prepare(`UPDATE ${table} SET project_id = ? WHERE id = ?`).run(writer3.project, id2);
|
|
47940
|
-
return { id: id2 };
|
|
47969
|
+
return { id: id2, ...amountNote ? { amountNote } : {} };
|
|
47941
47970
|
}, "saveItemRow");
|
|
47942
47971
|
return { savePipeline, saveItemRow };
|
|
47943
47972
|
}, "crmRowsOver");
|
|
47944
47973
|
|
|
47945
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
47974
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sqlite/crm-activities.js
|
|
47946
47975
|
var ACTIVITY_RECORD = "crm.activity";
|
|
47947
47976
|
var MOST_BODY = 2e4;
|
|
47948
47977
|
var MOST_SUBJECT = 500;
|
|
@@ -48022,7 +48051,7 @@ var crmActivitiesOver = /* @__PURE__ */ __name((context) => {
|
|
|
48022
48051
|
return { save: save2, of };
|
|
48023
48052
|
}, "crmActivitiesOver");
|
|
48024
48053
|
|
|
48025
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
48054
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sqlite/stage-amounts.js
|
|
48026
48055
|
var TABLES3 = { deal: "deals", lead: "leads" };
|
|
48027
48056
|
var stageAmountsOf = /* @__PURE__ */ __name(({ database }, kind3, stageIds, cutoff) => {
|
|
48028
48057
|
const rows = database.prepare(`SELECT stage_id, currency, count(*) AS items, coalesce(sum(amount), 0) AS units FROM ${TABLES3[kind3]} WHERE stage_id IN (${stageIds.map(() => "?").join(", ") || "NULL"}) AND deleted_at IS NULL AND (? IS NULL OR created_at >= ?) GROUP BY stage_id, currency ORDER BY currency`).all(...stageIds, cutoff, cutoff);
|
|
@@ -48039,7 +48068,7 @@ var stageAmountsOf = /* @__PURE__ */ __name(({ database }, kind3, stageIds, cuto
|
|
|
48039
48068
|
});
|
|
48040
48069
|
}, "stageAmountsOf");
|
|
48041
48070
|
|
|
48042
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
48071
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sqlite/deals.js
|
|
48043
48072
|
var TABLES4 = { deal: "deals", lead: "leads" };
|
|
48044
48073
|
var itemsSql = /* @__PURE__ */ __name((kind3) => `SELECT d.*, s.name AS stage_name, s.pipeline_id, p.name AS pipeline_name, b.name AS author_name, b.kind AS author_kind, a.provider AS account_provider, a.external_id AS account_external_id, bs.id AS base_stage_ref_id, bs.name AS base_stage_name FROM ${TABLES4[kind3]} d JOIN pipeline_stages s ON s.id = d.stage_id JOIN pipelines p ON p.id = s.pipeline_id LEFT JOIN bots b ON d.author_type = 'bot' AND b.id = d.author_id LEFT JOIN accounts a ON a.id = d.account_id LEFT JOIN pipeline_stages bs ON s.base_confirmed = 1 AND bs.id = s.base_stage_id`, "itemsSql");
|
|
48045
48074
|
var MAX_STAGES = 30;
|
|
@@ -48447,13 +48476,13 @@ var dealOperationsOver = /* @__PURE__ */ __name((context) => {
|
|
|
48447
48476
|
if (!found2.length && !exact) {
|
|
48448
48477
|
const docs = /* @__PURE__ */ new Map();
|
|
48449
48478
|
for (const { parts } of records2)
|
|
48450
|
-
for (const
|
|
48451
|
-
docs.set(
|
|
48479
|
+
for (const literal5 of new Set(parts.flatMap(({ words: held }) => held.map((word2) => word2.literal))))
|
|
48480
|
+
docs.set(literal5, (docs.get(literal5) ?? 0) + 1);
|
|
48452
48481
|
const vocabulary = {
|
|
48453
48482
|
knownTerms: /* @__PURE__ */ __name(async (terms) => new Set(terms.filter((term) => docs.has(term))), "knownTerms"),
|
|
48454
48483
|
termCandidates: /* @__PURE__ */ __name(async (_, { shortest, longest }) => [...docs].filter(([term]) => term.length >= shortest && term.length <= longest).map(([term, count2]) => ({ term, docs: count2 })), "termCandidates")
|
|
48455
48484
|
};
|
|
48456
|
-
const unmatched = probes.flat().filter((probe) => ![...stored4.values()].some((word2) => wordMatches(probe, word2, false))).map(({ literal:
|
|
48485
|
+
const unmatched = probes.flat().filter((probe) => ![...stored4.values()].some((word2) => wordMatches(probe, word2, false))).map(({ literal: literal5 }) => literal5);
|
|
48457
48486
|
const fixes = unmatched.length ? await correctWords(vocabulary, [...new Set(unmatched)]) : /* @__PURE__ */ new Map();
|
|
48458
48487
|
if (fixes.size) {
|
|
48459
48488
|
corrections = [...fixes].map(([from2, to]) => ({ from: from2, to }));
|
|
@@ -48518,7 +48547,7 @@ var dealsStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
48518
48547
|
};
|
|
48519
48548
|
}, "dealsStoreOver");
|
|
48520
48549
|
|
|
48521
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
48550
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sqlite/owner-languages.js
|
|
48522
48551
|
var KEY2 = "ownerLanguages";
|
|
48523
48552
|
var ISO_639_1 = new Set("aa ab ae af ak am an ar as av ay az ba be bg bi bm bn bo br bs ca ce ch co cr cs cu cv cy da de dv dz ee el en eo es et eu fa ff fi fj fo fr fy ga gd gl gn gu gv ha he hi ho hr ht hu hy hz ia id ie ig ii ik io is it iu ja jv ka kg ki kj kk kl km kn ko kr ks ku kv kw ky la lb lg li ln lo lt lu lv mg mh mi mk ml mn mr ms mt my na nb nd ne ng nl nn no nr nv ny oc oj om or os pa pi pl ps pt qu rm rn ro ru rw sa sc sd se sg si sk sl sm sn so sq sr ss st su sv sw ta te tg th ti tk tl tn to tr ts tt tw ty ug uk ur uz ve vi vo wa wo xh yi yo za zh zu".split(" "));
|
|
48524
48553
|
var DEFAULT_OWNER_LANGUAGES = ["ru"];
|
|
@@ -48548,7 +48577,7 @@ var saveOwnerLanguages = /* @__PURE__ */ __name((database, languages, now2) => {
|
|
|
48548
48577
|
database.prepare("INSERT INTO store_settings (key, value, at) VALUES (?, ?, ?) ON CONFLICT (key) DO UPDATE SET value = excluded.value, at = excluded.at").run(KEY2, JSON.stringify(languages), now2);
|
|
48549
48578
|
}, "saveOwnerLanguages");
|
|
48550
48579
|
|
|
48551
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
48580
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sqlite/base-stages.js
|
|
48552
48581
|
var OUTCOMES = {
|
|
48553
48582
|
lead: ["open", "open", "open", "won", "lost"],
|
|
48554
48583
|
deal: ["open", "open", "open", "open", "won", "lost"]
|
|
@@ -48881,7 +48910,7 @@ var baseStagesStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
48881
48910
|
};
|
|
48882
48911
|
}, "baseStagesStoreOver");
|
|
48883
48912
|
|
|
48884
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
48913
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sqlite/bot-updates.js
|
|
48885
48914
|
var botUpdateStoreOver = /* @__PURE__ */ __name((context, afterSave = () => {
|
|
48886
48915
|
}) => {
|
|
48887
48916
|
const { database, now: now2 } = context;
|
|
@@ -48940,7 +48969,7 @@ var botUpdateStoreOver = /* @__PURE__ */ __name((context, afterSave = () => {
|
|
|
48940
48969
|
};
|
|
48941
48970
|
}, "botUpdateStoreOver");
|
|
48942
48971
|
|
|
48943
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
48972
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sqlite/record-projection.js
|
|
48944
48973
|
var IMPORTER = { bot: "import" };
|
|
48945
48974
|
var importersProposal = /* @__PURE__ */ __name((entity) => entity.review === "proposed" && entity.author.type === "bot" && entity.author.name === IMPORTER.bot, "importersProposal");
|
|
48946
48975
|
var codeOf = /* @__PURE__ */ __name((error) => {
|
|
@@ -48985,7 +49014,7 @@ var moneyLinesOf = /* @__PURE__ */ __name((projection, list2) => (Array.isArray(
|
|
|
48985
49014
|
};
|
|
48986
49015
|
}), "moneyLinesOf");
|
|
48987
49016
|
|
|
48988
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
49017
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/domain/relation-role-labels.js
|
|
48989
49018
|
var label = /* @__PURE__ */ __name((en, ru, es) => ({ en, ru, es }), "label");
|
|
48990
49019
|
var ROLE_LABELS = {
|
|
48991
49020
|
organization: {
|
|
@@ -49026,7 +49055,7 @@ var ROLE_LABELS = {
|
|
|
49026
49055
|
}
|
|
49027
49056
|
};
|
|
49028
49057
|
|
|
49029
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
49058
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sqlite/relation-roles.js
|
|
49030
49059
|
var settingOf = /* @__PURE__ */ __name((list2) => `relationships.roles.${list2}`, "settingOf");
|
|
49031
49060
|
var isList = /* @__PURE__ */ __name((list2) => Object.hasOwn(ROLE_LISTS, list2), "isList");
|
|
49032
49061
|
var listOf2 = /* @__PURE__ */ __name((list2) => {
|
|
@@ -49110,7 +49139,7 @@ var relationRolesOver = /* @__PURE__ */ __name(({ database, now: now2 }) => {
|
|
|
49110
49139
|
};
|
|
49111
49140
|
}, "relationRolesOver");
|
|
49112
49141
|
|
|
49113
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
49142
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sqlite/crm-settings.js
|
|
49114
49143
|
var CRM_LINK_MODES = ["reported", "review"];
|
|
49115
49144
|
var COMPANY_TYPE_MEANINGS = ["customer-of", "supplier", "partner-of"];
|
|
49116
49145
|
var CRM_SCOPES = ["mine", "all"];
|
|
@@ -49157,7 +49186,8 @@ var picked = /* @__PURE__ */ __name((name, text8, values) => {
|
|
|
49157
49186
|
}, "picked");
|
|
49158
49187
|
var crmScopeUsers = /* @__PURE__ */ __name((database, key2) => {
|
|
49159
49188
|
const self = crmOwnUser(database, key2);
|
|
49160
|
-
|
|
49189
|
+
const chosen = userIds(stored2(database, crmSettingKey(key2, "unassigned")));
|
|
49190
|
+
return [...new Set(chosen.length ? chosen : self ? [self] : [])];
|
|
49161
49191
|
}, "crmScopeUsers");
|
|
49162
49192
|
var crmOwnUser = /* @__PURE__ */ __name((database, key2) => {
|
|
49163
49193
|
const value = stored2(database, crmSettingKey(key2, "self"));
|
|
@@ -49305,7 +49335,7 @@ var crmSettingsOf = /* @__PURE__ */ __name((database) => database.prepare("SELEC
|
|
|
49305
49335
|
return [{ setting: String(row2.key), value: settingValue(database, parsed5.key, parsed5.name) }];
|
|
49306
49336
|
}), "crmSettingsOf");
|
|
49307
49337
|
|
|
49308
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
49338
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sqlite/relation-proposals.js
|
|
49309
49339
|
var isoOf = /* @__PURE__ */ __name((ms) => ms === void 0 ? null : new Date(ms).toISOString(), "isoOf");
|
|
49310
49340
|
var relationOf = /* @__PURE__ */ __name((link3, now2) => ({
|
|
49311
49341
|
id: link3.id,
|
|
@@ -49665,7 +49695,7 @@ var decidedOrigin = /* @__PURE__ */ __name((by) => by === "owner" ? { origin: "o
|
|
|
49665
49695
|
provenance: `agent:${by.bot} for the owner: ${by.reason.trim()}`
|
|
49666
49696
|
}, "decidedOrigin");
|
|
49667
49697
|
|
|
49668
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
49698
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sqlite/reported-relations.js
|
|
49669
49699
|
var keyOf4 = /* @__PURE__ */ __name((kind3, fromType, fromId, toType, toId, role) => `${String(kind3)}|${String(fromType)}:${String(fromId)}|${String(toType)}:${String(toId)}|${role == null ? "" : String(role)}`, "keyOf");
|
|
49670
49700
|
var metadataOf = /* @__PURE__ */ __name((relation) => relation.metadata && Object.keys(relation.metadata).length ? JSON.stringify(relation.metadata) : null, "metadataOf");
|
|
49671
49701
|
var syncReportedIn = /* @__PURE__ */ __name((context, key2, relationships, scope3, { source: source2 = "import", by = { bot: key2.provider, kind: "rule" }, onOutcome } = {}) => {
|
|
@@ -49803,7 +49833,7 @@ var relationsStoreOver = /* @__PURE__ */ __name((context) => ({
|
|
|
49803
49833
|
syncReported: /* @__PURE__ */ __name(async (key2, relationships, scope3, options) => write(context.database, () => syncReportedIn(context, key2, relationships, scope3, options)), "syncReported")
|
|
49804
49834
|
}), "relationsStoreOver");
|
|
49805
49835
|
|
|
49806
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
49836
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sqlite/record-relationships.js
|
|
49807
49837
|
var importSource = /* @__PURE__ */ __name((provider) => `import:${provider}`, "importSource");
|
|
49808
49838
|
var noRelationships = /* @__PURE__ */ __name(() => ({
|
|
49809
49839
|
added: 0,
|
|
@@ -49993,7 +50023,7 @@ var recordRelationshipsOver = /* @__PURE__ */ __name((context) => {
|
|
|
49993
50023
|
return { report, placeOf: placeOf2, withdrawFrom };
|
|
49994
50024
|
}, "recordRelationshipsOver");
|
|
49995
50025
|
|
|
49996
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
50026
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sqlite/business-contracts.js
|
|
49997
50027
|
var CONTRACTS = "SELECT k.*, b.name AS author_name, b.kind AS author_kind FROM contracts k LEFT JOIN bots b ON k.author_type = 'bot' AND b.id = k.author_id";
|
|
49998
50028
|
var DAY_MS2 = 864e5;
|
|
49999
50029
|
var deadlineOf = /* @__PURE__ */ __name((expiration, days) => expiration === null || days === null ? null : new Date(Date.parse(`${expiration}T00:00:00Z`) - days * DAY_MS2).toISOString().slice(0, 10), "deadlineOf");
|
|
@@ -50152,7 +50182,7 @@ var contractsStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
50152
50182
|
};
|
|
50153
50183
|
}, "contractsStoreOver");
|
|
50154
50184
|
|
|
50155
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
50185
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sqlite/business-search.js
|
|
50156
50186
|
var BUSINESS_FIND_MAX = 2001;
|
|
50157
50187
|
var party2 = /* @__PURE__ */ __name((kind3, id2, as) => `LEFT JOIN persons ${as}p ON ${kind3} = 'person' AND ${as}p.id = ${id2} AND ${as}p.owner = 0 LEFT JOIN organizations ${as}o ON ${kind3} = 'organization' AND ${as}o.id = ${id2} LEFT JOIN projects ${as}j ON ${kind3} = 'project' AND ${as}j.id = ${id2}`, "party");
|
|
50158
50188
|
var partyName = /* @__PURE__ */ __name((as) => `coalesce(${as}p.name, ${as}o.name, ${as}j.name)`, "partyName");
|
|
@@ -50257,7 +50287,7 @@ var businessSearchOver = /* @__PURE__ */ __name(({ database }) => {
|
|
|
50257
50287
|
};
|
|
50258
50288
|
}, "businessSearchOver");
|
|
50259
50289
|
|
|
50260
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
50290
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sqlite/catalog.js
|
|
50261
50291
|
var CATALOG_QUERY = defineQuery({
|
|
50262
50292
|
entity: "document",
|
|
50263
50293
|
backend: "sql",
|
|
@@ -50436,7 +50466,9 @@ var catalogStoreOver = /* @__PURE__ */ __name(({ database, now: now2 }) => {
|
|
|
50436
50466
|
const actorSql = "json_each(d.metadata, '$.catalog.folded.people')";
|
|
50437
50467
|
const tagSql = "SELECT 1 FROM taggings g JOIN resolved_tags t ON t.id=g.tag_id WHERE g.taggable_type='document' AND g.taggable_id=d.id AND t.name=?";
|
|
50438
50468
|
const tag2 = /* @__PURE__ */ __name((name) => canonicalTagNamed(database, name)?.name ?? normalizeTag(name), "tag");
|
|
50439
|
-
if (query.parent
|
|
50469
|
+
if (Array.isArray(query.parent))
|
|
50470
|
+
add2("EXISTS(SELECT 1 FROM json_each(d.metadata, '$.catalog.parents') WHERE value IN (SELECT value FROM json_each(?)))", JSON.stringify(query.parent.map((parent2) => field2(parent2))));
|
|
50471
|
+
else if (query.parent !== void 0)
|
|
50440
50472
|
add2("EXISTS(SELECT 1 FROM json_each(d.metadata, '$.catalog.parents') WHERE value=?)", query.parent);
|
|
50441
50473
|
if (query.kind !== void 0)
|
|
50442
50474
|
add2("json_extract(d.metadata, '$.catalog.kind')=?", query.kind);
|
|
@@ -50488,7 +50520,7 @@ var catalogStoreOver = /* @__PURE__ */ __name(({ database, now: now2 }) => {
|
|
|
50488
50520
|
};
|
|
50489
50521
|
}, "catalogStoreOver");
|
|
50490
50522
|
|
|
50491
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
50523
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sqlite/context-document-source.js
|
|
50492
50524
|
var remote = /* @__PURE__ */ __name(() => `CASE WHEN json_valid(n.front_matter) THEN json_extract(n.front_matter,'$.source') IN (${documentAccountProvidersSql()}) ELSE 0 END`, "remote");
|
|
50493
50525
|
var field3 = /* @__PURE__ */ __name((name) => `CASE WHEN (${remote()}) THEN
|
|
50494
50526
|
CASE WHEN json_type(n.front_matter,'$.${name}')='text' THEN json_extract(n.front_matter,'$.${name}') END END`, "field");
|
|
@@ -50501,7 +50533,7 @@ var contextDocumentTimeKind = /* @__PURE__ */ __name(() => `CASE WHEN (${remoteT
|
|
|
50501
50533
|
THEN 'source-modified' ELSE 'stored-update' END`, "contextDocumentTimeKind");
|
|
50502
50534
|
var contextDocumentUrl = /* @__PURE__ */ __name(() => `coalesce(${preferred("url")},n.url,${field3("sourceUrl")})`, "contextDocumentUrl");
|
|
50503
50535
|
|
|
50504
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
50536
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sqlite/context-meeting-source.js
|
|
50505
50537
|
var readMeetingContextEvidence = /* @__PURE__ */ __name((database, request) => {
|
|
50506
50538
|
const { source: source2, words: words4, after: after2, before: before2, limit, maxReadBytes, cursor, signal } = request;
|
|
50507
50539
|
signal?.throwIfAborted();
|
|
@@ -50600,7 +50632,7 @@ var readMeetingContextEvidence = /* @__PURE__ */ __name((database, request) => {
|
|
|
50600
50632
|
});
|
|
50601
50633
|
}, "readMeetingContextEvidence");
|
|
50602
50634
|
|
|
50603
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
50635
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sqlite/context-evidence.js
|
|
50604
50636
|
var corpora = {
|
|
50605
50637
|
message: {
|
|
50606
50638
|
table: "messages",
|
|
@@ -50845,7 +50877,7 @@ var contextRecordsOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
|
50845
50877
|
}
|
|
50846
50878
|
}), "contextRecordsOver");
|
|
50847
50879
|
|
|
50848
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
50880
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sqlite/crm-contacts.js
|
|
50849
50881
|
var PLACEHOLDER = /(?:^|\s)null(?:\s+#\d+)?(?=\s|$)/gi;
|
|
50850
50882
|
var withoutPlaceholder = /* @__PURE__ */ __name((name) => name.replace(PLACEHOLDER, " ").replace(/\s+/g, " ").trim() || null, "withoutPlaceholder");
|
|
50851
50883
|
var DryRun = class extends Error {
|
|
@@ -50880,7 +50912,7 @@ var removeCrmContacts = /* @__PURE__ */ __name((context, key2, { users, before:
|
|
|
50880
50912
|
database.prepare("INSERT INTO temp.crm_scope SELECT DISTINCT value FROM json_each(?)").run(JSON.stringify((users ?? []).map((id2) => crmIdentityId(key2, id2, "user"))));
|
|
50881
50913
|
database.exec("INSERT INTO temp.crm_proposed SELECT ref, max(decided) FROM (SELECT json_extract(payload, '$.identity') AS ref, status <> 'proposed' AS decided FROM proposed_actions WHERE kind = 'identity_link' UNION ALL SELECT json_extract(payload, '$.with'), status <> 'proposed' FROM proposed_actions WHERE kind = 'identity_link') WHERE ref IS NOT NULL GROUP BY ref");
|
|
50882
50914
|
const identityRefs = referencesTo(database, "identities", /* @__PURE__ */ new Set([...OWN, "account_identities", "involvements"]), "SELECT id FROM temp.crm_gone");
|
|
50883
|
-
database.prepare(`INSERT INTO temp.crm_gone SELECT i.id, l.person_id FROM identities i LEFT JOIN identity_links l ON l.identity_id = i.id WHERE ${contactOf2} AND i.created_at < ? AND i.updated_at < ? AND NOT ${named2("deals", "deal")} AND NOT ${named2("leads", "lead")} AND NOT EXISTS (SELECT 1 FROM links k JOIN records r ON r.entity_type = 'organization' AND r.entity_id = k.to_id WHERE k.from_type = 'person' AND k.from_id = l.person_id AND +k.to_type = 'organization' AND k.kind = 'member-of' AND k.role = 'contact' AND k.source = 'crm' AND k.deleted_at IS NULL AND r.account_id = ${accountId} AND r.type = 'organization' AND r.deleted_at IS NULL) AND NOT EXISTS (SELECT 1 FROM identity_link_events e WHERE e.identity_id = i.id AND e.author = 'owner') AND NOT EXISTS (SELECT 1 FROM temp.crm_proposed c WHERE c.decided AND c.ref = i.provider || ':' || i.external_id)`).run(...contact, before2, before2);
|
|
50915
|
+
database.prepare(`INSERT INTO temp.crm_gone SELECT i.id, l.person_id FROM identities i LEFT JOIN identity_links l ON l.identity_id = i.id WHERE ${contactOf2} AND i.created_at < ? AND i.updated_at < ? ` + (users === void 0 ? "" : "AND coalesce(json_extract(i.metadata, '$.assignee'), '') NOT IN (SELECT id FROM temp.crm_scope) ") + `AND NOT ${named2("deals", "deal")} AND NOT ${named2("leads", "lead")} AND NOT EXISTS (SELECT 1 FROM links k JOIN records r ON r.entity_type = 'organization' AND r.entity_id = k.to_id WHERE k.from_type = 'person' AND k.from_id = l.person_id AND +k.to_type = 'organization' AND k.kind = 'member-of' AND k.role = 'contact' AND k.source = 'crm' AND k.deleted_at IS NULL AND r.account_id = ${accountId} AND r.type = 'organization' AND r.deleted_at IS NULL) AND NOT EXISTS (SELECT 1 FROM identity_link_events e WHERE e.identity_id = i.id AND e.author = 'owner') AND NOT EXISTS (SELECT 1 FROM temp.crm_proposed c WHERE c.decided AND c.ref = i.provider || ':' || i.external_id)`).run(...contact, before2, before2);
|
|
50884
50916
|
database.exec(`DELETE FROM temp.crm_gone WHERE id IN (${identityRefs})`);
|
|
50885
50917
|
database.exec("INSERT OR IGNORE INTO temp.crm_persons SELECT person FROM temp.crm_gone WHERE person IS NOT NULL");
|
|
50886
50918
|
database.exec("INSERT OR IGNORE INTO temp.crm_persons SELECT from_person_id FROM identity_link_events WHERE identity_id IN (SELECT id FROM temp.crm_gone) AND from_person_id IS NOT NULL");
|
|
@@ -50922,7 +50954,7 @@ var removeCrmContacts = /* @__PURE__ */ __name((context, key2, { users, before:
|
|
|
50922
50954
|
}
|
|
50923
50955
|
}, "removeCrmContacts");
|
|
50924
50956
|
|
|
50925
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
50957
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sqlite/crm-stage-entries.js
|
|
50926
50958
|
var STAGE_ENTRY_RECORD = "crm.stage-entry";
|
|
50927
50959
|
var crmStageEntriesOver = /* @__PURE__ */ __name((context) => {
|
|
50928
50960
|
const { database, now: now2 } = context;
|
|
@@ -50969,7 +51001,7 @@ var crmStageEntriesOver = /* @__PURE__ */ __name((context) => {
|
|
|
50969
51001
|
return { save: save2, pending, handled };
|
|
50970
51002
|
}, "crmStageEntriesOver");
|
|
50971
51003
|
|
|
50972
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
51004
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sqlite/crm.js
|
|
50973
51005
|
var PENDING = "crm:pending-relations";
|
|
50974
51006
|
var PENDING_DAYS = 30;
|
|
50975
51007
|
var PENDING_MOST = 5e3;
|
|
@@ -51187,6 +51219,8 @@ var crmCopiesOver = /* @__PURE__ */ __name((context, people2) => {
|
|
|
51187
51219
|
const saved = saveItemRow(key2, accountId, kind3, item, at2);
|
|
51188
51220
|
if ("reason" in saved)
|
|
51189
51221
|
return saved;
|
|
51222
|
+
if (saved.amountNote)
|
|
51223
|
+
report.tally.issues.push({ externalId: item.externalId, reason: "crm.amount-unkept", message: saved.amountNote });
|
|
51190
51224
|
const { id: id2 } = saved;
|
|
51191
51225
|
if (item.people === void 0 && item.assignee === void 0)
|
|
51192
51226
|
return null;
|
|
@@ -51214,6 +51248,10 @@ var crmCopiesOver = /* @__PURE__ */ __name((context, people2) => {
|
|
|
51214
51248
|
reportFrom(key2, accountId, self, wanted, scope3, report.tally, report.pending);
|
|
51215
51249
|
return null;
|
|
51216
51250
|
}, "saveItem");
|
|
51251
|
+
const assignContact = /* @__PURE__ */ __name((key2, externalId, assignee) => {
|
|
51252
|
+
const user = assignee ? crmIdentityId(key2, normalCrmUserId(assignee), "user") : null;
|
|
51253
|
+
database.prepare("UPDATE identities SET metadata = CASE WHEN ? IS NULL THEN json_remove(metadata, '$.assignee') ELSE json_set(coalesce(metadata, '{}'), '$.assignee', ?) END WHERE provider = ? AND external_id = ? AND json_extract(metadata, '$.assignee') IS NOT ?").run(user, user, key2.provider, crmIdentityId(key2, externalId), user);
|
|
51254
|
+
}, "assignContact");
|
|
51217
51255
|
const saveItems = /* @__PURE__ */ __name((key2, kind3, items, users) => write(database, () => {
|
|
51218
51256
|
const accountId = account(key2);
|
|
51219
51257
|
const at2 = now2();
|
|
@@ -51353,7 +51391,7 @@ var crmCopiesOver = /* @__PURE__ */ __name((context, people2) => {
|
|
|
51353
51391
|
const accountId = findAccountPk(context, key2);
|
|
51354
51392
|
if (accountId === void 0 || kind3 === "person")
|
|
51355
51393
|
return [];
|
|
51356
|
-
return kind3 === "organization" ? database.prepare("SELECT id, external_id, updated_at FROM records WHERE account_id = ? AND type = 'organization' AND deleted_at IS NULL").all(accountId) : database.prepare(`SELECT id, external_id, updated_at FROM ${TABLES2[kind3]} WHERE account_id = ? AND deleted_at IS NULL`).all(accountId);
|
|
51394
|
+
return kind3 === "organization" ? database.prepare("SELECT id, external_id, updated_at FROM records WHERE account_id = ? AND type = 'organization' AND deleted_at IS NULL").all(accountId) : database.prepare(`SELECT id, external_id, updated_at, json_extract(metadata, '$.assignee') AS assignee FROM ${TABLES2[kind3]} WHERE account_id = ? AND deleted_at IS NULL`).all(accountId);
|
|
51357
51395
|
}, "stored");
|
|
51358
51396
|
const markDeleted2 = /* @__PURE__ */ __name((key2, kind3, rows) => {
|
|
51359
51397
|
const table = kind3 === "organization" ? "records" : TABLES2[kind3];
|
|
@@ -51387,6 +51425,8 @@ var crmCopiesOver = /* @__PURE__ */ __name((context, people2) => {
|
|
|
51387
51425
|
const tally = tallied();
|
|
51388
51426
|
const pending = pendingBook(accountId);
|
|
51389
51427
|
for (const contact of contacts2) {
|
|
51428
|
+
if (contact.assignee !== void 0)
|
|
51429
|
+
assignContact(key2, contact.externalId, contact.assignee);
|
|
51390
51430
|
const person2 = nameUnnamed(key2, contact.externalId, "contact", textOf4(contact.name, 200));
|
|
51391
51431
|
const email = textOf4(contact.email, 320)?.toLowerCase();
|
|
51392
51432
|
const sharing = email ? peopleSharing(key2, contact.externalId, email) : 0;
|
|
@@ -51439,9 +51479,10 @@ var crmCopiesOver = /* @__PURE__ */ __name((context, people2) => {
|
|
|
51439
51479
|
const gone = new Set(externalIds);
|
|
51440
51480
|
return markDeleted2(key2, kind3, stored4(key2, kind3).filter((row2) => gone.has(String(row2.external_id))));
|
|
51441
51481
|
}), "remove"),
|
|
51442
|
-
removeUnlisted: /* @__PURE__ */ __name(async (key2, kind3, listed, before2, { dryRun } = {}) => write(database, () => {
|
|
51482
|
+
removeUnlisted: /* @__PURE__ */ __name(async (key2, kind3, listed, before2, { dryRun, users } = {}) => write(database, () => {
|
|
51443
51483
|
const held = new Set(listed);
|
|
51444
|
-
const
|
|
51484
|
+
const scope3 = users && new Set(users.map((id2) => crmIdentityId(key2, id2, "user")));
|
|
51485
|
+
const gone = stored4(key2, kind3).filter((row2) => !held.has(String(row2.external_id)) && Number(row2.updated_at) < before2 && (!scope3 || row2.assignee == null || scope3.has(String(row2.assignee))));
|
|
51445
51486
|
return dryRun ? gone.length : markDeleted2(key2, kind3, gone);
|
|
51446
51487
|
}), "removeUnlisted"),
|
|
51447
51488
|
scope: /* @__PURE__ */ __name(async (key2) => crmScope(database, key2), "scope"),
|
|
@@ -51478,10 +51519,10 @@ var crmCopiesOver = /* @__PURE__ */ __name((context, people2) => {
|
|
|
51478
51519
|
};
|
|
51479
51520
|
}, "crmCopiesOver");
|
|
51480
51521
|
|
|
51481
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
51522
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sqlite/decision-requests.js
|
|
51482
51523
|
import { createHash as createHash14, randomBytes as randomBytes2 } from "node:crypto";
|
|
51483
51524
|
|
|
51484
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
51525
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/decision-requests.js
|
|
51485
51526
|
var DECISION_ACTIONS = ["confirm", "reject", "ask-confirm", "ask-reject", "back", "later"];
|
|
51486
51527
|
var DECISION_TTL_MS = 72 * 60 * 60 * 1e3;
|
|
51487
51528
|
var CALLBACK_PREFIX = "wcr1:";
|
|
@@ -51495,7 +51536,7 @@ var callbackDataOf = /* @__PURE__ */ __name((token) => {
|
|
|
51495
51536
|
}, "callbackDataOf");
|
|
51496
51537
|
var parseCallbackData = /* @__PURE__ */ __name((data) => typeof data === "string" ? CALLBACK.exec(data)?.[1] : void 0, "parseCallbackData");
|
|
51497
51538
|
|
|
51498
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
51539
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sqlite/decision-requests.js
|
|
51499
51540
|
var digestOf = /* @__PURE__ */ __name((token) => createHash14("sha256").update(token).digest("hex"), "digestOf");
|
|
51500
51541
|
var newToken = /* @__PURE__ */ __name(() => randomBytes2(16).toString("base64url"), "newToken");
|
|
51501
51542
|
var requestOf = /* @__PURE__ */ __name((row2) => ({
|
|
@@ -51594,7 +51635,7 @@ var decisionRequestStoreOver = /* @__PURE__ */ __name(({ database, now: now2 })
|
|
|
51594
51635
|
};
|
|
51595
51636
|
}, "decisionRequestStoreOver");
|
|
51596
51637
|
|
|
51597
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
51638
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-listing.js
|
|
51598
51639
|
var MEETING_ROW_KINDS = ["meeting", "call", "event"];
|
|
51599
51640
|
var DAY6 = 864e5;
|
|
51600
51641
|
var JOINED = `(SELECT ce.event_id FROM calendar_entries ce JOIN events je ON je.id = ce.event_id
|
|
@@ -51691,6 +51732,21 @@ var rowsOf = /* @__PURE__ */ __name((context, filter) => {
|
|
|
51691
51732
|
}, "rowsOf");
|
|
51692
51733
|
var ROW_MEETINGS = "r.meetings";
|
|
51693
51734
|
var inRowMeetings = /* @__PURE__ */ __name((condition) => `EXISTS (SELECT 1 FROM json_each(${ROW_MEETINGS}) rm WHERE ${condition.replaceAll("{m}", "rm.value")})`, "inRowMeetings");
|
|
51735
|
+
var MEETING_TRANSCRIPT = `(EXISTS (SELECT 1 FROM meeting_transcripts t WHERE t.meeting_id = {m} AND t.deleted_at IS NULL
|
|
51736
|
+
AND t.superseded_at IS NULL)
|
|
51737
|
+
OR EXISTS (SELECT 1 FROM links tl JOIN documents td ON td.id = tl.to_id WHERE tl.from_type = 'meeting'
|
|
51738
|
+
AND tl.from_id = {m} AND tl.kind = 'attached' AND tl.to_type = 'document' AND tl.role IN ('transcript', 'notes')
|
|
51739
|
+
AND td.deleted_at IS NULL))`;
|
|
51740
|
+
var literal4 = /* @__PURE__ */ __name((text8) => `'${text8.replaceAll("'", "''")}'`, "literal");
|
|
51741
|
+
var namedLikeTranscript = /* @__PURE__ */ __name((title2) => `(${TRANSCRIPT_WORDS.flatMap((word2) => [
|
|
51742
|
+
`${title2} LIKE ${literal4(`%${word2}%`)}`,
|
|
51743
|
+
`instr(${title2}, ${literal4(word2.toLowerCase())}) > 0`
|
|
51744
|
+
]).join(" OR ")})`, "namedLikeTranscript");
|
|
51745
|
+
var EVENT_TRANSCRIPT = `EXISTS (SELECT 1 FROM calendar_entries tc JOIN links tl ON tl.from_type = 'calendar_entry'
|
|
51746
|
+
AND tl.from_id = tc.id AND tl.kind = 'attached' AND tl.to_type = 'document'
|
|
51747
|
+
JOIN documents td ON td.id = tl.to_id WHERE tc.event_id = {e} AND td.deleted_at IS NULL
|
|
51748
|
+
AND ${namedLikeTranscript("td.title")})`;
|
|
51749
|
+
var ROW_TRANSCRIPT = `((r.type = 'event' AND ${EVENT_TRANSCRIPT.replaceAll("{e}", "r.id")}) OR ${inRowMeetings(MEETING_TRANSCRIPT)})`;
|
|
51694
51750
|
var PHONE_MEETING = "(SELECT a.provider FROM meetings km JOIN accounts a ON a.id = km.account_id WHERE km.id = {m}) = 'phone'";
|
|
51695
51751
|
var KIND = `(CASE
|
|
51696
51752
|
WHEN (r.type = 'event' AND EXISTS (SELECT 1 FROM calendar_entries kc WHERE kc.event_id = r.id
|
|
@@ -51724,7 +51780,7 @@ var filtersOf = /* @__PURE__ */ __name((database, filter) => {
|
|
|
51724
51780
|
params.push(people2, people2, people2);
|
|
51725
51781
|
}
|
|
51726
51782
|
if (filter.hasTranscript !== void 0) {
|
|
51727
|
-
clauses.push(`${filter.hasTranscript ? "" : "NOT "}${
|
|
51783
|
+
clauses.push(`${filter.hasTranscript ? "" : "NOT "}${ROW_TRANSCRIPT}`);
|
|
51728
51784
|
}
|
|
51729
51785
|
return { sql: clauses.length ? `WHERE ${clauses.join(" AND ")}` : "", params };
|
|
51730
51786
|
}, "filtersOf");
|
|
@@ -51773,15 +51829,15 @@ var citingBatches = /* @__PURE__ */ __name((database, meetingIds) => {
|
|
|
51773
51829
|
var hydrate = /* @__PURE__ */ __name((database, page3) => {
|
|
51774
51830
|
const eventIds = page3.filter(({ type }) => type === "event").map(({ id: id2 }) => id2);
|
|
51775
51831
|
const meetingIds = [...new Set(page3.flatMap(({ meetingIds: meetingIds2 }) => meetingIds2))];
|
|
51776
|
-
const events3 = new Map(database.prepare(
|
|
51832
|
+
const events3 = new Map(database.prepare(`SELECT e.*, ${EVENT_TRANSCRIPT.replaceAll("{e}", "e.id")} AS has_transcript FROM events e
|
|
51833
|
+
WHERE e.id IN (SELECT value FROM json_each(?))`).all(ids2(eventIds)).map((row2) => [Number(row2.id), row2]));
|
|
51777
51834
|
const entries = database.prepare(`SELECT ce.id, ce.event_id, ce.join_url, ce.timezone, ce.status, ce.deleted_at, ce.event_type, ce.url,
|
|
51778
51835
|
ce.own_response, ce.conference, c.title AS calendar, a.provider, a.external_id AS account FROM calendar_entries ce JOIN calendars c ON c.id = ce.calendar_id
|
|
51779
51836
|
JOIN accounts a ON a.id = c.account_id WHERE ce.event_id IN (SELECT value FROM json_each(?))
|
|
51780
51837
|
ORDER BY ce.deleted_at IS NOT NULL, ce.id`).all(ids2(eventIds));
|
|
51781
51838
|
const series = new Map(database.prepare("SELECT id, recurrence FROM event_series WHERE id IN (SELECT event_series_id FROM events WHERE id IN (SELECT value FROM json_each(?)))").all(ids2(eventIds)).map((row2) => [Number(row2.id), row2.recurrence == null ? null : JSON.parse(String(row2.recurrence))]));
|
|
51782
51839
|
const meetings2 = new Map(database.prepare(`SELECT m.*, a.provider, a.external_id AS account,
|
|
51783
|
-
|
|
51784
|
-
AND t.superseded_at IS NULL) AS has_transcript,
|
|
51840
|
+
${MEETING_TRANSCRIPT.replaceAll("{m}", "m.id")} AS has_transcript,
|
|
51785
51841
|
EXISTS (SELECT 1 FROM meeting_summaries s WHERE s.meeting_id = m.id) AS has_summary,
|
|
51786
51842
|
(EXISTS (SELECT 1 FROM attachments ra WHERE ra.attachable_type = 'meeting' AND ra.attachable_id = m.id
|
|
51787
51843
|
AND (ra.kind IN ('audio', 'video') OR ra.mime LIKE 'audio/%' OR ra.mime LIKE 'video/%'))
|
|
@@ -51899,7 +51955,7 @@ var hydrate = /* @__PURE__ */ __name((database, page3) => {
|
|
|
51899
51955
|
sources,
|
|
51900
51956
|
participants: [...participants3.values()],
|
|
51901
51957
|
hasRecording: held.some((meeting) => Number(meeting.has_recording) === 1),
|
|
51902
|
-
hasTranscript: held.some((meeting) => Number(meeting.has_transcript) === 1),
|
|
51958
|
+
hasTranscript: Number(event2?.has_transcript ?? 0) === 1 || held.some((meeting) => Number(meeting.has_transcript) === 1),
|
|
51903
51959
|
hasSummary: held.some((meeting) => Number(meeting.has_summary) === 1),
|
|
51904
51960
|
documents: [...linked.values()],
|
|
51905
51961
|
seriesId: num(event2?.event_series_id),
|
|
@@ -51966,7 +52022,7 @@ var meetingListingOver = /* @__PURE__ */ __name((context) => {
|
|
|
51966
52022
|
};
|
|
51967
52023
|
}, "meetingListingOver");
|
|
51968
52024
|
|
|
51969
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
52025
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sqlite/document-listing.js
|
|
51970
52026
|
var DOCUMENT_KINDS = [
|
|
51971
52027
|
"transcript",
|
|
51972
52028
|
"doc",
|
|
@@ -52203,7 +52259,7 @@ var documentListingOver = /* @__PURE__ */ __name((context) => {
|
|
|
52203
52259
|
};
|
|
52204
52260
|
}, "documentListingOver");
|
|
52205
52261
|
|
|
52206
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
52262
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sqlite/note-search.js
|
|
52207
52263
|
var NOTE_FIELDS = [
|
|
52208
52264
|
"text",
|
|
52209
52265
|
"exact",
|
|
@@ -52488,6 +52544,7 @@ var searchCorpus = /* @__PURE__ */ __name((context, query, corpus) => {
|
|
|
52488
52544
|
});
|
|
52489
52545
|
}, "searchCorpus");
|
|
52490
52546
|
var SCAN_PAGE3 = 5e3;
|
|
52547
|
+
var SETTLE_BATCH = 50;
|
|
52491
52548
|
var LIVE5 = "((k.chunkable_type = 'document' AND EXISTS (SELECT 1 FROM documents d WHERE d.id = k.chunkable_id AND d.deleted_at IS NULL AND coalesce(json_extract(d.metadata, '$.catalog.active'), 1)=1 AND (? IS NULL OR d.account_id IN (SELECT CAST(value AS INTEGER) FROM json_each(?))))) OR (k.chunkable_type = 'note' AND ? IS NULL AND EXISTS (SELECT 1 FROM notes n WHERE n.id = k.chunkable_id AND n.deleted_at IS NULL)))";
|
|
52492
52549
|
var noteSearchOver = /* @__PURE__ */ __name((context) => {
|
|
52493
52550
|
const { database } = context;
|
|
@@ -52516,6 +52573,36 @@ var noteSearchOver = /* @__PURE__ */ __name((context) => {
|
|
|
52516
52573
|
return matchingNoteRefs(context, query);
|
|
52517
52574
|
}, "matchingRefs"),
|
|
52518
52575
|
indexState: /* @__PURE__ */ __name(async () => noteIndexState(database), "indexState"),
|
|
52576
|
+
indexWritten: /* @__PURE__ */ __name(async ({ until = /* @__PURE__ */ __name(() => false, "until") } = {}) => {
|
|
52577
|
+
if (isQueryOnly(database))
|
|
52578
|
+
return 0;
|
|
52579
|
+
const once4 = /* @__PURE__ */ __name(() => {
|
|
52580
|
+
let ran = false;
|
|
52581
|
+
return () => {
|
|
52582
|
+
const stop = ran;
|
|
52583
|
+
ran = true;
|
|
52584
|
+
return stop;
|
|
52585
|
+
};
|
|
52586
|
+
}, "once");
|
|
52587
|
+
const steps = [
|
|
52588
|
+
() => drainCorpus(database, CORPORA.document, stemmerFor2, { batch: SETTLE_BATCH, until: once4() }),
|
|
52589
|
+
() => drainCorpus(database, CORPORA.note, stemmerFor2, { batch: SETTLE_BATCH, until: once4() }),
|
|
52590
|
+
() => fillTrigrams(database, { batch: SETTLE_BATCH, until: once4() })
|
|
52591
|
+
];
|
|
52592
|
+
let total = 0;
|
|
52593
|
+
for (; ; ) {
|
|
52594
|
+
let done = 0;
|
|
52595
|
+
for (const step of steps) {
|
|
52596
|
+
if (until())
|
|
52597
|
+
return total;
|
|
52598
|
+
done += step();
|
|
52599
|
+
}
|
|
52600
|
+
total += done;
|
|
52601
|
+
if (done === 0)
|
|
52602
|
+
return total;
|
|
52603
|
+
await new Promise((resolve) => setImmediate(resolve));
|
|
52604
|
+
}
|
|
52605
|
+
}, "indexWritten"),
|
|
52519
52606
|
chunksToEmbed: /* @__PURE__ */ __name(async (model, { after: after2, limit }) => {
|
|
52520
52607
|
drain();
|
|
52521
52608
|
const scope3 = live2(void 0, void 0);
|
|
@@ -52646,7 +52733,7 @@ var noteSearchOver = /* @__PURE__ */ __name((context) => {
|
|
|
52646
52733
|
};
|
|
52647
52734
|
}, "noteSearchOver");
|
|
52648
52735
|
|
|
52649
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
52736
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sqlite/event-search.js
|
|
52650
52737
|
var EVENT_FIELDS = ["text", "exact", "body", "title", "date", "in"];
|
|
52651
52738
|
var inEventAccounts = /* @__PURE__ */ __name((event2) => searchableCopy(event2, "c.account_id IN (SELECT CAST(value AS INTEGER) FROM json_each(?))"), "inEventAccounts");
|
|
52652
52739
|
var EVENT_CORPUS = {
|
|
@@ -52778,7 +52865,7 @@ var eventSearchOver = /* @__PURE__ */ __name((context) => {
|
|
|
52778
52865
|
};
|
|
52779
52866
|
}, "eventSearchOver");
|
|
52780
52867
|
|
|
52781
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
52868
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/domain/moment.js
|
|
52782
52869
|
var calendarMoment = /* @__PURE__ */ __name((wanted, flag6, { zone, end = false } = {}) => {
|
|
52783
52870
|
try {
|
|
52784
52871
|
return zonedMoment(wanted, timezoneOf(zone), { start: 0, end: wanted.length }, { end });
|
|
@@ -52836,7 +52923,7 @@ var aheadOf = /* @__PURE__ */ __name((reference2, flag6, now2 = Date.now(), opti
|
|
|
52836
52923
|
return read2.time;
|
|
52837
52924
|
}, "aheadOf");
|
|
52838
52925
|
|
|
52839
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
52926
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sqlite/facts.js
|
|
52840
52927
|
var NAMED4 = "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";
|
|
52841
52928
|
var iso13 = /* @__PURE__ */ __name((value) => new Date(Number(value)).toISOString(), "iso");
|
|
52842
52929
|
var oneOf5 = /* @__PURE__ */ __name((value, allowed, what) => {
|
|
@@ -53059,7 +53146,7 @@ var factsStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
53059
53146
|
};
|
|
53060
53147
|
}, "factsStoreOver");
|
|
53061
53148
|
|
|
53062
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
53149
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sqlite/findings-core.js
|
|
53063
53150
|
var invalid5 = /* @__PURE__ */ __name((message3) => {
|
|
53064
53151
|
throw new CliError("validation_error", message3);
|
|
53065
53152
|
}, "invalid");
|
|
@@ -53227,7 +53314,7 @@ var findingsCoreOver = /* @__PURE__ */ __name((context, kind3) => {
|
|
|
53227
53314
|
return { snapshot: snapshot2, snapshotParts, previous, settle, keepWaiting, named: named2, sameDecision, create };
|
|
53228
53315
|
}, "findingsCoreOver");
|
|
53229
53316
|
|
|
53230
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
53317
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sqlite/evidence-findings.js
|
|
53231
53318
|
var stale = /* @__PURE__ */ __name(() => {
|
|
53232
53319
|
throw new CliError("validation_error", "evidence findings changed since they were read; stage a new batch", {
|
|
53233
53320
|
reason: "evidence-findings.stale"
|
|
@@ -53491,7 +53578,7 @@ var evidenceFindingsStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
53491
53578
|
};
|
|
53492
53579
|
}, "evidenceFindingsStoreOver");
|
|
53493
53580
|
|
|
53494
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
53581
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sqlite/involvements.js
|
|
53495
53582
|
var pendingInvolvements = /* @__PURE__ */ __name((database) => Number(database.prepare("SELECT count(*) AS n FROM involvement_pending").get()?.n ?? 0), "pendingInvolvements");
|
|
53496
53583
|
var involvementStoreOver = /* @__PURE__ */ __name(({ database, now: now2 }) => ({
|
|
53497
53584
|
rebuild: /* @__PURE__ */ __name((personId) => write(database, () => {
|
|
@@ -53545,7 +53632,7 @@ var involvementStoreOver = /* @__PURE__ */ __name(({ database, now: now2 }) => (
|
|
|
53545
53632
|
}, "forPerson")
|
|
53546
53633
|
}), "involvementStoreOver");
|
|
53547
53634
|
|
|
53548
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
53635
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sqlite/labelled.js
|
|
53549
53636
|
var LABELLED = {
|
|
53550
53637
|
note: "note",
|
|
53551
53638
|
document: "document",
|
|
@@ -53558,7 +53645,7 @@ var LABELLED = {
|
|
|
53558
53645
|
};
|
|
53559
53646
|
var accountMeetingTagging = /* @__PURE__ */ __name((alias2) => `(${alias2}.taggable_type <> 'meeting' OR EXISTS (SELECT 1 FROM meetings mt WHERE mt.id = ${alias2}.taggable_id AND mt.deleted_at IS NULL AND (? IS NULL OR mt.account_id = ?)))`, "accountMeetingTagging");
|
|
53560
53647
|
|
|
53561
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
53648
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-projects.js
|
|
53562
53649
|
import { createHash as createHash15 } from "node:crypto";
|
|
53563
53650
|
var fields3 = "id,from_id,to_id,source,confirmed,updated_at,length(evidence) AS evidenceLength,substr(evidence,1,2000) AS evidence";
|
|
53564
53651
|
var id = /* @__PURE__ */ __name((value) => {
|
|
@@ -53644,7 +53731,7 @@ var meetingProjectsStoreOver = /* @__PURE__ */ __name(({ database, now: now2 })
|
|
|
53644
53731
|
};
|
|
53645
53732
|
}, "meetingProjectsStoreOver");
|
|
53646
53733
|
|
|
53647
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
53734
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/knowledge-query.js
|
|
53648
53735
|
var ORGANIZATIONS_QUERY = {
|
|
53649
53736
|
entity: "organization",
|
|
53650
53737
|
backend: "sql",
|
|
@@ -53685,7 +53772,7 @@ var REMINDERS_QUERY = {
|
|
|
53685
53772
|
})
|
|
53686
53773
|
};
|
|
53687
53774
|
|
|
53688
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
53775
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sqlite/organization-categories.js
|
|
53689
53776
|
var OWN2 = "(SELECT id FROM organizations WHERE deleted_at IS NULL AND json_extract(metadata, '$.own') = 1)";
|
|
53690
53777
|
var EMPLOYED = "('employee', 'contractor', 'founder')";
|
|
53691
53778
|
var categorySql = /* @__PURE__ */ __name(({ category, accounts: accounts2 }, now2) => {
|
|
@@ -53706,7 +53793,7 @@ var categorySql = /* @__PURE__ */ __name(({ category, accounts: accounts2 }, now
|
|
|
53706
53793
|
return { sql: `EXISTS (SELECT 1 FROM links l WHERE ${where} AND ${usable})`, params: keys };
|
|
53707
53794
|
}, "categorySql");
|
|
53708
53795
|
|
|
53709
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
53796
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sqlite/organizations.js
|
|
53710
53797
|
var organizationOf = /* @__PURE__ */ __name((row2) => ({
|
|
53711
53798
|
id: String(row2.id),
|
|
53712
53799
|
ref: `organization:${row2.id}`,
|
|
@@ -53751,7 +53838,7 @@ var organizationsStoreOver = /* @__PURE__ */ __name(({ database, now: now2 }) =>
|
|
|
53751
53838
|
}), "setOwnOrganization")
|
|
53752
53839
|
}), "organizationsStoreOver");
|
|
53753
53840
|
|
|
53754
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
53841
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sqlite/relation-list.js
|
|
53755
53842
|
var KINDS = RELATION_KINDS.map(linkKind).join(", ");
|
|
53756
53843
|
var ACCOUNT_ENDS = [
|
|
53757
53844
|
["deal", "deals"],
|
|
@@ -53902,13 +53989,13 @@ var relationListOver = /* @__PURE__ */ __name((context) => {
|
|
|
53902
53989
|
__name(proposalItem, "proposalItem");
|
|
53903
53990
|
}, "relationListOver");
|
|
53904
53991
|
|
|
53905
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
53992
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sqlite/relation-reads.js
|
|
53906
53993
|
var relationReadsOver = /* @__PURE__ */ __name((context) => ({
|
|
53907
53994
|
...relationListOver(context),
|
|
53908
53995
|
...relationRolesOver(context)
|
|
53909
53996
|
}), "relationReadsOver");
|
|
53910
53997
|
|
|
53911
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
53998
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sqlite/source-review.js
|
|
53912
53999
|
var TABLES5 = { memory: "memories", fact: "facts" };
|
|
53913
54000
|
var RETIRED = /* @__PURE__ */ new Set(["superseded", "reversed", "rejected", "stale"]);
|
|
53914
54001
|
var DEFAULT_LIMIT = 500;
|
|
@@ -54151,16 +54238,16 @@ var sourceReviewStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
54151
54238
|
};
|
|
54152
54239
|
}, "sourceReviewStoreOver");
|
|
54153
54240
|
|
|
54154
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
54241
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sqlite/vocabulary.js
|
|
54155
54242
|
import { createHash as createHash18 } from "node:crypto";
|
|
54156
54243
|
|
|
54157
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
54244
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sqlite/tag-consolidation.js
|
|
54158
54245
|
import { createHash as createHash17 } from "node:crypto";
|
|
54159
54246
|
|
|
54160
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
54247
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sqlite/tag-consolidation-apply.js
|
|
54161
54248
|
import { createHash as createHash16 } from "node:crypto";
|
|
54162
54249
|
|
|
54163
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
54250
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sqlite/tag-consolidation-input.js
|
|
54164
54251
|
var consolidationId = /* @__PURE__ */ __name((value, field4) => {
|
|
54165
54252
|
if (typeof value !== "string" || !/^[1-9]\d*$/.test(value) || !Number.isSafeInteger(Number(value)))
|
|
54166
54253
|
throw new CliError("validation_error", `${field4} must be a positive canonical tag id`);
|
|
@@ -54211,7 +54298,7 @@ var consolidationApplyInput = /* @__PURE__ */ __name((options) => {
|
|
|
54211
54298
|
return input;
|
|
54212
54299
|
}, "consolidationApplyInput");
|
|
54213
54300
|
|
|
54214
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
54301
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sqlite/tag-consolidation-apply.js
|
|
54215
54302
|
var receiptOf = /* @__PURE__ */ __name((row2) => ({
|
|
54216
54303
|
id: String(row2.id),
|
|
54217
54304
|
sourceId: String(row2.source_id),
|
|
@@ -54286,7 +54373,7 @@ var applyTagConsolidation = /* @__PURE__ */ __name((context, preview, options) =
|
|
|
54286
54373
|
}, { beforeCommit: check3 });
|
|
54287
54374
|
}, "applyTagConsolidation");
|
|
54288
54375
|
|
|
54289
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
54376
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sqlite/tag-consolidation.js
|
|
54290
54377
|
var selections = [
|
|
54291
54378
|
["taggings", "tag_id IN (SELECT value FROM json_each(?))"],
|
|
54292
54379
|
["aliases", "aliasable_type='tag' AND aliasable_id IN (SELECT value FROM json_each(?))"],
|
|
@@ -54430,7 +54517,7 @@ var previewRows = /* @__PURE__ */ __name((context, options, source2, survivor, m
|
|
|
54430
54517
|
};
|
|
54431
54518
|
}, "previewRows");
|
|
54432
54519
|
|
|
54433
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
54520
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sqlite/vocabulary.js
|
|
54434
54521
|
var kinds = ["project", "tag", "topic"];
|
|
54435
54522
|
var cancelled2 = /* @__PURE__ */ __name((signal) => {
|
|
54436
54523
|
if (signal?.aborted)
|
|
@@ -54694,7 +54781,7 @@ var vocabularyStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
54694
54781
|
};
|
|
54695
54782
|
}, "vocabularyStoreOver");
|
|
54696
54783
|
|
|
54697
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
54784
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sqlite/knowledge.js
|
|
54698
54785
|
var TYPED_KEY_PREFIXES = new Set(Object.values(TASK_KEY_PREFIXES));
|
|
54699
54786
|
var ORGANIZATION_KINDS = ["company", "team", "family", "community"];
|
|
54700
54787
|
var PROJECT_TYPES = ["work", "client", "personal", "oss", "other"];
|
|
@@ -55248,7 +55335,7 @@ var projectKey = /* @__PURE__ */ __name((name) => {
|
|
|
55248
55335
|
return key2.padEnd(3, "X");
|
|
55249
55336
|
}, "projectKey");
|
|
55250
55337
|
|
|
55251
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
55338
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sqlite/log-pruning.js
|
|
55252
55339
|
var DAY7 = 864e5;
|
|
55253
55340
|
var SETTING5 = "logs_pruned_at";
|
|
55254
55341
|
var LOG_RETENTION = { agentActionsMs: 90 * DAY7, botUpdatePayloadsMs: 30 * DAY7 };
|
|
@@ -55275,7 +55362,7 @@ var logPruner = /* @__PURE__ */ __name((database, now2) => {
|
|
|
55275
55362
|
};
|
|
55276
55363
|
}, "logPruner");
|
|
55277
55364
|
|
|
55278
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
55365
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/mail/findings.js
|
|
55279
55366
|
var MAIL_FINDINGS_PER_RUN = 30;
|
|
55280
55367
|
var MAIL_FINDINGS_PER_SENDER = 5;
|
|
55281
55368
|
var invalid7 = /* @__PURE__ */ __name((message3) => {
|
|
@@ -55634,7 +55721,7 @@ var checkMailFindings = /* @__PURE__ */ __name((input) => {
|
|
|
55634
55721
|
}, "checkMailFindings");
|
|
55635
55722
|
var mailFindingFingerprint = /* @__PURE__ */ __name(({ id: _id, ...finding }) => findingHash(finding), "mailFindingFingerprint");
|
|
55636
55723
|
|
|
55637
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
55724
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sqlite/orders.js
|
|
55638
55725
|
var ORDERS = "SELECT o.*, b.name AS author_name, b.kind AS author_kind FROM orders o LEFT JOIN bots b ON o.author_type = 'bot' AND b.id = o.author_id";
|
|
55639
55726
|
var orderOperationsOver = /* @__PURE__ */ __name((context) => {
|
|
55640
55727
|
const { database, now: now2 } = context;
|
|
@@ -55849,7 +55936,7 @@ var ordersStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
55849
55936
|
};
|
|
55850
55937
|
}, "ordersStoreOver");
|
|
55851
55938
|
|
|
55852
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
55939
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sqlite/mail-findings.js
|
|
55853
55940
|
var MAIL_EDITS = {
|
|
55854
55941
|
task: ["title", "type", "reason", "commitment", "project", "dueAt", "dueEvidence", "assignee", "assigneeEvidence"],
|
|
55855
55942
|
fact: ["statement", "type", "reason", "subject", "project"],
|
|
@@ -56338,7 +56425,7 @@ ${evidence.join("\n")}`, agent);
|
|
|
56338
56425
|
};
|
|
56339
56426
|
}, "mailFindingsStoreOver");
|
|
56340
56427
|
|
|
56341
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
56428
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-findings.js
|
|
56342
56429
|
var stale3 = /* @__PURE__ */ __name(() => {
|
|
56343
56430
|
throw new CliError("validation_error", "meeting findings changed since they were read; stage a new batch", {
|
|
56344
56431
|
reason: "meeting-findings.stale"
|
|
@@ -56551,7 +56638,7 @@ var meetingFindingsStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
56551
56638
|
};
|
|
56552
56639
|
}, "meetingFindingsStoreOver");
|
|
56553
56640
|
|
|
56554
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
56641
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-vectors.js
|
|
56555
56642
|
var RANK_BATCH = 512;
|
|
56556
56643
|
var LIVE6 = "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";
|
|
56557
56644
|
var limitOf2 = /* @__PURE__ */ __name((value, name, max = 1e3) => {
|
|
@@ -56822,7 +56909,7 @@ var meetingVectorsOver = /* @__PURE__ */ __name((context) => ({
|
|
|
56822
56909
|
}
|
|
56823
56910
|
}), "meetingVectorsOver");
|
|
56824
56911
|
|
|
56825
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
56912
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sqlite/mention-sources.js
|
|
56826
56913
|
var OTHER_SOURCES = ["document", "note", "email"];
|
|
56827
56914
|
var TEXTS = {
|
|
56828
56915
|
document: "JOIN documents s ON mn.source_type = 'document' AND s.id = mn.source_id AND s.deleted_at IS NULL WHERE 1 ",
|
|
@@ -56923,7 +57010,7 @@ var sourceMentionStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
56923
57010
|
};
|
|
56924
57011
|
}, "sourceMentionStoreOver");
|
|
56925
57012
|
|
|
56926
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
57013
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sqlite/money-transactions.js
|
|
56927
57014
|
var TRANSACTIONS = "SELECT t.*, w.name AS wallet_name, b.name AS author_name, b.kind AS author_kind, (SELECT coalesce(sum(amount), 0) FROM transaction_splits WHERE transaction_id = t.id) AS split FROM financial_transactions t JOIN financial_accounts w ON w.id = t.financial_account_id LEFT JOIN bots b ON t.author_type = 'bot' AND b.id = t.author_id";
|
|
56928
57015
|
var MAX_SPLITS = 100;
|
|
56929
57016
|
var transactionOperationsOver = /* @__PURE__ */ __name((context) => {
|
|
@@ -57157,11 +57244,11 @@ var transactionsStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
57157
57244
|
};
|
|
57158
57245
|
}, "transactionsStoreOver");
|
|
57159
57246
|
|
|
57160
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
57247
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sqlite/open-store.js
|
|
57161
57248
|
import { accessSync, constants, existsSync as existsSync2, mkdirSync as mkdirSync2, statSync as statSync2, writeFileSync as writeFileSync2 } from "node:fs";
|
|
57162
57249
|
import { dirname as dirname2 } from "node:path";
|
|
57163
57250
|
|
|
57164
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
57251
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sqlite/clients.js
|
|
57165
57252
|
import { readFileSync as readFileSync3 } from "node:fs";
|
|
57166
57253
|
var CLIENTS_SETTING = "clients";
|
|
57167
57254
|
var coreVersion = (() => {
|
|
@@ -57222,7 +57309,7 @@ var refusalAdvice = /* @__PURE__ */ __name((clients, command, schema) => {
|
|
|
57222
57309
|
return mover ? `${own} (${mover.command} ${mover.version} moved the store to schema ${schema})` : own;
|
|
57223
57310
|
}, "refusalAdvice");
|
|
57224
57311
|
|
|
57225
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
57312
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sqlite/migrations.generated.js
|
|
57226
57313
|
var GENERATED = [
|
|
57227
57314
|
{
|
|
57228
57315
|
"name": "20261010184427_initial",
|
|
@@ -58576,7 +58663,7 @@ WHERE json_type(params, '$.selection') = 'object';`
|
|
|
58576
58663
|
}
|
|
58577
58664
|
];
|
|
58578
58665
|
|
|
58579
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
58666
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sqlite/rollback-copy.js
|
|
58580
58667
|
import { mkdirSync, rmSync, statfsSync, writeFileSync } from "node:fs";
|
|
58581
58668
|
import { basename, dirname, join as join3, parse } from "node:path";
|
|
58582
58669
|
var DERIVED = /(_fts|_words|_stems|_trigrams|_pending)$|^(embeddings|chunks|chunk_messages|mentions|involvements|search_terms)$|^vector_index/;
|
|
@@ -58809,7 +58896,7 @@ var rollBack2 = /* @__PURE__ */ __name((database, path) => {
|
|
|
58809
58896
|
return { ...result, foreignKeyViolations };
|
|
58810
58897
|
}, "rollBack");
|
|
58811
58898
|
|
|
58812
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
58899
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sqlite/manifest.js
|
|
58813
58900
|
var V31_TABLES = [
|
|
58814
58901
|
"accounts",
|
|
58815
58902
|
"account_identities",
|
|
@@ -58974,7 +59061,7 @@ var generatedMigrations = /* @__PURE__ */ __name((manifest = MANIFEST, generated
|
|
|
58974
59061
|
return migrations;
|
|
58975
59062
|
}, "generatedMigrations");
|
|
58976
59063
|
|
|
58977
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
59064
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/migrations.js
|
|
58978
59065
|
var MIGRATIONS = generatedMigrations();
|
|
58979
59066
|
var HISTORY = `CREATE TABLE IF NOT EXISTS schema_migrations (
|
|
58980
59067
|
version INTEGER PRIMARY KEY,
|
|
@@ -59071,7 +59158,7 @@ var migrate = /* @__PURE__ */ __name((database, { migrations = MIGRATIONS, now:
|
|
|
59071
59158
|
}
|
|
59072
59159
|
}, "migrate");
|
|
59073
59160
|
|
|
59074
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
59161
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sqlite/join-keys.js
|
|
59075
59162
|
var fillJoinKeys = /* @__PURE__ */ __name((database, { batch = 2e3 } = {}) => {
|
|
59076
59163
|
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 ?");
|
|
59077
59164
|
if (pending.get(0, 1) === void 0)
|
|
@@ -59093,7 +59180,7 @@ var fillJoinKeys = /* @__PURE__ */ __name((database, { batch = 2e3 } = {}) => {
|
|
|
59093
59180
|
}
|
|
59094
59181
|
}, "fillJoinKeys");
|
|
59095
59182
|
|
|
59096
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
59183
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sqlite/open.js
|
|
59097
59184
|
var openSqlite = /* @__PURE__ */ __name(async (path, { readOnly = false } = {}) => {
|
|
59098
59185
|
refuseOwnerStoreInTests(path);
|
|
59099
59186
|
const opened = "Bun" in globalThis ? await openUnderBun(path, readOnly) : await openUnderNode(path, readOnly);
|
|
@@ -59107,8 +59194,8 @@ var openSqlite = /* @__PURE__ */ __name(async (path, { readOnly = false } = {})
|
|
|
59107
59194
|
}, "openSqlite");
|
|
59108
59195
|
var openUnderNode = /* @__PURE__ */ __name(async (path, readOnly) => {
|
|
59109
59196
|
quietSqliteWarning();
|
|
59110
|
-
const { drizzle } = await import("./node-
|
|
59111
|
-
const { cacheOverNodeSqlite, nodeClient } = await import("./node-sqlite-
|
|
59197
|
+
const { drizzle } = await import("./node-N4DQQJKK.js");
|
|
59198
|
+
const { cacheOverNodeSqlite, nodeClient } = await import("./node-sqlite-MG4KFXYY.js");
|
|
59112
59199
|
const client = await nodeClient(path, { readOnly });
|
|
59113
59200
|
try {
|
|
59114
59201
|
if (!readOnly)
|
|
@@ -59122,8 +59209,8 @@ var openUnderNode = /* @__PURE__ */ __name(async (path, readOnly) => {
|
|
|
59122
59209
|
}
|
|
59123
59210
|
}, "openUnderNode");
|
|
59124
59211
|
var openUnderBun = /* @__PURE__ */ __name(async (path, readOnly) => {
|
|
59125
|
-
const { bunClient, cacheOverBunSqlite } = await import("./bun-sqlite-
|
|
59126
|
-
const { drizzle } = await import("./bun-
|
|
59212
|
+
const { bunClient, cacheOverBunSqlite } = await import("./bun-sqlite-F5RWCB2N.js");
|
|
59213
|
+
const { drizzle } = await import("./bun-XMZJDDEA.js");
|
|
59127
59214
|
const client = await bunClient(path, readOnly ? { readonly: true, create: false } : void 0);
|
|
59128
59215
|
try {
|
|
59129
59216
|
if (!readOnly)
|
|
@@ -59137,7 +59224,7 @@ var openUnderBun = /* @__PURE__ */ __name(async (path, readOnly) => {
|
|
|
59137
59224
|
}
|
|
59138
59225
|
}, "openUnderBun");
|
|
59139
59226
|
|
|
59140
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
59227
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sqlite/payment-facts.js
|
|
59141
59228
|
var PAYMENT_FACTS_TO_MOVE = "payment_facts_to_move";
|
|
59142
59229
|
var paymentOf = /* @__PURE__ */ __name((metadata3) => {
|
|
59143
59230
|
try {
|
|
@@ -59205,7 +59292,7 @@ var movePaymentFacts = /* @__PURE__ */ __name((context) => {
|
|
|
59205
59292
|
});
|
|
59206
59293
|
}, "movePaymentFacts");
|
|
59207
59294
|
|
|
59208
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
59295
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sqlite/read-compatibility.js
|
|
59209
59296
|
var readCompatibility = /* @__PURE__ */ __name((database, command) => {
|
|
59210
59297
|
const ours = MIGRATIONS.at(-1)?.version ?? 0;
|
|
59211
59298
|
if (!database.prepare("SELECT 1 FROM sqlite_master WHERE type='table' AND name='schema_migrations'").get())
|
|
@@ -59223,7 +59310,7 @@ var assertReadCompatible = /* @__PURE__ */ __name((database, command) => {
|
|
|
59223
59310
|
throw new CliError("configuration_error", `The store needs schema ${MIGRATIONS.at(-1)?.version ?? 0} maintenance before a read-only open`);
|
|
59224
59311
|
}, "assertReadCompatible");
|
|
59225
59312
|
|
|
59226
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
59313
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sqlite/suggested-links.js
|
|
59227
59314
|
var SUGGESTED_LINKS_TO_MOVE = "suggested_links_to_move";
|
|
59228
59315
|
var proposerOf2 = /* @__PURE__ */ __name((provenance2) => {
|
|
59229
59316
|
if (provenance2?.startsWith("rule:"))
|
|
@@ -59269,7 +59356,7 @@ var moveSuggestedLinks = /* @__PURE__ */ __name((database, now2) => {
|
|
|
59269
59356
|
});
|
|
59270
59357
|
}, "moveSuggestedLinks");
|
|
59271
59358
|
|
|
59272
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
59359
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sqlite/test-accounts.js
|
|
59273
59360
|
var TEST_ACCOUNTS_TO_PURGE = "test_accounts_to_purge";
|
|
59274
59361
|
var TEST_PROVIDER = "chat";
|
|
59275
59362
|
var purgeTestAccounts = /* @__PURE__ */ __name((context, warn) => {
|
|
@@ -59290,7 +59377,7 @@ var purgeTestAccounts = /* @__PURE__ */ __name((context, warn) => {
|
|
|
59290
59377
|
}
|
|
59291
59378
|
}, "purgeTestAccounts");
|
|
59292
59379
|
|
|
59293
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
59380
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sqlite/open-store.js
|
|
59294
59381
|
var BACKFILL_ON_OPEN = 5e3;
|
|
59295
59382
|
var NOT_WRITABLE = /* @__PURE__ */ new Set(["EACCES", "EPERM", "EROFS"]);
|
|
59296
59383
|
var createWritable = /* @__PURE__ */ __name((file) => {
|
|
@@ -59402,7 +59489,7 @@ var openStoreContext = /* @__PURE__ */ __name(async (options = {}) => {
|
|
|
59402
59489
|
}
|
|
59403
59490
|
}, "openStoreContext");
|
|
59404
59491
|
|
|
59405
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
59492
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sqlite/products.js
|
|
59406
59493
|
var PRODUCTS = "SELECT c.*, b.name AS author_name, b.kind AS author_kind FROM catalog_items c LEFT JOIN bots b ON c.author_type = 'bot' AND b.id = c.author_id";
|
|
59407
59494
|
var productOperationsOver = /* @__PURE__ */ __name((context) => {
|
|
59408
59495
|
const { database, now: now2 } = context;
|
|
@@ -59510,13 +59597,13 @@ var productsStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
59510
59597
|
};
|
|
59511
59598
|
}, "productsStoreOver");
|
|
59512
59599
|
|
|
59513
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
59600
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/project-transfer/plan.js
|
|
59514
59601
|
import { createHash as createHash20 } from "node:crypto";
|
|
59515
59602
|
|
|
59516
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
59603
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/project-transfer/manifest.js
|
|
59517
59604
|
import { createHash as createHash19 } from "node:crypto";
|
|
59518
59605
|
|
|
59519
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
59606
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/project-transfer/schema.js
|
|
59520
59607
|
var text6 = /* @__PURE__ */ __name((max) => pipe(string(), minLength(1), maxLength(max)), "text");
|
|
59521
59608
|
var ref = text6(2048);
|
|
59522
59609
|
var timestamp2 = pipe(number(), safeInteger(), minValue(0));
|
|
@@ -59586,7 +59673,7 @@ var projectAnnotationsSchema = strictObject({
|
|
|
59586
59673
|
}))
|
|
59587
59674
|
});
|
|
59588
59675
|
|
|
59589
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
59676
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/project-transfer/manifest.js
|
|
59590
59677
|
var PROJECT_ANNOTATIONS_MAX_BYTES = 4 * 1024 * 1024;
|
|
59591
59678
|
var invalid10 = /* @__PURE__ */ __name((field4) => {
|
|
59592
59679
|
throw new CliError("validation_error", `invalid project annotations.${field4}`);
|
|
@@ -59719,7 +59806,7 @@ var projectAnnotationsFingerprint = /* @__PURE__ */ __name((json3) => {
|
|
|
59719
59806
|
return createHash19("sha256").update(JSON.stringify(normalized)).digest("hex");
|
|
59720
59807
|
}, "projectAnnotationsFingerprint");
|
|
59721
59808
|
|
|
59722
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
59809
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/project-transfer/plan.js
|
|
59723
59810
|
var hash = pipe(string(), regex(/^[a-f0-9]{64}$/));
|
|
59724
59811
|
var ref2 = pipe(string(), minLength(1), maxLength(2048));
|
|
59725
59812
|
var targetSchema = strictObject({
|
|
@@ -59826,7 +59913,7 @@ var planBoundProjectAnnotations = /* @__PURE__ */ __name((manifest, manifest_fin
|
|
|
59826
59913
|
}, "planBoundProjectAnnotations");
|
|
59827
59914
|
var planProjectAnnotations = /* @__PURE__ */ __name((json3, target, bindings) => planBoundProjectAnnotations(decodeProjectAnnotations(json3), projectAnnotationsFingerprint(json3), target, bindings), "planProjectAnnotations");
|
|
59828
59915
|
|
|
59829
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
59916
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/project-transfer/snapshot-model.js
|
|
59830
59917
|
import { createHash as createHash21 } from "node:crypto";
|
|
59831
59918
|
var text7 = /* @__PURE__ */ __name((max) => pipe(string(), minLength(1), maxLength(max)), "text");
|
|
59832
59919
|
var timestamp3 = pipe(number(), safeInteger(), minValue(0));
|
|
@@ -59920,7 +60007,7 @@ var projectAnnotationSnapshotFingerprint = /* @__PURE__ */ __name((json3) => {
|
|
|
59920
60007
|
})).digest("hex");
|
|
59921
60008
|
}, "projectAnnotationSnapshotFingerprint");
|
|
59922
60009
|
|
|
59923
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
60010
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/project-transfer/request.js
|
|
59924
60011
|
var projectAnnotationRequest = /* @__PURE__ */ __name((request, restore = false) => {
|
|
59925
60012
|
if (!request || typeof request !== "object" || Array.isArray(request))
|
|
59926
60013
|
throw new CliError("validation_error", "project annotation request is required");
|
|
@@ -59937,7 +60024,7 @@ var projectAnnotationRequest = /* @__PURE__ */ __name((request, restore = false)
|
|
|
59937
60024
|
return { snapshot: snapshot2, projectId: Number(request.project.slice(8)) };
|
|
59938
60025
|
}, "projectAnnotationRequest");
|
|
59939
60026
|
|
|
59940
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
60027
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sqlite/project-transfer/budget.js
|
|
59941
60028
|
var SnapshotBudget = class {
|
|
59942
60029
|
static {
|
|
59943
60030
|
__name(this, "SnapshotBudget");
|
|
@@ -59963,13 +60050,13 @@ var SnapshotBudget = class {
|
|
|
59963
60050
|
}
|
|
59964
60051
|
};
|
|
59965
60052
|
|
|
59966
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
60053
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sqlite/project-transfer/preview.js
|
|
59967
60054
|
import { createHash as createHash23 } from "node:crypto";
|
|
59968
60055
|
|
|
59969
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
60056
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/project-transfer/snapshot-plan.js
|
|
59970
60057
|
var planProjectAnnotationSnapshot = /* @__PURE__ */ __name((json3, target, bindings) => planBoundProjectAnnotations(decodeProjectAnnotationSnapshot(json3), projectAnnotationSnapshotFingerprint(json3), target, bindings), "planProjectAnnotationSnapshot");
|
|
59971
60058
|
|
|
59972
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
60059
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sqlite/project-transfer/sources.js
|
|
59973
60060
|
import { createHash as createHash22 } from "node:crypto";
|
|
59974
60061
|
var invalid12 = /* @__PURE__ */ __name(() => {
|
|
59975
60062
|
throw new CliError("configuration_error", "project snapshot has an unavailable or unsupported dependency");
|
|
@@ -60112,7 +60199,7 @@ var ProjectSnapshotSources = class {
|
|
|
60112
60199
|
}
|
|
60113
60200
|
};
|
|
60114
60201
|
|
|
60115
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
60202
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sqlite/project-transfer/snapshot.js
|
|
60116
60203
|
var unsupported = /* @__PURE__ */ __name(() => {
|
|
60117
60204
|
throw new CliError("configuration_error", "project snapshot has unsupported metadata, deletion or account scope");
|
|
60118
60205
|
}, "unsupported");
|
|
@@ -60290,7 +60377,7 @@ var projectAnnotationSnapshot = /* @__PURE__ */ __name((database, projectId2, bu
|
|
|
60290
60377
|
return { snapshot: snapshot2, read_bytes: budget.bytes, records: budget.records };
|
|
60291
60378
|
}), "projectAnnotationSnapshot");
|
|
60292
60379
|
|
|
60293
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
60380
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sqlite/project-transfer/preview.js
|
|
60294
60381
|
var previewAnnotationSnapshot = /* @__PURE__ */ __name((database, projectId2, manifest, bindings, budget) => read(database, () => {
|
|
60295
60382
|
const current2 = projectAnnotationSnapshot(database, projectId2, budget).snapshot;
|
|
60296
60383
|
const sources = new ProjectSnapshotSources(database, budget);
|
|
@@ -60352,7 +60439,7 @@ var previewAnnotationSnapshot = /* @__PURE__ */ __name((database, projectId2, ma
|
|
|
60352
60439
|
};
|
|
60353
60440
|
}), "previewAnnotationSnapshot");
|
|
60354
60441
|
|
|
60355
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
60442
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sqlite/project-transfer/records.js
|
|
60356
60443
|
var metadataOf2 = /* @__PURE__ */ __name((database, link3, to) => {
|
|
60357
60444
|
const provenance2 = link3.provenance === null ? {} : { provenance: link3.provenance };
|
|
60358
60445
|
if (link3.kind === "evidence" && to)
|
|
@@ -60419,7 +60506,7 @@ var restoreAnnotationRecords = /* @__PURE__ */ __name((database, projectId2, sna
|
|
|
60419
60506
|
return mappings;
|
|
60420
60507
|
}, "restoreAnnotationRecords");
|
|
60421
60508
|
|
|
60422
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
60509
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sqlite/project-transfer/store.js
|
|
60423
60510
|
var projectAnnotationStoreOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
60424
60511
|
async preview(request) {
|
|
60425
60512
|
const { snapshot: snapshot2, projectId: projectId2 } = projectAnnotationRequest(request);
|
|
@@ -60449,7 +60536,7 @@ var projectAnnotationStoreOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
|
60449
60536
|
}
|
|
60450
60537
|
}), "projectAnnotationStoreOver");
|
|
60451
60538
|
|
|
60452
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
60539
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sqlite/record-relations.js
|
|
60453
60540
|
var isDerived = /* @__PURE__ */ __name((role) => role.startsWith("fields."), "isDerived");
|
|
60454
60541
|
var recordRelationsOver = /* @__PURE__ */ __name(({ database }) => {
|
|
60455
60542
|
const sql2 = /* @__PURE__ */ __name((text8) => database.prepare(text8), "sql");
|
|
@@ -60520,7 +60607,7 @@ var recordRelationsOver = /* @__PURE__ */ __name(({ database }) => {
|
|
|
60520
60607
|
return { entityRef, relatedOf, storedRelations, relate, missingOf };
|
|
60521
60608
|
}, "recordRelationsOver");
|
|
60522
60609
|
|
|
60523
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
60610
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sqlite/record-remap.js
|
|
60524
60611
|
var recordRemapOver = /* @__PURE__ */ __name(({ database, now: now2 }) => {
|
|
60525
60612
|
const pointedAt = /* @__PURE__ */ __name((type, id2) => {
|
|
60526
60613
|
for (const { table, pointer } of pointerPairs(database))
|
|
@@ -60574,7 +60661,7 @@ var recordRemapOver = /* @__PURE__ */ __name(({ database, now: now2 }) => {
|
|
|
60574
60661
|
return { pointedAt, remap };
|
|
60575
60662
|
}, "recordRemapOver");
|
|
60576
60663
|
|
|
60577
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
60664
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sqlite/record-run.js
|
|
60578
60665
|
var runs = 0;
|
|
60579
60666
|
var PAGE = 500;
|
|
60580
60667
|
var recordRunOver = /* @__PURE__ */ __name((context, writes) => {
|
|
@@ -60787,7 +60874,7 @@ var waitingPointer = /* @__PURE__ */ __name((index2, missing4) => {
|
|
|
60787
60874
|
return pointerOf("records", index2, "fields", key2);
|
|
60788
60875
|
}, "waitingPointer");
|
|
60789
60876
|
|
|
60790
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
60877
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sqlite/record-matching.js
|
|
60791
60878
|
var valuesOf = /* @__PURE__ */ __name((value) => (Array.isArray(value) ? value : [value]).filter((one2) => typeof one2 === "string"), "valuesOf");
|
|
60792
60879
|
var SCHEME = /^(email|domain|tax-id:[a-z]{2}|registration:[a-z]{2})$/;
|
|
60793
60880
|
var ORG_EMAIL = "org-email";
|
|
@@ -60953,7 +61040,7 @@ var renameMade = /* @__PURE__ */ __name(({ database, now: now2 }, type, id2, nam
|
|
|
60953
61040
|
]);
|
|
60954
61041
|
}, "renameMade");
|
|
60955
61042
|
|
|
60956
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
61043
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sqlite/record-projectors-direct.js
|
|
60957
61044
|
var productFields = /* @__PURE__ */ __name((fields4) => ({
|
|
60958
61045
|
name: given2(fields4, "name"),
|
|
60959
61046
|
unit: given2(fields4, "unit"),
|
|
@@ -61076,7 +61163,7 @@ var DIRECT_PROJECTORS = {
|
|
|
61076
61163
|
lead: dealProjector("lead")
|
|
61077
61164
|
};
|
|
61078
61165
|
|
|
61079
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
61166
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sqlite/record-projectors-document.js
|
|
61080
61167
|
var TEXT_ONLY = { storage: "text", localPath: null };
|
|
61081
61168
|
var textOf7 = /* @__PURE__ */ __name(({ fields: fields4, externalId }) => {
|
|
61082
61169
|
const text8 = String(fields4.text ?? "");
|
|
@@ -61145,7 +61232,7 @@ var DOCUMENT_PROJECTORS = {
|
|
|
61145
61232
|
}
|
|
61146
61233
|
};
|
|
61147
61234
|
|
|
61148
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
61235
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sqlite/record-projectors-money.js
|
|
61149
61236
|
var allocatedByOthers = /* @__PURE__ */ __name((context, paymentId) => {
|
|
61150
61237
|
const importer = authorActor(context, IMPORTER).actor;
|
|
61151
61238
|
return context.database.prepare("SELECT 1 FROM payment_allocations WHERE payment_id = ? AND NOT (author_type = ? AND author_id = ?) LIMIT 1").get(paymentId, importer.type, importer.id) !== void 0;
|
|
@@ -61355,7 +61442,7 @@ var MONEY_PROJECTORS = {
|
|
|
61355
61442
|
}
|
|
61356
61443
|
};
|
|
61357
61444
|
|
|
61358
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
61445
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sqlite/record-projectors-phone.js
|
|
61359
61446
|
var CALLS_CALENDAR = "calls";
|
|
61360
61447
|
var importOnly = /* @__PURE__ */ __name((source2, type) => {
|
|
61361
61448
|
if (!isImportedProvider(source2.provider))
|
|
@@ -61530,7 +61617,7 @@ var PHONE_PROJECTORS = {
|
|
|
61530
61617
|
}
|
|
61531
61618
|
};
|
|
61532
61619
|
|
|
61533
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
61620
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sqlite/record-projectors.js
|
|
61534
61621
|
var RECORD_PROJECTORS = {
|
|
61535
61622
|
...MONEY_PROJECTORS,
|
|
61536
61623
|
...DIRECT_PROJECTORS,
|
|
@@ -61541,7 +61628,7 @@ var RECORD_PROJECTORS = {
|
|
|
61541
61628
|
project: null
|
|
61542
61629
|
};
|
|
61543
61630
|
|
|
61544
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
61631
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sqlite/record-settling.js
|
|
61545
61632
|
var recordSettlingOver = /* @__PURE__ */ __name(({ database }, finance) => {
|
|
61546
61633
|
const sql2 = /* @__PURE__ */ __name((text8) => database.prepare(text8), "sql");
|
|
61547
61634
|
const freeOn = /* @__PURE__ */ __name((invoice, payment) => {
|
|
@@ -61603,7 +61690,7 @@ var recordSettlingOver = /* @__PURE__ */ __name(({ database }, finance) => {
|
|
|
61603
61690
|
return { settle, checkShares };
|
|
61604
61691
|
}, "recordSettlingOver");
|
|
61605
61692
|
|
|
61606
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
61693
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sqlite/record-stamps.js
|
|
61607
61694
|
import { createHash as createHash24 } from "node:crypto";
|
|
61608
61695
|
var VOLATILE = /* @__PURE__ */ new Set(["id", "created_at", "updated_at", "metadata"]);
|
|
61609
61696
|
var content = /* @__PURE__ */ __name((row2) => row2 === void 0 ? null : Object.fromEntries(Object.entries(row2).filter(([column2]) => !VOLATILE.has(column2))), "content");
|
|
@@ -61619,7 +61706,7 @@ var importStampsOver = /* @__PURE__ */ __name(({ database }) => {
|
|
|
61619
61706
|
return { stamp, untouched };
|
|
61620
61707
|
}, "importStampsOver");
|
|
61621
61708
|
|
|
61622
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
61709
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sqlite/subscriptions.js
|
|
61623
61710
|
var SUBSCRIPTIONS = "SELECT s.*, b.name AS author_name, b.kind AS author_kind FROM subscriptions s LEFT JOIN bots b ON s.author_type = 'bot' AND b.id = s.author_id";
|
|
61624
61711
|
var PRICES = "SELECT p.*, b.name AS author_name, b.kind AS author_kind FROM subscription_prices p LEFT JOIN bots b ON p.author_type = 'bot' AND b.id = p.author_id";
|
|
61625
61712
|
var PRICE_REF = /^subscription_price:([1-9]\d{0,15})$/;
|
|
@@ -61856,7 +61943,7 @@ var subscriptionsStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
61856
61943
|
};
|
|
61857
61944
|
}, "subscriptionsStoreOver");
|
|
61858
61945
|
|
|
61859
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
61946
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sqlite/wallets.js
|
|
61860
61947
|
var WALLETS = "SELECT w.*, b.name AS author_name, b.kind AS author_kind FROM financial_accounts w LEFT JOIN bots b ON w.author_type = 'bot' AND b.id = w.author_id";
|
|
61861
61948
|
var SIGNED = "CASE t.direction WHEN 'in' THEN t.amount ELSE -t.amount END";
|
|
61862
61949
|
var walletOperationsOver = /* @__PURE__ */ __name((context) => {
|
|
@@ -61981,7 +62068,7 @@ var walletsStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
61981
62068
|
};
|
|
61982
62069
|
}, "walletsStoreOver");
|
|
61983
62070
|
|
|
61984
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
62071
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sqlite/record-writes.js
|
|
61985
62072
|
var specOf = /* @__PURE__ */ __name((type) => RECORD_TYPES[type], "specOf");
|
|
61986
62073
|
var unsettled = /* @__PURE__ */ __name((fields4, relations) => recordFingerprint(fields4, relations.filter((relation) => !AMOUNT_ROLES.includes(relation.role))), "unsettled");
|
|
61987
62074
|
var tableOf2 = /* @__PURE__ */ __name((type) => typeof type === "string" && Object.hasOwn(DECIDED_TABLES, type) ? DECIDED_TABLES[type] : void 0, "tableOf");
|
|
@@ -62240,7 +62327,7 @@ var recordWritesOver = /* @__PURE__ */ __name((context) => {
|
|
|
62240
62327
|
return { writeOne, project: project2, completeDependents, entityRef, missingOf: relations.missingOf };
|
|
62241
62328
|
}, "recordWritesOver");
|
|
62242
62329
|
|
|
62243
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
62330
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sqlite/records.js
|
|
62244
62331
|
var LIMIT = 1e3;
|
|
62245
62332
|
var iso16 = /* @__PURE__ */ __name((value) => new Date(Number(value)).toISOString(), "iso");
|
|
62246
62333
|
var checkLimit = /* @__PURE__ */ __name((limit) => {
|
|
@@ -62464,7 +62551,7 @@ var recordStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
62464
62551
|
};
|
|
62465
62552
|
}, "recordStoreOver");
|
|
62466
62553
|
|
|
62467
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
62554
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sqlite/templates.js
|
|
62468
62555
|
var templateOf = /* @__PURE__ */ __name((row2) => ({
|
|
62469
62556
|
key: row2.key,
|
|
62470
62557
|
channel: row2.channel,
|
|
@@ -62519,7 +62606,7 @@ var storedTemplateBodies = /* @__PURE__ */ __name((database, key2, language) =>
|
|
|
62519
62606
|
return Object.fromEntries(rows.map((row2) => [row2.channel, row2.body]));
|
|
62520
62607
|
}, "storedTemplateBodies");
|
|
62521
62608
|
|
|
62522
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
62609
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/store-errors.js
|
|
62523
62610
|
var refusalOf2 = /* @__PURE__ */ __name((error) => error instanceof Error && error.name === "DrizzleQueryError" && error.cause instanceof CliError ? error.cause : error, "refusalOf");
|
|
62524
62611
|
var wrapped2 = /* @__PURE__ */ new WeakMap();
|
|
62525
62612
|
var storeErrors = /* @__PURE__ */ __name((area) => {
|
|
@@ -62554,7 +62641,7 @@ var storeErrors = /* @__PURE__ */ __name((area) => {
|
|
|
62554
62641
|
return proxy;
|
|
62555
62642
|
}, "storeErrors");
|
|
62556
62643
|
|
|
62557
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
62644
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sqlite/ranges.js
|
|
62558
62645
|
var markRange = /* @__PURE__ */ __name(({ orm, now: now2 }, chatKey, from2, to) => {
|
|
62559
62646
|
const touching = and(eq(syncRanges.chatId, chatKey), lte(syncRanges.fromKey, to + 1), gte(syncRanges.toKey, from2 - 1));
|
|
62560
62647
|
let merged2 = { from: from2, to };
|
|
@@ -62567,7 +62654,7 @@ var markRange = /* @__PURE__ */ __name(({ orm, now: now2 }, chatKey, from2, to)
|
|
|
62567
62654
|
}, "markRange");
|
|
62568
62655
|
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");
|
|
62569
62656
|
|
|
62570
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
62657
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sqlite/task-analysis-marks.js
|
|
62571
62658
|
var prefixOf2 = /* @__PURE__ */ __name(({ provider, account }) => `task_analysis:${provider}:${account}:`, "prefixOf");
|
|
62572
62659
|
var markOf = /* @__PURE__ */ __name((prefix, row2) => ({
|
|
62573
62660
|
chatId: String(row2.key).slice(prefix.length),
|
|
@@ -62588,7 +62675,7 @@ var setTaskAnalysisMark = /* @__PURE__ */ __name((database, account, { chatId, c
|
|
|
62588
62675
|
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);
|
|
62589
62676
|
}, "setTaskAnalysisMark");
|
|
62590
62677
|
|
|
62591
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
62678
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sqlite/task-rule-stops.js
|
|
62592
62679
|
var keyOf6 = /* @__PURE__ */ __name(({ provider, account }) => `task_rules_until:${provider}:${account}`, "keyOf");
|
|
62593
62680
|
var taskRulesStop = /* @__PURE__ */ __name((database, account) => {
|
|
62594
62681
|
const row2 = database.prepare("SELECT value FROM store_settings WHERE key = ?").get(keyOf6(account));
|
|
@@ -62598,7 +62685,7 @@ var setTaskRulesStop = /* @__PURE__ */ __name((database, account, until, now2) =
|
|
|
62598
62685
|
database.prepare("INSERT INTO store_settings (key, value, at) VALUES (?, ?, ?) ON CONFLICT (key) DO UPDATE SET value = excluded.value, at = excluded.at").run(keyOf6(account), JSON.stringify(until), now2);
|
|
62599
62686
|
}, "setTaskRulesStop");
|
|
62600
62687
|
|
|
62601
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
62688
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sync.js
|
|
62602
62689
|
var syncStoreOver = /* @__PURE__ */ __name((context) => {
|
|
62603
62690
|
const { database } = context;
|
|
62604
62691
|
const { accountPk: accountPk2, findAccountPk: findAccountPk2, chatKeyOf, chatPkFor: chatPkFor2, identityPk: identityPk2, writeMembers: writeMembers2, writeState: writeState2 } = keysOver(context);
|
|
@@ -62657,7 +62744,7 @@ var syncStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
62657
62744
|
};
|
|
62658
62745
|
}, "syncStoreOver");
|
|
62659
62746
|
|
|
62660
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
62747
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/tags.js
|
|
62661
62748
|
var tagsStoreOver = /* @__PURE__ */ __name((context) => {
|
|
62662
62749
|
const { database } = context;
|
|
62663
62750
|
return {
|
|
@@ -62679,7 +62766,7 @@ var tagsStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
62679
62766
|
};
|
|
62680
62767
|
}, "tagsStoreOver");
|
|
62681
62768
|
|
|
62682
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
62769
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sqlite/image-chunks.js
|
|
62683
62770
|
var IS_IMAGE = sql`(a.kind = 'photo' OR a.mime LIKE 'image/%')`;
|
|
62684
62771
|
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
|
|
62685
62772
|
WHERE chat_id = ${chatKey} AND deleted_at IS NULL AND trim(text) <> '' AND id <> ${messagePk}
|
|
@@ -62806,7 +62893,7 @@ var savePictureChunks = /* @__PURE__ */ __name(({ orm, now: now2, database }, ac
|
|
|
62806
62893
|
dropUnusedVectors(database, released.map(({ hash: hash2 }) => hash2));
|
|
62807
62894
|
}, "savePictureChunks");
|
|
62808
62895
|
|
|
62809
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
62896
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sqlite/message-chunks.js
|
|
62810
62897
|
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,
|
|
62811
62898
|
EXISTS (SELECT 1 FROM embeddings v WHERE v.model = ${model} AND v.content_hash = k.content_hash) AS embedded
|
|
62812
62899
|
FROM messages m
|
|
@@ -62895,7 +62982,7 @@ var nearestMessages = /* @__PURE__ */ __name((context, accountPk2, { limit, quer
|
|
|
62895
62982
|
return plain2(best(found2));
|
|
62896
62983
|
}, "nearestMessages");
|
|
62897
62984
|
|
|
62898
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
62985
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/vectors.js
|
|
62899
62986
|
var accountVectorsOver = /* @__PURE__ */ __name((context, mail) => {
|
|
62900
62987
|
const { database } = context;
|
|
62901
62988
|
const { findAccountPk: findAccountPk2, findChatPk: findChatPk2, chatKeyOf } = keysOver(context);
|
|
@@ -63154,7 +63241,7 @@ var vectorsStoreOver = /* @__PURE__ */ __name((context, keyed) => ({
|
|
|
63154
63241
|
vectorCounts: /* @__PURE__ */ __name(async (models) => vectorCounts(context, models), "vectorCounts")
|
|
63155
63242
|
}), "vectorsStoreOver");
|
|
63156
63243
|
|
|
63157
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
63244
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sqlite/store-tables.js
|
|
63158
63245
|
import { existsSync as existsSync3, readFileSync as readFileSync4 } from "node:fs";
|
|
63159
63246
|
import { dirname as dirname3, join as join4 } from "node:path";
|
|
63160
63247
|
var BOOKKEEPING2 = ["schema_migrations", "store_settings"];
|
|
@@ -63242,10 +63329,10 @@ var lastBackup = /* @__PURE__ */ __name((path) => {
|
|
|
63242
63329
|
}
|
|
63243
63330
|
}, "lastBackup");
|
|
63244
63331
|
|
|
63245
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
63332
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/providers.js
|
|
63246
63333
|
var registerProvider2 = /* @__PURE__ */ __name((store, entry2) => store.accounts.registerProvider(entry2), "registerProvider");
|
|
63247
63334
|
|
|
63248
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
63335
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/sqlite/store-contents.js
|
|
63249
63336
|
var COUNTED_TABLES = [
|
|
63250
63337
|
"accounts",
|
|
63251
63338
|
"chats",
|
|
@@ -63330,7 +63417,7 @@ var storeContents = /* @__PURE__ */ __name((database) => {
|
|
|
63330
63417
|
};
|
|
63331
63418
|
}, "storeContents");
|
|
63332
63419
|
|
|
63333
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
63420
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.672.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.101.0_commander@15_45e526ef63b403e5407f6f52c7b6265f/node_modules/@wirecat/cli-core/dist/store/store.js
|
|
63334
63421
|
var openStore = /* @__PURE__ */ __name(async (options = {}) => {
|
|
63335
63422
|
const context = await openStoreContext(options);
|
|
63336
63423
|
try {
|