@wirecat/bitrix24-cli 0.3.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 +130 -0
- package/README.md +84 -9
- package/dist/api-keys.d.ts +36 -9
- package/dist/api-keys.d.ts.map +1 -1
- package/dist/api-keys.js +139 -19
- 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/methods.d.ts.map +1 -1
- package/dist/bitrix/methods.js +7 -3
- package/dist/bitrix/methods.js.map +1 -1
- package/dist/bitrix/transport.d.ts +4 -7
- package/dist/bitrix/transport.d.ts.map +1 -1
- package/dist/bitrix/transport.js +29 -19
- 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-QIPTIUMJ.js → all-profiles-CANIDIDS.js} +12 -7
- package/dist/bundle/{anthropic-RHRAVHC2.js → anthropic-JUJB4DCF.js} +5 -5
- package/dist/bundle/{app-server-QIT6S7AZ.js → app-server-3V5Z4PTK.js} +68 -54
- package/dist/bundle/b24.js +18 -12
- package/dist/bundle/{bun-H6RSODZ3.js → bun-LKMV5TY7.js} +2 -2
- package/dist/bundle/{bun-sqlite-BO4LTQHX.js → bun-sqlite-S56EF74S.js} +3 -3
- package/dist/bundle/{chunk-D5S6QV6R.js → chunk-2I4KWS3H.js} +6 -6
- package/dist/bundle/chunk-36PO5NWY.js +147 -0
- package/dist/bundle/{chunk-ZIAQPTUS.js → chunk-42F7Q7V6.js} +3 -3
- package/dist/bundle/{chunk-6WY72XVQ.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-P33NDCDI.js → chunk-6MGWIZG4.js} +1 -1
- package/dist/bundle/{chunk-ZDQQCXFG.js → chunk-6YJTNZ7U.js} +13 -13
- package/dist/bundle/{chunk-MBDK4YXG.js → chunk-7FBFJ6B4.js} +4 -2
- package/dist/bundle/chunk-7VCMOTQP.js +55 -0
- package/dist/bundle/{chunk-P364PLIK.js → chunk-A5IMMGYU.js} +36 -34
- package/dist/bundle/{chunk-45AKJVKV.js → chunk-ASEHTBNK.js} +1 -1
- package/dist/bundle/{chunk-HGL63O5V.js → chunk-B6LPJYPQ.js} +2 -2
- package/dist/bundle/{chunk-LSPIOT6Z.js → chunk-BHEE2K6C.js} +7 -7
- package/dist/bundle/chunk-BYZQBE63.js +971 -0
- package/dist/bundle/{program-H3TGGRQ6.js → chunk-COKGNTDQ.js} +15761 -16685
- package/dist/bundle/{chunk-XJXONOB5.js → chunk-DVFYRQGE.js} +1 -1
- package/dist/bundle/{chunk-FLUEXJ4X.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-IRV2PCQ2.js → chunk-EYYOKT23.js} +26 -26
- package/dist/bundle/{chunk-PH5FZX6E.js → chunk-FCWPIWSR.js} +2 -2
- package/dist/bundle/{chunk-YZ5LHE5Q.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-VEWWAGTD.js → chunk-GLTKRLFT.js} +8 -8
- package/dist/bundle/chunk-GUUZQ7NE.js +581 -0
- package/dist/bundle/{chunk-QSNROIJL.js → chunk-H6RIPOOI.js} +42 -9
- package/dist/bundle/{chunk-H2ADPPSH.js → chunk-HGFNC4CR.js} +1819 -597
- package/dist/bundle/{chunk-7GRZAKBB.js → chunk-IERYD2N2.js} +6 -6
- package/dist/bundle/{chunk-N6FLBXZS.js → chunk-IGCLMEMB.js} +3 -3
- package/dist/bundle/{chunk-U5ACMCAQ.js → chunk-J7WCSZ2Q.js} +411 -919
- package/dist/bundle/{chunk-W5YAO5G5.js → chunk-JZYHQ4HB.js} +9 -4
- package/dist/bundle/{chunk-EVYSBZ3I.js → chunk-K4QM3X5F.js} +4 -4
- package/dist/bundle/{chunk-DTXERR44.js → chunk-KFSMY7SZ.js} +2 -2
- package/dist/bundle/{chunk-LRGYKOCP.js → chunk-KPEDH5T4.js} +1 -1
- package/dist/bundle/{chunk-XRFJWHY5.js → chunk-KUY7LII2.js} +4 -4
- package/dist/bundle/{chunk-QC53QBNC.js → chunk-LFXDHLFR.js} +3 -3
- package/dist/bundle/{chunk-CNNEA2M4.js → chunk-LGLT4JB6.js} +3 -3
- package/dist/bundle/{chunk-QGMDQ2PM.js → chunk-LM4OOBAW.js} +3 -3
- package/dist/bundle/chunk-M74BSKMA.js +234 -0
- package/dist/bundle/{chunk-2KCZ7BKW.js → chunk-MMMT6ORT.js} +11 -11
- package/dist/bundle/{chunk-WII44RXN.js → chunk-NGYD6QTE.js} +2 -2
- package/dist/bundle/{chunk-FOTREPNS.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-XD4FRDSL.js → chunk-OUMFNB34.js} +13 -149
- package/dist/bundle/{chunk-ZGZT5S6B.js → chunk-P2RQTNVJ.js} +806 -850
- package/dist/bundle/{chunk-RRJNNPR4.js → chunk-PBIBGIZ7.js} +1 -1
- package/dist/bundle/{chunk-EXOOKUEA.js → chunk-Q6VQHTRW.js} +2 -2
- package/dist/bundle/{chunk-TE3FR6MI.js → chunk-QHBCNVUG.js} +5 -5
- package/dist/bundle/{chunk-SGRYYE4X.js → chunk-QNOXAQ6Y.js} +4 -4
- package/dist/bundle/{chunk-QQXH2OPB.js → chunk-R5F2O5GX.js} +15 -272
- package/dist/bundle/{chunk-SFRNX2TI.js → chunk-R5PBSKJL.js} +1 -1
- package/dist/bundle/{chunk-OTD2ZRXD.js → chunk-RS2BARUU.js} +4 -4
- package/dist/bundle/chunk-TG3DSPT5.js +14 -0
- package/dist/bundle/{chunk-BCF7P4FZ.js → chunk-U22JMKUO.js} +6 -125
- package/dist/bundle/chunk-U66Q5TVK.js +106 -0
- package/dist/bundle/{chunk-QMPN6WKD.js → chunk-UCHMQWON.js} +211 -89
- package/dist/bundle/{chunk-POC3V3AO.js → chunk-VMJS7FJZ.js} +526 -467
- package/dist/bundle/{chunk-FZL7F5NR.js → chunk-VMVAQHDC.js} +77 -615
- package/dist/bundle/{chunk-K3UIB6ZF.js → chunk-WWMCJFMT.js} +2 -2
- package/dist/bundle/{chunk-CXL33BFL.js → chunk-XTA5TN3H.js} +1 -1
- package/dist/bundle/{chunk-WTPMJYMD.js → chunk-XUHHBEA7.js} +652 -131
- package/dist/bundle/{chunk-WKRQ44EH.js → chunk-YDZHO4LT.js} +13 -13
- package/dist/bundle/{chunk-2SNUMZ7S.js → chunk-ZKINZFIT.js} +6 -6
- package/dist/bundle/{chunk-HAXNUIGQ.js → chunk-ZSQXSIFQ.js} +89 -39
- package/dist/bundle/{chunk-YYO7D2MO.js → chunk-ZZEHDIEG.js} +58 -54
- package/dist/bundle/command-contract-OQV6H7SR.js +36 -0
- package/dist/bundle/{decode-5ZPLTYV6.js → decode-QSTBX4MG.js} +3 -3
- package/dist/bundle/{echarts-J6LAPIX7.js → echarts-JZELFH2N.js} +2 -2
- package/dist/bundle/{embed-YG5LDHME.js → embed-4RIW2LVH.js} +4 -4
- package/dist/bundle/{embedder-7FNUA5OZ.js → embedder-SW7DTWSL.js} +7 -7
- package/dist/bundle/{first-run-JPZNWIJN.js → first-run-7AISOSOM.js} +8 -8
- package/dist/bundle/first-screen-NMHNFZ2B.js +34 -0
- package/dist/bundle/{instructions-AXWTQHMR.js → instructions-BZE5YUGG.js} +1 -1
- package/dist/bundle/{mcp-7F46P6AM.js → mcp-SDWHDJTY.js} +2 -2
- package/dist/bundle/{node-P4E63KXA.js → node-KM3CUABH.js} +9 -9
- package/dist/bundle/{node-CWKAIOEM.js → node-LTKZIO4U.js} +2 -2
- package/dist/bundle/{node-sqlite-LSEKVRDA.js → node-sqlite-HQ5PN2RH.js} +4 -4
- package/dist/bundle/{oauth-THYNLRLD.js → oauth-UH6FOZQL.js} +5 -5
- package/dist/bundle/{open-E47QYKFC.js → open-TSUP3XGL.js} +3 -3
- package/dist/bundle/{openai-EWSGC3BC.js → openai-GVEE52E3.js} +14 -14
- package/dist/bundle/{process-WKTEA3WE.js → process-AGXY76ZE.js} +1 -1
- package/dist/bundle/program-BI4A4HFJ.js +2247 -0
- package/dist/bundle/{prompt-CAQ7QR3U.js → prompt-NRSUY7FA.js} +3 -3
- package/dist/bundle/{recognize-6KGHNZC3.js → recognize-NPDPQ6PJ.js} +2 -2
- package/dist/bundle/{remote-3UO2WDC3.js → remote-HFASMVLB.js} +5 -5
- package/dist/bundle/{rerank-2JVDPZBX.js → rerank-TL6Z6F7K.js} +5 -5
- package/dist/bundle/{chunk-VL6SPMZV.js → serve-VB4DHDZQ.js} +8 -6
- package/dist/bundle/server-T5EDRPJI.js +68 -0
- package/dist/bundle/{chunk-ZEW4P6AH.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-7NH5G4XJ.js → state-ISZVVZGR.js} +4 -4
- package/dist/bundle/store-IZJBAKJV.js +58 -0
- package/dist/bundle/{store-7O4JQD2Z.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 +81 -30
- 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 +43 -88
- package/dist/commands/crm-writes.js.map +1 -1
- package/dist/commands/crm.d.ts.map +1 -1
- package/dist/commands/crm.js +30 -48
- 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 +6 -6
- package/dist/commands/write.d.ts.map +1 -1
- package/dist/commands/write.js +11 -18
- 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 -8
- 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 +4 -6
- package/dist/crm/conditions.js.map +1 -1
- package/dist/crm/custom-query.d.ts +19 -0
- package/dist/crm/custom-query.d.ts.map +1 -0
- package/dist/crm/custom-query.js +79 -0
- package/dist/crm/custom-query.js.map +1 -0
- package/dist/crm/deal.d.ts +4 -27
- 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 +20 -0
- package/dist/crm/fields.d.ts.map +1 -0
- package/dist/crm/fields.js +78 -0
- package/dist/crm/fields.js.map +1 -0
- package/dist/crm/items.d.ts +7 -1
- package/dist/crm/items.d.ts.map +1 -1
- package/dist/crm/items.js +21 -18
- package/dist/crm/items.js.map +1 -1
- package/dist/crm/lead.d.ts +5 -36
- 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/organization.d.ts +1 -0
- package/dist/crm/organization.d.ts.map +1 -1
- package/dist/crm/person.d.ts +1 -0
- package/dist/crm/person.d.ts.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 +26 -5
- package/dist/crm/values.d.ts.map +1 -1
- package/dist/crm/values.js +40 -5
- 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 +53 -5
- package/dist/program.js.map +1 -1
- package/dist/reasons.d.ts.map +1 -1
- package/dist/reasons.js +6 -1
- package/dist/reasons.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 -10
- package/dist/bundle/all-profiles-QJ444GSX.js +0 -24
- package/dist/bundle/chunk-XNHSPHUN.js +0 -48
- package/dist/bundle/command-contract-OKQOE6G4.js +0 -30
- package/dist/bundle/first-screen-VQM4MTS7.js +0 -28
- package/dist/bundle/mcp-5RSWNTHS.js +0 -160
- package/dist/bundle/mcp-J5R5A65I.js +0 -87
- package/dist/bundle/serve-ES7AG5IK.js +0 -19
- package/dist/bundle/server-5LE5LNUQ.js +0 -45
- package/dist/bundle/server-BU4VBM6S.js +0 -58
- package/dist/bundle/store-maintenance-command-UDVGEY2D.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/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 -99
- package/dist/mcp.js.map +0 -1
- /package/dist/bundle/{chunk-4PDYYS5K.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-K3UIB6ZF.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.586.0_@wirecat+cli-base@0.79.0_commander@15.0.0_esbuild@0.28.2_type_bdecddef0ae5a50ae90cab8b9e35c13b/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();
|
|
@@ -17965,7 +17985,7 @@ var hitsByList = /* @__PURE__ */ __name((text2, categories) => {
|
|
|
17965
17985
|
const stem = stemmersOf();
|
|
17966
17986
|
const english = stem.english.stemTokens(text2);
|
|
17967
17987
|
const spanish = readsSpanish(text2) ? stem.spanish.stemTokens(text2) : [];
|
|
17968
|
-
const
|
|
17988
|
+
const counted2 = [];
|
|
17969
17989
|
for (const triggers of triggerStems(categories)) {
|
|
17970
17990
|
const hit = /* @__PURE__ */ new Set();
|
|
17971
17991
|
english.forEach((word, at) => {
|
|
@@ -17975,20 +17995,20 @@ var hitsByList = /* @__PURE__ */ __name((text2, categories) => {
|
|
|
17975
17995
|
else if (other !== void 0 && triggers.spanish.has(other))
|
|
17976
17996
|
hit.add(other);
|
|
17977
17997
|
});
|
|
17978
|
-
|
|
17998
|
+
counted2.push({ name: triggers.name, hits: hit.size });
|
|
17979
17999
|
}
|
|
17980
|
-
return
|
|
18000
|
+
return counted2;
|
|
17981
18001
|
}, "hitsByList");
|
|
17982
18002
|
var listsHit = /* @__PURE__ */ __name((text2, categories) => hitsByList(text2, categories).filter(({ hits }) => hits > 0).map(({ name }) => name), "listsHit");
|
|
17983
18003
|
var categorize = /* @__PURE__ */ __name((text2, categories = DEFAULT_TASK_CATEGORIES) => {
|
|
17984
18004
|
let best = { name: FALLBACK_CATEGORY, hits: 0 };
|
|
17985
|
-
for (const
|
|
17986
|
-
if (
|
|
17987
|
-
best =
|
|
18005
|
+
for (const counted2 of hitsByList(text2, categories))
|
|
18006
|
+
if (counted2.hits > best.hits)
|
|
18007
|
+
best = counted2;
|
|
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;
|
|
@@ -20001,8 +20021,8 @@ var chatsService = /* @__PURE__ */ __name((deps) => ({
|
|
|
20001
20021
|
});
|
|
20002
20022
|
const counts = await store.roster.memberCounts(chatId, { since: new Date(from).toISOString().slice(0, 10) });
|
|
20003
20023
|
const known2 = unrecorded ? { ...stats, complete: false, membersUnrecorded: true } : stats;
|
|
20004
|
-
const
|
|
20005
|
-
return completeness.state === "complete" || !syncsOneChat(deps.messenger) ?
|
|
20024
|
+
const counted2 = counts.length > 0 ? { ...known2, memberCounts: counts } : known2;
|
|
20025
|
+
return completeness.state === "complete" || !syncsOneChat(deps.messenger) ? counted2 : { ...counted2, fetch: typedCommand(deps.messenger.app.command, `messages sync ${chatId}`) };
|
|
20006
20026
|
}, "stats"),
|
|
20007
20027
|
sendAs: /* @__PURE__ */ __name(async (chat) => {
|
|
20008
20028
|
if (deps.offline) {
|
|
@@ -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.586.0_@wirecat+cli-base@0.79.0_commander@15.0.0_esbuild@0.28.2_type_bdecddef0ae5a50ae90cab8b9e35c13b/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) => ({
|
|
@@ -23771,7 +23788,7 @@ var gatherStoredProject = /* @__PURE__ */ __name(async (store, input) => {
|
|
|
23771
23788
|
const leftOut = [];
|
|
23772
23789
|
for (const one of all.filter((chat) => !purposeRead(purposes, chat.purpose))) {
|
|
23773
23790
|
const account = { provider: one.provider, account: one.account };
|
|
23774
|
-
const [
|
|
23791
|
+
const [counted2, [held]] = await Promise.all([
|
|
23775
23792
|
count4(account, one.chat, { since: gathered.window.after, until: gathered.window.before }),
|
|
23776
23793
|
chatCoverage(store, account, [one.chat])
|
|
23777
23794
|
]);
|
|
@@ -23784,11 +23801,11 @@ var gatherStoredProject = /* @__PURE__ */ __name(async (store, input) => {
|
|
|
23784
23801
|
purpose: one.purpose ?? LINK_PURPOSE,
|
|
23785
23802
|
relationship: one.relationship,
|
|
23786
23803
|
...one.proposed ? { proposed: one.proposed } : {},
|
|
23787
|
-
...
|
|
23804
|
+
...counted2
|
|
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))
|
|
@@ -25039,10 +25056,10 @@ var rowsOf = /* @__PURE__ */ __name((chat) => chat.messages.flatMap((message) =>
|
|
|
25039
25056
|
var centsText = /* @__PURE__ */ __name((cents) => `${Math.floor(cents / 100)}.${String(cents % 100).padStart(2, "0")}`, "centsText");
|
|
25040
25057
|
var amounts = {
|
|
25041
25058
|
id: "amounts",
|
|
25042
|
-
version:
|
|
25059
|
+
version: 3,
|
|
25043
25060
|
scope: "chat",
|
|
25044
|
-
read: /* @__PURE__ */ __name(async (
|
|
25045
|
-
if (!chat)
|
|
25061
|
+
read: /* @__PURE__ */ __name(async (context2, chat) => {
|
|
25062
|
+
if (!chat || context2.books)
|
|
25046
25063
|
return [];
|
|
25047
25064
|
const groups = /* @__PURE__ */ new Map();
|
|
25048
25065
|
for (const row of rowsOf(chat)) {
|
|
@@ -25055,7 +25072,8 @@ var amounts = {
|
|
|
25055
25072
|
const lastAsk = asks.at(-1);
|
|
25056
25073
|
const first2 = asks[0] ?? done2[0] ?? rows[0];
|
|
25057
25074
|
const paidAfter = done2.some((row) => !lastAsk || Date.parse(row.message.timestamp) >= Date.parse(lastAsk.message.timestamp));
|
|
25058
|
-
const
|
|
25075
|
+
const paid2 = asks.length ? paidAfter : done2.length > 0;
|
|
25076
|
+
const state = paid2 ? "paid-mentioned" : asks.length ? "asked" : "mentioned";
|
|
25059
25077
|
const cited = asks.length ? [...asks, ...paidAfter ? done2.slice(-1) : []] : rows;
|
|
25060
25078
|
return {
|
|
25061
25079
|
signal: "amounts",
|
|
@@ -25076,10 +25094,10 @@ var amounts = {
|
|
|
25076
25094
|
};
|
|
25077
25095
|
});
|
|
25078
25096
|
}, "read"),
|
|
25079
|
-
attention: /* @__PURE__ */ __name((items) => items.flatMap((item2) => item2.chat !== null && item2.data.state === "
|
|
25097
|
+
attention: /* @__PURE__ */ __name((items) => items.flatMap((item2) => item2.chat !== null && item2.data.state === "asked" ? [{ chat: item2.chat, weight: 2, why: "money asked" }] : []), "attention")
|
|
25080
25098
|
};
|
|
25081
25099
|
|
|
25082
|
-
// 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
|
|
25083
25101
|
var children = {
|
|
25084
25102
|
id: "children",
|
|
25085
25103
|
version: 1,
|
|
@@ -25108,7 +25126,7 @@ var children = {
|
|
|
25108
25126
|
}, "read")
|
|
25109
25127
|
};
|
|
25110
25128
|
|
|
25111
|
-
// 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
|
|
25112
25130
|
var coverage = {
|
|
25113
25131
|
id: "coverage",
|
|
25114
25132
|
version: 1,
|
|
@@ -25137,7 +25155,7 @@ var coverage = {
|
|
|
25137
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")
|
|
25138
25156
|
};
|
|
25139
25157
|
|
|
25140
|
-
// 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
|
|
25141
25159
|
var holding = /* @__PURE__ */ __name((row) => row.review !== "rejected", "holding");
|
|
25142
25160
|
var item = /* @__PURE__ */ __name((row, at, data) => ({
|
|
25143
25161
|
signal: "payments",
|
|
@@ -25179,15 +25197,15 @@ var payments = {
|
|
|
25179
25197
|
scope: "project",
|
|
25180
25198
|
read: /* @__PURE__ */ __name(async (context2) => {
|
|
25181
25199
|
const projects = [context2.project.ref, ...context2.project.children.map((child) => child.ref)];
|
|
25182
|
-
const rows = await Promise.all(projects.map(async (
|
|
25183
|
-
...(await context2.store.finance.payments({ project
|
|
25184
|
-
...(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)
|
|
25185
25203
|
]));
|
|
25186
25204
|
return rows.flat();
|
|
25187
25205
|
}, "read")
|
|
25188
25206
|
};
|
|
25189
25207
|
|
|
25190
|
-
// 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
|
|
25191
25209
|
var PATTERNS_PER_CHAT = 3;
|
|
25192
25210
|
var DAY3 = 864e5;
|
|
25193
25211
|
var KINDS2 = /* @__PURE__ */ new Set(["promise", "request"]);
|
|
@@ -25207,7 +25225,7 @@ var tasksOf = /* @__PURE__ */ __name(async (context2) => {
|
|
|
25207
25225
|
const projects = [context2.project.ref, ...context2.project.children.map((child) => child.ref)];
|
|
25208
25226
|
const accounts = new Map(context2.chats.map((chat) => [taskAccount(chat.account), chat.account]));
|
|
25209
25227
|
const inboxes = [...accounts.keys()].map(inboxKey);
|
|
25210
|
-
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)));
|
|
25211
25229
|
const projectRefs = new Set(projects);
|
|
25212
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);
|
|
25213
25231
|
}, "tasksOf");
|
|
@@ -25252,7 +25270,7 @@ var promises = {
|
|
|
25252
25270
|
scope: "project",
|
|
25253
25271
|
read: /* @__PURE__ */ __name(async (context2) => {
|
|
25254
25272
|
const projects = [context2.project.ref, ...context2.project.children.map((child) => child.ref)];
|
|
25255
|
-
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");
|
|
25256
25274
|
return [
|
|
25257
25275
|
...(await tasksOf(context2)).map((task2) => taskItem2(context2, task2)),
|
|
25258
25276
|
...facts.map((fact) => ({
|
|
@@ -25276,7 +25294,7 @@ var promises = {
|
|
|
25276
25294
|
}, "read")
|
|
25277
25295
|
};
|
|
25278
25296
|
|
|
25279
|
-
// 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
|
|
25280
25298
|
var PER_SIDE = 5;
|
|
25281
25299
|
var WEEK = 7 * 864e5;
|
|
25282
25300
|
var NOBODY = /* @__PURE__ */ new Set();
|
|
@@ -25307,7 +25325,7 @@ var questions2 = {
|
|
|
25307
25325
|
}, "attention")
|
|
25308
25326
|
};
|
|
25309
25327
|
|
|
25310
|
-
// 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
|
|
25311
25329
|
var targetOf = /* @__PURE__ */ __name((message, chat, owners) => {
|
|
25312
25330
|
const byId2 = /* @__PURE__ */ __name((id2) => chat.messages.find((one) => one.id === id2), "byId");
|
|
25313
25331
|
const quoted = message.replyTo ?? (message.replyToId === void 0 ? void 0 : byId2(message.replyToId));
|
|
@@ -25375,7 +25393,7 @@ var replyNext = {
|
|
|
25375
25393
|
attention: /* @__PURE__ */ __name((items) => items.flatMap((item2) => item2.chat !== null && item2.data.next === "owner" ? [{ chat: item2.chat, weight: 2, why: "your move" }] : []), "attention")
|
|
25376
25394
|
};
|
|
25377
25395
|
|
|
25378
|
-
// 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
|
|
25379
25397
|
var escaped = /* @__PURE__ */ __name((text2) => text2.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), "escaped");
|
|
25380
25398
|
var wholeWord = /* @__PURE__ */ __name((word) => new RegExp(`(?<![\\p{L}\\p{N}])${escaped(word)}(?![\\p{L}\\p{N}])`, "u"), "wholeWord");
|
|
25381
25399
|
var matcherOf = /* @__PURE__ */ __name((query) => {
|
|
@@ -25421,7 +25439,7 @@ var topics = {
|
|
|
25421
25439
|
}, "read")
|
|
25422
25440
|
};
|
|
25423
25441
|
|
|
25424
|
-
// 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
|
|
25425
25443
|
var STATUS_SIGNALS = [
|
|
25426
25444
|
replyNext,
|
|
25427
25445
|
questions2,
|
|
@@ -25433,7 +25451,7 @@ var STATUS_SIGNALS = [
|
|
|
25433
25451
|
children
|
|
25434
25452
|
];
|
|
25435
25453
|
|
|
25436
|
-
// 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
|
|
25437
25455
|
var DAY4 = 864e5;
|
|
25438
25456
|
var STATUS_WINDOW = 300;
|
|
25439
25457
|
var STATUS_CHATS = 16;
|
|
@@ -25478,17 +25496,23 @@ var childrenOf = /* @__PURE__ */ __name(async (store, root, catalog) => {
|
|
|
25478
25496
|
}, "childrenOf");
|
|
25479
25497
|
var inAccounts = /* @__PURE__ */ __name((accounts, provider, account) => accounts === void 0 || accounts.some((one) => one.provider === provider && one.account === account), "inAccounts");
|
|
25480
25498
|
var failure = /* @__PURE__ */ __name((error) => error instanceof Error ? error.message : String(error), "failure");
|
|
25481
|
-
var
|
|
25482
|
-
const
|
|
25483
|
-
|
|
25484
|
-
|
|
25485
|
-
|
|
25499
|
+
var owed = /* @__PURE__ */ __name((item2) => {
|
|
25500
|
+
const data = item2.data;
|
|
25501
|
+
return item2.signal === "payments" && data.state === "expected" && data.status === "confirmed";
|
|
25502
|
+
}, "owed");
|
|
25503
|
+
var keepsBooks = /* @__PURE__ */ __name(async (store, projects) => {
|
|
25504
|
+
for (const project of projects) {
|
|
25505
|
+
const filter = { project, review: "confirmed", limit: 1 };
|
|
25506
|
+
if ((await store.finance.invoices(filter)).length || (await store.finance.payments(filter)).length)
|
|
25507
|
+
return true;
|
|
25508
|
+
}
|
|
25509
|
+
return false;
|
|
25510
|
+
}, "keepsBooks");
|
|
25486
25511
|
var totalsOf = /* @__PURE__ */ __name((items) => {
|
|
25487
25512
|
const totals = /* @__PURE__ */ new Map();
|
|
25488
|
-
const open7 = counted2(items);
|
|
25489
25513
|
for (const item2 of items) {
|
|
25490
25514
|
const data = item2.data;
|
|
25491
|
-
if (!
|
|
25515
|
+
if (!owed(item2) || data.amount === void 0)
|
|
25492
25516
|
continue;
|
|
25493
25517
|
const key = `${data.direction}|${data.currency ?? ""}`;
|
|
25494
25518
|
const total = totals.get(key) ?? {
|
|
@@ -25521,11 +25545,11 @@ var projectStatus = /* @__PURE__ */ __name(async (store, input) => {
|
|
|
25521
25545
|
const { children: children2, cut } = await childrenOf(store, root, catalog);
|
|
25522
25546
|
const outOfScope = [];
|
|
25523
25547
|
const linked = /* @__PURE__ */ new Map();
|
|
25524
|
-
for (const
|
|
25525
|
-
for (const link4 of await linkedChatsOf(store,
|
|
25548
|
+
for (const project of [root, ...children2])
|
|
25549
|
+
for (const link4 of await linkedChatsOf(store, project.ref)) {
|
|
25526
25550
|
const chat = formatReference({ type: "chat", provider: link4.provider, account: link4.account, chat: link4.chat });
|
|
25527
25551
|
if (!linked.has(chat))
|
|
25528
|
-
linked.set(chat, { ...link4, project:
|
|
25552
|
+
linked.set(chat, { ...link4, project: project.ref });
|
|
25529
25553
|
}
|
|
25530
25554
|
const chosen = [];
|
|
25531
25555
|
for (const [chat, link4] of linked) {
|
|
@@ -25571,6 +25595,7 @@ var projectStatus = /* @__PURE__ */ __name(async (store, input) => {
|
|
|
25571
25595
|
chats,
|
|
25572
25596
|
project: { ...root, children: children2, cut },
|
|
25573
25597
|
store,
|
|
25598
|
+
books: await keepsBooks(store, [root.ref, ...children2.map((child) => child.ref)]),
|
|
25574
25599
|
contextQueries: input.contextQueries ?? []
|
|
25575
25600
|
};
|
|
25576
25601
|
const items = [];
|
|
@@ -25615,16 +25640,16 @@ var projectStatus = /* @__PURE__ */ __name(async (store, input) => {
|
|
|
25615
25640
|
};
|
|
25616
25641
|
}, "projectStatus");
|
|
25617
25642
|
|
|
25618
|
-
// 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
|
|
25619
25644
|
var accountService = /* @__PURE__ */ __name((deps) => {
|
|
25620
25645
|
const online = /* @__PURE__ */ __name(async (command) => {
|
|
25621
25646
|
if (deps.offline)
|
|
25622
25647
|
throw new CliError("validation_error", `\`${command}\` changes the account; not with --offline`);
|
|
25623
25648
|
return deps.connection();
|
|
25624
25649
|
}, "online");
|
|
25625
|
-
const onOneChat = /* @__PURE__ */ __name(async (command, chat, action,
|
|
25650
|
+
const onOneChat = /* @__PURE__ */ __name(async (command, chat, action, write) => {
|
|
25626
25651
|
const connection = await online(command);
|
|
25627
|
-
const act2 =
|
|
25652
|
+
const act2 = write(connection);
|
|
25628
25653
|
const { id: chatId } = await connection.resolve(chat);
|
|
25629
25654
|
const operationId = newOperationId();
|
|
25630
25655
|
await guardedWrite(deps.guard, { operationId, chatId, kind: "account", action }, () => act2(chatId));
|
|
@@ -25687,7 +25712,7 @@ var accountService = /* @__PURE__ */ __name((deps) => {
|
|
|
25687
25712
|
};
|
|
25688
25713
|
}, "accountService");
|
|
25689
25714
|
|
|
25690
|
-
// 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
|
|
25691
25716
|
var MINUTE = 6e4;
|
|
25692
25717
|
var YEAR = 365 * 24 * 60 * MINUTE;
|
|
25693
25718
|
var DELAY = /^(\d+)(m|h|d)$/;
|
|
@@ -25706,12 +25731,12 @@ var sendTime = /* @__PURE__ */ __name((value, now = Date.now(), flag = "--at-tim
|
|
|
25706
25731
|
return new Date(at - at % MINUTE).toISOString();
|
|
25707
25732
|
}, "sendTime");
|
|
25708
25733
|
|
|
25709
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
25710
|
-
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) => {
|
|
25711
25736
|
try {
|
|
25712
25737
|
const held = await accountStoreIfOpen(deps);
|
|
25713
25738
|
if (held)
|
|
25714
|
-
await
|
|
25739
|
+
await write(held);
|
|
25715
25740
|
} catch (error) {
|
|
25716
25741
|
const reason = error instanceof Error ? error.message : String(error);
|
|
25717
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 });
|
|
@@ -25852,21 +25877,21 @@ var adminService = /* @__PURE__ */ __name((deps) => {
|
|
|
25852
25877
|
const answerAll = capability(connection, "answerAllJoinRequests", "answer every join request at once");
|
|
25853
25878
|
const { id: chatId } = await connection.resolve(chat);
|
|
25854
25879
|
const page = await list2(chatId, { limit: 100, ...link4 === void 0 ? {} : { link: link4 } });
|
|
25855
|
-
const
|
|
25880
|
+
const counted2 = page.total ?? page.items.length;
|
|
25856
25881
|
if (page.total === void 0 && page.hasMore)
|
|
25857
25882
|
throw new CliError("validation_error", "too many requests to count; answer them by person, or by --link");
|
|
25858
|
-
if (
|
|
25859
|
-
return { chatId, accepted: accept, counted:
|
|
25883
|
+
if (counted2 === 0)
|
|
25884
|
+
return { chatId, accepted: accept, counted: counted2 };
|
|
25860
25885
|
const operationId = newOperationId();
|
|
25861
25886
|
await guardedWrite(deps.guard, {
|
|
25862
25887
|
operationId,
|
|
25863
25888
|
chatId,
|
|
25864
25889
|
kind: "chat",
|
|
25865
25890
|
action: accept ? "requests.accept" : "requests.decline",
|
|
25866
|
-
count:
|
|
25867
|
-
people:
|
|
25891
|
+
count: counted2,
|
|
25892
|
+
people: counted2
|
|
25868
25893
|
}, () => answerAll(chatId, accept, link4));
|
|
25869
|
-
return { operationId, chatId, accepted: accept, counted:
|
|
25894
|
+
return { operationId, chatId, accepted: accept, counted: counted2 };
|
|
25870
25895
|
}, "answerAllRequests"),
|
|
25871
25896
|
links: /* @__PURE__ */ __name(async (chat, window3) => {
|
|
25872
25897
|
if (deps.offline)
|
|
@@ -25953,7 +25978,7 @@ var linkLimits = /* @__PURE__ */ __name(({ approval, expires, maxUses }) => {
|
|
|
25953
25978
|
return expires === void 0 ? void 0 : sendTime(expires, Date.now(), "--expire-time");
|
|
25954
25979
|
}, "linkLimits");
|
|
25955
25980
|
|
|
25956
|
-
// 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
|
|
25957
25982
|
var THREADS_PAGE = 500;
|
|
25958
25983
|
var threadsOf = /* @__PURE__ */ __name(async (store, key) => {
|
|
25959
25984
|
const account = await store.accounts.storedAccount(key).catch(() => void 0);
|
|
@@ -26032,7 +26057,7 @@ var readMail = /* @__PURE__ */ __name(async (store, locator, { before: before2 =
|
|
|
26032
26057
|
return thread.slice(Math.max(0, at - before2), at + after + 1).map((hit) => hit.id === message ? { ...hit, anchor: true } : hit);
|
|
26033
26058
|
}, "readMail");
|
|
26034
26059
|
|
|
26035
|
-
// 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
|
|
26036
26061
|
var NO_MAIL = "no_mail";
|
|
26037
26062
|
var MAIL = "email";
|
|
26038
26063
|
var listContextOf = /* @__PURE__ */ __name(async (store, account, app, stored) => {
|
|
@@ -26079,7 +26104,7 @@ var accountsOfKind = /* @__PURE__ */ __name((kind, chosen, held, explicit, comma
|
|
|
26079
26104
|
return chosenMail.map(({ provider, account }) => ({ provider, account }));
|
|
26080
26105
|
}, "accountsOfKind");
|
|
26081
26106
|
|
|
26082
|
-
// 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
|
|
26083
26108
|
var MAIL_FIELDS = /* @__PURE__ */ new Set(["to", "cc", "bcc", "subject", "mailbox", "label", "is"]);
|
|
26084
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");
|
|
26085
26110
|
var prepareLucene = /* @__PURE__ */ __name(async (store, account, request, messenger) => {
|
|
@@ -26254,9 +26279,9 @@ var stemsNotReady = /* @__PURE__ */ __name((state, command) => {
|
|
|
26254
26279
|
}, "stemsNotReady");
|
|
26255
26280
|
var indexNotReady = /* @__PURE__ */ __name(async (store, command) => {
|
|
26256
26281
|
const state = await store.searchIndex.searchIndexState();
|
|
26257
|
-
const
|
|
26282
|
+
const migrate = `\`${command ? `${command} ` : ""}store migrate\``;
|
|
26258
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})`;
|
|
26259
|
-
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" });
|
|
26260
26285
|
}, "indexNotReady");
|
|
26261
26286
|
var coverageOf = /* @__PURE__ */ __name(async (store, { scopeAccounts, selectedChat }, messenger = {}) => {
|
|
26262
26287
|
const completeness = [];
|
|
@@ -26427,7 +26452,7 @@ var statsLucene = /* @__PURE__ */ __name(async (store, account, request, messeng
|
|
|
26427
26452
|
};
|
|
26428
26453
|
}, "statsLucene");
|
|
26429
26454
|
|
|
26430
|
-
// 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
|
|
26431
26456
|
var RANKING_SELECTION_BYTES = 64 * 1024;
|
|
26432
26457
|
var object = /* @__PURE__ */ __name((value) => value !== null && typeof value === "object" && !Array.isArray(value) ? value : void 0, "object");
|
|
26433
26458
|
function invalid(message = "ranking selection is invalid \u2014 obtain a new drilldown from stats top") {
|
|
@@ -26596,7 +26621,7 @@ var readRankingSelection = /* @__PURE__ */ __name(async (store, input) => {
|
|
|
26596
26621
|
};
|
|
26597
26622
|
}, "readRankingSelection");
|
|
26598
26623
|
|
|
26599
|
-
// 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
|
|
26600
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");
|
|
26601
26626
|
var searchRecordOf = /* @__PURE__ */ __name((command, params) => ({
|
|
26602
26627
|
command,
|
|
@@ -26606,7 +26631,7 @@ var searchRecordOf = /* @__PURE__ */ __name((command, params) => ({
|
|
|
26606
26631
|
fieldsVersion: FIELD_VERSION
|
|
26607
26632
|
}), "searchRecordOf");
|
|
26608
26633
|
|
|
26609
|
-
// 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
|
|
26610
26635
|
function invalid2(message) {
|
|
26611
26636
|
throw new CliError("validation_error", message);
|
|
26612
26637
|
}
|
|
@@ -26900,7 +26925,7 @@ var adminStatisticsService = /* @__PURE__ */ __name((deps) => ({
|
|
|
26900
26925
|
}, "evidence")
|
|
26901
26926
|
}), "adminStatisticsService");
|
|
26902
26927
|
|
|
26903
|
-
// 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
|
|
26904
26929
|
import { createHash as createHash7, randomUUID as randomUUID4 } from "node:crypto";
|
|
26905
26930
|
var GAP_BOUNDS = { maxGaps: 5, limit: 500, timeMs: 3e4 };
|
|
26906
26931
|
var validateRepair = /* @__PURE__ */ __name((messenger, options) => {
|
|
@@ -27037,16 +27062,16 @@ var gapsService = /* @__PURE__ */ __name((deps) => {
|
|
|
27037
27062
|
return { plan, repair };
|
|
27038
27063
|
}, "gapsService");
|
|
27039
27064
|
|
|
27040
|
-
// 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
|
|
27041
27066
|
import { createHash as createHash9 } from "node:crypto";
|
|
27042
27067
|
import { constants as constants2, mkdirSync as mkdirSync2 } from "node:fs";
|
|
27043
27068
|
import { lstat as lstat4, open as open6, readFile, stat as stat2 } from "node:fs/promises";
|
|
27044
27069
|
|
|
27045
|
-
// 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
|
|
27046
27071
|
import { lstat as lstat2, readdir as readdir2, realpath as realpath3 } from "node:fs/promises";
|
|
27047
27072
|
import { basename as basename4, join as join8, relative as relative2, sep as sep2 } from "node:path";
|
|
27048
27073
|
|
|
27049
|
-
// 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
|
|
27050
27075
|
import { openAsBlob, realpathSync } from "node:fs";
|
|
27051
27076
|
import { open as open4, stat } from "node:fs/promises";
|
|
27052
27077
|
import { basename as basename3, dirname as dirname3, extname, isAbsolute as isAbsolute2, relative, resolve as resolve5, sep } from "node:path";
|
|
@@ -27213,7 +27238,7 @@ var checkFilename = /* @__PURE__ */ __name((filename, files) => {
|
|
|
27213
27238
|
throw new CliError("validation_error", "--filename is a name, not a path: no / or \\, at most 255 characters");
|
|
27214
27239
|
}, "checkFilename");
|
|
27215
27240
|
var listOf2 = /* @__PURE__ */ __name((value) => value === void 0 ? [] : typeof value === "string" ? [value] : value, "listOf");
|
|
27216
|
-
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) => {
|
|
27217
27242
|
const photos = listOf2(photo);
|
|
27218
27243
|
const files = listOf2(file);
|
|
27219
27244
|
if (voice !== void 0 && (photos.length > 0 || files.length > 0 || (text2 ?? "").trim() !== "")) {
|
|
@@ -27225,21 +27250,21 @@ var readAttachments = /* @__PURE__ */ __name(async ({ photo, file, voice, asFile
|
|
|
27225
27250
|
checkFilename(filename, files);
|
|
27226
27251
|
const uploads = [];
|
|
27227
27252
|
for (const one of photos)
|
|
27228
|
-
uploads.push(await readUpload("photo", one,
|
|
27253
|
+
uploads.push(await readUpload("photo", one, read));
|
|
27229
27254
|
for (const one of files)
|
|
27230
27255
|
uploads.push({
|
|
27231
|
-
...await readUpload("file", one,
|
|
27256
|
+
...await readUpload("file", one, read),
|
|
27232
27257
|
...filename === void 0 ? {} : { name: filename },
|
|
27233
27258
|
...asFile ? { asFile: true } : {}
|
|
27234
27259
|
});
|
|
27235
27260
|
if (voice !== void 0)
|
|
27236
|
-
uploads.push(await readUpload("voice", voice,
|
|
27261
|
+
uploads.push(await readUpload("voice", voice, read));
|
|
27237
27262
|
return uploads;
|
|
27238
27263
|
}, "readAttachments");
|
|
27239
|
-
var readStickerFile = /* @__PURE__ */ __name(async (path, maxBytes,
|
|
27264
|
+
var readStickerFile = /* @__PURE__ */ __name(async (path, maxBytes, read) => {
|
|
27240
27265
|
if (extname(path).toLowerCase() !== ".webp")
|
|
27241
27266
|
throw new CliError("validation_error", `a sticker is a .webp \u2014 send ${path} as a photo or a file instead`);
|
|
27242
|
-
const { name, source } = await readUpload("file", path,
|
|
27267
|
+
const { name, source } = await readUpload("file", path, read);
|
|
27243
27268
|
if (SIGNATURES[".webp"]?.(await fileHead(path)) !== true)
|
|
27244
27269
|
throw new CliError("validation_error", `${path} is named .webp but is not a WebP image \u2014 nothing was sent`);
|
|
27245
27270
|
const size2 = uploadSize(source);
|
|
@@ -27248,7 +27273,7 @@ var readStickerFile = /* @__PURE__ */ __name(async (path, maxBytes, read2) => {
|
|
|
27248
27273
|
return { name, source };
|
|
27249
27274
|
}, "readStickerFile");
|
|
27250
27275
|
|
|
27251
|
-
// 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
|
|
27252
27277
|
var MAX_FILES = 1e4;
|
|
27253
27278
|
var directoryPaths = /* @__PURE__ */ __name(async (store, chat, directory2, app, env) => {
|
|
27254
27279
|
if (refusedPlace(directory2, app, env))
|
|
@@ -27317,15 +27342,15 @@ var directoryPaths = /* @__PURE__ */ __name(async (store, chat, directory2, app,
|
|
|
27317
27342
|
return choices;
|
|
27318
27343
|
}, "directoryPaths");
|
|
27319
27344
|
|
|
27320
|
-
// 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
|
|
27321
27346
|
import { posix } from "node:path";
|
|
27322
27347
|
|
|
27323
|
-
// 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
|
|
27324
27349
|
import { setImmediate as tick } from "node:timers/promises";
|
|
27325
27350
|
import { crc32 } from "node:zlib";
|
|
27326
27351
|
var import_xmldom = __toESM(require_lib(), 1);
|
|
27327
27352
|
|
|
27328
|
-
// 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
|
|
27329
27354
|
var import_chardet = __toESM(require_lib2(), 1);
|
|
27330
27355
|
var import_iconv_lite = __toESM(require_lib3(), 1);
|
|
27331
27356
|
var SAMPLE = 65536;
|
|
@@ -27427,7 +27452,7 @@ var decodeXml = /* @__PURE__ */ __name((bytes2) => {
|
|
|
27427
27452
|
return result.text;
|
|
27428
27453
|
}, "decodeXml");
|
|
27429
27454
|
|
|
27430
|
-
// 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
|
|
27431
27456
|
var MAX_PART = 10 * 1024 * 1024;
|
|
27432
27457
|
var MAX_ENTRIES = 1e3;
|
|
27433
27458
|
var decoder = new TextDecoder("utf-8", { fatal: true });
|
|
@@ -27642,7 +27667,7 @@ var elements = /* @__PURE__ */ __name((node, name, namespace) => {
|
|
|
27642
27667
|
return found;
|
|
27643
27668
|
}, "elements");
|
|
27644
27669
|
|
|
27645
|
-
// 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
|
|
27646
27671
|
var columnName = /* @__PURE__ */ __name((column) => {
|
|
27647
27672
|
let name = "";
|
|
27648
27673
|
for (let rest = column; rest > 0; rest = Math.floor((rest - 1) / 26))
|
|
@@ -27697,7 +27722,7 @@ var sheetText = /* @__PURE__ */ __name((sheets2, maxChars = MAX_TEXT_CHARS) => {
|
|
|
27697
27722
|
return { text: parts.join("").trim(), truncated: false };
|
|
27698
27723
|
}, "sheetText");
|
|
27699
27724
|
|
|
27700
|
-
// 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
|
|
27701
27726
|
var OFFICE = "urn:oasis:names:tc:opendocument:xmlns:office:1.0";
|
|
27702
27727
|
var TEXT = "urn:oasis:names:tc:opendocument:xmlns:text:1.0";
|
|
27703
27728
|
var TABLE = "urn:oasis:names:tc:opendocument:xmlns:table:1.0";
|
|
@@ -28097,10 +28122,10 @@ var readDocument = /* @__PURE__ */ __name(async (bytes2, kind, signal) => {
|
|
|
28097
28122
|
}
|
|
28098
28123
|
}, "readDocument");
|
|
28099
28124
|
|
|
28100
|
-
// 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
|
|
28101
28126
|
import { extname as extname3 } from "node:path";
|
|
28102
28127
|
|
|
28103
|
-
// 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
|
|
28104
28129
|
import { readFileSync } from "node:fs";
|
|
28105
28130
|
import { dirname as dirname4, extname as extname2, join as join9 } from "node:path";
|
|
28106
28131
|
import { fileURLToPath } from "node:url";
|
|
@@ -28123,7 +28148,7 @@ var versionOf = /* @__PURE__ */ __name((name) => {
|
|
|
28123
28148
|
}
|
|
28124
28149
|
return name;
|
|
28125
28150
|
}, "versionOf");
|
|
28126
|
-
var withEngine = /* @__PURE__ */ __name(async (load, name,
|
|
28151
|
+
var withEngine = /* @__PURE__ */ __name(async (load, name, read) => {
|
|
28127
28152
|
let engine;
|
|
28128
28153
|
try {
|
|
28129
28154
|
const loaded2 = await load(name);
|
|
@@ -28135,7 +28160,7 @@ var withEngine = /* @__PURE__ */ __name(async (load, name, read2) => {
|
|
|
28135
28160
|
}
|
|
28136
28161
|
const extractor = `${name === "mammoth" ? "docx" : name === "word-extractor" ? "doc" : "pdf"}:${versionOf(name)}`;
|
|
28137
28162
|
try {
|
|
28138
|
-
return await
|
|
28163
|
+
return await read(engine, extractor);
|
|
28139
28164
|
} catch (error) {
|
|
28140
28165
|
if (error instanceof ReaderLimit)
|
|
28141
28166
|
return { status: "too-large" };
|
|
@@ -28147,12 +28172,12 @@ var withEngine = /* @__PURE__ */ __name(async (load, name, read2) => {
|
|
|
28147
28172
|
var startsWith = /* @__PURE__ */ __name((bytes2, magic) => bytes2.length >= magic.length && [...magic].every((char, index) => bytes2[index] === char.charCodeAt(0)), "startsWith");
|
|
28148
28173
|
var extensionOf = /* @__PURE__ */ __name(({ name, path }) => extname2(name ?? path).toLowerCase(), "extensionOf");
|
|
28149
28174
|
var capped2 = /* @__PURE__ */ __name((text2) => text2.length > MAX_TEXT_CHARS ? text2.slice(0, MAX_TEXT_CHARS) : text2, "capped");
|
|
28150
|
-
var derived = /* @__PURE__ */ __name((bytes2, extractor,
|
|
28175
|
+
var derived = /* @__PURE__ */ __name((bytes2, extractor, read) => {
|
|
28151
28176
|
const decoded = decodeText(bytes2);
|
|
28152
28177
|
if ("error" in decoded)
|
|
28153
28178
|
return { status: "unreadable", extractor, error: decoded.error };
|
|
28154
28179
|
try {
|
|
28155
|
-
const text2 =
|
|
28180
|
+
const text2 = read(decoded.text);
|
|
28156
28181
|
return text2 === "" ? { status: "needs-agent", extractor } : { status: "extracted", text: capped2(text2), extractor };
|
|
28157
28182
|
} catch (error) {
|
|
28158
28183
|
if (error instanceof ReaderLimit)
|
|
@@ -28161,7 +28186,7 @@ var derived = /* @__PURE__ */ __name((bytes2, extractor, read2) => {
|
|
|
28161
28186
|
}
|
|
28162
28187
|
}, "derived");
|
|
28163
28188
|
|
|
28164
|
-
// 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
|
|
28165
28190
|
var IMAGES = /* @__PURE__ */ new Set([".jpg", ".jpeg", ".png", ".webp", ".gif", ".heic", ".tif", ".tiff", ".bmp"]);
|
|
28166
28191
|
var image2 = {
|
|
28167
28192
|
id: "image",
|
|
@@ -28170,7 +28195,7 @@ var image2 = {
|
|
|
28170
28195
|
read: /* @__PURE__ */ __name(async () => ({ status: "needs-agent" }), "read")
|
|
28171
28196
|
};
|
|
28172
28197
|
|
|
28173
|
-
// 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
|
|
28174
28199
|
var OLE = "\xD0\xCF\xE0\xA1\xB1\xE1";
|
|
28175
28200
|
var doc = {
|
|
28176
28201
|
id: "doc",
|
|
@@ -28182,7 +28207,7 @@ var doc = {
|
|
|
28182
28207
|
}), "read")
|
|
28183
28208
|
};
|
|
28184
28209
|
|
|
28185
|
-
// 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
|
|
28186
28211
|
var DOCX = "application/vnd.openxmlformats-officedocument.wordprocessingml.document";
|
|
28187
28212
|
var docx = {
|
|
28188
28213
|
id: "docx",
|
|
@@ -28195,7 +28220,7 @@ var docx = {
|
|
|
28195
28220
|
}), "read")
|
|
28196
28221
|
};
|
|
28197
28222
|
|
|
28198
|
-
// 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
|
|
28199
28224
|
var import_iconv_lite2 = __toESM(require_lib3(), 1);
|
|
28200
28225
|
var RTF_SKIPPED = /* @__PURE__ */ new Set([
|
|
28201
28226
|
"fonttbl",
|
|
@@ -28371,7 +28396,7 @@ var htmlText = /* @__PURE__ */ __name((source) => {
|
|
|
28371
28396
|
}, "htmlText");
|
|
28372
28397
|
var safeChar = /* @__PURE__ */ __name((code, fallback) => code > 0 && code <= 1114111 ? String.fromCodePoint(code) : fallback, "safeChar");
|
|
28373
28398
|
|
|
28374
|
-
// 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
|
|
28375
28400
|
var clean = /* @__PURE__ */ __name((value) => typeof value === "string" ? value.replace(/\s+/g, " ").trim() : "", "clean");
|
|
28376
28401
|
var namesIn = /* @__PURE__ */ __name((value) => [value].flat().map((entry) => typeof entry === "string" ? clean(entry) : clean(entry?.name)).filter(Boolean).join(", "), "namesIn");
|
|
28377
28402
|
var jsonLdNodes = /* @__PURE__ */ __name((document) => {
|
|
@@ -28427,7 +28452,7 @@ var markdownSections = /* @__PURE__ */ __name((text2) => {
|
|
|
28427
28452
|
return found.map((section, index) => ({ ...section, end: found[index + 1]?.start ?? text2.length }));
|
|
28428
28453
|
}, "markdownSections");
|
|
28429
28454
|
|
|
28430
|
-
// 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
|
|
28431
28456
|
var HTML = /* @__PURE__ */ new Set([".html", ".htm", ".xhtml"]);
|
|
28432
28457
|
var first = /* @__PURE__ */ __name((...values) => values.find((value) => typeof value === "string" && value !== ""), "first");
|
|
28433
28458
|
var loaded = /* @__PURE__ */ __name(async (load, name) => {
|
|
@@ -28498,7 +28523,7 @@ var html = {
|
|
|
28498
28523
|
}, "read")
|
|
28499
28524
|
};
|
|
28500
28525
|
|
|
28501
|
-
// 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
|
|
28502
28527
|
var office = {
|
|
28503
28528
|
id: "office",
|
|
28504
28529
|
version: documentExtractor("odt"),
|
|
@@ -28509,7 +28534,7 @@ var office = {
|
|
|
28509
28534
|
}, "read")
|
|
28510
28535
|
};
|
|
28511
28536
|
|
|
28512
|
-
// 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
|
|
28513
28538
|
var pdf = {
|
|
28514
28539
|
id: "pdf",
|
|
28515
28540
|
version: "unpdf",
|
|
@@ -28576,7 +28601,7 @@ var pdf = {
|
|
|
28576
28601
|
}), "read")
|
|
28577
28602
|
};
|
|
28578
28603
|
|
|
28579
|
-
// 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
|
|
28580
28605
|
var PLAIN = /* @__PURE__ */ new Set([".txt", ".md", ".markdown", ".csv", ".tsv", ".json", ".log"]);
|
|
28581
28606
|
var isPlain = /* @__PURE__ */ __name((hint) => PLAIN.has(extensionOf(hint)) || hint.mime?.startsWith("text/") || hint.mime === "application/json", "isPlain");
|
|
28582
28607
|
var readPlain = /* @__PURE__ */ __name((bytes2) => {
|
|
@@ -28596,7 +28621,7 @@ var plain = {
|
|
|
28596
28621
|
read: /* @__PURE__ */ __name(async (bytes2) => readPlain(bytes2), "read")
|
|
28597
28622
|
};
|
|
28598
28623
|
|
|
28599
|
-
// 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
|
|
28600
28625
|
var rtf = {
|
|
28601
28626
|
id: "rtf",
|
|
28602
28627
|
version: "v1",
|
|
@@ -28604,10 +28629,10 @@ var rtf = {
|
|
|
28604
28629
|
read: /* @__PURE__ */ __name(async (bytes2) => derived(bytes2, "rtf:v1", rtfText), "read")
|
|
28605
28630
|
};
|
|
28606
28631
|
|
|
28607
|
-
// 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
|
|
28608
28633
|
import { basename as basename5 } from "node:path";
|
|
28609
28634
|
|
|
28610
|
-
// 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
|
|
28611
28636
|
var delimitedSpans = /* @__PURE__ */ __name((text2, delimiter, maxCells = 1e4) => {
|
|
28612
28637
|
const cells = [];
|
|
28613
28638
|
let row = 1, column = 1, start = 0, quoted = false, truncated = false;
|
|
@@ -28645,7 +28670,7 @@ var delimitedSpans = /* @__PURE__ */ __name((text2, delimiter, maxCells = 1e4) =
|
|
|
28645
28670
|
return { cells, truncated };
|
|
28646
28671
|
}, "delimitedSpans");
|
|
28647
28672
|
|
|
28648
|
-
// 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
|
|
28649
28674
|
var DELIMITED = {
|
|
28650
28675
|
".csv": ",",
|
|
28651
28676
|
".tsv": " ",
|
|
@@ -28684,7 +28709,7 @@ var sheets = {
|
|
|
28684
28709
|
}, "read")
|
|
28685
28710
|
};
|
|
28686
28711
|
|
|
28687
|
-
// 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
|
|
28688
28713
|
var BUILT_INS2 = [office, pdf, docx, doc, rtf, html, sheets, plain, image2];
|
|
28689
28714
|
var HEAD_BYTES = 1024;
|
|
28690
28715
|
var readers = [...BUILT_INS2];
|
|
@@ -28694,7 +28719,7 @@ var readWithRegistry = /* @__PURE__ */ __name(async (bytes2, hint, context2) =>
|
|
|
28694
28719
|
return reader ? reader.read(bytes2, hint, context2) : { status: "unsupported" };
|
|
28695
28720
|
}, "readWithRegistry");
|
|
28696
28721
|
|
|
28697
|
-
// 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
|
|
28698
28723
|
var importEngine = /* @__PURE__ */ __name((name) => importFrom(new URL("attachments/extract.js", import.meta.resolve("@wirecat/cli-core")).href, name), "importEngine");
|
|
28699
28724
|
var extensionOf2 = /* @__PURE__ */ __name(({ name, path }) => extname3(name ?? path).toLowerCase(), "extensionOf");
|
|
28700
28725
|
var extractText = /* @__PURE__ */ __name(async (bytes2, hint, load, signal, env = process.env) => {
|
|
@@ -29773,7 +29798,7 @@ function imageSize(input) {
|
|
|
29773
29798
|
}
|
|
29774
29799
|
__name(imageSize, "imageSize");
|
|
29775
29800
|
|
|
29776
|
-
// 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
|
|
29777
29802
|
var MAX_PAGES = 20;
|
|
29778
29803
|
var MAX_PIXELS = 2e7;
|
|
29779
29804
|
var cancelled2 = /* @__PURE__ */ __name((signal) => {
|
|
@@ -29924,7 +29949,7 @@ var ocrPdf = /* @__PURE__ */ __name(async (bytes2, pipeline2, load, signal) => {
|
|
|
29924
29949
|
}
|
|
29925
29950
|
}, "ocrPdf");
|
|
29926
29951
|
|
|
29927
|
-
// 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
|
|
29928
29953
|
var pdfPreview = /* @__PURE__ */ __name(async (bytes2, page, signal, load = importEngine, env = process.env) => {
|
|
29929
29954
|
const limits = pdfPreviewLimits(env);
|
|
29930
29955
|
const cancelled4 = /* @__PURE__ */ __name(() => {
|
|
@@ -30001,7 +30026,7 @@ var pdfPreview = /* @__PURE__ */ __name(async (bytes2, page, signal, load = impo
|
|
|
30001
30026
|
}
|
|
30002
30027
|
}, "pdfPreview");
|
|
30003
30028
|
|
|
30004
|
-
// 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
|
|
30005
30030
|
import { createHash as createHash8 } from "node:crypto";
|
|
30006
30031
|
import { constants } from "node:fs";
|
|
30007
30032
|
import { lstat as lstat3, open as open5 } from "node:fs/promises";
|
|
@@ -30109,7 +30134,7 @@ var transferMime = /* @__PURE__ */ __name((head, hint, name = null) => {
|
|
|
30109
30134
|
return hint !== null && /^[a-z0-9.+-]+\/[a-z0-9.+-]+$/i.test(hint) ? hint : "application/octet-stream";
|
|
30110
30135
|
}, "transferMime");
|
|
30111
30136
|
|
|
30112
|
-
// 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
|
|
30113
30138
|
import { createWriteStream, mkdirSync } from "node:fs";
|
|
30114
30139
|
import { link as link3, rm } from "node:fs/promises";
|
|
30115
30140
|
import { join as join10, resolve as resolve6 } from "node:path";
|
|
@@ -30223,7 +30248,7 @@ var save = /* @__PURE__ */ __name(async (file, directory2, fallbackName, { uniqu
|
|
|
30223
30248
|
}
|
|
30224
30249
|
}, "save");
|
|
30225
30250
|
|
|
30226
|
-
// 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
|
|
30227
30252
|
var ATTACHMENT_QUERY = {
|
|
30228
30253
|
entity: "attachment",
|
|
30229
30254
|
backend: "sql",
|
|
@@ -30377,7 +30402,7 @@ var attachmentsService = /* @__PURE__ */ __name((deps) => ({
|
|
|
30377
30402
|
};
|
|
30378
30403
|
const batch = batchProgress(deps.env);
|
|
30379
30404
|
const fetched = /* @__PURE__ */ new Set();
|
|
30380
|
-
let
|
|
30405
|
+
let read = 0;
|
|
30381
30406
|
let beforePk = cursor === void 0 ? void 0 : Number(cursor);
|
|
30382
30407
|
let scanned = 0;
|
|
30383
30408
|
const pending = [];
|
|
@@ -30400,12 +30425,12 @@ var attachmentsService = /* @__PURE__ */ __name((deps) => ({
|
|
|
30400
30425
|
if (extraction && bytes2 !== void 0 && (!ocr || status === "extracted") && (status === "extracted" || file.read?.error !== null)) {
|
|
30401
30426
|
if (await keep(store, file, extraction, bytes2, sha) === false) {
|
|
30402
30427
|
run.unchanged += 1;
|
|
30403
|
-
|
|
30428
|
+
read += 1;
|
|
30404
30429
|
return;
|
|
30405
30430
|
}
|
|
30406
30431
|
}
|
|
30407
30432
|
if (status !== "missing" && status !== "too-large" && status !== "engine-missing")
|
|
30408
|
-
|
|
30433
|
+
read += 1;
|
|
30409
30434
|
if (extraction?.status === "engine-missing" && !run.enginesMissing.includes(extraction.engine))
|
|
30410
30435
|
run.enginesMissing.push(extraction.engine);
|
|
30411
30436
|
if (status === "extracted")
|
|
@@ -30461,9 +30486,9 @@ var attachmentsService = /* @__PURE__ */ __name((deps) => ({
|
|
|
30461
30486
|
limit: PAGE3
|
|
30462
30487
|
});
|
|
30463
30488
|
for (const file of page) {
|
|
30464
|
-
while (pending.length && (pending.length >= concurrency || limit !== void 0 &&
|
|
30489
|
+
while (pending.length && (pending.length >= concurrency || limit !== void 0 && read + pending.length >= limit))
|
|
30465
30490
|
await pending.shift();
|
|
30466
|
-
if (batch.stopped || signal?.aborted || limit !== void 0 &&
|
|
30491
|
+
if (batch.stopped || signal?.aborted || limit !== void 0 && read >= limit || scanLimit !== void 0 && scanned >= scanLimit) {
|
|
30467
30492
|
run.complete = false;
|
|
30468
30493
|
if (beforePk !== void 0)
|
|
30469
30494
|
run.cursor = String(beforePk);
|
|
@@ -30646,7 +30671,7 @@ var attachmentsService = /* @__PURE__ */ __name((deps) => ({
|
|
|
30646
30671
|
}, "setText")
|
|
30647
30672
|
}), "attachmentsService");
|
|
30648
30673
|
|
|
30649
|
-
// 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
|
|
30650
30675
|
var chatDocumentsService = /* @__PURE__ */ __name((deps) => ({
|
|
30651
30676
|
list: /* @__PURE__ */ __name(async (chat, { limit, offset, ref }) => {
|
|
30652
30677
|
const store = await accountStore(deps);
|
|
@@ -30676,7 +30701,7 @@ var chatDocumentsService = /* @__PURE__ */ __name((deps) => ({
|
|
|
30676
30701
|
}, "list")
|
|
30677
30702
|
}), "chatDocumentsService");
|
|
30678
30703
|
|
|
30679
|
-
// 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
|
|
30680
30705
|
var observationDuration = /* @__PURE__ */ __name((text2, flag) => {
|
|
30681
30706
|
const match = /^(\d+(?:\.\d+)?)([smhdw])$/.exec(text2);
|
|
30682
30707
|
const units2 = { s: 1e3, m: 6e4, h: 36e5, d: 864e5, w: 6048e5 };
|
|
@@ -30763,7 +30788,7 @@ var isRetentionSelection = /* @__PURE__ */ __name((selection) => {
|
|
|
30763
30788
|
}
|
|
30764
30789
|
}, "isRetentionSelection");
|
|
30765
30790
|
|
|
30766
|
-
// 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
|
|
30767
30792
|
var counterFields = /* @__PURE__ */ __name((text2 = "views,reactions,comments") => {
|
|
30768
30793
|
const fields = text2.split(",").map((one) => one.trim());
|
|
30769
30794
|
if (!fields.length || fields.some((one) => !COUNTER_FIELDS.includes(one)) || new Set(fields).size !== fields.length)
|
|
@@ -30970,7 +30995,7 @@ var countersService = /* @__PURE__ */ __name((deps) => {
|
|
|
30970
30995
|
};
|
|
30971
30996
|
}, "countersService");
|
|
30972
30997
|
|
|
30973
|
-
// 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
|
|
30974
30999
|
var SYNC_KEY = "messages.sync-first";
|
|
30975
31000
|
var SYNC_BOUNDS = { maxChats: 5, timeMs: 3e4, maxMessages: 500 };
|
|
30976
31001
|
var keyOf2 = /* @__PURE__ */ __name((chat) => JSON.stringify([chat.account.provider, chat.account.account, chat.chatId]), "keyOf");
|
|
@@ -31020,7 +31045,7 @@ var refreshSearch = /* @__PURE__ */ __name(async (deps, request) => {
|
|
|
31020
31045
|
const { execution } = await prepareLucene(store, account, request, deps.messenger);
|
|
31021
31046
|
const scoped = execution.chat ? [execution.chat] : chatScope(execution.root);
|
|
31022
31047
|
const options = { ...SYNC_BOUNDS, ...request.syncFirst };
|
|
31023
|
-
const
|
|
31048
|
+
const note = options.note ?? (() => {
|
|
31024
31049
|
});
|
|
31025
31050
|
const result = { chats: [], messages: 0, failed: [], complete: true };
|
|
31026
31051
|
const candidates = [];
|
|
@@ -31062,20 +31087,20 @@ var refreshSearch = /* @__PURE__ */ __name(async (deps, request) => {
|
|
|
31062
31087
|
}
|
|
31063
31088
|
try {
|
|
31064
31089
|
const newest = (await store.messages.messages(account, chatId, { limit: 1 })).items[0];
|
|
31065
|
-
let
|
|
31090
|
+
let counted2 = 0;
|
|
31066
31091
|
const fetched = await archiveService(deps).fetch(chatId, {
|
|
31067
31092
|
limit: options.maxMessages - result.messages,
|
|
31068
31093
|
pageSize: Math.min(100, deps.messenger.fetching?.maxPageSize ?? 100),
|
|
31069
31094
|
pauseMs: parseDuration(deps.messenger.fetching?.pause ?? "1s", "fetch pause"),
|
|
31070
31095
|
...newest ? { sinceMs: Date.parse(newest.timestamp) + 1 } : {},
|
|
31071
31096
|
stop,
|
|
31072
|
-
note
|
|
31097
|
+
note,
|
|
31073
31098
|
onPage: /* @__PURE__ */ __name(({ fetched: fetched2 }) => {
|
|
31074
|
-
result.messages += fetched2 -
|
|
31075
|
-
|
|
31099
|
+
result.messages += fetched2 - counted2;
|
|
31100
|
+
counted2 = fetched2;
|
|
31076
31101
|
}, "onPage")
|
|
31077
31102
|
});
|
|
31078
|
-
result.messages += fetched.fetched -
|
|
31103
|
+
result.messages += fetched.fetched - counted2;
|
|
31079
31104
|
if (fetched.stopped || !fetched.complete && !fetched.reachedSince) {
|
|
31080
31105
|
result.complete = false;
|
|
31081
31106
|
result.failed.push({
|
|
@@ -31093,7 +31118,7 @@ var refreshSearch = /* @__PURE__ */ __name(async (deps, request) => {
|
|
|
31093
31118
|
clearTimeout(timer);
|
|
31094
31119
|
}
|
|
31095
31120
|
if (!result.complete)
|
|
31096
|
-
|
|
31121
|
+
note("refresh incomplete \u2014 the local answer may be stale");
|
|
31097
31122
|
return result;
|
|
31098
31123
|
}, "refreshSearch");
|
|
31099
31124
|
var withRefresh = /* @__PURE__ */ __name((found, refreshed) => ({
|
|
@@ -31102,7 +31127,7 @@ var withRefresh = /* @__PURE__ */ __name((found, refreshed) => ({
|
|
|
31102
31127
|
...!refreshed || refreshed.complete ? {} : { coverage: { ...found.coverage, state: "stale" } }
|
|
31103
31128
|
}), "withRefresh");
|
|
31104
31129
|
|
|
31105
|
-
// 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
|
|
31106
31131
|
var CANDIDATES = 50;
|
|
31107
31132
|
var WORD_HITS = 200;
|
|
31108
31133
|
var RRF_K = 60;
|
|
@@ -31377,13 +31402,13 @@ var meanOf = /* @__PURE__ */ __name((vectors) => {
|
|
|
31377
31402
|
return mean2.map((value) => value / length);
|
|
31378
31403
|
}, "meanOf");
|
|
31379
31404
|
|
|
31380
|
-
// 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
|
|
31381
31406
|
var embeddingsService = /* @__PURE__ */ __name((deps) => ({
|
|
31382
31407
|
...embeddingsMaintenance(deps),
|
|
31383
31408
|
...embeddingsSearch(deps)
|
|
31384
31409
|
}), "embeddingsService");
|
|
31385
31410
|
|
|
31386
|
-
// 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
|
|
31387
31412
|
var foldersService = /* @__PURE__ */ __name((deps) => {
|
|
31388
31413
|
const online = /* @__PURE__ */ __name(async (command) => {
|
|
31389
31414
|
if (deps.offline)
|
|
@@ -31524,7 +31549,7 @@ var foldersService = /* @__PURE__ */ __name((deps) => {
|
|
|
31524
31549
|
};
|
|
31525
31550
|
}, "foldersService");
|
|
31526
31551
|
|
|
31527
|
-
// 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
|
|
31528
31553
|
var REVIEW_COUNT = 500;
|
|
31529
31554
|
var mentionsService = /* @__PURE__ */ __name((deps) => {
|
|
31530
31555
|
const located = /* @__PURE__ */ __name(async () => {
|
|
@@ -31603,7 +31628,7 @@ var mentionsService = /* @__PURE__ */ __name((deps) => {
|
|
|
31603
31628
|
};
|
|
31604
31629
|
}, "mentionsService");
|
|
31605
31630
|
|
|
31606
|
-
// 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
|
|
31607
31632
|
var fileLinks = /* @__PURE__ */ __name((attachments) => hitFiles(attachments).map(({ position, kind, name }) => ({
|
|
31608
31633
|
position,
|
|
31609
31634
|
kind,
|
|
@@ -31652,7 +31677,7 @@ var validatePermalink = /* @__PURE__ */ __name((link4) => {
|
|
|
31652
31677
|
return { url: link4.url, access: link4.access, reason: link4.reason };
|
|
31653
31678
|
}, "validatePermalink");
|
|
31654
31679
|
|
|
31655
|
-
// 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
|
|
31656
31681
|
var spokenSeconds = /* @__PURE__ */ __name((seconds) => {
|
|
31657
31682
|
if (seconds % 86400 === 0 && seconds > 86400)
|
|
31658
31683
|
return `${seconds / 86400}d`;
|
|
@@ -31684,7 +31709,7 @@ var pinDurationOf = /* @__PURE__ */ __name((value, allowed, flag = "--expire-tim
|
|
|
31684
31709
|
return seconds;
|
|
31685
31710
|
}, "pinDurationOf");
|
|
31686
31711
|
|
|
31687
|
-
// 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
|
|
31688
31713
|
var sendAsCheck = /* @__PURE__ */ __name((connection, sendAs) => {
|
|
31689
31714
|
if (sendAs === void 0) {
|
|
31690
31715
|
const saved = connection.savedSender?.bind(connection);
|
|
@@ -31709,7 +31734,7 @@ var typedSendAs = /* @__PURE__ */ __name((typed) => {
|
|
|
31709
31734
|
return sendAs;
|
|
31710
31735
|
}, "typedSendAs");
|
|
31711
31736
|
|
|
31712
|
-
// 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
|
|
31713
31738
|
var TOTAL_CAP = 1e4;
|
|
31714
31739
|
var totalOf = /* @__PURE__ */ __name((count4, shown, hasMore, exact = true) => {
|
|
31715
31740
|
const least = shown + (hasMore ? 1 : 0);
|
|
@@ -31720,7 +31745,7 @@ var totalOf = /* @__PURE__ */ __name((count4, shown, hasMore, exact = true) => {
|
|
|
31720
31745
|
return { value: count4, relation: exact ? "eq" : "gte" };
|
|
31721
31746
|
}, "totalOf");
|
|
31722
31747
|
|
|
31723
|
-
// 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
|
|
31724
31749
|
var WORD_FIELDS = /* @__PURE__ */ new Set(["text", "exact"]);
|
|
31725
31750
|
var fieldsOfQuery = /* @__PURE__ */ __name((root, everything) => {
|
|
31726
31751
|
let narrows = false;
|
|
@@ -31749,7 +31774,7 @@ var meaningWords = /* @__PURE__ */ __name((root) => {
|
|
|
31749
31774
|
return wanted(root).join(" ").trim();
|
|
31750
31775
|
}, "meaningWords");
|
|
31751
31776
|
|
|
31752
|
-
// 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
|
|
31753
31778
|
var words2 = /* @__PURE__ */ __name((text2) => normalize(text2).match(/[\p{L}\p{N}]+/gu) ?? [], "words");
|
|
31754
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"));
|
|
31755
31780
|
var questionWord = /\b(?:what|which|how|who|where|when|can|could|should)\b|(?:^|\s)(?:сколько|какой|какая|какие|какое|кто|кому|кем|где|когда|как|что|можно|может|могут|ли)(?:\s|$)/iu;
|
|
@@ -31881,7 +31906,7 @@ var questionLookup = /* @__PURE__ */ __name((text2) => {
|
|
|
31881
31906
|
return terms.length ? anyOfTerms(terms, plan.scope) : void 0;
|
|
31882
31907
|
}, "questionLookup");
|
|
31883
31908
|
|
|
31884
|
-
// 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
|
|
31885
31910
|
var COMBINED_DEFAULTS = { candidateDepth: 300, rrfK: 60, rerank: "all", chatCap: 0 };
|
|
31886
31911
|
var tokensOf = /* @__PURE__ */ __name((text2) => normalize(text2).match(/[\p{L}\p{N}\p{Co}\p{M}]+/gu) ?? [], "tokensOf");
|
|
31887
31912
|
var searchCombined = /* @__PURE__ */ __name(async (store, account, request, messenger = {}, options = COMBINED_DEFAULTS) => {
|
|
@@ -31928,7 +31953,7 @@ var searchCombined = /* @__PURE__ */ __name(async (store, account, request, mess
|
|
|
31928
31953
|
const clauses = fixes.map((value) => ({ occur: "should", node: { ...node, field: "exact", value } }));
|
|
31929
31954
|
return { kind: "boolean", clauses, span: node.span };
|
|
31930
31955
|
}, "transform");
|
|
31931
|
-
const
|
|
31956
|
+
const read = /* @__PURE__ */ __name(async (root, limit) => {
|
|
31932
31957
|
check2();
|
|
31933
31958
|
const nodes = /* @__PURE__ */ __name((node) => node.kind === "predicate" ? 1 : 1 + node.clauses.reduce((sum2, clause) => sum2 + nodes(clause.node), 0), "nodes");
|
|
31934
31959
|
if (nodes(root) > QUERY_LIMITS.nodes)
|
|
@@ -31938,16 +31963,16 @@ var searchCombined = /* @__PURE__ */ __name(async (store, account, request, mess
|
|
|
31938
31963
|
return found;
|
|
31939
31964
|
}, "read");
|
|
31940
31965
|
if (!expanding) {
|
|
31941
|
-
const found = await
|
|
31966
|
+
const found = await read(execution.root, request.limit);
|
|
31942
31967
|
return finish(found.items, found.hasMore, [], false, false);
|
|
31943
31968
|
}
|
|
31944
|
-
const exact = await
|
|
31945
|
-
const stemmed = await
|
|
31946
|
-
const prefix = await
|
|
31947
|
-
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 };
|
|
31948
31973
|
const fixedPrefixRoot = transform(execution.root, "corrected");
|
|
31949
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");
|
|
31950
|
-
const fixedPrefix = corrections.size ? await
|
|
31975
|
+
const fixedPrefix = corrections.size ? await read(correctedBeginnings(fixedPrefixRoot), depth) : { items: [], hasMore: false };
|
|
31951
31976
|
const ranked = /* @__PURE__ */ new Map();
|
|
31952
31977
|
const add = /* @__PURE__ */ __name((lists, source) => {
|
|
31953
31978
|
const shares = /* @__PURE__ */ new Map();
|
|
@@ -32074,7 +32099,7 @@ var signals = /* @__PURE__ */ __name((hit, terms, corrections, execution, mode,
|
|
|
32074
32099
|
return mode === "coverage" ? coverage2 * 4 : mode === "proximity" ? proximity : mode === "phrase" ? phrase : coverage2 * 4 + proximity + phrase;
|
|
32075
32100
|
}, "signals");
|
|
32076
32101
|
|
|
32077
|
-
// 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
|
|
32078
32103
|
var MEANING_DEPTH = 100;
|
|
32079
32104
|
var RRF_K2 = 60;
|
|
32080
32105
|
var RERANK_DEPTH = 50;
|
|
@@ -32392,14 +32417,14 @@ var scaled = /* @__PURE__ */ __name((values) => {
|
|
|
32392
32417
|
}, "scaled");
|
|
32393
32418
|
var mixedWithReranker = /* @__PURE__ */ __name((head, scores) => {
|
|
32394
32419
|
const fused2 = scaled(head.map((m) => m.score ?? 0));
|
|
32395
|
-
const
|
|
32420
|
+
const read = scaled(scores);
|
|
32396
32421
|
return head.map((m, i) => ({
|
|
32397
32422
|
hit: m.discovery ? { ...m, discovery: { ...m.discovery, rerankerScore: scores[i] } } : m,
|
|
32398
|
-
mixed: (1 - RERANK_WEIGHT) * fused2[i] + RERANK_WEIGHT *
|
|
32423
|
+
mixed: (1 - RERANK_WEIGHT) * fused2[i] + RERANK_WEIGHT * read[i]
|
|
32399
32424
|
})).sort((a, b) => b.mixed - a.mixed).map(({ hit }) => hit);
|
|
32400
32425
|
}, "mixedWithReranker");
|
|
32401
32426
|
|
|
32402
|
-
// 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
|
|
32403
32428
|
var THREAD_BOUNDS = { maxHops: 8, maxMessages: 50, maxBytes: 65536, withinMs: 864e5 };
|
|
32404
32429
|
var bytes = /* @__PURE__ */ __name((items, links) => Buffer.byteLength(JSON.stringify({ items, links }), "utf8"), "bytes");
|
|
32405
32430
|
var threadBounds = /* @__PURE__ */ __name((options = {}) => {
|
|
@@ -32598,7 +32623,7 @@ var readThreadContext = /* @__PURE__ */ __name(async (store, account, chat, mess
|
|
|
32598
32623
|
return result;
|
|
32599
32624
|
}, "readThreadContext");
|
|
32600
32625
|
|
|
32601
|
-
// 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
|
|
32602
32627
|
var SEARCH_FILL_MS = 200;
|
|
32603
32628
|
var statsStore = /* @__PURE__ */ __name(async (store, account, request, messenger = {}) => {
|
|
32604
32629
|
const stop = Date.now() + SEARCH_FILL_MS;
|
|
@@ -32665,12 +32690,12 @@ var accountOf2 = /* @__PURE__ */ __name((hit) => {
|
|
|
32665
32690
|
}, "accountOf");
|
|
32666
32691
|
var keyOf3 = /* @__PURE__ */ __name(({ provider, account }) => `${provider}/${account}`, "keyOf");
|
|
32667
32692
|
|
|
32668
|
-
// 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
|
|
32669
32694
|
import { createHash as createHash10 } from "node:crypto";
|
|
32670
32695
|
import { readFile as readFile2, stat as stat3 } from "node:fs/promises";
|
|
32671
32696
|
import { setTimeout as sleep4 } from "node:timers/promises";
|
|
32672
32697
|
|
|
32673
|
-
// 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
|
|
32674
32699
|
var GROUP_SETTINGS = [
|
|
32675
32700
|
"allCanPin",
|
|
32676
32701
|
"onlyAdminsAdd",
|
|
@@ -32684,7 +32709,7 @@ var ADMIN_RIGHTS = ["read", "members", "admins", "info", "pin", "link", "post",
|
|
|
32684
32709
|
var senderIsMe = /* @__PURE__ */ __name((message, account) => message.outgoing === true || message.senderId !== null && String(message.senderId) === account, "senderIsMe");
|
|
32685
32710
|
var MEDIA_KINDS = ["photo", "video", "file", "audio", "link"];
|
|
32686
32711
|
|
|
32687
|
-
// 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
|
|
32688
32713
|
var PICTURE_MAX_BYTES = 25 * 1024 * 1024;
|
|
32689
32714
|
var PICTURE_FLOOR = 0.25;
|
|
32690
32715
|
var PAGE4 = 50;
|
|
@@ -32701,7 +32726,7 @@ var picturesService = /* @__PURE__ */ __name((deps) => {
|
|
|
32701
32726
|
const directory2 = imageModelsDirectory(deps.env);
|
|
32702
32727
|
if (!isImageModelInstalled(model2, directory2))
|
|
32703
32728
|
throw new CliError("not_found", missingModel(model2.id), { reason: "model.not-downloaded", model: model2.id });
|
|
32704
|
-
const { openPictureEmbedder } = await import("./embedder-
|
|
32729
|
+
const { openPictureEmbedder } = await import("./embedder-SW7DTWSL.js");
|
|
32705
32730
|
return openPictureEmbedder(model2, directory2);
|
|
32706
32731
|
}, "open");
|
|
32707
32732
|
const embedder = /* @__PURE__ */ __name(() => {
|
|
@@ -32712,7 +32737,7 @@ var picturesService = /* @__PURE__ */ __name((deps) => {
|
|
|
32712
32737
|
return opened;
|
|
32713
32738
|
}, "embedder");
|
|
32714
32739
|
const model = imageModel(DEFAULT_IMAGE_MODEL);
|
|
32715
|
-
const bytesOf2 = /* @__PURE__ */ __name(async (picture, files,
|
|
32740
|
+
const bytesOf2 = /* @__PURE__ */ __name(async (picture, files, read) => {
|
|
32716
32741
|
if (picture.localPath) {
|
|
32717
32742
|
try {
|
|
32718
32743
|
if ((await stat3(picture.localPath)).size <= PICTURE_MAX_BYTES)
|
|
@@ -32732,7 +32757,7 @@ var picturesService = /* @__PURE__ */ __name((deps) => {
|
|
|
32732
32757
|
return void 0;
|
|
32733
32758
|
parts.push(part);
|
|
32734
32759
|
}
|
|
32735
|
-
await
|
|
32760
|
+
await read(file);
|
|
32736
32761
|
return Buffer.concat(parts);
|
|
32737
32762
|
}, "bytesOf");
|
|
32738
32763
|
return {
|
|
@@ -32898,7 +32923,7 @@ var withPictures = /* @__PURE__ */ __name((messages, pictures) => ({
|
|
|
32898
32923
|
}, "search")
|
|
32899
32924
|
}), "withPictures");
|
|
32900
32925
|
|
|
32901
|
-
// 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
|
|
32902
32927
|
var meaningLane = /* @__PURE__ */ __name((deps) => async (question, accounts, shared, within) => {
|
|
32903
32928
|
const target2 = embeddingTarget(deps, DEFAULT_TEXT_MODEL);
|
|
32904
32929
|
const skipped = /* @__PURE__ */ __name((reason, step) => ({
|
|
@@ -32966,7 +32991,7 @@ var meaningLane = /* @__PURE__ */ __name((deps) => async (question, accounts, sh
|
|
|
32966
32991
|
}
|
|
32967
32992
|
}, "meaningLane");
|
|
32968
32993
|
|
|
32969
|
-
// 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
|
|
32970
32995
|
var rerankLane = /* @__PURE__ */ __name((deps) => {
|
|
32971
32996
|
const choice = deps.reranker ?? DEFAULT_RERANK_MODEL;
|
|
32972
32997
|
if (choice === "off")
|
|
@@ -32978,9 +33003,9 @@ var rerankLane = /* @__PURE__ */ __name((deps) => {
|
|
|
32978
33003
|
return { skipped: { reason: `${model.id} is not downloaded`, step: "models.download", model: model.id } };
|
|
32979
33004
|
try {
|
|
32980
33005
|
const warm = deps.embedders;
|
|
32981
|
-
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, {
|
|
32982
33007
|
threads: defaultThreads()
|
|
32983
|
-
})) : await (await import("./rerank-
|
|
33008
|
+
})) : await (await import("./rerank-TL6Z6F7K.js")).openReranker(model, directory2);
|
|
32984
33009
|
return {
|
|
32985
33010
|
model: model.id,
|
|
32986
33011
|
score: /* @__PURE__ */ __name((question, passages) => reranker.score(plainWords(question), passages), "score"),
|
|
@@ -33000,32 +33025,32 @@ var rerankLane = /* @__PURE__ */ __name((deps) => {
|
|
|
33000
33025
|
};
|
|
33001
33026
|
}, "rerankLane");
|
|
33002
33027
|
|
|
33003
|
-
// 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
|
|
33004
33029
|
var openPictureEmbedderFor = /* @__PURE__ */ __name(async ({ env, command } = {}) => {
|
|
33005
33030
|
const model = imageModel(DEFAULT_IMAGE_MODEL);
|
|
33006
33031
|
const directory2 = imageModelsDirectory(env);
|
|
33007
33032
|
if (!isImageModelInstalled(model, directory2))
|
|
33008
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 });
|
|
33009
|
-
const { openPictureEmbedder } = await import("./embedder-
|
|
33034
|
+
const { openPictureEmbedder } = await import("./embedder-SW7DTWSL.js");
|
|
33010
33035
|
return openPictureEmbedder(model, directory2);
|
|
33011
33036
|
}, "openPictureEmbedderFor");
|
|
33012
33037
|
|
|
33013
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
33014
|
-
var documentSource = /* @__PURE__ */ __name((
|
|
33015
|
-
const metadata =
|
|
33016
|
-
const account = accounts.find(({ id: id2 }) => String(id2) ===
|
|
33017
|
-
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");
|
|
33018
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;
|
|
33019
33044
|
const url = file?.url ?? (remote && typeof metadata?.sourceUrl === "string" ? metadata.sourceUrl : void 0);
|
|
33020
33045
|
return {
|
|
33021
33046
|
kind: remote ? "document" : "note",
|
|
33022
33047
|
provider: profile ? profile.command : "notes",
|
|
33023
|
-
account: profile?.name ??
|
|
33048
|
+
account: profile?.name ?? note.folderId ?? "internal",
|
|
33024
33049
|
...remote && url !== void 0 ? { url } : {}
|
|
33025
33050
|
};
|
|
33026
33051
|
}, "documentSource");
|
|
33027
33052
|
|
|
33028
|
-
// 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
|
|
33029
33054
|
var plainQueryWords = /* @__PURE__ */ __name((query) => {
|
|
33030
33055
|
let root;
|
|
33031
33056
|
try {
|
|
@@ -33045,14 +33070,14 @@ var plainQueryWords = /* @__PURE__ */ __name((query) => {
|
|
|
33045
33070
|
}, "plainQueryWords");
|
|
33046
33071
|
var titleQuery = /* @__PURE__ */ __name((words3) => words3.split(" ").map((word) => `title:"${word}"`).join(" AND "), "titleQuery");
|
|
33047
33072
|
var titleTiers = /* @__PURE__ */ __name((hits, words3) => {
|
|
33048
|
-
const rank = /* @__PURE__ */ __name(({ note
|
|
33049
|
-
const title = normalize(
|
|
33073
|
+
const rank = /* @__PURE__ */ __name(({ note }) => {
|
|
33074
|
+
const title = normalize(note.title ?? "");
|
|
33050
33075
|
return title === words3 ? 0 : title.includes(words3) ? 1 : 2;
|
|
33051
33076
|
}, "rank");
|
|
33052
33077
|
return [...hits].sort((a, b) => rank(a) - rank(b));
|
|
33053
33078
|
}, "titleTiers");
|
|
33054
33079
|
|
|
33055
|
-
// 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
|
|
33056
33081
|
var storeQuery = /* @__PURE__ */ __name(async (store, text2, { exact, timezone } = {}) => resolvedQuery(store, parsedQuery(text2, exact), timezone), "storeQuery");
|
|
33057
33082
|
var parsedQuery = /* @__PURE__ */ __name((text2, exact) => validateFields(parseLucene(text2, { ...SEARCH_QUERY, defaultField: exact ? "exact" : "text" })).root, "parsedQuery");
|
|
33058
33083
|
var resolvedQuery = /* @__PURE__ */ __name(async (store, root, timezone) => {
|
|
@@ -33223,7 +33248,7 @@ var matching = /* @__PURE__ */ __name(async (store, refs, root, scope) => {
|
|
|
33223
33248
|
...scope.source ? { source: scope.source } : {},
|
|
33224
33249
|
...resolved.stemmer ? { stemmer: resolved.stemmer } : {}
|
|
33225
33250
|
});
|
|
33226
|
-
return new Map(found.items.map(({ ref, note
|
|
33251
|
+
return new Map(found.items.map(({ ref, note, at }) => [ref, { note, at }]));
|
|
33227
33252
|
}, "matching");
|
|
33228
33253
|
var RANK_WITHIN = 2e3;
|
|
33229
33254
|
var filterRefs = /* @__PURE__ */ __name(async (store, narrowing, scope) => {
|
|
@@ -33331,13 +33356,13 @@ var searchNotes = /* @__PURE__ */ __name(async (store, query, { limit = 20, offs
|
|
|
33331
33356
|
meaningSkipped = error.message;
|
|
33332
33357
|
}
|
|
33333
33358
|
}
|
|
33334
|
-
const
|
|
33335
|
-
const titled =
|
|
33336
|
-
text: [titleQuery(
|
|
33359
|
+
const titleWords2 = plainQueryWords(rest);
|
|
33360
|
+
const titled = titleWords2 === void 0 ? { items: [], hasMore: false } : await searchNotesQuery(store, {
|
|
33361
|
+
text: [titleQuery(titleWords2), filter ?? ""].filter(Boolean).join(" AND "),
|
|
33337
33362
|
limit: Math.max(window3, CANDIDATES2),
|
|
33338
33363
|
...scope
|
|
33339
33364
|
});
|
|
33340
|
-
const tier =
|
|
33365
|
+
const tier = titleWords2 === void 0 ? [] : titleTiers(titled.items, titleWords2);
|
|
33341
33366
|
const tierRefs = new Set(tier.map(({ ref }) => ref));
|
|
33342
33367
|
const slice = meaning === void 0 && tier.length === 0;
|
|
33343
33368
|
const matched = await searchNotesQuery(store, {
|
|
@@ -33348,10 +33373,10 @@ var searchNotes = /* @__PURE__ */ __name(async (store, query, { limit = 20, offs
|
|
|
33348
33373
|
...scope
|
|
33349
33374
|
});
|
|
33350
33375
|
const ranked = /* @__PURE__ */ new Map();
|
|
33351
|
-
const add = /* @__PURE__ */ __name((list2, by) => list2.forEach(({ ref, note
|
|
33376
|
+
const add = /* @__PURE__ */ __name((list2, by) => list2.forEach(({ ref, note, at }, rank) => {
|
|
33352
33377
|
if (tierRefs.has(ref))
|
|
33353
33378
|
return;
|
|
33354
|
-
const held = ranked.get(ref) ?? { note
|
|
33379
|
+
const held = ranked.get(ref) ?? { note, at, score: 0, foundBy: [] };
|
|
33355
33380
|
held.foundBy.push(by);
|
|
33356
33381
|
ranked.set(ref, held);
|
|
33357
33382
|
if (by === "meaning" && lookup !== void 0 && held.foundBy.includes("words"))
|
|
@@ -33362,7 +33387,7 @@ var searchNotes = /* @__PURE__ */ __name(async (store, query, { limit = 20, offs
|
|
|
33362
33387
|
if (meaning !== void 0)
|
|
33363
33388
|
add(meaning, "meaning");
|
|
33364
33389
|
const ordered = [
|
|
33365
|
-
...tier.map(({ ref, note
|
|
33390
|
+
...tier.map(({ ref, note, at }) => [ref, { note, at, score: 0, foundBy: ["title"] }]),
|
|
33366
33391
|
...[...ranked.entries()].sort(([, a], [, b]) => b.score - a.score)
|
|
33367
33392
|
];
|
|
33368
33393
|
const page = slice ? ordered : ordered.slice(offset, window3);
|
|
@@ -33372,7 +33397,7 @@ var searchNotes = /* @__PURE__ */ __name(async (store, query, { limit = 20, offs
|
|
|
33372
33397
|
const counts = /* @__PURE__ */ new Map();
|
|
33373
33398
|
const accounts = await store.accounts.storedAccounts();
|
|
33374
33399
|
const profiles = await store.accounts.profiles();
|
|
33375
|
-
for (const [ref, { note
|
|
33400
|
+
for (const [ref, { note, at, foundBy }] of page) {
|
|
33376
33401
|
const links = (await store.notes.links({ from: ref })).map(({ to, targetText, kind, anchor }) => ({
|
|
33377
33402
|
to,
|
|
33378
33403
|
target_text: targetText,
|
|
@@ -33381,13 +33406,13 @@ var searchNotes = /* @__PURE__ */ __name(async (store, query, { limit = 20, offs
|
|
|
33381
33406
|
}));
|
|
33382
33407
|
hits.push({
|
|
33383
33408
|
ref,
|
|
33384
|
-
source:
|
|
33385
|
-
folder_id:
|
|
33386
|
-
path:
|
|
33387
|
-
title:
|
|
33388
|
-
...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),
|
|
33389
33414
|
updated_at: at,
|
|
33390
|
-
excerpt: firstLine(
|
|
33415
|
+
excerpt: firstLine(note.text, words3),
|
|
33391
33416
|
links,
|
|
33392
33417
|
found_by: foundBy,
|
|
33393
33418
|
...cosines.has(ref) ? { meaning_score: cosines.get(ref) } : {}
|
|
@@ -33469,7 +33494,7 @@ var searchNotesOf = /* @__PURE__ */ __name(async (store, account, text2, { accou
|
|
|
33469
33494
|
};
|
|
33470
33495
|
}, "searchNotesOf");
|
|
33471
33496
|
|
|
33472
|
-
// 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
|
|
33473
33498
|
var MAX_EVENTS_OFFSET = 1e3;
|
|
33474
33499
|
var iso3 = /* @__PURE__ */ __name((at) => at === null ? null : new Date(at).toISOString(), "iso");
|
|
33475
33500
|
var accountIdsOf = /* @__PURE__ */ __name(async (store, accounts) => {
|
|
@@ -33586,8 +33611,8 @@ var searchEvents = /* @__PURE__ */ __name(async (store, query, { limit = 20, off
|
|
|
33586
33611
|
};
|
|
33587
33612
|
}, "searchEvents");
|
|
33588
33613
|
|
|
33589
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
33590
|
-
var RESOURCES_SEARCHED = ["messages", "mail", "notes", "events"];
|
|
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
|
|
33615
|
+
var RESOURCES_SEARCHED = ["messages", "mail", "notes", "events", "crm"];
|
|
33591
33616
|
var skippable = /* @__PURE__ */ __name((error) => error instanceof CliError && (error.code === "validation_error" || error.code === "not_found"), "skippable");
|
|
33592
33617
|
var filtersBeside = /* @__PURE__ */ __name((text2) => {
|
|
33593
33618
|
const { root } = parseLucene(text2, MESSAGE_PARSING);
|
|
@@ -33595,6 +33620,15 @@ var filtersBeside = /* @__PURE__ */ __name((text2) => {
|
|
|
33595
33620
|
const top = root.kind === "boolean" ? root.clauses : [{ node: root, occur: "must" }];
|
|
33596
33621
|
return top.every(({ node, occur }) => occur !== "must_not" && followable(node, occur === "must")) ? planQuestion(text2).scope : void 0;
|
|
33597
33622
|
}, "filtersBeside");
|
|
33623
|
+
var titleWords = /* @__PURE__ */ __name((text2) => {
|
|
33624
|
+
const { root } = parseLucene(text2, SEARCH_QUERY);
|
|
33625
|
+
const clauses = root.kind === "boolean" ? root.clauses : [{ node: root, occur: "must" }];
|
|
33626
|
+
const words3 = clauses.map(({ node, occur }) => occur !== "must_not" && node.kind === "predicate" && node.field === "text" && (node.operator === "term" || node.operator === "phrase") ? node.value : (() => {
|
|
33627
|
+
throw new CliError("validation_error", "deals and leads are found by the words of their title only");
|
|
33628
|
+
})());
|
|
33629
|
+
return { words: words3, anyWord: clauses.length > 1 && clauses.every(({ occur }) => occur === "should") };
|
|
33630
|
+
}, "titleWords");
|
|
33631
|
+
var crmAccounts = /* @__PURE__ */ __name(async (store) => (await store.accounts.accounts()).filter(({ provider }) => kindIn(provider) === "crm"), "crmAccounts");
|
|
33598
33632
|
var searchAll = /* @__PURE__ */ __name(async (store, account, request, messenger = {}, searchMessages = (query) => searchStore(store, account, query, messenger), meaning) => {
|
|
33599
33633
|
if (!request.text.trim())
|
|
33600
33634
|
throw new CliError("validation_error", "say what to find");
|
|
@@ -33641,11 +33675,11 @@ var searchAll = /* @__PURE__ */ __name(async (store, account, request, messenger
|
|
|
33641
33675
|
if (kind === "messages" && found.coverage)
|
|
33642
33676
|
coverage2 = found.coverage;
|
|
33643
33677
|
hasMore ||= found.hasMore;
|
|
33644
|
-
const
|
|
33678
|
+
const read = found.coverage?.accounts ?? given ?? (await store.accounts.accounts()).filter(({ provider }) => kindIn(provider) === kind);
|
|
33645
33679
|
for (const one of found.skipped ?? [])
|
|
33646
33680
|
if (!skipped.some(({ source }) => source === one.source))
|
|
33647
33681
|
skipped.push(one);
|
|
33648
|
-
accounts.push(...
|
|
33682
|
+
accounts.push(...read.map(({ provider, account: account2 }) => ({ resource: kind, provider, account: account2 })));
|
|
33649
33683
|
const itemOf3 = /* @__PURE__ */ __name((hit, foundBy) => {
|
|
33650
33684
|
const at = parseLocator(hit.locator);
|
|
33651
33685
|
return {
|
|
@@ -33672,7 +33706,7 @@ var searchAll = /* @__PURE__ */ __name(async (store, account, request, messenger
|
|
|
33672
33706
|
reason: "the query uses NOT, or a filter under OR or in a group, which meaning cannot follow",
|
|
33673
33707
|
model: DEFAULT_TEXT_MODEL
|
|
33674
33708
|
}
|
|
33675
|
-
} : await meaning(request.text,
|
|
33709
|
+
} : await meaning(request.text, read, embedders);
|
|
33676
33710
|
if ("skipped" in lane) {
|
|
33677
33711
|
by[kind] = { by: "words", meaningSkipped: lane.skipped };
|
|
33678
33712
|
return byWords;
|
|
@@ -33732,19 +33766,19 @@ var searchAll = /* @__PURE__ */ __name(async (store, account, request, messenger
|
|
|
33732
33766
|
text: hit.excerpt,
|
|
33733
33767
|
foundBy: hit.found_by
|
|
33734
33768
|
})));
|
|
33735
|
-
const
|
|
33769
|
+
const read = chosen?.map(({ account: account2 }) => account2) ?? [
|
|
33736
33770
|
INTERNAL_NOTES,
|
|
33737
33771
|
...(await store.notes.folders()).map(({ id: id2 }) => id2),
|
|
33738
33772
|
...(await store.notes.documentsAccounts()).map(({ id: id2 }) => id2)
|
|
33739
33773
|
];
|
|
33740
|
-
accounts.push(...
|
|
33774
|
+
accounts.push(...read.map((account2) => ({ resource, provider: "notes", account: account2 })));
|
|
33741
33775
|
} else if (resource === "events") {
|
|
33742
|
-
const
|
|
33743
|
-
if (!
|
|
33776
|
+
const read = request.scope?.events ?? await calendarAccounts(store);
|
|
33777
|
+
if (!read.length)
|
|
33744
33778
|
continue;
|
|
33745
33779
|
const found = await searchEvents(store, request.text, {
|
|
33746
33780
|
limit: window3,
|
|
33747
|
-
accounts:
|
|
33781
|
+
accounts: read,
|
|
33748
33782
|
embedders,
|
|
33749
33783
|
...command === void 0 ? {} : { command },
|
|
33750
33784
|
...request.env === void 0 ? {} : { env: request.env },
|
|
@@ -33772,7 +33806,31 @@ var searchAll = /* @__PURE__ */ __name(async (store, account, request, messenger
|
|
|
33772
33806
|
text: hit.excerpt,
|
|
33773
33807
|
foundBy: hit.found_by
|
|
33774
33808
|
})));
|
|
33775
|
-
accounts.push(...
|
|
33809
|
+
accounts.push(...read.map(({ provider, account: account2 }) => ({ resource, provider, account: account2 })));
|
|
33810
|
+
} else if (resource === "crm") {
|
|
33811
|
+
const { words: words3, anyWord } = titleWords(request.text);
|
|
33812
|
+
const chosen = request.scope?.crm;
|
|
33813
|
+
const found = await store.deals.find({
|
|
33814
|
+
words: words3,
|
|
33815
|
+
anyWord: anyWord || discover,
|
|
33816
|
+
...request.crmKinds === void 0 ? {} : { kinds: request.crmKinds },
|
|
33817
|
+
limit: Math.min(window3 + 1, 500),
|
|
33818
|
+
...chosen === void 0 ? {} : { accounts: chosen }
|
|
33819
|
+
});
|
|
33820
|
+
hasMore ||= found.length > window3;
|
|
33821
|
+
lists.push(found.slice(0, window3).map((deal) => ({
|
|
33822
|
+
kind: deal.kind,
|
|
33823
|
+
ref: deal.ref,
|
|
33824
|
+
provider: deal.account?.provider ?? "crm",
|
|
33825
|
+
account: deal.account?.account ?? INTERNAL_NOTES,
|
|
33826
|
+
title: deal.title,
|
|
33827
|
+
timestamp: deal.updatedAt,
|
|
33828
|
+
text: deal.summary,
|
|
33829
|
+
foundBy: ["title"]
|
|
33830
|
+
})));
|
|
33831
|
+
const read = chosen ?? [...await crmAccounts(store), { provider: "crm", account: INTERNAL_NOTES }];
|
|
33832
|
+
for (const { provider, account: account2 } of read)
|
|
33833
|
+
accounts.push({ resource, provider, account: account2 });
|
|
33776
33834
|
} else
|
|
33777
33835
|
lists.push(await messagesOf(resource));
|
|
33778
33836
|
searched.push(resource);
|
|
@@ -33815,7 +33873,7 @@ var oneList = /* @__PURE__ */ __name((lists, cosines) => {
|
|
|
33815
33873
|
return [...place.values()].sort((a, b) => a.rank - b.rank || cosine(b.item.ref) - cosine(a.item.ref)).map(({ item: item2 }) => item2);
|
|
33816
33874
|
}, "oneList");
|
|
33817
33875
|
|
|
33818
|
-
// 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
|
|
33819
33877
|
var RESOURCES_SEARCHED_WITH_MEETINGS = [...RESOURCES_SEARCHED, "meetings"];
|
|
33820
33878
|
var whole2 = /* @__PURE__ */ __name((value, minimum, maximum, label) => {
|
|
33821
33879
|
if (!Number.isSafeInteger(value) || value < minimum || value > maximum)
|
|
@@ -34050,25 +34108,26 @@ var searchAllOfSource = /* @__PURE__ */ __name(async (store, account, source, re
|
|
|
34050
34108
|
}));
|
|
34051
34109
|
if (only.includes("meetings") && meetings.length > 1)
|
|
34052
34110
|
throw new CliError("validation_error", `--source names several meeting accounts; search all reads one: ${meetings.map(({ provider, account: account2 }) => `${provider}:${account2}`).join(", ")}`);
|
|
34053
|
-
const
|
|
34054
|
-
if (
|
|
34111
|
+
const read = only.filter((resource) => named2(resource).length > 0);
|
|
34112
|
+
if (read.includes("meetings") && request.offset !== void 0)
|
|
34055
34113
|
throw new CliError("validation_error", "--offset pages messages, mail and notes; not with a meeting account yet");
|
|
34056
34114
|
const found = await searchAllIncludingMeetings(store, account, {
|
|
34057
34115
|
...request,
|
|
34058
|
-
only:
|
|
34116
|
+
only: read,
|
|
34059
34117
|
scope: {
|
|
34060
34118
|
messages: named2("messages"),
|
|
34061
34119
|
mail: named2("mail"),
|
|
34062
34120
|
notes: named2("notes"),
|
|
34063
|
-
events: named2("events")
|
|
34121
|
+
events: named2("events"),
|
|
34122
|
+
crm: named2("crm")
|
|
34064
34123
|
},
|
|
34065
34124
|
...meetings[0] ? { meetingAccount: meetings[0] } : {}
|
|
34066
34125
|
}, messenger, searchMessages, meaning);
|
|
34067
|
-
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` }));
|
|
34068
34127
|
return { ...found, skipped: [...skipped, ...empty2, ...unnamed, ...found.skipped] };
|
|
34069
34128
|
}, "searchAllOfSource");
|
|
34070
34129
|
|
|
34071
|
-
// 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
|
|
34072
34131
|
var SERVER_SEARCH_KEY = "messages.server-search";
|
|
34073
34132
|
var SERVER_BOUNDS = { timeMs: 5e3, perCall: 100, maxCalls: 3, textBytes: 262144 };
|
|
34074
34133
|
var DEFAULT_BACKEND = "both";
|
|
@@ -34257,7 +34316,7 @@ var searchServer = /* @__PURE__ */ __name(async (deps, request) => {
|
|
|
34257
34316
|
return { report, sources };
|
|
34258
34317
|
}, "searchServer");
|
|
34259
34318
|
|
|
34260
|
-
// 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
|
|
34261
34320
|
var DELETE_AT_ONCE = 10;
|
|
34262
34321
|
var filesOf = /* @__PURE__ */ __name(({ attachments }) => {
|
|
34263
34322
|
const files = fileLinks(attachments);
|
|
@@ -34265,7 +34324,7 @@ var filesOf = /* @__PURE__ */ __name(({ attachments }) => {
|
|
|
34265
34324
|
}, "filesOf");
|
|
34266
34325
|
var messagesService = /* @__PURE__ */ __name((deps) => {
|
|
34267
34326
|
const { guard } = deps;
|
|
34268
|
-
const inStore = /* @__PURE__ */ __name(async (
|
|
34327
|
+
const inStore = /* @__PURE__ */ __name(async (read) => read(await deps.store(), await deps.account()), "inStore");
|
|
34269
34328
|
const ownTarget = /* @__PURE__ */ __name(async (target2, account) => {
|
|
34270
34329
|
if (account.provider !== deps.messenger.provider)
|
|
34271
34330
|
throw new CliError("validation_error", "that locator belongs to another account; select its profile first");
|
|
@@ -34698,7 +34757,7 @@ var checkMediaOptions = /* @__PURE__ */ __name((messenger, asked, attachments) =
|
|
|
34698
34757
|
throw new CliError("validation_error", `${MEDIA_FLAGS[first2]} needs a --photo or --file`);
|
|
34699
34758
|
}, "checkMediaOptions");
|
|
34700
34759
|
|
|
34701
|
-
// 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
|
|
34702
34761
|
var CHANNEL_TAG_RULES_VERSION = "keywords-v1";
|
|
34703
34762
|
var RULES = {
|
|
34704
34763
|
ai: [/\b(ai|gpt|llm|machine learning|artificial intelligence)\b/iu, /нейросет|искусственн/iu],
|
|
@@ -34713,7 +34772,7 @@ var classifyChannel = /* @__PURE__ */ __name((metadata) => Object.entries(RULES)
|
|
|
34713
34772
|
return fields.length ? [{ tag, score: fields.length / 3, fields }] : [];
|
|
34714
34773
|
}), "classifyChannel");
|
|
34715
34774
|
|
|
34716
|
-
// 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
|
|
34717
34776
|
var metadataService = /* @__PURE__ */ __name((deps) => {
|
|
34718
34777
|
const held = /* @__PURE__ */ __name(async (reference, { includeLeft = false } = {}) => {
|
|
34719
34778
|
const store = await deps.store();
|
|
@@ -34728,8 +34787,8 @@ var metadataService = /* @__PURE__ */ __name((deps) => {
|
|
|
34728
34787
|
const found = (await store.chats.chats(account, {})).items.find((chat) => chat.id === chatId);
|
|
34729
34788
|
if (!found || found.kind !== "group" && found.kind !== "channel")
|
|
34730
34789
|
throw new CliError("validation_error", "metadata sync applies to groups and channels");
|
|
34731
|
-
const
|
|
34732
|
-
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());
|
|
34733
34792
|
return store.chats.saveChatMetadata(account, {
|
|
34734
34793
|
chatId,
|
|
34735
34794
|
title: card.title,
|
|
@@ -34799,7 +34858,7 @@ var metadataService = /* @__PURE__ */ __name((deps) => {
|
|
|
34799
34858
|
};
|
|
34800
34859
|
}, "metadataService");
|
|
34801
34860
|
|
|
34802
|
-
// 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
|
|
34803
34862
|
var FIRST_LOOK_MS = 24 * 36e5;
|
|
34804
34863
|
var moderateWith = /* @__PURE__ */ __name(async (run) => {
|
|
34805
34864
|
const { chatId, title, rules, point, since, dryRun } = run;
|
|
@@ -34836,7 +34895,7 @@ var moderateWith = /* @__PURE__ */ __name(async (run) => {
|
|
|
34836
34895
|
return { chatId, rows, notes };
|
|
34837
34896
|
}, "moderateWith");
|
|
34838
34897
|
|
|
34839
|
-
// 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
|
|
34840
34899
|
var moderationService = /* @__PURE__ */ __name((deps) => {
|
|
34841
34900
|
const file = /* @__PURE__ */ __name(() => new ModerationRules(moderationPathFor(deps.messenger.app, deps.profile ?? "default", deps.env ?? process.env)), "file");
|
|
34842
34901
|
const group = /* @__PURE__ */ __name(async (chat) => {
|
|
@@ -34914,14 +34973,14 @@ var moderatorOf = /* @__PURE__ */ __name((adapter, deps) => ({
|
|
|
34914
34973
|
}, "removePerson")
|
|
34915
34974
|
}), "moderatorOf");
|
|
34916
34975
|
|
|
34917
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34918
|
-
var noteItem = /* @__PURE__ */ __name((provider,
|
|
34919
|
-
id:
|
|
34920
|
-
contact: formatReference({ type: "contact", provider, id:
|
|
34921
|
-
text:
|
|
34922
|
-
revision:
|
|
34923
|
-
created_at:
|
|
34924
|
-
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
|
|
34925
34984
|
}), "noteItem");
|
|
34926
34985
|
var privatePeopleService = /* @__PURE__ */ __name((deps) => {
|
|
34927
34986
|
const target2 = /* @__PURE__ */ __name(async (reference) => {
|
|
@@ -34933,7 +34992,7 @@ var privatePeopleService = /* @__PURE__ */ __name((deps) => {
|
|
|
34933
34992
|
return {
|
|
34934
34993
|
notes: /* @__PURE__ */ __name(async (reference) => {
|
|
34935
34994
|
const { store, account, person } = await target2(reference);
|
|
34936
|
-
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));
|
|
34937
34996
|
}, "notes"),
|
|
34938
34997
|
alias: /* @__PURE__ */ __name(async (reference, alias) => {
|
|
34939
34998
|
const { store, account, person } = await target2(reference);
|
|
@@ -34958,7 +35017,7 @@ var privatePeopleService = /* @__PURE__ */ __name((deps) => {
|
|
|
34958
35017
|
};
|
|
34959
35018
|
}, "privatePeopleService");
|
|
34960
35019
|
|
|
34961
|
-
// 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
|
|
34962
35021
|
var empty = /* @__PURE__ */ __name(() => ({
|
|
34963
35022
|
total: 0,
|
|
34964
35023
|
population: 0,
|
|
@@ -35214,7 +35273,7 @@ var rankingsService = /* @__PURE__ */ __name((deps) => ({
|
|
|
35214
35273
|
}, "evidence")
|
|
35215
35274
|
}), "rankingsService");
|
|
35216
35275
|
|
|
35217
|
-
// 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
|
|
35218
35277
|
var FIELDS = ["date", "chat", "kind"];
|
|
35219
35278
|
var WAITING_TAIL = 100;
|
|
35220
35279
|
var plainOnly = /* @__PURE__ */ __name((text2, command) => {
|
|
@@ -35341,7 +35400,7 @@ var replyStatsService = /* @__PURE__ */ __name((deps) => {
|
|
|
35341
35400
|
};
|
|
35342
35401
|
}, "replyStatsService");
|
|
35343
35402
|
|
|
35344
|
-
// 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
|
|
35345
35404
|
var savedSearchItem = /* @__PURE__ */ __name((one) => ({
|
|
35346
35405
|
id: one.id,
|
|
35347
35406
|
name: one.name,
|
|
@@ -35470,7 +35529,7 @@ var searchesService = /* @__PURE__ */ __name((deps) => {
|
|
|
35470
35529
|
};
|
|
35471
35530
|
}, "searchesService");
|
|
35472
35531
|
|
|
35473
|
-
// 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
|
|
35474
35533
|
var TAGGING_QUERY = {
|
|
35475
35534
|
entity: "tagging",
|
|
35476
35535
|
backend: "sql",
|
|
@@ -35554,7 +35613,7 @@ var tagsService = /* @__PURE__ */ __name((deps) => {
|
|
|
35554
35613
|
};
|
|
35555
35614
|
}, "tagsService");
|
|
35556
35615
|
|
|
35557
|
-
// 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
|
|
35558
35617
|
var actionOf = /* @__PURE__ */ __name(({ title, closed, pinned, hidden, icon }) => {
|
|
35559
35618
|
const set = [closed, pinned, hidden].filter((one) => one !== void 0).length;
|
|
35560
35619
|
if (title !== void 0 || icon !== void 0 || set !== 1)
|
|
@@ -35753,7 +35812,7 @@ var topicsService = /* @__PURE__ */ __name((deps) => {
|
|
|
35753
35812
|
};
|
|
35754
35813
|
}, "topicsService");
|
|
35755
35814
|
|
|
35756
|
-
// 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
|
|
35757
35816
|
import { createHash as createHash11, randomUUID as randomUUID5 } from "node:crypto";
|
|
35758
35817
|
var hash2 = /* @__PURE__ */ __name((value) => createHash11("sha256").update(JSON.stringify(value)).digest("hex"), "hash");
|
|
35759
35818
|
var positive = /* @__PURE__ */ __name((value, name, minimum = 1) => {
|
|
@@ -35827,7 +35886,7 @@ var prepareEvidencePacket = /* @__PURE__ */ __name(({ kind, source, page, limits
|
|
|
35827
35886
|
return { ...content, id: randomUUID5(), fingerprint: hash2(content) };
|
|
35828
35887
|
}, "prepareEvidencePacket");
|
|
35829
35888
|
|
|
35830
|
-
// 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
|
|
35831
35890
|
var readEvidencePacket = /* @__PURE__ */ __name(async (store, account, { chat, limit, before: before2 }, messenger = {}) => {
|
|
35832
35891
|
if (!Number.isSafeInteger(limit) || limit < 1 || limit > 100)
|
|
35833
35892
|
throw new CliError("validation_error", "evidence message limit must be an integer from 1 to 100");
|
|
@@ -35847,7 +35906,7 @@ var readEvidencePacket = /* @__PURE__ */ __name(async (store, account, { chat, l
|
|
|
35847
35906
|
return { ...packet, nextBeforeId: older && last ? last.id : null };
|
|
35848
35907
|
}, "readEvidencePacket");
|
|
35849
35908
|
|
|
35850
|
-
// 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
|
|
35851
35910
|
var scopeKeys = [
|
|
35852
35911
|
"accountId",
|
|
35853
35912
|
"meetingId",
|
|
@@ -35869,7 +35928,7 @@ var optionKeys = /* @__PURE__ */ new Set([
|
|
|
35869
35928
|
"maxVocabularyReadBytes"
|
|
35870
35929
|
]);
|
|
35871
35930
|
|
|
35872
|
-
// 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
|
|
35873
35932
|
var communicationFields = {
|
|
35874
35933
|
sources: pipe(array(strictObject({
|
|
35875
35934
|
id: pipe(string(), regex(/^[A-Za-z0-9][A-Za-z0-9._-]{0,127}$/)),
|
|
@@ -35901,7 +35960,7 @@ var communicationRequest = /* @__PURE__ */ __name((value, preparationAfter) => {
|
|
|
35901
35960
|
return { ...input, after, before: before2 };
|
|
35902
35961
|
}, "communicationRequest");
|
|
35903
35962
|
|
|
35904
|
-
// 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
|
|
35905
35964
|
var MEETING_PREPARATION_LIMITS = {
|
|
35906
35965
|
meetings: { min: 1, max: 20, default: 5 },
|
|
35907
35966
|
cues: { min: 1, max: 100, default: 10 },
|
|
@@ -35974,7 +36033,7 @@ var validateMeetingPreparationRequest = /* @__PURE__ */ __name((externalId, orig
|
|
|
35974
36033
|
};
|
|
35975
36034
|
}, "validateMeetingPreparationRequest");
|
|
35976
36035
|
|
|
35977
|
-
// 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
|
|
35978
36037
|
var validatePreparationCommunications = /* @__PURE__ */ __name((section, request, after) => {
|
|
35979
36038
|
const fail2 = /* @__PURE__ */ __name(() => {
|
|
35980
36039
|
throw new CliError("invalid_response", "Preparation communications returned another selection or invalid evidence");
|
|
@@ -36022,7 +36081,7 @@ var validatePreparationCommunications = /* @__PURE__ */ __name((section, request
|
|
|
36022
36081
|
}
|
|
36023
36082
|
}, "validatePreparationCommunications");
|
|
36024
36083
|
|
|
36025
|
-
// 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
|
|
36026
36085
|
var upgradePackage = /* @__PURE__ */ __name(async ({ current, command, packageName, check: check2 }, ports) => {
|
|
36027
36086
|
const installer = ports.installer();
|
|
36028
36087
|
const argv = updateCommand(installer, packageName);
|
|
@@ -36054,9 +36113,9 @@ var upgradePackage = /* @__PURE__ */ __name(async ({ current, command, packageNa
|
|
|
36054
36113
|
const installed = await ports.installed?.();
|
|
36055
36114
|
if (installed === void 0)
|
|
36056
36115
|
return restart(result, ports);
|
|
36057
|
-
const
|
|
36116
|
+
const read = { ...result, installed };
|
|
36058
36117
|
if (!isNewer(latest2, installed))
|
|
36059
|
-
return restart(
|
|
36118
|
+
return restart(read, ports);
|
|
36060
36119
|
const heldBack = {
|
|
36061
36120
|
// pnpm 11 resolves `@latest` to the newest version older than minimumReleaseAge, 1 day by default.
|
|
36062
36121
|
until: installer === "pnpm" ? dayAfter(await ports.publishedAt?.(latest2)) : null,
|
|
@@ -36064,8 +36123,8 @@ var upgradePackage = /* @__PURE__ */ __name(async ({ current, command, packageNa
|
|
|
36064
36123
|
command: argv.map((word) => word === `${packageName}@latest` ? `${packageName}@${latest2}` : word).join(" ")
|
|
36065
36124
|
};
|
|
36066
36125
|
if (installed === current)
|
|
36067
|
-
return { result: { ...
|
|
36068
|
-
return { ...await restart({ ...
|
|
36126
|
+
return { result: { ...read, heldBack }, reason: "held_back", left: [] };
|
|
36127
|
+
return { ...await restart({ ...read, heldBack }, ports), reason: "held_back" };
|
|
36069
36128
|
}, "upgradePackage");
|
|
36070
36129
|
var restart = /* @__PURE__ */ __name(async (result, ports) => {
|
|
36071
36130
|
const servers = await ports.afterUpdate?.();
|
|
@@ -36087,7 +36146,7 @@ var dayAfter = /* @__PURE__ */ __name((published) => {
|
|
|
36087
36146
|
return Number.isNaN(time) ? null : new Date(time + 24 * 60 * 60 * 1e3).toISOString();
|
|
36088
36147
|
}, "dayAfter");
|
|
36089
36148
|
|
|
36090
|
-
// 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
|
|
36091
36150
|
var servicesFor = /* @__PURE__ */ __name((deps) => {
|
|
36092
36151
|
const pictures = picturesService(deps);
|
|
36093
36152
|
const base = {
|
|
@@ -36124,7 +36183,7 @@ var servicesFor = /* @__PURE__ */ __name((deps) => {
|
|
|
36124
36183
|
return deps.messenger.services ? { ...base, ...deps.messenger.services(base, deps) } : base;
|
|
36125
36184
|
}, "servicesFor");
|
|
36126
36185
|
|
|
36127
|
-
// 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
|
|
36128
36187
|
import { createHash as createHash12 } from "node:crypto";
|
|
36129
36188
|
import { chmodSync, lstatSync, mkdirSync as mkdirSync3, rmSync } from "node:fs";
|
|
36130
36189
|
import { createConnection, createServer } from "node:net";
|
|
@@ -36345,7 +36404,7 @@ var relayCommand = /* @__PURE__ */ __name((path, request, options) => new Promis
|
|
|
36345
36404
|
}, () => finish({ error: stopped() }));
|
|
36346
36405
|
}), "relayCommand");
|
|
36347
36406
|
|
|
36348
|
-
// 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
|
|
36349
36408
|
var lentConnection = /* @__PURE__ */ __name((connection, watchers) => throughWrapper(connection, {
|
|
36350
36409
|
close: /* @__PURE__ */ __name(async () => {
|
|
36351
36410
|
}, "close"),
|
|
@@ -36444,8 +36503,6 @@ export {
|
|
|
36444
36503
|
throughWrapper,
|
|
36445
36504
|
capability,
|
|
36446
36505
|
syncsOneChat,
|
|
36447
|
-
newSendId,
|
|
36448
|
-
newOperationId,
|
|
36449
36506
|
AUDIT_PAGE,
|
|
36450
36507
|
AUDIT_BUDGET,
|
|
36451
36508
|
AUDIT_MIN_SCORE,
|
|
@@ -36529,7 +36586,9 @@ export {
|
|
|
36529
36586
|
ADMIN_RIGHTS,
|
|
36530
36587
|
senderIsMe,
|
|
36531
36588
|
MEDIA_KINDS,
|
|
36589
|
+
meaningLane,
|
|
36532
36590
|
searchNotesOf,
|
|
36591
|
+
searchAllWithMeetings,
|
|
36533
36592
|
DELETE_AT_ONCE,
|
|
36534
36593
|
moderateWith,
|
|
36535
36594
|
CONTEXT_MESSAGES2 as CONTEXT_MESSAGES,
|