@wirecat/drive-cli 0.62.0 → 0.63.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin/drive.js +2 -2
- package/dist/bundle/{all-profiles-CKD2DWUK.js → all-profiles-GZJS3UKC.js} +6 -7
- package/dist/bundle/{anthropic-E3T4USLA.js → anthropic-RGV3WXX5.js} +3 -3
- package/dist/bundle/{app-server-JB2AEWWL.js → app-server-AA2PJ7PV.js} +40 -41
- package/dist/bundle/{bun-CC44AAND.js → bun-OXZYIA3R.js} +2 -2
- package/dist/bundle/{bun-sqlite-AUMFKYVR.js → bun-sqlite-D45NSDM3.js} +2 -2
- package/dist/bundle/{chunk-WZKEU7WR.js → chunk-2NIC72HH.js} +1 -1
- package/dist/bundle/{chunk-HCNQT3QE.js → chunk-2TDUGC5D.js} +331 -280
- package/dist/bundle/{chunk-DWJHL6DV.js → chunk-2TFXK3R4.js} +4 -4
- package/dist/bundle/{chunk-PEQA6LA5.js → chunk-33MGFUED.js} +169 -140
- package/dist/bundle/{chunk-YPFUYQDP.js → chunk-3BZRKLJ6.js} +12 -12
- package/dist/bundle/{chunk-YALI4C7C.js → chunk-3HK5WMI5.js} +5 -5
- package/dist/bundle/{chunk-R347FPYU.js → chunk-3QINVLZI.js} +1 -1
- package/dist/bundle/{chunk-LQKD257P.js → chunk-44SBK6KB.js} +938 -532
- package/dist/bundle/{chunk-XZUS7XRO.js → chunk-4CIZWCXV.js} +1 -1
- package/dist/bundle/{chunk-XS5POQST.js → chunk-4S4JMW6I.js} +1 -1
- package/dist/bundle/{chunk-YMWENGKH.js → chunk-534OBX5Y.js} +1 -1
- package/dist/bundle/{chunk-4SIZEJ3M.js → chunk-5PPL7JDM.js} +1 -1
- package/dist/bundle/{chunk-L7K2MOIC.js → chunk-6KQJSFYF.js} +18 -18
- package/dist/bundle/{chunk-VAYB52HF.js → chunk-6MQSQ4LX.js} +20 -20
- package/dist/bundle/{chunk-DJOAMGF4.js → chunk-7EMQ26BA.js} +9 -9
- package/dist/bundle/{chunk-TDX4GZFO.js → chunk-ABYGSJZ4.js} +4 -4
- package/dist/bundle/{chunk-FNWIJ6EJ.js → chunk-AEX37ETW.js} +1 -1
- package/dist/bundle/{chunk-SVPCHFKI.js → chunk-BKYMKVHT.js} +2 -2
- package/dist/bundle/{chunk-OBH5BA62.js → chunk-CE2TJBLP.js} +2 -2
- package/dist/bundle/{chunk-QTI6IVHZ.js → chunk-DJ3SDJZY.js} +6 -6
- package/dist/bundle/{chunk-XFRRKZHQ.js → chunk-DJHLVUL6.js} +16 -13
- package/dist/bundle/{chunk-JK3U25QZ.js → chunk-E4SDKMBJ.js} +59 -1
- package/dist/bundle/{chunk-HG6CAYJH.js → chunk-FRIJUILO.js} +2 -2
- package/dist/bundle/{chunk-RPMKG63Z.js → chunk-HZZCEQTH.js} +3 -3
- package/dist/bundle/{chunk-YXYTY4GF.js → chunk-J24ZFCWM.js} +16 -16
- package/dist/bundle/{chunk-E43ENLJJ.js → chunk-J4DIHPZ6.js} +1 -1
- package/dist/bundle/{chunk-SW4I5BR7.js → chunk-L37LMMRJ.js} +1 -1
- package/dist/bundle/{chunk-Q2LRPOKL.js → chunk-LMAVCYLQ.js} +3 -3
- package/dist/bundle/{chunk-T7X53FCJ.js → chunk-LZEOQW7S.js} +31 -31
- package/dist/bundle/{chunk-T5NWWXS2.js → chunk-MOTRI3SY.js} +1 -1
- package/dist/bundle/{chunk-ONP2IBHY.js → chunk-ND6LLYGF.js} +97 -80
- package/dist/bundle/{chunk-2KN35F32.js → chunk-NEFSGCVA.js} +8 -8
- package/dist/bundle/{chunk-JN5TVEEL.js → chunk-OXY6SSZG.js} +101 -14
- package/dist/bundle/{chunk-W4RTIL7S.js → chunk-PDCCYHCH.js} +2 -2
- package/dist/bundle/{chunk-AH5C3D3D.js → chunk-PO5RQQIG.js} +4 -4
- package/dist/bundle/{chunk-CZ2GJHLL.js → chunk-Q5DJTRKV.js} +2 -2
- package/dist/bundle/{chunk-O7ALBI2I.js → chunk-RKELRWH7.js} +3 -3
- package/dist/bundle/{chunk-67ZQCWBV.js → chunk-S4RXABDR.js} +2 -2
- package/dist/bundle/{chunk-QCX6XZLA.js → chunk-SXM6MHRR.js} +9 -9
- package/dist/bundle/{chunk-RIDQNVZM.js → chunk-TF23BZW5.js} +2 -2
- package/dist/bundle/{chunk-N7OZPKU7.js → chunk-TWUH22Z5.js} +1 -1
- package/dist/bundle/chunk-UPOSDTPT.js +87 -0
- package/dist/bundle/{chunk-CJHY5YIF.js → chunk-V3NVXIQR.js} +353 -114
- package/dist/bundle/{chunk-QH7DOVO3.js → chunk-VAUMOZU5.js} +44 -28
- package/dist/bundle/{chunk-VQDD64A4.js → chunk-VJEOGKAN.js} +7 -9
- package/dist/bundle/{chunk-MN4VXU3M.js → chunk-VKPCONDQ.js} +3 -3
- package/dist/bundle/{chunk-LWE4JGRN.js → chunk-WYGWWHZP.js} +2 -2
- package/dist/bundle/{chunk-EW7PKB4M.js → chunk-XDC3TWTL.js} +25 -25
- package/dist/bundle/{chunk-KLFSRKHB.js → chunk-XIUDS3OK.js} +1 -1
- package/dist/bundle/{chunk-U2BFYSQV.js → chunk-XNVFKMVR.js} +8559 -3343
- package/dist/bundle/{chunk-IR4SQLBR.js → chunk-XR6ESRU6.js} +1 -1
- package/dist/bundle/{chunk-RWSXVCSG.js → chunk-Y6GNA7HE.js} +2 -2
- package/dist/bundle/{chunk-7ZXIWZQ6.js → chunk-YGU6ULU5.js} +10 -10
- package/dist/bundle/{chunk-UGXN5D7U.js → chunk-YIP7ELON.js} +108 -62
- package/dist/bundle/{chunk-XEW2EN6F.js → chunk-Z42YYLTS.js} +31 -23
- package/dist/bundle/{chunk-DRZZBN3V.js → chunk-Z5KC7XBR.js} +1 -1
- package/dist/bundle/{chunk-7W5HYGVW.js → chunk-ZM5J6ZMB.js} +1 -1
- package/dist/bundle/{chunk-YOJDGAPT.js → chunk-ZOJU7ZFI.js} +7 -7
- package/dist/bundle/{command-contract-OB5BRABN.js → command-contract-BRW3AP44.js} +13 -14
- package/dist/bundle/{decode-WIIX3Y2X.js → decode-G5YEIPNC.js} +2 -2
- package/dist/bundle/drive.js +3 -3
- package/dist/bundle/{echarts-OYINM4C4.js → echarts-W2CWHNXR.js} +2 -2
- package/dist/bundle/{embed-DWZIYMBX.js → embed-OBFFPVF4.js} +3 -3
- package/dist/bundle/{embedder-ILWH7ZRM.js → embedder-NGCBQHIG.js} +6 -6
- package/dist/bundle/{entry-V5V3TOTY.js → entry-ET6HGM7A.js} +5 -5
- package/dist/bundle/{first-run-V3VVLQF4.js → first-run-JG52UZVO.js} +5 -5
- package/dist/bundle/{first-screen-Y3RIN7FU.js → first-screen-CIL3GFAA.js} +14 -15
- package/dist/bundle/{google-KLZSUAVY.js → google-CIWUVJ5C.js} +4 -4
- package/dist/bundle/{google-api-HZQ5R4ZO.js → google-api-Z3NSTBBR.js} +44 -45
- package/dist/bundle/{grants-L7XLHLUT.js → grants-3S4RL3WB.js} +49 -50
- package/dist/bundle/{identity-J2DON4IO.js → identity-OM6GFZ7T.js} +1 -1
- package/dist/bundle/{instructions-HGOJ23AJ.js → instructions-YQBQSYSS.js} +1 -1
- package/dist/bundle/{login-BD2TS4GY.js → login-7RYSDVN3.js} +48 -49
- package/dist/bundle/{node-CPKTDPH7.js → node-IVU33RL7.js} +2 -2
- package/dist/bundle/{node-sqlite-IXDCRLSX.js → node-sqlite-SIH5BEW2.js} +3 -3
- package/dist/bundle/{oauth-HOGY4YBB.js → oauth-PT4JEHLL.js} +4 -4
- package/dist/bundle/{open-O7P3ZV3Y.js → open-IAO2SNII.js} +2 -2
- package/dist/bundle/{openai-RCFQKCXC.js → openai-SGOUBHXP.js} +10 -10
- package/dist/bundle/{process-KXDRJO22.js → process-BPBMV3AT.js} +1 -1
- package/dist/bundle/{program-UCHFC7JQ.js → program-MYKKJ4F6.js} +68 -67
- package/dist/bundle/{prompt-EVPPBN5W.js → prompt-3ZM64DCB.js} +2 -2
- package/dist/bundle/{recognize-MRCYGP2J.js → recognize-A5C5RPB3.js} +1 -1
- package/dist/bundle/{remote-L3L4PHKF.js → remote-VWYFLRGO.js} +4 -4
- package/dist/bundle/{rerank-PSOE6XFT.js → rerank-4NGQWREA.js} +4 -4
- package/dist/bundle/{serve-72OGS3BF.js → serve-Y6LQTFH5.js} +6 -6
- package/dist/bundle/{server-SCXKYHBO.js → server-6AUHIIUA.js} +32 -33
- package/dist/bundle/server-PFHI35HA.js +69 -0
- package/dist/bundle/{services-YAFTELBI.js → services-2W4J7EMW.js} +26 -21
- package/dist/bundle/{sqlite-runtime-DLK4SU33.js → sqlite-runtime-P6BBDX2H.js} +3 -3
- package/dist/bundle/{state-T5VNAJSZ.js → state-PXKKXR3R.js} +3 -3
- package/dist/bundle/{store-R6MSY2IM.js → store-CN6JEUC4.js} +18 -10
- package/dist/bundle/{store-4OFK7PKQ.js → store-IVV2BAGZ.js} +42 -12
- package/dist/bundle/store-maintenance-command-MSY2QNEH.js +59 -0
- package/dist/bundle/tokens-P4LPNUFW.js +102 -0
- package/dist/commands/config.d.ts.map +1 -1
- package/dist/commands/config.js +5 -1
- package/dist/commands/config.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +2 -2
- package/dist/bundle/chunk-AQVUEZEP.js +0 -22
- package/dist/bundle/chunk-UOXOLGNG.js +0 -42
- package/dist/bundle/server-C5TGNFXW.js +0 -70
- package/dist/bundle/store-maintenance-command-QDMCXGV6.js +0 -60
- package/dist/bundle/tokens-HIG36RNS.js +0 -103
|
@@ -6,8 +6,9 @@ import {
|
|
|
6
6
|
documentKind,
|
|
7
7
|
engineMissing,
|
|
8
8
|
extractText,
|
|
9
|
-
importEngine
|
|
10
|
-
|
|
9
|
+
importEngine,
|
|
10
|
+
withTimeLimit
|
|
11
|
+
} from "./chunk-ND6LLYGF.js";
|
|
11
12
|
import {
|
|
12
13
|
acquireLock,
|
|
13
14
|
openOrdinaryFile,
|
|
@@ -16,7 +17,7 @@ import {
|
|
|
16
17
|
sameOrdinaryFile,
|
|
17
18
|
syncDirectory,
|
|
18
19
|
writeFileAtomic
|
|
19
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-3BZRKLJ6.js";
|
|
20
21
|
import {
|
|
21
22
|
DEFAULT_IMAGE_MODEL,
|
|
22
23
|
DEFAULT_RERANK_MODEL,
|
|
@@ -45,23 +46,20 @@ import {
|
|
|
45
46
|
typedCommand,
|
|
46
47
|
vectorModelKey,
|
|
47
48
|
withAttempt
|
|
48
|
-
} from "./chunk-
|
|
49
|
-
import {
|
|
50
|
-
isCliFailure
|
|
51
|
-
} from "./chunk-AQVUEZEP.js";
|
|
49
|
+
} from "./chunk-6MQSQ4LX.js";
|
|
52
50
|
import {
|
|
53
51
|
isNewer,
|
|
54
52
|
updateCommand
|
|
55
53
|
} from "./chunk-QCKZ3GAA.js";
|
|
56
54
|
import {
|
|
57
55
|
MAX_MODEL_IMAGE_BYTES
|
|
58
|
-
} from "./chunk-
|
|
56
|
+
} from "./chunk-MOTRI3SY.js";
|
|
59
57
|
import {
|
|
60
58
|
OPENAI_URL,
|
|
61
59
|
openRemote,
|
|
62
60
|
remoteKey,
|
|
63
61
|
remoteModel
|
|
64
|
-
} from "./chunk-
|
|
62
|
+
} from "./chunk-CE2TJBLP.js";
|
|
65
63
|
import {
|
|
66
64
|
defaultThreads,
|
|
67
65
|
installNativeRuntime,
|
|
@@ -70,11 +68,11 @@ import {
|
|
|
70
68
|
placedText,
|
|
71
69
|
runEmbedders,
|
|
72
70
|
textModelsDirectory
|
|
73
|
-
} from "./chunk-
|
|
71
|
+
} from "./chunk-PO5RQQIG.js";
|
|
74
72
|
import {
|
|
75
73
|
installFiles,
|
|
76
74
|
megabytes
|
|
77
|
-
} from "./chunk-
|
|
75
|
+
} from "./chunk-LMAVCYLQ.js";
|
|
78
76
|
import {
|
|
79
77
|
AGENDA_COLUMNS,
|
|
80
78
|
CHAT_COLUMNS,
|
|
@@ -96,10 +94,12 @@ import {
|
|
|
96
94
|
QUERY_VERSION,
|
|
97
95
|
RANKING_TOKENIZER_VERSION,
|
|
98
96
|
SEARCH_QUERY,
|
|
97
|
+
SOURCE_REVIEW_KIND,
|
|
99
98
|
TASK_CLOSE_KIND,
|
|
100
99
|
TASK_RELATION_KINDS,
|
|
101
100
|
TRACKED_CHAT_COLUMNS,
|
|
102
101
|
UNKNOWN_PROVIDER,
|
|
102
|
+
WORD_BODY,
|
|
103
103
|
amountsOf,
|
|
104
104
|
assertGenericAction,
|
|
105
105
|
assertMayDecide,
|
|
@@ -127,23 +127,26 @@ import {
|
|
|
127
127
|
fitting,
|
|
128
128
|
formatLocator,
|
|
129
129
|
formatReference,
|
|
130
|
-
googleDocumentId,
|
|
131
|
-
googleDocumentLinks,
|
|
132
130
|
hasStems,
|
|
133
131
|
hasText,
|
|
132
|
+
headerErrors,
|
|
134
133
|
historyStartKey,
|
|
135
134
|
hitFiles,
|
|
135
|
+
holdsKind,
|
|
136
|
+
holdsKindOf,
|
|
136
137
|
inSource,
|
|
137
138
|
inboxKey,
|
|
138
139
|
isAccountList,
|
|
139
140
|
isFolderProvider,
|
|
141
|
+
isImportedProvider,
|
|
140
142
|
isKind,
|
|
141
143
|
isLocator,
|
|
142
144
|
isOwnerOnlyKind,
|
|
143
145
|
isQueryLimit,
|
|
144
146
|
isStemmed,
|
|
147
|
+
jsonLine,
|
|
145
148
|
kindIn,
|
|
146
|
-
|
|
149
|
+
listedHolds,
|
|
147
150
|
looksLikeReference,
|
|
148
151
|
matchDownloads,
|
|
149
152
|
mayDecide,
|
|
@@ -165,15 +168,19 @@ import {
|
|
|
165
168
|
searchError,
|
|
166
169
|
sourceOf,
|
|
167
170
|
threadConversation,
|
|
171
|
+
typedPhone,
|
|
168
172
|
validateAst,
|
|
169
173
|
validateFields,
|
|
174
|
+
waitingPointer,
|
|
170
175
|
withoutField
|
|
171
|
-
} from "./chunk-
|
|
176
|
+
} from "./chunk-XNVFKMVR.js";
|
|
172
177
|
import {
|
|
173
178
|
MAX_TEXT_CHARS,
|
|
174
179
|
attachmentMaxBytes,
|
|
180
|
+
googleDocumentId,
|
|
181
|
+
googleDocumentLinks,
|
|
175
182
|
pdfPreviewLimits
|
|
176
|
-
} from "./chunk-
|
|
183
|
+
} from "./chunk-UPOSDTPT.js";
|
|
177
184
|
import {
|
|
178
185
|
MEETING_FIELD_NAMES,
|
|
179
186
|
MEETING_FINDINGS_KIND,
|
|
@@ -185,6 +192,7 @@ import {
|
|
|
185
192
|
createTaskService,
|
|
186
193
|
formatMeetingReference,
|
|
187
194
|
isClosedState,
|
|
195
|
+
isUsable,
|
|
188
196
|
liftMeetingFields,
|
|
189
197
|
meetingCueFingerprint,
|
|
190
198
|
meetingHitContextLimits,
|
|
@@ -199,7 +207,7 @@ import {
|
|
|
199
207
|
validateMeetingHitSearch,
|
|
200
208
|
validateMeetingPassage,
|
|
201
209
|
validateMeetingSeriesHistory
|
|
202
|
-
} from "./chunk-
|
|
210
|
+
} from "./chunk-V3NVXIQR.js";
|
|
203
211
|
import {
|
|
204
212
|
OPERATORS_BY_TYPE,
|
|
205
213
|
dateRange,
|
|
@@ -211,20 +219,24 @@ import {
|
|
|
211
219
|
validateQuery,
|
|
212
220
|
walkQuery
|
|
213
221
|
} from "./chunk-EOOGWUTP.js";
|
|
222
|
+
import {
|
|
223
|
+
isCliFailure,
|
|
224
|
+
sqliteCode
|
|
225
|
+
} from "./chunk-E4SDKMBJ.js";
|
|
214
226
|
import {
|
|
215
227
|
DEFAULT_STEMMERS,
|
|
216
228
|
createStemmer,
|
|
217
229
|
fold,
|
|
218
230
|
normalize
|
|
219
|
-
} from "./chunk-
|
|
231
|
+
} from "./chunk-ZOJU7ZFI.js";
|
|
220
232
|
import {
|
|
221
233
|
DEFAULT_TASK_CATEGORIES,
|
|
222
234
|
FALLBACK_CATEGORY
|
|
223
|
-
} from "./chunk-
|
|
235
|
+
} from "./chunk-ABYGSJZ4.js";
|
|
224
236
|
import {
|
|
225
237
|
storePath,
|
|
226
238
|
wirecatDirectory
|
|
227
|
-
} from "./chunk-
|
|
239
|
+
} from "./chunk-AEX37ETW.js";
|
|
228
240
|
import {
|
|
229
241
|
resolvePaths,
|
|
230
242
|
writeSecurely
|
|
@@ -262,7 +274,7 @@ import {
|
|
|
262
274
|
__name
|
|
263
275
|
} from "./chunk-ZVVMGPBJ.js";
|
|
264
276
|
|
|
265
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
277
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/domain/ref-arguments.js
|
|
266
278
|
var TAKES = {
|
|
267
279
|
chat: "a chat: chat:<provider>/<account>/<chat>, its id or its title",
|
|
268
280
|
message: "a message: msg:<provider>/<account>/<chat>/<message>, or a chat and the message's id"
|
|
@@ -322,7 +334,7 @@ var ensureAccount = /* @__PURE__ */ __name(async (reference, scope, profilesOn)
|
|
|
322
334
|
throw wrongAccount(reference, scope, profiles);
|
|
323
335
|
}, "ensureAccount");
|
|
324
336
|
|
|
325
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
337
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/resolve.js
|
|
326
338
|
var isId = /* @__PURE__ */ __name((reference) => /^-?\d+$/.test(reference.trim()), "isId");
|
|
327
339
|
var foldName = /* @__PURE__ */ __name((name) => name.normalize("NFC").replace(/[\uFE0E\uFE0F\u200D]/g, "").toLowerCase().replaceAll("\u0451", "\u0435"), "foldName");
|
|
328
340
|
var pickChat = /* @__PURE__ */ __name((reference, chats) => {
|
|
@@ -367,7 +379,7 @@ ${lines}`, { candidates });
|
|
|
367
379
|
}, "ambiguous");
|
|
368
380
|
var isPresent = /* @__PURE__ */ __name((value) => value !== null && value !== void 0, "isPresent");
|
|
369
381
|
|
|
370
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
382
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/services/deps.js
|
|
371
383
|
var accountStore = /* @__PURE__ */ __name(async (deps) => (await deps.store()).forAccount(await deps.account()), "accountStore");
|
|
372
384
|
var crossAccount = /* @__PURE__ */ __name((deps, _reason) => deps.store(), "crossAccount");
|
|
373
385
|
var NO_LOCAL_STORE = "this answer comes from the messenger, not from the local store";
|
|
@@ -375,9 +387,7 @@ var SQLITE_BUSY = 5;
|
|
|
375
387
|
var storeAbsent = /* @__PURE__ */ __name((error) => {
|
|
376
388
|
if (isCliFailure(error))
|
|
377
389
|
return error.code === "validation_error" && error.message === NO_LOCAL_STORE;
|
|
378
|
-
|
|
379
|
-
const code = errcode ?? errno;
|
|
380
|
-
return error instanceof Error && typeof code === "number" && (code & 255) === SQLITE_BUSY;
|
|
390
|
+
return error instanceof Error && sqliteCode(error) === SQLITE_BUSY;
|
|
381
391
|
}, "storeAbsent");
|
|
382
392
|
var accountUnknown = /* @__PURE__ */ __name((error) => isCliFailure(error) && (error.code === "not_found" || error.code === "authentication_error"), "accountUnknown");
|
|
383
393
|
var unless = /* @__PURE__ */ __name(async (work, expected2) => {
|
|
@@ -444,7 +454,7 @@ var storeOnlyDeps = /* @__PURE__ */ __name((store, account2, { app, env }) => {
|
|
|
444
454
|
return { ...storedDeps(messenger, store, account2, guard), ...env === void 0 ? {} : { env } };
|
|
445
455
|
}, "storeOnlyDeps");
|
|
446
456
|
|
|
447
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
457
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/botcheck/check.js
|
|
448
458
|
var DAY_MS = 864e5;
|
|
449
459
|
var NEW_DAYS = 30;
|
|
450
460
|
var SAME_TEXT_MIN = 20;
|
|
@@ -521,23 +531,7 @@ var scorePerson = /* @__PURE__ */ __name(({ subject, provider, activity, photos,
|
|
|
521
531
|
};
|
|
522
532
|
}, "scorePerson");
|
|
523
533
|
|
|
524
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
525
|
-
var timeLimit = /* @__PURE__ */ __name((ms) => {
|
|
526
|
-
const controller = new AbortController();
|
|
527
|
-
const timer = setTimeout(() => controller.abort(new DOMException("The operation timed out.", "TimeoutError")), ms);
|
|
528
|
-
timer.unref();
|
|
529
|
-
return { signal: controller.signal, clear: /* @__PURE__ */ __name(() => clearTimeout(timer), "clear") };
|
|
530
|
-
}, "timeLimit");
|
|
531
|
-
var withTimeLimit = /* @__PURE__ */ __name(async (ms, run) => {
|
|
532
|
-
const limit = timeLimit(ms);
|
|
533
|
-
try {
|
|
534
|
-
return await run(limit.signal);
|
|
535
|
-
} finally {
|
|
536
|
-
limit.clear();
|
|
537
|
-
}
|
|
538
|
-
}, "withTimeLimit");
|
|
539
|
-
|
|
540
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.604.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_4b96f151b4ca40121094ad166c695991/node_modules/@wirecat/cli-core/dist/botcheck/registries.js
|
|
534
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/botcheck/registries.js
|
|
541
535
|
var REGISTRIES = {
|
|
542
536
|
cas: { title: "Combot Anti-Spam (CAS)", docs: "https://cas.chat/api" },
|
|
543
537
|
lols: { title: "lols.bot", docs: "https://api.lols.bot/lols-bot.json" }
|
|
@@ -624,7 +618,7 @@ var notCovered = /* @__PURE__ */ __name((messenger, now = /* @__PURE__ */ new Da
|
|
|
624
618
|
detail: `lists Telegram accounts only, not ${messenger} ones`
|
|
625
619
|
})), "notCovered");
|
|
626
620
|
|
|
627
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
621
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/botcheck/service.js
|
|
628
622
|
var ACTIVITY_MESSAGES = 1e3;
|
|
629
623
|
var botCheckService = /* @__PURE__ */ __name((deps) => {
|
|
630
624
|
const subjectOf = /* @__PURE__ */ __name(async (reference) => {
|
|
@@ -712,7 +706,7 @@ var botCheckService = /* @__PURE__ */ __name((deps) => {
|
|
|
712
706
|
};
|
|
713
707
|
}, "botCheckService");
|
|
714
708
|
|
|
715
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
709
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/mail/owed.js
|
|
716
710
|
var mailTurn = /* @__PURE__ */ __name((newest) => {
|
|
717
711
|
if (newest === null)
|
|
718
712
|
return null;
|
|
@@ -721,7 +715,7 @@ var mailTurn = /* @__PURE__ */ __name((newest) => {
|
|
|
721
715
|
return newest.addressed ? "owed" : null;
|
|
722
716
|
}, "mailTurn");
|
|
723
717
|
|
|
724
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
718
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/services/agenda-mail.js
|
|
725
719
|
var absent = /* @__PURE__ */ __name((error) => {
|
|
726
720
|
if (error instanceof CliError && error.code === "not_found")
|
|
727
721
|
return void 0;
|
|
@@ -779,7 +773,7 @@ var mailActivity = /* @__PURE__ */ __name(async (store, account2, since, chats)
|
|
|
779
773
|
};
|
|
780
774
|
}, "mailActivity");
|
|
781
775
|
|
|
782
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
776
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/services/chat-coverage.js
|
|
783
777
|
var chatCoverage = /* @__PURE__ */ __name(async (store, account2, chatIds) => {
|
|
784
778
|
const ids = [...new Set(chatIds)];
|
|
785
779
|
if (ids.length === 0)
|
|
@@ -805,7 +799,7 @@ var chatCoverage = /* @__PURE__ */ __name(async (store, account2, chatIds) => {
|
|
|
805
799
|
}));
|
|
806
800
|
}, "chatCoverage");
|
|
807
801
|
|
|
808
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
802
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/domain/thread.js
|
|
809
803
|
var threadIdOf = /* @__PURE__ */ __name((value) => {
|
|
810
804
|
if (value === void 0)
|
|
811
805
|
return void 0;
|
|
@@ -815,7 +809,7 @@ var threadIdOf = /* @__PURE__ */ __name((value) => {
|
|
|
815
809
|
return id2;
|
|
816
810
|
}, "threadIdOf");
|
|
817
811
|
|
|
818
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
812
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/ports/messenger.js
|
|
819
813
|
var throughWrapper = /* @__PURE__ */ __name((inner, handled, wrap = (_, call) => call) => new Proxy(handled, {
|
|
820
814
|
get: /* @__PURE__ */ __name((own, key) => {
|
|
821
815
|
if (key in own)
|
|
@@ -832,15 +826,15 @@ var capability = /* @__PURE__ */ __name((adapter, method, what) => {
|
|
|
832
826
|
return found.bind(adapter);
|
|
833
827
|
}, "capability");
|
|
834
828
|
|
|
835
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
829
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/ports/traits.js
|
|
836
830
|
var syncsOneChat = /* @__PURE__ */ __name((messenger) => messenger.history !== "store" || messenger.historyOnDemand === true, "syncsOneChat");
|
|
837
831
|
|
|
838
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
832
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/sends/send-id.js
|
|
839
833
|
import { randomBytes } from "node:crypto";
|
|
840
834
|
var newSendId = /* @__PURE__ */ __name(() => randomBytes(8).readBigInt64BE().toString(), "newSendId");
|
|
841
835
|
var newOperationId = newSendId;
|
|
842
836
|
|
|
843
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
837
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/services/questions.js
|
|
844
838
|
var LINKS = /https?:\/\/\S+/g;
|
|
845
839
|
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");
|
|
846
840
|
var questions = /* @__PURE__ */ __name((messages, { answerers: answerers2, asker = "others" }) => {
|
|
@@ -870,7 +864,7 @@ var questions = /* @__PURE__ */ __name((messages, { answerers: answerers2, asker
|
|
|
870
864
|
});
|
|
871
865
|
}, "questions");
|
|
872
866
|
|
|
873
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
867
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/services/chat-stats.js
|
|
874
868
|
var TOP_POSTS = 5;
|
|
875
869
|
var JOINS = /* @__PURE__ */ new Set(["join", "add"]);
|
|
876
870
|
var LEAVES = /* @__PURE__ */ new Set(["leave", "remove"]);
|
|
@@ -987,7 +981,7 @@ var median = /* @__PURE__ */ __name((values) => {
|
|
|
987
981
|
return Math.round(sorted.length % 2 === 0 ? ((sorted[middle - 1] ?? upper) + upper) / 2 : upper);
|
|
988
982
|
}, "median");
|
|
989
983
|
|
|
990
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
984
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/services/member-history.js
|
|
991
985
|
var memberEvents = /* @__PURE__ */ __name((stays, revisions, since = 0) => {
|
|
992
986
|
const events = [];
|
|
993
987
|
for (const stay of stays) {
|
|
@@ -1019,7 +1013,7 @@ var memberEvents = /* @__PURE__ */ __name((stays, revisions, since = 0) => {
|
|
|
1019
1013
|
return events.filter(({ at }) => Date.parse(at) >= since).sort((a, b) => Date.parse(a.at) - Date.parse(b.at) || a.id.localeCompare(b.id));
|
|
1020
1014
|
}, "memberEvents");
|
|
1021
1015
|
|
|
1022
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
1016
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/services/members-audit.js
|
|
1023
1017
|
var AUDIT_PAGE = 200;
|
|
1024
1018
|
var AUDIT_BUDGET = 10;
|
|
1025
1019
|
var AUDIT_PAUSE_MS = 1e3;
|
|
@@ -1099,7 +1093,7 @@ var burstJoins = /* @__PURE__ */ __name((members) => {
|
|
|
1099
1093
|
return found;
|
|
1100
1094
|
}, "burstJoins");
|
|
1101
1095
|
|
|
1102
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
1096
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/services/message-resolution.js
|
|
1103
1097
|
var readChatId = /* @__PURE__ */ __name(async (deps, reference, store, account2) => {
|
|
1104
1098
|
if (deps.reads !== "store")
|
|
1105
1099
|
return keptChatId(deps.messenger, reference, store, account2);
|
|
@@ -1258,7 +1252,7 @@ var senderAmong = /* @__PURE__ */ __name(async (store, accounts, reference) => {
|
|
|
1258
1252
|
}
|
|
1259
1253
|
}, "senderAmong");
|
|
1260
1254
|
|
|
1261
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
1255
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/services/chats.js
|
|
1262
1256
|
var EVENTS_DAYS = 7;
|
|
1263
1257
|
var TRACKED_DAYS = 30;
|
|
1264
1258
|
var STATS_PAGE = 1e3;
|
|
@@ -1553,7 +1547,7 @@ var storedMembers = /* @__PURE__ */ __name(async (store, chatId) => {
|
|
|
1553
1547
|
return members.length === 0 ? null : members;
|
|
1554
1548
|
}, "storedMembers");
|
|
1555
1549
|
|
|
1556
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
1550
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/services/task-categories.js
|
|
1557
1551
|
var names = /* @__PURE__ */ __name((categories) => categories.map(({ name }) => name).join(", "), "names");
|
|
1558
1552
|
var taskCategoryOf = /* @__PURE__ */ __name((categories = DEFAULT_TASK_CATEGORIES, flag = "--category") => (typed) => {
|
|
1559
1553
|
const name = typed.trim().toLowerCase();
|
|
@@ -1610,7 +1604,7 @@ var categorize = /* @__PURE__ */ __name((text2, categories = DEFAULT_TASK_CATEGO
|
|
|
1610
1604
|
return best.name;
|
|
1611
1605
|
}, "categorize");
|
|
1612
1606
|
|
|
1613
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
1607
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/services/task-rules.js
|
|
1614
1608
|
var taskAccount = /* @__PURE__ */ __name(({ provider, account: account2 }) => `${provider}:${account2}`, "taskAccount");
|
|
1615
1609
|
var RULES_IN = {
|
|
1616
1610
|
dialog: "all",
|
|
@@ -1707,7 +1701,7 @@ var applyTaskRules = /* @__PURE__ */ __name(async (review, { store, account: acc
|
|
|
1707
1701
|
return result;
|
|
1708
1702
|
}, "applyTaskRules");
|
|
1709
1703
|
var ARRIVAL_WINDOW = 50;
|
|
1710
|
-
var
|
|
1704
|
+
var kindOf = /* @__PURE__ */ __name(async (store, account2, chat) => await store.chats.chatKind(account2, chat) ?? "unknown", "kindOf");
|
|
1711
1705
|
var applyTaskRulesOnArrival = /* @__PURE__ */ __name(async (store, account2, message) => {
|
|
1712
1706
|
const page = await store.messages.messages(account2, message.chatId, { limit: ARRIVAL_WINDOW });
|
|
1713
1707
|
const messages = [...page.items.filter((one2) => one2.id !== message.id), message].sort((a, b) => Date.parse(a.timestamp) - Date.parse(b.timestamp));
|
|
@@ -1716,7 +1710,7 @@ var applyTaskRulesOnArrival = /* @__PURE__ */ __name(async (store, account2, mes
|
|
|
1716
1710
|
{
|
|
1717
1711
|
id: message.chatId,
|
|
1718
1712
|
messages,
|
|
1719
|
-
kind: await
|
|
1713
|
+
kind: await kindOf(store, account2, message.chatId),
|
|
1720
1714
|
watched: (await watchedChats(store, account2)).has(message.chatId)
|
|
1721
1715
|
}
|
|
1722
1716
|
]
|
|
@@ -1808,7 +1802,7 @@ var applyTaskRulesToChats = /* @__PURE__ */ __name(async (store, account2, chatI
|
|
|
1808
1802
|
const tasks = [];
|
|
1809
1803
|
const pass = await applyTaskRules({
|
|
1810
1804
|
chats: [
|
|
1811
|
-
{ id: chat, messages: page.items, kind: await
|
|
1805
|
+
{ id: chat, messages: page.items, kind: await kindOf(store, account2, chat), watched: watched.has(chat) }
|
|
1812
1806
|
]
|
|
1813
1807
|
}, { store: store.tasks, account: account2, categories, dryRun: !yes, onHeld: /* @__PURE__ */ __name((task2) => tasks.push(task2), "onHeld") });
|
|
1814
1808
|
passes.push({ chat, messages: page.items.length, ...pass, tasks });
|
|
@@ -1816,7 +1810,7 @@ var applyTaskRulesToChats = /* @__PURE__ */ __name(async (store, account2, chatI
|
|
|
1816
1810
|
return passes;
|
|
1817
1811
|
}, "applyTaskRulesToChats");
|
|
1818
1812
|
|
|
1819
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
1813
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/services/task-tag-filters.js
|
|
1820
1814
|
var taskTagFilters = /* @__PURE__ */ __name(async (store, query) => {
|
|
1821
1815
|
const tags = /* @__PURE__ */ new Map();
|
|
1822
1816
|
for (const node of query ? walkQuery(query.root) : [])
|
|
@@ -1825,7 +1819,7 @@ var taskTagFilters = /* @__PURE__ */ __name(async (store, query) => {
|
|
|
1825
1819
|
return tags;
|
|
1826
1820
|
}, "taskTagFilters");
|
|
1827
1821
|
|
|
1828
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
1822
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/services/agenda.js
|
|
1829
1823
|
var DAY = 864e5;
|
|
1830
1824
|
var AGENDA_DEFAULTS = { unanswered: DAY, waiting: 7 * DAY };
|
|
1831
1825
|
var CLAIMS = ["none", "mine", "others", "any"];
|
|
@@ -2072,7 +2066,7 @@ var agendaItem = /* @__PURE__ */ __name((shown) => {
|
|
|
2072
2066
|
};
|
|
2073
2067
|
}, "agendaItem");
|
|
2074
2068
|
|
|
2075
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
2069
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/context/evidence-response.js
|
|
2076
2070
|
var contextSourceKey = /* @__PURE__ */ __name((source) => JSON.stringify([source.kind, source.accountId, source.provider, source.account]), "contextSourceKey");
|
|
2077
2071
|
var validateContextEvidencePage = /* @__PURE__ */ __name((page, request) => {
|
|
2078
2072
|
const fail3 = /* @__PURE__ */ __name(() => {
|
|
@@ -2136,7 +2130,7 @@ var validateContextEvidencePage = /* @__PURE__ */ __name((page, request) => {
|
|
|
2136
2130
|
}
|
|
2137
2131
|
}, "validateContextEvidencePage");
|
|
2138
2132
|
|
|
2139
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
2133
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/context/read-budget.js
|
|
2140
2134
|
var contextReadBudget = /* @__PURE__ */ __name((limits = {}) => {
|
|
2141
2135
|
if (!limits || typeof limits !== "object" || Array.isArray(limits))
|
|
2142
2136
|
throw new CliError("validation_error", "limits needs a context read allowance");
|
|
@@ -2189,7 +2183,7 @@ var contextReadBudget = /* @__PURE__ */ __name((limits = {}) => {
|
|
|
2189
2183
|
};
|
|
2190
2184
|
}, "contextReadBudget");
|
|
2191
2185
|
|
|
2192
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
2186
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/services/context-evidence.js
|
|
2193
2187
|
var createContextEvidenceReader = /* @__PURE__ */ __name((port, allowed, limits) => {
|
|
2194
2188
|
if (!port || typeof port.read !== "function")
|
|
2195
2189
|
throw new CliError("configuration_error", "context evidence reader is unavailable");
|
|
@@ -2233,7 +2227,7 @@ var createContextEvidenceReader = /* @__PURE__ */ __name((port, allowed, limits)
|
|
|
2233
2227
|
};
|
|
2234
2228
|
}, "createContextEvidenceReader");
|
|
2235
2229
|
|
|
2236
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
2230
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/services/excerpt.js
|
|
2237
2231
|
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");
|
|
2238
2232
|
var excerpt = /* @__PURE__ */ __name((text2, query, size4 = 240, options = {}) => {
|
|
2239
2233
|
const flat = text2.replace(/\s+/g, " ").trim();
|
|
@@ -2249,8 +2243,247 @@ var excerpt = /* @__PURE__ */ __name((text2, query, size4 = 240, options = {}) =
|
|
|
2249
2243
|
}, "excerpt");
|
|
2250
2244
|
var withExcerpt = /* @__PURE__ */ __name(({ matchedText, ...hit }, query) => ({ ...hit, excerpt: excerpt(matchedText ?? hit.text, query) }), "withExcerpt");
|
|
2251
2245
|
|
|
2252
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
2253
|
-
|
|
2246
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/services/ingest.js
|
|
2247
|
+
import { createInterface } from "node:readline";
|
|
2248
|
+
|
|
2249
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/domain/vcard.js
|
|
2250
|
+
import { createHash } from "node:crypto";
|
|
2251
|
+
var MAX_ID = 512;
|
|
2252
|
+
var AS_WORD = new RegExp(`^${WORD_BODY}$`);
|
|
2253
|
+
var isQuotedPrintable = /* @__PURE__ */ __name((line2) => {
|
|
2254
|
+
const colon = line2.indexOf(":");
|
|
2255
|
+
return /;(ENCODING=)?QUOTED-PRINTABLE\b/i.test(colon < 0 ? line2 : line2.slice(0, colon));
|
|
2256
|
+
}, "isQuotedPrintable");
|
|
2257
|
+
var PROPERTY_START = /^([A-Za-z0-9-]+\.)?[A-Za-z][A-Za-z0-9-]*(;[^:]*)?:/;
|
|
2258
|
+
var isSoft = /* @__PURE__ */ __name((line2) => line2 !== void 0 && isQuotedPrintable(line2) && line2.endsWith("="), "isSoft");
|
|
2259
|
+
var unfolded = /* @__PURE__ */ __name((text2) => {
|
|
2260
|
+
const lines = [];
|
|
2261
|
+
for (const raw of text2.replace(/^\uFEFF/, "").split(/\r\n|\r|\n/)) {
|
|
2262
|
+
const last2 = lines.length - 1;
|
|
2263
|
+
const previous = lines[last2];
|
|
2264
|
+
const bounds = /^(BEGIN|END):/i.test(raw);
|
|
2265
|
+
if (isSoft(previous) && !bounds && !PROPERTY_START.test(raw))
|
|
2266
|
+
lines[last2] = previous.slice(0, -1) + raw.replace(/^[ \t]/, "");
|
|
2267
|
+
else if (previous !== void 0 && /^[ \t]/.test(raw) && !bounds)
|
|
2268
|
+
lines[last2] = previous + raw.slice(1);
|
|
2269
|
+
else {
|
|
2270
|
+
if (isSoft(previous))
|
|
2271
|
+
lines[last2] = previous.slice(0, -1);
|
|
2272
|
+
lines.push(raw);
|
|
2273
|
+
}
|
|
2274
|
+
}
|
|
2275
|
+
const last = lines.length - 1;
|
|
2276
|
+
if (isSoft(lines[last]))
|
|
2277
|
+
lines[last] = lines[last].slice(0, -1);
|
|
2278
|
+
return lines.filter((line2) => line2.trim() !== "");
|
|
2279
|
+
}, "unfolded");
|
|
2280
|
+
var propertyOf = /* @__PURE__ */ __name((line2) => {
|
|
2281
|
+
let quoted = false;
|
|
2282
|
+
let colon = -1;
|
|
2283
|
+
for (let index = 0; index < line2.length; index += 1) {
|
|
2284
|
+
if (line2[index] === '"')
|
|
2285
|
+
quoted = !quoted;
|
|
2286
|
+
else if (line2[index] === ":" && !quoted) {
|
|
2287
|
+
colon = index;
|
|
2288
|
+
break;
|
|
2289
|
+
}
|
|
2290
|
+
}
|
|
2291
|
+
if (colon < 0)
|
|
2292
|
+
return void 0;
|
|
2293
|
+
const [head = "", ...rest] = line2.slice(0, colon).split(";");
|
|
2294
|
+
const params = /* @__PURE__ */ new Map();
|
|
2295
|
+
for (const part of rest) {
|
|
2296
|
+
const equals = part.indexOf("=");
|
|
2297
|
+
const key = equals < 0 ? /^(QUOTED-PRINTABLE|BASE64|8BIT|7BIT|B)$/i.test(part) ? "ENCODING" : "TYPE" : part.slice(0, equals);
|
|
2298
|
+
const values = (equals < 0 ? part : part.slice(equals + 1)).replaceAll('"', "").split(",");
|
|
2299
|
+
params.set(key.toUpperCase(), [...params.get(key.toUpperCase()) ?? [], ...values.map((one2) => one2.toUpperCase())]);
|
|
2300
|
+
}
|
|
2301
|
+
const name = head.replace(/^[^.]*\./, "").toUpperCase();
|
|
2302
|
+
return { name, params, value: line2.slice(colon + 1) };
|
|
2303
|
+
}, "propertyOf");
|
|
2304
|
+
var encoder = new TextEncoder();
|
|
2305
|
+
var decoded = /* @__PURE__ */ __name((property, report) => {
|
|
2306
|
+
const encoding = property.params.get("ENCODING")?.[0];
|
|
2307
|
+
if (encoding !== "QUOTED-PRINTABLE")
|
|
2308
|
+
return property.value;
|
|
2309
|
+
const bytes2 = [];
|
|
2310
|
+
const { value } = property;
|
|
2311
|
+
for (let index = 0; index < value.length; index += 1) {
|
|
2312
|
+
const hex = value.slice(index + 1, index + 3);
|
|
2313
|
+
if (value[index] === "=" && /^[0-9A-F]{2}$/i.test(hex)) {
|
|
2314
|
+
bytes2.push(Number.parseInt(hex, 16));
|
|
2315
|
+
index += 2;
|
|
2316
|
+
} else
|
|
2317
|
+
for (const byte of encoder.encode(value[index]))
|
|
2318
|
+
bytes2.push(byte);
|
|
2319
|
+
}
|
|
2320
|
+
const charset = property.params.get("CHARSET")?.[0]?.toLowerCase() ?? "utf-8";
|
|
2321
|
+
try {
|
|
2322
|
+
return new TextDecoder(charset).decode(new Uint8Array(bytes2));
|
|
2323
|
+
} catch {
|
|
2324
|
+
report(`${property.name} names the unknown charset ${charset}: read as UTF-8`);
|
|
2325
|
+
return new TextDecoder("utf-8").decode(new Uint8Array(bytes2));
|
|
2326
|
+
}
|
|
2327
|
+
}, "decoded");
|
|
2328
|
+
var components = /* @__PURE__ */ __name((value) => {
|
|
2329
|
+
const parts = [""];
|
|
2330
|
+
for (let index = 0; index < value.length; index += 1) {
|
|
2331
|
+
const char = value[index];
|
|
2332
|
+
if (char === "\\" && index + 1 < value.length) {
|
|
2333
|
+
const next = value[index + 1];
|
|
2334
|
+
parts[parts.length - 1] += next === "n" || next === "N" ? "\n" : next;
|
|
2335
|
+
index += 1;
|
|
2336
|
+
} else if (char === ";")
|
|
2337
|
+
parts.push("");
|
|
2338
|
+
else
|
|
2339
|
+
parts[parts.length - 1] += char;
|
|
2340
|
+
}
|
|
2341
|
+
return parts.map((part) => part.trim());
|
|
2342
|
+
}, "components");
|
|
2343
|
+
var textOf = /* @__PURE__ */ __name((property, report) => components(decoded(property, report)).join(";").trim(), "textOf");
|
|
2344
|
+
var e164 = /* @__PURE__ */ __name((typed, region) => {
|
|
2345
|
+
const text2 = typed.replace(/^tel:/i, "").replace(/;.*$/, "").trim();
|
|
2346
|
+
const international = /^(\+|00)/.test(text2);
|
|
2347
|
+
if (!international && region === void 0)
|
|
2348
|
+
return void 0;
|
|
2349
|
+
const value = typedPhone(text2, region === void 0 ? {} : { phoneCountries: [region] })?.value;
|
|
2350
|
+
return value?.startsWith("+") ? value : void 0;
|
|
2351
|
+
}, "e164");
|
|
2352
|
+
var foldedName = /* @__PURE__ */ __name((name) => name.normalize("NFKC").toLowerCase().replace(/\s+/g, " ").trim(), "foldedName");
|
|
2353
|
+
var hashed = /* @__PURE__ */ __name((prefix, parts) => `${prefix}${createHash("sha256").update(parts.join("\n")).digest("hex").slice(0, 32)}`, "hashed");
|
|
2354
|
+
var organizationId = /* @__PURE__ */ __name((name) => {
|
|
2355
|
+
const id2 = `org:${foldedName(name)}`;
|
|
2356
|
+
return id2.length <= MAX_ID ? id2 : hashed("org:", [foldedName(name)]);
|
|
2357
|
+
}, "organizationId");
|
|
2358
|
+
var titleWord = /* @__PURE__ */ __name((title) => {
|
|
2359
|
+
const word = title.toLowerCase().trim().replace(/\s+/g, "-");
|
|
2360
|
+
return AS_WORD.test(word) ? word : void 0;
|
|
2361
|
+
}, "titleWord");
|
|
2362
|
+
var nameOf = /* @__PURE__ */ __name((properties, report) => {
|
|
2363
|
+
const full = properties.find(({ name }) => name === "FN");
|
|
2364
|
+
const text2 = full ? textOf(full, report) : "";
|
|
2365
|
+
if (text2)
|
|
2366
|
+
return text2;
|
|
2367
|
+
const structured = properties.find(({ name }) => name === "N");
|
|
2368
|
+
if (!structured)
|
|
2369
|
+
return void 0;
|
|
2370
|
+
const [family = "", given = "", additional = ""] = components(decoded(structured, report));
|
|
2371
|
+
return [given, additional, family].filter(Boolean).join(" ") || void 0;
|
|
2372
|
+
}, "nameOf");
|
|
2373
|
+
var SKIPPED = /* @__PURE__ */ new Set(["PHOTO", "LOGO", "SOUND", "KEY"]);
|
|
2374
|
+
var cardsOf = /* @__PURE__ */ __name((text2) => {
|
|
2375
|
+
const cards = [];
|
|
2376
|
+
const issues = [];
|
|
2377
|
+
let card;
|
|
2378
|
+
const isBound = /* @__PURE__ */ __name((property, name) => property.name === name && property.value.trim().toUpperCase() === "VCARD", "isBound");
|
|
2379
|
+
for (const line2 of unfolded(text2)) {
|
|
2380
|
+
const property = propertyOf(line2);
|
|
2381
|
+
if (!property)
|
|
2382
|
+
continue;
|
|
2383
|
+
if (isBound(property, "BEGIN")) {
|
|
2384
|
+
if (card) {
|
|
2385
|
+
issues.push({ card: cards.length, message: "BEGIN:VCARD inside a card: the card ends there, unfinished" });
|
|
2386
|
+
cards.push(card);
|
|
2387
|
+
}
|
|
2388
|
+
card = [];
|
|
2389
|
+
} else if (isBound(property, "END")) {
|
|
2390
|
+
if (card)
|
|
2391
|
+
cards.push(card);
|
|
2392
|
+
card = void 0;
|
|
2393
|
+
} else if (card && !SKIPPED.has(property.name))
|
|
2394
|
+
card.push(property);
|
|
2395
|
+
}
|
|
2396
|
+
if (card) {
|
|
2397
|
+
issues.push({ card: cards.length, message: "the file ends inside a card, with no END:VCARD" });
|
|
2398
|
+
cards.push(card);
|
|
2399
|
+
}
|
|
2400
|
+
return { cards, issues };
|
|
2401
|
+
}, "cardsOf");
|
|
2402
|
+
var envelopeOfVcard = /* @__PURE__ */ __name((text2, { provider, account: account2, batchId, region }) => {
|
|
2403
|
+
const { cards, issues } = cardsOf(text2);
|
|
2404
|
+
const people = [];
|
|
2405
|
+
const organizations = /* @__PURE__ */ new Map();
|
|
2406
|
+
const seen = /* @__PURE__ */ new Set();
|
|
2407
|
+
for (const [index, properties] of cards.entries()) {
|
|
2408
|
+
const report = /* @__PURE__ */ __name((message) => {
|
|
2409
|
+
if (!issues.some((one2) => one2.card === index && one2.message === message))
|
|
2410
|
+
issues.push({ card: index, message });
|
|
2411
|
+
}, "report");
|
|
2412
|
+
const values = /* @__PURE__ */ __name((wanted) => properties.filter(({ name: name2 }) => name2 === wanted).map((one2) => textOf(one2, report)).filter(Boolean), "values");
|
|
2413
|
+
const name = nameOf(properties, report);
|
|
2414
|
+
const phones = [];
|
|
2415
|
+
const unread = [];
|
|
2416
|
+
for (const typed of values("TEL")) {
|
|
2417
|
+
const value = e164(typed, region);
|
|
2418
|
+
if (value !== void 0) {
|
|
2419
|
+
if (!phones.includes(value))
|
|
2420
|
+
phones.push(value);
|
|
2421
|
+
} else {
|
|
2422
|
+
unread.push(typed);
|
|
2423
|
+
issues.push({
|
|
2424
|
+
card: index,
|
|
2425
|
+
message: `${typed} has no country code${region === void 0 ? " and no region was given" : ` in ${region}`}: kept, not matched`
|
|
2426
|
+
});
|
|
2427
|
+
}
|
|
2428
|
+
}
|
|
2429
|
+
const emails = [...new Set(values("EMAIL").map((one2) => one2.replace(/^mailto:/i, "").toLowerCase()))];
|
|
2430
|
+
if (name === void 0 && phones.length === 0 && unread.length === 0 && emails.length === 0) {
|
|
2431
|
+
report("the card holds no name, number or address: left out");
|
|
2432
|
+
continue;
|
|
2433
|
+
}
|
|
2434
|
+
const uid = values("UID")[0];
|
|
2435
|
+
const externalId = uid === void 0 ? hashed("vcard:", [name ?? "", ...[...phones].sort(), ...emails.sort()]) : uid.length <= MAX_ID ? uid : hashed("vcard:", [uid]);
|
|
2436
|
+
if (seen.has(externalId)) {
|
|
2437
|
+
issues.push({ card: index, message: `another card of the file is ${externalId}: left out` });
|
|
2438
|
+
continue;
|
|
2439
|
+
}
|
|
2440
|
+
seen.add(externalId);
|
|
2441
|
+
const organization = properties.find(({ name: name2 }) => name2 === "ORG");
|
|
2442
|
+
const organizationName = organization ? components(decoded(organization, report))[0] : void 0;
|
|
2443
|
+
const title = values("TITLE")[0];
|
|
2444
|
+
const relations = [];
|
|
2445
|
+
if (organizationName) {
|
|
2446
|
+
const id2 = organizationId(organizationName);
|
|
2447
|
+
if (!organizations.has(id2))
|
|
2448
|
+
organizations.set(id2, {
|
|
2449
|
+
key: id2,
|
|
2450
|
+
type: "organization",
|
|
2451
|
+
external_id: id2,
|
|
2452
|
+
operation: "upsert",
|
|
2453
|
+
fields: { name: organizationName }
|
|
2454
|
+
});
|
|
2455
|
+
const as = title === void 0 ? void 0 : titleWord(title);
|
|
2456
|
+
relations.push({ role: "member-of", type: "organization", external_id: id2, ...as ? { as } : {} });
|
|
2457
|
+
}
|
|
2458
|
+
people.push({
|
|
2459
|
+
key: `person:${externalId}`,
|
|
2460
|
+
type: "person",
|
|
2461
|
+
external_id: externalId,
|
|
2462
|
+
operation: "upsert",
|
|
2463
|
+
fields: {
|
|
2464
|
+
...name === void 0 ? {} : { name },
|
|
2465
|
+
...phones.length ? { phone: phones } : {},
|
|
2466
|
+
...emails.length ? { email: emails } : {},
|
|
2467
|
+
...unread.length ? { phone_unread: unread } : {},
|
|
2468
|
+
...organizationName ? { organization: organizationName } : {},
|
|
2469
|
+
...title === void 0 ? {} : { title }
|
|
2470
|
+
},
|
|
2471
|
+
...relations.length ? { relations } : {}
|
|
2472
|
+
});
|
|
2473
|
+
}
|
|
2474
|
+
return {
|
|
2475
|
+
envelope: {
|
|
2476
|
+
schema_version: 1,
|
|
2477
|
+
source: { provider, account: account2, batch_id: batchId },
|
|
2478
|
+
...region === void 0 ? {} : { options: { phone_region: region } },
|
|
2479
|
+
records: [...organizations.values(), ...people]
|
|
2480
|
+
},
|
|
2481
|
+
issues
|
|
2482
|
+
};
|
|
2483
|
+
}, "envelopeOfVcard");
|
|
2484
|
+
|
|
2485
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/services/ingest.js
|
|
2486
|
+
var emptyReceipt = /* @__PURE__ */ __name((dryRun, errors) => ({
|
|
2254
2487
|
dryRun,
|
|
2255
2488
|
source: null,
|
|
2256
2489
|
created: 0,
|
|
@@ -2261,70 +2494,91 @@ var emptyReceipt = /* @__PURE__ */ __name((dryRun) => ({
|
|
|
2261
2494
|
proposed: [],
|
|
2262
2495
|
waiting: [],
|
|
2263
2496
|
flagged: [],
|
|
2264
|
-
|
|
2497
|
+
unmatched: [],
|
|
2498
|
+
ignored: [],
|
|
2499
|
+
errors,
|
|
2500
|
+
truncated: false
|
|
2265
2501
|
}), "emptyReceipt");
|
|
2266
|
-
var
|
|
2267
|
-
|
|
2268
|
-
|
|
2269
|
-
|
|
2270
|
-
|
|
2271
|
-
|
|
2272
|
-
|
|
2273
|
-
|
|
2274
|
-
|
|
2275
|
-
|
|
2276
|
-
|
|
2277
|
-
|
|
2278
|
-
const valid = record2;
|
|
2279
|
-
if (errors.length === 0 && keys.has(valid.key))
|
|
2280
|
-
errors.push({
|
|
2281
|
-
pointer: pointerOf("records", index, "key"),
|
|
2282
|
-
code: "record.duplicate-key",
|
|
2283
|
-
message: "another record of this envelope has this key",
|
|
2284
|
-
key: valid.key
|
|
2285
|
-
});
|
|
2286
|
-
const identity = errors.length === 0 ? `${valid.type}\0${valid.external_id}` : "";
|
|
2287
|
-
if (errors.length === 0 && identities.has(identity))
|
|
2288
|
-
errors.push({
|
|
2289
|
-
pointer: pointerOf("records", index, "external_id"),
|
|
2290
|
-
code: "record.duplicate",
|
|
2291
|
-
message: `another record of this envelope is ${valid.type} ${valid.external_id}`,
|
|
2292
|
-
key: valid.key
|
|
2293
|
-
});
|
|
2294
|
-
if (errors.length > 0) {
|
|
2295
|
-
receipt.refused += 1;
|
|
2296
|
-
for (const error of errors)
|
|
2297
|
-
receipt.errors.push(error);
|
|
2298
|
-
continue;
|
|
2299
|
-
}
|
|
2300
|
-
keys.add(valid.key);
|
|
2301
|
-
identities.add(identity);
|
|
2302
|
-
taken.push({ index, record: valid });
|
|
2303
|
-
}
|
|
2304
|
-
const written = await store.records.write(source, taken, { dryRun, chunk });
|
|
2305
|
-
for (const outcome2 of written.outcomes) {
|
|
2306
|
-
receipt[outcome2.status] += 1;
|
|
2307
|
-
if (outcome2.error)
|
|
2308
|
-
receipt.errors.push(outcome2.error);
|
|
2309
|
-
}
|
|
2310
|
-
for (const error of written.laterErrors)
|
|
2311
|
-
receipt.errors.push(error);
|
|
2312
|
-
receipt.errors.sort((a, b) => a.pointer.localeCompare(b.pointer, "en", { numeric: true }));
|
|
2313
|
-
receipt.proposed = written.proposed;
|
|
2314
|
-
receipt.waiting = written.waiting.map(({ index, key, missing: missing4 }) => ({
|
|
2502
|
+
var receiptOf = /* @__PURE__ */ __name((dryRun, source, run) => ({
|
|
2503
|
+
dryRun,
|
|
2504
|
+
source: { provider: source.provider, account: source.account, batchId: source.batch_id },
|
|
2505
|
+
created: run.created,
|
|
2506
|
+
updated: run.updated,
|
|
2507
|
+
unchanged: run.unchanged,
|
|
2508
|
+
deleted: run.deleted,
|
|
2509
|
+
refused: run.refused,
|
|
2510
|
+
proposed: run.proposed,
|
|
2511
|
+
waiting: run.waiting.map(({ index, key, missing: missing4 }) => ({ key, pointer: waitingPointer(index, missing4), missing: missing4 })),
|
|
2512
|
+
flagged: run.flagged.map(({ index, ...flag }) => ({ ...flag, pointer: pointerOf("records", index) })),
|
|
2513
|
+
unmatched: run.unmatched.map(({ index, key, reason, candidates }) => ({
|
|
2315
2514
|
key,
|
|
2316
|
-
pointer: pointerOf("records", index, "
|
|
2317
|
-
|
|
2318
|
-
|
|
2319
|
-
|
|
2515
|
+
pointer: pointerOf("records", index, "fields"),
|
|
2516
|
+
reason,
|
|
2517
|
+
candidates
|
|
2518
|
+
})),
|
|
2519
|
+
ignored: run.ignored.map(({ index, key, at, reason }) => ({
|
|
2320
2520
|
key,
|
|
2321
|
-
pointer: pointerOf("records", index),
|
|
2322
|
-
|
|
2323
|
-
}))
|
|
2324
|
-
|
|
2521
|
+
pointer: pointerOf("records", index, ...at),
|
|
2522
|
+
reason
|
|
2523
|
+
})),
|
|
2524
|
+
errors: run.errors,
|
|
2525
|
+
truncated: run.truncated
|
|
2526
|
+
}), "receiptOf");
|
|
2527
|
+
var itemOf = /* @__PURE__ */ __name((record2, index) => {
|
|
2528
|
+
const errors = recordErrors(record2, index);
|
|
2529
|
+
return { index, record: record2, ...errors.length > 0 ? { errors } : {} };
|
|
2530
|
+
}, "itemOf");
|
|
2531
|
+
var refusedAll = /* @__PURE__ */ __name((dryRun, errors, onIssue) => {
|
|
2532
|
+
for (const error of errors)
|
|
2533
|
+
onIssue?.(error);
|
|
2534
|
+
return emptyReceipt(dryRun, errors);
|
|
2535
|
+
}, "refusedAll");
|
|
2536
|
+
var ingest = /* @__PURE__ */ __name(async (store, envelope, { account: account2, dryRun = false, chunk = 1e3, onIssue }) => {
|
|
2537
|
+
const broken2 = envelopeErrors(envelope, account2);
|
|
2538
|
+
if (broken2.length > 0)
|
|
2539
|
+
return refusedAll(dryRun, broken2, onIssue);
|
|
2540
|
+
const { source, records, options } = envelope;
|
|
2541
|
+
const items = records.map(itemOf);
|
|
2542
|
+
return receiptOf(dryRun, source, await store.records.run(source, items, { dryRun, chunk, options, onIssue }));
|
|
2325
2543
|
}, "ingest");
|
|
2544
|
+
var jsonlLines = /* @__PURE__ */ __name((stream) => createInterface({ input: stream, crlfDelay: Number.POSITIVE_INFINITY }), "jsonlLines");
|
|
2545
|
+
var ingestLines = /* @__PURE__ */ __name(async (store, lines, { account: account2, dryRun = false, chunk = 1e3, onIssue }) => {
|
|
2546
|
+
const iterator = lines[Symbol.asyncIterator]();
|
|
2547
|
+
let header = {};
|
|
2548
|
+
for (let next = await iterator.next(); !next.done; next = await iterator.next())
|
|
2549
|
+
if (next.value.trim() !== "" && next.value !== "\uFEFF") {
|
|
2550
|
+
header = jsonLine(next.value);
|
|
2551
|
+
break;
|
|
2552
|
+
}
|
|
2553
|
+
const broken2 = headerErrors(header, account2);
|
|
2554
|
+
if (broken2.length > 0) {
|
|
2555
|
+
await iterator.return?.();
|
|
2556
|
+
return refusedAll(dryRun, broken2, onIssue);
|
|
2557
|
+
}
|
|
2558
|
+
const { source, options } = header;
|
|
2559
|
+
async function* items() {
|
|
2560
|
+
let index = 0;
|
|
2561
|
+
for (let next = await iterator.next(); !next.done; next = await iterator.next()) {
|
|
2562
|
+
if (next.value.trim() === "")
|
|
2563
|
+
continue;
|
|
2564
|
+
yield itemOf(jsonLine(next.value), index);
|
|
2565
|
+
index += 1;
|
|
2566
|
+
}
|
|
2567
|
+
}
|
|
2568
|
+
__name(items, "items");
|
|
2569
|
+
return receiptOf(dryRun, source, await store.records.run(source, items(), { dryRun, chunk, options, onIssue }));
|
|
2570
|
+
}, "ingestLines");
|
|
2571
|
+
var ingestVcard = /* @__PURE__ */ __name(async (store, text2, { provider, batchId, region, ...options }) => {
|
|
2572
|
+
const { envelope, issues } = envelopeOfVcard(text2, {
|
|
2573
|
+
provider,
|
|
2574
|
+
account: options.account,
|
|
2575
|
+
batchId,
|
|
2576
|
+
...region === void 0 ? {} : { region }
|
|
2577
|
+
});
|
|
2578
|
+
return { ...await ingest(store, envelope, options), vcard: issues };
|
|
2579
|
+
}, "ingestVcard");
|
|
2326
2580
|
|
|
2327
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
2581
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/services/link-scorers/shared.js
|
|
2328
2582
|
var escaped = /* @__PURE__ */ __name((text2) => text2.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), "escaped");
|
|
2329
2583
|
var folded = /* @__PURE__ */ __name((text2) => text2.normalize("NFKC").toLowerCase().replace(/\s+/gu, " "), "folded");
|
|
2330
2584
|
var wholeWords = /* @__PURE__ */ __name((term) => new RegExp(`(?<![\\p{L}\\p{N}\\p{M}_])${escaped(normalizeVocabularyName(term))}(?![\\p{L}\\p{N}\\p{M}_])`, "u"), "wholeWords");
|
|
@@ -2351,7 +2605,10 @@ var personRefOf = /* @__PURE__ */ __name(async (store, provider, id2) => {
|
|
|
2351
2605
|
const person = await store.people.personOf({ provider, id: id2 });
|
|
2352
2606
|
return person ? `person:${person.uid}` : void 0;
|
|
2353
2607
|
}, "personRefOf");
|
|
2354
|
-
var projectsOf = /* @__PURE__ */ __name(async (store, person
|
|
2608
|
+
var projectsOf = /* @__PURE__ */ __name(async (store, person, project) => (/* @__PURE__ */ new Set([
|
|
2609
|
+
project,
|
|
2610
|
+
...(await store.knowledge.relations(null, person)).filter((one2) => isUsable(one2.standing) && one2.kind === "member-of" && one2.from === person && one2.to.startsWith("project:")).map((one2) => one2.to)
|
|
2611
|
+
])).size, "projectsOf");
|
|
2355
2612
|
var identitiesIn = /* @__PURE__ */ __name(async (store, people, provider) => {
|
|
2356
2613
|
const found = [];
|
|
2357
2614
|
for (const person of people) {
|
|
@@ -2363,7 +2620,7 @@ var identitiesIn = /* @__PURE__ */ __name(async (store, people, provider) => {
|
|
|
2363
2620
|
return found;
|
|
2364
2621
|
}, "identitiesIn");
|
|
2365
2622
|
|
|
2366
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
2623
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/services/link-scorers/alias-hits.js
|
|
2367
2624
|
var SEARCH_LIMIT = 500;
|
|
2368
2625
|
var aliasWeight = /* @__PURE__ */ __name((hits) => hits >= 10 ? 0.55 : hits >= 3 ? 0.35 : 0, "aliasWeight");
|
|
2369
2626
|
var aliasHits = {
|
|
@@ -2412,15 +2669,17 @@ var aliasHits = {
|
|
|
2412
2669
|
}, "candidates")
|
|
2413
2670
|
};
|
|
2414
2671
|
|
|
2415
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
2672
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/services/link-scorers/chat-senders.js
|
|
2416
2673
|
var WEIGHT = 0.5;
|
|
2417
2674
|
var LARGE_GROUP_WEIGHT = 0.2;
|
|
2418
2675
|
var LARGE_GROUP = 30;
|
|
2676
|
+
var SMALL_CHAT = 10;
|
|
2419
2677
|
var MIN_MESSAGES = 5;
|
|
2420
2678
|
var READ_LIMIT = 2e3;
|
|
2421
2679
|
var chatSenders = {
|
|
2422
2680
|
id: "chat-senders",
|
|
2423
|
-
version:
|
|
2681
|
+
version: 2,
|
|
2682
|
+
spreads: true,
|
|
2424
2683
|
candidates: /* @__PURE__ */ __name(async ({ store, project, confirmed, sources, since, owner, signal }) => {
|
|
2425
2684
|
if (!project)
|
|
2426
2685
|
return [];
|
|
@@ -2444,7 +2703,7 @@ var chatSenders = {
|
|
|
2444
2703
|
const size4 = Math.max((await store.roster.members(key, reference.chat)).length, senders.size);
|
|
2445
2704
|
const weight = size4 > LARGE_GROUP ? LARGE_GROUP_WEIGHT : WEIGHT;
|
|
2446
2705
|
for (const [id2, { count: count2, last }] of senders) {
|
|
2447
|
-
if (count2 < MIN_MESSAGES)
|
|
2706
|
+
if (size4 > SMALL_CHAT && count2 < MIN_MESSAGES)
|
|
2448
2707
|
continue;
|
|
2449
2708
|
const person = await personRefOf(store, key.provider, id2);
|
|
2450
2709
|
if (!person || person === owner)
|
|
@@ -2464,7 +2723,7 @@ var chatSenders = {
|
|
|
2464
2723
|
}, "candidates")
|
|
2465
2724
|
};
|
|
2466
2725
|
|
|
2467
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
2726
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/services/link-scorers/chat-title.js
|
|
2468
2727
|
var WEIGHT2 = 0.7;
|
|
2469
2728
|
var chatTitle = {
|
|
2470
2729
|
id: "chat-title",
|
|
@@ -2503,7 +2762,7 @@ var chatTitle = {
|
|
|
2503
2762
|
}, "candidates")
|
|
2504
2763
|
};
|
|
2505
2764
|
|
|
2506
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
2765
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/services/link-scorers/email-domain.js
|
|
2507
2766
|
var WEIGHT3 = 0.3;
|
|
2508
2767
|
var CONTACTS = 500;
|
|
2509
2768
|
var MOST_PAIRS = 200;
|
|
@@ -2564,13 +2823,14 @@ var emailDomain = {
|
|
|
2564
2823
|
}, "candidates")
|
|
2565
2824
|
};
|
|
2566
2825
|
|
|
2567
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
2826
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/services/link-scorers/mail-thread.js
|
|
2568
2827
|
var NAMED = 0.7;
|
|
2569
2828
|
var MEMBER_ONLY = 0.3;
|
|
2570
2829
|
var READ_LIMIT2 = 500;
|
|
2571
2830
|
var mailThread = {
|
|
2572
2831
|
id: "mail-thread",
|
|
2573
2832
|
version: 1,
|
|
2833
|
+
spreads: true,
|
|
2574
2834
|
candidates: /* @__PURE__ */ __name(async ({ store, project, confirmed, sources, since, owner, signal }) => {
|
|
2575
2835
|
if (!project)
|
|
2576
2836
|
return [];
|
|
@@ -2637,11 +2897,12 @@ var mailThread = {
|
|
|
2637
2897
|
}, "candidates")
|
|
2638
2898
|
};
|
|
2639
2899
|
|
|
2640
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
2900
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/services/link-scorers/member-chats.js
|
|
2641
2901
|
var WEIGHT4 = 0.5;
|
|
2642
2902
|
var memberChats = {
|
|
2643
2903
|
id: "member-chats",
|
|
2644
2904
|
version: 1,
|
|
2905
|
+
spreads: true,
|
|
2645
2906
|
candidates: /* @__PURE__ */ __name(async ({ store, project, confirmed, sources, owner, signal }) => {
|
|
2646
2907
|
if (!project)
|
|
2647
2908
|
return [];
|
|
@@ -2677,11 +2938,12 @@ var memberChats = {
|
|
|
2677
2938
|
}, "candidates")
|
|
2678
2939
|
};
|
|
2679
2940
|
|
|
2680
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
2941
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/services/link-scorers/member-dialog.js
|
|
2681
2942
|
var WEIGHT5 = 0.6;
|
|
2682
2943
|
var memberDialog = {
|
|
2683
2944
|
id: "member-dialog",
|
|
2684
|
-
version:
|
|
2945
|
+
version: 2,
|
|
2946
|
+
spreads: true,
|
|
2685
2947
|
candidates: /* @__PURE__ */ __name(async ({ store, project, confirmed, sources, owner, signal }) => {
|
|
2686
2948
|
if (!project)
|
|
2687
2949
|
return [];
|
|
@@ -2695,7 +2957,7 @@ var memberDialog = {
|
|
|
2695
2957
|
if (chat.kind !== "dialog")
|
|
2696
2958
|
continue;
|
|
2697
2959
|
if (!projects.has(person))
|
|
2698
|
-
projects.set(person,
|
|
2960
|
+
projects.set(person, await projectsOf(store, person, project.ref));
|
|
2699
2961
|
const shared = projects.get(person) ?? 1;
|
|
2700
2962
|
found.push({
|
|
2701
2963
|
from: chatRef(key, chat.id),
|
|
@@ -2711,7 +2973,7 @@ var memberDialog = {
|
|
|
2711
2973
|
}, "candidates")
|
|
2712
2974
|
};
|
|
2713
2975
|
|
|
2714
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
2976
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/services/project-purposes.js
|
|
2715
2977
|
var BUILT_IN_PURPOSES = ["work", "sales", "support", "other"];
|
|
2716
2978
|
var DEFAULT_PURPOSES = ["work"];
|
|
2717
2979
|
var LINK_PURPOSE = "work";
|
|
@@ -2741,7 +3003,7 @@ var purposeList = /* @__PURE__ */ __name((value, previous = []) => [
|
|
|
2741
3003
|
...value.split(",").map((one2) => one2.trim()).filter(Boolean)
|
|
2742
3004
|
], "purposeList");
|
|
2743
3005
|
|
|
2744
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
3006
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/services/project-gathering-around.js
|
|
2745
3007
|
var storedMessageNeighbours = /* @__PURE__ */ __name((messages) => ({
|
|
2746
3008
|
async around(ref, window2) {
|
|
2747
3009
|
const at = parseLocator(ref);
|
|
@@ -2837,8 +3099,8 @@ var storedNeighbours = /* @__PURE__ */ __name((store) => {
|
|
|
2837
3099
|
};
|
|
2838
3100
|
}, "storedNeighbours");
|
|
2839
3101
|
|
|
2840
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
2841
|
-
import { createHash } from "node:crypto";
|
|
3102
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/services/project-gathering-request.js
|
|
3103
|
+
import { createHash as createHash2 } from "node:crypto";
|
|
2842
3104
|
var DAY2 = 864e5;
|
|
2843
3105
|
var MAX_TIME = 864e13;
|
|
2844
3106
|
var CONTEXT_CHUNK_DAYS = 90;
|
|
@@ -3054,7 +3316,7 @@ var projectGatheringRequest = /* @__PURE__ */ __name((input, now) => {
|
|
|
3054
3316
|
]));
|
|
3055
3317
|
if (budgets.maxPageBytes > budgets.maxReadBytes)
|
|
3056
3318
|
budgets.maxPageBytes = budgets.maxReadBytes;
|
|
3057
|
-
const fingerprint =
|
|
3319
|
+
const fingerprint = createHash2("sha256").update(JSON.stringify([
|
|
3058
3320
|
"project-gathering-v1",
|
|
3059
3321
|
project,
|
|
3060
3322
|
lanes,
|
|
@@ -3066,7 +3328,7 @@ var projectGatheringRequest = /* @__PURE__ */ __name((input, now) => {
|
|
|
3066
3328
|
asOf,
|
|
3067
3329
|
fetch2
|
|
3068
3330
|
])).digest("hex");
|
|
3069
|
-
const linkedKey = linkedChats.length ?
|
|
3331
|
+
const linkedKey = linkedChats.length ? createHash2("sha256").update(JSON.stringify(linkedChats.map((c) => c.ref))).digest("hex") : void 0;
|
|
3070
3332
|
const runKey = input.runKey === void 0 ? fingerprint : text(input.runKey, "runKey", 256);
|
|
3071
3333
|
if (input.checkpoint !== void 0 && typeof input.checkpoint !== "string")
|
|
3072
3334
|
fail("checkpoint must be text", "checkpoint");
|
|
@@ -3131,7 +3393,7 @@ var projectUnits = /* @__PURE__ */ __name((plan, window2) => {
|
|
|
3131
3393
|
fail(`${units2.length} lane \xD7 source \xD7 90-day reads exceed ${LIMITS.units}; narrow the lanes, sources or window`);
|
|
3132
3394
|
return units2;
|
|
3133
3395
|
}, "projectUnits");
|
|
3134
|
-
var seenKey = /* @__PURE__ */ __name((ref) =>
|
|
3396
|
+
var seenKey = /* @__PURE__ */ __name((ref) => createHash2("sha256").update(ref).digest("base64url").slice(0, 16), "seenKey");
|
|
3135
3397
|
var encodeCheckpoint = /* @__PURE__ */ __name((checkpoint) => Buffer.from(JSON.stringify(checkpoint)).toString("base64url"), "encodeCheckpoint");
|
|
3136
3398
|
var decodeCheckpoint = /* @__PURE__ */ __name((text2, plan) => {
|
|
3137
3399
|
let value;
|
|
@@ -3153,7 +3415,7 @@ var decodeCheckpoint = /* @__PURE__ */ __name((text2, plan) => {
|
|
|
3153
3415
|
return value;
|
|
3154
3416
|
}, "decodeCheckpoint");
|
|
3155
3417
|
|
|
3156
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
3418
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/services/project-gathering.js
|
|
3157
3419
|
var terminal = /* @__PURE__ */ new Set(["done", "unavailable", "failed"]);
|
|
3158
3420
|
var PAGE = 20;
|
|
3159
3421
|
var PEOPLE = 20;
|
|
@@ -3557,7 +3819,7 @@ var peopleOf = /* @__PURE__ */ __name((items, senderOf) => {
|
|
|
3557
3819
|
return [...byKey.values()].sort((a, b) => b.items - a.items || a.name.localeCompare(b.name));
|
|
3558
3820
|
}, "peopleOf");
|
|
3559
3821
|
|
|
3560
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
3822
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/services/meeting-project-candidate-matching.js
|
|
3561
3823
|
var normalizedText = /* @__PURE__ */ __name((text2) => text2.normalize("NFKC").toLowerCase().replace(/\s+/gu, " "), "normalizedText");
|
|
3562
3824
|
var termsOf = /* @__PURE__ */ __name((entry) => [
|
|
3563
3825
|
{ name: entry.name, kind: "canonical" },
|
|
@@ -3622,7 +3884,7 @@ var matchProjectCandidates = /* @__PURE__ */ __name((catalog, input) => matchVoc
|
|
|
3622
3884
|
omittedMatches: omitted
|
|
3623
3885
|
})), "matchProjectCandidates");
|
|
3624
3886
|
|
|
3625
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
3887
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/services/project-gathering-mentions.js
|
|
3626
3888
|
var KINDS = ["project", "tag", "topic"];
|
|
3627
3889
|
var findEvidenceMentions = /* @__PURE__ */ __name(async (vocabulary, gathering, options = {}) => {
|
|
3628
3890
|
if (typeof vocabulary?.vocabulary !== "function")
|
|
@@ -3677,7 +3939,7 @@ var findEvidenceMentions = /* @__PURE__ */ __name(async (vocabulary, gathering,
|
|
|
3677
3939
|
};
|
|
3678
3940
|
}, "findEvidenceMentions");
|
|
3679
3941
|
|
|
3680
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
3942
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/services/stored-project-gathering.js
|
|
3681
3943
|
var storedChatCount = /* @__PURE__ */ __name((store) => async (account2, chatId, { since, until }) => {
|
|
3682
3944
|
const window2 = { since: new Date(since).toISOString(), until: new Date(until - 1).toISOString() };
|
|
3683
3945
|
const [messages, newest, oldest] = await Promise.all([
|
|
@@ -3772,7 +4034,7 @@ var proposedLinksOf = /* @__PURE__ */ __name(async (store, project) => {
|
|
|
3772
4034
|
}
|
|
3773
4035
|
];
|
|
3774
4036
|
}).sort((a, b) => Number(a.id) - Number(b.id));
|
|
3775
|
-
const legacy = (await store.knowledge.relations(null, project)).filter((one2) =>
|
|
4037
|
+
const legacy = (await store.knowledge.relations(null, project)).filter((one2) => one2.standing === "proposed" && one2.kind === "member-of" && one2.to === project).map((one2) => ({ from: one2.from, id: `link:${one2.id}`, role: one2.role, purpose: one2.purpose }));
|
|
3776
4038
|
return [...proposals, ...legacy];
|
|
3777
4039
|
}, "proposedLinksOf");
|
|
3778
4040
|
var memberRefsOf = /* @__PURE__ */ __name(async (store, project, includeProposed) => {
|
|
@@ -3780,7 +4042,7 @@ var memberRefsOf = /* @__PURE__ */ __name(async (store, project, includeProposed
|
|
|
3780
4042
|
return [];
|
|
3781
4043
|
const confirmed = /* @__PURE__ */ new Set();
|
|
3782
4044
|
for (const relation of await store.knowledge.relations(null, project))
|
|
3783
|
-
if (relation.
|
|
4045
|
+
if (isUsable(relation.standing) && relation.kind === "member-of" && relation.to === project && /^person:.+/.test(relation.from))
|
|
3784
4046
|
confirmed.add(relation.from);
|
|
3785
4047
|
const members = [...confirmed].sort().map((ref) => ({ ref }));
|
|
3786
4048
|
if (!includeProposed)
|
|
@@ -3818,7 +4080,7 @@ var linkedChatsOf = /* @__PURE__ */ __name(async (store, project, options = {})
|
|
|
3818
4080
|
return [];
|
|
3819
4081
|
const chats = [];
|
|
3820
4082
|
for (const relation of await store.knowledge.relations(null, project)) {
|
|
3821
|
-
if (!relation.
|
|
4083
|
+
if (!isUsable(relation.standing) || relation.kind !== "member-of" || relation.to !== project)
|
|
3822
4084
|
continue;
|
|
3823
4085
|
const reference = chatOf2(relation.from);
|
|
3824
4086
|
if (reference)
|
|
@@ -3983,13 +4245,14 @@ var purposeHintOf = /* @__PURE__ */ __name((linked, rows, of) => {
|
|
|
3983
4245
|
return { chat: top.ref, relationship: link4.relationship, items, of };
|
|
3984
4246
|
}, "purposeHintOf");
|
|
3985
4247
|
|
|
3986
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
4248
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/services/link-scorers/scan.js
|
|
3987
4249
|
var SCORERS = [chatTitle, aliasHits, memberChats, memberDialog, chatSenders, mailThread];
|
|
3988
4250
|
var PERSON_SCORERS = [emailDomain];
|
|
3989
4251
|
var SCAN_BOT = { bot: "memo-scan", kind: "rule" };
|
|
3990
4252
|
var DEFAULT_THRESHOLD = 0.5;
|
|
3991
4253
|
var PERSON_THRESHOLD = 0.3;
|
|
3992
4254
|
var DEFAULT_LIMIT = 20;
|
|
4255
|
+
var MAX_HOPS = 4;
|
|
3993
4256
|
var projectOf2 = /* @__PURE__ */ __name(async (store, reference) => {
|
|
3994
4257
|
const ref = await canonicalProjectRef(store, reference);
|
|
3995
4258
|
const entry = (await store.knowledge.vocabulary({ kind: "project" })).entries.find((one2) => one2.id === ref.slice(8));
|
|
@@ -4000,7 +4263,7 @@ var projectOf2 = /* @__PURE__ */ __name(async (store, reference) => {
|
|
|
4000
4263
|
var confirmedOf = /* @__PURE__ */ __name(async (store, project) => {
|
|
4001
4264
|
if (!project)
|
|
4002
4265
|
return { chats: [], people: [] };
|
|
4003
|
-
const members = (await store.knowledge.relations(null, project.ref)).filter((one2) => one2.
|
|
4266
|
+
const members = (await store.knowledge.relations(null, project.ref)).filter((one2) => isUsable(one2.standing) && one2.kind === "member-of" && one2.to === project.ref);
|
|
4004
4267
|
return {
|
|
4005
4268
|
chats: [...new Set(members.map((one2) => one2.from).filter((ref) => ref.startsWith("chat:")))].sort(),
|
|
4006
4269
|
people: [...new Set(members.map((one2) => one2.from).filter((ref) => ref.startsWith("person:")))].sort()
|
|
@@ -4056,56 +4319,28 @@ var scanProjectLinks = /* @__PURE__ */ __name(async (store, input) => {
|
|
|
4056
4319
|
nameOnly: 0,
|
|
4057
4320
|
unresolved: 0
|
|
4058
4321
|
};
|
|
4059
|
-
const
|
|
4060
|
-
const
|
|
4061
|
-
|
|
4062
|
-
|
|
4063
|
-
|
|
4064
|
-
|
|
4065
|
-
|
|
4066
|
-
|
|
4067
|
-
|
|
4068
|
-
|
|
4069
|
-
|
|
4070
|
-
|
|
4071
|
-
|
|
4072
|
-
|
|
4073
|
-
|
|
4074
|
-
|
|
4075
|
-
skipped.unresolved++;
|
|
4076
|
-
continue;
|
|
4077
|
-
}
|
|
4078
|
-
const weight = Math.min(1, Math.max(0, candidate.weight));
|
|
4079
|
-
const held = pairs.get(key) ?? { candidate, signals: /* @__PURE__ */ new Map() };
|
|
4080
|
-
const scorerId = `${scorer.id}@${scorer.version}`;
|
|
4081
|
-
const before2 = held.signals.get(scorerId);
|
|
4082
|
-
if (!before2 || before2.weight < weight)
|
|
4083
|
-
held.signals.set(scorerId, {
|
|
4084
|
-
scorer: scorerId,
|
|
4085
|
-
weight,
|
|
4086
|
-
why: candidate.why.slice(0, 500),
|
|
4087
|
-
...candidate.purpose && scorerInput.purposes.includes(candidate.purpose) ? { purpose: candidate.purpose } : {}
|
|
4088
|
-
});
|
|
4089
|
-
held.candidate = {
|
|
4090
|
-
...held.candidate,
|
|
4091
|
-
evidence: [.../* @__PURE__ */ new Set([...held.candidate.evidence, ...candidate.evidence])]
|
|
4092
|
-
};
|
|
4093
|
-
pairs.set(key, held);
|
|
4094
|
-
}
|
|
4322
|
+
const fixed = /* @__PURE__ */ new Map();
|
|
4323
|
+
const candidatesOf = /* @__PURE__ */ __name(async (scorer, seeds2) => {
|
|
4324
|
+
if (scorer.spreads)
|
|
4325
|
+
return scorer.candidates({ ...scorerInput, confirmed: seeds2 });
|
|
4326
|
+
const held = fixed.get(scorer) ?? await scorer.candidates(scorerInput);
|
|
4327
|
+
fixed.set(scorer, held);
|
|
4328
|
+
return held;
|
|
4329
|
+
}, "candidatesOf");
|
|
4330
|
+
let seeds = scorerInput.confirmed;
|
|
4331
|
+
let collected = await collect(store, scorerInput, scorers, (scorer) => candidatesOf(scorer, seeds));
|
|
4332
|
+
for (let hop = 0; hop < MAX_HOPS && scorers.some((one2) => one2.spreads); hop++) {
|
|
4333
|
+
const grown = await seedsOf(store, seeds, collected.scored, threshold);
|
|
4334
|
+
if (!grown)
|
|
4335
|
+
break;
|
|
4336
|
+
seeds = grown;
|
|
4337
|
+
collected = await collect(store, scorerInput, scorers, (scorer) => candidatesOf(scorer, seeds));
|
|
4095
4338
|
}
|
|
4096
|
-
|
|
4097
|
-
|
|
4098
|
-
const purpose = list3.find((one2) => one2.purpose)?.purpose;
|
|
4099
|
-
return {
|
|
4100
|
-
candidate,
|
|
4101
|
-
purpose,
|
|
4102
|
-
signals: list3.map(({ scorer, weight, why }) => ({ scorer, weight, why })),
|
|
4103
|
-
score: combinedScore(list3.map((one2) => one2.weight))
|
|
4104
|
-
};
|
|
4105
|
-
}).sort((a, b) => b.score - a.score || a.candidate.from.localeCompare(b.candidate.from));
|
|
4339
|
+
skipped.nameOnly = collected.nameOnly;
|
|
4340
|
+
skipped.unresolved = collected.unresolved;
|
|
4106
4341
|
const proposals = [];
|
|
4107
4342
|
let fresh = 0;
|
|
4108
|
-
for (const { candidate, purpose, signals: signals2, score } of scored) {
|
|
4343
|
+
for (const { candidate, purpose, signals: signals2, score } of collected.scored) {
|
|
4109
4344
|
const state = await store.knowledge.relationState(null, candidate);
|
|
4110
4345
|
if (!state) {
|
|
4111
4346
|
skipped.unresolved++;
|
|
@@ -4162,6 +4397,73 @@ var scanProjectLinks = /* @__PURE__ */ __name(async (store, input) => {
|
|
|
4162
4397
|
}
|
|
4163
4398
|
return { project: project?.ref ?? null, proposals, skipped };
|
|
4164
4399
|
}, "scanProjectLinks");
|
|
4400
|
+
var collect = /* @__PURE__ */ __name(async (store, input, scorers, candidatesOf) => {
|
|
4401
|
+
const pairs = /* @__PURE__ */ new Map();
|
|
4402
|
+
const nameOnly = /* @__PURE__ */ new Set();
|
|
4403
|
+
let unresolved = 0;
|
|
4404
|
+
for (const scorer of scorers) {
|
|
4405
|
+
input.signal?.throwIfAborted();
|
|
4406
|
+
for (const candidate of await candidatesOf(scorer)) {
|
|
4407
|
+
const key = pairKey(candidate);
|
|
4408
|
+
const verdict = await admissible(store, input, candidate);
|
|
4409
|
+
if (verdict === "owner")
|
|
4410
|
+
continue;
|
|
4411
|
+
if (verdict === "name-only") {
|
|
4412
|
+
nameOnly.add(key);
|
|
4413
|
+
continue;
|
|
4414
|
+
}
|
|
4415
|
+
if (verdict !== "ok") {
|
|
4416
|
+
unresolved++;
|
|
4417
|
+
continue;
|
|
4418
|
+
}
|
|
4419
|
+
const weight = Math.min(1, Math.max(0, candidate.weight));
|
|
4420
|
+
const held = pairs.get(key) ?? { candidate, signals: /* @__PURE__ */ new Map() };
|
|
4421
|
+
const scorerId = `${scorer.id}@${scorer.version}`;
|
|
4422
|
+
const before2 = held.signals.get(scorerId);
|
|
4423
|
+
if (!before2 || before2.weight < weight)
|
|
4424
|
+
held.signals.set(scorerId, {
|
|
4425
|
+
scorer: scorerId,
|
|
4426
|
+
weight,
|
|
4427
|
+
why: candidate.why.slice(0, 500),
|
|
4428
|
+
...candidate.purpose && input.purposes.includes(candidate.purpose) ? { purpose: candidate.purpose } : {}
|
|
4429
|
+
});
|
|
4430
|
+
held.candidate = {
|
|
4431
|
+
...held.candidate,
|
|
4432
|
+
evidence: [.../* @__PURE__ */ new Set([...held.candidate.evidence, ...candidate.evidence])]
|
|
4433
|
+
};
|
|
4434
|
+
pairs.set(key, held);
|
|
4435
|
+
}
|
|
4436
|
+
}
|
|
4437
|
+
const scored = [...pairs.values()].map(({ candidate, signals: signals2 }) => {
|
|
4438
|
+
const list3 = [...signals2.values()].sort((a, b) => b.weight - a.weight || a.scorer.localeCompare(b.scorer));
|
|
4439
|
+
const purpose = list3.find((one2) => one2.purpose)?.purpose;
|
|
4440
|
+
return {
|
|
4441
|
+
candidate,
|
|
4442
|
+
purpose,
|
|
4443
|
+
signals: list3.map(({ scorer, weight, why }) => ({ scorer, weight, why })),
|
|
4444
|
+
score: combinedScore(list3.map((one2) => one2.weight))
|
|
4445
|
+
};
|
|
4446
|
+
}).sort((a, b) => b.score - a.score || a.candidate.from.localeCompare(b.candidate.from));
|
|
4447
|
+
return { scored, nameOnly: nameOnly.size, unresolved };
|
|
4448
|
+
}, "collect");
|
|
4449
|
+
var seedsOf = /* @__PURE__ */ __name(async (store, seeds, scored, threshold) => {
|
|
4450
|
+
const chats = new Set(seeds.chats);
|
|
4451
|
+
const people = new Set(seeds.people);
|
|
4452
|
+
const size4 = chats.size + people.size;
|
|
4453
|
+
for (const { candidate, score } of scored) {
|
|
4454
|
+
if (score < threshold || candidate.kind !== "member-of")
|
|
4455
|
+
continue;
|
|
4456
|
+
if (chats.has(candidate.from) || people.has(candidate.from))
|
|
4457
|
+
continue;
|
|
4458
|
+
if ((await store.knowledge.relationState(null, candidate))?.rejected !== false)
|
|
4459
|
+
continue;
|
|
4460
|
+
if (candidate.from.startsWith("chat:"))
|
|
4461
|
+
chats.add(candidate.from);
|
|
4462
|
+
else if (candidate.from.startsWith("person:"))
|
|
4463
|
+
people.add(candidate.from);
|
|
4464
|
+
}
|
|
4465
|
+
return chats.size + people.size === size4 ? void 0 : { chats: [...chats].sort(), people: [...people].sort() };
|
|
4466
|
+
}, "seedsOf");
|
|
4165
4467
|
var admissible = /* @__PURE__ */ __name(async (store, input, candidate) => {
|
|
4166
4468
|
if (candidate.from === candidate.to || !Number.isFinite(candidate.weight))
|
|
4167
4469
|
return "unresolved";
|
|
@@ -4191,24 +4493,24 @@ var referenceOf = /* @__PURE__ */ __name((text2) => {
|
|
|
4191
4493
|
}, "referenceOf");
|
|
4192
4494
|
var rejectedReversed = /* @__PURE__ */ __name(async (store, candidate) => candidate.kind === "related-to" && candidate.to.startsWith("person:") && ((await store.knowledge.relationState(null, { from: candidate.to, to: candidate.from, kind: candidate.kind }))?.rejected ?? false), "rejectedReversed");
|
|
4193
4495
|
|
|
4194
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
4496
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/services/media-archive.js
|
|
4195
4497
|
import { setTimeout as sleep } from "node:timers/promises";
|
|
4196
4498
|
|
|
4197
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
4499
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/services/media-archive-files.js
|
|
4198
4500
|
import { lstat } from "node:fs/promises";
|
|
4199
4501
|
|
|
4200
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
4201
|
-
import { createHash as
|
|
4502
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/persistence/native/recording-partial-store.js
|
|
4503
|
+
import { createHash as createHash4, randomUUID as randomUUID2 } from "node:crypto";
|
|
4202
4504
|
import { open as open2, rename as rename2, unlink as unlink2 } from "node:fs/promises";
|
|
4203
4505
|
import { join as join2 } from "node:path";
|
|
4204
4506
|
|
|
4205
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
4206
|
-
import { createHash as
|
|
4507
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/persistence/native/recording-partial-metadata.js
|
|
4508
|
+
import { createHash as createHash3 } from "node:crypto";
|
|
4207
4509
|
var metadataLimit = 16384;
|
|
4208
4510
|
var partialIdentity = /* @__PURE__ */ __name((locator) => JSON.stringify([locator.provider, locator.account, locator.occurrenceId, locator.assetId]), "partialIdentity");
|
|
4209
4511
|
var missing2 = /* @__PURE__ */ __name((error) => typeof error === "object" && error !== null && "code" in error && error.code === "ENOENT", "missing");
|
|
4210
4512
|
var fingerprintPartial = /* @__PURE__ */ __name(async (file2, signal, length) => {
|
|
4211
|
-
const hash3 =
|
|
4513
|
+
const hash3 = createHash3("sha256");
|
|
4212
4514
|
let size4 = 0;
|
|
4213
4515
|
const buffer = Buffer.alloc(65536);
|
|
4214
4516
|
for (; ; ) {
|
|
@@ -4262,7 +4564,7 @@ var readPartialMetadata = /* @__PURE__ */ __name(async (path, locator, maxBytes,
|
|
|
4262
4564
|
}
|
|
4263
4565
|
}, "readPartialMetadata");
|
|
4264
4566
|
|
|
4265
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
4567
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/persistence/native/recording-partial-writer.js
|
|
4266
4568
|
import { randomUUID } from "node:crypto";
|
|
4267
4569
|
import { open, rename, unlink } from "node:fs/promises";
|
|
4268
4570
|
import { join } from "node:path";
|
|
@@ -4354,7 +4656,7 @@ var partialWriter = /* @__PURE__ */ __name(async (input) => {
|
|
|
4354
4656
|
};
|
|
4355
4657
|
}, "partialWriter");
|
|
4356
4658
|
|
|
4357
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
4659
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/persistence/native/recording-partial-store.js
|
|
4358
4660
|
var NativeRecordingPartialStore = class {
|
|
4359
4661
|
static {
|
|
4360
4662
|
__name(this, "NativeRecordingPartialStore");
|
|
@@ -4376,7 +4678,7 @@ var NativeRecordingPartialStore = class {
|
|
|
4376
4678
|
this.options = Object.freeze({ ...options });
|
|
4377
4679
|
if (typeof root !== "string" || !root || root.includes("\0") || !/^\.[a-zA-Z0-9][a-zA-Z0-9._-]{0,95}-$/.test(options.prefix) || typeof options.persistent !== "boolean" || !Number.isSafeInteger(options.maxBytes) || options.maxBytes <= 0 || Object.values(this.locator).some((value) => typeof value !== "string" || !value.trim() || /[\0\r\n]/.test(value)))
|
|
4378
4680
|
throw new CliError("validation_error", "invalid native recording partial options");
|
|
4379
|
-
const key = options.persistent ?
|
|
4681
|
+
const key = options.persistent ? createHash4("sha256").update(partialIdentity(this.locator)).digest("hex") : randomUUID2();
|
|
4380
4682
|
this.path = join2(root, `${options.prefix}${key}.part`);
|
|
4381
4683
|
this.metadataPath = join2(root, `${options.prefix}${key}.json`);
|
|
4382
4684
|
}
|
|
@@ -4461,12 +4763,12 @@ var NativeRecordingPartialStore = class {
|
|
|
4461
4763
|
}
|
|
4462
4764
|
};
|
|
4463
4765
|
|
|
4464
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
4465
|
-
import { createHash as
|
|
4766
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/persistence/native/recording-publication.js
|
|
4767
|
+
import { createHash as createHash5 } from "node:crypto";
|
|
4466
4768
|
import { link } from "node:fs/promises";
|
|
4467
4769
|
import { basename, dirname, join as join4, resolve } from "node:path";
|
|
4468
4770
|
|
|
4469
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
4771
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/persistence/native/recording-publication-files.js
|
|
4470
4772
|
import { unlink as unlink3 } from "node:fs/promises";
|
|
4471
4773
|
var verifiedPublicationFile = /* @__PURE__ */ __name(async (path, expected2, signal, writable = false) => {
|
|
4472
4774
|
signal?.throwIfAborted();
|
|
@@ -4501,7 +4803,7 @@ var commitPublication = /* @__PURE__ */ __name(async (root, partialPath, finalPa
|
|
|
4501
4803
|
signal?.throwIfAborted();
|
|
4502
4804
|
}, "commitPublication");
|
|
4503
4805
|
|
|
4504
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
4806
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/persistence/native/recording-publication-journal.js
|
|
4505
4807
|
import { randomUUID as randomUUID3 } from "node:crypto";
|
|
4506
4808
|
import { open as open3, rename as rename3, unlink as unlink4 } from "node:fs/promises";
|
|
4507
4809
|
import { join as join3 } from "node:path";
|
|
@@ -4574,7 +4876,7 @@ var writePublicationJournal = /* @__PURE__ */ __name(async (root, path, prefix,
|
|
|
4574
4876
|
}
|
|
4575
4877
|
}, "writePublicationJournal");
|
|
4576
4878
|
|
|
4577
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
4879
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/persistence/native/recording-publication.js
|
|
4578
4880
|
var NativeRecordingPublication = class {
|
|
4579
4881
|
static {
|
|
4580
4882
|
__name(this, "NativeRecordingPublication");
|
|
@@ -4590,7 +4892,7 @@ var NativeRecordingPublication = class {
|
|
|
4590
4892
|
throw new CliError("validation_error", "invalid native recording publication options");
|
|
4591
4893
|
this.scope = partialIdentity(locator);
|
|
4592
4894
|
this.options = Object.freeze({ ...options, codec: Object.freeze({ ...options.codec }) });
|
|
4593
|
-
this.journalPath = join4(root, `${options.prefix}${
|
|
4895
|
+
this.journalPath = join4(root, `${options.prefix}${createHash5("sha256").update(this.scope).digest("hex")}.json`);
|
|
4594
4896
|
this.finalPath = join4(root, options.filename);
|
|
4595
4897
|
if (this.finalPath === this.journalPath)
|
|
4596
4898
|
throw new CliError("validation_error", "recording publication paths must be distinct");
|
|
@@ -4647,11 +4949,11 @@ var NativeRecordingPublication = class {
|
|
|
4647
4949
|
}
|
|
4648
4950
|
};
|
|
4649
4951
|
|
|
4650
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
4651
|
-
import { createHash as
|
|
4952
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/services/media-archive-manifest.js
|
|
4953
|
+
import { createHash as createHash6 } from "node:crypto";
|
|
4652
4954
|
import { readdir } from "node:fs/promises";
|
|
4653
4955
|
import { isAbsolute, join as join5, resolve as resolve2 } from "node:path";
|
|
4654
|
-
var mediaKey = /* @__PURE__ */ __name((one2) =>
|
|
4956
|
+
var mediaKey = /* @__PURE__ */ __name((one2) => createHash6("sha256").update(JSON.stringify([one2.provider, one2.account, one2.chat, one2.message, one2.position])).digest("hex"), "mediaKey");
|
|
4655
4957
|
var mediaManifestName = /* @__PURE__ */ __name((one2) => `.media-archive-${mediaKey(one2)}.json`, "mediaManifestName");
|
|
4656
4958
|
var missingMediaFile = /* @__PURE__ */ __name((error) => typeof error === "object" && error !== null && "code" in error && error.code === "ENOENT", "missingMediaFile");
|
|
4657
4959
|
var parseMediaEntry = /* @__PURE__ */ __name((value) => {
|
|
@@ -4678,7 +4980,7 @@ var mediaFingerprint = /* @__PURE__ */ __name(async (path, signal) => {
|
|
|
4678
4980
|
signal?.throwIfAborted();
|
|
4679
4981
|
const file2 = await openOrdinaryFile(path);
|
|
4680
4982
|
try {
|
|
4681
|
-
const hash3 =
|
|
4983
|
+
const hash3 = createHash6("sha256");
|
|
4682
4984
|
let size4 = 0;
|
|
4683
4985
|
for await (const chunk of file2.createReadStream({ autoClose: false, ...signal ? { signal } : {} })) {
|
|
4684
4986
|
signal?.throwIfAborted();
|
|
@@ -4734,7 +5036,7 @@ var commitMediaEntry = /* @__PURE__ */ __name((root, one2, beforePublish) => wri
|
|
|
4734
5036
|
beforePublish
|
|
4735
5037
|
}), "commitMediaEntry");
|
|
4736
5038
|
|
|
4737
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
5039
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/services/media-archive-files.js
|
|
4738
5040
|
var validator = '"media-completed-v1"';
|
|
4739
5041
|
var maximumFileBytes = 64 * 1024 * 1024 * 1024;
|
|
4740
5042
|
var archiveMediaFile = /* @__PURE__ */ __name(async (root, identity, kind, file2, beforeWrite, signal, metadata = {}) => {
|
|
@@ -4835,7 +5137,7 @@ var archiveMediaFile = /* @__PURE__ */ __name(async (root, identity, kind, file2
|
|
|
4835
5137
|
return entry;
|
|
4836
5138
|
}, "archiveMediaFile");
|
|
4837
5139
|
|
|
4838
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
5140
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/services/media-archive-locks.js
|
|
4839
5141
|
import { mkdir, realpath } from "node:fs/promises";
|
|
4840
5142
|
import { join as join6, resolve as resolve3 } from "node:path";
|
|
4841
5143
|
var archiveLocations = /* @__PURE__ */ __name(async (initial, signal) => {
|
|
@@ -4902,7 +5204,7 @@ var withMediaArchiveLocks = /* @__PURE__ */ __name(async (directory, signal, run
|
|
|
4902
5204
|
throw new CliError("validation_error", "archive locations changed during locking; run the command again");
|
|
4903
5205
|
}, "withMediaArchiveLocks");
|
|
4904
5206
|
|
|
4905
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
5207
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/services/media-archive.js
|
|
4906
5208
|
var validateMediaSince = /* @__PURE__ */ __name((value, flag = "--since-time") => {
|
|
4907
5209
|
if (value === void 0)
|
|
4908
5210
|
return void 0;
|
|
@@ -5055,7 +5357,7 @@ var archiveMedia = /* @__PURE__ */ __name(async (ports, options) => {
|
|
|
5055
5357
|
}, { create: true });
|
|
5056
5358
|
}, "archiveMedia");
|
|
5057
5359
|
|
|
5058
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
5360
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/services/media-archive-move.js
|
|
5059
5361
|
import { realpath as realpath2, unlink as unlink5 } from "node:fs/promises";
|
|
5060
5362
|
import { basename as basename2, dirname as dirname2, join as join7, resolve as resolve4 } from "node:path";
|
|
5061
5363
|
var canonicalDestination = /* @__PURE__ */ __name(async (directory) => {
|
|
@@ -5208,7 +5510,7 @@ var moveMediaArchive = /* @__PURE__ */ __name(async (options) => {
|
|
|
5208
5510
|
}, { additional: [target], createAdditional: !options.dryRun });
|
|
5209
5511
|
}, "moveMediaArchive");
|
|
5210
5512
|
|
|
5211
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
5513
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/services/model-downloads.js
|
|
5212
5514
|
var bytesOf = /* @__PURE__ */ __name((model) => model.files.reduce((sum2, file2) => sum2 + file2.bytes, 0), "bytesOf");
|
|
5213
5515
|
var nativeRuntime = /* @__PURE__ */ __name(async ({ env, progress = /* @__PURE__ */ __name(() => {
|
|
5214
5516
|
}, "progress") }) => {
|
|
@@ -5231,7 +5533,7 @@ var downloadTextModel = /* @__PURE__ */ __name(async (id2, { env, progress = /*
|
|
|
5231
5533
|
}
|
|
5232
5534
|
await nativeRuntime({ env, progress });
|
|
5233
5535
|
progress(`${model.id}: loading it once to check it works`);
|
|
5234
|
-
const { openEmbedder: openEmbedder2 } = await import("./embed-
|
|
5536
|
+
const { openEmbedder: openEmbedder2 } = await import("./embed-OBFFPVF4.js");
|
|
5235
5537
|
const embedder = await openEmbedder2(model, directory);
|
|
5236
5538
|
try {
|
|
5237
5539
|
const [vector] = await embedder.embed(["check"], "query");
|
|
@@ -5252,7 +5554,7 @@ var downloadRerankModel = /* @__PURE__ */ __name(async (id2, { env, progress = /
|
|
|
5252
5554
|
}
|
|
5253
5555
|
await nativeRuntime({ env, progress });
|
|
5254
5556
|
progress(`${model.id}: loading it once to check it works`);
|
|
5255
|
-
const { openReranker } = await import("./rerank-
|
|
5557
|
+
const { openReranker } = await import("./rerank-4NGQWREA.js");
|
|
5256
5558
|
const reranker = await openReranker(model, directory);
|
|
5257
5559
|
try {
|
|
5258
5560
|
await reranker.score("check", ["check"]);
|
|
@@ -5270,7 +5572,7 @@ var downloadImageModel = /* @__PURE__ */ __name(async (id2, { env, progress = /*
|
|
|
5270
5572
|
await installFiles(placedImage(model, directory), { progress, ...bytes2 ? { bytes: bytes2 } : {} });
|
|
5271
5573
|
}
|
|
5272
5574
|
progress(`${model.id}: loading it once to check it works`);
|
|
5273
|
-
const { openPictureEmbedder } = await import("./embedder-
|
|
5575
|
+
const { openPictureEmbedder } = await import("./embedder-NGCBQHIG.js");
|
|
5274
5576
|
const embedder = await openPictureEmbedder(model, directory);
|
|
5275
5577
|
try {
|
|
5276
5578
|
const vector = await embedder.embedQuery("check");
|
|
@@ -5282,7 +5584,7 @@ var downloadImageModel = /* @__PURE__ */ __name(async (id2, { env, progress = /*
|
|
|
5282
5584
|
return { model, directory };
|
|
5283
5585
|
}, "downloadImageModel");
|
|
5284
5586
|
|
|
5285
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
5587
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/domain/money-words.js
|
|
5286
5588
|
var MONEY_REQUEST = "money-request";
|
|
5287
5589
|
var MONEY_DONE = "money-done";
|
|
5288
5590
|
var PROMISE = "promise";
|
|
@@ -5316,10 +5618,10 @@ var MONEY_WORDS = [
|
|
|
5316
5618
|
}
|
|
5317
5619
|
];
|
|
5318
5620
|
|
|
5319
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
5621
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/services/money-words.js
|
|
5320
5622
|
var moneyClassesOf = /* @__PURE__ */ __name((text2) => listsHit(text2, MONEY_WORDS), "moneyClassesOf");
|
|
5321
5623
|
|
|
5322
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
5624
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/domain/status-words.js
|
|
5323
5625
|
var words = /* @__PURE__ */ __name((forms) => new RegExp(`(?<![\\p{L}\\p{N}])(?:${forms.join("|")})(?![\\p{L}\\p{N}])`, "iu"), "words");
|
|
5324
5626
|
var MONEY_DONE_FORMS = words([
|
|
5325
5627
|
"\u043E\u043F\u043B\u0430\u0442\u0438\u043B[\u0430\u0438]?",
|
|
@@ -5359,7 +5661,7 @@ var PROMISE_FORMS = words([
|
|
|
5359
5661
|
"estar\xE1 listo"
|
|
5360
5662
|
]);
|
|
5361
5663
|
|
|
5362
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
5664
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/services/project-status/items.js
|
|
5363
5665
|
var EXCERPT_CHARS = 80;
|
|
5364
5666
|
var excerpt2 = /* @__PURE__ */ __name((text2) => {
|
|
5365
5667
|
const flat = text2.replace(/\s+/g, " ").trim();
|
|
@@ -5381,7 +5683,7 @@ var whoOf = /* @__PURE__ */ __name((message) => ({
|
|
|
5381
5683
|
var fromOwner = /* @__PURE__ */ __name((message) => message.outgoing === true, "fromOwner");
|
|
5382
5684
|
var day = /* @__PURE__ */ __name((at) => new Date(at).toISOString().slice(0, 10), "day");
|
|
5383
5685
|
|
|
5384
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
5686
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/services/project-status/signals/amounts.js
|
|
5385
5687
|
var MONEY = DEFAULT_TASK_CATEGORIES.filter((category) => category.name === "money");
|
|
5386
5688
|
var verbOf = /* @__PURE__ */ __name((text2) => {
|
|
5387
5689
|
if (MONEY_DONE_FORMS.test(text2))
|
|
@@ -5462,7 +5764,7 @@ var amounts = {
|
|
|
5462
5764
|
attention: /* @__PURE__ */ __name((items) => items.flatMap((item2) => item2.chat !== null && item2.data.state === "asked" ? [{ chat: item2.chat, weight: 2, why: "money asked" }] : []), "attention")
|
|
5463
5765
|
};
|
|
5464
5766
|
|
|
5465
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
5767
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/services/project-status/signals/children.js
|
|
5466
5768
|
var children = {
|
|
5467
5769
|
id: "children",
|
|
5468
5770
|
version: 1,
|
|
@@ -5491,7 +5793,7 @@ var children = {
|
|
|
5491
5793
|
}, "read")
|
|
5492
5794
|
};
|
|
5493
5795
|
|
|
5494
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
5796
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/services/project-status/signals/coverage.js
|
|
5495
5797
|
var coverage = {
|
|
5496
5798
|
id: "coverage",
|
|
5497
5799
|
version: 1,
|
|
@@ -5520,7 +5822,7 @@ var coverage = {
|
|
|
5520
5822
|
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")
|
|
5521
5823
|
};
|
|
5522
5824
|
|
|
5523
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
5825
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/services/project-status/signals/payments.js
|
|
5524
5826
|
var holding = /* @__PURE__ */ __name((row) => row.review !== "rejected", "holding");
|
|
5525
5827
|
var item = /* @__PURE__ */ __name((row, at, data) => ({
|
|
5526
5828
|
signal: "payments",
|
|
@@ -5570,7 +5872,7 @@ var payments = {
|
|
|
5570
5872
|
}, "read")
|
|
5571
5873
|
};
|
|
5572
5874
|
|
|
5573
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
5875
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/services/project-status/signals/promises.js
|
|
5574
5876
|
var PATTERNS_PER_CHAT = 3;
|
|
5575
5877
|
var DAY3 = 864e5;
|
|
5576
5878
|
var KINDS2 = /* @__PURE__ */ new Set(["promise", "request"]);
|
|
@@ -5659,7 +5961,7 @@ var promises = {
|
|
|
5659
5961
|
}, "read")
|
|
5660
5962
|
};
|
|
5661
5963
|
|
|
5662
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
5964
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/services/project-status/signals/questions.js
|
|
5663
5965
|
var PER_SIDE = 5;
|
|
5664
5966
|
var WEEK = 7 * 864e5;
|
|
5665
5967
|
var NOBODY = /* @__PURE__ */ new Set();
|
|
@@ -5690,7 +5992,7 @@ var questions2 = {
|
|
|
5690
5992
|
}, "attention")
|
|
5691
5993
|
};
|
|
5692
5994
|
|
|
5693
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
5995
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/services/project-status/signals/reply-next.js
|
|
5694
5996
|
var targetOf = /* @__PURE__ */ __name((message, chat, owners) => {
|
|
5695
5997
|
const byId2 = /* @__PURE__ */ __name((id2) => chat.messages.find((one2) => one2.id === id2), "byId");
|
|
5696
5998
|
const quoted = message.replyTo ?? (message.replyToId === void 0 ? void 0 : byId2(message.replyToId));
|
|
@@ -5758,7 +6060,7 @@ var replyNext = {
|
|
|
5758
6060
|
attention: /* @__PURE__ */ __name((items) => items.flatMap((item2) => item2.chat !== null && item2.data.next === "owner" ? [{ chat: item2.chat, weight: 2, why: "your move" }] : []), "attention")
|
|
5759
6061
|
};
|
|
5760
6062
|
|
|
5761
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
6063
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/services/project-status/signals/topics.js
|
|
5762
6064
|
var escaped2 = /* @__PURE__ */ __name((text2) => text2.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), "escaped");
|
|
5763
6065
|
var wholeWord = /* @__PURE__ */ __name((word) => new RegExp(`(?<![\\p{L}\\p{N}])${escaped2(word)}(?![\\p{L}\\p{N}])`, "u"), "wholeWord");
|
|
5764
6066
|
var matcherOf = /* @__PURE__ */ __name((query) => {
|
|
@@ -5804,7 +6106,7 @@ var topics = {
|
|
|
5804
6106
|
}, "read")
|
|
5805
6107
|
};
|
|
5806
6108
|
|
|
5807
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
6109
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/services/project-status/signals/index.js
|
|
5808
6110
|
var STATUS_SIGNALS = [
|
|
5809
6111
|
replyNext,
|
|
5810
6112
|
questions2,
|
|
@@ -5816,7 +6118,7 @@ var STATUS_SIGNALS = [
|
|
|
5816
6118
|
children
|
|
5817
6119
|
];
|
|
5818
6120
|
|
|
5819
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
6121
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/services/project-status/index.js
|
|
5820
6122
|
var DAY4 = 864e5;
|
|
5821
6123
|
var STATUS_WINDOW = 300;
|
|
5822
6124
|
var STATUS_CHATS = 16;
|
|
@@ -5832,7 +6134,7 @@ var childrenOf = /* @__PURE__ */ __name(async (store, root, catalog) => {
|
|
|
5832
6134
|
const below = [];
|
|
5833
6135
|
for (const parent of level2)
|
|
5834
6136
|
for (const relation of await store.knowledge.relations(null, parent)) {
|
|
5835
|
-
if (!relation.
|
|
6137
|
+
if (!isUsable(relation.standing) || relation.kind !== "member-of" || relation.to !== parent)
|
|
5836
6138
|
continue;
|
|
5837
6139
|
if (!relation.from.startsWith("project:"))
|
|
5838
6140
|
continue;
|
|
@@ -6005,7 +6307,7 @@ var projectStatus = /* @__PURE__ */ __name(async (store, input) => {
|
|
|
6005
6307
|
};
|
|
6006
6308
|
}, "projectStatus");
|
|
6007
6309
|
|
|
6008
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
6310
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/services/account.js
|
|
6009
6311
|
var accountService = /* @__PURE__ */ __name((deps) => {
|
|
6010
6312
|
const online = /* @__PURE__ */ __name(async (command) => {
|
|
6011
6313
|
if (deps.offline)
|
|
@@ -6077,7 +6379,7 @@ var accountService = /* @__PURE__ */ __name((deps) => {
|
|
|
6077
6379
|
};
|
|
6078
6380
|
}, "accountService");
|
|
6079
6381
|
|
|
6080
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
6382
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/domain/send-time.js
|
|
6081
6383
|
var MINUTE = 6e4;
|
|
6082
6384
|
var YEAR = 365 * 24 * 60 * MINUTE;
|
|
6083
6385
|
var DELAY = /^(\d+)(m|h|d)$/;
|
|
@@ -6096,7 +6398,7 @@ var sendTime = /* @__PURE__ */ __name((value, now = Date.now(), flag = "--at-tim
|
|
|
6096
6398
|
return new Date(at - at % MINUTE).toISOString();
|
|
6097
6399
|
}, "sendTime");
|
|
6098
6400
|
|
|
6099
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
6401
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/services/admin.js
|
|
6100
6402
|
var recordMembership = /* @__PURE__ */ __name(async (deps, operationId, done2, change, fix, write) => {
|
|
6101
6403
|
try {
|
|
6102
6404
|
const held = await accountStoreIfOpen(deps);
|
|
@@ -6343,7 +6645,7 @@ var linkLimits = /* @__PURE__ */ __name(({ approval, expires, maxUses }) => {
|
|
|
6343
6645
|
return expires === void 0 ? void 0 : sendTime(expires, Date.now(), "--expire-time");
|
|
6344
6646
|
}, "linkLimits");
|
|
6345
6647
|
|
|
6346
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
6648
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/services/mail-search.js
|
|
6347
6649
|
var THREADS_PAGE = 500;
|
|
6348
6650
|
var threadsOf = /* @__PURE__ */ __name(async (store, key) => {
|
|
6349
6651
|
const account2 = await store.accounts.storedAccount(key).catch(() => void 0);
|
|
@@ -6422,7 +6724,7 @@ var readMail = /* @__PURE__ */ __name(async (store, locator, { before: before2 =
|
|
|
6422
6724
|
return thread.slice(Math.max(0, at - before2), at + after + 1).map((hit) => hit.id === message ? { ...hit, anchor: true } : hit);
|
|
6423
6725
|
}, "readMail");
|
|
6424
6726
|
|
|
6425
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
6727
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/services/search-kind.js
|
|
6426
6728
|
var NO_MAIL = "no_mail";
|
|
6427
6729
|
var MAIL = "email";
|
|
6428
6730
|
var listContextOf = /* @__PURE__ */ __name(async (store, account2, app, stored) => {
|
|
@@ -6453,11 +6755,11 @@ var accountsOfKind = /* @__PURE__ */ __name((kind, chosen, held, explicit, comma
|
|
|
6453
6755
|
if (kind === "messages") {
|
|
6454
6756
|
if (explicit === MAIL)
|
|
6455
6757
|
throw new CliError("validation_error", "mail is searched with `memo search mail`, not search messages");
|
|
6456
|
-
return chosen.filter(({ provider }) =>
|
|
6758
|
+
return chosen.filter(({ provider }) => holdsKindOf(provider, "messages"));
|
|
6457
6759
|
}
|
|
6458
6760
|
if (explicit !== void 0 && explicit !== MAIL && explicit !== "all")
|
|
6459
6761
|
throw new CliError("validation_error", `search mail reads mail only \u2014 \`${command === void 0 ? "" : `${command} `}search messages\` searches ${explicit}`);
|
|
6460
|
-
const mail = (listed ? chosen : held).filter(({ provider }) =>
|
|
6762
|
+
const mail = (listed ? chosen : held).filter(({ provider }) => holdsKindOf(provider, "mail"));
|
|
6461
6763
|
if (mail.length === 0)
|
|
6462
6764
|
throw new CliError("not_found", "no mail in the store yet \u2014 `memo sync --only mail --since-time <time>` imports it", {
|
|
6463
6765
|
reason: NO_MAIL
|
|
@@ -6469,7 +6771,7 @@ var accountsOfKind = /* @__PURE__ */ __name((kind, chosen, held, explicit, comma
|
|
|
6469
6771
|
return chosenMail.map(({ provider, account: account2 }) => ({ provider, account: account2 }));
|
|
6470
6772
|
}, "accountsOfKind");
|
|
6471
6773
|
|
|
6472
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
6774
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/services/messages-search.js
|
|
6473
6775
|
var MAIL_FIELDS = /* @__PURE__ */ new Set(["to", "cc", "bcc", "subject", "mailbox", "label", "is"]);
|
|
6474
6776
|
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");
|
|
6475
6777
|
var prepareLucene = /* @__PURE__ */ __name(async (store, account2, request, messenger) => {
|
|
@@ -6652,7 +6954,7 @@ var coverageOf = /* @__PURE__ */ __name(async (store, { scopeAccounts, selectedC
|
|
|
6652
6954
|
const completeness = [];
|
|
6653
6955
|
const stats = /* @__PURE__ */ new Map();
|
|
6654
6956
|
let inventoryComplete = scopeAccounts.length > 0;
|
|
6655
|
-
for (const selected of scopeAccounts) {
|
|
6957
|
+
for (const selected of scopeAccounts.filter(({ provider }) => !isImportedProvider(provider))) {
|
|
6656
6958
|
if (!await store.sync.syncState(selected, CHAT_LIST_KEY)) {
|
|
6657
6959
|
inventoryComplete = false;
|
|
6658
6960
|
}
|
|
@@ -6817,7 +7119,7 @@ var statsLucene = /* @__PURE__ */ __name(async (store, account2, request, messen
|
|
|
6817
7119
|
};
|
|
6818
7120
|
}, "statsLucene");
|
|
6819
7121
|
|
|
6820
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
7122
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/services/moment.js
|
|
6821
7123
|
var AGO = /^(\d+)(m|h|d)$/;
|
|
6822
7124
|
var AGO_MS = { m: 6e4, h: 36e5, d: 864e5 };
|
|
6823
7125
|
var DATE = /^\d{4}-\d{2}-\d{2}/;
|
|
@@ -6857,7 +7159,7 @@ var dateWindow = /* @__PURE__ */ __name(({ sinceTime, untilTime, zone, now = Dat
|
|
|
6857
7159
|
};
|
|
6858
7160
|
}, "dateWindow");
|
|
6859
7161
|
|
|
6860
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
7162
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/services/rankings-selection.js
|
|
6861
7163
|
var RANKING_SELECTION_BYTES = 64 * 1024;
|
|
6862
7164
|
var object = /* @__PURE__ */ __name((value) => value !== null && typeof value === "object" && !Array.isArray(value) ? value : void 0, "object");
|
|
6863
7165
|
function invalid(message = "ranking selection is invalid \u2014 obtain a new drilldown from stats top") {
|
|
@@ -7026,7 +7328,7 @@ var readRankingSelection = /* @__PURE__ */ __name(async (store, input) => {
|
|
|
7026
7328
|
};
|
|
7027
7329
|
}, "readRankingSelection");
|
|
7028
7330
|
|
|
7029
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
7331
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/services/search-record.js
|
|
7030
7332
|
var canonical = /* @__PURE__ */ __name((value, nested = false) => Array.isArray(value) ? value.map((one2) => canonical(one2, true)) : value !== null && typeof value === "object" ? Object.fromEntries(Object.entries(value).filter(([, one2]) => one2 !== void 0 && (nested || one2 !== false)).sort(([a], [b]) => a < b ? -1 : a > b ? 1 : 0).map(([key, one2]) => [key, canonical(one2, true)])) : value, "canonical");
|
|
7031
7333
|
var searchRecordOf = /* @__PURE__ */ __name((command, params) => ({
|
|
7032
7334
|
command,
|
|
@@ -7036,7 +7338,7 @@ var searchRecordOf = /* @__PURE__ */ __name((command, params) => ({
|
|
|
7036
7338
|
fieldsVersion: FIELD_VERSION
|
|
7037
7339
|
}), "searchRecordOf");
|
|
7038
7340
|
|
|
7039
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
7341
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/services/admin-statistics.js
|
|
7040
7342
|
function invalid2(message) {
|
|
7041
7343
|
throw new CliError("validation_error", message);
|
|
7042
7344
|
}
|
|
@@ -7070,13 +7372,13 @@ var answerers = /* @__PURE__ */ __name(async (store, refs, accounts) => {
|
|
|
7070
7372
|
const parts = ref.slice(7).split("/");
|
|
7071
7373
|
if (parts.length !== 3 || parts.some((part) => !part))
|
|
7072
7374
|
invalid2("answerer needs person:<provider>/<account>/<id>");
|
|
7073
|
-
let
|
|
7375
|
+
let decoded2;
|
|
7074
7376
|
try {
|
|
7075
|
-
|
|
7377
|
+
decoded2 = parts.map(decodeURIComponent);
|
|
7076
7378
|
} catch {
|
|
7077
7379
|
return invalid2("invalid answerer encoding");
|
|
7078
7380
|
}
|
|
7079
|
-
const [provider, account2, id2] =
|
|
7381
|
+
const [provider, account2, id2] = decoded2;
|
|
7080
7382
|
if (!accounts.some((one2) => one2.provider === provider && one2.account === account2))
|
|
7081
7383
|
invalid2("answerer account is outside this query");
|
|
7082
7384
|
return { provider, account: account2, id: id2 };
|
|
@@ -7330,10 +7632,10 @@ var adminStatisticsService = /* @__PURE__ */ __name((deps) => ({
|
|
|
7330
7632
|
}, "evidence")
|
|
7331
7633
|
}), "adminStatisticsService");
|
|
7332
7634
|
|
|
7333
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
7635
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/services/archive.js
|
|
7334
7636
|
import { setTimeout as sleep3 } from "node:timers/promises";
|
|
7335
7637
|
|
|
7336
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
7638
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/services/backfill-estimate.js
|
|
7337
7639
|
var REQUEST_MS = 400;
|
|
7338
7640
|
var estimateBackfill = /* @__PURE__ */ __name(({ ranges, held, newest, page, maxPages, pauseMs }) => {
|
|
7339
7641
|
const lowest = ranges[0];
|
|
@@ -7356,13 +7658,13 @@ var estimateBackfill = /* @__PURE__ */ __name(({ ranges, held, newest, page, max
|
|
|
7356
7658
|
};
|
|
7357
7659
|
}, "estimateBackfill");
|
|
7358
7660
|
|
|
7359
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
7661
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/domain/recovery.js
|
|
7360
7662
|
var withRecovery = /* @__PURE__ */ __name((error) => ({
|
|
7361
7663
|
...error,
|
|
7362
7664
|
retryable: typeof error.retryable === "boolean" ? error.retryable : error.code === "rate_limited" || error.status === 429
|
|
7363
7665
|
}), "withRecovery");
|
|
7364
7666
|
|
|
7365
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
7667
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/services/batch.js
|
|
7366
7668
|
var actionable = /* @__PURE__ */ __name((error) => {
|
|
7367
7669
|
if (isCliFailure(error))
|
|
7368
7670
|
return withRecovery({ code: error.code, message: error.message, ...error.details });
|
|
@@ -7445,7 +7747,7 @@ var mergeBatches = /* @__PURE__ */ __name((a, b) => {
|
|
|
7445
7747
|
};
|
|
7446
7748
|
}, "mergeBatches");
|
|
7447
7749
|
|
|
7448
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
7750
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/services/patience.js
|
|
7449
7751
|
import { setTimeout as sleep2 } from "node:timers/promises";
|
|
7450
7752
|
var LONGEST_WAIT_MS = 5 * 60 * 1e3;
|
|
7451
7753
|
var patiently = /* @__PURE__ */ __name(async (request, note, stop) => {
|
|
@@ -7468,7 +7770,7 @@ var patiently = /* @__PURE__ */ __name(async (request, note, stop) => {
|
|
|
7468
7770
|
}
|
|
7469
7771
|
}, "patiently");
|
|
7470
7772
|
|
|
7471
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
7773
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/conversations/link.js
|
|
7472
7774
|
var RULES_VERSION = 5;
|
|
7473
7775
|
var LOOK_BACK = 50;
|
|
7474
7776
|
var SAME_SENDER_WITHIN = 10;
|
|
@@ -7558,7 +7860,7 @@ var latest = /* @__PURE__ */ __name((window2, matches) => {
|
|
|
7558
7860
|
var sameThread = /* @__PURE__ */ __name((a, b) => a.threadId === b.threadId, "sameThread");
|
|
7559
7861
|
var link2 = /* @__PURE__ */ __name((message, parentId, source, kind, confidence, method) => ({ messageId: message.id, parentId, source, kind, confidence, method }), "link");
|
|
7560
7862
|
|
|
7561
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
7863
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/images/context/index.js
|
|
7562
7864
|
var CONTEXT_MESSAGES = 3;
|
|
7563
7865
|
var CONTEXT_MINUTES = 10;
|
|
7564
7866
|
var MAX_CHARS = 1200;
|
|
@@ -7582,12 +7884,12 @@ var context = {
|
|
|
7582
7884
|
}, "describe")
|
|
7583
7885
|
};
|
|
7584
7886
|
|
|
7585
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
7887
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/images/registry.js
|
|
7586
7888
|
var BUILT_INS = [context];
|
|
7587
7889
|
var providers = [...BUILT_INS];
|
|
7588
7890
|
var registeredImageProviders = /* @__PURE__ */ __name(() => providers, "registeredImageProviders");
|
|
7589
7891
|
|
|
7590
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
7892
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/services/conversations.js
|
|
7591
7893
|
var READ_PAGE = 5e3;
|
|
7592
7894
|
var CHAIN = 50;
|
|
7593
7895
|
var CONVERSATION_QUERY = {
|
|
@@ -7739,7 +8041,7 @@ var sized = /* @__PURE__ */ __name((size4) => {
|
|
|
7739
8041
|
return size4;
|
|
7740
8042
|
}, "sized");
|
|
7741
8043
|
|
|
7742
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
8044
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/services/embeddings-maintenance.js
|
|
7743
8045
|
var REFRESH_BOUNDS = { maxChats: 20, maxChunks: 2e3 };
|
|
7744
8046
|
var MESSAGE_PAGE = 5e3;
|
|
7745
8047
|
var PER_SESSION = 8;
|
|
@@ -7758,7 +8060,7 @@ var embeddingTarget = /* @__PURE__ */ __name((deps, choice = DEFAULT_TEXT_MODEL)
|
|
|
7758
8060
|
price: remote.price,
|
|
7759
8061
|
installed: true,
|
|
7760
8062
|
perBatch: PER_REQUEST * concurrency,
|
|
7761
|
-
open: /* @__PURE__ */ __name(async () => (await import("./remote-
|
|
8063
|
+
open: /* @__PURE__ */ __name(async () => (await import("./remote-VWYFLRGO.js")).openRemote(remote, apiKey, { concurrency }), "open")
|
|
7762
8064
|
};
|
|
7763
8065
|
}
|
|
7764
8066
|
const model = textModel(choice);
|
|
@@ -7775,7 +8077,7 @@ var embeddingTarget = /* @__PURE__ */ __name((deps, choice = DEFAULT_TEXT_MODEL)
|
|
|
7775
8077
|
if (!isTextModelInstalled(model, directory))
|
|
7776
8078
|
throw notDownloaded(model.id);
|
|
7777
8079
|
if (apart) {
|
|
7778
|
-
const { openProcess } = await import("./process-
|
|
8080
|
+
const { openProcess } = await import("./process-BPBMV3AT.js");
|
|
7779
8081
|
return openProcess(model, directory, { threads: threads ?? defaultThreads() });
|
|
7780
8082
|
}
|
|
7781
8083
|
return openEmbedder(model, directory, { threads: threads ?? defaultThreads() });
|
|
@@ -8064,7 +8366,7 @@ var shaped = /* @__PURE__ */ __name(({ chatId, builtAt, algorithmVersion, pendin
|
|
|
8064
8366
|
return { ...one2, state };
|
|
8065
8367
|
}, "shaped");
|
|
8066
8368
|
|
|
8067
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
8369
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/services/search-catchup.js
|
|
8068
8370
|
var CATCH_UP_BOUNDS = { maxChunks: 500, maxMessages: 1e4, timeMs: 3e4 };
|
|
8069
8371
|
var validateCatchUpBounds = /* @__PURE__ */ __name((options) => {
|
|
8070
8372
|
for (const [key, value, maximum] of [
|
|
@@ -8117,7 +8419,7 @@ var catchUpSearch = /* @__PURE__ */ __name(async (deps, chat, options, signal, c
|
|
|
8117
8419
|
}
|
|
8118
8420
|
}, "catchUpSearch");
|
|
8119
8421
|
|
|
8120
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
8422
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/services/archive.js
|
|
8121
8423
|
var pushed = /* @__PURE__ */ __name((deps, what) => {
|
|
8122
8424
|
if (deps.reads === "store") {
|
|
8123
8425
|
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`);
|
|
@@ -8483,8 +8785,8 @@ var timeOfKey = /* @__PURE__ */ __name(async (store, account2, chatId, key, byTi
|
|
|
8483
8785
|
return message?.timestamp ?? fallback;
|
|
8484
8786
|
}, "timeOfKey");
|
|
8485
8787
|
|
|
8486
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
8487
|
-
import { createHash as
|
|
8788
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/services/archive-gaps.js
|
|
8789
|
+
import { createHash as createHash7, randomUUID as randomUUID4 } from "node:crypto";
|
|
8488
8790
|
var GAP_BOUNDS = { maxGaps: 5, limit: 500, timeMs: 3e4 };
|
|
8489
8791
|
var validateRepair = /* @__PURE__ */ __name((messenger, options) => {
|
|
8490
8792
|
const maxGaps = options.maxGaps ?? GAP_BOUNDS.maxGaps;
|
|
@@ -8525,7 +8827,7 @@ var gapsService = /* @__PURE__ */ __name((deps) => {
|
|
|
8525
8827
|
limits: { ...GAP_BOUNDS, pageSize: (deps.messenger.fetching ?? FETCHING).page },
|
|
8526
8828
|
gaps,
|
|
8527
8829
|
unknown: unknown3,
|
|
8528
|
-
fingerprint:
|
|
8830
|
+
fingerprint: createHash7("sha256").update(JSON.stringify(identity)).digest("hex")
|
|
8529
8831
|
};
|
|
8530
8832
|
}, "plan");
|
|
8531
8833
|
const repair = /* @__PURE__ */ __name(async (chat, options = {}) => {
|
|
@@ -8620,16 +8922,16 @@ var gapsService = /* @__PURE__ */ __name((deps) => {
|
|
|
8620
8922
|
return { plan, repair };
|
|
8621
8923
|
}, "gapsService");
|
|
8622
8924
|
|
|
8623
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
8624
|
-
import { createHash as
|
|
8925
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/services/attachments.js
|
|
8926
|
+
import { createHash as createHash9 } from "node:crypto";
|
|
8625
8927
|
import { constants as constants2, mkdirSync as mkdirSync2 } from "node:fs";
|
|
8626
8928
|
import { lstat as lstat4, open as open6, readFile, stat as stat2 } from "node:fs/promises";
|
|
8627
8929
|
|
|
8628
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
8930
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/attachments/directory.js
|
|
8629
8931
|
import { lstat as lstat2, readdir as readdir2, realpath as realpath3 } from "node:fs/promises";
|
|
8630
8932
|
import { basename as basename4, join as join8, relative as relative2, sep as sep2 } from "node:path";
|
|
8631
8933
|
|
|
8632
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
8934
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/sends/upload.js
|
|
8633
8935
|
import { openAsBlob, realpathSync } from "node:fs";
|
|
8634
8936
|
import { open as open4, stat } from "node:fs/promises";
|
|
8635
8937
|
import { basename as basename3, dirname as dirname3, extname, isAbsolute as isAbsolute2, relative, resolve as resolve5, sep } from "node:path";
|
|
@@ -8831,7 +9133,7 @@ var readStickerFile = /* @__PURE__ */ __name(async (path, maxBytes, read) => {
|
|
|
8831
9133
|
return { name, source };
|
|
8832
9134
|
}, "readStickerFile");
|
|
8833
9135
|
|
|
8834
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
9136
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/attachments/directory.js
|
|
8835
9137
|
var MAX_FILES = 1e4;
|
|
8836
9138
|
var directoryPaths = /* @__PURE__ */ __name(async (store, chat, directory, app, env) => {
|
|
8837
9139
|
if (refusedPlace(directory, app, env))
|
|
@@ -9941,7 +10243,7 @@ function imageSize(input) {
|
|
|
9941
10243
|
}
|
|
9942
10244
|
__name(imageSize, "imageSize");
|
|
9943
10245
|
|
|
9944
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
10246
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/attachments/ocr.js
|
|
9945
10247
|
var MAX_PAGES = 20;
|
|
9946
10248
|
var MAX_PIXELS = 2e7;
|
|
9947
10249
|
var cancelled = /* @__PURE__ */ __name((signal) => {
|
|
@@ -10092,7 +10394,7 @@ var ocrPdf = /* @__PURE__ */ __name(async (bytes2, pipeline2, load, signal) => {
|
|
|
10092
10394
|
}
|
|
10093
10395
|
}, "ocrPdf");
|
|
10094
10396
|
|
|
10095
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
10397
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/attachments/pdf-preview.js
|
|
10096
10398
|
var pdfPreview = /* @__PURE__ */ __name(async (bytes2, page, signal, load = importEngine, env = process.env) => {
|
|
10097
10399
|
const limits = pdfPreviewLimits(env);
|
|
10098
10400
|
const cancelled4 = /* @__PURE__ */ __name(() => {
|
|
@@ -10169,8 +10471,8 @@ var pdfPreview = /* @__PURE__ */ __name(async (bytes2, page, signal, load = impo
|
|
|
10169
10471
|
}
|
|
10170
10472
|
}, "pdfPreview");
|
|
10171
10473
|
|
|
10172
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
10173
|
-
import { createHash as
|
|
10474
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/attachments/transfer.js
|
|
10475
|
+
import { createHash as createHash8 } from "node:crypto";
|
|
10174
10476
|
import { constants } from "node:fs";
|
|
10175
10477
|
import { lstat as lstat3, open as open5 } from "node:fs/promises";
|
|
10176
10478
|
var MAX_CHUNK_BYTES = 1024 * 1024;
|
|
@@ -10203,7 +10505,7 @@ var retainedBytes = /* @__PURE__ */ __name(async (path, options, captureFile = f
|
|
|
10203
10505
|
const bytes2 = Buffer.alloc(Math.min(chunkBytes, opened.size - offsetBytes));
|
|
10204
10506
|
const capturedFile = captureFile ? Buffer.alloc(opened.size) : void 0;
|
|
10205
10507
|
const head = Buffer.alloc(32);
|
|
10206
|
-
const hash3 =
|
|
10508
|
+
const hash3 = createHash8("sha256");
|
|
10207
10509
|
let seen = 0;
|
|
10208
10510
|
let copied = 0;
|
|
10209
10511
|
const scratch = Buffer.alloc(65536);
|
|
@@ -10277,7 +10579,7 @@ var transferMime = /* @__PURE__ */ __name((head, hint, name = null) => {
|
|
|
10277
10579
|
return hint !== null && /^[a-z0-9.+-]+\/[a-z0-9.+-]+$/i.test(hint) ? hint : "application/octet-stream";
|
|
10278
10580
|
}, "transferMime");
|
|
10279
10581
|
|
|
10280
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
10582
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/services/file-download.js
|
|
10281
10583
|
import { createWriteStream, mkdirSync } from "node:fs";
|
|
10282
10584
|
import { link as link3, rm } from "node:fs/promises";
|
|
10283
10585
|
import { join as join9, resolve as resolve6 } from "node:path";
|
|
@@ -10391,7 +10693,7 @@ var save = /* @__PURE__ */ __name(async (file2, directory, fallbackName, { uniqu
|
|
|
10391
10693
|
}
|
|
10392
10694
|
}, "save");
|
|
10393
10695
|
|
|
10394
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
10696
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/services/attachments.js
|
|
10395
10697
|
var ATTACHMENT_QUERY = {
|
|
10396
10698
|
entity: "attachment",
|
|
10397
10699
|
backend: "sql",
|
|
@@ -10441,7 +10743,7 @@ var outcome = /* @__PURE__ */ __name(async (file2, path, load, signal, noFollow
|
|
|
10441
10743
|
} finally {
|
|
10442
10744
|
await handle.close();
|
|
10443
10745
|
}
|
|
10444
|
-
const sha =
|
|
10746
|
+
const sha = createHash9("sha256").update(bytes2).digest("hex");
|
|
10445
10747
|
const isPdf = Buffer.from(bytes2.subarray(0, 5)).toString() === "%PDF-";
|
|
10446
10748
|
const ocrCandidate = ocr !== void 0 && (known2 === "image" || isPdf);
|
|
10447
10749
|
const localKind = documentKind(hint);
|
|
@@ -10480,7 +10782,7 @@ var keep = /* @__PURE__ */ __name(async (store, file2, extraction, bytes2, sha)
|
|
|
10480
10782
|
});
|
|
10481
10783
|
}
|
|
10482
10784
|
}, "keep");
|
|
10483
|
-
var
|
|
10785
|
+
var itemOf2 = /* @__PURE__ */ __name((account2, view) => ({
|
|
10484
10786
|
message: formatLocator({ ...account2, chat: view.chatId, message: view.messageId }),
|
|
10485
10787
|
kind: view.kind,
|
|
10486
10788
|
position: view.position + 1,
|
|
@@ -10692,7 +10994,7 @@ var attachmentsService = /* @__PURE__ */ __name((deps) => ({
|
|
|
10692
10994
|
}
|
|
10693
10995
|
const where = query ? queryFilter(query, attachmentColumns(chats), { command: "attachments list" }) : void 0;
|
|
10694
10996
|
const views = await store.attachments.attachments({ ...where ? { where } : {}, offset, limit: limit + 1 });
|
|
10695
|
-
return { items: views.slice(0, limit).map((view) =>
|
|
10997
|
+
return { items: views.slice(0, limit).map((view) => itemOf2(account2, view)), has_more: views.length > limit };
|
|
10696
10998
|
}, "list"),
|
|
10697
10999
|
show: /* @__PURE__ */ __name(async ({ chat, message, attachment: attachment2, page, load, ...window2 }) => {
|
|
10698
11000
|
validateWindow(window2);
|
|
@@ -10728,7 +11030,7 @@ var attachmentsService = /* @__PURE__ */ __name((deps) => ({
|
|
|
10728
11030
|
nextOffsetBytes: null,
|
|
10729
11031
|
complete: true,
|
|
10730
11032
|
base64: rendered.bytes.toString("base64"),
|
|
10731
|
-
sha256:
|
|
11033
|
+
sha256: createHash9("sha256").update(rendered.bytes).digest("hex"),
|
|
10732
11034
|
pdf: {
|
|
10733
11035
|
page: rendered.page,
|
|
10734
11036
|
pageCount: rendered.pageCount,
|
|
@@ -10814,7 +11116,7 @@ var attachmentsService = /* @__PURE__ */ __name((deps) => ({
|
|
|
10814
11116
|
}, "setText")
|
|
10815
11117
|
}), "attachmentsService");
|
|
10816
11118
|
|
|
10817
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
11119
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/services/chat-documents.js
|
|
10818
11120
|
var chatDocumentsService = /* @__PURE__ */ __name((deps) => ({
|
|
10819
11121
|
list: /* @__PURE__ */ __name(async (chat, { limit, offset, ref }) => {
|
|
10820
11122
|
const store = await accountStore(deps);
|
|
@@ -10844,7 +11146,7 @@ var chatDocumentsService = /* @__PURE__ */ __name((deps) => ({
|
|
|
10844
11146
|
}, "list")
|
|
10845
11147
|
}), "chatDocumentsService");
|
|
10846
11148
|
|
|
10847
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
11149
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/services/retention.js
|
|
10848
11150
|
var observationDuration = /* @__PURE__ */ __name((text2, flag) => {
|
|
10849
11151
|
const match = /^(\d+(?:\.\d+)?)([smhdw])$/.exec(text2);
|
|
10850
11152
|
const units2 = { s: 1e3, m: 6e4, h: 36e5, d: 864e5, w: 6048e5 };
|
|
@@ -10931,7 +11233,7 @@ var isRetentionSelection = /* @__PURE__ */ __name((selection) => {
|
|
|
10931
11233
|
}
|
|
10932
11234
|
}, "isRetentionSelection");
|
|
10933
11235
|
|
|
10934
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
11236
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/services/counters.js
|
|
10935
11237
|
var counterFields = /* @__PURE__ */ __name((text2 = "views,reactions,comments") => {
|
|
10936
11238
|
const fields = text2.split(",").map((one2) => one2.trim());
|
|
10937
11239
|
if (!fields.length || fields.some((one2) => !COUNTER_FIELDS.includes(one2)) || new Set(fields).size !== fields.length)
|
|
@@ -11138,7 +11440,7 @@ var countersService = /* @__PURE__ */ __name((deps) => {
|
|
|
11138
11440
|
};
|
|
11139
11441
|
}, "countersService");
|
|
11140
11442
|
|
|
11141
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
11443
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/services/search-refresh.js
|
|
11142
11444
|
var SYNC_KEY = "messages.sync-first";
|
|
11143
11445
|
var SYNC_BOUNDS = { maxChats: 5, timeMs: 3e4, maxMessages: 500 };
|
|
11144
11446
|
var keyOf2 = /* @__PURE__ */ __name((chat) => JSON.stringify([chat.account.provider, chat.account.account, chat.chatId]), "keyOf");
|
|
@@ -11270,7 +11572,7 @@ var withRefresh = /* @__PURE__ */ __name((found, refreshed) => ({
|
|
|
11270
11572
|
...!refreshed || refreshed.complete ? {} : { coverage: { ...found.coverage, state: "stale" } }
|
|
11271
11573
|
}), "withRefresh");
|
|
11272
11574
|
|
|
11273
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
11575
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/services/embeddings-search.js
|
|
11274
11576
|
var CANDIDATES = 50;
|
|
11275
11577
|
var WORD_HITS = 200;
|
|
11276
11578
|
var RRF_K = 60;
|
|
@@ -11545,13 +11847,13 @@ var meanOf = /* @__PURE__ */ __name((vectors) => {
|
|
|
11545
11847
|
return mean2.map((value) => value / length);
|
|
11546
11848
|
}, "meanOf");
|
|
11547
11849
|
|
|
11548
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
11850
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/services/embeddings.js
|
|
11549
11851
|
var embeddingsService = /* @__PURE__ */ __name((deps) => ({
|
|
11550
11852
|
...embeddingsMaintenance(deps),
|
|
11551
11853
|
...embeddingsSearch(deps)
|
|
11552
11854
|
}), "embeddingsService");
|
|
11553
11855
|
|
|
11554
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
11856
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/services/folders.js
|
|
11555
11857
|
var foldersService = /* @__PURE__ */ __name((deps) => {
|
|
11556
11858
|
const online = /* @__PURE__ */ __name(async (command) => {
|
|
11557
11859
|
if (deps.offline)
|
|
@@ -11692,7 +11994,7 @@ var foldersService = /* @__PURE__ */ __name((deps) => {
|
|
|
11692
11994
|
};
|
|
11693
11995
|
}, "foldersService");
|
|
11694
11996
|
|
|
11695
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
11997
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/services/inbox.js
|
|
11696
11998
|
var INBOX_CHATS = 20;
|
|
11697
11999
|
var REVIEW_DAYS = 3;
|
|
11698
12000
|
var UNANSWERED_HOURS = 24;
|
|
@@ -11900,7 +12202,7 @@ var inboxService = /* @__PURE__ */ __name((deps) => {
|
|
|
11900
12202
|
};
|
|
11901
12203
|
}, "inboxService");
|
|
11902
12204
|
|
|
11903
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
12205
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/services/mentions.js
|
|
11904
12206
|
var REVIEW_COUNT = 500;
|
|
11905
12207
|
var mentionsService = /* @__PURE__ */ __name((deps) => {
|
|
11906
12208
|
const located = /* @__PURE__ */ __name(async () => {
|
|
@@ -11979,7 +12281,7 @@ var mentionsService = /* @__PURE__ */ __name((deps) => {
|
|
|
11979
12281
|
};
|
|
11980
12282
|
}, "mentionsService");
|
|
11981
12283
|
|
|
11982
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
12284
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/domain/formatting.js
|
|
11983
12285
|
var invalid3 = /* @__PURE__ */ __name(() => new CliError("validation_error", "the messenger formatter returned invalid text spans"), "invalid");
|
|
11984
12286
|
var validateFormattedText = /* @__PURE__ */ __name((formatted2) => {
|
|
11985
12287
|
const { text: text2, spans } = formatted2;
|
|
@@ -12039,7 +12341,7 @@ var visibleFormattedText = /* @__PURE__ */ __name((formatted2) => {
|
|
|
12039
12341
|
};
|
|
12040
12342
|
}, "visibleFormattedText");
|
|
12041
12343
|
|
|
12042
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
12344
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/domain/message-link.js
|
|
12043
12345
|
var fileLinks = /* @__PURE__ */ __name((attachments) => hitFiles(attachments).map(({ position, kind, name }) => ({
|
|
12044
12346
|
position,
|
|
12045
12347
|
kind,
|
|
@@ -12088,7 +12390,7 @@ var validatePermalink = /* @__PURE__ */ __name((link4) => {
|
|
|
12088
12390
|
return { url: link4.url, access: link4.access, reason: link4.reason };
|
|
12089
12391
|
}, "validatePermalink");
|
|
12090
12392
|
|
|
12091
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
12393
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/domain/pin-duration.js
|
|
12092
12394
|
var spokenSeconds = /* @__PURE__ */ __name((seconds) => {
|
|
12093
12395
|
if (seconds % 86400 === 0 && seconds > 86400)
|
|
12094
12396
|
return `${seconds / 86400}d`;
|
|
@@ -12120,7 +12422,7 @@ var pinDurationOf = /* @__PURE__ */ __name((value, allowed, flag = "--expire-tim
|
|
|
12120
12422
|
return seconds;
|
|
12121
12423
|
}, "pinDurationOf");
|
|
12122
12424
|
|
|
12123
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
12425
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/sends/send-as.js
|
|
12124
12426
|
var sendAsCheck = /* @__PURE__ */ __name((connection, sendAs) => {
|
|
12125
12427
|
if (sendAs === void 0) {
|
|
12126
12428
|
const saved = connection.savedSender?.bind(connection);
|
|
@@ -12145,7 +12447,7 @@ var typedSendAs = /* @__PURE__ */ __name((typed) => {
|
|
|
12145
12447
|
return sendAs;
|
|
12146
12448
|
}, "typedSendAs");
|
|
12147
12449
|
|
|
12148
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
12450
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/search/total.js
|
|
12149
12451
|
var TOTAL_CAP = 1e4;
|
|
12150
12452
|
var totalOf = /* @__PURE__ */ __name((count2, shown, hasMore, exact = true) => {
|
|
12151
12453
|
const least = shown + (hasMore ? 1 : 0);
|
|
@@ -12156,7 +12458,7 @@ var totalOf = /* @__PURE__ */ __name((count2, shown, hasMore, exact = true) => {
|
|
|
12156
12458
|
return { value: count2, relation: exact ? "eq" : "gte" };
|
|
12157
12459
|
}, "totalOf");
|
|
12158
12460
|
|
|
12159
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
12461
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/search/lucene/meaning-parts.js
|
|
12160
12462
|
var WORD_FIELDS = /* @__PURE__ */ new Set(["text", "exact"]);
|
|
12161
12463
|
var fieldsOfQuery = /* @__PURE__ */ __name((root, everything) => {
|
|
12162
12464
|
let narrows = false;
|
|
@@ -12185,7 +12487,7 @@ var meaningWords = /* @__PURE__ */ __name((root) => {
|
|
|
12185
12487
|
return wanted(root).join(" ").trim();
|
|
12186
12488
|
}, "meaningWords");
|
|
12187
12489
|
|
|
12188
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
12490
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/search/question-plan.js
|
|
12189
12491
|
var words2 = /* @__PURE__ */ __name((text2) => normalize(text2).match(/[\p{L}\p{N}]+/gu) ?? [], "words");
|
|
12190
12492
|
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"));
|
|
12191
12493
|
var questionWord = /\b(?:what|which|how|who|where|when|can|could|should)\b|(?:^|\s)(?:сколько|какой|какая|какие|какое|кто|кому|кем|где|когда|как|что|можно|может|могут|ли)(?:\s|$)/iu;
|
|
@@ -12318,7 +12620,7 @@ var questionLookup = /* @__PURE__ */ __name((text2) => {
|
|
|
12318
12620
|
return terms.length ? anyOfTerms(terms, plan.scope) : void 0;
|
|
12319
12621
|
}, "questionLookup");
|
|
12320
12622
|
|
|
12321
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
12623
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/services/messages-combined.js
|
|
12322
12624
|
var COMBINED_DEFAULTS = { candidateDepth: 300, rrfK: 60, rerank: "all", chatCap: 0 };
|
|
12323
12625
|
var tokensOf = /* @__PURE__ */ __name((text2) => normalize(text2).match(/[\p{L}\p{N}\p{Co}\p{M}]+/gu) ?? [], "tokensOf");
|
|
12324
12626
|
var searchCombined = /* @__PURE__ */ __name(async (store, account2, request, messenger = {}, options = COMBINED_DEFAULTS) => {
|
|
@@ -12511,7 +12813,7 @@ var signals = /* @__PURE__ */ __name((hit, terms, corrections, execution, mode,
|
|
|
12511
12813
|
return mode === "coverage" ? coverage2 * 4 : mode === "proximity" ? proximity : mode === "phrase" ? phrase : coverage2 * 4 + proximity + phrase;
|
|
12512
12814
|
}, "signals");
|
|
12513
12815
|
|
|
12514
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
12816
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/services/messages-discovery.js
|
|
12515
12817
|
var MEANING_DEPTH = 100;
|
|
12516
12818
|
var RRF_K2 = 60;
|
|
12517
12819
|
var RERANK_DEPTH = 50;
|
|
@@ -12836,7 +13138,7 @@ var mixedWithReranker = /* @__PURE__ */ __name((head, scores) => {
|
|
|
12836
13138
|
})).sort((a, b) => b.mixed - a.mixed).map(({ hit }) => hit);
|
|
12837
13139
|
}, "mixedWithReranker");
|
|
12838
13140
|
|
|
12839
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
13141
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/services/thread-context.js
|
|
12840
13142
|
var THREAD_BOUNDS = { maxHops: 8, maxMessages: 50, maxBytes: 65536, withinMs: 864e5 };
|
|
12841
13143
|
var bytes = /* @__PURE__ */ __name((items, links) => Buffer.byteLength(JSON.stringify({ items, links }), "utf8"), "bytes");
|
|
12842
13144
|
var threadBounds = /* @__PURE__ */ __name((options = {}) => {
|
|
@@ -13035,7 +13337,7 @@ var readThreadContext = /* @__PURE__ */ __name(async (store, account2, chat, mes
|
|
|
13035
13337
|
return result;
|
|
13036
13338
|
}, "readThreadContext");
|
|
13037
13339
|
|
|
13038
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
13340
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/services/messages-archive-search.js
|
|
13039
13341
|
var SEARCH_FILL_MS = 200;
|
|
13040
13342
|
var statsStore = /* @__PURE__ */ __name(async (store, account2, request, messenger = {}) => {
|
|
13041
13343
|
const stop = Date.now() + SEARCH_FILL_MS;
|
|
@@ -13104,12 +13406,12 @@ var accountOf2 = /* @__PURE__ */ __name((hit) => {
|
|
|
13104
13406
|
}, "accountOf");
|
|
13105
13407
|
var keyOf3 = /* @__PURE__ */ __name(({ provider, account: account2 }) => `${provider}/${account2}`, "keyOf");
|
|
13106
13408
|
|
|
13107
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
13108
|
-
import { createHash as
|
|
13409
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/services/pictures.js
|
|
13410
|
+
import { createHash as createHash10 } from "node:crypto";
|
|
13109
13411
|
import { readFile as readFile2, stat as stat3 } from "node:fs/promises";
|
|
13110
13412
|
import { setTimeout as sleep4 } from "node:timers/promises";
|
|
13111
13413
|
|
|
13112
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
13414
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/domain/models.js
|
|
13113
13415
|
var GROUP_SETTINGS = [
|
|
13114
13416
|
"allCanPin",
|
|
13115
13417
|
"onlyAdminsAdd",
|
|
@@ -13123,7 +13425,7 @@ var ADMIN_RIGHTS = ["read", "members", "admins", "info", "pin", "link", "post",
|
|
|
13123
13425
|
var senderIsMe = /* @__PURE__ */ __name((message, account2) => message.outgoing === true || message.senderId !== null && String(message.senderId) === account2, "senderIsMe");
|
|
13124
13426
|
var MEDIA_KINDS = ["photo", "video", "file", "audio", "link"];
|
|
13125
13427
|
|
|
13126
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
13428
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/services/pictures.js
|
|
13127
13429
|
var PICTURE_MAX_BYTES = 25 * 1024 * 1024;
|
|
13128
13430
|
var PICTURE_FLOOR = 0.25;
|
|
13129
13431
|
var PAGE4 = 50;
|
|
@@ -13140,7 +13442,7 @@ var picturesService = /* @__PURE__ */ __name((deps) => {
|
|
|
13140
13442
|
const directory = imageModelsDirectory(deps.env);
|
|
13141
13443
|
if (!isImageModelInstalled(model2, directory))
|
|
13142
13444
|
throw new CliError("not_found", missingModel(model2.id), { reason: "model.not-downloaded", model: model2.id });
|
|
13143
|
-
const { openPictureEmbedder } = await import("./embedder-
|
|
13445
|
+
const { openPictureEmbedder } = await import("./embedder-NGCBQHIG.js");
|
|
13144
13446
|
return openPictureEmbedder(model2, directory);
|
|
13145
13447
|
}, "open");
|
|
13146
13448
|
const embedder = /* @__PURE__ */ __name(() => {
|
|
@@ -13237,7 +13539,7 @@ var picturesService = /* @__PURE__ */ __name((deps) => {
|
|
|
13237
13539
|
const vector = await use.embedImage(bytes2);
|
|
13238
13540
|
pending.push({
|
|
13239
13541
|
attachmentPk: picture.attachmentPk,
|
|
13240
|
-
hash:
|
|
13542
|
+
hash: createHash10("sha256").update(bytes2).digest("hex"),
|
|
13241
13543
|
bytes: bytes2.length,
|
|
13242
13544
|
occurredAt: picture.sentAt,
|
|
13243
13545
|
vector
|
|
@@ -13337,7 +13639,7 @@ var withPictures = /* @__PURE__ */ __name((messages, pictures) => ({
|
|
|
13337
13639
|
}, "search")
|
|
13338
13640
|
}), "withPictures");
|
|
13339
13641
|
|
|
13340
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
13642
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/services/messages-meaning.js
|
|
13341
13643
|
var meaningLane = /* @__PURE__ */ __name((deps) => async (question, accounts, shared, within) => {
|
|
13342
13644
|
const target = embeddingTarget(deps, DEFAULT_TEXT_MODEL);
|
|
13343
13645
|
const skipped = /* @__PURE__ */ __name((reason, step) => ({
|
|
@@ -13405,7 +13707,7 @@ var meaningLane = /* @__PURE__ */ __name((deps) => async (question, accounts, sh
|
|
|
13405
13707
|
}
|
|
13406
13708
|
}, "meaningLane");
|
|
13407
13709
|
|
|
13408
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
13710
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/services/messages-rerank.js
|
|
13409
13711
|
var rerankLane = /* @__PURE__ */ __name((deps) => {
|
|
13410
13712
|
const choice = deps.reranker ?? DEFAULT_RERANK_MODEL;
|
|
13411
13713
|
if (choice === "off")
|
|
@@ -13417,9 +13719,9 @@ var rerankLane = /* @__PURE__ */ __name((deps) => {
|
|
|
13417
13719
|
return { skipped: { reason: `${model.id} is not downloaded`, step: "models.download", model: model.id } };
|
|
13418
13720
|
try {
|
|
13419
13721
|
const warm = deps.embedders;
|
|
13420
|
-
const reranker = warm ? await warm.reranker(`rerank:${model.id}`, async () => (await import("./process-
|
|
13722
|
+
const reranker = warm ? await warm.reranker(`rerank:${model.id}`, async () => (await import("./process-BPBMV3AT.js")).openRerankerProcess(model, directory, {
|
|
13421
13723
|
threads: defaultThreads()
|
|
13422
|
-
})) : await (await import("./rerank-
|
|
13724
|
+
})) : await (await import("./rerank-4NGQWREA.js")).openReranker(model, directory);
|
|
13423
13725
|
return {
|
|
13424
13726
|
model: model.id,
|
|
13425
13727
|
score: /* @__PURE__ */ __name((question, passages) => reranker.score(plainWords(question), passages), "score"),
|
|
@@ -13439,21 +13741,21 @@ var rerankLane = /* @__PURE__ */ __name((deps) => {
|
|
|
13439
13741
|
};
|
|
13440
13742
|
}, "rerankLane");
|
|
13441
13743
|
|
|
13442
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
13443
|
-
import { createHash as
|
|
13744
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/services/document-pictures.js
|
|
13745
|
+
import { createHash as createHash11 } from "node:crypto";
|
|
13444
13746
|
var refOf = /* @__PURE__ */ __name((target) => target.ref ?? `document:${target.documentId}`, "refOf");
|
|
13445
13747
|
var openPictureEmbedderFor = /* @__PURE__ */ __name(async ({ env, command } = {}) => {
|
|
13446
13748
|
const model = imageModel(DEFAULT_IMAGE_MODEL);
|
|
13447
13749
|
const directory = imageModelsDirectory(env);
|
|
13448
13750
|
if (!isImageModelInstalled(model, directory))
|
|
13449
13751
|
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 });
|
|
13450
|
-
const { openPictureEmbedder } = await import("./embedder-
|
|
13752
|
+
const { openPictureEmbedder } = await import("./embedder-NGCBQHIG.js");
|
|
13451
13753
|
return openPictureEmbedder(model, directory);
|
|
13452
13754
|
}, "openPictureEmbedderFor");
|
|
13453
13755
|
var savePicture = /* @__PURE__ */ __name(async (store, target, bytes2, options = {}) => {
|
|
13454
13756
|
const ref = refOf(target);
|
|
13455
13757
|
const model = imageModel(DEFAULT_IMAGE_MODEL);
|
|
13456
|
-
const hash3 =
|
|
13758
|
+
const hash3 = createHash11("sha256").update(bytes2).digest("hex");
|
|
13457
13759
|
if (await store.notes.pictureHash(ref, model.key) === hash3)
|
|
13458
13760
|
return "unchanged";
|
|
13459
13761
|
const embedder = options.embedder ?? await openPictureEmbedderFor(options);
|
|
@@ -13468,7 +13770,7 @@ var savePicture = /* @__PURE__ */ __name(async (store, target, bytes2, options =
|
|
|
13468
13770
|
}, "savePicture");
|
|
13469
13771
|
var removePicture = /* @__PURE__ */ __name((store, target) => store.notes.removePicture(refOf(target)), "removePicture");
|
|
13470
13772
|
|
|
13471
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
13773
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/services/document-source.js
|
|
13472
13774
|
var documentSource = /* @__PURE__ */ __name((note, accounts, profiles, file2) => {
|
|
13473
13775
|
const metadata = note.frontMatter;
|
|
13474
13776
|
const account2 = accounts.find(({ id: id2 }) => String(id2) === note.folderId);
|
|
@@ -13483,7 +13785,7 @@ var documentSource = /* @__PURE__ */ __name((note, accounts, profiles, file2) =>
|
|
|
13483
13785
|
};
|
|
13484
13786
|
}, "documentSource");
|
|
13485
13787
|
|
|
13486
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
13788
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/services/notes-title-tier.js
|
|
13487
13789
|
var plainQueryWords = /* @__PURE__ */ __name((query) => {
|
|
13488
13790
|
let root;
|
|
13489
13791
|
try {
|
|
@@ -13510,7 +13812,7 @@ var titleTiers = /* @__PURE__ */ __name((hits, words4) => {
|
|
|
13510
13812
|
return [...hits].sort((a, b) => rank(a) - rank(b));
|
|
13511
13813
|
}, "titleTiers");
|
|
13512
13814
|
|
|
13513
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
13815
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/services/notes-search.js
|
|
13514
13816
|
var storeQuery = /* @__PURE__ */ __name(async (store, text2, { exact, timezone } = {}) => resolvedQuery(store, parsedQuery(text2, exact), timezone), "storeQuery");
|
|
13515
13817
|
var parsedQuery = /* @__PURE__ */ __name((text2, exact) => validateFields(parseLucene(text2, { ...SEARCH_QUERY, defaultField: exact ? "exact" : "text" })).root, "parsedQuery");
|
|
13516
13818
|
var resolvedQuery = /* @__PURE__ */ __name(async (store, root, timezone) => {
|
|
@@ -13938,7 +14240,8 @@ var searchNotesOf = /* @__PURE__ */ __name(async (store, account2, text2, { acco
|
|
|
13938
14240
|
const held = [
|
|
13939
14241
|
{ provider: "notes", account: INTERNAL_NOTES },
|
|
13940
14242
|
...(await store.notes.folders()).map(({ id: id2 }) => ({ provider: "notes", account: id2 })),
|
|
13941
|
-
...(await store.notes.documentsAccounts()).map(({ id: id2 }) => ({ provider: "notes", account: id2 }))
|
|
14243
|
+
...(await store.notes.documentsAccounts()).map(({ id: id2 }) => ({ provider: "notes", account: id2 })),
|
|
14244
|
+
...[await store.notes.addedAccount()].flatMap((added) => added ? [{ provider: "notes", account: added.id }] : [])
|
|
13942
14245
|
];
|
|
13943
14246
|
const named2 = list3 === void 0 ? { accounts: held, skipped: [] } : fitting(entriesOfList(list3, await listContextOf(store, account2, app)), ["notes", "documents"], what);
|
|
13944
14247
|
const source = query.source ?? noteSourceOfQuery(text2).source;
|
|
@@ -13958,14 +14261,14 @@ var searchNotesOf = /* @__PURE__ */ __name(async (store, account2, text2, { acco
|
|
|
13958
14261
|
};
|
|
13959
14262
|
}, "searchNotesOf");
|
|
13960
14263
|
|
|
13961
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
14264
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/services/events-search.js
|
|
13962
14265
|
var MAX_EVENTS_OFFSET = 1e3;
|
|
13963
14266
|
var iso = /* @__PURE__ */ __name((at) => at === null ? null : new Date(at).toISOString(), "iso");
|
|
13964
14267
|
var accountIdsOf = /* @__PURE__ */ __name(async (store, accounts) => {
|
|
13965
14268
|
const held = await store.accounts.storedAccounts();
|
|
13966
14269
|
return held.filter((one2) => accounts.some(({ provider, account: account2 }) => one2.provider === provider && one2.account === account2)).map(({ id: id2 }) => String(id2));
|
|
13967
14270
|
}, "accountIdsOf");
|
|
13968
|
-
var calendarAccounts = /* @__PURE__ */ __name(async (store) => (await store.accounts.storedAccounts()).filter(({ provider }) =>
|
|
14271
|
+
var calendarAccounts = /* @__PURE__ */ __name(async (store) => (await store.accounts.storedAccounts()).filter(({ provider }) => holdsKind(provider, "events")).map(({ provider, account: account2 }) => ({ provider, account: account2 })), "calendarAccounts");
|
|
13969
14272
|
var foundEvent = /* @__PURE__ */ __name((hit, query, foundBy) => ({
|
|
13970
14273
|
ref: hit.ref,
|
|
13971
14274
|
provider: hit.account?.provider ?? null,
|
|
@@ -14076,7 +14379,7 @@ var searchEvents = /* @__PURE__ */ __name(async (store, query, { limit = 20, off
|
|
|
14076
14379
|
};
|
|
14077
14380
|
}, "searchEvents");
|
|
14078
14381
|
|
|
14079
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
14382
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/services/search-all.js
|
|
14080
14383
|
var RESOURCES_SEARCHED = ["messages", "mail", "notes", "events", "crm"];
|
|
14081
14384
|
var refusal = /* @__PURE__ */ __name((error, text2) => {
|
|
14082
14385
|
const { reason, span } = error.details ?? {};
|
|
@@ -14102,7 +14405,7 @@ var titleWords = /* @__PURE__ */ __name((text2) => {
|
|
|
14102
14405
|
})());
|
|
14103
14406
|
return { words: words4, anyWord: clauses.length > 1 && clauses.every(({ occur }) => occur === "should") };
|
|
14104
14407
|
}, "titleWords");
|
|
14105
|
-
var crmAccounts = /* @__PURE__ */ __name(async (store) => (await store.accounts.accounts()).filter(({ provider }) =>
|
|
14408
|
+
var crmAccounts = /* @__PURE__ */ __name(async (store) => (await store.accounts.accounts()).filter(({ provider }) => holdsKind(provider, "crm")), "crmAccounts");
|
|
14106
14409
|
var searchAll = /* @__PURE__ */ __name(async (store, account2, asked, messenger = {}, searchMessages = (query) => searchStore(store, account2, query, messenger), meaning) => {
|
|
14107
14410
|
if (!asked.text.trim())
|
|
14108
14411
|
throw new CliError("validation_error", "say what to find");
|
|
@@ -14150,12 +14453,12 @@ var searchAll = /* @__PURE__ */ __name(async (store, account2, asked, messenger
|
|
|
14150
14453
|
if (kind === "messages" && found.coverage)
|
|
14151
14454
|
coverage2 = found.coverage;
|
|
14152
14455
|
hasMore ||= found.hasMore;
|
|
14153
|
-
const read = found.coverage?.accounts ?? given ?? (await store.accounts.accounts()).filter(({ provider }) =>
|
|
14456
|
+
const read = found.coverage?.accounts ?? given ?? (await store.accounts.accounts()).filter(({ provider }) => holdsKind(provider, kind));
|
|
14154
14457
|
for (const one2 of found.skipped ?? [])
|
|
14155
14458
|
if (!skipped.some(({ source }) => source === one2.source))
|
|
14156
14459
|
skipped.push(one2);
|
|
14157
14460
|
accounts.push(...read.map(({ provider, account: account3 }) => ({ resource: kind, provider, account: account3 })));
|
|
14158
|
-
const
|
|
14461
|
+
const itemOf3 = /* @__PURE__ */ __name((hit, foundBy) => {
|
|
14159
14462
|
const at = parseLocator(hit.locator);
|
|
14160
14463
|
return {
|
|
14161
14464
|
kind: kind === "mail" ? "mail" : "message",
|
|
@@ -14172,7 +14475,7 @@ var searchAll = /* @__PURE__ */ __name(async (store, account2, asked, messenger
|
|
|
14172
14475
|
foundBy
|
|
14173
14476
|
};
|
|
14174
14477
|
}, "itemOf");
|
|
14175
|
-
const byWords = found.items.map((hit) =>
|
|
14478
|
+
const byWords = found.items.map((hit) => itemOf3(hit, ["words"]));
|
|
14176
14479
|
if (!meaning || request.exact || kind === "messages" && request.backend === "server")
|
|
14177
14480
|
return byWords;
|
|
14178
14481
|
const filters = filtersBeside(request.text);
|
|
@@ -14201,7 +14504,7 @@ var searchAll = /* @__PURE__ */ __name(async (store, account2, asked, messenger
|
|
|
14201
14504
|
if (held && discovers)
|
|
14202
14505
|
held.score = Math.max(held.score, vote);
|
|
14203
14506
|
else
|
|
14204
|
-
fused2.set(hit.locator, { item: held?.item ??
|
|
14507
|
+
fused2.set(hit.locator, { item: held?.item ?? itemOf3(hit, ["meaning"]), score: (held?.score ?? 0) + vote });
|
|
14205
14508
|
});
|
|
14206
14509
|
return [...fused2.values()].sort((a, b) => b.score - a.score).map(({ item: item2 }) => item2);
|
|
14207
14510
|
}, "messagesOf");
|
|
@@ -14243,7 +14546,8 @@ var searchAll = /* @__PURE__ */ __name(async (store, account2, asked, messenger
|
|
|
14243
14546
|
const read = chosen?.map(({ account: account3 }) => account3) ?? [
|
|
14244
14547
|
INTERNAL_NOTES,
|
|
14245
14548
|
...(await store.notes.folders()).map(({ id: id2 }) => id2),
|
|
14246
|
-
...(await store.notes.documentsAccounts()).map(({ id: id2 }) => id2)
|
|
14549
|
+
...(await store.notes.documentsAccounts()).map(({ id: id2 }) => id2),
|
|
14550
|
+
...[await store.notes.addedAccount()].flatMap((added) => added ? [added.id] : [])
|
|
14247
14551
|
];
|
|
14248
14552
|
accounts.push(...read.map((account3) => ({ resource, provider: "notes", account: account3 })));
|
|
14249
14553
|
} else if (resource === "events") {
|
|
@@ -14347,7 +14651,7 @@ var oneList = /* @__PURE__ */ __name((lists, cosines) => {
|
|
|
14347
14651
|
return [...place.values()].sort((a, b) => a.rank - b.rank || cosine(b.item.ref) - cosine(a.item.ref)).map(({ item: item2 }) => item2);
|
|
14348
14652
|
}, "oneList");
|
|
14349
14653
|
|
|
14350
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
14654
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/services/search-all-meetings.js
|
|
14351
14655
|
var RESOURCES_SEARCHED_WITH_MEETINGS = [...RESOURCES_SEARCHED, "meetings"];
|
|
14352
14656
|
var whole2 = /* @__PURE__ */ __name((value, minimum, maximum, label) => {
|
|
14353
14657
|
if (!Number.isSafeInteger(value) || value < minimum || value > maximum)
|
|
@@ -14572,7 +14876,7 @@ var searchAllOfSource = /* @__PURE__ */ __name(async (store, account2, source, r
|
|
|
14572
14876
|
const entries = entriesOfList(source, await listContextOf(store, account2, messenger.app));
|
|
14573
14877
|
const { skipped } = fitting(entries, only, "search all", (kind) => `--only leaves ${kind} out`);
|
|
14574
14878
|
const named2 = /* @__PURE__ */ __name((resource) => [
|
|
14575
|
-
...new Map(entries.flatMap(({ accounts }) => accounts).filter((
|
|
14879
|
+
...new Map(entries.flatMap(({ accounts }) => accounts).filter((one2) => listedHolds(one2, resource)).map(({ provider, account: account3 }) => [`${provider}\0${account3}`, { provider, account: account3 }])).values()
|
|
14576
14880
|
], "named");
|
|
14577
14881
|
const meetings = await holdingMeetings(store, named2("meetings"));
|
|
14578
14882
|
const empty2 = named2("meetings").filter((one2) => !meetings.some(({ provider, account: account3 }) => provider === one2.provider && account3 === one2.account)).map(({ provider, account: account3 }) => ({
|
|
@@ -14601,7 +14905,7 @@ var searchAllOfSource = /* @__PURE__ */ __name(async (store, account2, source, r
|
|
|
14601
14905
|
return { ...found, skipped: [...skipped, ...empty2, ...unnamed, ...found.skipped] };
|
|
14602
14906
|
}, "searchAllOfSource");
|
|
14603
14907
|
|
|
14604
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
14908
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/services/server-search.js
|
|
14605
14909
|
var SERVER_SEARCH_KEY = "messages.server-search";
|
|
14606
14910
|
var SERVER_BOUNDS = { timeMs: 5e3, perCall: 100, maxCalls: 3, textBytes: 262144 };
|
|
14607
14911
|
var DEFAULT_BACKEND = "both";
|
|
@@ -14790,7 +15094,7 @@ var searchServer = /* @__PURE__ */ __name(async (deps, request) => {
|
|
|
14790
15094
|
return { report, sources };
|
|
14791
15095
|
}, "searchServer");
|
|
14792
15096
|
|
|
14793
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
15097
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/services/messages.js
|
|
14794
15098
|
var DELETE_AT_ONCE = 10;
|
|
14795
15099
|
var filesOf = /* @__PURE__ */ __name(({ attachments }) => {
|
|
14796
15100
|
const files = fileLinks(attachments);
|
|
@@ -15231,7 +15535,7 @@ var checkMediaOptions = /* @__PURE__ */ __name((messenger, asked, attachments) =
|
|
|
15231
15535
|
throw new CliError("validation_error", `${MEDIA_FLAGS[first]} needs a --photo or --file`);
|
|
15232
15536
|
}, "checkMediaOptions");
|
|
15233
15537
|
|
|
15234
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
15538
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/domain/channel-tags.js
|
|
15235
15539
|
var CHANNEL_TAG_RULES_VERSION = "keywords-v1";
|
|
15236
15540
|
var RULES = {
|
|
15237
15541
|
ai: [/\b(ai|gpt|llm|machine learning|artificial intelligence)\b/iu, /нейросет|искусственн/iu],
|
|
@@ -15246,7 +15550,7 @@ var classifyChannel = /* @__PURE__ */ __name((metadata) => Object.entries(RULES)
|
|
|
15246
15550
|
return fields.length ? [{ tag, score: fields.length / 3, fields }] : [];
|
|
15247
15551
|
}), "classifyChannel");
|
|
15248
15552
|
|
|
15249
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
15553
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/services/metadata.js
|
|
15250
15554
|
var metadataService = /* @__PURE__ */ __name((deps) => {
|
|
15251
15555
|
const held = /* @__PURE__ */ __name(async (reference, { includeLeft = false } = {}) => {
|
|
15252
15556
|
const store = await deps.store();
|
|
@@ -15332,7 +15636,7 @@ var metadataService = /* @__PURE__ */ __name((deps) => {
|
|
|
15332
15636
|
};
|
|
15333
15637
|
}, "metadataService");
|
|
15334
15638
|
|
|
15335
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
15639
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/moderation/check.js
|
|
15336
15640
|
var INVITE = /max\.ru\/join\/|(t|telegram)\.me\/(\+|joinchat\/)|tg:\/\/join/i;
|
|
15337
15641
|
var LINK2 = /https?:\/\/\S+/i;
|
|
15338
15642
|
var STRENGTH = { report: 0, delete: 1, remove: 2 };
|
|
@@ -15520,7 +15824,7 @@ var nextPoint = /* @__PURE__ */ __name((rows, found) => {
|
|
|
15520
15824
|
}, "nextPoint");
|
|
15521
15825
|
var someUndone = /* @__PURE__ */ __name((rows) => rows.some(undone), "someUndone");
|
|
15522
15826
|
|
|
15523
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
15827
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/moderation/rules.js
|
|
15524
15828
|
import { existsSync, readFileSync } from "node:fs";
|
|
15525
15829
|
import { join as join10 } from "node:path";
|
|
15526
15830
|
var RULE_ACTIONS = ["report", "delete", "remove"];
|
|
@@ -15663,7 +15967,7 @@ var assign = /* @__PURE__ */ __name((rules, key, value) => {
|
|
|
15663
15967
|
return { ...rules, [head]: { ...rules[head], [tail]: value } };
|
|
15664
15968
|
}, "assign");
|
|
15665
15969
|
|
|
15666
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
15970
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/moderation/run.js
|
|
15667
15971
|
var FIRST_LOOK_MS = 24 * 36e5;
|
|
15668
15972
|
var moderateWith = /* @__PURE__ */ __name(async (run) => {
|
|
15669
15973
|
const { chatId, title, rules, point, since, dryRun } = run;
|
|
@@ -15700,7 +16004,7 @@ var moderateWith = /* @__PURE__ */ __name(async (run) => {
|
|
|
15700
16004
|
return { chatId, rows, notes };
|
|
15701
16005
|
}, "moderateWith");
|
|
15702
16006
|
|
|
15703
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
16007
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/services/moderation.js
|
|
15704
16008
|
var moderationService = /* @__PURE__ */ __name((deps) => {
|
|
15705
16009
|
const file2 = /* @__PURE__ */ __name(() => new ModerationRules(moderationPathFor(deps.messenger.app, deps.profile ?? "default", deps.env ?? process.env)), "file");
|
|
15706
16010
|
const group = /* @__PURE__ */ __name(async (chat) => {
|
|
@@ -15778,7 +16082,7 @@ var moderatorOf = /* @__PURE__ */ __name((adapter, deps) => ({
|
|
|
15778
16082
|
}, "removePerson")
|
|
15779
16083
|
}), "moderatorOf");
|
|
15780
16084
|
|
|
15781
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
16085
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/services/person-context.js
|
|
15782
16086
|
var CONTEXT_MESSAGES2 = 10;
|
|
15783
16087
|
var CONTEXT_BYTES = 64 * 1024;
|
|
15784
16088
|
var toContext = /* @__PURE__ */ __name((key, message, chatTitle2) => ({
|
|
@@ -15854,18 +16158,34 @@ var eventsOnce = /* @__PURE__ */ __name(async (store, filter, limit) => {
|
|
|
15854
16158
|
}
|
|
15855
16159
|
return { items, cut: true };
|
|
15856
16160
|
}, "eventsOnce");
|
|
15857
|
-
var
|
|
16161
|
+
var nameOf2 = /* @__PURE__ */ __name(({ provider, account: account2 }) => `${provider}:${account2}`, "nameOf");
|
|
16162
|
+
var readableAccounts = /* @__PURE__ */ __name(async (store, asked, scopes) => {
|
|
16163
|
+
const stored = await store.accounts.storedAccounts();
|
|
16164
|
+
const own = stored.find((one2) => nameOf2(one2) === nameOf2(asked));
|
|
16165
|
+
if (!own || asked.scope !== void 0 && asked.scope !== own.scope)
|
|
16166
|
+
throw new CliError("not_found", `no ${asked.provider} account ${asked.account} in the store`);
|
|
16167
|
+
const allowed = scopes ?? [own.scope];
|
|
16168
|
+
return stored.filter((one2) => allowed.includes(one2.scope));
|
|
16169
|
+
}, "readableAccounts");
|
|
16170
|
+
var readsOf = /* @__PURE__ */ __name((record2, asked, readable) => {
|
|
16171
|
+
const scopeOf4 = new Map(readable.map((one2) => [nameOf2(one2), one2.scope]));
|
|
16172
|
+
return record2.identities.flatMap((identity) => (identity.provider === asked.provider ? [asked.account] : identity.accounts).flatMap((account2) => {
|
|
16173
|
+
const scope = scopeOf4.get(nameOf2({ provider: identity.provider, account: account2 }));
|
|
16174
|
+
return identity.accounts.includes(account2) && scope !== void 0 ? [{ key: { provider: identity.provider, account: account2 }, scope, identity }] : [];
|
|
16175
|
+
}));
|
|
16176
|
+
}, "readsOf");
|
|
15858
16177
|
var personContext = /* @__PURE__ */ __name(async (store, asked, reference, options = {}) => {
|
|
15859
16178
|
const found = pickPerson(reference, await store.people.people(asked.provider, { account: asked.account }));
|
|
15860
16179
|
const record2 = await store.people.personOf({ provider: asked.provider, id: found.id });
|
|
15861
16180
|
if (!record2)
|
|
15862
16181
|
throw new CliError("not_found", `no person ${found.id} in the store`);
|
|
16182
|
+
const readable = await readableAccounts(store, asked, options.scopes);
|
|
15863
16183
|
return {
|
|
15864
16184
|
person: { ...record2, provider: asked.provider, id: found.id },
|
|
15865
|
-
...await recordContext(store, record2, readsOf(record2, asked), options)
|
|
16185
|
+
...await recordContext(store, record2, readsOf(record2, asked, readable), readable, options)
|
|
15866
16186
|
};
|
|
15867
16187
|
}, "personContext");
|
|
15868
|
-
var recordContext = /* @__PURE__ */ __name(async (store, record2, reads, { messages = CONTEXT_MESSAGES2, bytes: bytes2 = CONTEXT_BYTES, since, now = Date.now() } = {}) => {
|
|
16188
|
+
var recordContext = /* @__PURE__ */ __name(async (store, record2, reads, readable, { messages = CONTEXT_MESSAGES2, bytes: bytes2 = CONTEXT_BYTES, since, now = Date.now() } = {}) => {
|
|
15869
16189
|
const recent = /* @__PURE__ */ __name((message) => since === void 0 || Date.parse(message.timestamp) >= since, "recent");
|
|
15870
16190
|
const shared = [];
|
|
15871
16191
|
const notRead = [];
|
|
@@ -15923,9 +16243,15 @@ var recordContext = /* @__PURE__ */ __name(async (store, record2, reads, { messa
|
|
|
15923
16243
|
cut ||= named2.hasMore;
|
|
15924
16244
|
}
|
|
15925
16245
|
const personId = Number(record2.uid);
|
|
15926
|
-
const
|
|
16246
|
+
const calendars = [];
|
|
16247
|
+
for (const one2 of readable)
|
|
16248
|
+
if ((await store.calendar.calendars(one2.id)).length)
|
|
16249
|
+
calendars.push(one2);
|
|
16250
|
+
const accountIds = calendars.map(({ id: id2 }) => id2);
|
|
16251
|
+
const nothing = { items: [], cut: false };
|
|
16252
|
+
const upcoming = accountIds.length ? await eventsOnce(store, { personId, accountIds, from: now }, messages) : nothing;
|
|
15927
16253
|
const upcomingIds = new Set(upcoming.items.map(({ id: id2 }) => id2));
|
|
15928
|
-
const past = await eventsOnce(store, { personId, to: now, newest: true, ...since === void 0 ? {} : { from: since } }, messages);
|
|
16254
|
+
const past = accountIds.length ? await eventsOnce(store, { personId, accountIds, to: now, newest: true, ...since === void 0 ? {} : { from: since } }, messages) : nothing;
|
|
15929
16255
|
cut ||= upcoming.cut || past.cut;
|
|
15930
16256
|
direct.sort(newestFirst);
|
|
15931
16257
|
const each = [...direct, ...beyond].sort(newestFirst);
|
|
@@ -15941,7 +16267,13 @@ var recordContext = /* @__PURE__ */ __name(async (store, record2, reads, { messa
|
|
|
15941
16267
|
};
|
|
15942
16268
|
cut ||= direct.length > messages || groups.length > messages || mentions.length > messages;
|
|
15943
16269
|
const kept2 = withinBytes(lists, bytes2);
|
|
16270
|
+
const read = [
|
|
16271
|
+
...reads.map(({ key, scope }) => ({ ...key, scope })),
|
|
16272
|
+
...calendars.map(({ provider, account: account2, scope }) => ({ provider, account: account2, scope }))
|
|
16273
|
+
];
|
|
16274
|
+
const accounts = [...new Map(read.map((one2) => [nameOf2(one2), one2])).values()].sort((a, b) => nameOf2(a).localeCompare(nameOf2(b)));
|
|
15944
16275
|
return {
|
|
16276
|
+
accounts,
|
|
15945
16277
|
shared: shared.sort((a, b) => Date.parse(b.lastMessageAt ?? "") - Date.parse(a.lastMessageAt ?? "")),
|
|
15946
16278
|
last: {
|
|
15947
16279
|
fromThem: each.find((message) => !message.outgoing) ?? null,
|
|
@@ -16013,7 +16345,7 @@ var lean = /* @__PURE__ */ __name((key, message, detail) => {
|
|
|
16013
16345
|
replyTo: message.replyTo?.id ?? message.replyToId ?? null
|
|
16014
16346
|
};
|
|
16015
16347
|
}, "lean");
|
|
16016
|
-
var
|
|
16348
|
+
var kindOf2 = /* @__PURE__ */ __name((chat, chatId, person) => chat && chat.kind !== "unknown" ? chat.kind : chatId === person ? "dialog" : chat?.kind ?? "unknown", "kindOf");
|
|
16017
16349
|
var personMessages = /* @__PURE__ */ __name(async (store, asked, reference, { chats, limit = CHAT_MESSAGES, detail = 0 }) => {
|
|
16018
16350
|
const found = pickPerson(reference, await store.people.people(asked.provider, { account: asked.account }));
|
|
16019
16351
|
const record2 = await store.people.personOf({ provider: asked.provider, id: found.id });
|
|
@@ -16026,7 +16358,7 @@ var personMessages = /* @__PURE__ */ __name(async (store, asked, reference, { ch
|
|
|
16026
16358
|
const chat = stored.find((one2) => one2.id === chatId);
|
|
16027
16359
|
const page = await store.messages.find({ account: asked, senders: [found.id], chatId, limit });
|
|
16028
16360
|
answer.push({
|
|
16029
|
-
chat: { id: chatId, title: chat?.title ?? null, kind:
|
|
16361
|
+
chat: { id: chatId, title: chat?.title ?? null, kind: kindOf2(chat, chatId, found.id) },
|
|
16030
16362
|
messages: page.items.toSorted((a, b) => Date.parse(a.timestamp) - Date.parse(b.timestamp)).map((message) => lean(asked, message, detail)),
|
|
16031
16363
|
complete: held.get(chatId) === "complete",
|
|
16032
16364
|
more: page.hasMore
|
|
@@ -16039,10 +16371,10 @@ var personMessages = /* @__PURE__ */ __name(async (store, asked, reference, { ch
|
|
|
16039
16371
|
};
|
|
16040
16372
|
}, "personMessages");
|
|
16041
16373
|
|
|
16042
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
16043
|
-
import { createHash as
|
|
16374
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/services/meeting-evidence.js
|
|
16375
|
+
import { createHash as createHash12 } from "node:crypto";
|
|
16044
16376
|
|
|
16045
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
16377
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/services/meeting-reference.js
|
|
16046
16378
|
var missing3 = /* @__PURE__ */ __name(() => new CliError("not_found", "the meeting evidence is unavailable for this account"), "missing");
|
|
16047
16379
|
var authorizedMeetingMetadata = /* @__PURE__ */ __name(async (store, accountId, reference, options = {}) => {
|
|
16048
16380
|
const parsed = parseMeetingReference(reference);
|
|
@@ -16090,8 +16422,8 @@ var resolveMeetingReference = /* @__PURE__ */ __name(async (store, accountId, re
|
|
|
16090
16422
|
};
|
|
16091
16423
|
}, "resolveMeetingReference");
|
|
16092
16424
|
|
|
16093
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
16094
|
-
var hash = /* @__PURE__ */ __name((value) =>
|
|
16425
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/services/meeting-evidence.js
|
|
16426
|
+
var hash = /* @__PURE__ */ __name((value) => createHash12("sha256").update(JSON.stringify(value)).digest("hex"), "hash");
|
|
16095
16427
|
var checkMeetingCancelled = /* @__PURE__ */ __name((signal) => {
|
|
16096
16428
|
if (signal?.aborted)
|
|
16097
16429
|
throw new CliError("cancelled", "meeting evidence reading was cancelled");
|
|
@@ -16289,7 +16621,7 @@ var readMeetingEvidence = /* @__PURE__ */ __name(async (store, accountId, refere
|
|
|
16289
16621
|
return { ...packet, fingerprint: hash(packet) };
|
|
16290
16622
|
}, "readMeetingEvidence");
|
|
16291
16623
|
|
|
16292
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
16624
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/services/person-meeting-context.js
|
|
16293
16625
|
var personMeetingContext = /* @__PURE__ */ __name(async (store, personReference, options) => {
|
|
16294
16626
|
const { meetings = 10, cues = 5, bytes: bytes2 = 64 * 1024, scanLimit = 1e3, since, signal } = options;
|
|
16295
16627
|
const requestedAccounts = options.accountIds;
|
|
@@ -16388,7 +16720,7 @@ var personMeetingContext = /* @__PURE__ */ __name(async (store, personReference,
|
|
|
16388
16720
|
};
|
|
16389
16721
|
}, "personMeetingContext");
|
|
16390
16722
|
|
|
16391
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
16723
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/services/person-preparation.js
|
|
16392
16724
|
var PREPARE_BYTES = 96 * 1024;
|
|
16393
16725
|
var MEETINGS = 5;
|
|
16394
16726
|
var CUES = 3;
|
|
@@ -16416,7 +16748,6 @@ var personPreparation = /* @__PURE__ */ __name(async (store, asked, reference, o
|
|
|
16416
16748
|
coverage: { included: items.length, hasMore: over || cut, cutBy: cut ? "bytes" : over ? "limit" : null }
|
|
16417
16749
|
};
|
|
16418
16750
|
}, "budgeted");
|
|
16419
|
-
const reads = readsOf(context2.person, asked);
|
|
16420
16751
|
const partial = new Set(context2.notRead.map((chat) => `${chat.provider}/${chat.account}/${chat.chatId}`));
|
|
16421
16752
|
const waiting = [];
|
|
16422
16753
|
for (const chat of context2.shared.filter((one2) => one2.kind === "dialog")) {
|
|
@@ -16433,10 +16764,10 @@ var personPreparation = /* @__PURE__ */ __name(async (store, asked, reference, o
|
|
|
16433
16764
|
});
|
|
16434
16765
|
}
|
|
16435
16766
|
waiting.sort((a, b) => Date.parse(b.message.timestamp) - Date.parse(a.message.timestamp));
|
|
16436
|
-
const accounts =
|
|
16767
|
+
const accounts = context2.accounts.map(({ provider, account: account2 }) => ({ provider, account: account2 }));
|
|
16437
16768
|
const held = await store.people.preparation(context2.person.uid, { accounts, limit });
|
|
16438
|
-
const
|
|
16439
|
-
const meetings = await meetingsOf(store, context2.person.uid,
|
|
16769
|
+
const readable = await readableAccounts(store, asked, options.scopes);
|
|
16770
|
+
const meetings = await meetingsOf(store, context2.person.uid, readable, options.since, () => left);
|
|
16440
16771
|
const sections = {
|
|
16441
16772
|
waiting: budgeted({ items: waiting, hasMore: false }),
|
|
16442
16773
|
tasks: budgeted(held.tasks),
|
|
@@ -16505,7 +16836,7 @@ var meetingsOf = /* @__PURE__ */ __name(async (store, uid, stored, since, left)
|
|
|
16505
16836
|
}
|
|
16506
16837
|
}, "meetingsOf");
|
|
16507
16838
|
|
|
16508
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
16839
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/services/person-profile.js
|
|
16509
16840
|
var personProfile = /* @__PURE__ */ __name(async (deps, person, known2) => {
|
|
16510
16841
|
const online = deps.offline ? void 0 : await deps.connection();
|
|
16511
16842
|
const held = await storeIfOpen(deps);
|
|
@@ -16575,7 +16906,7 @@ var quiet = /* @__PURE__ */ __name((facts) => facts.chats.map(({ id: id2, title,
|
|
|
16575
16906
|
complete: false
|
|
16576
16907
|
})), "quiet");
|
|
16577
16908
|
|
|
16578
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
16909
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/services/person-timeline.js
|
|
16579
16910
|
var TIMELINE_ITEMS = 50;
|
|
16580
16911
|
var TIMELINE_MAX = 500;
|
|
16581
16912
|
var SCOPES = ["personal", "work"];
|
|
@@ -16630,7 +16961,7 @@ var personTimeline = /* @__PURE__ */ __name(async (store, asked, reference, { sc
|
|
|
16630
16961
|
};
|
|
16631
16962
|
}, "personTimeline");
|
|
16632
16963
|
|
|
16633
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
16964
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/services/people.js
|
|
16634
16965
|
var peopleService = /* @__PURE__ */ __name((deps) => {
|
|
16635
16966
|
const localCard = /* @__PURE__ */ __name(async (card, includeNotes = false) => {
|
|
16636
16967
|
const held = await storeIfOpen(deps);
|
|
@@ -16857,7 +17188,7 @@ var withoutPhone = /* @__PURE__ */ __name((answer) => {
|
|
|
16857
17188
|
return rest;
|
|
16858
17189
|
}, "withoutPhone");
|
|
16859
17190
|
|
|
16860
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
17191
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/services/private-people.js
|
|
16861
17192
|
var noteItem = /* @__PURE__ */ __name((provider, note) => ({
|
|
16862
17193
|
id: note.id,
|
|
16863
17194
|
contact: formatReference({ type: "contact", provider, id: note.personId }),
|
|
@@ -16901,7 +17232,7 @@ var privatePeopleService = /* @__PURE__ */ __name((deps) => {
|
|
|
16901
17232
|
};
|
|
16902
17233
|
}, "privatePeopleService");
|
|
16903
17234
|
|
|
16904
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
17235
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/services/rankings.js
|
|
16905
17236
|
var empty = /* @__PURE__ */ __name(() => ({
|
|
16906
17237
|
total: 0,
|
|
16907
17238
|
population: 0,
|
|
@@ -17157,7 +17488,7 @@ var rankingsService = /* @__PURE__ */ __name((deps) => ({
|
|
|
17157
17488
|
}, "evidence")
|
|
17158
17489
|
}), "rankingsService");
|
|
17159
17490
|
|
|
17160
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
17491
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/services/reply-stats.js
|
|
17161
17492
|
var FIELDS = ["date", "chat", "kind"];
|
|
17162
17493
|
var WAITING_TAIL = 100;
|
|
17163
17494
|
var plainOnly = /* @__PURE__ */ __name((text2, command) => {
|
|
@@ -17284,7 +17615,7 @@ var replyStatsService = /* @__PURE__ */ __name((deps) => {
|
|
|
17284
17615
|
};
|
|
17285
17616
|
}, "replyStatsService");
|
|
17286
17617
|
|
|
17287
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
17618
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/services/searches.js
|
|
17288
17619
|
var savedSearchItem = /* @__PURE__ */ __name((one2) => ({
|
|
17289
17620
|
id: one2.id,
|
|
17290
17621
|
name: one2.name,
|
|
@@ -17305,7 +17636,7 @@ var MESSAGE_SEARCH_COMMANDS = [
|
|
|
17305
17636
|
"admin-statistics"
|
|
17306
17637
|
];
|
|
17307
17638
|
var NAME = /^[a-z0-9][a-z0-9-]{0,63}$/;
|
|
17308
|
-
var
|
|
17639
|
+
var nameOf3 = /* @__PURE__ */ __name((value) => {
|
|
17309
17640
|
const name = value.trim().toLowerCase();
|
|
17310
17641
|
if (!NAME.test(name) || /^\d+$/.test(name))
|
|
17311
17642
|
throw new CliError("validation_error", `"${singleLine(value)}" cannot name a saved search \u2014 use up to 64 letters a\u2013z, digits and hyphens, not only digits`, { reason: "name.invalid" });
|
|
@@ -17360,13 +17691,13 @@ var searchesService = /* @__PURE__ */ __name((deps) => {
|
|
|
17360
17691
|
if (isAdminSelection(params.selection)) {
|
|
17361
17692
|
const selected = await readAdminSelection(store, params.selection);
|
|
17362
17693
|
const normalized2 = typeof params.selection === "string" ? JSON.parse(params.selection) : params.selection;
|
|
17363
|
-
return store.searches.saveSearch(
|
|
17694
|
+
return store.searches.saveSearch(nameOf3(name), searchRecordOf("admin-statistics", {
|
|
17364
17695
|
adminReport: selected.options.report,
|
|
17365
17696
|
selection: normalized2,
|
|
17366
17697
|
timezone: selected.base.timezone
|
|
17367
17698
|
}), { replace });
|
|
17368
17699
|
}
|
|
17369
|
-
return store.searches.saveSearch(
|
|
17700
|
+
return store.searches.saveSearch(nameOf3(name), searchRecordOf(params.target ? params.target === "messages" ? "message-top" : "author-top" : params.by === void 0 ? "search" : "stats", checked(params)), {
|
|
17370
17701
|
replace
|
|
17371
17702
|
});
|
|
17372
17703
|
}), "create"),
|
|
@@ -17413,7 +17744,7 @@ var searchesService = /* @__PURE__ */ __name((deps) => {
|
|
|
17413
17744
|
};
|
|
17414
17745
|
}, "searchesService");
|
|
17415
17746
|
|
|
17416
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
17747
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/services/tags.js
|
|
17417
17748
|
var TAGGING_QUERY = {
|
|
17418
17749
|
entity: "tagging",
|
|
17419
17750
|
backend: "sql",
|
|
@@ -17497,7 +17828,7 @@ var tagsService = /* @__PURE__ */ __name((deps) => {
|
|
|
17497
17828
|
};
|
|
17498
17829
|
}, "tagsService");
|
|
17499
17830
|
|
|
17500
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
17831
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/services/task-stats.js
|
|
17501
17832
|
var TASK_STATS_BY = ["chat", "meeting", "project"];
|
|
17502
17833
|
var PERIOD_FIELD = "created";
|
|
17503
17834
|
var refuseNestedPeriod = /* @__PURE__ */ __name((node, top = true) => {
|
|
@@ -17600,7 +17931,7 @@ var meetingNames = /* @__PURE__ */ __name(async (store, groups) => {
|
|
|
17600
17931
|
}));
|
|
17601
17932
|
}, "meetingNames");
|
|
17602
17933
|
|
|
17603
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
17934
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/services/tasks.js
|
|
17604
17935
|
var TASK_QUERY = {
|
|
17605
17936
|
entity: "task",
|
|
17606
17937
|
backend: "sql",
|
|
@@ -18092,7 +18423,7 @@ var taskView = /* @__PURE__ */ __name(async (store, account2, task2) => {
|
|
|
18092
18423
|
};
|
|
18093
18424
|
}, "taskView");
|
|
18094
18425
|
|
|
18095
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
18426
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/services/topics.js
|
|
18096
18427
|
var actionOf = /* @__PURE__ */ __name(({ title, closed, pinned, hidden, icon }) => {
|
|
18097
18428
|
const set = [closed, pinned, hidden].filter((one2) => one2 !== void 0).length;
|
|
18098
18429
|
if (title !== void 0 || icon !== void 0 || set !== 1)
|
|
@@ -18291,9 +18622,9 @@ var topicsService = /* @__PURE__ */ __name((deps) => {
|
|
|
18291
18622
|
};
|
|
18292
18623
|
}, "topicsService");
|
|
18293
18624
|
|
|
18294
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
18295
|
-
import { createHash as
|
|
18296
|
-
var hash2 = /* @__PURE__ */ __name((value) =>
|
|
18625
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/services/evidence.js
|
|
18626
|
+
import { createHash as createHash13, randomUUID as randomUUID5 } from "node:crypto";
|
|
18627
|
+
var hash2 = /* @__PURE__ */ __name((value) => createHash13("sha256").update(JSON.stringify(value)).digest("hex"), "hash");
|
|
18297
18628
|
var positive = /* @__PURE__ */ __name((value, name, minimum = 1) => {
|
|
18298
18629
|
if (!Number.isSafeInteger(value) || value < minimum)
|
|
18299
18630
|
throw new CliError("validation_error", `${name} must be a safe integer of at least ${minimum}`);
|
|
@@ -18365,7 +18696,7 @@ var prepareEvidencePacket = /* @__PURE__ */ __name(({ kind, source, page, limits
|
|
|
18365
18696
|
return { ...content, id: randomUUID5(), fingerprint: hash2(content) };
|
|
18366
18697
|
}, "prepareEvidencePacket");
|
|
18367
18698
|
|
|
18368
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
18699
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/services/evidence-read.js
|
|
18369
18700
|
var readEvidencePacket = /* @__PURE__ */ __name(async (store, account2, { chat, limit, before: before2 }, messenger = {}) => {
|
|
18370
18701
|
if (!Number.isSafeInteger(limit) || limit < 1 || limit > 100)
|
|
18371
18702
|
throw new CliError("validation_error", "evidence message limit must be an integer from 1 to 100");
|
|
@@ -18385,7 +18716,7 @@ var readEvidencePacket = /* @__PURE__ */ __name(async (store, account2, { chat,
|
|
|
18385
18716
|
return { ...packet, nextBeforeId: older && last ? last.id : null };
|
|
18386
18717
|
}, "readEvidencePacket");
|
|
18387
18718
|
|
|
18388
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
18719
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/services/meeting-hit-search.js
|
|
18389
18720
|
var refreshMeetingIndex = /* @__PURE__ */ __name(async (meetings, accountId, signal) => {
|
|
18390
18721
|
let before2 = Number.POSITIVE_INFINITY;
|
|
18391
18722
|
for (; ; ) {
|
|
@@ -18447,7 +18778,7 @@ var searchMeetingHits = /* @__PURE__ */ __name(async (store, query, request, opt
|
|
|
18447
18778
|
return { ...result, selection };
|
|
18448
18779
|
}, "searchMeetingHits");
|
|
18449
18780
|
|
|
18450
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
18781
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/services/meeting-links.js
|
|
18451
18782
|
var readMeetingLinks = /* @__PURE__ */ __name(async (store, request) => {
|
|
18452
18783
|
const { maxMessages, url, ...selecting } = request;
|
|
18453
18784
|
const { input, selection } = await resolveMeetingSelection(store, selecting);
|
|
@@ -18486,10 +18817,10 @@ var readMeetingLinks = /* @__PURE__ */ __name(async (store, request) => {
|
|
|
18486
18817
|
};
|
|
18487
18818
|
}, "readMeetingLinks");
|
|
18488
18819
|
|
|
18489
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
18490
|
-
import { createHash as
|
|
18820
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/services/meeting-project-candidates.js
|
|
18821
|
+
import { createHash as createHash14 } from "node:crypto";
|
|
18491
18822
|
|
|
18492
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
18823
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/services/meeting-project-candidate-validation.js
|
|
18493
18824
|
function invalid5(field, response = false) {
|
|
18494
18825
|
throw new CliError(response ? "invalid_response" : "validation_error", `invalid project candidate ${field}`);
|
|
18495
18826
|
}
|
|
@@ -18608,7 +18939,7 @@ var candidateCatalog = /* @__PURE__ */ __name((catalog, limits) => {
|
|
|
18608
18939
|
}
|
|
18609
18940
|
}, "candidateCatalog");
|
|
18610
18941
|
|
|
18611
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
18942
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/services/meeting-project-candidates.js
|
|
18612
18943
|
var createMeetingProjectCandidateReader = /* @__PURE__ */ __name((scope, accountId, ports) => {
|
|
18613
18944
|
const fixed = snapshotMeetingScope(scope);
|
|
18614
18945
|
if (!Number.isSafeInteger(accountId) || accountId < 1 || typeof ports?.vocabulary?.vocabulary !== "function")
|
|
@@ -18633,7 +18964,7 @@ var createMeetingProjectCandidateReader = /* @__PURE__ */ __name((scope, account
|
|
|
18633
18964
|
schemaVersion: 1,
|
|
18634
18965
|
kind: "meeting_project_candidates",
|
|
18635
18966
|
source: { ...owner, reference: input.reference },
|
|
18636
|
-
inputFingerprint:
|
|
18967
|
+
inputFingerprint: createHash14("sha256").update(JSON.stringify(input)).digest("hex"),
|
|
18637
18968
|
vocabularyFingerprint: catalog.fingerprint,
|
|
18638
18969
|
association: "unconfirmed-literal-evidence",
|
|
18639
18970
|
items: found.slice(0, limits.limit),
|
|
@@ -18661,8 +18992,8 @@ var createMeetingProjectCandidateReader = /* @__PURE__ */ __name((scope, account
|
|
|
18661
18992
|
};
|
|
18662
18993
|
}, "createMeetingProjectCandidateReader");
|
|
18663
18994
|
|
|
18664
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
18665
|
-
import { createHash as
|
|
18995
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/services/meeting-project-discovery.js
|
|
18996
|
+
import { createHash as createHash15 } from "node:crypto";
|
|
18666
18997
|
var scopeKeys = [
|
|
18667
18998
|
"accountId",
|
|
18668
18999
|
"meetingId",
|
|
@@ -18760,7 +19091,7 @@ var readMeetingProjectDiscovery = /* @__PURE__ */ __name(async (ports, projectNa
|
|
|
18760
19091
|
add({ name: alias.name, kind: "alias", aliasId: alias.id });
|
|
18761
19092
|
if (!terms.length || terms.length > maxTerms)
|
|
18762
19093
|
return fail2("project discovery names exceed the selected term budget or contain no words");
|
|
18763
|
-
const key =
|
|
19094
|
+
const key = createHash15("sha256").update(JSON.stringify([query, found.fingerprint, project, terms, scopeKeys.map((name) => input[name] ?? null)])).digest("hex");
|
|
18764
19095
|
const previous = cursorOf2(cursor, key, terms.length);
|
|
18765
19096
|
const termIndex = previous?.term ?? 0;
|
|
18766
19097
|
const term = terms[termIndex];
|
|
@@ -18796,7 +19127,7 @@ var readMeetingProjectDiscovery = /* @__PURE__ */ __name(async (ports, projectNa
|
|
|
18796
19127
|
};
|
|
18797
19128
|
}, "readMeetingProjectDiscovery");
|
|
18798
19129
|
|
|
18799
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
19130
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/services/meeting-review.js
|
|
18800
19131
|
var readMeetingReview = /* @__PURE__ */ __name(async (store, request) => {
|
|
18801
19132
|
const { limit, ...selecting } = request;
|
|
18802
19133
|
const { input, selection } = await resolveMeetingSelection(store, selecting);
|
|
@@ -18804,7 +19135,7 @@ var readMeetingReview = /* @__PURE__ */ __name(async (store, request) => {
|
|
|
18804
19135
|
return { ...review, selection };
|
|
18805
19136
|
}, "readMeetingReview");
|
|
18806
19137
|
|
|
18807
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
19138
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/services/meeting-searches.js
|
|
18808
19139
|
var KIND = ["meetings-search"];
|
|
18809
19140
|
var meetingSearchesService = /* @__PURE__ */ __name((searches) => {
|
|
18810
19141
|
const found = /* @__PURE__ */ __name(async (reference) => {
|
|
@@ -18820,7 +19151,7 @@ var meetingSearchesService = /* @__PURE__ */ __name((searches) => {
|
|
|
18820
19151
|
}, "found");
|
|
18821
19152
|
const record2 = /* @__PURE__ */ __name(({ query, options }) => searchRecordOf("meetings-search", { ...options, text: query }), "record");
|
|
18822
19153
|
return {
|
|
18823
|
-
create: /* @__PURE__ */ __name(async (name, params, { replace = false } = {}) => (await searches()).saveSearch(
|
|
19154
|
+
create: /* @__PURE__ */ __name(async (name, params, { replace = false } = {}) => (await searches()).saveSearch(nameOf3(name), record2(params), { replace }), "create"),
|
|
18824
19155
|
list: /* @__PURE__ */ __name(async () => (await searches()).savedSearches(KIND), "list"),
|
|
18825
19156
|
show: found,
|
|
18826
19157
|
delete: /* @__PURE__ */ __name(async (reference) => (await searches()).deleteSearch((await found(reference)).id), "delete"),
|
|
@@ -18834,7 +19165,7 @@ var meetingSearchesService = /* @__PURE__ */ __name((searches) => {
|
|
|
18834
19165
|
};
|
|
18835
19166
|
}, "meetingSearchesService");
|
|
18836
19167
|
|
|
18837
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
19168
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/services/meeting-stats.js
|
|
18838
19169
|
var readMeetingStats = /* @__PURE__ */ __name(async (store, request) => {
|
|
18839
19170
|
const { timeZone, maxRows, ...selecting } = request;
|
|
18840
19171
|
const { input, selection } = await resolveMeetingSelection(store, selecting);
|
|
@@ -18857,8 +19188,8 @@ var readMeetingCounts = /* @__PURE__ */ __name(async (store, request) => {
|
|
|
18857
19188
|
return { ...counts, selection };
|
|
18858
19189
|
}, "readMeetingCounts");
|
|
18859
19190
|
|
|
18860
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
18861
|
-
import { createHash as
|
|
19191
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/services/meeting-hit-context.js
|
|
19192
|
+
import { createHash as createHash16 } from "node:crypto";
|
|
18862
19193
|
var contextCue = /* @__PURE__ */ __name((cue) => ({
|
|
18863
19194
|
ref: cue.reference,
|
|
18864
19195
|
fingerprint: cue.fingerprint,
|
|
@@ -18972,10 +19303,10 @@ var readMeetingHitContext = /* @__PURE__ */ __name(async (store, accountId, refe
|
|
|
18972
19303
|
},
|
|
18973
19304
|
items: picked
|
|
18974
19305
|
};
|
|
18975
|
-
return { ...packet, fingerprint:
|
|
19306
|
+
return { ...packet, fingerprint: createHash16("sha256").update(JSON.stringify(packet)).digest("hex") };
|
|
18976
19307
|
}, "readMeetingHitContext");
|
|
18977
19308
|
|
|
18978
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
19309
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/services/meeting-passage-format.js
|
|
18979
19310
|
var visible = /* @__PURE__ */ __name((text2) => text2.replace(/[\p{Cc}\p{Cf}]/gu, (value) => value === "\n" || value === " " ? value : `\\u{${value.codePointAt(0)?.toString(16)}}`), "visible");
|
|
18980
19311
|
var markdown = /* @__PURE__ */ __name((text2) => visible(text2).replaceAll("&", "&").replaceAll("<", "<").replaceAll(">", ">").replace(/[\\`*_[\]#|~]/g, "\\$&"), "markdown");
|
|
18981
19312
|
var timestamp = /* @__PURE__ */ __name((ms) => {
|
|
@@ -19051,7 +19382,7 @@ var readMeetingPassage = /* @__PURE__ */ __name(async (store, accountId, referen
|
|
|
19051
19382
|
return { packet, content };
|
|
19052
19383
|
}, "readMeetingPassage");
|
|
19053
19384
|
|
|
19054
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
19385
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/services/meeting-batch.js
|
|
19055
19386
|
var createMeetingBatchReader = /* @__PURE__ */ __name((store, accountId) => {
|
|
19056
19387
|
if (!Number.isSafeInteger(accountId) || accountId < 1)
|
|
19057
19388
|
throw new CliError("validation_error", "choose a positive meeting account");
|
|
@@ -19065,10 +19396,10 @@ var createMeetingBatchReader = /* @__PURE__ */ __name((store, accountId) => {
|
|
|
19065
19396
|
};
|
|
19066
19397
|
}, "createMeetingBatchReader");
|
|
19067
19398
|
|
|
19068
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
19069
|
-
import { createHash as
|
|
19399
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/services/meeting-combined.js
|
|
19400
|
+
import { createHash as createHash17 } from "node:crypto";
|
|
19070
19401
|
|
|
19071
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
19402
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/services/meeting-semantic.js
|
|
19072
19403
|
var positive2 = /* @__PURE__ */ __name((value, name, max) => {
|
|
19073
19404
|
if (!Number.isSafeInteger(value) || value < 1 || value > max)
|
|
19074
19405
|
throw new CliError("validation_error", `Invalid ${name}`);
|
|
@@ -19220,7 +19551,7 @@ var applyMeetingEmbedding = /* @__PURE__ */ __name(async (store, accountId, embe
|
|
|
19220
19551
|
};
|
|
19221
19552
|
}, "applyMeetingEmbedding");
|
|
19222
19553
|
|
|
19223
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
19554
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/services/meeting-combined.js
|
|
19224
19555
|
var DEPTH = 200;
|
|
19225
19556
|
var cursorOf3 = /* @__PURE__ */ __name((value, key) => {
|
|
19226
19557
|
if (value === void 0)
|
|
@@ -19242,7 +19573,7 @@ var searchMeetingsCombined = /* @__PURE__ */ __name(async (store, embedder, type
|
|
|
19242
19573
|
const { after, limit = 20, maxReadBytes, ...filters } = input;
|
|
19243
19574
|
const terms = questionTerms(query);
|
|
19244
19575
|
const wordQuery = terms === null ? query : terms.join(" ");
|
|
19245
|
-
const key =
|
|
19576
|
+
const key = createHash17("sha256").update(JSON.stringify([query, embedder.key, Object.entries(filters).filter(([name]) => name !== "signal")])).digest("base64url");
|
|
19246
19577
|
const offset = cursorOf3(after, key);
|
|
19247
19578
|
let byWords = [];
|
|
19248
19579
|
let indexing = "ready";
|
|
@@ -19357,7 +19688,7 @@ var searchMeetingsCombined = /* @__PURE__ */ __name(async (store, embedder, type
|
|
|
19357
19688
|
};
|
|
19358
19689
|
}, "searchMeetingsCombined");
|
|
19359
19690
|
|
|
19360
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
19691
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/services/meeting-context.js
|
|
19361
19692
|
var meetingReferences = /* @__PURE__ */ __name((values) => values.map((value) => formatMeetingReference(parseMeetingReference(value))), "meetingReferences");
|
|
19362
19693
|
var checkCancelled = /* @__PURE__ */ __name((signal) => {
|
|
19363
19694
|
if (!signal?.aborted)
|
|
@@ -19462,7 +19793,7 @@ var createMeetingContextService = /* @__PURE__ */ __name(async (store, input, op
|
|
|
19462
19793
|
};
|
|
19463
19794
|
}, "createMeetingContextService");
|
|
19464
19795
|
|
|
19465
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
19796
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/services/meeting-model.js
|
|
19466
19797
|
var integer2 = /* @__PURE__ */ __name((value, name, max) => {
|
|
19467
19798
|
if (!Number.isSafeInteger(value) || value < 1 || value > max)
|
|
19468
19799
|
throw new CliError("validation_error", `Invalid ${name}`);
|
|
@@ -19689,7 +20020,7 @@ var openMeetingEmbedder = /* @__PURE__ */ __name(async (choice, options = {}) =>
|
|
|
19689
20020
|
};
|
|
19690
20021
|
}, "openMeetingEmbedder");
|
|
19691
20022
|
|
|
19692
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
20023
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/context/communication-selection.js
|
|
19693
20024
|
var communicationFields = {
|
|
19694
20025
|
sources: pipe(array(strictObject({
|
|
19695
20026
|
id: pipe(string(), regex(/^[A-Za-z0-9][A-Za-z0-9._-]{0,127}$/)),
|
|
@@ -19721,7 +20052,7 @@ var communicationRequest = /* @__PURE__ */ __name((value, preparationAfter) => {
|
|
|
19721
20052
|
return { ...input, after, before: before2 };
|
|
19722
20053
|
}, "communicationRequest");
|
|
19723
20054
|
|
|
19724
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
20055
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/services/meeting-preparation-validation.js
|
|
19725
20056
|
var MEETING_PREPARATION_LIMITS = {
|
|
19726
20057
|
meetings: { min: 1, max: 20, default: 5 },
|
|
19727
20058
|
cues: { min: 1, max: 100, default: 10 },
|
|
@@ -19807,7 +20138,7 @@ var preparationRequest = /* @__PURE__ */ __name((accountId, externalId, original
|
|
|
19807
20138
|
return { ...input, history };
|
|
19808
20139
|
}, "preparationRequest");
|
|
19809
20140
|
|
|
19810
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
20141
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/services/meeting-communications-preparation.js
|
|
19811
20142
|
var readPreparationCommunications = /* @__PURE__ */ __name(async (plan, signal) => {
|
|
19812
20143
|
const section = {
|
|
19813
20144
|
readUsage: plan.reader.usage(),
|
|
@@ -19912,7 +20243,7 @@ var appendPreparationCommunications = /* @__PURE__ */ __name((result, read) => {
|
|
|
19912
20243
|
result.knowledge.coverage.otherSources = "see-communications";
|
|
19913
20244
|
}, "appendPreparationCommunications");
|
|
19914
20245
|
|
|
19915
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
20246
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/services/meeting-communications-selection.js
|
|
19916
20247
|
var captureCommunicationSelections = /* @__PURE__ */ __name((port) => {
|
|
19917
20248
|
if (port === void 0)
|
|
19918
20249
|
return void 0;
|
|
@@ -20017,7 +20348,7 @@ var validatePreparationCommunications = /* @__PURE__ */ __name((section, request
|
|
|
20017
20348
|
}
|
|
20018
20349
|
}, "validatePreparationCommunications");
|
|
20019
20350
|
|
|
20020
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
20351
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/services/meeting-knowledge-preparation.js
|
|
20021
20352
|
var invalid6 = /* @__PURE__ */ __name(() => {
|
|
20022
20353
|
throw new CliError("invalid_response", "Preparation knowledge returned an invalid selection");
|
|
20023
20354
|
}, "invalid");
|
|
@@ -20086,7 +20417,7 @@ var appendKnowledgePreparation = /* @__PURE__ */ __name(async (store, result, in
|
|
|
20086
20417
|
}
|
|
20087
20418
|
}, "appendKnowledgePreparation");
|
|
20088
20419
|
|
|
20089
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
20420
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/services/meeting-notes-preparation.js
|
|
20090
20421
|
var invalid7 = /* @__PURE__ */ __name(() => {
|
|
20091
20422
|
throw new CliError("invalid_response", "Preparation notes returned an invalid selection");
|
|
20092
20423
|
}, "invalid");
|
|
@@ -20160,7 +20491,7 @@ var appendNotesPreparation = /* @__PURE__ */ __name(async (store, result, input)
|
|
|
20160
20491
|
}
|
|
20161
20492
|
}, "appendNotesPreparation");
|
|
20162
20493
|
|
|
20163
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
20494
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/services/meeting-project-preparation.js
|
|
20164
20495
|
var PAGE_LIMIT = 4;
|
|
20165
20496
|
var size2 = /* @__PURE__ */ __name((value) => Buffer.byteLength(JSON.stringify(value), "utf8"), "size");
|
|
20166
20497
|
var appendProjectPreparation = /* @__PURE__ */ __name(async (ports, result, input) => {
|
|
@@ -20210,7 +20541,7 @@ var appendProjectPreparation = /* @__PURE__ */ __name(async (ports, result, inpu
|
|
|
20210
20541
|
}
|
|
20211
20542
|
}, "appendProjectPreparation");
|
|
20212
20543
|
|
|
20213
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
20544
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/services/meeting-related-preparation.js
|
|
20214
20545
|
var appendRelatedPreparation = /* @__PURE__ */ __name(async (store, result, input) => {
|
|
20215
20546
|
if (!result.series || !result.items.length || result.coverage.outputLimited)
|
|
20216
20547
|
return;
|
|
@@ -20282,7 +20613,7 @@ var appendRelatedPreparation = /* @__PURE__ */ __name(async (store, result, inpu
|
|
|
20282
20613
|
}
|
|
20283
20614
|
}, "appendRelatedPreparation");
|
|
20284
20615
|
|
|
20285
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
20616
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/services/meeting-preparation.js
|
|
20286
20617
|
var size3 = /* @__PURE__ */ __name((value) => Buffer.byteLength(JSON.stringify(value), "utf8"), "size");
|
|
20287
20618
|
var createMeetingPreparationService = /* @__PURE__ */ __name((scope, accountId, ports) => {
|
|
20288
20619
|
const fixed = snapshotMeetingScope(scope);
|
|
@@ -20420,14 +20751,14 @@ var createMeetingPreparationService = /* @__PURE__ */ __name((scope, accountId,
|
|
|
20420
20751
|
};
|
|
20421
20752
|
}, "createMeetingPreparationService");
|
|
20422
20753
|
|
|
20423
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
20424
|
-
import { createHash as
|
|
20754
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/services/meeting-task-proposal.js
|
|
20755
|
+
import { createHash as createHash18 } from "node:crypto";
|
|
20425
20756
|
var proposeMeetingTask = /* @__PURE__ */ __name(async (store, accountId, reference, kind) => {
|
|
20426
20757
|
if (!TASK_KINDS.includes(kind))
|
|
20427
20758
|
throw new CliError("validation_error", "unknown task kind");
|
|
20428
20759
|
const resolved = await resolveMeetingReference(store, accountId, reference);
|
|
20429
20760
|
return {
|
|
20430
|
-
id:
|
|
20761
|
+
id: createHash18("sha256").update(JSON.stringify({ source: resolved.reference, kind })).digest("hex"),
|
|
20431
20762
|
source: resolved.reference,
|
|
20432
20763
|
sourceKind: "meeting",
|
|
20433
20764
|
group: formatMeetingReference({ type: "meeting", accountId, meetingId: resolved.meeting.id }),
|
|
@@ -20440,7 +20771,7 @@ var proposeMeetingTask = /* @__PURE__ */ __name(async (store, accountId, referen
|
|
|
20440
20771
|
};
|
|
20441
20772
|
}, "proposeMeetingTask");
|
|
20442
20773
|
|
|
20443
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
20774
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/services/meeting-tasks.js
|
|
20444
20775
|
var accountSnapshot = /* @__PURE__ */ __name((key) => {
|
|
20445
20776
|
const { provider, account: account2, scope } = key;
|
|
20446
20777
|
if (!provider.trim() || provider.includes(":") || !account2.trim())
|
|
@@ -20503,7 +20834,7 @@ var readMeetingTask = /* @__PURE__ */ __name(async (store, account2, id2) => {
|
|
|
20503
20834
|
}
|
|
20504
20835
|
}, "readMeetingTask");
|
|
20505
20836
|
|
|
20506
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
20837
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/services/package-upgrade.js
|
|
20507
20838
|
var upgradePackage = /* @__PURE__ */ __name(async ({ current, command, packageName, check }, ports) => {
|
|
20508
20839
|
const installer = ports.installer();
|
|
20509
20840
|
const argv = updateCommand(installer, packageName);
|
|
@@ -20568,7 +20899,7 @@ var dayAfter = /* @__PURE__ */ __name((published) => {
|
|
|
20568
20899
|
return Number.isNaN(time) ? null : new Date(time + 24 * 60 * 60 * 1e3).toISOString();
|
|
20569
20900
|
}, "dayAfter");
|
|
20570
20901
|
|
|
20571
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
20902
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/services/proposal-tasks.js
|
|
20572
20903
|
var proposalSource = /* @__PURE__ */ __name((id2) => `proposed-action:${id2}`, "proposalSource");
|
|
20573
20904
|
var approveAsTask = /* @__PURE__ */ __name(async (store, id2, by) => {
|
|
20574
20905
|
const proposal = await store.proposedActions.get(id2);
|
|
@@ -20591,7 +20922,7 @@ var approveAsTask = /* @__PURE__ */ __name(async (store, id2, by) => {
|
|
|
20591
20922
|
return { proposal: await store.proposedActions.approve(proposal.id, by, { task: task2.id }), task: task2 };
|
|
20592
20923
|
}, "approveAsTask");
|
|
20593
20924
|
|
|
20594
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
20925
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/services/proposals/ids.js
|
|
20595
20926
|
var MAX_IDS = 500;
|
|
20596
20927
|
var refuse = /* @__PURE__ */ __name((message) => {
|
|
20597
20928
|
throw new CliError("validation_error", message, { reason: "proposal.ids" });
|
|
@@ -20633,7 +20964,7 @@ var parseProposalIds = /* @__PURE__ */ __name((text2) => {
|
|
|
20633
20964
|
return ids;
|
|
20634
20965
|
}, "parseProposalIds");
|
|
20635
20966
|
|
|
20636
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
20967
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/services/proposals/kinds/shared.js
|
|
20637
20968
|
var proposerOfAuthor = /* @__PURE__ */ __name((author) => {
|
|
20638
20969
|
if (author.type === "person")
|
|
20639
20970
|
return { type: "person", id: author.id };
|
|
@@ -20674,8 +21005,38 @@ var storedStatus = /* @__PURE__ */ __name((filter) => {
|
|
|
20674
21005
|
const status = filter.status ?? "proposed";
|
|
20675
21006
|
return status === "proposed" || status === "rejected" ? status : void 0;
|
|
20676
21007
|
}, "storedStatus");
|
|
21008
|
+
var reviewedRow = /* @__PURE__ */ __name((kind, entry, object3) => ({
|
|
21009
|
+
id: entry.ref,
|
|
21010
|
+
kind,
|
|
21011
|
+
status: entry.review,
|
|
21012
|
+
project: entry.project,
|
|
21013
|
+
subject: entry.ref,
|
|
21014
|
+
object: object3,
|
|
21015
|
+
summary: entry.title,
|
|
21016
|
+
proposedBy: proposerOfAuthor(entry.author),
|
|
21017
|
+
reason: entry.reason,
|
|
21018
|
+
evidence: [],
|
|
21019
|
+
score: null,
|
|
21020
|
+
signals: null,
|
|
21021
|
+
parts: null,
|
|
21022
|
+
createdAt: entry.createdAt
|
|
21023
|
+
}), "reviewedRow");
|
|
21024
|
+
var reviewedKind = /* @__PURE__ */ __name((spec) => ({
|
|
21025
|
+
kind: spec.type,
|
|
21026
|
+
prefix: spec.type,
|
|
21027
|
+
list: /* @__PURE__ */ __name(async (filter) => {
|
|
21028
|
+
const status = filter.status ?? "proposed";
|
|
21029
|
+
const entries = await spec.list({ ...pushed2(filter), ...status === "all" ? {} : { review: status } });
|
|
21030
|
+
return kept(entries.map(spec.row), filter);
|
|
21031
|
+
}, "list"),
|
|
21032
|
+
get: /* @__PURE__ */ __name(async (id2) => spec.row(await spec.get(id2)), "get"),
|
|
21033
|
+
decide: /* @__PURE__ */ __name(async (id2, { confirm, by, reason }) => {
|
|
21034
|
+
const made = await spec.decide(id2, confirm, { by, reason });
|
|
21035
|
+
return { id: id2, kind: spec.type, status: confirm ? "confirmed" : "rejected", made: confirm ? [made] : [] };
|
|
21036
|
+
}, "decide")
|
|
21037
|
+
}), "reviewedKind");
|
|
20677
21038
|
|
|
20678
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
21039
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/services/proposals/kinds/findings.js
|
|
20679
21040
|
var FACT_SUMMARIES = {
|
|
20680
21041
|
fact: /* @__PURE__ */ __name((finding) => finding.statement, "fact"),
|
|
20681
21042
|
task: /* @__PURE__ */ __name((finding) => finding.title, "task"),
|
|
@@ -20747,7 +21108,7 @@ var findingsKind = /* @__PURE__ */ __name((store) => {
|
|
|
20747
21108
|
};
|
|
20748
21109
|
}, "findingsKind");
|
|
20749
21110
|
|
|
20750
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
21111
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/services/proposals/kinds/organization.js
|
|
20751
21112
|
var ORGANIZATION_ADD_KIND = "organization_add";
|
|
20752
21113
|
var ORGANIZATION_RENAME_KIND = "organization_rename";
|
|
20753
21114
|
var rowOf2 = /* @__PURE__ */ __name((action2) => {
|
|
@@ -20803,7 +21164,7 @@ var organizationKind = /* @__PURE__ */ __name((store) => ({
|
|
|
20803
21164
|
}, "decide")
|
|
20804
21165
|
}), "organizationKind");
|
|
20805
21166
|
|
|
20806
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
21167
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/services/proposals/kinds/action.js
|
|
20807
21168
|
var rowOf3 = /* @__PURE__ */ __name((action2) => ({
|
|
20808
21169
|
id: action2.id,
|
|
20809
21170
|
kind: "action",
|
|
@@ -20843,7 +21204,16 @@ var actionKind = /* @__PURE__ */ __name((store, claimed) => ({
|
|
|
20843
21204
|
}, "decide")
|
|
20844
21205
|
}), "actionKind");
|
|
20845
21206
|
|
|
20846
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
21207
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/services/proposals/kinds/contracts.js
|
|
21208
|
+
var contractKind = /* @__PURE__ */ __name((store) => reviewedKind({
|
|
21209
|
+
type: "contract",
|
|
21210
|
+
list: /* @__PURE__ */ __name((options) => store.contracts.list(options), "list"),
|
|
21211
|
+
get: /* @__PURE__ */ __name((id2) => store.contracts.get(id2), "get"),
|
|
21212
|
+
row: /* @__PURE__ */ __name((contract) => reviewedRow("contract", contract, contract.deal), "row"),
|
|
21213
|
+
decide: /* @__PURE__ */ __name(async (id2, confirm, { by, reason }) => (confirm ? await store.contracts.confirm(id2, by, reason) : await store.contracts.reject(id2, by, reason)).ref, "decide")
|
|
21214
|
+
}), "contractKind");
|
|
21215
|
+
|
|
21216
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/services/proposals/kinds/fact.js
|
|
20847
21217
|
var STATUS = {
|
|
20848
21218
|
proposed: "proposed",
|
|
20849
21219
|
accepted: "confirmed",
|
|
@@ -20886,42 +21256,23 @@ var factKind = /* @__PURE__ */ __name((store) => ({
|
|
|
20886
21256
|
}, "decide")
|
|
20887
21257
|
}), "factKind");
|
|
20888
21258
|
|
|
20889
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
20890
|
-
var
|
|
20891
|
-
|
|
20892
|
-
|
|
20893
|
-
|
|
20894
|
-
|
|
20895
|
-
|
|
20896
|
-
|
|
20897
|
-
|
|
20898
|
-
|
|
20899
|
-
|
|
20900
|
-
|
|
20901
|
-
|
|
20902
|
-
|
|
20903
|
-
|
|
20904
|
-
createdAt: entry.createdAt
|
|
20905
|
-
}), "rowOf");
|
|
20906
|
-
var financeKind = /* @__PURE__ */ __name((store, kind) => ({
|
|
20907
|
-
kind,
|
|
20908
|
-
prefix: kind,
|
|
20909
|
-
list: /* @__PURE__ */ __name(async (filter) => {
|
|
20910
|
-
const status = filter.status ?? "proposed";
|
|
20911
|
-
const options = { ...pushed2(filter), ...status === "all" ? {} : { review: status } };
|
|
20912
|
-
const entries = kind === "invoice" ? await store.finance.invoices(options) : await store.finance.payments(options);
|
|
20913
|
-
return kept(entries.map((entry) => rowOf5(kind, entry)), filter);
|
|
20914
|
-
}, "list"),
|
|
20915
|
-
get: /* @__PURE__ */ __name(async (id2) => rowOf5(kind, kind === "invoice" ? await store.finance.invoice(id2) : await store.finance.payment(id2)), "get"),
|
|
20916
|
-
decide: /* @__PURE__ */ __name(async (id2, { confirm, by, reason }) => {
|
|
20917
|
-
const entry = confirm ? await store.finance.confirm(id2, by, reason) : await store.finance.reject(id2, by, reason);
|
|
20918
|
-
return { id: id2, kind, status: confirm ? "confirmed" : "rejected", made: confirm ? [entry.ref] : [] };
|
|
20919
|
-
}, "decide")
|
|
20920
|
-
}), "financeKind");
|
|
20921
|
-
var invoiceKind = /* @__PURE__ */ __name((store) => financeKind(store, "invoice"), "invoiceKind");
|
|
20922
|
-
var paymentKind = /* @__PURE__ */ __name((store) => financeKind(store, "payment"), "paymentKind");
|
|
21259
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/services/proposals/kinds/finance.js
|
|
21260
|
+
var invoiceKind = /* @__PURE__ */ __name((store) => reviewedKind({
|
|
21261
|
+
type: "invoice",
|
|
21262
|
+
list: /* @__PURE__ */ __name((options) => store.finance.invoices(options), "list"),
|
|
21263
|
+
get: /* @__PURE__ */ __name((id2) => store.finance.invoice(id2), "get"),
|
|
21264
|
+
row: /* @__PURE__ */ __name((invoice) => reviewedRow("invoice", invoice, invoice.counterparty.ref), "row"),
|
|
21265
|
+
decide: /* @__PURE__ */ __name(async (id2, confirm, { by, reason }) => (confirm ? await store.finance.confirm(id2, by, reason) : await store.finance.reject(id2, by, reason)).ref, "decide")
|
|
21266
|
+
}), "invoiceKind");
|
|
21267
|
+
var paymentKind = /* @__PURE__ */ __name((store) => reviewedKind({
|
|
21268
|
+
type: "payment",
|
|
21269
|
+
list: /* @__PURE__ */ __name((options) => store.finance.payments(options), "list"),
|
|
21270
|
+
get: /* @__PURE__ */ __name((id2) => store.finance.payment(id2), "get"),
|
|
21271
|
+
row: /* @__PURE__ */ __name((payment) => reviewedRow("payment", payment, (payment.direction === "in" ? payment.payer : payment.payee)?.ref ?? null), "row"),
|
|
21272
|
+
decide: /* @__PURE__ */ __name(async (id2, confirm, { by, reason }) => (confirm ? await store.finance.confirm(id2, by, reason) : await store.finance.reject(id2, by, reason)).ref, "decide")
|
|
21273
|
+
}), "paymentKind");
|
|
20923
21274
|
|
|
20924
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
21275
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/services/proposals/kinds/key-document.js
|
|
20925
21276
|
var linkRow = /* @__PURE__ */ __name((link4) => ({
|
|
20926
21277
|
id: `key:${link4.id}`,
|
|
20927
21278
|
kind: "key_document",
|
|
@@ -20989,7 +21340,7 @@ var keyDocumentKind = /* @__PURE__ */ __name((store) => {
|
|
|
20989
21340
|
};
|
|
20990
21341
|
}, "keyDocumentKind");
|
|
20991
21342
|
|
|
20992
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
21343
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/services/proposals/kinds/mail-findings.js
|
|
20993
21344
|
var words3 = /* @__PURE__ */ __name((...parts) => parts.filter(Boolean).join(" "), "words");
|
|
20994
21345
|
var summaryOf = /* @__PURE__ */ __name((finding) => {
|
|
20995
21346
|
switch (finding.kind) {
|
|
@@ -21015,7 +21366,7 @@ var summaryOf = /* @__PURE__ */ __name((finding) => {
|
|
|
21015
21366
|
return words3("order", finding.number, finding.supplierName, finding.status, `\xB7 ${finding.reason}`);
|
|
21016
21367
|
}
|
|
21017
21368
|
}, "summaryOf");
|
|
21018
|
-
var
|
|
21369
|
+
var rowOf5 = /* @__PURE__ */ __name((batch, createdAt) => {
|
|
21019
21370
|
const findings = batch.input.findings;
|
|
21020
21371
|
const outcome2 = /* @__PURE__ */ __name((id2) => batch.receipt?.items.find((item2) => item2.id === id2)?.status ?? null, "outcome");
|
|
21021
21372
|
const project = findings.flatMap((finding) => "project" in finding && finding.project ? [finding.project] : [])[0] ?? null;
|
|
@@ -21042,7 +21393,7 @@ var rowOf6 = /* @__PURE__ */ __name((batch, createdAt) => {
|
|
|
21042
21393
|
};
|
|
21043
21394
|
}, "rowOf");
|
|
21044
21395
|
var mailFindingsKind = /* @__PURE__ */ __name((store) => {
|
|
21045
|
-
const created = /* @__PURE__ */ __name(async (batch) =>
|
|
21396
|
+
const created = /* @__PURE__ */ __name(async (batch) => rowOf5(batch, (await store.proposedActions.get(batch.id)).createdAt), "created");
|
|
21046
21397
|
return {
|
|
21047
21398
|
kind: "mail_findings",
|
|
21048
21399
|
stored: [MAIL_FINDINGS_KIND],
|
|
@@ -21077,8 +21428,8 @@ var mailFindingsKind = /* @__PURE__ */ __name((store) => {
|
|
|
21077
21428
|
};
|
|
21078
21429
|
}, "mailFindingsKind");
|
|
21079
21430
|
|
|
21080
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
21081
|
-
var
|
|
21431
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/services/proposals/kinds/meeting-findings.js
|
|
21432
|
+
var rowOf6 = /* @__PURE__ */ __name((action2, batch) => {
|
|
21082
21433
|
const findings = batch.input.findings;
|
|
21083
21434
|
const projects = [...new Set(findings.map((one2) => "project" in one2 ? one2.project : void 0))];
|
|
21084
21435
|
const outcome2 = /* @__PURE__ */ __name((id2) => batch.receipt?.items.find((item2) => item2.id === id2)?.status ?? null, "outcome");
|
|
@@ -21123,12 +21474,12 @@ var meetingFindingsKind = /* @__PURE__ */ __name((store) => {
|
|
|
21123
21474
|
...filter.by === void 0 ? {} : { proposedBy: filter.by },
|
|
21124
21475
|
limit: Math.min(filter.offset + filter.limit, 500)
|
|
21125
21476
|
});
|
|
21126
|
-
const rows = await Promise.all(actions.map(async (action2) =>
|
|
21477
|
+
const rows = await Promise.all(actions.map(async (action2) => rowOf6(action2, (await batchOf(action2)).batch)));
|
|
21127
21478
|
return kept(rows, { ...filter, limit: filter.offset + filter.limit });
|
|
21128
21479
|
}, "list"),
|
|
21129
21480
|
get: /* @__PURE__ */ __name(async (id2) => {
|
|
21130
21481
|
const action2 = await store.proposedActions.get(id2);
|
|
21131
|
-
return
|
|
21482
|
+
return rowOf6(action2, (await batchOf(action2)).batch);
|
|
21132
21483
|
}, "get"),
|
|
21133
21484
|
decide: /* @__PURE__ */ __name(async (id2, { confirm, by, parts }) => {
|
|
21134
21485
|
const { account: account2, batch } = await batchOf(await store.proposedActions.get(id2));
|
|
@@ -21141,14 +21492,14 @@ var meetingFindingsKind = /* @__PURE__ */ __name((store) => {
|
|
|
21141
21492
|
};
|
|
21142
21493
|
}, "meetingFindingsKind");
|
|
21143
21494
|
|
|
21144
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
21495
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/services/proposals/kinds/memory.js
|
|
21145
21496
|
var STATUS2 = {
|
|
21146
21497
|
proposed: "proposed",
|
|
21147
21498
|
confirmed: "confirmed",
|
|
21148
21499
|
superseded: "confirmed",
|
|
21149
21500
|
stale: "rejected"
|
|
21150
21501
|
};
|
|
21151
|
-
var
|
|
21502
|
+
var rowOf7 = /* @__PURE__ */ __name((memory) => ({
|
|
21152
21503
|
id: memory.ref,
|
|
21153
21504
|
kind: "memory",
|
|
21154
21505
|
status: STATUS2[memory.status],
|
|
@@ -21173,48 +21524,25 @@ var memoryKind = /* @__PURE__ */ __name((store) => ({
|
|
|
21173
21524
|
...pushed2(filter),
|
|
21174
21525
|
...status === "all" ? {} : { status: status === "rejected" ? "stale" : status }
|
|
21175
21526
|
});
|
|
21176
|
-
return kept(memories.map(
|
|
21527
|
+
return kept(memories.map(rowOf7), filter);
|
|
21177
21528
|
}, "list"),
|
|
21178
|
-
get: /* @__PURE__ */ __name(async (id2) =>
|
|
21529
|
+
get: /* @__PURE__ */ __name(async (id2) => rowOf7(await store.memories.get(id2)), "get"),
|
|
21179
21530
|
decide: /* @__PURE__ */ __name(async (id2, { confirm, by }) => {
|
|
21180
21531
|
const memory = confirm ? await store.memories.confirm(id2, by) : await store.memories.markStale(id2, by);
|
|
21181
21532
|
return { id: id2, kind: "memory", status: confirm ? "confirmed" : "rejected", made: confirm ? [memory.ref] : [] };
|
|
21182
21533
|
}, "decide")
|
|
21183
21534
|
}), "memoryKind");
|
|
21184
21535
|
|
|
21185
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
21186
|
-
var
|
|
21187
|
-
|
|
21188
|
-
|
|
21189
|
-
|
|
21190
|
-
|
|
21191
|
-
|
|
21192
|
-
object: order.supplier?.ref ?? null,
|
|
21193
|
-
summary: order.title,
|
|
21194
|
-
proposedBy: proposerOfAuthor(order.author),
|
|
21195
|
-
reason: order.reason,
|
|
21196
|
-
evidence: [],
|
|
21197
|
-
score: null,
|
|
21198
|
-
signals: null,
|
|
21199
|
-
parts: null,
|
|
21200
|
-
createdAt: order.createdAt
|
|
21201
|
-
}), "rowOf");
|
|
21202
|
-
var orderKind = /* @__PURE__ */ __name((store) => ({
|
|
21203
|
-
kind: "order",
|
|
21204
|
-
prefix: "order",
|
|
21205
|
-
list: /* @__PURE__ */ __name(async (filter) => {
|
|
21206
|
-
const status = filter.status ?? "proposed";
|
|
21207
|
-
const orders = await store.orders.list({ ...pushed2(filter), ...status === "all" ? {} : { review: status } });
|
|
21208
|
-
return kept(orders.map(rowOf9), filter);
|
|
21209
|
-
}, "list"),
|
|
21210
|
-
get: /* @__PURE__ */ __name(async (id2) => rowOf9(await store.orders.get(id2)), "get"),
|
|
21211
|
-
decide: /* @__PURE__ */ __name(async (id2, { confirm, by, reason }) => {
|
|
21212
|
-
const order = confirm ? await store.orders.confirm(id2, by, reason) : await store.orders.reject(id2, by, reason);
|
|
21213
|
-
return { id: id2, kind: "order", status: confirm ? "confirmed" : "rejected", made: confirm ? [order.ref] : [] };
|
|
21214
|
-
}, "decide")
|
|
21536
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/services/proposals/kinds/orders.js
|
|
21537
|
+
var orderKind = /* @__PURE__ */ __name((store) => reviewedKind({
|
|
21538
|
+
type: "order",
|
|
21539
|
+
list: /* @__PURE__ */ __name((options) => store.orders.list(options), "list"),
|
|
21540
|
+
get: /* @__PURE__ */ __name((id2) => store.orders.get(id2), "get"),
|
|
21541
|
+
row: /* @__PURE__ */ __name((order) => reviewedRow("order", order, order.supplier?.ref ?? null), "row"),
|
|
21542
|
+
decide: /* @__PURE__ */ __name(async (id2, confirm, { by, reason }) => (confirm ? await store.orders.confirm(id2, by, reason) : await store.orders.reject(id2, by, reason)).ref, "decide")
|
|
21215
21543
|
}), "orderKind");
|
|
21216
21544
|
|
|
21217
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
21545
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/services/proposals/kinds/relationship.js
|
|
21218
21546
|
var linkRow2 = /* @__PURE__ */ __name((link4) => ({
|
|
21219
21547
|
id: `link:${link4.id}`,
|
|
21220
21548
|
kind: "relationship",
|
|
@@ -21288,10 +21616,10 @@ var relationshipKind = /* @__PURE__ */ __name((store) => {
|
|
|
21288
21616
|
};
|
|
21289
21617
|
}, "relationshipKind");
|
|
21290
21618
|
|
|
21291
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
21619
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/services/proposals/kinds/relationship-update.js
|
|
21292
21620
|
var KIND2 = "relationship_update";
|
|
21293
21621
|
var summaryOf2 = /* @__PURE__ */ __name(({ changes }) => Object.entries(changes).map(([field, value]) => `${field} ${value ?? "cleared"}`).join(", "), "summaryOf");
|
|
21294
|
-
var
|
|
21622
|
+
var rowOf8 = /* @__PURE__ */ __name((action2) => {
|
|
21295
21623
|
const payload = action2.payload;
|
|
21296
21624
|
return {
|
|
21297
21625
|
id: action2.id,
|
|
@@ -21320,9 +21648,9 @@ var relationshipUpdateKind = /* @__PURE__ */ __name((store) => ({
|
|
|
21320
21648
|
...status === void 0 ? {} : { status },
|
|
21321
21649
|
...pushed2(filter)
|
|
21322
21650
|
});
|
|
21323
|
-
return kept(stored.map(
|
|
21651
|
+
return kept(stored.map(rowOf8), filter);
|
|
21324
21652
|
}, "list"),
|
|
21325
|
-
get: /* @__PURE__ */ __name(async (id2) =>
|
|
21653
|
+
get: /* @__PURE__ */ __name(async (id2) => rowOf8(await store.proposedActions.get(id2)), "get"),
|
|
21326
21654
|
decide: /* @__PURE__ */ __name(async (id2, { confirm, by, reason }) => {
|
|
21327
21655
|
const { relation } = await store.knowledge.decideRelationUpdate(id2, {
|
|
21328
21656
|
confirm,
|
|
@@ -21338,8 +21666,70 @@ var relationshipUpdateKind = /* @__PURE__ */ __name((store) => ({
|
|
|
21338
21666
|
}, "decide")
|
|
21339
21667
|
}), "relationshipUpdateKind");
|
|
21340
21668
|
|
|
21341
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
21342
|
-
var
|
|
21669
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/services/proposals/kinds/source-review.js
|
|
21670
|
+
var rowOf9 = /* @__PURE__ */ __name((action2) => {
|
|
21671
|
+
const payload = action2.payload;
|
|
21672
|
+
const sources = payload.sources.flatMap((source) => source.ref ?? []);
|
|
21673
|
+
const contradicting = payload.challenges.flatMap((challenge) => challenge.evidence);
|
|
21674
|
+
const replacement = payload.sources.find((source) => source.replacement !== void 0)?.replacement ?? null;
|
|
21675
|
+
return {
|
|
21676
|
+
id: action2.id,
|
|
21677
|
+
kind: SOURCE_REVIEW_KIND,
|
|
21678
|
+
status: actionStatus(action2.status),
|
|
21679
|
+
project: null,
|
|
21680
|
+
subject: action2.target ?? payload.target,
|
|
21681
|
+
object: replacement,
|
|
21682
|
+
summary: `${payload.cause}: ${payload.sources.length} source(s), ${payload.challenges.length} challenge(s)`,
|
|
21683
|
+
proposedBy: proposerOfAction(action2),
|
|
21684
|
+
reason: payload.challenges.at(-1)?.reason ?? action2.reason,
|
|
21685
|
+
evidence: [.../* @__PURE__ */ new Set([...sources, ...contradicting])].slice(0, 5),
|
|
21686
|
+
score: null,
|
|
21687
|
+
signals: null,
|
|
21688
|
+
parts: null,
|
|
21689
|
+
createdAt: payload.raisedAt
|
|
21690
|
+
};
|
|
21691
|
+
}, "rowOf");
|
|
21692
|
+
var sourceReviewKind = /* @__PURE__ */ __name((store) => ({
|
|
21693
|
+
kind: SOURCE_REVIEW_KIND,
|
|
21694
|
+
stored: [SOURCE_REVIEW_KIND],
|
|
21695
|
+
ownerOnly: true,
|
|
21696
|
+
list: /* @__PURE__ */ __name(async (filter) => {
|
|
21697
|
+
const status = storedStatus(filter);
|
|
21698
|
+
const stored = await store.proposedActions.list({
|
|
21699
|
+
kinds: [SOURCE_REVIEW_KIND],
|
|
21700
|
+
...status === void 0 ? {} : { status },
|
|
21701
|
+
...pushed2(filter)
|
|
21702
|
+
});
|
|
21703
|
+
return kept(stored.map(rowOf9), filter);
|
|
21704
|
+
}, "list"),
|
|
21705
|
+
get: /* @__PURE__ */ __name(async (id2) => rowOf9(await store.proposedActions.get(id2)), "get"),
|
|
21706
|
+
decide: /* @__PURE__ */ __name(async (id2, { confirm, by, reason }) => {
|
|
21707
|
+
await store.knowledge.decideSourceReview(id2, { confirm, by, ...reason === void 0 ? {} : { reason } });
|
|
21708
|
+
return { id: id2, kind: SOURCE_REVIEW_KIND, status: confirm ? "confirmed" : "rejected", made: [] };
|
|
21709
|
+
}, "decide")
|
|
21710
|
+
}), "sourceReviewKind");
|
|
21711
|
+
|
|
21712
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/services/proposals/kinds/subscriptions.js
|
|
21713
|
+
var subscriptionKind = /* @__PURE__ */ __name((store) => reviewedKind({
|
|
21714
|
+
type: "subscription",
|
|
21715
|
+
list: /* @__PURE__ */ __name((options) => store.subscriptions.list(options), "list"),
|
|
21716
|
+
get: /* @__PURE__ */ __name((id2) => store.subscriptions.get(id2), "get"),
|
|
21717
|
+
row: /* @__PURE__ */ __name((subscription) => reviewedRow("subscription", subscription, (subscription.direction === "receivable" ? subscription.customer : subscription.supplier).ref), "row"),
|
|
21718
|
+
decide: /* @__PURE__ */ __name(async (id2, confirm, { by, reason }) => (confirm ? await store.subscriptions.confirm(id2, by, reason) : await store.subscriptions.reject(id2, by, reason)).ref, "decide")
|
|
21719
|
+
}), "subscriptionKind");
|
|
21720
|
+
var subscriptionPriceKind = /* @__PURE__ */ __name((store) => reviewedKind({
|
|
21721
|
+
type: "subscription_price",
|
|
21722
|
+
list: /* @__PURE__ */ __name(({ review, proposedBy, limit }) => store.subscriptions.prices({ review, proposedBy, limit }), "list"),
|
|
21723
|
+
get: /* @__PURE__ */ __name((id2) => store.subscriptions.price(id2), "get"),
|
|
21724
|
+
row: /* @__PURE__ */ __name((price) => reviewedRow("subscription_price", price, price.subscription), "row"),
|
|
21725
|
+
decide: /* @__PURE__ */ __name(async (id2, confirm, { by, reason }) => {
|
|
21726
|
+
await (confirm ? store.subscriptions.confirm(id2, by, reason) : store.subscriptions.reject(id2, by, reason));
|
|
21727
|
+
return id2;
|
|
21728
|
+
}, "decide")
|
|
21729
|
+
}), "subscriptionPriceKind");
|
|
21730
|
+
|
|
21731
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/services/proposals/kinds/task-close.js
|
|
21732
|
+
var rowOf10 = /* @__PURE__ */ __name((task2) => {
|
|
21343
21733
|
const suggestion = task2.closeSuggestion;
|
|
21344
21734
|
if (suggestion === null)
|
|
21345
21735
|
return void 0;
|
|
@@ -21364,7 +21754,7 @@ var taskCloseKind = /* @__PURE__ */ __name((store) => {
|
|
|
21364
21754
|
const taskOf = /* @__PURE__ */ __name(async (id2) => {
|
|
21365
21755
|
const key = id2.slice("close:".length);
|
|
21366
21756
|
const task2 = await store.tasks.details(key).catch(() => void 0);
|
|
21367
|
-
const row = task2 &&
|
|
21757
|
+
const row = task2 && rowOf10(task2);
|
|
21368
21758
|
if (!task2 || !row)
|
|
21369
21759
|
throw new CliError("not_found", `no close waits on task ${key}`);
|
|
21370
21760
|
return { task: task2, row };
|
|
@@ -21381,7 +21771,7 @@ var taskCloseKind = /* @__PURE__ */ __name((store) => {
|
|
|
21381
21771
|
where: { sql: "t.close_suggested_as IS NOT NULL", params: [] },
|
|
21382
21772
|
limit: filter.offset + filter.limit
|
|
21383
21773
|
});
|
|
21384
|
-
return kept(tasks.flatMap((task2) =>
|
|
21774
|
+
return kept(tasks.flatMap((task2) => rowOf10(task2) ?? []), { ...filter, limit: filter.offset + filter.limit });
|
|
21385
21775
|
}, "list"),
|
|
21386
21776
|
get: /* @__PURE__ */ __name(async (id2) => (await taskOf(id2)).row, "get"),
|
|
21387
21777
|
decide: /* @__PURE__ */ __name(async (id2, { confirm, by, reason }) => {
|
|
@@ -21406,7 +21796,16 @@ var taskCloseKind = /* @__PURE__ */ __name((store) => {
|
|
|
21406
21796
|
};
|
|
21407
21797
|
}, "taskCloseKind");
|
|
21408
21798
|
|
|
21409
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
21799
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/services/proposals/kinds/transactions.js
|
|
21800
|
+
var transactionKind = /* @__PURE__ */ __name((store) => reviewedKind({
|
|
21801
|
+
type: "transaction",
|
|
21802
|
+
list: /* @__PURE__ */ __name((options) => store.transactions.list(options), "list"),
|
|
21803
|
+
get: /* @__PURE__ */ __name((id2) => store.transactions.get(id2), "get"),
|
|
21804
|
+
row: /* @__PURE__ */ __name((transaction) => reviewedRow("transaction", transaction, transaction.counterparty?.ref ?? transaction.wallet), "row"),
|
|
21805
|
+
decide: /* @__PURE__ */ __name(async (id2, confirm, { by, reason }) => (confirm ? await store.transactions.confirm(id2, by, reason) : await store.transactions.reject(id2, by, reason)).ref, "decide")
|
|
21806
|
+
}), "transactionKind");
|
|
21807
|
+
|
|
21808
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/services/proposals/registry.js
|
|
21410
21809
|
var PREFIX = /^([a-z][a-z_]*):/;
|
|
21411
21810
|
var marked = /* @__PURE__ */ __name((kind, row) => kind.ownerOnly ? { ...row, ownerOnly: true } : row, "marked");
|
|
21412
21811
|
var refusalOf = /* @__PURE__ */ __name((id2, error) => {
|
|
@@ -21420,7 +21819,7 @@ var emptyProposalRegistry = /* @__PURE__ */ __name((store) => {
|
|
|
21420
21819
|
const policy = store.decisionPolicy;
|
|
21421
21820
|
const kinds = [];
|
|
21422
21821
|
const claimed = /* @__PURE__ */ __name(() => kinds.flatMap((kind) => kind.stored ?? []), "claimed");
|
|
21423
|
-
const
|
|
21822
|
+
const kindOf3 = /* @__PURE__ */ __name(async (id2) => {
|
|
21424
21823
|
const prefix = PREFIX.exec(id2)?.[1];
|
|
21425
21824
|
const found = prefix !== void 0 ? kinds.find((kind) => kind.prefix === prefix) : await (async () => {
|
|
21426
21825
|
const stored = (await store.proposedActions.get(id2)).kind;
|
|
@@ -21452,7 +21851,7 @@ var emptyProposalRegistry = /* @__PURE__ */ __name((store) => {
|
|
|
21452
21851
|
return { items: page.slice(0, filter.limit), hasMore: page.length > filter.limit };
|
|
21453
21852
|
}, "list"),
|
|
21454
21853
|
get: /* @__PURE__ */ __name(async (id2) => {
|
|
21455
|
-
const kind = await
|
|
21854
|
+
const kind = await kindOf3(id2);
|
|
21456
21855
|
return marked(kind, await kind.get(id2));
|
|
21457
21856
|
}, "get"),
|
|
21458
21857
|
decide: /* @__PURE__ */ __name(async (ids, decision) => {
|
|
@@ -21482,7 +21881,7 @@ var emptyProposalRegistry = /* @__PURE__ */ __name((store) => {
|
|
|
21482
21881
|
continue;
|
|
21483
21882
|
}
|
|
21484
21883
|
try {
|
|
21485
|
-
const kind = await
|
|
21884
|
+
const kind = await kindOf3(id2);
|
|
21486
21885
|
if (chosen.length && !kind.parts) {
|
|
21487
21886
|
refuseIds(id2, `a ${kind.kind} proposal has no parts; name ${id2} alone`);
|
|
21488
21887
|
continue;
|
|
@@ -21522,19 +21921,24 @@ var proposalRegistry = /* @__PURE__ */ __name((store) => {
|
|
|
21522
21921
|
invoiceKind(store),
|
|
21523
21922
|
paymentKind(store),
|
|
21524
21923
|
orderKind(store),
|
|
21924
|
+
contractKind(store),
|
|
21925
|
+
subscriptionKind(store),
|
|
21926
|
+
subscriptionPriceKind(store),
|
|
21927
|
+
transactionKind(store),
|
|
21525
21928
|
organizationKind(store),
|
|
21526
21929
|
memoryKind(store),
|
|
21527
21930
|
findingsKind(store),
|
|
21528
21931
|
mailFindingsKind(store),
|
|
21529
21932
|
meetingFindingsKind(store),
|
|
21530
|
-
taskCloseKind(store)
|
|
21933
|
+
taskCloseKind(store),
|
|
21934
|
+
sourceReviewKind(store)
|
|
21531
21935
|
])
|
|
21532
21936
|
registry.register(kind);
|
|
21533
21937
|
registry.register(actionKind(store, registry.claimed));
|
|
21534
21938
|
return registry;
|
|
21535
21939
|
}, "proposalRegistry");
|
|
21536
21940
|
|
|
21537
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
21941
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/services/stored-meeting-project-candidate-validation.js
|
|
21538
21942
|
var storedCandidateRequest = /* @__PURE__ */ __name((reference, accountId, options) => {
|
|
21539
21943
|
const invalid8 = /* @__PURE__ */ __name((field) => {
|
|
21540
21944
|
throw new CliError("validation_error", `invalid stored project candidate ${field}`);
|
|
@@ -21576,7 +21980,7 @@ var storedCandidateRequest = /* @__PURE__ */ __name((reference, accountId, optio
|
|
|
21576
21980
|
return { reference, limits, after, afterTranscriptId, signal };
|
|
21577
21981
|
}, "storedCandidateRequest");
|
|
21578
21982
|
|
|
21579
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
21983
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/services/stored-meeting-project-candidates.js
|
|
21580
21984
|
var createStoredMeetingProjectCandidateReader = /* @__PURE__ */ __name((scope, accountId, ports) => {
|
|
21581
21985
|
const fixed = snapshotMeetingScope(scope);
|
|
21582
21986
|
const store = ports?.meetings;
|
|
@@ -21668,7 +22072,7 @@ var createStoredMeetingProjectCandidateReader = /* @__PURE__ */ __name((scope, a
|
|
|
21668
22072
|
};
|
|
21669
22073
|
}, "createStoredMeetingProjectCandidateReader");
|
|
21670
22074
|
|
|
21671
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
22075
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.608.0_@wirecat+cli-base@0.80.9_commander@15.0.0_esbuild@0.28.2_type_835308f42ae01aacd71fad942c0d0dc0/node_modules/@wirecat/cli-core/dist/services/index.js
|
|
21672
22076
|
var servicesFor = /* @__PURE__ */ __name((deps) => {
|
|
21673
22077
|
const pictures = picturesService(deps);
|
|
21674
22078
|
const base = {
|
|
@@ -21710,7 +22114,6 @@ export {
|
|
|
21710
22114
|
syncsOneChat,
|
|
21711
22115
|
throughWrapper,
|
|
21712
22116
|
capability,
|
|
21713
|
-
withTimeLimit,
|
|
21714
22117
|
newSendId,
|
|
21715
22118
|
newOperationId,
|
|
21716
22119
|
batchProgress,
|
|
@@ -21773,6 +22176,9 @@ export {
|
|
|
21773
22176
|
createContextEvidenceReader,
|
|
21774
22177
|
excerpt,
|
|
21775
22178
|
ingest,
|
|
22179
|
+
jsonlLines,
|
|
22180
|
+
ingestLines,
|
|
22181
|
+
ingestVcard,
|
|
21776
22182
|
aliasHits,
|
|
21777
22183
|
chatSenders,
|
|
21778
22184
|
chatTitle,
|