@wirecat/tg-cli 0.130.0 → 0.132.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-OXVMOWVE.js} +60 -60
- package/dist/bundle/{all-profiles-GXFPZLYU.js → all-profiles-6OQC7PBL.js} +9 -9
- package/dist/bundle/{anthropic-FHS5XNK5.js → anthropic-YFMIHFW5.js} +5 -5
- package/dist/bundle/{app-server-IZMFSFP2.js → app-server-S7CJPJXN.js} +52 -52
- package/dist/bundle/{bot-api-V3ZJ75KE.js → bot-api-KJ6EZ4R6.js} +61 -61
- package/dist/bundle/{bot-history-EJQOD4AQ.js → bot-history-JYCXDFW4.js} +22 -22
- package/dist/bundle/{bun-GBAZFRCV.js → bun-FVTOBYZ2.js} +2 -2
- package/dist/bundle/{bun-sqlite-JB4BX6X7.js → bun-sqlite-KDGWBNOR.js} +6 -6
- package/dist/bundle/{chunk-KY3JLXW2.js → chunk-2LZD2VFV.js} +4 -4
- package/dist/bundle/{chunk-JUFLELQ7.js → chunk-2UGSIHLV.js} +2 -2
- package/dist/bundle/{chunk-TGRB4SSZ.js → chunk-3QHKZLBU.js} +4 -4
- package/dist/bundle/{chunk-6M3FAHPS.js → chunk-42MXCMW6.js} +3 -3
- package/dist/bundle/{chunk-HT6OFANN.js → chunk-44A2XRDE.js} +20 -20
- package/dist/bundle/{chunk-QJLCEOAP.js → chunk-4CKYANQH.js} +1 -1
- package/dist/bundle/{chunk-AUNNJDVD.js → chunk-4EDJJQJI.js} +28 -8
- package/dist/bundle/{chunk-2JZJPVBH.js → chunk-4YB7JU2W.js} +6 -6
- package/dist/bundle/{chunk-CLG2ISQH.js → chunk-4ZTVJHWU.js} +4 -4
- package/dist/bundle/{chunk-F6MLJ3V5.js → chunk-5RDNBG7D.js} +2 -2
- package/dist/bundle/{chunk-6JBRQ6PM.js → chunk-5UPEEMEF.js} +61 -19
- package/dist/bundle/{chunk-SYZXOEHY.js → chunk-6LPUK62N.js} +3 -3
- package/dist/bundle/{chunk-NRCY3WBC.js → chunk-74UPKW7H.js} +2 -2
- package/dist/bundle/{chunk-QDEP2QOA.js → chunk-7SEVVE3X.js} +3 -3
- package/dist/bundle/{chunk-PS7ZS5HD.js → chunk-A5D3J7XZ.js} +4 -4
- package/dist/bundle/{chunk-3XMUP55N.js → chunk-AERP2QR6.js} +10 -10
- package/dist/bundle/{chunk-RZPMFVWM.js → chunk-AUZWIBHJ.js} +6 -6
- package/dist/bundle/{chunk-OWVQMK7G.js → chunk-B4LGDOG5.js} +528 -389
- package/dist/bundle/{chunk-B6NQJAUC.js → chunk-BLZEQVP4.js} +2 -2
- package/dist/bundle/{chunk-GGGBPWUS.js → chunk-BMI2NWFI.js} +8 -8
- package/dist/bundle/{chunk-EB2JE722.js → chunk-BSXS7VAC.js} +1 -1
- package/dist/bundle/{chunk-FIO5NMK3.js → chunk-CFWFESBO.js} +8 -8
- package/dist/bundle/{chunk-QFVIHBLD.js → chunk-DSJNZXTP.js} +1 -1
- package/dist/bundle/{chunk-F6CV4KUN.js → chunk-DXPGMUOR.js} +2 -2
- package/dist/bundle/{chunk-IV6SIKVH.js → chunk-EPR67IRV.js} +4 -4
- package/dist/bundle/{chunk-BMSS3PCY.js → chunk-ESOFH7PA.js} +37 -30
- package/dist/bundle/{chunk-XXW6PFAX.js → chunk-FIUH52FE.js} +1 -1
- package/dist/bundle/{chunk-4BJAQNJ5.js → chunk-FKGYXIN7.js} +7 -7
- package/dist/bundle/{chunk-VSPSHBAC.js → chunk-FPSRT2TX.js} +2 -2
- package/dist/bundle/{chunk-OKTRB4ZQ.js → chunk-HBSKP7OV.js} +1 -1
- package/dist/bundle/{chunk-RAFK5KXU.js → chunk-IY7CTAOQ.js} +9 -9
- package/dist/bundle/{chunk-66UG67CE.js → chunk-IYJ4B632.js} +14 -13
- package/dist/bundle/{chunk-FH4YIBBH.js → chunk-JDNDWZYS.js} +4 -4
- package/dist/bundle/{chunk-C4ALE7CH.js → chunk-JMJOWT4N.js} +1 -1
- package/dist/bundle/{chunk-ZRQQOGAZ.js → chunk-JNWKV3QV.js} +4 -4
- package/dist/bundle/{chunk-2LPODKIF.js → chunk-JPSRC732.js} +17 -115
- package/dist/bundle/{chunk-SZB5WRMI.js → chunk-JZJV3DYK.js} +2 -2
- package/dist/bundle/{chunk-S5UTBEV3.js → chunk-KJICORS4.js} +38 -37
- package/dist/bundle/{chunk-RPWYTOLI.js → chunk-LF6FACSW.js} +5 -5
- package/dist/bundle/{chunk-QJDHRBXL.js → chunk-LG3K5NHX.js} +7 -7
- package/dist/bundle/{chunk-6WGAWISN.js → chunk-LMGVPDXN.js} +2 -2
- package/dist/bundle/{chunk-EUL7HMUL.js → chunk-LZ3HFDYL.js} +2 -2
- package/dist/bundle/{chunk-B5RGPZDZ.js → chunk-M2TV6BDB.js} +7 -7
- package/dist/bundle/{chunk-3KZG63EH.js → chunk-N5LZ6L4D.js} +3 -3
- package/dist/bundle/{chunk-O2ULG7OO.js → chunk-NLRGMP7M.js} +3 -3
- package/dist/bundle/{chunk-GYCKRIRK.js → chunk-NWCFO37P.js} +3 -3
- package/dist/bundle/{chunk-QBNEWEJC.js → chunk-NWDADTPE.js} +3 -3
- package/dist/bundle/{chunk-42LRWOTT.js → chunk-O3AM32YN.js} +15 -15
- package/dist/bundle/{chunk-7F3LOHRB.js → chunk-O43PARFS.js} +170 -162
- package/dist/bundle/{chunk-IRWSZJYL.js → chunk-OGZZUDJJ.js} +54 -54
- package/dist/bundle/{chunk-M327UNS6.js → chunk-OIRNHSAH.js} +6 -6
- package/dist/bundle/{chunk-XHX5D5VE.js → chunk-PG37E63A.js} +174 -72
- package/dist/bundle/{chunk-PWQKGFS2.js → chunk-PR4F3TYK.js} +30 -30
- package/dist/bundle/{chunk-I5PILOTU.js → chunk-PYECFCPD.js} +1 -1
- package/dist/bundle/{chunk-MVFSWKTM.js → chunk-QNEAPLOP.js} +12 -12
- package/dist/bundle/{chunk-VTJ3AOTT.js → chunk-QS46C5SW.js} +17 -17
- package/dist/bundle/{chunk-X5H5NERR.js → chunk-SMQ45RZX.js} +6 -6
- package/dist/bundle/{chunk-IBSHQWIJ.js → chunk-U7PHJSTX.js} +2 -2
- package/dist/bundle/{chunk-CKJ73EF3.js → chunk-UAFSDTID.js} +1 -1
- package/dist/bundle/{chunk-HHUK3XO5.js → chunk-UGD4SCUI.js} +1 -1
- package/dist/bundle/{chunk-MS6YEIG5.js → chunk-WAVRUADL.js} +13 -13
- package/dist/bundle/{chunk-VXWDQDRU.js → chunk-Y57EKZZK.js} +795 -467
- package/dist/bundle/{chunk-LQPZDDDP.js → chunk-YAPO7QNO.js} +6 -6
- package/dist/bundle/{chunk-G2SMVYBU.js → chunk-YRXSNH3R.js} +2 -2
- package/dist/bundle/{chunk-OJMDKWWL.js → chunk-YSNQGOUI.js} +2268 -1354
- package/dist/bundle/{chunk-GA3URWIF.js → chunk-YVI5SQPY.js} +1 -1
- package/dist/bundle/{chunk-GSHTLLCJ.js → chunk-ZJIGVT6Z.js} +2 -2
- package/dist/bundle/{chunk-LPT5T6PU.js → chunk-ZRW3DF25.js} +24 -24
- package/dist/bundle/{chunk-66PL7P4C.js → chunk-ZZ32DXTH.js} +1 -1
- package/dist/bundle/command-contract-FRH7LBGE.js +37 -0
- package/dist/bundle/{command-server-entry-YR6ONDWO.js → command-server-entry-TM264M2J.js} +27 -27
- package/dist/bundle/{decode-VUKGWFSW.js → decode-RJFOSHCE.js} +5 -5
- package/dist/bundle/{dispatch-ST5FK2KI.js → dispatch-7OZP3X4O.js} +8 -8
- package/dist/bundle/{echarts-GOV5M733.js → echarts-PYKF4D7B.js} +2 -2
- package/dist/bundle/{embed-2IVIYNAJ.js → embed-JFN6Z5TG.js} +6 -6
- package/dist/bundle/{embedder-2HU7JYZK.js → embedder-WN54JIMY.js} +9 -9
- package/dist/bundle/{entry-CSTCXYI5.js → entry-Z6LO6N6S.js} +9 -9
- package/dist/bundle/{failure-GMUQKQ5K.js → failure-UONA2IA5.js} +2 -2
- package/dist/bundle/{first-run-3IZGXZT5.js → first-run-WQAKES7G.js} +12 -12
- package/dist/bundle/first-screen-4RFG22SA.js +35 -0
- package/dist/bundle/{instructions-YSXV6FAC.js → instructions-PR4BBBTM.js} +1 -1
- package/dist/bundle/{mcp-VFIOZDVY.js → mcp-O6ACR2DX.js} +2 -2
- package/dist/bundle/meeting-combined-MHWTZOF2.js +23 -0
- package/dist/bundle/{meeting-model-FQBDHGRU.js → meeting-model-YVTUOM4H.js} +11 -11
- package/dist/bundle/{meeting-semantic-ONNEOJX5.js → meeting-semantic-X4KG6RNV.js} +6 -6
- package/dist/bundle/{node-FMQWCZRS.js → node-OVS5LTVZ.js} +2 -2
- package/dist/bundle/{node-sqlite-YN5OKOC6.js → node-sqlite-LC44SM4Z.js} +7 -7
- package/dist/bundle/{oauth-EW7PTZVT.js → oauth-NSVUFQCW.js} +7 -7
- package/dist/bundle/{open-Q2RDY344.js → open-XN5SJFVY.js} +5 -5
- package/dist/bundle/{openai-STON6G3O.js → openai-WOYZHJNL.js} +15 -15
- package/dist/bundle/{process-OQUC2TW3.js → process-UFBRGTQC.js} +1 -1
- package/dist/bundle/{program-N5BT75OC.js → program-RAGBRRQH.js} +65 -65
- package/dist/bundle/{prompt-WHVF7UTW.js → prompt-6HAKBUQN.js} +5 -5
- package/dist/bundle/{proxy-transport-A4MRO3PF.js → proxy-transport-5EJVFUTC.js} +5 -5
- package/dist/bundle/{recognize-YDQWMXNI.js → recognize-CN5COBVJ.js} +4 -4
- package/dist/bundle/{remote-477LQHP6.js → remote-STX5AMGE.js} +9 -9
- package/dist/bundle/{rerank-4YPB26FG.js → rerank-ZCOWTXIJ.js} +7 -7
- package/dist/bundle/{serve-FXJNUOTS.js → serve-XMQEOIG2.js} +9 -9
- package/dist/bundle/{server-2S6HFBGR.js → server-PGGUD3DM.js} +44 -44
- package/dist/bundle/server-WTNYWCZ4.js +69 -0
- package/dist/bundle/{sqlite-runtime-RXYNJYMC.js → sqlite-runtime-PS4DSOIU.js} +6 -6
- package/dist/bundle/{state-I2GGYGRL.js → state-GL4ZC57O.js} +6 -6
- package/dist/bundle/{store-KX3AAQZH.js → store-HJ76TLWD.js} +19 -19
- package/dist/bundle/{store-VQXIB6KV.js → store-VISFXSHL.js} +17 -17
- package/dist/bundle/store-maintenance-command-SMARMN5C.js +60 -0
- package/dist/bundle/tg.js +13 -13
- 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 +3 -3
- 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/meeting-combined-X4E3LSIJ.js +0 -23
- package/dist/bundle/server-UOSUTZNE.js +0 -69
- package/dist/bundle/store-maintenance-command-LW2MMDLY.js +0 -60
- /package/dist/bundle/{chunk-ZI3YTXSF.js → chunk-VKE77B3F.js} +0 -0
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
plainQuery,
|
|
12
12
|
searchError,
|
|
13
13
|
tooWideTerm
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-CFWFESBO.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-BMI2NWFI.js";
|
|
25
25
|
import {
|
|
26
26
|
NORMALIZER_VERSION,
|
|
27
27
|
fold,
|
|
28
28
|
normalize
|
|
29
|
-
} from "./chunk-
|
|
29
|
+
} from "./chunk-FIUH52FE.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-UAFSDTID.js";
|
|
55
55
|
import {
|
|
56
56
|
quietSqliteWarning,
|
|
57
57
|
storeCapable
|
|
58
|
-
} from "./chunk-
|
|
58
|
+
} from "./chunk-OIRNHSAH.js";
|
|
59
59
|
import {
|
|
60
60
|
PRAGMAS,
|
|
61
61
|
TIME_LIMIT_FUNCTION,
|
|
62
62
|
TimeLimitReached,
|
|
63
63
|
isQueryOnly
|
|
64
|
-
} from "./chunk-
|
|
64
|
+
} from "./chunk-JMJOWT4N.js";
|
|
65
65
|
import {
|
|
66
66
|
ACCOUNT_GROUPS,
|
|
67
67
|
ADDED_ACCOUNT,
|
|
@@ -187,23 +187,24 @@ import {
|
|
|
187
187
|
usableLinkSql,
|
|
188
188
|
useStoredProviders,
|
|
189
189
|
walletLine
|
|
190
|
-
} from "./chunk-
|
|
190
|
+
} from "./chunk-KJICORS4.js";
|
|
191
191
|
import {
|
|
192
192
|
sqliteCode
|
|
193
|
-
} from "./chunk-
|
|
193
|
+
} from "./chunk-NWDADTPE.js";
|
|
194
194
|
import {
|
|
195
195
|
normalizeTag,
|
|
196
196
|
tagOf
|
|
197
|
-
} from "./chunk-
|
|
197
|
+
} from "./chunk-U7PHJSTX.js";
|
|
198
198
|
import {
|
|
199
199
|
DEFAULT_TASK_CATEGORIES,
|
|
200
200
|
sharedConfigPath,
|
|
201
201
|
storedTaskCategories,
|
|
202
202
|
taskCategoriesReader
|
|
203
|
-
} from "./chunk-
|
|
203
|
+
} from "./chunk-M2TV6BDB.js";
|
|
204
204
|
import {
|
|
205
205
|
CHAT_MESSAGES_READ,
|
|
206
206
|
FACT_TYPES,
|
|
207
|
+
MEETING_CALL_DIRECTIONS,
|
|
207
208
|
MEETING_DOCUMENT_ROLES,
|
|
208
209
|
MEETING_FIELD_NAMES,
|
|
209
210
|
MEETING_FINDINGS_KIND,
|
|
@@ -211,6 +212,7 @@ import {
|
|
|
211
212
|
OPERATORS_BY_TYPE,
|
|
212
213
|
READ_BUDGET_EXCEEDED,
|
|
213
214
|
REVIEW_LIMIT,
|
|
215
|
+
TRANSCRIPT_WORDS,
|
|
214
216
|
aggregateMeetingCounts,
|
|
215
217
|
aggregateMeetingStats,
|
|
216
218
|
calendarText,
|
|
@@ -254,11 +256,11 @@ import {
|
|
|
254
256
|
validateQuery,
|
|
255
257
|
walkQuery,
|
|
256
258
|
zonedMoment
|
|
257
|
-
} from "./chunk-
|
|
259
|
+
} from "./chunk-PG37E63A.js";
|
|
258
260
|
import {
|
|
259
261
|
refuseOwnerStoreInTests,
|
|
260
262
|
storePath
|
|
261
|
-
} from "./chunk-
|
|
263
|
+
} from "./chunk-FPSRT2TX.js";
|
|
262
264
|
import {
|
|
263
265
|
array,
|
|
264
266
|
boolean,
|
|
@@ -276,7 +278,7 @@ import {
|
|
|
276
278
|
safeParse,
|
|
277
279
|
strictObject,
|
|
278
280
|
string
|
|
279
|
-
} from "./chunk-
|
|
281
|
+
} from "./chunk-4EDJJQJI.js";
|
|
280
282
|
import {
|
|
281
283
|
resolveFrom
|
|
282
284
|
} from "./chunk-Y5E2WNWB.js";
|
|
@@ -284,7 +286,7 @@ import {
|
|
|
284
286
|
CliError,
|
|
285
287
|
isCliError,
|
|
286
288
|
singleLine
|
|
287
|
-
} from "./chunk-
|
|
289
|
+
} from "./chunk-5RDNBG7D.js";
|
|
288
290
|
import {
|
|
289
291
|
__commonJS,
|
|
290
292
|
__name,
|
|
@@ -10028,7 +10030,7 @@ var require_cjs = __commonJS({
|
|
|
10028
10030
|
}
|
|
10029
10031
|
});
|
|
10030
10032
|
|
|
10031
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
10033
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/account-store.js
|
|
10032
10034
|
var bindArea = /* @__PURE__ */ __name(({ keyed, whole }, account) => {
|
|
10033
10035
|
const methods = whole;
|
|
10034
10036
|
return Object.fromEntries(Object.keys(keyed).map((name) => [
|
|
@@ -10156,7 +10158,7 @@ var bindAccount = /* @__PURE__ */ __name((store, account, areas, owners) => {
|
|
|
10156
10158
|
};
|
|
10157
10159
|
}, "bindAccount");
|
|
10158
10160
|
|
|
10159
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
10161
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/drizzle/core.js
|
|
10160
10162
|
var IndexBuilderOn = class {
|
|
10161
10163
|
static {
|
|
10162
10164
|
__name(this, "IndexBuilderOn");
|
|
@@ -10351,7 +10353,7 @@ function alias(table, alias2) {
|
|
|
10351
10353
|
}
|
|
10352
10354
|
__name(alias, "alias");
|
|
10353
10355
|
|
|
10354
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
10356
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/domain/record-fields.js
|
|
10355
10357
|
var DECIMAL_PATTERN = "^[0-9]{1,16}(\\.[0-9]{1,6})?$";
|
|
10356
10358
|
var SIGNED_DECIMAL = "^-?[0-9]{1,16}(\\.[0-9]{1,6})?$";
|
|
10357
10359
|
var DAY = "^[0-9]{4}-[0-9]{2}-[0-9]{2}$";
|
|
@@ -10401,7 +10403,7 @@ var arrayOf = /* @__PURE__ */ __name((item, maxItems, description) => ({
|
|
|
10401
10403
|
}), "arrayOf");
|
|
10402
10404
|
var isObject = /* @__PURE__ */ __name((value) => typeof value === "object" && value !== null && !Array.isArray(value), "isObject");
|
|
10403
10405
|
|
|
10404
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
10406
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/domain/record-types.js
|
|
10405
10407
|
var kept = /* @__PURE__ */ __name((description) => ({ description }), "kept");
|
|
10406
10408
|
var PARTY = ["person", "organization"];
|
|
10407
10409
|
var ORGANIZATION = ["organization"];
|
|
@@ -10796,7 +10798,7 @@ var hasV1Roles = /* @__PURE__ */ __name((type) => rolesOf2(type).some(([, role])
|
|
|
10796
10798
|
var IDENTITY_TYPES = RECORD_ENTITY_TYPES.filter((type) => RECORD_TYPES[type].review === "identity");
|
|
10797
10799
|
var article = /* @__PURE__ */ __name((word2) => /^[aeiou]/.test(word2) ? "an" : "a", "article");
|
|
10798
10800
|
|
|
10799
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
10801
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/entity-types.js
|
|
10800
10802
|
var ENTITY_TABLES = {
|
|
10801
10803
|
...RECORD_TABLES,
|
|
10802
10804
|
account: "accounts",
|
|
@@ -10835,11 +10837,11 @@ var orphanPointers = /* @__PURE__ */ __name((database) => pointerPairs(database)
|
|
|
10835
10837
|
return { table, pointer, type, count: count2, known: known2 };
|
|
10836
10838
|
}).filter(({ count: count2 }) => count2 > 0)), "orphanPointers");
|
|
10837
10839
|
|
|
10838
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
10840
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/identity-links.js
|
|
10839
10841
|
var IDENTITY_LINK_KIND = "identity_link";
|
|
10840
10842
|
var IDENTITY_LINK_SIGNALS = ["agent", "phone", "email", "guest-email", "name", "account"];
|
|
10841
10843
|
|
|
10842
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
10844
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/merged-persons.js
|
|
10843
10845
|
var SEPARATIONS = ["unlink", "split", "undo-merge"];
|
|
10844
10846
|
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
10847
|
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 +10873,7 @@ var samePersons = /* @__PURE__ */ __name((database, pk) => {
|
|
|
10871
10873
|
}, "samePersons");
|
|
10872
10874
|
var idsOf = /* @__PURE__ */ __name((database, type, id2) => JSON.stringify(type === "person" ? samePersons(database, id2) : [id2]), "idsOf");
|
|
10873
10875
|
|
|
10874
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
10876
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/identity-link-rows.js
|
|
10875
10877
|
var pairOf = /* @__PURE__ */ __name((a, b) => [Number(a), Number(b)].sort((x, y) => x - y).join("-"), "pairOf");
|
|
10876
10878
|
var pkOf = /* @__PURE__ */ __name((database, ref3) => {
|
|
10877
10879
|
const at2 = ref3.indexOf(":");
|
|
@@ -10978,13 +10980,13 @@ var forgetErasedLinks = /* @__PURE__ */ __name((database) => {
|
|
|
10978
10980
|
database.prepare("DELETE FROM proposed_actions WHERE id = ?").run(Number(row2.id));
|
|
10979
10981
|
}, "forgetErasedLinks");
|
|
10980
10982
|
|
|
10981
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
10983
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/identity-splits.js
|
|
10982
10984
|
var IDENTITY_SPLIT_KIND = "identity_split";
|
|
10983
10985
|
|
|
10984
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
10986
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/mail-findings.js
|
|
10985
10987
|
var MAIL_FINDINGS_KIND = "mail_findings";
|
|
10986
10988
|
|
|
10987
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
10989
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/decisions.js
|
|
10988
10990
|
var TASK_CLOSE_KIND = "task_close";
|
|
10989
10991
|
var DEFAULT_DECISION_POLICY = { agentDecisions: false, ruleProposalsOwnerOnly: true };
|
|
10990
10992
|
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 +11034,7 @@ var assertMayDecide = /* @__PURE__ */ __name((row2, by, policy = DEFAULT_DECISIO
|
|
|
11032
11034
|
}, "assertMayDecide");
|
|
11033
11035
|
var deciderAuthor = /* @__PURE__ */ __name((by) => by === "owner" ? "owner" : { bot: by.bot, ...by.model === void 0 ? {} : { model: by.model } }, "deciderAuthor");
|
|
11034
11036
|
|
|
11035
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
11037
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/domain/addresses.js
|
|
11036
11038
|
var EMAIL_ADDRESS = /^[^\s@]+@[^\s@]+\.[^\s@]+$/u;
|
|
11037
11039
|
var isEmailAddress = /* @__PURE__ */ __name((value) => EMAIL_ADDRESS.test(value), "isEmailAddress");
|
|
11038
11040
|
var ROLE_ADDRESS_WORDS = {
|
|
@@ -11094,7 +11096,7 @@ var PERSON_LIKE = /* @__PURE__ */ new Set(["hr"]);
|
|
|
11094
11096
|
var isPersonLikeRoleAddress = /* @__PURE__ */ __name((address) => PERSON_LIKE.has(localWord(address)), "isPersonLikeRoleAddress");
|
|
11095
11097
|
var isNoReplyAddress = /* @__PURE__ */ __name((address) => NO_REPLY.has(localWord(address)), "isNoReplyAddress");
|
|
11096
11098
|
|
|
11097
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
11099
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/mail/score.js
|
|
11098
11100
|
var import_disposable_email_domains_js = __toESM(require_dist(), 1);
|
|
11099
11101
|
var import_tldts = __toESM(require_cjs(), 1);
|
|
11100
11102
|
var FREE_MAIL = /* @__PURE__ */ new Set([
|
|
@@ -11124,7 +11126,7 @@ var FREE_MAIL = /* @__PURE__ */ new Set([
|
|
|
11124
11126
|
]);
|
|
11125
11127
|
var DAY_MS = 24 * 60 * 60 * 1e3;
|
|
11126
11128
|
|
|
11127
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
11129
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/address-organization.js
|
|
11128
11130
|
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
11131
|
var idsOf2 = /* @__PURE__ */ __name((rows) => rows.map((row2) => Number(row2.id)), "idsOf");
|
|
11130
11132
|
var holdAddress = /* @__PURE__ */ __name(({ database, now: now2 }, organization2, email, { method, author }) => {
|
|
@@ -11149,7 +11151,7 @@ var organizationOfAddress = /* @__PURE__ */ __name((context, { name, email, meth
|
|
|
11149
11151
|
return id2;
|
|
11150
11152
|
}, "organizationOfAddress");
|
|
11151
11153
|
|
|
11152
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
11154
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/domain/phone-plans.generated.js
|
|
11153
11155
|
var PHONE_PLANS = [
|
|
11154
11156
|
{
|
|
11155
11157
|
country: "us",
|
|
@@ -11529,7 +11531,7 @@ var PHONE_PLANS = [
|
|
|
11529
11531
|
}
|
|
11530
11532
|
];
|
|
11531
11533
|
|
|
11532
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
11534
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/domain/phones.js
|
|
11533
11535
|
var PHONE_COUNTRIES = PHONE_PLANS.map((plan) => plan.country);
|
|
11534
11536
|
var DEFAULT_PHONE_COUNTRIES = ["ru"];
|
|
11535
11537
|
var parsePhoneCountries = /* @__PURE__ */ __name((value) => {
|
|
@@ -11604,10 +11606,10 @@ var storedPhone = /* @__PURE__ */ __name((raw, provider) => {
|
|
|
11604
11606
|
return found2 ? `+${found2[1]}` : void 0;
|
|
11605
11607
|
}, "storedPhone");
|
|
11606
11608
|
|
|
11607
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
11609
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/transaction.js
|
|
11608
11610
|
import { AsyncLocalStorage } from "node:async_hooks";
|
|
11609
11611
|
|
|
11610
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
11612
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/journal.js
|
|
11611
11613
|
import { existsSync, statSync } from "node:fs";
|
|
11612
11614
|
var watched = /* @__PURE__ */ new WeakMap();
|
|
11613
11615
|
var walInode = /* @__PURE__ */ __name((store) => statSync(`${store}-wal`, { throwIfNoEntry: false })?.ino, "walInode");
|
|
@@ -11633,7 +11635,7 @@ var checkJournal = /* @__PURE__ */ __name((database) => {
|
|
|
11633
11635
|
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
11636
|
}, "checkJournal");
|
|
11635
11637
|
|
|
11636
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
11638
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/write-events.js
|
|
11637
11639
|
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
11640
|
var writeTarget = /* @__PURE__ */ __name((sql2) => {
|
|
11639
11641
|
const match = WRITE.exec(sql2);
|
|
@@ -11713,7 +11715,7 @@ var committedWrites = /* @__PURE__ */ __name((database) => {
|
|
|
11713
11715
|
}, "committedWrites");
|
|
11714
11716
|
var droppedWrites = /* @__PURE__ */ __name((database) => tallies.get(database)?.pending.clear(), "droppedWrites");
|
|
11715
11717
|
|
|
11716
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
11718
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/involvement-queue.js
|
|
11717
11719
|
var ARMS = [
|
|
11718
11720
|
[
|
|
11719
11721
|
"message",
|
|
@@ -11841,7 +11843,7 @@ var drainInvolvementQueue = /* @__PURE__ */ __name((database, cap = QUEUE_CAP) =
|
|
|
11841
11843
|
return recomputed;
|
|
11842
11844
|
}, "drainInvolvementQueue");
|
|
11843
11845
|
|
|
11844
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
11846
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/domain/mentions.js
|
|
11845
11847
|
import { domainToUnicode } from "node:url";
|
|
11846
11848
|
|
|
11847
11849
|
// node_modules/.pnpm/psl@1.15.0/node_modules/psl/dist/psl.mjs
|
|
@@ -21863,7 +21865,7 @@ var oa = /* @__PURE__ */ __name((e) => {
|
|
|
21863
21865
|
}, "oa");
|
|
21864
21866
|
var na = { parse: O, get: aa, isValid: oa };
|
|
21865
21867
|
|
|
21866
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
21868
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/domain/google-documents.js
|
|
21867
21869
|
var LINK = /https?:\/\/(?:(?:docs|drive|sheets|slides)\.google\.com|forms\.gle)(?:[/?#][^\s<>"'`]*)?/gi;
|
|
21868
21870
|
var ID = /^[\w-]{10,}$/;
|
|
21869
21871
|
var trimUrl = /* @__PURE__ */ __name((url) => {
|
|
@@ -21905,7 +21907,7 @@ var googleDocumentLinks = /* @__PURE__ */ __name((text8) => [...text8.matchAll(L
|
|
|
21905
21907
|
return { url, documentId: googleDocumentId(url) };
|
|
21906
21908
|
}), "googleDocumentLinks");
|
|
21907
21909
|
|
|
21908
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
21910
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/domain/places.js
|
|
21909
21911
|
var BEFORE = [
|
|
21910
21912
|
[/^(?:ул\.?|улиц[аеыу]|улицей)$/iu, "\u0443\u043B\u0438\u0446\u0430"],
|
|
21911
21913
|
[/^(?:пр-т|просп\.?|проспект[аеу]?)$/iu, "\u043F\u0440\u043E\u0441\u043F\u0435\u043A\u0442"],
|
|
@@ -22165,7 +22167,7 @@ var findPlaces = /* @__PURE__ */ __name((text8) => {
|
|
|
22165
22167
|
return found2.sort((a, b) => a.start - b.start);
|
|
22166
22168
|
}, "findPlaces");
|
|
22167
22169
|
|
|
22168
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
22170
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/domain/mentions.js
|
|
22169
22171
|
var MENTION_KINDS = ["phone", "email", "url", "document", "person-name", "place"];
|
|
22170
22172
|
var MENTION_VERSIONS = {
|
|
22171
22173
|
phone: 1,
|
|
@@ -22341,7 +22343,7 @@ var exactlyOne = /* @__PURE__ */ __name((text8, options) => {
|
|
|
22341
22343
|
return one2 && one2.start === 0 && one2.end === text8.length ? one2.value : void 0;
|
|
22342
22344
|
}, "exactlyOne");
|
|
22343
22345
|
|
|
22344
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
22346
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/domain/first-names.js
|
|
22345
22347
|
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
22348
|
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
22349
|
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 +22351,7 @@ var NOT_NAMES = ["\u0436\u0435\u043D\u0430", "\u0436\u0435\u043D\u044B", "\u0436
|
|
|
22349
22351
|
var FIRST_NAMES = [...new Set(`${RUSSIAN} ${EUROPEAN}`.split(" "))];
|
|
22350
22352
|
var NAME_WORDS = WORDS.split(" ");
|
|
22351
22353
|
|
|
22352
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
22354
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/domain/person-names.js
|
|
22353
22355
|
var LATIN_TO_CYRILLIC = {
|
|
22354
22356
|
shch: "\u0449",
|
|
22355
22357
|
sch: "\u0449",
|
|
@@ -22557,7 +22559,7 @@ var findUnknownNames = /* @__PURE__ */ __name((text8, stem, taken) => {
|
|
|
22557
22559
|
return found2;
|
|
22558
22560
|
}, "findUnknownNames");
|
|
22559
22561
|
|
|
22560
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
22562
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/domain/attachments.js
|
|
22561
22563
|
var NOT_FILES = /* @__PURE__ */ new Set([
|
|
22562
22564
|
"webpage",
|
|
22563
22565
|
"share",
|
|
@@ -22598,7 +22600,7 @@ var matchDownloads = /* @__PURE__ */ __name((stored4, files2) => {
|
|
|
22598
22600
|
});
|
|
22599
22601
|
}, "matchDownloads");
|
|
22600
22602
|
|
|
22601
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
22603
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/search/lucene/automaton.js
|
|
22602
22604
|
var any = { kind: "char", ranges: [[0, 1114111]], negate: false };
|
|
22603
22605
|
var literal2 = /* @__PURE__ */ __name((c) => ({
|
|
22604
22606
|
kind: "char",
|
|
@@ -22899,7 +22901,7 @@ var foldRegex = /* @__PURE__ */ __name((pattern, span) => {
|
|
|
22899
22901
|
const chars = [...pattern.normalize("NFC")];
|
|
22900
22902
|
let out = "";
|
|
22901
22903
|
let at2 = 0;
|
|
22902
|
-
const
|
|
22904
|
+
const literal5 = /* @__PURE__ */ __name((c) => {
|
|
22903
22905
|
if (!/[\p{L}\p{N}\p{M}]/u.test(c))
|
|
22904
22906
|
return c;
|
|
22905
22907
|
const folded6 = fold(c);
|
|
@@ -22978,7 +22980,7 @@ var foldRegex = /* @__PURE__ */ __name((pattern, span) => {
|
|
|
22978
22980
|
if (next === void 0)
|
|
22979
22981
|
out += c;
|
|
22980
22982
|
else
|
|
22981
|
-
out += (next.codePointAt(0) ?? 0) < 128 ? `${c}${next}` :
|
|
22983
|
+
out += (next.codePointAt(0) ?? 0) < 128 ? `${c}${next}` : literal5(next);
|
|
22982
22984
|
} else if (c === '"') {
|
|
22983
22985
|
const end = chars.indexOf('"', at2);
|
|
22984
22986
|
if (end < 0) {
|
|
@@ -22993,12 +22995,12 @@ var foldRegex = /* @__PURE__ */ __name((pattern, span) => {
|
|
|
22993
22995
|
} else if (c === "[")
|
|
22994
22996
|
characterClass();
|
|
22995
22997
|
else
|
|
22996
|
-
out +=
|
|
22998
|
+
out += literal5(c);
|
|
22997
22999
|
}
|
|
22998
23000
|
return out;
|
|
22999
23001
|
}, "foldRegex");
|
|
23000
23002
|
|
|
23001
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
23003
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/search/lucene/presets.js
|
|
23002
23004
|
var PRESET_VERSION = 1;
|
|
23003
23005
|
var PRESETS = {
|
|
23004
23006
|
password: {
|
|
@@ -23052,12 +23054,12 @@ var PRESETS = {
|
|
|
23052
23054
|
}
|
|
23053
23055
|
};
|
|
23054
23056
|
|
|
23055
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
23057
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/search/lucene/resolved.js
|
|
23056
23058
|
var hasText = /* @__PURE__ */ __name((node) => node.kind === "predicate" ? node.field === "text" || node.field === "exact" : node.clauses.some(({ node: node2 }) => hasText(node2)), "hasText");
|
|
23057
23059
|
var isStemmed = /* @__PURE__ */ __name((node) => node.field === "text" && (node.operator === "term" || node.operator === "phrase") && node.value !== "", "isStemmed");
|
|
23058
23060
|
var hasStems = /* @__PURE__ */ __name((node) => node.kind === "predicate" ? isStemmed(node) : node.clauses.some(({ node: node2 }) => hasStems(node2)), "hasStems");
|
|
23059
23061
|
|
|
23060
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
23062
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/mention-links.js
|
|
23061
23063
|
var LIVE = "mn.kind = 'url' AND mn.status <> 'dismissed'";
|
|
23062
23064
|
var MAIL_ROWS = `SELECT mn.source_id FROM mentions mn WHERE mn.source_type = 'email' AND ${LIVE}`;
|
|
23063
23065
|
var linkMatch = /* @__PURE__ */ __name((field4, typed, mail, mentioned2) => {
|
|
@@ -23081,7 +23083,7 @@ var linkMatch = /* @__PURE__ */ __name((field4, typed, mail, mentioned2) => {
|
|
|
23081
23083
|
};
|
|
23082
23084
|
}, "linkMatch");
|
|
23083
23085
|
|
|
23084
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
23086
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/phone-countries.js
|
|
23085
23087
|
var SETTING = "phoneCountries";
|
|
23086
23088
|
var savedPhoneCountries = /* @__PURE__ */ __name((database) => {
|
|
23087
23089
|
const row2 = database.prepare("SELECT value FROM store_settings WHERE key = ?").get(SETTING);
|
|
@@ -23112,7 +23114,7 @@ var valueMatch = /* @__PURE__ */ __name((database, typed) => {
|
|
|
23112
23114
|
return { sql: "mn.value = ?", params: [phone?.value ?? normalizedValue(typed, { phoneCountries })] };
|
|
23113
23115
|
}, "valueMatch");
|
|
23114
23116
|
|
|
23115
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
23117
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/domain/vocabulary.js
|
|
23116
23118
|
var normalizeVocabularyName = /* @__PURE__ */ __name((input) => {
|
|
23117
23119
|
if (typeof input !== "string" || input.length > 200 || /[\p{Cc}\p{Cf}]/u.test(input))
|
|
23118
23120
|
throw new CliError("validation_error", "a vocabulary name takes 1\u2013200 characters without control characters");
|
|
@@ -23140,7 +23142,7 @@ var vocabularySimilarity = /* @__PURE__ */ __name((left, right) => {
|
|
|
23140
23142
|
return 2 * intersection2 / (aa2.size + bb.size);
|
|
23141
23143
|
}, "vocabularySimilarity");
|
|
23142
23144
|
|
|
23143
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
23145
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/tag-creation.js
|
|
23144
23146
|
import { createHash } from "node:crypto";
|
|
23145
23147
|
var folded2 = /* @__PURE__ */ __name((name) => {
|
|
23146
23148
|
try {
|
|
@@ -23206,7 +23208,7 @@ var guardTagCreation = /* @__PURE__ */ __name((context, name, kind3, by, options
|
|
|
23206
23208
|
});
|
|
23207
23209
|
}, "guardTagCreation");
|
|
23208
23210
|
|
|
23209
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
23211
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/domain/tag-redirects.js
|
|
23210
23212
|
var invalid = /* @__PURE__ */ __name((message3) => {
|
|
23211
23213
|
throw new CliError("validation_error", message3);
|
|
23212
23214
|
}, "invalid");
|
|
@@ -23283,7 +23285,7 @@ var createTagRedirectIndex = /* @__PURE__ */ __name((snapshot2) => {
|
|
|
23283
23285
|
};
|
|
23284
23286
|
}, "createTagRedirectIndex");
|
|
23285
23287
|
|
|
23286
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
23288
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/tag-resolution.js
|
|
23287
23289
|
var tagCanonicalId = /* @__PURE__ */ __name((database, id2) => {
|
|
23288
23290
|
const row2 = database.prepare("SELECT canonical_id FROM resolved_tags WHERE id=?").get(id2);
|
|
23289
23291
|
if (!row2)
|
|
@@ -23311,7 +23313,7 @@ var tagRedirectSnapshot = /* @__PURE__ */ __name((database) => {
|
|
|
23311
23313
|
return snapshot2;
|
|
23312
23314
|
}, "tagRedirectSnapshot");
|
|
23313
23315
|
|
|
23314
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
23316
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/task-keys.js
|
|
23315
23317
|
import { createHash as createHash2 } from "node:crypto";
|
|
23316
23318
|
var TASK_KEY_PREFIXES = {
|
|
23317
23319
|
question: "Q",
|
|
@@ -23339,7 +23341,7 @@ var taskAccountOf = /* @__PURE__ */ __name((database, rowId) => {
|
|
|
23339
23341
|
return row2 && String(row2.key) === inboxKey(String(row2.name)) ? String(row2.name) : void 0;
|
|
23340
23342
|
}, "taskAccountOf");
|
|
23341
23343
|
|
|
23342
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
23344
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/things.js
|
|
23343
23345
|
var storedThing = /* @__PURE__ */ __name((type, id2) => ({ type: String(type), id: Number(id2) }), "storedThing");
|
|
23344
23346
|
var REFERABLE = {
|
|
23345
23347
|
...Object.fromEntries(Object.entries(RECORD_TYPES).map(([type, { tombstone: tombstone2 }]) => [type, { tombstone: tombstone2 }])),
|
|
@@ -23412,6 +23414,10 @@ var emailThreadOf = /* @__PURE__ */ __name((database, account, thread) => {
|
|
|
23412
23414
|
const row2 = database.prepare("SELECT t.id FROM email_threads t JOIN accounts a ON a.id = t.account_id WHERE a.provider = 'email' AND a.external_id = ? AND t.external_id = ?").get(account, thread);
|
|
23413
23415
|
return row2 ? { type: "email_thread", id: Number(row2.id) } : void 0;
|
|
23414
23416
|
}, "emailThreadOf");
|
|
23417
|
+
var referenceUnlessOwner = /* @__PURE__ */ __name((database, thing) => {
|
|
23418
|
+
const owner = thing.type === "person" && database.prepare("SELECT owner FROM persons WHERE id = ?").get(thing.id)?.owner;
|
|
23419
|
+
return owner ? null : referenceOfThing(database, thing) ?? null;
|
|
23420
|
+
}, "referenceUnlessOwner");
|
|
23415
23421
|
var referenceOfThing = /* @__PURE__ */ __name((database, thing) => {
|
|
23416
23422
|
if (["meeting", "meeting_transcript", "meeting_transcript_row"].includes(thing.type)) {
|
|
23417
23423
|
const join5 = thing.type === "meeting" ? "FROM meetings m WHERE m.id=?" : thing.type === "meeting_transcript" ? "FROM meeting_transcripts t JOIN meetings m ON m.id=t.meeting_id WHERE t.id=?" : "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 r.id=?";
|
|
@@ -23499,7 +23505,7 @@ var taskIdOf = /* @__PURE__ */ __name((database, rowId) => {
|
|
|
23499
23505
|
return row2 ? String(row2.id ?? row2.key) : void 0;
|
|
23500
23506
|
}, "taskIdOf");
|
|
23501
23507
|
|
|
23502
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
23508
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/values.js
|
|
23503
23509
|
var toMs = /* @__PURE__ */ __name((iso17) => {
|
|
23504
23510
|
if (iso17 === null || iso17 === void 0)
|
|
23505
23511
|
return null;
|
|
@@ -23513,7 +23519,7 @@ var present = /* @__PURE__ */ __name((entries) => Object.fromEntries(Object.entr
|
|
|
23513
23519
|
var DELIVERY = { delivered: 1, read: 2 };
|
|
23514
23520
|
var deliveryOf = /* @__PURE__ */ __name((stored4) => stored4 === DELIVERY.read ? "read" : stored4 === DELIVERY.delivered ? "delivered" : void 0, "deliveryOf");
|
|
23515
23521
|
|
|
23516
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
23522
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/tags.js
|
|
23517
23523
|
var TAG_KINDS = ["tag", "topic"];
|
|
23518
23524
|
var TAGGABLE = { chat: "chat", contact: "identity", message: "message", task: "task" };
|
|
23519
23525
|
var TAG_TYPE = {
|
|
@@ -23716,7 +23722,7 @@ var tagsOf = /* @__PURE__ */ __name(({ database }, key2, filter) => {
|
|
|
23716
23722
|
return result;
|
|
23717
23723
|
}, "tagsOf");
|
|
23718
23724
|
|
|
23719
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
23725
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/trigram-match.js
|
|
23720
23726
|
var MOST_YO_SPELLINGS = 64;
|
|
23721
23727
|
var yoSpellings = /* @__PURE__ */ __name((run) => {
|
|
23722
23728
|
let spellings2 = [""];
|
|
@@ -23738,7 +23744,7 @@ var anyCaseGlob = /* @__PURE__ */ __name((word2) => `*${[...word2.normalize("NFC
|
|
|
23738
23744
|
return forms2.size === 1 ? c : `[${[...forms2].join("")}]`;
|
|
23739
23745
|
}).join("")}*`, "anyCaseGlob");
|
|
23740
23746
|
|
|
23741
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
23747
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/lucene-fields.js
|
|
23742
23748
|
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
23749
|
var SPEECH = speech("att");
|
|
23744
23750
|
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 +24230,7 @@ var FIELD_COMPILERS = {
|
|
|
24224
24230
|
subject
|
|
24225
24231
|
};
|
|
24226
24232
|
|
|
24227
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
24233
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/place-key.js
|
|
24228
24234
|
var placeOf = /* @__PURE__ */ __name((database) => {
|
|
24229
24235
|
const exact = database.prepare("SELECT id FROM places WHERE folded = ?");
|
|
24230
24236
|
const onStreet = database.prepare("SELECT id FROM places WHERE substr(folded, 1, ?) = ? LIMIT 2");
|
|
@@ -24240,7 +24246,7 @@ var placeOf = /* @__PURE__ */ __name((database) => {
|
|
|
24240
24246
|
};
|
|
24241
24247
|
}, "placeOf");
|
|
24242
24248
|
|
|
24243
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
24249
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/mention-drain.js
|
|
24244
24250
|
var DRAIN_ON_WRITE = 500;
|
|
24245
24251
|
var METHOD = "rules";
|
|
24246
24252
|
var telegramLink = /* @__PURE__ */ __name((database) => {
|
|
@@ -24406,7 +24412,7 @@ var drainMentions = /* @__PURE__ */ __name((database, now2, limit = DRAIN_ON_WRI
|
|
|
24406
24412
|
return queued.length;
|
|
24407
24413
|
}, "drainMentions");
|
|
24408
24414
|
|
|
24409
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
24415
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/index-state.js
|
|
24410
24416
|
var indexRow = /* @__PURE__ */ __name((database, name) => {
|
|
24411
24417
|
const exists2 = database.prepare("SELECT 1 FROM sqlite_master WHERE name = 'search_index_state'").get();
|
|
24412
24418
|
if (!exists2)
|
|
@@ -24414,7 +24420,7 @@ var indexRow = /* @__PURE__ */ __name((database, name) => {
|
|
|
24414
24420
|
return database.prepare("SELECT * FROM search_index_state WHERE name = ?").get(name);
|
|
24415
24421
|
}, "indexRow");
|
|
24416
24422
|
|
|
24417
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
24423
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/stems.js
|
|
24418
24424
|
var INDEX = "message_stems";
|
|
24419
24425
|
var SETTING2 = "searchStemmers";
|
|
24420
24426
|
var DRAIN_ON_WRITE2 = 500;
|
|
@@ -24536,7 +24542,7 @@ var stemmerCache = /* @__PURE__ */ __name(() => {
|
|
|
24536
24542
|
};
|
|
24537
24543
|
}, "stemmerCache");
|
|
24538
24544
|
|
|
24539
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
24545
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/transaction.js
|
|
24540
24546
|
var rehearsal = new AsyncLocalStorage();
|
|
24541
24547
|
var SQLITE_BUSY = 5;
|
|
24542
24548
|
var pause = new Int32Array(new SharedArrayBuffer(4));
|
|
@@ -24679,7 +24685,7 @@ var read = /* @__PURE__ */ __name((database, body2) => {
|
|
|
24679
24685
|
}
|
|
24680
24686
|
}, "read");
|
|
24681
24687
|
|
|
24682
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
24688
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/folded.js
|
|
24683
24689
|
var FOLDED = [
|
|
24684
24690
|
{ table: "tasks", column: "title" },
|
|
24685
24691
|
{ table: "tasks", column: "close_reason" },
|
|
@@ -24716,7 +24722,7 @@ var fillFolded = /* @__PURE__ */ __name((database, { batch = 2e3 } = {}) => {
|
|
|
24716
24722
|
return filled;
|
|
24717
24723
|
}, "fillFolded");
|
|
24718
24724
|
|
|
24719
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
24725
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/conversations/chunks.js
|
|
24720
24726
|
import { createHash as createHash3 } from "node:crypto";
|
|
24721
24727
|
var CHUNK_CHARS = 1200;
|
|
24722
24728
|
var CHUNK_OVERLAP = 150;
|
|
@@ -24821,7 +24827,7 @@ var cutChunks = /* @__PURE__ */ __name((members2, limit = CHUNK_CHARS, check3, c
|
|
|
24821
24827
|
return chunks2;
|
|
24822
24828
|
}, "cutChunks");
|
|
24823
24829
|
|
|
24824
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
24830
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/search/task-signature.js
|
|
24825
24831
|
var DAY2 = 864e5;
|
|
24826
24832
|
var CURRENCY = [
|
|
24827
24833
|
[/^(₽|руб.*|р\.?|rub)$/u, "RUB"],
|
|
@@ -24947,7 +24953,7 @@ var dueDayOf = /* @__PURE__ */ __name((text8, createdMs) => {
|
|
|
24947
24953
|
return best?.day ?? null;
|
|
24948
24954
|
}, "dueDayOf");
|
|
24949
24955
|
|
|
24950
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
24956
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/search/task-similarity.js
|
|
24951
24957
|
var DAY3 = 864e5;
|
|
24952
24958
|
var STOP_WORDS = new Set([
|
|
24953
24959
|
// Russian and English as the test set ran them, already folded (пожалуйста → пожалуиста).
|
|
@@ -25102,7 +25108,7 @@ var rankCandidates = /* @__PURE__ */ __name((views, candidates) => candidates.ma
|
|
|
25102
25108
|
...compareViews(subjectViews ?? views, candidate, replyChain === void 0 ? {} : { replyChain })
|
|
25103
25109
|
})).sort((a, b) => b.score - a.score), "rankCandidates");
|
|
25104
25110
|
|
|
25105
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
25111
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/vector-index.js
|
|
25106
25112
|
var source = /* @__PURE__ */ __name((model, dims) => `SELECT k.id, k.chunkable_type,
|
|
25107
25113
|
coalesce(CASE k.chunkable_type
|
|
25108
25114
|
WHEN 'image' THEN (SELECT ch.account_id FROM attachments a JOIN messages m ON m.id = a.attachable_id
|
|
@@ -25244,10 +25250,11 @@ var dropUnusedVectors = /* @__PURE__ */ __name((database, hashes) => {
|
|
|
25244
25250
|
}, "dropUnusedVectors");
|
|
25245
25251
|
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
25252
|
|
|
25247
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
25253
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/vectors.js
|
|
25248
25254
|
var currentChunks = /* @__PURE__ */ __name((chatKey) => sql`SELECT k.content_hash, k.chunkable_id AS conversation_id, r.first_message_id,
|
|
25249
|
-
r.last_message_id, r.text_start, r.text_end FROM
|
|
25250
|
-
JOIN
|
|
25255
|
+
r.last_message_id, r.text_start, r.text_end FROM conversations c
|
|
25256
|
+
CROSS JOIN chunks k ON k.chunkable_type = 'conversation' AND k.chunkable_id = c.id
|
|
25257
|
+
JOIN chunk_messages r ON r.chunk_id = k.id
|
|
25251
25258
|
WHERE c.chat_id = ${chatKey}
|
|
25252
25259
|
AND c.build = (SELECT s.current_build FROM conversation_state s WHERE s.chat_id = ${chatKey})`, "currentChunks");
|
|
25253
25260
|
var chunksToEmbed = /* @__PURE__ */ __name(({ orm }, chatKey, model, { after: after2, limit }) => {
|
|
@@ -25490,7 +25497,7 @@ var readiness = /* @__PURE__ */ __name(({ orm }, chatKey, model) => {
|
|
|
25490
25497
|
JOIN conversations c ON c.id = cm.conversation_id AND c.build = ${build}
|
|
25491
25498
|
WHERE m.chat_id = ${chatKey} AND (m.deleted_at IS NOT NULL OR ${editedSince(sql`m.id`)})),
|
|
25492
25499
|
stale AS (SELECT DISTINCT k.content_hash AS hash FROM changed g
|
|
25493
|
-
JOIN chunks k ON k.chunkable_type = 'conversation' AND k.chunkable_id = g.conversation_id
|
|
25500
|
+
CROSS JOIN chunks k ON k.chunkable_type = 'conversation' AND k.chunkable_id = g.conversation_id
|
|
25494
25501
|
JOIN chunk_messages r ON r.chunk_id = k.id
|
|
25495
25502
|
JOIN messages f ON f.id = r.first_message_id JOIN messages l ON l.id = r.last_message_id
|
|
25496
25503
|
WHERE (g.sent_at, g.id) >= (f.sent_at, f.id) AND (g.sent_at, g.id) <= (l.sent_at, l.id)),
|
|
@@ -25519,7 +25526,7 @@ var vectorCounts = /* @__PURE__ */ __name(({ orm }, models) => new Map(models.ma
|
|
|
25519
25526
|
Number(orm.get(sql`SELECT count(*) AS n FROM embeddings WHERE model = ${model}`)?.n ?? 0)
|
|
25520
25527
|
])), "vectorCounts");
|
|
25521
25528
|
|
|
25522
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
25529
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/document-pictures.js
|
|
25523
25530
|
var DOCUMENT_PICTURE = "document_picture";
|
|
25524
25531
|
var SCAN_PAGE2 = 5e3;
|
|
25525
25532
|
var idOf = /* @__PURE__ */ __name((ref3) => {
|
|
@@ -25582,12 +25589,12 @@ var documentPicturesOver = /* @__PURE__ */ __name(({ database, now: now2 }) => (
|
|
|
25582
25589
|
}, "nearestPictures")
|
|
25583
25590
|
}), "documentPicturesOver");
|
|
25584
25591
|
|
|
25585
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
25592
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/index-text.js
|
|
25586
25593
|
var noteIndexText = /* @__PURE__ */ __name((title2, text8) => title2 ? `${title2}
|
|
25587
25594
|
|
|
25588
25595
|
${text8}` : text8, "noteIndexText");
|
|
25589
25596
|
|
|
25590
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
25597
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/enrichments.js
|
|
25591
25598
|
var ENRICHMENT_SUBJECTS = ["document", "note", "email"];
|
|
25592
25599
|
var ENRICHMENT_POSITION = 1e6;
|
|
25593
25600
|
var EMAIL_ENRICHMENT = "email_enrichment";
|
|
@@ -25681,10 +25688,10 @@ var enrichmentsOver = /* @__PURE__ */ __name(({ database, now: now2 }) => ({
|
|
|
25681
25688
|
}), "clear")
|
|
25682
25689
|
}), "enrichmentsOver");
|
|
25683
25690
|
|
|
25684
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
25691
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/query-filter.js
|
|
25685
25692
|
var glob = /* @__PURE__ */ __name((value) => [...fold(value).matchAll(/\\(.)|([*?])|(.)/gsu)].map(([, escaped2, wildcard, plain2]) => {
|
|
25686
|
-
const
|
|
25687
|
-
return wildcard ?? (/[*?[]/u.test(
|
|
25693
|
+
const literal5 = escaped2 ?? plain2 ?? "";
|
|
25694
|
+
return wildcard ?? (/[*?[]/u.test(literal5) ? `[${literal5}]` : literal5);
|
|
25688
25695
|
}).join(""), "glob");
|
|
25689
25696
|
var foldedWords = /* @__PURE__ */ __name((column2) => ({
|
|
25690
25697
|
where: /* @__PURE__ */ __name((node) => {
|
|
@@ -25757,7 +25764,7 @@ var compile = /* @__PURE__ */ __name((node, columns2, options) => {
|
|
|
25757
25764
|
var queryFilter = /* @__PURE__ */ __name((ast, columns2, options) => compile(ast.root, columns2, options), "queryFilter");
|
|
25758
25765
|
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
25766
|
|
|
25760
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
25767
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/events.js
|
|
25761
25768
|
var toJson = /* @__PURE__ */ __name((value) => value === null || value === void 0 ? null : JSON.stringify(value), "toJson");
|
|
25762
25769
|
var fromJson = /* @__PURE__ */ __name((value) => value === null || value === void 0 ? null : JSON.parse(String(value)), "fromJson");
|
|
25763
25770
|
var int = /* @__PURE__ */ __name((value) => value === null || value === void 0 ? null : Number(value), "int");
|
|
@@ -25847,7 +25854,7 @@ var linkMeeting = /* @__PURE__ */ __name((database, id2, eventId, now2, mode = "
|
|
|
25847
25854
|
});
|
|
25848
25855
|
}, "linkMeeting");
|
|
25849
25856
|
|
|
25850
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
25857
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/task-titles.js
|
|
25851
25858
|
var MAX_TITLE = 120;
|
|
25852
25859
|
var placeholderTitleOf = /* @__PURE__ */ __name((row2) => `${String(row2.type)} \u2014 ${String(row2.source_locator ?? "")}`, "placeholderTitleOf");
|
|
25853
25860
|
var PLACEHOLDER_TITLE_SQL = "title = type || ' \u2014 ' || coalesce(source_locator, '')";
|
|
@@ -25909,7 +25916,7 @@ var fillFoundTaskTitles = /* @__PURE__ */ __name((database, warn, { batch = 500
|
|
|
25909
25916
|
}
|
|
25910
25917
|
}, "fillFoundTaskTitles");
|
|
25911
25918
|
|
|
25912
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
25919
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/note-index.js
|
|
25913
25920
|
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
25921
|
var UNSEARCHED_EVENT_TYPES = [
|
|
25915
25922
|
"working-location",
|
|
@@ -26156,7 +26163,7 @@ var resetNoteIndex = /* @__PURE__ */ __name((database) => {
|
|
|
26156
26163
|
return true;
|
|
26157
26164
|
}, "resetNoteIndex");
|
|
26158
26165
|
|
|
26159
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
26166
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/person-resolution.js
|
|
26160
26167
|
var keyOf2 = /* @__PURE__ */ __name((name) => fold(name).trim().replace(/^@/, ""), "keyOf");
|
|
26161
26168
|
var resolvePersonLinks = /* @__PURE__ */ __name((database, names) => {
|
|
26162
26169
|
for (const key2 of new Set(names.filter((name) => !!name?.trim()).map(keyOf2))) {
|
|
@@ -26175,7 +26182,7 @@ var resolvePersonLinks = /* @__PURE__ */ __name((database, names) => {
|
|
|
26175
26182
|
}
|
|
26176
26183
|
}, "resolvePersonLinks");
|
|
26177
26184
|
|
|
26178
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
26185
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/schema/canonical-tags.js
|
|
26179
26186
|
var canonicalTags = sqliteTable("canonical_tags", {
|
|
26180
26187
|
id: integer("id").primaryKey(),
|
|
26181
26188
|
name: text("name").notNull().unique(),
|
|
@@ -26184,7 +26191,7 @@ var canonicalTags = sqliteTable("canonical_tags", {
|
|
|
26184
26191
|
updatedAt: integer("updated_at").notNull()
|
|
26185
26192
|
});
|
|
26186
26193
|
|
|
26187
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
26194
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/schema/link-revisions.js
|
|
26188
26195
|
var linkRevisions = sqliteTable("link_revisions", {
|
|
26189
26196
|
id: integer("id").primaryKey(),
|
|
26190
26197
|
linkId: integer("link_id").notNull(),
|
|
@@ -26196,7 +26203,7 @@ var linkRevisions = sqliteTable("link_revisions", {
|
|
|
26196
26203
|
createdAt: integer("created_at").notNull()
|
|
26197
26204
|
}, (table) => [index("link_revisions_by_link_id_created_at").on(table.linkId, table.createdAt)]);
|
|
26198
26205
|
|
|
26199
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
26206
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/schema/document-transfers.js
|
|
26200
26207
|
var documentAnnotationTransfers = sqliteTable("document_annotation_transfers", {
|
|
26201
26208
|
sourceKey: text("source_key").notNull(),
|
|
26202
26209
|
collection: text("collection").notNull(),
|
|
@@ -26206,13 +26213,13 @@ var documentAnnotationTransfers = sqliteTable("document_annotation_transfers", {
|
|
|
26206
26213
|
createdAt: integer("created_at").notNull()
|
|
26207
26214
|
}, (table) => [primaryKey({ columns: [table.sourceKey, table.collection] })]);
|
|
26208
26215
|
|
|
26209
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
26216
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/schema/document-index-pending.js
|
|
26210
26217
|
var documentIndexPending = sqliteTable("document_index_pending", {
|
|
26211
26218
|
id: integer("id").notNull(),
|
|
26212
26219
|
indexableType: text("indexable_type").notNull()
|
|
26213
26220
|
}, (table) => [primaryKey({ columns: [table.indexableType, table.id] })]);
|
|
26214
26221
|
|
|
26215
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
26222
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/schema/decision-requests.js
|
|
26216
26223
|
var decisionRequests = sqliteTable("decision_requests", {
|
|
26217
26224
|
id: integer("id").primaryKey(),
|
|
26218
26225
|
tokenDigest: text("token_digest").notNull().unique(),
|
|
@@ -26232,7 +26239,7 @@ var decisionRequests = sqliteTable("decision_requests", {
|
|
|
26232
26239
|
index("decision_requests_by_channel_bot_profile_chat_id_message_id").on(table.channel, table.botProfile, table.chatId, table.messageId)
|
|
26233
26240
|
]);
|
|
26234
26241
|
|
|
26235
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
26242
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/schema/enrichments.js
|
|
26236
26243
|
var enrichments = sqliteTable("enrichments", {
|
|
26237
26244
|
subjectType: text("subject_type").notNull(),
|
|
26238
26245
|
subjectId: integer("subject_id").notNull(),
|
|
@@ -26244,7 +26251,7 @@ var enrichments = sqliteTable("enrichments", {
|
|
|
26244
26251
|
createdAt: integer("created_at").notNull()
|
|
26245
26252
|
}, (table) => [primaryKey({ columns: [table.subjectType, table.subjectId] })]);
|
|
26246
26253
|
|
|
26247
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
26254
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/schema/templates.js
|
|
26248
26255
|
var templates = sqliteTable("templates", {
|
|
26249
26256
|
key: text("key").notNull(),
|
|
26250
26257
|
channel: text("channel").notNull(),
|
|
@@ -26266,7 +26273,7 @@ var templatesHistory = sqliteTable("templates_history", {
|
|
|
26266
26273
|
index("templates_history_by_key_channel_language_id").on(table.key, table.channel, table.language, table.id)
|
|
26267
26274
|
]);
|
|
26268
26275
|
|
|
26269
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
26276
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/schema/links.js
|
|
26270
26277
|
var links = sqliteTable("links", {
|
|
26271
26278
|
id: integer("id").primaryKey(),
|
|
26272
26279
|
fromType: text("from_type").notNull(),
|
|
@@ -26297,7 +26304,7 @@ var links = sqliteTable("links", {
|
|
|
26297
26304
|
index("links_by_to_type_to_id").on(table.toType, table.toId)
|
|
26298
26305
|
]);
|
|
26299
26306
|
|
|
26300
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
26307
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/schema/tag-consolidations.js
|
|
26301
26308
|
var tagRedirects = sqliteTable("tag_redirects", {
|
|
26302
26309
|
sourceId: integer("source_id").primaryKey().references(() => canonicalTags.id),
|
|
26303
26310
|
survivorId: integer("survivor_id").notNull().references(() => canonicalTags.id),
|
|
@@ -26323,7 +26330,7 @@ var tagConsolidations = sqliteTable("tag_consolidations", {
|
|
|
26323
26330
|
index("tag_consolidations_by_actor_type_actor_id").on(table.actorType, table.actorId)
|
|
26324
26331
|
]);
|
|
26325
26332
|
|
|
26326
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
26333
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/schema.js
|
|
26327
26334
|
var accounts = sqliteTable("accounts", {
|
|
26328
26335
|
id: integer("id").primaryKey(),
|
|
26329
26336
|
provider: text("provider").notNull(),
|
|
@@ -27227,7 +27234,9 @@ var meetings = sqliteTable("meetings", {
|
|
|
27227
27234
|
updatedAt: integer("updated_at").notNull(),
|
|
27228
27235
|
deletedAt: integer("deleted_at"),
|
|
27229
27236
|
titleFolded: text("title_folded"),
|
|
27230
|
-
joinKey: text("join_key")
|
|
27237
|
+
joinKey: text("join_key"),
|
|
27238
|
+
direction: text("direction"),
|
|
27239
|
+
clientPhone: text("client_phone")
|
|
27231
27240
|
}, (table) => [
|
|
27232
27241
|
unique().on(table.accountId, table.externalId),
|
|
27233
27242
|
index("meetings_by_join_key").on(table.joinKey).where(sql`join_key IS NOT NULL`),
|
|
@@ -27532,6 +27541,15 @@ var facts = sqliteTable("facts", {
|
|
|
27532
27541
|
index("facts_by_author_type_author_id").on(table.authorType, table.authorId),
|
|
27533
27542
|
index("facts_by_confirmed_by_type_confirmed_by_id").on(table.confirmedByType, table.confirmedById)
|
|
27534
27543
|
]);
|
|
27544
|
+
var factRemovals = sqliteTable("fact_removals", {
|
|
27545
|
+
id: integer("id").primaryKey(),
|
|
27546
|
+
factId: integer("fact_id").notNull(),
|
|
27547
|
+
subject: text("subject"),
|
|
27548
|
+
removedBy: text("removed_by").notNull(),
|
|
27549
|
+
bot: text("bot"),
|
|
27550
|
+
reason: text("reason"),
|
|
27551
|
+
removedAt: integer("removed_at").notNull()
|
|
27552
|
+
}, (table) => [index("fact_removals_by_removed_at").on(table.removedAt)]);
|
|
27535
27553
|
var invoices = sqliteTable("invoices", {
|
|
27536
27554
|
id: integer("id").primaryKey(),
|
|
27537
27555
|
direction: text("direction").notNull(),
|
|
@@ -28333,7 +28351,7 @@ var storeSettings = sqliteTable("store_settings", {
|
|
|
28333
28351
|
at: integer("at").notNull()
|
|
28334
28352
|
});
|
|
28335
28353
|
|
|
28336
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
28354
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/identities.js
|
|
28337
28355
|
var contactsOf = /* @__PURE__ */ __name(({ phones: phones2, emails: emails3 }) => {
|
|
28338
28356
|
if (phones2 === void 0 && emails3 === void 0)
|
|
28339
28357
|
return void 0;
|
|
@@ -28579,7 +28597,7 @@ var meetingIdentityPk = /* @__PURE__ */ __name((context, accountId, identity) =>
|
|
|
28579
28597
|
}, "meetingIdentityPk");
|
|
28580
28598
|
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
28599
|
|
|
28582
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
28600
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/domain/ref-arguments.js
|
|
28583
28601
|
var TAKES = {
|
|
28584
28602
|
chat: "a chat: chat:<provider>/<account>/<chat>, its id or its title",
|
|
28585
28603
|
message: "a message: msg:<provider>/<account>/<chat>/<message>, or a chat and the message's id"
|
|
@@ -28639,7 +28657,7 @@ var ensureAccount = /* @__PURE__ */ __name(async (reference2, scope3, profilesOn
|
|
|
28639
28657
|
throw wrongAccount(reference2, scope3, profiles);
|
|
28640
28658
|
}, "ensureAccount");
|
|
28641
28659
|
|
|
28642
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
28660
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/search/trigrams.js
|
|
28643
28661
|
var trigrams = /* @__PURE__ */ __name((term) => {
|
|
28644
28662
|
const padded = ` ${term} `;
|
|
28645
28663
|
const pieces = /* @__PURE__ */ new Set();
|
|
@@ -28648,7 +28666,7 @@ var trigrams = /* @__PURE__ */ __name((term) => {
|
|
|
28648
28666
|
return [...pieces];
|
|
28649
28667
|
}, "trigrams");
|
|
28650
28668
|
|
|
28651
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
28669
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/resolve.js
|
|
28652
28670
|
var isId = /* @__PURE__ */ __name((reference2) => /^-?\d+$/.test(reference2.trim()), "isId");
|
|
28653
28671
|
var foldName = /* @__PURE__ */ __name((name) => name.normalize("NFC").replace(/[\uFE0E\uFE0F\u200D]/g, "").toLowerCase().replaceAll("\u0451", "\u0435"), "foldName");
|
|
28654
28672
|
var pickChat = /* @__PURE__ */ __name((reference2, chats2) => {
|
|
@@ -28719,7 +28737,7 @@ ${lines}`, { candidates });
|
|
|
28719
28737
|
}, "ambiguous");
|
|
28720
28738
|
var isPresent = /* @__PURE__ */ __name((value) => value !== null && value !== void 0, "isPresent");
|
|
28721
28739
|
|
|
28722
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
28740
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/domain/display-names.js
|
|
28723
28741
|
var QUOTES = [
|
|
28724
28742
|
['"', '"'],
|
|
28725
28743
|
["'", "'"],
|
|
@@ -28777,7 +28795,7 @@ var nameKey = /* @__PURE__ */ __name((name) => {
|
|
|
28777
28795
|
}, "nameKey");
|
|
28778
28796
|
var isReadable = /* @__PURE__ */ __name((shown2) => shown2 !== null && READABLE.test(shown2), "isReadable");
|
|
28779
28797
|
|
|
28780
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
28798
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/person-separation.js
|
|
28781
28799
|
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
28800
|
var MOVED_AWAY = `moved.identity_id IN (SELECT value FROM json_each(?))
|
|
28783
28801
|
AND (moved.from_person_id IN (SELECT value FROM json_each(?))
|
|
@@ -28792,7 +28810,7 @@ var apart = /* @__PURE__ */ __name(({ database }, one2, other) => {
|
|
|
28792
28810
|
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
28811
|
var identitySeparated = /* @__PURE__ */ __name((context, identity, person2) => apart(context, { identities: [identity] }, { identities: identitiesOf(context, person2).filter((pk) => pk !== identity), person: person2 }), "identitySeparated");
|
|
28794
28812
|
|
|
28795
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
28813
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/reads.js
|
|
28796
28814
|
var MESSAGE_FIELDS = {
|
|
28797
28815
|
pk: messages.id,
|
|
28798
28816
|
nativeId: messages.externalId,
|
|
@@ -28972,7 +28990,7 @@ var chatActivity = /* @__PURE__ */ __name(({ database }, accountKey, since, wher
|
|
|
28972
28990
|
storedAt: toIso(Number(database.prepare("SELECT max(created_at) AS at FROM messages WHERE account_id = ?").get(accountKey)?.at) || null)
|
|
28973
28991
|
}), "chatActivity");
|
|
28974
28992
|
|
|
28975
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
28993
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/search.js
|
|
28976
28994
|
var HIT_FIELDS = {
|
|
28977
28995
|
...MESSAGE_FIELDS,
|
|
28978
28996
|
chatTitle: sql`${chats.title}`.as("chat_title"),
|
|
@@ -29073,7 +29091,7 @@ var directReplies = /* @__PURE__ */ __name((context, parents, limit) => {
|
|
|
29073
29091
|
};
|
|
29074
29092
|
}, "directReplies");
|
|
29075
29093
|
|
|
29076
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
29094
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/person-links.js
|
|
29077
29095
|
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
29096
|
var required = /* @__PURE__ */ __name((context, ref3) => {
|
|
29079
29097
|
const found2 = identityRow(context, ref3);
|
|
@@ -29286,7 +29304,7 @@ var mentioning = /* @__PURE__ */ __name((context, accountKey, { id: id2, usernam
|
|
|
29286
29304
|
}, "mentioning");
|
|
29287
29305
|
var escaped = /* @__PURE__ */ __name((text8) => text8.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), "escaped");
|
|
29288
29306
|
|
|
29289
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
29307
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/actors.js
|
|
29290
29308
|
var BOT_KINDS = ["agent", "rule", "script", "integration"];
|
|
29291
29309
|
var ownerPerson = /* @__PURE__ */ __name((database) => {
|
|
29292
29310
|
const found2 = database.prepare("SELECT id FROM persons WHERE owner = 1 ORDER BY id LIMIT 1").get();
|
|
@@ -29343,7 +29361,7 @@ var proposedBySql = /* @__PURE__ */ __name((type, id2, by) => {
|
|
|
29343
29361
|
return { sql: bot("pb.name = ?"), params: [by.bot] };
|
|
29344
29362
|
}, "proposedBySql");
|
|
29345
29363
|
|
|
29346
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
29364
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/source-review-marks.js
|
|
29347
29365
|
var TABLES = { memory: "memories", fact: "facts" };
|
|
29348
29366
|
var HOLDING = { memory: ["proposed", "confirmed"], fact: ["proposed", "accepted"] };
|
|
29349
29367
|
var KEPT = 20;
|
|
@@ -29438,7 +29456,7 @@ var scrubSourceReviews = /* @__PURE__ */ __name((database, erased, { refs }) =>
|
|
|
29438
29456
|
return scrubbed;
|
|
29439
29457
|
}, "scrubSourceReviews");
|
|
29440
29458
|
|
|
29441
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
29459
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/evidence-signature.js
|
|
29442
29460
|
var QUOTE_LIMIT = 500;
|
|
29443
29461
|
var GONE = { sig: "gone", rev: null, deleted: true, changedAt: null };
|
|
29444
29462
|
var part = /* @__PURE__ */ __name((value) => value == null ? "" : String(value), "part");
|
|
@@ -29717,11 +29735,11 @@ var deleteDocumentRow = /* @__PURE__ */ __name((database, id2, at2) => {
|
|
|
29717
29735
|
database.prepare("DELETE FROM documents WHERE id = ?").run(id2);
|
|
29718
29736
|
}, "deleteDocumentRow");
|
|
29719
29737
|
|
|
29720
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
29738
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/domain/ref-summaries.js
|
|
29721
29739
|
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
29740
|
var oneLine = /* @__PURE__ */ __name((text8) => singleLine(text8.replace(/\s+/g, " ").trim()), "oneLine");
|
|
29723
29741
|
|
|
29724
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
29742
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/ref-accounts.js
|
|
29725
29743
|
var accountKeys = /* @__PURE__ */ __name((database, ids3) => {
|
|
29726
29744
|
const unique2 = [...new Set(ids3)];
|
|
29727
29745
|
if (unique2.length === 0)
|
|
@@ -29810,7 +29828,7 @@ var refEndsOf = /* @__PURE__ */ __name((database, text8) => {
|
|
|
29810
29828
|
}, "refEndsOf");
|
|
29811
29829
|
var refAccountsOf = /* @__PURE__ */ __name((database, text8) => refEndsOf(database, text8)?.flat(), "refAccountsOf");
|
|
29812
29830
|
|
|
29813
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
29831
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/ref-summaries.js
|
|
29814
29832
|
var EXCERPT_CHARS = 280;
|
|
29815
29833
|
var TITLE_CHARS = 120;
|
|
29816
29834
|
var MEMORY_TITLE_CHARS = 80;
|
|
@@ -30234,7 +30252,7 @@ var refsStoreOver = /* @__PURE__ */ __name((context) => ({
|
|
|
30234
30252
|
ends: /* @__PURE__ */ __name(async (text8) => refEndsOf(context.database, text8), "ends")
|
|
30235
30253
|
}), "refsStoreOver");
|
|
30236
30254
|
|
|
30237
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
30255
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/evidence-sources.js
|
|
30238
30256
|
var sourceOf3 = /* @__PURE__ */ __name((read2, ref3) => ({
|
|
30239
30257
|
ref: ref3,
|
|
30240
30258
|
kind: read2.kind,
|
|
@@ -30272,7 +30290,7 @@ var evidenceSourcesOf = /* @__PURE__ */ __name((database, from2) => {
|
|
|
30272
30290
|
});
|
|
30273
30291
|
}, "evidenceSourcesOf");
|
|
30274
30292
|
|
|
30275
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
30293
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/attachments/limits.js
|
|
30276
30294
|
var MAX_FILE_BYTES = 50 * 1024 * 1024;
|
|
30277
30295
|
var MAX_TEXT_CHARS = 2e6;
|
|
30278
30296
|
var ATTACHMENT_LIMIT_ENV = [
|
|
@@ -30298,7 +30316,7 @@ var pdfPreviewLimits = /* @__PURE__ */ __name((env = process.env) => {
|
|
|
30298
30316
|
return { pixels, bytes: positive(env, "MESSAGING_PDF_PREVIEW_MAX_MIB", 8 * 1024 * 1024, 1024 * 1024) };
|
|
30299
30317
|
}, "pdfPreviewLimits");
|
|
30300
30318
|
|
|
30301
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
30319
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/ulid.js
|
|
30302
30320
|
import { randomBytes } from "node:crypto";
|
|
30303
30321
|
var CROCKFORD = "0123456789ABCDEFGHJKMNPQRSTVWXYZ";
|
|
30304
30322
|
var ulid = /* @__PURE__ */ __name((now2 = Date.now()) => {
|
|
@@ -30311,7 +30329,7 @@ var ulid = /* @__PURE__ */ __name((now2 = Date.now()) => {
|
|
|
30311
30329
|
return time3 + random;
|
|
30312
30330
|
}, "ulid");
|
|
30313
30331
|
|
|
30314
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
30332
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/document-metadata.js
|
|
30315
30333
|
var FOLDED_FIELDS = ["title", "site", "language", "author"];
|
|
30316
30334
|
var encodeDocumentMetadata = /* @__PURE__ */ __name((meta, sections) => {
|
|
30317
30335
|
if (!meta && !sections?.length)
|
|
@@ -30332,11 +30350,11 @@ var languageOf = /* @__PURE__ */ __name((meta) => {
|
|
|
30332
30350
|
return typeof language === "string" && language !== "" ? language : null;
|
|
30333
30351
|
}, "languageOf");
|
|
30334
30352
|
|
|
30335
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
30353
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/file-note.js
|
|
30336
30354
|
var LIVE3 = "f.deleted_at IS NULL AND d.deleted_at IS NULL AND coalesce(json_extract(d.metadata, '$.catalog.active'), 1)=1";
|
|
30337
30355
|
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
30356
|
|
|
30339
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
30357
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/files.js
|
|
30340
30358
|
var isObject2 = /* @__PURE__ */ __name((value) => value !== null && typeof value === "object" && !Array.isArray(value), "isObject");
|
|
30341
30359
|
var objectOf2 = /* @__PURE__ */ __name((value) => {
|
|
30342
30360
|
if (isObject2(value))
|
|
@@ -30373,8 +30391,8 @@ var localFolder = /* @__PURE__ */ __name((database, now2, accountId, path) => {
|
|
|
30373
30391
|
var logFileLink = /* @__PURE__ */ __name((database, now2, fileId, from2, to, method = "import", author = "rules") => database.prepare("INSERT INTO entity_link_events (linkable_type, linkable_id, entity_type, from_entity_id, to_entity_id, method, confidence, author, created_at) VALUES ('file', ?, 'document', ?, ?, ?, 1, ?, ?)").run(fileId, from2 == null ? null : Number(from2), to, method, author, now2), "logFileLink");
|
|
30374
30392
|
var driveFileTarget = /* @__PURE__ */ __name((fileId) => `google-drive:${fileId}`, "driveFileTarget");
|
|
30375
30393
|
var driveDocumentOf = /* @__PURE__ */ __name((database, fileId) => {
|
|
30376
|
-
const
|
|
30377
|
-
return
|
|
30394
|
+
const row2 = database.prepare("SELECT MIN(f.document_id) AS id FROM files f JOIN accounts a ON a.id = f.account_id WHERE a.provider = 'google-drive' AND f.external_id = ? AND f.deleted_at IS NULL AND f.document_id IS NOT NULL").get(fileId);
|
|
30395
|
+
return row2?.id == null ? null : Number(row2.id);
|
|
30378
30396
|
}, "driveDocumentOf");
|
|
30379
30397
|
var linkAttached = /* @__PURE__ */ __name((database, now2, fileId) => {
|
|
30380
30398
|
const target = driveFileTarget(fileId);
|
|
@@ -30583,7 +30601,7 @@ var filesStoreOver = /* @__PURE__ */ __name(({ database, now: now2 }) => {
|
|
|
30583
30601
|
};
|
|
30584
30602
|
}, "filesStoreOver");
|
|
30585
30603
|
|
|
30586
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
30604
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/imported-documents.js
|
|
30587
30605
|
var IMPORTED_DOCUMENT_QUERY = defineQuery({
|
|
30588
30606
|
entity: "document",
|
|
30589
30607
|
backend: "sql",
|
|
@@ -30629,7 +30647,7 @@ var importedDocumentWhere = /* @__PURE__ */ __name((database, query) => {
|
|
|
30629
30647
|
return queryFilter(validateQuery(query, IMPORTED_DOCUMENT_QUERY), columns2, { zone: timezoneOf() });
|
|
30630
30648
|
}, "importedDocumentWhere");
|
|
30631
30649
|
|
|
30632
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
30650
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/link-reviews.js
|
|
30633
30651
|
var reviewLink = /* @__PURE__ */ __name((database, linkable, entity, candidates, reason, now2) => {
|
|
30634
30652
|
database.prepare(`INSERT INTO link_reviews (linkable_type, linkable_id, entity_type, candidates, reason, status, created_at, updated_at)
|
|
30635
30653
|
VALUES (?, ?, ?, ?, ?, 'open', ?, ?)
|
|
@@ -30637,7 +30655,7 @@ var reviewLink = /* @__PURE__ */ __name((database, linkable, entity, candidates,
|
|
|
30637
30655
|
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
30656
|
}, "reviewLink");
|
|
30639
30657
|
|
|
30640
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
30658
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/link-row.js
|
|
30641
30659
|
var iso3 = /* @__PURE__ */ __name((value) => new Date(Number(value)).toISOString(), "iso");
|
|
30642
30660
|
var thingRef = /* @__PURE__ */ __name((database, type, id2) => type == null || id2 == null ? null : referenceOfThing(database, storedThing(type, id2)) ?? null, "thingRef");
|
|
30643
30661
|
var hasBothEnds = /* @__PURE__ */ __name((link3) => link3.from !== null && link3.to !== null, "hasBothEnds");
|
|
@@ -30671,7 +30689,7 @@ var linkOf = /* @__PURE__ */ __name((database, row2) => {
|
|
|
30671
30689
|
};
|
|
30672
30690
|
}, "linkOf");
|
|
30673
30691
|
|
|
30674
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
30692
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/note-dates.js
|
|
30675
30693
|
var dateFileNotes = /* @__PURE__ */ __name((database, folder, dates) => {
|
|
30676
30694
|
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
30695
|
const legacy = database.prepare("SELECT id FROM documents WHERE account_id = ? AND external_id = ? AND deleted_at IS NULL");
|
|
@@ -30692,7 +30710,7 @@ var dateFileNotes = /* @__PURE__ */ __name((database, folder, dates) => {
|
|
|
30692
30710
|
return changed;
|
|
30693
30711
|
}, "dateFileNotes");
|
|
30694
30712
|
|
|
30695
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
30713
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/text-input.js
|
|
30696
30714
|
var textOf2 = /* @__PURE__ */ __name((text8, what, max = 1e5, allowEmpty = false) => {
|
|
30697
30715
|
const value = text8.trim();
|
|
30698
30716
|
if (!value && !allowEmpty || value.length > max)
|
|
@@ -30705,7 +30723,7 @@ var oneOf = /* @__PURE__ */ __name((value, allowed, what) => {
|
|
|
30705
30723
|
return value;
|
|
30706
30724
|
}, "oneOf");
|
|
30707
30725
|
|
|
30708
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
30726
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/notes.js
|
|
30709
30727
|
var NOTE_FORMATS = ["obsidian", "markdown"];
|
|
30710
30728
|
var RELATIONSHIPS = RELATION_KINDS.map(linkKind).join(", ");
|
|
30711
30729
|
var iso4 = /* @__PURE__ */ __name((value) => new Date(Number(value)).toISOString(), "iso");
|
|
@@ -30715,6 +30733,7 @@ var keepRevision = /* @__PURE__ */ __name((database, row2, at2) => database.prep
|
|
|
30715
30733
|
var documentOf = /* @__PURE__ */ __name((row2) => ({
|
|
30716
30734
|
id: String(row2.id),
|
|
30717
30735
|
ref: `document:${row2.id}`,
|
|
30736
|
+
subject: null,
|
|
30718
30737
|
source: "file",
|
|
30719
30738
|
folderId: String(row2.account_id),
|
|
30720
30739
|
path: String(row2.external_id),
|
|
@@ -30729,9 +30748,10 @@ var documentOf = /* @__PURE__ */ __name((row2) => ({
|
|
|
30729
30748
|
updatedAt: iso4(row2.updated_at),
|
|
30730
30749
|
deletedAt: optionalIso(row2.deleted_at)
|
|
30731
30750
|
}), "documentOf");
|
|
30732
|
-
var noteOf = /* @__PURE__ */ __name((row2) => ({
|
|
30751
|
+
var noteOf = /* @__PURE__ */ __name((row2, database) => ({
|
|
30733
30752
|
id: String(row2.id),
|
|
30734
30753
|
ref: `note:${row2.id}`,
|
|
30754
|
+
subject: referenceUnlessOwner(database, { type: String(row2.notable_type), id: Number(row2.notable_id) }),
|
|
30735
30755
|
source: "internal",
|
|
30736
30756
|
folderId: null,
|
|
30737
30757
|
path: null,
|
|
@@ -30751,7 +30771,7 @@ var noteRowOf = /* @__PURE__ */ __name((database, reference2) => {
|
|
|
30751
30771
|
if (thing?.type === "document")
|
|
30752
30772
|
return documentOf(database.prepare("SELECT * FROM documents WHERE id = ?").get(thing.id));
|
|
30753
30773
|
if (thing?.type === "note")
|
|
30754
|
-
return noteOf(database.prepare("SELECT * FROM notes WHERE id = ?").get(thing.id));
|
|
30774
|
+
return noteOf(database.prepare("SELECT * FROM notes WHERE id = ?").get(thing.id), database);
|
|
30755
30775
|
return void 0;
|
|
30756
30776
|
}, "noteRowOf");
|
|
30757
30777
|
var requiredThing = /* @__PURE__ */ __name((database, reference2, what = "the target") => {
|
|
@@ -31084,7 +31104,7 @@ var notesStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
31084
31104
|
const id2 = Number(row2?.id);
|
|
31085
31105
|
for (const reference2 of about.slice(1))
|
|
31086
31106
|
insertLink(context, { from: `note:${id2}`, to: reference2, kind: "about", origin: "owner" });
|
|
31087
|
-
return noteOf(noteRow(String(id2)));
|
|
31107
|
+
return noteOf(noteRow(String(id2)), database);
|
|
31088
31108
|
}), "addNote"),
|
|
31089
31109
|
note: /* @__PURE__ */ __name(async (reference2) => anyNote(reference2), "note"),
|
|
31090
31110
|
resolveNote: /* @__PURE__ */ __name(async (reference2) => {
|
|
@@ -31113,7 +31133,7 @@ var notesStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
31113
31133
|
// In a folder, a document is wherever one of its live files is, under that file's path.
|
|
31114
31134
|
(folder === null ? "SELECT d.* FROM documents d WHERE d.deleted_at IS NULL AND ? IS NULL AND ? IS NULL " : "SELECT d.*, f.account_id AS account_id, CASE WHEN a.provider IN ('local', 'obsidian') THEN f.external_id ELSE d.external_id END 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 JOIN accounts a ON a.id = f.account_id WHERE f.deleted_at IS NULL AND d.deleted_at IS NULL AND f.account_id = ? AND ? IS NOT NULL ") + `AND coalesce(json_extract(d.metadata, '$.catalog.active'), 1)=1 AND (? IS NULL OR EXISTS (SELECT 1 FROM links l WHERE l.from_type = 'document' AND l.from_id = d.id AND l.kind = ${linkKind("about")} AND l.to_type = ? AND l.to_id IN (SELECT value FROM json_each(?)))) ${documentText ? `AND ${documentText.sql} ` : ""}ORDER BY d.created_at DESC, d.id DESC LIMIT ?`
|
|
31115
31135
|
).all(folder, folder, aboutType, aboutType, aboutId, ...documentText?.params ?? [], limit + offset + 1).map(documentOf);
|
|
31116
|
-
const written = options.source === "file" || folder !== null ? [] : database.prepare(`SELECT n.* FROM notes n WHERE n.deleted_at IS NULL AND (? IS NULL OR (n.notable_type = ? AND n.notable_id IN (SELECT value FROM json_each(?))) OR EXISTS (SELECT 1 FROM links l WHERE l.from_type = 'note' AND l.from_id = n.id AND l.kind = ${linkKind("about")} AND l.to_type = ? AND l.to_id IN (SELECT value FROM json_each(?)))) ${noteText2 ? `AND ${noteText2.sql} ` : ""}ORDER BY n.created_at DESC, n.id DESC LIMIT ?`).all(aboutType, aboutType, aboutId, aboutType, aboutId, ...noteText2?.params ?? [], limit + offset + 1).map(noteOf);
|
|
31136
|
+
const written = options.source === "file" || folder !== null ? [] : database.prepare(`SELECT n.* FROM notes n WHERE n.deleted_at IS NULL AND (? IS NULL OR (n.notable_type = ? AND n.notable_id IN (SELECT value FROM json_each(?))) OR EXISTS (SELECT 1 FROM links l WHERE l.from_type = 'note' AND l.from_id = n.id AND l.kind = ${linkKind("about")} AND l.to_type = ? AND l.to_id IN (SELECT value FROM json_each(?)))) ${noteText2 ? `AND ${noteText2.sql} ` : ""}ORDER BY n.created_at DESC, n.id DESC LIMIT ?`).all(aboutType, aboutType, aboutId, aboutType, aboutId, ...noteText2?.params ?? [], limit + offset + 1).map((row2) => noteOf(row2, database));
|
|
31117
31137
|
const all2 = [...files2, ...written].sort((a, b) => b.createdAt.localeCompare(a.createdAt) || b.ref.localeCompare(a.ref));
|
|
31118
31138
|
return { items: all2.slice(offset, offset + limit), hasMore: all2.length > offset + limit };
|
|
31119
31139
|
}, "notes"),
|
|
@@ -31134,7 +31154,7 @@ var notesStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
31134
31154
|
if (!changed)
|
|
31135
31155
|
throw new CliError("validation_error", "the note changed; read its current revision before editing");
|
|
31136
31156
|
database.prepare("INSERT INTO note_revisions (note_id, body, revision, created_at) VALUES (?, ?, ?, ?)").run(Number(bare3), String(found2.body), revision2, now2());
|
|
31137
|
-
return noteOf(noteRow(bare3));
|
|
31157
|
+
return noteOf(noteRow(bare3), database);
|
|
31138
31158
|
}), "editNote"),
|
|
31139
31159
|
removeNote: /* @__PURE__ */ __name(async (id2) => write(database, () => {
|
|
31140
31160
|
if (id2.startsWith("document:"))
|
|
@@ -31225,10 +31245,10 @@ var notesStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
31225
31245
|
};
|
|
31226
31246
|
}, "notesStoreOver");
|
|
31227
31247
|
|
|
31228
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
31248
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/rows-page.js
|
|
31229
31249
|
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
31250
|
|
|
31231
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
31251
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/memories.js
|
|
31232
31252
|
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
31253
|
var iso5 = /* @__PURE__ */ __name((value) => new Date(Number(value)).toISOString(), "iso");
|
|
31234
31254
|
var oneOf2 = /* @__PURE__ */ __name((value, allowed, what) => {
|
|
@@ -31493,7 +31513,7 @@ var memoriesStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
31493
31513
|
};
|
|
31494
31514
|
}, "memoriesStoreOver");
|
|
31495
31515
|
|
|
31496
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
31516
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/reviewed.js
|
|
31497
31517
|
var prefixesText = /* @__PURE__ */ __name((types) => `${article(types[0] ?? "")} ${types.map((type) => `${type}:`).join(" or ")}`, "prefixesText");
|
|
31498
31518
|
var refuse = /* @__PURE__ */ __name((message3, reason, code = "validation_error") => {
|
|
31499
31519
|
throw new CliError(code, message3, { reason });
|
|
@@ -31641,7 +31661,7 @@ var reviewedRowsOver = /* @__PURE__ */ __name((context) => {
|
|
|
31641
31661
|
return { partyOf, partyThing, reviewedOf, written, keepEvidence, ownerOnly: ownerOnly2, linkedId, ...decisionsOver(context) };
|
|
31642
31662
|
}, "reviewedRowsOver");
|
|
31643
31663
|
|
|
31644
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
31664
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/money-lines.js
|
|
31645
31665
|
var MAX_LINES = 500;
|
|
31646
31666
|
var PARENTS = {
|
|
31647
31667
|
invoice: {
|
|
@@ -31741,7 +31761,7 @@ var moneyLinesOver = /* @__PURE__ */ __name(({ database }) => {
|
|
|
31741
31761
|
return { linesOf, insertLines, shownLines, appendLine, deleteLine, sumOf, retotal };
|
|
31742
31762
|
}, "moneyLinesOver");
|
|
31743
31763
|
|
|
31744
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
31764
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/refunds.js
|
|
31745
31765
|
var COUNTED = {
|
|
31746
31766
|
confirmed: "np.review = 'confirmed' AND np.deleted_at IS NULL",
|
|
31747
31767
|
// A proposed refund promises nothing back yet, so it must not free room an import could then fill.
|
|
@@ -31816,7 +31836,7 @@ var refundRulesOver = /* @__PURE__ */ __name((context) => {
|
|
|
31816
31836
|
return { originalFor, refundShare, confirmable, keepsRefunded, keepsShare, keepsInvoice };
|
|
31817
31837
|
}, "refundRulesOver");
|
|
31818
31838
|
|
|
31819
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
31839
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/finance.js
|
|
31820
31840
|
var FINANCE_TYPES = ["invoice", "payment"];
|
|
31821
31841
|
var isFinanceType = /* @__PURE__ */ __name((type) => FINANCE_TYPES.includes(type), "isFinanceType");
|
|
31822
31842
|
var PAID = netPaidSql("i.id");
|
|
@@ -32220,7 +32240,7 @@ var financeStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
32220
32240
|
};
|
|
32221
32241
|
}, "financeStoreOver");
|
|
32222
32242
|
|
|
32223
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
32243
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/payment-entries.js
|
|
32224
32244
|
var refuse2 = /* @__PURE__ */ __name((message3, reason) => {
|
|
32225
32245
|
throw new CliError("validation_error", message3, { reason });
|
|
32226
32246
|
}, "refuse");
|
|
@@ -32298,7 +32318,7 @@ var paymentEntriesOver = /* @__PURE__ */ __name((context) => {
|
|
|
32298
32318
|
};
|
|
32299
32319
|
}, "paymentEntriesOver");
|
|
32300
32320
|
|
|
32301
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
32321
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/evidence-findings.js
|
|
32302
32322
|
var EVIDENCE_FINDINGS_KIND = "evidence_findings";
|
|
32303
32323
|
var reference = /* @__PURE__ */ __name((raw) => {
|
|
32304
32324
|
if (/^(document|note):[1-9]\d*$/.test(raw))
|
|
@@ -32325,7 +32345,7 @@ var validateEvidenceFindings = /* @__PURE__ */ __name((input) => {
|
|
|
32325
32345
|
return valid;
|
|
32326
32346
|
}, "validateEvidenceFindings");
|
|
32327
32347
|
|
|
32328
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
32348
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/proposed-actions.js
|
|
32329
32349
|
var PROPOSAL_STATUSES = ["proposed", "approved", "rejected", "executed", "failed"];
|
|
32330
32350
|
var PROPOSAL_VERDICTS = ["useful", "not_useful"];
|
|
32331
32351
|
var iso7 = /* @__PURE__ */ __name((value) => value == null ? null : new Date(Number(value)).toISOString(), "iso");
|
|
@@ -32519,7 +32539,7 @@ var proposedActionsStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
32519
32539
|
};
|
|
32520
32540
|
}, "proposedActionsStoreOver");
|
|
32521
32541
|
|
|
32522
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
32542
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/identity-proposals.js
|
|
32523
32543
|
var CONFIRMED = "proposal";
|
|
32524
32544
|
var refOf = /* @__PURE__ */ __name(({ database }, pk) => {
|
|
32525
32545
|
const row2 = database.prepare("SELECT provider, external_id FROM identities WHERE id = ?").get(pk);
|
|
@@ -32869,7 +32889,7 @@ var identityLinkRows = /* @__PURE__ */ __name((context, { person: person2, statu
|
|
|
32869
32889
|
return { items, hasMore: rows.length > limit };
|
|
32870
32890
|
}, "identityLinkRows");
|
|
32871
32891
|
|
|
32872
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
32892
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/person-merges.js
|
|
32873
32893
|
var mergeId = /* @__PURE__ */ __name((to, from2) => `merge:${to}-${from2}`, "mergeId");
|
|
32874
32894
|
var parseMergeId = /* @__PURE__ */ __name((id2) => {
|
|
32875
32895
|
const found2 = /^merge:([1-9]\d*)-([1-9]\d*)$/.exec(id2.trim());
|
|
@@ -32972,7 +32992,7 @@ var split = /* @__PURE__ */ __name((context, uid, refs, by) => {
|
|
|
32972
32992
|
return recordOf(context, alone);
|
|
32973
32993
|
}, "split");
|
|
32974
32994
|
|
|
32975
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
32995
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/identity-split-proposals.js
|
|
32976
32996
|
var refOf2 = /* @__PURE__ */ __name(({ provider, id: id2 }) => `${provider}:${id2}`, "refOf");
|
|
32977
32997
|
var keyOf3 = /* @__PURE__ */ __name((split2, person2, identities2) => `${split2} ${person2} ${[...identities2].sort().join(" ")}`, "keyOf");
|
|
32978
32998
|
var planOf = /* @__PURE__ */ __name((context, input) => {
|
|
@@ -33149,7 +33169,7 @@ var forgetErasedSplits = /* @__PURE__ */ __name((database) => {
|
|
|
33149
33169
|
database.prepare("DELETE FROM proposed_actions WHERE id = ?").run(Number(row2.id));
|
|
33150
33170
|
}, "forgetErasedSplits");
|
|
33151
33171
|
|
|
33152
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
33172
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/domain/test-data.js
|
|
33153
33173
|
var SEED_PEOPLE = [
|
|
33154
33174
|
{ name: "Owner", username: "owner" },
|
|
33155
33175
|
{ name: "Ann Lee", username: "ann" },
|
|
@@ -33166,7 +33186,7 @@ var RESERVED_ADDRESS_GLOBS = [
|
|
|
33166
33186
|
];
|
|
33167
33187
|
var SEED_ID_GLOBS = ["person-[0-9]*"];
|
|
33168
33188
|
|
|
33169
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
33189
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/test-people.js
|
|
33170
33190
|
var TEST_DATA_KIND = "test_data";
|
|
33171
33191
|
var globs = /* @__PURE__ */ __name((column2, patterns) => patterns.map((pattern) => `${column2} GLOB '${pattern}'`).join(" OR "), "globs");
|
|
33172
33192
|
var SURE = `(${globs("i.external_id", SEED_ID_GLOBS)} OR ${globs("lower(i.email)", RESERVED_ADDRESS_GLOBS)})`;
|
|
@@ -33235,7 +33255,7 @@ var forgetErasedTestData = /* @__PURE__ */ __name((database) => {
|
|
|
33235
33255
|
database.prepare("DELETE FROM proposed_actions WHERE id = ?").run(Number(row2.id));
|
|
33236
33256
|
}, "forgetErasedTestData");
|
|
33237
33257
|
|
|
33238
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
33258
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/accounts.js
|
|
33239
33259
|
var accountPk = /* @__PURE__ */ __name(({ orm, now: now2 }, { provider, account, scope: scope3 }, name = null, startScope) => Number(orm.insert(accounts).values({
|
|
33240
33260
|
provider,
|
|
33241
33261
|
externalId: account,
|
|
@@ -33329,7 +33349,7 @@ var dropOrphanPeople = /* @__PURE__ */ __name((database, unseenBefore) => {
|
|
|
33329
33349
|
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
33350
|
}, "dropOrphanPeople");
|
|
33331
33351
|
|
|
33332
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
33352
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/history-skips.js
|
|
33333
33353
|
var HISTORY_KEY = "$history";
|
|
33334
33354
|
var objectOf3 = /* @__PURE__ */ __name((text8) => {
|
|
33335
33355
|
if (typeof text8 !== "string")
|
|
@@ -33405,7 +33425,7 @@ var withoutHistory = /* @__PURE__ */ __name((metadata3) => {
|
|
|
33405
33425
|
return rest;
|
|
33406
33426
|
}, "withoutHistory");
|
|
33407
33427
|
|
|
33408
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
33428
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/chats.js
|
|
33409
33429
|
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
33430
|
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
33431
|
var setChatScope = /* @__PURE__ */ __name((context, accountKey, chatId, scope3) => {
|
|
@@ -33703,7 +33723,7 @@ var replaceAutoTags = /* @__PURE__ */ __name((context, key2, chatId, algorithm,
|
|
|
33703
33723
|
}
|
|
33704
33724
|
}, "replaceAutoTags");
|
|
33705
33725
|
|
|
33706
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
33726
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/domain/counters.js
|
|
33707
33727
|
var COUNTER_FIELDS = ["views", "reactions", "comments"];
|
|
33708
33728
|
var validCounter = /* @__PURE__ */ __name((value) => typeof value === "number" && Number.isFinite(value) && value >= 0, "validCounter");
|
|
33709
33729
|
var counterValue = /* @__PURE__ */ __name((message3, field4) => {
|
|
@@ -33740,7 +33760,7 @@ var counterFreshness = /* @__PURE__ */ __name((states) => {
|
|
|
33740
33760
|
return states.some((one2) => one2.freshness === "stale") ? "stale" : "fresh";
|
|
33741
33761
|
}, "counterFreshness");
|
|
33742
33762
|
|
|
33743
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
33763
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/bot-tokens.js
|
|
33744
33764
|
var BOT_TOKEN = /(?<!\d)(\d{6,12}):[A-Za-z0-9_-]{30,40}(?![A-Za-z0-9_-])/g;
|
|
33745
33765
|
var MAY_HOLD = "*[0-9][0-9][0-9][0-9][0-9][0-9]:*";
|
|
33746
33766
|
var MASKED_THROUGH = "bot_tokens_masked_through";
|
|
@@ -33780,7 +33800,7 @@ var maskStoredBotTokens = /* @__PURE__ */ __name((context) => {
|
|
|
33780
33800
|
}, "maskStoredBotTokens");
|
|
33781
33801
|
var masks = /* @__PURE__ */ __name((value) => value != null && withoutBotTokens(String(value)) !== value, "masks");
|
|
33782
33802
|
|
|
33783
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
33803
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/context/evidence.js
|
|
33784
33804
|
import { createHash as createHash4 } from "node:crypto";
|
|
33785
33805
|
var CONTEXT_MAX_READ_BYTES = 262144;
|
|
33786
33806
|
var CONTEXT_SOURCE_KINDS = ["message", "mail", "document", "meeting"];
|
|
@@ -33878,7 +33898,7 @@ var contextEvidenceRequest = /* @__PURE__ */ __name((input) => {
|
|
|
33878
33898
|
return { source: source2, query, chat: chat2, senders, words: words4, after: after2, before: before2, limit, maxReadBytes, cursor, signal: input.signal };
|
|
33879
33899
|
}, "contextEvidenceRequest");
|
|
33880
33900
|
|
|
33881
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
33901
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/email-activity.js
|
|
33882
33902
|
var MAIL_AGENDA_COLUMNS = { chat_kind: { type: "enum", sql: "'dialog'" } };
|
|
33883
33903
|
var ACTIVITY = `
|
|
33884
33904
|
SELECT t.external_id AS thread, t.subject, t.last_email_at, t.emails_count,
|
|
@@ -34008,7 +34028,7 @@ var mailActivity = /* @__PURE__ */ __name((database) => ({
|
|
|
34008
34028
|
threadActivity: /* @__PURE__ */ __name(async (accountId, since, where) => threadActivity(database, accountId, since, where), "threadActivity")
|
|
34009
34029
|
}), "mailActivity");
|
|
34010
34030
|
|
|
34011
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34031
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/conversations/mail-text.js
|
|
34012
34032
|
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
34033
|
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
34034
|
var ATTRIBUTION = /(wrote|написал[аи]?|escribió|a écrit|schrieb)\s*:\s*$/iu;
|
|
@@ -34081,15 +34101,15 @@ var mailCore = /* @__PURE__ */ __name((body2, earlier) => {
|
|
|
34081
34101
|
const lines = body2.replace(/\r\n?/g, "\n").split("\n");
|
|
34082
34102
|
const held = earlier.map(flat2);
|
|
34083
34103
|
const drop = /* @__PURE__ */ new Set();
|
|
34084
|
-
for (const { start, end, quoted:
|
|
34085
|
-
if (alreadyHeld(
|
|
34104
|
+
for (const { start, end, quoted: quoted6 } of quoteBlocks(lines))
|
|
34105
|
+
if (alreadyHeld(quoted6, held))
|
|
34086
34106
|
for (let i = start; i < end; i++)
|
|
34087
34107
|
drop.add(i);
|
|
34088
34108
|
const kept2 = trimEdges(lines.filter((_, i) => !drop.has(i)));
|
|
34089
34109
|
return withoutSignOff(withoutGreeting(kept2)).join("\n").trim();
|
|
34090
34110
|
}, "mailCore");
|
|
34091
34111
|
|
|
34092
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34112
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/email-index.js
|
|
34093
34113
|
var titleOf2 = /* @__PURE__ */ __name((subject2) => subject2?.replace(/^\s*((re|fwd?|aw|wg)\s*:\s*)+/i, "").trim() || null, "titleOf");
|
|
34094
34114
|
var MAIL_PIECES = `(SELECT k.id, k.content_hash, k.chunkable_type AS type, k.chunkable_id AS owner, k.position,
|
|
34095
34115
|
k.start_offset, k.end_offset, k.account_id, k.occurred_at,
|
|
@@ -34202,7 +34222,7 @@ var drainEmailIndex = /* @__PURE__ */ __name((database, stemmerFor2) => {
|
|
|
34202
34222
|
return emails3 + threads;
|
|
34203
34223
|
}, "drainEmailIndex");
|
|
34204
34224
|
|
|
34205
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34225
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/email-locations.js
|
|
34206
34226
|
var locate = /* @__PURE__ */ __name((database, accountId, emailId, where) => database.prepare(`INSERT OR REPLACE INTO email_locations (mailbox_id, uidvalidity, uid, email_id)
|
|
34207
34227
|
SELECT id, ?, ?, ? FROM mailboxes WHERE account_id = ? AND external_id = ?`).run(where.uidvalidity, where.uid, emailId, accountId, where.folder), "locate");
|
|
34208
34228
|
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 +34320,7 @@ var forgetLocations = /* @__PURE__ */ __name((database, accountId, folder, uidva
|
|
|
34300
34320
|
var backfillSentAt = /* @__PURE__ */ __name((database, accountId, limit) => Number(database.prepare(`UPDATE emails SET sent_at = received_at WHERE id IN (
|
|
34301
34321
|
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
34322
|
|
|
34303
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34323
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/email-state.js
|
|
34304
34324
|
var recountEmailThread = /* @__PURE__ */ __name((database, threadId, now2) => database.prepare(`UPDATE email_threads SET
|
|
34305
34325
|
emails_count = (SELECT count(*) FROM emails WHERE email_thread_id = ? AND deleted_at IS NULL),
|
|
34306
34326
|
last_email_at = (SELECT max(coalesce(sent_at, received_at)) FROM emails
|
|
@@ -34350,7 +34370,7 @@ var markEmailsRestored = /* @__PURE__ */ __name((database, accountId, externalId
|
|
|
34350
34370
|
return threads.length;
|
|
34351
34371
|
}, "markEmailsRestored");
|
|
34352
34372
|
|
|
34353
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34373
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/mail-nearest.js
|
|
34354
34374
|
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
34375
|
FROM ${MAIL_PIECES} JOIN embeddings v ON v.model = ? AND v.content_hash = p.content_hash
|
|
34356
34376
|
WHERE p.account_id = ?
|
|
@@ -34410,7 +34430,7 @@ var indexedMailPieces = /* @__PURE__ */ __name((database, model, query, filter,
|
|
|
34410
34430
|
}, "indexedMailPieces");
|
|
34411
34431
|
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
34432
|
|
|
34413
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34433
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/mail-rules.js
|
|
34414
34434
|
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
34435
|
var conditionsKey = /* @__PURE__ */ __name((conditions) => JSON.stringify(sorted(conditions)), "conditionsKey");
|
|
34416
34436
|
var ruleOf = /* @__PURE__ */ __name((row2) => ({
|
|
@@ -34477,7 +34497,7 @@ var mailRulesOver = /* @__PURE__ */ __name((database) => ({
|
|
|
34477
34497
|
}
|
|
34478
34498
|
}), "mailRulesOver");
|
|
34479
34499
|
|
|
34480
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34500
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-operation.js
|
|
34481
34501
|
function checkMeetingCancelled(signal) {
|
|
34482
34502
|
if (!signal?.aborted)
|
|
34483
34503
|
return;
|
|
@@ -34488,8 +34508,22 @@ function checkMeetingCancelled(signal) {
|
|
|
34488
34508
|
}
|
|
34489
34509
|
__name(checkMeetingCancelled, "checkMeetingCancelled");
|
|
34490
34510
|
|
|
34491
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34492
|
-
var
|
|
34511
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-values.js
|
|
34512
|
+
var managerOf = /* @__PURE__ */ __name((database, meetingId) => {
|
|
34513
|
+
const found2 = database.prepare("SELECT p.display_name, i.name, l.person_id FROM meeting_participants p JOIN identities i ON i.id = p.identity_id LEFT JOIN identity_links l ON l.identity_id = p.identity_id WHERE p.meeting_id = ? AND p.role = 'manager' ORDER BY p.id LIMIT 1").get(meetingId);
|
|
34514
|
+
if (!found2)
|
|
34515
|
+
return null;
|
|
34516
|
+
return {
|
|
34517
|
+
name: str(found2.display_name) ?? str(found2.name),
|
|
34518
|
+
person: found2.person_id == null ? null : `person:${found2.person_id}`
|
|
34519
|
+
};
|
|
34520
|
+
}, "managerOf");
|
|
34521
|
+
var callOf = /* @__PURE__ */ __name((database, row2) => row2.direction == null && row2.client_phone == null ? {} : {
|
|
34522
|
+
direction: str(row2.direction),
|
|
34523
|
+
clientPhone: str(row2.client_phone),
|
|
34524
|
+
manager: managerOf(database, Number(row2.id))
|
|
34525
|
+
}, "callOf");
|
|
34526
|
+
var meetingOf = /* @__PURE__ */ __name((database, row2) => ({
|
|
34493
34527
|
id: Number(row2.id),
|
|
34494
34528
|
accountId: Number(row2.account_id),
|
|
34495
34529
|
meetingSeriesId: int(row2.meeting_series_id),
|
|
@@ -34507,6 +34541,7 @@ var meetingOf = /* @__PURE__ */ __name((row2) => ({
|
|
|
34507
34541
|
participantsCount: int(row2.participants_count),
|
|
34508
34542
|
metadata: fromJson(row2.metadata),
|
|
34509
34543
|
deletedAt: int(row2.deleted_at),
|
|
34544
|
+
...callOf(database, row2),
|
|
34510
34545
|
createdAt: Number(row2.created_at),
|
|
34511
34546
|
updatedAt: Number(row2.updated_at)
|
|
34512
34547
|
}), "meetingOf");
|
|
@@ -34538,7 +34573,7 @@ var transcriptRowOf = /* @__PURE__ */ __name((row2) => ({
|
|
|
34538
34573
|
createdAt: Number(row2.created_at)
|
|
34539
34574
|
}), "transcriptRowOf");
|
|
34540
34575
|
|
|
34541
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34576
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-reads.js
|
|
34542
34577
|
var MEETING_TEXT = ["external_id", "title", "description", "location", "join_url", "timezone", "metadata"];
|
|
34543
34578
|
var TRANSCRIPT_TEXT = ["source", "format", "language", "content_hash", "metadata"];
|
|
34544
34579
|
var ROW_TEXT = ["speaker_name", "text", "normalized_text", "metadata"];
|
|
@@ -34580,7 +34615,7 @@ var parent = /* @__PURE__ */ __name((database, input, budget, load) => {
|
|
|
34580
34615
|
input.signal?.throwIfAborted();
|
|
34581
34616
|
return {
|
|
34582
34617
|
bytes: bytes3,
|
|
34583
|
-
meeting: load ? meetingOf(database.prepare("SELECT * FROM meetings WHERE id = ?").get(input.meetingId) ?? missing()) : void 0
|
|
34618
|
+
meeting: load ? meetingOf(database, database.prepare("SELECT * FROM meetings WHERE id = ?").get(input.meetingId) ?? missing()) : void 0
|
|
34584
34619
|
};
|
|
34585
34620
|
}, "parent");
|
|
34586
34621
|
var revision = /* @__PURE__ */ __name((database, input, budget, load) => {
|
|
@@ -34705,7 +34740,7 @@ var meetingReadsOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
|
34705
34740
|
}
|
|
34706
34741
|
}), "meetingReadsOver");
|
|
34707
34742
|
|
|
34708
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34743
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-selection.js
|
|
34709
34744
|
var meetingSelectionSql = /* @__PURE__ */ __name((input) => {
|
|
34710
34745
|
const clauses = ["m.account_id=?", "m.deleted_at IS NULL"];
|
|
34711
34746
|
const params = [input.accountId];
|
|
@@ -34748,7 +34783,7 @@ var meetingSelectionSql = /* @__PURE__ */ __name((input) => {
|
|
|
34748
34783
|
return { clauses, params };
|
|
34749
34784
|
}, "meetingSelectionSql");
|
|
34750
34785
|
|
|
34751
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34786
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-calls.js
|
|
34752
34787
|
var MOST_CALLS = 2e5;
|
|
34753
34788
|
var parsed3 = /* @__PURE__ */ __name((value) => {
|
|
34754
34789
|
if (typeof value !== "string")
|
|
@@ -34803,7 +34838,7 @@ var meetingCallsOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
|
34803
34838
|
}
|
|
34804
34839
|
}), "meetingCallsOver");
|
|
34805
34840
|
|
|
34806
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34841
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-chat-lines.js
|
|
34807
34842
|
var meetingChatLinesOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
34808
34843
|
async meetingChatLines(input) {
|
|
34809
34844
|
checkMeetingCancelled(input.signal);
|
|
@@ -34831,7 +34866,7 @@ var meetingChatLinesOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
|
34831
34866
|
}
|
|
34832
34867
|
}), "meetingChatLinesOver");
|
|
34833
34868
|
|
|
34834
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34869
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-context-links.js
|
|
34835
34870
|
var missing2 = /* @__PURE__ */ __name(() => {
|
|
34836
34871
|
throw new CliError("not_found", "Meeting, participant or selected target not found");
|
|
34837
34872
|
}, "missing");
|
|
@@ -34954,7 +34989,7 @@ function meetingContextLinksOver(context) {
|
|
|
34954
34989
|
}
|
|
34955
34990
|
__name(meetingContextLinksOver, "meetingContextLinksOver");
|
|
34956
34991
|
|
|
34957
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34992
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-documents.js
|
|
34958
34993
|
var TRANSCRIPT_ROLE = "transcript";
|
|
34959
34994
|
var roleOf3 = /* @__PURE__ */ __name((value) => MEETING_DOCUMENT_ROLES.find((role) => role === value), "roleOf");
|
|
34960
34995
|
var attach = /* @__PURE__ */ __name((database, meetingId, fileId, role, metadata3, listed, now2) => {
|
|
@@ -35028,7 +35063,7 @@ var meetingTranscriptDocumentsOver = /* @__PURE__ */ __name(({ database }) => {
|
|
|
35028
35063
|
};
|
|
35029
35064
|
}, "meetingTranscriptDocumentsOver");
|
|
35030
35065
|
|
|
35031
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
35066
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-index-values.js
|
|
35032
35067
|
var INDEX_CODES = { meeting_transcript_row: 1, meeting_chat_message: 2, meeting_summary: 3 };
|
|
35033
35068
|
var meetingRowid = /* @__PURE__ */ __name((type, id2) => id2 * 4 + INDEX_CODES[type], "meetingRowid");
|
|
35034
35069
|
var summaryOf2 = /* @__PURE__ */ __name((row2) => ({
|
|
@@ -35057,7 +35092,7 @@ var indexedText = /* @__PURE__ */ __name((database, type, id2) => {
|
|
|
35057
35092
|
return row2 ? summaryText(summaryOf2(row2)) : null;
|
|
35058
35093
|
}, "indexedText");
|
|
35059
35094
|
|
|
35060
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
35095
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-stem-state.js
|
|
35061
35096
|
var summaryBytes = ["title", "overview", "sections", "next_steps", "content"].map((key2) => `coalesce(length(CAST(s.${key2} AS BLOB)),0)`).join("+");
|
|
35062
35097
|
var meetingCurrentIndexRows = `
|
|
35063
35098
|
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 +35123,7 @@ var invalidateMeetingStems = /* @__PURE__ */ __name((database, type, id2) => {
|
|
|
35088
35123
|
}, "invalidateMeetingStems");
|
|
35089
35124
|
var meetingStemmableText = /* @__PURE__ */ __name((text8) => text8.replace(/[\p{L}\p{N}\p{M}\p{Co}]+/gu, (token) => token.length <= 1024 ? token : ""), "meetingStemmableText");
|
|
35090
35125
|
|
|
35091
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
35126
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-hit-index.js
|
|
35092
35127
|
function meetingHitIndexOver({ database, now: now2 }) {
|
|
35093
35128
|
return {
|
|
35094
35129
|
async indexSearch(original) {
|
|
@@ -35156,10 +35191,10 @@ function meetingHitIndexOver({ database, now: now2 }) {
|
|
|
35156
35191
|
}
|
|
35157
35192
|
__name(meetingHitIndexOver, "meetingHitIndexOver");
|
|
35158
35193
|
|
|
35159
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
35194
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-hit-search.js
|
|
35160
35195
|
import { createHash as createHash5 } from "node:crypto";
|
|
35161
35196
|
|
|
35162
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
35197
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/search/correct.js
|
|
35163
35198
|
var SHORTEST_CORRECTION = 3;
|
|
35164
35199
|
var maxEdits = /* @__PURE__ */ __name((word2) => word2.length <= 4 ? 1 : 2, "maxEdits");
|
|
35165
35200
|
var editDistance = /* @__PURE__ */ __name((a, b, max) => {
|
|
@@ -35206,7 +35241,7 @@ var correctWords = /* @__PURE__ */ __name(async (vocabulary, words4) => {
|
|
|
35206
35241
|
return corrections;
|
|
35207
35242
|
}, "correctWords");
|
|
35208
35243
|
|
|
35209
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
35244
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/search/garbled.js
|
|
35210
35245
|
var SHORTEST_GARBLED = 4;
|
|
35211
35246
|
var MOST_WIDENED = 64;
|
|
35212
35247
|
var plain = /* @__PURE__ */ __name((word2) => word2.replaceAll("\u044D", "\u0435"), "plain");
|
|
@@ -35227,14 +35262,14 @@ var garbledDistance = /* @__PURE__ */ __name((probe, word2, stems) => {
|
|
|
35227
35262
|
return null;
|
|
35228
35263
|
if (isNumberWord(probe.literal) || isNumberWord(word2))
|
|
35229
35264
|
return null;
|
|
35230
|
-
const
|
|
35265
|
+
const literal5 = plain(probe.literal);
|
|
35231
35266
|
const stored4 = plain(word2);
|
|
35232
35267
|
let best = null;
|
|
35233
35268
|
for (const queryStem of probe.stems.map(plain))
|
|
35234
35269
|
for (const wordStem of stems.map(plain)) {
|
|
35235
35270
|
if (Math.min(queryStem.length, wordStem.length) < 3)
|
|
35236
35271
|
continue;
|
|
35237
|
-
if (wordStem.startsWith(queryStem) &&
|
|
35272
|
+
if (wordStem.startsWith(queryStem) && literal5.startsWith(wordStem) || queryStem.startsWith(wordStem) && stored4.startsWith(queryStem))
|
|
35238
35273
|
return 0;
|
|
35239
35274
|
if (queryStem.length < SHORTEST_GARBLED)
|
|
35240
35275
|
continue;
|
|
@@ -35244,7 +35279,7 @@ var garbledDistance = /* @__PURE__ */ __name((probe, word2, stems) => {
|
|
|
35244
35279
|
if (distance <= 1)
|
|
35245
35280
|
best = distance;
|
|
35246
35281
|
}
|
|
35247
|
-
if (best === null && stored4.length >= SHORTEST_GARBLED &&
|
|
35282
|
+
if (best === null && stored4.length >= SHORTEST_GARBLED && literal5.startsWith(stored4))
|
|
35248
35283
|
return 1;
|
|
35249
35284
|
return best;
|
|
35250
35285
|
}, "garbledDistance");
|
|
@@ -35298,7 +35333,7 @@ var widenWords = /* @__PURE__ */ __name((probes, vocabulary, stem, known2) => {
|
|
|
35298
35333
|
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
35334
|
}, "widenWords");
|
|
35300
35335
|
|
|
35301
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
35336
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/search/russian-dictionary.js
|
|
35302
35337
|
import { readFileSync } from "node:fs";
|
|
35303
35338
|
var loaded;
|
|
35304
35339
|
var dictionary = /* @__PURE__ */ __name(() => {
|
|
@@ -35357,7 +35392,7 @@ var knownRussianWord = /* @__PURE__ */ __name((word2) => {
|
|
|
35357
35392
|
return false;
|
|
35358
35393
|
}, "knownRussianWord");
|
|
35359
35394
|
|
|
35360
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
35395
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-hit-query.js
|
|
35361
35396
|
var WORD2 = /[\p{L}\p{N}\p{M}]+/gu;
|
|
35362
35397
|
var MOST_WORDS = 128;
|
|
35363
35398
|
var quote = /* @__PURE__ */ __name((word2) => `"${word2.replaceAll('"', '""')}"`, "quote");
|
|
@@ -35435,11 +35470,11 @@ var resolveMeetingQuery = /* @__PURE__ */ __name((database, accountId, ast, stat
|
|
|
35435
35470
|
const all2 = [];
|
|
35436
35471
|
const wordsOf6 = /* @__PURE__ */ __name((value, exact) => {
|
|
35437
35472
|
const words4 = (value.match(WORD2) ?? []).filter((raw) => normalize(raw)).map((raw) => {
|
|
35438
|
-
const
|
|
35473
|
+
const literal5 = normalize(raw);
|
|
35439
35474
|
return {
|
|
35440
35475
|
raw,
|
|
35441
|
-
literal:
|
|
35442
|
-
whole: exact || isNumberWord(
|
|
35476
|
+
literal: literal5,
|
|
35477
|
+
whole: exact || isNumberWord(literal5),
|
|
35443
35478
|
stems: state.stemmer && raw.length <= 1024 && !exact ? [...new Set(state.stemmer.explain(raw).map((word2) => word2.stem))] : [],
|
|
35444
35479
|
widened: []
|
|
35445
35480
|
};
|
|
@@ -35613,7 +35648,7 @@ var matchedMeetingWords = /* @__PURE__ */ __name((tree, text8, stemmer2) => {
|
|
|
35613
35648
|
return [...found2];
|
|
35614
35649
|
}, "matchedMeetingWords");
|
|
35615
35650
|
|
|
35616
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
35651
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-hit-search.js
|
|
35617
35652
|
var fail = /* @__PURE__ */ __name((message3) => {
|
|
35618
35653
|
throw new CliError("validation_error", message3);
|
|
35619
35654
|
}, "fail");
|
|
@@ -35797,7 +35832,7 @@ function meetingHitSearchOver({ database }) {
|
|
|
35797
35832
|
}
|
|
35798
35833
|
__name(meetingHitSearchOver, "meetingHitSearchOver");
|
|
35799
35834
|
|
|
35800
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
35835
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-languages.js
|
|
35801
35836
|
var meetingLanguagesOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
35802
35837
|
async fillTranscriptLanguages({ accountId, apply, now: now2 }) {
|
|
35803
35838
|
positiveReadInteger(accountId, "accountId");
|
|
@@ -35829,7 +35864,7 @@ var meetingLanguagesOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
|
35829
35864
|
}
|
|
35830
35865
|
}), "meetingLanguagesOver");
|
|
35831
35866
|
|
|
35832
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
35867
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-participant-search.js
|
|
35833
35868
|
import { createHash as createHash6 } from "node:crypto";
|
|
35834
35869
|
var cursorOf2 = /* @__PURE__ */ __name((value, key2) => {
|
|
35835
35870
|
if (value === void 0)
|
|
@@ -35922,7 +35957,7 @@ var meetingParticipantSearchOver = /* @__PURE__ */ __name((context) => ({
|
|
|
35922
35957
|
}
|
|
35923
35958
|
}), "meetingParticipantSearchOver");
|
|
35924
35959
|
|
|
35925
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
35960
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/preparation-context-queries.js
|
|
35926
35961
|
var preparationQueries = {
|
|
35927
35962
|
participants: {
|
|
35928
35963
|
fields: "p.id, p.identity_id, p.display_name, l.person_id",
|
|
@@ -35972,7 +36007,7 @@ var preparationQueries = {
|
|
|
35972
36007
|
}
|
|
35973
36008
|
};
|
|
35974
36009
|
|
|
35975
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
36010
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-preparation-context.js
|
|
35976
36011
|
var meetingPreparationContextOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
35977
36012
|
async preparationContext(original) {
|
|
35978
36013
|
const input = validateMeetingPreparationContext(original);
|
|
@@ -36013,7 +36048,7 @@ var meetingPreparationContextOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
|
36013
36048
|
}
|
|
36014
36049
|
}), "meetingPreparationContextOver");
|
|
36015
36050
|
|
|
36016
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
36051
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/preparation-subjects.js
|
|
36017
36052
|
var preparationSubjects = /* @__PURE__ */ __name((anchors) => `WITH anchors AS (
|
|
36018
36053
|
SELECT m.id FROM meetings m JOIN meeting_series s ON s.id=m.meeting_series_id
|
|
36019
36054
|
WHERE m.id IN (${Array.from({ length: anchors }, () => "?").join(",")}) AND m.account_id=? AND s.account_id=?
|
|
@@ -36027,7 +36062,7 @@ var preparationSubjects = /* @__PURE__ */ __name((anchors) => `WITH anchors AS (
|
|
|
36027
36062
|
JOIN main.projects p ON p.id=l.to_id WHERE p.account_id IS NULL AND p.deleted_at IS NULL
|
|
36028
36063
|
)`, "preparationSubjects");
|
|
36029
36064
|
|
|
36030
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
36065
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-preparation-knowledge.js
|
|
36031
36066
|
var meetingPreparationKnowledgeOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
36032
36067
|
async preparationKnowledge(original) {
|
|
36033
36068
|
const { accountId, seriesId, anchorIds, after: after2, before: before2, limit, maxReadBytes, signal } = validateMeetingRelatedHistory(original);
|
|
@@ -36072,7 +36107,7 @@ var meetingPreparationKnowledgeOver = /* @__PURE__ */ __name(({ database }) => (
|
|
|
36072
36107
|
}
|
|
36073
36108
|
}), "meetingPreparationKnowledgeOver");
|
|
36074
36109
|
|
|
36075
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
36110
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-preparation-notes.js
|
|
36076
36111
|
var meetingPreparationNotesOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
36077
36112
|
async preparationNotes(original) {
|
|
36078
36113
|
const { accountId, seriesId, anchorIds, after: after2, before: before2, limit, maxReadBytes, signal } = validateMeetingRelatedHistory(original);
|
|
@@ -36125,7 +36160,7 @@ var meetingPreparationNotesOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
|
36125
36160
|
}
|
|
36126
36161
|
}), "meetingPreparationNotesOver");
|
|
36127
36162
|
|
|
36128
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
36163
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-related-history.js
|
|
36129
36164
|
var meetingRelatedHistoryOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
36130
36165
|
async relatedHistory(original) {
|
|
36131
36166
|
const input = validateMeetingRelatedHistory(original);
|
|
@@ -36196,7 +36231,7 @@ var meetingRelatedHistoryOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
|
36196
36231
|
}
|
|
36197
36232
|
}), "meetingRelatedHistoryOver");
|
|
36198
36233
|
|
|
36199
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
36234
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-review.js
|
|
36200
36235
|
var number2 = /* @__PURE__ */ __name((value) => value === null || value === void 0 ? null : Number(value), "number");
|
|
36201
36236
|
var text4 = /* @__PURE__ */ __name((value) => value === null || value === void 0 ? null : String(value), "text");
|
|
36202
36237
|
var meetingReviewOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
@@ -36277,7 +36312,7 @@ var meetingReviewOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
|
36277
36312
|
}
|
|
36278
36313
|
}), "meetingReviewOver");
|
|
36279
36314
|
|
|
36280
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
36315
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-series-history.js
|
|
36281
36316
|
var bytes2 = "length(CAST(external_id AS BLOB)) + coalesce(length(CAST(title AS BLOB)), 0)";
|
|
36282
36317
|
var ensureBytes2 = /* @__PURE__ */ __name((size2, budget) => {
|
|
36283
36318
|
if (!Number.isSafeInteger(size2) || size2 < 0 || size2 > budget)
|
|
@@ -36331,7 +36366,7 @@ var meetingSeriesHistoryOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
|
36331
36366
|
}
|
|
36332
36367
|
}), "meetingSeriesHistoryOver");
|
|
36333
36368
|
|
|
36334
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
36369
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-stats.js
|
|
36335
36370
|
var MOST_ROWS = 5e5;
|
|
36336
36371
|
var meetingCountsSql = /* @__PURE__ */ __name((where) => `SELECT m.started_at, coalesce(m.duration_ms, m.ended_at - m.started_at) AS duration_ms,
|
|
36337
36372
|
EXISTS (SELECT 1 FROM meeting_transcripts t WHERE t.meeting_id = m.id AND t.deleted_at IS NULL
|
|
@@ -36400,7 +36435,7 @@ var meetingStatsOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
|
36400
36435
|
}
|
|
36401
36436
|
}), "meetingStatsOver");
|
|
36402
36437
|
|
|
36403
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
36438
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/domain/name-variants.js
|
|
36404
36439
|
var CYRILLIC_TO_LATIN = {
|
|
36405
36440
|
\u0430: "a",
|
|
36406
36441
|
\u0431: "b",
|
|
@@ -36622,7 +36657,7 @@ for (const [full, short] of Object.entries(SHORT_FORMS))
|
|
|
36622
36657
|
}
|
|
36623
36658
|
var fullNames = /* @__PURE__ */ __name((skeleton) => [skeleton, ...FULL_NAMES.get(skeleton) ?? []], "fullNames");
|
|
36624
36659
|
|
|
36625
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
36660
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/name-traces.js
|
|
36626
36661
|
var peopleByNameKey = /* @__PURE__ */ __name((database) => {
|
|
36627
36662
|
const found2 = /* @__PURE__ */ new Map();
|
|
36628
36663
|
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 +36773,7 @@ function* sharedTraces(database, a, b, name, except) {
|
|
|
36738
36773
|
}
|
|
36739
36774
|
__name(sharedTraces, "sharedTraces");
|
|
36740
36775
|
|
|
36741
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
36776
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/person-matcher.js
|
|
36742
36777
|
var spellingsOf = /* @__PURE__ */ __name((value) => [value, value.slice(1)], "spellingsOf");
|
|
36743
36778
|
var PERSON_BY = {
|
|
36744
36779
|
// UNION, not OR: each branch reads its own index.
|
|
@@ -36761,7 +36796,7 @@ var personsByIdentifiers = /* @__PURE__ */ __name((database, ids3) => {
|
|
|
36761
36796
|
return [...found2].sort((a, b) => a - b);
|
|
36762
36797
|
}, "personsByIdentifiers");
|
|
36763
36798
|
|
|
36764
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
36799
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/person-match-scan.js
|
|
36765
36800
|
var BY = "rule";
|
|
36766
36801
|
var RULE = { bot: "rule", kind: "rule" };
|
|
36767
36802
|
var MOST_SHARING = 6;
|
|
@@ -37208,7 +37243,7 @@ var linkPhones = /* @__PURE__ */ __name((context, identities2) => {
|
|
|
37208
37243
|
return pass.result;
|
|
37209
37244
|
}, "linkPhones");
|
|
37210
37245
|
|
|
37211
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
37246
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/meetings.js
|
|
37212
37247
|
var CURSOR_KEY = "meetings";
|
|
37213
37248
|
var seriesOf2 = /* @__PURE__ */ __name((row2) => ({
|
|
37214
37249
|
id: Number(row2.id),
|
|
@@ -37286,7 +37321,7 @@ var details = /* @__PURE__ */ __name((database, id2) => {
|
|
|
37286
37321
|
const row2 = database.prepare("SELECT * FROM meetings WHERE id = ?").get(id2);
|
|
37287
37322
|
if (!row2)
|
|
37288
37323
|
return null;
|
|
37289
|
-
const meeting = meetingOf(row2);
|
|
37324
|
+
const meeting = meetingOf(database, row2);
|
|
37290
37325
|
const series = meeting.meetingSeriesId === null ? null : seriesOf2(database.prepare("SELECT * FROM meeting_series WHERE id = ?").get(meeting.meetingSeriesId));
|
|
37291
37326
|
const rowsOf2 = database.prepare("SELECT * FROM meeting_transcript_rows WHERE meeting_transcript_id = ? ORDER BY position");
|
|
37292
37327
|
return {
|
|
@@ -37367,6 +37402,11 @@ var fillGap = /* @__PURE__ */ __name((context, input, meetingId) => {
|
|
|
37367
37402
|
saveTranscripts(database, meetingId, input.transcripts, (position2) => position2 === null ? null : participantIds[position2] ?? null, input.now);
|
|
37368
37403
|
return meetingId;
|
|
37369
37404
|
}, "fillGap");
|
|
37405
|
+
var callDirection = /* @__PURE__ */ __name((value) => {
|
|
37406
|
+
if (value === null || MEETING_CALL_DIRECTIONS.includes(value))
|
|
37407
|
+
return value;
|
|
37408
|
+
throw new CliError("validation_error", `a call's direction is in or out, not ${String(value)}`);
|
|
37409
|
+
}, "callDirection");
|
|
37370
37410
|
var save = /* @__PURE__ */ __name((context, input) => {
|
|
37371
37411
|
const { database } = context;
|
|
37372
37412
|
const { meeting: { series: seriesInput, ...meeting }, now: now2 } = input;
|
|
@@ -37413,7 +37453,9 @@ var save = /* @__PURE__ */ __name((context, input) => {
|
|
|
37413
37453
|
host_identity_id: meeting.hostIdentityId,
|
|
37414
37454
|
...meeting.participantsCount === void 0 ? {} : { participants_count: meeting.participantsCount },
|
|
37415
37455
|
metadata: toJson(meeting.metadata),
|
|
37416
|
-
deleted_at: meeting.deletedAt
|
|
37456
|
+
deleted_at: meeting.deletedAt,
|
|
37457
|
+
...meeting.direction === void 0 ? {} : { direction: callDirection(meeting.direction) },
|
|
37458
|
+
...meeting.clientPhone === void 0 ? {} : { client_phone: meeting.clientPhone?.trim() || null }
|
|
37417
37459
|
}, now2);
|
|
37418
37460
|
const participantIds = (input.participants ?? []).map(({ identity, ...p }) => upsert(database, "meeting_participants", {
|
|
37419
37461
|
meeting_id: meetingId,
|
|
@@ -37755,7 +37797,7 @@ var meetingStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
37755
37797
|
},
|
|
37756
37798
|
async meetings(filter) {
|
|
37757
37799
|
const { sql: sql2, params } = filtered(filter);
|
|
37758
|
-
return database.prepare(sql2).all(...params).map(meetingOf);
|
|
37800
|
+
return database.prepare(sql2).all(...params).map((row2) => meetingOf(database, row2));
|
|
37759
37801
|
},
|
|
37760
37802
|
async account(id2) {
|
|
37761
37803
|
const row2 = database.prepare("SELECT provider, external_id FROM accounts WHERE id = ?").get(id2);
|
|
@@ -37808,7 +37850,7 @@ var meetingStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
37808
37850
|
};
|
|
37809
37851
|
}, "meetingStoreOver");
|
|
37810
37852
|
|
|
37811
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
37853
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/sync.js
|
|
37812
37854
|
var syncStateOf = /* @__PURE__ */ __name(({ orm }, accountKey, name) => {
|
|
37813
37855
|
const row2 = orm.select({ value: syncCursors.value, at: syncCursors.updatedAt }).from(syncCursors).where(and(eq(syncCursors.accountId, accountKey), eq(syncCursors.key, name))).get();
|
|
37814
37856
|
return row2 ? { value: row2.value, at: toIso(row2.at) } : void 0;
|
|
@@ -37834,7 +37876,7 @@ var release = /* @__PURE__ */ __name(({ orm }, chatKey, anchor, holder2) => {
|
|
|
37834
37876
|
orm.delete(fetchLeases).where(and(eq(fetchLeases.chatId, chatKey), eq(fetchLeases.anchor, anchor), eq(fetchLeases.holder, holder2))).run();
|
|
37835
37877
|
}, "release");
|
|
37836
37878
|
|
|
37837
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
37879
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/thread-columns.js
|
|
37838
37880
|
var THREAD_COLUMNS = {
|
|
37839
37881
|
subject: {
|
|
37840
37882
|
where: /* @__PURE__ */ __name(({ value }) => ({
|
|
@@ -37851,7 +37893,7 @@ var threadRows = /* @__PURE__ */ __name((database, filter) => {
|
|
|
37851
37893
|
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
37894
|
}, "threadRows");
|
|
37853
37895
|
|
|
37854
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
37896
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/emails.js
|
|
37855
37897
|
var threadConversation = /* @__PURE__ */ __name((place, builtAt) => ({
|
|
37856
37898
|
id: `email:${place.emailId}`,
|
|
37857
37899
|
chatId: place.threadExternalId,
|
|
@@ -38393,7 +38435,7 @@ var mailStoreOver = /* @__PURE__ */ __name(({ database, orm, now: now2 }, stemme
|
|
|
38393
38435
|
}
|
|
38394
38436
|
}), "mailStoreOver");
|
|
38395
38437
|
|
|
38396
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
38438
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/search/dictionary.js
|
|
38397
38439
|
import { readFileSync as readFileSync2 } from "node:fs";
|
|
38398
38440
|
var DICTIONARIES = Object.fromEntries(LANGUAGES.map(({ name, dictionary: dictionary3 }) => [name, dictionary3]));
|
|
38399
38441
|
var folded5 = /* @__PURE__ */ __name((word2) => /^[а-яё'-]*$/.test(word2) ? word2.replaceAll("\u0451", "\u0435").replaceAll("\u0439", "\u0438") : fold(word2), "folded");
|
|
@@ -38483,7 +38525,7 @@ var knownWord = /* @__PURE__ */ __name((languages) => {
|
|
|
38483
38525
|
}, "knownWord");
|
|
38484
38526
|
var dictionaryLanguages = /* @__PURE__ */ __name((stemmers) => [stemmers.cyrillic, ...stemmers.latin.split(",")].filter((name) => Object.hasOwn(DICTIONARIES, name)), "dictionaryLanguages");
|
|
38485
38527
|
|
|
38486
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
38528
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/transcript-query.js
|
|
38487
38529
|
var predicates = /* @__PURE__ */ __name((node) => node.kind === "predicate" ? [node] : node.clauses.flatMap(({ node: node2 }) => predicates(node2)), "predicates");
|
|
38488
38530
|
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
38531
|
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 +38611,7 @@ var spokenTranscripts = /* @__PURE__ */ __name((database, item, speaking, keys)
|
|
|
38569
38611
|
return found2;
|
|
38570
38612
|
}, "spokenTranscripts");
|
|
38571
38613
|
|
|
38572
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
38614
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/hit-places.js
|
|
38573
38615
|
var startOf = /* @__PURE__ */ __name((node) => node.operator === "wildcard" && node.implicit ? /^([\p{L}\p{N}]+)\*$/u.exec(normalize(node.value))?.[1] : void 0, "startOf");
|
|
38574
38616
|
var matchOf = /* @__PURE__ */ __name((node) => {
|
|
38575
38617
|
const start = startOf(node);
|
|
@@ -38627,7 +38669,7 @@ var placeHits = /* @__PURE__ */ __name((database, corpus, leaves, transcripts, f
|
|
|
38627
38669
|
});
|
|
38628
38670
|
}, "placeHits");
|
|
38629
38671
|
|
|
38630
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
38672
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/lucene-groups.js
|
|
38631
38673
|
var GROUPS = {
|
|
38632
38674
|
chat: {
|
|
38633
38675
|
key: "m.chat_id",
|
|
@@ -38649,7 +38691,7 @@ var GROUPS = {
|
|
|
38649
38691
|
}
|
|
38650
38692
|
};
|
|
38651
38693
|
|
|
38652
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
38694
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/lucene.js
|
|
38653
38695
|
var MESSAGES = {
|
|
38654
38696
|
rows: "messages",
|
|
38655
38697
|
threads: "chats",
|
|
@@ -39142,7 +39184,7 @@ var runCompiled = /* @__PURE__ */ __name(async (context, execution, by) => {
|
|
|
39142
39184
|
};
|
|
39143
39185
|
}, "runCompiled");
|
|
39144
39186
|
|
|
39145
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
39187
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/counters.js
|
|
39146
39188
|
function invalidMetadata() {
|
|
39147
39189
|
throw new CliError("validation_error", "stored counter metadata is malformed \u2014 check the store before refreshing");
|
|
39148
39190
|
}
|
|
@@ -39244,7 +39286,7 @@ var counterTargets = /* @__PURE__ */ __name((context, execution, options) => wit
|
|
|
39244
39286
|
};
|
|
39245
39287
|
}), "counterTargets");
|
|
39246
39288
|
|
|
39247
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
39289
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/attachment-texts.js
|
|
39248
39290
|
var NOT_FILE_LIST = [...NOT_FILES].map((kind3) => `'${kind3}'`).join(",");
|
|
39249
39291
|
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
39292
|
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 +39405,7 @@ var attachmentViews = /* @__PURE__ */ __name(({ database }, accountKey, { chatKe
|
|
|
39363
39405
|
}));
|
|
39364
39406
|
}, "attachmentViews");
|
|
39365
39407
|
|
|
39366
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
39408
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/transcripts.js
|
|
39367
39409
|
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
39410
|
var keepTranscript = /* @__PURE__ */ __name((context, chatKey, messageId, text8, source2) => {
|
|
39369
39411
|
const { orm, database, now: now2 } = context;
|
|
@@ -39401,7 +39443,7 @@ var intoVoiceAttachment = /* @__PURE__ */ __name((context, messagePk) => {
|
|
|
39401
39443
|
keepText(context, Number(row2.id), { text: String(row2.text), origin: "extracted", extractor: `speech:${row2.source}` });
|
|
39402
39444
|
}, "intoVoiceAttachment");
|
|
39403
39445
|
|
|
39404
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
39446
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/messages.js
|
|
39405
39447
|
var FIELDS = [
|
|
39406
39448
|
"threadExternalId",
|
|
39407
39449
|
"senderIdentityId",
|
|
@@ -39725,7 +39767,7 @@ var writeDerivedReactions = /* @__PURE__ */ __name((context, chatKey, messageId)
|
|
|
39725
39767
|
reactionStatementsOf(context.database).total.run(JSON.stringify(derived), chatKey, messageId);
|
|
39726
39768
|
}, "writeDerivedReactions");
|
|
39727
39769
|
|
|
39728
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
39770
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/keys.js
|
|
39729
39771
|
var keysOver = /* @__PURE__ */ __name((context) => {
|
|
39730
39772
|
const findAccountPk2 = /* @__PURE__ */ __name((key2) => findAccountPk(context, key2), "findAccountPk");
|
|
39731
39773
|
const findChatPk2 = /* @__PURE__ */ __name((accountKey, chatId) => findChatPk(context, accountKey, chatId), "findChatPk");
|
|
@@ -39746,7 +39788,7 @@ var keysOver = /* @__PURE__ */ __name((context) => {
|
|
|
39746
39788
|
};
|
|
39747
39789
|
}, "keysOver");
|
|
39748
39790
|
|
|
39749
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
39791
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/account-groups.js
|
|
39750
39792
|
var accountGroupsOf = /* @__PURE__ */ __name((database) => {
|
|
39751
39793
|
const row2 = database.prepare("SELECT value FROM store_settings WHERE key = ?").get(ACCOUNT_GROUPS);
|
|
39752
39794
|
if (!row2)
|
|
@@ -39793,7 +39835,7 @@ var forgetProfile = /* @__PURE__ */ __name((database, app, profile, now2) => {
|
|
|
39793
39835
|
database.prepare("INSERT OR REPLACE INTO store_settings (key, value, at) VALUES (?, ?, ?)").run(PROFILES, JSON.stringify(profiles), now2);
|
|
39794
39836
|
}, "forgetProfile");
|
|
39795
39837
|
|
|
39796
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
39838
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/calendar-events.js
|
|
39797
39839
|
var DAY4 = 864e5;
|
|
39798
39840
|
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
39841
|
var accountsOf = /* @__PURE__ */ __name((filter) => {
|
|
@@ -39909,7 +39951,7 @@ var listEvents = /* @__PURE__ */ __name((database, filter) => {
|
|
|
39909
39951
|
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
39952
|
}, "listEvents");
|
|
39911
39953
|
|
|
39912
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
39954
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/calendar-forget.js
|
|
39913
39955
|
var distinctIds = /* @__PURE__ */ __name((rows) => [...new Set(rows.map((row2) => Number(row2.id)))], "distinctIds");
|
|
39914
39956
|
var forgetCalendarRows = /* @__PURE__ */ __name((database, { calendarId, accountId, cursorKey, now: now2 }, refresh) => {
|
|
39915
39957
|
const unseenBefore = unreferenced(database, "identities");
|
|
@@ -39966,7 +40008,7 @@ var forgetCalendarRows = /* @__PURE__ */ __name((database, { calendarId, account
|
|
|
39966
40008
|
return { entries: entryIds.length, events: goneEvents.length };
|
|
39967
40009
|
}, "forgetCalendarRows");
|
|
39968
40010
|
|
|
39969
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
40011
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/calendar.js
|
|
39970
40012
|
var calendarOf = /* @__PURE__ */ __name((row2) => ({
|
|
39971
40013
|
id: Number(row2.id),
|
|
39972
40014
|
accountId: Number(row2.account_id),
|
|
@@ -40569,7 +40611,7 @@ var eventStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
40569
40611
|
};
|
|
40570
40612
|
}, "eventStoreOver");
|
|
40571
40613
|
|
|
40572
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
40614
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/account-purge.js
|
|
40573
40615
|
var purgeAccount = /* @__PURE__ */ __name((context, accountKey) => {
|
|
40574
40616
|
const { orm, database, now: now2 } = context;
|
|
40575
40617
|
const unseenBefore = unreferenced(database, "identities");
|
|
@@ -40684,7 +40726,7 @@ var purgeCrmCopies = /* @__PURE__ */ __name((database, accountKey) => {
|
|
|
40684
40726
|
run("DELETE FROM pipelines WHERE account_id = ?", accountKey);
|
|
40685
40727
|
}, "purgeCrmCopies");
|
|
40686
40728
|
|
|
40687
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
40729
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/own-identities.js
|
|
40688
40730
|
var ACCOUNT_REASON = "an account you connected, under another name: a mailbox or messenger you read may be someone else's";
|
|
40689
40731
|
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
40732
|
var ownersName = /* @__PURE__ */ __name((name, owner, alone) => {
|
|
@@ -40743,7 +40785,7 @@ var linkToOwner = /* @__PURE__ */ __name((context, ref3) => {
|
|
|
40743
40785
|
return personOf2(context, ref3);
|
|
40744
40786
|
}, "linkToOwner");
|
|
40745
40787
|
|
|
40746
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
40788
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/providers.js
|
|
40747
40789
|
var PROVIDERS_SETTING = "providers";
|
|
40748
40790
|
var storedProvidersOf = /* @__PURE__ */ __name((database) => {
|
|
40749
40791
|
const row2 = database.prepare("SELECT value FROM store_settings WHERE key = ?").get(PROVIDERS_SETTING);
|
|
@@ -40791,7 +40833,7 @@ var registerProvider = /* @__PURE__ */ __name((database, value, now2) => {
|
|
|
40791
40833
|
});
|
|
40792
40834
|
}, "registerProvider");
|
|
40793
40835
|
|
|
40794
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
40836
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/task-candidates.js
|
|
40795
40837
|
var DAY5 = 864e5;
|
|
40796
40838
|
var RECENTLY_CLOSED_MS = 14 * DAY5;
|
|
40797
40839
|
var TEXT_LIMIT = 20;
|
|
@@ -40989,7 +41031,7 @@ var taskSimilarityOver = /* @__PURE__ */ __name((context) => {
|
|
|
40989
41031
|
};
|
|
40990
41032
|
}, "taskSimilarityOver");
|
|
40991
41033
|
|
|
40992
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
41034
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/task-category-settings.js
|
|
40993
41035
|
var SETTING3 = "taskCategories";
|
|
40994
41036
|
var savedTaskCategories = /* @__PURE__ */ __name((database) => {
|
|
40995
41037
|
const row2 = database.prepare("SELECT value FROM store_settings WHERE key = ?").get(SETTING3);
|
|
@@ -41008,7 +41050,7 @@ var saveTaskCategories = /* @__PURE__ */ __name((database, categories, now2) =>
|
|
|
41008
41050
|
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
41051
|
}, "saveTaskCategories");
|
|
41010
41052
|
|
|
41011
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
41053
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/task-close.js
|
|
41012
41054
|
var DEFAULT_AGENT_CLOSE = { allowed: true, min: 0.8 };
|
|
41013
41055
|
var ALLOWED = "taskAgentClose";
|
|
41014
41056
|
var MIN = "taskAgentCloseMin";
|
|
@@ -41064,7 +41106,7 @@ var SUGGESTION_COLUMNS = [
|
|
|
41064
41106
|
];
|
|
41065
41107
|
var CLEAR_SUGGESTION = SUGGESTION_COLUMNS.map((column2) => `${column2} = NULL`).join(", ");
|
|
41066
41108
|
|
|
41067
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
41109
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/task-first-pass.js
|
|
41068
41110
|
var DEFAULT_FIRST_PASS_PER_CHAT = 0;
|
|
41069
41111
|
var KEY = "taskFirstPassPerChat";
|
|
41070
41112
|
var firstPassPerChatOf = /* @__PURE__ */ __name((value, setting = "task_first_pass_per_chat") => {
|
|
@@ -41084,7 +41126,7 @@ var saveFirstPassPerChat = /* @__PURE__ */ __name((database, value, now2) => {
|
|
|
41084
41126
|
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
41127
|
}, "saveFirstPassPerChat");
|
|
41086
41128
|
|
|
41087
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
41129
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/domain/external-links.js
|
|
41088
41130
|
var EXTERNAL_SERVICE = /^[a-z][a-z0-9-]{0,31}$/;
|
|
41089
41131
|
var EXTERNAL_ID_CHARS = 200;
|
|
41090
41132
|
var SOURCE_URL_CHARS = 2e3;
|
|
@@ -41111,7 +41153,7 @@ var sourceUrlOf = /* @__PURE__ */ __name((value, reason = "task.source-url") =>
|
|
|
41111
41153
|
return text8;
|
|
41112
41154
|
}, "sourceUrlOf");
|
|
41113
41155
|
|
|
41114
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
41156
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/task-board.js
|
|
41115
41157
|
var TASK_SORTS = ["priority", "due", "created", "updated", "key", "state"];
|
|
41116
41158
|
var field = /* @__PURE__ */ __name((name, type, example, more = {}) => ({
|
|
41117
41159
|
name,
|
|
@@ -41160,8 +41202,8 @@ var wordsMatch = /* @__PURE__ */ __name((node) => {
|
|
|
41160
41202
|
const words4 = taskWordsOf(node.value.replaceAll("*", " ")).split(/\s+/).filter((word2) => /[\p{L}\p{N}]/u.test(word2));
|
|
41161
41203
|
if (words4.length === 0)
|
|
41162
41204
|
return void 0;
|
|
41163
|
-
const
|
|
41164
|
-
return `normalized_text : (${node.operator === "phrase" ?
|
|
41205
|
+
const quoted6 = /* @__PURE__ */ __name((text8) => `"${text8.replaceAll('"', '""')}"`, "quoted");
|
|
41206
|
+
return `normalized_text : (${node.operator === "phrase" ? quoted6(words4.join(" ")) : words4.map((word2) => `${quoted6(word2)}*`).join(" AND ")})`;
|
|
41165
41207
|
}, "wordsMatch");
|
|
41166
41208
|
var projectWhere = /* @__PURE__ */ __name((node) => {
|
|
41167
41209
|
if (node.operator === "wildcard" && node.value === "*")
|
|
@@ -41363,7 +41405,7 @@ var withoutField = /* @__PURE__ */ __name((query, name) => {
|
|
|
41363
41405
|
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
41406
|
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
41407
|
|
|
41366
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
41408
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/task-comments.js
|
|
41367
41409
|
var authorNamed = /* @__PURE__ */ __name((database, row2) => {
|
|
41368
41410
|
if (row2.author_type == null)
|
|
41369
41411
|
return null;
|
|
@@ -41391,7 +41433,7 @@ var addComment = /* @__PURE__ */ __name((context, task, body2, by) => {
|
|
|
41391
41433
|
return commentsOf(database, task).find((one2) => one2.ref === `note:${made}`);
|
|
41392
41434
|
}, "addComment");
|
|
41393
41435
|
|
|
41394
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
41436
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/task-relations.js
|
|
41395
41437
|
var TASK_RELATION_KINDS = [
|
|
41396
41438
|
"blocked-by",
|
|
41397
41439
|
"follow-up-of",
|
|
@@ -41521,7 +41563,7 @@ var taskRelationsStoreOver = /* @__PURE__ */ __name((context, record3) => {
|
|
|
41521
41563
|
};
|
|
41522
41564
|
}, "taskRelationsStoreOver");
|
|
41523
41565
|
|
|
41524
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
41566
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/work-tasks.js
|
|
41525
41567
|
var TASK_ROLES = ["assignee", "reviewer", "watcher"];
|
|
41526
41568
|
var TASK_EVENT_KINDS = [
|
|
41527
41569
|
"created",
|
|
@@ -42080,7 +42122,7 @@ var workTasksOver = /* @__PURE__ */ __name((context) => {
|
|
|
42080
42122
|
};
|
|
42081
42123
|
}, "workTasksOver");
|
|
42082
42124
|
|
|
42083
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
42125
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/task-close-store.js
|
|
42084
42126
|
var taskCloseOver = /* @__PURE__ */ __name((context) => {
|
|
42085
42127
|
const { database, now: now2 } = context;
|
|
42086
42128
|
const liveRow = /* @__PURE__ */ __name((id2) => {
|
|
@@ -42129,7 +42171,7 @@ var taskCloseOver = /* @__PURE__ */ __name((context) => {
|
|
|
42129
42171
|
};
|
|
42130
42172
|
}, "taskCloseOver");
|
|
42131
42173
|
|
|
42132
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
42174
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/task-pairs.js
|
|
42133
42175
|
var TASK_PAIR_DECISIONS = ["review", "unsure", "merged", "rejected", "unmerged", "attached", "new"];
|
|
42134
42176
|
var taskPairsOver = /* @__PURE__ */ __name((context, similarity) => {
|
|
42135
42177
|
const { database, now: now2 } = context;
|
|
@@ -42348,7 +42390,7 @@ var taskPairsOver = /* @__PURE__ */ __name((context, similarity) => {
|
|
|
42348
42390
|
};
|
|
42349
42391
|
}, "taskPairsOver");
|
|
42350
42392
|
|
|
42351
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
42393
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/task-stats.js
|
|
42352
42394
|
var ACCOUNT_SCOPE = "t.package_id IS NOT NULL AND t.deleted_at IS NULL AND t.project_id = ?";
|
|
42353
42395
|
var TASK_STATS_SQL = {
|
|
42354
42396
|
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 +42429,7 @@ var taskStatsOver = /* @__PURE__ */ __name(({ database }, inbox) => ({
|
|
|
42387
42429
|
}, "statNames")
|
|
42388
42430
|
}), "taskStatsOver");
|
|
42389
42431
|
|
|
42390
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
42432
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/tasks.js
|
|
42391
42433
|
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
42434
|
var inboxProject = /* @__PURE__ */ __name(({ database, now: now2 }, account, create) => {
|
|
42393
42435
|
const key2 = inboxKey(account);
|
|
@@ -42603,7 +42645,7 @@ var oneOf4 = /* @__PURE__ */ __name((values, value, column2) => {
|
|
|
42603
42645
|
throw new CliError("configuration_error", `the store holds a task with an unknown ${column2} "${String(value)}"`);
|
|
42604
42646
|
}, "oneOf");
|
|
42605
42647
|
|
|
42606
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
42648
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/accounts.js
|
|
42607
42649
|
var accountAccountsOver = /* @__PURE__ */ __name((context) => {
|
|
42608
42650
|
const { database } = context;
|
|
42609
42651
|
const { accountPk: accountPk2, findAccountPk: findAccountPk2 } = keysOver(context);
|
|
@@ -42673,7 +42715,7 @@ var accountsStoreOver = /* @__PURE__ */ __name((context, keyed) => {
|
|
|
42673
42715
|
};
|
|
42674
42716
|
}, "accountsStoreOver");
|
|
42675
42717
|
|
|
42676
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
42718
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/attachments.js
|
|
42677
42719
|
var refColumn = /* @__PURE__ */ __name((ref3) => ref3 && Object.keys(ref3).length > 0 ? { providerRef: JSON.stringify(ref3) } : {}, "refColumn");
|
|
42678
42720
|
var updatePlaced = /* @__PURE__ */ __name(({ orm }, chatKey, messageId, files2, change) => {
|
|
42679
42721
|
const message3 = orm.select({ pk: messages.id }).from(messages).where(and(eq(messages.chatId, chatKey), eq(messages.externalId, messageId))).get();
|
|
@@ -42697,7 +42739,7 @@ var keepDownloads = /* @__PURE__ */ __name((context, chatKey, messageId, files2)
|
|
|
42697
42739
|
})), "keepDownloads");
|
|
42698
42740
|
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
42741
|
|
|
42700
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
42742
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/attachments.js
|
|
42701
42743
|
var accountAttachmentsOver = /* @__PURE__ */ __name((context) => {
|
|
42702
42744
|
const { database } = context;
|
|
42703
42745
|
const { findAccountPk: findAccountPk2, findChatPk: findChatPk2, chatKeyOf } = keysOver(context);
|
|
@@ -42754,7 +42796,7 @@ var attachmentsStoreOver = /* @__PURE__ */ __name((context, keyed) => ({
|
|
|
42754
42796
|
}, "keepAttachmentText")
|
|
42755
42797
|
}), "attachmentsStoreOver");
|
|
42756
42798
|
|
|
42757
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
42799
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/chat-rekey.js
|
|
42758
42800
|
var chatRow = /* @__PURE__ */ __name((context, accountKey, chatId) => context.database.prepare("SELECT * FROM chats WHERE account_id = ? AND external_id = ?").get(accountKey, chatId), "chatRow");
|
|
42759
42801
|
var pointerMover = /* @__PURE__ */ __name((context, type) => {
|
|
42760
42802
|
const statements = pointerPairs(context.database).filter(({ table }) => table !== "involvements").map(({ table, pointer }) => {
|
|
@@ -42939,7 +42981,7 @@ var rekeyChats = /* @__PURE__ */ __name((context, key2, accountKey, pairs, lockM
|
|
|
42939
42981
|
return done;
|
|
42940
42982
|
}, "rekeyChats");
|
|
42941
42983
|
|
|
42942
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
42984
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/completeness.js
|
|
42943
42985
|
var historyStartKey = /* @__PURE__ */ __name((chatId) => `history_start:${chatId}`, "historyStartKey");
|
|
42944
42986
|
var fetchedKey = /* @__PURE__ */ __name((chatId) => `fetched:${chatId}`, "fetchedKey");
|
|
42945
42987
|
var CHAT_LIST_KEY = "chat_list_complete";
|
|
@@ -42997,7 +43039,7 @@ var chatCoverage = /* @__PURE__ */ __name(({ database }, accountKey) => {
|
|
|
42997
43039
|
return { ...coverage, oldestMessageAt: toIso(oldest) };
|
|
42998
43040
|
}, "chatCoverage");
|
|
42999
43041
|
|
|
43000
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
43042
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/chats.js
|
|
43001
43043
|
var chatsStoreOver = /* @__PURE__ */ __name((context) => {
|
|
43002
43044
|
const { database } = context;
|
|
43003
43045
|
const { accountPk: accountPk2, findAccountPk: findAccountPk2, writeState: writeState2 } = keysOver(context);
|
|
@@ -43146,7 +43188,7 @@ var chatsStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
43146
43188
|
};
|
|
43147
43189
|
}, "chatsStoreOver");
|
|
43148
43190
|
|
|
43149
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
43191
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/batches.js
|
|
43150
43192
|
import { createHash as createHash7 } from "node:crypto";
|
|
43151
43193
|
var BATCH_CONTEXT = 50;
|
|
43152
43194
|
var replied = /* @__PURE__ */ __name((m) => sql`EXISTS (SELECT 1 FROM messages p WHERE p.chat_id = ${m}.chat_id
|
|
@@ -43284,7 +43326,7 @@ var saveAnswers = /* @__PURE__ */ __name((context, id2, answer) => {
|
|
|
43284
43326
|
var clearAnswers = /* @__PURE__ */ __name(({ orm }, chatKey, model) => Number(orm.all(sql`DELETE FROM message_links WHERE chat_id = ${chatKey} AND source = 'agent'
|
|
43285
43327
|
${model === void 0 ? sql`` : sql`AND method = ${model}`} RETURNING 1 AS n`).length), "clearAnswers");
|
|
43286
43328
|
|
|
43287
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
43329
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/conversations.js
|
|
43288
43330
|
import { setTimeout } from "node:timers/promises";
|
|
43289
43331
|
var position = /* @__PURE__ */ __name((sentAt, pk) => `${sentAt}:${pk}`, "position");
|
|
43290
43332
|
var linkInputs = /* @__PURE__ */ __name(({ orm }, chatKey, { after: after2, limit }) => {
|
|
@@ -43596,7 +43638,7 @@ var agentAnswers = /* @__PURE__ */ __name(({ orm }, chatKey) => new Map(orm.all(
|
|
|
43596
43638
|
AND NOT EXISTS (SELECT 1 FROM messages d
|
|
43597
43639
|
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
43640
|
|
|
43599
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
43641
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/conversations.js
|
|
43600
43642
|
var conversationsStoreOver = /* @__PURE__ */ __name((context) => {
|
|
43601
43643
|
const { database } = context;
|
|
43602
43644
|
const { findAccountPk: findAccountPk2, findChatPk: findChatPk2, chatKeyOf } = keysOver(context);
|
|
@@ -43703,7 +43745,7 @@ var conversationsStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
43703
43745
|
};
|
|
43704
43746
|
}, "conversationsStoreOver");
|
|
43705
43747
|
|
|
43706
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
43748
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/counters.js
|
|
43707
43749
|
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
43750
|
var accountCountersOver = /* @__PURE__ */ __name((context) => {
|
|
43709
43751
|
const { database } = context;
|
|
@@ -43728,7 +43770,7 @@ var countersStoreOver = /* @__PURE__ */ __name((context, keyed) => ({
|
|
|
43728
43770
|
counterTargets: /* @__PURE__ */ __name(async (execution, options) => counterTargets(context, execution, options), "counterTargets")
|
|
43729
43771
|
}), "countersStoreOver");
|
|
43730
43772
|
|
|
43731
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
43773
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/mentions.js
|
|
43732
43774
|
var MENTION_STATUSES = ["found", "linked", "proposed", "dismissed"];
|
|
43733
43775
|
var MENTION_QUERY = defineQuery({
|
|
43734
43776
|
entity: "mention",
|
|
@@ -43947,7 +43989,7 @@ var listPlaces = /* @__PURE__ */ __name((database, { limit, offset }) => {
|
|
|
43947
43989
|
return { items: hasMore ? rows.slice(0, limit) : rows, hasMore };
|
|
43948
43990
|
}, "listPlaces");
|
|
43949
43991
|
|
|
43950
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
43992
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/mentions.js
|
|
43951
43993
|
var accountMentionsOver = /* @__PURE__ */ __name((context) => {
|
|
43952
43994
|
const { database } = context;
|
|
43953
43995
|
const { findAccountPk: findAccountPk2 } = keysOver(context);
|
|
@@ -43982,7 +44024,7 @@ var mentionsStoreOver = /* @__PURE__ */ __name((context, keyed) => ({
|
|
|
43982
44024
|
places: /* @__PURE__ */ __name(async (window) => listPlaces(context.database, window), "places")
|
|
43983
44025
|
}), "mentionsStoreOver");
|
|
43984
44026
|
|
|
43985
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
44027
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/reply-times.js
|
|
43986
44028
|
var FAR = Number.MAX_SAFE_INTEGER;
|
|
43987
44029
|
var MUTED_NOW = "(coalesce(c.muted,0)=1 AND (c.muted_until IS NULL OR c.muted_until>?))";
|
|
43988
44030
|
var chatsIn = /* @__PURE__ */ __name((scope3, kinds2, now2) => {
|
|
@@ -44081,7 +44123,7 @@ var waitingChats = /* @__PURE__ */ __name((context, scope3, waits, cap) => {
|
|
|
44081
44123
|
});
|
|
44082
44124
|
}, "waitingChats");
|
|
44083
44125
|
|
|
44084
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
44126
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/chat-activity-counts.js
|
|
44085
44127
|
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
44128
|
var chatActivityCounts = /* @__PURE__ */ __name(({ database }, chatKeys, { since, until, now: now2 }) => {
|
|
44087
44129
|
const statement = database.prepare(SQL);
|
|
@@ -44101,7 +44143,7 @@ var chatActivityCounts = /* @__PURE__ */ __name(({ database }, chatKeys, { since
|
|
|
44101
44143
|
return found2;
|
|
44102
44144
|
}, "chatActivityCounts");
|
|
44103
44145
|
|
|
44104
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
44146
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/document-links.js
|
|
44105
44147
|
var documentLinkMessages = /* @__PURE__ */ __name(({ database }, chatKey, messageId) => {
|
|
44106
44148
|
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
44149
|
const rows = messageId === void 0 ? read2.all(chatKey) : read2.all(chatKey, messageId);
|
|
@@ -44116,7 +44158,7 @@ var documentLinkMessages = /* @__PURE__ */ __name(({ database }, chatKey, messag
|
|
|
44116
44158
|
}));
|
|
44117
44159
|
}, "documentLinkMessages");
|
|
44118
44160
|
|
|
44119
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
44161
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/follow-ups.js
|
|
44120
44162
|
var stemmerFor = stemmerCache();
|
|
44121
44163
|
var laterSharingRare = /* @__PURE__ */ __name((context, wanted, { rareAt, limit }) => {
|
|
44122
44164
|
if (wanted.length > 50 || !Number.isInteger(limit) || limit < 1 || limit > 100)
|
|
@@ -44160,7 +44202,7 @@ var laterSharingRare = /* @__PURE__ */ __name((context, wanted, { rareAt, limit
|
|
|
44160
44202
|
});
|
|
44161
44203
|
}, "laterSharingRare");
|
|
44162
44204
|
|
|
44163
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
44205
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/messages.js
|
|
44164
44206
|
var accountMessagesOver = /* @__PURE__ */ __name((context) => {
|
|
44165
44207
|
const { database } = context;
|
|
44166
44208
|
const { accountPk: accountPk2, findAccountPk: findAccountPk2, findChatPk: findChatPk2, chatKeyOf, chatPkFor: chatPkFor2, answeredChatPk: answeredChatPk2, upsertMessage: upsertMessage2 } = keysOver(context);
|
|
@@ -44301,7 +44343,151 @@ var messagesStoreOver = /* @__PURE__ */ __name((context, keyed) => ({
|
|
|
44301
44343
|
laterSharingRare: /* @__PURE__ */ __name(async (wanted, options) => laterSharingRare(context, wanted, options), "laterSharingRare")
|
|
44302
44344
|
}), "messagesStoreOver");
|
|
44303
44345
|
|
|
44304
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
44346
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/identity-rekey.js
|
|
44347
|
+
var quoted2 = /* @__PURE__ */ __name((name) => `"${name.replace(/"/g, '""')}"`, "quoted");
|
|
44348
|
+
var columnsOf3 = /* @__PURE__ */ __name((database, table) => database.prepare("SELECT name, pk, type FROM pragma_table_info(?)").all(table), "columnsOf");
|
|
44349
|
+
var foreignKeysTo = /* @__PURE__ */ __name((database, table) => database.prepare(`SELECT m.name AS tbl, f."from" AS col FROM sqlite_master m JOIN pragma_foreign_key_list(m.name) f
|
|
44350
|
+
WHERE m.type = 'table' AND f."table" = ? ORDER BY m.name = 'identity_links', m.name, f."from"`).all(table).map((row2) => ({ table: String(row2.tbl), column: String(row2.col) })), "foreignKeysTo");
|
|
44351
|
+
var uniqueKeys = /* @__PURE__ */ __name((database, table, column2) => {
|
|
44352
|
+
const keys = [];
|
|
44353
|
+
const primary = columnsOf3(database, table).filter((one2) => Number(one2.pk) > 0);
|
|
44354
|
+
if (primary.length === 1 && primary[0]?.name === column2 && String(primary[0]?.type).toLowerCase() === "integer")
|
|
44355
|
+
keys.push({ columns: [column2], where: null });
|
|
44356
|
+
for (const index2 of database.prepare('SELECT name, partial FROM pragma_index_list(?) WHERE "unique" = 1').all(table)) {
|
|
44357
|
+
const columns2 = database.prepare("SELECT name FROM pragma_index_info(?) ORDER BY seqno").all(String(index2.name)).map((one2) => String(one2.name));
|
|
44358
|
+
if (!columns2.includes(column2))
|
|
44359
|
+
continue;
|
|
44360
|
+
const sql2 = Number(index2.partial) ? String(database.prepare("SELECT sql FROM sqlite_master WHERE name = ?").get(String(index2.name))?.sql ?? "") : "";
|
|
44361
|
+
const where = /\bWHERE\b([\s\S]*)$/i.exec(sql2)?.[1]?.trim() ?? null;
|
|
44362
|
+
keys.push({ columns: columns2, where });
|
|
44363
|
+
}
|
|
44364
|
+
return keys;
|
|
44365
|
+
}, "uniqueKeys");
|
|
44366
|
+
var rowKey = /* @__PURE__ */ __name((database, table) => columnsOf3(database, table).some((one2) => one2.name === "id" && Number(one2.pk) === 1) ? "id" : "rowid", "rowKey");
|
|
44367
|
+
var moveRows = /* @__PURE__ */ __name((context, table, column2, from2, to) => {
|
|
44368
|
+
const { database } = context;
|
|
44369
|
+
const t = quoted2(table);
|
|
44370
|
+
const c = quoted2(column2);
|
|
44371
|
+
database.prepare(`UPDATE OR IGNORE ${t} SET ${c} = ? WHERE ${c} = ?`).run(to, from2);
|
|
44372
|
+
const key2 = rowKey(database, table);
|
|
44373
|
+
const left = database.prepare(`SELECT ${key2} AS pk, * FROM ${t} WHERE ${c} = ?`).all(from2);
|
|
44374
|
+
if (left.length === 0)
|
|
44375
|
+
return;
|
|
44376
|
+
const keys = uniqueKeys(database, table, column2);
|
|
44377
|
+
const fill = columnsOf3(database, table).map((one2) => String(one2.name)).filter((name) => name !== column2 && name !== "id");
|
|
44378
|
+
for (const row2 of left) {
|
|
44379
|
+
const twin = twinOf(database, table, column2, to, row2, keys);
|
|
44380
|
+
if (twin === void 0)
|
|
44381
|
+
throw new CliError("conflict", `${table}.${column2}: a row of the old identity has no counterpart to merge into`, {
|
|
44382
|
+
reason: "identity.merge-conflict"
|
|
44383
|
+
});
|
|
44384
|
+
foldRow(context, table, key2, fill, Number(row2.pk), twin);
|
|
44385
|
+
for (const ref3 of foreignKeysTo(database, table))
|
|
44386
|
+
moveRows(context, ref3.table, ref3.column, Number(row2.pk), twin);
|
|
44387
|
+
database.prepare(`DELETE FROM ${t} WHERE ${key2} = ?`).run(Number(row2.pk));
|
|
44388
|
+
}
|
|
44389
|
+
}, "moveRows");
|
|
44390
|
+
var twinOf = /* @__PURE__ */ __name((database, table, column2, to, row2, keys) => {
|
|
44391
|
+
const key2 = rowKey(database, table);
|
|
44392
|
+
for (const unique2 of keys) {
|
|
44393
|
+
const others = unique2.columns.filter((one2) => one2 !== column2);
|
|
44394
|
+
const found2 = database.prepare(`SELECT ${key2} AS pk FROM ${quoted2(table)} WHERE ${quoted2(column2)} = ?` + others.map((one2) => ` AND ${quoted2(one2)} IS ?`).join("") + (unique2.where ? ` AND (${unique2.where})` : "")).get(to, ...others.map((one2) => row2[one2]));
|
|
44395
|
+
if (found2)
|
|
44396
|
+
return Number(found2.pk);
|
|
44397
|
+
}
|
|
44398
|
+
return void 0;
|
|
44399
|
+
}, "twinOf");
|
|
44400
|
+
var foldRow = /* @__PURE__ */ __name((context, table, key2, fill, from2, to) => {
|
|
44401
|
+
const t = quoted2(table);
|
|
44402
|
+
const latest4 = new Set(table === "account_identities" ? ["last_messaged_at", "address_book"] : []);
|
|
44403
|
+
const sets = fill.map((name) => latest4.has(name) ? `${quoted2(name)} = max(coalesce(${quoted2(name)}, 0), coalesce((SELECT o.${quoted2(name)} FROM ${t} o WHERE o.${key2} = ?), 0))` : `${quoted2(name)} = coalesce(${quoted2(name)}, (SELECT o.${quoted2(name)} FROM ${t} o WHERE o.${key2} = ?))`);
|
|
44404
|
+
if (sets.length === 0)
|
|
44405
|
+
return;
|
|
44406
|
+
context.database.prepare(`UPDATE ${t} SET ${sets.join(", ")} WHERE ${key2} = ?`).run(...fill.map(() => from2), to);
|
|
44407
|
+
}, "foldRow");
|
|
44408
|
+
var renameInProposals = /* @__PURE__ */ __name((database, provider, from2, to) => {
|
|
44409
|
+
const [old, renamed] = [`${provider}:${from2}`, `${provider}:${to}`];
|
|
44410
|
+
const persons2 = [];
|
|
44411
|
+
const rows = database.prepare("SELECT id, payload FROM proposed_actions WHERE kind IN ('identity_link', 'identity_split') AND instr(payload, ?) > 0").all(JSON.stringify(old));
|
|
44412
|
+
for (const row2 of rows) {
|
|
44413
|
+
const payload = JSON.parse(String(row2.payload));
|
|
44414
|
+
for (const field4 of ["identity", "with"])
|
|
44415
|
+
if (payload[field4] === old)
|
|
44416
|
+
payload[field4] = renamed;
|
|
44417
|
+
if (Array.isArray(payload.identities))
|
|
44418
|
+
payload.identities = payload.identities.map((one2) => one2 === old ? renamed : one2);
|
|
44419
|
+
if (Array.isArray(payload.persons))
|
|
44420
|
+
for (const one2 of payload.persons)
|
|
44421
|
+
persons2.push(Number(one2));
|
|
44422
|
+
database.prepare("UPDATE proposed_actions SET payload = ? WHERE id = ?").run(JSON.stringify(payload), Number(row2.id));
|
|
44423
|
+
}
|
|
44424
|
+
return persons2;
|
|
44425
|
+
}, "renameInProposals");
|
|
44426
|
+
var personOfIdentity2 = /* @__PURE__ */ __name((database, identity) => {
|
|
44427
|
+
const row2 = database.prepare("SELECT person_id FROM identity_links WHERE identity_id = ?").get(identity);
|
|
44428
|
+
return row2 ? Number(row2.person_id) : void 0;
|
|
44429
|
+
}, "personOfIdentity");
|
|
44430
|
+
var rekeyIdentity = /* @__PURE__ */ __name((context, provider, { from: from2, to, phone }, by) => {
|
|
44431
|
+
const { database } = context;
|
|
44432
|
+
if (!to.trim())
|
|
44433
|
+
return "skipped";
|
|
44434
|
+
if (from2 === to)
|
|
44435
|
+
return "unchanged";
|
|
44436
|
+
const find2 = database.prepare("SELECT * FROM identities WHERE provider = ? AND external_id = ?");
|
|
44437
|
+
const old = find2.get(provider, from2);
|
|
44438
|
+
if (!old)
|
|
44439
|
+
return "unchanged";
|
|
44440
|
+
const oldId = Number(old.id);
|
|
44441
|
+
const kept2 = find2.get(provider, to);
|
|
44442
|
+
const persons2 = renameInProposals(database, provider, from2, to);
|
|
44443
|
+
if (!kept2) {
|
|
44444
|
+
database.prepare("UPDATE identities SET external_id = ?, updated_at = ? WHERE id = ?").run(to, context.now(), oldId);
|
|
44445
|
+
if (phone !== void 0)
|
|
44446
|
+
database.prepare("UPDATE identities SET phone = ? WHERE id = ?").run(phone, oldId);
|
|
44447
|
+
settleLinks(database, persons2);
|
|
44448
|
+
return "renamed";
|
|
44449
|
+
}
|
|
44450
|
+
const keptId = Number(kept2.id);
|
|
44451
|
+
const [mine, theirs] = [personOfIdentity2(database, oldId), personOfIdentity2(database, keptId)];
|
|
44452
|
+
if (mine !== void 0 && theirs !== void 0 && mine !== theirs)
|
|
44453
|
+
persons2.push(mergePerson(context, mine, theirs, { method: "identity-rekey", by }));
|
|
44454
|
+
for (const { table, pointer } of pointerPairs(database)) {
|
|
44455
|
+
const where = `WHERE ${pointer}_type = 'identity' AND ${pointer}_id = ?`;
|
|
44456
|
+
database.prepare(`UPDATE OR IGNORE ${quoted2(table)} SET ${pointer}_id = ? ${where}`).run(keptId, oldId);
|
|
44457
|
+
database.prepare(`DELETE FROM ${quoted2(table)} ${where}`).run(oldId);
|
|
44458
|
+
}
|
|
44459
|
+
for (const { table, column: column2 } of foreignKeysTo(database, "identities"))
|
|
44460
|
+
moveRows(context, table, column2, oldId, keptId);
|
|
44461
|
+
const fill = ["username", "name", "bot", "phone_hmac", "metadata", "description", "email", "phone"];
|
|
44462
|
+
database.prepare(`UPDATE identities SET ${fill.map((name) => `${name} = coalesce(${name}, (SELECT o.${name} FROM identities o WHERE o.id = ?))`).join(", ")}, updated_at = ? WHERE id = ?`).run(...fill.map(() => oldId), context.now(), keptId);
|
|
44463
|
+
database.prepare("DELETE FROM identities WHERE id = ?").run(oldId);
|
|
44464
|
+
if (phone !== void 0)
|
|
44465
|
+
database.prepare("UPDATE identities SET phone = ? WHERE id = ?").run(phone, keptId);
|
|
44466
|
+
settleLinks(database, [...persons2, ...theirs === void 0 ? [] : [theirs]]);
|
|
44467
|
+
return "merged";
|
|
44468
|
+
}, "rekeyIdentity");
|
|
44469
|
+
var rekeyIdentities = /* @__PURE__ */ __name((context, provider, pairs, { lockMs, by }) => {
|
|
44470
|
+
const done = { taken: 0, renamed: 0, merged: 0, unchanged: 0, skipped: 0, refused: [], touched: [] };
|
|
44471
|
+
const started = performance.now();
|
|
44472
|
+
const now2 = context.database.prepare("SELECT id FROM identities WHERE provider = ? AND external_id = ?");
|
|
44473
|
+
for (const pair of pairs) {
|
|
44474
|
+
if (done.taken > 0 && performance.now() - started >= lockMs)
|
|
44475
|
+
break;
|
|
44476
|
+
done.taken += 1;
|
|
44477
|
+
try {
|
|
44478
|
+
const outcome = write(context.database, () => rekeyIdentity(context, provider, pair, by));
|
|
44479
|
+
done[outcome] += 1;
|
|
44480
|
+
const id2 = now2.get(provider, pair.to)?.id;
|
|
44481
|
+
if ((outcome === "renamed" || outcome === "merged") && id2 != null)
|
|
44482
|
+
done.touched.push(Number(id2));
|
|
44483
|
+
} catch (error) {
|
|
44484
|
+
done.refused.push({ from: pair.from, to: pair.to, error });
|
|
44485
|
+
}
|
|
44486
|
+
}
|
|
44487
|
+
return done;
|
|
44488
|
+
}, "rekeyIdentities");
|
|
44489
|
+
|
|
44490
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/domain/person-kinds.js
|
|
44305
44491
|
var PERSON_KINDS = ["person", "organization", "automated", "stranger", "unsorted", "test"];
|
|
44306
44492
|
var AUTOMATED_WORDS = /* @__PURE__ */ new Set([
|
|
44307
44493
|
"noreply",
|
|
@@ -44364,12 +44550,12 @@ var isCompanyName = /* @__PURE__ */ __name((name) => {
|
|
|
44364
44550
|
return wordsOf3(name.replaceAll(".", "")).some((word2) => LEGAL_FORMS.has(word2) || COMPANY_WORDS.has(word2));
|
|
44365
44551
|
}, "isCompanyName");
|
|
44366
44552
|
|
|
44367
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
44553
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/person-ties.js
|
|
44368
44554
|
var SMALL_GROUP_MEMBERS = 10;
|
|
44369
44555
|
var PERSON_TIES = ["chat", "small-group", "mail", "meeting", "crm", "phone-book"];
|
|
44370
44556
|
var ALWAYS_SHOWN = ["owner", "added", "task"];
|
|
44371
44557
|
var crmProviders = /* @__PURE__ */ __name(() => providers().filter((entry2) => kindsOfEntry(entry2).includes("crm")).map(({ name }) => name), "crmProviders");
|
|
44372
|
-
var
|
|
44558
|
+
var quoted3 = /* @__PURE__ */ __name((value) => `'${value.replaceAll("'", "''")}'`, "quoted");
|
|
44373
44559
|
var GROUP_SIZE = "coalesce(c.participants_count, (SELECT mc.listed_count FROM member_counts mc WHERE mc.chat_id = c.id ORDER BY mc.date DESC LIMIT 1))";
|
|
44374
44560
|
var chatPeople = /* @__PURE__ */ __name((where, few) => {
|
|
44375
44561
|
const members2 = `SELECT m.identity_id FROM chats c JOIN chat_members m ON m.chat_id = c.id WHERE ${where}`;
|
|
@@ -44382,7 +44568,7 @@ var OWNERS_CRM_PEOPLE = "SELECT id FROM persons WHERE owner = 1 UNION SELECT e.f
|
|
|
44382
44568
|
var crmTie = /* @__PURE__ */ __name((crm) => {
|
|
44383
44569
|
if (crm.length === 0)
|
|
44384
44570
|
return "SELECT NULL WHERE 0";
|
|
44385
|
-
const providers2 = crm.map(
|
|
44571
|
+
const providers2 = crm.map(quoted3).join(", ");
|
|
44386
44572
|
const contacts2 = `SELECT d.to_id FROM links d JOIN links o ON o.from_type = d.from_type AND o.from_id = d.from_id AND o.kind = 'related-to' AND o.role = 'owner' AND o.to_type = 'person' AND o.deleted_at IS NULL WHERE d.from_type IN ('deal', 'lead') AND d.kind = 'related-to' AND d.to_type = 'person' AND d.role IS NOT 'owner' AND d.deleted_at IS NULL AND o.to_id IN (${OWNERS_CRM_PEOPLE})`;
|
|
44387
44573
|
return `SELECT id FROM identities WHERE provider IN (${providers2}) AND external_id LIKE '%/user/%' UNION SELECT l.identity_id FROM identity_links l WHERE l.person_id IN (${contacts2}) UNION SELECT e.identity_id FROM identity_link_events e WHERE e.from_person_id IN (${contacts2}) AND ${mergeSql("e")}`;
|
|
44388
44574
|
}, "crmTie");
|
|
@@ -44419,7 +44605,7 @@ var shownReasons = /* @__PURE__ */ __name((database, people2) => {
|
|
|
44419
44605
|
return new Map([...found2].map(([person2, reasons]) => [person2, ORDER.filter((one2) => reasons.has(one2))]));
|
|
44420
44606
|
}, "shownReasons");
|
|
44421
44607
|
|
|
44422
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
44608
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/people-list.js
|
|
44423
44609
|
var PEOPLE_SORTS = ["interactions", "recent", "name", "tasks"];
|
|
44424
44610
|
var MIN_QUERY = 3;
|
|
44425
44611
|
var matching2 = /* @__PURE__ */ __name((query) => {
|
|
@@ -44764,7 +44950,7 @@ var similarPeople = /* @__PURE__ */ __name((database, typed, limit) => {
|
|
|
44764
44950
|
return withLastContact(database, rows).map((person2, at2) => ({ ...person2, sameName: same[at2] === true }));
|
|
44765
44951
|
}, "similarPeople");
|
|
44766
44952
|
|
|
44767
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
44953
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/person-doubts.js
|
|
44768
44954
|
var DOUBT_REASONS = ["owner-other-name", "test-data", "shared-address", "mixed-names"];
|
|
44769
44955
|
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
44956
|
var text5 = /* @__PURE__ */ __name((value) => typeof value === "string" && value.trim() !== "" ? value : null, "text");
|
|
@@ -44837,9 +45023,9 @@ var nameGroups = /* @__PURE__ */ __name((held) => {
|
|
|
44837
45023
|
const weight = /* @__PURE__ */ __name((members2) => members2.reduce((sum, one2) => sum + 1 + (one2.by === "owner" ? 2 : 0) + (one2.account ? 2 : 0), 0) + (members2.some((one2) => sharesWord(heldWords(one2), own)) ? 2 : 0), "weight");
|
|
44838
45024
|
return [...groups.values()].sort((a, b) => weight(b) - weight(a) || a[0].pk - b[0].pk);
|
|
44839
45025
|
}, "nameGroups");
|
|
44840
|
-
var
|
|
45026
|
+
var quoted4 = /* @__PURE__ */ __name((held) => [...new Set(held.map(({ name, ref: ref3 }) => name ?? ref3))].map((name) => `\xAB${name}\xBB`).join(", "), "quoted");
|
|
44841
45027
|
var whyOf = /* @__PURE__ */ __name((found2) => {
|
|
44842
|
-
const names =
|
|
45028
|
+
const names = quoted4(found2.held);
|
|
44843
45029
|
if (found2.reason === "owner-other-name")
|
|
44844
45030
|
return `your own person holds ${names}, under another name than yours: an account or mailbox you read may be someone else's`;
|
|
44845
45031
|
if (found2.reason === "test-data")
|
|
@@ -45020,7 +45206,7 @@ var markTestData = /* @__PURE__ */ __name((context, uid, by) => {
|
|
|
45020
45206
|
return { person: `person:${person2}`, identities: identities2 };
|
|
45021
45207
|
}, "markTestData");
|
|
45022
45208
|
|
|
45023
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
45209
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/person-preparation.js
|
|
45024
45210
|
var GLOBAL_PROJECT = "SELECT id FROM main.projects WHERE account_id IS NULL AND deleted_at IS NULL";
|
|
45025
45211
|
var IN_SCOPES = "IN (SELECT value FROM json_each(?))";
|
|
45026
45212
|
var projectScope = /* @__PURE__ */ __name((id2) => `(SELECT p.scope FROM main.projects p WHERE p.id=${id2})`, "projectScope");
|
|
@@ -45089,7 +45275,7 @@ var personPreparation = /* @__PURE__ */ __name(({ database, now: now2 }, uid, {
|
|
|
45089
45275
|
});
|
|
45090
45276
|
}, "personPreparation");
|
|
45091
45277
|
|
|
45092
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
45278
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/person-scope.js
|
|
45093
45279
|
var personSeenInAccounts = /* @__PURE__ */ __name(({ database }, uid, accountIds) => {
|
|
45094
45280
|
const id2 = Number(uid);
|
|
45095
45281
|
if (!/^[1-9]\d*$/.test(uid) || !Number.isSafeInteger(id2) || !accountIds.length || accountIds.length > 1e3 || accountIds.some((account) => !Number.isSafeInteger(account) || account <= 0))
|
|
@@ -45097,7 +45283,7 @@ var personSeenInAccounts = /* @__PURE__ */ __name(({ database }, uid, accountIds
|
|
|
45097
45283
|
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
45284
|
}, "personSeenInAccounts");
|
|
45099
45285
|
|
|
45100
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
45286
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/private-people.js
|
|
45101
45287
|
var required2 = /* @__PURE__ */ __name(({ database }, key2, personId) => {
|
|
45102
45288
|
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
45289
|
if (!row2)
|
|
@@ -45164,7 +45350,7 @@ var removeNote = /* @__PURE__ */ __name((context, key2, personId, id2) => {
|
|
|
45164
45350
|
return { id: id2, personId, removed: true };
|
|
45165
45351
|
}, "removeNote");
|
|
45166
45352
|
|
|
45167
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
45353
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/people.js
|
|
45168
45354
|
var accountPeopleOver = /* @__PURE__ */ __name((context) => {
|
|
45169
45355
|
const { database } = context;
|
|
45170
45356
|
const { accountPk: accountPk2, findAccountPk: findAccountPk2, identityPk: identityPk2 } = keysOver(context);
|
|
@@ -45267,6 +45453,12 @@ var peopleStoreOver = /* @__PURE__ */ __name((context, keyed) => {
|
|
|
45267
45453
|
unlinkIdentity: /* @__PURE__ */ __name(async (identity, options) => {
|
|
45268
45454
|
return write(database, () => unlinkIdentity(context, identity, options));
|
|
45269
45455
|
}, "unlinkIdentity"),
|
|
45456
|
+
rekeyIdentities: /* @__PURE__ */ __name(async (provider, pairs, { lockMs = 250, by = provider } = {}) => {
|
|
45457
|
+
const done = write(database, () => rekeyIdentities(context, provider, pairs, { lockMs, by }));
|
|
45458
|
+
if (done.touched.length > 0)
|
|
45459
|
+
linkPhones(context, new Set(done.touched));
|
|
45460
|
+
return done;
|
|
45461
|
+
}, "rekeyIdentities"),
|
|
45270
45462
|
merges: /* @__PURE__ */ __name(async (uid) => merges(context, uid), "merges"),
|
|
45271
45463
|
undoMerge: /* @__PURE__ */ __name(async (to, from2, by) => write(database, () => undoMerge(context, to, from2, by)), "undoMerge"),
|
|
45272
45464
|
split: /* @__PURE__ */ __name(async (uid, chosen, by) => write(database, () => split(context, uid, chosen, by)), "split"),
|
|
@@ -45291,13 +45483,13 @@ var peopleStoreOver = /* @__PURE__ */ __name((context, keyed) => {
|
|
|
45291
45483
|
};
|
|
45292
45484
|
}, "peopleStoreOver");
|
|
45293
45485
|
|
|
45294
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
45486
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/admin-statistics.js
|
|
45295
45487
|
import { createHash as createHash9 } from "node:crypto";
|
|
45296
45488
|
|
|
45297
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
45489
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/domain/admin-statistics.js
|
|
45298
45490
|
import { createHash as createHash8 } from "node:crypto";
|
|
45299
45491
|
|
|
45300
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
45492
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/domain/rankings-options.js
|
|
45301
45493
|
var MESSAGE_MEASURES = ["views", "reactions", "forwards", "comments", "replies", "thread-size"];
|
|
45302
45494
|
var AUTHOR_MEASURES = [
|
|
45303
45495
|
"messages",
|
|
@@ -45437,7 +45629,7 @@ var withoutUrls = /* @__PURE__ */ __name((text8) => text8.replace(/\S+/gu, (toke
|
|
|
45437
45629
|
var rankingWords = /* @__PURE__ */ __name((text8) => withoutUrls(text8).match(/[\p{L}\p{N}]+/gu)?.length ?? 0, "rankingWords");
|
|
45438
45630
|
var rankingQuestion = /* @__PURE__ */ __name((text8) => withoutUrls(text8).includes("?"), "rankingQuestion");
|
|
45439
45631
|
|
|
45440
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
45632
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/domain/rankings-graph.js
|
|
45441
45633
|
var RANKING_GRAPH_LIMITS = { nodes: 5e4, depth: 256, work: 1e7, bytes: 8388608 };
|
|
45442
45634
|
var exhausted2 = /* @__PURE__ */ __name((budget) => {
|
|
45443
45635
|
throw new CliError("validation_error", `ranking exceeded ${budget} \u2014 narrow its chat or date scope`, {
|
|
@@ -45659,7 +45851,7 @@ var rankReplyGraph = /* @__PURE__ */ __name((nodes, check3 = () => {
|
|
|
45659
45851
|
};
|
|
45660
45852
|
}, "rankReplyGraph");
|
|
45661
45853
|
|
|
45662
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
45854
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/domain/admin-statistics.js
|
|
45663
45855
|
var adminEntityKey = /* @__PURE__ */ __name((row2) => JSON.stringify([row2.account.provider, row2.account.account, row2.id]), "adminEntityKey");
|
|
45664
45856
|
var personKey = /* @__PURE__ */ __name((node) => JSON.stringify([node.account.provider, node.account.account, node.sender]), "personKey");
|
|
45665
45857
|
var locator = /* @__PURE__ */ __name((node) => formatLocator({ ...node.account, chat: node.chatId, message: node.id }), "locator");
|
|
@@ -45833,7 +46025,7 @@ var calculateAdminStatistics = /* @__PURE__ */ __name((nodes, stays, options, in
|
|
|
45833
46025
|
return { items, evidence, summary, graph: graph.quality };
|
|
45834
46026
|
}, "calculateAdminStatistics");
|
|
45835
46027
|
|
|
45836
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
46028
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/domain/rankings-range.js
|
|
45837
46029
|
var rankingContextRange = /* @__PURE__ */ __name((root) => {
|
|
45838
46030
|
const dates = [];
|
|
45839
46031
|
const visit = /* @__PURE__ */ __name((node, required3) => {
|
|
@@ -45855,7 +46047,7 @@ var rankingContextRange = /* @__PURE__ */ __name((root) => {
|
|
|
45855
46047
|
return dates[0].node.resolution.date;
|
|
45856
46048
|
}, "rankingContextRange");
|
|
45857
46049
|
|
|
45858
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
46050
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/rankings.js
|
|
45859
46051
|
var reactionCounts = /* @__PURE__ */ __name((stored4) => {
|
|
45860
46052
|
let counts;
|
|
45861
46053
|
try {
|
|
@@ -46150,7 +46342,7 @@ var rankQuery = /* @__PURE__ */ __name((context, execution, request, inspect) =>
|
|
|
46150
46342
|
});
|
|
46151
46343
|
}, "rankQuery");
|
|
46152
46344
|
|
|
46153
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
46345
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/admin-statistics.js
|
|
46154
46346
|
function fail2(message3, reason = "query.too-large") {
|
|
46155
46347
|
throw new CliError("validation_error", message3, { reason, complete: false });
|
|
46156
46348
|
}
|
|
@@ -46327,7 +46519,7 @@ var adminStatisticsQuery = /* @__PURE__ */ __name((context, execution, request)
|
|
|
46327
46519
|
return result;
|
|
46328
46520
|
}), "adminStatisticsQuery");
|
|
46329
46521
|
|
|
46330
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
46522
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/conversation-eligibility.js
|
|
46331
46523
|
var conversationEligibility = /* @__PURE__ */ __name(async (context, execution) => {
|
|
46332
46524
|
if (!execution.accounts.length)
|
|
46333
46525
|
return { conversations: [], chats: [] };
|
|
@@ -46345,7 +46537,7 @@ var conversationEligibility = /* @__PURE__ */ __name(async (context, execution)
|
|
|
46345
46537
|
return { conversations: conversations2, chats: chats2 };
|
|
46346
46538
|
}, "conversationEligibility");
|
|
46347
46539
|
|
|
46348
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
46540
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/ranking-evidence.js
|
|
46349
46541
|
import { createHash as createHash10 } from "node:crypto";
|
|
46350
46542
|
var EVIDENCE_BYTES = 64 * 1024;
|
|
46351
46543
|
var FINGERPRINT_BYTES = 8 * 1024 * 1024;
|
|
@@ -46495,7 +46687,7 @@ var rankingEvidence = /* @__PURE__ */ __name((context, execution, request) => {
|
|
|
46495
46687
|
return result;
|
|
46496
46688
|
}, "rankingEvidence");
|
|
46497
46689
|
|
|
46498
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
46690
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/queries.js
|
|
46499
46691
|
var queriesStoreOver = /* @__PURE__ */ __name((context, stemmerFor2) => {
|
|
46500
46692
|
const mailIndexed = /* @__PURE__ */ __name((execution) => {
|
|
46501
46693
|
if (execution.corpus === "mail")
|
|
@@ -46516,7 +46708,7 @@ var queriesStoreOver = /* @__PURE__ */ __name((context, stemmerFor2) => {
|
|
|
46516
46708
|
};
|
|
46517
46709
|
}, "queriesStoreOver");
|
|
46518
46710
|
|
|
46519
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
46711
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/chat-events.js
|
|
46520
46712
|
var saveChatEvents = /* @__PURE__ */ __name((context, accountKey, provider, chatKey, events3) => {
|
|
46521
46713
|
const { database, now: now2 } = context;
|
|
46522
46714
|
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 +46747,10 @@ var chatEventsOf = /* @__PURE__ */ __name(({ database }, chatKey, { since = 0, l
|
|
|
46555
46747
|
}));
|
|
46556
46748
|
}, "chatEventsOf");
|
|
46557
46749
|
|
|
46558
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
46750
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/retention.js
|
|
46559
46751
|
import { createHash as createHash11 } from "node:crypto";
|
|
46560
46752
|
|
|
46561
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
46753
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/domain/calendar.js
|
|
46562
46754
|
var calendarKey = /* @__PURE__ */ __name((zone, by) => {
|
|
46563
46755
|
const format = new Intl.DateTimeFormat("en-CA", {
|
|
46564
46756
|
timeZone: zone,
|
|
@@ -46578,7 +46770,7 @@ var weekKey = /* @__PURE__ */ __name((day3) => {
|
|
|
46578
46770
|
return date3.toISOString().slice(0, 10);
|
|
46579
46771
|
}, "weekKey");
|
|
46580
46772
|
|
|
46581
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
46773
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/domain/retention.js
|
|
46582
46774
|
var RETENTION_TOLERANCE = 864e5;
|
|
46583
46775
|
var validateRetentionOptions = /* @__PURE__ */ __name((options) => {
|
|
46584
46776
|
const { since, until, cutoff, checkpoints, within, limit, by } = options;
|
|
@@ -46632,7 +46824,7 @@ var retentionCohorts = /* @__PURE__ */ __name((stays, options) => {
|
|
|
46632
46824
|
return [...groups.values()].sort((a, b) => a.cohort.localeCompare(b.cohort));
|
|
46633
46825
|
}, "retentionCohorts");
|
|
46634
46826
|
|
|
46635
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
46827
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/retention.js
|
|
46636
46828
|
var iso10 = /* @__PURE__ */ __name((at2) => new Date(at2).toISOString(), "iso");
|
|
46637
46829
|
var retentionQuery = /* @__PURE__ */ __name((context, accountPk2, chatPk, chatId, options, evidence) => {
|
|
46638
46830
|
validateRetentionOptions(options);
|
|
@@ -46763,7 +46955,7 @@ var retentionQuery = /* @__PURE__ */ __name((context, accountPk2, chatPk, chatId
|
|
|
46763
46955
|
};
|
|
46764
46956
|
}, "retentionQuery");
|
|
46765
46957
|
|
|
46766
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
46958
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/roster.js
|
|
46767
46959
|
var iso11 = /* @__PURE__ */ __name((ms) => ms === null ? null : new Date(ms).toISOString(), "iso");
|
|
46768
46960
|
var marksOf = /* @__PURE__ */ __name(({ isBot: isBot2, flagged, deleted, hasPhoto }) => ({
|
|
46769
46961
|
...isBot2 === void 0 ? {} : { bot: isBot2 },
|
|
@@ -46892,7 +47084,7 @@ var trackedChats = /* @__PURE__ */ __name((context, accountKey, where) => contex
|
|
|
46892
47084
|
lastCount: memberCountsOf(context, pk).at(-1) ?? null
|
|
46893
47085
|
})), "trackedChats");
|
|
46894
47086
|
|
|
46895
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
47087
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/roster.js
|
|
46896
47088
|
var rosterStoreOver = /* @__PURE__ */ __name((context) => {
|
|
46897
47089
|
const { database } = context;
|
|
46898
47090
|
const { accountPk: accountPk2, findAccountPk: findAccountPk2, chatKeyOf, chatPkFor: chatPkFor2, writeMembers: writeMembers2 } = keysOver(context);
|
|
@@ -46948,7 +47140,7 @@ var rosterStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
46948
47140
|
};
|
|
46949
47141
|
}, "rosterStoreOver");
|
|
46950
47142
|
|
|
46951
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
47143
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/backfill.js
|
|
46952
47144
|
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
47145
|
var backfillNormalized = /* @__PURE__ */ __name((database, { batch = 5e3, onBatch, until = /* @__PURE__ */ __name(() => false, "until") } = {}) => {
|
|
46954
47146
|
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 +47164,7 @@ var backfillNormalized = /* @__PURE__ */ __name((database, { batch = 5e3, onBatc
|
|
|
46972
47164
|
}
|
|
46973
47165
|
}, "backfillNormalized");
|
|
46974
47166
|
|
|
46975
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
47167
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/search-index.js
|
|
46976
47168
|
var INDEX2 = "message_words";
|
|
46977
47169
|
var searchIndexState2 = /* @__PURE__ */ __name((database) => {
|
|
46978
47170
|
const row2 = indexRow(database, INDEX2);
|
|
@@ -47099,7 +47291,7 @@ var resetSearchIndex = /* @__PURE__ */ __name((database) => {
|
|
|
47099
47291
|
});
|
|
47100
47292
|
}, "resetSearchIndex");
|
|
47101
47293
|
|
|
47102
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
47294
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/stems-fill.js
|
|
47103
47295
|
var fillStems = /* @__PURE__ */ __name((database, { batch = 5e3, until = /* @__PURE__ */ __name(() => false, "until"), onBatch, now: now2 = Date.now } = {}) => {
|
|
47104
47296
|
const filled = { stemmed: 0, drained: 0 };
|
|
47105
47297
|
const before2 = stemsState(database);
|
|
@@ -47194,7 +47386,7 @@ var followDefaultStemmers = /* @__PURE__ */ __name((database, now2 = Date.now) =
|
|
|
47194
47386
|
return resetStems(database, { now: now2 });
|
|
47195
47387
|
}, "followDefaultStemmers");
|
|
47196
47388
|
|
|
47197
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
47389
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/words.js
|
|
47198
47390
|
var VOCABULARY = "SELECT term, doc FROM message_words_vocab WHERE col = 'normalized_text'";
|
|
47199
47391
|
var knownTerms = /* @__PURE__ */ __name(({ database }, terms) => {
|
|
47200
47392
|
const lookup = database.prepare(`${VOCABULARY} AND term >= ? AND term <= ? LIMIT 1`);
|
|
@@ -47216,7 +47408,7 @@ var termCandidates = /* @__PURE__ */ __name(({ database }, pieces, { shortest, l
|
|
|
47216
47408
|
});
|
|
47217
47409
|
}, "termCandidates");
|
|
47218
47410
|
|
|
47219
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
47411
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/search-index.js
|
|
47220
47412
|
var searchIndexStoreOver = /* @__PURE__ */ __name((context) => {
|
|
47221
47413
|
const { database } = context;
|
|
47222
47414
|
const stemmerFor2 = stemmerCache();
|
|
@@ -47240,7 +47432,7 @@ var searchIndexStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
47240
47432
|
};
|
|
47241
47433
|
}, "searchIndexStoreOver");
|
|
47242
47434
|
|
|
47243
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
47435
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/searches.js
|
|
47244
47436
|
var HISTORY_KEPT = 1e3;
|
|
47245
47437
|
var commandFilter = /* @__PURE__ */ __name((commands) => commands ? { sql: ` AND command IN (${commands.map(() => "?").join(", ")})`, values: [...commands] } : { sql: "", values: [] }, "commandFilter");
|
|
47246
47438
|
var COLUMNS6 = "id, name, command, params, language, version, fields_version, created_at, updated_at, last_run_at, runs";
|
|
@@ -47310,7 +47502,7 @@ var clearHistory = /* @__PURE__ */ __name(({ database }, commands) => {
|
|
|
47310
47502
|
return database.prepare(`DELETE FROM searches WHERE name IS NULL${only.sql}`).run(...only.values).changes;
|
|
47311
47503
|
}, "clearHistory");
|
|
47312
47504
|
|
|
47313
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
47505
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/searches.js
|
|
47314
47506
|
var searchesStoreOver = /* @__PURE__ */ __name((context) => {
|
|
47315
47507
|
const { database } = context;
|
|
47316
47508
|
return {
|
|
@@ -47334,7 +47526,7 @@ var searchesStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
47334
47526
|
};
|
|
47335
47527
|
}, "searchesStoreOver");
|
|
47336
47528
|
|
|
47337
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
47529
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/added-sources.js
|
|
47338
47530
|
import { createHash as createHash12 } from "node:crypto";
|
|
47339
47531
|
var ADDED_KINDS = ["text", "file", "page"];
|
|
47340
47532
|
var TEXT_COLUMNS = "kind = ?, title = ?, file_name = ?, extension = ?, url = ?, mime = ?, size = ?, content_hash = ?, body = ?, extraction = ?, metadata = ?, language = ?";
|
|
@@ -47576,7 +47768,7 @@ var addedSourcesOver = /* @__PURE__ */ __name((context) => {
|
|
|
47576
47768
|
};
|
|
47577
47769
|
}, "addedSourcesOver");
|
|
47578
47770
|
|
|
47579
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
47771
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/agent-actions.js
|
|
47580
47772
|
var ACTION_TIERS = ["read", "draft", "write-private", "write-public", "destructive", "admin"];
|
|
47581
47773
|
var ACTION_OUTCOMES = ["ok", "refused", "failed"];
|
|
47582
47774
|
var CODE = /^[a-z][a-z0-9_]{0,63}$/;
|
|
@@ -47624,7 +47816,7 @@ var agentActionsStoreOver = /* @__PURE__ */ __name((context, afterRecord = () =>
|
|
|
47624
47816
|
};
|
|
47625
47817
|
}, "agentActionsStoreOver");
|
|
47626
47818
|
|
|
47627
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
47819
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/base-suggest.js
|
|
47628
47820
|
var baseSettingKey = /* @__PURE__ */ __name((kind3) => `stages.base.${kind3}`, "baseSettingKey");
|
|
47629
47821
|
var storedPipeline = /* @__PURE__ */ __name((value) => {
|
|
47630
47822
|
if (typeof value !== "string")
|
|
@@ -47670,7 +47862,7 @@ var suggestBaseStages = /* @__PURE__ */ __name((database, kind3, pipelines2, { o
|
|
|
47670
47862
|
}
|
|
47671
47863
|
}, "suggestBaseStages");
|
|
47672
47864
|
|
|
47673
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
47865
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/domain/records.js
|
|
47674
47866
|
import { createHash as createHash13 } from "node:crypto";
|
|
47675
47867
|
var RECORDS_SCHEMA_VERSION = 1;
|
|
47676
47868
|
var RECORD_OPERATIONS = ["upsert", "delete"];
|
|
@@ -47811,8 +48003,39 @@ var fieldReferences = /* @__PURE__ */ __name((record3, options = {}) => {
|
|
|
47811
48003
|
return found2;
|
|
47812
48004
|
}, "fieldReferences");
|
|
47813
48005
|
|
|
47814
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
48006
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/crm-rows.js
|
|
47815
48007
|
var TABLES2 = { deal: "deals", lead: "leads" };
|
|
48008
|
+
var MONEY_REFUSALS = ["money.currency", "money.amount"];
|
|
48009
|
+
var amountFault = /* @__PURE__ */ __name((item, code) => {
|
|
48010
|
+
const text8 = String(item.amount).trim();
|
|
48011
|
+
const decimal2 = /^\d+(?:\.(\d+))?$/.exec(text8);
|
|
48012
|
+
if (text8.startsWith("-"))
|
|
48013
|
+
return "it is below zero";
|
|
48014
|
+
if (!decimal2)
|
|
48015
|
+
return "it is not a decimal number";
|
|
48016
|
+
if ((decimal2[1] ?? "").length > scaleOf(String(code)))
|
|
48017
|
+
return `it has more decimals than ${code} has`;
|
|
48018
|
+
return "it is too large to keep exactly";
|
|
48019
|
+
}, "amountFault");
|
|
48020
|
+
var moneyOf2 = /* @__PURE__ */ __name((item) => {
|
|
48021
|
+
if (item.amount == null || item.currency == null)
|
|
48022
|
+
return { currency: null, amount: null, amountNote: null };
|
|
48023
|
+
try {
|
|
48024
|
+
const currency2 = currencyOf(item.currency);
|
|
48025
|
+
return { currency: currency2, amount: minorUnits(String(item.amount), currency2), amountNote: null };
|
|
48026
|
+
} catch (error) {
|
|
48027
|
+
const reason = error instanceof CliError ? error.details?.reason : void 0;
|
|
48028
|
+
if (!MONEY_REFUSALS.includes(reason))
|
|
48029
|
+
throw error;
|
|
48030
|
+
const code = textOf4(String(item.currency), 10);
|
|
48031
|
+
const why = reason === "money.currency" ? `the store keeps no amounts in ${code}` : amountFault(item, code);
|
|
48032
|
+
return {
|
|
48033
|
+
currency: null,
|
|
48034
|
+
amount: null,
|
|
48035
|
+
amountNote: `the CRM's amount ${textOf4(String(item.amount), 40)} ${code} is not kept: ${why}`
|
|
48036
|
+
};
|
|
48037
|
+
}
|
|
48038
|
+
}, "moneyOf");
|
|
47816
48039
|
var SOURCE = "crm";
|
|
47817
48040
|
var crmIdentityId = /* @__PURE__ */ __name((key2, externalId, type = "contact") => `${idPart(key2.account)}/${type}/${idPart(externalId)}`, "crmIdentityId");
|
|
47818
48041
|
var idPart = /* @__PURE__ */ __name((value) => value.replaceAll("%", "%25").replaceAll("/", "%2F"), "idPart");
|
|
@@ -47894,11 +48117,7 @@ var crmRowsOver = /* @__PURE__ */ __name((context) => {
|
|
|
47894
48117
|
message: `${kind3} ${item.externalId} stands in stage ${item.stage} of pipeline ${item.pipeline}, which is not stored`
|
|
47895
48118
|
};
|
|
47896
48119
|
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");
|
|
48120
|
+
const { currency: currency2, amount, amountNote } = moneyOf2(item);
|
|
47902
48121
|
if (item.status != null && !STAGE_OUTCOMES.includes(item.status))
|
|
47903
48122
|
throw new CliError("validation_error", `${kind3} ${item.externalId}'s status is open, won or lost`);
|
|
47904
48123
|
const status2 = item.status ?? String(stage.outcome);
|
|
@@ -47910,7 +48129,8 @@ var crmRowsOver = /* @__PURE__ */ __name((context) => {
|
|
|
47910
48129
|
...item.assignee ? { assignee: crmIdentityId(key2, item.assignee, "user") } : {},
|
|
47911
48130
|
...textOf4(item.contactName, 200) ? { contact_name: textOf4(item.contactName, 200) } : {},
|
|
47912
48131
|
...textOf4(item.companyName, 200) ? { company_name: textOf4(item.companyName, 200) } : {},
|
|
47913
|
-
...item.closedReason && status2 !== "open" ? { closed_reason: textOf4(item.closedReason, 2e3) } : {}
|
|
48132
|
+
...item.closedReason && status2 !== "open" ? { closed_reason: textOf4(item.closedReason, 2e3) } : {},
|
|
48133
|
+
...amountNote ? { amount_note: { label: "Amount not kept", value: amountNote } } : {}
|
|
47914
48134
|
};
|
|
47915
48135
|
const values = {
|
|
47916
48136
|
title: title2,
|
|
@@ -47937,12 +48157,12 @@ var crmRowsOver = /* @__PURE__ */ __name((context) => {
|
|
|
47937
48157
|
}
|
|
47938
48158
|
if (writer3.project !== void 0)
|
|
47939
48159
|
database.prepare(`UPDATE ${table} SET project_id = ? WHERE id = ?`).run(writer3.project, id2);
|
|
47940
|
-
return { id: id2 };
|
|
48160
|
+
return { id: id2, ...amountNote ? { amountNote } : {} };
|
|
47941
48161
|
}, "saveItemRow");
|
|
47942
48162
|
return { savePipeline, saveItemRow };
|
|
47943
48163
|
}, "crmRowsOver");
|
|
47944
48164
|
|
|
47945
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
48165
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/crm-activities.js
|
|
47946
48166
|
var ACTIVITY_RECORD = "crm.activity";
|
|
47947
48167
|
var MOST_BODY = 2e4;
|
|
47948
48168
|
var MOST_SUBJECT = 500;
|
|
@@ -48022,7 +48242,7 @@ var crmActivitiesOver = /* @__PURE__ */ __name((context) => {
|
|
|
48022
48242
|
return { save: save2, of };
|
|
48023
48243
|
}, "crmActivitiesOver");
|
|
48024
48244
|
|
|
48025
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
48245
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/stage-amounts.js
|
|
48026
48246
|
var TABLES3 = { deal: "deals", lead: "leads" };
|
|
48027
48247
|
var stageAmountsOf = /* @__PURE__ */ __name(({ database }, kind3, stageIds, cutoff) => {
|
|
48028
48248
|
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 +48259,7 @@ var stageAmountsOf = /* @__PURE__ */ __name(({ database }, kind3, stageIds, cuto
|
|
|
48039
48259
|
});
|
|
48040
48260
|
}, "stageAmountsOf");
|
|
48041
48261
|
|
|
48042
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
48262
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/deals.js
|
|
48043
48263
|
var TABLES4 = { deal: "deals", lead: "leads" };
|
|
48044
48264
|
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
48265
|
var MAX_STAGES = 30;
|
|
@@ -48447,13 +48667,13 @@ var dealOperationsOver = /* @__PURE__ */ __name((context) => {
|
|
|
48447
48667
|
if (!found2.length && !exact) {
|
|
48448
48668
|
const docs = /* @__PURE__ */ new Map();
|
|
48449
48669
|
for (const { parts } of records2)
|
|
48450
|
-
for (const
|
|
48451
|
-
docs.set(
|
|
48670
|
+
for (const literal5 of new Set(parts.flatMap(({ words: held }) => held.map((word2) => word2.literal))))
|
|
48671
|
+
docs.set(literal5, (docs.get(literal5) ?? 0) + 1);
|
|
48452
48672
|
const vocabulary = {
|
|
48453
48673
|
knownTerms: /* @__PURE__ */ __name(async (terms) => new Set(terms.filter((term) => docs.has(term))), "knownTerms"),
|
|
48454
48674
|
termCandidates: /* @__PURE__ */ __name(async (_, { shortest, longest }) => [...docs].filter(([term]) => term.length >= shortest && term.length <= longest).map(([term, count2]) => ({ term, docs: count2 })), "termCandidates")
|
|
48455
48675
|
};
|
|
48456
|
-
const unmatched = probes.flat().filter((probe) => ![...stored4.values()].some((word2) => wordMatches(probe, word2, false))).map(({ literal:
|
|
48676
|
+
const unmatched = probes.flat().filter((probe) => ![...stored4.values()].some((word2) => wordMatches(probe, word2, false))).map(({ literal: literal5 }) => literal5);
|
|
48457
48677
|
const fixes = unmatched.length ? await correctWords(vocabulary, [...new Set(unmatched)]) : /* @__PURE__ */ new Map();
|
|
48458
48678
|
if (fixes.size) {
|
|
48459
48679
|
corrections = [...fixes].map(([from2, to]) => ({ from: from2, to }));
|
|
@@ -48518,7 +48738,7 @@ var dealsStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
48518
48738
|
};
|
|
48519
48739
|
}, "dealsStoreOver");
|
|
48520
48740
|
|
|
48521
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
48741
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/owner-languages.js
|
|
48522
48742
|
var KEY2 = "ownerLanguages";
|
|
48523
48743
|
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
48744
|
var DEFAULT_OWNER_LANGUAGES = ["ru"];
|
|
@@ -48548,7 +48768,7 @@ var saveOwnerLanguages = /* @__PURE__ */ __name((database, languages, now2) => {
|
|
|
48548
48768
|
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
48769
|
}, "saveOwnerLanguages");
|
|
48550
48770
|
|
|
48551
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
48771
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/base-stages.js
|
|
48552
48772
|
var OUTCOMES = {
|
|
48553
48773
|
lead: ["open", "open", "open", "won", "lost"],
|
|
48554
48774
|
deal: ["open", "open", "open", "open", "won", "lost"]
|
|
@@ -48881,7 +49101,7 @@ var baseStagesStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
48881
49101
|
};
|
|
48882
49102
|
}, "baseStagesStoreOver");
|
|
48883
49103
|
|
|
48884
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
49104
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/bot-updates.js
|
|
48885
49105
|
var botUpdateStoreOver = /* @__PURE__ */ __name((context, afterSave = () => {
|
|
48886
49106
|
}) => {
|
|
48887
49107
|
const { database, now: now2 } = context;
|
|
@@ -48940,7 +49160,7 @@ var botUpdateStoreOver = /* @__PURE__ */ __name((context, afterSave = () => {
|
|
|
48940
49160
|
};
|
|
48941
49161
|
}, "botUpdateStoreOver");
|
|
48942
49162
|
|
|
48943
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
49163
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/record-projection.js
|
|
48944
49164
|
var IMPORTER = { bot: "import" };
|
|
48945
49165
|
var importersProposal = /* @__PURE__ */ __name((entity) => entity.review === "proposed" && entity.author.type === "bot" && entity.author.name === IMPORTER.bot, "importersProposal");
|
|
48946
49166
|
var codeOf = /* @__PURE__ */ __name((error) => {
|
|
@@ -48985,7 +49205,7 @@ var moneyLinesOf = /* @__PURE__ */ __name((projection, list2) => (Array.isArray(
|
|
|
48985
49205
|
};
|
|
48986
49206
|
}), "moneyLinesOf");
|
|
48987
49207
|
|
|
48988
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
49208
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/domain/relation-role-labels.js
|
|
48989
49209
|
var label = /* @__PURE__ */ __name((en, ru, es) => ({ en, ru, es }), "label");
|
|
48990
49210
|
var ROLE_LABELS = {
|
|
48991
49211
|
organization: {
|
|
@@ -49026,7 +49246,7 @@ var ROLE_LABELS = {
|
|
|
49026
49246
|
}
|
|
49027
49247
|
};
|
|
49028
49248
|
|
|
49029
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
49249
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/relation-roles.js
|
|
49030
49250
|
var settingOf = /* @__PURE__ */ __name((list2) => `relationships.roles.${list2}`, "settingOf");
|
|
49031
49251
|
var isList = /* @__PURE__ */ __name((list2) => Object.hasOwn(ROLE_LISTS, list2), "isList");
|
|
49032
49252
|
var listOf2 = /* @__PURE__ */ __name((list2) => {
|
|
@@ -49110,7 +49330,7 @@ var relationRolesOver = /* @__PURE__ */ __name(({ database, now: now2 }) => {
|
|
|
49110
49330
|
};
|
|
49111
49331
|
}, "relationRolesOver");
|
|
49112
49332
|
|
|
49113
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
49333
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/crm-settings.js
|
|
49114
49334
|
var CRM_LINK_MODES = ["reported", "review"];
|
|
49115
49335
|
var COMPANY_TYPE_MEANINGS = ["customer-of", "supplier", "partner-of"];
|
|
49116
49336
|
var CRM_SCOPES = ["mine", "all"];
|
|
@@ -49157,7 +49377,8 @@ var picked = /* @__PURE__ */ __name((name, text8, values) => {
|
|
|
49157
49377
|
}, "picked");
|
|
49158
49378
|
var crmScopeUsers = /* @__PURE__ */ __name((database, key2) => {
|
|
49159
49379
|
const self = crmOwnUser(database, key2);
|
|
49160
|
-
|
|
49380
|
+
const chosen = userIds(stored2(database, crmSettingKey(key2, "unassigned")));
|
|
49381
|
+
return [...new Set(chosen.length ? chosen : self ? [self] : [])];
|
|
49161
49382
|
}, "crmScopeUsers");
|
|
49162
49383
|
var crmOwnUser = /* @__PURE__ */ __name((database, key2) => {
|
|
49163
49384
|
const value = stored2(database, crmSettingKey(key2, "self"));
|
|
@@ -49305,7 +49526,7 @@ var crmSettingsOf = /* @__PURE__ */ __name((database) => database.prepare("SELEC
|
|
|
49305
49526
|
return [{ setting: String(row2.key), value: settingValue(database, parsed5.key, parsed5.name) }];
|
|
49306
49527
|
}), "crmSettingsOf");
|
|
49307
49528
|
|
|
49308
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
49529
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/relation-proposals.js
|
|
49309
49530
|
var isoOf = /* @__PURE__ */ __name((ms) => ms === void 0 ? null : new Date(ms).toISOString(), "isoOf");
|
|
49310
49531
|
var relationOf = /* @__PURE__ */ __name((link3, now2) => ({
|
|
49311
49532
|
id: link3.id,
|
|
@@ -49665,7 +49886,7 @@ var decidedOrigin = /* @__PURE__ */ __name((by) => by === "owner" ? { origin: "o
|
|
|
49665
49886
|
provenance: `agent:${by.bot} for the owner: ${by.reason.trim()}`
|
|
49666
49887
|
}, "decidedOrigin");
|
|
49667
49888
|
|
|
49668
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
49889
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/reported-relations.js
|
|
49669
49890
|
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
49891
|
var metadataOf = /* @__PURE__ */ __name((relation) => relation.metadata && Object.keys(relation.metadata).length ? JSON.stringify(relation.metadata) : null, "metadataOf");
|
|
49671
49892
|
var syncReportedIn = /* @__PURE__ */ __name((context, key2, relationships, scope3, { source: source2 = "import", by = { bot: key2.provider, kind: "rule" }, onOutcome } = {}) => {
|
|
@@ -49803,7 +50024,7 @@ var relationsStoreOver = /* @__PURE__ */ __name((context) => ({
|
|
|
49803
50024
|
syncReported: /* @__PURE__ */ __name(async (key2, relationships, scope3, options) => write(context.database, () => syncReportedIn(context, key2, relationships, scope3, options)), "syncReported")
|
|
49804
50025
|
}), "relationsStoreOver");
|
|
49805
50026
|
|
|
49806
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
50027
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/record-relationships.js
|
|
49807
50028
|
var importSource = /* @__PURE__ */ __name((provider) => `import:${provider}`, "importSource");
|
|
49808
50029
|
var noRelationships = /* @__PURE__ */ __name(() => ({
|
|
49809
50030
|
added: 0,
|
|
@@ -49993,11 +50214,11 @@ var recordRelationshipsOver = /* @__PURE__ */ __name((context) => {
|
|
|
49993
50214
|
return { report, placeOf: placeOf2, withdrawFrom };
|
|
49994
50215
|
}, "recordRelationshipsOver");
|
|
49995
50216
|
|
|
49996
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
50217
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/business-contracts.js
|
|
49997
50218
|
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
50219
|
var DAY_MS2 = 864e5;
|
|
49999
50220
|
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");
|
|
50000
|
-
var
|
|
50221
|
+
var columnsOf4 = /* @__PURE__ */ __name((fields4, base) => {
|
|
50001
50222
|
const kept2 = /* @__PURE__ */ __name((given3, column2, read2) => given3 === void 0 ? base[column2] ?? null : read2(given3), "kept");
|
|
50002
50223
|
const name = kept2(fields4.name, "name", (value2) => text3(value2, "a contract's name", 200));
|
|
50003
50224
|
if (name == null)
|
|
@@ -50098,7 +50319,7 @@ var contractOperationsOver = /* @__PURE__ */ __name((context) => {
|
|
|
50098
50319
|
}, "decide");
|
|
50099
50320
|
return {
|
|
50100
50321
|
add: /* @__PURE__ */ __name((input) => {
|
|
50101
|
-
const columns2 =
|
|
50322
|
+
const columns2 = columnsOf4({ ...input, status: input.status ?? "active", autoRenew: input.autoRenew ?? false }, {});
|
|
50102
50323
|
const id2 = write(database, () => {
|
|
50103
50324
|
const deal = linkedId(input.deal, "deal", "contract.ref");
|
|
50104
50325
|
const by = written(input);
|
|
@@ -50129,7 +50350,7 @@ var contractOperationsOver = /* @__PURE__ */ __name((context) => {
|
|
|
50129
50350
|
if (row2.review === "rejected" || row2.deleted_at != null)
|
|
50130
50351
|
refuse(`${ref3} is ${row2.deleted_at != null ? "deleted" : "rejected"}`, "contract.ref");
|
|
50131
50352
|
mayChangeParts(row2, by, `only the owner changes ${ref3}; a bot changes only a contract it proposed that is still proposed`);
|
|
50132
|
-
const columns2 =
|
|
50353
|
+
const columns2 = columnsOf4(fields4, row2);
|
|
50133
50354
|
write(database, () => {
|
|
50134
50355
|
const deal = fields4.deal === void 0 ? row2.deal_id : linkedId(fields4.deal, "deal", "contract.ref");
|
|
50135
50356
|
database.prepare("UPDATE contracts SET name = ?, number = ?, kind = ?, status = ?, signed_date = ?, effective_date = ?, expiration_date = ?, auto_renew = ?, renewal_count = ?, renewal_unit = ?, notice_days = ?, terms = ?, value = ?, currency = ?, deal_id = ?, updated_at = ? WHERE id = ?").run(columns2.name, columns2.number, columns2.kind, columns2.status, columns2.signed_date, columns2.effective_date, columns2.expiration_date, columns2.auto_renew, columns2.renewal_count, columns2.renewal_unit, columns2.notice_days, columns2.terms, columns2.value, columns2.currency, deal, now2(), Number(row2.id));
|
|
@@ -50152,7 +50373,7 @@ var contractsStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
50152
50373
|
};
|
|
50153
50374
|
}, "contractsStoreOver");
|
|
50154
50375
|
|
|
50155
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
50376
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/business-search.js
|
|
50156
50377
|
var BUSINESS_FIND_MAX = 2001;
|
|
50157
50378
|
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
50379
|
var partyName = /* @__PURE__ */ __name((as) => `coalesce(${as}p.name, ${as}o.name, ${as}j.name)`, "partyName");
|
|
@@ -50257,7 +50478,7 @@ var businessSearchOver = /* @__PURE__ */ __name(({ database }) => {
|
|
|
50257
50478
|
};
|
|
50258
50479
|
}, "businessSearchOver");
|
|
50259
50480
|
|
|
50260
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
50481
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/catalog.js
|
|
50261
50482
|
var CATALOG_QUERY = defineQuery({
|
|
50262
50483
|
entity: "document",
|
|
50263
50484
|
backend: "sql",
|
|
@@ -50436,7 +50657,9 @@ var catalogStoreOver = /* @__PURE__ */ __name(({ database, now: now2 }) => {
|
|
|
50436
50657
|
const actorSql = "json_each(d.metadata, '$.catalog.folded.people')";
|
|
50437
50658
|
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
50659
|
const tag2 = /* @__PURE__ */ __name((name) => canonicalTagNamed(database, name)?.name ?? normalizeTag(name), "tag");
|
|
50439
|
-
if (query.parent
|
|
50660
|
+
if (Array.isArray(query.parent))
|
|
50661
|
+
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))));
|
|
50662
|
+
else if (query.parent !== void 0)
|
|
50440
50663
|
add2("EXISTS(SELECT 1 FROM json_each(d.metadata, '$.catalog.parents') WHERE value=?)", query.parent);
|
|
50441
50664
|
if (query.kind !== void 0)
|
|
50442
50665
|
add2("json_extract(d.metadata, '$.catalog.kind')=?", query.kind);
|
|
@@ -50488,7 +50711,7 @@ var catalogStoreOver = /* @__PURE__ */ __name(({ database, now: now2 }) => {
|
|
|
50488
50711
|
};
|
|
50489
50712
|
}, "catalogStoreOver");
|
|
50490
50713
|
|
|
50491
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
50714
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/context-document-source.js
|
|
50492
50715
|
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
50716
|
var field3 = /* @__PURE__ */ __name((name) => `CASE WHEN (${remote()}) THEN
|
|
50494
50717
|
CASE WHEN json_type(n.front_matter,'$.${name}')='text' THEN json_extract(n.front_matter,'$.${name}') END END`, "field");
|
|
@@ -50501,7 +50724,7 @@ var contextDocumentTimeKind = /* @__PURE__ */ __name(() => `CASE WHEN (${remoteT
|
|
|
50501
50724
|
THEN 'source-modified' ELSE 'stored-update' END`, "contextDocumentTimeKind");
|
|
50502
50725
|
var contextDocumentUrl = /* @__PURE__ */ __name(() => `coalesce(${preferred("url")},n.url,${field3("sourceUrl")})`, "contextDocumentUrl");
|
|
50503
50726
|
|
|
50504
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
50727
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/context-meeting-source.js
|
|
50505
50728
|
var readMeetingContextEvidence = /* @__PURE__ */ __name((database, request) => {
|
|
50506
50729
|
const { source: source2, words: words4, after: after2, before: before2, limit, maxReadBytes, cursor, signal } = request;
|
|
50507
50730
|
signal?.throwIfAborted();
|
|
@@ -50600,7 +50823,7 @@ var readMeetingContextEvidence = /* @__PURE__ */ __name((database, request) => {
|
|
|
50600
50823
|
});
|
|
50601
50824
|
}, "readMeetingContextEvidence");
|
|
50602
50825
|
|
|
50603
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
50826
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/context-evidence.js
|
|
50604
50827
|
var corpora = {
|
|
50605
50828
|
message: {
|
|
50606
50829
|
table: "messages",
|
|
@@ -50845,7 +51068,7 @@ var contextRecordsOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
|
50845
51068
|
}
|
|
50846
51069
|
}), "contextRecordsOver");
|
|
50847
51070
|
|
|
50848
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
51071
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/crm-contacts.js
|
|
50849
51072
|
var PLACEHOLDER = /(?:^|\s)null(?:\s+#\d+)?(?=\s|$)/gi;
|
|
50850
51073
|
var withoutPlaceholder = /* @__PURE__ */ __name((name) => name.replace(PLACEHOLDER, " ").replace(/\s+/g, " ").trim() || null, "withoutPlaceholder");
|
|
50851
51074
|
var DryRun = class extends Error {
|
|
@@ -50880,7 +51103,7 @@ var removeCrmContacts = /* @__PURE__ */ __name((context, key2, { users, before:
|
|
|
50880
51103
|
database.prepare("INSERT INTO temp.crm_scope SELECT DISTINCT value FROM json_each(?)").run(JSON.stringify((users ?? []).map((id2) => crmIdentityId(key2, id2, "user"))));
|
|
50881
51104
|
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
51105
|
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);
|
|
51106
|
+
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
51107
|
database.exec(`DELETE FROM temp.crm_gone WHERE id IN (${identityRefs})`);
|
|
50885
51108
|
database.exec("INSERT OR IGNORE INTO temp.crm_persons SELECT person FROM temp.crm_gone WHERE person IS NOT NULL");
|
|
50886
51109
|
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 +51145,7 @@ var removeCrmContacts = /* @__PURE__ */ __name((context, key2, { users, before:
|
|
|
50922
51145
|
}
|
|
50923
51146
|
}, "removeCrmContacts");
|
|
50924
51147
|
|
|
50925
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
51148
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/crm-stage-entries.js
|
|
50926
51149
|
var STAGE_ENTRY_RECORD = "crm.stage-entry";
|
|
50927
51150
|
var crmStageEntriesOver = /* @__PURE__ */ __name((context) => {
|
|
50928
51151
|
const { database, now: now2 } = context;
|
|
@@ -50969,7 +51192,7 @@ var crmStageEntriesOver = /* @__PURE__ */ __name((context) => {
|
|
|
50969
51192
|
return { save: save2, pending, handled };
|
|
50970
51193
|
}, "crmStageEntriesOver");
|
|
50971
51194
|
|
|
50972
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
51195
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/crm.js
|
|
50973
51196
|
var PENDING = "crm:pending-relations";
|
|
50974
51197
|
var PENDING_DAYS = 30;
|
|
50975
51198
|
var PENDING_MOST = 5e3;
|
|
@@ -51187,6 +51410,8 @@ var crmCopiesOver = /* @__PURE__ */ __name((context, people2) => {
|
|
|
51187
51410
|
const saved = saveItemRow(key2, accountId, kind3, item, at2);
|
|
51188
51411
|
if ("reason" in saved)
|
|
51189
51412
|
return saved;
|
|
51413
|
+
if (saved.amountNote)
|
|
51414
|
+
report.tally.issues.push({ externalId: item.externalId, reason: "crm.amount-unkept", message: saved.amountNote });
|
|
51190
51415
|
const { id: id2 } = saved;
|
|
51191
51416
|
if (item.people === void 0 && item.assignee === void 0)
|
|
51192
51417
|
return null;
|
|
@@ -51214,6 +51439,10 @@ var crmCopiesOver = /* @__PURE__ */ __name((context, people2) => {
|
|
|
51214
51439
|
reportFrom(key2, accountId, self, wanted, scope3, report.tally, report.pending);
|
|
51215
51440
|
return null;
|
|
51216
51441
|
}, "saveItem");
|
|
51442
|
+
const assignContact = /* @__PURE__ */ __name((key2, externalId, assignee) => {
|
|
51443
|
+
const user = assignee ? crmIdentityId(key2, normalCrmUserId(assignee), "user") : null;
|
|
51444
|
+
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);
|
|
51445
|
+
}, "assignContact");
|
|
51217
51446
|
const saveItems = /* @__PURE__ */ __name((key2, kind3, items, users) => write(database, () => {
|
|
51218
51447
|
const accountId = account(key2);
|
|
51219
51448
|
const at2 = now2();
|
|
@@ -51353,7 +51582,7 @@ var crmCopiesOver = /* @__PURE__ */ __name((context, people2) => {
|
|
|
51353
51582
|
const accountId = findAccountPk(context, key2);
|
|
51354
51583
|
if (accountId === void 0 || kind3 === "person")
|
|
51355
51584
|
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);
|
|
51585
|
+
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
51586
|
}, "stored");
|
|
51358
51587
|
const markDeleted2 = /* @__PURE__ */ __name((key2, kind3, rows) => {
|
|
51359
51588
|
const table = kind3 === "organization" ? "records" : TABLES2[kind3];
|
|
@@ -51387,6 +51616,8 @@ var crmCopiesOver = /* @__PURE__ */ __name((context, people2) => {
|
|
|
51387
51616
|
const tally = tallied();
|
|
51388
51617
|
const pending = pendingBook(accountId);
|
|
51389
51618
|
for (const contact of contacts2) {
|
|
51619
|
+
if (contact.assignee !== void 0)
|
|
51620
|
+
assignContact(key2, contact.externalId, contact.assignee);
|
|
51390
51621
|
const person2 = nameUnnamed(key2, contact.externalId, "contact", textOf4(contact.name, 200));
|
|
51391
51622
|
const email = textOf4(contact.email, 320)?.toLowerCase();
|
|
51392
51623
|
const sharing = email ? peopleSharing(key2, contact.externalId, email) : 0;
|
|
@@ -51439,9 +51670,10 @@ var crmCopiesOver = /* @__PURE__ */ __name((context, people2) => {
|
|
|
51439
51670
|
const gone = new Set(externalIds);
|
|
51440
51671
|
return markDeleted2(key2, kind3, stored4(key2, kind3).filter((row2) => gone.has(String(row2.external_id))));
|
|
51441
51672
|
}), "remove"),
|
|
51442
|
-
removeUnlisted: /* @__PURE__ */ __name(async (key2, kind3, listed, before2, { dryRun } = {}) => write(database, () => {
|
|
51673
|
+
removeUnlisted: /* @__PURE__ */ __name(async (key2, kind3, listed, before2, { dryRun, users } = {}) => write(database, () => {
|
|
51443
51674
|
const held = new Set(listed);
|
|
51444
|
-
const
|
|
51675
|
+
const scope3 = users && new Set(users.map((id2) => crmIdentityId(key2, id2, "user")));
|
|
51676
|
+
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
51677
|
return dryRun ? gone.length : markDeleted2(key2, kind3, gone);
|
|
51446
51678
|
}), "removeUnlisted"),
|
|
51447
51679
|
scope: /* @__PURE__ */ __name(async (key2) => crmScope(database, key2), "scope"),
|
|
@@ -51478,10 +51710,10 @@ var crmCopiesOver = /* @__PURE__ */ __name((context, people2) => {
|
|
|
51478
51710
|
};
|
|
51479
51711
|
}, "crmCopiesOver");
|
|
51480
51712
|
|
|
51481
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
51713
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/decision-requests.js
|
|
51482
51714
|
import { createHash as createHash14, randomBytes as randomBytes2 } from "node:crypto";
|
|
51483
51715
|
|
|
51484
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
51716
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/decision-requests.js
|
|
51485
51717
|
var DECISION_ACTIONS = ["confirm", "reject", "ask-confirm", "ask-reject", "back", "later"];
|
|
51486
51718
|
var DECISION_TTL_MS = 72 * 60 * 60 * 1e3;
|
|
51487
51719
|
var CALLBACK_PREFIX = "wcr1:";
|
|
@@ -51495,7 +51727,7 @@ var callbackDataOf = /* @__PURE__ */ __name((token) => {
|
|
|
51495
51727
|
}, "callbackDataOf");
|
|
51496
51728
|
var parseCallbackData = /* @__PURE__ */ __name((data) => typeof data === "string" ? CALLBACK.exec(data)?.[1] : void 0, "parseCallbackData");
|
|
51497
51729
|
|
|
51498
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
51730
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/decision-requests.js
|
|
51499
51731
|
var digestOf = /* @__PURE__ */ __name((token) => createHash14("sha256").update(token).digest("hex"), "digestOf");
|
|
51500
51732
|
var newToken = /* @__PURE__ */ __name(() => randomBytes2(16).toString("base64url"), "newToken");
|
|
51501
51733
|
var requestOf = /* @__PURE__ */ __name((row2) => ({
|
|
@@ -51594,7 +51826,7 @@ var decisionRequestStoreOver = /* @__PURE__ */ __name(({ database, now: now2 })
|
|
|
51594
51826
|
};
|
|
51595
51827
|
}, "decisionRequestStoreOver");
|
|
51596
51828
|
|
|
51597
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
51829
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-listing.js
|
|
51598
51830
|
var MEETING_ROW_KINDS = ["meeting", "call", "event"];
|
|
51599
51831
|
var DAY6 = 864e5;
|
|
51600
51832
|
var JOINED = `(SELECT ce.event_id FROM calendar_entries ce JOIN events je ON je.id = ce.event_id
|
|
@@ -51691,6 +51923,21 @@ var rowsOf = /* @__PURE__ */ __name((context, filter) => {
|
|
|
51691
51923
|
}, "rowsOf");
|
|
51692
51924
|
var ROW_MEETINGS = "r.meetings";
|
|
51693
51925
|
var inRowMeetings = /* @__PURE__ */ __name((condition) => `EXISTS (SELECT 1 FROM json_each(${ROW_MEETINGS}) rm WHERE ${condition.replaceAll("{m}", "rm.value")})`, "inRowMeetings");
|
|
51926
|
+
var MEETING_TRANSCRIPT = `(EXISTS (SELECT 1 FROM meeting_transcripts t WHERE t.meeting_id = {m} AND t.deleted_at IS NULL
|
|
51927
|
+
AND t.superseded_at IS NULL)
|
|
51928
|
+
OR EXISTS (SELECT 1 FROM links tl JOIN documents td ON td.id = tl.to_id WHERE tl.from_type = 'meeting'
|
|
51929
|
+
AND tl.from_id = {m} AND tl.kind = 'attached' AND tl.to_type = 'document' AND tl.role IN ('transcript', 'notes')
|
|
51930
|
+
AND td.deleted_at IS NULL))`;
|
|
51931
|
+
var literal4 = /* @__PURE__ */ __name((text8) => `'${text8.replaceAll("'", "''")}'`, "literal");
|
|
51932
|
+
var namedLikeTranscript = /* @__PURE__ */ __name((title2) => `(${TRANSCRIPT_WORDS.flatMap((word2) => [
|
|
51933
|
+
`${title2} LIKE ${literal4(`%${word2}%`)}`,
|
|
51934
|
+
`instr(${title2}, ${literal4(word2.toLowerCase())}) > 0`
|
|
51935
|
+
]).join(" OR ")})`, "namedLikeTranscript");
|
|
51936
|
+
var EVENT_TRANSCRIPT = `EXISTS (SELECT 1 FROM calendar_entries tc JOIN links tl ON tl.from_type = 'calendar_entry'
|
|
51937
|
+
AND tl.from_id = tc.id AND tl.kind = 'attached' AND tl.to_type = 'document'
|
|
51938
|
+
JOIN documents td ON td.id = tl.to_id WHERE tc.event_id = {e} AND td.deleted_at IS NULL
|
|
51939
|
+
AND ${namedLikeTranscript("td.title")})`;
|
|
51940
|
+
var ROW_TRANSCRIPT = `((r.type = 'event' AND ${EVENT_TRANSCRIPT.replaceAll("{e}", "r.id")}) OR ${inRowMeetings(MEETING_TRANSCRIPT)})`;
|
|
51694
51941
|
var PHONE_MEETING = "(SELECT a.provider FROM meetings km JOIN accounts a ON a.id = km.account_id WHERE km.id = {m}) = 'phone'";
|
|
51695
51942
|
var KIND = `(CASE
|
|
51696
51943
|
WHEN (r.type = 'event' AND EXISTS (SELECT 1 FROM calendar_entries kc WHERE kc.event_id = r.id
|
|
@@ -51724,7 +51971,7 @@ var filtersOf = /* @__PURE__ */ __name((database, filter) => {
|
|
|
51724
51971
|
params.push(people2, people2, people2);
|
|
51725
51972
|
}
|
|
51726
51973
|
if (filter.hasTranscript !== void 0) {
|
|
51727
|
-
clauses.push(`${filter.hasTranscript ? "" : "NOT "}${
|
|
51974
|
+
clauses.push(`${filter.hasTranscript ? "" : "NOT "}${ROW_TRANSCRIPT}`);
|
|
51728
51975
|
}
|
|
51729
51976
|
return { sql: clauses.length ? `WHERE ${clauses.join(" AND ")}` : "", params };
|
|
51730
51977
|
}, "filtersOf");
|
|
@@ -51773,15 +52020,15 @@ var citingBatches = /* @__PURE__ */ __name((database, meetingIds) => {
|
|
|
51773
52020
|
var hydrate = /* @__PURE__ */ __name((database, page3) => {
|
|
51774
52021
|
const eventIds = page3.filter(({ type }) => type === "event").map(({ id: id2 }) => id2);
|
|
51775
52022
|
const meetingIds = [...new Set(page3.flatMap(({ meetingIds: meetingIds2 }) => meetingIds2))];
|
|
51776
|
-
const events3 = new Map(database.prepare(
|
|
52023
|
+
const events3 = new Map(database.prepare(`SELECT e.*, ${EVENT_TRANSCRIPT.replaceAll("{e}", "e.id")} AS has_transcript FROM events e
|
|
52024
|
+
WHERE e.id IN (SELECT value FROM json_each(?))`).all(ids2(eventIds)).map((row2) => [Number(row2.id), row2]));
|
|
51777
52025
|
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
52026
|
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
52027
|
JOIN accounts a ON a.id = c.account_id WHERE ce.event_id IN (SELECT value FROM json_each(?))
|
|
51780
52028
|
ORDER BY ce.deleted_at IS NOT NULL, ce.id`).all(ids2(eventIds));
|
|
51781
52029
|
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
52030
|
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,
|
|
52031
|
+
${MEETING_TRANSCRIPT.replaceAll("{m}", "m.id")} AS has_transcript,
|
|
51785
52032
|
EXISTS (SELECT 1 FROM meeting_summaries s WHERE s.meeting_id = m.id) AS has_summary,
|
|
51786
52033
|
(EXISTS (SELECT 1 FROM attachments ra WHERE ra.attachable_type = 'meeting' AND ra.attachable_id = m.id
|
|
51787
52034
|
AND (ra.kind IN ('audio', 'video') OR ra.mime LIKE 'audio/%' OR ra.mime LIKE 'video/%'))
|
|
@@ -51899,7 +52146,7 @@ var hydrate = /* @__PURE__ */ __name((database, page3) => {
|
|
|
51899
52146
|
sources,
|
|
51900
52147
|
participants: [...participants3.values()],
|
|
51901
52148
|
hasRecording: held.some((meeting) => Number(meeting.has_recording) === 1),
|
|
51902
|
-
hasTranscript: held.some((meeting) => Number(meeting.has_transcript) === 1),
|
|
52149
|
+
hasTranscript: Number(event2?.has_transcript ?? 0) === 1 || held.some((meeting) => Number(meeting.has_transcript) === 1),
|
|
51903
52150
|
hasSummary: held.some((meeting) => Number(meeting.has_summary) === 1),
|
|
51904
52151
|
documents: [...linked.values()],
|
|
51905
52152
|
seriesId: num(event2?.event_series_id),
|
|
@@ -51966,7 +52213,7 @@ var meetingListingOver = /* @__PURE__ */ __name((context) => {
|
|
|
51966
52213
|
};
|
|
51967
52214
|
}, "meetingListingOver");
|
|
51968
52215
|
|
|
51969
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
52216
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/document-listing.js
|
|
51970
52217
|
var DOCUMENT_KINDS = [
|
|
51971
52218
|
"transcript",
|
|
51972
52219
|
"doc",
|
|
@@ -52203,7 +52450,7 @@ var documentListingOver = /* @__PURE__ */ __name((context) => {
|
|
|
52203
52450
|
};
|
|
52204
52451
|
}, "documentListingOver");
|
|
52205
52452
|
|
|
52206
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
52453
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/note-search.js
|
|
52207
52454
|
var NOTE_FIELDS = [
|
|
52208
52455
|
"text",
|
|
52209
52456
|
"exact",
|
|
@@ -52219,7 +52466,7 @@ var NOTE_FIELDS = [
|
|
|
52219
52466
|
"keyword",
|
|
52220
52467
|
"source"
|
|
52221
52468
|
];
|
|
52222
|
-
var
|
|
52469
|
+
var quoted5 = /* @__PURE__ */ __name((value) => `"${value.replaceAll('"', '""')}"`, "quoted");
|
|
52223
52470
|
var bound4 = /* @__PURE__ */ __name((sql2, ...params) => ({ sql: sql2, params, exact: true }), "bound");
|
|
52224
52471
|
var combine2 = /* @__PURE__ */ __name((parts, operator) => ({
|
|
52225
52472
|
sql: parts.length ? `(${parts.map(({ sql: sql2 }) => sql2).join(` ${operator} `)})` : operator === "AND" ? "1" : "0",
|
|
@@ -52273,7 +52520,7 @@ var searchNotes = /* @__PURE__ */ __name((context, query) => {
|
|
|
52273
52520
|
return {
|
|
52274
52521
|
items: rows.slice(offset, offset + query.limit).map((row2) => {
|
|
52275
52522
|
const found2 = read2[row2.type === "document" ? "document" : "note"].get(row2.id);
|
|
52276
|
-
const note3 = row2.type === "document" ? documentOf(found2) : noteOf(found2);
|
|
52523
|
+
const note3 = row2.type === "document" ? documentOf(found2) : noteOf(found2, context.database);
|
|
52277
52524
|
return {
|
|
52278
52525
|
ref: note3.ref,
|
|
52279
52526
|
note: note3,
|
|
@@ -52326,9 +52573,9 @@ var searchCorpus = /* @__PURE__ */ __name((context, query, corpus) => {
|
|
|
52326
52573
|
const stems = query.stemmer.phrases(value);
|
|
52327
52574
|
return {
|
|
52328
52575
|
sql: `n.id IN (SELECT rowid FROM ${corpus.words} WHERE ${corpus.words} MATCH ?)${stems ? ` OR n.id IN (SELECT rowid FROM ${corpus.stems} WHERE ${corpus.stems} MATCH ?)` : ""}`,
|
|
52329
|
-
params: [`normalized_text : (${
|
|
52576
|
+
params: [`normalized_text : (${quoted5(text8)})`, ...stems ? [`stems : (${stems})`] : []],
|
|
52330
52577
|
exact: true,
|
|
52331
|
-
fts:
|
|
52578
|
+
fts: quoted5(text8),
|
|
52332
52579
|
...stems ? { stems } : {}
|
|
52333
52580
|
};
|
|
52334
52581
|
}
|
|
@@ -52336,7 +52583,7 @@ var searchCorpus = /* @__PURE__ */ __name((context, query, corpus) => {
|
|
|
52336
52583
|
if (operator === "term" || operator === "phrase") {
|
|
52337
52584
|
const text8 = normalize(value);
|
|
52338
52585
|
const stems = query.stemmer?.phrases(value);
|
|
52339
|
-
return /[\p{L}\p{N}]/u.test(text8) ? { ...wordMatch2(
|
|
52586
|
+
return /[\p{L}\p{N}]/u.test(text8) ? { ...wordMatch2(quoted5(text8)), ...stems ? { stems } : {} } : bound4("0");
|
|
52340
52587
|
}
|
|
52341
52588
|
const pattern = operator === "wildcard" ? wildcardPattern(normalize(value)) : foldRegex(value, node.span);
|
|
52342
52589
|
const matcher = automaton(pattern, node);
|
|
@@ -52347,7 +52594,7 @@ var searchCorpus = /* @__PURE__ */ __name((context, query, corpus) => {
|
|
|
52347
52594
|
exhausted("term expansions");
|
|
52348
52595
|
const matches2 = terms.flatMap(({ term }) => {
|
|
52349
52596
|
check3();
|
|
52350
|
-
return matcher.test(String(term), budget) ? [
|
|
52597
|
+
return matcher.test(String(term), budget) ? [quoted5(String(term))] : [];
|
|
52351
52598
|
});
|
|
52352
52599
|
return matches2.length ? wordMatch2(matches2.join(" OR ")) : bound4("0");
|
|
52353
52600
|
}
|
|
@@ -52488,6 +52735,7 @@ var searchCorpus = /* @__PURE__ */ __name((context, query, corpus) => {
|
|
|
52488
52735
|
});
|
|
52489
52736
|
}, "searchCorpus");
|
|
52490
52737
|
var SCAN_PAGE3 = 5e3;
|
|
52738
|
+
var SETTLE_BATCH = 50;
|
|
52491
52739
|
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
52740
|
var noteSearchOver = /* @__PURE__ */ __name((context) => {
|
|
52493
52741
|
const { database } = context;
|
|
@@ -52495,7 +52743,7 @@ var noteSearchOver = /* @__PURE__ */ __name((context) => {
|
|
|
52495
52743
|
const drain = /* @__PURE__ */ __name(() => drainNoteIndex(database, stemmerFor2), "drain");
|
|
52496
52744
|
const read2 = /* @__PURE__ */ __name((type, id2) => {
|
|
52497
52745
|
const row2 = database.prepare(`SELECT * FROM ${type === "document" ? "documents" : "notes"} WHERE id = ?`).get(id2);
|
|
52498
|
-
return row2 ? type === "document" ? documentOf(row2) : noteOf(row2) : void 0;
|
|
52746
|
+
return row2 ? type === "document" ? documentOf(row2) : noteOf(row2, database) : void 0;
|
|
52499
52747
|
}, "read");
|
|
52500
52748
|
const live2 = /* @__PURE__ */ __name((folderIds, source2, withInternal = false) => {
|
|
52501
52749
|
const folders = folderIds?.length ? JSON.stringify(folderIds) : null;
|
|
@@ -52516,6 +52764,36 @@ var noteSearchOver = /* @__PURE__ */ __name((context) => {
|
|
|
52516
52764
|
return matchingNoteRefs(context, query);
|
|
52517
52765
|
}, "matchingRefs"),
|
|
52518
52766
|
indexState: /* @__PURE__ */ __name(async () => noteIndexState(database), "indexState"),
|
|
52767
|
+
indexWritten: /* @__PURE__ */ __name(async ({ until = /* @__PURE__ */ __name(() => false, "until") } = {}) => {
|
|
52768
|
+
if (isQueryOnly(database))
|
|
52769
|
+
return 0;
|
|
52770
|
+
const once4 = /* @__PURE__ */ __name(() => {
|
|
52771
|
+
let ran = false;
|
|
52772
|
+
return () => {
|
|
52773
|
+
const stop = ran;
|
|
52774
|
+
ran = true;
|
|
52775
|
+
return stop;
|
|
52776
|
+
};
|
|
52777
|
+
}, "once");
|
|
52778
|
+
const steps = [
|
|
52779
|
+
() => drainCorpus(database, CORPORA.document, stemmerFor2, { batch: SETTLE_BATCH, until: once4() }),
|
|
52780
|
+
() => drainCorpus(database, CORPORA.note, stemmerFor2, { batch: SETTLE_BATCH, until: once4() }),
|
|
52781
|
+
() => fillTrigrams(database, { batch: SETTLE_BATCH, until: once4() })
|
|
52782
|
+
];
|
|
52783
|
+
let total = 0;
|
|
52784
|
+
for (; ; ) {
|
|
52785
|
+
let done = 0;
|
|
52786
|
+
for (const step of steps) {
|
|
52787
|
+
if (until())
|
|
52788
|
+
return total;
|
|
52789
|
+
done += step();
|
|
52790
|
+
}
|
|
52791
|
+
total += done;
|
|
52792
|
+
if (done === 0)
|
|
52793
|
+
return total;
|
|
52794
|
+
await new Promise((resolve) => setImmediate(resolve));
|
|
52795
|
+
}
|
|
52796
|
+
}, "indexWritten"),
|
|
52519
52797
|
chunksToEmbed: /* @__PURE__ */ __name(async (model, { after: after2, limit }) => {
|
|
52520
52798
|
drain();
|
|
52521
52799
|
const scope3 = live2(void 0, void 0);
|
|
@@ -52646,7 +52924,7 @@ var noteSearchOver = /* @__PURE__ */ __name((context) => {
|
|
|
52646
52924
|
};
|
|
52647
52925
|
}, "noteSearchOver");
|
|
52648
52926
|
|
|
52649
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
52927
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/event-search.js
|
|
52650
52928
|
var EVENT_FIELDS = ["text", "exact", "body", "title", "date", "in"];
|
|
52651
52929
|
var inEventAccounts = /* @__PURE__ */ __name((event2) => searchableCopy(event2, "c.account_id IN (SELECT CAST(value AS INTEGER) FROM json_each(?))"), "inEventAccounts");
|
|
52652
52930
|
var EVENT_CORPUS = {
|
|
@@ -52778,7 +53056,7 @@ var eventSearchOver = /* @__PURE__ */ __name((context) => {
|
|
|
52778
53056
|
};
|
|
52779
53057
|
}, "eventSearchOver");
|
|
52780
53058
|
|
|
52781
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
53059
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/domain/moment.js
|
|
52782
53060
|
var calendarMoment = /* @__PURE__ */ __name((wanted, flag6, { zone, end = false } = {}) => {
|
|
52783
53061
|
try {
|
|
52784
53062
|
return zonedMoment(wanted, timezoneOf(zone), { start: 0, end: wanted.length }, { end });
|
|
@@ -52836,7 +53114,7 @@ var aheadOf = /* @__PURE__ */ __name((reference2, flag6, now2 = Date.now(), opti
|
|
|
52836
53114
|
return read2.time;
|
|
52837
53115
|
}, "aheadOf");
|
|
52838
53116
|
|
|
52839
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
53117
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/facts.js
|
|
52840
53118
|
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
53119
|
var iso13 = /* @__PURE__ */ __name((value) => new Date(Number(value)).toISOString(), "iso");
|
|
52842
53120
|
var oneOf5 = /* @__PURE__ */ __name((value, allowed, what) => {
|
|
@@ -52863,6 +53141,7 @@ var factOperationsOver = /* @__PURE__ */ __name((context) => {
|
|
|
52863
53141
|
source: String(row2.source),
|
|
52864
53142
|
evidence: evidenceOf(context, { type: "fact", id: Number(row2.id) }),
|
|
52865
53143
|
sourceReview: sourceReviewOf(database, { type: "fact", id: Number(row2.id) }),
|
|
53144
|
+
...reversalOf(row2),
|
|
52866
53145
|
createdAt: iso13(row2.created_at),
|
|
52867
53146
|
updatedAt: iso13(row2.updated_at)
|
|
52868
53147
|
}), "factOf");
|
|
@@ -52883,8 +53162,9 @@ var factOperationsOver = /* @__PURE__ */ __name((context) => {
|
|
|
52883
53162
|
ownerOnly: ownerOnly2
|
|
52884
53163
|
}, by, context.decisions), "decided");
|
|
52885
53164
|
const retiresAccepted = /* @__PURE__ */ __name((row2) => row2.status === "proposed" && row2.supersedes_id != null && database.prepare("SELECT 1 FROM facts WHERE id = ? AND status = 'accepted'").get(Number(row2.supersedes_id)) !== void 0, "retiresAccepted");
|
|
53165
|
+
const whyOf2 = /* @__PURE__ */ __name((by, reason) => [by === "owner" ? void 0 : by.reason.trim(), reason?.trim() || void 0].filter(Boolean).join(": ") || null, "whyOf");
|
|
52886
53166
|
const keepDecision = /* @__PURE__ */ __name((id2, by, reason) => {
|
|
52887
|
-
const why =
|
|
53167
|
+
const why = whyOf2(by, reason) ?? "";
|
|
52888
53168
|
if (by === "owner" && !why)
|
|
52889
53169
|
return;
|
|
52890
53170
|
const decision = by === "owner" ? { by: "owner", reason: why } : { by: "agent", bot: by.bot, reason: why };
|
|
@@ -52961,7 +53241,7 @@ var factOperationsOver = /* @__PURE__ */ __name((context) => {
|
|
|
52961
53241
|
write(database, () => accept(id2, by));
|
|
52962
53242
|
return factOf(rowOf3(reference2));
|
|
52963
53243
|
}, "acceptChecked"),
|
|
52964
|
-
reverse: /* @__PURE__ */ __name((reference2, by) => {
|
|
53244
|
+
reverse: /* @__PURE__ */ __name((reference2, by, reason) => {
|
|
52965
53245
|
const row2 = rowOf3(reference2);
|
|
52966
53246
|
assertMayWithdraw({ id: `fact:${row2.id}`, proposedBy: { type: "unknown" }, proposed: false }, by);
|
|
52967
53247
|
if (row2.type !== "decision")
|
|
@@ -52969,7 +53249,13 @@ var factOperationsOver = /* @__PURE__ */ __name((context) => {
|
|
|
52969
53249
|
if (row2.status !== "accepted")
|
|
52970
53250
|
throw new CliError("validation_error", "only an accepted decision can be reversed");
|
|
52971
53251
|
write(database, () => {
|
|
52972
|
-
|
|
53252
|
+
const at2 = now2();
|
|
53253
|
+
const why = whyOf2(by, reason);
|
|
53254
|
+
database.prepare("UPDATE facts SET status = 'reversed', updated_at = ? WHERE id = ?").run(at2, Number(row2.id));
|
|
53255
|
+
if (by !== "owner" || why !== null) {
|
|
53256
|
+
const step = { step: "reversed", by: by === "owner" ? "owner" : "agent", bot: by === "owner" ? null : by.bot };
|
|
53257
|
+
database.prepare("UPDATE facts SET metadata = json_set(coalesce(metadata, '{}'), '$.history', json(coalesce(json_extract(metadata, '$.history'), '[]')), '$.history[#]', json(?)) WHERE id = ?").run(JSON.stringify({ ...step, at: iso13(at2), reason: why }), Number(row2.id));
|
|
53258
|
+
}
|
|
52973
53259
|
closing(Number(row2.id), by, "reversed");
|
|
52974
53260
|
});
|
|
52975
53261
|
return factOf(rowOf3(reference2));
|
|
@@ -53012,10 +53298,11 @@ var factOperationsOver = /* @__PURE__ */ __name((context) => {
|
|
|
53012
53298
|
});
|
|
53013
53299
|
return factOf(rowOf3(reference2));
|
|
53014
53300
|
}, "reject"),
|
|
53015
|
-
remove: /* @__PURE__ */ __name((reference2, by) => {
|
|
53301
|
+
remove: /* @__PURE__ */ __name((reference2, by, reason) => {
|
|
53016
53302
|
const row2 = rowOf3(reference2);
|
|
53017
53303
|
withdrawn(row2, by);
|
|
53018
53304
|
const id2 = Number(row2.id);
|
|
53305
|
+
const { subject: subject2 } = subjectOf(database, row2);
|
|
53019
53306
|
const twin = row2.source === "memory" && row2.metadata != null ? migratedFrom(String(row2.metadata)) : void 0;
|
|
53020
53307
|
const links2 = erase(database, () => {
|
|
53021
53308
|
keepHighestId(database, "facts", now2());
|
|
@@ -53027,15 +53314,45 @@ var factOperationsOver = /* @__PURE__ */ __name((context) => {
|
|
|
53027
53314
|
database.prepare("DELETE FROM links WHERE from_type = 'fact' AND from_id = ?").run(id2);
|
|
53028
53315
|
database.prepare("DELETE FROM taggings WHERE taggable_type = 'fact' AND taggable_id = ?").run(id2);
|
|
53029
53316
|
database.prepare("DELETE FROM facts WHERE id = ?").run(id2);
|
|
53317
|
+
database.prepare("INSERT INTO fact_removals (fact_id, subject, removed_by, bot, reason, removed_at) VALUES (?, ?, ?, ?, ?, ?)").run(id2, subject2, by === "owner" ? "owner" : "agent", by === "owner" ? null : by.bot, whyOf2(by, reason), now2());
|
|
53030
53318
|
if (twin !== void 0)
|
|
53031
53319
|
database.prepare("DELETE FROM memories WHERE id = ? AND deleted_at IS NOT NULL").run(twin);
|
|
53032
53320
|
return count2;
|
|
53033
53321
|
});
|
|
53034
53322
|
return { ref: `fact:${id2}`, removed: true, links: links2 };
|
|
53035
53323
|
}, "remove"),
|
|
53324
|
+
removed: /* @__PURE__ */ __name((options = {}) => {
|
|
53325
|
+
const limit = Math.min(Math.max(options.limit ?? 100, 1), 500);
|
|
53326
|
+
const offset = Math.max(options.offset ?? 0, 0);
|
|
53327
|
+
const rows = database.prepare("SELECT * FROM fact_removals ORDER BY removed_at DESC, id DESC LIMIT ? OFFSET ?").all(limit + 1, offset).map((one2) => ({
|
|
53328
|
+
fact: `fact:${one2.fact_id}`,
|
|
53329
|
+
subject: one2.subject == null ? null : String(one2.subject),
|
|
53330
|
+
removedBy: one2.removed_by === "agent" ? "agent" : "owner",
|
|
53331
|
+
bot: one2.bot == null ? null : String(one2.bot),
|
|
53332
|
+
reason: one2.reason == null ? null : String(one2.reason),
|
|
53333
|
+
removedAt: iso13(one2.removed_at)
|
|
53334
|
+
}));
|
|
53335
|
+
return pageOfRows(rows, limit, offset);
|
|
53336
|
+
}, "removed"),
|
|
53036
53337
|
sources: /* @__PURE__ */ __name((reference2) => evidenceSourcesOf(database, { type: "fact", id: Number(rowOf3(reference2).id) }), "sources")
|
|
53037
53338
|
};
|
|
53038
53339
|
}, "factOperationsOver");
|
|
53340
|
+
var reversalOf = /* @__PURE__ */ __name((row2) => {
|
|
53341
|
+
if (row2.status !== "reversed" || row2.metadata == null)
|
|
53342
|
+
return {};
|
|
53343
|
+
const { history } = JSON.parse(String(row2.metadata));
|
|
53344
|
+
const step = history?.findLast((one2) => one2.step === "reversed");
|
|
53345
|
+
if (!step)
|
|
53346
|
+
return {};
|
|
53347
|
+
return {
|
|
53348
|
+
reversal: {
|
|
53349
|
+
by: step.by === "agent" ? "agent" : "owner",
|
|
53350
|
+
bot: typeof step.bot === "string" ? step.bot : null,
|
|
53351
|
+
at: String(step.at),
|
|
53352
|
+
reason: typeof step.reason === "string" ? step.reason : null
|
|
53353
|
+
}
|
|
53354
|
+
};
|
|
53355
|
+
}, "reversalOf");
|
|
53039
53356
|
var migratedFrom = /* @__PURE__ */ __name((metadata3) => {
|
|
53040
53357
|
try {
|
|
53041
53358
|
const { memory } = JSON.parse(metadata3);
|
|
@@ -53051,15 +53368,16 @@ var factsStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
53051
53368
|
get: /* @__PURE__ */ __name(async (reference2) => operations.get(reference2), "get"),
|
|
53052
53369
|
list: /* @__PURE__ */ __name(async (options) => operations.list(options), "list"),
|
|
53053
53370
|
accept: /* @__PURE__ */ __name(async (reference2, by, reason) => operations.accept(reference2, by, reason), "accept"),
|
|
53054
|
-
reverse: /* @__PURE__ */ __name(async (reference2, by) => operations.reverse(reference2, by), "reverse"),
|
|
53371
|
+
reverse: /* @__PURE__ */ __name(async (reference2, by, reason) => operations.reverse(reference2, by, reason), "reverse"),
|
|
53055
53372
|
revoke: /* @__PURE__ */ __name(async (reference2, by, reason) => operations.revoke(reference2, by, reason), "revoke"),
|
|
53056
53373
|
reject: /* @__PURE__ */ __name(async (reference2, by, reason) => operations.reject(reference2, by, reason), "reject"),
|
|
53057
|
-
remove: /* @__PURE__ */ __name(async (reference2, by) => operations.remove(reference2, by), "remove"),
|
|
53374
|
+
remove: /* @__PURE__ */ __name(async (reference2, by, reason) => operations.remove(reference2, by, reason), "remove"),
|
|
53375
|
+
removed: /* @__PURE__ */ __name(async (options) => operations.removed(options), "removed"),
|
|
53058
53376
|
sources: /* @__PURE__ */ __name(async (reference2) => operations.sources(reference2), "sources")
|
|
53059
53377
|
};
|
|
53060
53378
|
}, "factsStoreOver");
|
|
53061
53379
|
|
|
53062
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
53380
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/findings-core.js
|
|
53063
53381
|
var invalid5 = /* @__PURE__ */ __name((message3) => {
|
|
53064
53382
|
throw new CliError("validation_error", message3);
|
|
53065
53383
|
}, "invalid");
|
|
@@ -53153,14 +53471,14 @@ var findingsCoreOver = /* @__PURE__ */ __name((context, kind3) => {
|
|
|
53153
53471
|
}, "previous");
|
|
53154
53472
|
const create = /* @__PURE__ */ __name((finding, agent, decidedBy) => {
|
|
53155
53473
|
const evidence = finding.evidence.map((item) => item.reference);
|
|
53156
|
-
const
|
|
53474
|
+
const quoted6 = finding.evidence.map((item) => item.quote === void 0 ? item.reference : { ref: item.reference, quote: item.quote });
|
|
53157
53475
|
if (finding.kind === "fact") {
|
|
53158
53476
|
const fact = facts2.add({
|
|
53159
53477
|
type: finding.type,
|
|
53160
53478
|
statement: finding.statement,
|
|
53161
53479
|
...finding.project === void 0 ? {} : { project: finding.project },
|
|
53162
53480
|
...finding.subject === void 0 ? {} : { subject: finding.subject },
|
|
53163
|
-
evidence:
|
|
53481
|
+
evidence: quoted6,
|
|
53164
53482
|
by: agent
|
|
53165
53483
|
});
|
|
53166
53484
|
return facts2.acceptChecked(fact.ref, decidedBy).ref;
|
|
@@ -53181,7 +53499,7 @@ var findingsCoreOver = /* @__PURE__ */ __name((context, kind3) => {
|
|
|
53181
53499
|
const id2 = taskRowOf(database, task.id);
|
|
53182
53500
|
if (id2 === void 0)
|
|
53183
53501
|
throw new CliError("configuration_error", "created finding task is unavailable");
|
|
53184
|
-
linkEvidence(context, { type: finding.type, id: id2 },
|
|
53502
|
+
linkEvidence(context, { type: finding.type, id: id2 }, quoted6, "agent");
|
|
53185
53503
|
if (finding.assignee)
|
|
53186
53504
|
tasks2.assign(task.id, { to: finding.assignee, role: "assignee" }, agent);
|
|
53187
53505
|
return task.ref;
|
|
@@ -53227,7 +53545,7 @@ var findingsCoreOver = /* @__PURE__ */ __name((context, kind3) => {
|
|
|
53227
53545
|
return { snapshot: snapshot2, snapshotParts, previous, settle, keepWaiting, named: named2, sameDecision, create };
|
|
53228
53546
|
}, "findingsCoreOver");
|
|
53229
53547
|
|
|
53230
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
53548
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/evidence-findings.js
|
|
53231
53549
|
var stale = /* @__PURE__ */ __name(() => {
|
|
53232
53550
|
throw new CliError("validation_error", "evidence findings changed since they were read; stage a new batch", {
|
|
53233
53551
|
reason: "evidence-findings.stale"
|
|
@@ -53279,7 +53597,7 @@ var evidenceFindingsStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
53279
53597
|
const cite = /* @__PURE__ */ __name(() => {
|
|
53280
53598
|
let readBytes = 0;
|
|
53281
53599
|
const texts2 = /* @__PURE__ */ new Map();
|
|
53282
|
-
const
|
|
53600
|
+
const quoted6 = /* @__PURE__ */ __name((evidence) => {
|
|
53283
53601
|
if (evidence.quote !== void 0 && !quoteKept(evidence.quote, texts2.get(evidence.reference) ?? ""))
|
|
53284
53602
|
throw new CliError("validation_error", `the quote cited from ${evidence.reference} is not in its text`, {
|
|
53285
53603
|
reason: "finding.quote-not-found"
|
|
@@ -53289,7 +53607,7 @@ var evidenceFindingsStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
53289
53607
|
if (seen.has(evidence.reference)) {
|
|
53290
53608
|
if (seen.get(evidence.reference) !== evidence.fingerprint)
|
|
53291
53609
|
return stale();
|
|
53292
|
-
return
|
|
53610
|
+
return quoted6(evidence);
|
|
53293
53611
|
}
|
|
53294
53612
|
const record3 = contextRecordOf(database, evidence.reference);
|
|
53295
53613
|
if (!record3)
|
|
@@ -53302,7 +53620,7 @@ var evidenceFindingsStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
53302
53620
|
return stale();
|
|
53303
53621
|
seen.set(evidence.reference, fingerprint2);
|
|
53304
53622
|
texts2.set(evidence.reference, record3.text);
|
|
53305
|
-
|
|
53623
|
+
quoted6(evidence);
|
|
53306
53624
|
};
|
|
53307
53625
|
}, "cite");
|
|
53308
53626
|
const snapshot2 = /* @__PURE__ */ __name((input) => core.snapshot(input, cite()), "snapshot");
|
|
@@ -53491,7 +53809,7 @@ var evidenceFindingsStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
53491
53809
|
};
|
|
53492
53810
|
}, "evidenceFindingsStoreOver");
|
|
53493
53811
|
|
|
53494
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
53812
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/involvements.js
|
|
53495
53813
|
var pendingInvolvements = /* @__PURE__ */ __name((database) => Number(database.prepare("SELECT count(*) AS n FROM involvement_pending").get()?.n ?? 0), "pendingInvolvements");
|
|
53496
53814
|
var involvementStoreOver = /* @__PURE__ */ __name(({ database, now: now2 }) => ({
|
|
53497
53815
|
rebuild: /* @__PURE__ */ __name((personId) => write(database, () => {
|
|
@@ -53545,7 +53863,7 @@ var involvementStoreOver = /* @__PURE__ */ __name(({ database, now: now2 }) => (
|
|
|
53545
53863
|
}, "forPerson")
|
|
53546
53864
|
}), "involvementStoreOver");
|
|
53547
53865
|
|
|
53548
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
53866
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/labelled.js
|
|
53549
53867
|
var LABELLED = {
|
|
53550
53868
|
note: "note",
|
|
53551
53869
|
document: "document",
|
|
@@ -53558,7 +53876,7 @@ var LABELLED = {
|
|
|
53558
53876
|
};
|
|
53559
53877
|
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
53878
|
|
|
53561
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
53879
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-projects.js
|
|
53562
53880
|
import { createHash as createHash15 } from "node:crypto";
|
|
53563
53881
|
var fields3 = "id,from_id,to_id,source,confirmed,updated_at,length(evidence) AS evidenceLength,substr(evidence,1,2000) AS evidence";
|
|
53564
53882
|
var id = /* @__PURE__ */ __name((value) => {
|
|
@@ -53644,7 +53962,7 @@ var meetingProjectsStoreOver = /* @__PURE__ */ __name(({ database, now: now2 })
|
|
|
53644
53962
|
};
|
|
53645
53963
|
}, "meetingProjectsStoreOver");
|
|
53646
53964
|
|
|
53647
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
53965
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/knowledge-query.js
|
|
53648
53966
|
var ORGANIZATIONS_QUERY = {
|
|
53649
53967
|
entity: "organization",
|
|
53650
53968
|
backend: "sql",
|
|
@@ -53685,7 +54003,7 @@ var REMINDERS_QUERY = {
|
|
|
53685
54003
|
})
|
|
53686
54004
|
};
|
|
53687
54005
|
|
|
53688
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
54006
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/organization-categories.js
|
|
53689
54007
|
var OWN2 = "(SELECT id FROM organizations WHERE deleted_at IS NULL AND json_extract(metadata, '$.own') = 1)";
|
|
53690
54008
|
var EMPLOYED = "('employee', 'contractor', 'founder')";
|
|
53691
54009
|
var categorySql = /* @__PURE__ */ __name(({ category, accounts: accounts2 }, now2) => {
|
|
@@ -53706,7 +54024,7 @@ var categorySql = /* @__PURE__ */ __name(({ category, accounts: accounts2 }, now
|
|
|
53706
54024
|
return { sql: `EXISTS (SELECT 1 FROM links l WHERE ${where} AND ${usable})`, params: keys };
|
|
53707
54025
|
}, "categorySql");
|
|
53708
54026
|
|
|
53709
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
54027
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/organizations.js
|
|
53710
54028
|
var organizationOf = /* @__PURE__ */ __name((row2) => ({
|
|
53711
54029
|
id: String(row2.id),
|
|
53712
54030
|
ref: `organization:${row2.id}`,
|
|
@@ -53751,7 +54069,7 @@ var organizationsStoreOver = /* @__PURE__ */ __name(({ database, now: now2 }) =>
|
|
|
53751
54069
|
}), "setOwnOrganization")
|
|
53752
54070
|
}), "organizationsStoreOver");
|
|
53753
54071
|
|
|
53754
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
54072
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/relation-list.js
|
|
53755
54073
|
var KINDS = RELATION_KINDS.map(linkKind).join(", ");
|
|
53756
54074
|
var ACCOUNT_ENDS = [
|
|
53757
54075
|
["deal", "deals"],
|
|
@@ -53902,13 +54220,13 @@ var relationListOver = /* @__PURE__ */ __name((context) => {
|
|
|
53902
54220
|
__name(proposalItem, "proposalItem");
|
|
53903
54221
|
}, "relationListOver");
|
|
53904
54222
|
|
|
53905
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
54223
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/relation-reads.js
|
|
53906
54224
|
var relationReadsOver = /* @__PURE__ */ __name((context) => ({
|
|
53907
54225
|
...relationListOver(context),
|
|
53908
54226
|
...relationRolesOver(context)
|
|
53909
54227
|
}), "relationReadsOver");
|
|
53910
54228
|
|
|
53911
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
54229
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/source-review.js
|
|
53912
54230
|
var TABLES5 = { memory: "memories", fact: "facts" };
|
|
53913
54231
|
var RETIRED = /* @__PURE__ */ new Set(["superseded", "reversed", "rejected", "stale"]);
|
|
53914
54232
|
var DEFAULT_LIMIT = 500;
|
|
@@ -54151,16 +54469,16 @@ var sourceReviewStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
54151
54469
|
};
|
|
54152
54470
|
}, "sourceReviewStoreOver");
|
|
54153
54471
|
|
|
54154
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
54472
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/vocabulary.js
|
|
54155
54473
|
import { createHash as createHash18 } from "node:crypto";
|
|
54156
54474
|
|
|
54157
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
54475
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/tag-consolidation.js
|
|
54158
54476
|
import { createHash as createHash17 } from "node:crypto";
|
|
54159
54477
|
|
|
54160
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
54478
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/tag-consolidation-apply.js
|
|
54161
54479
|
import { createHash as createHash16 } from "node:crypto";
|
|
54162
54480
|
|
|
54163
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
54481
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/tag-consolidation-input.js
|
|
54164
54482
|
var consolidationId = /* @__PURE__ */ __name((value, field4) => {
|
|
54165
54483
|
if (typeof value !== "string" || !/^[1-9]\d*$/.test(value) || !Number.isSafeInteger(Number(value)))
|
|
54166
54484
|
throw new CliError("validation_error", `${field4} must be a positive canonical tag id`);
|
|
@@ -54211,7 +54529,7 @@ var consolidationApplyInput = /* @__PURE__ */ __name((options) => {
|
|
|
54211
54529
|
return input;
|
|
54212
54530
|
}, "consolidationApplyInput");
|
|
54213
54531
|
|
|
54214
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
54532
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/tag-consolidation-apply.js
|
|
54215
54533
|
var receiptOf = /* @__PURE__ */ __name((row2) => ({
|
|
54216
54534
|
id: String(row2.id),
|
|
54217
54535
|
sourceId: String(row2.source_id),
|
|
@@ -54286,7 +54604,7 @@ var applyTagConsolidation = /* @__PURE__ */ __name((context, preview, options) =
|
|
|
54286
54604
|
}, { beforeCommit: check3 });
|
|
54287
54605
|
}, "applyTagConsolidation");
|
|
54288
54606
|
|
|
54289
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
54607
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/tag-consolidation.js
|
|
54290
54608
|
var selections = [
|
|
54291
54609
|
["taggings", "tag_id IN (SELECT value FROM json_each(?))"],
|
|
54292
54610
|
["aliases", "aliasable_type='tag' AND aliasable_id IN (SELECT value FROM json_each(?))"],
|
|
@@ -54430,7 +54748,7 @@ var previewRows = /* @__PURE__ */ __name((context, options, source2, survivor, m
|
|
|
54430
54748
|
};
|
|
54431
54749
|
}, "previewRows");
|
|
54432
54750
|
|
|
54433
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
54751
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/vocabulary.js
|
|
54434
54752
|
var kinds = ["project", "tag", "topic"];
|
|
54435
54753
|
var cancelled2 = /* @__PURE__ */ __name((signal) => {
|
|
54436
54754
|
if (signal?.aborted)
|
|
@@ -54694,7 +55012,7 @@ var vocabularyStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
54694
55012
|
};
|
|
54695
55013
|
}, "vocabularyStoreOver");
|
|
54696
55014
|
|
|
54697
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
55015
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/knowledge.js
|
|
54698
55016
|
var TYPED_KEY_PREFIXES = new Set(Object.values(TASK_KEY_PREFIXES));
|
|
54699
55017
|
var ORGANIZATION_KINDS = ["company", "team", "family", "community"];
|
|
54700
55018
|
var PROJECT_TYPES = ["work", "client", "personal", "oss", "other"];
|
|
@@ -55248,7 +55566,7 @@ var projectKey = /* @__PURE__ */ __name((name) => {
|
|
|
55248
55566
|
return key2.padEnd(3, "X");
|
|
55249
55567
|
}, "projectKey");
|
|
55250
55568
|
|
|
55251
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
55569
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/log-pruning.js
|
|
55252
55570
|
var DAY7 = 864e5;
|
|
55253
55571
|
var SETTING5 = "logs_pruned_at";
|
|
55254
55572
|
var LOG_RETENTION = { agentActionsMs: 90 * DAY7, botUpdatePayloadsMs: 30 * DAY7 };
|
|
@@ -55275,7 +55593,7 @@ var logPruner = /* @__PURE__ */ __name((database, now2) => {
|
|
|
55275
55593
|
};
|
|
55276
55594
|
}, "logPruner");
|
|
55277
55595
|
|
|
55278
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
55596
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/mail/findings.js
|
|
55279
55597
|
var MAIL_FINDINGS_PER_RUN = 30;
|
|
55280
55598
|
var MAIL_FINDINGS_PER_SENDER = 5;
|
|
55281
55599
|
var invalid7 = /* @__PURE__ */ __name((message3) => {
|
|
@@ -55634,7 +55952,7 @@ var checkMailFindings = /* @__PURE__ */ __name((input) => {
|
|
|
55634
55952
|
}, "checkMailFindings");
|
|
55635
55953
|
var mailFindingFingerprint = /* @__PURE__ */ __name(({ id: _id, ...finding }) => findingHash(finding), "mailFindingFingerprint");
|
|
55636
55954
|
|
|
55637
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
55955
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/orders.js
|
|
55638
55956
|
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
55957
|
var orderOperationsOver = /* @__PURE__ */ __name((context) => {
|
|
55640
55958
|
const { database, now: now2 } = context;
|
|
@@ -55849,7 +56167,7 @@ var ordersStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
55849
56167
|
};
|
|
55850
56168
|
}, "ordersStoreOver");
|
|
55851
56169
|
|
|
55852
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
56170
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/mail-findings.js
|
|
55853
56171
|
var MAIL_EDITS = {
|
|
55854
56172
|
task: ["title", "type", "reason", "commitment", "project", "dueAt", "dueEvidence", "assignee", "assigneeEvidence"],
|
|
55855
56173
|
fact: ["statement", "type", "reason", "subject", "project"],
|
|
@@ -56338,7 +56656,7 @@ ${evidence.join("\n")}`, agent);
|
|
|
56338
56656
|
};
|
|
56339
56657
|
}, "mailFindingsStoreOver");
|
|
56340
56658
|
|
|
56341
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
56659
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-findings.js
|
|
56342
56660
|
var stale3 = /* @__PURE__ */ __name(() => {
|
|
56343
56661
|
throw new CliError("validation_error", "meeting findings changed since they were read; stage a new batch", {
|
|
56344
56662
|
reason: "meeting-findings.stale"
|
|
@@ -56551,7 +56869,7 @@ var meetingFindingsStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
56551
56869
|
};
|
|
56552
56870
|
}, "meetingFindingsStoreOver");
|
|
56553
56871
|
|
|
56554
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
56872
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-vectors.js
|
|
56555
56873
|
var RANK_BATCH = 512;
|
|
56556
56874
|
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
56875
|
var limitOf2 = /* @__PURE__ */ __name((value, name, max = 1e3) => {
|
|
@@ -56822,7 +57140,7 @@ var meetingVectorsOver = /* @__PURE__ */ __name((context) => ({
|
|
|
56822
57140
|
}
|
|
56823
57141
|
}), "meetingVectorsOver");
|
|
56824
57142
|
|
|
56825
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
57143
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/mention-sources.js
|
|
56826
57144
|
var OTHER_SOURCES = ["document", "note", "email"];
|
|
56827
57145
|
var TEXTS = {
|
|
56828
57146
|
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 +57241,7 @@ var sourceMentionStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
56923
57241
|
};
|
|
56924
57242
|
}, "sourceMentionStoreOver");
|
|
56925
57243
|
|
|
56926
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
57244
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/money-transactions.js
|
|
56927
57245
|
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
57246
|
var MAX_SPLITS = 100;
|
|
56929
57247
|
var transactionOperationsOver = /* @__PURE__ */ __name((context) => {
|
|
@@ -57157,11 +57475,11 @@ var transactionsStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
57157
57475
|
};
|
|
57158
57476
|
}, "transactionsStoreOver");
|
|
57159
57477
|
|
|
57160
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
57478
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/open-store.js
|
|
57161
57479
|
import { accessSync, constants, existsSync as existsSync2, mkdirSync as mkdirSync2, statSync as statSync2, writeFileSync as writeFileSync2 } from "node:fs";
|
|
57162
57480
|
import { dirname as dirname2 } from "node:path";
|
|
57163
57481
|
|
|
57164
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
57482
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/clients.js
|
|
57165
57483
|
import { readFileSync as readFileSync3 } from "node:fs";
|
|
57166
57484
|
var CLIENTS_SETTING = "clients";
|
|
57167
57485
|
var coreVersion = (() => {
|
|
@@ -57222,7 +57540,7 @@ var refusalAdvice = /* @__PURE__ */ __name((clients, command, schema) => {
|
|
|
57222
57540
|
return mover ? `${own} (${mover.command} ${mover.version} moved the store to schema ${schema})` : own;
|
|
57223
57541
|
}, "refusalAdvice");
|
|
57224
57542
|
|
|
57225
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
57543
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/migrations.generated.js
|
|
57226
57544
|
var GENERATED = [
|
|
57227
57545
|
{
|
|
57228
57546
|
"name": "20261010184427_initial",
|
|
@@ -58573,10 +58891,19 @@ WHERE json_type(params, '$.selection') = 'object';`
|
|
|
58573
58891
|
"CREATE TRIGGER person_kind_identity_au AFTER UPDATE OF provider, external_id, name, username, phone, email, bot ON identities\nWHEN OLD.provider IS NOT NEW.provider OR OLD.external_id IS NOT NEW.external_id OR OLD.name IS NOT NEW.name OR OLD.username IS NOT NEW.username OR OLD.phone IS NOT NEW.phone OR OLD.email IS NOT NEW.email OR OLD.bot IS NOT NEW.bot BEGIN\n UPDATE persons SET kind = NULL WHERE kind IS NOT NULL AND id IN (SELECT person_id FROM identity_links WHERE identity_id = NEW.id);\nEND;",
|
|
58574
58892
|
"UPDATE persons SET kind = NULL WHERE kind IS NOT NULL AND trim(coalesce(name, '')) = '';"
|
|
58575
58893
|
]
|
|
58894
|
+
},
|
|
58895
|
+
{
|
|
58896
|
+
"name": "20261113154357_version-67-fact-removals-call-fields",
|
|
58897
|
+
"statements": [
|
|
58898
|
+
"CREATE TABLE `fact_removals` (\n `id` integer PRIMARY KEY,\n `fact_id` integer NOT NULL,\n `subject` text,\n `removed_by` text NOT NULL,\n `bot` text,\n `reason` text,\n `removed_at` integer NOT NULL\n);",
|
|
58899
|
+
"ALTER TABLE `meetings` ADD `direction` text;",
|
|
58900
|
+
"ALTER TABLE `meetings` ADD `client_phone` text;",
|
|
58901
|
+
"CREATE INDEX `fact_removals_by_removed_at` ON `fact_removals` (`removed_at`);"
|
|
58902
|
+
]
|
|
58576
58903
|
}
|
|
58577
58904
|
];
|
|
58578
58905
|
|
|
58579
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
58906
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/rollback-copy.js
|
|
58580
58907
|
import { mkdirSync, rmSync, statfsSync, writeFileSync } from "node:fs";
|
|
58581
58908
|
import { basename, dirname, join as join3, parse } from "node:path";
|
|
58582
58909
|
var DERIVED = /(_fts|_words|_stems|_trigrams|_pending)$|^(embeddings|chunks|chunk_messages|mentions|involvements|search_terms)$|^vector_index/;
|
|
@@ -58595,7 +58922,7 @@ var freeBytesOf = /* @__PURE__ */ __name((dir) => {
|
|
|
58595
58922
|
}, "freeBytesOf");
|
|
58596
58923
|
var tableIn = /* @__PURE__ */ __name((database, schema, name) => database.prepare(`SELECT 1 FROM ${schema}.sqlite_master WHERE type = 'table' AND name = ?`).get(name) !== void 0, "tableIn");
|
|
58597
58924
|
var keepsRowid = /* @__PURE__ */ __name((database, schema, table) => Number(database.prepare("SELECT wr FROM pragma_table_list WHERE schema = ? AND name = ?").get(schema, table)?.wr) === 0, "keepsRowid");
|
|
58598
|
-
var
|
|
58925
|
+
var columnsOf5 = /* @__PURE__ */ __name((database, schema, table) => database.prepare("SELECT name FROM pragma_table_info(?, ?)").all(table, schema).map((row2) => String(row2.name)), "columnsOf");
|
|
58599
58926
|
var versionOf = /* @__PURE__ */ __name((database) => Number(database.prepare("SELECT max(version) AS version FROM main.schema_migrations").get()?.version ?? 0), "versionOf");
|
|
58600
58927
|
var tableBytes = /* @__PURE__ */ __name((database, tables) => {
|
|
58601
58928
|
try {
|
|
@@ -58749,16 +59076,16 @@ var rebuild = /* @__PURE__ */ __name((database, table, sql2) => {
|
|
|
58749
59076
|
const aside = `__rollback_${table}`;
|
|
58750
59077
|
database.exec(`ALTER TABLE ${quote2(table)} RENAME TO ${quote2(aside)}`);
|
|
58751
59078
|
database.exec(sql2);
|
|
58752
|
-
const kept2 = new Set(
|
|
58753
|
-
const columns2 =
|
|
59079
|
+
const kept2 = new Set(columnsOf5(database, "main", aside));
|
|
59080
|
+
const columns2 = columnsOf5(database, "main", table).filter((column2) => kept2.has(column2));
|
|
58754
59081
|
const rowid = keepsRowid(database, "main", table) ? ["rowid"] : [];
|
|
58755
59082
|
const list2 = [...rowid, ...columns2.map(quote2)].join(", ");
|
|
58756
59083
|
database.exec(`INSERT INTO ${quote2(table)} (${list2}) SELECT ${list2} FROM ${quote2(aside)}`);
|
|
58757
59084
|
database.exec(`DROP TABLE ${quote2(aside)}`);
|
|
58758
59085
|
}, "rebuild");
|
|
58759
59086
|
var restoreRows = /* @__PURE__ */ __name((database, table) => {
|
|
58760
|
-
const copied = new Set(
|
|
58761
|
-
const columns2 =
|
|
59087
|
+
const copied = new Set(columnsOf5(database, SCHEMA, table));
|
|
59088
|
+
const columns2 = columnsOf5(database, "main", table).filter((column2) => copied.has(column2));
|
|
58762
59089
|
const rowid = keepsRowid(database, "main", table) && copied.has(ROWID);
|
|
58763
59090
|
const into = [...rowid ? ["rowid"] : [], ...columns2.map(quote2)].join(", ");
|
|
58764
59091
|
const from2 = [...rowid ? [ROWID] : [], ...columns2.map(quote2)].join(", ");
|
|
@@ -58809,7 +59136,7 @@ var rollBack2 = /* @__PURE__ */ __name((database, path) => {
|
|
|
58809
59136
|
return { ...result, foreignKeyViolations };
|
|
58810
59137
|
}, "rollBack");
|
|
58811
59138
|
|
|
58812
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
59139
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/manifest.js
|
|
58813
59140
|
var V31_TABLES = [
|
|
58814
59141
|
"accounts",
|
|
58815
59142
|
"account_identities",
|
|
@@ -58938,7 +59265,8 @@ var MANIFEST = [
|
|
|
58938
59265
|
{ name: "20261110020704_version-63-people-ties-messages-crm", version: 63, minCompatible: 56 },
|
|
58939
59266
|
{ name: "20261110084658_version-64-deal-link-triggers", version: 64, minCompatible: 56 },
|
|
58940
59267
|
{ name: "20261110182602_version-65-found-task-titles", version: 65, minCompatible: 56 },
|
|
58941
|
-
{ name: "20261110233711_version-66-identity-name-trigger", version: 66, minCompatible: 56 }
|
|
59268
|
+
{ name: "20261110233711_version-66-identity-name-trigger", version: 66, minCompatible: 56 },
|
|
59269
|
+
{ name: "20261113154357_version-67-fact-removals-call-fields", version: 67, minCompatible: 56 }
|
|
58942
59270
|
];
|
|
58943
59271
|
var generatedMigrations = /* @__PURE__ */ __name((manifest = MANIFEST, generated = GENERATED) => {
|
|
58944
59272
|
const migrations = [];
|
|
@@ -58974,7 +59302,7 @@ var generatedMigrations = /* @__PURE__ */ __name((manifest = MANIFEST, generated
|
|
|
58974
59302
|
return migrations;
|
|
58975
59303
|
}, "generatedMigrations");
|
|
58976
59304
|
|
|
58977
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
59305
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/migrations.js
|
|
58978
59306
|
var MIGRATIONS = generatedMigrations();
|
|
58979
59307
|
var HISTORY = `CREATE TABLE IF NOT EXISTS schema_migrations (
|
|
58980
59308
|
version INTEGER PRIMARY KEY,
|
|
@@ -59071,7 +59399,7 @@ var migrate = /* @__PURE__ */ __name((database, { migrations = MIGRATIONS, now:
|
|
|
59071
59399
|
}
|
|
59072
59400
|
}, "migrate");
|
|
59073
59401
|
|
|
59074
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
59402
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/join-keys.js
|
|
59075
59403
|
var fillJoinKeys = /* @__PURE__ */ __name((database, { batch = 2e3 } = {}) => {
|
|
59076
59404
|
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
59405
|
if (pending.get(0, 1) === void 0)
|
|
@@ -59093,7 +59421,7 @@ var fillJoinKeys = /* @__PURE__ */ __name((database, { batch = 2e3 } = {}) => {
|
|
|
59093
59421
|
}
|
|
59094
59422
|
}, "fillJoinKeys");
|
|
59095
59423
|
|
|
59096
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
59424
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/open.js
|
|
59097
59425
|
var openSqlite = /* @__PURE__ */ __name(async (path, { readOnly = false } = {}) => {
|
|
59098
59426
|
refuseOwnerStoreInTests(path);
|
|
59099
59427
|
const opened = "Bun" in globalThis ? await openUnderBun(path, readOnly) : await openUnderNode(path, readOnly);
|
|
@@ -59107,8 +59435,8 @@ var openSqlite = /* @__PURE__ */ __name(async (path, { readOnly = false } = {})
|
|
|
59107
59435
|
}, "openSqlite");
|
|
59108
59436
|
var openUnderNode = /* @__PURE__ */ __name(async (path, readOnly) => {
|
|
59109
59437
|
quietSqliteWarning();
|
|
59110
|
-
const { drizzle } = await import("./node-
|
|
59111
|
-
const { cacheOverNodeSqlite, nodeClient } = await import("./node-sqlite-
|
|
59438
|
+
const { drizzle } = await import("./node-OVS5LTVZ.js");
|
|
59439
|
+
const { cacheOverNodeSqlite, nodeClient } = await import("./node-sqlite-LC44SM4Z.js");
|
|
59112
59440
|
const client = await nodeClient(path, { readOnly });
|
|
59113
59441
|
try {
|
|
59114
59442
|
if (!readOnly)
|
|
@@ -59122,8 +59450,8 @@ var openUnderNode = /* @__PURE__ */ __name(async (path, readOnly) => {
|
|
|
59122
59450
|
}
|
|
59123
59451
|
}, "openUnderNode");
|
|
59124
59452
|
var openUnderBun = /* @__PURE__ */ __name(async (path, readOnly) => {
|
|
59125
|
-
const { bunClient, cacheOverBunSqlite } = await import("./bun-sqlite-
|
|
59126
|
-
const { drizzle } = await import("./bun-
|
|
59453
|
+
const { bunClient, cacheOverBunSqlite } = await import("./bun-sqlite-KDGWBNOR.js");
|
|
59454
|
+
const { drizzle } = await import("./bun-FVTOBYZ2.js");
|
|
59127
59455
|
const client = await bunClient(path, readOnly ? { readonly: true, create: false } : void 0);
|
|
59128
59456
|
try {
|
|
59129
59457
|
if (!readOnly)
|
|
@@ -59137,7 +59465,7 @@ var openUnderBun = /* @__PURE__ */ __name(async (path, readOnly) => {
|
|
|
59137
59465
|
}
|
|
59138
59466
|
}, "openUnderBun");
|
|
59139
59467
|
|
|
59140
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
59468
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/payment-facts.js
|
|
59141
59469
|
var PAYMENT_FACTS_TO_MOVE = "payment_facts_to_move";
|
|
59142
59470
|
var paymentOf = /* @__PURE__ */ __name((metadata3) => {
|
|
59143
59471
|
try {
|
|
@@ -59205,7 +59533,7 @@ var movePaymentFacts = /* @__PURE__ */ __name((context) => {
|
|
|
59205
59533
|
});
|
|
59206
59534
|
}, "movePaymentFacts");
|
|
59207
59535
|
|
|
59208
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
59536
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/read-compatibility.js
|
|
59209
59537
|
var readCompatibility = /* @__PURE__ */ __name((database, command) => {
|
|
59210
59538
|
const ours = MIGRATIONS.at(-1)?.version ?? 0;
|
|
59211
59539
|
if (!database.prepare("SELECT 1 FROM sqlite_master WHERE type='table' AND name='schema_migrations'").get())
|
|
@@ -59223,7 +59551,7 @@ var assertReadCompatible = /* @__PURE__ */ __name((database, command) => {
|
|
|
59223
59551
|
throw new CliError("configuration_error", `The store needs schema ${MIGRATIONS.at(-1)?.version ?? 0} maintenance before a read-only open`);
|
|
59224
59552
|
}, "assertReadCompatible");
|
|
59225
59553
|
|
|
59226
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
59554
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/suggested-links.js
|
|
59227
59555
|
var SUGGESTED_LINKS_TO_MOVE = "suggested_links_to_move";
|
|
59228
59556
|
var proposerOf2 = /* @__PURE__ */ __name((provenance2) => {
|
|
59229
59557
|
if (provenance2?.startsWith("rule:"))
|
|
@@ -59269,7 +59597,7 @@ var moveSuggestedLinks = /* @__PURE__ */ __name((database, now2) => {
|
|
|
59269
59597
|
});
|
|
59270
59598
|
}, "moveSuggestedLinks");
|
|
59271
59599
|
|
|
59272
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
59600
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/test-accounts.js
|
|
59273
59601
|
var TEST_ACCOUNTS_TO_PURGE = "test_accounts_to_purge";
|
|
59274
59602
|
var TEST_PROVIDER = "chat";
|
|
59275
59603
|
var purgeTestAccounts = /* @__PURE__ */ __name((context, warn) => {
|
|
@@ -59290,7 +59618,7 @@ var purgeTestAccounts = /* @__PURE__ */ __name((context, warn) => {
|
|
|
59290
59618
|
}
|
|
59291
59619
|
}, "purgeTestAccounts");
|
|
59292
59620
|
|
|
59293
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
59621
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/open-store.js
|
|
59294
59622
|
var BACKFILL_ON_OPEN = 5e3;
|
|
59295
59623
|
var NOT_WRITABLE = /* @__PURE__ */ new Set(["EACCES", "EPERM", "EROFS"]);
|
|
59296
59624
|
var createWritable = /* @__PURE__ */ __name((file) => {
|
|
@@ -59402,7 +59730,7 @@ var openStoreContext = /* @__PURE__ */ __name(async (options = {}) => {
|
|
|
59402
59730
|
}
|
|
59403
59731
|
}, "openStoreContext");
|
|
59404
59732
|
|
|
59405
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
59733
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/products.js
|
|
59406
59734
|
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
59735
|
var productOperationsOver = /* @__PURE__ */ __name((context) => {
|
|
59408
59736
|
const { database, now: now2 } = context;
|
|
@@ -59510,13 +59838,13 @@ var productsStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
59510
59838
|
};
|
|
59511
59839
|
}, "productsStoreOver");
|
|
59512
59840
|
|
|
59513
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
59841
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/project-transfer/plan.js
|
|
59514
59842
|
import { createHash as createHash20 } from "node:crypto";
|
|
59515
59843
|
|
|
59516
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
59844
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/project-transfer/manifest.js
|
|
59517
59845
|
import { createHash as createHash19 } from "node:crypto";
|
|
59518
59846
|
|
|
59519
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
59847
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/project-transfer/schema.js
|
|
59520
59848
|
var text6 = /* @__PURE__ */ __name((max) => pipe(string(), minLength(1), maxLength(max)), "text");
|
|
59521
59849
|
var ref = text6(2048);
|
|
59522
59850
|
var timestamp2 = pipe(number(), safeInteger(), minValue(0));
|
|
@@ -59586,7 +59914,7 @@ var projectAnnotationsSchema = strictObject({
|
|
|
59586
59914
|
}))
|
|
59587
59915
|
});
|
|
59588
59916
|
|
|
59589
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
59917
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/project-transfer/manifest.js
|
|
59590
59918
|
var PROJECT_ANNOTATIONS_MAX_BYTES = 4 * 1024 * 1024;
|
|
59591
59919
|
var invalid10 = /* @__PURE__ */ __name((field4) => {
|
|
59592
59920
|
throw new CliError("validation_error", `invalid project annotations.${field4}`);
|
|
@@ -59719,7 +60047,7 @@ var projectAnnotationsFingerprint = /* @__PURE__ */ __name((json3) => {
|
|
|
59719
60047
|
return createHash19("sha256").update(JSON.stringify(normalized)).digest("hex");
|
|
59720
60048
|
}, "projectAnnotationsFingerprint");
|
|
59721
60049
|
|
|
59722
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
60050
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/project-transfer/plan.js
|
|
59723
60051
|
var hash = pipe(string(), regex(/^[a-f0-9]{64}$/));
|
|
59724
60052
|
var ref2 = pipe(string(), minLength(1), maxLength(2048));
|
|
59725
60053
|
var targetSchema = strictObject({
|
|
@@ -59826,7 +60154,7 @@ var planBoundProjectAnnotations = /* @__PURE__ */ __name((manifest, manifest_fin
|
|
|
59826
60154
|
}, "planBoundProjectAnnotations");
|
|
59827
60155
|
var planProjectAnnotations = /* @__PURE__ */ __name((json3, target, bindings) => planBoundProjectAnnotations(decodeProjectAnnotations(json3), projectAnnotationsFingerprint(json3), target, bindings), "planProjectAnnotations");
|
|
59828
60156
|
|
|
59829
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
60157
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/project-transfer/snapshot-model.js
|
|
59830
60158
|
import { createHash as createHash21 } from "node:crypto";
|
|
59831
60159
|
var text7 = /* @__PURE__ */ __name((max) => pipe(string(), minLength(1), maxLength(max)), "text");
|
|
59832
60160
|
var timestamp3 = pipe(number(), safeInteger(), minValue(0));
|
|
@@ -59920,7 +60248,7 @@ var projectAnnotationSnapshotFingerprint = /* @__PURE__ */ __name((json3) => {
|
|
|
59920
60248
|
})).digest("hex");
|
|
59921
60249
|
}, "projectAnnotationSnapshotFingerprint");
|
|
59922
60250
|
|
|
59923
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
60251
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/project-transfer/request.js
|
|
59924
60252
|
var projectAnnotationRequest = /* @__PURE__ */ __name((request, restore = false) => {
|
|
59925
60253
|
if (!request || typeof request !== "object" || Array.isArray(request))
|
|
59926
60254
|
throw new CliError("validation_error", "project annotation request is required");
|
|
@@ -59937,7 +60265,7 @@ var projectAnnotationRequest = /* @__PURE__ */ __name((request, restore = false)
|
|
|
59937
60265
|
return { snapshot: snapshot2, projectId: Number(request.project.slice(8)) };
|
|
59938
60266
|
}, "projectAnnotationRequest");
|
|
59939
60267
|
|
|
59940
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
60268
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/project-transfer/budget.js
|
|
59941
60269
|
var SnapshotBudget = class {
|
|
59942
60270
|
static {
|
|
59943
60271
|
__name(this, "SnapshotBudget");
|
|
@@ -59963,13 +60291,13 @@ var SnapshotBudget = class {
|
|
|
59963
60291
|
}
|
|
59964
60292
|
};
|
|
59965
60293
|
|
|
59966
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
60294
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/project-transfer/preview.js
|
|
59967
60295
|
import { createHash as createHash23 } from "node:crypto";
|
|
59968
60296
|
|
|
59969
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
60297
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/project-transfer/snapshot-plan.js
|
|
59970
60298
|
var planProjectAnnotationSnapshot = /* @__PURE__ */ __name((json3, target, bindings) => planBoundProjectAnnotations(decodeProjectAnnotationSnapshot(json3), projectAnnotationSnapshotFingerprint(json3), target, bindings), "planProjectAnnotationSnapshot");
|
|
59971
60299
|
|
|
59972
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
60300
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/project-transfer/sources.js
|
|
59973
60301
|
import { createHash as createHash22 } from "node:crypto";
|
|
59974
60302
|
var invalid12 = /* @__PURE__ */ __name(() => {
|
|
59975
60303
|
throw new CliError("configuration_error", "project snapshot has an unavailable or unsupported dependency");
|
|
@@ -60112,7 +60440,7 @@ var ProjectSnapshotSources = class {
|
|
|
60112
60440
|
}
|
|
60113
60441
|
};
|
|
60114
60442
|
|
|
60115
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
60443
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/project-transfer/snapshot.js
|
|
60116
60444
|
var unsupported = /* @__PURE__ */ __name(() => {
|
|
60117
60445
|
throw new CliError("configuration_error", "project snapshot has unsupported metadata, deletion or account scope");
|
|
60118
60446
|
}, "unsupported");
|
|
@@ -60290,7 +60618,7 @@ var projectAnnotationSnapshot = /* @__PURE__ */ __name((database, projectId2, bu
|
|
|
60290
60618
|
return { snapshot: snapshot2, read_bytes: budget.bytes, records: budget.records };
|
|
60291
60619
|
}), "projectAnnotationSnapshot");
|
|
60292
60620
|
|
|
60293
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
60621
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/project-transfer/preview.js
|
|
60294
60622
|
var previewAnnotationSnapshot = /* @__PURE__ */ __name((database, projectId2, manifest, bindings, budget) => read(database, () => {
|
|
60295
60623
|
const current2 = projectAnnotationSnapshot(database, projectId2, budget).snapshot;
|
|
60296
60624
|
const sources = new ProjectSnapshotSources(database, budget);
|
|
@@ -60352,7 +60680,7 @@ var previewAnnotationSnapshot = /* @__PURE__ */ __name((database, projectId2, ma
|
|
|
60352
60680
|
};
|
|
60353
60681
|
}), "previewAnnotationSnapshot");
|
|
60354
60682
|
|
|
60355
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
60683
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/project-transfer/records.js
|
|
60356
60684
|
var metadataOf2 = /* @__PURE__ */ __name((database, link3, to) => {
|
|
60357
60685
|
const provenance2 = link3.provenance === null ? {} : { provenance: link3.provenance };
|
|
60358
60686
|
if (link3.kind === "evidence" && to)
|
|
@@ -60419,7 +60747,7 @@ var restoreAnnotationRecords = /* @__PURE__ */ __name((database, projectId2, sna
|
|
|
60419
60747
|
return mappings;
|
|
60420
60748
|
}, "restoreAnnotationRecords");
|
|
60421
60749
|
|
|
60422
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
60750
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/project-transfer/store.js
|
|
60423
60751
|
var projectAnnotationStoreOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
60424
60752
|
async preview(request) {
|
|
60425
60753
|
const { snapshot: snapshot2, projectId: projectId2 } = projectAnnotationRequest(request);
|
|
@@ -60449,7 +60777,7 @@ var projectAnnotationStoreOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
|
60449
60777
|
}
|
|
60450
60778
|
}), "projectAnnotationStoreOver");
|
|
60451
60779
|
|
|
60452
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
60780
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/record-relations.js
|
|
60453
60781
|
var isDerived = /* @__PURE__ */ __name((role) => role.startsWith("fields."), "isDerived");
|
|
60454
60782
|
var recordRelationsOver = /* @__PURE__ */ __name(({ database }) => {
|
|
60455
60783
|
const sql2 = /* @__PURE__ */ __name((text8) => database.prepare(text8), "sql");
|
|
@@ -60520,7 +60848,7 @@ var recordRelationsOver = /* @__PURE__ */ __name(({ database }) => {
|
|
|
60520
60848
|
return { entityRef, relatedOf, storedRelations, relate, missingOf };
|
|
60521
60849
|
}, "recordRelationsOver");
|
|
60522
60850
|
|
|
60523
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
60851
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/record-remap.js
|
|
60524
60852
|
var recordRemapOver = /* @__PURE__ */ __name(({ database, now: now2 }) => {
|
|
60525
60853
|
const pointedAt = /* @__PURE__ */ __name((type, id2) => {
|
|
60526
60854
|
for (const { table, pointer } of pointerPairs(database))
|
|
@@ -60574,7 +60902,7 @@ var recordRemapOver = /* @__PURE__ */ __name(({ database, now: now2 }) => {
|
|
|
60574
60902
|
return { pointedAt, remap };
|
|
60575
60903
|
}, "recordRemapOver");
|
|
60576
60904
|
|
|
60577
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
60905
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/record-run.js
|
|
60578
60906
|
var runs = 0;
|
|
60579
60907
|
var PAGE = 500;
|
|
60580
60908
|
var recordRunOver = /* @__PURE__ */ __name((context, writes) => {
|
|
@@ -60787,7 +61115,7 @@ var waitingPointer = /* @__PURE__ */ __name((index2, missing4) => {
|
|
|
60787
61115
|
return pointerOf("records", index2, "fields", key2);
|
|
60788
61116
|
}, "waitingPointer");
|
|
60789
61117
|
|
|
60790
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
61118
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/record-matching.js
|
|
60791
61119
|
var valuesOf = /* @__PURE__ */ __name((value) => (Array.isArray(value) ? value : [value]).filter((one2) => typeof one2 === "string"), "valuesOf");
|
|
60792
61120
|
var SCHEME = /^(email|domain|tax-id:[a-z]{2}|registration:[a-z]{2})$/;
|
|
60793
61121
|
var ORG_EMAIL = "org-email";
|
|
@@ -60953,7 +61281,7 @@ var renameMade = /* @__PURE__ */ __name(({ database, now: now2 }, type, id2, nam
|
|
|
60953
61281
|
]);
|
|
60954
61282
|
}, "renameMade");
|
|
60955
61283
|
|
|
60956
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
61284
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/record-projectors-direct.js
|
|
60957
61285
|
var productFields = /* @__PURE__ */ __name((fields4) => ({
|
|
60958
61286
|
name: given2(fields4, "name"),
|
|
60959
61287
|
unit: given2(fields4, "unit"),
|
|
@@ -61076,7 +61404,7 @@ var DIRECT_PROJECTORS = {
|
|
|
61076
61404
|
lead: dealProjector("lead")
|
|
61077
61405
|
};
|
|
61078
61406
|
|
|
61079
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
61407
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/record-projectors-document.js
|
|
61080
61408
|
var TEXT_ONLY = { storage: "text", localPath: null };
|
|
61081
61409
|
var textOf7 = /* @__PURE__ */ __name(({ fields: fields4, externalId }) => {
|
|
61082
61410
|
const text8 = String(fields4.text ?? "");
|
|
@@ -61145,7 +61473,7 @@ var DOCUMENT_PROJECTORS = {
|
|
|
61145
61473
|
}
|
|
61146
61474
|
};
|
|
61147
61475
|
|
|
61148
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
61476
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/record-projectors-money.js
|
|
61149
61477
|
var allocatedByOthers = /* @__PURE__ */ __name((context, paymentId) => {
|
|
61150
61478
|
const importer = authorActor(context, IMPORTER).actor;
|
|
61151
61479
|
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 +61683,7 @@ var MONEY_PROJECTORS = {
|
|
|
61355
61683
|
}
|
|
61356
61684
|
};
|
|
61357
61685
|
|
|
61358
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
61686
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/record-projectors-phone.js
|
|
61359
61687
|
var CALLS_CALENDAR = "calls";
|
|
61360
61688
|
var importOnly = /* @__PURE__ */ __name((source2, type) => {
|
|
61361
61689
|
if (!isImportedProvider(source2.provider))
|
|
@@ -61530,7 +61858,7 @@ var PHONE_PROJECTORS = {
|
|
|
61530
61858
|
}
|
|
61531
61859
|
};
|
|
61532
61860
|
|
|
61533
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
61861
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/record-projectors.js
|
|
61534
61862
|
var RECORD_PROJECTORS = {
|
|
61535
61863
|
...MONEY_PROJECTORS,
|
|
61536
61864
|
...DIRECT_PROJECTORS,
|
|
@@ -61541,7 +61869,7 @@ var RECORD_PROJECTORS = {
|
|
|
61541
61869
|
project: null
|
|
61542
61870
|
};
|
|
61543
61871
|
|
|
61544
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
61872
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/record-settling.js
|
|
61545
61873
|
var recordSettlingOver = /* @__PURE__ */ __name(({ database }, finance) => {
|
|
61546
61874
|
const sql2 = /* @__PURE__ */ __name((text8) => database.prepare(text8), "sql");
|
|
61547
61875
|
const freeOn = /* @__PURE__ */ __name((invoice, payment) => {
|
|
@@ -61603,7 +61931,7 @@ var recordSettlingOver = /* @__PURE__ */ __name(({ database }, finance) => {
|
|
|
61603
61931
|
return { settle, checkShares };
|
|
61604
61932
|
}, "recordSettlingOver");
|
|
61605
61933
|
|
|
61606
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
61934
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/record-stamps.js
|
|
61607
61935
|
import { createHash as createHash24 } from "node:crypto";
|
|
61608
61936
|
var VOLATILE = /* @__PURE__ */ new Set(["id", "created_at", "updated_at", "metadata"]);
|
|
61609
61937
|
var content = /* @__PURE__ */ __name((row2) => row2 === void 0 ? null : Object.fromEntries(Object.entries(row2).filter(([column2]) => !VOLATILE.has(column2))), "content");
|
|
@@ -61619,7 +61947,7 @@ var importStampsOver = /* @__PURE__ */ __name(({ database }) => {
|
|
|
61619
61947
|
return { stamp, untouched };
|
|
61620
61948
|
}, "importStampsOver");
|
|
61621
61949
|
|
|
61622
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
61950
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/subscriptions.js
|
|
61623
61951
|
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
61952
|
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
61953
|
var PRICE_REF = /^subscription_price:([1-9]\d{0,15})$/;
|
|
@@ -61697,7 +62025,7 @@ var subscriptionOperationsOver = /* @__PURE__ */ __name((context) => {
|
|
|
61697
62025
|
const row2 = rowOf3(reference2);
|
|
61698
62026
|
return { ...subscriptionOf(row2), prices: pricesOf2(Number(row2.id)) };
|
|
61699
62027
|
}, "detailOf");
|
|
61700
|
-
const
|
|
62028
|
+
const columnsOf6 = /* @__PURE__ */ __name((fields4, base) => {
|
|
61701
62029
|
const kept2 = /* @__PURE__ */ __name((given3, column2, read2) => given3 === void 0 ? base[column2] ?? null : read2(given3), "kept");
|
|
61702
62030
|
const day3 = /* @__PURE__ */ __name((given3, column2, what) => kept2(given3, column2, (value) => isoDate(value, what)), "day");
|
|
61703
62031
|
const direction = kept2(fields4.direction, "direction", (value) => oneOf3(value, INVOICE_DIRECTIONS, "a subscription's direction"));
|
|
@@ -61784,7 +62112,7 @@ var subscriptionOperationsOver = /* @__PURE__ */ __name((context) => {
|
|
|
61784
62112
|
if (input.prices !== void 0 && (!Array.isArray(input.prices) || input.prices.length > 100))
|
|
61785
62113
|
refuse("a subscription takes at most 100 prices", "subscription.field");
|
|
61786
62114
|
const id2 = write(database, () => {
|
|
61787
|
-
const columns2 =
|
|
62115
|
+
const columns2 = columnsOf6(input, {});
|
|
61788
62116
|
const by = written(input);
|
|
61789
62117
|
const at2 = now2();
|
|
61790
62118
|
const made = Number(database.prepare("INSERT INTO subscriptions (name, direction, supplier_type, supplier_id, customer_type, customer_id, catalog_item_id, contract_id, project_id, status, interval_count, interval_unit, start_date, trial_end_date, next_renewal_date, cancelled_date, end_date, review, author_type, author_id, model, confirmed_by_type, confirmed_by_id, source, metadata, created_at, updated_at) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) RETURNING id").get(columns2.name, columns2.direction, columns2.supplier_type, columns2.supplier_id, columns2.customer_type, columns2.customer_id, columns2.catalog_item_id, columns2.contract_id, by.project, columns2.status, columns2.interval_count, columns2.interval_unit, columns2.start_date, columns2.trial_end_date, columns2.next_renewal_date, columns2.cancelled_date, columns2.end_date, by.review, by.actor.type, by.actor.id, by.model, by.confirmedType, by.confirmedId, by.source, by.metadata, at2, at2)?.id);
|
|
@@ -61814,7 +62142,7 @@ var subscriptionOperationsOver = /* @__PURE__ */ __name((context) => {
|
|
|
61814
62142
|
const row2 = rowOf3(reference2);
|
|
61815
62143
|
writable(row2, by);
|
|
61816
62144
|
write(database, () => {
|
|
61817
|
-
const columns2 =
|
|
62145
|
+
const columns2 = columnsOf6(fields4, row2);
|
|
61818
62146
|
database.prepare("UPDATE subscriptions SET name = ?, direction = ?, supplier_type = ?, supplier_id = ?, customer_type = ?, customer_id = ?, catalog_item_id = ?, contract_id = ?, status = ?, interval_count = ?, interval_unit = ?, start_date = ?, trial_end_date = ?, next_renewal_date = ?, cancelled_date = ?, end_date = ?, updated_at = ? WHERE id = ?").run(columns2.name, columns2.direction, columns2.supplier_type, columns2.supplier_id, columns2.customer_type, columns2.customer_id, columns2.catalog_item_id, columns2.contract_id, columns2.status, columns2.interval_count, columns2.interval_unit, columns2.start_date, columns2.trial_end_date, columns2.next_renewal_date, columns2.cancelled_date, columns2.end_date, now2(), Number(row2.id));
|
|
61819
62147
|
});
|
|
61820
62148
|
return detailOf(`subscription:${row2.id}`);
|
|
@@ -61856,7 +62184,7 @@ var subscriptionsStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
61856
62184
|
};
|
|
61857
62185
|
}, "subscriptionsStoreOver");
|
|
61858
62186
|
|
|
61859
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
62187
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/wallets.js
|
|
61860
62188
|
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
62189
|
var SIGNED = "CASE t.direction WHEN 'in' THEN t.amount ELSE -t.amount END";
|
|
61862
62190
|
var walletOperationsOver = /* @__PURE__ */ __name((context) => {
|
|
@@ -61981,7 +62309,7 @@ var walletsStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
61981
62309
|
};
|
|
61982
62310
|
}, "walletsStoreOver");
|
|
61983
62311
|
|
|
61984
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
62312
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/record-writes.js
|
|
61985
62313
|
var specOf = /* @__PURE__ */ __name((type) => RECORD_TYPES[type], "specOf");
|
|
61986
62314
|
var unsettled = /* @__PURE__ */ __name((fields4, relations) => recordFingerprint(fields4, relations.filter((relation) => !AMOUNT_ROLES.includes(relation.role))), "unsettled");
|
|
61987
62315
|
var tableOf2 = /* @__PURE__ */ __name((type) => typeof type === "string" && Object.hasOwn(DECIDED_TABLES, type) ? DECIDED_TABLES[type] : void 0, "tableOf");
|
|
@@ -62240,7 +62568,7 @@ var recordWritesOver = /* @__PURE__ */ __name((context) => {
|
|
|
62240
62568
|
return { writeOne, project: project2, completeDependents, entityRef, missingOf: relations.missingOf };
|
|
62241
62569
|
}, "recordWritesOver");
|
|
62242
62570
|
|
|
62243
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
62571
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/records.js
|
|
62244
62572
|
var LIMIT = 1e3;
|
|
62245
62573
|
var iso16 = /* @__PURE__ */ __name((value) => new Date(Number(value)).toISOString(), "iso");
|
|
62246
62574
|
var checkLimit = /* @__PURE__ */ __name((limit) => {
|
|
@@ -62464,7 +62792,7 @@ var recordStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
62464
62792
|
};
|
|
62465
62793
|
}, "recordStoreOver");
|
|
62466
62794
|
|
|
62467
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
62795
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/templates.js
|
|
62468
62796
|
var templateOf = /* @__PURE__ */ __name((row2) => ({
|
|
62469
62797
|
key: row2.key,
|
|
62470
62798
|
channel: row2.channel,
|
|
@@ -62519,7 +62847,7 @@ var storedTemplateBodies = /* @__PURE__ */ __name((database, key2, language) =>
|
|
|
62519
62847
|
return Object.fromEntries(rows.map((row2) => [row2.channel, row2.body]));
|
|
62520
62848
|
}, "storedTemplateBodies");
|
|
62521
62849
|
|
|
62522
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
62850
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/store-errors.js
|
|
62523
62851
|
var refusalOf2 = /* @__PURE__ */ __name((error) => error instanceof Error && error.name === "DrizzleQueryError" && error.cause instanceof CliError ? error.cause : error, "refusalOf");
|
|
62524
62852
|
var wrapped2 = /* @__PURE__ */ new WeakMap();
|
|
62525
62853
|
var storeErrors = /* @__PURE__ */ __name((area) => {
|
|
@@ -62554,7 +62882,7 @@ var storeErrors = /* @__PURE__ */ __name((area) => {
|
|
|
62554
62882
|
return proxy;
|
|
62555
62883
|
}, "storeErrors");
|
|
62556
62884
|
|
|
62557
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
62885
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/ranges.js
|
|
62558
62886
|
var markRange = /* @__PURE__ */ __name(({ orm, now: now2 }, chatKey, from2, to) => {
|
|
62559
62887
|
const touching = and(eq(syncRanges.chatId, chatKey), lte(syncRanges.fromKey, to + 1), gte(syncRanges.toKey, from2 - 1));
|
|
62560
62888
|
let merged2 = { from: from2, to };
|
|
@@ -62567,7 +62895,7 @@ var markRange = /* @__PURE__ */ __name(({ orm, now: now2 }, chatKey, from2, to)
|
|
|
62567
62895
|
}, "markRange");
|
|
62568
62896
|
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
62897
|
|
|
62570
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
62898
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/task-analysis-marks.js
|
|
62571
62899
|
var prefixOf2 = /* @__PURE__ */ __name(({ provider, account }) => `task_analysis:${provider}:${account}:`, "prefixOf");
|
|
62572
62900
|
var markOf = /* @__PURE__ */ __name((prefix, row2) => ({
|
|
62573
62901
|
chatId: String(row2.key).slice(prefix.length),
|
|
@@ -62588,7 +62916,7 @@ var setTaskAnalysisMark = /* @__PURE__ */ __name((database, account, { chatId, c
|
|
|
62588
62916
|
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
62917
|
}, "setTaskAnalysisMark");
|
|
62590
62918
|
|
|
62591
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
62919
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/task-rule-stops.js
|
|
62592
62920
|
var keyOf6 = /* @__PURE__ */ __name(({ provider, account }) => `task_rules_until:${provider}:${account}`, "keyOf");
|
|
62593
62921
|
var taskRulesStop = /* @__PURE__ */ __name((database, account) => {
|
|
62594
62922
|
const row2 = database.prepare("SELECT value FROM store_settings WHERE key = ?").get(keyOf6(account));
|
|
@@ -62598,7 +62926,7 @@ var setTaskRulesStop = /* @__PURE__ */ __name((database, account, until, now2) =
|
|
|
62598
62926
|
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
62927
|
}, "setTaskRulesStop");
|
|
62600
62928
|
|
|
62601
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
62929
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sync.js
|
|
62602
62930
|
var syncStoreOver = /* @__PURE__ */ __name((context) => {
|
|
62603
62931
|
const { database } = context;
|
|
62604
62932
|
const { accountPk: accountPk2, findAccountPk: findAccountPk2, chatKeyOf, chatPkFor: chatPkFor2, identityPk: identityPk2, writeMembers: writeMembers2, writeState: writeState2 } = keysOver(context);
|
|
@@ -62657,7 +62985,7 @@ var syncStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
62657
62985
|
};
|
|
62658
62986
|
}, "syncStoreOver");
|
|
62659
62987
|
|
|
62660
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
62988
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/tags.js
|
|
62661
62989
|
var tagsStoreOver = /* @__PURE__ */ __name((context) => {
|
|
62662
62990
|
const { database } = context;
|
|
62663
62991
|
return {
|
|
@@ -62679,7 +63007,7 @@ var tagsStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
62679
63007
|
};
|
|
62680
63008
|
}, "tagsStoreOver");
|
|
62681
63009
|
|
|
62682
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
63010
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/image-chunks.js
|
|
62683
63011
|
var IS_IMAGE = sql`(a.kind = 'photo' OR a.mime LIKE 'image/%')`;
|
|
62684
63012
|
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
63013
|
WHERE chat_id = ${chatKey} AND deleted_at IS NULL AND trim(text) <> '' AND id <> ${messagePk}
|
|
@@ -62806,7 +63134,7 @@ var savePictureChunks = /* @__PURE__ */ __name(({ orm, now: now2, database }, ac
|
|
|
62806
63134
|
dropUnusedVectors(database, released.map(({ hash: hash2 }) => hash2));
|
|
62807
63135
|
}, "savePictureChunks");
|
|
62808
63136
|
|
|
62809
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
63137
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/message-chunks.js
|
|
62810
63138
|
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
63139
|
EXISTS (SELECT 1 FROM embeddings v WHERE v.model = ${model} AND v.content_hash = k.content_hash) AS embedded
|
|
62812
63140
|
FROM messages m
|
|
@@ -62895,7 +63223,7 @@ var nearestMessages = /* @__PURE__ */ __name((context, accountPk2, { limit, quer
|
|
|
62895
63223
|
return plain2(best(found2));
|
|
62896
63224
|
}, "nearestMessages");
|
|
62897
63225
|
|
|
62898
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
63226
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/vectors.js
|
|
62899
63227
|
var accountVectorsOver = /* @__PURE__ */ __name((context, mail) => {
|
|
62900
63228
|
const { database } = context;
|
|
62901
63229
|
const { findAccountPk: findAccountPk2, findChatPk: findChatPk2, chatKeyOf } = keysOver(context);
|
|
@@ -63154,7 +63482,7 @@ var vectorsStoreOver = /* @__PURE__ */ __name((context, keyed) => ({
|
|
|
63154
63482
|
vectorCounts: /* @__PURE__ */ __name(async (models) => vectorCounts(context, models), "vectorCounts")
|
|
63155
63483
|
}), "vectorsStoreOver");
|
|
63156
63484
|
|
|
63157
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
63485
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/store-tables.js
|
|
63158
63486
|
import { existsSync as existsSync3, readFileSync as readFileSync4 } from "node:fs";
|
|
63159
63487
|
import { dirname as dirname3, join as join4 } from "node:path";
|
|
63160
63488
|
var BOOKKEEPING2 = ["schema_migrations", "store_settings"];
|
|
@@ -63242,10 +63570,10 @@ var lastBackup = /* @__PURE__ */ __name((path) => {
|
|
|
63242
63570
|
}
|
|
63243
63571
|
}, "lastBackup");
|
|
63244
63572
|
|
|
63245
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
63573
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/providers.js
|
|
63246
63574
|
var registerProvider2 = /* @__PURE__ */ __name((store, entry2) => store.accounts.registerProvider(entry2), "registerProvider");
|
|
63247
63575
|
|
|
63248
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
63576
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/sqlite/store-contents.js
|
|
63249
63577
|
var COUNTED_TABLES = [
|
|
63250
63578
|
"accounts",
|
|
63251
63579
|
"chats",
|
|
@@ -63330,7 +63658,7 @@ var storeContents = /* @__PURE__ */ __name((database) => {
|
|
|
63330
63658
|
};
|
|
63331
63659
|
}, "storeContents");
|
|
63332
63660
|
|
|
63333
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
63661
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.675.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.102.1_commander@15_4538b457841b7e7d546b8c440ab6644a/node_modules/@wirecat/cli-core/dist/store/store.js
|
|
63334
63662
|
var openStore = /* @__PURE__ */ __name(async (options = {}) => {
|
|
63335
63663
|
const context = await openStoreContext(options);
|
|
63336
63664
|
try {
|