@wirecat/bitrix24-cli 0.4.0 → 0.5.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/CHANGELOG.md +78 -0
- package/README.md +84 -9
- package/dist/api-keys.d.ts +18 -13
- package/dist/api-keys.d.ts.map +1 -1
- package/dist/api-keys.js +79 -22
- package/dist/api-keys.js.map +1 -1
- package/dist/bin/b24.js +2 -2
- package/dist/bitrix/errors.js +1 -1
- package/dist/bitrix/errors.js.map +1 -1
- package/dist/bitrix/transport.d.ts +1 -1
- package/dist/bitrix/transport.d.ts.map +1 -1
- package/dist/bitrix/transport.js +20 -6
- package/dist/bitrix/transport.js.map +1 -1
- package/dist/body.d.ts +14 -0
- package/dist/body.d.ts.map +1 -0
- package/dist/body.js +44 -0
- package/dist/body.js.map +1 -0
- package/dist/bundle/{chunk-JAS3OZSP.js → all-profiles-CANIDIDS.js} +12 -7
- package/dist/bundle/{anthropic-QCYLKSJJ.js → anthropic-JUJB4DCF.js} +5 -5
- package/dist/bundle/{app-server-FSLZ2Y6N.js → app-server-3V5Z4PTK.js} +68 -54
- package/dist/bundle/b24.js +18 -12
- package/dist/bundle/{bun-UYRQXF33.js → bun-LKMV5TY7.js} +2 -2
- package/dist/bundle/{bun-sqlite-GXME7EMT.js → bun-sqlite-S56EF74S.js} +3 -3
- package/dist/bundle/{chunk-D2IRPC5I.js → chunk-2I4KWS3H.js} +6 -6
- package/dist/bundle/chunk-36PO5NWY.js +147 -0
- package/dist/bundle/{chunk-COOOXDKZ.js → chunk-42F7Q7V6.js} +3 -3
- package/dist/bundle/{chunk-POUSZWMP.js → chunk-4D3K6GZW.js} +18 -4
- package/dist/bundle/chunk-5D4MJQ6X.js +22 -0
- package/dist/bundle/chunk-5JOPERVF.js +84 -0
- package/dist/bundle/chunk-6A4UPWDC.js +15 -0
- package/dist/bundle/{chunk-O7FVOICH.js → chunk-6MGWIZG4.js} +1 -1
- package/dist/bundle/{chunk-B252WFK7.js → chunk-6YJTNZ7U.js} +13 -13
- package/dist/bundle/{chunk-2D5W4LWL.js → chunk-7FBFJ6B4.js} +4 -2
- package/dist/bundle/chunk-7VCMOTQP.js +55 -0
- package/dist/bundle/{chunk-6BLVBGRK.js → chunk-A5IMMGYU.js} +36 -34
- package/dist/bundle/{chunk-66QLBRIT.js → chunk-ASEHTBNK.js} +1 -1
- package/dist/bundle/{chunk-MY6FAZRA.js → chunk-B6LPJYPQ.js} +2 -2
- package/dist/bundle/{chunk-EQLWU6ZB.js → chunk-BHEE2K6C.js} +7 -7
- package/dist/bundle/chunk-BYZQBE63.js +971 -0
- package/dist/bundle/{chunk-J7OMY6EO.js → chunk-COKGNTDQ.js} +1477 -723
- package/dist/bundle/{chunk-QVZSLBR6.js → chunk-DVFYRQGE.js} +1 -1
- package/dist/bundle/{chunk-Q7Z5IMVY.js → chunk-DVSIBZ3G.js} +1 -1
- package/dist/bundle/chunk-EJEIXC6Y.js +273 -0
- package/dist/bundle/chunk-EYTGCM44.js +130 -0
- package/dist/bundle/{chunk-SBW2Y7AZ.js → chunk-EYYOKT23.js} +26 -26
- package/dist/bundle/{chunk-Y5PPMGCS.js → chunk-FCWPIWSR.js} +2 -2
- package/dist/bundle/{chunk-AOUNT22U.js → chunk-FSWRMQWX.js} +2 -2
- package/dist/bundle/{chunk-ADLS6FVG.js → chunk-FXBHOCJK.js} +1 -1
- package/dist/bundle/chunk-G5MW6RCM.js +723 -0
- package/dist/bundle/{chunk-4OVK5XW2.js → chunk-GLTKRLFT.js} +8 -8
- package/dist/bundle/chunk-GUUZQ7NE.js +581 -0
- package/dist/bundle/{chunk-XOPMSWFC.js → chunk-H6RIPOOI.js} +36 -3
- package/dist/bundle/{chunk-GTMCLOYY.js → chunk-HGFNC4CR.js} +1447 -430
- package/dist/bundle/{chunk-IF27EQN6.js → chunk-IERYD2N2.js} +6 -6
- package/dist/bundle/{chunk-Q4ILKTV4.js → chunk-IGCLMEMB.js} +3 -3
- package/dist/bundle/{chunk-2IZ6GGU2.js → chunk-J7WCSZ2Q.js} +410 -918
- package/dist/bundle/{chunk-CR3TLGM4.js → chunk-JZYHQ4HB.js} +3 -3
- package/dist/bundle/{chunk-XR5SUCAC.js → chunk-K4QM3X5F.js} +4 -4
- package/dist/bundle/{chunk-OWILUBCI.js → chunk-KFSMY7SZ.js} +2 -2
- package/dist/bundle/{chunk-AMVRNYD6.js → chunk-KPEDH5T4.js} +1 -1
- package/dist/bundle/{chunk-NEK7LKC6.js → chunk-KUY7LII2.js} +4 -4
- package/dist/bundle/{chunk-NDSOBIR3.js → chunk-LFXDHLFR.js} +3 -3
- package/dist/bundle/{chunk-ZU4HXKEW.js → chunk-LGLT4JB6.js} +3 -3
- package/dist/bundle/{chunk-EIGPMMGC.js → chunk-LM4OOBAW.js} +3 -3
- package/dist/bundle/chunk-M74BSKMA.js +234 -0
- package/dist/bundle/{chunk-MPI2FDJ4.js → chunk-MMMT6ORT.js} +11 -11
- package/dist/bundle/{chunk-F5NH3UJQ.js → chunk-NGYD6QTE.js} +2 -2
- package/dist/bundle/{chunk-6ERX33NC.js → chunk-NO6QOPVT.js} +10 -19
- package/dist/bundle/chunk-O6XC7DZI.js +804 -0
- package/dist/bundle/chunk-OE3NFB53.js +64 -0
- package/dist/bundle/{chunk-VTIUWHZ3.js → chunk-OUMFNB34.js} +13 -149
- package/dist/bundle/{chunk-VMQL4GNH.js → chunk-P2RQTNVJ.js} +806 -850
- package/dist/bundle/{chunk-XKQZLR2X.js → chunk-PBIBGIZ7.js} +1 -1
- package/dist/bundle/{chunk-YFZXI3NN.js → chunk-Q6VQHTRW.js} +2 -2
- package/dist/bundle/{chunk-OKDC6CLH.js → chunk-QHBCNVUG.js} +5 -5
- package/dist/bundle/{chunk-WJRBX5QB.js → chunk-QNOXAQ6Y.js} +4 -4
- package/dist/bundle/{chunk-GTFRSYYJ.js → chunk-R5F2O5GX.js} +7 -269
- package/dist/bundle/{chunk-OCRCVLZQ.js → chunk-R5PBSKJL.js} +1 -1
- package/dist/bundle/{chunk-JB7OXYAU.js → chunk-RS2BARUU.js} +4 -4
- package/dist/bundle/chunk-TG3DSPT5.js +14 -0
- package/dist/bundle/{chunk-UH56WLDS.js → chunk-U22JMKUO.js} +6 -125
- package/dist/bundle/chunk-U66Q5TVK.js +106 -0
- package/dist/bundle/{chunk-NWKXMMON.js → chunk-UCHMQWON.js} +136 -33
- package/dist/bundle/{chunk-DQIQIZQS.js → chunk-VMJS7FJZ.js} +451 -433
- package/dist/bundle/{chunk-IWEWDVZ6.js → chunk-VMVAQHDC.js} +77 -615
- package/dist/bundle/{chunk-M5XMAUGZ.js → chunk-WWMCJFMT.js} +2 -2
- package/dist/bundle/{chunk-OYLJHX74.js → chunk-XTA5TN3H.js} +1 -1
- package/dist/bundle/{chunk-ELBOQHJA.js → chunk-XUHHBEA7.js} +652 -131
- package/dist/bundle/{chunk-BHZ5VDDY.js → chunk-YDZHO4LT.js} +13 -13
- package/dist/bundle/{chunk-NKLLI4B2.js → chunk-ZKINZFIT.js} +6 -6
- package/dist/bundle/{chunk-GTDOUP6L.js → chunk-ZSQXSIFQ.js} +85 -38
- package/dist/bundle/{chunk-LAYH344Y.js → chunk-ZZEHDIEG.js} +58 -54
- package/dist/bundle/command-contract-OQV6H7SR.js +36 -0
- package/dist/bundle/{decode-IF2F2SFC.js → decode-QSTBX4MG.js} +3 -3
- package/dist/bundle/{echarts-WDDVEJO2.js → echarts-JZELFH2N.js} +2 -2
- package/dist/bundle/{embed-VDUGYEAR.js → embed-4RIW2LVH.js} +4 -4
- package/dist/bundle/{embedder-DUN62H3Z.js → embedder-SW7DTWSL.js} +7 -7
- package/dist/bundle/{first-run-NDGYBQEN.js → first-run-7AISOSOM.js} +8 -8
- package/dist/bundle/first-screen-NMHNFZ2B.js +34 -0
- package/dist/bundle/{instructions-JIIKWS7X.js → instructions-BZE5YUGG.js} +1 -1
- package/dist/bundle/{mcp-33JX6KP4.js → mcp-SDWHDJTY.js} +2 -2
- package/dist/bundle/{node-P4E63KXA.js → node-KM3CUABH.js} +9 -9
- package/dist/bundle/{node-K57WT42O.js → node-LTKZIO4U.js} +2 -2
- package/dist/bundle/{node-sqlite-KS6ORRIG.js → node-sqlite-HQ5PN2RH.js} +4 -4
- package/dist/bundle/{oauth-SLSANN37.js → oauth-UH6FOZQL.js} +5 -5
- package/dist/bundle/{open-WJPHADEX.js → open-TSUP3XGL.js} +3 -3
- package/dist/bundle/{openai-HXB3GTOD.js → openai-GVEE52E3.js} +14 -14
- package/dist/bundle/{process-P73TFAXT.js → process-AGXY76ZE.js} +1 -1
- package/dist/bundle/{program-7BMG5NIN.js → program-BI4A4HFJ.js} +1045 -1048
- package/dist/bundle/{prompt-WDPV37R4.js → prompt-NRSUY7FA.js} +3 -3
- package/dist/bundle/{recognize-CXIFL6IV.js → recognize-NPDPQ6PJ.js} +2 -2
- package/dist/bundle/{remote-Q4VJ4OQW.js → remote-HFASMVLB.js} +5 -5
- package/dist/bundle/{rerank-SUFYK63I.js → rerank-TL6Z6F7K.js} +5 -5
- package/dist/bundle/{chunk-XG6QKS7L.js → serve-VB4DHDZQ.js} +8 -6
- package/dist/bundle/server-T5EDRPJI.js +68 -0
- package/dist/bundle/{chunk-K7XWCZF6.js → server-Z6MW6C37.js} +50 -14
- package/dist/bundle/source-4IGO5J7E.js +237 -0
- package/dist/bundle/sqlite-runtime-YS4POY3W.js +17 -0
- package/dist/bundle/{state-EZCCXQV7.js → state-ISZVVZGR.js} +4 -4
- package/dist/bundle/store-IZJBAKJV.js +58 -0
- package/dist/bundle/{store-MZ7JBYR6.js → store-L76MSQC3.js} +17 -12
- package/dist/bundle/store-PBTIB7BD.js +207 -0
- package/dist/bundle/store-maintenance-command-YFKII7TF.js +58 -0
- package/dist/bundle/writer-3O5EYMFE.js +214 -0
- package/dist/commands/api.d.ts.map +1 -1
- package/dist/commands/api.js +34 -33
- package/dist/commands/api.js.map +1 -1
- package/dist/commands/crm-shared.d.ts +4 -0
- package/dist/commands/crm-shared.d.ts.map +1 -0
- package/dist/commands/crm-shared.js +94 -0
- package/dist/commands/crm-shared.js.map +1 -0
- package/dist/commands/crm-writes.d.ts +0 -1
- package/dist/commands/crm-writes.d.ts.map +1 -1
- package/dist/commands/crm-writes.js +31 -92
- package/dist/commands/crm-writes.js.map +1 -1
- package/dist/commands/crm.d.ts.map +1 -1
- package/dist/commands/crm.js +1 -45
- package/dist/commands/crm.js.map +1 -1
- package/dist/commands/session.d.ts.map +1 -1
- package/dist/commands/session.js +1 -0
- package/dist/commands/session.js.map +1 -1
- package/dist/commands/write.d.ts +1 -6
- package/dist/commands/write.d.ts.map +1 -1
- package/dist/commands/write.js +7 -16
- package/dist/commands/write.js.map +1 -1
- package/dist/config.d.ts +0 -5
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +6 -9
- package/dist/config.js.map +1 -1
- package/dist/crm/capabilities.d.ts +7 -0
- package/dist/crm/capabilities.d.ts.map +1 -0
- package/dist/crm/capabilities.js +7 -0
- package/dist/crm/capabilities.js.map +1 -0
- package/dist/crm/conditions.d.ts +1 -1
- package/dist/crm/conditions.d.ts.map +1 -1
- package/dist/crm/conditions.js +3 -5
- package/dist/crm/conditions.js.map +1 -1
- package/dist/crm/custom-query.d.ts +1 -1
- package/dist/crm/custom-query.d.ts.map +1 -1
- package/dist/crm/custom-query.js +2 -2
- package/dist/crm/custom-query.js.map +1 -1
- package/dist/crm/deal.d.ts +4 -28
- package/dist/crm/deal.d.ts.map +1 -1
- package/dist/crm/deal.js +15 -48
- package/dist/crm/deal.js.map +1 -1
- package/dist/crm/fields.d.ts +2 -26
- package/dist/crm/fields.d.ts.map +1 -1
- package/dist/crm/fields.js +2 -67
- package/dist/crm/fields.js.map +1 -1
- package/dist/crm/items.d.ts.map +1 -1
- package/dist/crm/items.js +6 -5
- package/dist/crm/items.js.map +1 -1
- package/dist/crm/lead.d.ts +5 -37
- package/dist/crm/lead.d.ts.map +1 -1
- package/dist/crm/lead.js +15 -61
- package/dist/crm/lead.js.map +1 -1
- package/dist/crm/pipelines.d.ts +5 -0
- package/dist/crm/pipelines.d.ts.map +1 -0
- package/dist/crm/pipelines.js +54 -0
- package/dist/crm/pipelines.js.map +1 -0
- package/dist/crm/product.d.ts.map +1 -1
- package/dist/crm/product.js +2 -2
- package/dist/crm/product.js.map +1 -1
- package/dist/crm/rest3-fields.d.ts +3 -0
- package/dist/crm/rest3-fields.d.ts.map +1 -0
- package/dist/crm/rest3-fields.js +38 -0
- package/dist/crm/rest3-fields.js.map +1 -0
- package/dist/crm/source.d.ts +15 -0
- package/dist/crm/source.d.ts.map +1 -0
- package/dist/crm/source.js +122 -0
- package/dist/crm/source.js.map +1 -0
- package/dist/crm/user.d.ts.map +1 -1
- package/dist/crm/user.js +2 -2
- package/dist/crm/user.js.map +1 -1
- package/dist/crm/values.d.ts +19 -4
- package/dist/crm/values.d.ts.map +1 -1
- package/dist/crm/values.js +28 -2
- package/dist/crm/values.js.map +1 -1
- package/dist/crm/writer.d.ts +9 -0
- package/dist/crm/writer.d.ts.map +1 -0
- package/dist/crm/writer.js +119 -0
- package/dist/crm/writer.js.map +1 -0
- package/dist/program.d.ts.map +1 -1
- package/dist/program.js +51 -6
- package/dist/program.js.map +1 -1
- package/dist/store.d.ts +15 -0
- package/dist/store.d.ts.map +1 -0
- package/dist/store.js +33 -0
- package/dist/store.js.map +1 -0
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +4 -6
- package/skills/bitrix24-cli/SKILL.md +16 -15
- package/dist/bundle/all-profiles-MBQZCOVK.js +0 -24
- package/dist/bundle/chunk-UCLWWSQK.js +0 -48
- package/dist/bundle/command-contract-UON4EIC4.js +0 -30
- package/dist/bundle/first-screen-QAVKP5RF.js +0 -28
- package/dist/bundle/mcp-57EQ6QJO.js +0 -171
- package/dist/bundle/mcp-PFJER2DE.js +0 -87
- package/dist/bundle/serve-B7PGFOC2.js +0 -19
- package/dist/bundle/server-4DBNJWW6.js +0 -58
- package/dist/bundle/server-OKE7SXJ2.js +0 -45
- package/dist/bundle/store-maintenance-command-T5QZMENJ.js +0 -47
- package/dist/commands/doctor.d.ts +0 -77
- package/dist/commands/doctor.d.ts.map +0 -1
- package/dist/commands/doctor.js +0 -74
- package/dist/commands/doctor.js.map +0 -1
- package/dist/commands/fields.d.ts +0 -3
- package/dist/commands/fields.d.ts.map +0 -1
- package/dist/commands/fields.js +0 -45
- package/dist/commands/fields.js.map +0 -1
- package/dist/commands/mcp.d.ts +0 -3
- package/dist/commands/mcp.d.ts.map +0 -1
- package/dist/commands/mcp.js +0 -97
- package/dist/commands/mcp.js.map +0 -1
- package/dist/crm/pipeline.d.ts +0 -17
- package/dist/crm/pipeline.d.ts.map +0 -1
- package/dist/crm/pipeline.js +0 -42
- package/dist/crm/pipeline.js.map +0 -1
- package/dist/crm/stage.d.ts +0 -20
- package/dist/crm/stage.d.ts.map +0 -1
- package/dist/crm/stage.js +0 -65
- package/dist/crm/stage.js.map +0 -1
- package/dist/mcp.d.ts +0 -29
- package/dist/mcp.d.ts.map +0 -1
- package/dist/mcp.js +0 -102
- package/dist/mcp.js.map +0 -1
- /package/dist/bundle/{chunk-NDTJE6JQ.js → chunk-ZQ3GWKDQ.js} +0 -0
|
@@ -8,7 +8,14 @@ import {
|
|
|
8
8
|
sameOrdinaryFile,
|
|
9
9
|
syncDirectory,
|
|
10
10
|
writeFileAtomic
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-6YJTNZ7U.js";
|
|
12
|
+
import {
|
|
13
|
+
newOperationId,
|
|
14
|
+
newSendId
|
|
15
|
+
} from "./chunk-6A4UPWDC.js";
|
|
16
|
+
import {
|
|
17
|
+
MAX_MODEL_IMAGE_BYTES
|
|
18
|
+
} from "./chunk-WWMCJFMT.js";
|
|
12
19
|
import {
|
|
13
20
|
Command,
|
|
14
21
|
DEFAULT_IMAGE_MODEL,
|
|
@@ -20,11 +27,10 @@ import {
|
|
|
20
27
|
WEIGHTS,
|
|
21
28
|
agenda,
|
|
22
29
|
annotate,
|
|
30
|
+
annotateOption,
|
|
23
31
|
attachment,
|
|
24
|
-
codeOf,
|
|
25
32
|
conversation,
|
|
26
33
|
environmentOf,
|
|
27
|
-
guardedWrite,
|
|
28
34
|
historyWindow,
|
|
29
35
|
imageModel,
|
|
30
36
|
imageModelsDirectory,
|
|
@@ -36,29 +42,33 @@ import {
|
|
|
36
42
|
oddName,
|
|
37
43
|
parseDuration,
|
|
38
44
|
placedImage,
|
|
39
|
-
readOnlyLockOf,
|
|
40
45
|
renderAnswer,
|
|
41
46
|
rerankModel,
|
|
42
|
-
sentIds,
|
|
43
47
|
sharedCommand,
|
|
44
48
|
snakeKeys,
|
|
45
49
|
tagging,
|
|
46
50
|
task,
|
|
47
51
|
textModel,
|
|
52
|
+
vectorModelKey
|
|
53
|
+
} from "./chunk-J7WCSZ2Q.js";
|
|
54
|
+
import {
|
|
55
|
+
codeOf,
|
|
56
|
+
guardedWrite,
|
|
57
|
+
readOnlyLockOf,
|
|
58
|
+
sentIds,
|
|
48
59
|
typedCommand,
|
|
49
|
-
vectorModelKey,
|
|
50
60
|
withAttempt
|
|
51
|
-
} from "./chunk-
|
|
61
|
+
} from "./chunk-G5MW6RCM.js";
|
|
52
62
|
import {
|
|
53
63
|
isCliFailure
|
|
54
|
-
} from "./chunk-
|
|
64
|
+
} from "./chunk-5D4MJQ6X.js";
|
|
55
65
|
import {
|
|
56
66
|
isNewer,
|
|
57
67
|
updateCommand
|
|
58
|
-
} from "./chunk-
|
|
68
|
+
} from "./chunk-K4QM3X5F.js";
|
|
59
69
|
import {
|
|
60
70
|
remoteKey
|
|
61
|
-
} from "./chunk-
|
|
71
|
+
} from "./chunk-LM4OOBAW.js";
|
|
62
72
|
import {
|
|
63
73
|
Unzip,
|
|
64
74
|
UnzipInflate,
|
|
@@ -69,32 +79,31 @@ import {
|
|
|
69
79
|
placedText,
|
|
70
80
|
runEmbedders,
|
|
71
81
|
textModelsDirectory
|
|
72
|
-
} from "./chunk-
|
|
82
|
+
} from "./chunk-ZKINZFIT.js";
|
|
73
83
|
import {
|
|
74
84
|
installFiles,
|
|
75
85
|
megabytes
|
|
76
|
-
} from "./chunk-
|
|
77
|
-
import {
|
|
78
|
-
MAX_MODEL_IMAGE_BYTES
|
|
79
|
-
} from "./chunk-M5XMAUGZ.js";
|
|
86
|
+
} from "./chunk-QNOXAQ6Y.js";
|
|
80
87
|
import {
|
|
81
88
|
MAX_ACTIONS,
|
|
82
89
|
ModerationRules,
|
|
83
90
|
act,
|
|
84
|
-
chatReferenceOf,
|
|
85
91
|
defaultRules,
|
|
86
|
-
ensureAccount,
|
|
87
92
|
gather,
|
|
88
|
-
isId,
|
|
89
93
|
judge,
|
|
90
94
|
moderationPathFor,
|
|
91
95
|
nextPoint,
|
|
92
|
-
pickChat,
|
|
93
|
-
pickPerson,
|
|
94
96
|
someUndone,
|
|
95
97
|
validateFormattedText,
|
|
96
98
|
visibleFormattedText
|
|
97
|
-
} from "./chunk-
|
|
99
|
+
} from "./chunk-U22JMKUO.js";
|
|
100
|
+
import {
|
|
101
|
+
chatReferenceOf,
|
|
102
|
+
ensureAccount,
|
|
103
|
+
isId,
|
|
104
|
+
pickChat,
|
|
105
|
+
pickPerson
|
|
106
|
+
} from "./chunk-EYTGCM44.js";
|
|
98
107
|
import {
|
|
99
108
|
AGENDA_COLUMNS,
|
|
100
109
|
CHAT_COLUMNS,
|
|
@@ -157,34 +166,38 @@ import {
|
|
|
157
166
|
validateAst,
|
|
158
167
|
validateFields,
|
|
159
168
|
withoutField
|
|
160
|
-
} from "./chunk-
|
|
169
|
+
} from "./chunk-HGFNC4CR.js";
|
|
161
170
|
import {
|
|
162
171
|
TASK_KINDS,
|
|
163
172
|
TASK_STATES,
|
|
164
173
|
createTaskService,
|
|
165
174
|
isClosedState
|
|
166
|
-
} from "./chunk-
|
|
175
|
+
} from "./chunk-A5IMMGYU.js";
|
|
167
176
|
import {
|
|
168
177
|
DEFAULT_STEMMERS,
|
|
169
178
|
createStemmer,
|
|
170
179
|
fold,
|
|
171
180
|
normalize
|
|
172
|
-
} from "./chunk-
|
|
181
|
+
} from "./chunk-GLTKRLFT.js";
|
|
173
182
|
import {
|
|
174
183
|
DEFAULT_TASK_CATEGORIES,
|
|
175
184
|
FALLBACK_CATEGORY
|
|
176
|
-
} from "./chunk-
|
|
185
|
+
} from "./chunk-QHBCNVUG.js";
|
|
177
186
|
import {
|
|
178
187
|
storePath,
|
|
179
188
|
wirecatDirectory
|
|
180
|
-
} from "./chunk-
|
|
189
|
+
} from "./chunk-KFSMY7SZ.js";
|
|
181
190
|
import {
|
|
182
191
|
COUNTER_FIELDS,
|
|
183
|
-
INTERNAL_NOTES,
|
|
184
192
|
RANKING_TOKENIZER_VERSION,
|
|
185
|
-
UNKNOWN_PROVIDER,
|
|
186
193
|
counterFreshness,
|
|
187
194
|
counterObservationTime,
|
|
195
|
+
rankingOptions,
|
|
196
|
+
rankingQuestion
|
|
197
|
+
} from "./chunk-EJEIXC6Y.js";
|
|
198
|
+
import {
|
|
199
|
+
INTERNAL_NOTES,
|
|
200
|
+
UNKNOWN_PROVIDER,
|
|
188
201
|
formatLocator,
|
|
189
202
|
formatReference,
|
|
190
203
|
isFolderProvider,
|
|
@@ -194,10 +207,11 @@ import {
|
|
|
194
207
|
kindOf,
|
|
195
208
|
parseLocator,
|
|
196
209
|
parseReference,
|
|
197
|
-
providerNamed
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
210
|
+
providerNamed
|
|
211
|
+
} from "./chunk-R5F2O5GX.js";
|
|
212
|
+
import {
|
|
213
|
+
normalizeTag
|
|
214
|
+
} from "./chunk-5JOPERVF.js";
|
|
201
215
|
import {
|
|
202
216
|
EVENT_QUERY,
|
|
203
217
|
MEETING_PROJECT_EVIDENCE_QUERY,
|
|
@@ -224,7 +238,6 @@ import {
|
|
|
224
238
|
meetingTranscriptAnswer,
|
|
225
239
|
meetingsList,
|
|
226
240
|
meetingsQuery,
|
|
227
|
-
normalizeTag,
|
|
228
241
|
parseLucene,
|
|
229
242
|
parseMeetingReference,
|
|
230
243
|
pull,
|
|
@@ -238,7 +251,7 @@ import {
|
|
|
238
251
|
validateQuery,
|
|
239
252
|
walkQuery,
|
|
240
253
|
zonedMoment
|
|
241
|
-
} from "./chunk-
|
|
254
|
+
} from "./chunk-P2RQTNVJ.js";
|
|
242
255
|
import {
|
|
243
256
|
CliError,
|
|
244
257
|
array,
|
|
@@ -259,7 +272,7 @@ import {
|
|
|
259
272
|
singleLine,
|
|
260
273
|
strictObject,
|
|
261
274
|
string
|
|
262
|
-
} from "./chunk-
|
|
275
|
+
} from "./chunk-EYYOKT23.js";
|
|
263
276
|
import {
|
|
264
277
|
importFrom,
|
|
265
278
|
resolveFrom
|
|
@@ -16879,10 +16892,10 @@ var require_lib3 = __commonJS({
|
|
|
16879
16892
|
}
|
|
16880
16893
|
});
|
|
16881
16894
|
|
|
16882
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
16895
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/ports/traits.js
|
|
16883
16896
|
var syncsOneChat = /* @__PURE__ */ __name((messenger) => messenger.history !== "store" || messenger.historyOnDemand === true, "syncsOneChat");
|
|
16884
16897
|
|
|
16885
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
16898
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/conversations/link.js
|
|
16886
16899
|
var RULES_VERSION = 5;
|
|
16887
16900
|
var LOOK_BACK = 50;
|
|
16888
16901
|
var SAME_SENDER_WITHIN = 10;
|
|
@@ -16972,7 +16985,7 @@ var latest = /* @__PURE__ */ __name((window3, matches) => {
|
|
|
16972
16985
|
var sameThread = /* @__PURE__ */ __name((a, b) => a.threadId === b.threadId, "sameThread");
|
|
16973
16986
|
var link = /* @__PURE__ */ __name((message, parentId, source, kind, confidence, method) => ({ messageId: message.id, parentId, source, kind, confidence, method }), "link");
|
|
16974
16987
|
|
|
16975
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
16988
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/cli/messenger/lacks.js
|
|
16976
16989
|
var COMMAND_NEEDS = {
|
|
16977
16990
|
"account update": ["updateProfile", "change the profile"],
|
|
16978
16991
|
"account sessions list": ["sessions", "list the account's sessions"],
|
|
@@ -17022,7 +17035,7 @@ var hideNever = /* @__PURE__ */ __name((messenger, group) => {
|
|
|
17022
17035
|
return group;
|
|
17023
17036
|
}, "hideNever");
|
|
17024
17037
|
|
|
17025
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
17038
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/services/members-audit.js
|
|
17026
17039
|
var AUDIT_PAGE = 200;
|
|
17027
17040
|
var AUDIT_BUDGET = 10;
|
|
17028
17041
|
var AUDIT_PAUSE_MS = 1e3;
|
|
@@ -17102,7 +17115,7 @@ var burstJoins = /* @__PURE__ */ __name((members) => {
|
|
|
17102
17115
|
return found;
|
|
17103
17116
|
}, "burstJoins");
|
|
17104
17117
|
|
|
17105
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
17118
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/meetings/cli/query-options.js
|
|
17106
17119
|
var queryWordsAfterOptions = /* @__PURE__ */ __name((command) => {
|
|
17107
17120
|
command.allowUnknownOption();
|
|
17108
17121
|
const parse = command.parseOptions.bind(command);
|
|
@@ -17122,7 +17135,7 @@ var queryWordsAfterOptions = /* @__PURE__ */ __name((command) => {
|
|
|
17122
17135
|
return command;
|
|
17123
17136
|
}, "queryWordsAfterOptions");
|
|
17124
17137
|
|
|
17125
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
17138
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/meetings/cli/passage.js
|
|
17126
17139
|
var count = /* @__PURE__ */ __name((value) => {
|
|
17127
17140
|
if (!/^(0|[1-9]\d*)$/.test(value) || !Number.isSafeInteger(Number(value)))
|
|
17128
17141
|
throw new CliError("validation_error", "expected a nonnegative safe integer");
|
|
@@ -17164,7 +17177,7 @@ var addMeetingPassageCommandDefinition = /* @__PURE__ */ __name((program, deps)
|
|
|
17164
17177
|
var createMeetingPassageCommand = sharedCommand(createMeetingPassageCommandDefinition);
|
|
17165
17178
|
var addMeetingPassageCommand = sharedCommand(addMeetingPassageCommandDefinition);
|
|
17166
17179
|
|
|
17167
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
17180
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/meetings/cli/project-evidence.js
|
|
17168
17181
|
var integer = /* @__PURE__ */ __name((value) => {
|
|
17169
17182
|
if (!/^[1-9]\d*$/.test(value) || !Number.isSafeInteger(Number(value)))
|
|
17170
17183
|
throw new CliError("validation_error", "expected a positive safe integer");
|
|
@@ -17176,8 +17189,8 @@ var addMeetingProjectEvidenceCommandDefinition = /* @__PURE__ */ __name((program
|
|
|
17176
17189
|
throw new CliError("configuration_error", "meeting command group is unavailable");
|
|
17177
17190
|
const projects = group.commands.find((command) => command.name() === "projects") ?? group.command("projects").description("project-name evidence in stored meetings");
|
|
17178
17191
|
return annotate(queryWordsAfterOptions(projects.command("evidence").description("find cited project-name and alias evidence in the local meeting index; does not refresh it or confirm membership")).argument("<project>", "existing project name, key or explicit alias").argument("[query...]", "exact ID fields and a UTC started_at range, joined by AND").addHelpText("after", `
|
|
17179
|
-
${fieldsHelp(MEETING_PROJECT_EVIDENCE_QUERY)}`).option("--limit <n>", "hits in one name page, 1 through 1000 (default 100)", integer).option("--cursor <cursor>", "continue with the same project and frozen selection from next").option("--max-read-bytes <bytes>", "word-read byte budget, at most 67108864 (default 4194304)", integer).action(async (
|
|
17180
|
-
deps.output(await readMeetingProjectEvidence(deps.read,
|
|
17192
|
+
${fieldsHelp(MEETING_PROJECT_EVIDENCE_QUERY)}`).option("--limit <n>", "hits in one name page, 1 through 1000 (default 100)", integer).option("--cursor <cursor>", "continue with the same project and frozen selection from next").option("--max-read-bytes <bytes>", "word-read byte budget, at most 67108864 (default 4194304)", integer).action(async (project, words3, options) => {
|
|
17193
|
+
deps.output(await readMeetingProjectEvidence(deps.read, project, { ...options, query: words3.join(" "), signal: deps.signal() }, deps.now?.()));
|
|
17181
17194
|
}), {
|
|
17182
17195
|
origin: "handwritten",
|
|
17183
17196
|
effects: { remote: "none", local: "read" },
|
|
@@ -17187,7 +17200,7 @@ ${fieldsHelp(MEETING_PROJECT_EVIDENCE_QUERY)}`).option("--limit <n>", "hits in o
|
|
|
17187
17200
|
}, "addMeetingProjectEvidenceCommandDefinition");
|
|
17188
17201
|
var addMeetingProjectEvidenceCommand = sharedCommand(addMeetingProjectEvidenceCommandDefinition);
|
|
17189
17202
|
|
|
17190
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
17203
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/meetings/cli/search.js
|
|
17191
17204
|
var ZONED = /(?:Z|[+-]\d{2}:?\d{2})$/i;
|
|
17192
17205
|
var moment = /* @__PURE__ */ __name((flag, end, readIn) => (value) => {
|
|
17193
17206
|
const zone = timezoneOf();
|
|
@@ -17273,7 +17286,7 @@ var addMeetingSearchCommandDefinition = /* @__PURE__ */ __name((program, deps) =
|
|
|
17273
17286
|
var createMeetingSearchCommand = sharedCommand(createMeetingSearchCommandDefinition);
|
|
17274
17287
|
var addMeetingSearchCommand = sharedCommand(addMeetingSearchCommandDefinition);
|
|
17275
17288
|
|
|
17276
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
17289
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/meetings/cli/index.js
|
|
17277
17290
|
var integer3 = /* @__PURE__ */ __name((text2) => {
|
|
17278
17291
|
if (!/^[1-9]\d*$/.test(text2) || !Number.isSafeInteger(Number(text2)))
|
|
17279
17292
|
throw new InvalidArgumentError("expected a positive integer");
|
|
@@ -17323,7 +17336,14 @@ ${fieldsHelp(MEETING_QUERY, MEETING_QUERY_GUIDE)}`);
|
|
|
17323
17336
|
output(annotate(group.command("summary"), { effects: LOCAL_READ, output: { entity: "meeting_summary" } }).description("show stored meeting summaries").argument("<meeting>", "stored meeting id", integer3)).action(async (id2, _opts, command) => {
|
|
17324
17337
|
print(await meetingSummaryAnswer(deps.store, id2, deps.accountId), command);
|
|
17325
17338
|
});
|
|
17326
|
-
output(annotate(group.command("export"), { effects: LOCAL_WRITE, output: { entity: "meeting_export" } }).description("export a meeting as Markdown or one transcript as WebVTT").argument("<meeting>", "stored meeting id", integer3).addOption(new Option("--format <format>", "export format").choices(["markdown", "vtt"]).default("markdown")).option("--transcript-id <id>", "export a specific transcript version", integer3).
|
|
17339
|
+
const exporter = output(annotate(group.command("export"), { effects: LOCAL_WRITE, output: { entity: "meeting_export" } }).description("export a meeting as Markdown or one transcript as WebVTT").argument("<meeting>", "stored meeting id", integer3).addOption(new Option("--format <format>", "export format").choices(["markdown", "vtt"]).default("markdown")).option("--transcript-id <id>", "export a specific transcript version", integer3).addOption(
|
|
17340
|
+
// Not over MCP: an agent would choose where on the owner's disk to write; it gets the content in the answer.
|
|
17341
|
+
annotateOption(new Option("--output <file>", "write content to a new file through the host's writer"), {
|
|
17342
|
+
mcp: false
|
|
17343
|
+
})
|
|
17344
|
+
));
|
|
17345
|
+
deps.newFileOutput?.(exporter, "output");
|
|
17346
|
+
exporter.action(async (id2, opts, command) => {
|
|
17327
17347
|
if (opts.output !== void 0 && !opts.output.trim())
|
|
17328
17348
|
throw new MeetingError("validation_error", "output path must not be empty");
|
|
17329
17349
|
if (opts.output !== void 0 && !deps.writeFile)
|
|
@@ -17350,16 +17370,21 @@ ${fieldsHelp(MEETING_QUERY, MEETING_QUERY_GUIDE)}`);
|
|
|
17350
17370
|
output(annotate(group.command("sync"), {
|
|
17351
17371
|
effects: FETCH,
|
|
17352
17372
|
offline: false,
|
|
17353
|
-
output: { entity: "meeting_ingestion" }
|
|
17354
|
-
|
|
17355
|
-
|
|
17373
|
+
output: { entity: "meeting_ingestion" },
|
|
17374
|
+
// Only a sync that stops itself at its budget may outlive the one-shot deadline.
|
|
17375
|
+
...deps.budgetOf ? { cooperative: true, partial: true } : {}
|
|
17376
|
+
}).description("bring the stored meetings up to date from the connected account, oldest first; a run that stops before its deadline keeps what it saved and the next one goes on from there")).option("--since-time <time>", "fetch meetings starting at or after this ISO 8601 date or time", date).option("--lookback-days <days>", "revisit recent occurrences for late transcripts (0\u201331)", lookbackDays).option("--rescan", "read the last 30 days again, not only what came after the last sync").action(async (opts, command) => {
|
|
17377
|
+
const source = deps.source;
|
|
17378
|
+
if (!source)
|
|
17356
17379
|
throw new MeetingError("configuration_error", "meeting source is unavailable");
|
|
17357
|
-
print(await pull(
|
|
17380
|
+
await deps.inRun(command, async () => print(await pull(source, deps.store, {
|
|
17358
17381
|
accountId: deps.accountId,
|
|
17359
17382
|
since: opts.sinceTime === void 0 ? void 0 : new Date(opts.sinceTime).toISOString(),
|
|
17360
17383
|
now: deps.now?.(),
|
|
17361
|
-
lookbackMs: opts.lookbackDays * 864e5
|
|
17362
|
-
|
|
17384
|
+
...opts.lookbackDays === void 0 ? {} : { lookbackMs: opts.lookbackDays * 864e5 },
|
|
17385
|
+
...opts.rescan ? { rescan: true } : {},
|
|
17386
|
+
...deps.budgetOf ? { budget: deps.budgetOf(command) } : {}
|
|
17387
|
+
}), command));
|
|
17363
17388
|
});
|
|
17364
17389
|
const importCommand = annotate(group.command("import"), {
|
|
17365
17390
|
effects: LOCAL_WRITE,
|
|
@@ -17405,7 +17430,7 @@ ${fieldsHelp(EVENT_QUERY, MEETING_QUERY_GUIDE)}`);
|
|
|
17405
17430
|
}, "addMeetingCommandsDefinition");
|
|
17406
17431
|
var addMeetingCommands = sharedCommand(addMeetingCommandsDefinition);
|
|
17407
17432
|
|
|
17408
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
17433
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/cli/list-query.js
|
|
17409
17434
|
var LIST_QUERY_GUIDE = "https://github.com/WireCatLabs/cli-core/blob/main/docs/search/query-language.md";
|
|
17410
17435
|
var QUERY_ARGUMENT = "field:value terms that narrow the list \u2014 the fields are below";
|
|
17411
17436
|
var withQuery = /* @__PURE__ */ __name((command, registry) => {
|
|
@@ -17544,7 +17569,7 @@ var termField = /* @__PURE__ */ __name((name, type, example, more = {}) => nativ
|
|
|
17544
17569
|
var queryHelp = /* @__PURE__ */ __name((registry) => `
|
|
17545
17570
|
${fieldsHelp(registry, LIST_QUERY_GUIDE)}`, "queryHelp");
|
|
17546
17571
|
|
|
17547
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
17572
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/cli/paging.js
|
|
17548
17573
|
var positiveCount = /* @__PURE__ */ __name((flag) => (value) => {
|
|
17549
17574
|
if (!/^\d+$/.test(value.trim()) || Number(value) < 1)
|
|
17550
17575
|
throw new CliError("validation_error", `${flag} takes a whole number from 1 upwards, not "${value}"`);
|
|
@@ -17553,7 +17578,7 @@ var positiveCount = /* @__PURE__ */ __name((flag) => (value) => {
|
|
|
17553
17578
|
var withPaging = /* @__PURE__ */ __name((command) => command.option("--limit <n>", "how many to show", positiveCount("--limit")).option("--page <n>", "which page, starting at 1", positiveCount("--page")).option("--all", "every row, no paging"), "withPaging");
|
|
17554
17579
|
var window = /* @__PURE__ */ __name(({ limit, page, all }) => all ? { offset: 0 } : { limit, offset: (page - 1) * limit }, "window");
|
|
17555
17580
|
|
|
17556
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
17581
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/cli/messenger/chat-answers.js
|
|
17557
17582
|
var defined = /* @__PURE__ */ __name((record2) => Object.fromEntries(Object.entries(record2).filter(([, value]) => value !== void 0)), "defined");
|
|
17558
17583
|
var chatRef = /* @__PURE__ */ __name((account, chat) => formatReference({ type: "chat", provider: account.provider, account: account.account, chat }), "chatRef");
|
|
17559
17584
|
var settingsOf = /* @__PURE__ */ __name((settings) => defined({
|
|
@@ -17815,7 +17840,7 @@ var sessionAnswer = /* @__PURE__ */ __name(({ current, client, device, location,
|
|
|
17815
17840
|
...createdAt === void 0 ? {} : { created_at: createdAt }
|
|
17816
17841
|
}), "sessionAnswer");
|
|
17817
17842
|
|
|
17818
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
17843
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/services/deps.js
|
|
17819
17844
|
var accountStore = /* @__PURE__ */ __name(async (deps) => (await deps.store()).forAccount(await deps.account()), "accountStore");
|
|
17820
17845
|
var crossAccount = /* @__PURE__ */ __name((deps, _reason) => deps.store(), "crossAccount");
|
|
17821
17846
|
var NO_LOCAL_STORE = "this answer comes from the messenger, not from the local store";
|
|
@@ -17879,7 +17904,7 @@ var storedDeps = /* @__PURE__ */ __name((messenger, store, account, guard) => ({
|
|
|
17879
17904
|
}), "storedDeps");
|
|
17880
17905
|
var storeModeDeps = /* @__PURE__ */ __name((messenger, store, account, guard) => ({ ...storedDeps(messenger, store, account, guard), offline: false, reads: "store" }), "storeModeDeps");
|
|
17881
17906
|
|
|
17882
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
17907
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/ports/messenger.js
|
|
17883
17908
|
var throughWrapper = /* @__PURE__ */ __name((inner, handled, wrap = (_, call) => call) => new Proxy(handled, {
|
|
17884
17909
|
get: /* @__PURE__ */ __name((own, key) => {
|
|
17885
17910
|
if (key in own)
|
|
@@ -17896,12 +17921,7 @@ var capability = /* @__PURE__ */ __name((adapter, method, what) => {
|
|
|
17896
17921
|
return found.bind(adapter);
|
|
17897
17922
|
}, "capability");
|
|
17898
17923
|
|
|
17899
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
17900
|
-
import { randomBytes } from "node:crypto";
|
|
17901
|
-
var newSendId = /* @__PURE__ */ __name(() => randomBytes(8).readBigInt64BE().toString(), "newSendId");
|
|
17902
|
-
var newOperationId = newSendId;
|
|
17903
|
-
|
|
17904
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.590.0_@wirecat+cli-base@0.80.1_commander@15.0.0_esbuild@0.28.2_type_4c7167080feb2ba6356a64767981f5fd/node_modules/@wirecat/cli-core/dist/services/questions.js
|
|
17924
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/services/questions.js
|
|
17905
17925
|
var LINKS = /https?:\/\/\S+/g;
|
|
17906
17926
|
var unanswered = /* @__PURE__ */ __name((messages, { answerers: answerers2, before: before2 }) => questions(messages, { answerers: answerers2 }).filter(({ question, answer }) => answer === void 0 && Date.parse(question.timestamp) < before2).map(({ question }) => question), "unanswered");
|
|
17907
17927
|
var questions = /* @__PURE__ */ __name((messages, { answerers: answerers2, asker = "others" }) => {
|
|
@@ -17931,7 +17951,7 @@ var questions = /* @__PURE__ */ __name((messages, { answerers: answerers2, asker
|
|
|
17931
17951
|
});
|
|
17932
17952
|
}, "questions");
|
|
17933
17953
|
|
|
17934
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
17954
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/services/task-categories.js
|
|
17935
17955
|
var names = /* @__PURE__ */ __name((categories) => categories.map(({ name }) => name).join(", "), "names");
|
|
17936
17956
|
var taskCategoryOf = /* @__PURE__ */ __name((categories = DEFAULT_TASK_CATEGORIES, flag = "--category") => (typed) => {
|
|
17937
17957
|
const name = typed.trim().toLowerCase();
|
|
@@ -17988,7 +18008,7 @@ var categorize = /* @__PURE__ */ __name((text2, categories = DEFAULT_TASK_CATEGO
|
|
|
17988
18008
|
return best.name;
|
|
17989
18009
|
}, "categorize");
|
|
17990
18010
|
|
|
17991
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
18011
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/services/task-rules.js
|
|
17992
18012
|
var taskAccount = /* @__PURE__ */ __name(({ provider, account }) => `${provider}:${account}`, "taskAccount");
|
|
17993
18013
|
var RULES_IN = {
|
|
17994
18014
|
dialog: "all",
|
|
@@ -18194,7 +18214,7 @@ var applyTaskRulesToChats = /* @__PURE__ */ __name(async (store, account, chatId
|
|
|
18194
18214
|
return passes;
|
|
18195
18215
|
}, "applyTaskRulesToChats");
|
|
18196
18216
|
|
|
18197
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
18217
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/services/moment.js
|
|
18198
18218
|
var AGO = /^(\d+)(m|h|d)$/;
|
|
18199
18219
|
var AGO_MS = { m: 6e4, h: 36e5, d: 864e5 };
|
|
18200
18220
|
var DATE = /^\d{4}-\d{2}-\d{2}/;
|
|
@@ -18234,10 +18254,10 @@ var dateWindow = /* @__PURE__ */ __name(({ sinceTime, untilTime, zone, now = Dat
|
|
|
18234
18254
|
};
|
|
18235
18255
|
}, "dateWindow");
|
|
18236
18256
|
|
|
18237
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
18257
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/services/patience.js
|
|
18238
18258
|
import { setTimeout as sleep } from "node:timers/promises";
|
|
18239
18259
|
var LONGEST_WAIT_MS = 5 * 60 * 1e3;
|
|
18240
|
-
var patiently = /* @__PURE__ */ __name(async (request,
|
|
18260
|
+
var patiently = /* @__PURE__ */ __name(async (request, note, stop) => {
|
|
18241
18261
|
let waited;
|
|
18242
18262
|
for (let attempt = 1; ; attempt += 1) {
|
|
18243
18263
|
stop.throwIfAborted();
|
|
@@ -18247,7 +18267,7 @@ var patiently = /* @__PURE__ */ __name(async (request, note2, stop) => {
|
|
|
18247
18267
|
const wait = isCliFailure(error) && error.code === "rate_limited" ? Number(error.details?.retry_after_ms) : NaN;
|
|
18248
18268
|
if (!Number.isFinite(wait) || wait < 0 || wait > LONGEST_WAIT_MS || attempt >= 3)
|
|
18249
18269
|
throw error;
|
|
18250
|
-
|
|
18270
|
+
note(`asked to wait ${Math.ceil(wait / 1e3)} s \u2014 waiting, then going on`);
|
|
18251
18271
|
await sleep(wait, void 0, { signal: stop }).catch(() => {
|
|
18252
18272
|
});
|
|
18253
18273
|
waited = wait;
|
|
@@ -18257,10 +18277,10 @@ var patiently = /* @__PURE__ */ __name(async (request, note2, stop) => {
|
|
|
18257
18277
|
}
|
|
18258
18278
|
}, "patiently");
|
|
18259
18279
|
|
|
18260
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
18280
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/services/archive.js
|
|
18261
18281
|
import { setTimeout as sleep2 } from "node:timers/promises";
|
|
18262
18282
|
|
|
18263
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
18283
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/services/backfill-estimate.js
|
|
18264
18284
|
var REQUEST_MS = 400;
|
|
18265
18285
|
var estimateBackfill = /* @__PURE__ */ __name(({ ranges, held, newest, page, maxPages, pauseMs }) => {
|
|
18266
18286
|
const lowest = ranges[0];
|
|
@@ -18283,13 +18303,13 @@ var estimateBackfill = /* @__PURE__ */ __name(({ ranges, held, newest, page, max
|
|
|
18283
18303
|
};
|
|
18284
18304
|
}, "estimateBackfill");
|
|
18285
18305
|
|
|
18286
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
18306
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/domain/recovery.js
|
|
18287
18307
|
var withRecovery = /* @__PURE__ */ __name((error) => ({
|
|
18288
18308
|
...error,
|
|
18289
18309
|
retryable: typeof error.retryable === "boolean" ? error.retryable : error.code === "rate_limited" || error.status === 429
|
|
18290
18310
|
}), "withRecovery");
|
|
18291
18311
|
|
|
18292
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
18312
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/services/batch.js
|
|
18293
18313
|
var actionable = /* @__PURE__ */ __name((error) => {
|
|
18294
18314
|
if (isCliFailure(error))
|
|
18295
18315
|
return withRecovery({ code: error.code, message: error.message, ...error.details });
|
|
@@ -18372,7 +18392,7 @@ var mergeBatches = /* @__PURE__ */ __name((a, b) => {
|
|
|
18372
18392
|
};
|
|
18373
18393
|
}, "mergeBatches");
|
|
18374
18394
|
|
|
18375
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
18395
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/services/message-resolution.js
|
|
18376
18396
|
var readChatId = /* @__PURE__ */ __name(async (deps, reference, store, account) => {
|
|
18377
18397
|
if (deps.reads !== "store")
|
|
18378
18398
|
return keptChatId(deps.messenger, reference, store, account);
|
|
@@ -18531,7 +18551,7 @@ var senderAmong = /* @__PURE__ */ __name(async (store, accounts, reference) => {
|
|
|
18531
18551
|
}
|
|
18532
18552
|
}, "senderAmong");
|
|
18533
18553
|
|
|
18534
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
18554
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/images/context/index.js
|
|
18535
18555
|
var CONTEXT_MESSAGES = 3;
|
|
18536
18556
|
var CONTEXT_MINUTES = 10;
|
|
18537
18557
|
var MAX_CHARS = 1200;
|
|
@@ -18555,12 +18575,12 @@ var context = {
|
|
|
18555
18575
|
}, "describe")
|
|
18556
18576
|
};
|
|
18557
18577
|
|
|
18558
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
18578
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/images/registry.js
|
|
18559
18579
|
var BUILT_INS = [context];
|
|
18560
18580
|
var providers = [...BUILT_INS];
|
|
18561
18581
|
var registeredImageProviders = /* @__PURE__ */ __name(() => providers, "registeredImageProviders");
|
|
18562
18582
|
|
|
18563
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
18583
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/services/conversations.js
|
|
18564
18584
|
var READ_PAGE = 5e3;
|
|
18565
18585
|
var CHAIN = 50;
|
|
18566
18586
|
var CONVERSATION_QUERY = {
|
|
@@ -18712,7 +18732,7 @@ var sized = /* @__PURE__ */ __name((size2) => {
|
|
|
18712
18732
|
return size2;
|
|
18713
18733
|
}, "sized");
|
|
18714
18734
|
|
|
18715
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
18735
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/services/embeddings-maintenance.js
|
|
18716
18736
|
var REFRESH_BOUNDS = { maxChats: 20, maxChunks: 2e3 };
|
|
18717
18737
|
var MESSAGE_PAGE = 5e3;
|
|
18718
18738
|
var PER_SESSION = 8;
|
|
@@ -18731,7 +18751,7 @@ var embeddingTarget = /* @__PURE__ */ __name((deps, choice = DEFAULT_TEXT_MODEL)
|
|
|
18731
18751
|
price: remote.price,
|
|
18732
18752
|
installed: true,
|
|
18733
18753
|
perBatch: PER_REQUEST * concurrency,
|
|
18734
|
-
open: /* @__PURE__ */ __name(async () => (await import("./remote-
|
|
18754
|
+
open: /* @__PURE__ */ __name(async () => (await import("./remote-HFASMVLB.js")).openRemote(remote, apiKey, { concurrency }), "open")
|
|
18735
18755
|
};
|
|
18736
18756
|
}
|
|
18737
18757
|
const model = textModel(choice);
|
|
@@ -18748,7 +18768,7 @@ var embeddingTarget = /* @__PURE__ */ __name((deps, choice = DEFAULT_TEXT_MODEL)
|
|
|
18748
18768
|
if (!isTextModelInstalled(model, directory2))
|
|
18749
18769
|
throw notDownloaded(model.id);
|
|
18750
18770
|
if (apart) {
|
|
18751
|
-
const { openProcess } = await import("./process-
|
|
18771
|
+
const { openProcess } = await import("./process-AGXY76ZE.js");
|
|
18752
18772
|
return openProcess(model, directory2, { threads: threads ?? defaultThreads() });
|
|
18753
18773
|
}
|
|
18754
18774
|
return openEmbedder(model, directory2, { threads: threads ?? defaultThreads() });
|
|
@@ -19037,7 +19057,7 @@ var shaped = /* @__PURE__ */ __name(({ chatId, builtAt, algorithmVersion, pendin
|
|
|
19037
19057
|
return { ...one, state };
|
|
19038
19058
|
}, "shaped");
|
|
19039
19059
|
|
|
19040
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
19060
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/services/search-catchup.js
|
|
19041
19061
|
var CATCH_UP_BOUNDS = { maxChunks: 500, maxMessages: 1e4, timeMs: 3e4 };
|
|
19042
19062
|
var validateCatchUpBounds = /* @__PURE__ */ __name((options) => {
|
|
19043
19063
|
for (const [key, value, maximum] of [
|
|
@@ -19090,7 +19110,7 @@ var catchUpSearch = /* @__PURE__ */ __name(async (deps, chat, options, signal, c
|
|
|
19090
19110
|
}
|
|
19091
19111
|
}, "catchUpSearch");
|
|
19092
19112
|
|
|
19093
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
19113
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/services/archive.js
|
|
19094
19114
|
var pushed = /* @__PURE__ */ __name((deps, what) => {
|
|
19095
19115
|
if (deps.reads === "store") {
|
|
19096
19116
|
throw new CliError("validation_error", `${what} asks for older history, and this messenger pushes its history instead \u2014 keep \`${typedCommand(deps.messenger.app.command, "serve")}\` running`);
|
|
@@ -19309,7 +19329,7 @@ var recordSkip = /* @__PURE__ */ __name(async (store, account, chatId, skip) =>
|
|
|
19309
19329
|
const at = (/* @__PURE__ */ new Date()).toISOString();
|
|
19310
19330
|
await store.chats.recordHistorySkips(account, /* @__PURE__ */ new Map([[chatId, { ...skip, messages: 0, oldestAt: at, newestAt: at, unread: true }]]));
|
|
19311
19331
|
}, "recordSkip");
|
|
19312
|
-
var abortable = /* @__PURE__ */ __name(async (
|
|
19332
|
+
var abortable = /* @__PURE__ */ __name(async (read, signal) => {
|
|
19313
19333
|
signal.throwIfAborted();
|
|
19314
19334
|
let listener = /* @__PURE__ */ __name(() => {
|
|
19315
19335
|
}, "listener");
|
|
@@ -19318,12 +19338,12 @@ var abortable = /* @__PURE__ */ __name(async (read2, signal) => {
|
|
|
19318
19338
|
signal.addEventListener("abort", listener, { once: true });
|
|
19319
19339
|
});
|
|
19320
19340
|
try {
|
|
19321
|
-
return await Promise.race([
|
|
19341
|
+
return await Promise.race([read(), interrupted]);
|
|
19322
19342
|
} finally {
|
|
19323
19343
|
signal.removeEventListener("abort", listener);
|
|
19324
19344
|
}
|
|
19325
19345
|
}, "abortable");
|
|
19326
|
-
var fetchInto = /* @__PURE__ */ __name(async ({ history, store, account, fetching, limit, pageSize, pauseMs, sinceMs, last, note
|
|
19346
|
+
var fetchInto = /* @__PURE__ */ __name(async ({ history, store, account, fetching, limit, pageSize, pauseMs, sinceMs, last, note, stop, onPage, window: window3, onRequest }) => {
|
|
19327
19347
|
if (window3 && (!Number.isSafeInteger(window3.from) || !Number.isSafeInteger(window3.to + 1) || window3.from > window3.to))
|
|
19328
19348
|
throw new CliError("validation_error", "invalid history window");
|
|
19329
19349
|
const byTime = fetching.orderBy === "time";
|
|
@@ -19346,9 +19366,9 @@ var fetchInto = /* @__PURE__ */ __name(async ({ history, store, account, fetchin
|
|
|
19346
19366
|
page = await patiently(() => {
|
|
19347
19367
|
requests += 1;
|
|
19348
19368
|
onRequest?.();
|
|
19349
|
-
const
|
|
19350
|
-
return window3 ? abortable(
|
|
19351
|
-
},
|
|
19369
|
+
const read = /* @__PURE__ */ __name(() => history({ limit: Math.min(pageSize, limit - fetched), ...before2 ? { before: before2 } : {} }), "read");
|
|
19370
|
+
return window3 ? abortable(read, stop) : read();
|
|
19371
|
+
}, note, stop);
|
|
19352
19372
|
} catch (error) {
|
|
19353
19373
|
if (stop.aborted)
|
|
19354
19374
|
break;
|
|
@@ -19407,7 +19427,7 @@ var fetchInto = /* @__PURE__ */ __name(async ({ history, store, account, fetchin
|
|
|
19407
19427
|
}
|
|
19408
19428
|
const boundary = window3 === void 0 ? held.from : low;
|
|
19409
19429
|
before2 = byTime ? new Date(boundary + (fresh > 0 && !(window3 && fetching.beforeInclusive) ? 1 : 0)).toISOString() : String(boundary);
|
|
19410
|
-
|
|
19430
|
+
note(`${fetched} messages so far, back to ${fromAt.slice(0, 10)}`);
|
|
19411
19431
|
const wait = fetching.jitter ? pauseMs * (1 + Math.random()) : pauseMs;
|
|
19412
19432
|
await sleep2(wait, void 0, { signal: stop }).catch(() => {
|
|
19413
19433
|
});
|
|
@@ -19456,7 +19476,7 @@ var timeOfKey = /* @__PURE__ */ __name(async (store, account, chatId, key, byTim
|
|
|
19456
19476
|
return message?.timestamp ?? fallback;
|
|
19457
19477
|
}, "timeOfKey");
|
|
19458
19478
|
|
|
19459
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
19479
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/botcheck/check.js
|
|
19460
19480
|
var DAY_MS = 864e5;
|
|
19461
19481
|
var NEW_DAYS = 30;
|
|
19462
19482
|
var SAME_TEXT_MIN = 20;
|
|
@@ -19533,7 +19553,7 @@ var scorePerson = /* @__PURE__ */ __name(({ subject, provider, activity, photos,
|
|
|
19533
19553
|
};
|
|
19534
19554
|
}, "scorePerson");
|
|
19535
19555
|
|
|
19536
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
19556
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/http/time-limit.js
|
|
19537
19557
|
var timeLimit = /* @__PURE__ */ __name((ms) => {
|
|
19538
19558
|
const controller = new AbortController();
|
|
19539
19559
|
const timer = setTimeout(() => controller.abort(new DOMException("The operation timed out.", "TimeoutError")), ms);
|
|
@@ -19549,7 +19569,7 @@ var withTimeLimit = /* @__PURE__ */ __name(async (ms, run) => {
|
|
|
19549
19569
|
}
|
|
19550
19570
|
}, "withTimeLimit");
|
|
19551
19571
|
|
|
19552
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
19572
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/botcheck/registries.js
|
|
19553
19573
|
var REGISTRIES = {
|
|
19554
19574
|
cas: { title: "Combot Anti-Spam (CAS)", docs: "https://cas.chat/api" },
|
|
19555
19575
|
lols: { title: "lols.bot", docs: "https://api.lols.bot/lols-bot.json" }
|
|
@@ -19636,7 +19656,7 @@ var notCovered = /* @__PURE__ */ __name((messenger, now = /* @__PURE__ */ new Da
|
|
|
19636
19656
|
detail: `lists Telegram accounts only, not ${messenger} ones`
|
|
19637
19657
|
})), "notCovered");
|
|
19638
19658
|
|
|
19639
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
19659
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/botcheck/service.js
|
|
19640
19660
|
var ACTIVITY_MESSAGES = 1e3;
|
|
19641
19661
|
var botCheckService = /* @__PURE__ */ __name((deps) => {
|
|
19642
19662
|
const subjectOf = /* @__PURE__ */ __name(async (reference) => {
|
|
@@ -19724,7 +19744,7 @@ var botCheckService = /* @__PURE__ */ __name((deps) => {
|
|
|
19724
19744
|
};
|
|
19725
19745
|
}, "botCheckService");
|
|
19726
19746
|
|
|
19727
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
19747
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/domain/thread.js
|
|
19728
19748
|
var threadIdOf = /* @__PURE__ */ __name((value) => {
|
|
19729
19749
|
if (value === void 0)
|
|
19730
19750
|
return void 0;
|
|
@@ -19734,7 +19754,7 @@ var threadIdOf = /* @__PURE__ */ __name((value) => {
|
|
|
19734
19754
|
return id2;
|
|
19735
19755
|
}, "threadIdOf");
|
|
19736
19756
|
|
|
19737
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
19757
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/services/chat-stats.js
|
|
19738
19758
|
var TOP_POSTS = 5;
|
|
19739
19759
|
var JOINS = /* @__PURE__ */ new Set(["join", "add"]);
|
|
19740
19760
|
var LEAVES = /* @__PURE__ */ new Set(["leave", "remove"]);
|
|
@@ -19851,7 +19871,7 @@ var median = /* @__PURE__ */ __name((values) => {
|
|
|
19851
19871
|
return Math.round(sorted.length % 2 === 0 ? ((sorted[middle - 1] ?? upper) + upper) / 2 : upper);
|
|
19852
19872
|
}, "median");
|
|
19853
19873
|
|
|
19854
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
19874
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/services/member-history.js
|
|
19855
19875
|
var memberEvents = /* @__PURE__ */ __name((stays, revisions, since = 0) => {
|
|
19856
19876
|
const events = [];
|
|
19857
19877
|
for (const stay of stays) {
|
|
@@ -19883,7 +19903,7 @@ var memberEvents = /* @__PURE__ */ __name((stays, revisions, since = 0) => {
|
|
|
19883
19903
|
return events.filter(({ at }) => Date.parse(at) >= since).sort((a, b) => Date.parse(a.at) - Date.parse(b.at) || a.id.localeCompare(b.id));
|
|
19884
19904
|
}, "memberEvents");
|
|
19885
19905
|
|
|
19886
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
19906
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/services/chats.js
|
|
19887
19907
|
var EVENTS_DAYS = 7;
|
|
19888
19908
|
var TRACKED_DAYS = 30;
|
|
19889
19909
|
var STATS_PAGE = 1e3;
|
|
@@ -20018,10 +20038,10 @@ var chatsService = /* @__PURE__ */ __name((deps) => ({
|
|
|
20018
20038
|
throw new CliError("validation_error", "`chats members check` reads the member list from the messenger; not with --offline");
|
|
20019
20039
|
}
|
|
20020
20040
|
const connection = await deps.connection();
|
|
20021
|
-
const { chatId: id2, members:
|
|
20041
|
+
const { chatId: id2, members: read, more, participants } = await readMembers(connection, chat, budget, pauseMs);
|
|
20022
20042
|
const held = await accountStoreIfOpen(deps);
|
|
20023
20043
|
const stored = held ? await storedFacts(held, id2) : void 0;
|
|
20024
|
-
const { items: judged, unknown: unknown2 } = auditMembers(
|
|
20044
|
+
const { items: judged, unknown: unknown2 } = auditMembers(read, {
|
|
20025
20045
|
firstMessages: stored?.firstMessages,
|
|
20026
20046
|
self: connection.self(),
|
|
20027
20047
|
minScore
|
|
@@ -20029,7 +20049,7 @@ var chatsService = /* @__PURE__ */ __name((deps) => ({
|
|
|
20029
20049
|
const items = deep > 0 ? await deepChecks(deps, judged, deep, pauseMs, registry) : judged;
|
|
20030
20050
|
return {
|
|
20031
20051
|
chatId: id2,
|
|
20032
|
-
read:
|
|
20052
|
+
read: read.length,
|
|
20033
20053
|
participantsCount: participants ?? stored?.participantsCount ?? null,
|
|
20034
20054
|
more,
|
|
20035
20055
|
unknown: unknown2,
|
|
@@ -20043,11 +20063,11 @@ var chatsService = /* @__PURE__ */ __name((deps) => ({
|
|
|
20043
20063
|
throw new CliError("validation_error", "`chats members fetch` reads the member list from the messenger; not with --offline");
|
|
20044
20064
|
}
|
|
20045
20065
|
const startedAt = (/* @__PURE__ */ new Date()).toISOString();
|
|
20046
|
-
const
|
|
20066
|
+
const read = await readMembers(await deps.connection(), chat, budget, pauseMs);
|
|
20047
20067
|
const observedAt = (/* @__PURE__ */ new Date()).toISOString();
|
|
20048
|
-
const { chatId, members, more } =
|
|
20068
|
+
const { chatId, members, more } = read;
|
|
20049
20069
|
const store = await accountStore(deps);
|
|
20050
|
-
const participants =
|
|
20070
|
+
const participants = read.participants ?? (await store.chats.chats({})).items.find(({ id: id2 }) => id2 === chatId)?.participantsCount ?? null;
|
|
20051
20071
|
const complete = !more && participants !== null && members.length >= participants;
|
|
20052
20072
|
const change = await store.roster.saveRoster(chatId, {
|
|
20053
20073
|
members,
|
|
@@ -20158,27 +20178,27 @@ var storedSince = /* @__PURE__ */ __name(async (store, chatId, since) => {
|
|
|
20158
20178
|
}, "storedSince");
|
|
20159
20179
|
var readMembers = /* @__PURE__ */ __name(async (connection, chat, budget, pauseMs) => {
|
|
20160
20180
|
const members = capability(connection, "members", "list a group's members");
|
|
20161
|
-
const
|
|
20181
|
+
const read = [];
|
|
20162
20182
|
let chatId;
|
|
20163
20183
|
let participants = null;
|
|
20164
20184
|
let more = true;
|
|
20165
20185
|
for (let page = 0; page < budget && more; page++) {
|
|
20166
20186
|
if (page > 0)
|
|
20167
20187
|
await new Promise((resolve7) => setTimeout(resolve7, pauseMs));
|
|
20168
|
-
const found = await members(chatId ?? chat, { limit: AUDIT_PAGE, offset:
|
|
20188
|
+
const found = await members(chatId ?? chat, { limit: AUDIT_PAGE, offset: read.length });
|
|
20169
20189
|
chatId = found.chatId;
|
|
20170
20190
|
participants = found.participantsCount ?? participants;
|
|
20171
|
-
|
|
20191
|
+
read.push(...found.items);
|
|
20172
20192
|
more = found.hasMore && found.items.length > 0;
|
|
20173
20193
|
}
|
|
20174
|
-
return { chatId: chatId ?? chat, members:
|
|
20194
|
+
return { chatId: chatId ?? chat, members: read, more, participants };
|
|
20175
20195
|
}, "readMembers");
|
|
20176
20196
|
var storedMembers = /* @__PURE__ */ __name(async (store, chatId) => {
|
|
20177
20197
|
const members = (await store.roster.members(chatId)).filter((one) => one.id !== store.account.account);
|
|
20178
20198
|
return members.length === 0 ? null : members;
|
|
20179
20199
|
}, "storedMembers");
|
|
20180
20200
|
|
|
20181
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
20201
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/services/inbox.js
|
|
20182
20202
|
var INBOX_CHATS = 20;
|
|
20183
20203
|
var REVIEW_DAYS = 3;
|
|
20184
20204
|
var UNANSWERED_HOURS = 24;
|
|
@@ -20223,9 +20243,9 @@ var capped = /* @__PURE__ */ __name((chats, most) => ({
|
|
|
20223
20243
|
var unreadIn = /* @__PURE__ */ __name(async (adapter, { limit, all = false, kinds }) => {
|
|
20224
20244
|
const page = await everyChat(adapter);
|
|
20225
20245
|
const { heard: waiting, quiet: quiet2 } = heard(byRecency(ofKinds(page.items, kinds).filter((chat) => (chat.unreadCount ?? 0) > 0 || chat.markedUnread === true)), all);
|
|
20226
|
-
const { read
|
|
20246
|
+
const { read, skipped } = capped(waiting, INBOX_CHATS);
|
|
20227
20247
|
const chats = [];
|
|
20228
|
-
for (const { id: id2, title, kind, unreadCount } of
|
|
20248
|
+
for (const { id: id2, title, kind, unreadCount } of read) {
|
|
20229
20249
|
const count4 = unreadCount ?? 0;
|
|
20230
20250
|
if (count4 === 0) {
|
|
20231
20251
|
const newest = (await adapter.history(id2, { limit })).items.findLast((message) => !message.outgoing);
|
|
@@ -20248,10 +20268,10 @@ var newIn = /* @__PURE__ */ __name(async (adapter, { since, points, limit, all =
|
|
|
20248
20268
|
const changed = byRecency(ofKinds(changedAll, kinds));
|
|
20249
20269
|
const cut = changed.reduce((latest2, chat) => Math.max(latest2, Date.parse(chat.lastMessageAt ?? "")), since);
|
|
20250
20270
|
const { heard: wanted, quiet: quiet2 } = heard(changed, all);
|
|
20251
|
-
const { read
|
|
20271
|
+
const { read, skipped } = capped(wanted, INBOX_CHATS);
|
|
20252
20272
|
const chats = [];
|
|
20253
20273
|
const checked2 = {};
|
|
20254
|
-
for (const { id: id2, title, kind, unreadCount } of
|
|
20274
|
+
for (const { id: id2, title, kind, unreadCount } of read) {
|
|
20255
20275
|
const { items } = await adapter.history(id2, { limit });
|
|
20256
20276
|
const fresh = items.filter((message) => {
|
|
20257
20277
|
const time = Date.parse(message.timestamp);
|
|
@@ -20299,10 +20319,10 @@ var reviewIn = /* @__PURE__ */ __name(async (adapter, { since, points, chat, kin
|
|
|
20299
20319
|
const cut = changed.reduce((latest2, one) => Math.max(latest2, Date.parse(one.lastMessageAt ?? "")), since);
|
|
20300
20320
|
const only = chat === void 0 ? void 0 : (await adapter.resolve(chat)).id;
|
|
20301
20321
|
const { heard: wanted, quiet: quiet2 } = only === void 0 ? heard(ofKinds(changed, kinds), all) : { heard: changed.filter((one) => one.id === only), quiet: 0 };
|
|
20302
|
-
const { read
|
|
20322
|
+
const { read, skipped } = capped(wanted, REVIEW_CHATS);
|
|
20303
20323
|
const chats = [];
|
|
20304
20324
|
const checked2 = {};
|
|
20305
|
-
for (const { id: id2, title, kind } of
|
|
20325
|
+
for (const { id: id2, title, kind } of read) {
|
|
20306
20326
|
const { messages, more } = await window2(adapter, id2, startOf(id2), cut);
|
|
20307
20327
|
if (messages.length > 0)
|
|
20308
20328
|
chats.push({ id: id2, title, kind, messages, more });
|
|
@@ -20386,7 +20406,7 @@ var inboxService = /* @__PURE__ */ __name((deps) => {
|
|
|
20386
20406
|
};
|
|
20387
20407
|
}, "inboxService");
|
|
20388
20408
|
|
|
20389
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
20409
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/services/person-context.js
|
|
20390
20410
|
var CONTEXT_MESSAGES2 = 10;
|
|
20391
20411
|
var CONTEXT_BYTES = 64 * 1024;
|
|
20392
20412
|
var toContext = /* @__PURE__ */ __name((key, message, chatTitle2) => ({
|
|
@@ -20647,10 +20667,10 @@ var personMessages = /* @__PURE__ */ __name(async (store, asked, reference, { ch
|
|
|
20647
20667
|
};
|
|
20648
20668
|
}, "personMessages");
|
|
20649
20669
|
|
|
20650
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
20670
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/services/meeting-evidence.js
|
|
20651
20671
|
import { createHash } from "node:crypto";
|
|
20652
20672
|
|
|
20653
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
20673
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/services/meeting-reference.js
|
|
20654
20674
|
var missing2 = /* @__PURE__ */ __name(() => new CliError("not_found", "the meeting evidence is unavailable for this account"), "missing");
|
|
20655
20675
|
var authorizedMeetingMetadata = /* @__PURE__ */ __name(async (store, accountId, reference, options = {}) => {
|
|
20656
20676
|
const parsed = parseMeetingReference(reference);
|
|
@@ -20668,7 +20688,7 @@ var authorizedMeetingMetadata = /* @__PURE__ */ __name(async (store, accountId,
|
|
|
20668
20688
|
return { parsed, meeting };
|
|
20669
20689
|
}, "authorizedMeetingMetadata");
|
|
20670
20690
|
|
|
20671
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
20691
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/services/meeting-evidence.js
|
|
20672
20692
|
var hash = /* @__PURE__ */ __name((value) => createHash("sha256").update(JSON.stringify(value)).digest("hex"), "hash");
|
|
20673
20693
|
var checkMeetingCancelled = /* @__PURE__ */ __name((signal) => {
|
|
20674
20694
|
if (signal?.aborted)
|
|
@@ -20867,7 +20887,7 @@ var readMeetingEvidence = /* @__PURE__ */ __name(async (store, accountId, refere
|
|
|
20867
20887
|
return { ...packet, fingerprint: hash(packet) };
|
|
20868
20888
|
}, "readMeetingEvidence");
|
|
20869
20889
|
|
|
20870
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
20890
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/services/person-meeting-context.js
|
|
20871
20891
|
var personMeetingContext = /* @__PURE__ */ __name(async (store, personReference, options) => {
|
|
20872
20892
|
const { meetings = 10, cues = 5, bytes: bytes2 = 64 * 1024, scanLimit = 1e3, since, signal } = options;
|
|
20873
20893
|
const requestedAccounts = options.accountIds;
|
|
@@ -20966,7 +20986,7 @@ var personMeetingContext = /* @__PURE__ */ __name(async (store, personReference,
|
|
|
20966
20986
|
};
|
|
20967
20987
|
}, "personMeetingContext");
|
|
20968
20988
|
|
|
20969
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
20989
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/services/person-preparation.js
|
|
20970
20990
|
var PREPARE_BYTES = 96 * 1024;
|
|
20971
20991
|
var MEETINGS = 5;
|
|
20972
20992
|
var CUES = 3;
|
|
@@ -21069,11 +21089,11 @@ var meetingsOf = /* @__PURE__ */ __name(async (store, uid, stored, since, left)
|
|
|
21069
21089
|
bytes: Math.min(left(), 4 * 1024 * 1024),
|
|
21070
21090
|
...since === void 0 ? {} : { since }
|
|
21071
21091
|
});
|
|
21072
|
-
const
|
|
21092
|
+
const read = new Set(found.items.map((item2) => parseMeetingReference(item2.reference).accountId));
|
|
21073
21093
|
return {
|
|
21074
21094
|
items: found.items,
|
|
21075
21095
|
hasMore: found.coverage.truncatedBy !== null || found.coverage.scanLimitReached,
|
|
21076
|
-
accounts: stored.filter(({ id: id2 }) =>
|
|
21096
|
+
accounts: stored.filter(({ id: id2 }) => read.has(id2)).map(accountName),
|
|
21077
21097
|
pending: found.coverage.pending
|
|
21078
21098
|
};
|
|
21079
21099
|
} catch (error) {
|
|
@@ -21083,18 +21103,18 @@ var meetingsOf = /* @__PURE__ */ __name(async (store, uid, stored, since, left)
|
|
|
21083
21103
|
}
|
|
21084
21104
|
}, "meetingsOf");
|
|
21085
21105
|
|
|
21086
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
21106
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/services/person-profile.js
|
|
21087
21107
|
var personProfile = /* @__PURE__ */ __name(async (deps, person, known2) => {
|
|
21088
21108
|
const online = deps.offline ? void 0 : await deps.connection();
|
|
21089
21109
|
const held = await storeIfOpen(deps);
|
|
21090
|
-
const
|
|
21110
|
+
const read = online?.profile ? await online.profile(person) : known2 ? factsOfCard(known2) : await storedFacts2(held ?? { store: await deps.store(), account: await deps.account() }, person);
|
|
21091
21111
|
if (!held)
|
|
21092
|
-
return { ...
|
|
21093
|
-
if (online?.profile &&
|
|
21094
|
-
await unlessBusy(() => held.store.people.savePeople(held.account, [{ id:
|
|
21112
|
+
return { ...read, chats: quiet(read), aliases: [] };
|
|
21113
|
+
if (online?.profile && read.phone) {
|
|
21114
|
+
await unlessBusy(() => held.store.people.savePeople(held.account, [{ id: read.id, name: read.name, phone: read.phone }]));
|
|
21095
21115
|
}
|
|
21096
|
-
const phone =
|
|
21097
|
-
const facts = phone ? { ...
|
|
21116
|
+
const phone = read.phone ?? await held.store.people.phoneOf(held.account, read.id);
|
|
21117
|
+
const facts = phone ? { ...read, phone } : read;
|
|
21098
21118
|
return {
|
|
21099
21119
|
...facts,
|
|
21100
21120
|
chats: await activityIn(held.store, held.account, facts),
|
|
@@ -21153,7 +21173,7 @@ var quiet = /* @__PURE__ */ __name((facts) => facts.chats.map(({ id: id2, title,
|
|
|
21153
21173
|
complete: false
|
|
21154
21174
|
})), "quiet");
|
|
21155
21175
|
|
|
21156
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
21176
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/services/person-timeline.js
|
|
21157
21177
|
var TIMELINE_ITEMS = 50;
|
|
21158
21178
|
var TIMELINE_MAX = 500;
|
|
21159
21179
|
var SCOPES = ["personal", "work"];
|
|
@@ -21208,7 +21228,7 @@ var personTimeline = /* @__PURE__ */ __name(async (store, asked, reference, { sc
|
|
|
21208
21228
|
};
|
|
21209
21229
|
}, "personTimeline");
|
|
21210
21230
|
|
|
21211
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
21231
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/services/people.js
|
|
21212
21232
|
var peopleService = /* @__PURE__ */ __name((deps) => {
|
|
21213
21233
|
const localCard = /* @__PURE__ */ __name(async (card, includeNotes = false) => {
|
|
21214
21234
|
const held = await storeIfOpen(deps);
|
|
@@ -21435,10 +21455,7 @@ var withoutPhone = /* @__PURE__ */ __name((answer) => {
|
|
|
21435
21455
|
return rest;
|
|
21436
21456
|
}, "withoutPhone");
|
|
21437
21457
|
|
|
21438
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
21439
|
-
var MAX_BYTES = 16 * 1024 * 1024;
|
|
21440
|
-
|
|
21441
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.590.0_@wirecat+cli-base@0.80.1_commander@15.0.0_esbuild@0.28.2_type_4c7167080feb2ba6356a64767981f5fd/node_modules/@wirecat/cli-core/dist/services/task-stats.js
|
|
21458
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/services/task-stats.js
|
|
21442
21459
|
var TASK_STATS_BY = ["chat", "meeting", "project"];
|
|
21443
21460
|
var PERIOD_FIELD = "created";
|
|
21444
21461
|
var refuseNestedPeriod = /* @__PURE__ */ __name((node, top = true) => {
|
|
@@ -21470,14 +21487,14 @@ var taskStatsOf = /* @__PURE__ */ __name(async (store, account, { by = "chat", q
|
|
|
21470
21487
|
if (query)
|
|
21471
21488
|
refuseNestedPeriod(query.root);
|
|
21472
21489
|
const time = /* @__PURE__ */ __name((sql) => ({ type: "time", sql }), "time");
|
|
21473
|
-
const
|
|
21490
|
+
const read = { ...columns, [PERIOD_FIELD]: time("t.created_at"), closed: time("t.closed_at") };
|
|
21474
21491
|
const fixed = [
|
|
21475
21492
|
...group === void 0 ? [] : [{ sql: "t.source_group = ?", params: [group] }],
|
|
21476
21493
|
...kind === void 0 ? [] : [{ sql: "t.type = ?", params: [kind] }],
|
|
21477
21494
|
...by === "meeting" ? [{ sql: "t.source_kind = 'meeting'", params: [] }] : []
|
|
21478
21495
|
];
|
|
21479
21496
|
const options = { command: "stats tasks show", now, ...timezone === void 0 ? {} : { zone: timezone } };
|
|
21480
|
-
const where = /* @__PURE__ */ __name((ast, more = []) => and([...fixed, ...more, ...ast ? [queryFilter(ast,
|
|
21497
|
+
const where = /* @__PURE__ */ __name((ast, more = []) => and([...fixed, ...more, ...ast ? [queryFilter(ast, read, options)] : []]), "where");
|
|
21481
21498
|
const scope = by === "project" ? { board: true } : { account: taskAccount(account) };
|
|
21482
21499
|
const all = await store.tasks.statRows(scope, where(withoutField(query, PERIOD_FIELD)));
|
|
21483
21500
|
const created = await store.tasks.statRows(scope, where(query));
|
|
@@ -21541,7 +21558,7 @@ var meetingNames = /* @__PURE__ */ __name(async (store, groups) => {
|
|
|
21541
21558
|
}));
|
|
21542
21559
|
}, "meetingNames");
|
|
21543
21560
|
|
|
21544
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
21561
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/services/task-tag-filters.js
|
|
21545
21562
|
var taskTagFilters = /* @__PURE__ */ __name(async (store, query) => {
|
|
21546
21563
|
const tags = /* @__PURE__ */ new Map();
|
|
21547
21564
|
for (const node of query ? walkQuery(query.root) : [])
|
|
@@ -21550,7 +21567,7 @@ var taskTagFilters = /* @__PURE__ */ __name(async (store, query) => {
|
|
|
21550
21567
|
return tags;
|
|
21551
21568
|
}, "taskTagFilters");
|
|
21552
21569
|
|
|
21553
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
21570
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/services/tasks.js
|
|
21554
21571
|
var TASK_QUERY = {
|
|
21555
21572
|
entity: "task",
|
|
21556
21573
|
backend: "sql",
|
|
@@ -21761,19 +21778,19 @@ var tasksService = /* @__PURE__ */ __name((deps, categories) => {
|
|
|
21761
21778
|
const locator = native ? void 0 : parseLocator(source);
|
|
21762
21779
|
if (locator && (locator.provider !== account.provider || locator.account !== account.account))
|
|
21763
21780
|
throw new CliError("validation_error", "that locator belongs to another account; select its profile first");
|
|
21764
|
-
const
|
|
21765
|
-
if ((native || locator?.provider === "notes") && !
|
|
21781
|
+
const note = native || locator?.provider === "notes" ? await store.notes.resolveNote(source) : void 0;
|
|
21782
|
+
if ((native || locator?.provider === "notes") && !note)
|
|
21766
21783
|
throw new CliError("not_found", "the task source note is unavailable or deleted");
|
|
21767
|
-
if (
|
|
21784
|
+
if (note && note.deletedAt !== null)
|
|
21768
21785
|
throw new CliError("not_found", "the task source note is unavailable or deleted");
|
|
21769
|
-
if (
|
|
21770
|
-
for (const reference of await store.notes.noteReferences(
|
|
21786
|
+
if (note) {
|
|
21787
|
+
for (const reference of await store.notes.noteReferences(note.ref)) {
|
|
21771
21788
|
const existing = (await store.tasks.findBySource(taskAccount(account), reference)).find((task3) => origin === "rule" || task3.kind === type);
|
|
21772
21789
|
if (existing)
|
|
21773
21790
|
return { task: await taskView(store, account, existing), created: false };
|
|
21774
21791
|
}
|
|
21775
21792
|
}
|
|
21776
|
-
const held = (await store.tasks.findBySource(taskAccount(account),
|
|
21793
|
+
const held = (await store.tasks.findBySource(taskAccount(account), note ? note.ref : source)).find((one) => one.kind === type);
|
|
21777
21794
|
if (held)
|
|
21778
21795
|
return { task: await taskView(store, account, held), created: false };
|
|
21779
21796
|
if (choice.attach !== void 0 && choice.new)
|
|
@@ -21781,7 +21798,7 @@ var tasksService = /* @__PURE__ */ __name((deps, categories) => {
|
|
|
21781
21798
|
const draft = {
|
|
21782
21799
|
title: plan.title ?? "",
|
|
21783
21800
|
...plan.description === void 0 ? {} : { description: plan.description },
|
|
21784
|
-
...
|
|
21801
|
+
...note ? {} : { source },
|
|
21785
21802
|
...chosen === void 0 ? {} : { category: chosen },
|
|
21786
21803
|
...plan.dueAt ? { due: plan.dueAt } : {}
|
|
21787
21804
|
};
|
|
@@ -21796,9 +21813,9 @@ var tasksService = /* @__PURE__ */ __name((deps, categories) => {
|
|
|
21796
21813
|
...origin === "owner" ? { origin: "owner", by: "owner" } : { origin: "suggested", confirmed: false }
|
|
21797
21814
|
};
|
|
21798
21815
|
try {
|
|
21799
|
-
await store.notes.addLink({ ...link4, to:
|
|
21816
|
+
await store.notes.addLink({ ...link4, to: note ? note.ref : source });
|
|
21800
21817
|
} catch (error) {
|
|
21801
|
-
if (!(error instanceof CliError && error.code === "not_found" && !
|
|
21818
|
+
if (!(error instanceof CliError && error.code === "not_found" && !note))
|
|
21802
21819
|
throw error;
|
|
21803
21820
|
await store.notes.addLink({ ...link4, targetText: source });
|
|
21804
21821
|
}
|
|
@@ -21820,12 +21837,12 @@ var tasksService = /* @__PURE__ */ __name((deps, categories) => {
|
|
|
21820
21837
|
}));
|
|
21821
21838
|
throw new CliError("validation_error", `${candidates.length === 1 ? "a task" : `${candidates.length} tasks`} may be the same job: ${shown.map((one) => `${one.key} (${one.band}, ${one.score}: ${one.reasons.join(", ")})`).join("; ")} \u2014 link the message to one with --into <id>, or open it anyway with --new` + (closedOnes ? ", which links it follow-up-of the closed one" : ""), { reason: "task.duplicate-candidates", candidates: shown });
|
|
21822
21839
|
}
|
|
21823
|
-
const sourceText = /* @__PURE__ */ __name(async () =>
|
|
21840
|
+
const sourceText = /* @__PURE__ */ __name(async () => note ? note.text : locator ? (await store.messages.message(account, locator.message, { chatId: locator.chat }))?.text ?? "" : "", "sourceText");
|
|
21824
21841
|
const { task: added, created } = await service(store).add({
|
|
21825
|
-
source:
|
|
21826
|
-
sourceKind:
|
|
21842
|
+
source: note ? note.ref : source,
|
|
21843
|
+
sourceKind: note || account.provider === "notes" ? "note" : account.provider === "email" ? "email" : "message",
|
|
21827
21844
|
account: taskAccount(account),
|
|
21828
|
-
group:
|
|
21845
|
+
group: note ? note.ref : locator.chat,
|
|
21829
21846
|
kind: type,
|
|
21830
21847
|
origin,
|
|
21831
21848
|
...plan.dueAt ? { dueAt: plan.dueAt } : {},
|
|
@@ -22028,11 +22045,11 @@ var taskView = /* @__PURE__ */ __name(async (store, account, task2) => {
|
|
|
22028
22045
|
if (locator && (locator.provider !== account.provider || locator.account !== account.account))
|
|
22029
22046
|
return { ...task2, message: null };
|
|
22030
22047
|
if (native || locator?.provider === "notes") {
|
|
22031
|
-
const
|
|
22048
|
+
const note = await store.notes.resolveNote(task2.source);
|
|
22032
22049
|
return {
|
|
22033
22050
|
...task2,
|
|
22034
22051
|
message: null,
|
|
22035
|
-
note:
|
|
22052
|
+
note: note && note.deletedAt === null ? { id: note.id, title: note.title, text: note.text.slice(0, PREVIEW), updatedAt: note.updatedAt } : null
|
|
22036
22053
|
};
|
|
22037
22054
|
}
|
|
22038
22055
|
const found = locator ? await store.messages.message(account, locator.message, { chatId: locator.chat }) : void 0;
|
|
@@ -22042,7 +22059,7 @@ var taskView = /* @__PURE__ */ __name(async (store, account, task2) => {
|
|
|
22042
22059
|
};
|
|
22043
22060
|
}, "taskView");
|
|
22044
22061
|
|
|
22045
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
22062
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/mail/owed.js
|
|
22046
22063
|
var mailTurn = /* @__PURE__ */ __name((newest) => {
|
|
22047
22064
|
if (newest === null)
|
|
22048
22065
|
return null;
|
|
@@ -22051,7 +22068,7 @@ var mailTurn = /* @__PURE__ */ __name((newest) => {
|
|
|
22051
22068
|
return newest.addressed ? "owed" : null;
|
|
22052
22069
|
}, "mailTurn");
|
|
22053
22070
|
|
|
22054
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
22071
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/services/agenda-mail.js
|
|
22055
22072
|
var absent = /* @__PURE__ */ __name((error) => {
|
|
22056
22073
|
if (error instanceof CliError && error.code === "not_found")
|
|
22057
22074
|
return void 0;
|
|
@@ -22109,7 +22126,7 @@ var mailActivity = /* @__PURE__ */ __name(async (store, account, since, chats) =
|
|
|
22109
22126
|
};
|
|
22110
22127
|
}, "mailActivity");
|
|
22111
22128
|
|
|
22112
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
22129
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/services/chat-coverage.js
|
|
22113
22130
|
var chatCoverage = /* @__PURE__ */ __name(async (store, account, chatIds) => {
|
|
22114
22131
|
const ids = [...new Set(chatIds)];
|
|
22115
22132
|
if (ids.length === 0)
|
|
@@ -22135,7 +22152,7 @@ var chatCoverage = /* @__PURE__ */ __name(async (store, account, chatIds) => {
|
|
|
22135
22152
|
}));
|
|
22136
22153
|
}, "chatCoverage");
|
|
22137
22154
|
|
|
22138
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
22155
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/services/agenda.js
|
|
22139
22156
|
var DAY = 864e5;
|
|
22140
22157
|
var AGENDA_DEFAULTS = { unanswered: DAY, waiting: 7 * DAY };
|
|
22141
22158
|
var CLAIMS = ["none", "mine", "others", "any"];
|
|
@@ -22382,7 +22399,7 @@ var agendaItem = /* @__PURE__ */ __name((shown) => {
|
|
|
22382
22399
|
};
|
|
22383
22400
|
}, "agendaItem");
|
|
22384
22401
|
|
|
22385
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
22402
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/context/evidence-response.js
|
|
22386
22403
|
var contextSourceKey = /* @__PURE__ */ __name((source) => JSON.stringify([source.kind, source.accountId, source.provider, source.account]), "contextSourceKey");
|
|
22387
22404
|
var validateContextEvidencePage = /* @__PURE__ */ __name((page, request) => {
|
|
22388
22405
|
const fail2 = /* @__PURE__ */ __name(() => {
|
|
@@ -22446,7 +22463,7 @@ var validateContextEvidencePage = /* @__PURE__ */ __name((page, request) => {
|
|
|
22446
22463
|
}
|
|
22447
22464
|
}, "validateContextEvidencePage");
|
|
22448
22465
|
|
|
22449
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
22466
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/context/read-budget.js
|
|
22450
22467
|
var contextReadBudget = /* @__PURE__ */ __name((limits = {}) => {
|
|
22451
22468
|
if (!limits || typeof limits !== "object" || Array.isArray(limits))
|
|
22452
22469
|
throw new CliError("validation_error", "limits needs a context read allowance");
|
|
@@ -22499,7 +22516,7 @@ var contextReadBudget = /* @__PURE__ */ __name((limits = {}) => {
|
|
|
22499
22516
|
};
|
|
22500
22517
|
}, "contextReadBudget");
|
|
22501
22518
|
|
|
22502
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
22519
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/services/context-evidence.js
|
|
22503
22520
|
var createContextEvidenceReader = /* @__PURE__ */ __name((port, allowed, limits) => {
|
|
22504
22521
|
if (!port || typeof port.read !== "function")
|
|
22505
22522
|
throw new CliError("configuration_error", "context evidence reader is unavailable");
|
|
@@ -22507,7 +22524,7 @@ var createContextEvidenceReader = /* @__PURE__ */ __name((port, allowed, limits)
|
|
|
22507
22524
|
throw new CliError("validation_error", "allowed needs 1\u20138 explicitly authorized sources");
|
|
22508
22525
|
const keys = new Set(allowed.map(contextSource).map(contextSourceKey));
|
|
22509
22526
|
const budget = contextReadBudget(limits);
|
|
22510
|
-
const
|
|
22527
|
+
const read = port.read.bind(port);
|
|
22511
22528
|
return {
|
|
22512
22529
|
usage: budget.usage,
|
|
22513
22530
|
async read(original) {
|
|
@@ -22530,7 +22547,7 @@ var createContextEvidenceReader = /* @__PURE__ */ __name((port, allowed, limits)
|
|
|
22530
22547
|
signal
|
|
22531
22548
|
});
|
|
22532
22549
|
try {
|
|
22533
|
-
const page = await
|
|
22550
|
+
const page = await read(request);
|
|
22534
22551
|
signal?.throwIfAborted();
|
|
22535
22552
|
validateContextEvidencePage(page, request);
|
|
22536
22553
|
reservation.complete(page.readBytes);
|
|
@@ -22543,7 +22560,7 @@ var createContextEvidenceReader = /* @__PURE__ */ __name((port, allowed, limits)
|
|
|
22543
22560
|
};
|
|
22544
22561
|
}, "createContextEvidenceReader");
|
|
22545
22562
|
|
|
22546
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
22563
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/services/excerpt.js
|
|
22547
22564
|
var queryWords = /* @__PURE__ */ __name((query) => query.toLowerCase().split(/\s+/).map((word) => word.replace(/^[\p{L}_]+:/u, "").replace(/~\d+$/u, "").replace(/^[^\p{L}\p{N}]+|[^\p{L}\p{N}]+$/gu, "")).filter((word) => word.length > 2 && !["and", "or", "not"].includes(word)), "queryWords");
|
|
22548
22565
|
var excerpt = /* @__PURE__ */ __name((text2, query, size2 = 240, options = {}) => {
|
|
22549
22566
|
const flat = text2.replace(/\s+/g, " ").trim();
|
|
@@ -22559,7 +22576,7 @@ var excerpt = /* @__PURE__ */ __name((text2, query, size2 = 240, options = {}) =
|
|
|
22559
22576
|
}, "excerpt");
|
|
22560
22577
|
var withExcerpt = /* @__PURE__ */ __name(({ matchedText, ...hit }, query) => ({ ...hit, excerpt: excerpt(matchedText ?? hit.text, query) }), "withExcerpt");
|
|
22561
22578
|
|
|
22562
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
22579
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/services/project-purposes.js
|
|
22563
22580
|
var BUILT_IN_PURPOSES = ["work", "sales", "support", "other"];
|
|
22564
22581
|
var DEFAULT_PURPOSES = ["work"];
|
|
22565
22582
|
var LINK_PURPOSE = "work";
|
|
@@ -22569,7 +22586,7 @@ var unknown = /* @__PURE__ */ __name((asked, config) => {
|
|
|
22569
22586
|
if (wrong.length)
|
|
22570
22587
|
throw new CliError("validation_error", `unknown purpose ${wrong.join(", ")}; the configured ones are ${config.purposes.join(", ")}, or all`, { param: "purpose", purposes: [...config.purposes] });
|
|
22571
22588
|
}, "unknown");
|
|
22572
|
-
var purposesOf = /* @__PURE__ */ __name((asked, config = BUILT_IN_PURPOSE_CONFIG,
|
|
22589
|
+
var purposesOf = /* @__PURE__ */ __name((asked, config = BUILT_IN_PURPOSE_CONFIG, project) => {
|
|
22573
22590
|
const words3 = (asked ?? []).map((one) => one.trim()).filter(Boolean);
|
|
22574
22591
|
if (words3.includes("all")) {
|
|
22575
22592
|
if (words3.length > 1)
|
|
@@ -22580,7 +22597,7 @@ var purposesOf = /* @__PURE__ */ __name((asked, config = BUILT_IN_PURPOSE_CONFIG
|
|
|
22580
22597
|
unknown(words3, config);
|
|
22581
22598
|
return new Set(words3);
|
|
22582
22599
|
}
|
|
22583
|
-
const own = (
|
|
22600
|
+
const own = (project?.key ? config.projects?.[project.key] : void 0) ?? (project?.ref ? config.projects?.[project.ref] : void 0);
|
|
22584
22601
|
return new Set(own ?? config.defaults);
|
|
22585
22602
|
}, "purposesOf");
|
|
22586
22603
|
var purposeRead = /* @__PURE__ */ __name((choice, purpose) => choice === "all" || choice.has(purpose ?? LINK_PURPOSE), "purposeRead");
|
|
@@ -22589,7 +22606,7 @@ var purposeList = /* @__PURE__ */ __name((value, previous = []) => [
|
|
|
22589
22606
|
...value.split(",").map((one) => one.trim()).filter(Boolean)
|
|
22590
22607
|
], "purposeList");
|
|
22591
22608
|
|
|
22592
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
22609
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/services/project-gathering-around.js
|
|
22593
22610
|
var storedMessageNeighbours = /* @__PURE__ */ __name((messages) => ({
|
|
22594
22611
|
async around(ref, window3) {
|
|
22595
22612
|
const at = parseLocator(ref);
|
|
@@ -22684,7 +22701,7 @@ var storedNeighbours = /* @__PURE__ */ __name((store) => {
|
|
|
22684
22701
|
};
|
|
22685
22702
|
}, "storedNeighbours");
|
|
22686
22703
|
|
|
22687
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
22704
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/services/project-gathering-request.js
|
|
22688
22705
|
import { createHash as createHash2 } from "node:crypto";
|
|
22689
22706
|
var DAY2 = 864e5;
|
|
22690
22707
|
var MAX_TIME = 864e13;
|
|
@@ -22755,7 +22772,7 @@ var projectGatheringRequest = /* @__PURE__ */ __name((input, now) => {
|
|
|
22755
22772
|
if (!input.project || typeof input.project !== "object")
|
|
22756
22773
|
fail("project needs a name", "project");
|
|
22757
22774
|
known(input.project, ["name", "key", "background", "aliases"], "project.");
|
|
22758
|
-
const
|
|
22775
|
+
const project = {
|
|
22759
22776
|
name: text(input.project.name, "project.name", 512),
|
|
22760
22777
|
key: input.project.key === void 0 ? null : text(input.project.key, "project.key", 64),
|
|
22761
22778
|
background: input.project.background === void 0 ? null : text(input.project.background, "project.background", 8192),
|
|
@@ -22836,10 +22853,10 @@ var projectGatheringRequest = /* @__PURE__ */ __name((input, now) => {
|
|
|
22836
22853
|
if (person && !found.people.includes(person))
|
|
22837
22854
|
found.people.push(person);
|
|
22838
22855
|
}, "lane");
|
|
22839
|
-
lane("project", laneQuery(
|
|
22840
|
-
if (
|
|
22841
|
-
lane("key", laneQuery(
|
|
22842
|
-
for (const [i, a] of
|
|
22856
|
+
lane("project", laneQuery(project.name, "project.name"));
|
|
22857
|
+
if (project.key)
|
|
22858
|
+
lane("key", laneQuery(project.key, "project.key"));
|
|
22859
|
+
for (const [i, a] of project.aliases.entries())
|
|
22843
22860
|
lane("alias", laneQuery(a, `project.aliases.${i}`));
|
|
22844
22861
|
for (const k of keywords)
|
|
22845
22862
|
lane("keyword", k);
|
|
@@ -22903,7 +22920,7 @@ var projectGatheringRequest = /* @__PURE__ */ __name((input, now) => {
|
|
|
22903
22920
|
budgets.maxPageBytes = budgets.maxReadBytes;
|
|
22904
22921
|
const fingerprint = createHash2("sha256").update(JSON.stringify([
|
|
22905
22922
|
"project-gathering-v1",
|
|
22906
|
-
|
|
22923
|
+
project,
|
|
22907
22924
|
lanes,
|
|
22908
22925
|
people,
|
|
22909
22926
|
sources.map(contextSourceKey),
|
|
@@ -22918,7 +22935,7 @@ var projectGatheringRequest = /* @__PURE__ */ __name((input, now) => {
|
|
|
22918
22935
|
if (input.checkpoint !== void 0 && typeof input.checkpoint !== "string")
|
|
22919
22936
|
fail("checkpoint must be text", "checkpoint");
|
|
22920
22937
|
return {
|
|
22921
|
-
project
|
|
22938
|
+
project,
|
|
22922
22939
|
keywords,
|
|
22923
22940
|
people,
|
|
22924
22941
|
lanes,
|
|
@@ -23000,7 +23017,7 @@ var decodeCheckpoint = /* @__PURE__ */ __name((text2, plan) => {
|
|
|
23000
23017
|
return value;
|
|
23001
23018
|
}, "decodeCheckpoint");
|
|
23002
23019
|
|
|
23003
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
23020
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/services/project-gathering.js
|
|
23004
23021
|
var terminal = /* @__PURE__ */ new Set(["done", "unavailable", "failed"]);
|
|
23005
23022
|
var PAGE2 = 20;
|
|
23006
23023
|
var PEOPLE = 20;
|
|
@@ -23404,7 +23421,7 @@ var peopleOf = /* @__PURE__ */ __name((items, senderOf) => {
|
|
|
23404
23421
|
return [...byKey.values()].sort((a, b) => b.items - a.items || a.name.localeCompare(b.name));
|
|
23405
23422
|
}, "peopleOf");
|
|
23406
23423
|
|
|
23407
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
23424
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/services/meeting-project-candidate-matching.js
|
|
23408
23425
|
var normalizedText = /* @__PURE__ */ __name((text2) => text2.normalize("NFKC").toLowerCase().replace(/\s+/gu, " "), "normalizedText");
|
|
23409
23426
|
var termsOf = /* @__PURE__ */ __name((entry) => [
|
|
23410
23427
|
{ name: entry.name, kind: "canonical" },
|
|
@@ -23448,7 +23465,7 @@ var matchVocabularyTerms = /* @__PURE__ */ __name((catalog, texts) => {
|
|
|
23448
23465
|
return result.sort((a, b) => Number(a.entry.id) - Number(b.entry.id));
|
|
23449
23466
|
}, "matchVocabularyTerms");
|
|
23450
23467
|
|
|
23451
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
23468
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/services/project-gathering-mentions.js
|
|
23452
23469
|
var KINDS = ["project", "tag", "topic"];
|
|
23453
23470
|
var findEvidenceMentions = /* @__PURE__ */ __name(async (vocabulary, gathering, options = {}) => {
|
|
23454
23471
|
if (typeof vocabulary?.vocabulary !== "function")
|
|
@@ -23503,7 +23520,7 @@ var findEvidenceMentions = /* @__PURE__ */ __name(async (vocabulary, gathering,
|
|
|
23503
23520
|
};
|
|
23504
23521
|
}, "findEvidenceMentions");
|
|
23505
23522
|
|
|
23506
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
23523
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/services/stored-project-gathering.js
|
|
23507
23524
|
var storedChatCount = /* @__PURE__ */ __name((store) => async (account, chatId, { since, until }) => {
|
|
23508
23525
|
const window3 = { since: new Date(since).toISOString(), until: new Date(until - 1).toISOString() };
|
|
23509
23526
|
const [messages, newest, oldest] = await Promise.all([
|
|
@@ -23581,12 +23598,12 @@ var contactOf = /* @__PURE__ */ __name(async (store, contact) => {
|
|
|
23581
23598
|
}, "contactOf");
|
|
23582
23599
|
var LINKED_CHATS = 16;
|
|
23583
23600
|
var CORE_LIMIT = 16;
|
|
23584
|
-
var proposedLinksOf = /* @__PURE__ */ __name(async (store,
|
|
23585
|
-
const stored = await store.proposedActions.list({ kinds: ["relationship"], status: "proposed", project
|
|
23601
|
+
var proposedLinksOf = /* @__PURE__ */ __name(async (store, project) => {
|
|
23602
|
+
const stored = await store.proposedActions.list({ kinds: ["relationship"], status: "proposed", project, limit: 500 });
|
|
23586
23603
|
const proposals = stored.flatMap((action) => {
|
|
23587
23604
|
const payload = action.payload;
|
|
23588
23605
|
const { purpose, score } = action.payload;
|
|
23589
|
-
if (payload?.kind !== "member-of" || payload.to !==
|
|
23606
|
+
if (payload?.kind !== "member-of" || payload.to !== project || typeof payload.from !== "string")
|
|
23590
23607
|
return [];
|
|
23591
23608
|
return [
|
|
23592
23609
|
{
|
|
@@ -23598,29 +23615,29 @@ var proposedLinksOf = /* @__PURE__ */ __name(async (store, project2) => {
|
|
|
23598
23615
|
}
|
|
23599
23616
|
];
|
|
23600
23617
|
}).sort((a, b) => Number(a.id) - Number(b.id));
|
|
23601
|
-
const legacy = (await store.knowledge.relations(null,
|
|
23618
|
+
const legacy = (await store.knowledge.relations(null, project)).filter((one) => !one.confirmed && one.kind === "member-of" && one.to === project).map((one) => ({ from: one.from, id: `link:${one.id}`, role: one.role, purpose: one.purpose }));
|
|
23602
23619
|
return [...proposals, ...legacy];
|
|
23603
23620
|
}, "proposedLinksOf");
|
|
23604
|
-
var memberRefsOf = /* @__PURE__ */ __name(async (store,
|
|
23605
|
-
if (!
|
|
23621
|
+
var memberRefsOf = /* @__PURE__ */ __name(async (store, project, includeProposed) => {
|
|
23622
|
+
if (!project)
|
|
23606
23623
|
return [];
|
|
23607
23624
|
const confirmed = /* @__PURE__ */ new Set();
|
|
23608
|
-
for (const relation of await store.knowledge.relations(null,
|
|
23609
|
-
if (relation.confirmed && relation.kind === "member-of" && relation.to ===
|
|
23625
|
+
for (const relation of await store.knowledge.relations(null, project))
|
|
23626
|
+
if (relation.confirmed && relation.kind === "member-of" && relation.to === project && /^person:.+/.test(relation.from))
|
|
23610
23627
|
confirmed.add(relation.from);
|
|
23611
23628
|
const members = [...confirmed].sort().map((ref) => ({ ref }));
|
|
23612
23629
|
if (!includeProposed)
|
|
23613
23630
|
return members;
|
|
23614
|
-
for (const one of await proposedLinksOf(store,
|
|
23631
|
+
for (const one of await proposedLinksOf(store, project))
|
|
23615
23632
|
if (/^person:.+/.test(one.from) && !members.some((member) => member.ref === one.from))
|
|
23616
23633
|
members.push({ ref: one.from, proposed: one.id, ...one.score === void 0 ? {} : { score: one.score } });
|
|
23617
23634
|
return members;
|
|
23618
23635
|
}, "memberRefsOf");
|
|
23619
|
-
var memberLanesOf = /* @__PURE__ */ __name(async (store,
|
|
23636
|
+
var memberLanesOf = /* @__PURE__ */ __name(async (store, project, given, room, includeProposed) => {
|
|
23620
23637
|
const lanes = [];
|
|
23621
23638
|
const left = [];
|
|
23622
23639
|
const rows = [];
|
|
23623
|
-
for (const member of (await memberRefsOf(store,
|
|
23640
|
+
for (const member of (await memberRefsOf(store, project, includeProposed)).filter((one) => !given.has(one.ref))) {
|
|
23624
23641
|
const { ref: reference, ...marks } = member;
|
|
23625
23642
|
const person = await store.people.personByUid(reference.slice("person:".length));
|
|
23626
23643
|
const senders = person ? sendersOf2(person) : [];
|
|
@@ -23639,12 +23656,12 @@ var chatOf2 = /* @__PURE__ */ __name((from) => {
|
|
|
23639
23656
|
const reference = parseReference(from);
|
|
23640
23657
|
return reference.type === "chat" ? reference : void 0;
|
|
23641
23658
|
}, "chatOf");
|
|
23642
|
-
var linkedChatsOf = /* @__PURE__ */ __name(async (store,
|
|
23643
|
-
if (!
|
|
23659
|
+
var linkedChatsOf = /* @__PURE__ */ __name(async (store, project, options = {}) => {
|
|
23660
|
+
if (!project)
|
|
23644
23661
|
return [];
|
|
23645
23662
|
const chats = [];
|
|
23646
|
-
for (const relation of await store.knowledge.relations(null,
|
|
23647
|
-
if (!relation.confirmed || relation.kind !== "member-of" || relation.to !==
|
|
23663
|
+
for (const relation of await store.knowledge.relations(null, project)) {
|
|
23664
|
+
if (!relation.confirmed || relation.kind !== "member-of" || relation.to !== project)
|
|
23648
23665
|
continue;
|
|
23649
23666
|
const reference = chatOf2(relation.from);
|
|
23650
23667
|
if (reference)
|
|
@@ -23659,7 +23676,7 @@ var linkedChatsOf = /* @__PURE__ */ __name(async (store, project2, options = {})
|
|
|
23659
23676
|
}
|
|
23660
23677
|
if (!options.includeProposed)
|
|
23661
23678
|
return chats;
|
|
23662
|
-
for (const one of await proposedLinksOf(store,
|
|
23679
|
+
for (const one of await proposedLinksOf(store, project)) {
|
|
23663
23680
|
const reference = chatOf2(one.from);
|
|
23664
23681
|
if (!reference)
|
|
23665
23682
|
continue;
|
|
@@ -23684,19 +23701,19 @@ var gatherStoredProject = /* @__PURE__ */ __name(async (store, input) => {
|
|
|
23684
23701
|
throw new CliError("validation_error", "--before-time must be later than --since-time", { param: "before_time" });
|
|
23685
23702
|
if (!store.contextEvidence)
|
|
23686
23703
|
throw new CliError("configuration_error", "Stored context reads are unavailable in this store");
|
|
23687
|
-
const
|
|
23704
|
+
const project = await projectOf(store, input.project);
|
|
23688
23705
|
const { sources, unread, scope } = input.sources;
|
|
23689
23706
|
if (sources.length === 0)
|
|
23690
23707
|
throw new CliError("not_found", "no selected source holds anything to read", { param: "source" });
|
|
23691
23708
|
const contacts = (await Promise.all([...new Set(input.people ?? [])].map((contact) => contactOf(store, contact)))).flat();
|
|
23692
|
-
const aliases = [.../* @__PURE__ */ new Set([...
|
|
23693
|
-
const searchLanes = 1 + (
|
|
23709
|
+
const aliases = [.../* @__PURE__ */ new Set([...project.aliases, ...input.aliases ?? []])].filter((alias) => alias !== project.name);
|
|
23710
|
+
const searchLanes = 1 + (project.key ? 1 : 0) + aliases.length + (input.keywords?.length ?? 0) + contacts.filter((one) => one.name).length;
|
|
23694
23711
|
const room = Math.min(CORE_LIMIT - contacts.length, CORE_LIMIT - searchLanes - contacts.filter((one) => one.senders).length);
|
|
23695
23712
|
const includeProposed = input.includeProposed === true;
|
|
23696
|
-
const purposes = purposesOf(input.purposes, input.purposeConfig,
|
|
23697
|
-
const members = await memberLanesOf(store,
|
|
23713
|
+
const purposes = purposesOf(input.purposes, input.purposeConfig, project);
|
|
23714
|
+
const members = await memberLanesOf(store, project.ref, new Set(contacts.flatMap((one) => one.reference ?? [])), room, includeProposed);
|
|
23698
23715
|
const people = [...contacts, ...members.lanes];
|
|
23699
|
-
const all = await linkedChatsOf(store,
|
|
23716
|
+
const all = await linkedChatsOf(store, project.ref, { includeProposed });
|
|
23700
23717
|
const linked = all.filter((one) => purposeRead(purposes, one.purpose));
|
|
23701
23718
|
const linkedChats = linked.slice(0, LINKED_CHATS).map(({ provider, account, chat }) => ({ provider, account, chat }));
|
|
23702
23719
|
const budgets = {
|
|
@@ -23713,8 +23730,8 @@ var gatherStoredProject = /* @__PURE__ */ __name(async (store, input) => {
|
|
|
23713
23730
|
...input.onFetchProgress ? { onFetchProgress: input.onFetchProgress } : {}
|
|
23714
23731
|
}, {
|
|
23715
23732
|
project: {
|
|
23716
|
-
name:
|
|
23717
|
-
...
|
|
23733
|
+
name: project.name,
|
|
23734
|
+
...project.key ? { key: project.key } : {},
|
|
23718
23735
|
...aliases.length ? { aliases } : {}
|
|
23719
23736
|
},
|
|
23720
23737
|
index: input.catchUp === false ? "as-is" : "update",
|
|
@@ -23732,7 +23749,7 @@ var gatherStoredProject = /* @__PURE__ */ __name(async (store, input) => {
|
|
|
23732
23749
|
...Object.keys(budgets).length ? { budgets } : {},
|
|
23733
23750
|
...input.signal ? { signal: input.signal } : {}
|
|
23734
23751
|
});
|
|
23735
|
-
const mentions = await findEvidenceMentions(store.knowledge, gathered, { exclude:
|
|
23752
|
+
const mentions = await findEvidenceMentions(store.knowledge, gathered, { exclude: project.ref });
|
|
23736
23753
|
const unreadChats = [
|
|
23737
23754
|
...gathered.linkedChats.filter((one) => one.state === "out-of-scope").map((one) => ({ source: one.ref, kind: "linked-chat", reason: "out-of-scope" })),
|
|
23738
23755
|
...linked.slice(LINKED_CHATS).map((one) => ({
|
|
@@ -23788,7 +23805,7 @@ var gatherStoredProject = /* @__PURE__ */ __name(async (store, input) => {
|
|
|
23788
23805
|
});
|
|
23789
23806
|
}
|
|
23790
23807
|
return {
|
|
23791
|
-
projectRef:
|
|
23808
|
+
projectRef: project.ref,
|
|
23792
23809
|
unreadSources: [...unread, ...unreadChats, ...members.left],
|
|
23793
23810
|
...gathered,
|
|
23794
23811
|
items,
|
|
@@ -23809,18 +23826,18 @@ var purposeHintOf = /* @__PURE__ */ __name((linked, rows, of) => {
|
|
|
23809
23826
|
return { chat: top.ref, relationship: link4.relationship, items, of };
|
|
23810
23827
|
}, "purposeHintOf");
|
|
23811
23828
|
|
|
23812
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
23829
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/services/media-archive.js
|
|
23813
23830
|
import { setTimeout as sleep3 } from "node:timers/promises";
|
|
23814
23831
|
|
|
23815
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
23832
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/services/media-archive-files.js
|
|
23816
23833
|
import { lstat } from "node:fs/promises";
|
|
23817
23834
|
|
|
23818
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
23835
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/persistence/native/recording-partial-store.js
|
|
23819
23836
|
import { createHash as createHash4, randomUUID as randomUUID2 } from "node:crypto";
|
|
23820
23837
|
import { open as open2, rename as rename2, unlink as unlink2 } from "node:fs/promises";
|
|
23821
23838
|
import { join as join2 } from "node:path";
|
|
23822
23839
|
|
|
23823
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
23840
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/persistence/native/recording-partial-metadata.js
|
|
23824
23841
|
import { createHash as createHash3 } from "node:crypto";
|
|
23825
23842
|
var metadataLimit = 16384;
|
|
23826
23843
|
var partialIdentity = /* @__PURE__ */ __name((locator) => JSON.stringify([locator.provider, locator.account, locator.occurrenceId, locator.assetId]), "partialIdentity");
|
|
@@ -23880,7 +23897,7 @@ var readPartialMetadata = /* @__PURE__ */ __name(async (path, locator, maxBytes,
|
|
|
23880
23897
|
}
|
|
23881
23898
|
}, "readPartialMetadata");
|
|
23882
23899
|
|
|
23883
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
23900
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/persistence/native/recording-partial-writer.js
|
|
23884
23901
|
import { randomUUID } from "node:crypto";
|
|
23885
23902
|
import { open, rename, unlink } from "node:fs/promises";
|
|
23886
23903
|
import { join } from "node:path";
|
|
@@ -23972,7 +23989,7 @@ var partialWriter = /* @__PURE__ */ __name(async (input) => {
|
|
|
23972
23989
|
};
|
|
23973
23990
|
}, "partialWriter");
|
|
23974
23991
|
|
|
23975
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
23992
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/persistence/native/recording-partial-store.js
|
|
23976
23993
|
var NativeRecordingPartialStore = class {
|
|
23977
23994
|
static {
|
|
23978
23995
|
__name(this, "NativeRecordingPartialStore");
|
|
@@ -24079,12 +24096,12 @@ var NativeRecordingPartialStore = class {
|
|
|
24079
24096
|
}
|
|
24080
24097
|
};
|
|
24081
24098
|
|
|
24082
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
24099
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/persistence/native/recording-publication.js
|
|
24083
24100
|
import { createHash as createHash5 } from "node:crypto";
|
|
24084
24101
|
import { link as link2 } from "node:fs/promises";
|
|
24085
24102
|
import { basename, dirname, join as join4, resolve } from "node:path";
|
|
24086
24103
|
|
|
24087
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
24104
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/persistence/native/recording-publication-files.js
|
|
24088
24105
|
import { unlink as unlink3 } from "node:fs/promises";
|
|
24089
24106
|
var verifiedPublicationFile = /* @__PURE__ */ __name(async (path, expected2, signal, writable = false) => {
|
|
24090
24107
|
signal?.throwIfAborted();
|
|
@@ -24119,7 +24136,7 @@ var commitPublication = /* @__PURE__ */ __name(async (root, partialPath, finalPa
|
|
|
24119
24136
|
signal?.throwIfAborted();
|
|
24120
24137
|
}, "commitPublication");
|
|
24121
24138
|
|
|
24122
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
24139
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/persistence/native/recording-publication-journal.js
|
|
24123
24140
|
import { randomUUID as randomUUID3 } from "node:crypto";
|
|
24124
24141
|
import { open as open3, rename as rename3, unlink as unlink4 } from "node:fs/promises";
|
|
24125
24142
|
import { join as join3 } from "node:path";
|
|
@@ -24192,7 +24209,7 @@ var writePublicationJournal = /* @__PURE__ */ __name(async (root, path, prefix,
|
|
|
24192
24209
|
}
|
|
24193
24210
|
}, "writePublicationJournal");
|
|
24194
24211
|
|
|
24195
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
24212
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/persistence/native/recording-publication.js
|
|
24196
24213
|
var NativeRecordingPublication = class {
|
|
24197
24214
|
static {
|
|
24198
24215
|
__name(this, "NativeRecordingPublication");
|
|
@@ -24265,7 +24282,7 @@ var NativeRecordingPublication = class {
|
|
|
24265
24282
|
}
|
|
24266
24283
|
};
|
|
24267
24284
|
|
|
24268
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
24285
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/services/media-archive-manifest.js
|
|
24269
24286
|
import { createHash as createHash6 } from "node:crypto";
|
|
24270
24287
|
import { readdir } from "node:fs/promises";
|
|
24271
24288
|
import { isAbsolute, join as join5, resolve as resolve2 } from "node:path";
|
|
@@ -24352,7 +24369,7 @@ var commitMediaEntry = /* @__PURE__ */ __name((root, one, beforePublish) => writ
|
|
|
24352
24369
|
beforePublish
|
|
24353
24370
|
}), "commitMediaEntry");
|
|
24354
24371
|
|
|
24355
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
24372
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/services/media-archive-files.js
|
|
24356
24373
|
var validator = '"media-completed-v1"';
|
|
24357
24374
|
var maximumFileBytes = 64 * 1024 * 1024 * 1024;
|
|
24358
24375
|
var archiveMediaFile = /* @__PURE__ */ __name(async (root, identity, kind, file, beforeWrite, signal, metadata = {}) => {
|
|
@@ -24453,7 +24470,7 @@ var archiveMediaFile = /* @__PURE__ */ __name(async (root, identity, kind, file,
|
|
|
24453
24470
|
return entry;
|
|
24454
24471
|
}, "archiveMediaFile");
|
|
24455
24472
|
|
|
24456
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
24473
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/services/media-archive-locks.js
|
|
24457
24474
|
import { mkdir, realpath } from "node:fs/promises";
|
|
24458
24475
|
import { join as join6, resolve as resolve3 } from "node:path";
|
|
24459
24476
|
var archiveLocations = /* @__PURE__ */ __name(async (initial, signal) => {
|
|
@@ -24520,7 +24537,7 @@ var withMediaArchiveLocks = /* @__PURE__ */ __name(async (directory2, signal, ru
|
|
|
24520
24537
|
throw new CliError("validation_error", "archive locations changed during locking; run the command again");
|
|
24521
24538
|
}, "withMediaArchiveLocks");
|
|
24522
24539
|
|
|
24523
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
24540
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/services/media-archive.js
|
|
24524
24541
|
var validateMediaSince = /* @__PURE__ */ __name((value, flag = "--since-time") => {
|
|
24525
24542
|
if (value === void 0)
|
|
24526
24543
|
return void 0;
|
|
@@ -24673,7 +24690,7 @@ var archiveMedia = /* @__PURE__ */ __name(async (ports, options) => {
|
|
|
24673
24690
|
}, { create: true });
|
|
24674
24691
|
}, "archiveMedia");
|
|
24675
24692
|
|
|
24676
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
24693
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/services/media-archive-move.js
|
|
24677
24694
|
import { realpath as realpath2, unlink as unlink5 } from "node:fs/promises";
|
|
24678
24695
|
import { basename as basename2, dirname as dirname2, join as join7, resolve as resolve4 } from "node:path";
|
|
24679
24696
|
var canonicalDestination = /* @__PURE__ */ __name(async (directory2) => {
|
|
@@ -24826,7 +24843,7 @@ var moveMediaArchive = /* @__PURE__ */ __name(async (options) => {
|
|
|
24826
24843
|
}, { additional: [target2], createAdditional: !options.dryRun });
|
|
24827
24844
|
}, "moveMediaArchive");
|
|
24828
24845
|
|
|
24829
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
24846
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/services/model-downloads.js
|
|
24830
24847
|
var bytesOf = /* @__PURE__ */ __name((model) => model.files.reduce((sum2, file) => sum2 + file.bytes, 0), "bytesOf");
|
|
24831
24848
|
var nativeRuntime = /* @__PURE__ */ __name(async ({ env, progress = /* @__PURE__ */ __name(() => {
|
|
24832
24849
|
}, "progress") }) => {
|
|
@@ -24849,7 +24866,7 @@ var downloadTextModel = /* @__PURE__ */ __name(async (id2, { env, progress = /*
|
|
|
24849
24866
|
}
|
|
24850
24867
|
await nativeRuntime({ env, progress });
|
|
24851
24868
|
progress(`${model.id}: loading it once to check it works`);
|
|
24852
|
-
const { openEmbedder: openEmbedder2 } = await import("./embed-
|
|
24869
|
+
const { openEmbedder: openEmbedder2 } = await import("./embed-4RIW2LVH.js");
|
|
24853
24870
|
const embedder = await openEmbedder2(model, directory2);
|
|
24854
24871
|
try {
|
|
24855
24872
|
const [vector] = await embedder.embed(["check"], "query");
|
|
@@ -24870,7 +24887,7 @@ var downloadRerankModel = /* @__PURE__ */ __name(async (id2, { env, progress = /
|
|
|
24870
24887
|
}
|
|
24871
24888
|
await nativeRuntime({ env, progress });
|
|
24872
24889
|
progress(`${model.id}: loading it once to check it works`);
|
|
24873
|
-
const { openReranker } = await import("./rerank-
|
|
24890
|
+
const { openReranker } = await import("./rerank-TL6Z6F7K.js");
|
|
24874
24891
|
const reranker = await openReranker(model, directory2);
|
|
24875
24892
|
try {
|
|
24876
24893
|
await reranker.score("check", ["check"]);
|
|
@@ -24888,7 +24905,7 @@ var downloadImageModel = /* @__PURE__ */ __name(async (id2, { env, progress = /*
|
|
|
24888
24905
|
await installFiles(placedImage(model, directory2), { progress });
|
|
24889
24906
|
}
|
|
24890
24907
|
progress(`${model.id}: loading it once to check it works`);
|
|
24891
|
-
const { openPictureEmbedder } = await import("./embedder-
|
|
24908
|
+
const { openPictureEmbedder } = await import("./embedder-SW7DTWSL.js");
|
|
24892
24909
|
const embedder = await openPictureEmbedder(model, directory2);
|
|
24893
24910
|
try {
|
|
24894
24911
|
const vector = await embedder.embedQuery("check");
|
|
@@ -24900,7 +24917,7 @@ var downloadImageModel = /* @__PURE__ */ __name(async (id2, { env, progress = /*
|
|
|
24900
24917
|
return { model, directory: directory2 };
|
|
24901
24918
|
}, "downloadImageModel");
|
|
24902
24919
|
|
|
24903
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
24920
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/domain/money-words.js
|
|
24904
24921
|
var MONEY_REQUEST = "money-request";
|
|
24905
24922
|
var MONEY_DONE = "money-done";
|
|
24906
24923
|
var PROMISE = "promise";
|
|
@@ -24934,10 +24951,10 @@ var MONEY_WORDS = [
|
|
|
24934
24951
|
}
|
|
24935
24952
|
];
|
|
24936
24953
|
|
|
24937
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
24954
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/services/money-words.js
|
|
24938
24955
|
var moneyClassesOf = /* @__PURE__ */ __name((text2) => listsHit(text2, MONEY_WORDS), "moneyClassesOf");
|
|
24939
24956
|
|
|
24940
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
24957
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/domain/status-words.js
|
|
24941
24958
|
var words = /* @__PURE__ */ __name((forms) => new RegExp(`(?<![\\p{L}\\p{N}])(?:${forms.join("|")})(?![\\p{L}\\p{N}])`, "iu"), "words");
|
|
24942
24959
|
var MONEY_DONE_FORMS = words([
|
|
24943
24960
|
"\u043E\u043F\u043B\u0430\u0442\u0438\u043B[\u0430\u0438]?",
|
|
@@ -24977,7 +24994,7 @@ var PROMISE_FORMS = words([
|
|
|
24977
24994
|
"estar\xE1 listo"
|
|
24978
24995
|
]);
|
|
24979
24996
|
|
|
24980
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
24997
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/services/project-status/items.js
|
|
24981
24998
|
var EXCERPT_CHARS = 80;
|
|
24982
24999
|
var excerpt2 = /* @__PURE__ */ __name((text2) => {
|
|
24983
25000
|
const flat = text2.replace(/\s+/g, " ").trim();
|
|
@@ -24999,7 +25016,7 @@ var whoOf = /* @__PURE__ */ __name((message) => ({
|
|
|
24999
25016
|
var fromOwner = /* @__PURE__ */ __name((message) => message.outgoing === true, "fromOwner");
|
|
25000
25017
|
var day = /* @__PURE__ */ __name((at) => new Date(at).toISOString().slice(0, 10), "day");
|
|
25001
25018
|
|
|
25002
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
25019
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/services/project-status/signals/amounts.js
|
|
25003
25020
|
var MONEY = DEFAULT_TASK_CATEGORIES.filter((category) => category.name === "money");
|
|
25004
25021
|
var verbOf = /* @__PURE__ */ __name((text2) => {
|
|
25005
25022
|
if (MONEY_DONE_FORMS.test(text2))
|
|
@@ -25080,7 +25097,7 @@ var amounts = {
|
|
|
25080
25097
|
attention: /* @__PURE__ */ __name((items) => items.flatMap((item2) => item2.chat !== null && item2.data.state === "asked" ? [{ chat: item2.chat, weight: 2, why: "money asked" }] : []), "attention")
|
|
25081
25098
|
};
|
|
25082
25099
|
|
|
25083
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
25100
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/services/project-status/signals/children.js
|
|
25084
25101
|
var children = {
|
|
25085
25102
|
id: "children",
|
|
25086
25103
|
version: 1,
|
|
@@ -25109,7 +25126,7 @@ var children = {
|
|
|
25109
25126
|
}, "read")
|
|
25110
25127
|
};
|
|
25111
25128
|
|
|
25112
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
25129
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/services/project-status/signals/coverage.js
|
|
25113
25130
|
var coverage = {
|
|
25114
25131
|
id: "coverage",
|
|
25115
25132
|
version: 1,
|
|
@@ -25138,7 +25155,7 @@ var coverage = {
|
|
|
25138
25155
|
attention: /* @__PURE__ */ __name((items) => items.flatMap((item2) => item2.chat !== null && item2.data.state !== "complete" && item2.data.beforeHeld ? [{ chat: item2.chat, weight: 3, why: "held in part" }] : []), "attention")
|
|
25139
25156
|
};
|
|
25140
25157
|
|
|
25141
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
25158
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/services/project-status/signals/payments.js
|
|
25142
25159
|
var holding = /* @__PURE__ */ __name((row) => row.review !== "rejected", "holding");
|
|
25143
25160
|
var item = /* @__PURE__ */ __name((row, at, data) => ({
|
|
25144
25161
|
signal: "payments",
|
|
@@ -25180,15 +25197,15 @@ var payments = {
|
|
|
25180
25197
|
scope: "project",
|
|
25181
25198
|
read: /* @__PURE__ */ __name(async (context2) => {
|
|
25182
25199
|
const projects = [context2.project.ref, ...context2.project.children.map((child) => child.ref)];
|
|
25183
|
-
const rows = await Promise.all(projects.map(async (
|
|
25184
|
-
...(await context2.store.finance.payments({ project
|
|
25185
|
-
...(await context2.store.finance.invoices({ project
|
|
25200
|
+
const rows = await Promise.all(projects.map(async (project) => [
|
|
25201
|
+
...(await context2.store.finance.payments({ project, limit: 500 })).filter(holding).map(paid),
|
|
25202
|
+
...(await context2.store.finance.invoices({ project, open: true, limit: 500 })).filter(holding).map(expected)
|
|
25186
25203
|
]));
|
|
25187
25204
|
return rows.flat();
|
|
25188
25205
|
}, "read")
|
|
25189
25206
|
};
|
|
25190
25207
|
|
|
25191
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
25208
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/services/project-status/signals/promises.js
|
|
25192
25209
|
var PATTERNS_PER_CHAT = 3;
|
|
25193
25210
|
var DAY3 = 864e5;
|
|
25194
25211
|
var KINDS2 = /* @__PURE__ */ new Set(["promise", "request"]);
|
|
@@ -25208,7 +25225,7 @@ var tasksOf = /* @__PURE__ */ __name(async (context2) => {
|
|
|
25208
25225
|
const projects = [context2.project.ref, ...context2.project.children.map((child) => child.ref)];
|
|
25209
25226
|
const accounts = new Map(context2.chats.map((chat) => [taskAccount(chat.account), chat.account]));
|
|
25210
25227
|
const inboxes = [...accounts.keys()].map(inboxKey);
|
|
25211
|
-
const found = await Promise.all([...projects, ...inboxes].map((
|
|
25228
|
+
const found = await Promise.all([...projects, ...inboxes].map((project) => context2.store.tasks.find({ project, limit: 500 }).catch(orNone)));
|
|
25212
25229
|
const projectRefs = new Set(projects);
|
|
25213
25230
|
return found.flat().filter((task2) => KINDS2.has(task2.type) && OPEN.has(task2.status)).filter((task2) => projectRefs.has(task2.project) || chatOfSource(context2, task2.source) !== void 0);
|
|
25214
25231
|
}, "tasksOf");
|
|
@@ -25253,7 +25270,7 @@ var promises = {
|
|
|
25253
25270
|
scope: "project",
|
|
25254
25271
|
read: /* @__PURE__ */ __name(async (context2) => {
|
|
25255
25272
|
const projects = [context2.project.ref, ...context2.project.children.map((child) => child.ref)];
|
|
25256
|
-
const facts = (await Promise.all(projects.map((
|
|
25273
|
+
const facts = (await Promise.all(projects.map((project) => context2.store.facts.list({ type: "promise", project })))).flat().filter((fact) => fact.status === "proposed" || fact.status === "accepted");
|
|
25257
25274
|
return [
|
|
25258
25275
|
...(await tasksOf(context2)).map((task2) => taskItem2(context2, task2)),
|
|
25259
25276
|
...facts.map((fact) => ({
|
|
@@ -25277,7 +25294,7 @@ var promises = {
|
|
|
25277
25294
|
}, "read")
|
|
25278
25295
|
};
|
|
25279
25296
|
|
|
25280
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
25297
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/services/project-status/signals/questions.js
|
|
25281
25298
|
var PER_SIDE = 5;
|
|
25282
25299
|
var WEEK = 7 * 864e5;
|
|
25283
25300
|
var NOBODY = /* @__PURE__ */ new Set();
|
|
@@ -25308,7 +25325,7 @@ var questions2 = {
|
|
|
25308
25325
|
}, "attention")
|
|
25309
25326
|
};
|
|
25310
25327
|
|
|
25311
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
25328
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/services/project-status/signals/reply-next.js
|
|
25312
25329
|
var targetOf = /* @__PURE__ */ __name((message, chat, owners) => {
|
|
25313
25330
|
const byId2 = /* @__PURE__ */ __name((id2) => chat.messages.find((one) => one.id === id2), "byId");
|
|
25314
25331
|
const quoted = message.replyTo ?? (message.replyToId === void 0 ? void 0 : byId2(message.replyToId));
|
|
@@ -25376,7 +25393,7 @@ var replyNext = {
|
|
|
25376
25393
|
attention: /* @__PURE__ */ __name((items) => items.flatMap((item2) => item2.chat !== null && item2.data.next === "owner" ? [{ chat: item2.chat, weight: 2, why: "your move" }] : []), "attention")
|
|
25377
25394
|
};
|
|
25378
25395
|
|
|
25379
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
25396
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/services/project-status/signals/topics.js
|
|
25380
25397
|
var escaped = /* @__PURE__ */ __name((text2) => text2.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), "escaped");
|
|
25381
25398
|
var wholeWord = /* @__PURE__ */ __name((word) => new RegExp(`(?<![\\p{L}\\p{N}])${escaped(word)}(?![\\p{L}\\p{N}])`, "u"), "wholeWord");
|
|
25382
25399
|
var matcherOf = /* @__PURE__ */ __name((query) => {
|
|
@@ -25422,7 +25439,7 @@ var topics = {
|
|
|
25422
25439
|
}, "read")
|
|
25423
25440
|
};
|
|
25424
25441
|
|
|
25425
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
25442
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/services/project-status/signals/index.js
|
|
25426
25443
|
var STATUS_SIGNALS = [
|
|
25427
25444
|
replyNext,
|
|
25428
25445
|
questions2,
|
|
@@ -25434,7 +25451,7 @@ var STATUS_SIGNALS = [
|
|
|
25434
25451
|
children
|
|
25435
25452
|
];
|
|
25436
25453
|
|
|
25437
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
25454
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/services/project-status/index.js
|
|
25438
25455
|
var DAY4 = 864e5;
|
|
25439
25456
|
var STATUS_WINDOW = 300;
|
|
25440
25457
|
var STATUS_CHATS = 16;
|
|
@@ -25484,8 +25501,8 @@ var owed = /* @__PURE__ */ __name((item2) => {
|
|
|
25484
25501
|
return item2.signal === "payments" && data.state === "expected" && data.status === "confirmed";
|
|
25485
25502
|
}, "owed");
|
|
25486
25503
|
var keepsBooks = /* @__PURE__ */ __name(async (store, projects) => {
|
|
25487
|
-
for (const
|
|
25488
|
-
const filter = { project
|
|
25504
|
+
for (const project of projects) {
|
|
25505
|
+
const filter = { project, review: "confirmed", limit: 1 };
|
|
25489
25506
|
if ((await store.finance.invoices(filter)).length || (await store.finance.payments(filter)).length)
|
|
25490
25507
|
return true;
|
|
25491
25508
|
}
|
|
@@ -25528,11 +25545,11 @@ var projectStatus = /* @__PURE__ */ __name(async (store, input) => {
|
|
|
25528
25545
|
const { children: children2, cut } = await childrenOf(store, root, catalog);
|
|
25529
25546
|
const outOfScope = [];
|
|
25530
25547
|
const linked = /* @__PURE__ */ new Map();
|
|
25531
|
-
for (const
|
|
25532
|
-
for (const link4 of await linkedChatsOf(store,
|
|
25548
|
+
for (const project of [root, ...children2])
|
|
25549
|
+
for (const link4 of await linkedChatsOf(store, project.ref)) {
|
|
25533
25550
|
const chat = formatReference({ type: "chat", provider: link4.provider, account: link4.account, chat: link4.chat });
|
|
25534
25551
|
if (!linked.has(chat))
|
|
25535
|
-
linked.set(chat, { ...link4, project:
|
|
25552
|
+
linked.set(chat, { ...link4, project: project.ref });
|
|
25536
25553
|
}
|
|
25537
25554
|
const chosen = [];
|
|
25538
25555
|
for (const [chat, link4] of linked) {
|
|
@@ -25623,16 +25640,16 @@ var projectStatus = /* @__PURE__ */ __name(async (store, input) => {
|
|
|
25623
25640
|
};
|
|
25624
25641
|
}, "projectStatus");
|
|
25625
25642
|
|
|
25626
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
25643
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/services/account.js
|
|
25627
25644
|
var accountService = /* @__PURE__ */ __name((deps) => {
|
|
25628
25645
|
const online = /* @__PURE__ */ __name(async (command) => {
|
|
25629
25646
|
if (deps.offline)
|
|
25630
25647
|
throw new CliError("validation_error", `\`${command}\` changes the account; not with --offline`);
|
|
25631
25648
|
return deps.connection();
|
|
25632
25649
|
}, "online");
|
|
25633
|
-
const onOneChat = /* @__PURE__ */ __name(async (command, chat, action,
|
|
25650
|
+
const onOneChat = /* @__PURE__ */ __name(async (command, chat, action, write) => {
|
|
25634
25651
|
const connection = await online(command);
|
|
25635
|
-
const act2 =
|
|
25652
|
+
const act2 = write(connection);
|
|
25636
25653
|
const { id: chatId } = await connection.resolve(chat);
|
|
25637
25654
|
const operationId = newOperationId();
|
|
25638
25655
|
await guardedWrite(deps.guard, { operationId, chatId, kind: "account", action }, () => act2(chatId));
|
|
@@ -25695,7 +25712,7 @@ var accountService = /* @__PURE__ */ __name((deps) => {
|
|
|
25695
25712
|
};
|
|
25696
25713
|
}, "accountService");
|
|
25697
25714
|
|
|
25698
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
25715
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/domain/send-time.js
|
|
25699
25716
|
var MINUTE = 6e4;
|
|
25700
25717
|
var YEAR = 365 * 24 * 60 * MINUTE;
|
|
25701
25718
|
var DELAY = /^(\d+)(m|h|d)$/;
|
|
@@ -25714,12 +25731,12 @@ var sendTime = /* @__PURE__ */ __name((value, now = Date.now(), flag = "--at-tim
|
|
|
25714
25731
|
return new Date(at - at % MINUTE).toISOString();
|
|
25715
25732
|
}, "sendTime");
|
|
25716
25733
|
|
|
25717
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
25718
|
-
var recordMembership = /* @__PURE__ */ __name(async (deps, operationId, done2, change, fix,
|
|
25734
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/services/admin.js
|
|
25735
|
+
var recordMembership = /* @__PURE__ */ __name(async (deps, operationId, done2, change, fix, write) => {
|
|
25719
25736
|
try {
|
|
25720
25737
|
const held = await accountStoreIfOpen(deps);
|
|
25721
25738
|
if (held)
|
|
25722
|
-
await
|
|
25739
|
+
await write(held);
|
|
25723
25740
|
} catch (error) {
|
|
25724
25741
|
const reason = error instanceof Error ? error.message : String(error);
|
|
25725
25742
|
throw new CliError(isCliError(error) ? error.code : "invalid_response", `${done2}, but the local store could not ${change} (${reason}) \u2014 do not run it again; ${fix}`, { operation_id: operationId, retryable: false });
|
|
@@ -25961,7 +25978,7 @@ var linkLimits = /* @__PURE__ */ __name(({ approval, expires, maxUses }) => {
|
|
|
25961
25978
|
return expires === void 0 ? void 0 : sendTime(expires, Date.now(), "--expire-time");
|
|
25962
25979
|
}, "linkLimits");
|
|
25963
25980
|
|
|
25964
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
25981
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/services/mail-search.js
|
|
25965
25982
|
var THREADS_PAGE = 500;
|
|
25966
25983
|
var threadsOf = /* @__PURE__ */ __name(async (store, key) => {
|
|
25967
25984
|
const account = await store.accounts.storedAccount(key).catch(() => void 0);
|
|
@@ -26040,7 +26057,7 @@ var readMail = /* @__PURE__ */ __name(async (store, locator, { before: before2 =
|
|
|
26040
26057
|
return thread.slice(Math.max(0, at - before2), at + after + 1).map((hit) => hit.id === message ? { ...hit, anchor: true } : hit);
|
|
26041
26058
|
}, "readMail");
|
|
26042
26059
|
|
|
26043
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
26060
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/services/search-kind.js
|
|
26044
26061
|
var NO_MAIL = "no_mail";
|
|
26045
26062
|
var MAIL = "email";
|
|
26046
26063
|
var listContextOf = /* @__PURE__ */ __name(async (store, account, app, stored) => {
|
|
@@ -26087,7 +26104,7 @@ var accountsOfKind = /* @__PURE__ */ __name((kind, chosen, held, explicit, comma
|
|
|
26087
26104
|
return chosenMail.map(({ provider, account }) => ({ provider, account }));
|
|
26088
26105
|
}, "accountsOfKind");
|
|
26089
26106
|
|
|
26090
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
26107
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/services/messages-search.js
|
|
26091
26108
|
var MAIL_FIELDS = /* @__PURE__ */ new Set(["to", "cc", "bcc", "subject", "mailbox", "label", "is"]);
|
|
26092
26109
|
var positiveSources = /* @__PURE__ */ __name((node) => node.kind === "predicate" ? node.field === "in" ? [node.value.toLowerCase()] : [] : node.clauses.filter(({ occur }) => occur !== "must_not").flatMap(({ node: node2 }) => positiveSources(node2)), "positiveSources");
|
|
26093
26110
|
var prepareLucene = /* @__PURE__ */ __name(async (store, account, request, messenger) => {
|
|
@@ -26262,9 +26279,9 @@ var stemsNotReady = /* @__PURE__ */ __name((state, command) => {
|
|
|
26262
26279
|
}, "stemsNotReady");
|
|
26263
26280
|
var indexNotReady = /* @__PURE__ */ __name(async (store, command) => {
|
|
26264
26281
|
const state = await store.searchIndex.searchIndexState();
|
|
26265
|
-
const
|
|
26282
|
+
const migrate = `\`${command ? `${command} ` : ""}store migrate\``;
|
|
26266
26283
|
const progress = !state ? "this store file has no word index yet" : state.pendingNormalization > 0 ? `${state.pendingNormalization} messages still wait to be normalized before their words are indexed` : `the word index is about ${Math.floor(state.filledThrough / Math.max(state.watermark, 1) * 100)}% built (message ${state.filledThrough} of ${state.watermark})`;
|
|
26267
|
-
throw new CliError("validation_error", `the word index is not ready: ${progress}. ${state ? `Each search builds a little more; ${
|
|
26284
|
+
throw new CliError("validation_error", `the word index is not ready: ${progress}. ${state ? `Each search builds a little more; ${migrate} finishes it now` : `${migrate} builds it`}. Searches without words (has:, kind:, date:) work meanwhile`, { reason: "index.not-ready" });
|
|
26268
26285
|
}, "indexNotReady");
|
|
26269
26286
|
var coverageOf = /* @__PURE__ */ __name(async (store, { scopeAccounts, selectedChat }, messenger = {}) => {
|
|
26270
26287
|
const completeness = [];
|
|
@@ -26435,7 +26452,7 @@ var statsLucene = /* @__PURE__ */ __name(async (store, account, request, messeng
|
|
|
26435
26452
|
};
|
|
26436
26453
|
}, "statsLucene");
|
|
26437
26454
|
|
|
26438
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
26455
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/services/rankings-selection.js
|
|
26439
26456
|
var RANKING_SELECTION_BYTES = 64 * 1024;
|
|
26440
26457
|
var object = /* @__PURE__ */ __name((value) => value !== null && typeof value === "object" && !Array.isArray(value) ? value : void 0, "object");
|
|
26441
26458
|
function invalid(message = "ranking selection is invalid \u2014 obtain a new drilldown from stats top") {
|
|
@@ -26604,7 +26621,7 @@ var readRankingSelection = /* @__PURE__ */ __name(async (store, input) => {
|
|
|
26604
26621
|
};
|
|
26605
26622
|
}, "readRankingSelection");
|
|
26606
26623
|
|
|
26607
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
26624
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/services/search-record.js
|
|
26608
26625
|
var canonical = /* @__PURE__ */ __name((value, nested = false) => Array.isArray(value) ? value.map((one) => canonical(one, true)) : value !== null && typeof value === "object" ? Object.fromEntries(Object.entries(value).filter(([, one]) => one !== void 0 && (nested || one !== false)).sort(([a], [b]) => a < b ? -1 : a > b ? 1 : 0).map(([key, one]) => [key, canonical(one, true)])) : value, "canonical");
|
|
26609
26626
|
var searchRecordOf = /* @__PURE__ */ __name((command, params) => ({
|
|
26610
26627
|
command,
|
|
@@ -26614,7 +26631,7 @@ var searchRecordOf = /* @__PURE__ */ __name((command, params) => ({
|
|
|
26614
26631
|
fieldsVersion: FIELD_VERSION
|
|
26615
26632
|
}), "searchRecordOf");
|
|
26616
26633
|
|
|
26617
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
26634
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/services/admin-statistics.js
|
|
26618
26635
|
function invalid2(message) {
|
|
26619
26636
|
throw new CliError("validation_error", message);
|
|
26620
26637
|
}
|
|
@@ -26908,7 +26925,7 @@ var adminStatisticsService = /* @__PURE__ */ __name((deps) => ({
|
|
|
26908
26925
|
}, "evidence")
|
|
26909
26926
|
}), "adminStatisticsService");
|
|
26910
26927
|
|
|
26911
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
26928
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/services/archive-gaps.js
|
|
26912
26929
|
import { createHash as createHash7, randomUUID as randomUUID4 } from "node:crypto";
|
|
26913
26930
|
var GAP_BOUNDS = { maxGaps: 5, limit: 500, timeMs: 3e4 };
|
|
26914
26931
|
var validateRepair = /* @__PURE__ */ __name((messenger, options) => {
|
|
@@ -27045,16 +27062,16 @@ var gapsService = /* @__PURE__ */ __name((deps) => {
|
|
|
27045
27062
|
return { plan, repair };
|
|
27046
27063
|
}, "gapsService");
|
|
27047
27064
|
|
|
27048
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
27065
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/services/attachments.js
|
|
27049
27066
|
import { createHash as createHash9 } from "node:crypto";
|
|
27050
27067
|
import { constants as constants2, mkdirSync as mkdirSync2 } from "node:fs";
|
|
27051
27068
|
import { lstat as lstat4, open as open6, readFile, stat as stat2 } from "node:fs/promises";
|
|
27052
27069
|
|
|
27053
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
27070
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/attachments/directory.js
|
|
27054
27071
|
import { lstat as lstat2, readdir as readdir2, realpath as realpath3 } from "node:fs/promises";
|
|
27055
27072
|
import { basename as basename4, join as join8, relative as relative2, sep as sep2 } from "node:path";
|
|
27056
27073
|
|
|
27057
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
27074
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/sends/upload.js
|
|
27058
27075
|
import { openAsBlob, realpathSync } from "node:fs";
|
|
27059
27076
|
import { open as open4, stat } from "node:fs/promises";
|
|
27060
27077
|
import { basename as basename3, dirname as dirname3, extname, isAbsolute as isAbsolute2, relative, resolve as resolve5, sep } from "node:path";
|
|
@@ -27221,7 +27238,7 @@ var checkFilename = /* @__PURE__ */ __name((filename, files) => {
|
|
|
27221
27238
|
throw new CliError("validation_error", "--filename is a name, not a path: no / or \\, at most 255 characters");
|
|
27222
27239
|
}, "checkFilename");
|
|
27223
27240
|
var listOf2 = /* @__PURE__ */ __name((value) => value === void 0 ? [] : typeof value === "string" ? [value] : value, "listOf");
|
|
27224
|
-
var readAttachments = /* @__PURE__ */ __name(async ({ photo, file, voice, asFile, filename, text: text2 },
|
|
27241
|
+
var readAttachments = /* @__PURE__ */ __name(async ({ photo, file, voice, asFile, filename, text: text2 }, read) => {
|
|
27225
27242
|
const photos = listOf2(photo);
|
|
27226
27243
|
const files = listOf2(file);
|
|
27227
27244
|
if (voice !== void 0 && (photos.length > 0 || files.length > 0 || (text2 ?? "").trim() !== "")) {
|
|
@@ -27233,21 +27250,21 @@ var readAttachments = /* @__PURE__ */ __name(async ({ photo, file, voice, asFile
|
|
|
27233
27250
|
checkFilename(filename, files);
|
|
27234
27251
|
const uploads = [];
|
|
27235
27252
|
for (const one of photos)
|
|
27236
|
-
uploads.push(await readUpload("photo", one,
|
|
27253
|
+
uploads.push(await readUpload("photo", one, read));
|
|
27237
27254
|
for (const one of files)
|
|
27238
27255
|
uploads.push({
|
|
27239
|
-
...await readUpload("file", one,
|
|
27256
|
+
...await readUpload("file", one, read),
|
|
27240
27257
|
...filename === void 0 ? {} : { name: filename },
|
|
27241
27258
|
...asFile ? { asFile: true } : {}
|
|
27242
27259
|
});
|
|
27243
27260
|
if (voice !== void 0)
|
|
27244
|
-
uploads.push(await readUpload("voice", voice,
|
|
27261
|
+
uploads.push(await readUpload("voice", voice, read));
|
|
27245
27262
|
return uploads;
|
|
27246
27263
|
}, "readAttachments");
|
|
27247
|
-
var readStickerFile = /* @__PURE__ */ __name(async (path, maxBytes,
|
|
27264
|
+
var readStickerFile = /* @__PURE__ */ __name(async (path, maxBytes, read) => {
|
|
27248
27265
|
if (extname(path).toLowerCase() !== ".webp")
|
|
27249
27266
|
throw new CliError("validation_error", `a sticker is a .webp \u2014 send ${path} as a photo or a file instead`);
|
|
27250
|
-
const { name, source } = await readUpload("file", path,
|
|
27267
|
+
const { name, source } = await readUpload("file", path, read);
|
|
27251
27268
|
if (SIGNATURES[".webp"]?.(await fileHead(path)) !== true)
|
|
27252
27269
|
throw new CliError("validation_error", `${path} is named .webp but is not a WebP image \u2014 nothing was sent`);
|
|
27253
27270
|
const size2 = uploadSize(source);
|
|
@@ -27256,7 +27273,7 @@ var readStickerFile = /* @__PURE__ */ __name(async (path, maxBytes, read2) => {
|
|
|
27256
27273
|
return { name, source };
|
|
27257
27274
|
}, "readStickerFile");
|
|
27258
27275
|
|
|
27259
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
27276
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/attachments/directory.js
|
|
27260
27277
|
var MAX_FILES = 1e4;
|
|
27261
27278
|
var directoryPaths = /* @__PURE__ */ __name(async (store, chat, directory2, app, env) => {
|
|
27262
27279
|
if (refusedPlace(directory2, app, env))
|
|
@@ -27325,15 +27342,15 @@ var directoryPaths = /* @__PURE__ */ __name(async (store, chat, directory2, app,
|
|
|
27325
27342
|
return choices;
|
|
27326
27343
|
}, "directoryPaths");
|
|
27327
27344
|
|
|
27328
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
27345
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/attachments/documents.js
|
|
27329
27346
|
import { posix } from "node:path";
|
|
27330
27347
|
|
|
27331
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
27348
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/attachments/container.js
|
|
27332
27349
|
import { setImmediate as tick } from "node:timers/promises";
|
|
27333
27350
|
import { crc32 } from "node:zlib";
|
|
27334
27351
|
var import_xmldom = __toESM(require_lib(), 1);
|
|
27335
27352
|
|
|
27336
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
27353
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/attachments/encoding.js
|
|
27337
27354
|
var import_chardet = __toESM(require_lib2(), 1);
|
|
27338
27355
|
var import_iconv_lite = __toESM(require_lib3(), 1);
|
|
27339
27356
|
var SAMPLE = 65536;
|
|
@@ -27435,7 +27452,7 @@ var decodeXml = /* @__PURE__ */ __name((bytes2) => {
|
|
|
27435
27452
|
return result.text;
|
|
27436
27453
|
}, "decodeXml");
|
|
27437
27454
|
|
|
27438
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
27455
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/attachments/container.js
|
|
27439
27456
|
var MAX_PART = 10 * 1024 * 1024;
|
|
27440
27457
|
var MAX_ENTRIES = 1e3;
|
|
27441
27458
|
var decoder = new TextDecoder("utf-8", { fatal: true });
|
|
@@ -27650,7 +27667,7 @@ var elements = /* @__PURE__ */ __name((node, name, namespace) => {
|
|
|
27650
27667
|
return found;
|
|
27651
27668
|
}, "elements");
|
|
27652
27669
|
|
|
27653
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
27670
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/attachments/sheets.js
|
|
27654
27671
|
var columnName = /* @__PURE__ */ __name((column) => {
|
|
27655
27672
|
let name = "";
|
|
27656
27673
|
for (let rest = column; rest > 0; rest = Math.floor((rest - 1) / 26))
|
|
@@ -27705,7 +27722,7 @@ var sheetText = /* @__PURE__ */ __name((sheets2, maxChars = MAX_TEXT_CHARS) => {
|
|
|
27705
27722
|
return { text: parts.join("").trim(), truncated: false };
|
|
27706
27723
|
}, "sheetText");
|
|
27707
27724
|
|
|
27708
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
27725
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/attachments/documents.js
|
|
27709
27726
|
var OFFICE = "urn:oasis:names:tc:opendocument:xmlns:office:1.0";
|
|
27710
27727
|
var TEXT = "urn:oasis:names:tc:opendocument:xmlns:text:1.0";
|
|
27711
27728
|
var TABLE = "urn:oasis:names:tc:opendocument:xmlns:table:1.0";
|
|
@@ -28105,10 +28122,10 @@ var readDocument = /* @__PURE__ */ __name(async (bytes2, kind, signal) => {
|
|
|
28105
28122
|
}
|
|
28106
28123
|
}, "readDocument");
|
|
28107
28124
|
|
|
28108
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
28125
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/attachments/extract.js
|
|
28109
28126
|
import { extname as extname3 } from "node:path";
|
|
28110
28127
|
|
|
28111
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
28128
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/readers/engine.js
|
|
28112
28129
|
import { readFileSync } from "node:fs";
|
|
28113
28130
|
import { dirname as dirname4, extname as extname2, join as join9 } from "node:path";
|
|
28114
28131
|
import { fileURLToPath } from "node:url";
|
|
@@ -28131,7 +28148,7 @@ var versionOf = /* @__PURE__ */ __name((name) => {
|
|
|
28131
28148
|
}
|
|
28132
28149
|
return name;
|
|
28133
28150
|
}, "versionOf");
|
|
28134
|
-
var withEngine = /* @__PURE__ */ __name(async (load, name,
|
|
28151
|
+
var withEngine = /* @__PURE__ */ __name(async (load, name, read) => {
|
|
28135
28152
|
let engine;
|
|
28136
28153
|
try {
|
|
28137
28154
|
const loaded2 = await load(name);
|
|
@@ -28143,7 +28160,7 @@ var withEngine = /* @__PURE__ */ __name(async (load, name, read2) => {
|
|
|
28143
28160
|
}
|
|
28144
28161
|
const extractor = `${name === "mammoth" ? "docx" : name === "word-extractor" ? "doc" : "pdf"}:${versionOf(name)}`;
|
|
28145
28162
|
try {
|
|
28146
|
-
return await
|
|
28163
|
+
return await read(engine, extractor);
|
|
28147
28164
|
} catch (error) {
|
|
28148
28165
|
if (error instanceof ReaderLimit)
|
|
28149
28166
|
return { status: "too-large" };
|
|
@@ -28155,12 +28172,12 @@ var withEngine = /* @__PURE__ */ __name(async (load, name, read2) => {
|
|
|
28155
28172
|
var startsWith = /* @__PURE__ */ __name((bytes2, magic) => bytes2.length >= magic.length && [...magic].every((char, index) => bytes2[index] === char.charCodeAt(0)), "startsWith");
|
|
28156
28173
|
var extensionOf = /* @__PURE__ */ __name(({ name, path }) => extname2(name ?? path).toLowerCase(), "extensionOf");
|
|
28157
28174
|
var capped2 = /* @__PURE__ */ __name((text2) => text2.length > MAX_TEXT_CHARS ? text2.slice(0, MAX_TEXT_CHARS) : text2, "capped");
|
|
28158
|
-
var derived = /* @__PURE__ */ __name((bytes2, extractor,
|
|
28175
|
+
var derived = /* @__PURE__ */ __name((bytes2, extractor, read) => {
|
|
28159
28176
|
const decoded = decodeText(bytes2);
|
|
28160
28177
|
if ("error" in decoded)
|
|
28161
28178
|
return { status: "unreadable", extractor, error: decoded.error };
|
|
28162
28179
|
try {
|
|
28163
|
-
const text2 =
|
|
28180
|
+
const text2 = read(decoded.text);
|
|
28164
28181
|
return text2 === "" ? { status: "needs-agent", extractor } : { status: "extracted", text: capped2(text2), extractor };
|
|
28165
28182
|
} catch (error) {
|
|
28166
28183
|
if (error instanceof ReaderLimit)
|
|
@@ -28169,7 +28186,7 @@ var derived = /* @__PURE__ */ __name((bytes2, extractor, read2) => {
|
|
|
28169
28186
|
}
|
|
28170
28187
|
}, "derived");
|
|
28171
28188
|
|
|
28172
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
28189
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/readers/image/index.js
|
|
28173
28190
|
var IMAGES = /* @__PURE__ */ new Set([".jpg", ".jpeg", ".png", ".webp", ".gif", ".heic", ".tif", ".tiff", ".bmp"]);
|
|
28174
28191
|
var image2 = {
|
|
28175
28192
|
id: "image",
|
|
@@ -28178,7 +28195,7 @@ var image2 = {
|
|
|
28178
28195
|
read: /* @__PURE__ */ __name(async () => ({ status: "needs-agent" }), "read")
|
|
28179
28196
|
};
|
|
28180
28197
|
|
|
28181
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
28198
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/readers/doc/index.js
|
|
28182
28199
|
var OLE = "\xD0\xCF\xE0\xA1\xB1\xE1";
|
|
28183
28200
|
var doc = {
|
|
28184
28201
|
id: "doc",
|
|
@@ -28190,7 +28207,7 @@ var doc = {
|
|
|
28190
28207
|
}), "read")
|
|
28191
28208
|
};
|
|
28192
28209
|
|
|
28193
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
28210
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/readers/docx/index.js
|
|
28194
28211
|
var DOCX = "application/vnd.openxmlformats-officedocument.wordprocessingml.document";
|
|
28195
28212
|
var docx = {
|
|
28196
28213
|
id: "docx",
|
|
@@ -28203,7 +28220,7 @@ var docx = {
|
|
|
28203
28220
|
}), "read")
|
|
28204
28221
|
};
|
|
28205
28222
|
|
|
28206
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
28223
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/attachments/markup.js
|
|
28207
28224
|
var import_iconv_lite2 = __toESM(require_lib3(), 1);
|
|
28208
28225
|
var RTF_SKIPPED = /* @__PURE__ */ new Set([
|
|
28209
28226
|
"fonttbl",
|
|
@@ -28379,7 +28396,7 @@ var htmlText = /* @__PURE__ */ __name((source) => {
|
|
|
28379
28396
|
}, "htmlText");
|
|
28380
28397
|
var safeChar = /* @__PURE__ */ __name((code, fallback) => code > 0 && code <= 1114111 ? String.fromCodePoint(code) : fallback, "safeChar");
|
|
28381
28398
|
|
|
28382
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
28399
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/readers/html/page.js
|
|
28383
28400
|
var clean = /* @__PURE__ */ __name((value) => typeof value === "string" ? value.replace(/\s+/g, " ").trim() : "", "clean");
|
|
28384
28401
|
var namesIn = /* @__PURE__ */ __name((value) => [value].flat().map((entry) => typeof entry === "string" ? clean(entry) : clean(entry?.name)).filter(Boolean).join(", "), "namesIn");
|
|
28385
28402
|
var jsonLdNodes = /* @__PURE__ */ __name((document) => {
|
|
@@ -28435,7 +28452,7 @@ var markdownSections = /* @__PURE__ */ __name((text2) => {
|
|
|
28435
28452
|
return found.map((section, index) => ({ ...section, end: found[index + 1]?.start ?? text2.length }));
|
|
28436
28453
|
}, "markdownSections");
|
|
28437
28454
|
|
|
28438
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
28455
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/readers/html/index.js
|
|
28439
28456
|
var HTML = /* @__PURE__ */ new Set([".html", ".htm", ".xhtml"]);
|
|
28440
28457
|
var first = /* @__PURE__ */ __name((...values) => values.find((value) => typeof value === "string" && value !== ""), "first");
|
|
28441
28458
|
var loaded = /* @__PURE__ */ __name(async (load, name) => {
|
|
@@ -28506,7 +28523,7 @@ var html = {
|
|
|
28506
28523
|
}, "read")
|
|
28507
28524
|
};
|
|
28508
28525
|
|
|
28509
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
28526
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/readers/office/index.js
|
|
28510
28527
|
var office = {
|
|
28511
28528
|
id: "office",
|
|
28512
28529
|
version: documentExtractor("odt"),
|
|
@@ -28517,7 +28534,7 @@ var office = {
|
|
|
28517
28534
|
}, "read")
|
|
28518
28535
|
};
|
|
28519
28536
|
|
|
28520
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
28537
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/readers/pdf/index.js
|
|
28521
28538
|
var pdf = {
|
|
28522
28539
|
id: "pdf",
|
|
28523
28540
|
version: "unpdf",
|
|
@@ -28584,7 +28601,7 @@ var pdf = {
|
|
|
28584
28601
|
}), "read")
|
|
28585
28602
|
};
|
|
28586
28603
|
|
|
28587
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
28604
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/readers/plain/index.js
|
|
28588
28605
|
var PLAIN = /* @__PURE__ */ new Set([".txt", ".md", ".markdown", ".csv", ".tsv", ".json", ".log"]);
|
|
28589
28606
|
var isPlain = /* @__PURE__ */ __name((hint) => PLAIN.has(extensionOf(hint)) || hint.mime?.startsWith("text/") || hint.mime === "application/json", "isPlain");
|
|
28590
28607
|
var readPlain = /* @__PURE__ */ __name((bytes2) => {
|
|
@@ -28604,7 +28621,7 @@ var plain = {
|
|
|
28604
28621
|
read: /* @__PURE__ */ __name(async (bytes2) => readPlain(bytes2), "read")
|
|
28605
28622
|
};
|
|
28606
28623
|
|
|
28607
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
28624
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/readers/rtf/index.js
|
|
28608
28625
|
var rtf = {
|
|
28609
28626
|
id: "rtf",
|
|
28610
28627
|
version: "v1",
|
|
@@ -28612,10 +28629,10 @@ var rtf = {
|
|
|
28612
28629
|
read: /* @__PURE__ */ __name(async (bytes2) => derived(bytes2, "rtf:v1", rtfText), "read")
|
|
28613
28630
|
};
|
|
28614
28631
|
|
|
28615
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
28632
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/readers/sheets/index.js
|
|
28616
28633
|
import { basename as basename5 } from "node:path";
|
|
28617
28634
|
|
|
28618
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
28635
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/attachments/csv-spans.js
|
|
28619
28636
|
var delimitedSpans = /* @__PURE__ */ __name((text2, delimiter, maxCells = 1e4) => {
|
|
28620
28637
|
const cells = [];
|
|
28621
28638
|
let row = 1, column = 1, start = 0, quoted = false, truncated = false;
|
|
@@ -28653,7 +28670,7 @@ var delimitedSpans = /* @__PURE__ */ __name((text2, delimiter, maxCells = 1e4) =
|
|
|
28653
28670
|
return { cells, truncated };
|
|
28654
28671
|
}, "delimitedSpans");
|
|
28655
28672
|
|
|
28656
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
28673
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/readers/sheets/index.js
|
|
28657
28674
|
var DELIMITED = {
|
|
28658
28675
|
".csv": ",",
|
|
28659
28676
|
".tsv": " ",
|
|
@@ -28692,7 +28709,7 @@ var sheets = {
|
|
|
28692
28709
|
}, "read")
|
|
28693
28710
|
};
|
|
28694
28711
|
|
|
28695
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
28712
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/readers/registry.js
|
|
28696
28713
|
var BUILT_INS2 = [office, pdf, docx, doc, rtf, html, sheets, plain, image2];
|
|
28697
28714
|
var HEAD_BYTES = 1024;
|
|
28698
28715
|
var readers = [...BUILT_INS2];
|
|
@@ -28702,7 +28719,7 @@ var readWithRegistry = /* @__PURE__ */ __name(async (bytes2, hint, context2) =>
|
|
|
28702
28719
|
return reader ? reader.read(bytes2, hint, context2) : { status: "unsupported" };
|
|
28703
28720
|
}, "readWithRegistry");
|
|
28704
28721
|
|
|
28705
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
28722
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/attachments/extract.js
|
|
28706
28723
|
var importEngine = /* @__PURE__ */ __name((name) => importFrom(new URL("attachments/extract.js", import.meta.resolve("@wirecat/cli-core")).href, name), "importEngine");
|
|
28707
28724
|
var extensionOf2 = /* @__PURE__ */ __name(({ name, path }) => extname3(name ?? path).toLowerCase(), "extensionOf");
|
|
28708
28725
|
var extractText = /* @__PURE__ */ __name(async (bytes2, hint, load, signal, env = process.env) => {
|
|
@@ -29781,7 +29798,7 @@ function imageSize(input) {
|
|
|
29781
29798
|
}
|
|
29782
29799
|
__name(imageSize, "imageSize");
|
|
29783
29800
|
|
|
29784
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
29801
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/attachments/ocr.js
|
|
29785
29802
|
var MAX_PAGES = 20;
|
|
29786
29803
|
var MAX_PIXELS = 2e7;
|
|
29787
29804
|
var cancelled2 = /* @__PURE__ */ __name((signal) => {
|
|
@@ -29932,7 +29949,7 @@ var ocrPdf = /* @__PURE__ */ __name(async (bytes2, pipeline2, load, signal) => {
|
|
|
29932
29949
|
}
|
|
29933
29950
|
}, "ocrPdf");
|
|
29934
29951
|
|
|
29935
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
29952
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/attachments/pdf-preview.js
|
|
29936
29953
|
var pdfPreview = /* @__PURE__ */ __name(async (bytes2, page, signal, load = importEngine, env = process.env) => {
|
|
29937
29954
|
const limits = pdfPreviewLimits(env);
|
|
29938
29955
|
const cancelled4 = /* @__PURE__ */ __name(() => {
|
|
@@ -30009,7 +30026,7 @@ var pdfPreview = /* @__PURE__ */ __name(async (bytes2, page, signal, load = impo
|
|
|
30009
30026
|
}
|
|
30010
30027
|
}, "pdfPreview");
|
|
30011
30028
|
|
|
30012
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
30029
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/attachments/transfer.js
|
|
30013
30030
|
import { createHash as createHash8 } from "node:crypto";
|
|
30014
30031
|
import { constants } from "node:fs";
|
|
30015
30032
|
import { lstat as lstat3, open as open5 } from "node:fs/promises";
|
|
@@ -30117,7 +30134,7 @@ var transferMime = /* @__PURE__ */ __name((head, hint, name = null) => {
|
|
|
30117
30134
|
return hint !== null && /^[a-z0-9.+-]+\/[a-z0-9.+-]+$/i.test(hint) ? hint : "application/octet-stream";
|
|
30118
30135
|
}, "transferMime");
|
|
30119
30136
|
|
|
30120
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
30137
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/services/file-download.js
|
|
30121
30138
|
import { createWriteStream, mkdirSync } from "node:fs";
|
|
30122
30139
|
import { link as link3, rm } from "node:fs/promises";
|
|
30123
30140
|
import { join as join10, resolve as resolve6 } from "node:path";
|
|
@@ -30231,7 +30248,7 @@ var save = /* @__PURE__ */ __name(async (file, directory2, fallbackName, { uniqu
|
|
|
30231
30248
|
}
|
|
30232
30249
|
}, "save");
|
|
30233
30250
|
|
|
30234
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
30251
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/services/attachments.js
|
|
30235
30252
|
var ATTACHMENT_QUERY = {
|
|
30236
30253
|
entity: "attachment",
|
|
30237
30254
|
backend: "sql",
|
|
@@ -30385,7 +30402,7 @@ var attachmentsService = /* @__PURE__ */ __name((deps) => ({
|
|
|
30385
30402
|
};
|
|
30386
30403
|
const batch = batchProgress(deps.env);
|
|
30387
30404
|
const fetched = /* @__PURE__ */ new Set();
|
|
30388
|
-
let
|
|
30405
|
+
let read = 0;
|
|
30389
30406
|
let beforePk = cursor === void 0 ? void 0 : Number(cursor);
|
|
30390
30407
|
let scanned = 0;
|
|
30391
30408
|
const pending = [];
|
|
@@ -30408,12 +30425,12 @@ var attachmentsService = /* @__PURE__ */ __name((deps) => ({
|
|
|
30408
30425
|
if (extraction && bytes2 !== void 0 && (!ocr || status === "extracted") && (status === "extracted" || file.read?.error !== null)) {
|
|
30409
30426
|
if (await keep(store, file, extraction, bytes2, sha) === false) {
|
|
30410
30427
|
run.unchanged += 1;
|
|
30411
|
-
|
|
30428
|
+
read += 1;
|
|
30412
30429
|
return;
|
|
30413
30430
|
}
|
|
30414
30431
|
}
|
|
30415
30432
|
if (status !== "missing" && status !== "too-large" && status !== "engine-missing")
|
|
30416
|
-
|
|
30433
|
+
read += 1;
|
|
30417
30434
|
if (extraction?.status === "engine-missing" && !run.enginesMissing.includes(extraction.engine))
|
|
30418
30435
|
run.enginesMissing.push(extraction.engine);
|
|
30419
30436
|
if (status === "extracted")
|
|
@@ -30469,9 +30486,9 @@ var attachmentsService = /* @__PURE__ */ __name((deps) => ({
|
|
|
30469
30486
|
limit: PAGE3
|
|
30470
30487
|
});
|
|
30471
30488
|
for (const file of page) {
|
|
30472
|
-
while (pending.length && (pending.length >= concurrency || limit !== void 0 &&
|
|
30489
|
+
while (pending.length && (pending.length >= concurrency || limit !== void 0 && read + pending.length >= limit))
|
|
30473
30490
|
await pending.shift();
|
|
30474
|
-
if (batch.stopped || signal?.aborted || limit !== void 0 &&
|
|
30491
|
+
if (batch.stopped || signal?.aborted || limit !== void 0 && read >= limit || scanLimit !== void 0 && scanned >= scanLimit) {
|
|
30475
30492
|
run.complete = false;
|
|
30476
30493
|
if (beforePk !== void 0)
|
|
30477
30494
|
run.cursor = String(beforePk);
|
|
@@ -30654,7 +30671,7 @@ var attachmentsService = /* @__PURE__ */ __name((deps) => ({
|
|
|
30654
30671
|
}, "setText")
|
|
30655
30672
|
}), "attachmentsService");
|
|
30656
30673
|
|
|
30657
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
30674
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/services/chat-documents.js
|
|
30658
30675
|
var chatDocumentsService = /* @__PURE__ */ __name((deps) => ({
|
|
30659
30676
|
list: /* @__PURE__ */ __name(async (chat, { limit, offset, ref }) => {
|
|
30660
30677
|
const store = await accountStore(deps);
|
|
@@ -30684,7 +30701,7 @@ var chatDocumentsService = /* @__PURE__ */ __name((deps) => ({
|
|
|
30684
30701
|
}, "list")
|
|
30685
30702
|
}), "chatDocumentsService");
|
|
30686
30703
|
|
|
30687
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
30704
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/services/retention.js
|
|
30688
30705
|
var observationDuration = /* @__PURE__ */ __name((text2, flag) => {
|
|
30689
30706
|
const match = /^(\d+(?:\.\d+)?)([smhdw])$/.exec(text2);
|
|
30690
30707
|
const units2 = { s: 1e3, m: 6e4, h: 36e5, d: 864e5, w: 6048e5 };
|
|
@@ -30771,7 +30788,7 @@ var isRetentionSelection = /* @__PURE__ */ __name((selection) => {
|
|
|
30771
30788
|
}
|
|
30772
30789
|
}, "isRetentionSelection");
|
|
30773
30790
|
|
|
30774
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
30791
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/services/counters.js
|
|
30775
30792
|
var counterFields = /* @__PURE__ */ __name((text2 = "views,reactions,comments") => {
|
|
30776
30793
|
const fields = text2.split(",").map((one) => one.trim());
|
|
30777
30794
|
if (!fields.length || fields.some((one) => !COUNTER_FIELDS.includes(one)) || new Set(fields).size !== fields.length)
|
|
@@ -30978,7 +30995,7 @@ var countersService = /* @__PURE__ */ __name((deps) => {
|
|
|
30978
30995
|
};
|
|
30979
30996
|
}, "countersService");
|
|
30980
30997
|
|
|
30981
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
30998
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/services/search-refresh.js
|
|
30982
30999
|
var SYNC_KEY = "messages.sync-first";
|
|
30983
31000
|
var SYNC_BOUNDS = { maxChats: 5, timeMs: 3e4, maxMessages: 500 };
|
|
30984
31001
|
var keyOf2 = /* @__PURE__ */ __name((chat) => JSON.stringify([chat.account.provider, chat.account.account, chat.chatId]), "keyOf");
|
|
@@ -31028,7 +31045,7 @@ var refreshSearch = /* @__PURE__ */ __name(async (deps, request) => {
|
|
|
31028
31045
|
const { execution } = await prepareLucene(store, account, request, deps.messenger);
|
|
31029
31046
|
const scoped = execution.chat ? [execution.chat] : chatScope(execution.root);
|
|
31030
31047
|
const options = { ...SYNC_BOUNDS, ...request.syncFirst };
|
|
31031
|
-
const
|
|
31048
|
+
const note = options.note ?? (() => {
|
|
31032
31049
|
});
|
|
31033
31050
|
const result = { chats: [], messages: 0, failed: [], complete: true };
|
|
31034
31051
|
const candidates = [];
|
|
@@ -31077,7 +31094,7 @@ var refreshSearch = /* @__PURE__ */ __name(async (deps, request) => {
|
|
|
31077
31094
|
pauseMs: parseDuration(deps.messenger.fetching?.pause ?? "1s", "fetch pause"),
|
|
31078
31095
|
...newest ? { sinceMs: Date.parse(newest.timestamp) + 1 } : {},
|
|
31079
31096
|
stop,
|
|
31080
|
-
note
|
|
31097
|
+
note,
|
|
31081
31098
|
onPage: /* @__PURE__ */ __name(({ fetched: fetched2 }) => {
|
|
31082
31099
|
result.messages += fetched2 - counted2;
|
|
31083
31100
|
counted2 = fetched2;
|
|
@@ -31101,7 +31118,7 @@ var refreshSearch = /* @__PURE__ */ __name(async (deps, request) => {
|
|
|
31101
31118
|
clearTimeout(timer);
|
|
31102
31119
|
}
|
|
31103
31120
|
if (!result.complete)
|
|
31104
|
-
|
|
31121
|
+
note("refresh incomplete \u2014 the local answer may be stale");
|
|
31105
31122
|
return result;
|
|
31106
31123
|
}, "refreshSearch");
|
|
31107
31124
|
var withRefresh = /* @__PURE__ */ __name((found, refreshed) => ({
|
|
@@ -31110,7 +31127,7 @@ var withRefresh = /* @__PURE__ */ __name((found, refreshed) => ({
|
|
|
31110
31127
|
...!refreshed || refreshed.complete ? {} : { coverage: { ...found.coverage, state: "stale" } }
|
|
31111
31128
|
}), "withRefresh");
|
|
31112
31129
|
|
|
31113
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
31130
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/services/embeddings-search.js
|
|
31114
31131
|
var CANDIDATES = 50;
|
|
31115
31132
|
var WORD_HITS = 200;
|
|
31116
31133
|
var RRF_K = 60;
|
|
@@ -31385,13 +31402,13 @@ var meanOf = /* @__PURE__ */ __name((vectors) => {
|
|
|
31385
31402
|
return mean2.map((value) => value / length);
|
|
31386
31403
|
}, "meanOf");
|
|
31387
31404
|
|
|
31388
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
31405
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/services/embeddings.js
|
|
31389
31406
|
var embeddingsService = /* @__PURE__ */ __name((deps) => ({
|
|
31390
31407
|
...embeddingsMaintenance(deps),
|
|
31391
31408
|
...embeddingsSearch(deps)
|
|
31392
31409
|
}), "embeddingsService");
|
|
31393
31410
|
|
|
31394
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
31411
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/services/folders.js
|
|
31395
31412
|
var foldersService = /* @__PURE__ */ __name((deps) => {
|
|
31396
31413
|
const online = /* @__PURE__ */ __name(async (command) => {
|
|
31397
31414
|
if (deps.offline)
|
|
@@ -31532,7 +31549,7 @@ var foldersService = /* @__PURE__ */ __name((deps) => {
|
|
|
31532
31549
|
};
|
|
31533
31550
|
}, "foldersService");
|
|
31534
31551
|
|
|
31535
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
31552
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/services/mentions.js
|
|
31536
31553
|
var REVIEW_COUNT = 500;
|
|
31537
31554
|
var mentionsService = /* @__PURE__ */ __name((deps) => {
|
|
31538
31555
|
const located = /* @__PURE__ */ __name(async () => {
|
|
@@ -31611,7 +31628,7 @@ var mentionsService = /* @__PURE__ */ __name((deps) => {
|
|
|
31611
31628
|
};
|
|
31612
31629
|
}, "mentionsService");
|
|
31613
31630
|
|
|
31614
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
31631
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/domain/message-link.js
|
|
31615
31632
|
var fileLinks = /* @__PURE__ */ __name((attachments) => hitFiles(attachments).map(({ position, kind, name }) => ({
|
|
31616
31633
|
position,
|
|
31617
31634
|
kind,
|
|
@@ -31660,7 +31677,7 @@ var validatePermalink = /* @__PURE__ */ __name((link4) => {
|
|
|
31660
31677
|
return { url: link4.url, access: link4.access, reason: link4.reason };
|
|
31661
31678
|
}, "validatePermalink");
|
|
31662
31679
|
|
|
31663
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
31680
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/domain/pin-duration.js
|
|
31664
31681
|
var spokenSeconds = /* @__PURE__ */ __name((seconds) => {
|
|
31665
31682
|
if (seconds % 86400 === 0 && seconds > 86400)
|
|
31666
31683
|
return `${seconds / 86400}d`;
|
|
@@ -31692,7 +31709,7 @@ var pinDurationOf = /* @__PURE__ */ __name((value, allowed, flag = "--expire-tim
|
|
|
31692
31709
|
return seconds;
|
|
31693
31710
|
}, "pinDurationOf");
|
|
31694
31711
|
|
|
31695
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
31712
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/sends/send-as.js
|
|
31696
31713
|
var sendAsCheck = /* @__PURE__ */ __name((connection, sendAs) => {
|
|
31697
31714
|
if (sendAs === void 0) {
|
|
31698
31715
|
const saved = connection.savedSender?.bind(connection);
|
|
@@ -31717,7 +31734,7 @@ var typedSendAs = /* @__PURE__ */ __name((typed) => {
|
|
|
31717
31734
|
return sendAs;
|
|
31718
31735
|
}, "typedSendAs");
|
|
31719
31736
|
|
|
31720
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
31737
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/search/total.js
|
|
31721
31738
|
var TOTAL_CAP = 1e4;
|
|
31722
31739
|
var totalOf = /* @__PURE__ */ __name((count4, shown, hasMore, exact = true) => {
|
|
31723
31740
|
const least = shown + (hasMore ? 1 : 0);
|
|
@@ -31728,7 +31745,7 @@ var totalOf = /* @__PURE__ */ __name((count4, shown, hasMore, exact = true) => {
|
|
|
31728
31745
|
return { value: count4, relation: exact ? "eq" : "gte" };
|
|
31729
31746
|
}, "totalOf");
|
|
31730
31747
|
|
|
31731
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
31748
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/search/lucene/meaning-parts.js
|
|
31732
31749
|
var WORD_FIELDS = /* @__PURE__ */ new Set(["text", "exact"]);
|
|
31733
31750
|
var fieldsOfQuery = /* @__PURE__ */ __name((root, everything) => {
|
|
31734
31751
|
let narrows = false;
|
|
@@ -31757,7 +31774,7 @@ var meaningWords = /* @__PURE__ */ __name((root) => {
|
|
|
31757
31774
|
return wanted(root).join(" ").trim();
|
|
31758
31775
|
}, "meaningWords");
|
|
31759
31776
|
|
|
31760
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
31777
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/search/question-plan.js
|
|
31761
31778
|
var words2 = /* @__PURE__ */ __name((text2) => normalize(text2).match(/[\p{L}\p{N}]+/gu) ?? [], "words");
|
|
31762
31779
|
var scaffolding = new Set(words2("what which how many much who where when is are was were do does did can could should we the a an for of to under from in on at has have \u0441\u043A\u043E\u043B\u044C\u043A\u043E \u043A\u0430\u043A\u043E\u0439 \u043A\u0430\u043A\u0430\u044F \u043A\u0430\u043A\u0438\u0435 \u043A\u0430\u043A\u043E\u0435 \u043A\u0442\u043E \u043A\u043E\u043C\u0443 \u043A\u0435\u043C \u0433\u0434\u0435 \u043A\u043E\u0433\u0434\u0430 \u043A\u0430\u043A \u0447\u0442\u043E \u0432\u043E \u043F\u043E \u043D\u0430 \u0432 \u043A \u0441 \u0443 \u0447\u0435\u0440\u0435\u0437 \u043B\u0438 \u0434\u043E\u043B\u0436\u0435\u043D \u0434\u043E\u043B\u0436\u043D\u0430 \u043D\u0443\u0436\u043D\u043E \u0438\u0434\u0451\u0442 \u0438\u0434\u0435\u0442 \u043C\u043E\u0436\u043D\u043E \u043C\u043E\u0436\u0435\u0442 \u043C\u043E\u0433\u0443\u0442"));
|
|
31763
31780
|
var questionWord = /\b(?:what|which|how|who|where|when|can|could|should)\b|(?:^|\s)(?:сколько|какой|какая|какие|какое|кто|кому|кем|где|когда|как|что|можно|может|могут|ли)(?:\s|$)/iu;
|
|
@@ -31889,7 +31906,7 @@ var questionLookup = /* @__PURE__ */ __name((text2) => {
|
|
|
31889
31906
|
return terms.length ? anyOfTerms(terms, plan.scope) : void 0;
|
|
31890
31907
|
}, "questionLookup");
|
|
31891
31908
|
|
|
31892
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
31909
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/services/messages-combined.js
|
|
31893
31910
|
var COMBINED_DEFAULTS = { candidateDepth: 300, rrfK: 60, rerank: "all", chatCap: 0 };
|
|
31894
31911
|
var tokensOf = /* @__PURE__ */ __name((text2) => normalize(text2).match(/[\p{L}\p{N}\p{Co}\p{M}]+/gu) ?? [], "tokensOf");
|
|
31895
31912
|
var searchCombined = /* @__PURE__ */ __name(async (store, account, request, messenger = {}, options = COMBINED_DEFAULTS) => {
|
|
@@ -31936,7 +31953,7 @@ var searchCombined = /* @__PURE__ */ __name(async (store, account, request, mess
|
|
|
31936
31953
|
const clauses = fixes.map((value) => ({ occur: "should", node: { ...node, field: "exact", value } }));
|
|
31937
31954
|
return { kind: "boolean", clauses, span: node.span };
|
|
31938
31955
|
}, "transform");
|
|
31939
|
-
const
|
|
31956
|
+
const read = /* @__PURE__ */ __name(async (root, limit) => {
|
|
31940
31957
|
check2();
|
|
31941
31958
|
const nodes = /* @__PURE__ */ __name((node) => node.kind === "predicate" ? 1 : 1 + node.clauses.reduce((sum2, clause) => sum2 + nodes(clause.node), 0), "nodes");
|
|
31942
31959
|
if (nodes(root) > QUERY_LIMITS.nodes)
|
|
@@ -31946,16 +31963,16 @@ var searchCombined = /* @__PURE__ */ __name(async (store, account, request, mess
|
|
|
31946
31963
|
return found;
|
|
31947
31964
|
}, "read");
|
|
31948
31965
|
if (!expanding) {
|
|
31949
|
-
const found = await
|
|
31966
|
+
const found = await read(execution.root, request.limit);
|
|
31950
31967
|
return finish(found.items, found.hasMore, [], false, false);
|
|
31951
31968
|
}
|
|
31952
|
-
const exact = await
|
|
31953
|
-
const stemmed = await
|
|
31954
|
-
const prefix = await
|
|
31955
|
-
const fixed = corrections.size ? await
|
|
31969
|
+
const exact = await read(transform(execution.root, "words", true), depth);
|
|
31970
|
+
const stemmed = await read(execution.root, depth);
|
|
31971
|
+
const prefix = await read(transform(execution.root, "beginnings"), depth);
|
|
31972
|
+
const fixed = corrections.size ? await read(transform(execution.root, "corrected"), depth) : { items: [], hasMore: false };
|
|
31956
31973
|
const fixedPrefixRoot = transform(execution.root, "corrected");
|
|
31957
31974
|
const correctedBeginnings = /* @__PURE__ */ __name((node) => node.kind === "boolean" ? { ...node, clauses: node.clauses.map((clause) => ({ ...clause, node: correctedBeginnings(clause.node) })) } : bySpan.has(node.span.start) && [...normalize(node.value)].length >= 3 ? { ...node, field: "exact", operator: "wildcard", value: `${normalize(node.value)}*` } : node, "correctedBeginnings");
|
|
31958
|
-
const fixedPrefix = corrections.size ? await
|
|
31975
|
+
const fixedPrefix = corrections.size ? await read(correctedBeginnings(fixedPrefixRoot), depth) : { items: [], hasMore: false };
|
|
31959
31976
|
const ranked = /* @__PURE__ */ new Map();
|
|
31960
31977
|
const add = /* @__PURE__ */ __name((lists, source) => {
|
|
31961
31978
|
const shares = /* @__PURE__ */ new Map();
|
|
@@ -32082,7 +32099,7 @@ var signals = /* @__PURE__ */ __name((hit, terms, corrections, execution, mode,
|
|
|
32082
32099
|
return mode === "coverage" ? coverage2 * 4 : mode === "proximity" ? proximity : mode === "phrase" ? phrase : coverage2 * 4 + proximity + phrase;
|
|
32083
32100
|
}, "signals");
|
|
32084
32101
|
|
|
32085
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
32102
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/services/messages-discovery.js
|
|
32086
32103
|
var MEANING_DEPTH = 100;
|
|
32087
32104
|
var RRF_K2 = 60;
|
|
32088
32105
|
var RERANK_DEPTH = 50;
|
|
@@ -32400,14 +32417,14 @@ var scaled = /* @__PURE__ */ __name((values) => {
|
|
|
32400
32417
|
}, "scaled");
|
|
32401
32418
|
var mixedWithReranker = /* @__PURE__ */ __name((head, scores) => {
|
|
32402
32419
|
const fused2 = scaled(head.map((m) => m.score ?? 0));
|
|
32403
|
-
const
|
|
32420
|
+
const read = scaled(scores);
|
|
32404
32421
|
return head.map((m, i) => ({
|
|
32405
32422
|
hit: m.discovery ? { ...m, discovery: { ...m.discovery, rerankerScore: scores[i] } } : m,
|
|
32406
|
-
mixed: (1 - RERANK_WEIGHT) * fused2[i] + RERANK_WEIGHT *
|
|
32423
|
+
mixed: (1 - RERANK_WEIGHT) * fused2[i] + RERANK_WEIGHT * read[i]
|
|
32407
32424
|
})).sort((a, b) => b.mixed - a.mixed).map(({ hit }) => hit);
|
|
32408
32425
|
}, "mixedWithReranker");
|
|
32409
32426
|
|
|
32410
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
32427
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/services/thread-context.js
|
|
32411
32428
|
var THREAD_BOUNDS = { maxHops: 8, maxMessages: 50, maxBytes: 65536, withinMs: 864e5 };
|
|
32412
32429
|
var bytes = /* @__PURE__ */ __name((items, links) => Buffer.byteLength(JSON.stringify({ items, links }), "utf8"), "bytes");
|
|
32413
32430
|
var threadBounds = /* @__PURE__ */ __name((options = {}) => {
|
|
@@ -32606,7 +32623,7 @@ var readThreadContext = /* @__PURE__ */ __name(async (store, account, chat, mess
|
|
|
32606
32623
|
return result;
|
|
32607
32624
|
}, "readThreadContext");
|
|
32608
32625
|
|
|
32609
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
32626
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/services/messages-archive-search.js
|
|
32610
32627
|
var SEARCH_FILL_MS = 200;
|
|
32611
32628
|
var statsStore = /* @__PURE__ */ __name(async (store, account, request, messenger = {}) => {
|
|
32612
32629
|
const stop = Date.now() + SEARCH_FILL_MS;
|
|
@@ -32673,12 +32690,12 @@ var accountOf2 = /* @__PURE__ */ __name((hit) => {
|
|
|
32673
32690
|
}, "accountOf");
|
|
32674
32691
|
var keyOf3 = /* @__PURE__ */ __name(({ provider, account }) => `${provider}/${account}`, "keyOf");
|
|
32675
32692
|
|
|
32676
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
32693
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/services/pictures.js
|
|
32677
32694
|
import { createHash as createHash10 } from "node:crypto";
|
|
32678
32695
|
import { readFile as readFile2, stat as stat3 } from "node:fs/promises";
|
|
32679
32696
|
import { setTimeout as sleep4 } from "node:timers/promises";
|
|
32680
32697
|
|
|
32681
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
32698
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/domain/models.js
|
|
32682
32699
|
var GROUP_SETTINGS = [
|
|
32683
32700
|
"allCanPin",
|
|
32684
32701
|
"onlyAdminsAdd",
|
|
@@ -32692,7 +32709,7 @@ var ADMIN_RIGHTS = ["read", "members", "admins", "info", "pin", "link", "post",
|
|
|
32692
32709
|
var senderIsMe = /* @__PURE__ */ __name((message, account) => message.outgoing === true || message.senderId !== null && String(message.senderId) === account, "senderIsMe");
|
|
32693
32710
|
var MEDIA_KINDS = ["photo", "video", "file", "audio", "link"];
|
|
32694
32711
|
|
|
32695
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
32712
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/services/pictures.js
|
|
32696
32713
|
var PICTURE_MAX_BYTES = 25 * 1024 * 1024;
|
|
32697
32714
|
var PICTURE_FLOOR = 0.25;
|
|
32698
32715
|
var PAGE4 = 50;
|
|
@@ -32709,7 +32726,7 @@ var picturesService = /* @__PURE__ */ __name((deps) => {
|
|
|
32709
32726
|
const directory2 = imageModelsDirectory(deps.env);
|
|
32710
32727
|
if (!isImageModelInstalled(model2, directory2))
|
|
32711
32728
|
throw new CliError("not_found", missingModel(model2.id), { reason: "model.not-downloaded", model: model2.id });
|
|
32712
|
-
const { openPictureEmbedder } = await import("./embedder-
|
|
32729
|
+
const { openPictureEmbedder } = await import("./embedder-SW7DTWSL.js");
|
|
32713
32730
|
return openPictureEmbedder(model2, directory2);
|
|
32714
32731
|
}, "open");
|
|
32715
32732
|
const embedder = /* @__PURE__ */ __name(() => {
|
|
@@ -32720,7 +32737,7 @@ var picturesService = /* @__PURE__ */ __name((deps) => {
|
|
|
32720
32737
|
return opened;
|
|
32721
32738
|
}, "embedder");
|
|
32722
32739
|
const model = imageModel(DEFAULT_IMAGE_MODEL);
|
|
32723
|
-
const bytesOf2 = /* @__PURE__ */ __name(async (picture, files,
|
|
32740
|
+
const bytesOf2 = /* @__PURE__ */ __name(async (picture, files, read) => {
|
|
32724
32741
|
if (picture.localPath) {
|
|
32725
32742
|
try {
|
|
32726
32743
|
if ((await stat3(picture.localPath)).size <= PICTURE_MAX_BYTES)
|
|
@@ -32740,7 +32757,7 @@ var picturesService = /* @__PURE__ */ __name((deps) => {
|
|
|
32740
32757
|
return void 0;
|
|
32741
32758
|
parts.push(part);
|
|
32742
32759
|
}
|
|
32743
|
-
await
|
|
32760
|
+
await read(file);
|
|
32744
32761
|
return Buffer.concat(parts);
|
|
32745
32762
|
}, "bytesOf");
|
|
32746
32763
|
return {
|
|
@@ -32906,7 +32923,7 @@ var withPictures = /* @__PURE__ */ __name((messages, pictures) => ({
|
|
|
32906
32923
|
}, "search")
|
|
32907
32924
|
}), "withPictures");
|
|
32908
32925
|
|
|
32909
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
32926
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/services/messages-meaning.js
|
|
32910
32927
|
var meaningLane = /* @__PURE__ */ __name((deps) => async (question, accounts, shared, within) => {
|
|
32911
32928
|
const target2 = embeddingTarget(deps, DEFAULT_TEXT_MODEL);
|
|
32912
32929
|
const skipped = /* @__PURE__ */ __name((reason, step) => ({
|
|
@@ -32974,7 +32991,7 @@ var meaningLane = /* @__PURE__ */ __name((deps) => async (question, accounts, sh
|
|
|
32974
32991
|
}
|
|
32975
32992
|
}, "meaningLane");
|
|
32976
32993
|
|
|
32977
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
32994
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/services/messages-rerank.js
|
|
32978
32995
|
var rerankLane = /* @__PURE__ */ __name((deps) => {
|
|
32979
32996
|
const choice = deps.reranker ?? DEFAULT_RERANK_MODEL;
|
|
32980
32997
|
if (choice === "off")
|
|
@@ -32986,9 +33003,9 @@ var rerankLane = /* @__PURE__ */ __name((deps) => {
|
|
|
32986
33003
|
return { skipped: { reason: `${model.id} is not downloaded`, step: "models.download", model: model.id } };
|
|
32987
33004
|
try {
|
|
32988
33005
|
const warm = deps.embedders;
|
|
32989
|
-
const reranker = warm ? await warm.reranker(`rerank:${model.id}`, async () => (await import("./process-
|
|
33006
|
+
const reranker = warm ? await warm.reranker(`rerank:${model.id}`, async () => (await import("./process-AGXY76ZE.js")).openRerankerProcess(model, directory2, {
|
|
32990
33007
|
threads: defaultThreads()
|
|
32991
|
-
})) : await (await import("./rerank-
|
|
33008
|
+
})) : await (await import("./rerank-TL6Z6F7K.js")).openReranker(model, directory2);
|
|
32992
33009
|
return {
|
|
32993
33010
|
model: model.id,
|
|
32994
33011
|
score: /* @__PURE__ */ __name((question, passages) => reranker.score(plainWords(question), passages), "score"),
|
|
@@ -33008,32 +33025,32 @@ var rerankLane = /* @__PURE__ */ __name((deps) => {
|
|
|
33008
33025
|
};
|
|
33009
33026
|
}, "rerankLane");
|
|
33010
33027
|
|
|
33011
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
33028
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/services/document-pictures.js
|
|
33012
33029
|
var openPictureEmbedderFor = /* @__PURE__ */ __name(async ({ env, command } = {}) => {
|
|
33013
33030
|
const model = imageModel(DEFAULT_IMAGE_MODEL);
|
|
33014
33031
|
const directory2 = imageModelsDirectory(env);
|
|
33015
33032
|
if (!isImageModelInstalled(model, directory2))
|
|
33016
33033
|
throw new CliError("not_found", `the picture model is not downloaded \u2014 ${command === void 0 ? "install it with a WireCat CLI that has `images models download` (tg, max or wa); they share the model folder" : `\`${command} images models download ${model.id}\` fetches it`}`, { reason: "model.not-downloaded", model: model.id });
|
|
33017
|
-
const { openPictureEmbedder } = await import("./embedder-
|
|
33034
|
+
const { openPictureEmbedder } = await import("./embedder-SW7DTWSL.js");
|
|
33018
33035
|
return openPictureEmbedder(model, directory2);
|
|
33019
33036
|
}, "openPictureEmbedderFor");
|
|
33020
33037
|
|
|
33021
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
33022
|
-
var documentSource = /* @__PURE__ */ __name((
|
|
33023
|
-
const metadata =
|
|
33024
|
-
const account = accounts.find(({ id: id2 }) => String(id2) ===
|
|
33025
|
-
const remote =
|
|
33038
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/services/document-source.js
|
|
33039
|
+
var documentSource = /* @__PURE__ */ __name((note, accounts, profiles, file) => {
|
|
33040
|
+
const metadata = note.frontMatter;
|
|
33041
|
+
const account = accounts.find(({ id: id2 }) => String(id2) === note.folderId);
|
|
33042
|
+
const remote = note.source === "file" && (account !== void 0 && kindIn(account.provider) === "documents" || metadata?.source === "google-drive");
|
|
33026
33043
|
const profile = remote && account ? Object.entries(profiles).flatMap(([command, named2]) => Object.entries(named2).map(([name, key]) => ({ command, name, key }))).find(({ key }) => key.provider === account.provider && key.account === account.account || isFolderProvider(key.provider) && key.account === account.name) : void 0;
|
|
33027
33044
|
const url = file?.url ?? (remote && typeof metadata?.sourceUrl === "string" ? metadata.sourceUrl : void 0);
|
|
33028
33045
|
return {
|
|
33029
33046
|
kind: remote ? "document" : "note",
|
|
33030
33047
|
provider: profile ? profile.command : "notes",
|
|
33031
|
-
account: profile?.name ??
|
|
33048
|
+
account: profile?.name ?? note.folderId ?? "internal",
|
|
33032
33049
|
...remote && url !== void 0 ? { url } : {}
|
|
33033
33050
|
};
|
|
33034
33051
|
}, "documentSource");
|
|
33035
33052
|
|
|
33036
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
33053
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/services/notes-title-tier.js
|
|
33037
33054
|
var plainQueryWords = /* @__PURE__ */ __name((query) => {
|
|
33038
33055
|
let root;
|
|
33039
33056
|
try {
|
|
@@ -33053,14 +33070,14 @@ var plainQueryWords = /* @__PURE__ */ __name((query) => {
|
|
|
33053
33070
|
}, "plainQueryWords");
|
|
33054
33071
|
var titleQuery = /* @__PURE__ */ __name((words3) => words3.split(" ").map((word) => `title:"${word}"`).join(" AND "), "titleQuery");
|
|
33055
33072
|
var titleTiers = /* @__PURE__ */ __name((hits, words3) => {
|
|
33056
|
-
const rank = /* @__PURE__ */ __name(({ note
|
|
33057
|
-
const title = normalize(
|
|
33073
|
+
const rank = /* @__PURE__ */ __name(({ note }) => {
|
|
33074
|
+
const title = normalize(note.title ?? "");
|
|
33058
33075
|
return title === words3 ? 0 : title.includes(words3) ? 1 : 2;
|
|
33059
33076
|
}, "rank");
|
|
33060
33077
|
return [...hits].sort((a, b) => rank(a) - rank(b));
|
|
33061
33078
|
}, "titleTiers");
|
|
33062
33079
|
|
|
33063
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
33080
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/services/notes-search.js
|
|
33064
33081
|
var storeQuery = /* @__PURE__ */ __name(async (store, text2, { exact, timezone } = {}) => resolvedQuery(store, parsedQuery(text2, exact), timezone), "storeQuery");
|
|
33065
33082
|
var parsedQuery = /* @__PURE__ */ __name((text2, exact) => validateFields(parseLucene(text2, { ...SEARCH_QUERY, defaultField: exact ? "exact" : "text" })).root, "parsedQuery");
|
|
33066
33083
|
var resolvedQuery = /* @__PURE__ */ __name(async (store, root, timezone) => {
|
|
@@ -33231,7 +33248,7 @@ var matching = /* @__PURE__ */ __name(async (store, refs, root, scope) => {
|
|
|
33231
33248
|
...scope.source ? { source: scope.source } : {},
|
|
33232
33249
|
...resolved.stemmer ? { stemmer: resolved.stemmer } : {}
|
|
33233
33250
|
});
|
|
33234
|
-
return new Map(found.items.map(({ ref, note
|
|
33251
|
+
return new Map(found.items.map(({ ref, note, at }) => [ref, { note, at }]));
|
|
33235
33252
|
}, "matching");
|
|
33236
33253
|
var RANK_WITHIN = 2e3;
|
|
33237
33254
|
var filterRefs = /* @__PURE__ */ __name(async (store, narrowing, scope) => {
|
|
@@ -33356,10 +33373,10 @@ var searchNotes = /* @__PURE__ */ __name(async (store, query, { limit = 20, offs
|
|
|
33356
33373
|
...scope
|
|
33357
33374
|
});
|
|
33358
33375
|
const ranked = /* @__PURE__ */ new Map();
|
|
33359
|
-
const add = /* @__PURE__ */ __name((list2, by) => list2.forEach(({ ref, note
|
|
33376
|
+
const add = /* @__PURE__ */ __name((list2, by) => list2.forEach(({ ref, note, at }, rank) => {
|
|
33360
33377
|
if (tierRefs.has(ref))
|
|
33361
33378
|
return;
|
|
33362
|
-
const held = ranked.get(ref) ?? { note
|
|
33379
|
+
const held = ranked.get(ref) ?? { note, at, score: 0, foundBy: [] };
|
|
33363
33380
|
held.foundBy.push(by);
|
|
33364
33381
|
ranked.set(ref, held);
|
|
33365
33382
|
if (by === "meaning" && lookup !== void 0 && held.foundBy.includes("words"))
|
|
@@ -33370,7 +33387,7 @@ var searchNotes = /* @__PURE__ */ __name(async (store, query, { limit = 20, offs
|
|
|
33370
33387
|
if (meaning !== void 0)
|
|
33371
33388
|
add(meaning, "meaning");
|
|
33372
33389
|
const ordered = [
|
|
33373
|
-
...tier.map(({ ref, note
|
|
33390
|
+
...tier.map(({ ref, note, at }) => [ref, { note, at, score: 0, foundBy: ["title"] }]),
|
|
33374
33391
|
...[...ranked.entries()].sort(([, a], [, b]) => b.score - a.score)
|
|
33375
33392
|
];
|
|
33376
33393
|
const page = slice ? ordered : ordered.slice(offset, window3);
|
|
@@ -33380,7 +33397,7 @@ var searchNotes = /* @__PURE__ */ __name(async (store, query, { limit = 20, offs
|
|
|
33380
33397
|
const counts = /* @__PURE__ */ new Map();
|
|
33381
33398
|
const accounts = await store.accounts.storedAccounts();
|
|
33382
33399
|
const profiles = await store.accounts.profiles();
|
|
33383
|
-
for (const [ref, { note
|
|
33400
|
+
for (const [ref, { note, at, foundBy }] of page) {
|
|
33384
33401
|
const links = (await store.notes.links({ from: ref })).map(({ to, targetText, kind, anchor }) => ({
|
|
33385
33402
|
to,
|
|
33386
33403
|
target_text: targetText,
|
|
@@ -33389,13 +33406,13 @@ var searchNotes = /* @__PURE__ */ __name(async (store, query, { limit = 20, offs
|
|
|
33389
33406
|
}));
|
|
33390
33407
|
hits.push({
|
|
33391
33408
|
ref,
|
|
33392
|
-
source:
|
|
33393
|
-
folder_id:
|
|
33394
|
-
path:
|
|
33395
|
-
title:
|
|
33396
|
-
...documentSource(
|
|
33409
|
+
source: note.source,
|
|
33410
|
+
folder_id: note.folderId,
|
|
33411
|
+
path: note.path,
|
|
33412
|
+
title: note.title,
|
|
33413
|
+
...documentSource(note, accounts, profiles, note.source === "file" ? (await store.files.ofDocument(note.ref))[0] : void 0),
|
|
33397
33414
|
updated_at: at,
|
|
33398
|
-
excerpt: firstLine(
|
|
33415
|
+
excerpt: firstLine(note.text, words3),
|
|
33399
33416
|
links,
|
|
33400
33417
|
found_by: foundBy,
|
|
33401
33418
|
...cosines.has(ref) ? { meaning_score: cosines.get(ref) } : {}
|
|
@@ -33477,7 +33494,7 @@ var searchNotesOf = /* @__PURE__ */ __name(async (store, account, text2, { accou
|
|
|
33477
33494
|
};
|
|
33478
33495
|
}, "searchNotesOf");
|
|
33479
33496
|
|
|
33480
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
33497
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/services/events-search.js
|
|
33481
33498
|
var MAX_EVENTS_OFFSET = 1e3;
|
|
33482
33499
|
var iso3 = /* @__PURE__ */ __name((at) => at === null ? null : new Date(at).toISOString(), "iso");
|
|
33483
33500
|
var accountIdsOf = /* @__PURE__ */ __name(async (store, accounts) => {
|
|
@@ -33594,7 +33611,7 @@ var searchEvents = /* @__PURE__ */ __name(async (store, query, { limit = 20, off
|
|
|
33594
33611
|
};
|
|
33595
33612
|
}, "searchEvents");
|
|
33596
33613
|
|
|
33597
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
33614
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/services/search-all.js
|
|
33598
33615
|
var RESOURCES_SEARCHED = ["messages", "mail", "notes", "events", "crm"];
|
|
33599
33616
|
var skippable = /* @__PURE__ */ __name((error) => error instanceof CliError && (error.code === "validation_error" || error.code === "not_found"), "skippable");
|
|
33600
33617
|
var filtersBeside = /* @__PURE__ */ __name((text2) => {
|
|
@@ -33658,11 +33675,11 @@ var searchAll = /* @__PURE__ */ __name(async (store, account, request, messenger
|
|
|
33658
33675
|
if (kind === "messages" && found.coverage)
|
|
33659
33676
|
coverage2 = found.coverage;
|
|
33660
33677
|
hasMore ||= found.hasMore;
|
|
33661
|
-
const
|
|
33678
|
+
const read = found.coverage?.accounts ?? given ?? (await store.accounts.accounts()).filter(({ provider }) => kindIn(provider) === kind);
|
|
33662
33679
|
for (const one of found.skipped ?? [])
|
|
33663
33680
|
if (!skipped.some(({ source }) => source === one.source))
|
|
33664
33681
|
skipped.push(one);
|
|
33665
|
-
accounts.push(...
|
|
33682
|
+
accounts.push(...read.map(({ provider, account: account2 }) => ({ resource: kind, provider, account: account2 })));
|
|
33666
33683
|
const itemOf3 = /* @__PURE__ */ __name((hit, foundBy) => {
|
|
33667
33684
|
const at = parseLocator(hit.locator);
|
|
33668
33685
|
return {
|
|
@@ -33689,7 +33706,7 @@ var searchAll = /* @__PURE__ */ __name(async (store, account, request, messenger
|
|
|
33689
33706
|
reason: "the query uses NOT, or a filter under OR or in a group, which meaning cannot follow",
|
|
33690
33707
|
model: DEFAULT_TEXT_MODEL
|
|
33691
33708
|
}
|
|
33692
|
-
} : await meaning(request.text,
|
|
33709
|
+
} : await meaning(request.text, read, embedders);
|
|
33693
33710
|
if ("skipped" in lane) {
|
|
33694
33711
|
by[kind] = { by: "words", meaningSkipped: lane.skipped };
|
|
33695
33712
|
return byWords;
|
|
@@ -33749,19 +33766,19 @@ var searchAll = /* @__PURE__ */ __name(async (store, account, request, messenger
|
|
|
33749
33766
|
text: hit.excerpt,
|
|
33750
33767
|
foundBy: hit.found_by
|
|
33751
33768
|
})));
|
|
33752
|
-
const
|
|
33769
|
+
const read = chosen?.map(({ account: account2 }) => account2) ?? [
|
|
33753
33770
|
INTERNAL_NOTES,
|
|
33754
33771
|
...(await store.notes.folders()).map(({ id: id2 }) => id2),
|
|
33755
33772
|
...(await store.notes.documentsAccounts()).map(({ id: id2 }) => id2)
|
|
33756
33773
|
];
|
|
33757
|
-
accounts.push(...
|
|
33774
|
+
accounts.push(...read.map((account2) => ({ resource, provider: "notes", account: account2 })));
|
|
33758
33775
|
} else if (resource === "events") {
|
|
33759
|
-
const
|
|
33760
|
-
if (!
|
|
33776
|
+
const read = request.scope?.events ?? await calendarAccounts(store);
|
|
33777
|
+
if (!read.length)
|
|
33761
33778
|
continue;
|
|
33762
33779
|
const found = await searchEvents(store, request.text, {
|
|
33763
33780
|
limit: window3,
|
|
33764
|
-
accounts:
|
|
33781
|
+
accounts: read,
|
|
33765
33782
|
embedders,
|
|
33766
33783
|
...command === void 0 ? {} : { command },
|
|
33767
33784
|
...request.env === void 0 ? {} : { env: request.env },
|
|
@@ -33789,13 +33806,14 @@ var searchAll = /* @__PURE__ */ __name(async (store, account, request, messenger
|
|
|
33789
33806
|
text: hit.excerpt,
|
|
33790
33807
|
foundBy: hit.found_by
|
|
33791
33808
|
})));
|
|
33792
|
-
accounts.push(...
|
|
33809
|
+
accounts.push(...read.map(({ provider, account: account2 }) => ({ resource, provider, account: account2 })));
|
|
33793
33810
|
} else if (resource === "crm") {
|
|
33794
33811
|
const { words: words3, anyWord } = titleWords(request.text);
|
|
33795
33812
|
const chosen = request.scope?.crm;
|
|
33796
33813
|
const found = await store.deals.find({
|
|
33797
33814
|
words: words3,
|
|
33798
33815
|
anyWord: anyWord || discover,
|
|
33816
|
+
...request.crmKinds === void 0 ? {} : { kinds: request.crmKinds },
|
|
33799
33817
|
limit: Math.min(window3 + 1, 500),
|
|
33800
33818
|
...chosen === void 0 ? {} : { accounts: chosen }
|
|
33801
33819
|
});
|
|
@@ -33810,8 +33828,8 @@ var searchAll = /* @__PURE__ */ __name(async (store, account, request, messenger
|
|
|
33810
33828
|
text: deal.summary,
|
|
33811
33829
|
foundBy: ["title"]
|
|
33812
33830
|
})));
|
|
33813
|
-
const
|
|
33814
|
-
for (const { provider, account: account2 } of
|
|
33831
|
+
const read = chosen ?? [...await crmAccounts(store), { provider: "crm", account: INTERNAL_NOTES }];
|
|
33832
|
+
for (const { provider, account: account2 } of read)
|
|
33815
33833
|
accounts.push({ resource, provider, account: account2 });
|
|
33816
33834
|
} else
|
|
33817
33835
|
lists.push(await messagesOf(resource));
|
|
@@ -33855,7 +33873,7 @@ var oneList = /* @__PURE__ */ __name((lists, cosines) => {
|
|
|
33855
33873
|
return [...place.values()].sort((a, b) => a.rank - b.rank || cosine(b.item.ref) - cosine(a.item.ref)).map(({ item: item2 }) => item2);
|
|
33856
33874
|
}, "oneList");
|
|
33857
33875
|
|
|
33858
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
33876
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/services/search-all-meetings.js
|
|
33859
33877
|
var RESOURCES_SEARCHED_WITH_MEETINGS = [...RESOURCES_SEARCHED, "meetings"];
|
|
33860
33878
|
var whole2 = /* @__PURE__ */ __name((value, minimum, maximum, label) => {
|
|
33861
33879
|
if (!Number.isSafeInteger(value) || value < minimum || value > maximum)
|
|
@@ -34090,12 +34108,12 @@ var searchAllOfSource = /* @__PURE__ */ __name(async (store, account, source, re
|
|
|
34090
34108
|
}));
|
|
34091
34109
|
if (only.includes("meetings") && meetings.length > 1)
|
|
34092
34110
|
throw new CliError("validation_error", `--source names several meeting accounts; search all reads one: ${meetings.map(({ provider, account: account2 }) => `${provider}:${account2}`).join(", ")}`);
|
|
34093
|
-
const
|
|
34094
|
-
if (
|
|
34111
|
+
const read = only.filter((resource) => named2(resource).length > 0);
|
|
34112
|
+
if (read.includes("meetings") && request.offset !== void 0)
|
|
34095
34113
|
throw new CliError("validation_error", "--offset pages messages, mail and notes; not with a meeting account yet");
|
|
34096
34114
|
const found = await searchAllIncludingMeetings(store, account, {
|
|
34097
34115
|
...request,
|
|
34098
|
-
only:
|
|
34116
|
+
only: read,
|
|
34099
34117
|
scope: {
|
|
34100
34118
|
messages: named2("messages"),
|
|
34101
34119
|
mail: named2("mail"),
|
|
@@ -34105,11 +34123,11 @@ var searchAllOfSource = /* @__PURE__ */ __name(async (store, account, source, re
|
|
|
34105
34123
|
},
|
|
34106
34124
|
...meetings[0] ? { meetingAccount: meetings[0] } : {}
|
|
34107
34125
|
}, messenger, searchMessages, meaning);
|
|
34108
|
-
const unnamed = only.filter((resource) => !
|
|
34126
|
+
const unnamed = only.filter((resource) => !read.includes(resource)).map((resource) => ({ resource, code: "not_found", reason: `--source names no ${resource} account` }));
|
|
34109
34127
|
return { ...found, skipped: [...skipped, ...empty2, ...unnamed, ...found.skipped] };
|
|
34110
34128
|
}, "searchAllOfSource");
|
|
34111
34129
|
|
|
34112
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34130
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/services/server-search.js
|
|
34113
34131
|
var SERVER_SEARCH_KEY = "messages.server-search";
|
|
34114
34132
|
var SERVER_BOUNDS = { timeMs: 5e3, perCall: 100, maxCalls: 3, textBytes: 262144 };
|
|
34115
34133
|
var DEFAULT_BACKEND = "both";
|
|
@@ -34298,7 +34316,7 @@ var searchServer = /* @__PURE__ */ __name(async (deps, request) => {
|
|
|
34298
34316
|
return { report, sources };
|
|
34299
34317
|
}, "searchServer");
|
|
34300
34318
|
|
|
34301
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34319
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/services/messages.js
|
|
34302
34320
|
var DELETE_AT_ONCE = 10;
|
|
34303
34321
|
var filesOf = /* @__PURE__ */ __name(({ attachments }) => {
|
|
34304
34322
|
const files = fileLinks(attachments);
|
|
@@ -34306,7 +34324,7 @@ var filesOf = /* @__PURE__ */ __name(({ attachments }) => {
|
|
|
34306
34324
|
}, "filesOf");
|
|
34307
34325
|
var messagesService = /* @__PURE__ */ __name((deps) => {
|
|
34308
34326
|
const { guard } = deps;
|
|
34309
|
-
const inStore = /* @__PURE__ */ __name(async (
|
|
34327
|
+
const inStore = /* @__PURE__ */ __name(async (read) => read(await deps.store(), await deps.account()), "inStore");
|
|
34310
34328
|
const ownTarget = /* @__PURE__ */ __name(async (target2, account) => {
|
|
34311
34329
|
if (account.provider !== deps.messenger.provider)
|
|
34312
34330
|
throw new CliError("validation_error", "that locator belongs to another account; select its profile first");
|
|
@@ -34739,7 +34757,7 @@ var checkMediaOptions = /* @__PURE__ */ __name((messenger, asked, attachments) =
|
|
|
34739
34757
|
throw new CliError("validation_error", `${MEDIA_FLAGS[first2]} needs a --photo or --file`);
|
|
34740
34758
|
}, "checkMediaOptions");
|
|
34741
34759
|
|
|
34742
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34760
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/domain/channel-tags.js
|
|
34743
34761
|
var CHANNEL_TAG_RULES_VERSION = "keywords-v1";
|
|
34744
34762
|
var RULES = {
|
|
34745
34763
|
ai: [/\b(ai|gpt|llm|machine learning|artificial intelligence)\b/iu, /нейросет|искусственн/iu],
|
|
@@ -34754,7 +34772,7 @@ var classifyChannel = /* @__PURE__ */ __name((metadata) => Object.entries(RULES)
|
|
|
34754
34772
|
return fields.length ? [{ tag, score: fields.length / 3, fields }] : [];
|
|
34755
34773
|
}), "classifyChannel");
|
|
34756
34774
|
|
|
34757
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34775
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/services/metadata.js
|
|
34758
34776
|
var metadataService = /* @__PURE__ */ __name((deps) => {
|
|
34759
34777
|
const held = /* @__PURE__ */ __name(async (reference, { includeLeft = false } = {}) => {
|
|
34760
34778
|
const store = await deps.store();
|
|
@@ -34769,8 +34787,8 @@ var metadataService = /* @__PURE__ */ __name((deps) => {
|
|
|
34769
34787
|
const found = (await store.chats.chats(account, {})).items.find((chat) => chat.id === chatId);
|
|
34770
34788
|
if (!found || found.kind !== "group" && found.kind !== "channel")
|
|
34771
34789
|
throw new CliError("validation_error", "metadata sync applies to groups and channels");
|
|
34772
|
-
const
|
|
34773
|
-
const card = deps.withConnection ? await deps.withConnection(
|
|
34790
|
+
const read = /* @__PURE__ */ __name(async (adapter) => capability(adapter, "group", "read group or channel metadata")(chatId), "read");
|
|
34791
|
+
const card = deps.withConnection ? await deps.withConnection(read) : await read(await deps.connection());
|
|
34774
34792
|
return store.chats.saveChatMetadata(account, {
|
|
34775
34793
|
chatId,
|
|
34776
34794
|
title: card.title,
|
|
@@ -34840,7 +34858,7 @@ var metadataService = /* @__PURE__ */ __name((deps) => {
|
|
|
34840
34858
|
};
|
|
34841
34859
|
}, "metadataService");
|
|
34842
34860
|
|
|
34843
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34861
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/moderation/run.js
|
|
34844
34862
|
var FIRST_LOOK_MS = 24 * 36e5;
|
|
34845
34863
|
var moderateWith = /* @__PURE__ */ __name(async (run) => {
|
|
34846
34864
|
const { chatId, title, rules, point, since, dryRun } = run;
|
|
@@ -34877,7 +34895,7 @@ var moderateWith = /* @__PURE__ */ __name(async (run) => {
|
|
|
34877
34895
|
return { chatId, rows, notes };
|
|
34878
34896
|
}, "moderateWith");
|
|
34879
34897
|
|
|
34880
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34898
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/services/moderation.js
|
|
34881
34899
|
var moderationService = /* @__PURE__ */ __name((deps) => {
|
|
34882
34900
|
const file = /* @__PURE__ */ __name(() => new ModerationRules(moderationPathFor(deps.messenger.app, deps.profile ?? "default", deps.env ?? process.env)), "file");
|
|
34883
34901
|
const group = /* @__PURE__ */ __name(async (chat) => {
|
|
@@ -34955,14 +34973,14 @@ var moderatorOf = /* @__PURE__ */ __name((adapter, deps) => ({
|
|
|
34955
34973
|
}, "removePerson")
|
|
34956
34974
|
}), "moderatorOf");
|
|
34957
34975
|
|
|
34958
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34959
|
-
var noteItem = /* @__PURE__ */ __name((provider,
|
|
34960
|
-
id:
|
|
34961
|
-
contact: formatReference({ type: "contact", provider, id:
|
|
34962
|
-
text:
|
|
34963
|
-
revision:
|
|
34964
|
-
created_at:
|
|
34965
|
-
updated_at:
|
|
34976
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/services/private-people.js
|
|
34977
|
+
var noteItem = /* @__PURE__ */ __name((provider, note) => ({
|
|
34978
|
+
id: note.id,
|
|
34979
|
+
contact: formatReference({ type: "contact", provider, id: note.personId }),
|
|
34980
|
+
text: note.text,
|
|
34981
|
+
revision: note.revision,
|
|
34982
|
+
created_at: note.createdAt,
|
|
34983
|
+
updated_at: note.updatedAt
|
|
34966
34984
|
}), "noteItem");
|
|
34967
34985
|
var privatePeopleService = /* @__PURE__ */ __name((deps) => {
|
|
34968
34986
|
const target2 = /* @__PURE__ */ __name(async (reference) => {
|
|
@@ -34974,7 +34992,7 @@ var privatePeopleService = /* @__PURE__ */ __name((deps) => {
|
|
|
34974
34992
|
return {
|
|
34975
34993
|
notes: /* @__PURE__ */ __name(async (reference) => {
|
|
34976
34994
|
const { store, account, person } = await target2(reference);
|
|
34977
|
-
return (await store.people.privateContact(account, person.id)).notes.map((
|
|
34995
|
+
return (await store.people.privateContact(account, person.id)).notes.map((note) => noteItem(account.provider, note));
|
|
34978
34996
|
}, "notes"),
|
|
34979
34997
|
alias: /* @__PURE__ */ __name(async (reference, alias) => {
|
|
34980
34998
|
const { store, account, person } = await target2(reference);
|
|
@@ -34999,7 +35017,7 @@ var privatePeopleService = /* @__PURE__ */ __name((deps) => {
|
|
|
34999
35017
|
};
|
|
35000
35018
|
}, "privatePeopleService");
|
|
35001
35019
|
|
|
35002
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
35020
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/services/rankings.js
|
|
35003
35021
|
var empty = /* @__PURE__ */ __name(() => ({
|
|
35004
35022
|
total: 0,
|
|
35005
35023
|
population: 0,
|
|
@@ -35255,7 +35273,7 @@ var rankingsService = /* @__PURE__ */ __name((deps) => ({
|
|
|
35255
35273
|
}, "evidence")
|
|
35256
35274
|
}), "rankingsService");
|
|
35257
35275
|
|
|
35258
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
35276
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/services/reply-stats.js
|
|
35259
35277
|
var FIELDS = ["date", "chat", "kind"];
|
|
35260
35278
|
var WAITING_TAIL = 100;
|
|
35261
35279
|
var plainOnly = /* @__PURE__ */ __name((text2, command) => {
|
|
@@ -35382,7 +35400,7 @@ var replyStatsService = /* @__PURE__ */ __name((deps) => {
|
|
|
35382
35400
|
};
|
|
35383
35401
|
}, "replyStatsService");
|
|
35384
35402
|
|
|
35385
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
35403
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/services/searches.js
|
|
35386
35404
|
var savedSearchItem = /* @__PURE__ */ __name((one) => ({
|
|
35387
35405
|
id: one.id,
|
|
35388
35406
|
name: one.name,
|
|
@@ -35511,7 +35529,7 @@ var searchesService = /* @__PURE__ */ __name((deps) => {
|
|
|
35511
35529
|
};
|
|
35512
35530
|
}, "searchesService");
|
|
35513
35531
|
|
|
35514
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
35532
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/services/tags.js
|
|
35515
35533
|
var TAGGING_QUERY = {
|
|
35516
35534
|
entity: "tagging",
|
|
35517
35535
|
backend: "sql",
|
|
@@ -35595,7 +35613,7 @@ var tagsService = /* @__PURE__ */ __name((deps) => {
|
|
|
35595
35613
|
};
|
|
35596
35614
|
}, "tagsService");
|
|
35597
35615
|
|
|
35598
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
35616
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/services/topics.js
|
|
35599
35617
|
var actionOf = /* @__PURE__ */ __name(({ title, closed, pinned, hidden, icon }) => {
|
|
35600
35618
|
const set = [closed, pinned, hidden].filter((one) => one !== void 0).length;
|
|
35601
35619
|
if (title !== void 0 || icon !== void 0 || set !== 1)
|
|
@@ -35794,7 +35812,7 @@ var topicsService = /* @__PURE__ */ __name((deps) => {
|
|
|
35794
35812
|
};
|
|
35795
35813
|
}, "topicsService");
|
|
35796
35814
|
|
|
35797
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
35815
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/services/evidence.js
|
|
35798
35816
|
import { createHash as createHash11, randomUUID as randomUUID5 } from "node:crypto";
|
|
35799
35817
|
var hash2 = /* @__PURE__ */ __name((value) => createHash11("sha256").update(JSON.stringify(value)).digest("hex"), "hash");
|
|
35800
35818
|
var positive = /* @__PURE__ */ __name((value, name, minimum = 1) => {
|
|
@@ -35868,7 +35886,7 @@ var prepareEvidencePacket = /* @__PURE__ */ __name(({ kind, source, page, limits
|
|
|
35868
35886
|
return { ...content, id: randomUUID5(), fingerprint: hash2(content) };
|
|
35869
35887
|
}, "prepareEvidencePacket");
|
|
35870
35888
|
|
|
35871
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
35889
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/services/evidence-read.js
|
|
35872
35890
|
var readEvidencePacket = /* @__PURE__ */ __name(async (store, account, { chat, limit, before: before2 }, messenger = {}) => {
|
|
35873
35891
|
if (!Number.isSafeInteger(limit) || limit < 1 || limit > 100)
|
|
35874
35892
|
throw new CliError("validation_error", "evidence message limit must be an integer from 1 to 100");
|
|
@@ -35888,7 +35906,7 @@ var readEvidencePacket = /* @__PURE__ */ __name(async (store, account, { chat, l
|
|
|
35888
35906
|
return { ...packet, nextBeforeId: older && last ? last.id : null };
|
|
35889
35907
|
}, "readEvidencePacket");
|
|
35890
35908
|
|
|
35891
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
35909
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/services/meeting-project-discovery.js
|
|
35892
35910
|
var scopeKeys = [
|
|
35893
35911
|
"accountId",
|
|
35894
35912
|
"meetingId",
|
|
@@ -35910,7 +35928,7 @@ var optionKeys = /* @__PURE__ */ new Set([
|
|
|
35910
35928
|
"maxVocabularyReadBytes"
|
|
35911
35929
|
]);
|
|
35912
35930
|
|
|
35913
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
35931
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/context/communication-selection.js
|
|
35914
35932
|
var communicationFields = {
|
|
35915
35933
|
sources: pipe(array(strictObject({
|
|
35916
35934
|
id: pipe(string(), regex(/^[A-Za-z0-9][A-Za-z0-9._-]{0,127}$/)),
|
|
@@ -35942,7 +35960,7 @@ var communicationRequest = /* @__PURE__ */ __name((value, preparationAfter) => {
|
|
|
35942
35960
|
return { ...input, after, before: before2 };
|
|
35943
35961
|
}, "communicationRequest");
|
|
35944
35962
|
|
|
35945
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
35963
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/services/meeting-preparation-validation.js
|
|
35946
35964
|
var MEETING_PREPARATION_LIMITS = {
|
|
35947
35965
|
meetings: { min: 1, max: 20, default: 5 },
|
|
35948
35966
|
cues: { min: 1, max: 100, default: 10 },
|
|
@@ -36015,7 +36033,7 @@ var validateMeetingPreparationRequest = /* @__PURE__ */ __name((externalId, orig
|
|
|
36015
36033
|
};
|
|
36016
36034
|
}, "validateMeetingPreparationRequest");
|
|
36017
36035
|
|
|
36018
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
36036
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/services/meeting-communications-selection.js
|
|
36019
36037
|
var validatePreparationCommunications = /* @__PURE__ */ __name((section, request, after) => {
|
|
36020
36038
|
const fail2 = /* @__PURE__ */ __name(() => {
|
|
36021
36039
|
throw new CliError("invalid_response", "Preparation communications returned another selection or invalid evidence");
|
|
@@ -36063,7 +36081,7 @@ var validatePreparationCommunications = /* @__PURE__ */ __name((section, request
|
|
|
36063
36081
|
}
|
|
36064
36082
|
}, "validatePreparationCommunications");
|
|
36065
36083
|
|
|
36066
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
36084
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/services/package-upgrade.js
|
|
36067
36085
|
var upgradePackage = /* @__PURE__ */ __name(async ({ current, command, packageName, check: check2 }, ports) => {
|
|
36068
36086
|
const installer = ports.installer();
|
|
36069
36087
|
const argv = updateCommand(installer, packageName);
|
|
@@ -36095,9 +36113,9 @@ var upgradePackage = /* @__PURE__ */ __name(async ({ current, command, packageNa
|
|
|
36095
36113
|
const installed = await ports.installed?.();
|
|
36096
36114
|
if (installed === void 0)
|
|
36097
36115
|
return restart(result, ports);
|
|
36098
|
-
const
|
|
36116
|
+
const read = { ...result, installed };
|
|
36099
36117
|
if (!isNewer(latest2, installed))
|
|
36100
|
-
return restart(
|
|
36118
|
+
return restart(read, ports);
|
|
36101
36119
|
const heldBack = {
|
|
36102
36120
|
// pnpm 11 resolves `@latest` to the newest version older than minimumReleaseAge, 1 day by default.
|
|
36103
36121
|
until: installer === "pnpm" ? dayAfter(await ports.publishedAt?.(latest2)) : null,
|
|
@@ -36105,8 +36123,8 @@ var upgradePackage = /* @__PURE__ */ __name(async ({ current, command, packageNa
|
|
|
36105
36123
|
command: argv.map((word) => word === `${packageName}@latest` ? `${packageName}@${latest2}` : word).join(" ")
|
|
36106
36124
|
};
|
|
36107
36125
|
if (installed === current)
|
|
36108
|
-
return { result: { ...
|
|
36109
|
-
return { ...await restart({ ...
|
|
36126
|
+
return { result: { ...read, heldBack }, reason: "held_back", left: [] };
|
|
36127
|
+
return { ...await restart({ ...read, heldBack }, ports), reason: "held_back" };
|
|
36110
36128
|
}, "upgradePackage");
|
|
36111
36129
|
var restart = /* @__PURE__ */ __name(async (result, ports) => {
|
|
36112
36130
|
const servers = await ports.afterUpdate?.();
|
|
@@ -36128,7 +36146,7 @@ var dayAfter = /* @__PURE__ */ __name((published) => {
|
|
|
36128
36146
|
return Number.isNaN(time) ? null : new Date(time + 24 * 60 * 60 * 1e3).toISOString();
|
|
36129
36147
|
}, "dayAfter");
|
|
36130
36148
|
|
|
36131
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
36149
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/services/index.js
|
|
36132
36150
|
var servicesFor = /* @__PURE__ */ __name((deps) => {
|
|
36133
36151
|
const pictures = picturesService(deps);
|
|
36134
36152
|
const base = {
|
|
@@ -36165,7 +36183,7 @@ var servicesFor = /* @__PURE__ */ __name((deps) => {
|
|
|
36165
36183
|
return deps.messenger.services ? { ...base, ...deps.messenger.services(base, deps) } : base;
|
|
36166
36184
|
}, "servicesFor");
|
|
36167
36185
|
|
|
36168
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
36186
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/background/relay.js
|
|
36169
36187
|
import { createHash as createHash12 } from "node:crypto";
|
|
36170
36188
|
import { chmodSync, lstatSync, mkdirSync as mkdirSync3, rmSync } from "node:fs";
|
|
36171
36189
|
import { createConnection, createServer } from "node:net";
|
|
@@ -36386,7 +36404,7 @@ var relayCommand = /* @__PURE__ */ __name((path, request, options) => new Promis
|
|
|
36386
36404
|
}, () => finish({ error: stopped() }));
|
|
36387
36405
|
}), "relayCommand");
|
|
36388
36406
|
|
|
36389
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
36407
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.601.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4fddd50439ae4e4f952967ea26554e7b/node_modules/@wirecat/cli-core/dist/cli/messenger/serve-relay.js
|
|
36390
36408
|
var lentConnection = /* @__PURE__ */ __name((connection, watchers) => throughWrapper(connection, {
|
|
36391
36409
|
close: /* @__PURE__ */ __name(async () => {
|
|
36392
36410
|
}, "close"),
|
|
@@ -36485,8 +36503,6 @@ export {
|
|
|
36485
36503
|
throughWrapper,
|
|
36486
36504
|
capability,
|
|
36487
36505
|
syncsOneChat,
|
|
36488
|
-
newSendId,
|
|
36489
|
-
newOperationId,
|
|
36490
36506
|
AUDIT_PAGE,
|
|
36491
36507
|
AUDIT_BUDGET,
|
|
36492
36508
|
AUDIT_MIN_SCORE,
|
|
@@ -36570,7 +36586,9 @@ export {
|
|
|
36570
36586
|
ADMIN_RIGHTS,
|
|
36571
36587
|
senderIsMe,
|
|
36572
36588
|
MEDIA_KINDS,
|
|
36589
|
+
meaningLane,
|
|
36573
36590
|
searchNotesOf,
|
|
36591
|
+
searchAllWithMeetings,
|
|
36574
36592
|
DELETE_AT_ONCE,
|
|
36575
36593
|
moderateWith,
|
|
36576
36594
|
CONTEXT_MESSAGES2 as CONTEXT_MESSAGES,
|