@wirecat/tg-cli 0.131.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-TA637IRT.js → adapter-OXVMOWVE.js} +60 -60
- package/dist/bundle/{all-profiles-7M3GBCB6.js → all-profiles-6OQC7PBL.js} +9 -9
- package/dist/bundle/{anthropic-P3THLZWO.js → anthropic-YFMIHFW5.js} +5 -5
- package/dist/bundle/{app-server-OE5EAXIY.js → app-server-S7CJPJXN.js} +52 -52
- package/dist/bundle/{bot-api-WYR2C4A5.js → bot-api-KJ6EZ4R6.js} +61 -61
- package/dist/bundle/{bot-history-PKJTHU7L.js → bot-history-JYCXDFW4.js} +22 -22
- package/dist/bundle/{bun-XMZJDDEA.js → bun-FVTOBYZ2.js} +2 -2
- package/dist/bundle/{bun-sqlite-F5RWCB2N.js → bun-sqlite-KDGWBNOR.js} +6 -6
- package/dist/bundle/{chunk-76UAXRDY.js → chunk-2LZD2VFV.js} +4 -4
- package/dist/bundle/{chunk-JUFLELQ7.js → chunk-2UGSIHLV.js} +2 -2
- package/dist/bundle/{chunk-2U6XE4HI.js → chunk-3QHKZLBU.js} +4 -4
- package/dist/bundle/{chunk-34PRGA7E.js → chunk-42MXCMW6.js} +3 -3
- package/dist/bundle/{chunk-HT6OFANN.js → chunk-44A2XRDE.js} +20 -20
- package/dist/bundle/{chunk-WG6UZJ3E.js → chunk-4CKYANQH.js} +1 -1
- package/dist/bundle/{chunk-AUNNJDVD.js → chunk-4EDJJQJI.js} +28 -8
- package/dist/bundle/{chunk-O7X6RM5R.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-UUNQV4YL.js → chunk-5UPEEMEF.js} +22 -15
- package/dist/bundle/{chunk-YJ4BPNWI.js → chunk-6LPUK62N.js} +3 -3
- package/dist/bundle/{chunk-GNIROVSK.js → chunk-74UPKW7H.js} +2 -2
- package/dist/bundle/{chunk-IULSIKEM.js → chunk-7SEVVE3X.js} +3 -3
- package/dist/bundle/{chunk-PS7ZS5HD.js → chunk-A5D3J7XZ.js} +4 -4
- package/dist/bundle/{chunk-O73DZURO.js → chunk-AERP2QR6.js} +10 -10
- package/dist/bundle/{chunk-6BPM3LNR.js → chunk-AUZWIBHJ.js} +6 -6
- package/dist/bundle/{chunk-JDLNI7BU.js → chunk-B4LGDOG5.js} +263 -260
- package/dist/bundle/{chunk-B6NQJAUC.js → chunk-BLZEQVP4.js} +2 -2
- package/dist/bundle/{chunk-WUIKJJ5A.js → chunk-BMI2NWFI.js} +8 -8
- package/dist/bundle/{chunk-QGFUUJPL.js → chunk-BSXS7VAC.js} +1 -1
- package/dist/bundle/{chunk-OOSX7K7G.js → chunk-CFWFESBO.js} +8 -8
- package/dist/bundle/{chunk-PD4RREQB.js → chunk-DSJNZXTP.js} +1 -1
- package/dist/bundle/{chunk-MYC3M4BY.js → chunk-DXPGMUOR.js} +2 -2
- package/dist/bundle/{chunk-LJO6MMQG.js → chunk-EPR67IRV.js} +4 -4
- package/dist/bundle/{chunk-SLT2PBFP.js → chunk-ESOFH7PA.js} +37 -30
- package/dist/bundle/{chunk-2OXR2MRV.js → chunk-FIUH52FE.js} +1 -1
- package/dist/bundle/{chunk-43KSYUZU.js → chunk-FKGYXIN7.js} +7 -7
- package/dist/bundle/{chunk-TT6OHNV2.js → chunk-FPSRT2TX.js} +2 -2
- package/dist/bundle/{chunk-ITYDJIRC.js → chunk-HBSKP7OV.js} +1 -1
- package/dist/bundle/{chunk-LDSTUBLY.js → chunk-IY7CTAOQ.js} +9 -9
- package/dist/bundle/{chunk-5AJ5RLJW.js → chunk-IYJ4B632.js} +14 -13
- package/dist/bundle/{chunk-J2QQZVEN.js → chunk-JDNDWZYS.js} +4 -4
- package/dist/bundle/{chunk-H655CMXJ.js → chunk-JMJOWT4N.js} +1 -1
- package/dist/bundle/{chunk-NTORQXAS.js → chunk-JNWKV3QV.js} +4 -4
- package/dist/bundle/{chunk-JSE4OBYI.js → chunk-JPSRC732.js} +13 -13
- package/dist/bundle/{chunk-L2SMUTJY.js → chunk-JZJV3DYK.js} +2 -2
- package/dist/bundle/{chunk-EZBMLKBK.js → chunk-KJICORS4.js} +36 -36
- package/dist/bundle/{chunk-P6KGEZIS.js → chunk-LF6FACSW.js} +5 -5
- package/dist/bundle/{chunk-5ZIT6JXP.js → chunk-LG3K5NHX.js} +7 -7
- package/dist/bundle/{chunk-UGYC2FV5.js → chunk-LMGVPDXN.js} +2 -2
- package/dist/bundle/{chunk-6O5AD3GA.js → chunk-LZ3HFDYL.js} +2 -2
- package/dist/bundle/{chunk-JF4AJNCE.js → chunk-M2TV6BDB.js} +7 -7
- package/dist/bundle/{chunk-XC2YJDDK.js → chunk-N5LZ6L4D.js} +3 -3
- package/dist/bundle/{chunk-OX5EAUKF.js → chunk-NLRGMP7M.js} +3 -3
- package/dist/bundle/{chunk-S2IET7WM.js → chunk-NWCFO37P.js} +3 -3
- package/dist/bundle/{chunk-LWSOCKOD.js → chunk-NWDADTPE.js} +3 -3
- package/dist/bundle/{chunk-BXW6FGLD.js → chunk-O3AM32YN.js} +15 -15
- package/dist/bundle/{chunk-5N7TJ6TJ.js → chunk-O43PARFS.js} +166 -161
- package/dist/bundle/{chunk-OPG54IFH.js → chunk-OGZZUDJJ.js} +54 -54
- package/dist/bundle/{chunk-AJQ6JFLY.js → chunk-OIRNHSAH.js} +6 -6
- package/dist/bundle/{chunk-LEPDRO3O.js → chunk-PG37E63A.js} +76 -59
- package/dist/bundle/{chunk-6TJTQ4I4.js → chunk-PR4F3TYK.js} +30 -30
- package/dist/bundle/{chunk-NOZZHEMD.js → chunk-PYECFCPD.js} +1 -1
- package/dist/bundle/{chunk-EXMJDHBM.js → chunk-QNEAPLOP.js} +12 -12
- package/dist/bundle/{chunk-BFERGEBI.js → chunk-QS46C5SW.js} +17 -17
- package/dist/bundle/{chunk-VNJZXV7E.js → chunk-SMQ45RZX.js} +6 -6
- package/dist/bundle/{chunk-PHGH5N4C.js → chunk-U7PHJSTX.js} +2 -2
- package/dist/bundle/{chunk-SQ2JLZFK.js → chunk-UAFSDTID.js} +1 -1
- package/dist/bundle/{chunk-2TOJQQKS.js → chunk-UGD4SCUI.js} +1 -1
- package/dist/bundle/{chunk-VVUUP5NF.js → chunk-WAVRUADL.js} +13 -13
- package/dist/bundle/{chunk-Z2TCTTPJ.js → chunk-Y57EKZZK.js} +676 -435
- package/dist/bundle/{chunk-LTP4BYHJ.js → chunk-YAPO7QNO.js} +6 -6
- package/dist/bundle/{chunk-YZTMQE62.js → chunk-YRXSNH3R.js} +2 -2
- package/dist/bundle/{chunk-AEIDEIVB.js → chunk-YSNQGOUI.js} +2235 -1355
- package/dist/bundle/{chunk-GA3URWIF.js → chunk-YVI5SQPY.js} +1 -1
- package/dist/bundle/{chunk-SS5H2XAT.js → chunk-ZJIGVT6Z.js} +2 -2
- package/dist/bundle/{chunk-NXNSEFGR.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-6FH3RXJ2.js → command-server-entry-TM264M2J.js} +27 -27
- package/dist/bundle/{decode-UBRT2QDP.js → decode-RJFOSHCE.js} +5 -5
- package/dist/bundle/{dispatch-ST5FK2KI.js → dispatch-7OZP3X4O.js} +8 -8
- package/dist/bundle/{echarts-PG45GQLR.js → echarts-PYKF4D7B.js} +2 -2
- package/dist/bundle/{embed-BUQDSZ57.js → embed-JFN6Z5TG.js} +6 -6
- package/dist/bundle/{embedder-TXA3EV7O.js → embedder-WN54JIMY.js} +9 -9
- package/dist/bundle/{entry-JWIEF57D.js → entry-Z6LO6N6S.js} +9 -9
- package/dist/bundle/{failure-GMUQKQ5K.js → failure-UONA2IA5.js} +2 -2
- package/dist/bundle/{first-run-5VTHKMK5.js → first-run-WQAKES7G.js} +12 -12
- package/dist/bundle/first-screen-4RFG22SA.js +35 -0
- package/dist/bundle/{instructions-ZMEPWTFO.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-5FVNZCTL.js → meeting-model-YVTUOM4H.js} +11 -11
- package/dist/bundle/{meeting-semantic-HUMYFMO7.js → meeting-semantic-X4KG6RNV.js} +6 -6
- package/dist/bundle/{node-N4DQQJKK.js → node-OVS5LTVZ.js} +2 -2
- package/dist/bundle/{node-sqlite-MG4KFXYY.js → node-sqlite-LC44SM4Z.js} +7 -7
- package/dist/bundle/{oauth-NKDSXEH6.js → oauth-NSVUFQCW.js} +7 -7
- package/dist/bundle/{open-DV2YUU2M.js → open-XN5SJFVY.js} +5 -5
- package/dist/bundle/{openai-FEKMZOUJ.js → openai-WOYZHJNL.js} +15 -15
- package/dist/bundle/{process-QZS3TE6A.js → process-UFBRGTQC.js} +1 -1
- package/dist/bundle/{program-FNDGXEVS.js → program-RAGBRRQH.js} +63 -63
- package/dist/bundle/{prompt-C7RSBNH5.js → prompt-6HAKBUQN.js} +5 -5
- package/dist/bundle/{proxy-transport-A4MRO3PF.js → proxy-transport-5EJVFUTC.js} +5 -5
- package/dist/bundle/{recognize-5BL763FS.js → recognize-CN5COBVJ.js} +4 -4
- package/dist/bundle/{remote-CXAKRC7X.js → remote-STX5AMGE.js} +9 -9
- package/dist/bundle/{rerank-XAEXY5A4.js → rerank-ZCOWTXIJ.js} +7 -7
- package/dist/bundle/{serve-JLZGFTZH.js → serve-XMQEOIG2.js} +9 -9
- package/dist/bundle/{server-GF3TV2U7.js → server-PGGUD3DM.js} +44 -44
- package/dist/bundle/server-WTNYWCZ4.js +69 -0
- package/dist/bundle/{sqlite-runtime-3OVQ7OTM.js → sqlite-runtime-PS4DSOIU.js} +6 -6
- package/dist/bundle/{state-FGJKQKC2.js → state-GL4ZC57O.js} +6 -6
- package/dist/bundle/{store-WYLMNAAQ.js → store-HJ76TLWD.js} +19 -19
- package/dist/bundle/{store-2J5VJZQY.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/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +3 -3
- package/dist/bundle/command-contract-DAQYQF6R.js +0 -37
- package/dist/bundle/first-screen-PTHIZ5ZF.js +0 -35
- package/dist/bundle/meeting-combined-DU3RJR6X.js +0 -23
- package/dist/bundle/server-GLPEWUYT.js +0 -69
- package/dist/bundle/store-maintenance-command-QN6QH6RA.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,
|
|
@@ -255,11 +256,11 @@ import {
|
|
|
255
256
|
validateQuery,
|
|
256
257
|
walkQuery,
|
|
257
258
|
zonedMoment
|
|
258
|
-
} from "./chunk-
|
|
259
|
+
} from "./chunk-PG37E63A.js";
|
|
259
260
|
import {
|
|
260
261
|
refuseOwnerStoreInTests,
|
|
261
262
|
storePath
|
|
262
|
-
} from "./chunk-
|
|
263
|
+
} from "./chunk-FPSRT2TX.js";
|
|
263
264
|
import {
|
|
264
265
|
array,
|
|
265
266
|
boolean,
|
|
@@ -277,7 +278,7 @@ import {
|
|
|
277
278
|
safeParse,
|
|
278
279
|
strictObject,
|
|
279
280
|
string
|
|
280
|
-
} from "./chunk-
|
|
281
|
+
} from "./chunk-4EDJJQJI.js";
|
|
281
282
|
import {
|
|
282
283
|
resolveFrom
|
|
283
284
|
} from "./chunk-Y5E2WNWB.js";
|
|
@@ -285,7 +286,7 @@ import {
|
|
|
285
286
|
CliError,
|
|
286
287
|
isCliError,
|
|
287
288
|
singleLine
|
|
288
|
-
} from "./chunk-
|
|
289
|
+
} from "./chunk-5RDNBG7D.js";
|
|
289
290
|
import {
|
|
290
291
|
__commonJS,
|
|
291
292
|
__name,
|
|
@@ -10029,7 +10030,7 @@ var require_cjs = __commonJS({
|
|
|
10029
10030
|
}
|
|
10030
10031
|
});
|
|
10031
10032
|
|
|
10032
|
-
// 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
|
|
10033
10034
|
var bindArea = /* @__PURE__ */ __name(({ keyed, whole }, account) => {
|
|
10034
10035
|
const methods = whole;
|
|
10035
10036
|
return Object.fromEntries(Object.keys(keyed).map((name) => [
|
|
@@ -10157,7 +10158,7 @@ var bindAccount = /* @__PURE__ */ __name((store, account, areas, owners) => {
|
|
|
10157
10158
|
};
|
|
10158
10159
|
}, "bindAccount");
|
|
10159
10160
|
|
|
10160
|
-
// 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
|
|
10161
10162
|
var IndexBuilderOn = class {
|
|
10162
10163
|
static {
|
|
10163
10164
|
__name(this, "IndexBuilderOn");
|
|
@@ -10352,7 +10353,7 @@ function alias(table, alias2) {
|
|
|
10352
10353
|
}
|
|
10353
10354
|
__name(alias, "alias");
|
|
10354
10355
|
|
|
10355
|
-
// 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
|
|
10356
10357
|
var DECIMAL_PATTERN = "^[0-9]{1,16}(\\.[0-9]{1,6})?$";
|
|
10357
10358
|
var SIGNED_DECIMAL = "^-?[0-9]{1,16}(\\.[0-9]{1,6})?$";
|
|
10358
10359
|
var DAY = "^[0-9]{4}-[0-9]{2}-[0-9]{2}$";
|
|
@@ -10402,7 +10403,7 @@ var arrayOf = /* @__PURE__ */ __name((item, maxItems, description) => ({
|
|
|
10402
10403
|
}), "arrayOf");
|
|
10403
10404
|
var isObject = /* @__PURE__ */ __name((value) => typeof value === "object" && value !== null && !Array.isArray(value), "isObject");
|
|
10404
10405
|
|
|
10405
|
-
// 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
|
|
10406
10407
|
var kept = /* @__PURE__ */ __name((description) => ({ description }), "kept");
|
|
10407
10408
|
var PARTY = ["person", "organization"];
|
|
10408
10409
|
var ORGANIZATION = ["organization"];
|
|
@@ -10797,7 +10798,7 @@ var hasV1Roles = /* @__PURE__ */ __name((type) => rolesOf2(type).some(([, role])
|
|
|
10797
10798
|
var IDENTITY_TYPES = RECORD_ENTITY_TYPES.filter((type) => RECORD_TYPES[type].review === "identity");
|
|
10798
10799
|
var article = /* @__PURE__ */ __name((word2) => /^[aeiou]/.test(word2) ? "an" : "a", "article");
|
|
10799
10800
|
|
|
10800
|
-
// 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
|
|
10801
10802
|
var ENTITY_TABLES = {
|
|
10802
10803
|
...RECORD_TABLES,
|
|
10803
10804
|
account: "accounts",
|
|
@@ -10836,11 +10837,11 @@ var orphanPointers = /* @__PURE__ */ __name((database) => pointerPairs(database)
|
|
|
10836
10837
|
return { table, pointer, type, count: count2, known: known2 };
|
|
10837
10838
|
}).filter(({ count: count2 }) => count2 > 0)), "orphanPointers");
|
|
10838
10839
|
|
|
10839
|
-
// 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
|
|
10840
10841
|
var IDENTITY_LINK_KIND = "identity_link";
|
|
10841
10842
|
var IDENTITY_LINK_SIGNALS = ["agent", "phone", "email", "guest-email", "name", "account"];
|
|
10842
10843
|
|
|
10843
|
-
// 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
|
|
10844
10845
|
var SEPARATIONS = ["unlink", "split", "undo-merge"];
|
|
10845
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");
|
|
10846
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");
|
|
@@ -10872,7 +10873,7 @@ var samePersons = /* @__PURE__ */ __name((database, pk) => {
|
|
|
10872
10873
|
}, "samePersons");
|
|
10873
10874
|
var idsOf = /* @__PURE__ */ __name((database, type, id2) => JSON.stringify(type === "person" ? samePersons(database, id2) : [id2]), "idsOf");
|
|
10874
10875
|
|
|
10875
|
-
// 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
|
|
10876
10877
|
var pairOf = /* @__PURE__ */ __name((a, b) => [Number(a), Number(b)].sort((x, y) => x - y).join("-"), "pairOf");
|
|
10877
10878
|
var pkOf = /* @__PURE__ */ __name((database, ref3) => {
|
|
10878
10879
|
const at2 = ref3.indexOf(":");
|
|
@@ -10979,13 +10980,13 @@ var forgetErasedLinks = /* @__PURE__ */ __name((database) => {
|
|
|
10979
10980
|
database.prepare("DELETE FROM proposed_actions WHERE id = ?").run(Number(row2.id));
|
|
10980
10981
|
}, "forgetErasedLinks");
|
|
10981
10982
|
|
|
10982
|
-
// 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
|
|
10983
10984
|
var IDENTITY_SPLIT_KIND = "identity_split";
|
|
10984
10985
|
|
|
10985
|
-
// 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
|
|
10986
10987
|
var MAIL_FINDINGS_KIND = "mail_findings";
|
|
10987
10988
|
|
|
10988
|
-
// 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
|
|
10989
10990
|
var TASK_CLOSE_KIND = "task_close";
|
|
10990
10991
|
var DEFAULT_DECISION_POLICY = { agentDecisions: false, ruleProposalsOwnerOnly: true };
|
|
10991
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");
|
|
@@ -11033,7 +11034,7 @@ var assertMayDecide = /* @__PURE__ */ __name((row2, by, policy = DEFAULT_DECISIO
|
|
|
11033
11034
|
}, "assertMayDecide");
|
|
11034
11035
|
var deciderAuthor = /* @__PURE__ */ __name((by) => by === "owner" ? "owner" : { bot: by.bot, ...by.model === void 0 ? {} : { model: by.model } }, "deciderAuthor");
|
|
11035
11036
|
|
|
11036
|
-
// 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
|
|
11037
11038
|
var EMAIL_ADDRESS = /^[^\s@]+@[^\s@]+\.[^\s@]+$/u;
|
|
11038
11039
|
var isEmailAddress = /* @__PURE__ */ __name((value) => EMAIL_ADDRESS.test(value), "isEmailAddress");
|
|
11039
11040
|
var ROLE_ADDRESS_WORDS = {
|
|
@@ -11095,7 +11096,7 @@ var PERSON_LIKE = /* @__PURE__ */ new Set(["hr"]);
|
|
|
11095
11096
|
var isPersonLikeRoleAddress = /* @__PURE__ */ __name((address) => PERSON_LIKE.has(localWord(address)), "isPersonLikeRoleAddress");
|
|
11096
11097
|
var isNoReplyAddress = /* @__PURE__ */ __name((address) => NO_REPLY.has(localWord(address)), "isNoReplyAddress");
|
|
11097
11098
|
|
|
11098
|
-
// 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
|
|
11099
11100
|
var import_disposable_email_domains_js = __toESM(require_dist(), 1);
|
|
11100
11101
|
var import_tldts = __toESM(require_cjs(), 1);
|
|
11101
11102
|
var FREE_MAIL = /* @__PURE__ */ new Set([
|
|
@@ -11125,7 +11126,7 @@ var FREE_MAIL = /* @__PURE__ */ new Set([
|
|
|
11125
11126
|
]);
|
|
11126
11127
|
var DAY_MS = 24 * 60 * 60 * 1e3;
|
|
11127
11128
|
|
|
11128
|
-
// 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
|
|
11129
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 ";
|
|
11130
11131
|
var idsOf2 = /* @__PURE__ */ __name((rows) => rows.map((row2) => Number(row2.id)), "idsOf");
|
|
11131
11132
|
var holdAddress = /* @__PURE__ */ __name(({ database, now: now2 }, organization2, email, { method, author }) => {
|
|
@@ -11150,7 +11151,7 @@ var organizationOfAddress = /* @__PURE__ */ __name((context, { name, email, meth
|
|
|
11150
11151
|
return id2;
|
|
11151
11152
|
}, "organizationOfAddress");
|
|
11152
11153
|
|
|
11153
|
-
// 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
|
|
11154
11155
|
var PHONE_PLANS = [
|
|
11155
11156
|
{
|
|
11156
11157
|
country: "us",
|
|
@@ -11530,7 +11531,7 @@ var PHONE_PLANS = [
|
|
|
11530
11531
|
}
|
|
11531
11532
|
];
|
|
11532
11533
|
|
|
11533
|
-
// 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
|
|
11534
11535
|
var PHONE_COUNTRIES = PHONE_PLANS.map((plan) => plan.country);
|
|
11535
11536
|
var DEFAULT_PHONE_COUNTRIES = ["ru"];
|
|
11536
11537
|
var parsePhoneCountries = /* @__PURE__ */ __name((value) => {
|
|
@@ -11605,10 +11606,10 @@ var storedPhone = /* @__PURE__ */ __name((raw, provider) => {
|
|
|
11605
11606
|
return found2 ? `+${found2[1]}` : void 0;
|
|
11606
11607
|
}, "storedPhone");
|
|
11607
11608
|
|
|
11608
|
-
// 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
|
|
11609
11610
|
import { AsyncLocalStorage } from "node:async_hooks";
|
|
11610
11611
|
|
|
11611
|
-
// 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
|
|
11612
11613
|
import { existsSync, statSync } from "node:fs";
|
|
11613
11614
|
var watched = /* @__PURE__ */ new WeakMap();
|
|
11614
11615
|
var walInode = /* @__PURE__ */ __name((store) => statSync(`${store}-wal`, { throwIfNoEntry: false })?.ino, "walInode");
|
|
@@ -11634,7 +11635,7 @@ var checkJournal = /* @__PURE__ */ __name((database) => {
|
|
|
11634
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" });
|
|
11635
11636
|
}, "checkJournal");
|
|
11636
11637
|
|
|
11637
|
-
// 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
|
|
11638
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;
|
|
11639
11640
|
var writeTarget = /* @__PURE__ */ __name((sql2) => {
|
|
11640
11641
|
const match = WRITE.exec(sql2);
|
|
@@ -11714,7 +11715,7 @@ var committedWrites = /* @__PURE__ */ __name((database) => {
|
|
|
11714
11715
|
}, "committedWrites");
|
|
11715
11716
|
var droppedWrites = /* @__PURE__ */ __name((database) => tallies.get(database)?.pending.clear(), "droppedWrites");
|
|
11716
11717
|
|
|
11717
|
-
// 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
|
|
11718
11719
|
var ARMS = [
|
|
11719
11720
|
[
|
|
11720
11721
|
"message",
|
|
@@ -11842,7 +11843,7 @@ var drainInvolvementQueue = /* @__PURE__ */ __name((database, cap = QUEUE_CAP) =
|
|
|
11842
11843
|
return recomputed;
|
|
11843
11844
|
}, "drainInvolvementQueue");
|
|
11844
11845
|
|
|
11845
|
-
// 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
|
|
11846
11847
|
import { domainToUnicode } from "node:url";
|
|
11847
11848
|
|
|
11848
11849
|
// node_modules/.pnpm/psl@1.15.0/node_modules/psl/dist/psl.mjs
|
|
@@ -21864,7 +21865,7 @@ var oa = /* @__PURE__ */ __name((e) => {
|
|
|
21864
21865
|
}, "oa");
|
|
21865
21866
|
var na = { parse: O, get: aa, isValid: oa };
|
|
21866
21867
|
|
|
21867
|
-
// 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
|
|
21868
21869
|
var LINK = /https?:\/\/(?:(?:docs|drive|sheets|slides)\.google\.com|forms\.gle)(?:[/?#][^\s<>"'`]*)?/gi;
|
|
21869
21870
|
var ID = /^[\w-]{10,}$/;
|
|
21870
21871
|
var trimUrl = /* @__PURE__ */ __name((url) => {
|
|
@@ -21906,7 +21907,7 @@ var googleDocumentLinks = /* @__PURE__ */ __name((text8) => [...text8.matchAll(L
|
|
|
21906
21907
|
return { url, documentId: googleDocumentId(url) };
|
|
21907
21908
|
}), "googleDocumentLinks");
|
|
21908
21909
|
|
|
21909
|
-
// 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
|
|
21910
21911
|
var BEFORE = [
|
|
21911
21912
|
[/^(?:ул\.?|улиц[аеыу]|улицей)$/iu, "\u0443\u043B\u0438\u0446\u0430"],
|
|
21912
21913
|
[/^(?:пр-т|просп\.?|проспект[аеу]?)$/iu, "\u043F\u0440\u043E\u0441\u043F\u0435\u043A\u0442"],
|
|
@@ -22166,7 +22167,7 @@ var findPlaces = /* @__PURE__ */ __name((text8) => {
|
|
|
22166
22167
|
return found2.sort((a, b) => a.start - b.start);
|
|
22167
22168
|
}, "findPlaces");
|
|
22168
22169
|
|
|
22169
|
-
// 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
|
|
22170
22171
|
var MENTION_KINDS = ["phone", "email", "url", "document", "person-name", "place"];
|
|
22171
22172
|
var MENTION_VERSIONS = {
|
|
22172
22173
|
phone: 1,
|
|
@@ -22342,7 +22343,7 @@ var exactlyOne = /* @__PURE__ */ __name((text8, options) => {
|
|
|
22342
22343
|
return one2 && one2.start === 0 && one2.end === text8.length ? one2.value : void 0;
|
|
22343
22344
|
}, "exactlyOne");
|
|
22344
22345
|
|
|
22345
|
-
// 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
|
|
22346
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";
|
|
22347
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";
|
|
22348
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";
|
|
@@ -22350,7 +22351,7 @@ var NOT_NAMES = ["\u0436\u0435\u043D\u0430", "\u0436\u0435\u043D\u044B", "\u0436
|
|
|
22350
22351
|
var FIRST_NAMES = [...new Set(`${RUSSIAN} ${EUROPEAN}`.split(" "))];
|
|
22351
22352
|
var NAME_WORDS = WORDS.split(" ");
|
|
22352
22353
|
|
|
22353
|
-
// 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
|
|
22354
22355
|
var LATIN_TO_CYRILLIC = {
|
|
22355
22356
|
shch: "\u0449",
|
|
22356
22357
|
sch: "\u0449",
|
|
@@ -22558,7 +22559,7 @@ var findUnknownNames = /* @__PURE__ */ __name((text8, stem, taken) => {
|
|
|
22558
22559
|
return found2;
|
|
22559
22560
|
}, "findUnknownNames");
|
|
22560
22561
|
|
|
22561
|
-
// 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
|
|
22562
22563
|
var NOT_FILES = /* @__PURE__ */ new Set([
|
|
22563
22564
|
"webpage",
|
|
22564
22565
|
"share",
|
|
@@ -22599,7 +22600,7 @@ var matchDownloads = /* @__PURE__ */ __name((stored4, files2) => {
|
|
|
22599
22600
|
});
|
|
22600
22601
|
}, "matchDownloads");
|
|
22601
22602
|
|
|
22602
|
-
// 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
|
|
22603
22604
|
var any = { kind: "char", ranges: [[0, 1114111]], negate: false };
|
|
22604
22605
|
var literal2 = /* @__PURE__ */ __name((c) => ({
|
|
22605
22606
|
kind: "char",
|
|
@@ -22999,7 +23000,7 @@ var foldRegex = /* @__PURE__ */ __name((pattern, span) => {
|
|
|
22999
23000
|
return out;
|
|
23000
23001
|
}, "foldRegex");
|
|
23001
23002
|
|
|
23002
|
-
// 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
|
|
23003
23004
|
var PRESET_VERSION = 1;
|
|
23004
23005
|
var PRESETS = {
|
|
23005
23006
|
password: {
|
|
@@ -23053,12 +23054,12 @@ var PRESETS = {
|
|
|
23053
23054
|
}
|
|
23054
23055
|
};
|
|
23055
23056
|
|
|
23056
|
-
// 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
|
|
23057
23058
|
var hasText = /* @__PURE__ */ __name((node) => node.kind === "predicate" ? node.field === "text" || node.field === "exact" : node.clauses.some(({ node: node2 }) => hasText(node2)), "hasText");
|
|
23058
23059
|
var isStemmed = /* @__PURE__ */ __name((node) => node.field === "text" && (node.operator === "term" || node.operator === "phrase") && node.value !== "", "isStemmed");
|
|
23059
23060
|
var hasStems = /* @__PURE__ */ __name((node) => node.kind === "predicate" ? isStemmed(node) : node.clauses.some(({ node: node2 }) => hasStems(node2)), "hasStems");
|
|
23060
23061
|
|
|
23061
|
-
// 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
|
|
23062
23063
|
var LIVE = "mn.kind = 'url' AND mn.status <> 'dismissed'";
|
|
23063
23064
|
var MAIL_ROWS = `SELECT mn.source_id FROM mentions mn WHERE mn.source_type = 'email' AND ${LIVE}`;
|
|
23064
23065
|
var linkMatch = /* @__PURE__ */ __name((field4, typed, mail, mentioned2) => {
|
|
@@ -23082,7 +23083,7 @@ var linkMatch = /* @__PURE__ */ __name((field4, typed, mail, mentioned2) => {
|
|
|
23082
23083
|
};
|
|
23083
23084
|
}, "linkMatch");
|
|
23084
23085
|
|
|
23085
|
-
// 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
|
|
23086
23087
|
var SETTING = "phoneCountries";
|
|
23087
23088
|
var savedPhoneCountries = /* @__PURE__ */ __name((database) => {
|
|
23088
23089
|
const row2 = database.prepare("SELECT value FROM store_settings WHERE key = ?").get(SETTING);
|
|
@@ -23113,7 +23114,7 @@ var valueMatch = /* @__PURE__ */ __name((database, typed) => {
|
|
|
23113
23114
|
return { sql: "mn.value = ?", params: [phone?.value ?? normalizedValue(typed, { phoneCountries })] };
|
|
23114
23115
|
}, "valueMatch");
|
|
23115
23116
|
|
|
23116
|
-
// 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
|
|
23117
23118
|
var normalizeVocabularyName = /* @__PURE__ */ __name((input) => {
|
|
23118
23119
|
if (typeof input !== "string" || input.length > 200 || /[\p{Cc}\p{Cf}]/u.test(input))
|
|
23119
23120
|
throw new CliError("validation_error", "a vocabulary name takes 1\u2013200 characters without control characters");
|
|
@@ -23141,7 +23142,7 @@ var vocabularySimilarity = /* @__PURE__ */ __name((left, right) => {
|
|
|
23141
23142
|
return 2 * intersection2 / (aa2.size + bb.size);
|
|
23142
23143
|
}, "vocabularySimilarity");
|
|
23143
23144
|
|
|
23144
|
-
// 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
|
|
23145
23146
|
import { createHash } from "node:crypto";
|
|
23146
23147
|
var folded2 = /* @__PURE__ */ __name((name) => {
|
|
23147
23148
|
try {
|
|
@@ -23207,7 +23208,7 @@ var guardTagCreation = /* @__PURE__ */ __name((context, name, kind3, by, options
|
|
|
23207
23208
|
});
|
|
23208
23209
|
}, "guardTagCreation");
|
|
23209
23210
|
|
|
23210
|
-
// 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
|
|
23211
23212
|
var invalid = /* @__PURE__ */ __name((message3) => {
|
|
23212
23213
|
throw new CliError("validation_error", message3);
|
|
23213
23214
|
}, "invalid");
|
|
@@ -23284,7 +23285,7 @@ var createTagRedirectIndex = /* @__PURE__ */ __name((snapshot2) => {
|
|
|
23284
23285
|
};
|
|
23285
23286
|
}, "createTagRedirectIndex");
|
|
23286
23287
|
|
|
23287
|
-
// 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
|
|
23288
23289
|
var tagCanonicalId = /* @__PURE__ */ __name((database, id2) => {
|
|
23289
23290
|
const row2 = database.prepare("SELECT canonical_id FROM resolved_tags WHERE id=?").get(id2);
|
|
23290
23291
|
if (!row2)
|
|
@@ -23312,7 +23313,7 @@ var tagRedirectSnapshot = /* @__PURE__ */ __name((database) => {
|
|
|
23312
23313
|
return snapshot2;
|
|
23313
23314
|
}, "tagRedirectSnapshot");
|
|
23314
23315
|
|
|
23315
|
-
// 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
|
|
23316
23317
|
import { createHash as createHash2 } from "node:crypto";
|
|
23317
23318
|
var TASK_KEY_PREFIXES = {
|
|
23318
23319
|
question: "Q",
|
|
@@ -23340,7 +23341,7 @@ var taskAccountOf = /* @__PURE__ */ __name((database, rowId) => {
|
|
|
23340
23341
|
return row2 && String(row2.key) === inboxKey(String(row2.name)) ? String(row2.name) : void 0;
|
|
23341
23342
|
}, "taskAccountOf");
|
|
23342
23343
|
|
|
23343
|
-
// 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
|
|
23344
23345
|
var storedThing = /* @__PURE__ */ __name((type, id2) => ({ type: String(type), id: Number(id2) }), "storedThing");
|
|
23345
23346
|
var REFERABLE = {
|
|
23346
23347
|
...Object.fromEntries(Object.entries(RECORD_TYPES).map(([type, { tombstone: tombstone2 }]) => [type, { tombstone: tombstone2 }])),
|
|
@@ -23413,6 +23414,10 @@ var emailThreadOf = /* @__PURE__ */ __name((database, account, thread) => {
|
|
|
23413
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);
|
|
23414
23415
|
return row2 ? { type: "email_thread", id: Number(row2.id) } : void 0;
|
|
23415
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");
|
|
23416
23421
|
var referenceOfThing = /* @__PURE__ */ __name((database, thing) => {
|
|
23417
23422
|
if (["meeting", "meeting_transcript", "meeting_transcript_row"].includes(thing.type)) {
|
|
23418
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=?";
|
|
@@ -23500,7 +23505,7 @@ var taskIdOf = /* @__PURE__ */ __name((database, rowId) => {
|
|
|
23500
23505
|
return row2 ? String(row2.id ?? row2.key) : void 0;
|
|
23501
23506
|
}, "taskIdOf");
|
|
23502
23507
|
|
|
23503
|
-
// 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
|
|
23504
23509
|
var toMs = /* @__PURE__ */ __name((iso17) => {
|
|
23505
23510
|
if (iso17 === null || iso17 === void 0)
|
|
23506
23511
|
return null;
|
|
@@ -23514,7 +23519,7 @@ var present = /* @__PURE__ */ __name((entries) => Object.fromEntries(Object.entr
|
|
|
23514
23519
|
var DELIVERY = { delivered: 1, read: 2 };
|
|
23515
23520
|
var deliveryOf = /* @__PURE__ */ __name((stored4) => stored4 === DELIVERY.read ? "read" : stored4 === DELIVERY.delivered ? "delivered" : void 0, "deliveryOf");
|
|
23516
23521
|
|
|
23517
|
-
// 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
|
|
23518
23523
|
var TAG_KINDS = ["tag", "topic"];
|
|
23519
23524
|
var TAGGABLE = { chat: "chat", contact: "identity", message: "message", task: "task" };
|
|
23520
23525
|
var TAG_TYPE = {
|
|
@@ -23717,7 +23722,7 @@ var tagsOf = /* @__PURE__ */ __name(({ database }, key2, filter) => {
|
|
|
23717
23722
|
return result;
|
|
23718
23723
|
}, "tagsOf");
|
|
23719
23724
|
|
|
23720
|
-
// 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
|
|
23721
23726
|
var MOST_YO_SPELLINGS = 64;
|
|
23722
23727
|
var yoSpellings = /* @__PURE__ */ __name((run) => {
|
|
23723
23728
|
let spellings2 = [""];
|
|
@@ -23739,7 +23744,7 @@ var anyCaseGlob = /* @__PURE__ */ __name((word2) => `*${[...word2.normalize("NFC
|
|
|
23739
23744
|
return forms2.size === 1 ? c : `[${[...forms2].join("")}]`;
|
|
23740
23745
|
}).join("")}*`, "anyCaseGlob");
|
|
23741
23746
|
|
|
23742
|
-
// 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
|
|
23743
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");
|
|
23744
23749
|
var SPEECH = speech("att");
|
|
23745
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");
|
|
@@ -24225,7 +24230,7 @@ var FIELD_COMPILERS = {
|
|
|
24225
24230
|
subject
|
|
24226
24231
|
};
|
|
24227
24232
|
|
|
24228
|
-
// 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
|
|
24229
24234
|
var placeOf = /* @__PURE__ */ __name((database) => {
|
|
24230
24235
|
const exact = database.prepare("SELECT id FROM places WHERE folded = ?");
|
|
24231
24236
|
const onStreet = database.prepare("SELECT id FROM places WHERE substr(folded, 1, ?) = ? LIMIT 2");
|
|
@@ -24241,7 +24246,7 @@ var placeOf = /* @__PURE__ */ __name((database) => {
|
|
|
24241
24246
|
};
|
|
24242
24247
|
}, "placeOf");
|
|
24243
24248
|
|
|
24244
|
-
// 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
|
|
24245
24250
|
var DRAIN_ON_WRITE = 500;
|
|
24246
24251
|
var METHOD = "rules";
|
|
24247
24252
|
var telegramLink = /* @__PURE__ */ __name((database) => {
|
|
@@ -24407,7 +24412,7 @@ var drainMentions = /* @__PURE__ */ __name((database, now2, limit = DRAIN_ON_WRI
|
|
|
24407
24412
|
return queued.length;
|
|
24408
24413
|
}, "drainMentions");
|
|
24409
24414
|
|
|
24410
|
-
// 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
|
|
24411
24416
|
var indexRow = /* @__PURE__ */ __name((database, name) => {
|
|
24412
24417
|
const exists2 = database.prepare("SELECT 1 FROM sqlite_master WHERE name = 'search_index_state'").get();
|
|
24413
24418
|
if (!exists2)
|
|
@@ -24415,7 +24420,7 @@ var indexRow = /* @__PURE__ */ __name((database, name) => {
|
|
|
24415
24420
|
return database.prepare("SELECT * FROM search_index_state WHERE name = ?").get(name);
|
|
24416
24421
|
}, "indexRow");
|
|
24417
24422
|
|
|
24418
|
-
// 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
|
|
24419
24424
|
var INDEX = "message_stems";
|
|
24420
24425
|
var SETTING2 = "searchStemmers";
|
|
24421
24426
|
var DRAIN_ON_WRITE2 = 500;
|
|
@@ -24537,7 +24542,7 @@ var stemmerCache = /* @__PURE__ */ __name(() => {
|
|
|
24537
24542
|
};
|
|
24538
24543
|
}, "stemmerCache");
|
|
24539
24544
|
|
|
24540
|
-
// 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
|
|
24541
24546
|
var rehearsal = new AsyncLocalStorage();
|
|
24542
24547
|
var SQLITE_BUSY = 5;
|
|
24543
24548
|
var pause = new Int32Array(new SharedArrayBuffer(4));
|
|
@@ -24680,7 +24685,7 @@ var read = /* @__PURE__ */ __name((database, body2) => {
|
|
|
24680
24685
|
}
|
|
24681
24686
|
}, "read");
|
|
24682
24687
|
|
|
24683
|
-
// 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
|
|
24684
24689
|
var FOLDED = [
|
|
24685
24690
|
{ table: "tasks", column: "title" },
|
|
24686
24691
|
{ table: "tasks", column: "close_reason" },
|
|
@@ -24717,7 +24722,7 @@ var fillFolded = /* @__PURE__ */ __name((database, { batch = 2e3 } = {}) => {
|
|
|
24717
24722
|
return filled;
|
|
24718
24723
|
}, "fillFolded");
|
|
24719
24724
|
|
|
24720
|
-
// 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
|
|
24721
24726
|
import { createHash as createHash3 } from "node:crypto";
|
|
24722
24727
|
var CHUNK_CHARS = 1200;
|
|
24723
24728
|
var CHUNK_OVERLAP = 150;
|
|
@@ -24822,7 +24827,7 @@ var cutChunks = /* @__PURE__ */ __name((members2, limit = CHUNK_CHARS, check3, c
|
|
|
24822
24827
|
return chunks2;
|
|
24823
24828
|
}, "cutChunks");
|
|
24824
24829
|
|
|
24825
|
-
// 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
|
|
24826
24831
|
var DAY2 = 864e5;
|
|
24827
24832
|
var CURRENCY = [
|
|
24828
24833
|
[/^(₽|руб.*|р\.?|rub)$/u, "RUB"],
|
|
@@ -24948,7 +24953,7 @@ var dueDayOf = /* @__PURE__ */ __name((text8, createdMs) => {
|
|
|
24948
24953
|
return best?.day ?? null;
|
|
24949
24954
|
}, "dueDayOf");
|
|
24950
24955
|
|
|
24951
|
-
// 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
|
|
24952
24957
|
var DAY3 = 864e5;
|
|
24953
24958
|
var STOP_WORDS = new Set([
|
|
24954
24959
|
// Russian and English as the test set ran them, already folded (пожалуйста → пожалуиста).
|
|
@@ -25103,7 +25108,7 @@ var rankCandidates = /* @__PURE__ */ __name((views, candidates) => candidates.ma
|
|
|
25103
25108
|
...compareViews(subjectViews ?? views, candidate, replyChain === void 0 ? {} : { replyChain })
|
|
25104
25109
|
})).sort((a, b) => b.score - a.score), "rankCandidates");
|
|
25105
25110
|
|
|
25106
|
-
// 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
|
|
25107
25112
|
var source = /* @__PURE__ */ __name((model, dims) => `SELECT k.id, k.chunkable_type,
|
|
25108
25113
|
coalesce(CASE k.chunkable_type
|
|
25109
25114
|
WHEN 'image' THEN (SELECT ch.account_id FROM attachments a JOIN messages m ON m.id = a.attachable_id
|
|
@@ -25245,10 +25250,11 @@ var dropUnusedVectors = /* @__PURE__ */ __name((database, hashes) => {
|
|
|
25245
25250
|
}, "dropUnusedVectors");
|
|
25246
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");
|
|
25247
25252
|
|
|
25248
|
-
// 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
|
|
25249
25254
|
var currentChunks = /* @__PURE__ */ __name((chatKey) => sql`SELECT k.content_hash, k.chunkable_id AS conversation_id, r.first_message_id,
|
|
25250
|
-
r.last_message_id, r.text_start, r.text_end FROM
|
|
25251
|
-
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
|
|
25252
25258
|
WHERE c.chat_id = ${chatKey}
|
|
25253
25259
|
AND c.build = (SELECT s.current_build FROM conversation_state s WHERE s.chat_id = ${chatKey})`, "currentChunks");
|
|
25254
25260
|
var chunksToEmbed = /* @__PURE__ */ __name(({ orm }, chatKey, model, { after: after2, limit }) => {
|
|
@@ -25491,7 +25497,7 @@ var readiness = /* @__PURE__ */ __name(({ orm }, chatKey, model) => {
|
|
|
25491
25497
|
JOIN conversations c ON c.id = cm.conversation_id AND c.build = ${build}
|
|
25492
25498
|
WHERE m.chat_id = ${chatKey} AND (m.deleted_at IS NOT NULL OR ${editedSince(sql`m.id`)})),
|
|
25493
25499
|
stale AS (SELECT DISTINCT k.content_hash AS hash FROM changed g
|
|
25494
|
-
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
|
|
25495
25501
|
JOIN chunk_messages r ON r.chunk_id = k.id
|
|
25496
25502
|
JOIN messages f ON f.id = r.first_message_id JOIN messages l ON l.id = r.last_message_id
|
|
25497
25503
|
WHERE (g.sent_at, g.id) >= (f.sent_at, f.id) AND (g.sent_at, g.id) <= (l.sent_at, l.id)),
|
|
@@ -25520,7 +25526,7 @@ var vectorCounts = /* @__PURE__ */ __name(({ orm }, models) => new Map(models.ma
|
|
|
25520
25526
|
Number(orm.get(sql`SELECT count(*) AS n FROM embeddings WHERE model = ${model}`)?.n ?? 0)
|
|
25521
25527
|
])), "vectorCounts");
|
|
25522
25528
|
|
|
25523
|
-
// 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
|
|
25524
25530
|
var DOCUMENT_PICTURE = "document_picture";
|
|
25525
25531
|
var SCAN_PAGE2 = 5e3;
|
|
25526
25532
|
var idOf = /* @__PURE__ */ __name((ref3) => {
|
|
@@ -25583,12 +25589,12 @@ var documentPicturesOver = /* @__PURE__ */ __name(({ database, now: now2 }) => (
|
|
|
25583
25589
|
}, "nearestPictures")
|
|
25584
25590
|
}), "documentPicturesOver");
|
|
25585
25591
|
|
|
25586
|
-
// 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
|
|
25587
25593
|
var noteIndexText = /* @__PURE__ */ __name((title2, text8) => title2 ? `${title2}
|
|
25588
25594
|
|
|
25589
25595
|
${text8}` : text8, "noteIndexText");
|
|
25590
25596
|
|
|
25591
|
-
// 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
|
|
25592
25598
|
var ENRICHMENT_SUBJECTS = ["document", "note", "email"];
|
|
25593
25599
|
var ENRICHMENT_POSITION = 1e6;
|
|
25594
25600
|
var EMAIL_ENRICHMENT = "email_enrichment";
|
|
@@ -25682,7 +25688,7 @@ var enrichmentsOver = /* @__PURE__ */ __name(({ database, now: now2 }) => ({
|
|
|
25682
25688
|
}), "clear")
|
|
25683
25689
|
}), "enrichmentsOver");
|
|
25684
25690
|
|
|
25685
|
-
// 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
|
|
25686
25692
|
var glob = /* @__PURE__ */ __name((value) => [...fold(value).matchAll(/\\(.)|([*?])|(.)/gsu)].map(([, escaped2, wildcard, plain2]) => {
|
|
25687
25693
|
const literal5 = escaped2 ?? plain2 ?? "";
|
|
25688
25694
|
return wildcard ?? (/[*?[]/u.test(literal5) ? `[${literal5}]` : literal5);
|
|
@@ -25758,7 +25764,7 @@ var compile = /* @__PURE__ */ __name((node, columns2, options) => {
|
|
|
25758
25764
|
var queryFilter = /* @__PURE__ */ __name((ast, columns2, options) => compile(ast.root, columns2, options), "queryFilter");
|
|
25759
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");
|
|
25760
25766
|
|
|
25761
|
-
// 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
|
|
25762
25768
|
var toJson = /* @__PURE__ */ __name((value) => value === null || value === void 0 ? null : JSON.stringify(value), "toJson");
|
|
25763
25769
|
var fromJson = /* @__PURE__ */ __name((value) => value === null || value === void 0 ? null : JSON.parse(String(value)), "fromJson");
|
|
25764
25770
|
var int = /* @__PURE__ */ __name((value) => value === null || value === void 0 ? null : Number(value), "int");
|
|
@@ -25848,7 +25854,7 @@ var linkMeeting = /* @__PURE__ */ __name((database, id2, eventId, now2, mode = "
|
|
|
25848
25854
|
});
|
|
25849
25855
|
}, "linkMeeting");
|
|
25850
25856
|
|
|
25851
|
-
// 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
|
|
25852
25858
|
var MAX_TITLE = 120;
|
|
25853
25859
|
var placeholderTitleOf = /* @__PURE__ */ __name((row2) => `${String(row2.type)} \u2014 ${String(row2.source_locator ?? "")}`, "placeholderTitleOf");
|
|
25854
25860
|
var PLACEHOLDER_TITLE_SQL = "title = type || ' \u2014 ' || coalesce(source_locator, '')";
|
|
@@ -25910,7 +25916,7 @@ var fillFoundTaskTitles = /* @__PURE__ */ __name((database, warn, { batch = 500
|
|
|
25910
25916
|
}
|
|
25911
25917
|
}, "fillFoundTaskTitles");
|
|
25912
25918
|
|
|
25913
|
-
// 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
|
|
25914
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), ''))";
|
|
25915
25921
|
var UNSEARCHED_EVENT_TYPES = [
|
|
25916
25922
|
"working-location",
|
|
@@ -26157,7 +26163,7 @@ var resetNoteIndex = /* @__PURE__ */ __name((database) => {
|
|
|
26157
26163
|
return true;
|
|
26158
26164
|
}, "resetNoteIndex");
|
|
26159
26165
|
|
|
26160
|
-
// 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
|
|
26161
26167
|
var keyOf2 = /* @__PURE__ */ __name((name) => fold(name).trim().replace(/^@/, ""), "keyOf");
|
|
26162
26168
|
var resolvePersonLinks = /* @__PURE__ */ __name((database, names) => {
|
|
26163
26169
|
for (const key2 of new Set(names.filter((name) => !!name?.trim()).map(keyOf2))) {
|
|
@@ -26176,7 +26182,7 @@ var resolvePersonLinks = /* @__PURE__ */ __name((database, names) => {
|
|
|
26176
26182
|
}
|
|
26177
26183
|
}, "resolvePersonLinks");
|
|
26178
26184
|
|
|
26179
|
-
// 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
|
|
26180
26186
|
var canonicalTags = sqliteTable("canonical_tags", {
|
|
26181
26187
|
id: integer("id").primaryKey(),
|
|
26182
26188
|
name: text("name").notNull().unique(),
|
|
@@ -26185,7 +26191,7 @@ var canonicalTags = sqliteTable("canonical_tags", {
|
|
|
26185
26191
|
updatedAt: integer("updated_at").notNull()
|
|
26186
26192
|
});
|
|
26187
26193
|
|
|
26188
|
-
// 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
|
|
26189
26195
|
var linkRevisions = sqliteTable("link_revisions", {
|
|
26190
26196
|
id: integer("id").primaryKey(),
|
|
26191
26197
|
linkId: integer("link_id").notNull(),
|
|
@@ -26197,7 +26203,7 @@ var linkRevisions = sqliteTable("link_revisions", {
|
|
|
26197
26203
|
createdAt: integer("created_at").notNull()
|
|
26198
26204
|
}, (table) => [index("link_revisions_by_link_id_created_at").on(table.linkId, table.createdAt)]);
|
|
26199
26205
|
|
|
26200
|
-
// 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
|
|
26201
26207
|
var documentAnnotationTransfers = sqliteTable("document_annotation_transfers", {
|
|
26202
26208
|
sourceKey: text("source_key").notNull(),
|
|
26203
26209
|
collection: text("collection").notNull(),
|
|
@@ -26207,13 +26213,13 @@ var documentAnnotationTransfers = sqliteTable("document_annotation_transfers", {
|
|
|
26207
26213
|
createdAt: integer("created_at").notNull()
|
|
26208
26214
|
}, (table) => [primaryKey({ columns: [table.sourceKey, table.collection] })]);
|
|
26209
26215
|
|
|
26210
|
-
// 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
|
|
26211
26217
|
var documentIndexPending = sqliteTable("document_index_pending", {
|
|
26212
26218
|
id: integer("id").notNull(),
|
|
26213
26219
|
indexableType: text("indexable_type").notNull()
|
|
26214
26220
|
}, (table) => [primaryKey({ columns: [table.indexableType, table.id] })]);
|
|
26215
26221
|
|
|
26216
|
-
// 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
|
|
26217
26223
|
var decisionRequests = sqliteTable("decision_requests", {
|
|
26218
26224
|
id: integer("id").primaryKey(),
|
|
26219
26225
|
tokenDigest: text("token_digest").notNull().unique(),
|
|
@@ -26233,7 +26239,7 @@ var decisionRequests = sqliteTable("decision_requests", {
|
|
|
26233
26239
|
index("decision_requests_by_channel_bot_profile_chat_id_message_id").on(table.channel, table.botProfile, table.chatId, table.messageId)
|
|
26234
26240
|
]);
|
|
26235
26241
|
|
|
26236
|
-
// 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
|
|
26237
26243
|
var enrichments = sqliteTable("enrichments", {
|
|
26238
26244
|
subjectType: text("subject_type").notNull(),
|
|
26239
26245
|
subjectId: integer("subject_id").notNull(),
|
|
@@ -26245,7 +26251,7 @@ var enrichments = sqliteTable("enrichments", {
|
|
|
26245
26251
|
createdAt: integer("created_at").notNull()
|
|
26246
26252
|
}, (table) => [primaryKey({ columns: [table.subjectType, table.subjectId] })]);
|
|
26247
26253
|
|
|
26248
|
-
// 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
|
|
26249
26255
|
var templates = sqliteTable("templates", {
|
|
26250
26256
|
key: text("key").notNull(),
|
|
26251
26257
|
channel: text("channel").notNull(),
|
|
@@ -26267,7 +26273,7 @@ var templatesHistory = sqliteTable("templates_history", {
|
|
|
26267
26273
|
index("templates_history_by_key_channel_language_id").on(table.key, table.channel, table.language, table.id)
|
|
26268
26274
|
]);
|
|
26269
26275
|
|
|
26270
|
-
// 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
|
|
26271
26277
|
var links = sqliteTable("links", {
|
|
26272
26278
|
id: integer("id").primaryKey(),
|
|
26273
26279
|
fromType: text("from_type").notNull(),
|
|
@@ -26298,7 +26304,7 @@ var links = sqliteTable("links", {
|
|
|
26298
26304
|
index("links_by_to_type_to_id").on(table.toType, table.toId)
|
|
26299
26305
|
]);
|
|
26300
26306
|
|
|
26301
|
-
// 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
|
|
26302
26308
|
var tagRedirects = sqliteTable("tag_redirects", {
|
|
26303
26309
|
sourceId: integer("source_id").primaryKey().references(() => canonicalTags.id),
|
|
26304
26310
|
survivorId: integer("survivor_id").notNull().references(() => canonicalTags.id),
|
|
@@ -26324,7 +26330,7 @@ var tagConsolidations = sqliteTable("tag_consolidations", {
|
|
|
26324
26330
|
index("tag_consolidations_by_actor_type_actor_id").on(table.actorType, table.actorId)
|
|
26325
26331
|
]);
|
|
26326
26332
|
|
|
26327
|
-
// 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
|
|
26328
26334
|
var accounts = sqliteTable("accounts", {
|
|
26329
26335
|
id: integer("id").primaryKey(),
|
|
26330
26336
|
provider: text("provider").notNull(),
|
|
@@ -27228,7 +27234,9 @@ var meetings = sqliteTable("meetings", {
|
|
|
27228
27234
|
updatedAt: integer("updated_at").notNull(),
|
|
27229
27235
|
deletedAt: integer("deleted_at"),
|
|
27230
27236
|
titleFolded: text("title_folded"),
|
|
27231
|
-
joinKey: text("join_key")
|
|
27237
|
+
joinKey: text("join_key"),
|
|
27238
|
+
direction: text("direction"),
|
|
27239
|
+
clientPhone: text("client_phone")
|
|
27232
27240
|
}, (table) => [
|
|
27233
27241
|
unique().on(table.accountId, table.externalId),
|
|
27234
27242
|
index("meetings_by_join_key").on(table.joinKey).where(sql`join_key IS NOT NULL`),
|
|
@@ -27533,6 +27541,15 @@ var facts = sqliteTable("facts", {
|
|
|
27533
27541
|
index("facts_by_author_type_author_id").on(table.authorType, table.authorId),
|
|
27534
27542
|
index("facts_by_confirmed_by_type_confirmed_by_id").on(table.confirmedByType, table.confirmedById)
|
|
27535
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)]);
|
|
27536
27553
|
var invoices = sqliteTable("invoices", {
|
|
27537
27554
|
id: integer("id").primaryKey(),
|
|
27538
27555
|
direction: text("direction").notNull(),
|
|
@@ -28334,7 +28351,7 @@ var storeSettings = sqliteTable("store_settings", {
|
|
|
28334
28351
|
at: integer("at").notNull()
|
|
28335
28352
|
});
|
|
28336
28353
|
|
|
28337
|
-
// 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
|
|
28338
28355
|
var contactsOf = /* @__PURE__ */ __name(({ phones: phones2, emails: emails3 }) => {
|
|
28339
28356
|
if (phones2 === void 0 && emails3 === void 0)
|
|
28340
28357
|
return void 0;
|
|
@@ -28580,7 +28597,7 @@ var meetingIdentityPk = /* @__PURE__ */ __name((context, accountId, identity) =>
|
|
|
28580
28597
|
}, "meetingIdentityPk");
|
|
28581
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");
|
|
28582
28599
|
|
|
28583
|
-
// 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
|
|
28584
28601
|
var TAKES = {
|
|
28585
28602
|
chat: "a chat: chat:<provider>/<account>/<chat>, its id or its title",
|
|
28586
28603
|
message: "a message: msg:<provider>/<account>/<chat>/<message>, or a chat and the message's id"
|
|
@@ -28640,7 +28657,7 @@ var ensureAccount = /* @__PURE__ */ __name(async (reference2, scope3, profilesOn
|
|
|
28640
28657
|
throw wrongAccount(reference2, scope3, profiles);
|
|
28641
28658
|
}, "ensureAccount");
|
|
28642
28659
|
|
|
28643
|
-
// 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
|
|
28644
28661
|
var trigrams = /* @__PURE__ */ __name((term) => {
|
|
28645
28662
|
const padded = ` ${term} `;
|
|
28646
28663
|
const pieces = /* @__PURE__ */ new Set();
|
|
@@ -28649,7 +28666,7 @@ var trigrams = /* @__PURE__ */ __name((term) => {
|
|
|
28649
28666
|
return [...pieces];
|
|
28650
28667
|
}, "trigrams");
|
|
28651
28668
|
|
|
28652
|
-
// 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
|
|
28653
28670
|
var isId = /* @__PURE__ */ __name((reference2) => /^-?\d+$/.test(reference2.trim()), "isId");
|
|
28654
28671
|
var foldName = /* @__PURE__ */ __name((name) => name.normalize("NFC").replace(/[\uFE0E\uFE0F\u200D]/g, "").toLowerCase().replaceAll("\u0451", "\u0435"), "foldName");
|
|
28655
28672
|
var pickChat = /* @__PURE__ */ __name((reference2, chats2) => {
|
|
@@ -28720,7 +28737,7 @@ ${lines}`, { candidates });
|
|
|
28720
28737
|
}, "ambiguous");
|
|
28721
28738
|
var isPresent = /* @__PURE__ */ __name((value) => value !== null && value !== void 0, "isPresent");
|
|
28722
28739
|
|
|
28723
|
-
// 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
|
|
28724
28741
|
var QUOTES = [
|
|
28725
28742
|
['"', '"'],
|
|
28726
28743
|
["'", "'"],
|
|
@@ -28778,7 +28795,7 @@ var nameKey = /* @__PURE__ */ __name((name) => {
|
|
|
28778
28795
|
}, "nameKey");
|
|
28779
28796
|
var isReadable = /* @__PURE__ */ __name((shown2) => shown2 !== null && READABLE.test(shown2), "isReadable");
|
|
28780
28797
|
|
|
28781
|
-
// 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
|
|
28782
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");
|
|
28783
28800
|
var MOVED_AWAY = `moved.identity_id IN (SELECT value FROM json_each(?))
|
|
28784
28801
|
AND (moved.from_person_id IN (SELECT value FROM json_each(?))
|
|
@@ -28793,7 +28810,7 @@ var apart = /* @__PURE__ */ __name(({ database }, one2, other) => {
|
|
|
28793
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");
|
|
28794
28811
|
var identitySeparated = /* @__PURE__ */ __name((context, identity, person2) => apart(context, { identities: [identity] }, { identities: identitiesOf(context, person2).filter((pk) => pk !== identity), person: person2 }), "identitySeparated");
|
|
28795
28812
|
|
|
28796
|
-
// 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
|
|
28797
28814
|
var MESSAGE_FIELDS = {
|
|
28798
28815
|
pk: messages.id,
|
|
28799
28816
|
nativeId: messages.externalId,
|
|
@@ -28973,7 +28990,7 @@ var chatActivity = /* @__PURE__ */ __name(({ database }, accountKey, since, wher
|
|
|
28973
28990
|
storedAt: toIso(Number(database.prepare("SELECT max(created_at) AS at FROM messages WHERE account_id = ?").get(accountKey)?.at) || null)
|
|
28974
28991
|
}), "chatActivity");
|
|
28975
28992
|
|
|
28976
|
-
// 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
|
|
28977
28994
|
var HIT_FIELDS = {
|
|
28978
28995
|
...MESSAGE_FIELDS,
|
|
28979
28996
|
chatTitle: sql`${chats.title}`.as("chat_title"),
|
|
@@ -29074,7 +29091,7 @@ var directReplies = /* @__PURE__ */ __name((context, parents, limit) => {
|
|
|
29074
29091
|
};
|
|
29075
29092
|
}, "directReplies");
|
|
29076
29093
|
|
|
29077
|
-
// 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
|
|
29078
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");
|
|
29079
29096
|
var required = /* @__PURE__ */ __name((context, ref3) => {
|
|
29080
29097
|
const found2 = identityRow(context, ref3);
|
|
@@ -29287,7 +29304,7 @@ var mentioning = /* @__PURE__ */ __name((context, accountKey, { id: id2, usernam
|
|
|
29287
29304
|
}, "mentioning");
|
|
29288
29305
|
var escaped = /* @__PURE__ */ __name((text8) => text8.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), "escaped");
|
|
29289
29306
|
|
|
29290
|
-
// 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
|
|
29291
29308
|
var BOT_KINDS = ["agent", "rule", "script", "integration"];
|
|
29292
29309
|
var ownerPerson = /* @__PURE__ */ __name((database) => {
|
|
29293
29310
|
const found2 = database.prepare("SELECT id FROM persons WHERE owner = 1 ORDER BY id LIMIT 1").get();
|
|
@@ -29344,7 +29361,7 @@ var proposedBySql = /* @__PURE__ */ __name((type, id2, by) => {
|
|
|
29344
29361
|
return { sql: bot("pb.name = ?"), params: [by.bot] };
|
|
29345
29362
|
}, "proposedBySql");
|
|
29346
29363
|
|
|
29347
|
-
// 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
|
|
29348
29365
|
var TABLES = { memory: "memories", fact: "facts" };
|
|
29349
29366
|
var HOLDING = { memory: ["proposed", "confirmed"], fact: ["proposed", "accepted"] };
|
|
29350
29367
|
var KEPT = 20;
|
|
@@ -29439,7 +29456,7 @@ var scrubSourceReviews = /* @__PURE__ */ __name((database, erased, { refs }) =>
|
|
|
29439
29456
|
return scrubbed;
|
|
29440
29457
|
}, "scrubSourceReviews");
|
|
29441
29458
|
|
|
29442
|
-
// 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
|
|
29443
29460
|
var QUOTE_LIMIT = 500;
|
|
29444
29461
|
var GONE = { sig: "gone", rev: null, deleted: true, changedAt: null };
|
|
29445
29462
|
var part = /* @__PURE__ */ __name((value) => value == null ? "" : String(value), "part");
|
|
@@ -29718,11 +29735,11 @@ var deleteDocumentRow = /* @__PURE__ */ __name((database, id2, at2) => {
|
|
|
29718
29735
|
database.prepare("DELETE FROM documents WHERE id = ?").run(id2);
|
|
29719
29736
|
}, "deleteDocumentRow");
|
|
29720
29737
|
|
|
29721
|
-
// 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
|
|
29722
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");
|
|
29723
29740
|
var oneLine = /* @__PURE__ */ __name((text8) => singleLine(text8.replace(/\s+/g, " ").trim()), "oneLine");
|
|
29724
29741
|
|
|
29725
|
-
// 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
|
|
29726
29743
|
var accountKeys = /* @__PURE__ */ __name((database, ids3) => {
|
|
29727
29744
|
const unique2 = [...new Set(ids3)];
|
|
29728
29745
|
if (unique2.length === 0)
|
|
@@ -29811,7 +29828,7 @@ var refEndsOf = /* @__PURE__ */ __name((database, text8) => {
|
|
|
29811
29828
|
}, "refEndsOf");
|
|
29812
29829
|
var refAccountsOf = /* @__PURE__ */ __name((database, text8) => refEndsOf(database, text8)?.flat(), "refAccountsOf");
|
|
29813
29830
|
|
|
29814
|
-
// 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
|
|
29815
29832
|
var EXCERPT_CHARS = 280;
|
|
29816
29833
|
var TITLE_CHARS = 120;
|
|
29817
29834
|
var MEMORY_TITLE_CHARS = 80;
|
|
@@ -30235,7 +30252,7 @@ var refsStoreOver = /* @__PURE__ */ __name((context) => ({
|
|
|
30235
30252
|
ends: /* @__PURE__ */ __name(async (text8) => refEndsOf(context.database, text8), "ends")
|
|
30236
30253
|
}), "refsStoreOver");
|
|
30237
30254
|
|
|
30238
|
-
// 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
|
|
30239
30256
|
var sourceOf3 = /* @__PURE__ */ __name((read2, ref3) => ({
|
|
30240
30257
|
ref: ref3,
|
|
30241
30258
|
kind: read2.kind,
|
|
@@ -30273,7 +30290,7 @@ var evidenceSourcesOf = /* @__PURE__ */ __name((database, from2) => {
|
|
|
30273
30290
|
});
|
|
30274
30291
|
}, "evidenceSourcesOf");
|
|
30275
30292
|
|
|
30276
|
-
// 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
|
|
30277
30294
|
var MAX_FILE_BYTES = 50 * 1024 * 1024;
|
|
30278
30295
|
var MAX_TEXT_CHARS = 2e6;
|
|
30279
30296
|
var ATTACHMENT_LIMIT_ENV = [
|
|
@@ -30299,7 +30316,7 @@ var pdfPreviewLimits = /* @__PURE__ */ __name((env = process.env) => {
|
|
|
30299
30316
|
return { pixels, bytes: positive(env, "MESSAGING_PDF_PREVIEW_MAX_MIB", 8 * 1024 * 1024, 1024 * 1024) };
|
|
30300
30317
|
}, "pdfPreviewLimits");
|
|
30301
30318
|
|
|
30302
|
-
// 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
|
|
30303
30320
|
import { randomBytes } from "node:crypto";
|
|
30304
30321
|
var CROCKFORD = "0123456789ABCDEFGHJKMNPQRSTVWXYZ";
|
|
30305
30322
|
var ulid = /* @__PURE__ */ __name((now2 = Date.now()) => {
|
|
@@ -30312,7 +30329,7 @@ var ulid = /* @__PURE__ */ __name((now2 = Date.now()) => {
|
|
|
30312
30329
|
return time3 + random;
|
|
30313
30330
|
}, "ulid");
|
|
30314
30331
|
|
|
30315
|
-
// 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
|
|
30316
30333
|
var FOLDED_FIELDS = ["title", "site", "language", "author"];
|
|
30317
30334
|
var encodeDocumentMetadata = /* @__PURE__ */ __name((meta, sections) => {
|
|
30318
30335
|
if (!meta && !sections?.length)
|
|
@@ -30333,11 +30350,11 @@ var languageOf = /* @__PURE__ */ __name((meta) => {
|
|
|
30333
30350
|
return typeof language === "string" && language !== "" ? language : null;
|
|
30334
30351
|
}, "languageOf");
|
|
30335
30352
|
|
|
30336
|
-
// 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
|
|
30337
30354
|
var LIVE3 = "f.deleted_at IS NULL AND d.deleted_at IS NULL AND coalesce(json_extract(d.metadata, '$.catalog.active'), 1)=1";
|
|
30338
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");
|
|
30339
30356
|
|
|
30340
|
-
// 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
|
|
30341
30358
|
var isObject2 = /* @__PURE__ */ __name((value) => value !== null && typeof value === "object" && !Array.isArray(value), "isObject");
|
|
30342
30359
|
var objectOf2 = /* @__PURE__ */ __name((value) => {
|
|
30343
30360
|
if (isObject2(value))
|
|
@@ -30374,8 +30391,8 @@ var localFolder = /* @__PURE__ */ __name((database, now2, accountId, path) => {
|
|
|
30374
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");
|
|
30375
30392
|
var driveFileTarget = /* @__PURE__ */ __name((fileId) => `google-drive:${fileId}`, "driveFileTarget");
|
|
30376
30393
|
var driveDocumentOf = /* @__PURE__ */ __name((database, fileId) => {
|
|
30377
|
-
const
|
|
30378
|
-
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);
|
|
30379
30396
|
}, "driveDocumentOf");
|
|
30380
30397
|
var linkAttached = /* @__PURE__ */ __name((database, now2, fileId) => {
|
|
30381
30398
|
const target = driveFileTarget(fileId);
|
|
@@ -30584,7 +30601,7 @@ var filesStoreOver = /* @__PURE__ */ __name(({ database, now: now2 }) => {
|
|
|
30584
30601
|
};
|
|
30585
30602
|
}, "filesStoreOver");
|
|
30586
30603
|
|
|
30587
|
-
// 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
|
|
30588
30605
|
var IMPORTED_DOCUMENT_QUERY = defineQuery({
|
|
30589
30606
|
entity: "document",
|
|
30590
30607
|
backend: "sql",
|
|
@@ -30630,7 +30647,7 @@ var importedDocumentWhere = /* @__PURE__ */ __name((database, query) => {
|
|
|
30630
30647
|
return queryFilter(validateQuery(query, IMPORTED_DOCUMENT_QUERY), columns2, { zone: timezoneOf() });
|
|
30631
30648
|
}, "importedDocumentWhere");
|
|
30632
30649
|
|
|
30633
|
-
// 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
|
|
30634
30651
|
var reviewLink = /* @__PURE__ */ __name((database, linkable, entity, candidates, reason, now2) => {
|
|
30635
30652
|
database.prepare(`INSERT INTO link_reviews (linkable_type, linkable_id, entity_type, candidates, reason, status, created_at, updated_at)
|
|
30636
30653
|
VALUES (?, ?, ?, ?, ?, 'open', ?, ?)
|
|
@@ -30638,7 +30655,7 @@ var reviewLink = /* @__PURE__ */ __name((database, linkable, entity, candidates,
|
|
|
30638
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);
|
|
30639
30656
|
}, "reviewLink");
|
|
30640
30657
|
|
|
30641
|
-
// 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
|
|
30642
30659
|
var iso3 = /* @__PURE__ */ __name((value) => new Date(Number(value)).toISOString(), "iso");
|
|
30643
30660
|
var thingRef = /* @__PURE__ */ __name((database, type, id2) => type == null || id2 == null ? null : referenceOfThing(database, storedThing(type, id2)) ?? null, "thingRef");
|
|
30644
30661
|
var hasBothEnds = /* @__PURE__ */ __name((link3) => link3.from !== null && link3.to !== null, "hasBothEnds");
|
|
@@ -30672,7 +30689,7 @@ var linkOf = /* @__PURE__ */ __name((database, row2) => {
|
|
|
30672
30689
|
};
|
|
30673
30690
|
}, "linkOf");
|
|
30674
30691
|
|
|
30675
|
-
// 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
|
|
30676
30693
|
var dateFileNotes = /* @__PURE__ */ __name((database, folder, dates) => {
|
|
30677
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");
|
|
30678
30695
|
const legacy = database.prepare("SELECT id FROM documents WHERE account_id = ? AND external_id = ? AND deleted_at IS NULL");
|
|
@@ -30693,7 +30710,7 @@ var dateFileNotes = /* @__PURE__ */ __name((database, folder, dates) => {
|
|
|
30693
30710
|
return changed;
|
|
30694
30711
|
}, "dateFileNotes");
|
|
30695
30712
|
|
|
30696
|
-
// 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
|
|
30697
30714
|
var textOf2 = /* @__PURE__ */ __name((text8, what, max = 1e5, allowEmpty = false) => {
|
|
30698
30715
|
const value = text8.trim();
|
|
30699
30716
|
if (!value && !allowEmpty || value.length > max)
|
|
@@ -30706,7 +30723,7 @@ var oneOf = /* @__PURE__ */ __name((value, allowed, what) => {
|
|
|
30706
30723
|
return value;
|
|
30707
30724
|
}, "oneOf");
|
|
30708
30725
|
|
|
30709
|
-
// 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
|
|
30710
30727
|
var NOTE_FORMATS = ["obsidian", "markdown"];
|
|
30711
30728
|
var RELATIONSHIPS = RELATION_KINDS.map(linkKind).join(", ");
|
|
30712
30729
|
var iso4 = /* @__PURE__ */ __name((value) => new Date(Number(value)).toISOString(), "iso");
|
|
@@ -30716,6 +30733,7 @@ var keepRevision = /* @__PURE__ */ __name((database, row2, at2) => database.prep
|
|
|
30716
30733
|
var documentOf = /* @__PURE__ */ __name((row2) => ({
|
|
30717
30734
|
id: String(row2.id),
|
|
30718
30735
|
ref: `document:${row2.id}`,
|
|
30736
|
+
subject: null,
|
|
30719
30737
|
source: "file",
|
|
30720
30738
|
folderId: String(row2.account_id),
|
|
30721
30739
|
path: String(row2.external_id),
|
|
@@ -30730,9 +30748,10 @@ var documentOf = /* @__PURE__ */ __name((row2) => ({
|
|
|
30730
30748
|
updatedAt: iso4(row2.updated_at),
|
|
30731
30749
|
deletedAt: optionalIso(row2.deleted_at)
|
|
30732
30750
|
}), "documentOf");
|
|
30733
|
-
var noteOf = /* @__PURE__ */ __name((row2) => ({
|
|
30751
|
+
var noteOf = /* @__PURE__ */ __name((row2, database) => ({
|
|
30734
30752
|
id: String(row2.id),
|
|
30735
30753
|
ref: `note:${row2.id}`,
|
|
30754
|
+
subject: referenceUnlessOwner(database, { type: String(row2.notable_type), id: Number(row2.notable_id) }),
|
|
30736
30755
|
source: "internal",
|
|
30737
30756
|
folderId: null,
|
|
30738
30757
|
path: null,
|
|
@@ -30752,7 +30771,7 @@ var noteRowOf = /* @__PURE__ */ __name((database, reference2) => {
|
|
|
30752
30771
|
if (thing?.type === "document")
|
|
30753
30772
|
return documentOf(database.prepare("SELECT * FROM documents WHERE id = ?").get(thing.id));
|
|
30754
30773
|
if (thing?.type === "note")
|
|
30755
|
-
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);
|
|
30756
30775
|
return void 0;
|
|
30757
30776
|
}, "noteRowOf");
|
|
30758
30777
|
var requiredThing = /* @__PURE__ */ __name((database, reference2, what = "the target") => {
|
|
@@ -31085,7 +31104,7 @@ var notesStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
31085
31104
|
const id2 = Number(row2?.id);
|
|
31086
31105
|
for (const reference2 of about.slice(1))
|
|
31087
31106
|
insertLink(context, { from: `note:${id2}`, to: reference2, kind: "about", origin: "owner" });
|
|
31088
|
-
return noteOf(noteRow(String(id2)));
|
|
31107
|
+
return noteOf(noteRow(String(id2)), database);
|
|
31089
31108
|
}), "addNote"),
|
|
31090
31109
|
note: /* @__PURE__ */ __name(async (reference2) => anyNote(reference2), "note"),
|
|
31091
31110
|
resolveNote: /* @__PURE__ */ __name(async (reference2) => {
|
|
@@ -31114,7 +31133,7 @@ var notesStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
31114
31133
|
// In a folder, a document is wherever one of its live files is, under that file's path.
|
|
31115
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 ?`
|
|
31116
31135
|
).all(folder, folder, aboutType, aboutType, aboutId, ...documentText?.params ?? [], limit + offset + 1).map(documentOf);
|
|
31117
|
-
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));
|
|
31118
31137
|
const all2 = [...files2, ...written].sort((a, b) => b.createdAt.localeCompare(a.createdAt) || b.ref.localeCompare(a.ref));
|
|
31119
31138
|
return { items: all2.slice(offset, offset + limit), hasMore: all2.length > offset + limit };
|
|
31120
31139
|
}, "notes"),
|
|
@@ -31135,7 +31154,7 @@ var notesStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
31135
31154
|
if (!changed)
|
|
31136
31155
|
throw new CliError("validation_error", "the note changed; read its current revision before editing");
|
|
31137
31156
|
database.prepare("INSERT INTO note_revisions (note_id, body, revision, created_at) VALUES (?, ?, ?, ?)").run(Number(bare3), String(found2.body), revision2, now2());
|
|
31138
|
-
return noteOf(noteRow(bare3));
|
|
31157
|
+
return noteOf(noteRow(bare3), database);
|
|
31139
31158
|
}), "editNote"),
|
|
31140
31159
|
removeNote: /* @__PURE__ */ __name(async (id2) => write(database, () => {
|
|
31141
31160
|
if (id2.startsWith("document:"))
|
|
@@ -31226,10 +31245,10 @@ var notesStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
31226
31245
|
};
|
|
31227
31246
|
}, "notesStoreOver");
|
|
31228
31247
|
|
|
31229
|
-
// 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
|
|
31230
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");
|
|
31231
31250
|
|
|
31232
|
-
// 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
|
|
31233
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";
|
|
31234
31253
|
var iso5 = /* @__PURE__ */ __name((value) => new Date(Number(value)).toISOString(), "iso");
|
|
31235
31254
|
var oneOf2 = /* @__PURE__ */ __name((value, allowed, what) => {
|
|
@@ -31494,7 +31513,7 @@ var memoriesStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
31494
31513
|
};
|
|
31495
31514
|
}, "memoriesStoreOver");
|
|
31496
31515
|
|
|
31497
|
-
// 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
|
|
31498
31517
|
var prefixesText = /* @__PURE__ */ __name((types) => `${article(types[0] ?? "")} ${types.map((type) => `${type}:`).join(" or ")}`, "prefixesText");
|
|
31499
31518
|
var refuse = /* @__PURE__ */ __name((message3, reason, code = "validation_error") => {
|
|
31500
31519
|
throw new CliError(code, message3, { reason });
|
|
@@ -31642,7 +31661,7 @@ var reviewedRowsOver = /* @__PURE__ */ __name((context) => {
|
|
|
31642
31661
|
return { partyOf, partyThing, reviewedOf, written, keepEvidence, ownerOnly: ownerOnly2, linkedId, ...decisionsOver(context) };
|
|
31643
31662
|
}, "reviewedRowsOver");
|
|
31644
31663
|
|
|
31645
|
-
// 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
|
|
31646
31665
|
var MAX_LINES = 500;
|
|
31647
31666
|
var PARENTS = {
|
|
31648
31667
|
invoice: {
|
|
@@ -31742,7 +31761,7 @@ var moneyLinesOver = /* @__PURE__ */ __name(({ database }) => {
|
|
|
31742
31761
|
return { linesOf, insertLines, shownLines, appendLine, deleteLine, sumOf, retotal };
|
|
31743
31762
|
}, "moneyLinesOver");
|
|
31744
31763
|
|
|
31745
|
-
// 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
|
|
31746
31765
|
var COUNTED = {
|
|
31747
31766
|
confirmed: "np.review = 'confirmed' AND np.deleted_at IS NULL",
|
|
31748
31767
|
// A proposed refund promises nothing back yet, so it must not free room an import could then fill.
|
|
@@ -31817,7 +31836,7 @@ var refundRulesOver = /* @__PURE__ */ __name((context) => {
|
|
|
31817
31836
|
return { originalFor, refundShare, confirmable, keepsRefunded, keepsShare, keepsInvoice };
|
|
31818
31837
|
}, "refundRulesOver");
|
|
31819
31838
|
|
|
31820
|
-
// 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
|
|
31821
31840
|
var FINANCE_TYPES = ["invoice", "payment"];
|
|
31822
31841
|
var isFinanceType = /* @__PURE__ */ __name((type) => FINANCE_TYPES.includes(type), "isFinanceType");
|
|
31823
31842
|
var PAID = netPaidSql("i.id");
|
|
@@ -32221,7 +32240,7 @@ var financeStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
32221
32240
|
};
|
|
32222
32241
|
}, "financeStoreOver");
|
|
32223
32242
|
|
|
32224
|
-
// 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
|
|
32225
32244
|
var refuse2 = /* @__PURE__ */ __name((message3, reason) => {
|
|
32226
32245
|
throw new CliError("validation_error", message3, { reason });
|
|
32227
32246
|
}, "refuse");
|
|
@@ -32299,7 +32318,7 @@ var paymentEntriesOver = /* @__PURE__ */ __name((context) => {
|
|
|
32299
32318
|
};
|
|
32300
32319
|
}, "paymentEntriesOver");
|
|
32301
32320
|
|
|
32302
|
-
// 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
|
|
32303
32322
|
var EVIDENCE_FINDINGS_KIND = "evidence_findings";
|
|
32304
32323
|
var reference = /* @__PURE__ */ __name((raw) => {
|
|
32305
32324
|
if (/^(document|note):[1-9]\d*$/.test(raw))
|
|
@@ -32326,7 +32345,7 @@ var validateEvidenceFindings = /* @__PURE__ */ __name((input) => {
|
|
|
32326
32345
|
return valid;
|
|
32327
32346
|
}, "validateEvidenceFindings");
|
|
32328
32347
|
|
|
32329
|
-
// 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
|
|
32330
32349
|
var PROPOSAL_STATUSES = ["proposed", "approved", "rejected", "executed", "failed"];
|
|
32331
32350
|
var PROPOSAL_VERDICTS = ["useful", "not_useful"];
|
|
32332
32351
|
var iso7 = /* @__PURE__ */ __name((value) => value == null ? null : new Date(Number(value)).toISOString(), "iso");
|
|
@@ -32520,7 +32539,7 @@ var proposedActionsStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
32520
32539
|
};
|
|
32521
32540
|
}, "proposedActionsStoreOver");
|
|
32522
32541
|
|
|
32523
|
-
// 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
|
|
32524
32543
|
var CONFIRMED = "proposal";
|
|
32525
32544
|
var refOf = /* @__PURE__ */ __name(({ database }, pk) => {
|
|
32526
32545
|
const row2 = database.prepare("SELECT provider, external_id FROM identities WHERE id = ?").get(pk);
|
|
@@ -32870,7 +32889,7 @@ var identityLinkRows = /* @__PURE__ */ __name((context, { person: person2, statu
|
|
|
32870
32889
|
return { items, hasMore: rows.length > limit };
|
|
32871
32890
|
}, "identityLinkRows");
|
|
32872
32891
|
|
|
32873
|
-
// 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
|
|
32874
32893
|
var mergeId = /* @__PURE__ */ __name((to, from2) => `merge:${to}-${from2}`, "mergeId");
|
|
32875
32894
|
var parseMergeId = /* @__PURE__ */ __name((id2) => {
|
|
32876
32895
|
const found2 = /^merge:([1-9]\d*)-([1-9]\d*)$/.exec(id2.trim());
|
|
@@ -32973,7 +32992,7 @@ var split = /* @__PURE__ */ __name((context, uid, refs, by) => {
|
|
|
32973
32992
|
return recordOf(context, alone);
|
|
32974
32993
|
}, "split");
|
|
32975
32994
|
|
|
32976
|
-
// 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
|
|
32977
32996
|
var refOf2 = /* @__PURE__ */ __name(({ provider, id: id2 }) => `${provider}:${id2}`, "refOf");
|
|
32978
32997
|
var keyOf3 = /* @__PURE__ */ __name((split2, person2, identities2) => `${split2} ${person2} ${[...identities2].sort().join(" ")}`, "keyOf");
|
|
32979
32998
|
var planOf = /* @__PURE__ */ __name((context, input) => {
|
|
@@ -33150,7 +33169,7 @@ var forgetErasedSplits = /* @__PURE__ */ __name((database) => {
|
|
|
33150
33169
|
database.prepare("DELETE FROM proposed_actions WHERE id = ?").run(Number(row2.id));
|
|
33151
33170
|
}, "forgetErasedSplits");
|
|
33152
33171
|
|
|
33153
|
-
// 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
|
|
33154
33173
|
var SEED_PEOPLE = [
|
|
33155
33174
|
{ name: "Owner", username: "owner" },
|
|
33156
33175
|
{ name: "Ann Lee", username: "ann" },
|
|
@@ -33167,7 +33186,7 @@ var RESERVED_ADDRESS_GLOBS = [
|
|
|
33167
33186
|
];
|
|
33168
33187
|
var SEED_ID_GLOBS = ["person-[0-9]*"];
|
|
33169
33188
|
|
|
33170
|
-
// 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
|
|
33171
33190
|
var TEST_DATA_KIND = "test_data";
|
|
33172
33191
|
var globs = /* @__PURE__ */ __name((column2, patterns) => patterns.map((pattern) => `${column2} GLOB '${pattern}'`).join(" OR "), "globs");
|
|
33173
33192
|
var SURE = `(${globs("i.external_id", SEED_ID_GLOBS)} OR ${globs("lower(i.email)", RESERVED_ADDRESS_GLOBS)})`;
|
|
@@ -33236,7 +33255,7 @@ var forgetErasedTestData = /* @__PURE__ */ __name((database) => {
|
|
|
33236
33255
|
database.prepare("DELETE FROM proposed_actions WHERE id = ?").run(Number(row2.id));
|
|
33237
33256
|
}, "forgetErasedTestData");
|
|
33238
33257
|
|
|
33239
|
-
// 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
|
|
33240
33259
|
var accountPk = /* @__PURE__ */ __name(({ orm, now: now2 }, { provider, account, scope: scope3 }, name = null, startScope) => Number(orm.insert(accounts).values({
|
|
33241
33260
|
provider,
|
|
33242
33261
|
externalId: account,
|
|
@@ -33330,7 +33349,7 @@ var dropOrphanPeople = /* @__PURE__ */ __name((database, unseenBefore) => {
|
|
|
33330
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));
|
|
33331
33350
|
}, "dropOrphanPeople");
|
|
33332
33351
|
|
|
33333
|
-
// 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
|
|
33334
33353
|
var HISTORY_KEY = "$history";
|
|
33335
33354
|
var objectOf3 = /* @__PURE__ */ __name((text8) => {
|
|
33336
33355
|
if (typeof text8 !== "string")
|
|
@@ -33406,7 +33425,7 @@ var withoutHistory = /* @__PURE__ */ __name((metadata3) => {
|
|
|
33406
33425
|
return rest;
|
|
33407
33426
|
}, "withoutHistory");
|
|
33408
33427
|
|
|
33409
|
-
// 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
|
|
33410
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");
|
|
33411
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");
|
|
33412
33431
|
var setChatScope = /* @__PURE__ */ __name((context, accountKey, chatId, scope3) => {
|
|
@@ -33704,7 +33723,7 @@ var replaceAutoTags = /* @__PURE__ */ __name((context, key2, chatId, algorithm,
|
|
|
33704
33723
|
}
|
|
33705
33724
|
}, "replaceAutoTags");
|
|
33706
33725
|
|
|
33707
|
-
// 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
|
|
33708
33727
|
var COUNTER_FIELDS = ["views", "reactions", "comments"];
|
|
33709
33728
|
var validCounter = /* @__PURE__ */ __name((value) => typeof value === "number" && Number.isFinite(value) && value >= 0, "validCounter");
|
|
33710
33729
|
var counterValue = /* @__PURE__ */ __name((message3, field4) => {
|
|
@@ -33741,7 +33760,7 @@ var counterFreshness = /* @__PURE__ */ __name((states) => {
|
|
|
33741
33760
|
return states.some((one2) => one2.freshness === "stale") ? "stale" : "fresh";
|
|
33742
33761
|
}, "counterFreshness");
|
|
33743
33762
|
|
|
33744
|
-
// 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
|
|
33745
33764
|
var BOT_TOKEN = /(?<!\d)(\d{6,12}):[A-Za-z0-9_-]{30,40}(?![A-Za-z0-9_-])/g;
|
|
33746
33765
|
var MAY_HOLD = "*[0-9][0-9][0-9][0-9][0-9][0-9]:*";
|
|
33747
33766
|
var MASKED_THROUGH = "bot_tokens_masked_through";
|
|
@@ -33781,7 +33800,7 @@ var maskStoredBotTokens = /* @__PURE__ */ __name((context) => {
|
|
|
33781
33800
|
}, "maskStoredBotTokens");
|
|
33782
33801
|
var masks = /* @__PURE__ */ __name((value) => value != null && withoutBotTokens(String(value)) !== value, "masks");
|
|
33783
33802
|
|
|
33784
|
-
// 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
|
|
33785
33804
|
import { createHash as createHash4 } from "node:crypto";
|
|
33786
33805
|
var CONTEXT_MAX_READ_BYTES = 262144;
|
|
33787
33806
|
var CONTEXT_SOURCE_KINDS = ["message", "mail", "document", "meeting"];
|
|
@@ -33879,7 +33898,7 @@ var contextEvidenceRequest = /* @__PURE__ */ __name((input) => {
|
|
|
33879
33898
|
return { source: source2, query, chat: chat2, senders, words: words4, after: after2, before: before2, limit, maxReadBytes, cursor, signal: input.signal };
|
|
33880
33899
|
}, "contextEvidenceRequest");
|
|
33881
33900
|
|
|
33882
|
-
// 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
|
|
33883
33902
|
var MAIL_AGENDA_COLUMNS = { chat_kind: { type: "enum", sql: "'dialog'" } };
|
|
33884
33903
|
var ACTIVITY = `
|
|
33885
33904
|
SELECT t.external_id AS thread, t.subject, t.last_email_at, t.emails_count,
|
|
@@ -34009,7 +34028,7 @@ var mailActivity = /* @__PURE__ */ __name((database) => ({
|
|
|
34009
34028
|
threadActivity: /* @__PURE__ */ __name(async (accountId, since, where) => threadActivity(database, accountId, since, where), "threadActivity")
|
|
34010
34029
|
}), "mailActivity");
|
|
34011
34030
|
|
|
34012
|
-
// 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
|
|
34013
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");
|
|
34014
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;
|
|
34015
34034
|
var ATTRIBUTION = /(wrote|написал[аи]?|escribió|a écrit|schrieb)\s*:\s*$/iu;
|
|
@@ -34082,15 +34101,15 @@ var mailCore = /* @__PURE__ */ __name((body2, earlier) => {
|
|
|
34082
34101
|
const lines = body2.replace(/\r\n?/g, "\n").split("\n");
|
|
34083
34102
|
const held = earlier.map(flat2);
|
|
34084
34103
|
const drop = /* @__PURE__ */ new Set();
|
|
34085
|
-
for (const { start, end, quoted:
|
|
34086
|
-
if (alreadyHeld(
|
|
34104
|
+
for (const { start, end, quoted: quoted6 } of quoteBlocks(lines))
|
|
34105
|
+
if (alreadyHeld(quoted6, held))
|
|
34087
34106
|
for (let i = start; i < end; i++)
|
|
34088
34107
|
drop.add(i);
|
|
34089
34108
|
const kept2 = trimEdges(lines.filter((_, i) => !drop.has(i)));
|
|
34090
34109
|
return withoutSignOff(withoutGreeting(kept2)).join("\n").trim();
|
|
34091
34110
|
}, "mailCore");
|
|
34092
34111
|
|
|
34093
|
-
// 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
|
|
34094
34113
|
var titleOf2 = /* @__PURE__ */ __name((subject2) => subject2?.replace(/^\s*((re|fwd?|aw|wg)\s*:\s*)+/i, "").trim() || null, "titleOf");
|
|
34095
34114
|
var MAIL_PIECES = `(SELECT k.id, k.content_hash, k.chunkable_type AS type, k.chunkable_id AS owner, k.position,
|
|
34096
34115
|
k.start_offset, k.end_offset, k.account_id, k.occurred_at,
|
|
@@ -34203,7 +34222,7 @@ var drainEmailIndex = /* @__PURE__ */ __name((database, stemmerFor2) => {
|
|
|
34203
34222
|
return emails3 + threads;
|
|
34204
34223
|
}, "drainEmailIndex");
|
|
34205
34224
|
|
|
34206
|
-
// 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
|
|
34207
34226
|
var locate = /* @__PURE__ */ __name((database, accountId, emailId, where) => database.prepare(`INSERT OR REPLACE INTO email_locations (mailbox_id, uidvalidity, uid, email_id)
|
|
34208
34227
|
SELECT id, ?, ?, ? FROM mailboxes WHERE account_id = ? AND external_id = ?`).run(where.uidvalidity, where.uid, emailId, accountId, where.folder), "locate");
|
|
34209
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,
|
|
@@ -34301,7 +34320,7 @@ var forgetLocations = /* @__PURE__ */ __name((database, accountId, folder, uidva
|
|
|
34301
34320
|
var backfillSentAt = /* @__PURE__ */ __name((database, accountId, limit) => Number(database.prepare(`UPDATE emails SET sent_at = received_at WHERE id IN (
|
|
34302
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");
|
|
34303
34322
|
|
|
34304
|
-
// 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
|
|
34305
34324
|
var recountEmailThread = /* @__PURE__ */ __name((database, threadId, now2) => database.prepare(`UPDATE email_threads SET
|
|
34306
34325
|
emails_count = (SELECT count(*) FROM emails WHERE email_thread_id = ? AND deleted_at IS NULL),
|
|
34307
34326
|
last_email_at = (SELECT max(coalesce(sent_at, received_at)) FROM emails
|
|
@@ -34351,7 +34370,7 @@ var markEmailsRestored = /* @__PURE__ */ __name((database, accountId, externalId
|
|
|
34351
34370
|
return threads.length;
|
|
34352
34371
|
}, "markEmailsRestored");
|
|
34353
34372
|
|
|
34354
|
-
// 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
|
|
34355
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
|
|
34356
34375
|
FROM ${MAIL_PIECES} JOIN embeddings v ON v.model = ? AND v.content_hash = p.content_hash
|
|
34357
34376
|
WHERE p.account_id = ?
|
|
@@ -34411,7 +34430,7 @@ var indexedMailPieces = /* @__PURE__ */ __name((database, model, query, filter,
|
|
|
34411
34430
|
}, "indexedMailPieces");
|
|
34412
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");
|
|
34413
34432
|
|
|
34414
|
-
// 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
|
|
34415
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");
|
|
34416
34435
|
var conditionsKey = /* @__PURE__ */ __name((conditions) => JSON.stringify(sorted(conditions)), "conditionsKey");
|
|
34417
34436
|
var ruleOf = /* @__PURE__ */ __name((row2) => ({
|
|
@@ -34478,7 +34497,7 @@ var mailRulesOver = /* @__PURE__ */ __name((database) => ({
|
|
|
34478
34497
|
}
|
|
34479
34498
|
}), "mailRulesOver");
|
|
34480
34499
|
|
|
34481
|
-
// 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
|
|
34482
34501
|
function checkMeetingCancelled(signal) {
|
|
34483
34502
|
if (!signal?.aborted)
|
|
34484
34503
|
return;
|
|
@@ -34489,8 +34508,22 @@ function checkMeetingCancelled(signal) {
|
|
|
34489
34508
|
}
|
|
34490
34509
|
__name(checkMeetingCancelled, "checkMeetingCancelled");
|
|
34491
34510
|
|
|
34492
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34493
|
-
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) => ({
|
|
34494
34527
|
id: Number(row2.id),
|
|
34495
34528
|
accountId: Number(row2.account_id),
|
|
34496
34529
|
meetingSeriesId: int(row2.meeting_series_id),
|
|
@@ -34508,6 +34541,7 @@ var meetingOf = /* @__PURE__ */ __name((row2) => ({
|
|
|
34508
34541
|
participantsCount: int(row2.participants_count),
|
|
34509
34542
|
metadata: fromJson(row2.metadata),
|
|
34510
34543
|
deletedAt: int(row2.deleted_at),
|
|
34544
|
+
...callOf(database, row2),
|
|
34511
34545
|
createdAt: Number(row2.created_at),
|
|
34512
34546
|
updatedAt: Number(row2.updated_at)
|
|
34513
34547
|
}), "meetingOf");
|
|
@@ -34539,7 +34573,7 @@ var transcriptRowOf = /* @__PURE__ */ __name((row2) => ({
|
|
|
34539
34573
|
createdAt: Number(row2.created_at)
|
|
34540
34574
|
}), "transcriptRowOf");
|
|
34541
34575
|
|
|
34542
|
-
// 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
|
|
34543
34577
|
var MEETING_TEXT = ["external_id", "title", "description", "location", "join_url", "timezone", "metadata"];
|
|
34544
34578
|
var TRANSCRIPT_TEXT = ["source", "format", "language", "content_hash", "metadata"];
|
|
34545
34579
|
var ROW_TEXT = ["speaker_name", "text", "normalized_text", "metadata"];
|
|
@@ -34581,7 +34615,7 @@ var parent = /* @__PURE__ */ __name((database, input, budget, load) => {
|
|
|
34581
34615
|
input.signal?.throwIfAborted();
|
|
34582
34616
|
return {
|
|
34583
34617
|
bytes: bytes3,
|
|
34584
|
-
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
|
|
34585
34619
|
};
|
|
34586
34620
|
}, "parent");
|
|
34587
34621
|
var revision = /* @__PURE__ */ __name((database, input, budget, load) => {
|
|
@@ -34706,7 +34740,7 @@ var meetingReadsOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
|
34706
34740
|
}
|
|
34707
34741
|
}), "meetingReadsOver");
|
|
34708
34742
|
|
|
34709
|
-
// 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
|
|
34710
34744
|
var meetingSelectionSql = /* @__PURE__ */ __name((input) => {
|
|
34711
34745
|
const clauses = ["m.account_id=?", "m.deleted_at IS NULL"];
|
|
34712
34746
|
const params = [input.accountId];
|
|
@@ -34749,7 +34783,7 @@ var meetingSelectionSql = /* @__PURE__ */ __name((input) => {
|
|
|
34749
34783
|
return { clauses, params };
|
|
34750
34784
|
}, "meetingSelectionSql");
|
|
34751
34785
|
|
|
34752
|
-
// 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
|
|
34753
34787
|
var MOST_CALLS = 2e5;
|
|
34754
34788
|
var parsed3 = /* @__PURE__ */ __name((value) => {
|
|
34755
34789
|
if (typeof value !== "string")
|
|
@@ -34804,7 +34838,7 @@ var meetingCallsOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
|
34804
34838
|
}
|
|
34805
34839
|
}), "meetingCallsOver");
|
|
34806
34840
|
|
|
34807
|
-
// 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
|
|
34808
34842
|
var meetingChatLinesOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
34809
34843
|
async meetingChatLines(input) {
|
|
34810
34844
|
checkMeetingCancelled(input.signal);
|
|
@@ -34832,7 +34866,7 @@ var meetingChatLinesOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
|
34832
34866
|
}
|
|
34833
34867
|
}), "meetingChatLinesOver");
|
|
34834
34868
|
|
|
34835
|
-
// 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
|
|
34836
34870
|
var missing2 = /* @__PURE__ */ __name(() => {
|
|
34837
34871
|
throw new CliError("not_found", "Meeting, participant or selected target not found");
|
|
34838
34872
|
}, "missing");
|
|
@@ -34955,7 +34989,7 @@ function meetingContextLinksOver(context) {
|
|
|
34955
34989
|
}
|
|
34956
34990
|
__name(meetingContextLinksOver, "meetingContextLinksOver");
|
|
34957
34991
|
|
|
34958
|
-
// 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
|
|
34959
34993
|
var TRANSCRIPT_ROLE = "transcript";
|
|
34960
34994
|
var roleOf3 = /* @__PURE__ */ __name((value) => MEETING_DOCUMENT_ROLES.find((role) => role === value), "roleOf");
|
|
34961
34995
|
var attach = /* @__PURE__ */ __name((database, meetingId, fileId, role, metadata3, listed, now2) => {
|
|
@@ -35029,7 +35063,7 @@ var meetingTranscriptDocumentsOver = /* @__PURE__ */ __name(({ database }) => {
|
|
|
35029
35063
|
};
|
|
35030
35064
|
}, "meetingTranscriptDocumentsOver");
|
|
35031
35065
|
|
|
35032
|
-
// 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
|
|
35033
35067
|
var INDEX_CODES = { meeting_transcript_row: 1, meeting_chat_message: 2, meeting_summary: 3 };
|
|
35034
35068
|
var meetingRowid = /* @__PURE__ */ __name((type, id2) => id2 * 4 + INDEX_CODES[type], "meetingRowid");
|
|
35035
35069
|
var summaryOf2 = /* @__PURE__ */ __name((row2) => ({
|
|
@@ -35058,7 +35092,7 @@ var indexedText = /* @__PURE__ */ __name((database, type, id2) => {
|
|
|
35058
35092
|
return row2 ? summaryText(summaryOf2(row2)) : null;
|
|
35059
35093
|
}, "indexedText");
|
|
35060
35094
|
|
|
35061
|
-
// 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
|
|
35062
35096
|
var summaryBytes = ["title", "overview", "sections", "next_steps", "content"].map((key2) => `coalesce(length(CAST(s.${key2} AS BLOB)),0)`).join("+");
|
|
35063
35097
|
var meetingCurrentIndexRows = `
|
|
35064
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
|
|
@@ -35089,7 +35123,7 @@ var invalidateMeetingStems = /* @__PURE__ */ __name((database, type, id2) => {
|
|
|
35089
35123
|
}, "invalidateMeetingStems");
|
|
35090
35124
|
var meetingStemmableText = /* @__PURE__ */ __name((text8) => text8.replace(/[\p{L}\p{N}\p{M}\p{Co}]+/gu, (token) => token.length <= 1024 ? token : ""), "meetingStemmableText");
|
|
35091
35125
|
|
|
35092
|
-
// 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
|
|
35093
35127
|
function meetingHitIndexOver({ database, now: now2 }) {
|
|
35094
35128
|
return {
|
|
35095
35129
|
async indexSearch(original) {
|
|
@@ -35157,10 +35191,10 @@ function meetingHitIndexOver({ database, now: now2 }) {
|
|
|
35157
35191
|
}
|
|
35158
35192
|
__name(meetingHitIndexOver, "meetingHitIndexOver");
|
|
35159
35193
|
|
|
35160
|
-
// 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
|
|
35161
35195
|
import { createHash as createHash5 } from "node:crypto";
|
|
35162
35196
|
|
|
35163
|
-
// 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
|
|
35164
35198
|
var SHORTEST_CORRECTION = 3;
|
|
35165
35199
|
var maxEdits = /* @__PURE__ */ __name((word2) => word2.length <= 4 ? 1 : 2, "maxEdits");
|
|
35166
35200
|
var editDistance = /* @__PURE__ */ __name((a, b, max) => {
|
|
@@ -35207,7 +35241,7 @@ var correctWords = /* @__PURE__ */ __name(async (vocabulary, words4) => {
|
|
|
35207
35241
|
return corrections;
|
|
35208
35242
|
}, "correctWords");
|
|
35209
35243
|
|
|
35210
|
-
// 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
|
|
35211
35245
|
var SHORTEST_GARBLED = 4;
|
|
35212
35246
|
var MOST_WIDENED = 64;
|
|
35213
35247
|
var plain = /* @__PURE__ */ __name((word2) => word2.replaceAll("\u044D", "\u0435"), "plain");
|
|
@@ -35299,7 +35333,7 @@ var widenWords = /* @__PURE__ */ __name((probes, vocabulary, stem, known2) => {
|
|
|
35299
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));
|
|
35300
35334
|
}, "widenWords");
|
|
35301
35335
|
|
|
35302
|
-
// 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
|
|
35303
35337
|
import { readFileSync } from "node:fs";
|
|
35304
35338
|
var loaded;
|
|
35305
35339
|
var dictionary = /* @__PURE__ */ __name(() => {
|
|
@@ -35358,7 +35392,7 @@ var knownRussianWord = /* @__PURE__ */ __name((word2) => {
|
|
|
35358
35392
|
return false;
|
|
35359
35393
|
}, "knownRussianWord");
|
|
35360
35394
|
|
|
35361
|
-
// 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
|
|
35362
35396
|
var WORD2 = /[\p{L}\p{N}\p{M}]+/gu;
|
|
35363
35397
|
var MOST_WORDS = 128;
|
|
35364
35398
|
var quote = /* @__PURE__ */ __name((word2) => `"${word2.replaceAll('"', '""')}"`, "quote");
|
|
@@ -35614,7 +35648,7 @@ var matchedMeetingWords = /* @__PURE__ */ __name((tree, text8, stemmer2) => {
|
|
|
35614
35648
|
return [...found2];
|
|
35615
35649
|
}, "matchedMeetingWords");
|
|
35616
35650
|
|
|
35617
|
-
// 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
|
|
35618
35652
|
var fail = /* @__PURE__ */ __name((message3) => {
|
|
35619
35653
|
throw new CliError("validation_error", message3);
|
|
35620
35654
|
}, "fail");
|
|
@@ -35798,7 +35832,7 @@ function meetingHitSearchOver({ database }) {
|
|
|
35798
35832
|
}
|
|
35799
35833
|
__name(meetingHitSearchOver, "meetingHitSearchOver");
|
|
35800
35834
|
|
|
35801
|
-
// 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
|
|
35802
35836
|
var meetingLanguagesOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
35803
35837
|
async fillTranscriptLanguages({ accountId, apply, now: now2 }) {
|
|
35804
35838
|
positiveReadInteger(accountId, "accountId");
|
|
@@ -35830,7 +35864,7 @@ var meetingLanguagesOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
|
35830
35864
|
}
|
|
35831
35865
|
}), "meetingLanguagesOver");
|
|
35832
35866
|
|
|
35833
|
-
// 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
|
|
35834
35868
|
import { createHash as createHash6 } from "node:crypto";
|
|
35835
35869
|
var cursorOf2 = /* @__PURE__ */ __name((value, key2) => {
|
|
35836
35870
|
if (value === void 0)
|
|
@@ -35923,7 +35957,7 @@ var meetingParticipantSearchOver = /* @__PURE__ */ __name((context) => ({
|
|
|
35923
35957
|
}
|
|
35924
35958
|
}), "meetingParticipantSearchOver");
|
|
35925
35959
|
|
|
35926
|
-
// 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
|
|
35927
35961
|
var preparationQueries = {
|
|
35928
35962
|
participants: {
|
|
35929
35963
|
fields: "p.id, p.identity_id, p.display_name, l.person_id",
|
|
@@ -35973,7 +36007,7 @@ var preparationQueries = {
|
|
|
35973
36007
|
}
|
|
35974
36008
|
};
|
|
35975
36009
|
|
|
35976
|
-
// 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
|
|
35977
36011
|
var meetingPreparationContextOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
35978
36012
|
async preparationContext(original) {
|
|
35979
36013
|
const input = validateMeetingPreparationContext(original);
|
|
@@ -36014,7 +36048,7 @@ var meetingPreparationContextOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
|
36014
36048
|
}
|
|
36015
36049
|
}), "meetingPreparationContextOver");
|
|
36016
36050
|
|
|
36017
|
-
// 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
|
|
36018
36052
|
var preparationSubjects = /* @__PURE__ */ __name((anchors) => `WITH anchors AS (
|
|
36019
36053
|
SELECT m.id FROM meetings m JOIN meeting_series s ON s.id=m.meeting_series_id
|
|
36020
36054
|
WHERE m.id IN (${Array.from({ length: anchors }, () => "?").join(",")}) AND m.account_id=? AND s.account_id=?
|
|
@@ -36028,7 +36062,7 @@ var preparationSubjects = /* @__PURE__ */ __name((anchors) => `WITH anchors AS (
|
|
|
36028
36062
|
JOIN main.projects p ON p.id=l.to_id WHERE p.account_id IS NULL AND p.deleted_at IS NULL
|
|
36029
36063
|
)`, "preparationSubjects");
|
|
36030
36064
|
|
|
36031
|
-
// 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
|
|
36032
36066
|
var meetingPreparationKnowledgeOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
36033
36067
|
async preparationKnowledge(original) {
|
|
36034
36068
|
const { accountId, seriesId, anchorIds, after: after2, before: before2, limit, maxReadBytes, signal } = validateMeetingRelatedHistory(original);
|
|
@@ -36073,7 +36107,7 @@ var meetingPreparationKnowledgeOver = /* @__PURE__ */ __name(({ database }) => (
|
|
|
36073
36107
|
}
|
|
36074
36108
|
}), "meetingPreparationKnowledgeOver");
|
|
36075
36109
|
|
|
36076
|
-
// 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
|
|
36077
36111
|
var meetingPreparationNotesOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
36078
36112
|
async preparationNotes(original) {
|
|
36079
36113
|
const { accountId, seriesId, anchorIds, after: after2, before: before2, limit, maxReadBytes, signal } = validateMeetingRelatedHistory(original);
|
|
@@ -36126,7 +36160,7 @@ var meetingPreparationNotesOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
|
36126
36160
|
}
|
|
36127
36161
|
}), "meetingPreparationNotesOver");
|
|
36128
36162
|
|
|
36129
|
-
// 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
|
|
36130
36164
|
var meetingRelatedHistoryOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
36131
36165
|
async relatedHistory(original) {
|
|
36132
36166
|
const input = validateMeetingRelatedHistory(original);
|
|
@@ -36197,7 +36231,7 @@ var meetingRelatedHistoryOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
|
36197
36231
|
}
|
|
36198
36232
|
}), "meetingRelatedHistoryOver");
|
|
36199
36233
|
|
|
36200
|
-
// 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
|
|
36201
36235
|
var number2 = /* @__PURE__ */ __name((value) => value === null || value === void 0 ? null : Number(value), "number");
|
|
36202
36236
|
var text4 = /* @__PURE__ */ __name((value) => value === null || value === void 0 ? null : String(value), "text");
|
|
36203
36237
|
var meetingReviewOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
@@ -36278,7 +36312,7 @@ var meetingReviewOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
|
36278
36312
|
}
|
|
36279
36313
|
}), "meetingReviewOver");
|
|
36280
36314
|
|
|
36281
|
-
// 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
|
|
36282
36316
|
var bytes2 = "length(CAST(external_id AS BLOB)) + coalesce(length(CAST(title AS BLOB)), 0)";
|
|
36283
36317
|
var ensureBytes2 = /* @__PURE__ */ __name((size2, budget) => {
|
|
36284
36318
|
if (!Number.isSafeInteger(size2) || size2 < 0 || size2 > budget)
|
|
@@ -36332,7 +36366,7 @@ var meetingSeriesHistoryOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
|
36332
36366
|
}
|
|
36333
36367
|
}), "meetingSeriesHistoryOver");
|
|
36334
36368
|
|
|
36335
|
-
// 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
|
|
36336
36370
|
var MOST_ROWS = 5e5;
|
|
36337
36371
|
var meetingCountsSql = /* @__PURE__ */ __name((where) => `SELECT m.started_at, coalesce(m.duration_ms, m.ended_at - m.started_at) AS duration_ms,
|
|
36338
36372
|
EXISTS (SELECT 1 FROM meeting_transcripts t WHERE t.meeting_id = m.id AND t.deleted_at IS NULL
|
|
@@ -36401,7 +36435,7 @@ var meetingStatsOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
|
36401
36435
|
}
|
|
36402
36436
|
}), "meetingStatsOver");
|
|
36403
36437
|
|
|
36404
|
-
// 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
|
|
36405
36439
|
var CYRILLIC_TO_LATIN = {
|
|
36406
36440
|
\u0430: "a",
|
|
36407
36441
|
\u0431: "b",
|
|
@@ -36623,7 +36657,7 @@ for (const [full, short] of Object.entries(SHORT_FORMS))
|
|
|
36623
36657
|
}
|
|
36624
36658
|
var fullNames = /* @__PURE__ */ __name((skeleton) => [skeleton, ...FULL_NAMES.get(skeleton) ?? []], "fullNames");
|
|
36625
36659
|
|
|
36626
|
-
// 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
|
|
36627
36661
|
var peopleByNameKey = /* @__PURE__ */ __name((database) => {
|
|
36628
36662
|
const found2 = /* @__PURE__ */ new Map();
|
|
36629
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()) {
|
|
@@ -36739,7 +36773,7 @@ function* sharedTraces(database, a, b, name, except) {
|
|
|
36739
36773
|
}
|
|
36740
36774
|
__name(sharedTraces, "sharedTraces");
|
|
36741
36775
|
|
|
36742
|
-
// 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
|
|
36743
36777
|
var spellingsOf = /* @__PURE__ */ __name((value) => [value, value.slice(1)], "spellingsOf");
|
|
36744
36778
|
var PERSON_BY = {
|
|
36745
36779
|
// UNION, not OR: each branch reads its own index.
|
|
@@ -36762,7 +36796,7 @@ var personsByIdentifiers = /* @__PURE__ */ __name((database, ids3) => {
|
|
|
36762
36796
|
return [...found2].sort((a, b) => a - b);
|
|
36763
36797
|
}, "personsByIdentifiers");
|
|
36764
36798
|
|
|
36765
|
-
// 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
|
|
36766
36800
|
var BY = "rule";
|
|
36767
36801
|
var RULE = { bot: "rule", kind: "rule" };
|
|
36768
36802
|
var MOST_SHARING = 6;
|
|
@@ -37209,7 +37243,7 @@ var linkPhones = /* @__PURE__ */ __name((context, identities2) => {
|
|
|
37209
37243
|
return pass.result;
|
|
37210
37244
|
}, "linkPhones");
|
|
37211
37245
|
|
|
37212
|
-
// 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
|
|
37213
37247
|
var CURSOR_KEY = "meetings";
|
|
37214
37248
|
var seriesOf2 = /* @__PURE__ */ __name((row2) => ({
|
|
37215
37249
|
id: Number(row2.id),
|
|
@@ -37287,7 +37321,7 @@ var details = /* @__PURE__ */ __name((database, id2) => {
|
|
|
37287
37321
|
const row2 = database.prepare("SELECT * FROM meetings WHERE id = ?").get(id2);
|
|
37288
37322
|
if (!row2)
|
|
37289
37323
|
return null;
|
|
37290
|
-
const meeting = meetingOf(row2);
|
|
37324
|
+
const meeting = meetingOf(database, row2);
|
|
37291
37325
|
const series = meeting.meetingSeriesId === null ? null : seriesOf2(database.prepare("SELECT * FROM meeting_series WHERE id = ?").get(meeting.meetingSeriesId));
|
|
37292
37326
|
const rowsOf2 = database.prepare("SELECT * FROM meeting_transcript_rows WHERE meeting_transcript_id = ? ORDER BY position");
|
|
37293
37327
|
return {
|
|
@@ -37368,6 +37402,11 @@ var fillGap = /* @__PURE__ */ __name((context, input, meetingId) => {
|
|
|
37368
37402
|
saveTranscripts(database, meetingId, input.transcripts, (position2) => position2 === null ? null : participantIds[position2] ?? null, input.now);
|
|
37369
37403
|
return meetingId;
|
|
37370
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");
|
|
37371
37410
|
var save = /* @__PURE__ */ __name((context, input) => {
|
|
37372
37411
|
const { database } = context;
|
|
37373
37412
|
const { meeting: { series: seriesInput, ...meeting }, now: now2 } = input;
|
|
@@ -37414,7 +37453,9 @@ var save = /* @__PURE__ */ __name((context, input) => {
|
|
|
37414
37453
|
host_identity_id: meeting.hostIdentityId,
|
|
37415
37454
|
...meeting.participantsCount === void 0 ? {} : { participants_count: meeting.participantsCount },
|
|
37416
37455
|
metadata: toJson(meeting.metadata),
|
|
37417
|
-
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 }
|
|
37418
37459
|
}, now2);
|
|
37419
37460
|
const participantIds = (input.participants ?? []).map(({ identity, ...p }) => upsert(database, "meeting_participants", {
|
|
37420
37461
|
meeting_id: meetingId,
|
|
@@ -37756,7 +37797,7 @@ var meetingStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
37756
37797
|
},
|
|
37757
37798
|
async meetings(filter) {
|
|
37758
37799
|
const { sql: sql2, params } = filtered(filter);
|
|
37759
|
-
return database.prepare(sql2).all(...params).map(meetingOf);
|
|
37800
|
+
return database.prepare(sql2).all(...params).map((row2) => meetingOf(database, row2));
|
|
37760
37801
|
},
|
|
37761
37802
|
async account(id2) {
|
|
37762
37803
|
const row2 = database.prepare("SELECT provider, external_id FROM accounts WHERE id = ?").get(id2);
|
|
@@ -37809,7 +37850,7 @@ var meetingStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
37809
37850
|
};
|
|
37810
37851
|
}, "meetingStoreOver");
|
|
37811
37852
|
|
|
37812
|
-
// 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
|
|
37813
37854
|
var syncStateOf = /* @__PURE__ */ __name(({ orm }, accountKey, name) => {
|
|
37814
37855
|
const row2 = orm.select({ value: syncCursors.value, at: syncCursors.updatedAt }).from(syncCursors).where(and(eq(syncCursors.accountId, accountKey), eq(syncCursors.key, name))).get();
|
|
37815
37856
|
return row2 ? { value: row2.value, at: toIso(row2.at) } : void 0;
|
|
@@ -37835,7 +37876,7 @@ var release = /* @__PURE__ */ __name(({ orm }, chatKey, anchor, holder2) => {
|
|
|
37835
37876
|
orm.delete(fetchLeases).where(and(eq(fetchLeases.chatId, chatKey), eq(fetchLeases.anchor, anchor), eq(fetchLeases.holder, holder2))).run();
|
|
37836
37877
|
}, "release");
|
|
37837
37878
|
|
|
37838
|
-
// 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
|
|
37839
37880
|
var THREAD_COLUMNS = {
|
|
37840
37881
|
subject: {
|
|
37841
37882
|
where: /* @__PURE__ */ __name(({ value }) => ({
|
|
@@ -37852,7 +37893,7 @@ var threadRows = /* @__PURE__ */ __name((database, filter) => {
|
|
|
37852
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);
|
|
37853
37894
|
}, "threadRows");
|
|
37854
37895
|
|
|
37855
|
-
// 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
|
|
37856
37897
|
var threadConversation = /* @__PURE__ */ __name((place, builtAt) => ({
|
|
37857
37898
|
id: `email:${place.emailId}`,
|
|
37858
37899
|
chatId: place.threadExternalId,
|
|
@@ -38394,7 +38435,7 @@ var mailStoreOver = /* @__PURE__ */ __name(({ database, orm, now: now2 }, stemme
|
|
|
38394
38435
|
}
|
|
38395
38436
|
}), "mailStoreOver");
|
|
38396
38437
|
|
|
38397
|
-
// 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
|
|
38398
38439
|
import { readFileSync as readFileSync2 } from "node:fs";
|
|
38399
38440
|
var DICTIONARIES = Object.fromEntries(LANGUAGES.map(({ name, dictionary: dictionary3 }) => [name, dictionary3]));
|
|
38400
38441
|
var folded5 = /* @__PURE__ */ __name((word2) => /^[а-яё'-]*$/.test(word2) ? word2.replaceAll("\u0451", "\u0435").replaceAll("\u0439", "\u0438") : fold(word2), "folded");
|
|
@@ -38484,7 +38525,7 @@ var knownWord = /* @__PURE__ */ __name((languages) => {
|
|
|
38484
38525
|
}, "knownWord");
|
|
38485
38526
|
var dictionaryLanguages = /* @__PURE__ */ __name((stemmers) => [stemmers.cyrillic, ...stemmers.latin.split(",")].filter((name) => Object.hasOwn(DICTIONARIES, name)), "dictionaryLanguages");
|
|
38486
38527
|
|
|
38487
|
-
// 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
|
|
38488
38529
|
var predicates = /* @__PURE__ */ __name((node) => node.kind === "predicate" ? [node] : node.clauses.flatMap(({ node: node2 }) => predicates(node2)), "predicates");
|
|
38489
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");
|
|
38490
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
|
|
@@ -38570,7 +38611,7 @@ var spokenTranscripts = /* @__PURE__ */ __name((database, item, speaking, keys)
|
|
|
38570
38611
|
return found2;
|
|
38571
38612
|
}, "spokenTranscripts");
|
|
38572
38613
|
|
|
38573
|
-
// 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
|
|
38574
38615
|
var startOf = /* @__PURE__ */ __name((node) => node.operator === "wildcard" && node.implicit ? /^([\p{L}\p{N}]+)\*$/u.exec(normalize(node.value))?.[1] : void 0, "startOf");
|
|
38575
38616
|
var matchOf = /* @__PURE__ */ __name((node) => {
|
|
38576
38617
|
const start = startOf(node);
|
|
@@ -38628,7 +38669,7 @@ var placeHits = /* @__PURE__ */ __name((database, corpus, leaves, transcripts, f
|
|
|
38628
38669
|
});
|
|
38629
38670
|
}, "placeHits");
|
|
38630
38671
|
|
|
38631
|
-
// 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
|
|
38632
38673
|
var GROUPS = {
|
|
38633
38674
|
chat: {
|
|
38634
38675
|
key: "m.chat_id",
|
|
@@ -38650,7 +38691,7 @@ var GROUPS = {
|
|
|
38650
38691
|
}
|
|
38651
38692
|
};
|
|
38652
38693
|
|
|
38653
|
-
// 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
|
|
38654
38695
|
var MESSAGES = {
|
|
38655
38696
|
rows: "messages",
|
|
38656
38697
|
threads: "chats",
|
|
@@ -39143,7 +39184,7 @@ var runCompiled = /* @__PURE__ */ __name(async (context, execution, by) => {
|
|
|
39143
39184
|
};
|
|
39144
39185
|
}, "runCompiled");
|
|
39145
39186
|
|
|
39146
|
-
// 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
|
|
39147
39188
|
function invalidMetadata() {
|
|
39148
39189
|
throw new CliError("validation_error", "stored counter metadata is malformed \u2014 check the store before refreshing");
|
|
39149
39190
|
}
|
|
@@ -39245,7 +39286,7 @@ var counterTargets = /* @__PURE__ */ __name((context, execution, options) => wit
|
|
|
39245
39286
|
};
|
|
39246
39287
|
}), "counterTargets");
|
|
39247
39288
|
|
|
39248
|
-
// 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
|
|
39249
39290
|
var NOT_FILE_LIST = [...NOT_FILES].map((kind3) => `'${kind3}'`).join(",");
|
|
39250
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,
|
|
39251
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
|
|
@@ -39364,7 +39405,7 @@ var attachmentViews = /* @__PURE__ */ __name(({ database }, accountKey, { chatKe
|
|
|
39364
39405
|
}));
|
|
39365
39406
|
}, "attachmentViews");
|
|
39366
39407
|
|
|
39367
|
-
// 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
|
|
39368
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");
|
|
39369
39410
|
var keepTranscript = /* @__PURE__ */ __name((context, chatKey, messageId, text8, source2) => {
|
|
39370
39411
|
const { orm, database, now: now2 } = context;
|
|
@@ -39402,7 +39443,7 @@ var intoVoiceAttachment = /* @__PURE__ */ __name((context, messagePk) => {
|
|
|
39402
39443
|
keepText(context, Number(row2.id), { text: String(row2.text), origin: "extracted", extractor: `speech:${row2.source}` });
|
|
39403
39444
|
}, "intoVoiceAttachment");
|
|
39404
39445
|
|
|
39405
|
-
// 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
|
|
39406
39447
|
var FIELDS = [
|
|
39407
39448
|
"threadExternalId",
|
|
39408
39449
|
"senderIdentityId",
|
|
@@ -39726,7 +39767,7 @@ var writeDerivedReactions = /* @__PURE__ */ __name((context, chatKey, messageId)
|
|
|
39726
39767
|
reactionStatementsOf(context.database).total.run(JSON.stringify(derived), chatKey, messageId);
|
|
39727
39768
|
}, "writeDerivedReactions");
|
|
39728
39769
|
|
|
39729
|
-
// 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
|
|
39730
39771
|
var keysOver = /* @__PURE__ */ __name((context) => {
|
|
39731
39772
|
const findAccountPk2 = /* @__PURE__ */ __name((key2) => findAccountPk(context, key2), "findAccountPk");
|
|
39732
39773
|
const findChatPk2 = /* @__PURE__ */ __name((accountKey, chatId) => findChatPk(context, accountKey, chatId), "findChatPk");
|
|
@@ -39747,7 +39788,7 @@ var keysOver = /* @__PURE__ */ __name((context) => {
|
|
|
39747
39788
|
};
|
|
39748
39789
|
}, "keysOver");
|
|
39749
39790
|
|
|
39750
|
-
// 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
|
|
39751
39792
|
var accountGroupsOf = /* @__PURE__ */ __name((database) => {
|
|
39752
39793
|
const row2 = database.prepare("SELECT value FROM store_settings WHERE key = ?").get(ACCOUNT_GROUPS);
|
|
39753
39794
|
if (!row2)
|
|
@@ -39794,7 +39835,7 @@ var forgetProfile = /* @__PURE__ */ __name((database, app, profile, now2) => {
|
|
|
39794
39835
|
database.prepare("INSERT OR REPLACE INTO store_settings (key, value, at) VALUES (?, ?, ?)").run(PROFILES, JSON.stringify(profiles), now2);
|
|
39795
39836
|
}, "forgetProfile");
|
|
39796
39837
|
|
|
39797
|
-
// 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
|
|
39798
39839
|
var DAY4 = 864e5;
|
|
39799
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}')`;
|
|
39800
39841
|
var accountsOf = /* @__PURE__ */ __name((filter) => {
|
|
@@ -39910,7 +39951,7 @@ var listEvents = /* @__PURE__ */ __name((database, filter) => {
|
|
|
39910
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);
|
|
39911
39952
|
}, "listEvents");
|
|
39912
39953
|
|
|
39913
|
-
// 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
|
|
39914
39955
|
var distinctIds = /* @__PURE__ */ __name((rows) => [...new Set(rows.map((row2) => Number(row2.id)))], "distinctIds");
|
|
39915
39956
|
var forgetCalendarRows = /* @__PURE__ */ __name((database, { calendarId, accountId, cursorKey, now: now2 }, refresh) => {
|
|
39916
39957
|
const unseenBefore = unreferenced(database, "identities");
|
|
@@ -39967,7 +40008,7 @@ var forgetCalendarRows = /* @__PURE__ */ __name((database, { calendarId, account
|
|
|
39967
40008
|
return { entries: entryIds.length, events: goneEvents.length };
|
|
39968
40009
|
}, "forgetCalendarRows");
|
|
39969
40010
|
|
|
39970
|
-
// 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
|
|
39971
40012
|
var calendarOf = /* @__PURE__ */ __name((row2) => ({
|
|
39972
40013
|
id: Number(row2.id),
|
|
39973
40014
|
accountId: Number(row2.account_id),
|
|
@@ -40570,7 +40611,7 @@ var eventStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
40570
40611
|
};
|
|
40571
40612
|
}, "eventStoreOver");
|
|
40572
40613
|
|
|
40573
|
-
// 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
|
|
40574
40615
|
var purgeAccount = /* @__PURE__ */ __name((context, accountKey) => {
|
|
40575
40616
|
const { orm, database, now: now2 } = context;
|
|
40576
40617
|
const unseenBefore = unreferenced(database, "identities");
|
|
@@ -40685,7 +40726,7 @@ var purgeCrmCopies = /* @__PURE__ */ __name((database, accountKey) => {
|
|
|
40685
40726
|
run("DELETE FROM pipelines WHERE account_id = ?", accountKey);
|
|
40686
40727
|
}, "purgeCrmCopies");
|
|
40687
40728
|
|
|
40688
|
-
// 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
|
|
40689
40730
|
var ACCOUNT_REASON = "an account you connected, under another name: a mailbox or messenger you read may be someone else's";
|
|
40690
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");
|
|
40691
40732
|
var ownersName = /* @__PURE__ */ __name((name, owner, alone) => {
|
|
@@ -40744,7 +40785,7 @@ var linkToOwner = /* @__PURE__ */ __name((context, ref3) => {
|
|
|
40744
40785
|
return personOf2(context, ref3);
|
|
40745
40786
|
}, "linkToOwner");
|
|
40746
40787
|
|
|
40747
|
-
// 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
|
|
40748
40789
|
var PROVIDERS_SETTING = "providers";
|
|
40749
40790
|
var storedProvidersOf = /* @__PURE__ */ __name((database) => {
|
|
40750
40791
|
const row2 = database.prepare("SELECT value FROM store_settings WHERE key = ?").get(PROVIDERS_SETTING);
|
|
@@ -40792,7 +40833,7 @@ var registerProvider = /* @__PURE__ */ __name((database, value, now2) => {
|
|
|
40792
40833
|
});
|
|
40793
40834
|
}, "registerProvider");
|
|
40794
40835
|
|
|
40795
|
-
// 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
|
|
40796
40837
|
var DAY5 = 864e5;
|
|
40797
40838
|
var RECENTLY_CLOSED_MS = 14 * DAY5;
|
|
40798
40839
|
var TEXT_LIMIT = 20;
|
|
@@ -40990,7 +41031,7 @@ var taskSimilarityOver = /* @__PURE__ */ __name((context) => {
|
|
|
40990
41031
|
};
|
|
40991
41032
|
}, "taskSimilarityOver");
|
|
40992
41033
|
|
|
40993
|
-
// 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
|
|
40994
41035
|
var SETTING3 = "taskCategories";
|
|
40995
41036
|
var savedTaskCategories = /* @__PURE__ */ __name((database) => {
|
|
40996
41037
|
const row2 = database.prepare("SELECT value FROM store_settings WHERE key = ?").get(SETTING3);
|
|
@@ -41009,7 +41050,7 @@ var saveTaskCategories = /* @__PURE__ */ __name((database, categories, now2) =>
|
|
|
41009
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);
|
|
41010
41051
|
}, "saveTaskCategories");
|
|
41011
41052
|
|
|
41012
|
-
// 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
|
|
41013
41054
|
var DEFAULT_AGENT_CLOSE = { allowed: true, min: 0.8 };
|
|
41014
41055
|
var ALLOWED = "taskAgentClose";
|
|
41015
41056
|
var MIN = "taskAgentCloseMin";
|
|
@@ -41065,7 +41106,7 @@ var SUGGESTION_COLUMNS = [
|
|
|
41065
41106
|
];
|
|
41066
41107
|
var CLEAR_SUGGESTION = SUGGESTION_COLUMNS.map((column2) => `${column2} = NULL`).join(", ");
|
|
41067
41108
|
|
|
41068
|
-
// 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
|
|
41069
41110
|
var DEFAULT_FIRST_PASS_PER_CHAT = 0;
|
|
41070
41111
|
var KEY = "taskFirstPassPerChat";
|
|
41071
41112
|
var firstPassPerChatOf = /* @__PURE__ */ __name((value, setting = "task_first_pass_per_chat") => {
|
|
@@ -41085,7 +41126,7 @@ var saveFirstPassPerChat = /* @__PURE__ */ __name((database, value, now2) => {
|
|
|
41085
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);
|
|
41086
41127
|
}, "saveFirstPassPerChat");
|
|
41087
41128
|
|
|
41088
|
-
// 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
|
|
41089
41130
|
var EXTERNAL_SERVICE = /^[a-z][a-z0-9-]{0,31}$/;
|
|
41090
41131
|
var EXTERNAL_ID_CHARS = 200;
|
|
41091
41132
|
var SOURCE_URL_CHARS = 2e3;
|
|
@@ -41112,7 +41153,7 @@ var sourceUrlOf = /* @__PURE__ */ __name((value, reason = "task.source-url") =>
|
|
|
41112
41153
|
return text8;
|
|
41113
41154
|
}, "sourceUrlOf");
|
|
41114
41155
|
|
|
41115
|
-
// 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
|
|
41116
41157
|
var TASK_SORTS = ["priority", "due", "created", "updated", "key", "state"];
|
|
41117
41158
|
var field = /* @__PURE__ */ __name((name, type, example, more = {}) => ({
|
|
41118
41159
|
name,
|
|
@@ -41161,8 +41202,8 @@ var wordsMatch = /* @__PURE__ */ __name((node) => {
|
|
|
41161
41202
|
const words4 = taskWordsOf(node.value.replaceAll("*", " ")).split(/\s+/).filter((word2) => /[\p{L}\p{N}]/u.test(word2));
|
|
41162
41203
|
if (words4.length === 0)
|
|
41163
41204
|
return void 0;
|
|
41164
|
-
const
|
|
41165
|
-
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 ")})`;
|
|
41166
41207
|
}, "wordsMatch");
|
|
41167
41208
|
var projectWhere = /* @__PURE__ */ __name((node) => {
|
|
41168
41209
|
if (node.operator === "wildcard" && node.value === "*")
|
|
@@ -41364,7 +41405,7 @@ var withoutField = /* @__PURE__ */ __name((query, name) => {
|
|
|
41364
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 ?`;
|
|
41365
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");
|
|
41366
41407
|
|
|
41367
|
-
// 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
|
|
41368
41409
|
var authorNamed = /* @__PURE__ */ __name((database, row2) => {
|
|
41369
41410
|
if (row2.author_type == null)
|
|
41370
41411
|
return null;
|
|
@@ -41392,7 +41433,7 @@ var addComment = /* @__PURE__ */ __name((context, task, body2, by) => {
|
|
|
41392
41433
|
return commentsOf(database, task).find((one2) => one2.ref === `note:${made}`);
|
|
41393
41434
|
}, "addComment");
|
|
41394
41435
|
|
|
41395
|
-
// 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
|
|
41396
41437
|
var TASK_RELATION_KINDS = [
|
|
41397
41438
|
"blocked-by",
|
|
41398
41439
|
"follow-up-of",
|
|
@@ -41522,7 +41563,7 @@ var taskRelationsStoreOver = /* @__PURE__ */ __name((context, record3) => {
|
|
|
41522
41563
|
};
|
|
41523
41564
|
}, "taskRelationsStoreOver");
|
|
41524
41565
|
|
|
41525
|
-
// 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
|
|
41526
41567
|
var TASK_ROLES = ["assignee", "reviewer", "watcher"];
|
|
41527
41568
|
var TASK_EVENT_KINDS = [
|
|
41528
41569
|
"created",
|
|
@@ -42081,7 +42122,7 @@ var workTasksOver = /* @__PURE__ */ __name((context) => {
|
|
|
42081
42122
|
};
|
|
42082
42123
|
}, "workTasksOver");
|
|
42083
42124
|
|
|
42084
|
-
// 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
|
|
42085
42126
|
var taskCloseOver = /* @__PURE__ */ __name((context) => {
|
|
42086
42127
|
const { database, now: now2 } = context;
|
|
42087
42128
|
const liveRow = /* @__PURE__ */ __name((id2) => {
|
|
@@ -42130,7 +42171,7 @@ var taskCloseOver = /* @__PURE__ */ __name((context) => {
|
|
|
42130
42171
|
};
|
|
42131
42172
|
}, "taskCloseOver");
|
|
42132
42173
|
|
|
42133
|
-
// 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
|
|
42134
42175
|
var TASK_PAIR_DECISIONS = ["review", "unsure", "merged", "rejected", "unmerged", "attached", "new"];
|
|
42135
42176
|
var taskPairsOver = /* @__PURE__ */ __name((context, similarity) => {
|
|
42136
42177
|
const { database, now: now2 } = context;
|
|
@@ -42349,7 +42390,7 @@ var taskPairsOver = /* @__PURE__ */ __name((context, similarity) => {
|
|
|
42349
42390
|
};
|
|
42350
42391
|
}, "taskPairsOver");
|
|
42351
42392
|
|
|
42352
|
-
// 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
|
|
42353
42394
|
var ACCOUNT_SCOPE = "t.package_id IS NOT NULL AND t.deleted_at IS NULL AND t.project_id = ?";
|
|
42354
42395
|
var TASK_STATS_SQL = {
|
|
42355
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"),
|
|
@@ -42388,7 +42429,7 @@ var taskStatsOver = /* @__PURE__ */ __name(({ database }, inbox) => ({
|
|
|
42388
42429
|
}, "statNames")
|
|
42389
42430
|
}), "taskStatsOver");
|
|
42390
42431
|
|
|
42391
|
-
// 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
|
|
42392
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";
|
|
42393
42434
|
var inboxProject = /* @__PURE__ */ __name(({ database, now: now2 }, account, create) => {
|
|
42394
42435
|
const key2 = inboxKey(account);
|
|
@@ -42604,7 +42645,7 @@ var oneOf4 = /* @__PURE__ */ __name((values, value, column2) => {
|
|
|
42604
42645
|
throw new CliError("configuration_error", `the store holds a task with an unknown ${column2} "${String(value)}"`);
|
|
42605
42646
|
}, "oneOf");
|
|
42606
42647
|
|
|
42607
|
-
// 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
|
|
42608
42649
|
var accountAccountsOver = /* @__PURE__ */ __name((context) => {
|
|
42609
42650
|
const { database } = context;
|
|
42610
42651
|
const { accountPk: accountPk2, findAccountPk: findAccountPk2 } = keysOver(context);
|
|
@@ -42674,7 +42715,7 @@ var accountsStoreOver = /* @__PURE__ */ __name((context, keyed) => {
|
|
|
42674
42715
|
};
|
|
42675
42716
|
}, "accountsStoreOver");
|
|
42676
42717
|
|
|
42677
|
-
// 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
|
|
42678
42719
|
var refColumn = /* @__PURE__ */ __name((ref3) => ref3 && Object.keys(ref3).length > 0 ? { providerRef: JSON.stringify(ref3) } : {}, "refColumn");
|
|
42679
42720
|
var updatePlaced = /* @__PURE__ */ __name(({ orm }, chatKey, messageId, files2, change) => {
|
|
42680
42721
|
const message3 = orm.select({ pk: messages.id }).from(messages).where(and(eq(messages.chatId, chatKey), eq(messages.externalId, messageId))).get();
|
|
@@ -42698,7 +42739,7 @@ var keepDownloads = /* @__PURE__ */ __name((context, chatKey, messageId, files2)
|
|
|
42698
42739
|
})), "keepDownloads");
|
|
42699
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");
|
|
42700
42741
|
|
|
42701
|
-
// 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
|
|
42702
42743
|
var accountAttachmentsOver = /* @__PURE__ */ __name((context) => {
|
|
42703
42744
|
const { database } = context;
|
|
42704
42745
|
const { findAccountPk: findAccountPk2, findChatPk: findChatPk2, chatKeyOf } = keysOver(context);
|
|
@@ -42755,7 +42796,7 @@ var attachmentsStoreOver = /* @__PURE__ */ __name((context, keyed) => ({
|
|
|
42755
42796
|
}, "keepAttachmentText")
|
|
42756
42797
|
}), "attachmentsStoreOver");
|
|
42757
42798
|
|
|
42758
|
-
// 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
|
|
42759
42800
|
var chatRow = /* @__PURE__ */ __name((context, accountKey, chatId) => context.database.prepare("SELECT * FROM chats WHERE account_id = ? AND external_id = ?").get(accountKey, chatId), "chatRow");
|
|
42760
42801
|
var pointerMover = /* @__PURE__ */ __name((context, type) => {
|
|
42761
42802
|
const statements = pointerPairs(context.database).filter(({ table }) => table !== "involvements").map(({ table, pointer }) => {
|
|
@@ -42940,7 +42981,7 @@ var rekeyChats = /* @__PURE__ */ __name((context, key2, accountKey, pairs, lockM
|
|
|
42940
42981
|
return done;
|
|
42941
42982
|
}, "rekeyChats");
|
|
42942
42983
|
|
|
42943
|
-
// 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
|
|
42944
42985
|
var historyStartKey = /* @__PURE__ */ __name((chatId) => `history_start:${chatId}`, "historyStartKey");
|
|
42945
42986
|
var fetchedKey = /* @__PURE__ */ __name((chatId) => `fetched:${chatId}`, "fetchedKey");
|
|
42946
42987
|
var CHAT_LIST_KEY = "chat_list_complete";
|
|
@@ -42998,7 +43039,7 @@ var chatCoverage = /* @__PURE__ */ __name(({ database }, accountKey) => {
|
|
|
42998
43039
|
return { ...coverage, oldestMessageAt: toIso(oldest) };
|
|
42999
43040
|
}, "chatCoverage");
|
|
43000
43041
|
|
|
43001
|
-
// 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
|
|
43002
43043
|
var chatsStoreOver = /* @__PURE__ */ __name((context) => {
|
|
43003
43044
|
const { database } = context;
|
|
43004
43045
|
const { accountPk: accountPk2, findAccountPk: findAccountPk2, writeState: writeState2 } = keysOver(context);
|
|
@@ -43147,7 +43188,7 @@ var chatsStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
43147
43188
|
};
|
|
43148
43189
|
}, "chatsStoreOver");
|
|
43149
43190
|
|
|
43150
|
-
// 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
|
|
43151
43192
|
import { createHash as createHash7 } from "node:crypto";
|
|
43152
43193
|
var BATCH_CONTEXT = 50;
|
|
43153
43194
|
var replied = /* @__PURE__ */ __name((m) => sql`EXISTS (SELECT 1 FROM messages p WHERE p.chat_id = ${m}.chat_id
|
|
@@ -43285,7 +43326,7 @@ var saveAnswers = /* @__PURE__ */ __name((context, id2, answer) => {
|
|
|
43285
43326
|
var clearAnswers = /* @__PURE__ */ __name(({ orm }, chatKey, model) => Number(orm.all(sql`DELETE FROM message_links WHERE chat_id = ${chatKey} AND source = 'agent'
|
|
43286
43327
|
${model === void 0 ? sql`` : sql`AND method = ${model}`} RETURNING 1 AS n`).length), "clearAnswers");
|
|
43287
43328
|
|
|
43288
|
-
// 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
|
|
43289
43330
|
import { setTimeout } from "node:timers/promises";
|
|
43290
43331
|
var position = /* @__PURE__ */ __name((sentAt, pk) => `${sentAt}:${pk}`, "position");
|
|
43291
43332
|
var linkInputs = /* @__PURE__ */ __name(({ orm }, chatKey, { after: after2, limit }) => {
|
|
@@ -43597,7 +43638,7 @@ var agentAnswers = /* @__PURE__ */ __name(({ orm }, chatKey) => new Map(orm.all(
|
|
|
43597
43638
|
AND NOT EXISTS (SELECT 1 FROM messages d
|
|
43598
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");
|
|
43599
43640
|
|
|
43600
|
-
// 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
|
|
43601
43642
|
var conversationsStoreOver = /* @__PURE__ */ __name((context) => {
|
|
43602
43643
|
const { database } = context;
|
|
43603
43644
|
const { findAccountPk: findAccountPk2, findChatPk: findChatPk2, chatKeyOf } = keysOver(context);
|
|
@@ -43704,7 +43745,7 @@ var conversationsStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
43704
43745
|
};
|
|
43705
43746
|
}, "conversationsStoreOver");
|
|
43706
43747
|
|
|
43707
|
-
// 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
|
|
43708
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";
|
|
43709
43750
|
var accountCountersOver = /* @__PURE__ */ __name((context) => {
|
|
43710
43751
|
const { database } = context;
|
|
@@ -43729,7 +43770,7 @@ var countersStoreOver = /* @__PURE__ */ __name((context, keyed) => ({
|
|
|
43729
43770
|
counterTargets: /* @__PURE__ */ __name(async (execution, options) => counterTargets(context, execution, options), "counterTargets")
|
|
43730
43771
|
}), "countersStoreOver");
|
|
43731
43772
|
|
|
43732
|
-
// 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
|
|
43733
43774
|
var MENTION_STATUSES = ["found", "linked", "proposed", "dismissed"];
|
|
43734
43775
|
var MENTION_QUERY = defineQuery({
|
|
43735
43776
|
entity: "mention",
|
|
@@ -43948,7 +43989,7 @@ var listPlaces = /* @__PURE__ */ __name((database, { limit, offset }) => {
|
|
|
43948
43989
|
return { items: hasMore ? rows.slice(0, limit) : rows, hasMore };
|
|
43949
43990
|
}, "listPlaces");
|
|
43950
43991
|
|
|
43951
|
-
// 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
|
|
43952
43993
|
var accountMentionsOver = /* @__PURE__ */ __name((context) => {
|
|
43953
43994
|
const { database } = context;
|
|
43954
43995
|
const { findAccountPk: findAccountPk2 } = keysOver(context);
|
|
@@ -43983,7 +44024,7 @@ var mentionsStoreOver = /* @__PURE__ */ __name((context, keyed) => ({
|
|
|
43983
44024
|
places: /* @__PURE__ */ __name(async (window) => listPlaces(context.database, window), "places")
|
|
43984
44025
|
}), "mentionsStoreOver");
|
|
43985
44026
|
|
|
43986
|
-
// 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
|
|
43987
44028
|
var FAR = Number.MAX_SAFE_INTEGER;
|
|
43988
44029
|
var MUTED_NOW = "(coalesce(c.muted,0)=1 AND (c.muted_until IS NULL OR c.muted_until>?))";
|
|
43989
44030
|
var chatsIn = /* @__PURE__ */ __name((scope3, kinds2, now2) => {
|
|
@@ -44082,7 +44123,7 @@ var waitingChats = /* @__PURE__ */ __name((context, scope3, waits, cap) => {
|
|
|
44082
44123
|
});
|
|
44083
44124
|
}, "waitingChats");
|
|
44084
44125
|
|
|
44085
|
-
// 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
|
|
44086
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 = ?`;
|
|
44087
44128
|
var chatActivityCounts = /* @__PURE__ */ __name(({ database }, chatKeys, { since, until, now: now2 }) => {
|
|
44088
44129
|
const statement = database.prepare(SQL);
|
|
@@ -44102,7 +44143,7 @@ var chatActivityCounts = /* @__PURE__ */ __name(({ database }, chatKeys, { since
|
|
|
44102
44143
|
return found2;
|
|
44103
44144
|
}, "chatActivityCounts");
|
|
44104
44145
|
|
|
44105
|
-
// 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
|
|
44106
44147
|
var documentLinkMessages = /* @__PURE__ */ __name(({ database }, chatKey, messageId) => {
|
|
44107
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");
|
|
44108
44149
|
const rows = messageId === void 0 ? read2.all(chatKey) : read2.all(chatKey, messageId);
|
|
@@ -44117,7 +44158,7 @@ var documentLinkMessages = /* @__PURE__ */ __name(({ database }, chatKey, messag
|
|
|
44117
44158
|
}));
|
|
44118
44159
|
}, "documentLinkMessages");
|
|
44119
44160
|
|
|
44120
|
-
// 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
|
|
44121
44162
|
var stemmerFor = stemmerCache();
|
|
44122
44163
|
var laterSharingRare = /* @__PURE__ */ __name((context, wanted, { rareAt, limit }) => {
|
|
44123
44164
|
if (wanted.length > 50 || !Number.isInteger(limit) || limit < 1 || limit > 100)
|
|
@@ -44161,7 +44202,7 @@ var laterSharingRare = /* @__PURE__ */ __name((context, wanted, { rareAt, limit
|
|
|
44161
44202
|
});
|
|
44162
44203
|
}, "laterSharingRare");
|
|
44163
44204
|
|
|
44164
|
-
// 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
|
|
44165
44206
|
var accountMessagesOver = /* @__PURE__ */ __name((context) => {
|
|
44166
44207
|
const { database } = context;
|
|
44167
44208
|
const { accountPk: accountPk2, findAccountPk: findAccountPk2, findChatPk: findChatPk2, chatKeyOf, chatPkFor: chatPkFor2, answeredChatPk: answeredChatPk2, upsertMessage: upsertMessage2 } = keysOver(context);
|
|
@@ -44302,7 +44343,151 @@ var messagesStoreOver = /* @__PURE__ */ __name((context, keyed) => ({
|
|
|
44302
44343
|
laterSharingRare: /* @__PURE__ */ __name(async (wanted, options) => laterSharingRare(context, wanted, options), "laterSharingRare")
|
|
44303
44344
|
}), "messagesStoreOver");
|
|
44304
44345
|
|
|
44305
|
-
// 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
|
|
44306
44491
|
var PERSON_KINDS = ["person", "organization", "automated", "stranger", "unsorted", "test"];
|
|
44307
44492
|
var AUTOMATED_WORDS = /* @__PURE__ */ new Set([
|
|
44308
44493
|
"noreply",
|
|
@@ -44365,12 +44550,12 @@ var isCompanyName = /* @__PURE__ */ __name((name) => {
|
|
|
44365
44550
|
return wordsOf3(name.replaceAll(".", "")).some((word2) => LEGAL_FORMS.has(word2) || COMPANY_WORDS.has(word2));
|
|
44366
44551
|
}, "isCompanyName");
|
|
44367
44552
|
|
|
44368
|
-
// 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
|
|
44369
44554
|
var SMALL_GROUP_MEMBERS = 10;
|
|
44370
44555
|
var PERSON_TIES = ["chat", "small-group", "mail", "meeting", "crm", "phone-book"];
|
|
44371
44556
|
var ALWAYS_SHOWN = ["owner", "added", "task"];
|
|
44372
44557
|
var crmProviders = /* @__PURE__ */ __name(() => providers().filter((entry2) => kindsOfEntry(entry2).includes("crm")).map(({ name }) => name), "crmProviders");
|
|
44373
|
-
var
|
|
44558
|
+
var quoted3 = /* @__PURE__ */ __name((value) => `'${value.replaceAll("'", "''")}'`, "quoted");
|
|
44374
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))";
|
|
44375
44560
|
var chatPeople = /* @__PURE__ */ __name((where, few) => {
|
|
44376
44561
|
const members2 = `SELECT m.identity_id FROM chats c JOIN chat_members m ON m.chat_id = c.id WHERE ${where}`;
|
|
@@ -44383,7 +44568,7 @@ var OWNERS_CRM_PEOPLE = "SELECT id FROM persons WHERE owner = 1 UNION SELECT e.f
|
|
|
44383
44568
|
var crmTie = /* @__PURE__ */ __name((crm) => {
|
|
44384
44569
|
if (crm.length === 0)
|
|
44385
44570
|
return "SELECT NULL WHERE 0";
|
|
44386
|
-
const providers2 = crm.map(
|
|
44571
|
+
const providers2 = crm.map(quoted3).join(", ");
|
|
44387
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})`;
|
|
44388
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")}`;
|
|
44389
44574
|
}, "crmTie");
|
|
@@ -44420,7 +44605,7 @@ var shownReasons = /* @__PURE__ */ __name((database, people2) => {
|
|
|
44420
44605
|
return new Map([...found2].map(([person2, reasons]) => [person2, ORDER.filter((one2) => reasons.has(one2))]));
|
|
44421
44606
|
}, "shownReasons");
|
|
44422
44607
|
|
|
44423
|
-
// 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
|
|
44424
44609
|
var PEOPLE_SORTS = ["interactions", "recent", "name", "tasks"];
|
|
44425
44610
|
var MIN_QUERY = 3;
|
|
44426
44611
|
var matching2 = /* @__PURE__ */ __name((query) => {
|
|
@@ -44765,7 +44950,7 @@ var similarPeople = /* @__PURE__ */ __name((database, typed, limit) => {
|
|
|
44765
44950
|
return withLastContact(database, rows).map((person2, at2) => ({ ...person2, sameName: same[at2] === true }));
|
|
44766
44951
|
}, "similarPeople");
|
|
44767
44952
|
|
|
44768
|
-
// 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
|
|
44769
44954
|
var DOUBT_REASONS = ["owner-other-name", "test-data", "shared-address", "mixed-names"];
|
|
44770
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";
|
|
44771
44956
|
var text5 = /* @__PURE__ */ __name((value) => typeof value === "string" && value.trim() !== "" ? value : null, "text");
|
|
@@ -44838,9 +45023,9 @@ var nameGroups = /* @__PURE__ */ __name((held) => {
|
|
|
44838
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");
|
|
44839
45024
|
return [...groups.values()].sort((a, b) => weight(b) - weight(a) || a[0].pk - b[0].pk);
|
|
44840
45025
|
}, "nameGroups");
|
|
44841
|
-
var
|
|
45026
|
+
var quoted4 = /* @__PURE__ */ __name((held) => [...new Set(held.map(({ name, ref: ref3 }) => name ?? ref3))].map((name) => `\xAB${name}\xBB`).join(", "), "quoted");
|
|
44842
45027
|
var whyOf = /* @__PURE__ */ __name((found2) => {
|
|
44843
|
-
const names =
|
|
45028
|
+
const names = quoted4(found2.held);
|
|
44844
45029
|
if (found2.reason === "owner-other-name")
|
|
44845
45030
|
return `your own person holds ${names}, under another name than yours: an account or mailbox you read may be someone else's`;
|
|
44846
45031
|
if (found2.reason === "test-data")
|
|
@@ -45021,7 +45206,7 @@ var markTestData = /* @__PURE__ */ __name((context, uid, by) => {
|
|
|
45021
45206
|
return { person: `person:${person2}`, identities: identities2 };
|
|
45022
45207
|
}, "markTestData");
|
|
45023
45208
|
|
|
45024
|
-
// 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
|
|
45025
45210
|
var GLOBAL_PROJECT = "SELECT id FROM main.projects WHERE account_id IS NULL AND deleted_at IS NULL";
|
|
45026
45211
|
var IN_SCOPES = "IN (SELECT value FROM json_each(?))";
|
|
45027
45212
|
var projectScope = /* @__PURE__ */ __name((id2) => `(SELECT p.scope FROM main.projects p WHERE p.id=${id2})`, "projectScope");
|
|
@@ -45090,7 +45275,7 @@ var personPreparation = /* @__PURE__ */ __name(({ database, now: now2 }, uid, {
|
|
|
45090
45275
|
});
|
|
45091
45276
|
}, "personPreparation");
|
|
45092
45277
|
|
|
45093
|
-
// 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
|
|
45094
45279
|
var personSeenInAccounts = /* @__PURE__ */ __name(({ database }, uid, accountIds) => {
|
|
45095
45280
|
const id2 = Number(uid);
|
|
45096
45281
|
if (!/^[1-9]\d*$/.test(uid) || !Number.isSafeInteger(id2) || !accountIds.length || accountIds.length > 1e3 || accountIds.some((account) => !Number.isSafeInteger(account) || account <= 0))
|
|
@@ -45098,7 +45283,7 @@ var personSeenInAccounts = /* @__PURE__ */ __name(({ database }, uid, accountIds
|
|
|
45098
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)));
|
|
45099
45284
|
}, "personSeenInAccounts");
|
|
45100
45285
|
|
|
45101
|
-
// 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
|
|
45102
45287
|
var required2 = /* @__PURE__ */ __name(({ database }, key2, personId) => {
|
|
45103
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);
|
|
45104
45289
|
if (!row2)
|
|
@@ -45165,7 +45350,7 @@ var removeNote = /* @__PURE__ */ __name((context, key2, personId, id2) => {
|
|
|
45165
45350
|
return { id: id2, personId, removed: true };
|
|
45166
45351
|
}, "removeNote");
|
|
45167
45352
|
|
|
45168
|
-
// 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
|
|
45169
45354
|
var accountPeopleOver = /* @__PURE__ */ __name((context) => {
|
|
45170
45355
|
const { database } = context;
|
|
45171
45356
|
const { accountPk: accountPk2, findAccountPk: findAccountPk2, identityPk: identityPk2 } = keysOver(context);
|
|
@@ -45268,6 +45453,12 @@ var peopleStoreOver = /* @__PURE__ */ __name((context, keyed) => {
|
|
|
45268
45453
|
unlinkIdentity: /* @__PURE__ */ __name(async (identity, options) => {
|
|
45269
45454
|
return write(database, () => unlinkIdentity(context, identity, options));
|
|
45270
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"),
|
|
45271
45462
|
merges: /* @__PURE__ */ __name(async (uid) => merges(context, uid), "merges"),
|
|
45272
45463
|
undoMerge: /* @__PURE__ */ __name(async (to, from2, by) => write(database, () => undoMerge(context, to, from2, by)), "undoMerge"),
|
|
45273
45464
|
split: /* @__PURE__ */ __name(async (uid, chosen, by) => write(database, () => split(context, uid, chosen, by)), "split"),
|
|
@@ -45292,13 +45483,13 @@ var peopleStoreOver = /* @__PURE__ */ __name((context, keyed) => {
|
|
|
45292
45483
|
};
|
|
45293
45484
|
}, "peopleStoreOver");
|
|
45294
45485
|
|
|
45295
|
-
// 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
|
|
45296
45487
|
import { createHash as createHash9 } from "node:crypto";
|
|
45297
45488
|
|
|
45298
|
-
// 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
|
|
45299
45490
|
import { createHash as createHash8 } from "node:crypto";
|
|
45300
45491
|
|
|
45301
|
-
// 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
|
|
45302
45493
|
var MESSAGE_MEASURES = ["views", "reactions", "forwards", "comments", "replies", "thread-size"];
|
|
45303
45494
|
var AUTHOR_MEASURES = [
|
|
45304
45495
|
"messages",
|
|
@@ -45438,7 +45629,7 @@ var withoutUrls = /* @__PURE__ */ __name((text8) => text8.replace(/\S+/gu, (toke
|
|
|
45438
45629
|
var rankingWords = /* @__PURE__ */ __name((text8) => withoutUrls(text8).match(/[\p{L}\p{N}]+/gu)?.length ?? 0, "rankingWords");
|
|
45439
45630
|
var rankingQuestion = /* @__PURE__ */ __name((text8) => withoutUrls(text8).includes("?"), "rankingQuestion");
|
|
45440
45631
|
|
|
45441
|
-
// 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
|
|
45442
45633
|
var RANKING_GRAPH_LIMITS = { nodes: 5e4, depth: 256, work: 1e7, bytes: 8388608 };
|
|
45443
45634
|
var exhausted2 = /* @__PURE__ */ __name((budget) => {
|
|
45444
45635
|
throw new CliError("validation_error", `ranking exceeded ${budget} \u2014 narrow its chat or date scope`, {
|
|
@@ -45660,7 +45851,7 @@ var rankReplyGraph = /* @__PURE__ */ __name((nodes, check3 = () => {
|
|
|
45660
45851
|
};
|
|
45661
45852
|
}, "rankReplyGraph");
|
|
45662
45853
|
|
|
45663
|
-
// 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
|
|
45664
45855
|
var adminEntityKey = /* @__PURE__ */ __name((row2) => JSON.stringify([row2.account.provider, row2.account.account, row2.id]), "adminEntityKey");
|
|
45665
45856
|
var personKey = /* @__PURE__ */ __name((node) => JSON.stringify([node.account.provider, node.account.account, node.sender]), "personKey");
|
|
45666
45857
|
var locator = /* @__PURE__ */ __name((node) => formatLocator({ ...node.account, chat: node.chatId, message: node.id }), "locator");
|
|
@@ -45834,7 +46025,7 @@ var calculateAdminStatistics = /* @__PURE__ */ __name((nodes, stays, options, in
|
|
|
45834
46025
|
return { items, evidence, summary, graph: graph.quality };
|
|
45835
46026
|
}, "calculateAdminStatistics");
|
|
45836
46027
|
|
|
45837
|
-
// 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
|
|
45838
46029
|
var rankingContextRange = /* @__PURE__ */ __name((root) => {
|
|
45839
46030
|
const dates = [];
|
|
45840
46031
|
const visit = /* @__PURE__ */ __name((node, required3) => {
|
|
@@ -45856,7 +46047,7 @@ var rankingContextRange = /* @__PURE__ */ __name((root) => {
|
|
|
45856
46047
|
return dates[0].node.resolution.date;
|
|
45857
46048
|
}, "rankingContextRange");
|
|
45858
46049
|
|
|
45859
|
-
// 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
|
|
45860
46051
|
var reactionCounts = /* @__PURE__ */ __name((stored4) => {
|
|
45861
46052
|
let counts;
|
|
45862
46053
|
try {
|
|
@@ -46151,7 +46342,7 @@ var rankQuery = /* @__PURE__ */ __name((context, execution, request, inspect) =>
|
|
|
46151
46342
|
});
|
|
46152
46343
|
}, "rankQuery");
|
|
46153
46344
|
|
|
46154
|
-
// 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
|
|
46155
46346
|
function fail2(message3, reason = "query.too-large") {
|
|
46156
46347
|
throw new CliError("validation_error", message3, { reason, complete: false });
|
|
46157
46348
|
}
|
|
@@ -46328,7 +46519,7 @@ var adminStatisticsQuery = /* @__PURE__ */ __name((context, execution, request)
|
|
|
46328
46519
|
return result;
|
|
46329
46520
|
}), "adminStatisticsQuery");
|
|
46330
46521
|
|
|
46331
|
-
// 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
|
|
46332
46523
|
var conversationEligibility = /* @__PURE__ */ __name(async (context, execution) => {
|
|
46333
46524
|
if (!execution.accounts.length)
|
|
46334
46525
|
return { conversations: [], chats: [] };
|
|
@@ -46346,7 +46537,7 @@ var conversationEligibility = /* @__PURE__ */ __name(async (context, execution)
|
|
|
46346
46537
|
return { conversations: conversations2, chats: chats2 };
|
|
46347
46538
|
}, "conversationEligibility");
|
|
46348
46539
|
|
|
46349
|
-
// 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
|
|
46350
46541
|
import { createHash as createHash10 } from "node:crypto";
|
|
46351
46542
|
var EVIDENCE_BYTES = 64 * 1024;
|
|
46352
46543
|
var FINGERPRINT_BYTES = 8 * 1024 * 1024;
|
|
@@ -46496,7 +46687,7 @@ var rankingEvidence = /* @__PURE__ */ __name((context, execution, request) => {
|
|
|
46496
46687
|
return result;
|
|
46497
46688
|
}, "rankingEvidence");
|
|
46498
46689
|
|
|
46499
|
-
// 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
|
|
46500
46691
|
var queriesStoreOver = /* @__PURE__ */ __name((context, stemmerFor2) => {
|
|
46501
46692
|
const mailIndexed = /* @__PURE__ */ __name((execution) => {
|
|
46502
46693
|
if (execution.corpus === "mail")
|
|
@@ -46517,7 +46708,7 @@ var queriesStoreOver = /* @__PURE__ */ __name((context, stemmerFor2) => {
|
|
|
46517
46708
|
};
|
|
46518
46709
|
}, "queriesStoreOver");
|
|
46519
46710
|
|
|
46520
|
-
// 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
|
|
46521
46712
|
var saveChatEvents = /* @__PURE__ */ __name((context, accountKey, provider, chatKey, events3) => {
|
|
46522
46713
|
const { database, now: now2 } = context;
|
|
46523
46714
|
const insert = database.prepare(`INSERT INTO chat_events (chat_id, source_id, action, actor_identity_id, title, happened_at, created_at, updated_at)
|
|
@@ -46556,10 +46747,10 @@ var chatEventsOf = /* @__PURE__ */ __name(({ database }, chatKey, { since = 0, l
|
|
|
46556
46747
|
}));
|
|
46557
46748
|
}, "chatEventsOf");
|
|
46558
46749
|
|
|
46559
|
-
// 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
|
|
46560
46751
|
import { createHash as createHash11 } from "node:crypto";
|
|
46561
46752
|
|
|
46562
|
-
// 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
|
|
46563
46754
|
var calendarKey = /* @__PURE__ */ __name((zone, by) => {
|
|
46564
46755
|
const format = new Intl.DateTimeFormat("en-CA", {
|
|
46565
46756
|
timeZone: zone,
|
|
@@ -46579,7 +46770,7 @@ var weekKey = /* @__PURE__ */ __name((day3) => {
|
|
|
46579
46770
|
return date3.toISOString().slice(0, 10);
|
|
46580
46771
|
}, "weekKey");
|
|
46581
46772
|
|
|
46582
|
-
// 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
|
|
46583
46774
|
var RETENTION_TOLERANCE = 864e5;
|
|
46584
46775
|
var validateRetentionOptions = /* @__PURE__ */ __name((options) => {
|
|
46585
46776
|
const { since, until, cutoff, checkpoints, within, limit, by } = options;
|
|
@@ -46633,7 +46824,7 @@ var retentionCohorts = /* @__PURE__ */ __name((stays, options) => {
|
|
|
46633
46824
|
return [...groups.values()].sort((a, b) => a.cohort.localeCompare(b.cohort));
|
|
46634
46825
|
}, "retentionCohorts");
|
|
46635
46826
|
|
|
46636
|
-
// 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
|
|
46637
46828
|
var iso10 = /* @__PURE__ */ __name((at2) => new Date(at2).toISOString(), "iso");
|
|
46638
46829
|
var retentionQuery = /* @__PURE__ */ __name((context, accountPk2, chatPk, chatId, options, evidence) => {
|
|
46639
46830
|
validateRetentionOptions(options);
|
|
@@ -46764,7 +46955,7 @@ var retentionQuery = /* @__PURE__ */ __name((context, accountPk2, chatPk, chatId
|
|
|
46764
46955
|
};
|
|
46765
46956
|
}, "retentionQuery");
|
|
46766
46957
|
|
|
46767
|
-
// 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
|
|
46768
46959
|
var iso11 = /* @__PURE__ */ __name((ms) => ms === null ? null : new Date(ms).toISOString(), "iso");
|
|
46769
46960
|
var marksOf = /* @__PURE__ */ __name(({ isBot: isBot2, flagged, deleted, hasPhoto }) => ({
|
|
46770
46961
|
...isBot2 === void 0 ? {} : { bot: isBot2 },
|
|
@@ -46893,7 +47084,7 @@ var trackedChats = /* @__PURE__ */ __name((context, accountKey, where) => contex
|
|
|
46893
47084
|
lastCount: memberCountsOf(context, pk).at(-1) ?? null
|
|
46894
47085
|
})), "trackedChats");
|
|
46895
47086
|
|
|
46896
|
-
// 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
|
|
46897
47088
|
var rosterStoreOver = /* @__PURE__ */ __name((context) => {
|
|
46898
47089
|
const { database } = context;
|
|
46899
47090
|
const { accountPk: accountPk2, findAccountPk: findAccountPk2, chatKeyOf, chatPkFor: chatPkFor2, writeMembers: writeMembers2 } = keysOver(context);
|
|
@@ -46949,7 +47140,7 @@ var rosterStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
46949
47140
|
};
|
|
46950
47141
|
}, "rosterStoreOver");
|
|
46951
47142
|
|
|
46952
|
-
// 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
|
|
46953
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");
|
|
46954
47145
|
var backfillNormalized = /* @__PURE__ */ __name((database, { batch = 5e3, onBatch, until = /* @__PURE__ */ __name(() => false, "until") } = {}) => {
|
|
46955
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 ?`);
|
|
@@ -46973,7 +47164,7 @@ var backfillNormalized = /* @__PURE__ */ __name((database, { batch = 5e3, onBatc
|
|
|
46973
47164
|
}
|
|
46974
47165
|
}, "backfillNormalized");
|
|
46975
47166
|
|
|
46976
|
-
// 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
|
|
46977
47168
|
var INDEX2 = "message_words";
|
|
46978
47169
|
var searchIndexState2 = /* @__PURE__ */ __name((database) => {
|
|
46979
47170
|
const row2 = indexRow(database, INDEX2);
|
|
@@ -47100,7 +47291,7 @@ var resetSearchIndex = /* @__PURE__ */ __name((database) => {
|
|
|
47100
47291
|
});
|
|
47101
47292
|
}, "resetSearchIndex");
|
|
47102
47293
|
|
|
47103
|
-
// 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
|
|
47104
47295
|
var fillStems = /* @__PURE__ */ __name((database, { batch = 5e3, until = /* @__PURE__ */ __name(() => false, "until"), onBatch, now: now2 = Date.now } = {}) => {
|
|
47105
47296
|
const filled = { stemmed: 0, drained: 0 };
|
|
47106
47297
|
const before2 = stemsState(database);
|
|
@@ -47195,7 +47386,7 @@ var followDefaultStemmers = /* @__PURE__ */ __name((database, now2 = Date.now) =
|
|
|
47195
47386
|
return resetStems(database, { now: now2 });
|
|
47196
47387
|
}, "followDefaultStemmers");
|
|
47197
47388
|
|
|
47198
|
-
// 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
|
|
47199
47390
|
var VOCABULARY = "SELECT term, doc FROM message_words_vocab WHERE col = 'normalized_text'";
|
|
47200
47391
|
var knownTerms = /* @__PURE__ */ __name(({ database }, terms) => {
|
|
47201
47392
|
const lookup = database.prepare(`${VOCABULARY} AND term >= ? AND term <= ? LIMIT 1`);
|
|
@@ -47217,7 +47408,7 @@ var termCandidates = /* @__PURE__ */ __name(({ database }, pieces, { shortest, l
|
|
|
47217
47408
|
});
|
|
47218
47409
|
}, "termCandidates");
|
|
47219
47410
|
|
|
47220
|
-
// 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
|
|
47221
47412
|
var searchIndexStoreOver = /* @__PURE__ */ __name((context) => {
|
|
47222
47413
|
const { database } = context;
|
|
47223
47414
|
const stemmerFor2 = stemmerCache();
|
|
@@ -47241,7 +47432,7 @@ var searchIndexStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
47241
47432
|
};
|
|
47242
47433
|
}, "searchIndexStoreOver");
|
|
47243
47434
|
|
|
47244
|
-
// 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
|
|
47245
47436
|
var HISTORY_KEPT = 1e3;
|
|
47246
47437
|
var commandFilter = /* @__PURE__ */ __name((commands) => commands ? { sql: ` AND command IN (${commands.map(() => "?").join(", ")})`, values: [...commands] } : { sql: "", values: [] }, "commandFilter");
|
|
47247
47438
|
var COLUMNS6 = "id, name, command, params, language, version, fields_version, created_at, updated_at, last_run_at, runs";
|
|
@@ -47311,7 +47502,7 @@ var clearHistory = /* @__PURE__ */ __name(({ database }, commands) => {
|
|
|
47311
47502
|
return database.prepare(`DELETE FROM searches WHERE name IS NULL${only.sql}`).run(...only.values).changes;
|
|
47312
47503
|
}, "clearHistory");
|
|
47313
47504
|
|
|
47314
|
-
// 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
|
|
47315
47506
|
var searchesStoreOver = /* @__PURE__ */ __name((context) => {
|
|
47316
47507
|
const { database } = context;
|
|
47317
47508
|
return {
|
|
@@ -47335,7 +47526,7 @@ var searchesStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
47335
47526
|
};
|
|
47336
47527
|
}, "searchesStoreOver");
|
|
47337
47528
|
|
|
47338
|
-
// 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
|
|
47339
47530
|
import { createHash as createHash12 } from "node:crypto";
|
|
47340
47531
|
var ADDED_KINDS = ["text", "file", "page"];
|
|
47341
47532
|
var TEXT_COLUMNS = "kind = ?, title = ?, file_name = ?, extension = ?, url = ?, mime = ?, size = ?, content_hash = ?, body = ?, extraction = ?, metadata = ?, language = ?";
|
|
@@ -47577,7 +47768,7 @@ var addedSourcesOver = /* @__PURE__ */ __name((context) => {
|
|
|
47577
47768
|
};
|
|
47578
47769
|
}, "addedSourcesOver");
|
|
47579
47770
|
|
|
47580
|
-
// 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
|
|
47581
47772
|
var ACTION_TIERS = ["read", "draft", "write-private", "write-public", "destructive", "admin"];
|
|
47582
47773
|
var ACTION_OUTCOMES = ["ok", "refused", "failed"];
|
|
47583
47774
|
var CODE = /^[a-z][a-z0-9_]{0,63}$/;
|
|
@@ -47625,7 +47816,7 @@ var agentActionsStoreOver = /* @__PURE__ */ __name((context, afterRecord = () =>
|
|
|
47625
47816
|
};
|
|
47626
47817
|
}, "agentActionsStoreOver");
|
|
47627
47818
|
|
|
47628
|
-
// 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
|
|
47629
47820
|
var baseSettingKey = /* @__PURE__ */ __name((kind3) => `stages.base.${kind3}`, "baseSettingKey");
|
|
47630
47821
|
var storedPipeline = /* @__PURE__ */ __name((value) => {
|
|
47631
47822
|
if (typeof value !== "string")
|
|
@@ -47671,7 +47862,7 @@ var suggestBaseStages = /* @__PURE__ */ __name((database, kind3, pipelines2, { o
|
|
|
47671
47862
|
}
|
|
47672
47863
|
}, "suggestBaseStages");
|
|
47673
47864
|
|
|
47674
|
-
// 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
|
|
47675
47866
|
import { createHash as createHash13 } from "node:crypto";
|
|
47676
47867
|
var RECORDS_SCHEMA_VERSION = 1;
|
|
47677
47868
|
var RECORD_OPERATIONS = ["upsert", "delete"];
|
|
@@ -47812,7 +48003,7 @@ var fieldReferences = /* @__PURE__ */ __name((record3, options = {}) => {
|
|
|
47812
48003
|
return found2;
|
|
47813
48004
|
}, "fieldReferences");
|
|
47814
48005
|
|
|
47815
|
-
// 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
|
|
47816
48007
|
var TABLES2 = { deal: "deals", lead: "leads" };
|
|
47817
48008
|
var MONEY_REFUSALS = ["money.currency", "money.amount"];
|
|
47818
48009
|
var amountFault = /* @__PURE__ */ __name((item, code) => {
|
|
@@ -47971,7 +48162,7 @@ var crmRowsOver = /* @__PURE__ */ __name((context) => {
|
|
|
47971
48162
|
return { savePipeline, saveItemRow };
|
|
47972
48163
|
}, "crmRowsOver");
|
|
47973
48164
|
|
|
47974
|
-
// 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
|
|
47975
48166
|
var ACTIVITY_RECORD = "crm.activity";
|
|
47976
48167
|
var MOST_BODY = 2e4;
|
|
47977
48168
|
var MOST_SUBJECT = 500;
|
|
@@ -48051,7 +48242,7 @@ var crmActivitiesOver = /* @__PURE__ */ __name((context) => {
|
|
|
48051
48242
|
return { save: save2, of };
|
|
48052
48243
|
}, "crmActivitiesOver");
|
|
48053
48244
|
|
|
48054
|
-
// 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
|
|
48055
48246
|
var TABLES3 = { deal: "deals", lead: "leads" };
|
|
48056
48247
|
var stageAmountsOf = /* @__PURE__ */ __name(({ database }, kind3, stageIds, cutoff) => {
|
|
48057
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);
|
|
@@ -48068,7 +48259,7 @@ var stageAmountsOf = /* @__PURE__ */ __name(({ database }, kind3, stageIds, cuto
|
|
|
48068
48259
|
});
|
|
48069
48260
|
}, "stageAmountsOf");
|
|
48070
48261
|
|
|
48071
|
-
// 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
|
|
48072
48263
|
var TABLES4 = { deal: "deals", lead: "leads" };
|
|
48073
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");
|
|
48074
48265
|
var MAX_STAGES = 30;
|
|
@@ -48547,7 +48738,7 @@ var dealsStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
48547
48738
|
};
|
|
48548
48739
|
}, "dealsStoreOver");
|
|
48549
48740
|
|
|
48550
|
-
// 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
|
|
48551
48742
|
var KEY2 = "ownerLanguages";
|
|
48552
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(" "));
|
|
48553
48744
|
var DEFAULT_OWNER_LANGUAGES = ["ru"];
|
|
@@ -48577,7 +48768,7 @@ var saveOwnerLanguages = /* @__PURE__ */ __name((database, languages, now2) => {
|
|
|
48577
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);
|
|
48578
48769
|
}, "saveOwnerLanguages");
|
|
48579
48770
|
|
|
48580
|
-
// 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
|
|
48581
48772
|
var OUTCOMES = {
|
|
48582
48773
|
lead: ["open", "open", "open", "won", "lost"],
|
|
48583
48774
|
deal: ["open", "open", "open", "open", "won", "lost"]
|
|
@@ -48910,7 +49101,7 @@ var baseStagesStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
48910
49101
|
};
|
|
48911
49102
|
}, "baseStagesStoreOver");
|
|
48912
49103
|
|
|
48913
|
-
// 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
|
|
48914
49105
|
var botUpdateStoreOver = /* @__PURE__ */ __name((context, afterSave = () => {
|
|
48915
49106
|
}) => {
|
|
48916
49107
|
const { database, now: now2 } = context;
|
|
@@ -48969,7 +49160,7 @@ var botUpdateStoreOver = /* @__PURE__ */ __name((context, afterSave = () => {
|
|
|
48969
49160
|
};
|
|
48970
49161
|
}, "botUpdateStoreOver");
|
|
48971
49162
|
|
|
48972
|
-
// 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
|
|
48973
49164
|
var IMPORTER = { bot: "import" };
|
|
48974
49165
|
var importersProposal = /* @__PURE__ */ __name((entity) => entity.review === "proposed" && entity.author.type === "bot" && entity.author.name === IMPORTER.bot, "importersProposal");
|
|
48975
49166
|
var codeOf = /* @__PURE__ */ __name((error) => {
|
|
@@ -49014,7 +49205,7 @@ var moneyLinesOf = /* @__PURE__ */ __name((projection, list2) => (Array.isArray(
|
|
|
49014
49205
|
};
|
|
49015
49206
|
}), "moneyLinesOf");
|
|
49016
49207
|
|
|
49017
|
-
// 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
|
|
49018
49209
|
var label = /* @__PURE__ */ __name((en, ru, es) => ({ en, ru, es }), "label");
|
|
49019
49210
|
var ROLE_LABELS = {
|
|
49020
49211
|
organization: {
|
|
@@ -49055,7 +49246,7 @@ var ROLE_LABELS = {
|
|
|
49055
49246
|
}
|
|
49056
49247
|
};
|
|
49057
49248
|
|
|
49058
|
-
// 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
|
|
49059
49250
|
var settingOf = /* @__PURE__ */ __name((list2) => `relationships.roles.${list2}`, "settingOf");
|
|
49060
49251
|
var isList = /* @__PURE__ */ __name((list2) => Object.hasOwn(ROLE_LISTS, list2), "isList");
|
|
49061
49252
|
var listOf2 = /* @__PURE__ */ __name((list2) => {
|
|
@@ -49139,7 +49330,7 @@ var relationRolesOver = /* @__PURE__ */ __name(({ database, now: now2 }) => {
|
|
|
49139
49330
|
};
|
|
49140
49331
|
}, "relationRolesOver");
|
|
49141
49332
|
|
|
49142
|
-
// 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
|
|
49143
49334
|
var CRM_LINK_MODES = ["reported", "review"];
|
|
49144
49335
|
var COMPANY_TYPE_MEANINGS = ["customer-of", "supplier", "partner-of"];
|
|
49145
49336
|
var CRM_SCOPES = ["mine", "all"];
|
|
@@ -49335,7 +49526,7 @@ var crmSettingsOf = /* @__PURE__ */ __name((database) => database.prepare("SELEC
|
|
|
49335
49526
|
return [{ setting: String(row2.key), value: settingValue(database, parsed5.key, parsed5.name) }];
|
|
49336
49527
|
}), "crmSettingsOf");
|
|
49337
49528
|
|
|
49338
|
-
// 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
|
|
49339
49530
|
var isoOf = /* @__PURE__ */ __name((ms) => ms === void 0 ? null : new Date(ms).toISOString(), "isoOf");
|
|
49340
49531
|
var relationOf = /* @__PURE__ */ __name((link3, now2) => ({
|
|
49341
49532
|
id: link3.id,
|
|
@@ -49695,7 +49886,7 @@ var decidedOrigin = /* @__PURE__ */ __name((by) => by === "owner" ? { origin: "o
|
|
|
49695
49886
|
provenance: `agent:${by.bot} for the owner: ${by.reason.trim()}`
|
|
49696
49887
|
}, "decidedOrigin");
|
|
49697
49888
|
|
|
49698
|
-
// 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
|
|
49699
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");
|
|
49700
49891
|
var metadataOf = /* @__PURE__ */ __name((relation) => relation.metadata && Object.keys(relation.metadata).length ? JSON.stringify(relation.metadata) : null, "metadataOf");
|
|
49701
49892
|
var syncReportedIn = /* @__PURE__ */ __name((context, key2, relationships, scope3, { source: source2 = "import", by = { bot: key2.provider, kind: "rule" }, onOutcome } = {}) => {
|
|
@@ -49833,7 +50024,7 @@ var relationsStoreOver = /* @__PURE__ */ __name((context) => ({
|
|
|
49833
50024
|
syncReported: /* @__PURE__ */ __name(async (key2, relationships, scope3, options) => write(context.database, () => syncReportedIn(context, key2, relationships, scope3, options)), "syncReported")
|
|
49834
50025
|
}), "relationsStoreOver");
|
|
49835
50026
|
|
|
49836
|
-
// 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
|
|
49837
50028
|
var importSource = /* @__PURE__ */ __name((provider) => `import:${provider}`, "importSource");
|
|
49838
50029
|
var noRelationships = /* @__PURE__ */ __name(() => ({
|
|
49839
50030
|
added: 0,
|
|
@@ -50023,11 +50214,11 @@ var recordRelationshipsOver = /* @__PURE__ */ __name((context) => {
|
|
|
50023
50214
|
return { report, placeOf: placeOf2, withdrawFrom };
|
|
50024
50215
|
}, "recordRelationshipsOver");
|
|
50025
50216
|
|
|
50026
|
-
// 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
|
|
50027
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";
|
|
50028
50219
|
var DAY_MS2 = 864e5;
|
|
50029
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");
|
|
50030
|
-
var
|
|
50221
|
+
var columnsOf4 = /* @__PURE__ */ __name((fields4, base) => {
|
|
50031
50222
|
const kept2 = /* @__PURE__ */ __name((given3, column2, read2) => given3 === void 0 ? base[column2] ?? null : read2(given3), "kept");
|
|
50032
50223
|
const name = kept2(fields4.name, "name", (value2) => text3(value2, "a contract's name", 200));
|
|
50033
50224
|
if (name == null)
|
|
@@ -50128,7 +50319,7 @@ var contractOperationsOver = /* @__PURE__ */ __name((context) => {
|
|
|
50128
50319
|
}, "decide");
|
|
50129
50320
|
return {
|
|
50130
50321
|
add: /* @__PURE__ */ __name((input) => {
|
|
50131
|
-
const columns2 =
|
|
50322
|
+
const columns2 = columnsOf4({ ...input, status: input.status ?? "active", autoRenew: input.autoRenew ?? false }, {});
|
|
50132
50323
|
const id2 = write(database, () => {
|
|
50133
50324
|
const deal = linkedId(input.deal, "deal", "contract.ref");
|
|
50134
50325
|
const by = written(input);
|
|
@@ -50159,7 +50350,7 @@ var contractOperationsOver = /* @__PURE__ */ __name((context) => {
|
|
|
50159
50350
|
if (row2.review === "rejected" || row2.deleted_at != null)
|
|
50160
50351
|
refuse(`${ref3} is ${row2.deleted_at != null ? "deleted" : "rejected"}`, "contract.ref");
|
|
50161
50352
|
mayChangeParts(row2, by, `only the owner changes ${ref3}; a bot changes only a contract it proposed that is still proposed`);
|
|
50162
|
-
const columns2 =
|
|
50353
|
+
const columns2 = columnsOf4(fields4, row2);
|
|
50163
50354
|
write(database, () => {
|
|
50164
50355
|
const deal = fields4.deal === void 0 ? row2.deal_id : linkedId(fields4.deal, "deal", "contract.ref");
|
|
50165
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));
|
|
@@ -50182,7 +50373,7 @@ var contractsStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
50182
50373
|
};
|
|
50183
50374
|
}, "contractsStoreOver");
|
|
50184
50375
|
|
|
50185
|
-
// 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
|
|
50186
50377
|
var BUSINESS_FIND_MAX = 2001;
|
|
50187
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");
|
|
50188
50379
|
var partyName = /* @__PURE__ */ __name((as) => `coalesce(${as}p.name, ${as}o.name, ${as}j.name)`, "partyName");
|
|
@@ -50287,7 +50478,7 @@ var businessSearchOver = /* @__PURE__ */ __name(({ database }) => {
|
|
|
50287
50478
|
};
|
|
50288
50479
|
}, "businessSearchOver");
|
|
50289
50480
|
|
|
50290
|
-
// 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
|
|
50291
50482
|
var CATALOG_QUERY = defineQuery({
|
|
50292
50483
|
entity: "document",
|
|
50293
50484
|
backend: "sql",
|
|
@@ -50520,7 +50711,7 @@ var catalogStoreOver = /* @__PURE__ */ __name(({ database, now: now2 }) => {
|
|
|
50520
50711
|
};
|
|
50521
50712
|
}, "catalogStoreOver");
|
|
50522
50713
|
|
|
50523
|
-
// 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
|
|
50524
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");
|
|
50525
50716
|
var field3 = /* @__PURE__ */ __name((name) => `CASE WHEN (${remote()}) THEN
|
|
50526
50717
|
CASE WHEN json_type(n.front_matter,'$.${name}')='text' THEN json_extract(n.front_matter,'$.${name}') END END`, "field");
|
|
@@ -50533,7 +50724,7 @@ var contextDocumentTimeKind = /* @__PURE__ */ __name(() => `CASE WHEN (${remoteT
|
|
|
50533
50724
|
THEN 'source-modified' ELSE 'stored-update' END`, "contextDocumentTimeKind");
|
|
50534
50725
|
var contextDocumentUrl = /* @__PURE__ */ __name(() => `coalesce(${preferred("url")},n.url,${field3("sourceUrl")})`, "contextDocumentUrl");
|
|
50535
50726
|
|
|
50536
|
-
// 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
|
|
50537
50728
|
var readMeetingContextEvidence = /* @__PURE__ */ __name((database, request) => {
|
|
50538
50729
|
const { source: source2, words: words4, after: after2, before: before2, limit, maxReadBytes, cursor, signal } = request;
|
|
50539
50730
|
signal?.throwIfAborted();
|
|
@@ -50632,7 +50823,7 @@ var readMeetingContextEvidence = /* @__PURE__ */ __name((database, request) => {
|
|
|
50632
50823
|
});
|
|
50633
50824
|
}, "readMeetingContextEvidence");
|
|
50634
50825
|
|
|
50635
|
-
// 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
|
|
50636
50827
|
var corpora = {
|
|
50637
50828
|
message: {
|
|
50638
50829
|
table: "messages",
|
|
@@ -50877,7 +51068,7 @@ var contextRecordsOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
|
50877
51068
|
}
|
|
50878
51069
|
}), "contextRecordsOver");
|
|
50879
51070
|
|
|
50880
|
-
// 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
|
|
50881
51072
|
var PLACEHOLDER = /(?:^|\s)null(?:\s+#\d+)?(?=\s|$)/gi;
|
|
50882
51073
|
var withoutPlaceholder = /* @__PURE__ */ __name((name) => name.replace(PLACEHOLDER, " ").replace(/\s+/g, " ").trim() || null, "withoutPlaceholder");
|
|
50883
51074
|
var DryRun = class extends Error {
|
|
@@ -50954,7 +51145,7 @@ var removeCrmContacts = /* @__PURE__ */ __name((context, key2, { users, before:
|
|
|
50954
51145
|
}
|
|
50955
51146
|
}, "removeCrmContacts");
|
|
50956
51147
|
|
|
50957
|
-
// 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
|
|
50958
51149
|
var STAGE_ENTRY_RECORD = "crm.stage-entry";
|
|
50959
51150
|
var crmStageEntriesOver = /* @__PURE__ */ __name((context) => {
|
|
50960
51151
|
const { database, now: now2 } = context;
|
|
@@ -51001,7 +51192,7 @@ var crmStageEntriesOver = /* @__PURE__ */ __name((context) => {
|
|
|
51001
51192
|
return { save: save2, pending, handled };
|
|
51002
51193
|
}, "crmStageEntriesOver");
|
|
51003
51194
|
|
|
51004
|
-
// 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
|
|
51005
51196
|
var PENDING = "crm:pending-relations";
|
|
51006
51197
|
var PENDING_DAYS = 30;
|
|
51007
51198
|
var PENDING_MOST = 5e3;
|
|
@@ -51519,10 +51710,10 @@ var crmCopiesOver = /* @__PURE__ */ __name((context, people2) => {
|
|
|
51519
51710
|
};
|
|
51520
51711
|
}, "crmCopiesOver");
|
|
51521
51712
|
|
|
51522
|
-
// 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
|
|
51523
51714
|
import { createHash as createHash14, randomBytes as randomBytes2 } from "node:crypto";
|
|
51524
51715
|
|
|
51525
|
-
// 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
|
|
51526
51717
|
var DECISION_ACTIONS = ["confirm", "reject", "ask-confirm", "ask-reject", "back", "later"];
|
|
51527
51718
|
var DECISION_TTL_MS = 72 * 60 * 60 * 1e3;
|
|
51528
51719
|
var CALLBACK_PREFIX = "wcr1:";
|
|
@@ -51536,7 +51727,7 @@ var callbackDataOf = /* @__PURE__ */ __name((token) => {
|
|
|
51536
51727
|
}, "callbackDataOf");
|
|
51537
51728
|
var parseCallbackData = /* @__PURE__ */ __name((data) => typeof data === "string" ? CALLBACK.exec(data)?.[1] : void 0, "parseCallbackData");
|
|
51538
51729
|
|
|
51539
|
-
// 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
|
|
51540
51731
|
var digestOf = /* @__PURE__ */ __name((token) => createHash14("sha256").update(token).digest("hex"), "digestOf");
|
|
51541
51732
|
var newToken = /* @__PURE__ */ __name(() => randomBytes2(16).toString("base64url"), "newToken");
|
|
51542
51733
|
var requestOf = /* @__PURE__ */ __name((row2) => ({
|
|
@@ -51635,7 +51826,7 @@ var decisionRequestStoreOver = /* @__PURE__ */ __name(({ database, now: now2 })
|
|
|
51635
51826
|
};
|
|
51636
51827
|
}, "decisionRequestStoreOver");
|
|
51637
51828
|
|
|
51638
|
-
// 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
|
|
51639
51830
|
var MEETING_ROW_KINDS = ["meeting", "call", "event"];
|
|
51640
51831
|
var DAY6 = 864e5;
|
|
51641
51832
|
var JOINED = `(SELECT ce.event_id FROM calendar_entries ce JOIN events je ON je.id = ce.event_id
|
|
@@ -52022,7 +52213,7 @@ var meetingListingOver = /* @__PURE__ */ __name((context) => {
|
|
|
52022
52213
|
};
|
|
52023
52214
|
}, "meetingListingOver");
|
|
52024
52215
|
|
|
52025
|
-
// 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
|
|
52026
52217
|
var DOCUMENT_KINDS = [
|
|
52027
52218
|
"transcript",
|
|
52028
52219
|
"doc",
|
|
@@ -52259,7 +52450,7 @@ var documentListingOver = /* @__PURE__ */ __name((context) => {
|
|
|
52259
52450
|
};
|
|
52260
52451
|
}, "documentListingOver");
|
|
52261
52452
|
|
|
52262
|
-
// 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
|
|
52263
52454
|
var NOTE_FIELDS = [
|
|
52264
52455
|
"text",
|
|
52265
52456
|
"exact",
|
|
@@ -52275,7 +52466,7 @@ var NOTE_FIELDS = [
|
|
|
52275
52466
|
"keyword",
|
|
52276
52467
|
"source"
|
|
52277
52468
|
];
|
|
52278
|
-
var
|
|
52469
|
+
var quoted5 = /* @__PURE__ */ __name((value) => `"${value.replaceAll('"', '""')}"`, "quoted");
|
|
52279
52470
|
var bound4 = /* @__PURE__ */ __name((sql2, ...params) => ({ sql: sql2, params, exact: true }), "bound");
|
|
52280
52471
|
var combine2 = /* @__PURE__ */ __name((parts, operator) => ({
|
|
52281
52472
|
sql: parts.length ? `(${parts.map(({ sql: sql2 }) => sql2).join(` ${operator} `)})` : operator === "AND" ? "1" : "0",
|
|
@@ -52329,7 +52520,7 @@ var searchNotes = /* @__PURE__ */ __name((context, query) => {
|
|
|
52329
52520
|
return {
|
|
52330
52521
|
items: rows.slice(offset, offset + query.limit).map((row2) => {
|
|
52331
52522
|
const found2 = read2[row2.type === "document" ? "document" : "note"].get(row2.id);
|
|
52332
|
-
const note3 = row2.type === "document" ? documentOf(found2) : noteOf(found2);
|
|
52523
|
+
const note3 = row2.type === "document" ? documentOf(found2) : noteOf(found2, context.database);
|
|
52333
52524
|
return {
|
|
52334
52525
|
ref: note3.ref,
|
|
52335
52526
|
note: note3,
|
|
@@ -52382,9 +52573,9 @@ var searchCorpus = /* @__PURE__ */ __name((context, query, corpus) => {
|
|
|
52382
52573
|
const stems = query.stemmer.phrases(value);
|
|
52383
52574
|
return {
|
|
52384
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 ?)` : ""}`,
|
|
52385
|
-
params: [`normalized_text : (${
|
|
52576
|
+
params: [`normalized_text : (${quoted5(text8)})`, ...stems ? [`stems : (${stems})`] : []],
|
|
52386
52577
|
exact: true,
|
|
52387
|
-
fts:
|
|
52578
|
+
fts: quoted5(text8),
|
|
52388
52579
|
...stems ? { stems } : {}
|
|
52389
52580
|
};
|
|
52390
52581
|
}
|
|
@@ -52392,7 +52583,7 @@ var searchCorpus = /* @__PURE__ */ __name((context, query, corpus) => {
|
|
|
52392
52583
|
if (operator === "term" || operator === "phrase") {
|
|
52393
52584
|
const text8 = normalize(value);
|
|
52394
52585
|
const stems = query.stemmer?.phrases(value);
|
|
52395
|
-
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");
|
|
52396
52587
|
}
|
|
52397
52588
|
const pattern = operator === "wildcard" ? wildcardPattern(normalize(value)) : foldRegex(value, node.span);
|
|
52398
52589
|
const matcher = automaton(pattern, node);
|
|
@@ -52403,7 +52594,7 @@ var searchCorpus = /* @__PURE__ */ __name((context, query, corpus) => {
|
|
|
52403
52594
|
exhausted("term expansions");
|
|
52404
52595
|
const matches2 = terms.flatMap(({ term }) => {
|
|
52405
52596
|
check3();
|
|
52406
|
-
return matcher.test(String(term), budget) ? [
|
|
52597
|
+
return matcher.test(String(term), budget) ? [quoted5(String(term))] : [];
|
|
52407
52598
|
});
|
|
52408
52599
|
return matches2.length ? wordMatch2(matches2.join(" OR ")) : bound4("0");
|
|
52409
52600
|
}
|
|
@@ -52552,7 +52743,7 @@ var noteSearchOver = /* @__PURE__ */ __name((context) => {
|
|
|
52552
52743
|
const drain = /* @__PURE__ */ __name(() => drainNoteIndex(database, stemmerFor2), "drain");
|
|
52553
52744
|
const read2 = /* @__PURE__ */ __name((type, id2) => {
|
|
52554
52745
|
const row2 = database.prepare(`SELECT * FROM ${type === "document" ? "documents" : "notes"} WHERE id = ?`).get(id2);
|
|
52555
|
-
return row2 ? type === "document" ? documentOf(row2) : noteOf(row2) : void 0;
|
|
52746
|
+
return row2 ? type === "document" ? documentOf(row2) : noteOf(row2, database) : void 0;
|
|
52556
52747
|
}, "read");
|
|
52557
52748
|
const live2 = /* @__PURE__ */ __name((folderIds, source2, withInternal = false) => {
|
|
52558
52749
|
const folders = folderIds?.length ? JSON.stringify(folderIds) : null;
|
|
@@ -52733,7 +52924,7 @@ var noteSearchOver = /* @__PURE__ */ __name((context) => {
|
|
|
52733
52924
|
};
|
|
52734
52925
|
}, "noteSearchOver");
|
|
52735
52926
|
|
|
52736
|
-
// 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
|
|
52737
52928
|
var EVENT_FIELDS = ["text", "exact", "body", "title", "date", "in"];
|
|
52738
52929
|
var inEventAccounts = /* @__PURE__ */ __name((event2) => searchableCopy(event2, "c.account_id IN (SELECT CAST(value AS INTEGER) FROM json_each(?))"), "inEventAccounts");
|
|
52739
52930
|
var EVENT_CORPUS = {
|
|
@@ -52865,7 +53056,7 @@ var eventSearchOver = /* @__PURE__ */ __name((context) => {
|
|
|
52865
53056
|
};
|
|
52866
53057
|
}, "eventSearchOver");
|
|
52867
53058
|
|
|
52868
|
-
// 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
|
|
52869
53060
|
var calendarMoment = /* @__PURE__ */ __name((wanted, flag6, { zone, end = false } = {}) => {
|
|
52870
53061
|
try {
|
|
52871
53062
|
return zonedMoment(wanted, timezoneOf(zone), { start: 0, end: wanted.length }, { end });
|
|
@@ -52923,7 +53114,7 @@ var aheadOf = /* @__PURE__ */ __name((reference2, flag6, now2 = Date.now(), opti
|
|
|
52923
53114
|
return read2.time;
|
|
52924
53115
|
}, "aheadOf");
|
|
52925
53116
|
|
|
52926
|
-
// 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
|
|
52927
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";
|
|
52928
53119
|
var iso13 = /* @__PURE__ */ __name((value) => new Date(Number(value)).toISOString(), "iso");
|
|
52929
53120
|
var oneOf5 = /* @__PURE__ */ __name((value, allowed, what) => {
|
|
@@ -52950,6 +53141,7 @@ var factOperationsOver = /* @__PURE__ */ __name((context) => {
|
|
|
52950
53141
|
source: String(row2.source),
|
|
52951
53142
|
evidence: evidenceOf(context, { type: "fact", id: Number(row2.id) }),
|
|
52952
53143
|
sourceReview: sourceReviewOf(database, { type: "fact", id: Number(row2.id) }),
|
|
53144
|
+
...reversalOf(row2),
|
|
52953
53145
|
createdAt: iso13(row2.created_at),
|
|
52954
53146
|
updatedAt: iso13(row2.updated_at)
|
|
52955
53147
|
}), "factOf");
|
|
@@ -52970,8 +53162,9 @@ var factOperationsOver = /* @__PURE__ */ __name((context) => {
|
|
|
52970
53162
|
ownerOnly: ownerOnly2
|
|
52971
53163
|
}, by, context.decisions), "decided");
|
|
52972
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");
|
|
52973
53166
|
const keepDecision = /* @__PURE__ */ __name((id2, by, reason) => {
|
|
52974
|
-
const why =
|
|
53167
|
+
const why = whyOf2(by, reason) ?? "";
|
|
52975
53168
|
if (by === "owner" && !why)
|
|
52976
53169
|
return;
|
|
52977
53170
|
const decision = by === "owner" ? { by: "owner", reason: why } : { by: "agent", bot: by.bot, reason: why };
|
|
@@ -53048,7 +53241,7 @@ var factOperationsOver = /* @__PURE__ */ __name((context) => {
|
|
|
53048
53241
|
write(database, () => accept(id2, by));
|
|
53049
53242
|
return factOf(rowOf3(reference2));
|
|
53050
53243
|
}, "acceptChecked"),
|
|
53051
|
-
reverse: /* @__PURE__ */ __name((reference2, by) => {
|
|
53244
|
+
reverse: /* @__PURE__ */ __name((reference2, by, reason) => {
|
|
53052
53245
|
const row2 = rowOf3(reference2);
|
|
53053
53246
|
assertMayWithdraw({ id: `fact:${row2.id}`, proposedBy: { type: "unknown" }, proposed: false }, by);
|
|
53054
53247
|
if (row2.type !== "decision")
|
|
@@ -53056,7 +53249,13 @@ var factOperationsOver = /* @__PURE__ */ __name((context) => {
|
|
|
53056
53249
|
if (row2.status !== "accepted")
|
|
53057
53250
|
throw new CliError("validation_error", "only an accepted decision can be reversed");
|
|
53058
53251
|
write(database, () => {
|
|
53059
|
-
|
|
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
|
+
}
|
|
53060
53259
|
closing(Number(row2.id), by, "reversed");
|
|
53061
53260
|
});
|
|
53062
53261
|
return factOf(rowOf3(reference2));
|
|
@@ -53099,10 +53298,11 @@ var factOperationsOver = /* @__PURE__ */ __name((context) => {
|
|
|
53099
53298
|
});
|
|
53100
53299
|
return factOf(rowOf3(reference2));
|
|
53101
53300
|
}, "reject"),
|
|
53102
|
-
remove: /* @__PURE__ */ __name((reference2, by) => {
|
|
53301
|
+
remove: /* @__PURE__ */ __name((reference2, by, reason) => {
|
|
53103
53302
|
const row2 = rowOf3(reference2);
|
|
53104
53303
|
withdrawn(row2, by);
|
|
53105
53304
|
const id2 = Number(row2.id);
|
|
53305
|
+
const { subject: subject2 } = subjectOf(database, row2);
|
|
53106
53306
|
const twin = row2.source === "memory" && row2.metadata != null ? migratedFrom(String(row2.metadata)) : void 0;
|
|
53107
53307
|
const links2 = erase(database, () => {
|
|
53108
53308
|
keepHighestId(database, "facts", now2());
|
|
@@ -53114,15 +53314,45 @@ var factOperationsOver = /* @__PURE__ */ __name((context) => {
|
|
|
53114
53314
|
database.prepare("DELETE FROM links WHERE from_type = 'fact' AND from_id = ?").run(id2);
|
|
53115
53315
|
database.prepare("DELETE FROM taggings WHERE taggable_type = 'fact' AND taggable_id = ?").run(id2);
|
|
53116
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());
|
|
53117
53318
|
if (twin !== void 0)
|
|
53118
53319
|
database.prepare("DELETE FROM memories WHERE id = ? AND deleted_at IS NOT NULL").run(twin);
|
|
53119
53320
|
return count2;
|
|
53120
53321
|
});
|
|
53121
53322
|
return { ref: `fact:${id2}`, removed: true, links: links2 };
|
|
53122
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"),
|
|
53123
53337
|
sources: /* @__PURE__ */ __name((reference2) => evidenceSourcesOf(database, { type: "fact", id: Number(rowOf3(reference2).id) }), "sources")
|
|
53124
53338
|
};
|
|
53125
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");
|
|
53126
53356
|
var migratedFrom = /* @__PURE__ */ __name((metadata3) => {
|
|
53127
53357
|
try {
|
|
53128
53358
|
const { memory } = JSON.parse(metadata3);
|
|
@@ -53138,15 +53368,16 @@ var factsStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
53138
53368
|
get: /* @__PURE__ */ __name(async (reference2) => operations.get(reference2), "get"),
|
|
53139
53369
|
list: /* @__PURE__ */ __name(async (options) => operations.list(options), "list"),
|
|
53140
53370
|
accept: /* @__PURE__ */ __name(async (reference2, by, reason) => operations.accept(reference2, by, reason), "accept"),
|
|
53141
|
-
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"),
|
|
53142
53372
|
revoke: /* @__PURE__ */ __name(async (reference2, by, reason) => operations.revoke(reference2, by, reason), "revoke"),
|
|
53143
53373
|
reject: /* @__PURE__ */ __name(async (reference2, by, reason) => operations.reject(reference2, by, reason), "reject"),
|
|
53144
|
-
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"),
|
|
53145
53376
|
sources: /* @__PURE__ */ __name(async (reference2) => operations.sources(reference2), "sources")
|
|
53146
53377
|
};
|
|
53147
53378
|
}, "factsStoreOver");
|
|
53148
53379
|
|
|
53149
|
-
// 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
|
|
53150
53381
|
var invalid5 = /* @__PURE__ */ __name((message3) => {
|
|
53151
53382
|
throw new CliError("validation_error", message3);
|
|
53152
53383
|
}, "invalid");
|
|
@@ -53240,14 +53471,14 @@ var findingsCoreOver = /* @__PURE__ */ __name((context, kind3) => {
|
|
|
53240
53471
|
}, "previous");
|
|
53241
53472
|
const create = /* @__PURE__ */ __name((finding, agent, decidedBy) => {
|
|
53242
53473
|
const evidence = finding.evidence.map((item) => item.reference);
|
|
53243
|
-
const
|
|
53474
|
+
const quoted6 = finding.evidence.map((item) => item.quote === void 0 ? item.reference : { ref: item.reference, quote: item.quote });
|
|
53244
53475
|
if (finding.kind === "fact") {
|
|
53245
53476
|
const fact = facts2.add({
|
|
53246
53477
|
type: finding.type,
|
|
53247
53478
|
statement: finding.statement,
|
|
53248
53479
|
...finding.project === void 0 ? {} : { project: finding.project },
|
|
53249
53480
|
...finding.subject === void 0 ? {} : { subject: finding.subject },
|
|
53250
|
-
evidence:
|
|
53481
|
+
evidence: quoted6,
|
|
53251
53482
|
by: agent
|
|
53252
53483
|
});
|
|
53253
53484
|
return facts2.acceptChecked(fact.ref, decidedBy).ref;
|
|
@@ -53268,7 +53499,7 @@ var findingsCoreOver = /* @__PURE__ */ __name((context, kind3) => {
|
|
|
53268
53499
|
const id2 = taskRowOf(database, task.id);
|
|
53269
53500
|
if (id2 === void 0)
|
|
53270
53501
|
throw new CliError("configuration_error", "created finding task is unavailable");
|
|
53271
|
-
linkEvidence(context, { type: finding.type, id: id2 },
|
|
53502
|
+
linkEvidence(context, { type: finding.type, id: id2 }, quoted6, "agent");
|
|
53272
53503
|
if (finding.assignee)
|
|
53273
53504
|
tasks2.assign(task.id, { to: finding.assignee, role: "assignee" }, agent);
|
|
53274
53505
|
return task.ref;
|
|
@@ -53314,7 +53545,7 @@ var findingsCoreOver = /* @__PURE__ */ __name((context, kind3) => {
|
|
|
53314
53545
|
return { snapshot: snapshot2, snapshotParts, previous, settle, keepWaiting, named: named2, sameDecision, create };
|
|
53315
53546
|
}, "findingsCoreOver");
|
|
53316
53547
|
|
|
53317
|
-
// 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
|
|
53318
53549
|
var stale = /* @__PURE__ */ __name(() => {
|
|
53319
53550
|
throw new CliError("validation_error", "evidence findings changed since they were read; stage a new batch", {
|
|
53320
53551
|
reason: "evidence-findings.stale"
|
|
@@ -53366,7 +53597,7 @@ var evidenceFindingsStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
53366
53597
|
const cite = /* @__PURE__ */ __name(() => {
|
|
53367
53598
|
let readBytes = 0;
|
|
53368
53599
|
const texts2 = /* @__PURE__ */ new Map();
|
|
53369
|
-
const
|
|
53600
|
+
const quoted6 = /* @__PURE__ */ __name((evidence) => {
|
|
53370
53601
|
if (evidence.quote !== void 0 && !quoteKept(evidence.quote, texts2.get(evidence.reference) ?? ""))
|
|
53371
53602
|
throw new CliError("validation_error", `the quote cited from ${evidence.reference} is not in its text`, {
|
|
53372
53603
|
reason: "finding.quote-not-found"
|
|
@@ -53376,7 +53607,7 @@ var evidenceFindingsStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
53376
53607
|
if (seen.has(evidence.reference)) {
|
|
53377
53608
|
if (seen.get(evidence.reference) !== evidence.fingerprint)
|
|
53378
53609
|
return stale();
|
|
53379
|
-
return
|
|
53610
|
+
return quoted6(evidence);
|
|
53380
53611
|
}
|
|
53381
53612
|
const record3 = contextRecordOf(database, evidence.reference);
|
|
53382
53613
|
if (!record3)
|
|
@@ -53389,7 +53620,7 @@ var evidenceFindingsStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
53389
53620
|
return stale();
|
|
53390
53621
|
seen.set(evidence.reference, fingerprint2);
|
|
53391
53622
|
texts2.set(evidence.reference, record3.text);
|
|
53392
|
-
|
|
53623
|
+
quoted6(evidence);
|
|
53393
53624
|
};
|
|
53394
53625
|
}, "cite");
|
|
53395
53626
|
const snapshot2 = /* @__PURE__ */ __name((input) => core.snapshot(input, cite()), "snapshot");
|
|
@@ -53578,7 +53809,7 @@ var evidenceFindingsStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
53578
53809
|
};
|
|
53579
53810
|
}, "evidenceFindingsStoreOver");
|
|
53580
53811
|
|
|
53581
|
-
// 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
|
|
53582
53813
|
var pendingInvolvements = /* @__PURE__ */ __name((database) => Number(database.prepare("SELECT count(*) AS n FROM involvement_pending").get()?.n ?? 0), "pendingInvolvements");
|
|
53583
53814
|
var involvementStoreOver = /* @__PURE__ */ __name(({ database, now: now2 }) => ({
|
|
53584
53815
|
rebuild: /* @__PURE__ */ __name((personId) => write(database, () => {
|
|
@@ -53632,7 +53863,7 @@ var involvementStoreOver = /* @__PURE__ */ __name(({ database, now: now2 }) => (
|
|
|
53632
53863
|
}, "forPerson")
|
|
53633
53864
|
}), "involvementStoreOver");
|
|
53634
53865
|
|
|
53635
|
-
// 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
|
|
53636
53867
|
var LABELLED = {
|
|
53637
53868
|
note: "note",
|
|
53638
53869
|
document: "document",
|
|
@@ -53645,7 +53876,7 @@ var LABELLED = {
|
|
|
53645
53876
|
};
|
|
53646
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");
|
|
53647
53878
|
|
|
53648
|
-
// 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
|
|
53649
53880
|
import { createHash as createHash15 } from "node:crypto";
|
|
53650
53881
|
var fields3 = "id,from_id,to_id,source,confirmed,updated_at,length(evidence) AS evidenceLength,substr(evidence,1,2000) AS evidence";
|
|
53651
53882
|
var id = /* @__PURE__ */ __name((value) => {
|
|
@@ -53731,7 +53962,7 @@ var meetingProjectsStoreOver = /* @__PURE__ */ __name(({ database, now: now2 })
|
|
|
53731
53962
|
};
|
|
53732
53963
|
}, "meetingProjectsStoreOver");
|
|
53733
53964
|
|
|
53734
|
-
// 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
|
|
53735
53966
|
var ORGANIZATIONS_QUERY = {
|
|
53736
53967
|
entity: "organization",
|
|
53737
53968
|
backend: "sql",
|
|
@@ -53772,7 +54003,7 @@ var REMINDERS_QUERY = {
|
|
|
53772
54003
|
})
|
|
53773
54004
|
};
|
|
53774
54005
|
|
|
53775
|
-
// 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
|
|
53776
54007
|
var OWN2 = "(SELECT id FROM organizations WHERE deleted_at IS NULL AND json_extract(metadata, '$.own') = 1)";
|
|
53777
54008
|
var EMPLOYED = "('employee', 'contractor', 'founder')";
|
|
53778
54009
|
var categorySql = /* @__PURE__ */ __name(({ category, accounts: accounts2 }, now2) => {
|
|
@@ -53793,7 +54024,7 @@ var categorySql = /* @__PURE__ */ __name(({ category, accounts: accounts2 }, now
|
|
|
53793
54024
|
return { sql: `EXISTS (SELECT 1 FROM links l WHERE ${where} AND ${usable})`, params: keys };
|
|
53794
54025
|
}, "categorySql");
|
|
53795
54026
|
|
|
53796
|
-
// 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
|
|
53797
54028
|
var organizationOf = /* @__PURE__ */ __name((row2) => ({
|
|
53798
54029
|
id: String(row2.id),
|
|
53799
54030
|
ref: `organization:${row2.id}`,
|
|
@@ -53838,7 +54069,7 @@ var organizationsStoreOver = /* @__PURE__ */ __name(({ database, now: now2 }) =>
|
|
|
53838
54069
|
}), "setOwnOrganization")
|
|
53839
54070
|
}), "organizationsStoreOver");
|
|
53840
54071
|
|
|
53841
|
-
// 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
|
|
53842
54073
|
var KINDS = RELATION_KINDS.map(linkKind).join(", ");
|
|
53843
54074
|
var ACCOUNT_ENDS = [
|
|
53844
54075
|
["deal", "deals"],
|
|
@@ -53989,13 +54220,13 @@ var relationListOver = /* @__PURE__ */ __name((context) => {
|
|
|
53989
54220
|
__name(proposalItem, "proposalItem");
|
|
53990
54221
|
}, "relationListOver");
|
|
53991
54222
|
|
|
53992
|
-
// 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
|
|
53993
54224
|
var relationReadsOver = /* @__PURE__ */ __name((context) => ({
|
|
53994
54225
|
...relationListOver(context),
|
|
53995
54226
|
...relationRolesOver(context)
|
|
53996
54227
|
}), "relationReadsOver");
|
|
53997
54228
|
|
|
53998
|
-
// 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
|
|
53999
54230
|
var TABLES5 = { memory: "memories", fact: "facts" };
|
|
54000
54231
|
var RETIRED = /* @__PURE__ */ new Set(["superseded", "reversed", "rejected", "stale"]);
|
|
54001
54232
|
var DEFAULT_LIMIT = 500;
|
|
@@ -54238,16 +54469,16 @@ var sourceReviewStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
54238
54469
|
};
|
|
54239
54470
|
}, "sourceReviewStoreOver");
|
|
54240
54471
|
|
|
54241
|
-
// 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
|
|
54242
54473
|
import { createHash as createHash18 } from "node:crypto";
|
|
54243
54474
|
|
|
54244
|
-
// 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
|
|
54245
54476
|
import { createHash as createHash17 } from "node:crypto";
|
|
54246
54477
|
|
|
54247
|
-
// 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
|
|
54248
54479
|
import { createHash as createHash16 } from "node:crypto";
|
|
54249
54480
|
|
|
54250
|
-
// 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
|
|
54251
54482
|
var consolidationId = /* @__PURE__ */ __name((value, field4) => {
|
|
54252
54483
|
if (typeof value !== "string" || !/^[1-9]\d*$/.test(value) || !Number.isSafeInteger(Number(value)))
|
|
54253
54484
|
throw new CliError("validation_error", `${field4} must be a positive canonical tag id`);
|
|
@@ -54298,7 +54529,7 @@ var consolidationApplyInput = /* @__PURE__ */ __name((options) => {
|
|
|
54298
54529
|
return input;
|
|
54299
54530
|
}, "consolidationApplyInput");
|
|
54300
54531
|
|
|
54301
|
-
// 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
|
|
54302
54533
|
var receiptOf = /* @__PURE__ */ __name((row2) => ({
|
|
54303
54534
|
id: String(row2.id),
|
|
54304
54535
|
sourceId: String(row2.source_id),
|
|
@@ -54373,7 +54604,7 @@ var applyTagConsolidation = /* @__PURE__ */ __name((context, preview, options) =
|
|
|
54373
54604
|
}, { beforeCommit: check3 });
|
|
54374
54605
|
}, "applyTagConsolidation");
|
|
54375
54606
|
|
|
54376
|
-
// 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
|
|
54377
54608
|
var selections = [
|
|
54378
54609
|
["taggings", "tag_id IN (SELECT value FROM json_each(?))"],
|
|
54379
54610
|
["aliases", "aliasable_type='tag' AND aliasable_id IN (SELECT value FROM json_each(?))"],
|
|
@@ -54517,7 +54748,7 @@ var previewRows = /* @__PURE__ */ __name((context, options, source2, survivor, m
|
|
|
54517
54748
|
};
|
|
54518
54749
|
}, "previewRows");
|
|
54519
54750
|
|
|
54520
|
-
// 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
|
|
54521
54752
|
var kinds = ["project", "tag", "topic"];
|
|
54522
54753
|
var cancelled2 = /* @__PURE__ */ __name((signal) => {
|
|
54523
54754
|
if (signal?.aborted)
|
|
@@ -54781,7 +55012,7 @@ var vocabularyStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
54781
55012
|
};
|
|
54782
55013
|
}, "vocabularyStoreOver");
|
|
54783
55014
|
|
|
54784
|
-
// 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
|
|
54785
55016
|
var TYPED_KEY_PREFIXES = new Set(Object.values(TASK_KEY_PREFIXES));
|
|
54786
55017
|
var ORGANIZATION_KINDS = ["company", "team", "family", "community"];
|
|
54787
55018
|
var PROJECT_TYPES = ["work", "client", "personal", "oss", "other"];
|
|
@@ -55335,7 +55566,7 @@ var projectKey = /* @__PURE__ */ __name((name) => {
|
|
|
55335
55566
|
return key2.padEnd(3, "X");
|
|
55336
55567
|
}, "projectKey");
|
|
55337
55568
|
|
|
55338
|
-
// 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
|
|
55339
55570
|
var DAY7 = 864e5;
|
|
55340
55571
|
var SETTING5 = "logs_pruned_at";
|
|
55341
55572
|
var LOG_RETENTION = { agentActionsMs: 90 * DAY7, botUpdatePayloadsMs: 30 * DAY7 };
|
|
@@ -55362,7 +55593,7 @@ var logPruner = /* @__PURE__ */ __name((database, now2) => {
|
|
|
55362
55593
|
};
|
|
55363
55594
|
}, "logPruner");
|
|
55364
55595
|
|
|
55365
|
-
// 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
|
|
55366
55597
|
var MAIL_FINDINGS_PER_RUN = 30;
|
|
55367
55598
|
var MAIL_FINDINGS_PER_SENDER = 5;
|
|
55368
55599
|
var invalid7 = /* @__PURE__ */ __name((message3) => {
|
|
@@ -55721,7 +55952,7 @@ var checkMailFindings = /* @__PURE__ */ __name((input) => {
|
|
|
55721
55952
|
}, "checkMailFindings");
|
|
55722
55953
|
var mailFindingFingerprint = /* @__PURE__ */ __name(({ id: _id, ...finding }) => findingHash(finding), "mailFindingFingerprint");
|
|
55723
55954
|
|
|
55724
|
-
// 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
|
|
55725
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";
|
|
55726
55957
|
var orderOperationsOver = /* @__PURE__ */ __name((context) => {
|
|
55727
55958
|
const { database, now: now2 } = context;
|
|
@@ -55936,7 +56167,7 @@ var ordersStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
55936
56167
|
};
|
|
55937
56168
|
}, "ordersStoreOver");
|
|
55938
56169
|
|
|
55939
|
-
// 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
|
|
55940
56171
|
var MAIL_EDITS = {
|
|
55941
56172
|
task: ["title", "type", "reason", "commitment", "project", "dueAt", "dueEvidence", "assignee", "assigneeEvidence"],
|
|
55942
56173
|
fact: ["statement", "type", "reason", "subject", "project"],
|
|
@@ -56425,7 +56656,7 @@ ${evidence.join("\n")}`, agent);
|
|
|
56425
56656
|
};
|
|
56426
56657
|
}, "mailFindingsStoreOver");
|
|
56427
56658
|
|
|
56428
|
-
// 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
|
|
56429
56660
|
var stale3 = /* @__PURE__ */ __name(() => {
|
|
56430
56661
|
throw new CliError("validation_error", "meeting findings changed since they were read; stage a new batch", {
|
|
56431
56662
|
reason: "meeting-findings.stale"
|
|
@@ -56638,7 +56869,7 @@ var meetingFindingsStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
56638
56869
|
};
|
|
56639
56870
|
}, "meetingFindingsStoreOver");
|
|
56640
56871
|
|
|
56641
|
-
// 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
|
|
56642
56873
|
var RANK_BATCH = 512;
|
|
56643
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";
|
|
56644
56875
|
var limitOf2 = /* @__PURE__ */ __name((value, name, max = 1e3) => {
|
|
@@ -56909,7 +57140,7 @@ var meetingVectorsOver = /* @__PURE__ */ __name((context) => ({
|
|
|
56909
57140
|
}
|
|
56910
57141
|
}), "meetingVectorsOver");
|
|
56911
57142
|
|
|
56912
|
-
// 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
|
|
56913
57144
|
var OTHER_SOURCES = ["document", "note", "email"];
|
|
56914
57145
|
var TEXTS = {
|
|
56915
57146
|
document: "JOIN documents s ON mn.source_type = 'document' AND s.id = mn.source_id AND s.deleted_at IS NULL WHERE 1 ",
|
|
@@ -57010,7 +57241,7 @@ var sourceMentionStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
57010
57241
|
};
|
|
57011
57242
|
}, "sourceMentionStoreOver");
|
|
57012
57243
|
|
|
57013
|
-
// 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
|
|
57014
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";
|
|
57015
57246
|
var MAX_SPLITS = 100;
|
|
57016
57247
|
var transactionOperationsOver = /* @__PURE__ */ __name((context) => {
|
|
@@ -57244,11 +57475,11 @@ var transactionsStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
57244
57475
|
};
|
|
57245
57476
|
}, "transactionsStoreOver");
|
|
57246
57477
|
|
|
57247
|
-
// 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
|
|
57248
57479
|
import { accessSync, constants, existsSync as existsSync2, mkdirSync as mkdirSync2, statSync as statSync2, writeFileSync as writeFileSync2 } from "node:fs";
|
|
57249
57480
|
import { dirname as dirname2 } from "node:path";
|
|
57250
57481
|
|
|
57251
|
-
// 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
|
|
57252
57483
|
import { readFileSync as readFileSync3 } from "node:fs";
|
|
57253
57484
|
var CLIENTS_SETTING = "clients";
|
|
57254
57485
|
var coreVersion = (() => {
|
|
@@ -57309,7 +57540,7 @@ var refusalAdvice = /* @__PURE__ */ __name((clients, command, schema) => {
|
|
|
57309
57540
|
return mover ? `${own} (${mover.command} ${mover.version} moved the store to schema ${schema})` : own;
|
|
57310
57541
|
}, "refusalAdvice");
|
|
57311
57542
|
|
|
57312
|
-
// 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
|
|
57313
57544
|
var GENERATED = [
|
|
57314
57545
|
{
|
|
57315
57546
|
"name": "20261010184427_initial",
|
|
@@ -58660,10 +58891,19 @@ WHERE json_type(params, '$.selection') = 'object';`
|
|
|
58660
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;",
|
|
58661
58892
|
"UPDATE persons SET kind = NULL WHERE kind IS NOT NULL AND trim(coalesce(name, '')) = '';"
|
|
58662
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
|
+
]
|
|
58663
58903
|
}
|
|
58664
58904
|
];
|
|
58665
58905
|
|
|
58666
|
-
// 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
|
|
58667
58907
|
import { mkdirSync, rmSync, statfsSync, writeFileSync } from "node:fs";
|
|
58668
58908
|
import { basename, dirname, join as join3, parse } from "node:path";
|
|
58669
58909
|
var DERIVED = /(_fts|_words|_stems|_trigrams|_pending)$|^(embeddings|chunks|chunk_messages|mentions|involvements|search_terms)$|^vector_index/;
|
|
@@ -58682,7 +58922,7 @@ var freeBytesOf = /* @__PURE__ */ __name((dir) => {
|
|
|
58682
58922
|
}, "freeBytesOf");
|
|
58683
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");
|
|
58684
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");
|
|
58685
|
-
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");
|
|
58686
58926
|
var versionOf = /* @__PURE__ */ __name((database) => Number(database.prepare("SELECT max(version) AS version FROM main.schema_migrations").get()?.version ?? 0), "versionOf");
|
|
58687
58927
|
var tableBytes = /* @__PURE__ */ __name((database, tables) => {
|
|
58688
58928
|
try {
|
|
@@ -58836,16 +59076,16 @@ var rebuild = /* @__PURE__ */ __name((database, table, sql2) => {
|
|
|
58836
59076
|
const aside = `__rollback_${table}`;
|
|
58837
59077
|
database.exec(`ALTER TABLE ${quote2(table)} RENAME TO ${quote2(aside)}`);
|
|
58838
59078
|
database.exec(sql2);
|
|
58839
|
-
const kept2 = new Set(
|
|
58840
|
-
const columns2 =
|
|
59079
|
+
const kept2 = new Set(columnsOf5(database, "main", aside));
|
|
59080
|
+
const columns2 = columnsOf5(database, "main", table).filter((column2) => kept2.has(column2));
|
|
58841
59081
|
const rowid = keepsRowid(database, "main", table) ? ["rowid"] : [];
|
|
58842
59082
|
const list2 = [...rowid, ...columns2.map(quote2)].join(", ");
|
|
58843
59083
|
database.exec(`INSERT INTO ${quote2(table)} (${list2}) SELECT ${list2} FROM ${quote2(aside)}`);
|
|
58844
59084
|
database.exec(`DROP TABLE ${quote2(aside)}`);
|
|
58845
59085
|
}, "rebuild");
|
|
58846
59086
|
var restoreRows = /* @__PURE__ */ __name((database, table) => {
|
|
58847
|
-
const copied = new Set(
|
|
58848
|
-
const columns2 =
|
|
59087
|
+
const copied = new Set(columnsOf5(database, SCHEMA, table));
|
|
59088
|
+
const columns2 = columnsOf5(database, "main", table).filter((column2) => copied.has(column2));
|
|
58849
59089
|
const rowid = keepsRowid(database, "main", table) && copied.has(ROWID);
|
|
58850
59090
|
const into = [...rowid ? ["rowid"] : [], ...columns2.map(quote2)].join(", ");
|
|
58851
59091
|
const from2 = [...rowid ? [ROWID] : [], ...columns2.map(quote2)].join(", ");
|
|
@@ -58896,7 +59136,7 @@ var rollBack2 = /* @__PURE__ */ __name((database, path) => {
|
|
|
58896
59136
|
return { ...result, foreignKeyViolations };
|
|
58897
59137
|
}, "rollBack");
|
|
58898
59138
|
|
|
58899
|
-
// 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
|
|
58900
59140
|
var V31_TABLES = [
|
|
58901
59141
|
"accounts",
|
|
58902
59142
|
"account_identities",
|
|
@@ -59025,7 +59265,8 @@ var MANIFEST = [
|
|
|
59025
59265
|
{ name: "20261110020704_version-63-people-ties-messages-crm", version: 63, minCompatible: 56 },
|
|
59026
59266
|
{ name: "20261110084658_version-64-deal-link-triggers", version: 64, minCompatible: 56 },
|
|
59027
59267
|
{ name: "20261110182602_version-65-found-task-titles", version: 65, minCompatible: 56 },
|
|
59028
|
-
{ 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 }
|
|
59029
59270
|
];
|
|
59030
59271
|
var generatedMigrations = /* @__PURE__ */ __name((manifest = MANIFEST, generated = GENERATED) => {
|
|
59031
59272
|
const migrations = [];
|
|
@@ -59061,7 +59302,7 @@ var generatedMigrations = /* @__PURE__ */ __name((manifest = MANIFEST, generated
|
|
|
59061
59302
|
return migrations;
|
|
59062
59303
|
}, "generatedMigrations");
|
|
59063
59304
|
|
|
59064
|
-
// 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
|
|
59065
59306
|
var MIGRATIONS = generatedMigrations();
|
|
59066
59307
|
var HISTORY = `CREATE TABLE IF NOT EXISTS schema_migrations (
|
|
59067
59308
|
version INTEGER PRIMARY KEY,
|
|
@@ -59158,7 +59399,7 @@ var migrate = /* @__PURE__ */ __name((database, { migrations = MIGRATIONS, now:
|
|
|
59158
59399
|
}
|
|
59159
59400
|
}, "migrate");
|
|
59160
59401
|
|
|
59161
|
-
// 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
|
|
59162
59403
|
var fillJoinKeys = /* @__PURE__ */ __name((database, { batch = 2e3 } = {}) => {
|
|
59163
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 ?");
|
|
59164
59405
|
if (pending.get(0, 1) === void 0)
|
|
@@ -59180,7 +59421,7 @@ var fillJoinKeys = /* @__PURE__ */ __name((database, { batch = 2e3 } = {}) => {
|
|
|
59180
59421
|
}
|
|
59181
59422
|
}, "fillJoinKeys");
|
|
59182
59423
|
|
|
59183
|
-
// 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
|
|
59184
59425
|
var openSqlite = /* @__PURE__ */ __name(async (path, { readOnly = false } = {}) => {
|
|
59185
59426
|
refuseOwnerStoreInTests(path);
|
|
59186
59427
|
const opened = "Bun" in globalThis ? await openUnderBun(path, readOnly) : await openUnderNode(path, readOnly);
|
|
@@ -59194,8 +59435,8 @@ var openSqlite = /* @__PURE__ */ __name(async (path, { readOnly = false } = {})
|
|
|
59194
59435
|
}, "openSqlite");
|
|
59195
59436
|
var openUnderNode = /* @__PURE__ */ __name(async (path, readOnly) => {
|
|
59196
59437
|
quietSqliteWarning();
|
|
59197
|
-
const { drizzle } = await import("./node-
|
|
59198
|
-
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");
|
|
59199
59440
|
const client = await nodeClient(path, { readOnly });
|
|
59200
59441
|
try {
|
|
59201
59442
|
if (!readOnly)
|
|
@@ -59209,8 +59450,8 @@ var openUnderNode = /* @__PURE__ */ __name(async (path, readOnly) => {
|
|
|
59209
59450
|
}
|
|
59210
59451
|
}, "openUnderNode");
|
|
59211
59452
|
var openUnderBun = /* @__PURE__ */ __name(async (path, readOnly) => {
|
|
59212
|
-
const { bunClient, cacheOverBunSqlite } = await import("./bun-sqlite-
|
|
59213
|
-
const { drizzle } = await import("./bun-
|
|
59453
|
+
const { bunClient, cacheOverBunSqlite } = await import("./bun-sqlite-KDGWBNOR.js");
|
|
59454
|
+
const { drizzle } = await import("./bun-FVTOBYZ2.js");
|
|
59214
59455
|
const client = await bunClient(path, readOnly ? { readonly: true, create: false } : void 0);
|
|
59215
59456
|
try {
|
|
59216
59457
|
if (!readOnly)
|
|
@@ -59224,7 +59465,7 @@ var openUnderBun = /* @__PURE__ */ __name(async (path, readOnly) => {
|
|
|
59224
59465
|
}
|
|
59225
59466
|
}, "openUnderBun");
|
|
59226
59467
|
|
|
59227
|
-
// 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
|
|
59228
59469
|
var PAYMENT_FACTS_TO_MOVE = "payment_facts_to_move";
|
|
59229
59470
|
var paymentOf = /* @__PURE__ */ __name((metadata3) => {
|
|
59230
59471
|
try {
|
|
@@ -59292,7 +59533,7 @@ var movePaymentFacts = /* @__PURE__ */ __name((context) => {
|
|
|
59292
59533
|
});
|
|
59293
59534
|
}, "movePaymentFacts");
|
|
59294
59535
|
|
|
59295
|
-
// 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
|
|
59296
59537
|
var readCompatibility = /* @__PURE__ */ __name((database, command) => {
|
|
59297
59538
|
const ours = MIGRATIONS.at(-1)?.version ?? 0;
|
|
59298
59539
|
if (!database.prepare("SELECT 1 FROM sqlite_master WHERE type='table' AND name='schema_migrations'").get())
|
|
@@ -59310,7 +59551,7 @@ var assertReadCompatible = /* @__PURE__ */ __name((database, command) => {
|
|
|
59310
59551
|
throw new CliError("configuration_error", `The store needs schema ${MIGRATIONS.at(-1)?.version ?? 0} maintenance before a read-only open`);
|
|
59311
59552
|
}, "assertReadCompatible");
|
|
59312
59553
|
|
|
59313
|
-
// 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
|
|
59314
59555
|
var SUGGESTED_LINKS_TO_MOVE = "suggested_links_to_move";
|
|
59315
59556
|
var proposerOf2 = /* @__PURE__ */ __name((provenance2) => {
|
|
59316
59557
|
if (provenance2?.startsWith("rule:"))
|
|
@@ -59356,7 +59597,7 @@ var moveSuggestedLinks = /* @__PURE__ */ __name((database, now2) => {
|
|
|
59356
59597
|
});
|
|
59357
59598
|
}, "moveSuggestedLinks");
|
|
59358
59599
|
|
|
59359
|
-
// 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
|
|
59360
59601
|
var TEST_ACCOUNTS_TO_PURGE = "test_accounts_to_purge";
|
|
59361
59602
|
var TEST_PROVIDER = "chat";
|
|
59362
59603
|
var purgeTestAccounts = /* @__PURE__ */ __name((context, warn) => {
|
|
@@ -59377,7 +59618,7 @@ var purgeTestAccounts = /* @__PURE__ */ __name((context, warn) => {
|
|
|
59377
59618
|
}
|
|
59378
59619
|
}, "purgeTestAccounts");
|
|
59379
59620
|
|
|
59380
|
-
// 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
|
|
59381
59622
|
var BACKFILL_ON_OPEN = 5e3;
|
|
59382
59623
|
var NOT_WRITABLE = /* @__PURE__ */ new Set(["EACCES", "EPERM", "EROFS"]);
|
|
59383
59624
|
var createWritable = /* @__PURE__ */ __name((file) => {
|
|
@@ -59489,7 +59730,7 @@ var openStoreContext = /* @__PURE__ */ __name(async (options = {}) => {
|
|
|
59489
59730
|
}
|
|
59490
59731
|
}, "openStoreContext");
|
|
59491
59732
|
|
|
59492
|
-
// 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
|
|
59493
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";
|
|
59494
59735
|
var productOperationsOver = /* @__PURE__ */ __name((context) => {
|
|
59495
59736
|
const { database, now: now2 } = context;
|
|
@@ -59597,13 +59838,13 @@ var productsStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
59597
59838
|
};
|
|
59598
59839
|
}, "productsStoreOver");
|
|
59599
59840
|
|
|
59600
|
-
// 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
|
|
59601
59842
|
import { createHash as createHash20 } from "node:crypto";
|
|
59602
59843
|
|
|
59603
|
-
// 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
|
|
59604
59845
|
import { createHash as createHash19 } from "node:crypto";
|
|
59605
59846
|
|
|
59606
|
-
// 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
|
|
59607
59848
|
var text6 = /* @__PURE__ */ __name((max) => pipe(string(), minLength(1), maxLength(max)), "text");
|
|
59608
59849
|
var ref = text6(2048);
|
|
59609
59850
|
var timestamp2 = pipe(number(), safeInteger(), minValue(0));
|
|
@@ -59673,7 +59914,7 @@ var projectAnnotationsSchema = strictObject({
|
|
|
59673
59914
|
}))
|
|
59674
59915
|
});
|
|
59675
59916
|
|
|
59676
|
-
// 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
|
|
59677
59918
|
var PROJECT_ANNOTATIONS_MAX_BYTES = 4 * 1024 * 1024;
|
|
59678
59919
|
var invalid10 = /* @__PURE__ */ __name((field4) => {
|
|
59679
59920
|
throw new CliError("validation_error", `invalid project annotations.${field4}`);
|
|
@@ -59806,7 +60047,7 @@ var projectAnnotationsFingerprint = /* @__PURE__ */ __name((json3) => {
|
|
|
59806
60047
|
return createHash19("sha256").update(JSON.stringify(normalized)).digest("hex");
|
|
59807
60048
|
}, "projectAnnotationsFingerprint");
|
|
59808
60049
|
|
|
59809
|
-
// 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
|
|
59810
60051
|
var hash = pipe(string(), regex(/^[a-f0-9]{64}$/));
|
|
59811
60052
|
var ref2 = pipe(string(), minLength(1), maxLength(2048));
|
|
59812
60053
|
var targetSchema = strictObject({
|
|
@@ -59913,7 +60154,7 @@ var planBoundProjectAnnotations = /* @__PURE__ */ __name((manifest, manifest_fin
|
|
|
59913
60154
|
}, "planBoundProjectAnnotations");
|
|
59914
60155
|
var planProjectAnnotations = /* @__PURE__ */ __name((json3, target, bindings) => planBoundProjectAnnotations(decodeProjectAnnotations(json3), projectAnnotationsFingerprint(json3), target, bindings), "planProjectAnnotations");
|
|
59915
60156
|
|
|
59916
|
-
// 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
|
|
59917
60158
|
import { createHash as createHash21 } from "node:crypto";
|
|
59918
60159
|
var text7 = /* @__PURE__ */ __name((max) => pipe(string(), minLength(1), maxLength(max)), "text");
|
|
59919
60160
|
var timestamp3 = pipe(number(), safeInteger(), minValue(0));
|
|
@@ -60007,7 +60248,7 @@ var projectAnnotationSnapshotFingerprint = /* @__PURE__ */ __name((json3) => {
|
|
|
60007
60248
|
})).digest("hex");
|
|
60008
60249
|
}, "projectAnnotationSnapshotFingerprint");
|
|
60009
60250
|
|
|
60010
|
-
// 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
|
|
60011
60252
|
var projectAnnotationRequest = /* @__PURE__ */ __name((request, restore = false) => {
|
|
60012
60253
|
if (!request || typeof request !== "object" || Array.isArray(request))
|
|
60013
60254
|
throw new CliError("validation_error", "project annotation request is required");
|
|
@@ -60024,7 +60265,7 @@ var projectAnnotationRequest = /* @__PURE__ */ __name((request, restore = false)
|
|
|
60024
60265
|
return { snapshot: snapshot2, projectId: Number(request.project.slice(8)) };
|
|
60025
60266
|
}, "projectAnnotationRequest");
|
|
60026
60267
|
|
|
60027
|
-
// 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
|
|
60028
60269
|
var SnapshotBudget = class {
|
|
60029
60270
|
static {
|
|
60030
60271
|
__name(this, "SnapshotBudget");
|
|
@@ -60050,13 +60291,13 @@ var SnapshotBudget = class {
|
|
|
60050
60291
|
}
|
|
60051
60292
|
};
|
|
60052
60293
|
|
|
60053
|
-
// 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
|
|
60054
60295
|
import { createHash as createHash23 } from "node:crypto";
|
|
60055
60296
|
|
|
60056
|
-
// 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
|
|
60057
60298
|
var planProjectAnnotationSnapshot = /* @__PURE__ */ __name((json3, target, bindings) => planBoundProjectAnnotations(decodeProjectAnnotationSnapshot(json3), projectAnnotationSnapshotFingerprint(json3), target, bindings), "planProjectAnnotationSnapshot");
|
|
60058
60299
|
|
|
60059
|
-
// 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
|
|
60060
60301
|
import { createHash as createHash22 } from "node:crypto";
|
|
60061
60302
|
var invalid12 = /* @__PURE__ */ __name(() => {
|
|
60062
60303
|
throw new CliError("configuration_error", "project snapshot has an unavailable or unsupported dependency");
|
|
@@ -60199,7 +60440,7 @@ var ProjectSnapshotSources = class {
|
|
|
60199
60440
|
}
|
|
60200
60441
|
};
|
|
60201
60442
|
|
|
60202
|
-
// 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
|
|
60203
60444
|
var unsupported = /* @__PURE__ */ __name(() => {
|
|
60204
60445
|
throw new CliError("configuration_error", "project snapshot has unsupported metadata, deletion or account scope");
|
|
60205
60446
|
}, "unsupported");
|
|
@@ -60377,7 +60618,7 @@ var projectAnnotationSnapshot = /* @__PURE__ */ __name((database, projectId2, bu
|
|
|
60377
60618
|
return { snapshot: snapshot2, read_bytes: budget.bytes, records: budget.records };
|
|
60378
60619
|
}), "projectAnnotationSnapshot");
|
|
60379
60620
|
|
|
60380
|
-
// 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
|
|
60381
60622
|
var previewAnnotationSnapshot = /* @__PURE__ */ __name((database, projectId2, manifest, bindings, budget) => read(database, () => {
|
|
60382
60623
|
const current2 = projectAnnotationSnapshot(database, projectId2, budget).snapshot;
|
|
60383
60624
|
const sources = new ProjectSnapshotSources(database, budget);
|
|
@@ -60439,7 +60680,7 @@ var previewAnnotationSnapshot = /* @__PURE__ */ __name((database, projectId2, ma
|
|
|
60439
60680
|
};
|
|
60440
60681
|
}), "previewAnnotationSnapshot");
|
|
60441
60682
|
|
|
60442
|
-
// 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
|
|
60443
60684
|
var metadataOf2 = /* @__PURE__ */ __name((database, link3, to) => {
|
|
60444
60685
|
const provenance2 = link3.provenance === null ? {} : { provenance: link3.provenance };
|
|
60445
60686
|
if (link3.kind === "evidence" && to)
|
|
@@ -60506,7 +60747,7 @@ var restoreAnnotationRecords = /* @__PURE__ */ __name((database, projectId2, sna
|
|
|
60506
60747
|
return mappings;
|
|
60507
60748
|
}, "restoreAnnotationRecords");
|
|
60508
60749
|
|
|
60509
|
-
// 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
|
|
60510
60751
|
var projectAnnotationStoreOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
60511
60752
|
async preview(request) {
|
|
60512
60753
|
const { snapshot: snapshot2, projectId: projectId2 } = projectAnnotationRequest(request);
|
|
@@ -60536,7 +60777,7 @@ var projectAnnotationStoreOver = /* @__PURE__ */ __name(({ database }) => ({
|
|
|
60536
60777
|
}
|
|
60537
60778
|
}), "projectAnnotationStoreOver");
|
|
60538
60779
|
|
|
60539
|
-
// 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
|
|
60540
60781
|
var isDerived = /* @__PURE__ */ __name((role) => role.startsWith("fields."), "isDerived");
|
|
60541
60782
|
var recordRelationsOver = /* @__PURE__ */ __name(({ database }) => {
|
|
60542
60783
|
const sql2 = /* @__PURE__ */ __name((text8) => database.prepare(text8), "sql");
|
|
@@ -60607,7 +60848,7 @@ var recordRelationsOver = /* @__PURE__ */ __name(({ database }) => {
|
|
|
60607
60848
|
return { entityRef, relatedOf, storedRelations, relate, missingOf };
|
|
60608
60849
|
}, "recordRelationsOver");
|
|
60609
60850
|
|
|
60610
|
-
// 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
|
|
60611
60852
|
var recordRemapOver = /* @__PURE__ */ __name(({ database, now: now2 }) => {
|
|
60612
60853
|
const pointedAt = /* @__PURE__ */ __name((type, id2) => {
|
|
60613
60854
|
for (const { table, pointer } of pointerPairs(database))
|
|
@@ -60661,7 +60902,7 @@ var recordRemapOver = /* @__PURE__ */ __name(({ database, now: now2 }) => {
|
|
|
60661
60902
|
return { pointedAt, remap };
|
|
60662
60903
|
}, "recordRemapOver");
|
|
60663
60904
|
|
|
60664
|
-
// 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
|
|
60665
60906
|
var runs = 0;
|
|
60666
60907
|
var PAGE = 500;
|
|
60667
60908
|
var recordRunOver = /* @__PURE__ */ __name((context, writes) => {
|
|
@@ -60874,7 +61115,7 @@ var waitingPointer = /* @__PURE__ */ __name((index2, missing4) => {
|
|
|
60874
61115
|
return pointerOf("records", index2, "fields", key2);
|
|
60875
61116
|
}, "waitingPointer");
|
|
60876
61117
|
|
|
60877
|
-
// 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
|
|
60878
61119
|
var valuesOf = /* @__PURE__ */ __name((value) => (Array.isArray(value) ? value : [value]).filter((one2) => typeof one2 === "string"), "valuesOf");
|
|
60879
61120
|
var SCHEME = /^(email|domain|tax-id:[a-z]{2}|registration:[a-z]{2})$/;
|
|
60880
61121
|
var ORG_EMAIL = "org-email";
|
|
@@ -61040,7 +61281,7 @@ var renameMade = /* @__PURE__ */ __name(({ database, now: now2 }, type, id2, nam
|
|
|
61040
61281
|
]);
|
|
61041
61282
|
}, "renameMade");
|
|
61042
61283
|
|
|
61043
|
-
// 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
|
|
61044
61285
|
var productFields = /* @__PURE__ */ __name((fields4) => ({
|
|
61045
61286
|
name: given2(fields4, "name"),
|
|
61046
61287
|
unit: given2(fields4, "unit"),
|
|
@@ -61163,7 +61404,7 @@ var DIRECT_PROJECTORS = {
|
|
|
61163
61404
|
lead: dealProjector("lead")
|
|
61164
61405
|
};
|
|
61165
61406
|
|
|
61166
|
-
// 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
|
|
61167
61408
|
var TEXT_ONLY = { storage: "text", localPath: null };
|
|
61168
61409
|
var textOf7 = /* @__PURE__ */ __name(({ fields: fields4, externalId }) => {
|
|
61169
61410
|
const text8 = String(fields4.text ?? "");
|
|
@@ -61232,7 +61473,7 @@ var DOCUMENT_PROJECTORS = {
|
|
|
61232
61473
|
}
|
|
61233
61474
|
};
|
|
61234
61475
|
|
|
61235
|
-
// 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
|
|
61236
61477
|
var allocatedByOthers = /* @__PURE__ */ __name((context, paymentId) => {
|
|
61237
61478
|
const importer = authorActor(context, IMPORTER).actor;
|
|
61238
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;
|
|
@@ -61442,7 +61683,7 @@ var MONEY_PROJECTORS = {
|
|
|
61442
61683
|
}
|
|
61443
61684
|
};
|
|
61444
61685
|
|
|
61445
|
-
// 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
|
|
61446
61687
|
var CALLS_CALENDAR = "calls";
|
|
61447
61688
|
var importOnly = /* @__PURE__ */ __name((source2, type) => {
|
|
61448
61689
|
if (!isImportedProvider(source2.provider))
|
|
@@ -61617,7 +61858,7 @@ var PHONE_PROJECTORS = {
|
|
|
61617
61858
|
}
|
|
61618
61859
|
};
|
|
61619
61860
|
|
|
61620
|
-
// 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
|
|
61621
61862
|
var RECORD_PROJECTORS = {
|
|
61622
61863
|
...MONEY_PROJECTORS,
|
|
61623
61864
|
...DIRECT_PROJECTORS,
|
|
@@ -61628,7 +61869,7 @@ var RECORD_PROJECTORS = {
|
|
|
61628
61869
|
project: null
|
|
61629
61870
|
};
|
|
61630
61871
|
|
|
61631
|
-
// 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
|
|
61632
61873
|
var recordSettlingOver = /* @__PURE__ */ __name(({ database }, finance) => {
|
|
61633
61874
|
const sql2 = /* @__PURE__ */ __name((text8) => database.prepare(text8), "sql");
|
|
61634
61875
|
const freeOn = /* @__PURE__ */ __name((invoice, payment) => {
|
|
@@ -61690,7 +61931,7 @@ var recordSettlingOver = /* @__PURE__ */ __name(({ database }, finance) => {
|
|
|
61690
61931
|
return { settle, checkShares };
|
|
61691
61932
|
}, "recordSettlingOver");
|
|
61692
61933
|
|
|
61693
|
-
// 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
|
|
61694
61935
|
import { createHash as createHash24 } from "node:crypto";
|
|
61695
61936
|
var VOLATILE = /* @__PURE__ */ new Set(["id", "created_at", "updated_at", "metadata"]);
|
|
61696
61937
|
var content = /* @__PURE__ */ __name((row2) => row2 === void 0 ? null : Object.fromEntries(Object.entries(row2).filter(([column2]) => !VOLATILE.has(column2))), "content");
|
|
@@ -61706,7 +61947,7 @@ var importStampsOver = /* @__PURE__ */ __name(({ database }) => {
|
|
|
61706
61947
|
return { stamp, untouched };
|
|
61707
61948
|
}, "importStampsOver");
|
|
61708
61949
|
|
|
61709
|
-
// 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
|
|
61710
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";
|
|
61711
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";
|
|
61712
61953
|
var PRICE_REF = /^subscription_price:([1-9]\d{0,15})$/;
|
|
@@ -61784,7 +62025,7 @@ var subscriptionOperationsOver = /* @__PURE__ */ __name((context) => {
|
|
|
61784
62025
|
const row2 = rowOf3(reference2);
|
|
61785
62026
|
return { ...subscriptionOf(row2), prices: pricesOf2(Number(row2.id)) };
|
|
61786
62027
|
}, "detailOf");
|
|
61787
|
-
const
|
|
62028
|
+
const columnsOf6 = /* @__PURE__ */ __name((fields4, base) => {
|
|
61788
62029
|
const kept2 = /* @__PURE__ */ __name((given3, column2, read2) => given3 === void 0 ? base[column2] ?? null : read2(given3), "kept");
|
|
61789
62030
|
const day3 = /* @__PURE__ */ __name((given3, column2, what) => kept2(given3, column2, (value) => isoDate(value, what)), "day");
|
|
61790
62031
|
const direction = kept2(fields4.direction, "direction", (value) => oneOf3(value, INVOICE_DIRECTIONS, "a subscription's direction"));
|
|
@@ -61871,7 +62112,7 @@ var subscriptionOperationsOver = /* @__PURE__ */ __name((context) => {
|
|
|
61871
62112
|
if (input.prices !== void 0 && (!Array.isArray(input.prices) || input.prices.length > 100))
|
|
61872
62113
|
refuse("a subscription takes at most 100 prices", "subscription.field");
|
|
61873
62114
|
const id2 = write(database, () => {
|
|
61874
|
-
const columns2 =
|
|
62115
|
+
const columns2 = columnsOf6(input, {});
|
|
61875
62116
|
const by = written(input);
|
|
61876
62117
|
const at2 = now2();
|
|
61877
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);
|
|
@@ -61901,7 +62142,7 @@ var subscriptionOperationsOver = /* @__PURE__ */ __name((context) => {
|
|
|
61901
62142
|
const row2 = rowOf3(reference2);
|
|
61902
62143
|
writable(row2, by);
|
|
61903
62144
|
write(database, () => {
|
|
61904
|
-
const columns2 =
|
|
62145
|
+
const columns2 = columnsOf6(fields4, row2);
|
|
61905
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));
|
|
61906
62147
|
});
|
|
61907
62148
|
return detailOf(`subscription:${row2.id}`);
|
|
@@ -61943,7 +62184,7 @@ var subscriptionsStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
61943
62184
|
};
|
|
61944
62185
|
}, "subscriptionsStoreOver");
|
|
61945
62186
|
|
|
61946
|
-
// 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
|
|
61947
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";
|
|
61948
62189
|
var SIGNED = "CASE t.direction WHEN 'in' THEN t.amount ELSE -t.amount END";
|
|
61949
62190
|
var walletOperationsOver = /* @__PURE__ */ __name((context) => {
|
|
@@ -62068,7 +62309,7 @@ var walletsStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
62068
62309
|
};
|
|
62069
62310
|
}, "walletsStoreOver");
|
|
62070
62311
|
|
|
62071
|
-
// 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
|
|
62072
62313
|
var specOf = /* @__PURE__ */ __name((type) => RECORD_TYPES[type], "specOf");
|
|
62073
62314
|
var unsettled = /* @__PURE__ */ __name((fields4, relations) => recordFingerprint(fields4, relations.filter((relation) => !AMOUNT_ROLES.includes(relation.role))), "unsettled");
|
|
62074
62315
|
var tableOf2 = /* @__PURE__ */ __name((type) => typeof type === "string" && Object.hasOwn(DECIDED_TABLES, type) ? DECIDED_TABLES[type] : void 0, "tableOf");
|
|
@@ -62327,7 +62568,7 @@ var recordWritesOver = /* @__PURE__ */ __name((context) => {
|
|
|
62327
62568
|
return { writeOne, project: project2, completeDependents, entityRef, missingOf: relations.missingOf };
|
|
62328
62569
|
}, "recordWritesOver");
|
|
62329
62570
|
|
|
62330
|
-
// 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
|
|
62331
62572
|
var LIMIT = 1e3;
|
|
62332
62573
|
var iso16 = /* @__PURE__ */ __name((value) => new Date(Number(value)).toISOString(), "iso");
|
|
62333
62574
|
var checkLimit = /* @__PURE__ */ __name((limit) => {
|
|
@@ -62551,7 +62792,7 @@ var recordStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
62551
62792
|
};
|
|
62552
62793
|
}, "recordStoreOver");
|
|
62553
62794
|
|
|
62554
|
-
// 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
|
|
62555
62796
|
var templateOf = /* @__PURE__ */ __name((row2) => ({
|
|
62556
62797
|
key: row2.key,
|
|
62557
62798
|
channel: row2.channel,
|
|
@@ -62606,7 +62847,7 @@ var storedTemplateBodies = /* @__PURE__ */ __name((database, key2, language) =>
|
|
|
62606
62847
|
return Object.fromEntries(rows.map((row2) => [row2.channel, row2.body]));
|
|
62607
62848
|
}, "storedTemplateBodies");
|
|
62608
62849
|
|
|
62609
|
-
// 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
|
|
62610
62851
|
var refusalOf2 = /* @__PURE__ */ __name((error) => error instanceof Error && error.name === "DrizzleQueryError" && error.cause instanceof CliError ? error.cause : error, "refusalOf");
|
|
62611
62852
|
var wrapped2 = /* @__PURE__ */ new WeakMap();
|
|
62612
62853
|
var storeErrors = /* @__PURE__ */ __name((area) => {
|
|
@@ -62641,7 +62882,7 @@ var storeErrors = /* @__PURE__ */ __name((area) => {
|
|
|
62641
62882
|
return proxy;
|
|
62642
62883
|
}, "storeErrors");
|
|
62643
62884
|
|
|
62644
|
-
// 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
|
|
62645
62886
|
var markRange = /* @__PURE__ */ __name(({ orm, now: now2 }, chatKey, from2, to) => {
|
|
62646
62887
|
const touching = and(eq(syncRanges.chatId, chatKey), lte(syncRanges.fromKey, to + 1), gte(syncRanges.toKey, from2 - 1));
|
|
62647
62888
|
let merged2 = { from: from2, to };
|
|
@@ -62654,7 +62895,7 @@ var markRange = /* @__PURE__ */ __name(({ orm, now: now2 }, chatKey, from2, to)
|
|
|
62654
62895
|
}, "markRange");
|
|
62655
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");
|
|
62656
62897
|
|
|
62657
|
-
// 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
|
|
62658
62899
|
var prefixOf2 = /* @__PURE__ */ __name(({ provider, account }) => `task_analysis:${provider}:${account}:`, "prefixOf");
|
|
62659
62900
|
var markOf = /* @__PURE__ */ __name((prefix, row2) => ({
|
|
62660
62901
|
chatId: String(row2.key).slice(prefix.length),
|
|
@@ -62675,7 +62916,7 @@ var setTaskAnalysisMark = /* @__PURE__ */ __name((database, account, { chatId, c
|
|
|
62675
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);
|
|
62676
62917
|
}, "setTaskAnalysisMark");
|
|
62677
62918
|
|
|
62678
|
-
// 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
|
|
62679
62920
|
var keyOf6 = /* @__PURE__ */ __name(({ provider, account }) => `task_rules_until:${provider}:${account}`, "keyOf");
|
|
62680
62921
|
var taskRulesStop = /* @__PURE__ */ __name((database, account) => {
|
|
62681
62922
|
const row2 = database.prepare("SELECT value FROM store_settings WHERE key = ?").get(keyOf6(account));
|
|
@@ -62685,7 +62926,7 @@ var setTaskRulesStop = /* @__PURE__ */ __name((database, account, until, now2) =
|
|
|
62685
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);
|
|
62686
62927
|
}, "setTaskRulesStop");
|
|
62687
62928
|
|
|
62688
|
-
// 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
|
|
62689
62930
|
var syncStoreOver = /* @__PURE__ */ __name((context) => {
|
|
62690
62931
|
const { database } = context;
|
|
62691
62932
|
const { accountPk: accountPk2, findAccountPk: findAccountPk2, chatKeyOf, chatPkFor: chatPkFor2, identityPk: identityPk2, writeMembers: writeMembers2, writeState: writeState2 } = keysOver(context);
|
|
@@ -62744,7 +62985,7 @@ var syncStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
62744
62985
|
};
|
|
62745
62986
|
}, "syncStoreOver");
|
|
62746
62987
|
|
|
62747
|
-
// 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
|
|
62748
62989
|
var tagsStoreOver = /* @__PURE__ */ __name((context) => {
|
|
62749
62990
|
const { database } = context;
|
|
62750
62991
|
return {
|
|
@@ -62766,7 +63007,7 @@ var tagsStoreOver = /* @__PURE__ */ __name((context) => {
|
|
|
62766
63007
|
};
|
|
62767
63008
|
}, "tagsStoreOver");
|
|
62768
63009
|
|
|
62769
|
-
// 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
|
|
62770
63011
|
var IS_IMAGE = sql`(a.kind = 'photo' OR a.mime LIKE 'image/%')`;
|
|
62771
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
|
|
62772
63013
|
WHERE chat_id = ${chatKey} AND deleted_at IS NULL AND trim(text) <> '' AND id <> ${messagePk}
|
|
@@ -62893,7 +63134,7 @@ var savePictureChunks = /* @__PURE__ */ __name(({ orm, now: now2, database }, ac
|
|
|
62893
63134
|
dropUnusedVectors(database, released.map(({ hash: hash2 }) => hash2));
|
|
62894
63135
|
}, "savePictureChunks");
|
|
62895
63136
|
|
|
62896
|
-
// 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
|
|
62897
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,
|
|
62898
63139
|
EXISTS (SELECT 1 FROM embeddings v WHERE v.model = ${model} AND v.content_hash = k.content_hash) AS embedded
|
|
62899
63140
|
FROM messages m
|
|
@@ -62982,7 +63223,7 @@ var nearestMessages = /* @__PURE__ */ __name((context, accountPk2, { limit, quer
|
|
|
62982
63223
|
return plain2(best(found2));
|
|
62983
63224
|
}, "nearestMessages");
|
|
62984
63225
|
|
|
62985
|
-
// 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
|
|
62986
63227
|
var accountVectorsOver = /* @__PURE__ */ __name((context, mail) => {
|
|
62987
63228
|
const { database } = context;
|
|
62988
63229
|
const { findAccountPk: findAccountPk2, findChatPk: findChatPk2, chatKeyOf } = keysOver(context);
|
|
@@ -63241,7 +63482,7 @@ var vectorsStoreOver = /* @__PURE__ */ __name((context, keyed) => ({
|
|
|
63241
63482
|
vectorCounts: /* @__PURE__ */ __name(async (models) => vectorCounts(context, models), "vectorCounts")
|
|
63242
63483
|
}), "vectorsStoreOver");
|
|
63243
63484
|
|
|
63244
|
-
// 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
|
|
63245
63486
|
import { existsSync as existsSync3, readFileSync as readFileSync4 } from "node:fs";
|
|
63246
63487
|
import { dirname as dirname3, join as join4 } from "node:path";
|
|
63247
63488
|
var BOOKKEEPING2 = ["schema_migrations", "store_settings"];
|
|
@@ -63329,10 +63570,10 @@ var lastBackup = /* @__PURE__ */ __name((path) => {
|
|
|
63329
63570
|
}
|
|
63330
63571
|
}, "lastBackup");
|
|
63331
63572
|
|
|
63332
|
-
// 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
|
|
63333
63574
|
var registerProvider2 = /* @__PURE__ */ __name((store, entry2) => store.accounts.registerProvider(entry2), "registerProvider");
|
|
63334
63575
|
|
|
63335
|
-
// 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
|
|
63336
63577
|
var COUNTED_TABLES = [
|
|
63337
63578
|
"accounts",
|
|
63338
63579
|
"chats",
|
|
@@ -63417,7 +63658,7 @@ var storeContents = /* @__PURE__ */ __name((database) => {
|
|
|
63417
63658
|
};
|
|
63418
63659
|
}, "storeContents");
|
|
63419
63660
|
|
|
63420
|
-
// 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
|
|
63421
63662
|
var openStore = /* @__PURE__ */ __name(async (options = {}) => {
|
|
63422
63663
|
const context = await openStoreContext(options);
|
|
63423
63664
|
try {
|