@wirecat/tg-cli 0.111.0 → 0.113.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/README.md +3 -0
- package/dist/bin/tg.js +2 -2
- package/dist/bundle/{adapter-WFC2JAD4.js → adapter-EQKEFGPB.js} +70 -50
- package/dist/bundle/{all-profiles-FEUSGHT7.js → all-profiles-TTBFF663.js} +8 -8
- package/dist/bundle/{anthropic-O646SJIJ.js → anthropic-XPZS7267.js} +5 -5
- package/dist/bundle/{app-server-7P23Y45A.js → app-server-ZSZ7KRAY.js} +42 -42
- package/dist/bundle/{bot-api-WTJCL6VF.js → bot-api-X7BOVNIO.js} +46 -46
- package/dist/bundle/{bot-history-5J2Q4SPC.js → bot-history-DWIUIPN5.js} +15 -15
- package/dist/bundle/{bun-KUKVEKDW.js → bun-ZGZVAJU2.js} +2 -2
- package/dist/bundle/{bun-sqlite-2G5TXHYE.js → bun-sqlite-UN2UJ6SI.js} +4 -4
- package/dist/bundle/{chunk-UDYCZ5KB.js → chunk-3MAYYFKY.js} +1 -1
- package/dist/bundle/{chunk-3BD24JYK.js → chunk-452UZ2PU.js} +121 -95
- package/dist/bundle/{chunk-EB44Z44U.js → chunk-4GLMEES6.js} +1 -1
- package/dist/bundle/{chunk-J2Z5E7TO.js → chunk-4SQB5VKL.js} +1 -1
- package/dist/bundle/{chunk-BNQOUCL2.js → chunk-5NF7M4MN.js} +1 -1
- package/dist/bundle/{chunk-VIEVOF3O.js → chunk-6F6K3LWV.js} +11 -11
- package/dist/bundle/{chunk-QLLPZWYZ.js → chunk-6OKGHHRL.js} +4 -4
- package/dist/bundle/{chunk-QVM2HKJP.js → chunk-6WJ5M2Q4.js} +4 -4
- package/dist/bundle/{chunk-OYVDWHP5.js → chunk-7IWDS2CM.js} +2 -2
- package/dist/bundle/{chunk-ABVHA4K6.js → chunk-AGUCXSSM.js} +5 -5
- package/dist/bundle/{chunk-2ZH3PUQX.js → chunk-AVUIWZTP.js} +2 -2
- package/dist/bundle/{chunk-LLAZSGS7.js → chunk-BI5YJZJB.js} +31 -27
- package/dist/bundle/{chunk-COHMFCHD.js → chunk-EGR5IJCG.js} +95 -34
- package/dist/bundle/{chunk-7665YBJ7.js → chunk-ENXO43TV.js} +6 -6
- package/dist/bundle/{chunk-MSGYLWCH.js → chunk-G74QMORP.js} +2 -2
- package/dist/bundle/{chunk-KLHLWKWC.js → chunk-GX4LRLVD.js} +80 -60
- package/dist/bundle/{chunk-DREEXESG.js → chunk-HNN7EKIM.js} +114 -79
- package/dist/bundle/{chunk-2K6IGVSI.js → chunk-HO53POQG.js} +5 -5
- package/dist/bundle/{chunk-43ZFY6TW.js → chunk-IDUYRTPF.js} +2 -2
- package/dist/bundle/{chunk-WDRNVSWF.js → chunk-IYKRHDX6.js} +45 -44
- package/dist/bundle/{chunk-KE47Y4PW.js → chunk-J6USEBA6.js} +699 -379
- package/dist/bundle/{chunk-5ZPLOYTP.js → chunk-JDQSX2JQ.js} +453 -358
- package/dist/bundle/{chunk-NIKYFRDQ.js → chunk-JO45BOYE.js} +2 -2
- package/dist/bundle/{chunk-ONHHBPV3.js → chunk-JRTZ5I6M.js} +2 -2
- package/dist/bundle/{chunk-YG4BO7N3.js → chunk-JW7BMJ6O.js} +2 -2
- package/dist/bundle/{chunk-J4QVXR5I.js → chunk-K3F46QVN.js} +2 -2
- package/dist/bundle/{chunk-XXOJ7PQY.js → chunk-KK3JVOOV.js} +30 -30
- package/dist/bundle/{chunk-UPRYEDAV.js → chunk-KOWQVHXI.js} +3 -3
- package/dist/bundle/{chunk-BWRCPMMC.js → chunk-KQ23JWLJ.js} +20 -18
- package/dist/bundle/{chunk-ZCV4UEVH.js → chunk-KVLCIZUK.js} +3 -3
- package/dist/bundle/{chunk-DEG4JJHG.js → chunk-MTX5EDYJ.js} +813 -542
- package/dist/bundle/{chunk-UFIUMPXP.js → chunk-OC4RRFKH.js} +4 -4
- package/dist/bundle/{chunk-PNUHAHTF.js → chunk-OQR442B6.js} +1 -1
- package/dist/bundle/{chunk-TWZTQHP6.js → chunk-OSBAISA5.js} +6 -6
- package/dist/bundle/{chunk-UIPT6IAU.js → chunk-OYNSFQ7K.js} +1 -1
- package/dist/bundle/{chunk-EO563SUX.js → chunk-PCRLXJRH.js} +11 -7
- package/dist/bundle/{chunk-XIRASTVS.js → chunk-PHPNA2HU.js} +11 -11
- package/dist/bundle/{chunk-7GQLD5TJ.js → chunk-PHYDBR5M.js} +2 -2
- package/dist/bundle/{chunk-T6DSAROY.js → chunk-Q264PYGE.js} +51 -14
- package/dist/bundle/{chunk-QEAMO2TS.js → chunk-T4TTRFP5.js} +7 -7
- package/dist/bundle/{chunk-UMUJHC4M.js → chunk-T5RM4Y35.js} +3 -3
- package/dist/bundle/{chunk-ITSSCYLP.js → chunk-TQ6EA7TB.js} +11 -11
- package/dist/bundle/{chunk-QAC6Z675.js → chunk-TUD4MU7S.js} +2 -2
- package/dist/bundle/{chunk-ZCHC7TYO.js → chunk-U3MJQLZQ.js} +26 -13
- package/dist/bundle/{chunk-YFK3DNNP.js → chunk-UE75KPAC.js} +4 -4
- package/dist/bundle/{chunk-HN6ZMUAS.js → chunk-UIVLDKWT.js} +1 -1
- package/dist/bundle/{chunk-3WUTBGZE.js → chunk-VDATXIO4.js} +6 -6
- package/dist/bundle/{chunk-AUWYMMYL.js → chunk-VDEXNNMH.js} +4 -4
- package/dist/bundle/{chunk-33HEHPIK.js → chunk-VVA4555T.js} +8 -8
- package/dist/bundle/{chunk-PQGWEFJ2.js → chunk-WSAHUQ6K.js} +3 -3
- package/dist/bundle/{chunk-K457FHD4.js → chunk-XXNJF3ZM.js} +32 -26
- package/dist/bundle/{chunk-NQAV7U7C.js → chunk-XZ2ZHIAO.js} +1 -1
- package/dist/bundle/{chunk-5FJQG5UZ.js → chunk-Z6TRIW2O.js} +8 -8
- package/dist/bundle/{chunk-CJUSP5X2.js → chunk-ZID2Y4XU.js} +2 -2
- package/dist/bundle/command-contract-GV67H22L.js +32 -0
- package/dist/bundle/{decode-QJNVAAKJ.js → decode-AMQVTEMW.js} +4 -4
- package/dist/bundle/{echarts-2EDY7OUX.js → echarts-ECYONFQJ.js} +2 -2
- package/dist/bundle/{embed-PZSXOQJO.js → embed-VZYBZEWI.js} +5 -5
- package/dist/bundle/{embedder-O4EGMMUU.js → embedder-GSWBGHRK.js} +8 -8
- package/dist/bundle/{entry-DVLMQM6J.js → entry-LALZILY4.js} +5 -5
- package/dist/bundle/{first-run-J67KTUWA.js → first-run-LEAI623Q.js} +9 -9
- package/dist/bundle/first-screen-MOCVLE23.js +30 -0
- package/dist/bundle/{identity-DSYY4FLQ.js → identity-54HA5GN6.js} +3 -3
- package/dist/bundle/{instructions-O535XB2L.js → instructions-AXLQQS3G.js} +1 -1
- package/dist/bundle/{mcp-EMNFFY4N.js → mcp-VVMPUDSL.js} +2 -2
- package/dist/bundle/{node-S3VEQNTE.js → node-7JHC5K77.js} +2 -2
- package/dist/bundle/{node-sqlite-3DNWF2BW.js → node-sqlite-LYJEK46T.js} +4 -4
- package/dist/bundle/{oauth-IU2RAZ3D.js → oauth-BROPKI3K.js} +6 -6
- package/dist/bundle/{open-M2IPPXMI.js → open-C6XQ46JK.js} +3 -3
- package/dist/bundle/{openai-GDI7HISL.js → openai-VWSU7ZDD.js} +13 -13
- package/dist/bundle/{process-3IGMEATV.js → process-QKEFL5HL.js} +1 -1
- package/dist/bundle/{program-P7YPHVLD.js → program-ACY7O33O.js} +48 -48
- package/dist/bundle/{prompt-S6R7IHDK.js → prompt-EGULVW2F.js} +4 -4
- package/dist/bundle/{proxy-transport-OROEVBCG.js → proxy-transport-KIMADLQ2.js} +4 -4
- package/dist/bundle/{recognize-PFZRQ3P4.js → recognize-UMTKLWVR.js} +3 -3
- package/dist/bundle/{remote-Q37V7LUX.js → remote-DABI7PSQ.js} +6 -6
- package/dist/bundle/{rerank-V5YQQQAM.js → rerank-ZFATWWBE.js} +6 -6
- package/dist/bundle/{serve-5CAD2UVG.js → serve-B7YYCMGN.js} +8 -8
- package/dist/bundle/{server-R6YAO2SG.js → server-DGKZISZH.js} +32 -32
- package/dist/bundle/server-UC7UWUIS.js +56 -0
- package/dist/bundle/{state-Y3A2NEM3.js → state-AQ2PABA5.js} +5 -5
- package/dist/bundle/{store-H5K32CNI.js → store-46GJTFLJ.js} +12 -10
- package/dist/bundle/store-maintenance-command-FCFKHGRM.js +45 -0
- package/dist/bundle/tg.js +4 -4
- package/dist/telegram/adapter.d.ts +2 -0
- package/dist/telegram/adapter.d.ts.map +1 -1
- package/dist/telegram/adapter.js +3 -0
- package/dist/telegram/adapter.js.map +1 -1
- package/dist/telegram/topics.d.ts +4 -2
- package/dist/telegram/topics.d.ts.map +1 -1
- package/dist/telegram/topics.js +21 -3
- package/dist/telegram/topics.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +3 -3
- package/skills/tg-cli/SKILL.md +2 -0
- package/dist/bundle/command-contract-JCRVVL7P.js +0 -32
- package/dist/bundle/first-screen-PYEE5NMQ.js +0 -30
- package/dist/bundle/server-RUQLAWWS.js +0 -56
- package/dist/bundle/store-maintenance-command-QZDC4WKW.js +0 -45
- /package/dist/bundle/{chunk-NPGVOZVK.js → chunk-HPXYN7F3.js} +0 -0
|
@@ -4,10 +4,11 @@ import {
|
|
|
4
4
|
acquireLock,
|
|
5
5
|
openOrdinaryFile,
|
|
6
6
|
readBoundedUtf8File,
|
|
7
|
+
safeName,
|
|
7
8
|
sameOrdinaryFile,
|
|
8
9
|
syncDirectory,
|
|
9
10
|
writeFileAtomic
|
|
10
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-U3MJQLZQ.js";
|
|
11
12
|
import {
|
|
12
13
|
Command,
|
|
13
14
|
DEFAULT_IMAGE_MODEL,
|
|
@@ -46,23 +47,23 @@ import {
|
|
|
46
47
|
typedCommand,
|
|
47
48
|
vectorModelKey,
|
|
48
49
|
withAttempt
|
|
49
|
-
} from "./chunk-
|
|
50
|
+
} from "./chunk-GX4LRLVD.js";
|
|
50
51
|
import {
|
|
51
52
|
isCliFailure
|
|
52
|
-
} from "./chunk-
|
|
53
|
+
} from "./chunk-Z6TRIW2O.js";
|
|
53
54
|
import {
|
|
54
55
|
isNewer,
|
|
55
56
|
updateCommand
|
|
56
|
-
} from "./chunk-
|
|
57
|
+
} from "./chunk-AGUCXSSM.js";
|
|
57
58
|
import {
|
|
58
59
|
readOnlyLockOf
|
|
59
|
-
} from "./chunk-
|
|
60
|
+
} from "./chunk-IDUYRTPF.js";
|
|
60
61
|
import {
|
|
61
62
|
MAX_MODEL_IMAGE_BYTES
|
|
62
|
-
} from "./chunk-
|
|
63
|
+
} from "./chunk-TUD4MU7S.js";
|
|
63
64
|
import {
|
|
64
65
|
remoteKey
|
|
65
|
-
} from "./chunk-
|
|
66
|
+
} from "./chunk-T5RM4Y35.js";
|
|
66
67
|
import {
|
|
67
68
|
Unzip,
|
|
68
69
|
UnzipInflate,
|
|
@@ -73,11 +74,11 @@ import {
|
|
|
73
74
|
placedText,
|
|
74
75
|
runEmbedders,
|
|
75
76
|
textModelsDirectory
|
|
76
|
-
} from "./chunk-
|
|
77
|
+
} from "./chunk-ENXO43TV.js";
|
|
77
78
|
import {
|
|
78
79
|
installFiles,
|
|
79
80
|
megabytes
|
|
80
|
-
} from "./chunk-
|
|
81
|
+
} from "./chunk-VDEXNNMH.js";
|
|
81
82
|
import {
|
|
82
83
|
AGENDA_COLUMNS,
|
|
83
84
|
CHAT_COLUMNS,
|
|
@@ -125,6 +126,7 @@ import {
|
|
|
125
126
|
hasStems,
|
|
126
127
|
hasText,
|
|
127
128
|
historyStartKey,
|
|
129
|
+
hitFiles,
|
|
128
130
|
inSource,
|
|
129
131
|
inboxKey,
|
|
130
132
|
isAccountList,
|
|
@@ -149,7 +151,7 @@ import {
|
|
|
149
151
|
threadConversation,
|
|
150
152
|
validateAst,
|
|
151
153
|
validateFields
|
|
152
|
-
} from "./chunk-
|
|
154
|
+
} from "./chunk-J6USEBA6.js";
|
|
153
155
|
import {
|
|
154
156
|
EVENT_QUERY,
|
|
155
157
|
MEETING_PROJECT_EVIDENCE_QUERY,
|
|
@@ -194,27 +196,27 @@ import {
|
|
|
194
196
|
validateQuery,
|
|
195
197
|
walkQuery,
|
|
196
198
|
zonedMoment
|
|
197
|
-
} from "./chunk-
|
|
199
|
+
} from "./chunk-HNN7EKIM.js";
|
|
198
200
|
import {
|
|
199
201
|
DEFAULT_STEMMERS,
|
|
200
202
|
createStemmer,
|
|
201
203
|
fold,
|
|
202
204
|
normalize
|
|
203
|
-
} from "./chunk-
|
|
205
|
+
} from "./chunk-VVA4555T.js";
|
|
204
206
|
import {
|
|
205
207
|
DEFAULT_TASK_CATEGORIES,
|
|
206
208
|
FALLBACK_CATEGORY
|
|
207
|
-
} from "./chunk-
|
|
209
|
+
} from "./chunk-VDATXIO4.js";
|
|
208
210
|
import {
|
|
209
211
|
storePath,
|
|
210
212
|
wirecatDirectory
|
|
211
|
-
} from "./chunk-
|
|
213
|
+
} from "./chunk-PHYDBR5M.js";
|
|
212
214
|
import {
|
|
213
215
|
resolvePaths,
|
|
214
216
|
singleLine,
|
|
215
217
|
visibleControls,
|
|
216
218
|
writeSecurely
|
|
217
|
-
} from "./chunk-
|
|
219
|
+
} from "./chunk-KQ23JWLJ.js";
|
|
218
220
|
import {
|
|
219
221
|
CliError,
|
|
220
222
|
array,
|
|
@@ -239,7 +241,7 @@ import {
|
|
|
239
241
|
string,
|
|
240
242
|
transform,
|
|
241
243
|
unknown
|
|
242
|
-
} from "./chunk-
|
|
244
|
+
} from "./chunk-PCRLXJRH.js";
|
|
243
245
|
import {
|
|
244
246
|
importFrom,
|
|
245
247
|
resolveFrom
|
|
@@ -16859,7 +16861,7 @@ var require_lib3 = __commonJS({
|
|
|
16859
16861
|
}
|
|
16860
16862
|
});
|
|
16861
16863
|
|
|
16862
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
16864
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.544.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.73.0_commander@15._14d279ae6bc0fc41a3606e009c109ba5/node_modules/@wirecat/cli-core/dist/conversations/link.js
|
|
16863
16865
|
var RULES_VERSION = 5;
|
|
16864
16866
|
var LOOK_BACK = 50;
|
|
16865
16867
|
var SAME_SENDER_WITHIN = 10;
|
|
@@ -16949,15 +16951,15 @@ var latest = /* @__PURE__ */ __name((window3, matches) => {
|
|
|
16949
16951
|
var sameThread = /* @__PURE__ */ __name((a, b) => a.threadId === b.threadId, "sameThread");
|
|
16950
16952
|
var link = /* @__PURE__ */ __name((message, parentId, source, kind, confidence, method) => ({ messageId: message.id, parentId, source, kind, confidence, method }), "link");
|
|
16951
16953
|
|
|
16952
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
16954
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.544.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.73.0_commander@15._14d279ae6bc0fc41a3606e009c109ba5/node_modules/@wirecat/cli-core/dist/ports/traits.js
|
|
16953
16955
|
var syncsOneChat = /* @__PURE__ */ __name((messenger) => messenger.history !== "store" || messenger.historyOnDemand === true, "syncsOneChat");
|
|
16954
16956
|
|
|
16955
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
16957
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.544.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.73.0_commander@15._14d279ae6bc0fc41a3606e009c109ba5/node_modules/@wirecat/cli-core/dist/sends/send-id.js
|
|
16956
16958
|
import { randomBytes } from "node:crypto";
|
|
16957
16959
|
var newSendId = /* @__PURE__ */ __name(() => randomBytes(8).readBigInt64BE().toString(), "newSendId");
|
|
16958
16960
|
var newOperationId = newSendId;
|
|
16959
16961
|
|
|
16960
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
16962
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.544.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.73.0_commander@15._14d279ae6bc0fc41a3606e009c109ba5/node_modules/@wirecat/cli-core/dist/sends/upload.js
|
|
16961
16963
|
import { openAsBlob, realpathSync } from "node:fs";
|
|
16962
16964
|
import { open, stat } from "node:fs/promises";
|
|
16963
16965
|
import { basename, dirname, extname, isAbsolute, relative, resolve, sep } from "node:path";
|
|
@@ -17178,7 +17180,7 @@ var readStickerFile = /* @__PURE__ */ __name(async (path, maxBytes, read) => {
|
|
|
17178
17180
|
return { name, source };
|
|
17179
17181
|
}, "readStickerFile");
|
|
17180
17182
|
|
|
17181
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
17183
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.544.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.73.0_commander@15._14d279ae6bc0fc41a3606e009c109ba5/node_modules/@wirecat/cli-core/dist/cli/messenger/lacks.js
|
|
17182
17184
|
var COMMAND_NEEDS = {
|
|
17183
17185
|
"account update": ["updateProfile", "change the profile"],
|
|
17184
17186
|
"account sessions list": ["sessions", "list the account's sessions"],
|
|
@@ -17228,7 +17230,7 @@ var hideNever = /* @__PURE__ */ __name((messenger, group) => {
|
|
|
17228
17230
|
return group;
|
|
17229
17231
|
}, "hideNever");
|
|
17230
17232
|
|
|
17231
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
17233
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.544.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.73.0_commander@15._14d279ae6bc0fc41a3606e009c109ba5/node_modules/@wirecat/cli-core/dist/services/members-audit.js
|
|
17232
17234
|
var AUDIT_PAGE = 200;
|
|
17233
17235
|
var AUDIT_BUDGET = 10;
|
|
17234
17236
|
var AUDIT_PAUSE_MS = 1e3;
|
|
@@ -17308,7 +17310,7 @@ var burstJoins = /* @__PURE__ */ __name((members) => {
|
|
|
17308
17310
|
return found;
|
|
17309
17311
|
}, "burstJoins");
|
|
17310
17312
|
|
|
17311
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
17313
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.544.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.73.0_commander@15._14d279ae6bc0fc41a3606e009c109ba5/node_modules/@wirecat/cli-core/dist/meetings/cli/query-options.js
|
|
17312
17314
|
var queryWordsAfterOptions = /* @__PURE__ */ __name((command) => {
|
|
17313
17315
|
command.allowUnknownOption();
|
|
17314
17316
|
const parse = command.parseOptions.bind(command);
|
|
@@ -17328,7 +17330,7 @@ var queryWordsAfterOptions = /* @__PURE__ */ __name((command) => {
|
|
|
17328
17330
|
return command;
|
|
17329
17331
|
}, "queryWordsAfterOptions");
|
|
17330
17332
|
|
|
17331
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
17333
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.544.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.73.0_commander@15._14d279ae6bc0fc41a3606e009c109ba5/node_modules/@wirecat/cli-core/dist/meetings/cli/passage.js
|
|
17332
17334
|
var count = /* @__PURE__ */ __name((value) => {
|
|
17333
17335
|
if (!/^(0|[1-9]\d*)$/.test(value) || !Number.isSafeInteger(Number(value)))
|
|
17334
17336
|
throw new CliError("validation_error", "expected a nonnegative safe integer");
|
|
@@ -17370,7 +17372,7 @@ var addMeetingPassageCommandDefinition = /* @__PURE__ */ __name((program, deps)
|
|
|
17370
17372
|
var createMeetingPassageCommand = sharedCommand(createMeetingPassageCommandDefinition);
|
|
17371
17373
|
var addMeetingPassageCommand = sharedCommand(addMeetingPassageCommandDefinition);
|
|
17372
17374
|
|
|
17373
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
17375
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.544.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.73.0_commander@15._14d279ae6bc0fc41a3606e009c109ba5/node_modules/@wirecat/cli-core/dist/meetings/cli/project-evidence.js
|
|
17374
17376
|
var integer2 = /* @__PURE__ */ __name((value) => {
|
|
17375
17377
|
if (!/^[1-9]\d*$/.test(value) || !Number.isSafeInteger(Number(value)))
|
|
17376
17378
|
throw new CliError("validation_error", "expected a positive safe integer");
|
|
@@ -17393,7 +17395,7 @@ ${fieldsHelp(MEETING_PROJECT_EVIDENCE_QUERY)}`).option("--limit <n>", "hits in o
|
|
|
17393
17395
|
}, "addMeetingProjectEvidenceCommandDefinition");
|
|
17394
17396
|
var addMeetingProjectEvidenceCommand = sharedCommand(addMeetingProjectEvidenceCommandDefinition);
|
|
17395
17397
|
|
|
17396
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
17398
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.544.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.73.0_commander@15._14d279ae6bc0fc41a3606e009c109ba5/node_modules/@wirecat/cli-core/dist/meetings/cli/search.js
|
|
17397
17399
|
var ZONED = /(?:Z|[+-]\d{2}:?\d{2})$/i;
|
|
17398
17400
|
var moment = /* @__PURE__ */ __name((flag, end, readIn) => (value) => {
|
|
17399
17401
|
const zone = timezoneOf();
|
|
@@ -17479,7 +17481,7 @@ var addMeetingSearchCommandDefinition = /* @__PURE__ */ __name((program, deps) =
|
|
|
17479
17481
|
var createMeetingSearchCommand = sharedCommand(createMeetingSearchCommandDefinition);
|
|
17480
17482
|
var addMeetingSearchCommand = sharedCommand(addMeetingSearchCommandDefinition);
|
|
17481
17483
|
|
|
17482
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
17484
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.544.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.73.0_commander@15._14d279ae6bc0fc41a3606e009c109ba5/node_modules/@wirecat/cli-core/dist/meetings/cli/index.js
|
|
17483
17485
|
var integer4 = /* @__PURE__ */ __name((text2) => {
|
|
17484
17486
|
if (!/^[1-9]\d*$/.test(text2) || !Number.isSafeInteger(Number(text2)))
|
|
17485
17487
|
throw new InvalidArgumentError("expected a positive integer");
|
|
@@ -17599,13 +17601,14 @@ ${fieldsHelp(EVENT_QUERY, MEETING_QUERY_GUIDE)}`);
|
|
|
17599
17601
|
}, "addMeetingCommandsDefinition");
|
|
17600
17602
|
var addMeetingCommands = sharedCommand(addMeetingCommandsDefinition);
|
|
17601
17603
|
|
|
17602
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
17604
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.544.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.73.0_commander@15._14d279ae6bc0fc41a3606e009c109ba5/node_modules/@wirecat/cli-core/dist/cli/list-query.js
|
|
17603
17605
|
var LIST_QUERY_GUIDE = "https://github.com/WireCatLabs/cli-core/blob/main/docs/search/query-language.md";
|
|
17606
|
+
var QUERY_ARGUMENT = "field:value terms that narrow the list \u2014 the fields are below";
|
|
17604
17607
|
var withQuery = /* @__PURE__ */ __name((command, registry) => {
|
|
17605
17608
|
const query = defineQuery(registry);
|
|
17606
17609
|
annotate(command, { query, output: { entity: registry.entity } });
|
|
17607
17610
|
const shown = askable(query);
|
|
17608
|
-
queryWordsAfterOptions(command).argument("[query...]", shown.length > 0 ?
|
|
17611
|
+
queryWordsAfterOptions(command).argument("[query...]", shown.length > 0 ? QUERY_ARGUMENT : "field:value terms; this list filters by none yet");
|
|
17609
17612
|
if (shown.length > 0)
|
|
17610
17613
|
command.addHelpText("after", `
|
|
17611
17614
|
${fieldsHelp({ ...query, fields: shown }, LIST_QUERY_GUIDE)}`);
|
|
@@ -17616,9 +17619,19 @@ var unfilteredQuery = /* @__PURE__ */ __name((entity, schema2) => ({
|
|
|
17616
17619
|
backend: "native",
|
|
17617
17620
|
fields: queryFieldsOf(schema2, {})
|
|
17618
17621
|
}), "unfilteredQuery");
|
|
17622
|
+
var withTomorrow = /* @__PURE__ */ __name((query, registry, zone = timezoneOf(), now = Date.now()) => {
|
|
17623
|
+
const times = new Set(registry.fields.filter(({ type }) => type === "time").map(({ name }) => name));
|
|
17624
|
+
const date2 = /* @__PURE__ */ new Date(`${new Intl.DateTimeFormat("en-CA", { timeZone: zone }).format(now)}T00:00:00Z`);
|
|
17625
|
+
date2.setUTCDate(date2.getUTCDate() + 1);
|
|
17626
|
+
const tomorrow = date2.toISOString().slice(0, 10);
|
|
17627
|
+
const day = /* @__PURE__ */ __name((value) => value.toLowerCase() === "tomorrow" ? tomorrow : value, "day");
|
|
17628
|
+
const map = /* @__PURE__ */ __name((node) => node.kind === "predicate" ? times.has(node.field) ? { ...node, value: day(node.value), ...node.upper === void 0 ? {} : { upper: day(node.upper) } } : node : { ...node, clauses: node.clauses.map((clause) => ({ ...clause, node: map(clause.node) })) }, "map");
|
|
17629
|
+
return { ...query, root: map(query.root) };
|
|
17630
|
+
}, "withTomorrow");
|
|
17619
17631
|
var listQuery = /* @__PURE__ */ __name((text2, registry, command, { defaultField = "none" } = {}) => {
|
|
17620
17632
|
const context2 = { command, guide: LIST_QUERY_GUIDE };
|
|
17621
|
-
const
|
|
17633
|
+
const parsed = text2.trim() === "" ? void 0 : parseLucene(text2, { defaultField, ...context2 });
|
|
17634
|
+
const typed = parsed && withTomorrow(parsed, registry);
|
|
17622
17635
|
if (typed)
|
|
17623
17636
|
validateQuery(typed, registry, context2);
|
|
17624
17637
|
const named2 = typed ? fieldsNamed(typed) : /* @__PURE__ */ new Set();
|
|
@@ -17650,7 +17663,7 @@ var pagedList = /* @__PURE__ */ __name((command, { limit, page, all }, { items,
|
|
|
17650
17663
|
}), "pagedList");
|
|
17651
17664
|
var askable = /* @__PURE__ */ __name((registry) => registry.backend === "native" ? registry.fields.filter((field) => field.native) : registry.fields, "askable");
|
|
17652
17665
|
var nativeTerms = /* @__PURE__ */ __name((ast, command) => new Map([...nativeTermLists(ast, command)].map(([field, [node]]) => [field, node])), "nativeTerms");
|
|
17653
|
-
var nativeTermLists = /* @__PURE__ */ __name((ast, command, repeatable = []) => {
|
|
17666
|
+
var nativeTermLists = /* @__PURE__ */ __name((ast, command, repeatable = [], negatable = []) => {
|
|
17654
17667
|
const terms = /* @__PURE__ */ new Map();
|
|
17655
17668
|
if (!ast)
|
|
17656
17669
|
return terms;
|
|
@@ -17658,8 +17671,14 @@ var nativeTermLists = /* @__PURE__ */ __name((ast, command, repeatable = []) =>
|
|
|
17658
17671
|
const add = /* @__PURE__ */ __name((node) => {
|
|
17659
17672
|
if (node.kind === "boolean") {
|
|
17660
17673
|
for (const clause of node.clauses) {
|
|
17674
|
+
const excluded = clause.occur === "must_not" && clause.node.kind === "predicate" && negatable.includes(clause.node.field);
|
|
17675
|
+
if (excluded && clause.node.kind === "predicate") {
|
|
17676
|
+
const key = `-${clause.node.field}`;
|
|
17677
|
+
terms.set(key, [...terms.get(key) ?? [], clause.node]);
|
|
17678
|
+
continue;
|
|
17679
|
+
}
|
|
17661
17680
|
if (clause.occur !== "must")
|
|
17662
|
-
queryError("query.unsupported-placement", clause.node.span, "this list takes only field:value terms joined by AND", context2);
|
|
17681
|
+
queryError("query.unsupported-placement", clause.node.span, negatable.length ? `this list takes only field:value terms joined by AND, and -field:value for ${negatable.join(", ")}` : "this list takes only field:value terms joined by AND", context2);
|
|
17663
17682
|
add(clause.node);
|
|
17664
17683
|
}
|
|
17665
17684
|
return;
|
|
@@ -17715,7 +17734,7 @@ var termField = /* @__PURE__ */ __name((name, type, example, more = {}) => nativ
|
|
|
17715
17734
|
var queryHelp = /* @__PURE__ */ __name((registry) => `
|
|
17716
17735
|
${fieldsHelp(registry, LIST_QUERY_GUIDE)}`, "queryHelp");
|
|
17717
17736
|
|
|
17718
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
17737
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.544.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.73.0_commander@15._14d279ae6bc0fc41a3606e009c109ba5/node_modules/@wirecat/cli-core/dist/cli/paging.js
|
|
17719
17738
|
var positiveCount = /* @__PURE__ */ __name((flag) => (value) => {
|
|
17720
17739
|
if (!/^\d+$/.test(value.trim()) || Number(value) < 1)
|
|
17721
17740
|
throw new CliError("validation_error", `${flag} takes a whole number from 1 upwards, not "${value}"`);
|
|
@@ -17724,7 +17743,7 @@ var positiveCount = /* @__PURE__ */ __name((flag) => (value) => {
|
|
|
17724
17743
|
var withPaging = /* @__PURE__ */ __name((command) => command.option("--limit <n>", "how many to show", positiveCount("--limit")).option("--page <n>", "which page, starting at 1", positiveCount("--page")).option("--all", "every row, no paging"), "withPaging");
|
|
17725
17744
|
var window = /* @__PURE__ */ __name(({ limit, page, all }) => all ? { offset: 0 } : { limit, offset: (page - 1) * limit }, "window");
|
|
17726
17745
|
|
|
17727
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
17746
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.544.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.73.0_commander@15._14d279ae6bc0fc41a3606e009c109ba5/node_modules/@wirecat/cli-core/dist/cli/messenger/chat-answers.js
|
|
17728
17747
|
var defined = /* @__PURE__ */ __name((record2) => Object.fromEntries(Object.entries(record2).filter(([, value]) => value !== void 0)), "defined");
|
|
17729
17748
|
var chatRef = /* @__PURE__ */ __name((account, chat) => formatReference({ type: "chat", provider: account.provider, account: account.account, chat }), "chatRef");
|
|
17730
17749
|
var settingsOf = /* @__PURE__ */ __name((settings) => defined({
|
|
@@ -17986,7 +18005,7 @@ var sessionAnswer = /* @__PURE__ */ __name(({ current, client, device, location,
|
|
|
17986
18005
|
...createdAt === void 0 ? {} : { created_at: createdAt }
|
|
17987
18006
|
}), "sessionAnswer");
|
|
17988
18007
|
|
|
17989
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
18008
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.544.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.73.0_commander@15._14d279ae6bc0fc41a3606e009c109ba5/node_modules/@wirecat/cli-core/dist/services/deps.js
|
|
17990
18009
|
var accountStore = /* @__PURE__ */ __name(async (deps) => (await deps.store()).forAccount(await deps.account()), "accountStore");
|
|
17991
18010
|
var crossAccount = /* @__PURE__ */ __name((deps, _reason) => deps.store(), "crossAccount");
|
|
17992
18011
|
var NO_LOCAL_STORE = "this answer comes from the messenger, not from the local store";
|
|
@@ -18021,7 +18040,7 @@ var storeIfOpen = /* @__PURE__ */ __name(async (deps) => {
|
|
|
18021
18040
|
var fromStore = /* @__PURE__ */ __name((deps) => deps.offline || deps.reads === "store", "fromStore");
|
|
18022
18041
|
var nothingStored = /* @__PURE__ */ __name((messenger) => `nothing stored for this chat yet \u2014 keep \`${typedCommand(messenger.app.command, "serve")}\` running`, "nothingStored");
|
|
18023
18042
|
var PUSHED = "this messenger's history is read from the local store";
|
|
18024
|
-
var OFFLINE = "--offline answers only from what is kept locally: `chats list|show`, `messages list|show|context`, `contacts list|show` and `review`";
|
|
18043
|
+
var OFFLINE = "--offline answers only from what is kept locally: `chats list|show`, `messages list|show|context|download`, `contacts list|show` and `review`";
|
|
18025
18044
|
var onlineDeps = /* @__PURE__ */ __name((messenger, adapter, guard, where = {}) => ({
|
|
18026
18045
|
messenger,
|
|
18027
18046
|
...where,
|
|
@@ -18051,7 +18070,7 @@ var storedDeps = /* @__PURE__ */ __name((messenger, store, account, guard) => ({
|
|
|
18051
18070
|
}), "storedDeps");
|
|
18052
18071
|
var storeModeDeps = /* @__PURE__ */ __name((messenger, store, account, guard) => ({ ...storedDeps(messenger, store, account, guard), offline: false, reads: "store" }), "storeModeDeps");
|
|
18053
18072
|
|
|
18054
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
18073
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.544.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.73.0_commander@15._14d279ae6bc0fc41a3606e009c109ba5/node_modules/@wirecat/cli-core/dist/resolve.js
|
|
18055
18074
|
var isId = /* @__PURE__ */ __name((reference) => /^-?\d+$/.test(reference.trim()), "isId");
|
|
18056
18075
|
var foldName = /* @__PURE__ */ __name((name) => name.normalize("NFC").replace(/[\uFE0E\uFE0F\u200D]/g, "").toLowerCase(), "foldName");
|
|
18057
18076
|
var pickChat = /* @__PURE__ */ __name((reference, chats) => {
|
|
@@ -18089,7 +18108,7 @@ ${lines3}`, { candidates });
|
|
|
18089
18108
|
}, "ambiguous");
|
|
18090
18109
|
var isPresent = /* @__PURE__ */ __name((value) => value !== null && value !== void 0, "isPresent");
|
|
18091
18110
|
|
|
18092
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
18111
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.544.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.73.0_commander@15._14d279ae6bc0fc41a3606e009c109ba5/node_modules/@wirecat/cli-core/dist/ports/messenger.js
|
|
18093
18112
|
var throughWrapper = /* @__PURE__ */ __name((inner, handled, wrap = (_, call) => call) => new Proxy(handled, {
|
|
18094
18113
|
get: /* @__PURE__ */ __name((own, key) => {
|
|
18095
18114
|
if (key in own)
|
|
@@ -18106,7 +18125,7 @@ var capability = /* @__PURE__ */ __name((adapter, method, what) => {
|
|
|
18106
18125
|
return found.bind(adapter);
|
|
18107
18126
|
}, "capability");
|
|
18108
18127
|
|
|
18109
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
18128
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.544.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.73.0_commander@15._14d279ae6bc0fc41a3606e009c109ba5/node_modules/@wirecat/cli-core/dist/services/moment.js
|
|
18110
18129
|
var AGO = /^(\d+)(m|h|d)$/;
|
|
18111
18130
|
var AGO_MS = { m: 6e4, h: 36e5, d: 864e5 };
|
|
18112
18131
|
var DATE = /^\d{4}-\d{2}-\d{2}/;
|
|
@@ -18146,7 +18165,7 @@ var dateWindow = /* @__PURE__ */ __name(({ sinceTime, untilTime, zone, now = Dat
|
|
|
18146
18165
|
};
|
|
18147
18166
|
}, "dateWindow");
|
|
18148
18167
|
|
|
18149
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
18168
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.544.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.73.0_commander@15._14d279ae6bc0fc41a3606e009c109ba5/node_modules/@wirecat/cli-core/dist/services/questions.js
|
|
18150
18169
|
var LINKS = /https?:\/\/\S+/g;
|
|
18151
18170
|
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");
|
|
18152
18171
|
var questions = /* @__PURE__ */ __name((messages, { answerers: answerers2 }) => {
|
|
@@ -18173,7 +18192,7 @@ var questions = /* @__PURE__ */ __name((messages, { answerers: answerers2 }) =>
|
|
|
18173
18192
|
});
|
|
18174
18193
|
}, "questions");
|
|
18175
18194
|
|
|
18176
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
18195
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.544.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.73.0_commander@15._14d279ae6bc0fc41a3606e009c109ba5/node_modules/@wirecat/cli-core/dist/services/task-categories.js
|
|
18177
18196
|
var names = /* @__PURE__ */ __name((categories) => categories.map(({ name }) => name).join(", "), "names");
|
|
18178
18197
|
var taskCategoryOf = /* @__PURE__ */ __name((categories = DEFAULT_TASK_CATEGORIES, flag = "--category") => (typed) => {
|
|
18179
18198
|
const name = typed.trim().toLowerCase();
|
|
@@ -18223,7 +18242,7 @@ var categorize = /* @__PURE__ */ __name((text2, categories = DEFAULT_TASK_CATEGO
|
|
|
18223
18242
|
return best.name;
|
|
18224
18243
|
}, "categorize");
|
|
18225
18244
|
|
|
18226
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
18245
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.544.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.73.0_commander@15._14d279ae6bc0fc41a3606e009c109ba5/node_modules/@wirecat/cli-core/dist/services/task-rules.js
|
|
18227
18246
|
var taskAccount = /* @__PURE__ */ __name(({ provider, account }) => `${provider}:${account}`, "taskAccount");
|
|
18228
18247
|
var RULES_IN = {
|
|
18229
18248
|
dialog: "all",
|
|
@@ -18429,7 +18448,7 @@ var applyTaskRulesToChats = /* @__PURE__ */ __name(async (store, account, chatId
|
|
|
18429
18448
|
return passes;
|
|
18430
18449
|
}, "applyTaskRulesToChats");
|
|
18431
18450
|
|
|
18432
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
18451
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.544.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.73.0_commander@15._14d279ae6bc0fc41a3606e009c109ba5/node_modules/@wirecat/cli-core/dist/botcheck/check.js
|
|
18433
18452
|
var DAY_MS = 864e5;
|
|
18434
18453
|
var NEW_DAYS = 30;
|
|
18435
18454
|
var SAME_TEXT_MIN = 20;
|
|
@@ -18506,7 +18525,7 @@ var scorePerson = /* @__PURE__ */ __name(({ subject, provider, activity, photos,
|
|
|
18506
18525
|
};
|
|
18507
18526
|
}, "scorePerson");
|
|
18508
18527
|
|
|
18509
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
18528
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.544.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.73.0_commander@15._14d279ae6bc0fc41a3606e009c109ba5/node_modules/@wirecat/cli-core/dist/botcheck/registries.js
|
|
18510
18529
|
var REGISTRIES = {
|
|
18511
18530
|
cas: { title: "Combot Anti-Spam (CAS)", docs: "https://cas.chat/api" },
|
|
18512
18531
|
lols: { title: "lols.bot", docs: "https://api.lols.bot/lols-bot.json" }
|
|
@@ -18591,7 +18610,7 @@ var notCovered = /* @__PURE__ */ __name((messenger, now = /* @__PURE__ */ new Da
|
|
|
18591
18610
|
detail: `lists Telegram accounts only, not ${messenger} ones`
|
|
18592
18611
|
})), "notCovered");
|
|
18593
18612
|
|
|
18594
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
18613
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.544.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.73.0_commander@15._14d279ae6bc0fc41a3606e009c109ba5/node_modules/@wirecat/cli-core/dist/botcheck/service.js
|
|
18595
18614
|
var ACTIVITY_MESSAGES = 1e3;
|
|
18596
18615
|
var botCheckService = /* @__PURE__ */ __name((deps) => {
|
|
18597
18616
|
const subjectOf = /* @__PURE__ */ __name(async (reference) => {
|
|
@@ -18679,7 +18698,7 @@ var botCheckService = /* @__PURE__ */ __name((deps) => {
|
|
|
18679
18698
|
};
|
|
18680
18699
|
}, "botCheckService");
|
|
18681
18700
|
|
|
18682
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
18701
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.544.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.73.0_commander@15._14d279ae6bc0fc41a3606e009c109ba5/node_modules/@wirecat/cli-core/dist/domain/thread.js
|
|
18683
18702
|
var threadIdOf = /* @__PURE__ */ __name((value) => {
|
|
18684
18703
|
if (value === void 0)
|
|
18685
18704
|
return void 0;
|
|
@@ -18689,7 +18708,7 @@ var threadIdOf = /* @__PURE__ */ __name((value) => {
|
|
|
18689
18708
|
return id2;
|
|
18690
18709
|
}, "threadIdOf");
|
|
18691
18710
|
|
|
18692
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
18711
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.544.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.73.0_commander@15._14d279ae6bc0fc41a3606e009c109ba5/node_modules/@wirecat/cli-core/dist/services/chat-stats.js
|
|
18693
18712
|
var TOP_POSTS = 5;
|
|
18694
18713
|
var JOINS = /* @__PURE__ */ new Set(["join", "add"]);
|
|
18695
18714
|
var LEAVES = /* @__PURE__ */ new Set(["leave", "remove"]);
|
|
@@ -18806,7 +18825,7 @@ var median = /* @__PURE__ */ __name((values) => {
|
|
|
18806
18825
|
return Math.round(sorted.length % 2 === 0 ? ((sorted[middle - 1] ?? upper) + upper) / 2 : upper);
|
|
18807
18826
|
}, "median");
|
|
18808
18827
|
|
|
18809
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
18828
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.544.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.73.0_commander@15._14d279ae6bc0fc41a3606e009c109ba5/node_modules/@wirecat/cli-core/dist/services/member-history.js
|
|
18810
18829
|
var memberEvents = /* @__PURE__ */ __name((stays, revisions, since = 0) => {
|
|
18811
18830
|
const events = [];
|
|
18812
18831
|
for (const stay of stays) {
|
|
@@ -18838,7 +18857,7 @@ var memberEvents = /* @__PURE__ */ __name((stays, revisions, since = 0) => {
|
|
|
18838
18857
|
return events.filter(({ at }) => Date.parse(at) >= since).sort((a, b) => Date.parse(a.at) - Date.parse(b.at) || a.id.localeCompare(b.id));
|
|
18839
18858
|
}, "memberEvents");
|
|
18840
18859
|
|
|
18841
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
18860
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.544.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.73.0_commander@15._14d279ae6bc0fc41a3606e009c109ba5/node_modules/@wirecat/cli-core/dist/services/message-resolution.js
|
|
18842
18861
|
var readChatId = /* @__PURE__ */ __name(async (deps, reference, store, account) => {
|
|
18843
18862
|
if (deps.reads !== "store")
|
|
18844
18863
|
return keptChatId(deps.messenger, reference, store, account);
|
|
@@ -18985,7 +19004,7 @@ var senderAmong = /* @__PURE__ */ __name(async (store, accounts, reference) => {
|
|
|
18985
19004
|
}
|
|
18986
19005
|
}, "senderAmong");
|
|
18987
19006
|
|
|
18988
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
19007
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.544.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.73.0_commander@15._14d279ae6bc0fc41a3606e009c109ba5/node_modules/@wirecat/cli-core/dist/services/chats.js
|
|
18989
19008
|
var EVENTS_DAYS = 7;
|
|
18990
19009
|
var TRACKED_DAYS = 30;
|
|
18991
19010
|
var STATS_PAGE = 1e3;
|
|
@@ -19280,7 +19299,7 @@ var storedMembers = /* @__PURE__ */ __name(async (store, chatId) => {
|
|
|
19280
19299
|
return members.length === 0 ? null : members;
|
|
19281
19300
|
}, "storedMembers");
|
|
19282
19301
|
|
|
19283
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
19302
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.544.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.73.0_commander@15._14d279ae6bc0fc41a3606e009c109ba5/node_modules/@wirecat/cli-core/dist/services/inbox.js
|
|
19284
19303
|
var INBOX_CHATS = 20;
|
|
19285
19304
|
var REVIEW_DAYS = 3;
|
|
19286
19305
|
var UNANSWERED_HOURS = 24;
|
|
@@ -19488,7 +19507,7 @@ var inboxService = /* @__PURE__ */ __name((deps) => {
|
|
|
19488
19507
|
};
|
|
19489
19508
|
}, "inboxService");
|
|
19490
19509
|
|
|
19491
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
19510
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.544.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.73.0_commander@15._14d279ae6bc0fc41a3606e009c109ba5/node_modules/@wirecat/cli-core/dist/domain/formatting.js
|
|
19492
19511
|
var invalid = /* @__PURE__ */ __name(() => new CliError("validation_error", "the messenger formatter returned invalid text spans"), "invalid");
|
|
19493
19512
|
var validateFormattedText = /* @__PURE__ */ __name((formatted2) => {
|
|
19494
19513
|
const { text: text2, spans } = formatted2;
|
|
@@ -19548,7 +19567,7 @@ var visibleFormattedText = /* @__PURE__ */ __name((formatted2) => {
|
|
|
19548
19567
|
};
|
|
19549
19568
|
}, "visibleFormattedText");
|
|
19550
19569
|
|
|
19551
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
19570
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.544.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.73.0_commander@15._14d279ae6bc0fc41a3606e009c109ba5/node_modules/@wirecat/cli-core/dist/moderation/check.js
|
|
19552
19571
|
var INVITE = /max\.ru\/join\/|(t|telegram)\.me\/(\+|joinchat\/)|tg:\/\/join/i;
|
|
19553
19572
|
var LINK2 = /https?:\/\/\S+/i;
|
|
19554
19573
|
var STRENGTH = { report: 0, delete: 1, remove: 2 };
|
|
@@ -19736,7 +19755,7 @@ var nextPoint = /* @__PURE__ */ __name((rows, found) => {
|
|
|
19736
19755
|
}, "nextPoint");
|
|
19737
19756
|
var someUndone = /* @__PURE__ */ __name((rows) => rows.some(undone), "someUndone");
|
|
19738
19757
|
|
|
19739
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
19758
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.544.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.73.0_commander@15._14d279ae6bc0fc41a3606e009c109ba5/node_modules/@wirecat/cli-core/dist/moderation/rules.js
|
|
19740
19759
|
import { existsSync, readFileSync } from "node:fs";
|
|
19741
19760
|
import { join } from "node:path";
|
|
19742
19761
|
var RULE_ACTIONS = ["report", "delete", "remove"];
|
|
@@ -19879,7 +19898,7 @@ var assign = /* @__PURE__ */ __name((rules, key, value) => {
|
|
|
19879
19898
|
return { ...rules, [head]: { ...rules[head], [tail]: value } };
|
|
19880
19899
|
}, "assign");
|
|
19881
19900
|
|
|
19882
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
19901
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.544.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.73.0_commander@15._14d279ae6bc0fc41a3606e009c109ba5/node_modules/@wirecat/cli-core/dist/services/person-context.js
|
|
19883
19902
|
var CONTEXT_MESSAGES = 10;
|
|
19884
19903
|
var CONTEXT_BYTES = 64 * 1024;
|
|
19885
19904
|
var toContext = /* @__PURE__ */ __name((key, message, chatTitle) => ({
|
|
@@ -19956,11 +19975,17 @@ var eventsOnce = /* @__PURE__ */ __name(async (store, filter, limit) => {
|
|
|
19956
19975
|
return { items, cut: true };
|
|
19957
19976
|
}, "eventsOnce");
|
|
19958
19977
|
var readsOf = /* @__PURE__ */ __name((record2, asked) => record2.identities.flatMap((identity) => (identity.provider === asked.provider ? [asked.account] : identity.accounts).filter((account) => identity.accounts.includes(account)).map((account) => ({ key: { provider: identity.provider, account }, identity }))), "readsOf");
|
|
19959
|
-
var personContext = /* @__PURE__ */ __name(async (store, asked, reference,
|
|
19978
|
+
var personContext = /* @__PURE__ */ __name(async (store, asked, reference, options = {}) => {
|
|
19960
19979
|
const found = pickPerson(reference, await store.people.people(asked.provider, { account: asked.account }));
|
|
19961
19980
|
const record2 = await store.people.personOf({ provider: asked.provider, id: found.id });
|
|
19962
19981
|
if (!record2)
|
|
19963
19982
|
throw new CliError("not_found", `no person ${found.id} in the store`);
|
|
19983
|
+
return {
|
|
19984
|
+
person: { ...record2, provider: asked.provider, id: found.id },
|
|
19985
|
+
...await recordContext(store, record2, readsOf(record2, asked), options)
|
|
19986
|
+
};
|
|
19987
|
+
}, "personContext");
|
|
19988
|
+
var recordContext = /* @__PURE__ */ __name(async (store, record2, reads, { messages = CONTEXT_MESSAGES, bytes: bytes2 = CONTEXT_BYTES, since, now = Date.now() } = {}) => {
|
|
19964
19989
|
const recent = /* @__PURE__ */ __name((message) => since === void 0 || Date.parse(message.timestamp) >= since, "recent");
|
|
19965
19990
|
const shared = [];
|
|
19966
19991
|
const notRead = [];
|
|
@@ -19969,7 +19994,7 @@ var personContext = /* @__PURE__ */ __name(async (store, asked, reference, { mes
|
|
|
19969
19994
|
const theirs = [];
|
|
19970
19995
|
const mentions = [];
|
|
19971
19996
|
let cut = false;
|
|
19972
|
-
for (const { key, identity } of
|
|
19997
|
+
for (const { key, identity } of reads) {
|
|
19973
19998
|
const chats = await store.chats.chatsWith(key, identity.id);
|
|
19974
19999
|
for (const chat of chats) {
|
|
19975
20000
|
shared.push({ ...key, chatId: chat.id, title: chat.title, kind: chat.kind, lastMessageAt: chat.lastMessageAt });
|
|
@@ -20037,7 +20062,6 @@ var personContext = /* @__PURE__ */ __name(async (store, asked, reference, { mes
|
|
|
20037
20062
|
cut ||= direct.length > messages || groups.length > messages || mentions.length > messages;
|
|
20038
20063
|
const kept = withinBytes(lists, bytes2);
|
|
20039
20064
|
return {
|
|
20040
|
-
person: { ...record2, provider: asked.provider, id: found.id },
|
|
20041
20065
|
shared: shared.sort((a, b) => Date.parse(b.lastMessageAt ?? "") - Date.parse(a.lastMessageAt ?? "")),
|
|
20042
20066
|
last: {
|
|
20043
20067
|
fromThem: each.find((message) => !message.outgoing) ?? null,
|
|
@@ -20055,7 +20079,7 @@ var personContext = /* @__PURE__ */ __name(async (store, asked, reference, { mes
|
|
|
20055
20079
|
complete: notRead.length === 0,
|
|
20056
20080
|
notRead
|
|
20057
20081
|
};
|
|
20058
|
-
}, "
|
|
20082
|
+
}, "recordContext");
|
|
20059
20083
|
var withinBytes = /* @__PURE__ */ __name((lists, bytes2) => {
|
|
20060
20084
|
let used = 0;
|
|
20061
20085
|
let cut = false;
|
|
@@ -20135,10 +20159,10 @@ var personMessages = /* @__PURE__ */ __name(async (store, asked, reference, { ch
|
|
|
20135
20159
|
};
|
|
20136
20160
|
}, "personMessages");
|
|
20137
20161
|
|
|
20138
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
20162
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.544.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.73.0_commander@15._14d279ae6bc0fc41a3606e009c109ba5/node_modules/@wirecat/cli-core/dist/services/meeting-evidence.js
|
|
20139
20163
|
import { createHash } from "node:crypto";
|
|
20140
20164
|
|
|
20141
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
20165
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.544.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.73.0_commander@15._14d279ae6bc0fc41a3606e009c109ba5/node_modules/@wirecat/cli-core/dist/services/meeting-reference.js
|
|
20142
20166
|
var missing2 = /* @__PURE__ */ __name(() => new CliError("not_found", "the meeting evidence is unavailable for this account"), "missing");
|
|
20143
20167
|
var authorizedMeetingMetadata = /* @__PURE__ */ __name(async (store, accountId, reference, options = {}) => {
|
|
20144
20168
|
const parsed = parseMeetingReference(reference);
|
|
@@ -20156,7 +20180,7 @@ var authorizedMeetingMetadata = /* @__PURE__ */ __name(async (store, accountId,
|
|
|
20156
20180
|
return { parsed, meeting };
|
|
20157
20181
|
}, "authorizedMeetingMetadata");
|
|
20158
20182
|
|
|
20159
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
20183
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.544.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.73.0_commander@15._14d279ae6bc0fc41a3606e009c109ba5/node_modules/@wirecat/cli-core/dist/services/meeting-evidence.js
|
|
20160
20184
|
var hash = /* @__PURE__ */ __name((value) => createHash("sha256").update(JSON.stringify(value)).digest("hex"), "hash");
|
|
20161
20185
|
var checkMeetingCancelled = /* @__PURE__ */ __name((signal) => {
|
|
20162
20186
|
if (signal?.aborted)
|
|
@@ -20355,7 +20379,7 @@ var readMeetingEvidence = /* @__PURE__ */ __name(async (store, accountId, refere
|
|
|
20355
20379
|
return { ...packet, fingerprint: hash(packet) };
|
|
20356
20380
|
}, "readMeetingEvidence");
|
|
20357
20381
|
|
|
20358
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
20382
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.544.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.73.0_commander@15._14d279ae6bc0fc41a3606e009c109ba5/node_modules/@wirecat/cli-core/dist/services/person-meeting-context.js
|
|
20359
20383
|
var personMeetingContext = /* @__PURE__ */ __name(async (store, personReference, options) => {
|
|
20360
20384
|
const { meetings = 10, cues = 5, bytes: bytes2 = 64 * 1024, scanLimit = 1e3, since, signal } = options;
|
|
20361
20385
|
const requestedAccounts = options.accountIds;
|
|
@@ -20454,7 +20478,7 @@ var personMeetingContext = /* @__PURE__ */ __name(async (store, personReference,
|
|
|
20454
20478
|
};
|
|
20455
20479
|
}, "personMeetingContext");
|
|
20456
20480
|
|
|
20457
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
20481
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.544.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.73.0_commander@15._14d279ae6bc0fc41a3606e009c109ba5/node_modules/@wirecat/cli-core/dist/services/person-preparation.js
|
|
20458
20482
|
var PREPARE_BYTES = 96 * 1024;
|
|
20459
20483
|
var MEETINGS = 5;
|
|
20460
20484
|
var CUES = 3;
|
|
@@ -20571,7 +20595,7 @@ var meetingsOf = /* @__PURE__ */ __name(async (store, uid, stored, since, left)
|
|
|
20571
20595
|
}
|
|
20572
20596
|
}, "meetingsOf");
|
|
20573
20597
|
|
|
20574
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
20598
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.544.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.73.0_commander@15._14d279ae6bc0fc41a3606e009c109ba5/node_modules/@wirecat/cli-core/dist/services/person-profile.js
|
|
20575
20599
|
var personProfile = /* @__PURE__ */ __name(async (deps, person, known2) => {
|
|
20576
20600
|
const online = deps.offline ? void 0 : await deps.connection();
|
|
20577
20601
|
const held = await storeIfOpen(deps);
|
|
@@ -20641,7 +20665,7 @@ var quiet = /* @__PURE__ */ __name((facts) => facts.chats.map(({ id: id2, title,
|
|
|
20641
20665
|
complete: false
|
|
20642
20666
|
})), "quiet");
|
|
20643
20667
|
|
|
20644
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
20668
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.544.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.73.0_commander@15._14d279ae6bc0fc41a3606e009c109ba5/node_modules/@wirecat/cli-core/dist/services/person-timeline.js
|
|
20645
20669
|
var TIMELINE_ITEMS = 50;
|
|
20646
20670
|
var TIMELINE_MAX = 500;
|
|
20647
20671
|
var SCOPES = ["personal", "work"];
|
|
@@ -20696,7 +20720,7 @@ var personTimeline = /* @__PURE__ */ __name(async (store, asked, reference, { sc
|
|
|
20696
20720
|
};
|
|
20697
20721
|
}, "personTimeline");
|
|
20698
20722
|
|
|
20699
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
20723
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.544.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.73.0_commander@15._14d279ae6bc0fc41a3606e009c109ba5/node_modules/@wirecat/cli-core/dist/services/people.js
|
|
20700
20724
|
var peopleService = /* @__PURE__ */ __name((deps) => {
|
|
20701
20725
|
const localCard = /* @__PURE__ */ __name(async (card, includeNotes = false) => {
|
|
20702
20726
|
const held = await storeIfOpen(deps);
|
|
@@ -20923,7 +20947,7 @@ var withoutPhone = /* @__PURE__ */ __name((answer) => {
|
|
|
20923
20947
|
return rest;
|
|
20924
20948
|
}, "withoutPhone");
|
|
20925
20949
|
|
|
20926
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
20950
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.544.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.73.0_commander@15._14d279ae6bc0fc41a3606e009c109ba5/node_modules/@wirecat/cli-core/dist/services/task-tag-filters.js
|
|
20927
20951
|
var taskTagFilters = /* @__PURE__ */ __name(async (store, query) => {
|
|
20928
20952
|
const tags = /* @__PURE__ */ new Map();
|
|
20929
20953
|
for (const node of query ? walkQuery(query.root) : [])
|
|
@@ -20932,7 +20956,7 @@ var taskTagFilters = /* @__PURE__ */ __name(async (store, query) => {
|
|
|
20932
20956
|
return tags;
|
|
20933
20957
|
}, "taskTagFilters");
|
|
20934
20958
|
|
|
20935
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
20959
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.544.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.73.0_commander@15._14d279ae6bc0fc41a3606e009c109ba5/node_modules/@wirecat/cli-core/dist/services/tasks.js
|
|
20936
20960
|
var TASK_QUERY = {
|
|
20937
20961
|
entity: "task",
|
|
20938
20962
|
backend: "sql",
|
|
@@ -21117,7 +21141,7 @@ var tasksService = /* @__PURE__ */ __name((deps, categories) => {
|
|
|
21117
21141
|
...previews ? { previews: await Promise.all(shown.map(({ task: task2 }) => taskView(store, account, task2))) } : {}
|
|
21118
21142
|
};
|
|
21119
21143
|
}), "list"),
|
|
21120
|
-
add: /* @__PURE__ */ __name((message, type, origin, { category: named2, ...plan } = {}, choice = {}) => inStore(async (store, account) => {
|
|
21144
|
+
add: /* @__PURE__ */ __name((message, type, origin, { category: named2, ...plan } = {}, choice = {}, author = void 0) => inStore(async (store, account) => {
|
|
21121
21145
|
const chosen = named2 === void 0 ? void 0 : await categoryOf(store, named2);
|
|
21122
21146
|
const source = message.trim();
|
|
21123
21147
|
const native = isNoteReference(source);
|
|
@@ -21152,7 +21176,7 @@ var tasksService = /* @__PURE__ */ __name((deps, categories) => {
|
|
|
21152
21176
|
...plan.dueAt ? { due: plan.dueAt } : {}
|
|
21153
21177
|
};
|
|
21154
21178
|
const subject = { account: taskAccount(account), draft };
|
|
21155
|
-
const by = origin === "owner" ? "owner" : { bot: origin };
|
|
21179
|
+
const by = author ?? (origin === "owner" ? "owner" : { bot: origin });
|
|
21156
21180
|
if (choice.attach !== void 0) {
|
|
21157
21181
|
const target2 = await owned(store, account, choice.attach);
|
|
21158
21182
|
const similarity = await store.tasks.compare(subject, target2.id);
|
|
@@ -21412,7 +21436,7 @@ var taskView = /* @__PURE__ */ __name(async (store, account, task2) => {
|
|
|
21412
21436
|
};
|
|
21413
21437
|
}, "taskView");
|
|
21414
21438
|
|
|
21415
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
21439
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.544.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.73.0_commander@15._14d279ae6bc0fc41a3606e009c109ba5/node_modules/@wirecat/cli-core/dist/services/chat-coverage.js
|
|
21416
21440
|
var chatCoverage = /* @__PURE__ */ __name(async (store, account, chatIds) => {
|
|
21417
21441
|
const ids = [...new Set(chatIds)];
|
|
21418
21442
|
if (ids.length === 0)
|
|
@@ -21438,7 +21462,7 @@ var chatCoverage = /* @__PURE__ */ __name(async (store, account, chatIds) => {
|
|
|
21438
21462
|
}));
|
|
21439
21463
|
}, "chatCoverage");
|
|
21440
21464
|
|
|
21441
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
21465
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.544.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.73.0_commander@15._14d279ae6bc0fc41a3606e009c109ba5/node_modules/@wirecat/cli-core/dist/context/evidence-response.js
|
|
21442
21466
|
var contextSourceKey = /* @__PURE__ */ __name((source) => JSON.stringify([source.kind, source.accountId, source.provider, source.account]), "contextSourceKey");
|
|
21443
21467
|
var validateContextEvidencePage = /* @__PURE__ */ __name((page, request) => {
|
|
21444
21468
|
const fail2 = /* @__PURE__ */ __name(() => {
|
|
@@ -21502,7 +21526,7 @@ var validateContextEvidencePage = /* @__PURE__ */ __name((page, request) => {
|
|
|
21502
21526
|
}
|
|
21503
21527
|
}, "validateContextEvidencePage");
|
|
21504
21528
|
|
|
21505
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
21529
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.544.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.73.0_commander@15._14d279ae6bc0fc41a3606e009c109ba5/node_modules/@wirecat/cli-core/dist/context/read-budget.js
|
|
21506
21530
|
var contextReadBudget = /* @__PURE__ */ __name((limits = {}) => {
|
|
21507
21531
|
if (!limits || typeof limits !== "object" || Array.isArray(limits))
|
|
21508
21532
|
throw new CliError("validation_error", "limits needs a context read allowance");
|
|
@@ -21555,7 +21579,7 @@ var contextReadBudget = /* @__PURE__ */ __name((limits = {}) => {
|
|
|
21555
21579
|
};
|
|
21556
21580
|
}, "contextReadBudget");
|
|
21557
21581
|
|
|
21558
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
21582
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.544.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.73.0_commander@15._14d279ae6bc0fc41a3606e009c109ba5/node_modules/@wirecat/cli-core/dist/services/context-evidence.js
|
|
21559
21583
|
var createContextEvidenceReader = /* @__PURE__ */ __name((port, allowed, limits) => {
|
|
21560
21584
|
if (!port || typeof port.read !== "function")
|
|
21561
21585
|
throw new CliError("configuration_error", "context evidence reader is unavailable");
|
|
@@ -21599,7 +21623,7 @@ var createContextEvidenceReader = /* @__PURE__ */ __name((port, allowed, limits)
|
|
|
21599
21623
|
};
|
|
21600
21624
|
}, "createContextEvidenceReader");
|
|
21601
21625
|
|
|
21602
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
21626
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.544.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.73.0_commander@15._14d279ae6bc0fc41a3606e009c109ba5/node_modules/@wirecat/cli-core/dist/services/excerpt.js
|
|
21603
21627
|
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");
|
|
21604
21628
|
var excerpt = /* @__PURE__ */ __name((text2, query, size2 = 240, options = {}) => {
|
|
21605
21629
|
const flat = text2.replace(/\s+/g, " ").trim();
|
|
@@ -21615,18 +21639,18 @@ var excerpt = /* @__PURE__ */ __name((text2, query, size2 = 240, options = {}) =
|
|
|
21615
21639
|
}, "excerpt");
|
|
21616
21640
|
var withExcerpt = /* @__PURE__ */ __name(({ matchedText, ...hit }, query) => ({ ...hit, excerpt: excerpt(matchedText ?? hit.text, query) }), "withExcerpt");
|
|
21617
21641
|
|
|
21618
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
21642
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.544.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.73.0_commander@15._14d279ae6bc0fc41a3606e009c109ba5/node_modules/@wirecat/cli-core/dist/services/media-archive.js
|
|
21619
21643
|
import { setTimeout as sleep } from "node:timers/promises";
|
|
21620
21644
|
|
|
21621
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
21645
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.544.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.73.0_commander@15._14d279ae6bc0fc41a3606e009c109ba5/node_modules/@wirecat/cli-core/dist/services/media-archive-files.js
|
|
21622
21646
|
import { lstat } from "node:fs/promises";
|
|
21623
21647
|
|
|
21624
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
21648
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.544.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.73.0_commander@15._14d279ae6bc0fc41a3606e009c109ba5/node_modules/@wirecat/cli-core/dist/persistence/native/recording-partial-store.js
|
|
21625
21649
|
import { createHash as createHash3, randomUUID as randomUUID2 } from "node:crypto";
|
|
21626
21650
|
import { open as open3, rename as rename2, unlink as unlink2 } from "node:fs/promises";
|
|
21627
21651
|
import { join as join3 } from "node:path";
|
|
21628
21652
|
|
|
21629
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
21653
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.544.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.73.0_commander@15._14d279ae6bc0fc41a3606e009c109ba5/node_modules/@wirecat/cli-core/dist/persistence/native/recording-partial-metadata.js
|
|
21630
21654
|
import { createHash as createHash2 } from "node:crypto";
|
|
21631
21655
|
var metadataLimit = 16384;
|
|
21632
21656
|
var partialIdentity = /* @__PURE__ */ __name((locator) => JSON.stringify([locator.provider, locator.account, locator.occurrenceId, locator.assetId]), "partialIdentity");
|
|
@@ -21686,7 +21710,7 @@ var readPartialMetadata = /* @__PURE__ */ __name(async (path, locator, maxBytes,
|
|
|
21686
21710
|
}
|
|
21687
21711
|
}, "readPartialMetadata");
|
|
21688
21712
|
|
|
21689
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
21713
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.544.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.73.0_commander@15._14d279ae6bc0fc41a3606e009c109ba5/node_modules/@wirecat/cli-core/dist/persistence/native/recording-partial-writer.js
|
|
21690
21714
|
import { randomUUID } from "node:crypto";
|
|
21691
21715
|
import { open as open2, rename, unlink } from "node:fs/promises";
|
|
21692
21716
|
import { join as join2 } from "node:path";
|
|
@@ -21778,7 +21802,7 @@ var partialWriter = /* @__PURE__ */ __name(async (input) => {
|
|
|
21778
21802
|
};
|
|
21779
21803
|
}, "partialWriter");
|
|
21780
21804
|
|
|
21781
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
21805
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.544.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.73.0_commander@15._14d279ae6bc0fc41a3606e009c109ba5/node_modules/@wirecat/cli-core/dist/persistence/native/recording-partial-store.js
|
|
21782
21806
|
var NativeRecordingPartialStore = class {
|
|
21783
21807
|
static {
|
|
21784
21808
|
__name(this, "NativeRecordingPartialStore");
|
|
@@ -21885,12 +21909,12 @@ var NativeRecordingPartialStore = class {
|
|
|
21885
21909
|
}
|
|
21886
21910
|
};
|
|
21887
21911
|
|
|
21888
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
21912
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.544.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.73.0_commander@15._14d279ae6bc0fc41a3606e009c109ba5/node_modules/@wirecat/cli-core/dist/persistence/native/recording-publication.js
|
|
21889
21913
|
import { createHash as createHash4 } from "node:crypto";
|
|
21890
21914
|
import { link as link2 } from "node:fs/promises";
|
|
21891
21915
|
import { basename as basename2, dirname as dirname2, join as join5, resolve as resolve2 } from "node:path";
|
|
21892
21916
|
|
|
21893
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
21917
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.544.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.73.0_commander@15._14d279ae6bc0fc41a3606e009c109ba5/node_modules/@wirecat/cli-core/dist/persistence/native/recording-publication-files.js
|
|
21894
21918
|
import { unlink as unlink3 } from "node:fs/promises";
|
|
21895
21919
|
var verifiedPublicationFile = /* @__PURE__ */ __name(async (path, expected, signal, writable = false) => {
|
|
21896
21920
|
signal?.throwIfAborted();
|
|
@@ -21925,7 +21949,7 @@ var commitPublication = /* @__PURE__ */ __name(async (root, partialPath, finalPa
|
|
|
21925
21949
|
signal?.throwIfAborted();
|
|
21926
21950
|
}, "commitPublication");
|
|
21927
21951
|
|
|
21928
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
21952
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.544.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.73.0_commander@15._14d279ae6bc0fc41a3606e009c109ba5/node_modules/@wirecat/cli-core/dist/persistence/native/recording-publication-journal.js
|
|
21929
21953
|
import { randomUUID as randomUUID3 } from "node:crypto";
|
|
21930
21954
|
import { open as open4, rename as rename3, unlink as unlink4 } from "node:fs/promises";
|
|
21931
21955
|
import { join as join4 } from "node:path";
|
|
@@ -21998,7 +22022,7 @@ var writePublicationJournal = /* @__PURE__ */ __name(async (root, path, prefix,
|
|
|
21998
22022
|
}
|
|
21999
22023
|
}, "writePublicationJournal");
|
|
22000
22024
|
|
|
22001
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
22025
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.544.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.73.0_commander@15._14d279ae6bc0fc41a3606e009c109ba5/node_modules/@wirecat/cli-core/dist/persistence/native/recording-publication.js
|
|
22002
22026
|
var NativeRecordingPublication = class {
|
|
22003
22027
|
static {
|
|
22004
22028
|
__name(this, "NativeRecordingPublication");
|
|
@@ -22071,7 +22095,7 @@ var NativeRecordingPublication = class {
|
|
|
22071
22095
|
}
|
|
22072
22096
|
};
|
|
22073
22097
|
|
|
22074
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
22098
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.544.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.73.0_commander@15._14d279ae6bc0fc41a3606e009c109ba5/node_modules/@wirecat/cli-core/dist/services/media-archive-manifest.js
|
|
22075
22099
|
import { createHash as createHash5 } from "node:crypto";
|
|
22076
22100
|
import { readdir } from "node:fs/promises";
|
|
22077
22101
|
import { isAbsolute as isAbsolute2, join as join6, resolve as resolve3 } from "node:path";
|
|
@@ -22158,7 +22182,7 @@ var commitMediaEntry = /* @__PURE__ */ __name((root, one, beforePublish) => writ
|
|
|
22158
22182
|
beforePublish
|
|
22159
22183
|
}), "commitMediaEntry");
|
|
22160
22184
|
|
|
22161
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
22185
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.544.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.73.0_commander@15._14d279ae6bc0fc41a3606e009c109ba5/node_modules/@wirecat/cli-core/dist/services/media-archive-files.js
|
|
22162
22186
|
var validator = '"media-completed-v1"';
|
|
22163
22187
|
var maximumFileBytes = 64 * 1024 * 1024 * 1024;
|
|
22164
22188
|
var archiveMediaFile = /* @__PURE__ */ __name(async (root, identity, kind, file2, beforeWrite, signal, metadata = {}) => {
|
|
@@ -22259,7 +22283,7 @@ var archiveMediaFile = /* @__PURE__ */ __name(async (root, identity, kind, file2
|
|
|
22259
22283
|
return entry;
|
|
22260
22284
|
}, "archiveMediaFile");
|
|
22261
22285
|
|
|
22262
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
22286
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.544.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.73.0_commander@15._14d279ae6bc0fc41a3606e009c109ba5/node_modules/@wirecat/cli-core/dist/services/media-archive-locks.js
|
|
22263
22287
|
import { mkdir, realpath } from "node:fs/promises";
|
|
22264
22288
|
import { join as join7, resolve as resolve4 } from "node:path";
|
|
22265
22289
|
var archiveLocations = /* @__PURE__ */ __name(async (initial, signal) => {
|
|
@@ -22326,7 +22350,7 @@ var withMediaArchiveLocks = /* @__PURE__ */ __name(async (directory2, signal, ru
|
|
|
22326
22350
|
throw new CliError("validation_error", "archive locations changed during locking; run the command again");
|
|
22327
22351
|
}, "withMediaArchiveLocks");
|
|
22328
22352
|
|
|
22329
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
22353
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.544.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.73.0_commander@15._14d279ae6bc0fc41a3606e009c109ba5/node_modules/@wirecat/cli-core/dist/services/media-archive.js
|
|
22330
22354
|
var validateMediaSince = /* @__PURE__ */ __name((value, flag = "--since-time") => {
|
|
22331
22355
|
if (value === void 0)
|
|
22332
22356
|
return void 0;
|
|
@@ -22479,7 +22503,7 @@ var archiveMedia = /* @__PURE__ */ __name(async (ports, options) => {
|
|
|
22479
22503
|
}, { create: true });
|
|
22480
22504
|
}, "archiveMedia");
|
|
22481
22505
|
|
|
22482
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
22506
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.544.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.73.0_commander@15._14d279ae6bc0fc41a3606e009c109ba5/node_modules/@wirecat/cli-core/dist/services/media-archive-move.js
|
|
22483
22507
|
import { realpath as realpath2, unlink as unlink5 } from "node:fs/promises";
|
|
22484
22508
|
import { basename as basename3, dirname as dirname3, join as join8, resolve as resolve5 } from "node:path";
|
|
22485
22509
|
var canonicalDestination = /* @__PURE__ */ __name(async (directory2) => {
|
|
@@ -22632,7 +22656,7 @@ var moveMediaArchive = /* @__PURE__ */ __name(async (options) => {
|
|
|
22632
22656
|
}, { additional: [target2], createAdditional: !options.dryRun });
|
|
22633
22657
|
}, "moveMediaArchive");
|
|
22634
22658
|
|
|
22635
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
22659
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.544.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.73.0_commander@15._14d279ae6bc0fc41a3606e009c109ba5/node_modules/@wirecat/cli-core/dist/services/model-downloads.js
|
|
22636
22660
|
var bytesOf = /* @__PURE__ */ __name((model) => model.files.reduce((sum2, file2) => sum2 + file2.bytes, 0), "bytesOf");
|
|
22637
22661
|
var nativeRuntime = /* @__PURE__ */ __name(async ({ env, progress = /* @__PURE__ */ __name(() => {
|
|
22638
22662
|
}, "progress") }) => {
|
|
@@ -22655,7 +22679,7 @@ var downloadTextModel = /* @__PURE__ */ __name(async (id2, { env, progress = /*
|
|
|
22655
22679
|
}
|
|
22656
22680
|
await nativeRuntime({ env, progress });
|
|
22657
22681
|
progress(`${model.id}: loading it once to check it works`);
|
|
22658
|
-
const { openEmbedder: openEmbedder2 } = await import("./embed-
|
|
22682
|
+
const { openEmbedder: openEmbedder2 } = await import("./embed-VZYBZEWI.js");
|
|
22659
22683
|
const embedder = await openEmbedder2(model, directory2);
|
|
22660
22684
|
try {
|
|
22661
22685
|
const [vector] = await embedder.embed(["check"], "query");
|
|
@@ -22676,7 +22700,7 @@ var downloadRerankModel = /* @__PURE__ */ __name(async (id2, { env, progress = /
|
|
|
22676
22700
|
}
|
|
22677
22701
|
await nativeRuntime({ env, progress });
|
|
22678
22702
|
progress(`${model.id}: loading it once to check it works`);
|
|
22679
|
-
const { openReranker } = await import("./rerank-
|
|
22703
|
+
const { openReranker } = await import("./rerank-ZFATWWBE.js");
|
|
22680
22704
|
const reranker = await openReranker(model, directory2);
|
|
22681
22705
|
try {
|
|
22682
22706
|
await reranker.score("check", ["check"]);
|
|
@@ -22694,7 +22718,7 @@ var downloadImageModel = /* @__PURE__ */ __name(async (id2, { env, progress = /*
|
|
|
22694
22718
|
await installFiles(placedImage(model, directory2), { progress });
|
|
22695
22719
|
}
|
|
22696
22720
|
progress(`${model.id}: loading it once to check it works`);
|
|
22697
|
-
const { openPictureEmbedder } = await import("./embedder-
|
|
22721
|
+
const { openPictureEmbedder } = await import("./embedder-GSWBGHRK.js");
|
|
22698
22722
|
const embedder = await openPictureEmbedder(model, directory2);
|
|
22699
22723
|
try {
|
|
22700
22724
|
const vector = await embedder.embedQuery("check");
|
|
@@ -22706,7 +22730,7 @@ var downloadImageModel = /* @__PURE__ */ __name(async (id2, { env, progress = /*
|
|
|
22706
22730
|
return { model, directory: directory2 };
|
|
22707
22731
|
}, "downloadImageModel");
|
|
22708
22732
|
|
|
22709
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
22733
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.544.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.73.0_commander@15._14d279ae6bc0fc41a3606e009c109ba5/node_modules/@wirecat/cli-core/dist/services/project-gathering-around.js
|
|
22710
22734
|
var storedMessageNeighbours = /* @__PURE__ */ __name((messages) => ({
|
|
22711
22735
|
async around(ref, window3) {
|
|
22712
22736
|
const at = parseLocator(ref);
|
|
@@ -22801,7 +22825,7 @@ var storedNeighbours = /* @__PURE__ */ __name((store) => {
|
|
|
22801
22825
|
};
|
|
22802
22826
|
}, "storedNeighbours");
|
|
22803
22827
|
|
|
22804
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
22828
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.544.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.73.0_commander@15._14d279ae6bc0fc41a3606e009c109ba5/node_modules/@wirecat/cli-core/dist/services/project-gathering-request.js
|
|
22805
22829
|
import { createHash as createHash6 } from "node:crypto";
|
|
22806
22830
|
var DAY = 864e5;
|
|
22807
22831
|
var MAX_TIME = 864e13;
|
|
@@ -23117,7 +23141,7 @@ var decodeCheckpoint = /* @__PURE__ */ __name((text2, plan) => {
|
|
|
23117
23141
|
return value;
|
|
23118
23142
|
}, "decodeCheckpoint");
|
|
23119
23143
|
|
|
23120
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
23144
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.544.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.73.0_commander@15._14d279ae6bc0fc41a3606e009c109ba5/node_modules/@wirecat/cli-core/dist/services/project-gathering.js
|
|
23121
23145
|
var terminal = /* @__PURE__ */ new Set(["done", "unavailable", "failed"]);
|
|
23122
23146
|
var PAGE2 = 20;
|
|
23123
23147
|
var PEOPLE = 20;
|
|
@@ -23521,7 +23545,7 @@ var peopleOf = /* @__PURE__ */ __name((items, senderOf) => {
|
|
|
23521
23545
|
return [...byKey.values()].sort((a, b) => b.items - a.items || a.name.localeCompare(b.name));
|
|
23522
23546
|
}, "peopleOf");
|
|
23523
23547
|
|
|
23524
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
23548
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.544.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.73.0_commander@15._14d279ae6bc0fc41a3606e009c109ba5/node_modules/@wirecat/cli-core/dist/services/meeting-project-candidate-matching.js
|
|
23525
23549
|
var normalizedText = /* @__PURE__ */ __name((text2) => text2.normalize("NFKC").toLowerCase().replace(/\s+/gu, " "), "normalizedText");
|
|
23526
23550
|
var termsOf = /* @__PURE__ */ __name((entry) => [
|
|
23527
23551
|
{ name: entry.name, kind: "canonical" },
|
|
@@ -23565,7 +23589,7 @@ var matchVocabularyTerms = /* @__PURE__ */ __name((catalog, texts) => {
|
|
|
23565
23589
|
return result.sort((a, b) => Number(a.entry.id) - Number(b.entry.id));
|
|
23566
23590
|
}, "matchVocabularyTerms");
|
|
23567
23591
|
|
|
23568
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
23592
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.544.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.73.0_commander@15._14d279ae6bc0fc41a3606e009c109ba5/node_modules/@wirecat/cli-core/dist/services/project-gathering-mentions.js
|
|
23569
23593
|
var KINDS = ["project", "tag", "topic"];
|
|
23570
23594
|
var findEvidenceMentions = /* @__PURE__ */ __name(async (vocabulary, gathering, options = {}) => {
|
|
23571
23595
|
if (typeof vocabulary?.vocabulary !== "function")
|
|
@@ -23620,7 +23644,7 @@ var findEvidenceMentions = /* @__PURE__ */ __name(async (vocabulary, gathering,
|
|
|
23620
23644
|
};
|
|
23621
23645
|
}, "findEvidenceMentions");
|
|
23622
23646
|
|
|
23623
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
23647
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.544.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.73.0_commander@15._14d279ae6bc0fc41a3606e009c109ba5/node_modules/@wirecat/cli-core/dist/services/stored-project-gathering.js
|
|
23624
23648
|
var PROJECT_ID = /^project:[1-9]\d*$/;
|
|
23625
23649
|
var canonicalProjectRef = /* @__PURE__ */ __name(async (store, reference) => {
|
|
23626
23650
|
if (PROJECT_ID.test(reference)) {
|
|
@@ -23786,7 +23810,7 @@ var gatherStoredProject = /* @__PURE__ */ __name(async (store, input) => {
|
|
|
23786
23810
|
return { projectRef: project.ref, unreadSources: [...unread, ...unreadChats, ...members.left], ...gathered, mentions };
|
|
23787
23811
|
}, "gatherStoredProject");
|
|
23788
23812
|
|
|
23789
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
23813
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.544.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.73.0_commander@15._14d279ae6bc0fc41a3606e009c109ba5/node_modules/@wirecat/cli-core/dist/services/account.js
|
|
23790
23814
|
var accountService = /* @__PURE__ */ __name((deps) => {
|
|
23791
23815
|
const online = /* @__PURE__ */ __name(async (command) => {
|
|
23792
23816
|
if (deps.offline)
|
|
@@ -23858,7 +23882,7 @@ var accountService = /* @__PURE__ */ __name((deps) => {
|
|
|
23858
23882
|
};
|
|
23859
23883
|
}, "accountService");
|
|
23860
23884
|
|
|
23861
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
23885
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.544.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.73.0_commander@15._14d279ae6bc0fc41a3606e009c109ba5/node_modules/@wirecat/cli-core/dist/domain/send-time.js
|
|
23862
23886
|
var MINUTE = 6e4;
|
|
23863
23887
|
var YEAR = 365 * 24 * 60 * MINUTE;
|
|
23864
23888
|
var DELAY = /^(\d+)(m|h|d)$/;
|
|
@@ -23877,7 +23901,7 @@ var sendTime = /* @__PURE__ */ __name((value, now = Date.now(), flag = "--at-tim
|
|
|
23877
23901
|
return new Date(at - at % MINUTE).toISOString();
|
|
23878
23902
|
}, "sendTime");
|
|
23879
23903
|
|
|
23880
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
23904
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.544.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.73.0_commander@15._14d279ae6bc0fc41a3606e009c109ba5/node_modules/@wirecat/cli-core/dist/services/admin.js
|
|
23881
23905
|
var recordMembership = /* @__PURE__ */ __name(async (deps, operationId, done2, change, fix, write) => {
|
|
23882
23906
|
try {
|
|
23883
23907
|
const held = await accountStoreIfOpen(deps);
|
|
@@ -24124,7 +24148,7 @@ var linkLimits = /* @__PURE__ */ __name(({ approval, expires, maxUses }) => {
|
|
|
24124
24148
|
return expires === void 0 ? void 0 : sendTime(expires, Date.now(), "--expire-time");
|
|
24125
24149
|
}, "linkLimits");
|
|
24126
24150
|
|
|
24127
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
24151
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.544.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.73.0_commander@15._14d279ae6bc0fc41a3606e009c109ba5/node_modules/@wirecat/cli-core/dist/services/mail-search.js
|
|
24128
24152
|
var THREADS_PAGE = 500;
|
|
24129
24153
|
var threadsOf = /* @__PURE__ */ __name(async (store, key) => {
|
|
24130
24154
|
const account = await store.accounts.storedAccount(key).catch(() => void 0);
|
|
@@ -24203,7 +24227,7 @@ var readMail = /* @__PURE__ */ __name(async (store, locator, { before: before2 =
|
|
|
24203
24227
|
return thread.slice(Math.max(0, at - before2), at + after + 1).map((hit) => hit.id === message ? { ...hit, anchor: true } : hit);
|
|
24204
24228
|
}, "readMail");
|
|
24205
24229
|
|
|
24206
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
24230
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.544.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.73.0_commander@15._14d279ae6bc0fc41a3606e009c109ba5/node_modules/@wirecat/cli-core/dist/services/search-kind.js
|
|
24207
24231
|
var NO_MAIL = "no_mail";
|
|
24208
24232
|
var MAIL = "email";
|
|
24209
24233
|
var listContextOf = /* @__PURE__ */ __name(async (store, account, app, stored) => {
|
|
@@ -24250,7 +24274,7 @@ var accountsOfKind = /* @__PURE__ */ __name((kind, chosen, held, explicit, comma
|
|
|
24250
24274
|
return chosenMail.map(({ provider, account }) => ({ provider, account }));
|
|
24251
24275
|
}, "accountsOfKind");
|
|
24252
24276
|
|
|
24253
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
24277
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.544.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.73.0_commander@15._14d279ae6bc0fc41a3606e009c109ba5/node_modules/@wirecat/cli-core/dist/services/messages-search.js
|
|
24254
24278
|
var MAIL_FIELDS = /* @__PURE__ */ new Set(["to", "cc", "bcc", "subject", "mailbox", "label", "is"]);
|
|
24255
24279
|
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");
|
|
24256
24280
|
var prepareLucene = /* @__PURE__ */ __name(async (store, account, request, messenger) => {
|
|
@@ -24598,7 +24622,7 @@ var statsLucene = /* @__PURE__ */ __name(async (store, account, request, messeng
|
|
|
24598
24622
|
};
|
|
24599
24623
|
}, "statsLucene");
|
|
24600
24624
|
|
|
24601
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
24625
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.544.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.73.0_commander@15._14d279ae6bc0fc41a3606e009c109ba5/node_modules/@wirecat/cli-core/dist/services/rankings-selection.js
|
|
24602
24626
|
var RANKING_SELECTION_BYTES = 64 * 1024;
|
|
24603
24627
|
var object = /* @__PURE__ */ __name((value) => value !== null && typeof value === "object" && !Array.isArray(value) ? value : void 0, "object");
|
|
24604
24628
|
function invalid3(message = "ranking selection is invalid \u2014 obtain a new drilldown from stats top") {
|
|
@@ -24767,7 +24791,7 @@ var readRankingSelection = /* @__PURE__ */ __name(async (store, input) => {
|
|
|
24767
24791
|
};
|
|
24768
24792
|
}, "readRankingSelection");
|
|
24769
24793
|
|
|
24770
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
24794
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.544.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.73.0_commander@15._14d279ae6bc0fc41a3606e009c109ba5/node_modules/@wirecat/cli-core/dist/services/search-record.js
|
|
24771
24795
|
var canonical = /* @__PURE__ */ __name((value, nested = false) => Array.isArray(value) ? value.map((one) => canonical(one, true)) : value !== null && typeof value === "object" ? Object.fromEntries(Object.entries(value).filter(([, one]) => one !== void 0 && (nested || one !== false)).sort(([a], [b]) => a < b ? -1 : a > b ? 1 : 0).map(([key, one]) => [key, canonical(one, true)])) : value, "canonical");
|
|
24772
24796
|
var searchRecordOf = /* @__PURE__ */ __name((command, params) => ({
|
|
24773
24797
|
command,
|
|
@@ -24777,7 +24801,7 @@ var searchRecordOf = /* @__PURE__ */ __name((command, params) => ({
|
|
|
24777
24801
|
fieldsVersion: FIELD_VERSION
|
|
24778
24802
|
}), "searchRecordOf");
|
|
24779
24803
|
|
|
24780
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
24804
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.544.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.73.0_commander@15._14d279ae6bc0fc41a3606e009c109ba5/node_modules/@wirecat/cli-core/dist/services/admin-statistics.js
|
|
24781
24805
|
function invalid4(message) {
|
|
24782
24806
|
throw new CliError("validation_error", message);
|
|
24783
24807
|
}
|
|
@@ -25071,7 +25095,7 @@ var adminStatisticsService = /* @__PURE__ */ __name((deps) => ({
|
|
|
25071
25095
|
}, "evidence")
|
|
25072
25096
|
}), "adminStatisticsService");
|
|
25073
25097
|
|
|
25074
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
25098
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.544.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.73.0_commander@15._14d279ae6bc0fc41a3606e009c109ba5/node_modules/@wirecat/cli-core/dist/services/agenda.js
|
|
25075
25099
|
var DAY2 = 864e5;
|
|
25076
25100
|
var CLAIMS = ["none", "mine", "others", "any"];
|
|
25077
25101
|
var TASK_FIELDS = /* @__PURE__ */ new Set(["tag", "category", "claimed"]);
|
|
@@ -25313,10 +25337,10 @@ var agendaItem = /* @__PURE__ */ __name((shown) => {
|
|
|
25313
25337
|
};
|
|
25314
25338
|
}, "agendaItem");
|
|
25315
25339
|
|
|
25316
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
25340
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.544.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.73.0_commander@15._14d279ae6bc0fc41a3606e009c109ba5/node_modules/@wirecat/cli-core/dist/services/archive.js
|
|
25317
25341
|
import { setTimeout as sleep3 } from "node:timers/promises";
|
|
25318
25342
|
|
|
25319
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
25343
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.544.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.73.0_commander@15._14d279ae6bc0fc41a3606e009c109ba5/node_modules/@wirecat/cli-core/dist/services/backfill-estimate.js
|
|
25320
25344
|
var REQUEST_MS = 400;
|
|
25321
25345
|
var estimateBackfill = /* @__PURE__ */ __name(({ ranges, held, newest, page, maxPages, pauseMs }) => {
|
|
25322
25346
|
const lowest = ranges[0];
|
|
@@ -25339,13 +25363,13 @@ var estimateBackfill = /* @__PURE__ */ __name(({ ranges, held, newest, page, max
|
|
|
25339
25363
|
};
|
|
25340
25364
|
}, "estimateBackfill");
|
|
25341
25365
|
|
|
25342
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
25366
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.544.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.73.0_commander@15._14d279ae6bc0fc41a3606e009c109ba5/node_modules/@wirecat/cli-core/dist/domain/recovery.js
|
|
25343
25367
|
var withRecovery = /* @__PURE__ */ __name((error) => ({
|
|
25344
25368
|
...error,
|
|
25345
25369
|
retryable: typeof error.retryable === "boolean" ? error.retryable : error.code === "rate_limited" || error.status === 429
|
|
25346
25370
|
}), "withRecovery");
|
|
25347
25371
|
|
|
25348
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
25372
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.544.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.73.0_commander@15._14d279ae6bc0fc41a3606e009c109ba5/node_modules/@wirecat/cli-core/dist/services/batch.js
|
|
25349
25373
|
var actionable = /* @__PURE__ */ __name((error) => {
|
|
25350
25374
|
if (isCliFailure(error))
|
|
25351
25375
|
return withRecovery({ code: error.code, message: error.message, ...error.details });
|
|
@@ -25428,7 +25452,7 @@ var mergeBatches = /* @__PURE__ */ __name((a, b) => {
|
|
|
25428
25452
|
};
|
|
25429
25453
|
}, "mergeBatches");
|
|
25430
25454
|
|
|
25431
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
25455
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.544.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.73.0_commander@15._14d279ae6bc0fc41a3606e009c109ba5/node_modules/@wirecat/cli-core/dist/services/patience.js
|
|
25432
25456
|
import { setTimeout as sleep2 } from "node:timers/promises";
|
|
25433
25457
|
var LONGEST_WAIT_MS = 5 * 60 * 1e3;
|
|
25434
25458
|
var patiently = /* @__PURE__ */ __name(async (request, note, stop) => {
|
|
@@ -25451,7 +25475,7 @@ var patiently = /* @__PURE__ */ __name(async (request, note, stop) => {
|
|
|
25451
25475
|
}
|
|
25452
25476
|
}, "patiently");
|
|
25453
25477
|
|
|
25454
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
25478
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.544.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.73.0_commander@15._14d279ae6bc0fc41a3606e009c109ba5/node_modules/@wirecat/cli-core/dist/images/context/index.js
|
|
25455
25479
|
var CONTEXT_MESSAGES2 = 3;
|
|
25456
25480
|
var CONTEXT_MINUTES = 10;
|
|
25457
25481
|
var MAX_CHARS = 1200;
|
|
@@ -25475,12 +25499,12 @@ var context = {
|
|
|
25475
25499
|
}, "describe")
|
|
25476
25500
|
};
|
|
25477
25501
|
|
|
25478
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
25502
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.544.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.73.0_commander@15._14d279ae6bc0fc41a3606e009c109ba5/node_modules/@wirecat/cli-core/dist/images/registry.js
|
|
25479
25503
|
var BUILT_INS = [context];
|
|
25480
25504
|
var providers = [...BUILT_INS];
|
|
25481
25505
|
var registeredImageProviders = /* @__PURE__ */ __name(() => providers, "registeredImageProviders");
|
|
25482
25506
|
|
|
25483
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
25507
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.544.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.73.0_commander@15._14d279ae6bc0fc41a3606e009c109ba5/node_modules/@wirecat/cli-core/dist/services/conversations.js
|
|
25484
25508
|
var READ_PAGE = 5e3;
|
|
25485
25509
|
var CHAIN = 50;
|
|
25486
25510
|
var CONVERSATION_QUERY = {
|
|
@@ -25632,7 +25656,7 @@ var sized = /* @__PURE__ */ __name((size2) => {
|
|
|
25632
25656
|
return size2;
|
|
25633
25657
|
}, "sized");
|
|
25634
25658
|
|
|
25635
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
25659
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.544.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.73.0_commander@15._14d279ae6bc0fc41a3606e009c109ba5/node_modules/@wirecat/cli-core/dist/services/embeddings-maintenance.js
|
|
25636
25660
|
var REFRESH_BOUNDS = { maxChats: 20, maxChunks: 2e3 };
|
|
25637
25661
|
var MESSAGE_PAGE = 5e3;
|
|
25638
25662
|
var PER_SESSION = 8;
|
|
@@ -25651,7 +25675,7 @@ var embeddingTarget = /* @__PURE__ */ __name((deps, choice = DEFAULT_TEXT_MODEL)
|
|
|
25651
25675
|
price: remote.price,
|
|
25652
25676
|
installed: true,
|
|
25653
25677
|
perBatch: PER_REQUEST * concurrency,
|
|
25654
|
-
open: /* @__PURE__ */ __name(async () => (await import("./remote-
|
|
25678
|
+
open: /* @__PURE__ */ __name(async () => (await import("./remote-DABI7PSQ.js")).openRemote(remote, apiKey, { concurrency }), "open")
|
|
25655
25679
|
};
|
|
25656
25680
|
}
|
|
25657
25681
|
const model = textModel(choice);
|
|
@@ -25668,7 +25692,7 @@ var embeddingTarget = /* @__PURE__ */ __name((deps, choice = DEFAULT_TEXT_MODEL)
|
|
|
25668
25692
|
if (!isTextModelInstalled(model, directory2))
|
|
25669
25693
|
throw notDownloaded(model.id);
|
|
25670
25694
|
if (apart) {
|
|
25671
|
-
const { openProcess } = await import("./process-
|
|
25695
|
+
const { openProcess } = await import("./process-QKEFL5HL.js");
|
|
25672
25696
|
return openProcess(model, directory2, { threads: threads ?? defaultThreads() });
|
|
25673
25697
|
}
|
|
25674
25698
|
return openEmbedder(model, directory2, { threads: threads ?? defaultThreads() });
|
|
@@ -25957,7 +25981,7 @@ var shaped = /* @__PURE__ */ __name(({ chatId, builtAt, algorithmVersion, pendin
|
|
|
25957
25981
|
return { ...one, state };
|
|
25958
25982
|
}, "shaped");
|
|
25959
25983
|
|
|
25960
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
25984
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.544.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.73.0_commander@15._14d279ae6bc0fc41a3606e009c109ba5/node_modules/@wirecat/cli-core/dist/services/search-catchup.js
|
|
25961
25985
|
var CATCH_UP_BOUNDS = { maxChunks: 500, maxMessages: 1e4, timeMs: 3e4 };
|
|
25962
25986
|
var validateCatchUpBounds = /* @__PURE__ */ __name((options) => {
|
|
25963
25987
|
for (const [key, value, maximum] of [
|
|
@@ -26010,7 +26034,7 @@ var catchUpSearch = /* @__PURE__ */ __name(async (deps, chat, options, signal, c
|
|
|
26010
26034
|
}
|
|
26011
26035
|
}, "catchUpSearch");
|
|
26012
26036
|
|
|
26013
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
26037
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.544.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.73.0_commander@15._14d279ae6bc0fc41a3606e009c109ba5/node_modules/@wirecat/cli-core/dist/services/archive.js
|
|
26014
26038
|
var pushed = /* @__PURE__ */ __name((deps, what) => {
|
|
26015
26039
|
if (deps.reads === "store") {
|
|
26016
26040
|
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`);
|
|
@@ -26331,7 +26355,7 @@ var timeOfKey = /* @__PURE__ */ __name(async (store, account, chatId, key, byTim
|
|
|
26331
26355
|
return message?.timestamp ?? fallback;
|
|
26332
26356
|
}, "timeOfKey");
|
|
26333
26357
|
|
|
26334
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
26358
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.544.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.73.0_commander@15._14d279ae6bc0fc41a3606e009c109ba5/node_modules/@wirecat/cli-core/dist/services/archive-gaps.js
|
|
26335
26359
|
import { createHash as createHash7, randomUUID as randomUUID4 } from "node:crypto";
|
|
26336
26360
|
var GAP_BOUNDS = { maxGaps: 5, limit: 500, timeMs: 3e4 };
|
|
26337
26361
|
var validateRepair = /* @__PURE__ */ __name((messenger, options) => {
|
|
@@ -26468,12 +26492,12 @@ var gapsService = /* @__PURE__ */ __name((deps) => {
|
|
|
26468
26492
|
return { plan, repair };
|
|
26469
26493
|
}, "gapsService");
|
|
26470
26494
|
|
|
26471
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
26495
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.544.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.73.0_commander@15._14d279ae6bc0fc41a3606e009c109ba5/node_modules/@wirecat/cli-core/dist/services/attachments.js
|
|
26472
26496
|
import { createHash as createHash9 } from "node:crypto";
|
|
26473
|
-
import { constants as constants2 } from "node:fs";
|
|
26474
|
-
import { open as open6, readFile, stat as stat2 } from "node:fs/promises";
|
|
26497
|
+
import { constants as constants2, mkdirSync as mkdirSync2 } from "node:fs";
|
|
26498
|
+
import { lstat as lstat4, open as open6, readFile, stat as stat2 } from "node:fs/promises";
|
|
26475
26499
|
|
|
26476
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
26500
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.544.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.73.0_commander@15._14d279ae6bc0fc41a3606e009c109ba5/node_modules/@wirecat/cli-core/dist/attachments/directory.js
|
|
26477
26501
|
import { lstat as lstat2, readdir as readdir2, realpath as realpath3 } from "node:fs/promises";
|
|
26478
26502
|
import { basename as basename4, join as join9, relative as relative2, sep as sep2 } from "node:path";
|
|
26479
26503
|
var MAX_FILES = 1e4;
|
|
@@ -26544,15 +26568,15 @@ var directoryPaths = /* @__PURE__ */ __name(async (store, chat, directory2, app,
|
|
|
26544
26568
|
return choices;
|
|
26545
26569
|
}, "directoryPaths");
|
|
26546
26570
|
|
|
26547
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
26571
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.544.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.73.0_commander@15._14d279ae6bc0fc41a3606e009c109ba5/node_modules/@wirecat/cli-core/dist/attachments/documents.js
|
|
26548
26572
|
import { posix } from "node:path";
|
|
26549
26573
|
|
|
26550
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
26574
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.544.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.73.0_commander@15._14d279ae6bc0fc41a3606e009c109ba5/node_modules/@wirecat/cli-core/dist/attachments/container.js
|
|
26551
26575
|
import { setImmediate as tick } from "node:timers/promises";
|
|
26552
26576
|
import { crc32 } from "node:zlib";
|
|
26553
26577
|
var import_xmldom = __toESM(require_lib(), 1);
|
|
26554
26578
|
|
|
26555
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
26579
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.544.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.73.0_commander@15._14d279ae6bc0fc41a3606e009c109ba5/node_modules/@wirecat/cli-core/dist/attachments/encoding.js
|
|
26556
26580
|
var import_chardet = __toESM(require_lib2(), 1);
|
|
26557
26581
|
var import_iconv_lite = __toESM(require_lib3(), 1);
|
|
26558
26582
|
var SAMPLE = 65536;
|
|
@@ -26654,7 +26678,7 @@ var decodeXml = /* @__PURE__ */ __name((bytes2) => {
|
|
|
26654
26678
|
return result.text;
|
|
26655
26679
|
}, "decodeXml");
|
|
26656
26680
|
|
|
26657
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
26681
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.544.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.73.0_commander@15._14d279ae6bc0fc41a3606e009c109ba5/node_modules/@wirecat/cli-core/dist/attachments/container.js
|
|
26658
26682
|
var MAX_PART = 10 * 1024 * 1024;
|
|
26659
26683
|
var MAX_ENTRIES = 1e3;
|
|
26660
26684
|
var decoder = new TextDecoder("utf-8", { fatal: true });
|
|
@@ -26667,7 +26691,7 @@ var cancelled = /* @__PURE__ */ __name((signal) => {
|
|
|
26667
26691
|
if (signal?.aborted)
|
|
26668
26692
|
throw new CliError("cancelled", "document extraction cancelled");
|
|
26669
26693
|
}, "cancelled");
|
|
26670
|
-
var
|
|
26694
|
+
var safeName2 = /* @__PURE__ */ __name((name) => name.length > 0 && name.length <= 512 && !/^[\\/]|\\/.test(name) && ![...name].some((character) => character.charCodeAt(0) < 32) && !name.split("/").includes(".."), "safeName");
|
|
26671
26695
|
var directory = /* @__PURE__ */ __name((bytes2) => {
|
|
26672
26696
|
const view = new DataView(bytes2.buffer, bytes2.byteOffset, bytes2.byteLength);
|
|
26673
26697
|
let end = -1;
|
|
@@ -26702,7 +26726,7 @@ var directory = /* @__PURE__ */ __name((bytes2) => {
|
|
|
26702
26726
|
if (next > stop)
|
|
26703
26727
|
throw new Error("invalid_zip");
|
|
26704
26728
|
const name = decoder.decode(bytes2.subarray(offset + 46, offset + 46 + length));
|
|
26705
|
-
if (!
|
|
26729
|
+
if (!safeName2(name) || entries.has(name) || flags & 1 || method !== 0 && method !== 8)
|
|
26706
26730
|
throw new Error("invalid_zip");
|
|
26707
26731
|
if ((view.getUint32(offset + 38, true) >>> 16 & 61440) === 40960)
|
|
26708
26732
|
throw new Error("invalid_zip");
|
|
@@ -26869,7 +26893,7 @@ var elements = /* @__PURE__ */ __name((node, name, namespace) => {
|
|
|
26869
26893
|
return found;
|
|
26870
26894
|
}, "elements");
|
|
26871
26895
|
|
|
26872
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
26896
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.544.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.73.0_commander@15._14d279ae6bc0fc41a3606e009c109ba5/node_modules/@wirecat/cli-core/dist/attachments/sheets.js
|
|
26873
26897
|
var columnName = /* @__PURE__ */ __name((column) => {
|
|
26874
26898
|
let name = "";
|
|
26875
26899
|
for (let rest = column; rest > 0; rest = Math.floor((rest - 1) / 26))
|
|
@@ -26924,7 +26948,7 @@ var sheetText = /* @__PURE__ */ __name((sheets2, maxChars = MAX_TEXT_CHARS) => {
|
|
|
26924
26948
|
return { text: parts.join("").trim(), truncated: false };
|
|
26925
26949
|
}, "sheetText");
|
|
26926
26950
|
|
|
26927
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
26951
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.544.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.73.0_commander@15._14d279ae6bc0fc41a3606e009c109ba5/node_modules/@wirecat/cli-core/dist/attachments/documents.js
|
|
26928
26952
|
var OFFICE = "urn:oasis:names:tc:opendocument:xmlns:office:1.0";
|
|
26929
26953
|
var TEXT = "urn:oasis:names:tc:opendocument:xmlns:text:1.0";
|
|
26930
26954
|
var TABLE = "urn:oasis:names:tc:opendocument:xmlns:table:1.0";
|
|
@@ -27324,10 +27348,10 @@ var readDocument = /* @__PURE__ */ __name(async (bytes2, kind, signal) => {
|
|
|
27324
27348
|
}
|
|
27325
27349
|
}, "readDocument");
|
|
27326
27350
|
|
|
27327
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
27351
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.544.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.73.0_commander@15._14d279ae6bc0fc41a3606e009c109ba5/node_modules/@wirecat/cli-core/dist/attachments/extract.js
|
|
27328
27352
|
import { extname as extname3 } from "node:path";
|
|
27329
27353
|
|
|
27330
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
27354
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.544.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.73.0_commander@15._14d279ae6bc0fc41a3606e009c109ba5/node_modules/@wirecat/cli-core/dist/readers/engine.js
|
|
27331
27355
|
import { readFileSync as readFileSync2 } from "node:fs";
|
|
27332
27356
|
import { dirname as dirname4, extname as extname2, join as join10 } from "node:path";
|
|
27333
27357
|
import { fileURLToPath } from "node:url";
|
|
@@ -27388,7 +27412,7 @@ var derived = /* @__PURE__ */ __name((bytes2, extractor, read) => {
|
|
|
27388
27412
|
}
|
|
27389
27413
|
}, "derived");
|
|
27390
27414
|
|
|
27391
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
27415
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.544.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.73.0_commander@15._14d279ae6bc0fc41a3606e009c109ba5/node_modules/@wirecat/cli-core/dist/readers/image/index.js
|
|
27392
27416
|
var IMAGES = /* @__PURE__ */ new Set([".jpg", ".jpeg", ".png", ".webp", ".gif", ".heic", ".tif", ".tiff", ".bmp"]);
|
|
27393
27417
|
var image2 = {
|
|
27394
27418
|
id: "image",
|
|
@@ -27397,7 +27421,7 @@ var image2 = {
|
|
|
27397
27421
|
read: /* @__PURE__ */ __name(async () => ({ status: "needs-agent" }), "read")
|
|
27398
27422
|
};
|
|
27399
27423
|
|
|
27400
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
27424
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.544.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.73.0_commander@15._14d279ae6bc0fc41a3606e009c109ba5/node_modules/@wirecat/cli-core/dist/readers/doc/index.js
|
|
27401
27425
|
var OLE = "\xD0\xCF\xE0\xA1\xB1\xE1";
|
|
27402
27426
|
var doc = {
|
|
27403
27427
|
id: "doc",
|
|
@@ -27409,7 +27433,7 @@ var doc = {
|
|
|
27409
27433
|
}), "read")
|
|
27410
27434
|
};
|
|
27411
27435
|
|
|
27412
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
27436
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.544.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.73.0_commander@15._14d279ae6bc0fc41a3606e009c109ba5/node_modules/@wirecat/cli-core/dist/readers/docx/index.js
|
|
27413
27437
|
var DOCX = "application/vnd.openxmlformats-officedocument.wordprocessingml.document";
|
|
27414
27438
|
var docx = {
|
|
27415
27439
|
id: "docx",
|
|
@@ -27422,7 +27446,7 @@ var docx = {
|
|
|
27422
27446
|
}), "read")
|
|
27423
27447
|
};
|
|
27424
27448
|
|
|
27425
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
27449
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.544.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.73.0_commander@15._14d279ae6bc0fc41a3606e009c109ba5/node_modules/@wirecat/cli-core/dist/attachments/markup.js
|
|
27426
27450
|
var import_iconv_lite2 = __toESM(require_lib3(), 1);
|
|
27427
27451
|
var RTF_SKIPPED = /* @__PURE__ */ new Set([
|
|
27428
27452
|
"fonttbl",
|
|
@@ -27598,7 +27622,7 @@ var htmlText = /* @__PURE__ */ __name((source) => {
|
|
|
27598
27622
|
}, "htmlText");
|
|
27599
27623
|
var safeChar = /* @__PURE__ */ __name((code, fallback) => code > 0 && code <= 1114111 ? String.fromCodePoint(code) : fallback, "safeChar");
|
|
27600
27624
|
|
|
27601
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
27625
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.544.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.73.0_commander@15._14d279ae6bc0fc41a3606e009c109ba5/node_modules/@wirecat/cli-core/dist/readers/html/page.js
|
|
27602
27626
|
var clean = /* @__PURE__ */ __name((value) => typeof value === "string" ? value.replace(/\s+/g, " ").trim() : "", "clean");
|
|
27603
27627
|
var namesIn = /* @__PURE__ */ __name((value) => [value].flat().map((entry) => typeof entry === "string" ? clean(entry) : clean(entry?.name)).filter(Boolean).join(", "), "namesIn");
|
|
27604
27628
|
var jsonLdNodes = /* @__PURE__ */ __name((document) => {
|
|
@@ -27654,7 +27678,7 @@ var markdownSections = /* @__PURE__ */ __name((text2) => {
|
|
|
27654
27678
|
return found.map((section, index) => ({ ...section, end: found[index + 1]?.start ?? text2.length }));
|
|
27655
27679
|
}, "markdownSections");
|
|
27656
27680
|
|
|
27657
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
27681
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.544.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.73.0_commander@15._14d279ae6bc0fc41a3606e009c109ba5/node_modules/@wirecat/cli-core/dist/readers/html/index.js
|
|
27658
27682
|
var HTML = /* @__PURE__ */ new Set([".html", ".htm", ".xhtml"]);
|
|
27659
27683
|
var first = /* @__PURE__ */ __name((...values) => values.find((value) => typeof value === "string" && value !== ""), "first");
|
|
27660
27684
|
var loaded = /* @__PURE__ */ __name(async (load, name) => {
|
|
@@ -27725,7 +27749,7 @@ var html = {
|
|
|
27725
27749
|
}, "read")
|
|
27726
27750
|
};
|
|
27727
27751
|
|
|
27728
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
27752
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.544.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.73.0_commander@15._14d279ae6bc0fc41a3606e009c109ba5/node_modules/@wirecat/cli-core/dist/readers/office/index.js
|
|
27729
27753
|
var office = {
|
|
27730
27754
|
id: "office",
|
|
27731
27755
|
version: documentExtractor("odt"),
|
|
@@ -27736,7 +27760,7 @@ var office = {
|
|
|
27736
27760
|
}, "read")
|
|
27737
27761
|
};
|
|
27738
27762
|
|
|
27739
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
27763
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.544.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.73.0_commander@15._14d279ae6bc0fc41a3606e009c109ba5/node_modules/@wirecat/cli-core/dist/readers/pdf/index.js
|
|
27740
27764
|
var pdf = {
|
|
27741
27765
|
id: "pdf",
|
|
27742
27766
|
version: "unpdf",
|
|
@@ -27803,7 +27827,7 @@ var pdf = {
|
|
|
27803
27827
|
}), "read")
|
|
27804
27828
|
};
|
|
27805
27829
|
|
|
27806
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
27830
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.544.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.73.0_commander@15._14d279ae6bc0fc41a3606e009c109ba5/node_modules/@wirecat/cli-core/dist/readers/plain/index.js
|
|
27807
27831
|
var PLAIN = /* @__PURE__ */ new Set([".txt", ".md", ".markdown", ".csv", ".tsv", ".json", ".log"]);
|
|
27808
27832
|
var isPlain = /* @__PURE__ */ __name((hint) => PLAIN.has(extensionOf(hint)) || hint.mime?.startsWith("text/") || hint.mime === "application/json", "isPlain");
|
|
27809
27833
|
var readPlain = /* @__PURE__ */ __name((bytes2) => {
|
|
@@ -27823,7 +27847,7 @@ var plain = {
|
|
|
27823
27847
|
read: /* @__PURE__ */ __name(async (bytes2) => readPlain(bytes2), "read")
|
|
27824
27848
|
};
|
|
27825
27849
|
|
|
27826
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
27850
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.544.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.73.0_commander@15._14d279ae6bc0fc41a3606e009c109ba5/node_modules/@wirecat/cli-core/dist/readers/rtf/index.js
|
|
27827
27851
|
var rtf = {
|
|
27828
27852
|
id: "rtf",
|
|
27829
27853
|
version: "v1",
|
|
@@ -27831,10 +27855,10 @@ var rtf = {
|
|
|
27831
27855
|
read: /* @__PURE__ */ __name(async (bytes2) => derived(bytes2, "rtf:v1", rtfText), "read")
|
|
27832
27856
|
};
|
|
27833
27857
|
|
|
27834
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
27858
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.544.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.73.0_commander@15._14d279ae6bc0fc41a3606e009c109ba5/node_modules/@wirecat/cli-core/dist/readers/sheets/index.js
|
|
27835
27859
|
import { basename as basename5 } from "node:path";
|
|
27836
27860
|
|
|
27837
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
27861
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.544.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.73.0_commander@15._14d279ae6bc0fc41a3606e009c109ba5/node_modules/@wirecat/cli-core/dist/attachments/csv-spans.js
|
|
27838
27862
|
var delimitedSpans = /* @__PURE__ */ __name((text2, delimiter, maxCells = 1e4) => {
|
|
27839
27863
|
const cells = [];
|
|
27840
27864
|
let row = 1, column = 1, start = 0, quoted = false, truncated = false;
|
|
@@ -27872,7 +27896,7 @@ var delimitedSpans = /* @__PURE__ */ __name((text2, delimiter, maxCells = 1e4) =
|
|
|
27872
27896
|
return { cells, truncated };
|
|
27873
27897
|
}, "delimitedSpans");
|
|
27874
27898
|
|
|
27875
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
27899
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.544.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.73.0_commander@15._14d279ae6bc0fc41a3606e009c109ba5/node_modules/@wirecat/cli-core/dist/readers/sheets/index.js
|
|
27876
27900
|
var DELIMITED = {
|
|
27877
27901
|
".csv": ",",
|
|
27878
27902
|
".tsv": " ",
|
|
@@ -27911,7 +27935,7 @@ var sheets = {
|
|
|
27911
27935
|
}, "read")
|
|
27912
27936
|
};
|
|
27913
27937
|
|
|
27914
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
27938
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.544.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.73.0_commander@15._14d279ae6bc0fc41a3606e009c109ba5/node_modules/@wirecat/cli-core/dist/readers/registry.js
|
|
27915
27939
|
var BUILT_INS2 = [office, pdf, docx, doc, rtf, html, sheets, plain, image2];
|
|
27916
27940
|
var HEAD_BYTES = 1024;
|
|
27917
27941
|
var readers = [...BUILT_INS2];
|
|
@@ -27921,7 +27945,7 @@ var readWithRegistry = /* @__PURE__ */ __name(async (bytes2, hint, context2) =>
|
|
|
27921
27945
|
return reader ? reader.read(bytes2, hint, context2) : { status: "unsupported" };
|
|
27922
27946
|
}, "readWithRegistry");
|
|
27923
27947
|
|
|
27924
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
27948
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.544.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.73.0_commander@15._14d279ae6bc0fc41a3606e009c109ba5/node_modules/@wirecat/cli-core/dist/attachments/extract.js
|
|
27925
27949
|
var importEngine = /* @__PURE__ */ __name((name) => importFrom(new URL("attachments/extract.js", import.meta.resolve("@wirecat/cli-core")).href, name), "importEngine");
|
|
27926
27950
|
var extensionOf2 = /* @__PURE__ */ __name(({ name, path }) => extname3(name ?? path).toLowerCase(), "extensionOf");
|
|
27927
27951
|
var extractText = /* @__PURE__ */ __name(async (bytes2, hint, load, signal, env = process.env) => {
|
|
@@ -29000,7 +29024,7 @@ function imageSize(input) {
|
|
|
29000
29024
|
}
|
|
29001
29025
|
__name(imageSize, "imageSize");
|
|
29002
29026
|
|
|
29003
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
29027
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.544.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.73.0_commander@15._14d279ae6bc0fc41a3606e009c109ba5/node_modules/@wirecat/cli-core/dist/attachments/ocr.js
|
|
29004
29028
|
var MAX_PAGES = 20;
|
|
29005
29029
|
var MAX_PIXELS = 2e7;
|
|
29006
29030
|
var cancelled2 = /* @__PURE__ */ __name((signal) => {
|
|
@@ -29151,7 +29175,7 @@ var ocrPdf = /* @__PURE__ */ __name(async (bytes2, pipeline2, load, signal) => {
|
|
|
29151
29175
|
}
|
|
29152
29176
|
}, "ocrPdf");
|
|
29153
29177
|
|
|
29154
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
29178
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.544.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.73.0_commander@15._14d279ae6bc0fc41a3606e009c109ba5/node_modules/@wirecat/cli-core/dist/attachments/pdf-preview.js
|
|
29155
29179
|
var pdfPreview = /* @__PURE__ */ __name(async (bytes2, page, signal, load = importEngine, env = process.env) => {
|
|
29156
29180
|
const limits = pdfPreviewLimits(env);
|
|
29157
29181
|
const cancelled4 = /* @__PURE__ */ __name(() => {
|
|
@@ -29228,7 +29252,7 @@ var pdfPreview = /* @__PURE__ */ __name(async (bytes2, page, signal, load = impo
|
|
|
29228
29252
|
}
|
|
29229
29253
|
}, "pdfPreview");
|
|
29230
29254
|
|
|
29231
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
29255
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.544.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.73.0_commander@15._14d279ae6bc0fc41a3606e009c109ba5/node_modules/@wirecat/cli-core/dist/attachments/transfer.js
|
|
29232
29256
|
import { createHash as createHash8 } from "node:crypto";
|
|
29233
29257
|
import { constants } from "node:fs";
|
|
29234
29258
|
import { lstat as lstat3, open as open5 } from "node:fs/promises";
|
|
@@ -29336,7 +29360,121 @@ var transferMime = /* @__PURE__ */ __name((head, hint, name = null) => {
|
|
|
29336
29360
|
return hint !== null && /^[a-z0-9.+-]+\/[a-z0-9.+-]+$/i.test(hint) ? hint : "application/octet-stream";
|
|
29337
29361
|
}, "transferMime");
|
|
29338
29362
|
|
|
29339
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
29363
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.544.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.73.0_commander@15._14d279ae6bc0fc41a3606e009c109ba5/node_modules/@wirecat/cli-core/dist/services/file-download.js
|
|
29364
|
+
import { createWriteStream, mkdirSync } from "node:fs";
|
|
29365
|
+
import { link as link3, rm } from "node:fs/promises";
|
|
29366
|
+
import { join as join11, resolve as resolve6 } from "node:path";
|
|
29367
|
+
import { Readable, Transform } from "node:stream";
|
|
29368
|
+
import { pipeline } from "node:stream/promises";
|
|
29369
|
+
var refreshedFiles = /* @__PURE__ */ __name((files) => files.flatMap(({ kind, name, position, providerRef }) => providerRef === void 0 || Object.keys(providerRef).length === 0 ? [] : [
|
|
29370
|
+
{
|
|
29371
|
+
kind,
|
|
29372
|
+
providerRef,
|
|
29373
|
+
...name === void 0 ? {} : { name },
|
|
29374
|
+
...position === void 0 ? {} : { position }
|
|
29375
|
+
}
|
|
29376
|
+
]), "refreshedFiles");
|
|
29377
|
+
var recordPaths = /* @__PURE__ */ __name(async (messages, chat, message, files, saved, warn, onFailure) => {
|
|
29378
|
+
const downloaded = saved.map((one, index) => ({
|
|
29379
|
+
kind: one.kind,
|
|
29380
|
+
path: one.path,
|
|
29381
|
+
...files[index]?.name === void 0 ? {} : { name: files[index]?.name },
|
|
29382
|
+
...files[index]?.position === void 0 ? {} : { position: files[index]?.position },
|
|
29383
|
+
...files[index]?.providerRef === void 0 ? {} : { providerRef: files[index]?.providerRef }
|
|
29384
|
+
}));
|
|
29385
|
+
try {
|
|
29386
|
+
const kept = await messages.keepDownloaded(chat, message, downloaded);
|
|
29387
|
+
if (kept < downloaded.length && downloaded.some(({ providerRef }) => Object.keys(providerRef ?? {}).length > 0))
|
|
29388
|
+
warn(`message ${message}: a new file reference from the messenger was not saved; the next download asks again`);
|
|
29389
|
+
return kept;
|
|
29390
|
+
} catch (error) {
|
|
29391
|
+
onFailure?.(error);
|
|
29392
|
+
warn(`not recorded in the local store where message ${message}'s files went: ${error.message}`);
|
|
29393
|
+
return 0;
|
|
29394
|
+
}
|
|
29395
|
+
}, "recordPaths");
|
|
29396
|
+
var downloadMessage = /* @__PURE__ */ __name(async (messages, chat, message, output, warn) => {
|
|
29397
|
+
const { files } = await messages.download(chat, message);
|
|
29398
|
+
mkdirSync(output, { recursive: true });
|
|
29399
|
+
const result = await saveFiles(messages, chat, message, files, output, { unique: true, warn });
|
|
29400
|
+
if (result.batch.failed > 0)
|
|
29401
|
+
throw new CliError("provider_error", "some attachments failed; completed downloads are retained", {
|
|
29402
|
+
batch: result.batch,
|
|
29403
|
+
saved: result.saved
|
|
29404
|
+
});
|
|
29405
|
+
return result.saved;
|
|
29406
|
+
}, "downloadMessage");
|
|
29407
|
+
var saveFiles = /* @__PURE__ */ __name(async (messages, chat, message, files, output, { unique = false, warn, onSaved, batch = batchProgress() }) => {
|
|
29408
|
+
const saved = [];
|
|
29409
|
+
const successful = [];
|
|
29410
|
+
for (const [index, file2] of files.entries()) {
|
|
29411
|
+
if (batch.stopped)
|
|
29412
|
+
break;
|
|
29413
|
+
try {
|
|
29414
|
+
const one = await save(file2, output, `${message}-${index + 1}`, { unique });
|
|
29415
|
+
saved.push(one);
|
|
29416
|
+
successful.push(file2);
|
|
29417
|
+
batch.ok();
|
|
29418
|
+
onSaved?.(one);
|
|
29419
|
+
} catch (error) {
|
|
29420
|
+
const issue = batch.fail(message, "download", error, (file2.position ?? index) + 1);
|
|
29421
|
+
warn(`message ${message}, attachment ${(file2.position ?? index) + 1}: ${issue.code} \u2014 ${issue.message}`);
|
|
29422
|
+
}
|
|
29423
|
+
}
|
|
29424
|
+
await recordPaths(messages, chat, message, successful, saved, warn, (error) => batch.fail(message, "record_downloads", error));
|
|
29425
|
+
return { saved, batch: batch.result() };
|
|
29426
|
+
}, "saveFiles");
|
|
29427
|
+
var EXTENSIONS = {
|
|
29428
|
+
"image/jpeg": "jpg",
|
|
29429
|
+
"image/png": "png",
|
|
29430
|
+
"image/webp": "webp",
|
|
29431
|
+
"image/gif": "gif",
|
|
29432
|
+
"video/mp4": "mp4",
|
|
29433
|
+
"video/webm": "webm",
|
|
29434
|
+
"audio/mpeg": "mp3",
|
|
29435
|
+
"audio/ogg": "ogg",
|
|
29436
|
+
"audio/mp4": "m4a",
|
|
29437
|
+
"application/pdf": "pdf"
|
|
29438
|
+
};
|
|
29439
|
+
var BY_KIND = { photo: "jpg" };
|
|
29440
|
+
var save = /* @__PURE__ */ __name(async (file2, directory2, fallbackName, { unique = false } = {}) => {
|
|
29441
|
+
const own = safeName(file2.name);
|
|
29442
|
+
const fileName = /* @__PURE__ */ __name(() => {
|
|
29443
|
+
const extension = EXTENSIONS[file2.mime ?? ""] ?? BY_KIND[file2.kind];
|
|
29444
|
+
return own ?? (extension ? `${fallbackName}.${extension}` : fallbackName);
|
|
29445
|
+
}, "fileName");
|
|
29446
|
+
const partial = join11(directory2, `.${fileName()}.${process.pid}.part`);
|
|
29447
|
+
let bytes2 = 0;
|
|
29448
|
+
const counting = new Transform({
|
|
29449
|
+
transform(chunk, _encoding, done2) {
|
|
29450
|
+
bytes2 += chunk.length;
|
|
29451
|
+
done2(null, chunk);
|
|
29452
|
+
}
|
|
29453
|
+
});
|
|
29454
|
+
try {
|
|
29455
|
+
await pipeline(Readable.from(file2.bytes()), counting, createWriteStream(partial, { flags: "wx", mode: 384 }));
|
|
29456
|
+
const name = fileName();
|
|
29457
|
+
const names2 = unique && own ? [name, `${fallbackName}-${own}`] : [name];
|
|
29458
|
+
for (const candidate of names2) {
|
|
29459
|
+
const path2 = resolve6(join11(directory2, candidate));
|
|
29460
|
+
const taken = await link3(partial, path2).then(() => false, (error) => {
|
|
29461
|
+
if (error.code === "EEXIST")
|
|
29462
|
+
return true;
|
|
29463
|
+
throw error;
|
|
29464
|
+
});
|
|
29465
|
+
if (!taken)
|
|
29466
|
+
return { kind: file2.kind, path: path2, bytes: bytes2 };
|
|
29467
|
+
}
|
|
29468
|
+
const path = resolve6(join11(directory2, names2.at(-1) ?? name));
|
|
29469
|
+
if (unique)
|
|
29470
|
+
return { kind: file2.kind, path, bytes: bytes2, existing: true };
|
|
29471
|
+
throw new CliError("validation_error", `${path} already exists \u2014 nothing was overwritten; choose --output-dir`);
|
|
29472
|
+
} finally {
|
|
29473
|
+
await rm(partial, { force: true });
|
|
29474
|
+
}
|
|
29475
|
+
}, "save");
|
|
29476
|
+
|
|
29477
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.544.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.73.0_commander@15._14d279ae6bc0fc41a3606e009c109ba5/node_modules/@wirecat/cli-core/dist/services/attachments.js
|
|
29340
29478
|
var ATTACHMENT_QUERY = {
|
|
29341
29479
|
entity: "attachment",
|
|
29342
29480
|
backend: "sql",
|
|
@@ -29691,6 +29829,48 @@ var attachmentsService = /* @__PURE__ */ __name((deps) => ({
|
|
|
29691
29829
|
...preview
|
|
29692
29830
|
};
|
|
29693
29831
|
}, "show"),
|
|
29832
|
+
saveHeld: /* @__PURE__ */ __name(async ({ chat, message, attachment: attachment2, output }) => {
|
|
29833
|
+
if (attachment2 !== void 0 && (!Number.isSafeInteger(attachment2) || attachment2 < 1))
|
|
29834
|
+
throw new CliError("validation_error", "attachment must be a position from 1");
|
|
29835
|
+
const store = await accountStore(deps);
|
|
29836
|
+
const { account } = store;
|
|
29837
|
+
const { chatId, messageId } = await messageOf(deps, store, chat, message);
|
|
29838
|
+
const ref = formatLocator({ ...account, chat: chatId, message: messageId });
|
|
29839
|
+
const files = (await store.attachments.attachments({ chatId, messageId, limit: 1e3 })).filter(({ kind }) => !NOT_FILES.has(kind));
|
|
29840
|
+
if (files.length === 0)
|
|
29841
|
+
throw new CliError("not_found", `the local store holds no file of ${ref}`);
|
|
29842
|
+
const chosen = attachment2 === void 0 ? files : files.filter(({ position }) => position === attachment2 - 1);
|
|
29843
|
+
if (chosen.length === 0)
|
|
29844
|
+
throw new CliError("not_found", `${ref} has no file at position ${attachment2}; its files are at ${files.map(({ position }) => position + 1).join(", ")}`);
|
|
29845
|
+
const env = deps.env ?? process.env;
|
|
29846
|
+
const held = await Promise.all(chosen.map(async (file2) => {
|
|
29847
|
+
const missing4 = new CliError("not_found", `file ${file2.position + 1} of ${ref} is not saved on this computer; run messages download without --offline`);
|
|
29848
|
+
if (file2.localPath === null)
|
|
29849
|
+
throw missing4;
|
|
29850
|
+
if (refusedPlace(file2.localPath, deps.messenger.app, env))
|
|
29851
|
+
throw new CliError("validation_error", "cannot copy known credential files, the WireCat apps' own files or the message store");
|
|
29852
|
+
const found = await lstat4(file2.localPath).catch(() => void 0);
|
|
29853
|
+
if (!found)
|
|
29854
|
+
throw missing4;
|
|
29855
|
+
if (!found.isFile())
|
|
29856
|
+
throw new CliError("validation_error", "the saved attachment must be a regular file");
|
|
29857
|
+
return { file: file2, path: file2.localPath };
|
|
29858
|
+
}));
|
|
29859
|
+
mkdirSync2(output, { recursive: true });
|
|
29860
|
+
const saved = [];
|
|
29861
|
+
for (const { file: file2, path } of held)
|
|
29862
|
+
saved.push(await save({
|
|
29863
|
+
kind: file2.kind,
|
|
29864
|
+
...file2.name === null ? {} : { name: file2.name },
|
|
29865
|
+
...file2.mime === null ? {} : { mime: file2.mime },
|
|
29866
|
+
position: file2.position,
|
|
29867
|
+
bytes: /* @__PURE__ */ __name(async function* () {
|
|
29868
|
+
const handle = await open6(path, constants2.O_RDONLY | (constants2.O_NOFOLLOW ?? 0));
|
|
29869
|
+
yield* handle.createReadStream();
|
|
29870
|
+
}, "bytes")
|
|
29871
|
+
}, output, `${messageId}-${file2.position + 1}`));
|
|
29872
|
+
return saved;
|
|
29873
|
+
}, "saveHeld"),
|
|
29694
29874
|
setText: /* @__PURE__ */ __name(async ({ chat, message, attachment: attachment2, text: text2 }) => {
|
|
29695
29875
|
if (text2.trim() === "")
|
|
29696
29876
|
throw new CliError("validation_error", "the text is empty \u2014 nothing to keep");
|
|
@@ -29717,7 +29897,7 @@ var attachmentsService = /* @__PURE__ */ __name((deps) => ({
|
|
|
29717
29897
|
}, "setText")
|
|
29718
29898
|
}), "attachmentsService");
|
|
29719
29899
|
|
|
29720
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
29900
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.544.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.73.0_commander@15._14d279ae6bc0fc41a3606e009c109ba5/node_modules/@wirecat/cli-core/dist/services/chat-documents.js
|
|
29721
29901
|
var chatDocumentsService = /* @__PURE__ */ __name((deps) => ({
|
|
29722
29902
|
list: /* @__PURE__ */ __name(async (chat, { limit, offset, ref }) => {
|
|
29723
29903
|
const store = await accountStore(deps);
|
|
@@ -29747,7 +29927,7 @@ var chatDocumentsService = /* @__PURE__ */ __name((deps) => ({
|
|
|
29747
29927
|
}, "list")
|
|
29748
29928
|
}), "chatDocumentsService");
|
|
29749
29929
|
|
|
29750
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
29930
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.544.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.73.0_commander@15._14d279ae6bc0fc41a3606e009c109ba5/node_modules/@wirecat/cli-core/dist/services/retention.js
|
|
29751
29931
|
var observationDuration = /* @__PURE__ */ __name((text2, flag) => {
|
|
29752
29932
|
const match = /^(\d+(?:\.\d+)?)([smhdw])$/.exec(text2);
|
|
29753
29933
|
const units2 = { s: 1e3, m: 6e4, h: 36e5, d: 864e5, w: 6048e5 };
|
|
@@ -29834,7 +30014,7 @@ var isRetentionSelection = /* @__PURE__ */ __name((selection) => {
|
|
|
29834
30014
|
}
|
|
29835
30015
|
}, "isRetentionSelection");
|
|
29836
30016
|
|
|
29837
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
30017
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.544.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.73.0_commander@15._14d279ae6bc0fc41a3606e009c109ba5/node_modules/@wirecat/cli-core/dist/services/counters.js
|
|
29838
30018
|
var counterFields = /* @__PURE__ */ __name((text2 = "views,reactions,comments") => {
|
|
29839
30019
|
const fields = text2.split(",").map((one) => one.trim());
|
|
29840
30020
|
if (!fields.length || fields.some((one) => !COUNTER_FIELDS.includes(one)) || new Set(fields).size !== fields.length)
|
|
@@ -30041,7 +30221,7 @@ var countersService = /* @__PURE__ */ __name((deps) => {
|
|
|
30041
30221
|
};
|
|
30042
30222
|
}, "countersService");
|
|
30043
30223
|
|
|
30044
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
30224
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.544.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.73.0_commander@15._14d279ae6bc0fc41a3606e009c109ba5/node_modules/@wirecat/cli-core/dist/services/search-refresh.js
|
|
30045
30225
|
var SYNC_KEY = "messages.sync-first";
|
|
30046
30226
|
var SYNC_BOUNDS = { maxChats: 5, timeMs: 3e4, maxMessages: 500 };
|
|
30047
30227
|
var keyOf2 = /* @__PURE__ */ __name((chat) => JSON.stringify([chat.account.provider, chat.account.account, chat.chatId]), "keyOf");
|
|
@@ -30173,7 +30353,7 @@ var withRefresh = /* @__PURE__ */ __name((found, refreshed) => ({
|
|
|
30173
30353
|
...!refreshed || refreshed.complete ? {} : { coverage: { ...found.coverage, state: "stale" } }
|
|
30174
30354
|
}), "withRefresh");
|
|
30175
30355
|
|
|
30176
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
30356
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.544.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.73.0_commander@15._14d279ae6bc0fc41a3606e009c109ba5/node_modules/@wirecat/cli-core/dist/services/embeddings-search.js
|
|
30177
30357
|
var CANDIDATES = 50;
|
|
30178
30358
|
var WORD_HITS = 200;
|
|
30179
30359
|
var RRF_K = 60;
|
|
@@ -30448,13 +30628,13 @@ var meanOf = /* @__PURE__ */ __name((vectors) => {
|
|
|
30448
30628
|
return mean.map((value) => value / length);
|
|
30449
30629
|
}, "meanOf");
|
|
30450
30630
|
|
|
30451
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
30631
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.544.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.73.0_commander@15._14d279ae6bc0fc41a3606e009c109ba5/node_modules/@wirecat/cli-core/dist/services/embeddings.js
|
|
30452
30632
|
var embeddingsService = /* @__PURE__ */ __name((deps) => ({
|
|
30453
30633
|
...embeddingsMaintenance(deps),
|
|
30454
30634
|
...embeddingsSearch(deps)
|
|
30455
30635
|
}), "embeddingsService");
|
|
30456
30636
|
|
|
30457
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
30637
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.544.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.73.0_commander@15._14d279ae6bc0fc41a3606e009c109ba5/node_modules/@wirecat/cli-core/dist/services/folders.js
|
|
30458
30638
|
var foldersService = /* @__PURE__ */ __name((deps) => {
|
|
30459
30639
|
const online = /* @__PURE__ */ __name(async (command) => {
|
|
30460
30640
|
if (deps.offline)
|
|
@@ -30595,7 +30775,7 @@ var foldersService = /* @__PURE__ */ __name((deps) => {
|
|
|
30595
30775
|
};
|
|
30596
30776
|
}, "foldersService");
|
|
30597
30777
|
|
|
30598
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
30778
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.544.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.73.0_commander@15._14d279ae6bc0fc41a3606e009c109ba5/node_modules/@wirecat/cli-core/dist/services/mentions.js
|
|
30599
30779
|
var REVIEW_COUNT = 500;
|
|
30600
30780
|
var mentionsService = /* @__PURE__ */ __name((deps) => {
|
|
30601
30781
|
const located = /* @__PURE__ */ __name(async () => {
|
|
@@ -30674,7 +30854,14 @@ var mentionsService = /* @__PURE__ */ __name((deps) => {
|
|
|
30674
30854
|
};
|
|
30675
30855
|
}, "mentionsService");
|
|
30676
30856
|
|
|
30677
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
30857
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.544.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.73.0_commander@15._14d279ae6bc0fc41a3606e009c109ba5/node_modules/@wirecat/cli-core/dist/domain/message-link.js
|
|
30858
|
+
var fileLinks = /* @__PURE__ */ __name((attachments) => hitFiles(attachments).map(({ position, kind, name }) => ({
|
|
30859
|
+
position,
|
|
30860
|
+
kind,
|
|
30861
|
+
...name === void 0 ? {} : { name },
|
|
30862
|
+
url: null,
|
|
30863
|
+
reason: "unsupported_provider"
|
|
30864
|
+
})), "fileLinks");
|
|
30678
30865
|
var messageLinkTarget = /* @__PURE__ */ __name((reference, message, provider) => {
|
|
30679
30866
|
if (isLocator(reference)) {
|
|
30680
30867
|
if (message !== void 0)
|
|
@@ -30721,7 +30908,7 @@ var validatePermalink = /* @__PURE__ */ __name((link4) => {
|
|
|
30721
30908
|
return { url: link4.url, access: link4.access, reason: link4.reason };
|
|
30722
30909
|
}, "validatePermalink");
|
|
30723
30910
|
|
|
30724
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
30911
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.544.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.73.0_commander@15._14d279ae6bc0fc41a3606e009c109ba5/node_modules/@wirecat/cli-core/dist/domain/pin-duration.js
|
|
30725
30912
|
var spokenSeconds = /* @__PURE__ */ __name((seconds) => {
|
|
30726
30913
|
if (seconds % 86400 === 0 && seconds > 86400)
|
|
30727
30914
|
return `${seconds / 86400}d`;
|
|
@@ -30753,7 +30940,7 @@ var pinDurationOf = /* @__PURE__ */ __name((value, allowed, flag = "--expire-tim
|
|
|
30753
30940
|
return seconds;
|
|
30754
30941
|
}, "pinDurationOf");
|
|
30755
30942
|
|
|
30756
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
30943
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.544.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.73.0_commander@15._14d279ae6bc0fc41a3606e009c109ba5/node_modules/@wirecat/cli-core/dist/sends/send-as.js
|
|
30757
30944
|
var sendAsCheck = /* @__PURE__ */ __name((connection, sendAs) => {
|
|
30758
30945
|
if (sendAs === void 0) {
|
|
30759
30946
|
const saved = connection.savedSender?.bind(connection);
|
|
@@ -30778,7 +30965,7 @@ var typedSendAs = /* @__PURE__ */ __name((typed) => {
|
|
|
30778
30965
|
return sendAs;
|
|
30779
30966
|
}, "typedSendAs");
|
|
30780
30967
|
|
|
30781
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
30968
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.544.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.73.0_commander@15._14d279ae6bc0fc41a3606e009c109ba5/node_modules/@wirecat/cli-core/dist/search/total.js
|
|
30782
30969
|
var TOTAL_CAP = 1e4;
|
|
30783
30970
|
var totalOf = /* @__PURE__ */ __name((count4, shown, hasMore, exact = true) => {
|
|
30784
30971
|
const least = shown + (hasMore ? 1 : 0);
|
|
@@ -30789,7 +30976,7 @@ var totalOf = /* @__PURE__ */ __name((count4, shown, hasMore, exact = true) => {
|
|
|
30789
30976
|
return { value: count4, relation: exact ? "eq" : "gte" };
|
|
30790
30977
|
}, "totalOf");
|
|
30791
30978
|
|
|
30792
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
30979
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.544.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.73.0_commander@15._14d279ae6bc0fc41a3606e009c109ba5/node_modules/@wirecat/cli-core/dist/search/lucene/meaning-parts.js
|
|
30793
30980
|
var WORD_FIELDS = /* @__PURE__ */ new Set(["text", "exact"]);
|
|
30794
30981
|
var fieldsOfQuery = /* @__PURE__ */ __name((root, everything) => {
|
|
30795
30982
|
let narrows = false;
|
|
@@ -30818,7 +31005,7 @@ var meaningWords = /* @__PURE__ */ __name((root) => {
|
|
|
30818
31005
|
return wanted(root).join(" ").trim();
|
|
30819
31006
|
}, "meaningWords");
|
|
30820
31007
|
|
|
30821
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
31008
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.544.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.73.0_commander@15._14d279ae6bc0fc41a3606e009c109ba5/node_modules/@wirecat/cli-core/dist/search/question-plan.js
|
|
30822
31009
|
var words = /* @__PURE__ */ __name((text2) => normalize(text2).match(/[\p{L}\p{N}]+/gu) ?? [], "words");
|
|
30823
31010
|
var scaffolding = new Set(words("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"));
|
|
30824
31011
|
var questionWord = /\b(?:what|which|how|who|where|when|can|could|should)\b|(?:^|\s)(?:сколько|какой|какая|какие|какое|кто|кому|кем|где|когда|как|что|можно|может|могут|ли)(?:\s|$)/iu;
|
|
@@ -30933,7 +31120,7 @@ function planQuestion(text2, strict = false) {
|
|
|
30933
31120
|
}
|
|
30934
31121
|
__name(planQuestion, "planQuestion");
|
|
30935
31122
|
|
|
30936
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
31123
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.544.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.73.0_commander@15._14d279ae6bc0fc41a3606e009c109ba5/node_modules/@wirecat/cli-core/dist/services/messages-combined.js
|
|
30937
31124
|
var COMBINED_DEFAULTS = { candidateDepth: 300, rrfK: 60, rerank: "all", chatCap: 0 };
|
|
30938
31125
|
var tokensOf = /* @__PURE__ */ __name((text2) => normalize(text2).match(/[\p{L}\p{N}\p{Co}\p{M}]+/gu) ?? [], "tokensOf");
|
|
30939
31126
|
var searchCombined = /* @__PURE__ */ __name(async (store, account, request, messenger = {}, options = COMBINED_DEFAULTS) => {
|
|
@@ -31126,7 +31313,7 @@ var signals = /* @__PURE__ */ __name((hit, terms, corrections, execution, mode,
|
|
|
31126
31313
|
return mode === "coverage" ? coverage * 4 : mode === "proximity" ? proximity : mode === "phrase" ? phrase : coverage * 4 + proximity + phrase;
|
|
31127
31314
|
}, "signals");
|
|
31128
31315
|
|
|
31129
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
31316
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.544.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.73.0_commander@15._14d279ae6bc0fc41a3606e009c109ba5/node_modules/@wirecat/cli-core/dist/services/messages-discovery.js
|
|
31130
31317
|
var MEANING_DEPTH = 100;
|
|
31131
31318
|
var RRF_K2 = 60;
|
|
31132
31319
|
var RERANK_DEPTH = 50;
|
|
@@ -31454,7 +31641,7 @@ var mixedWithReranker = /* @__PURE__ */ __name((head, scores) => {
|
|
|
31454
31641
|
})).sort((a, b) => b.mixed - a.mixed).map(({ hit }) => hit);
|
|
31455
31642
|
}, "mixedWithReranker");
|
|
31456
31643
|
|
|
31457
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
31644
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.544.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.73.0_commander@15._14d279ae6bc0fc41a3606e009c109ba5/node_modules/@wirecat/cli-core/dist/services/thread-context.js
|
|
31458
31645
|
var THREAD_BOUNDS = { maxHops: 8, maxMessages: 50, maxBytes: 65536, withinMs: 864e5 };
|
|
31459
31646
|
var bytes = /* @__PURE__ */ __name((items, links) => Buffer.byteLength(JSON.stringify({ items, links }), "utf8"), "bytes");
|
|
31460
31647
|
var threadBounds = /* @__PURE__ */ __name((options = {}) => {
|
|
@@ -31653,7 +31840,7 @@ var readThreadContext = /* @__PURE__ */ __name(async (store, account, chat, mess
|
|
|
31653
31840
|
return result;
|
|
31654
31841
|
}, "readThreadContext");
|
|
31655
31842
|
|
|
31656
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
31843
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.544.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.73.0_commander@15._14d279ae6bc0fc41a3606e009c109ba5/node_modules/@wirecat/cli-core/dist/services/messages-archive-search.js
|
|
31657
31844
|
var SEARCH_FILL_MS = 200;
|
|
31658
31845
|
var statsStore = /* @__PURE__ */ __name(async (store, account, request, messenger = {}) => {
|
|
31659
31846
|
const stop = Date.now() + SEARCH_FILL_MS;
|
|
@@ -31720,12 +31907,12 @@ var accountOf2 = /* @__PURE__ */ __name((hit) => {
|
|
|
31720
31907
|
}, "accountOf");
|
|
31721
31908
|
var keyOf3 = /* @__PURE__ */ __name(({ provider, account }) => `${provider}/${account}`, "keyOf");
|
|
31722
31909
|
|
|
31723
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
31910
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.544.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.73.0_commander@15._14d279ae6bc0fc41a3606e009c109ba5/node_modules/@wirecat/cli-core/dist/services/pictures.js
|
|
31724
31911
|
import { createHash as createHash10 } from "node:crypto";
|
|
31725
31912
|
import { readFile as readFile2, stat as stat3 } from "node:fs/promises";
|
|
31726
31913
|
import { setTimeout as sleep4 } from "node:timers/promises";
|
|
31727
31914
|
|
|
31728
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
31915
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.544.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.73.0_commander@15._14d279ae6bc0fc41a3606e009c109ba5/node_modules/@wirecat/cli-core/dist/domain/models.js
|
|
31729
31916
|
var GROUP_SETTINGS = [
|
|
31730
31917
|
"allCanPin",
|
|
31731
31918
|
"onlyAdminsAdd",
|
|
@@ -31739,130 +31926,7 @@ var ADMIN_RIGHTS = ["read", "members", "admins", "info", "pin", "link", "post",
|
|
|
31739
31926
|
var senderIsMe = /* @__PURE__ */ __name((message, account) => message.outgoing === true || message.senderId !== null && String(message.senderId) === account, "senderIsMe");
|
|
31740
31927
|
var MEDIA_KINDS = ["photo", "video", "file", "audio", "link"];
|
|
31741
31928
|
|
|
31742
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
31743
|
-
import { createWriteStream, mkdirSync } from "node:fs";
|
|
31744
|
-
import { link as link3, rm } from "node:fs/promises";
|
|
31745
|
-
import { basename as basename6, join as join11, resolve as resolve6 } from "node:path";
|
|
31746
|
-
import { Readable, Transform } from "node:stream";
|
|
31747
|
-
import { pipeline } from "node:stream/promises";
|
|
31748
|
-
var refreshedFiles = /* @__PURE__ */ __name((files) => files.flatMap(({ kind, name, position, providerRef }) => providerRef === void 0 || Object.keys(providerRef).length === 0 ? [] : [
|
|
31749
|
-
{
|
|
31750
|
-
kind,
|
|
31751
|
-
providerRef,
|
|
31752
|
-
...name === void 0 ? {} : { name },
|
|
31753
|
-
...position === void 0 ? {} : { position }
|
|
31754
|
-
}
|
|
31755
|
-
]), "refreshedFiles");
|
|
31756
|
-
var recordPaths = /* @__PURE__ */ __name(async (messages, chat, message, files, saved, warn, onFailure) => {
|
|
31757
|
-
const downloaded = saved.map((one, index) => ({
|
|
31758
|
-
kind: one.kind,
|
|
31759
|
-
path: one.path,
|
|
31760
|
-
...files[index]?.name === void 0 ? {} : { name: files[index]?.name },
|
|
31761
|
-
...files[index]?.position === void 0 ? {} : { position: files[index]?.position },
|
|
31762
|
-
...files[index]?.providerRef === void 0 ? {} : { providerRef: files[index]?.providerRef }
|
|
31763
|
-
}));
|
|
31764
|
-
try {
|
|
31765
|
-
const kept = await messages.keepDownloaded(chat, message, downloaded);
|
|
31766
|
-
if (kept < downloaded.length && downloaded.some(({ providerRef }) => Object.keys(providerRef ?? {}).length > 0))
|
|
31767
|
-
warn(`message ${message}: a new file reference from the messenger was not saved; the next download asks again`);
|
|
31768
|
-
return kept;
|
|
31769
|
-
} catch (error) {
|
|
31770
|
-
onFailure?.(error);
|
|
31771
|
-
warn(`not recorded in the local store where message ${message}'s files went: ${error.message}`);
|
|
31772
|
-
return 0;
|
|
31773
|
-
}
|
|
31774
|
-
}, "recordPaths");
|
|
31775
|
-
var downloadMessage = /* @__PURE__ */ __name(async (messages, chat, message, output, warn) => {
|
|
31776
|
-
const { files } = await messages.download(chat, message);
|
|
31777
|
-
mkdirSync(output, { recursive: true });
|
|
31778
|
-
const result = await saveFiles(messages, chat, message, files, output, { unique: true, warn });
|
|
31779
|
-
if (result.batch.failed > 0)
|
|
31780
|
-
throw new CliError("provider_error", "some attachments failed; completed downloads are retained", {
|
|
31781
|
-
batch: result.batch,
|
|
31782
|
-
saved: result.saved
|
|
31783
|
-
});
|
|
31784
|
-
return result.saved;
|
|
31785
|
-
}, "downloadMessage");
|
|
31786
|
-
var saveFiles = /* @__PURE__ */ __name(async (messages, chat, message, files, output, { unique = false, warn, onSaved, batch = batchProgress() }) => {
|
|
31787
|
-
const saved = [];
|
|
31788
|
-
const successful = [];
|
|
31789
|
-
for (const [index, file2] of files.entries()) {
|
|
31790
|
-
if (batch.stopped)
|
|
31791
|
-
break;
|
|
31792
|
-
try {
|
|
31793
|
-
const one = await save(file2, output, `${message}-${index + 1}`, { unique });
|
|
31794
|
-
saved.push(one);
|
|
31795
|
-
successful.push(file2);
|
|
31796
|
-
batch.ok();
|
|
31797
|
-
onSaved?.(one);
|
|
31798
|
-
} catch (error) {
|
|
31799
|
-
const issue = batch.fail(message, "download", error, (file2.position ?? index) + 1);
|
|
31800
|
-
warn(`message ${message}, attachment ${(file2.position ?? index) + 1}: ${issue.code} \u2014 ${issue.message}`);
|
|
31801
|
-
}
|
|
31802
|
-
}
|
|
31803
|
-
await recordPaths(messages, chat, message, successful, saved, warn, (error) => batch.fail(message, "record_downloads", error));
|
|
31804
|
-
return { saved, batch: batch.result() };
|
|
31805
|
-
}, "saveFiles");
|
|
31806
|
-
var EXTENSIONS = {
|
|
31807
|
-
"image/jpeg": "jpg",
|
|
31808
|
-
"image/png": "png",
|
|
31809
|
-
"image/webp": "webp",
|
|
31810
|
-
"image/gif": "gif",
|
|
31811
|
-
"video/mp4": "mp4",
|
|
31812
|
-
"video/webm": "webm",
|
|
31813
|
-
"audio/mpeg": "mp3",
|
|
31814
|
-
"audio/ogg": "ogg",
|
|
31815
|
-
"audio/mp4": "m4a",
|
|
31816
|
-
"application/pdf": "pdf"
|
|
31817
|
-
};
|
|
31818
|
-
var BY_KIND = { photo: "jpg" };
|
|
31819
|
-
var safeName2 = /* @__PURE__ */ __name((name, platform = process.platform) => {
|
|
31820
|
-
let plain2 = name === void 0 ? "" : basename6(name.replaceAll("\\", "/")).replace(/[\p{Cc}---]/gu, "").replace(/^\.+/, "");
|
|
31821
|
-
if (platform === "win32") {
|
|
31822
|
-
plain2 = plain2.replace(/[<>:"|?*]/g, "_").replace(/[. ]+$/, "");
|
|
31823
|
-
if (/^(con|prn|aux|nul|com[1-9]|lpt[1-9])(?:\.|$)/i.test(plain2))
|
|
31824
|
-
return void 0;
|
|
31825
|
-
}
|
|
31826
|
-
return plain2 === "" ? void 0 : plain2;
|
|
31827
|
-
}, "safeName");
|
|
31828
|
-
var save = /* @__PURE__ */ __name(async (file2, directory2, fallbackName, { unique = false } = {}) => {
|
|
31829
|
-
const own = safeName2(file2.name);
|
|
31830
|
-
const fileName = /* @__PURE__ */ __name(() => {
|
|
31831
|
-
const extension = EXTENSIONS[file2.mime ?? ""] ?? BY_KIND[file2.kind];
|
|
31832
|
-
return own ?? (extension ? `${fallbackName}.${extension}` : fallbackName);
|
|
31833
|
-
}, "fileName");
|
|
31834
|
-
const partial = join11(directory2, `.${fileName()}.${process.pid}.part`);
|
|
31835
|
-
let bytes2 = 0;
|
|
31836
|
-
const counting = new Transform({
|
|
31837
|
-
transform(chunk, _encoding, done2) {
|
|
31838
|
-
bytes2 += chunk.length;
|
|
31839
|
-
done2(null, chunk);
|
|
31840
|
-
}
|
|
31841
|
-
});
|
|
31842
|
-
try {
|
|
31843
|
-
await pipeline(Readable.from(file2.bytes()), counting, createWriteStream(partial, { flags: "wx", mode: 384 }));
|
|
31844
|
-
const name = fileName();
|
|
31845
|
-
const names2 = unique && own ? [name, `${fallbackName}-${own}`] : [name];
|
|
31846
|
-
for (const candidate of names2) {
|
|
31847
|
-
const path2 = resolve6(join11(directory2, candidate));
|
|
31848
|
-
const taken = await link3(partial, path2).then(() => false, (error) => {
|
|
31849
|
-
if (error.code === "EEXIST")
|
|
31850
|
-
return true;
|
|
31851
|
-
throw error;
|
|
31852
|
-
});
|
|
31853
|
-
if (!taken)
|
|
31854
|
-
return { kind: file2.kind, path: path2, bytes: bytes2 };
|
|
31855
|
-
}
|
|
31856
|
-
const path = resolve6(join11(directory2, names2.at(-1) ?? name));
|
|
31857
|
-
if (unique)
|
|
31858
|
-
return { kind: file2.kind, path, bytes: bytes2, existing: true };
|
|
31859
|
-
throw new CliError("validation_error", `${path} already exists \u2014 nothing was overwritten; choose --output-dir`);
|
|
31860
|
-
} finally {
|
|
31861
|
-
await rm(partial, { force: true });
|
|
31862
|
-
}
|
|
31863
|
-
}, "save");
|
|
31864
|
-
|
|
31865
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.517.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.68.1_commander@15._6629eebba461c30d3c69d5318744d1d9/node_modules/@wirecat/cli-core/dist/services/pictures.js
|
|
31929
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.544.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.73.0_commander@15._14d279ae6bc0fc41a3606e009c109ba5/node_modules/@wirecat/cli-core/dist/services/pictures.js
|
|
31866
31930
|
var PICTURE_MAX_BYTES = 25 * 1024 * 1024;
|
|
31867
31931
|
var PICTURE_FLOOR = 0.25;
|
|
31868
31932
|
var PAGE5 = 50;
|
|
@@ -31879,7 +31943,7 @@ var picturesService = /* @__PURE__ */ __name((deps) => {
|
|
|
31879
31943
|
const directory2 = imageModelsDirectory(deps.env);
|
|
31880
31944
|
if (!isImageModelInstalled(model2, directory2))
|
|
31881
31945
|
throw new CliError("not_found", missingModel(model2.id), { reason: "model.not-downloaded", model: model2.id });
|
|
31882
|
-
const { openPictureEmbedder } = await import("./embedder-
|
|
31946
|
+
const { openPictureEmbedder } = await import("./embedder-GSWBGHRK.js");
|
|
31883
31947
|
return openPictureEmbedder(model2, directory2);
|
|
31884
31948
|
}, "open");
|
|
31885
31949
|
const embedder = /* @__PURE__ */ __name(() => {
|
|
@@ -32076,7 +32140,7 @@ var withPictures = /* @__PURE__ */ __name((messages, pictures) => ({
|
|
|
32076
32140
|
}, "search")
|
|
32077
32141
|
}), "withPictures");
|
|
32078
32142
|
|
|
32079
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
32143
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.544.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.73.0_commander@15._14d279ae6bc0fc41a3606e009c109ba5/node_modules/@wirecat/cli-core/dist/services/messages-meaning.js
|
|
32080
32144
|
var meaningLane = /* @__PURE__ */ __name((deps) => async (question, accounts, shared, within) => {
|
|
32081
32145
|
const target2 = embeddingTarget(deps, DEFAULT_TEXT_MODEL);
|
|
32082
32146
|
const skipped = /* @__PURE__ */ __name((reason, step) => ({
|
|
@@ -32125,7 +32189,7 @@ var meaningLane = /* @__PURE__ */ __name((deps) => async (question, accounts, sh
|
|
|
32125
32189
|
}
|
|
32126
32190
|
}, "meaningLane");
|
|
32127
32191
|
|
|
32128
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
32192
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.544.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.73.0_commander@15._14d279ae6bc0fc41a3606e009c109ba5/node_modules/@wirecat/cli-core/dist/services/messages-rerank.js
|
|
32129
32193
|
var rerankLane = /* @__PURE__ */ __name((deps) => {
|
|
32130
32194
|
const choice = deps.reranker ?? DEFAULT_RERANK_MODEL;
|
|
32131
32195
|
if (choice === "off")
|
|
@@ -32137,9 +32201,9 @@ var rerankLane = /* @__PURE__ */ __name((deps) => {
|
|
|
32137
32201
|
return { skipped: { reason: `${model.id} is not downloaded`, step: "models.download", model: model.id } };
|
|
32138
32202
|
try {
|
|
32139
32203
|
const warm = deps.embedders;
|
|
32140
|
-
const reranker = warm ? await warm.reranker(`rerank:${model.id}`, async () => (await import("./process-
|
|
32204
|
+
const reranker = warm ? await warm.reranker(`rerank:${model.id}`, async () => (await import("./process-QKEFL5HL.js")).openRerankerProcess(model, directory2, {
|
|
32141
32205
|
threads: defaultThreads()
|
|
32142
|
-
})) : await (await import("./rerank-
|
|
32206
|
+
})) : await (await import("./rerank-ZFATWWBE.js")).openReranker(model, directory2);
|
|
32143
32207
|
return {
|
|
32144
32208
|
model: model.id,
|
|
32145
32209
|
score: /* @__PURE__ */ __name((question, passages) => reranker.score(plainWords(question), passages), "score"),
|
|
@@ -32159,17 +32223,17 @@ var rerankLane = /* @__PURE__ */ __name((deps) => {
|
|
|
32159
32223
|
};
|
|
32160
32224
|
}, "rerankLane");
|
|
32161
32225
|
|
|
32162
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
32226
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.544.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.73.0_commander@15._14d279ae6bc0fc41a3606e009c109ba5/node_modules/@wirecat/cli-core/dist/services/document-pictures.js
|
|
32163
32227
|
var openPictureEmbedderFor = /* @__PURE__ */ __name(async ({ env, command } = {}) => {
|
|
32164
32228
|
const model = imageModel(DEFAULT_IMAGE_MODEL);
|
|
32165
32229
|
const directory2 = imageModelsDirectory(env);
|
|
32166
32230
|
if (!isImageModelInstalled(model, directory2))
|
|
32167
32231
|
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 });
|
|
32168
|
-
const { openPictureEmbedder } = await import("./embedder-
|
|
32232
|
+
const { openPictureEmbedder } = await import("./embedder-GSWBGHRK.js");
|
|
32169
32233
|
return openPictureEmbedder(model, directory2);
|
|
32170
32234
|
}, "openPictureEmbedderFor");
|
|
32171
32235
|
|
|
32172
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
32236
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.544.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.73.0_commander@15._14d279ae6bc0fc41a3606e009c109ba5/node_modules/@wirecat/cli-core/dist/services/document-source.js
|
|
32173
32237
|
var documentSource = /* @__PURE__ */ __name((note, accounts, profiles, file2) => {
|
|
32174
32238
|
const metadata = note.frontMatter;
|
|
32175
32239
|
const account = accounts.find(({ id: id2 }) => String(id2) === note.folderId);
|
|
@@ -32184,7 +32248,7 @@ var documentSource = /* @__PURE__ */ __name((note, accounts, profiles, file2) =>
|
|
|
32184
32248
|
};
|
|
32185
32249
|
}, "documentSource");
|
|
32186
32250
|
|
|
32187
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
32251
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.544.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.73.0_commander@15._14d279ae6bc0fc41a3606e009c109ba5/node_modules/@wirecat/cli-core/dist/services/notes-title-tier.js
|
|
32188
32252
|
var plainQueryWords = /* @__PURE__ */ __name((query) => {
|
|
32189
32253
|
let root;
|
|
32190
32254
|
try {
|
|
@@ -32211,7 +32275,7 @@ var titleTiers = /* @__PURE__ */ __name((hits, words2) => {
|
|
|
32211
32275
|
return [...hits].sort((a, b) => rank(a) - rank(b));
|
|
32212
32276
|
}, "titleTiers");
|
|
32213
32277
|
|
|
32214
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
32278
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.544.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.73.0_commander@15._14d279ae6bc0fc41a3606e009c109ba5/node_modules/@wirecat/cli-core/dist/services/notes-search.js
|
|
32215
32279
|
var storeQuery = /* @__PURE__ */ __name(async (store, text2, { exact, timezone } = {}) => resolvedQuery(store, parsedQuery(text2, exact), timezone), "storeQuery");
|
|
32216
32280
|
var parsedQuery = /* @__PURE__ */ __name((text2, exact) => validateFields(parseLucene(text2, { ...SEARCH_QUERY, defaultField: exact ? "exact" : "text" })).root, "parsedQuery");
|
|
32217
32281
|
var resolvedQuery = /* @__PURE__ */ __name(async (store, root, timezone) => {
|
|
@@ -32621,7 +32685,7 @@ var searchNotesOf = /* @__PURE__ */ __name(async (store, account, text2, { accou
|
|
|
32621
32685
|
};
|
|
32622
32686
|
}, "searchNotesOf");
|
|
32623
32687
|
|
|
32624
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
32688
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.544.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.73.0_commander@15._14d279ae6bc0fc41a3606e009c109ba5/node_modules/@wirecat/cli-core/dist/services/events-search.js
|
|
32625
32689
|
var MAX_EVENTS_OFFSET = 1e3;
|
|
32626
32690
|
var iso3 = /* @__PURE__ */ __name((at) => at === null ? null : new Date(at).toISOString(), "iso");
|
|
32627
32691
|
var accountIdsOf = /* @__PURE__ */ __name(async (store, accounts) => {
|
|
@@ -32733,7 +32797,7 @@ var searchEvents = /* @__PURE__ */ __name(async (store, query, { limit = 20, off
|
|
|
32733
32797
|
};
|
|
32734
32798
|
}, "searchEvents");
|
|
32735
32799
|
|
|
32736
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
32800
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.544.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.73.0_commander@15._14d279ae6bc0fc41a3606e009c109ba5/node_modules/@wirecat/cli-core/dist/services/search-all.js
|
|
32737
32801
|
var RESOURCES_SEARCHED = ["messages", "mail", "notes", "events"];
|
|
32738
32802
|
var skippable = /* @__PURE__ */ __name((error) => error instanceof CliError && (error.code === "validation_error" || error.code === "not_found"), "skippable");
|
|
32739
32803
|
var filtersBeside = /* @__PURE__ */ __name((text2) => {
|
|
@@ -32802,6 +32866,7 @@ var searchAll = /* @__PURE__ */ __name(async (store, account, request, messenger
|
|
|
32802
32866
|
from: hit.email?.from ? { name: hit.email.from.name ?? hit.email.from.address, ref: hit.email.from.ref } : { name: hit.senderName, ref: null },
|
|
32803
32867
|
senderIsMe: senderIsMe(hit, at.account),
|
|
32804
32868
|
...hit.email ? { email: hit.email } : {},
|
|
32869
|
+
attachments: hitFiles(hit.attachments),
|
|
32805
32870
|
foundBy
|
|
32806
32871
|
};
|
|
32807
32872
|
}, "itemOf");
|
|
@@ -32941,7 +33006,7 @@ var searchAll = /* @__PURE__ */ __name(async (store, account, request, messenger
|
|
|
32941
33006
|
};
|
|
32942
33007
|
}, "searchAll");
|
|
32943
33008
|
|
|
32944
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
33009
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.544.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.73.0_commander@15._14d279ae6bc0fc41a3606e009c109ba5/node_modules/@wirecat/cli-core/dist/services/search-all-meetings.js
|
|
32945
33010
|
var RESOURCES_SEARCHED_WITH_MEETINGS = [...RESOURCES_SEARCHED, "meetings"];
|
|
32946
33011
|
var whole3 = /* @__PURE__ */ __name((value, minimum, maximum, label) => {
|
|
32947
33012
|
if (!Number.isSafeInteger(value) || value < minimum || value > maximum)
|
|
@@ -33034,7 +33099,8 @@ var collectMeetings = /* @__PURE__ */ __name(async (store, account, request, que
|
|
|
33034
33099
|
meetingId: hit.meetingId,
|
|
33035
33100
|
scope: hit.scope,
|
|
33036
33101
|
id: hit.id,
|
|
33037
|
-
startMs: hit.startMs
|
|
33102
|
+
startMs: hit.startMs,
|
|
33103
|
+
...hit.scope === "transcript" && hit.ref !== void 0 ? { cueRef: hit.ref, speakerName: hit.speakerName ?? null } : {}
|
|
33038
33104
|
}
|
|
33039
33105
|
});
|
|
33040
33106
|
if (collected.items.length > request.limit) {
|
|
@@ -33188,9 +33254,9 @@ var searchAllOfSource = /* @__PURE__ */ __name(async (store, account, source, re
|
|
|
33188
33254
|
return { ...found, skipped: [...skipped, ...empty2, ...unnamed, ...found.skipped] };
|
|
33189
33255
|
}, "searchAllOfSource");
|
|
33190
33256
|
|
|
33191
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
33257
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.544.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.73.0_commander@15._14d279ae6bc0fc41a3606e009c109ba5/node_modules/@wirecat/cli-core/dist/services/server-search.js
|
|
33192
33258
|
var SERVER_SEARCH_KEY = "messages.server-search";
|
|
33193
|
-
var SERVER_BOUNDS = { timeMs: 5e3, perCall: 100, maxCalls: 3 };
|
|
33259
|
+
var SERVER_BOUNDS = { timeMs: 5e3, perCall: 100, maxCalls: 3, maxMessageBytes: 5e6 };
|
|
33194
33260
|
var DEFAULT_BACKEND = "both";
|
|
33195
33261
|
var sourceKey = /* @__PURE__ */ __name((chatId, id2) => JSON.stringify([chatId, id2]), "sourceKey");
|
|
33196
33262
|
var merge = /* @__PURE__ */ __name((one, other) => {
|
|
@@ -33377,8 +33443,12 @@ var searchServer = /* @__PURE__ */ __name(async (deps, request) => {
|
|
|
33377
33443
|
return { report, sources };
|
|
33378
33444
|
}, "searchServer");
|
|
33379
33445
|
|
|
33380
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
33446
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.544.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.73.0_commander@15._14d279ae6bc0fc41a3606e009c109ba5/node_modules/@wirecat/cli-core/dist/services/messages.js
|
|
33381
33447
|
var DELETE_AT_ONCE = 10;
|
|
33448
|
+
var filesOf = /* @__PURE__ */ __name(({ attachments }) => {
|
|
33449
|
+
const files = fileLinks(attachments);
|
|
33450
|
+
return files.length > 0 ? { files } : {};
|
|
33451
|
+
}, "filesOf");
|
|
33382
33452
|
var messagesService = /* @__PURE__ */ __name((deps) => {
|
|
33383
33453
|
const { guard } = deps;
|
|
33384
33454
|
const inStore = /* @__PURE__ */ __name(async (read) => read(await deps.store(), await deps.account()), "inStore");
|
|
@@ -33528,13 +33598,15 @@ var messagesService = /* @__PURE__ */ __name((deps) => {
|
|
|
33528
33598
|
const store = await deps.store();
|
|
33529
33599
|
const chat2 = await readChatId(deps, target2.chat, store, account);
|
|
33530
33600
|
const found2 = await store.messages.around(account, chat2, target2.message, { before: 0, after: 0 });
|
|
33531
|
-
|
|
33601
|
+
const held2 = found2.find((item) => item.id === target2.message && item.chatId === chat2);
|
|
33602
|
+
if (!held2)
|
|
33532
33603
|
throw new CliError("not_found", "no such message in this account's stored chat");
|
|
33533
33604
|
return {
|
|
33534
33605
|
locator: formatLocator({ ...account, chat: chat2, message: target2.message }),
|
|
33535
33606
|
url: null,
|
|
33536
33607
|
access: "unavailable",
|
|
33537
|
-
reason: deps.offline ? "offline" : "unsupported_provider"
|
|
33608
|
+
reason: deps.offline ? "offline" : "unsupported_provider",
|
|
33609
|
+
...filesOf(held2)
|
|
33538
33610
|
};
|
|
33539
33611
|
}
|
|
33540
33612
|
const connection = await deps.connection();
|
|
@@ -33542,20 +33614,27 @@ var messagesService = /* @__PURE__ */ __name((deps) => {
|
|
|
33542
33614
|
throw new CliError("authentication_error", "the connected account differs from the recorded profile; refresh the session before linking");
|
|
33543
33615
|
const { id: chat } = await connection.resolve(target2.chat);
|
|
33544
33616
|
const locator = formatLocator({ ...account, chat, message: target2.message });
|
|
33545
|
-
if (connection.permalink)
|
|
33546
|
-
|
|
33617
|
+
if (connection.permalink) {
|
|
33618
|
+
const permalink = validatePermalink(await connection.permalink(chat, target2.message));
|
|
33619
|
+
const held2 = await deps.store().then((store) => store.messages.around(account, chat, target2.message, { before: 0, after: 0 })).then((found2) => found2.find((item) => item.id === target2.message && item.chatId === chat)).catch(() => void 0);
|
|
33620
|
+
return { locator, ...permalink, ...held2 ? filesOf(held2) : {} };
|
|
33621
|
+
}
|
|
33547
33622
|
const found = await capability(connection, "around", "read a message")(chat, target2.message, {
|
|
33548
33623
|
before: 0,
|
|
33549
33624
|
after: 0
|
|
33550
33625
|
});
|
|
33551
|
-
|
|
33626
|
+
const held = found.find((item) => item.id === target2.message && item.chatId === chat);
|
|
33627
|
+
if (!held)
|
|
33552
33628
|
throw new CliError("not_found", "no such message in this chat");
|
|
33553
|
-
return { locator, url: null, access: "unavailable", reason: "unsupported_provider" };
|
|
33629
|
+
return { locator, url: null, access: "unavailable", reason: "unsupported_provider", ...filesOf(held) };
|
|
33554
33630
|
}, "link"),
|
|
33555
|
-
download: /* @__PURE__ */ __name(async (
|
|
33631
|
+
download: /* @__PURE__ */ __name(async (reference, message) => {
|
|
33632
|
+
const target2 = messageLinkTarget(reference, message, deps.messenger.provider);
|
|
33633
|
+
if (target2.account !== void 0 && target2.account !== (await deps.account()).account)
|
|
33634
|
+
throw new CliError("validation_error", "that locator belongs to another account; select its profile first");
|
|
33556
33635
|
const connection = await deps.connection();
|
|
33557
33636
|
const download = capability(connection, "download", "download attachments");
|
|
33558
|
-
return download((await connection.resolve(chat)).id, message);
|
|
33637
|
+
return download((await connection.resolve(target2.chat)).id, target2.message);
|
|
33559
33638
|
}, "download"),
|
|
33560
33639
|
keepDownloaded: /* @__PURE__ */ __name((chat, message, files) => inStore(async (store, account) => {
|
|
33561
33640
|
const chatId = await storedChatId(deps.messenger, chat, store, account).catch(() => void 0) ?? (await (await deps.connection()).resolve(chat)).id;
|
|
@@ -33803,7 +33882,7 @@ var checkMediaOptions = /* @__PURE__ */ __name((messenger, asked, attachments) =
|
|
|
33803
33882
|
throw new CliError("validation_error", `${MEDIA_FLAGS[first2]} needs a --photo or --file`);
|
|
33804
33883
|
}, "checkMediaOptions");
|
|
33805
33884
|
|
|
33806
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
33885
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.544.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.73.0_commander@15._14d279ae6bc0fc41a3606e009c109ba5/node_modules/@wirecat/cli-core/dist/domain/channel-tags.js
|
|
33807
33886
|
var CHANNEL_TAG_RULES_VERSION = "keywords-v1";
|
|
33808
33887
|
var RULES = {
|
|
33809
33888
|
ai: [/\b(ai|gpt|llm|machine learning|artificial intelligence)\b/iu, /нейросет|искусственн/iu],
|
|
@@ -33818,7 +33897,7 @@ var classifyChannel = /* @__PURE__ */ __name((metadata) => Object.entries(RULES)
|
|
|
33818
33897
|
return fields.length ? [{ tag, score: fields.length / 3, fields }] : [];
|
|
33819
33898
|
}), "classifyChannel");
|
|
33820
33899
|
|
|
33821
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
33900
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.544.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.73.0_commander@15._14d279ae6bc0fc41a3606e009c109ba5/node_modules/@wirecat/cli-core/dist/services/metadata.js
|
|
33822
33901
|
var metadataService = /* @__PURE__ */ __name((deps) => {
|
|
33823
33902
|
const held = /* @__PURE__ */ __name(async (reference, { includeLeft = false } = {}) => {
|
|
33824
33903
|
const store = await deps.store();
|
|
@@ -33904,7 +33983,7 @@ var metadataService = /* @__PURE__ */ __name((deps) => {
|
|
|
33904
33983
|
};
|
|
33905
33984
|
}, "metadataService");
|
|
33906
33985
|
|
|
33907
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
33986
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.544.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.73.0_commander@15._14d279ae6bc0fc41a3606e009c109ba5/node_modules/@wirecat/cli-core/dist/moderation/run.js
|
|
33908
33987
|
var FIRST_LOOK_MS = 24 * 36e5;
|
|
33909
33988
|
var moderateWith = /* @__PURE__ */ __name(async (run) => {
|
|
33910
33989
|
const { chatId, title, rules, point, since, dryRun } = run;
|
|
@@ -33941,7 +34020,7 @@ var moderateWith = /* @__PURE__ */ __name(async (run) => {
|
|
|
33941
34020
|
return { chatId, rows, notes };
|
|
33942
34021
|
}, "moderateWith");
|
|
33943
34022
|
|
|
33944
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34023
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.544.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.73.0_commander@15._14d279ae6bc0fc41a3606e009c109ba5/node_modules/@wirecat/cli-core/dist/services/moderation.js
|
|
33945
34024
|
var moderationService = /* @__PURE__ */ __name((deps) => {
|
|
33946
34025
|
const file2 = /* @__PURE__ */ __name(() => new ModerationRules(moderationPathFor(deps.messenger.app, deps.profile ?? "default", deps.env ?? process.env)), "file");
|
|
33947
34026
|
const group = /* @__PURE__ */ __name(async (chat) => {
|
|
@@ -34019,7 +34098,7 @@ var moderatorOf = /* @__PURE__ */ __name((adapter, deps) => ({
|
|
|
34019
34098
|
}, "removePerson")
|
|
34020
34099
|
}), "moderatorOf");
|
|
34021
34100
|
|
|
34022
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34101
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.544.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.73.0_commander@15._14d279ae6bc0fc41a3606e009c109ba5/node_modules/@wirecat/cli-core/dist/services/private-people.js
|
|
34023
34102
|
var noteItem = /* @__PURE__ */ __name((provider, note) => ({
|
|
34024
34103
|
id: note.id,
|
|
34025
34104
|
contact: formatReference({ type: "contact", provider, id: note.personId }),
|
|
@@ -34063,7 +34142,7 @@ var privatePeopleService = /* @__PURE__ */ __name((deps) => {
|
|
|
34063
34142
|
};
|
|
34064
34143
|
}, "privatePeopleService");
|
|
34065
34144
|
|
|
34066
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34145
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.544.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.73.0_commander@15._14d279ae6bc0fc41a3606e009c109ba5/node_modules/@wirecat/cli-core/dist/services/rankings.js
|
|
34067
34146
|
var empty = /* @__PURE__ */ __name(() => ({
|
|
34068
34147
|
total: 0,
|
|
34069
34148
|
population: 0,
|
|
@@ -34319,7 +34398,7 @@ var rankingsService = /* @__PURE__ */ __name((deps) => ({
|
|
|
34319
34398
|
}, "evidence")
|
|
34320
34399
|
}), "rankingsService");
|
|
34321
34400
|
|
|
34322
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34401
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.544.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.73.0_commander@15._14d279ae6bc0fc41a3606e009c109ba5/node_modules/@wirecat/cli-core/dist/services/searches.js
|
|
34323
34402
|
var savedSearchItem = /* @__PURE__ */ __name((one) => ({
|
|
34324
34403
|
id: one.id,
|
|
34325
34404
|
name: one.name,
|
|
@@ -34448,7 +34527,7 @@ var searchesService = /* @__PURE__ */ __name((deps) => {
|
|
|
34448
34527
|
};
|
|
34449
34528
|
}, "searchesService");
|
|
34450
34529
|
|
|
34451
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34530
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.544.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.73.0_commander@15._14d279ae6bc0fc41a3606e009c109ba5/node_modules/@wirecat/cli-core/dist/services/tags.js
|
|
34452
34531
|
var TAGGING_QUERY = {
|
|
34453
34532
|
entity: "tagging",
|
|
34454
34533
|
backend: "sql",
|
|
@@ -34532,10 +34611,10 @@ var tagsService = /* @__PURE__ */ __name((deps) => {
|
|
|
34532
34611
|
};
|
|
34533
34612
|
}, "tagsService");
|
|
34534
34613
|
|
|
34535
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34536
|
-
var actionOf = /* @__PURE__ */ __name(({ title, closed, pinned, hidden }) => {
|
|
34614
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.544.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.73.0_commander@15._14d279ae6bc0fc41a3606e009c109ba5/node_modules/@wirecat/cli-core/dist/services/topics.js
|
|
34615
|
+
var actionOf = /* @__PURE__ */ __name(({ title, closed, pinned, hidden, icon }) => {
|
|
34537
34616
|
const set = [closed, pinned, hidden].filter((one) => one !== void 0).length;
|
|
34538
|
-
if (title !== void 0 || set !== 1)
|
|
34617
|
+
if (title !== void 0 || icon !== void 0 || set !== 1)
|
|
34539
34618
|
return "topic-edit";
|
|
34540
34619
|
if (closed !== void 0)
|
|
34541
34620
|
return closed ? "topic-close" : "topic-reopen";
|
|
@@ -34547,6 +34626,12 @@ var validTitle = /* @__PURE__ */ __name((title) => {
|
|
|
34547
34626
|
if (title.trim() === "" || new TextEncoder().encode(title).byteLength > 128)
|
|
34548
34627
|
throw new CliError("validation_error", "a topic title needs 1\u2013128 UTF-8 bytes");
|
|
34549
34628
|
}, "validTitle");
|
|
34629
|
+
var validIcon = /* @__PURE__ */ __name((icon) => {
|
|
34630
|
+
const emoji = icon.trim();
|
|
34631
|
+
if (emoji === "")
|
|
34632
|
+
throw new CliError("validation_error", "which icon? give an emoji from `topics icons list`");
|
|
34633
|
+
return emoji;
|
|
34634
|
+
}, "validIcon");
|
|
34550
34635
|
var topicsService = /* @__PURE__ */ __name((deps) => {
|
|
34551
34636
|
const online = /* @__PURE__ */ __name(async () => {
|
|
34552
34637
|
if (deps.offline)
|
|
@@ -34562,6 +34647,11 @@ var topicsService = /* @__PURE__ */ __name((deps) => {
|
|
|
34562
34647
|
throw new CliError("validation_error", "which topic? give its id, from `topics list`");
|
|
34563
34648
|
return capability(await deps.connection(), "topic", "show a forum topic")(chat, id2);
|
|
34564
34649
|
}, "show"),
|
|
34650
|
+
icons: /* @__PURE__ */ __name(async () => {
|
|
34651
|
+
if (deps.offline)
|
|
34652
|
+
throw new CliError("validation_error", "`topics icons list` asks the messenger; not with --offline");
|
|
34653
|
+
return capability(await deps.connection(), "topicIcons", "list topic icons")();
|
|
34654
|
+
}, "icons"),
|
|
34565
34655
|
enable: /* @__PURE__ */ __name(async (chat, { upgrade }) => {
|
|
34566
34656
|
const connection = await online();
|
|
34567
34657
|
const probe = capability(connection, "forumState", "configure forum topics");
|
|
@@ -34638,8 +34728,9 @@ var topicsService = /* @__PURE__ */ __name((deps) => {
|
|
|
34638
34728
|
forum: true
|
|
34639
34729
|
};
|
|
34640
34730
|
}, "enable"),
|
|
34641
|
-
create: /* @__PURE__ */ __name(async (chat, title, { sendId }) => {
|
|
34731
|
+
create: /* @__PURE__ */ __name(async (chat, title, { sendId, icon: typedIcon }) => {
|
|
34642
34732
|
validTitle(title);
|
|
34733
|
+
const icon = typedIcon === void 0 ? void 0 : validIcon(typedIcon);
|
|
34643
34734
|
const connection = await online();
|
|
34644
34735
|
const create = capability(connection, "createTopic", "create forum topics");
|
|
34645
34736
|
const probe = capability(connection, "forumState", "read forum settings");
|
|
@@ -34654,7 +34745,7 @@ var topicsService = /* @__PURE__ */ __name((deps) => {
|
|
|
34654
34745
|
action: "topic-create",
|
|
34655
34746
|
key: "topics.create",
|
|
34656
34747
|
length: title.length
|
|
34657
|
-
}, () => create(target2, title, { sendId: id2 }), (done2) => ({ threadId: done2.id, resultChatId: target2 }), async () => {
|
|
34748
|
+
}, () => create(target2, title, { sendId: id2, ...icon === void 0 ? {} : { icon } }), (done2) => ({ threadId: done2.id, resultChatId: target2 }), async () => {
|
|
34658
34749
|
const state = await probe(chatId);
|
|
34659
34750
|
if (!state.forum)
|
|
34660
34751
|
throw new CliError("validation_error", "enable topics first with `topics enable`; creating a topic never upgrades a group");
|
|
@@ -34668,8 +34759,9 @@ var topicsService = /* @__PURE__ */ __name((deps) => {
|
|
|
34668
34759
|
}, "create"),
|
|
34669
34760
|
edit: /* @__PURE__ */ __name(async (chat, typedTopic, change) => {
|
|
34670
34761
|
const { title, closed, pinned, hidden } = change;
|
|
34671
|
-
|
|
34672
|
-
|
|
34762
|
+
const icon = change.icon == null ? change.icon : validIcon(change.icon);
|
|
34763
|
+
if ([title, closed, pinned, hidden, icon].every((one) => one === void 0))
|
|
34764
|
+
throw new CliError("validation_error", "nothing to change \u2014 rename, close, reopen, pin, unpin, hide or give an icon");
|
|
34673
34765
|
if (title !== void 0)
|
|
34674
34766
|
validTitle(title);
|
|
34675
34767
|
const topicId = typedTopic.trim();
|
|
@@ -34684,7 +34776,8 @@ var topicsService = /* @__PURE__ */ __name((deps) => {
|
|
|
34684
34776
|
...title === void 0 ? {} : { title },
|
|
34685
34777
|
...closed === void 0 ? {} : { closed },
|
|
34686
34778
|
...pinned === void 0 ? {} : { pinned },
|
|
34687
|
-
...hidden === void 0 ? {} : { hidden }
|
|
34779
|
+
...hidden === void 0 ? {} : { hidden },
|
|
34780
|
+
...icon === void 0 ? {} : { icon }
|
|
34688
34781
|
}));
|
|
34689
34782
|
return { operationId, chatId, topic };
|
|
34690
34783
|
}, "edit"),
|
|
@@ -34717,7 +34810,7 @@ var topicsService = /* @__PURE__ */ __name((deps) => {
|
|
|
34717
34810
|
};
|
|
34718
34811
|
}, "topicsService");
|
|
34719
34812
|
|
|
34720
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34813
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.544.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.73.0_commander@15._14d279ae6bc0fc41a3606e009c109ba5/node_modules/@wirecat/cli-core/dist/services/evidence.js
|
|
34721
34814
|
import { createHash as createHash11, randomUUID as randomUUID5 } from "node:crypto";
|
|
34722
34815
|
var hash2 = /* @__PURE__ */ __name((value) => createHash11("sha256").update(JSON.stringify(value)).digest("hex"), "hash");
|
|
34723
34816
|
var positive = /* @__PURE__ */ __name((value, name, minimum = 1) => {
|
|
@@ -34791,7 +34884,7 @@ var prepareEvidencePacket = /* @__PURE__ */ __name(({ kind, source, page, limits
|
|
|
34791
34884
|
return { ...content, id: randomUUID5(), fingerprint: hash2(content) };
|
|
34792
34885
|
}, "prepareEvidencePacket");
|
|
34793
34886
|
|
|
34794
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34887
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.544.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.73.0_commander@15._14d279ae6bc0fc41a3606e009c109ba5/node_modules/@wirecat/cli-core/dist/services/evidence-read.js
|
|
34795
34888
|
var readEvidencePacket = /* @__PURE__ */ __name(async (store, account, { chat, limit, before: before2 }, messenger = {}) => {
|
|
34796
34889
|
if (!Number.isSafeInteger(limit) || limit < 1 || limit > 100)
|
|
34797
34890
|
throw new CliError("validation_error", "evidence message limit must be an integer from 1 to 100");
|
|
@@ -34811,7 +34904,7 @@ var readEvidencePacket = /* @__PURE__ */ __name(async (store, account, { chat, l
|
|
|
34811
34904
|
return { ...packet, nextBeforeId: older && last ? last.id : null };
|
|
34812
34905
|
}, "readEvidencePacket");
|
|
34813
34906
|
|
|
34814
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34907
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.544.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.73.0_commander@15._14d279ae6bc0fc41a3606e009c109ba5/node_modules/@wirecat/cli-core/dist/services/meeting-project-discovery.js
|
|
34815
34908
|
var scopeKeys = [
|
|
34816
34909
|
"accountId",
|
|
34817
34910
|
"meetingId",
|
|
@@ -34833,7 +34926,7 @@ var optionKeys = /* @__PURE__ */ new Set([
|
|
|
34833
34926
|
"maxVocabularyReadBytes"
|
|
34834
34927
|
]);
|
|
34835
34928
|
|
|
34836
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34929
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.544.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.73.0_commander@15._14d279ae6bc0fc41a3606e009c109ba5/node_modules/@wirecat/cli-core/dist/context/communication-selection.js
|
|
34837
34930
|
var communicationFields = {
|
|
34838
34931
|
sources: pipe(array(strictObject({
|
|
34839
34932
|
id: pipe(string(), regex(/^[A-Za-z0-9][A-Za-z0-9._-]{0,127}$/)),
|
|
@@ -34865,7 +34958,7 @@ var communicationRequest = /* @__PURE__ */ __name((value, preparationAfter) => {
|
|
|
34865
34958
|
return { ...input, after, before: before2 };
|
|
34866
34959
|
}, "communicationRequest");
|
|
34867
34960
|
|
|
34868
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
34961
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.544.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.73.0_commander@15._14d279ae6bc0fc41a3606e009c109ba5/node_modules/@wirecat/cli-core/dist/services/meeting-preparation-validation.js
|
|
34869
34962
|
var MEETING_PREPARATION_LIMITS = {
|
|
34870
34963
|
meetings: { min: 1, max: 20, default: 5 },
|
|
34871
34964
|
cues: { min: 1, max: 100, default: 10 },
|
|
@@ -34938,7 +35031,7 @@ var validateMeetingPreparationRequest = /* @__PURE__ */ __name((externalId, orig
|
|
|
34938
35031
|
};
|
|
34939
35032
|
}, "validateMeetingPreparationRequest");
|
|
34940
35033
|
|
|
34941
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
35034
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.544.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.73.0_commander@15._14d279ae6bc0fc41a3606e009c109ba5/node_modules/@wirecat/cli-core/dist/services/meeting-communications-selection.js
|
|
34942
35035
|
var validatePreparationCommunications = /* @__PURE__ */ __name((section, request, after) => {
|
|
34943
35036
|
const fail2 = /* @__PURE__ */ __name(() => {
|
|
34944
35037
|
throw new CliError("invalid_response", "Preparation communications returned another selection or invalid evidence");
|
|
@@ -34986,7 +35079,7 @@ var validatePreparationCommunications = /* @__PURE__ */ __name((section, request
|
|
|
34986
35079
|
}
|
|
34987
35080
|
}, "validatePreparationCommunications");
|
|
34988
35081
|
|
|
34989
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
35082
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.544.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.73.0_commander@15._14d279ae6bc0fc41a3606e009c109ba5/node_modules/@wirecat/cli-core/dist/services/package-upgrade.js
|
|
34990
35083
|
var upgradePackage = /* @__PURE__ */ __name(async ({ current, command, packageName, check: check2 }, ports) => {
|
|
34991
35084
|
const installer = ports.installer();
|
|
34992
35085
|
const argv = updateCommand(installer, packageName);
|
|
@@ -35051,7 +35144,7 @@ var dayAfter = /* @__PURE__ */ __name((published) => {
|
|
|
35051
35144
|
return Number.isNaN(time) ? null : new Date(time + 24 * 60 * 60 * 1e3).toISOString();
|
|
35052
35145
|
}, "dayAfter");
|
|
35053
35146
|
|
|
35054
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
35147
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.544.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.73.0_commander@15._14d279ae6bc0fc41a3606e009c109ba5/node_modules/@wirecat/cli-core/dist/services/index.js
|
|
35055
35148
|
var servicesFor = /* @__PURE__ */ __name((deps) => {
|
|
35056
35149
|
const pictures = picturesService(deps);
|
|
35057
35150
|
const base = {
|
|
@@ -35087,9 +35180,9 @@ var servicesFor = /* @__PURE__ */ __name((deps) => {
|
|
|
35087
35180
|
return deps.messenger.services ? { ...base, ...deps.messenger.services(base, deps) } : base;
|
|
35088
35181
|
}, "servicesFor");
|
|
35089
35182
|
|
|
35090
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
35183
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.544.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.73.0_commander@15._14d279ae6bc0fc41a3606e009c109ba5/node_modules/@wirecat/cli-core/dist/background/relay.js
|
|
35091
35184
|
import { createHash as createHash12 } from "node:crypto";
|
|
35092
|
-
import { chmodSync, lstatSync, mkdirSync as
|
|
35185
|
+
import { chmodSync, lstatSync, mkdirSync as mkdirSync3, rmSync } from "node:fs";
|
|
35093
35186
|
import { createConnection, createServer } from "node:net";
|
|
35094
35187
|
import { tmpdir } from "node:os";
|
|
35095
35188
|
import { dirname as dirname5, isAbsolute as isAbsolute3, join as join12 } from "node:path";
|
|
@@ -35117,7 +35210,7 @@ var relayPath = /* @__PURE__ */ __name((lockPath) => {
|
|
|
35117
35210
|
return join12("/tmp", name);
|
|
35118
35211
|
}, "relayPath");
|
|
35119
35212
|
var privateDirectory = /* @__PURE__ */ __name((dir) => {
|
|
35120
|
-
|
|
35213
|
+
mkdirSync3(dir, { recursive: true, mode: 448 });
|
|
35121
35214
|
const stat4 = lstatSync(dir);
|
|
35122
35215
|
const mine = process.getuid === void 0 || stat4.uid === process.getuid();
|
|
35123
35216
|
if (!stat4.isDirectory() || !mine || (stat4.mode & 63) !== 0) {
|
|
@@ -35308,7 +35401,7 @@ var relayCommand = /* @__PURE__ */ __name((path, request, options) => new Promis
|
|
|
35308
35401
|
}, () => finish({ error: stopped() }));
|
|
35309
35402
|
}), "relayCommand");
|
|
35310
35403
|
|
|
35311
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
35404
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.544.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.73.0_commander@15._14d279ae6bc0fc41a3606e009c109ba5/node_modules/@wirecat/cli-core/dist/cli/messenger/serve-relay.js
|
|
35312
35405
|
var lentConnection = /* @__PURE__ */ __name((connection, watchers) => throughWrapper(connection, {
|
|
35313
35406
|
close: /* @__PURE__ */ __name(async () => {
|
|
35314
35407
|
}, "close"),
|
|
@@ -35466,6 +35559,9 @@ export {
|
|
|
35466
35559
|
engineHint,
|
|
35467
35560
|
engineStates,
|
|
35468
35561
|
imageSize,
|
|
35562
|
+
refreshedFiles,
|
|
35563
|
+
downloadMessage,
|
|
35564
|
+
saveFiles,
|
|
35469
35565
|
ATTACHMENT_QUERY,
|
|
35470
35566
|
isRetentionSelection,
|
|
35471
35567
|
REVIEW_DAYS,
|
|
@@ -35473,6 +35569,7 @@ export {
|
|
|
35473
35569
|
reviewStart,
|
|
35474
35570
|
kindsOf,
|
|
35475
35571
|
validateFormattedText,
|
|
35572
|
+
messageLinkTarget,
|
|
35476
35573
|
pinLengthHelp,
|
|
35477
35574
|
pinDurationOf,
|
|
35478
35575
|
sendAsCheck,
|
|
@@ -35485,9 +35582,6 @@ export {
|
|
|
35485
35582
|
ADMIN_RIGHTS,
|
|
35486
35583
|
senderIsMe,
|
|
35487
35584
|
MEDIA_KINDS,
|
|
35488
|
-
refreshedFiles,
|
|
35489
|
-
downloadMessage,
|
|
35490
|
-
saveFiles,
|
|
35491
35585
|
searchNotesOf,
|
|
35492
35586
|
DELETE_AT_ONCE,
|
|
35493
35587
|
describe,
|
|
@@ -35535,6 +35629,7 @@ export {
|
|
|
35535
35629
|
createMeetingSearchCommand,
|
|
35536
35630
|
addMeetingCommands,
|
|
35537
35631
|
LIST_QUERY_GUIDE,
|
|
35632
|
+
QUERY_ARGUMENT,
|
|
35538
35633
|
withQuery,
|
|
35539
35634
|
unfilteredQuery,
|
|
35540
35635
|
listQuery,
|