@wirecat/tg-cli 0.100.0 → 0.101.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 -3
- package/dist/bin/tg.js +1 -1
- package/dist/bundle/{adapter-2LVPMFKF.js → adapter-A3VD4Y6Z.js} +24 -24
- package/dist/bundle/{all-profiles-BLTK2AAB.js → all-profiles-UPVNHXB2.js} +16 -7
- package/dist/bundle/{anthropic-RJE4XEOO.js → anthropic-IRKNWPIB.js} +5 -5
- package/dist/bundle/{bot-api-4XM3NVWG.js → bot-api-UNTQG2M5.js} +48 -48
- package/dist/bundle/{bot-history-WVM5GEQN.js → bot-history-V4RTY5K7.js} +15 -15
- package/dist/bundle/{bun-UZXO2LRQ.js → bun-2JZPG2NL.js} +2 -2
- package/dist/bundle/{bun-sqlite-GJLGSQIT.js → bun-sqlite-TZHKM225.js} +4 -4
- package/dist/bundle/{chunk-V4JSVH4M.js → chunk-22PQUX72.js} +2 -2
- package/dist/bundle/{chunk-MQNFEVAH.js → chunk-2DGOFLDA.js} +2 -2
- package/dist/bundle/{chunk-2IM4M7Q2.js → chunk-2XBSVRT2.js} +1 -1
- package/dist/bundle/{chunk-HKT5EOT5.js → chunk-4ZS73HTJ.js} +1 -1
- package/dist/bundle/{chunk-SMJTL5U7.js → chunk-54R2GDQ3.js} +6 -4
- package/dist/bundle/{chunk-2MXQ2EUN.js → chunk-5GKXETRP.js} +21 -20
- package/dist/bundle/{chunk-GTURDJJD.js → chunk-5KU4UQBM.js} +1 -1
- package/dist/bundle/{chunk-JFJVS5JC.js → chunk-5TPT2S2Z.js} +2 -2
- package/dist/bundle/{chunk-SYPL4PHV.js → chunk-64DK7S4F.js} +1 -1
- package/dist/bundle/{chunk-BAIZAZ6Q.js → chunk-6IPY2QRG.js} +2 -2
- package/dist/bundle/{chunk-I6WZJVRT.js → chunk-7CBUCTB6.js} +55 -36
- package/dist/bundle/{chunk-LI7TXFLS.js → chunk-A5JSTZZZ.js} +3 -3
- package/dist/bundle/{chunk-OW3COBN5.js → chunk-ACGTFLEB.js} +9 -9
- package/dist/bundle/{chunk-Q26JMPBP.js → chunk-BX6HH4F6.js} +11 -11
- package/dist/bundle/{chunk-CV5ASHTW.js → chunk-BXQS5RCE.js} +45 -45
- package/dist/bundle/{chunk-MUEXF4ME.js → chunk-CJ6IYCYP.js} +12 -11
- package/dist/bundle/{chunk-GYEOQS2D.js → chunk-DG62L57H.js} +17 -17
- package/dist/bundle/{chunk-4U7QOFDA.js → chunk-DYNSP6FW.js} +445 -236
- package/dist/bundle/{chunk-HXTTDIL7.js → chunk-F7TDFWXY.js} +3 -3
- package/dist/bundle/{chunk-P26LWFNZ.js → chunk-G2US6LJB.js} +1 -1
- package/dist/bundle/{chunk-KE6L2UEG.js → chunk-G3ZRY436.js} +70 -61
- package/dist/bundle/{chunk-QY3YOOTP.js → chunk-G77QOTXE.js} +2 -2
- package/dist/bundle/{chunk-6YLT4YVJ.js → chunk-H6OXALTJ.js} +2 -2
- package/dist/bundle/{chunk-WKOY3POD.js → chunk-LPB2MDUW.js} +7 -7
- package/dist/bundle/{chunk-66E5QDLH.js → chunk-MLLJ74LM.js} +1 -1
- package/dist/bundle/{chunk-6VEOR6GD.js → chunk-N5UFBWDM.js} +6 -6
- package/dist/bundle/{chunk-THVNP6S6.js → chunk-NC5WS7OP.js} +2 -2
- package/dist/bundle/{chunk-YG7PNCSW.js → chunk-NKJJJAIJ.js} +10 -3
- package/dist/bundle/{chunk-DVOUKGFK.js → chunk-NMGO6LW6.js} +8 -8
- package/dist/bundle/{chunk-QU2FJMFB.js → chunk-ODSVNH3H.js} +798 -492
- package/dist/bundle/{chunk-WE3LBRMB.js → chunk-OEJ5DMCX.js} +7 -7
- package/dist/bundle/{chunk-3N6LXAPE.js → chunk-OILBDLWL.js} +10 -10
- package/dist/bundle/{chunk-U7LXA4SO.js → chunk-OPBTNQ35.js} +11 -11
- package/dist/bundle/{chunk-OOOV3JBZ.js → chunk-PUBS2F5J.js} +953 -677
- package/dist/bundle/{chunk-H3X5LS6U.js → chunk-PYTOIDSM.js} +4 -4
- package/dist/bundle/{chunk-RER6DAHP.js → chunk-QOWSVDPZ.js} +157 -145
- package/dist/bundle/{chunk-2XUGPE5W.js → chunk-QYVVRQTN.js} +3 -3
- package/dist/bundle/{chunk-RDQMV6EU.js → chunk-RF54YDBB.js} +4 -4
- package/dist/bundle/{chunk-3QDPV34J.js → chunk-RVCS7Q3A.js} +51 -47
- package/dist/bundle/{chunk-4YCLWWZ3.js → chunk-S2JSZWEC.js} +11 -11
- package/dist/bundle/{chunk-SGJYU3SB.js → chunk-S7ZNLLY5.js} +3 -3
- package/dist/bundle/{chunk-JSKT5UZX.js → chunk-TGREFJVA.js} +8 -8
- package/dist/bundle/{chunk-4VBDVZNE.js → chunk-U46UNBMT.js} +15 -15
- package/dist/bundle/{chunk-BL36RR34.js → chunk-UN6CKIBN.js} +4 -4
- package/dist/bundle/chunk-VA5YEJS3.js +161 -0
- package/dist/bundle/{chunk-DN4QUTWU.js → chunk-VCGL2ETF.js} +1 -1
- package/dist/bundle/{chunk-UMLPXNJI.js → chunk-VRSN7VLO.js} +1 -1
- package/dist/bundle/{chunk-ATZ44Z77.js → chunk-VYDTI254.js} +108 -29
- package/dist/bundle/{chunk-UD4DOZCN.js → chunk-W2336E7Y.js} +6 -6
- package/dist/bundle/{chunk-3S5CL55R.js → chunk-XCKD54TN.js} +6 -6
- package/dist/bundle/{chunk-A7OBVRJV.js → chunk-ZEOCU24Z.js} +3 -3
- package/dist/bundle/{chunk-BZANDKWT.js → chunk-ZJVZXJOG.js} +2 -2
- package/dist/bundle/{chunk-ASDZHG5I.js → chunk-ZV24I2UJ.js} +2 -2
- package/dist/bundle/command-contract-TKDI7E56.js +31 -0
- package/dist/bundle/{echarts-YHSYUWLY.js → echarts-QZ6PR3VC.js} +2 -2
- package/dist/bundle/{embed-3HGI2XIW.js → embed-UBXCXSRD.js} +4 -4
- package/dist/bundle/{embedder-2CJMZETJ.js → embedder-B4ZTKC23.js} +7 -7
- package/dist/bundle/{entry-UVE53OV3.js → entry-BTUTHO5M.js} +5 -5
- package/dist/bundle/{first-run-6GYC2QS3.js → first-run-UC4HRIFV.js} +9 -9
- package/dist/bundle/first-screen-SMCX6YKY.js +29 -0
- package/dist/bundle/{identity-HEV5E57G.js → identity-QSDEGDH7.js} +3 -3
- package/dist/bundle/{instructions-5UVAXSQV.js → instructions-BBGLZKO3.js} +1 -1
- package/dist/bundle/{mcp-NWXBVNUA.js → mcp-4Y37G2UY.js} +2 -2
- package/dist/bundle/{node-YHYEGYVE.js → node-LZZX22VR.js} +2 -2
- package/dist/bundle/{node-sqlite-CQ33A3R2.js → node-sqlite-BPGT6T5U.js} +4 -4
- package/dist/bundle/{oauth-OB3JFAD7.js → oauth-XNE2KPKJ.js} +6 -6
- package/dist/bundle/{open-JHGZIXU2.js → open-SXGYZLB5.js} +3 -3
- package/dist/bundle/{process-PSKS3N5B.js → process-GPUXC4PG.js} +1 -1
- package/dist/bundle/{program-RPYVPNRX.js → program-NEXEAL7T.js} +51 -51
- package/dist/bundle/{prompt-7BXUMJGG.js → prompt-SORGLEYI.js} +4 -4
- package/dist/bundle/{proxy-transport-3EEMW2HW.js → proxy-transport-G4MA6BGU.js} +4 -4
- package/dist/bundle/{recognize-YMZPL47R.js → recognize-UJBXORVD.js} +5 -5
- package/dist/bundle/{remote-LQ3Q22NG.js → remote-W72AR7KH.js} +5 -5
- package/dist/bundle/{rerank-SM7IYVXJ.js → rerank-3Y2VZM3J.js} +5 -5
- package/dist/bundle/{serve-GHUEP5H5.js → serve-VDZIVOPR.js} +23 -8
- package/dist/bundle/{server-K2BQPPHN.js → server-BERXP4GW.js} +52 -52
- package/dist/bundle/{server-A45HVXQY.js → server-ZFHN4GUF.js} +34 -34
- package/dist/bundle/{state-WIOL52GZ.js → state-DGR4EE3E.js} +9 -5
- package/dist/bundle/{store-XE5AKUJZ.js → store-MRCFSCZD.js} +10 -10
- package/dist/bundle/store-maintenance-command-DCMZDMYS.js +46 -0
- package/dist/bundle/tg.js +4 -4
- package/dist/commands/context.d.ts.map +1 -1
- package/dist/commands/context.js +2 -0
- package/dist/commands/context.js.map +1 -1
- package/dist/program.js +1 -1
- package/dist/program.js.map +1 -1
- package/dist/telegram/errors.js +1 -1
- package/dist/telegram/errors.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/install/windows.ps1 +1 -1
- package/package.json +3 -3
- package/skills/tg-cli/SKILL.md +4 -4
- package/dist/bundle/chunk-Z2FHEIXN.js +0 -63
- package/dist/bundle/command-contract-AIVKJYIR.js +0 -31
- package/dist/bundle/first-screen-HRRLVLOG.js +0 -29
- package/dist/bundle/store-maintenance-command-YS5E7VUN.js +0 -46
- /package/dist/bundle/{chunk-3MVHRZWR.js → chunk-2SJOUK6J.js} +0 -0
|
@@ -19,7 +19,7 @@ import {
|
|
|
19
19
|
uploadSize,
|
|
20
20
|
validateFormattedText,
|
|
21
21
|
visibleFormattedText
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-OILBDLWL.js";
|
|
23
23
|
import {
|
|
24
24
|
Command,
|
|
25
25
|
DEFAULT_RERANK_MODEL,
|
|
@@ -48,26 +48,26 @@ import {
|
|
|
48
48
|
task,
|
|
49
49
|
textModel,
|
|
50
50
|
vectorModelKey
|
|
51
|
-
} from "./chunk-
|
|
51
|
+
} from "./chunk-RVCS7Q3A.js";
|
|
52
52
|
import {
|
|
53
53
|
codeOf,
|
|
54
54
|
guardedWrite,
|
|
55
55
|
sentIds,
|
|
56
56
|
typedCommand
|
|
57
|
-
} from "./chunk-
|
|
57
|
+
} from "./chunk-OPBTNQ35.js";
|
|
58
58
|
import {
|
|
59
59
|
isNewer,
|
|
60
60
|
updateCommand
|
|
61
|
-
} from "./chunk-
|
|
61
|
+
} from "./chunk-PYTOIDSM.js";
|
|
62
62
|
import {
|
|
63
63
|
readOnlyLockOf
|
|
64
|
-
} from "./chunk-
|
|
64
|
+
} from "./chunk-ZV24I2UJ.js";
|
|
65
65
|
import {
|
|
66
66
|
MAX_MODEL_IMAGE_BYTES
|
|
67
|
-
} from "./chunk-
|
|
67
|
+
} from "./chunk-H6OXALTJ.js";
|
|
68
68
|
import {
|
|
69
69
|
remoteKey
|
|
70
|
-
} from "./chunk-
|
|
70
|
+
} from "./chunk-A5JSTZZZ.js";
|
|
71
71
|
import {
|
|
72
72
|
Unzip,
|
|
73
73
|
UnzipInflate,
|
|
@@ -82,7 +82,7 @@ import {
|
|
|
82
82
|
runEmbedders,
|
|
83
83
|
sharedModelsDirectory,
|
|
84
84
|
textModelsDirectory
|
|
85
|
-
} from "./chunk-
|
|
85
|
+
} from "./chunk-ACGTFLEB.js";
|
|
86
86
|
import {
|
|
87
87
|
AGENDA_COLUMNS,
|
|
88
88
|
CHAT_COLUMNS,
|
|
@@ -150,7 +150,7 @@ import {
|
|
|
150
150
|
threadConversation,
|
|
151
151
|
validateAst,
|
|
152
152
|
validateFields
|
|
153
|
-
} from "./chunk-
|
|
153
|
+
} from "./chunk-PUBS2F5J.js";
|
|
154
154
|
import {
|
|
155
155
|
EVENT_QUERY,
|
|
156
156
|
MEETING_PROJECT_EVIDENCE_QUERY,
|
|
@@ -194,20 +194,20 @@ import {
|
|
|
194
194
|
validateQuery,
|
|
195
195
|
walkQuery,
|
|
196
196
|
zonedMoment
|
|
197
|
-
} from "./chunk-
|
|
197
|
+
} from "./chunk-G3ZRY436.js";
|
|
198
198
|
import {
|
|
199
199
|
DEFAULT_STEMMERS,
|
|
200
200
|
createStemmer,
|
|
201
201
|
fold,
|
|
202
202
|
normalize
|
|
203
|
-
} from "./chunk-
|
|
203
|
+
} from "./chunk-TGREFJVA.js";
|
|
204
204
|
import {
|
|
205
205
|
DEFAULT_TASK_CATEGORIES,
|
|
206
206
|
FALLBACK_CATEGORY
|
|
207
|
-
} from "./chunk-
|
|
207
|
+
} from "./chunk-W2336E7Y.js";
|
|
208
208
|
import {
|
|
209
209
|
singleLine
|
|
210
|
-
} from "./chunk-
|
|
210
|
+
} from "./chunk-DG62L57H.js";
|
|
211
211
|
import {
|
|
212
212
|
CliError,
|
|
213
213
|
array,
|
|
@@ -226,7 +226,7 @@ import {
|
|
|
226
226
|
safeParse,
|
|
227
227
|
strictObject,
|
|
228
228
|
string
|
|
229
|
-
} from "./chunk-
|
|
229
|
+
} from "./chunk-OEJ5DMCX.js";
|
|
230
230
|
import {
|
|
231
231
|
importFrom,
|
|
232
232
|
resolveFrom
|
|
@@ -16846,7 +16846,7 @@ var require_lib3 = __commonJS({
|
|
|
16846
16846
|
}
|
|
16847
16847
|
});
|
|
16848
16848
|
|
|
16849
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
16849
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.466.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.64.0_commander@15._f7e4048410ccbe1e801fd184c043d197/node_modules/@wirecat/cli-core/dist/conversations/link.js
|
|
16850
16850
|
var RULES_VERSION = 5;
|
|
16851
16851
|
var LOOK_BACK = 50;
|
|
16852
16852
|
var SAME_SENDER_WITHIN = 10;
|
|
@@ -16936,10 +16936,10 @@ var latest = /* @__PURE__ */ __name((window3, matches) => {
|
|
|
16936
16936
|
var sameThread = /* @__PURE__ */ __name((a, b) => a.threadId === b.threadId, "sameThread");
|
|
16937
16937
|
var link = /* @__PURE__ */ __name((message, parentId, source, kind, confidence, method) => ({ messageId: message.id, parentId, source, kind, confidence, method }), "link");
|
|
16938
16938
|
|
|
16939
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
16939
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.466.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.64.0_commander@15._f7e4048410ccbe1e801fd184c043d197/node_modules/@wirecat/cli-core/dist/ports/traits.js
|
|
16940
16940
|
var syncsOneChat = /* @__PURE__ */ __name((messenger) => messenger.history !== "store" || messenger.historyOnDemand === true, "syncsOneChat");
|
|
16941
16941
|
|
|
16942
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
16942
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.466.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.64.0_commander@15._f7e4048410ccbe1e801fd184c043d197/node_modules/@wirecat/cli-core/dist/cli/messenger/lacks.js
|
|
16943
16943
|
var COMMAND_NEEDS = {
|
|
16944
16944
|
"account update": ["updateProfile", "change the profile"],
|
|
16945
16945
|
"account sessions list": ["sessions", "list the account's sessions"],
|
|
@@ -16989,7 +16989,7 @@ var hideNever = /* @__PURE__ */ __name((messenger, group) => {
|
|
|
16989
16989
|
return group;
|
|
16990
16990
|
}, "hideNever");
|
|
16991
16991
|
|
|
16992
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
16992
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.466.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.64.0_commander@15._f7e4048410ccbe1e801fd184c043d197/node_modules/@wirecat/cli-core/dist/services/members-audit.js
|
|
16993
16993
|
var AUDIT_PAGE = 200;
|
|
16994
16994
|
var AUDIT_BUDGET = 10;
|
|
16995
16995
|
var AUDIT_PAUSE_MS = 1e3;
|
|
@@ -17069,7 +17069,7 @@ var burstJoins = /* @__PURE__ */ __name((members) => {
|
|
|
17069
17069
|
return found;
|
|
17070
17070
|
}, "burstJoins");
|
|
17071
17071
|
|
|
17072
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
17072
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.466.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.64.0_commander@15._f7e4048410ccbe1e801fd184c043d197/node_modules/@wirecat/cli-core/dist/meetings/cli/query-options.js
|
|
17073
17073
|
var queryWordsAfterOptions = /* @__PURE__ */ __name((command) => {
|
|
17074
17074
|
command.allowUnknownOption();
|
|
17075
17075
|
const parse = command.parseOptions.bind(command);
|
|
@@ -17089,7 +17089,7 @@ var queryWordsAfterOptions = /* @__PURE__ */ __name((command) => {
|
|
|
17089
17089
|
return command;
|
|
17090
17090
|
}, "queryWordsAfterOptions");
|
|
17091
17091
|
|
|
17092
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
17092
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.466.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.64.0_commander@15._f7e4048410ccbe1e801fd184c043d197/node_modules/@wirecat/cli-core/dist/meetings/cli/passage.js
|
|
17093
17093
|
var count = /* @__PURE__ */ __name((value) => {
|
|
17094
17094
|
if (!/^(0|[1-9]\d*)$/.test(value) || !Number.isSafeInteger(Number(value)))
|
|
17095
17095
|
throw new CliError("validation_error", "expected a nonnegative safe integer");
|
|
@@ -17131,7 +17131,7 @@ var addMeetingPassageCommandDefinition = /* @__PURE__ */ __name((program, deps)
|
|
|
17131
17131
|
var createMeetingPassageCommand = sharedCommand(createMeetingPassageCommandDefinition);
|
|
17132
17132
|
var addMeetingPassageCommand = sharedCommand(addMeetingPassageCommandDefinition);
|
|
17133
17133
|
|
|
17134
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
17134
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.466.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.64.0_commander@15._f7e4048410ccbe1e801fd184c043d197/node_modules/@wirecat/cli-core/dist/meetings/cli/project-evidence.js
|
|
17135
17135
|
var integer = /* @__PURE__ */ __name((value) => {
|
|
17136
17136
|
if (!/^[1-9]\d*$/.test(value) || !Number.isSafeInteger(Number(value)))
|
|
17137
17137
|
throw new CliError("validation_error", "expected a positive safe integer");
|
|
@@ -17154,7 +17154,7 @@ ${fieldsHelp(MEETING_PROJECT_EVIDENCE_QUERY)}`).option("--limit <n>", "hits in o
|
|
|
17154
17154
|
}, "addMeetingProjectEvidenceCommandDefinition");
|
|
17155
17155
|
var addMeetingProjectEvidenceCommand = sharedCommand(addMeetingProjectEvidenceCommandDefinition);
|
|
17156
17156
|
|
|
17157
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
17157
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.466.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.64.0_commander@15._f7e4048410ccbe1e801fd184c043d197/node_modules/@wirecat/cli-core/dist/meetings/cli/search.js
|
|
17158
17158
|
var ZONED = /(?:Z|[+-]\d{2}:?\d{2})$/i;
|
|
17159
17159
|
var moment = /* @__PURE__ */ __name((flag, end, readIn) => (value) => {
|
|
17160
17160
|
const zone = timezoneOf();
|
|
@@ -17240,7 +17240,7 @@ var addMeetingSearchCommandDefinition = /* @__PURE__ */ __name((program, deps) =
|
|
|
17240
17240
|
var createMeetingSearchCommand = sharedCommand(createMeetingSearchCommandDefinition);
|
|
17241
17241
|
var addMeetingSearchCommand = sharedCommand(addMeetingSearchCommandDefinition);
|
|
17242
17242
|
|
|
17243
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
17243
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.466.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.64.0_commander@15._f7e4048410ccbe1e801fd184c043d197/node_modules/@wirecat/cli-core/dist/meetings/cli/index.js
|
|
17244
17244
|
var integer3 = /* @__PURE__ */ __name((text) => {
|
|
17245
17245
|
if (!/^[1-9]\d*$/.test(text) || !Number.isSafeInteger(Number(text)))
|
|
17246
17246
|
throw new InvalidArgumentError("expected a positive integer");
|
|
@@ -17360,7 +17360,7 @@ ${fieldsHelp(EVENT_QUERY, MEETING_QUERY_GUIDE)}`);
|
|
|
17360
17360
|
}, "addMeetingCommandsDefinition");
|
|
17361
17361
|
var addMeetingCommands = sharedCommand(addMeetingCommandsDefinition);
|
|
17362
17362
|
|
|
17363
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
17363
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.466.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.64.0_commander@15._f7e4048410ccbe1e801fd184c043d197/node_modules/@wirecat/cli-core/dist/cli/list-query.js
|
|
17364
17364
|
var LIST_QUERY_GUIDE = "https://github.com/WireCatLabs/cli-core/blob/main/docs/search/query-language.md";
|
|
17365
17365
|
var withQuery = /* @__PURE__ */ __name((command, registry) => {
|
|
17366
17366
|
const query = defineQuery(registry);
|
|
@@ -17474,7 +17474,7 @@ var termField = /* @__PURE__ */ __name((name, type, example, more = {}) => nativ
|
|
|
17474
17474
|
var queryHelp = /* @__PURE__ */ __name((registry) => `
|
|
17475
17475
|
${fieldsHelp(registry, LIST_QUERY_GUIDE)}`, "queryHelp");
|
|
17476
17476
|
|
|
17477
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
17477
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.466.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.64.0_commander@15._f7e4048410ccbe1e801fd184c043d197/node_modules/@wirecat/cli-core/dist/cli/paging.js
|
|
17478
17478
|
var positiveCount = /* @__PURE__ */ __name((flag) => (value) => {
|
|
17479
17479
|
if (!/^\d+$/.test(value.trim()) || Number(value) < 1)
|
|
17480
17480
|
throw new CliError("validation_error", `${flag} takes a whole number from 1 upwards, not "${value}"`);
|
|
@@ -17483,7 +17483,7 @@ var positiveCount = /* @__PURE__ */ __name((flag) => (value) => {
|
|
|
17483
17483
|
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");
|
|
17484
17484
|
var window = /* @__PURE__ */ __name(({ limit, page, all }) => all ? { offset: 0 } : { limit, offset: (page - 1) * limit }, "window");
|
|
17485
17485
|
|
|
17486
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
17486
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.466.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.64.0_commander@15._f7e4048410ccbe1e801fd184c043d197/node_modules/@wirecat/cli-core/dist/cli/messenger/chat-answers.js
|
|
17487
17487
|
var defined = /* @__PURE__ */ __name((record2) => Object.fromEntries(Object.entries(record2).filter(([, value]) => value !== void 0)), "defined");
|
|
17488
17488
|
var chatRef = /* @__PURE__ */ __name((account, chat) => formatReference({ type: "chat", provider: account.provider, account: account.account, chat }), "chatRef");
|
|
17489
17489
|
var settingsOf = /* @__PURE__ */ __name((settings) => defined({
|
|
@@ -17617,7 +17617,8 @@ var topicAnswer = /* @__PURE__ */ __name((topic) => defined({
|
|
|
17617
17617
|
hidden: topic.hidden,
|
|
17618
17618
|
unread_count: topic.unreadCount,
|
|
17619
17619
|
last_message_at: topic.lastMessageAt,
|
|
17620
|
-
created_at: topic.createdAt
|
|
17620
|
+
created_at: topic.createdAt,
|
|
17621
|
+
untrusted: ["title"]
|
|
17621
17622
|
}), "topicAnswer");
|
|
17622
17623
|
var folderAnswer = /* @__PURE__ */ __name((folder) => {
|
|
17623
17624
|
const shown = "chats" in folder ? folder : void 0;
|
|
@@ -17707,7 +17708,7 @@ var sessionAnswer = /* @__PURE__ */ __name(({ current, client, device, location,
|
|
|
17707
17708
|
...createdAt === void 0 ? {} : { created_at: createdAt }
|
|
17708
17709
|
}), "sessionAnswer");
|
|
17709
17710
|
|
|
17710
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
17711
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.466.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.64.0_commander@15._f7e4048410ccbe1e801fd184c043d197/node_modules/@wirecat/cli-core/dist/services/deps.js
|
|
17711
17712
|
var accountStore = /* @__PURE__ */ __name(async (deps) => (await deps.store()).forAccount(await deps.account()), "accountStore");
|
|
17712
17713
|
var crossAccount = /* @__PURE__ */ __name((deps, _reason) => deps.store(), "crossAccount");
|
|
17713
17714
|
var NO_LOCAL_STORE = "this answer comes from the messenger, not from the local store";
|
|
@@ -17772,7 +17773,7 @@ var storedDeps = /* @__PURE__ */ __name((messenger, store, account, guard) => ({
|
|
|
17772
17773
|
}), "storedDeps");
|
|
17773
17774
|
var storeModeDeps = /* @__PURE__ */ __name((messenger, store, account, guard) => ({ ...storedDeps(messenger, store, account, guard), offline: false, reads: "store" }), "storeModeDeps");
|
|
17774
17775
|
|
|
17775
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
17776
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.466.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.64.0_commander@15._f7e4048410ccbe1e801fd184c043d197/node_modules/@wirecat/cli-core/dist/ports/messenger.js
|
|
17776
17777
|
var throughWrapper = /* @__PURE__ */ __name((inner, handled, wrap = (_, call) => call) => new Proxy(handled, {
|
|
17777
17778
|
get: /* @__PURE__ */ __name((own, key) => {
|
|
17778
17779
|
if (key in own)
|
|
@@ -17789,7 +17790,7 @@ var capability = /* @__PURE__ */ __name((adapter, method, what) => {
|
|
|
17789
17790
|
return found.bind(adapter);
|
|
17790
17791
|
}, "capability");
|
|
17791
17792
|
|
|
17792
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
17793
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.466.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.64.0_commander@15._f7e4048410ccbe1e801fd184c043d197/node_modules/@wirecat/cli-core/dist/services/message-resolution.js
|
|
17793
17794
|
var readChatId = /* @__PURE__ */ __name(async (deps, reference, store, account) => {
|
|
17794
17795
|
if (deps.reads !== "store")
|
|
17795
17796
|
return keptChatId(deps.messenger, reference, store, account);
|
|
@@ -17936,7 +17937,7 @@ var senderAmong = /* @__PURE__ */ __name(async (store, accounts, reference) => {
|
|
|
17936
17937
|
}
|
|
17937
17938
|
}, "senderAmong");
|
|
17938
17939
|
|
|
17939
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
17940
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.466.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.64.0_commander@15._f7e4048410ccbe1e801fd184c043d197/node_modules/@wirecat/cli-core/dist/services/person-context.js
|
|
17940
17941
|
var CONTEXT_MESSAGES = 10;
|
|
17941
17942
|
var CONTEXT_BYTES = 64 * 1024;
|
|
17942
17943
|
var toContext = /* @__PURE__ */ __name((key, message, chatTitle) => ({
|
|
@@ -17978,8 +17979,42 @@ var mailWith = /* @__PURE__ */ __name(async (store, key, address, limit, since)
|
|
|
17978
17979
|
return { items, hasMore: emails.length > limit };
|
|
17979
17980
|
}, "mailWith");
|
|
17980
17981
|
var newestFirst = /* @__PURE__ */ __name((a, b) => Date.parse(b.timestamp) - Date.parse(a.timestamp), "newestFirst");
|
|
17982
|
+
var iso = /* @__PURE__ */ __name((at) => at === null ? null : new Date(at).toISOString(), "iso");
|
|
17983
|
+
var contextEvent = /* @__PURE__ */ __name((event) => ({
|
|
17984
|
+
ref: `event:${event.id}`,
|
|
17985
|
+
title: event.title,
|
|
17986
|
+
startsAt: iso(event.startsAt),
|
|
17987
|
+
endsAt: iso(event.endsAt),
|
|
17988
|
+
allDay: event.allDay === true,
|
|
17989
|
+
location: event.location,
|
|
17990
|
+
status: event.status ?? null
|
|
17991
|
+
}), "contextEvent");
|
|
17992
|
+
var EVENT_PAGE = 100;
|
|
17993
|
+
var EVENT_ROWS = 1e3;
|
|
17994
|
+
var eventsOnce = /* @__PURE__ */ __name(async (store, filter, limit) => {
|
|
17995
|
+
const items = [];
|
|
17996
|
+
const series = /* @__PURE__ */ new Set();
|
|
17997
|
+
for (let offset = 0; offset < EVENT_ROWS; offset += EVENT_PAGE) {
|
|
17998
|
+
const page = await store.calendar.events({ ...filter, limit: EVENT_PAGE, offset });
|
|
17999
|
+
for (const event of page) {
|
|
18000
|
+
if (event.status === "cancelled")
|
|
18001
|
+
continue;
|
|
18002
|
+
if (event.eventSeriesId !== null) {
|
|
18003
|
+
if (series.has(event.eventSeriesId))
|
|
18004
|
+
continue;
|
|
18005
|
+
series.add(event.eventSeriesId);
|
|
18006
|
+
}
|
|
18007
|
+
if (items.length === limit)
|
|
18008
|
+
return { items, cut: true };
|
|
18009
|
+
items.push(event);
|
|
18010
|
+
}
|
|
18011
|
+
if (page.length < EVENT_PAGE)
|
|
18012
|
+
return { items, cut: false };
|
|
18013
|
+
}
|
|
18014
|
+
return { items, cut: true };
|
|
18015
|
+
}, "eventsOnce");
|
|
17981
18016
|
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");
|
|
17982
|
-
var personContext = /* @__PURE__ */ __name(async (store, asked, reference, { messages = CONTEXT_MESSAGES, bytes: bytes2 = CONTEXT_BYTES, since } = {}) => {
|
|
18017
|
+
var personContext = /* @__PURE__ */ __name(async (store, asked, reference, { messages = CONTEXT_MESSAGES, bytes: bytes2 = CONTEXT_BYTES, since, now = Date.now() } = {}) => {
|
|
17983
18018
|
const found = pickPerson(reference, await store.people.people(asked.provider, { account: asked.account }));
|
|
17984
18019
|
const record2 = await store.people.personOf({ provider: asked.provider, id: found.id });
|
|
17985
18020
|
if (!record2)
|
|
@@ -18040,6 +18075,11 @@ var personContext = /* @__PURE__ */ __name(async (store, asked, reference, { mes
|
|
|
18040
18075
|
mentions.push(...named2.items.filter((hit) => hit.senderId !== identity.id).map((hit) => toContext(key, hit, hit.chatTitle ?? null)).filter(recent));
|
|
18041
18076
|
cut ||= named2.hasMore;
|
|
18042
18077
|
}
|
|
18078
|
+
const personId = Number(record2.uid);
|
|
18079
|
+
const upcoming = await eventsOnce(store, { personId, from: now }, messages);
|
|
18080
|
+
const upcomingIds = new Set(upcoming.items.map(({ id: id2 }) => id2));
|
|
18081
|
+
const past = await eventsOnce(store, { personId, to: now, newest: true, ...since === void 0 ? {} : { from: since } }, messages);
|
|
18082
|
+
cut ||= upcoming.cut || past.cut;
|
|
18043
18083
|
direct.sort(newestFirst);
|
|
18044
18084
|
const each = [...direct, ...beyond].sort(newestFirst);
|
|
18045
18085
|
theirs.sort(newestFirst);
|
|
@@ -18064,6 +18104,10 @@ var personContext = /* @__PURE__ */ __name(async (store, asked, reference, { mes
|
|
|
18064
18104
|
},
|
|
18065
18105
|
recent: { direct: kept.direct, groups: kept.groups },
|
|
18066
18106
|
mentions: kept.mentions,
|
|
18107
|
+
events: {
|
|
18108
|
+
upcoming: upcoming.items.map(contextEvent),
|
|
18109
|
+
recent: past.items.filter(({ id: id2 }) => !upcomingIds.has(id2)).map(contextEvent)
|
|
18110
|
+
},
|
|
18067
18111
|
limits: { messages, bytes: bytes2 },
|
|
18068
18112
|
hasMore: cut || kept.cut,
|
|
18069
18113
|
complete: notRead.length === 0,
|
|
@@ -18149,10 +18193,10 @@ var personMessages = /* @__PURE__ */ __name(async (store, asked, reference, { ch
|
|
|
18149
18193
|
};
|
|
18150
18194
|
}, "personMessages");
|
|
18151
18195
|
|
|
18152
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
18196
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.466.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.64.0_commander@15._f7e4048410ccbe1e801fd184c043d197/node_modules/@wirecat/cli-core/dist/services/meeting-evidence.js
|
|
18153
18197
|
import { createHash } from "node:crypto";
|
|
18154
18198
|
|
|
18155
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
18199
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.466.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.64.0_commander@15._f7e4048410ccbe1e801fd184c043d197/node_modules/@wirecat/cli-core/dist/services/meeting-reference.js
|
|
18156
18200
|
var missing2 = /* @__PURE__ */ __name(() => new CliError("not_found", "the meeting evidence is unavailable for this account"), "missing");
|
|
18157
18201
|
var authorizedMeetingMetadata = /* @__PURE__ */ __name(async (store, accountId, reference, options = {}) => {
|
|
18158
18202
|
const parsed = parseMeetingReference(reference);
|
|
@@ -18170,7 +18214,7 @@ var authorizedMeetingMetadata = /* @__PURE__ */ __name(async (store, accountId,
|
|
|
18170
18214
|
return { parsed, meeting };
|
|
18171
18215
|
}, "authorizedMeetingMetadata");
|
|
18172
18216
|
|
|
18173
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
18217
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.466.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.64.0_commander@15._f7e4048410ccbe1e801fd184c043d197/node_modules/@wirecat/cli-core/dist/services/meeting-evidence.js
|
|
18174
18218
|
var hash = /* @__PURE__ */ __name((value) => createHash("sha256").update(JSON.stringify(value)).digest("hex"), "hash");
|
|
18175
18219
|
var checkMeetingCancelled = /* @__PURE__ */ __name((signal) => {
|
|
18176
18220
|
if (signal?.aborted)
|
|
@@ -18369,7 +18413,7 @@ var readMeetingEvidence = /* @__PURE__ */ __name(async (store, accountId, refere
|
|
|
18369
18413
|
return { ...packet, fingerprint: hash(packet) };
|
|
18370
18414
|
}, "readMeetingEvidence");
|
|
18371
18415
|
|
|
18372
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
18416
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.466.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.64.0_commander@15._f7e4048410ccbe1e801fd184c043d197/node_modules/@wirecat/cli-core/dist/services/person-meeting-context.js
|
|
18373
18417
|
var personMeetingContext = /* @__PURE__ */ __name(async (store, personReference, options) => {
|
|
18374
18418
|
const { meetings = 10, cues = 5, bytes: bytes2 = 64 * 1024, scanLimit = 1e3, since, signal } = options;
|
|
18375
18419
|
const requestedAccounts = options.accountIds;
|
|
@@ -18468,7 +18512,7 @@ var personMeetingContext = /* @__PURE__ */ __name(async (store, personReference,
|
|
|
18468
18512
|
};
|
|
18469
18513
|
}, "personMeetingContext");
|
|
18470
18514
|
|
|
18471
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
18515
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.466.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.64.0_commander@15._f7e4048410ccbe1e801fd184c043d197/node_modules/@wirecat/cli-core/dist/services/person-preparation.js
|
|
18472
18516
|
var PREPARE_BYTES = 96 * 1024;
|
|
18473
18517
|
var MEETINGS = 5;
|
|
18474
18518
|
var CUES = 3;
|
|
@@ -18585,7 +18629,7 @@ var meetingsOf = /* @__PURE__ */ __name(async (store, uid, stored, since, left)
|
|
|
18585
18629
|
}
|
|
18586
18630
|
}, "meetingsOf");
|
|
18587
18631
|
|
|
18588
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
18632
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.466.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.64.0_commander@15._f7e4048410ccbe1e801fd184c043d197/node_modules/@wirecat/cli-core/dist/services/person-profile.js
|
|
18589
18633
|
var personProfile = /* @__PURE__ */ __name(async (deps, person) => {
|
|
18590
18634
|
const online = deps.offline ? void 0 : await deps.connection();
|
|
18591
18635
|
const held = await storeIfOpen(deps);
|
|
@@ -18642,7 +18686,7 @@ var quiet = /* @__PURE__ */ __name((facts) => facts.chats.map(({ id: id2, title,
|
|
|
18642
18686
|
complete: false
|
|
18643
18687
|
})), "quiet");
|
|
18644
18688
|
|
|
18645
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
18689
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.466.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.64.0_commander@15._f7e4048410ccbe1e801fd184c043d197/node_modules/@wirecat/cli-core/dist/services/person-timeline.js
|
|
18646
18690
|
var TIMELINE_ITEMS = 50;
|
|
18647
18691
|
var TIMELINE_MAX = 500;
|
|
18648
18692
|
var SCOPES = ["personal", "work"];
|
|
@@ -18697,7 +18741,7 @@ var personTimeline = /* @__PURE__ */ __name(async (store, asked, reference, { sc
|
|
|
18697
18741
|
};
|
|
18698
18742
|
}, "personTimeline");
|
|
18699
18743
|
|
|
18700
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
18744
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.466.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.64.0_commander@15._f7e4048410ccbe1e801fd184c043d197/node_modules/@wirecat/cli-core/dist/services/people.js
|
|
18701
18745
|
var peopleService = /* @__PURE__ */ __name((deps) => {
|
|
18702
18746
|
const localCard = /* @__PURE__ */ __name(async (card, includeNotes = false) => {
|
|
18703
18747
|
const held = await storeIfOpen(deps);
|
|
@@ -18788,17 +18832,7 @@ var peopleService = /* @__PURE__ */ __name((deps) => {
|
|
|
18788
18832
|
...detail ? { detail } : {}
|
|
18789
18833
|
});
|
|
18790
18834
|
}, "messagesIn"),
|
|
18791
|
-
link: /* @__PURE__ */ __name(async (person, other, method = "manual") =>
|
|
18792
|
-
const store = await deps.store();
|
|
18793
|
-
const account = await deps.account();
|
|
18794
|
-
const one = await identityIn(store, account, person);
|
|
18795
|
-
if (other === "me")
|
|
18796
|
-
return store.people.linkToOwner(one);
|
|
18797
|
-
const two = await identityIn(store, account, other);
|
|
18798
|
-
if (one.provider === two.provider && one.id === two.id)
|
|
18799
|
-
throw new CliError("validation_error", "that is the same person twice");
|
|
18800
|
-
return store.people.linkIdentities(one, two, { method, by: "owner" });
|
|
18801
|
-
}, "link"),
|
|
18835
|
+
link: /* @__PURE__ */ __name(async (person, other, method = "manual") => linkPeople(await deps.store(), await deps.account(), person, other, method), "link"),
|
|
18802
18836
|
unlink: /* @__PURE__ */ __name(async (person) => {
|
|
18803
18837
|
const store = await deps.store();
|
|
18804
18838
|
return store.people.unlinkIdentity(await identityIn(store, await deps.account(), person), {
|
|
@@ -18875,6 +18909,15 @@ var peopleService = /* @__PURE__ */ __name((deps) => {
|
|
|
18875
18909
|
};
|
|
18876
18910
|
}, "peopleService");
|
|
18877
18911
|
var IMPORT_CHUNK = 10;
|
|
18912
|
+
var linkPeople = /* @__PURE__ */ __name(async (store, account, person, other, method = "manual") => {
|
|
18913
|
+
const one = await identityIn(store, account, person);
|
|
18914
|
+
if (other === "me")
|
|
18915
|
+
return store.people.linkToOwner(one);
|
|
18916
|
+
const two = await identityIn(store, account, other);
|
|
18917
|
+
if (one.provider === two.provider && one.id === two.id)
|
|
18918
|
+
throw new CliError("validation_error", "that is the same person twice");
|
|
18919
|
+
return store.people.linkIdentities(one, two, { method, by: "owner" });
|
|
18920
|
+
}, "linkPeople");
|
|
18878
18921
|
var phoneOf = /* @__PURE__ */ __name((typed) => {
|
|
18879
18922
|
const digits = typed.replace(/[\s()+-]/g, "");
|
|
18880
18923
|
if (!/^\d{6,15}$/.test(digits)) {
|
|
@@ -18922,7 +18965,7 @@ var byRecency = /* @__PURE__ */ __name((a, b) => (b.lastMessagedAt ?? "").locale
|
|
|
18922
18965
|
var byName = /* @__PURE__ */ __name((a, b) => (a.name ?? "").localeCompare(b.name ?? ""), "byName");
|
|
18923
18966
|
var maskedAccount = /* @__PURE__ */ __name((account) => account.phone ? { ...account, phone: `***${account.phone.replace(/\D/g, "").slice(-4)}` } : account, "maskedAccount");
|
|
18924
18967
|
|
|
18925
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
18968
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.466.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.64.0_commander@15._f7e4048410ccbe1e801fd184c043d197/node_modules/@wirecat/cli-core/dist/services/moment.js
|
|
18926
18969
|
var AGO = /^(\d+)(m|h|d)$/;
|
|
18927
18970
|
var AGO_MS = { m: 6e4, h: 36e5, d: 864e5 };
|
|
18928
18971
|
var DATE = /^\d{4}-\d{2}-\d{2}/;
|
|
@@ -18962,7 +19005,7 @@ var dateWindow = /* @__PURE__ */ __name(({ sinceTime, untilTime, zone, now = Dat
|
|
|
18962
19005
|
};
|
|
18963
19006
|
}, "dateWindow");
|
|
18964
19007
|
|
|
18965
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
19008
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.466.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.64.0_commander@15._f7e4048410ccbe1e801fd184c043d197/node_modules/@wirecat/cli-core/dist/services/questions.js
|
|
18966
19009
|
var LINKS = /https?:\/\/\S+/g;
|
|
18967
19010
|
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");
|
|
18968
19011
|
var questions = /* @__PURE__ */ __name((messages, { answerers: answerers2 }) => {
|
|
@@ -18989,7 +19032,7 @@ var questions = /* @__PURE__ */ __name((messages, { answerers: answerers2 }) =>
|
|
|
18989
19032
|
});
|
|
18990
19033
|
}, "questions");
|
|
18991
19034
|
|
|
18992
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
19035
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.466.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.64.0_commander@15._f7e4048410ccbe1e801fd184c043d197/node_modules/@wirecat/cli-core/dist/services/task-categories.js
|
|
18993
19036
|
var names = /* @__PURE__ */ __name((categories) => categories.map(({ name }) => name).join(", "), "names");
|
|
18994
19037
|
var taskCategoryOf = /* @__PURE__ */ __name((categories = DEFAULT_TASK_CATEGORIES, flag = "--category") => (typed) => {
|
|
18995
19038
|
const name = typed.trim().toLowerCase();
|
|
@@ -19039,7 +19082,7 @@ var categorize = /* @__PURE__ */ __name((text, categories = DEFAULT_TASK_CATEGOR
|
|
|
19039
19082
|
return best.name;
|
|
19040
19083
|
}, "categorize");
|
|
19041
19084
|
|
|
19042
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
19085
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.466.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.64.0_commander@15._f7e4048410ccbe1e801fd184c043d197/node_modules/@wirecat/cli-core/dist/services/task-rules.js
|
|
19043
19086
|
var taskAccount = /* @__PURE__ */ __name(({ provider, account }) => `${provider}:${account}`, "taskAccount");
|
|
19044
19087
|
var RULES_IN = {
|
|
19045
19088
|
dialog: "all",
|
|
@@ -19245,7 +19288,7 @@ var applyTaskRulesToChats = /* @__PURE__ */ __name(async (store, account, chatId
|
|
|
19245
19288
|
return passes;
|
|
19246
19289
|
}, "applyTaskRulesToChats");
|
|
19247
19290
|
|
|
19248
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
19291
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.466.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.64.0_commander@15._f7e4048410ccbe1e801fd184c043d197/node_modules/@wirecat/cli-core/dist/botcheck/check.js
|
|
19249
19292
|
var DAY_MS = 864e5;
|
|
19250
19293
|
var NEW_DAYS = 30;
|
|
19251
19294
|
var SAME_TEXT_MIN = 20;
|
|
@@ -19322,7 +19365,7 @@ var scorePerson = /* @__PURE__ */ __name(({ subject, provider, activity, photos,
|
|
|
19322
19365
|
};
|
|
19323
19366
|
}, "scorePerson");
|
|
19324
19367
|
|
|
19325
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
19368
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.466.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.64.0_commander@15._f7e4048410ccbe1e801fd184c043d197/node_modules/@wirecat/cli-core/dist/botcheck/registries.js
|
|
19326
19369
|
var REGISTRIES = {
|
|
19327
19370
|
cas: { title: "Combot Anti-Spam (CAS)", docs: "https://cas.chat/api" },
|
|
19328
19371
|
lols: { title: "lols.bot", docs: "https://api.lols.bot/lols-bot.json" }
|
|
@@ -19407,7 +19450,7 @@ var notCovered = /* @__PURE__ */ __name((messenger, now = /* @__PURE__ */ new Da
|
|
|
19407
19450
|
detail: `lists Telegram accounts only, not ${messenger} ones`
|
|
19408
19451
|
})), "notCovered");
|
|
19409
19452
|
|
|
19410
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
19453
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.466.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.64.0_commander@15._f7e4048410ccbe1e801fd184c043d197/node_modules/@wirecat/cli-core/dist/botcheck/service.js
|
|
19411
19454
|
var ACTIVITY_MESSAGES = 1e3;
|
|
19412
19455
|
var botCheckService = /* @__PURE__ */ __name((deps) => {
|
|
19413
19456
|
const subjectOf = /* @__PURE__ */ __name(async (reference) => {
|
|
@@ -19495,7 +19538,7 @@ var botCheckService = /* @__PURE__ */ __name((deps) => {
|
|
|
19495
19538
|
};
|
|
19496
19539
|
}, "botCheckService");
|
|
19497
19540
|
|
|
19498
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
19541
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.466.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.64.0_commander@15._f7e4048410ccbe1e801fd184c043d197/node_modules/@wirecat/cli-core/dist/domain/thread.js
|
|
19499
19542
|
var threadIdOf = /* @__PURE__ */ __name((value) => {
|
|
19500
19543
|
if (value === void 0)
|
|
19501
19544
|
return void 0;
|
|
@@ -19505,7 +19548,7 @@ var threadIdOf = /* @__PURE__ */ __name((value) => {
|
|
|
19505
19548
|
return id2;
|
|
19506
19549
|
}, "threadIdOf");
|
|
19507
19550
|
|
|
19508
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
19551
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.466.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.64.0_commander@15._f7e4048410ccbe1e801fd184c043d197/node_modules/@wirecat/cli-core/dist/services/chat-stats.js
|
|
19509
19552
|
var TOP_POSTS = 5;
|
|
19510
19553
|
var JOINS = /* @__PURE__ */ new Set(["join", "add"]);
|
|
19511
19554
|
var LEAVES = /* @__PURE__ */ new Set(["leave", "remove"]);
|
|
@@ -19583,7 +19626,7 @@ var membersOf = /* @__PURE__ */ __name(({ events, more }, messages, since) => {
|
|
|
19583
19626
|
}, "membersOf");
|
|
19584
19627
|
var seriesOf = /* @__PURE__ */ __name((messages, events, by, timezone) => {
|
|
19585
19628
|
const dayOf = calendarKey(timezone, "day");
|
|
19586
|
-
const
|
|
19629
|
+
const keyOf5 = /* @__PURE__ */ __name((timestamp) => {
|
|
19587
19630
|
const day = dayOf(Date.parse(timestamp));
|
|
19588
19631
|
if (by === "day")
|
|
19589
19632
|
return day;
|
|
@@ -19598,12 +19641,12 @@ var seriesOf = /* @__PURE__ */ __name((messages, events, by, timezone) => {
|
|
|
19598
19641
|
return found;
|
|
19599
19642
|
}, "row");
|
|
19600
19643
|
for (const one of messages)
|
|
19601
|
-
row(
|
|
19644
|
+
row(keyOf5(one.timestamp)).messages.push(one);
|
|
19602
19645
|
for (const { timestamp, event, people } of events?.events ?? []) {
|
|
19603
19646
|
if (JOINS.has(event))
|
|
19604
|
-
row(
|
|
19647
|
+
row(keyOf5(timestamp)).joined += people.length;
|
|
19605
19648
|
if (LEAVES.has(event))
|
|
19606
|
-
row(
|
|
19649
|
+
row(keyOf5(timestamp)).left += people.length;
|
|
19607
19650
|
}
|
|
19608
19651
|
return [...rows.entries()].sort(([a], [b]) => a.localeCompare(b)).map(([key, found]) => ({
|
|
19609
19652
|
key,
|
|
@@ -19622,7 +19665,7 @@ var median = /* @__PURE__ */ __name((values) => {
|
|
|
19622
19665
|
return Math.round(sorted.length % 2 === 0 ? ((sorted[middle - 1] ?? upper) + upper) / 2 : upper);
|
|
19623
19666
|
}, "median");
|
|
19624
19667
|
|
|
19625
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
19668
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.466.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.64.0_commander@15._f7e4048410ccbe1e801fd184c043d197/node_modules/@wirecat/cli-core/dist/services/member-history.js
|
|
19626
19669
|
var memberEvents = /* @__PURE__ */ __name((stays, revisions, since = 0) => {
|
|
19627
19670
|
const events = [];
|
|
19628
19671
|
for (const stay of stays) {
|
|
@@ -19654,7 +19697,7 @@ var memberEvents = /* @__PURE__ */ __name((stays, revisions, since = 0) => {
|
|
|
19654
19697
|
return events.filter(({ at }) => Date.parse(at) >= since).sort((a, b) => Date.parse(a.at) - Date.parse(b.at) || a.id.localeCompare(b.id));
|
|
19655
19698
|
}, "memberEvents");
|
|
19656
19699
|
|
|
19657
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
19700
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.466.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.64.0_commander@15._f7e4048410ccbe1e801fd184c043d197/node_modules/@wirecat/cli-core/dist/services/chats.js
|
|
19658
19701
|
var EVENTS_DAYS = 7;
|
|
19659
19702
|
var TRACKED_DAYS = 30;
|
|
19660
19703
|
var STATS_PAGE = 1e3;
|
|
@@ -19949,7 +19992,7 @@ var storedMembers = /* @__PURE__ */ __name(async (store, chatId) => {
|
|
|
19949
19992
|
return members.length === 0 ? null : members;
|
|
19950
19993
|
}, "storedMembers");
|
|
19951
19994
|
|
|
19952
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
19995
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.466.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.64.0_commander@15._f7e4048410ccbe1e801fd184c043d197/node_modules/@wirecat/cli-core/dist/services/inbox.js
|
|
19953
19996
|
var INBOX_CHATS = 20;
|
|
19954
19997
|
var REVIEW_DAYS = 3;
|
|
19955
19998
|
var UNANSWERED_HOURS = 24;
|
|
@@ -20157,7 +20200,7 @@ var inboxService = /* @__PURE__ */ __name((deps) => {
|
|
|
20157
20200
|
};
|
|
20158
20201
|
}, "inboxService");
|
|
20159
20202
|
|
|
20160
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
20203
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.466.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.64.0_commander@15._f7e4048410ccbe1e801fd184c043d197/node_modules/@wirecat/cli-core/dist/services/task-tag-filters.js
|
|
20161
20204
|
var taskTagFilters = /* @__PURE__ */ __name(async (store, query) => {
|
|
20162
20205
|
const tags = /* @__PURE__ */ new Map();
|
|
20163
20206
|
for (const node of query ? walkQuery(query.root) : [])
|
|
@@ -20166,7 +20209,7 @@ var taskTagFilters = /* @__PURE__ */ __name(async (store, query) => {
|
|
|
20166
20209
|
return tags;
|
|
20167
20210
|
}, "taskTagFilters");
|
|
20168
20211
|
|
|
20169
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
20212
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.466.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.64.0_commander@15._f7e4048410ccbe1e801fd184c043d197/node_modules/@wirecat/cli-core/dist/services/tasks.js
|
|
20170
20213
|
var TASK_QUERY = {
|
|
20171
20214
|
entity: "task",
|
|
20172
20215
|
backend: "sql",
|
|
@@ -20599,7 +20642,7 @@ var tasksService = /* @__PURE__ */ __name((deps, categories) => {
|
|
|
20599
20642
|
}), "stats")
|
|
20600
20643
|
};
|
|
20601
20644
|
}, "tasksService");
|
|
20602
|
-
var
|
|
20645
|
+
var iso2 = /* @__PURE__ */ __name((at) => at === void 0 ? null : at.toISOString(), "iso");
|
|
20603
20646
|
var taskItem = /* @__PURE__ */ __name((account, { task: task2, title, updatedAt, closeSuggestion = null }) => ({
|
|
20604
20647
|
ref: `task:${task2.id}`,
|
|
20605
20648
|
id: task2.id,
|
|
@@ -20611,8 +20654,8 @@ var taskItem = /* @__PURE__ */ __name((account, { task: task2, title, updatedAt,
|
|
|
20611
20654
|
account: task2.account,
|
|
20612
20655
|
chat: task2.sourceKind === "note" ? null : formatReference({ type: "chat", provider: account.provider, account: account.account, chat: task2.group }),
|
|
20613
20656
|
source_message: task2.source,
|
|
20614
|
-
due_at:
|
|
20615
|
-
closed_at:
|
|
20657
|
+
due_at: iso2(task2.dueAt),
|
|
20658
|
+
closed_at: iso2(task2.closedAt),
|
|
20616
20659
|
...task2.reason === void 0 ? {} : { reason: task2.reason },
|
|
20617
20660
|
category: task2.category ?? null,
|
|
20618
20661
|
...claimItem(task2),
|
|
@@ -20646,7 +20689,7 @@ var taskView = /* @__PURE__ */ __name(async (store, account, task2) => {
|
|
|
20646
20689
|
};
|
|
20647
20690
|
}, "taskView");
|
|
20648
20691
|
|
|
20649
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
20692
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.466.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.64.0_commander@15._f7e4048410ccbe1e801fd184c043d197/node_modules/@wirecat/cli-core/dist/services/excerpt.js
|
|
20650
20693
|
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");
|
|
20651
20694
|
var excerpt = /* @__PURE__ */ __name((text, query, size2 = 240, options = {}) => {
|
|
20652
20695
|
const flat = text.replace(/\s+/g, " ").trim();
|
|
@@ -20662,18 +20705,18 @@ var excerpt = /* @__PURE__ */ __name((text, query, size2 = 240, options = {}) =>
|
|
|
20662
20705
|
}, "excerpt");
|
|
20663
20706
|
var withExcerpt = /* @__PURE__ */ __name(({ matchedText, ...hit }, query) => ({ ...hit, excerpt: excerpt(matchedText ?? hit.text, query) }), "withExcerpt");
|
|
20664
20707
|
|
|
20665
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
20708
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.466.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.64.0_commander@15._f7e4048410ccbe1e801fd184c043d197/node_modules/@wirecat/cli-core/dist/services/media-archive.js
|
|
20666
20709
|
import { setTimeout as sleep } from "node:timers/promises";
|
|
20667
20710
|
|
|
20668
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
20711
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.466.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.64.0_commander@15._f7e4048410ccbe1e801fd184c043d197/node_modules/@wirecat/cli-core/dist/services/media-archive-files.js
|
|
20669
20712
|
import { lstat as lstat4 } from "node:fs/promises";
|
|
20670
20713
|
|
|
20671
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
20714
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.466.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.64.0_commander@15._f7e4048410ccbe1e801fd184c043d197/node_modules/@wirecat/cli-core/dist/persistence/native/recording-partial-store.js
|
|
20672
20715
|
import { createHash as createHash3, randomUUID as randomUUID4 } from "node:crypto";
|
|
20673
20716
|
import { open as open5, rename as rename3, unlink as unlink6 } from "node:fs/promises";
|
|
20674
20717
|
import { join as join5 } from "node:path";
|
|
20675
20718
|
|
|
20676
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
20719
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.466.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.64.0_commander@15._f7e4048410ccbe1e801fd184c043d197/node_modules/@wirecat/cli-core/dist/files/atomic-write.js
|
|
20677
20720
|
import { randomUUID } from "node:crypto";
|
|
20678
20721
|
import { constants } from "node:fs";
|
|
20679
20722
|
import { link as link2, open, realpath, rename, unlink } from "node:fs/promises";
|
|
@@ -20711,7 +20754,7 @@ var writeFileAtomic = /* @__PURE__ */ __name(async (path, content, { mode = 384,
|
|
|
20711
20754
|
}
|
|
20712
20755
|
}, "writeFileAtomic");
|
|
20713
20756
|
|
|
20714
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
20757
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.466.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.64.0_commander@15._f7e4048410ccbe1e801fd184c043d197/node_modules/@wirecat/cli-core/dist/files/ordinary-file.js
|
|
20715
20758
|
import { constants as constants2 } from "node:fs";
|
|
20716
20759
|
import { lstat, open as open2 } from "node:fs/promises";
|
|
20717
20760
|
var deviceOf = /* @__PURE__ */ __name((dev) => process.platform === "win32" ? BigInt.asUintN(32, dev) : dev, "deviceOf");
|
|
@@ -20777,7 +20820,7 @@ var syncDirectory = /* @__PURE__ */ __name(async (path) => {
|
|
|
20777
20820
|
}
|
|
20778
20821
|
}, "syncDirectory");
|
|
20779
20822
|
|
|
20780
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
20823
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.466.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.64.0_commander@15._f7e4048410ccbe1e801fd184c043d197/node_modules/@wirecat/cli-core/dist/files/bounded-utf8.js
|
|
20781
20824
|
var readBoundedUtf8File = /* @__PURE__ */ __name(async (path, { maxBytes }) => {
|
|
20782
20825
|
if (!Number.isSafeInteger(maxBytes) || maxBytes < 1 || maxBytes > 16 * 1024 * 1024)
|
|
20783
20826
|
throw new CliError("validation_error", "file maxBytes takes 1\u201316777216 bytes");
|
|
@@ -20806,21 +20849,21 @@ var readBoundedUtf8File = /* @__PURE__ */ __name(async (path, { maxBytes }) => {
|
|
|
20806
20849
|
}
|
|
20807
20850
|
}, "readBoundedUtf8File");
|
|
20808
20851
|
|
|
20809
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
20852
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.466.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.64.0_commander@15._f7e4048410ccbe1e801fd184c043d197/node_modules/@wirecat/cli-core/dist/files/lock.js
|
|
20810
20853
|
import { mkdir as mkdir2 } from "node:fs/promises";
|
|
20811
20854
|
import { basename as basename2, dirname as dirname2 } from "node:path";
|
|
20812
20855
|
|
|
20813
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
20856
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.466.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.64.0_commander@15._f7e4048410ccbe1e801fd184c043d197/node_modules/@wirecat/cli-core/dist/files/native-writer-lease.js
|
|
20814
20857
|
import { randomUUID as randomUUID2 } from "node:crypto";
|
|
20815
20858
|
import { lstat as lstat3, mkdir, open as open3, realpath as realpath3, rmdir as rmdir2, unlink as unlink4 } from "node:fs/promises";
|
|
20816
20859
|
import { hostname as hostname2 } from "node:os";
|
|
20817
20860
|
import { join as join3 } from "node:path";
|
|
20818
20861
|
|
|
20819
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
20862
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.466.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.64.0_commander@15._f7e4048410ccbe1e801fd184c043d197/node_modules/@wirecat/cli-core/dist/files/native-lease-inspection.js
|
|
20820
20863
|
import { lstat as lstat2, readdir, realpath as realpath2, unlink as unlink2 } from "node:fs/promises";
|
|
20821
20864
|
import { join as join2 } from "node:path";
|
|
20822
20865
|
|
|
20823
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
20866
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.466.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.64.0_commander@15._f7e4048410ccbe1e801fd184c043d197/node_modules/@wirecat/cli-core/dist/files/native-lease-owner.js
|
|
20824
20867
|
import { hostname } from "node:os";
|
|
20825
20868
|
var missingLeaseFile = /* @__PURE__ */ __name((error) => typeof error === "object" && error !== null && "code" in error && error.code === "ENOENT", "missingLeaseFile");
|
|
20826
20869
|
var readLeaseOwner = /* @__PURE__ */ __name(async (path, name, signal) => {
|
|
@@ -20865,7 +20908,7 @@ var leaseOwnerStatus = /* @__PURE__ */ __name((owner) => {
|
|
|
20865
20908
|
}
|
|
20866
20909
|
}, "leaseOwnerStatus");
|
|
20867
20910
|
|
|
20868
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
20911
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.466.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.64.0_commander@15._f7e4048410ccbe1e801fd184c043d197/node_modules/@wirecat/cli-core/dist/files/native-lease-inspection.js
|
|
20869
20912
|
var leaseInspection = /* @__PURE__ */ __name((markerDirectory) => {
|
|
20870
20913
|
const inspect = /* @__PURE__ */ __name(async (destination, options = {}) => {
|
|
20871
20914
|
options.signal?.throwIfAborted();
|
|
@@ -20924,7 +20967,7 @@ var leaseInspection = /* @__PURE__ */ __name((markerDirectory) => {
|
|
|
20924
20967
|
return { inspect, recover };
|
|
20925
20968
|
}, "leaseInspection");
|
|
20926
20969
|
|
|
20927
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
20970
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.466.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.64.0_commander@15._f7e4048410ccbe1e801fd184c043d197/node_modules/@wirecat/cli-core/dist/files/native-lease-release.js
|
|
20928
20971
|
import { rmdir, unlink as unlink3 } from "node:fs/promises";
|
|
20929
20972
|
var ownedNativeLease = /* @__PURE__ */ __name((path, name, owner, folder, identity) => {
|
|
20930
20973
|
let releasing;
|
|
@@ -20949,7 +20992,7 @@ var ownedNativeLease = /* @__PURE__ */ __name((path, name, owner, folder, identi
|
|
|
20949
20992
|
};
|
|
20950
20993
|
}, "ownedNativeLease");
|
|
20951
20994
|
|
|
20952
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
20995
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.466.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.64.0_commander@15._f7e4048410ccbe1e801fd184c043d197/node_modules/@wirecat/cli-core/dist/files/native-writer-lease.js
|
|
20953
20996
|
var validName = /* @__PURE__ */ __name((value) => typeof value === "string" && value.length > 0 && value !== "." && value !== ".." && !/[\\/\0:]/.test(value), "validName");
|
|
20954
20997
|
var nativeWriterLeaseStore = /* @__PURE__ */ __name((layout) => {
|
|
20955
20998
|
const { markerDirectory, legacyMarker } = layout;
|
|
@@ -21020,7 +21063,7 @@ var nativeWriterLeaseStore = /* @__PURE__ */ __name((layout) => {
|
|
|
21020
21063
|
};
|
|
21021
21064
|
}, "nativeWriterLeaseStore");
|
|
21022
21065
|
|
|
21023
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
21066
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.466.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.64.0_commander@15._f7e4048410ccbe1e801fd184c043d197/node_modules/@wirecat/cli-core/dist/files/lock.js
|
|
21024
21067
|
var acquireLock = /* @__PURE__ */ __name(async (path, { signal } = {}) => {
|
|
21025
21068
|
const folder = dirname2(path);
|
|
21026
21069
|
await mkdir2(folder, { recursive: true, mode: 448 });
|
|
@@ -21035,7 +21078,7 @@ var acquireLock = /* @__PURE__ */ __name(async (path, { signal } = {}) => {
|
|
|
21035
21078
|
});
|
|
21036
21079
|
}, "acquireLock");
|
|
21037
21080
|
|
|
21038
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
21081
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.466.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.64.0_commander@15._f7e4048410ccbe1e801fd184c043d197/node_modules/@wirecat/cli-core/dist/persistence/native/recording-partial-metadata.js
|
|
21039
21082
|
import { createHash as createHash2 } from "node:crypto";
|
|
21040
21083
|
var metadataLimit = 16384;
|
|
21041
21084
|
var partialIdentity = /* @__PURE__ */ __name((locator) => JSON.stringify([locator.provider, locator.account, locator.occurrenceId, locator.assetId]), "partialIdentity");
|
|
@@ -21095,7 +21138,7 @@ var readPartialMetadata = /* @__PURE__ */ __name(async (path, locator, maxBytes,
|
|
|
21095
21138
|
}
|
|
21096
21139
|
}, "readPartialMetadata");
|
|
21097
21140
|
|
|
21098
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
21141
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.466.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.64.0_commander@15._f7e4048410ccbe1e801fd184c043d197/node_modules/@wirecat/cli-core/dist/persistence/native/recording-partial-writer.js
|
|
21099
21142
|
import { randomUUID as randomUUID3 } from "node:crypto";
|
|
21100
21143
|
import { open as open4, rename as rename2, unlink as unlink5 } from "node:fs/promises";
|
|
21101
21144
|
import { join as join4 } from "node:path";
|
|
@@ -21187,7 +21230,7 @@ var partialWriter = /* @__PURE__ */ __name(async (input) => {
|
|
|
21187
21230
|
};
|
|
21188
21231
|
}, "partialWriter");
|
|
21189
21232
|
|
|
21190
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
21233
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.466.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.64.0_commander@15._f7e4048410ccbe1e801fd184c043d197/node_modules/@wirecat/cli-core/dist/persistence/native/recording-partial-store.js
|
|
21191
21234
|
var NativeRecordingPartialStore = class {
|
|
21192
21235
|
static {
|
|
21193
21236
|
__name(this, "NativeRecordingPartialStore");
|
|
@@ -21294,12 +21337,12 @@ var NativeRecordingPartialStore = class {
|
|
|
21294
21337
|
}
|
|
21295
21338
|
};
|
|
21296
21339
|
|
|
21297
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
21340
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.466.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.64.0_commander@15._f7e4048410ccbe1e801fd184c043d197/node_modules/@wirecat/cli-core/dist/persistence/native/recording-publication.js
|
|
21298
21341
|
import { createHash as createHash4 } from "node:crypto";
|
|
21299
21342
|
import { link as link3 } from "node:fs/promises";
|
|
21300
21343
|
import { basename as basename3, dirname as dirname3, join as join7, resolve } from "node:path";
|
|
21301
21344
|
|
|
21302
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
21345
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.466.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.64.0_commander@15._f7e4048410ccbe1e801fd184c043d197/node_modules/@wirecat/cli-core/dist/persistence/native/recording-publication-files.js
|
|
21303
21346
|
import { unlink as unlink7 } from "node:fs/promises";
|
|
21304
21347
|
var verifiedPublicationFile = /* @__PURE__ */ __name(async (path, expected, signal, writable = false) => {
|
|
21305
21348
|
signal?.throwIfAborted();
|
|
@@ -21334,7 +21377,7 @@ var commitPublication = /* @__PURE__ */ __name(async (root, partialPath, finalPa
|
|
|
21334
21377
|
signal?.throwIfAborted();
|
|
21335
21378
|
}, "commitPublication");
|
|
21336
21379
|
|
|
21337
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
21380
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.466.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.64.0_commander@15._f7e4048410ccbe1e801fd184c043d197/node_modules/@wirecat/cli-core/dist/persistence/native/recording-publication-journal.js
|
|
21338
21381
|
import { randomUUID as randomUUID5 } from "node:crypto";
|
|
21339
21382
|
import { open as open6, rename as rename4, unlink as unlink8 } from "node:fs/promises";
|
|
21340
21383
|
import { join as join6 } from "node:path";
|
|
@@ -21407,7 +21450,7 @@ var writePublicationJournal = /* @__PURE__ */ __name(async (root, path, prefix,
|
|
|
21407
21450
|
}
|
|
21408
21451
|
}, "writePublicationJournal");
|
|
21409
21452
|
|
|
21410
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
21453
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.466.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.64.0_commander@15._f7e4048410ccbe1e801fd184c043d197/node_modules/@wirecat/cli-core/dist/persistence/native/recording-publication.js
|
|
21411
21454
|
var NativeRecordingPublication = class {
|
|
21412
21455
|
static {
|
|
21413
21456
|
__name(this, "NativeRecordingPublication");
|
|
@@ -21480,7 +21523,7 @@ var NativeRecordingPublication = class {
|
|
|
21480
21523
|
}
|
|
21481
21524
|
};
|
|
21482
21525
|
|
|
21483
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
21526
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.466.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.64.0_commander@15._f7e4048410ccbe1e801fd184c043d197/node_modules/@wirecat/cli-core/dist/services/media-archive-manifest.js
|
|
21484
21527
|
import { createHash as createHash5 } from "node:crypto";
|
|
21485
21528
|
import { readdir as readdir2 } from "node:fs/promises";
|
|
21486
21529
|
import { isAbsolute, join as join8, resolve as resolve2 } from "node:path";
|
|
@@ -21567,7 +21610,7 @@ var commitMediaEntry = /* @__PURE__ */ __name((root, one, beforePublish) => writ
|
|
|
21567
21610
|
beforePublish
|
|
21568
21611
|
}), "commitMediaEntry");
|
|
21569
21612
|
|
|
21570
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
21613
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.466.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.64.0_commander@15._f7e4048410ccbe1e801fd184c043d197/node_modules/@wirecat/cli-core/dist/services/media-archive-files.js
|
|
21571
21614
|
var validator = '"media-completed-v1"';
|
|
21572
21615
|
var maximumFileBytes = 64 * 1024 * 1024 * 1024;
|
|
21573
21616
|
var archiveMediaFile = /* @__PURE__ */ __name(async (root, identity, kind, file, beforeWrite, signal, metadata = {}) => {
|
|
@@ -21668,7 +21711,7 @@ var archiveMediaFile = /* @__PURE__ */ __name(async (root, identity, kind, file,
|
|
|
21668
21711
|
return entry;
|
|
21669
21712
|
}, "archiveMediaFile");
|
|
21670
21713
|
|
|
21671
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
21714
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.466.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.64.0_commander@15._f7e4048410ccbe1e801fd184c043d197/node_modules/@wirecat/cli-core/dist/services/media-archive-locks.js
|
|
21672
21715
|
import { mkdir as mkdir3, realpath as realpath4 } from "node:fs/promises";
|
|
21673
21716
|
import { join as join9, resolve as resolve3 } from "node:path";
|
|
21674
21717
|
var archiveLocations = /* @__PURE__ */ __name(async (initial, signal) => {
|
|
@@ -21735,7 +21778,7 @@ var withMediaArchiveLocks = /* @__PURE__ */ __name(async (directory2, signal, ru
|
|
|
21735
21778
|
throw new CliError("validation_error", "archive locations changed during locking; run the command again");
|
|
21736
21779
|
}, "withMediaArchiveLocks");
|
|
21737
21780
|
|
|
21738
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
21781
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.466.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.64.0_commander@15._f7e4048410ccbe1e801fd184c043d197/node_modules/@wirecat/cli-core/dist/services/media-archive.js
|
|
21739
21782
|
var validateMediaSince = /* @__PURE__ */ __name((value, flag = "--since-time") => {
|
|
21740
21783
|
if (value === void 0)
|
|
21741
21784
|
return void 0;
|
|
@@ -21888,7 +21931,7 @@ var archiveMedia = /* @__PURE__ */ __name(async (ports, options) => {
|
|
|
21888
21931
|
}, { create: true });
|
|
21889
21932
|
}, "archiveMedia");
|
|
21890
21933
|
|
|
21891
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
21934
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.466.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.64.0_commander@15._f7e4048410ccbe1e801fd184c043d197/node_modules/@wirecat/cli-core/dist/services/media-archive-move.js
|
|
21892
21935
|
import { realpath as realpath5, unlink as unlink9 } from "node:fs/promises";
|
|
21893
21936
|
import { basename as basename4, dirname as dirname4, join as join10, resolve as resolve4 } from "node:path";
|
|
21894
21937
|
var canonicalDestination = /* @__PURE__ */ __name(async (directory2) => {
|
|
@@ -22041,7 +22084,7 @@ var moveMediaArchive = /* @__PURE__ */ __name(async (options) => {
|
|
|
22041
22084
|
}, { additional: [target2], createAdditional: !options.dryRun });
|
|
22042
22085
|
}, "moveMediaArchive");
|
|
22043
22086
|
|
|
22044
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
22087
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.466.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.64.0_commander@15._f7e4048410ccbe1e801fd184c043d197/node_modules/@wirecat/cli-core/dist/images/picture/models.js
|
|
22045
22088
|
import { join as join11 } from "node:path";
|
|
22046
22089
|
var clip = /* @__PURE__ */ __name((name) => `https://huggingface.co/Xenova/clip-vit-base-patch32/resolve/d15189d7028b43f1d3e65039190477f6af591c2a/${name}`, "clip");
|
|
22047
22090
|
var IMAGE_MODELS = [
|
|
@@ -22095,7 +22138,7 @@ var imageModelsDirectory = /* @__PURE__ */ __name((env = process.env) => sharedM
|
|
|
22095
22138
|
var placedImage = /* @__PURE__ */ __name((model, directory2) => model.files.map((file) => [file, join11(directory2, model.id, file.name)]), "placedImage");
|
|
22096
22139
|
var isImageModelInstalled = /* @__PURE__ */ __name((model, directory2) => filesPresent(placedImage(model, directory2)), "isImageModelInstalled");
|
|
22097
22140
|
|
|
22098
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
22141
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.466.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.64.0_commander@15._f7e4048410ccbe1e801fd184c043d197/node_modules/@wirecat/cli-core/dist/services/model-downloads.js
|
|
22099
22142
|
var bytesOf = /* @__PURE__ */ __name((model) => model.files.reduce((sum2, file) => sum2 + file.bytes, 0), "bytesOf");
|
|
22100
22143
|
var nativeRuntime = /* @__PURE__ */ __name(async ({ env, progress = /* @__PURE__ */ __name(() => {
|
|
22101
22144
|
}, "progress") }) => {
|
|
@@ -22118,7 +22161,7 @@ var downloadTextModel = /* @__PURE__ */ __name(async (id2, { env, progress = /*
|
|
|
22118
22161
|
}
|
|
22119
22162
|
await nativeRuntime({ env, progress });
|
|
22120
22163
|
progress(`${model.id}: loading it once to check it works`);
|
|
22121
|
-
const { openEmbedder: openEmbedder2 } = await import("./embed-
|
|
22164
|
+
const { openEmbedder: openEmbedder2 } = await import("./embed-UBXCXSRD.js");
|
|
22122
22165
|
const embedder = await openEmbedder2(model, directory2);
|
|
22123
22166
|
try {
|
|
22124
22167
|
const [vector] = await embedder.embed(["check"], "query");
|
|
@@ -22139,7 +22182,7 @@ var downloadRerankModel = /* @__PURE__ */ __name(async (id2, { env, progress = /
|
|
|
22139
22182
|
}
|
|
22140
22183
|
await nativeRuntime({ env, progress });
|
|
22141
22184
|
progress(`${model.id}: loading it once to check it works`);
|
|
22142
|
-
const { openReranker } = await import("./rerank-
|
|
22185
|
+
const { openReranker } = await import("./rerank-3Y2VZM3J.js");
|
|
22143
22186
|
const reranker = await openReranker(model, directory2);
|
|
22144
22187
|
try {
|
|
22145
22188
|
await reranker.score("check", ["check"]);
|
|
@@ -22157,7 +22200,7 @@ var downloadImageModel = /* @__PURE__ */ __name(async (id2, { env, progress = /*
|
|
|
22157
22200
|
await installFiles(placedImage(model, directory2), { progress });
|
|
22158
22201
|
}
|
|
22159
22202
|
progress(`${model.id}: loading it once to check it works`);
|
|
22160
|
-
const { openPictureEmbedder } = await import("./embedder-
|
|
22203
|
+
const { openPictureEmbedder } = await import("./embedder-B4ZTKC23.js");
|
|
22161
22204
|
const embedder = await openPictureEmbedder(model, directory2);
|
|
22162
22205
|
try {
|
|
22163
22206
|
const vector = await embedder.embedQuery("check");
|
|
@@ -22169,7 +22212,7 @@ var downloadImageModel = /* @__PURE__ */ __name(async (id2, { env, progress = /*
|
|
|
22169
22212
|
return { model, directory: directory2 };
|
|
22170
22213
|
}, "downloadImageModel");
|
|
22171
22214
|
|
|
22172
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
22215
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.466.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.64.0_commander@15._f7e4048410ccbe1e801fd184c043d197/node_modules/@wirecat/cli-core/dist/services/account.js
|
|
22173
22216
|
var accountService = /* @__PURE__ */ __name((deps) => {
|
|
22174
22217
|
const online = /* @__PURE__ */ __name(async (command) => {
|
|
22175
22218
|
if (deps.offline)
|
|
@@ -22241,7 +22284,7 @@ var accountService = /* @__PURE__ */ __name((deps) => {
|
|
|
22241
22284
|
};
|
|
22242
22285
|
}, "accountService");
|
|
22243
22286
|
|
|
22244
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
22287
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.466.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.64.0_commander@15._f7e4048410ccbe1e801fd184c043d197/node_modules/@wirecat/cli-core/dist/domain/send-time.js
|
|
22245
22288
|
var MINUTE = 6e4;
|
|
22246
22289
|
var YEAR = 365 * 24 * 60 * MINUTE;
|
|
22247
22290
|
var DELAY = /^(\d+)(m|h|d)$/;
|
|
@@ -22260,7 +22303,7 @@ var sendTime = /* @__PURE__ */ __name((value, now = Date.now(), flag = "--at-tim
|
|
|
22260
22303
|
return new Date(at - at % MINUTE).toISOString();
|
|
22261
22304
|
}, "sendTime");
|
|
22262
22305
|
|
|
22263
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
22306
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.466.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.64.0_commander@15._f7e4048410ccbe1e801fd184c043d197/node_modules/@wirecat/cli-core/dist/services/admin.js
|
|
22264
22307
|
var recordMembership = /* @__PURE__ */ __name(async (deps, operationId, done2, change, fix, write) => {
|
|
22265
22308
|
try {
|
|
22266
22309
|
const held = await accountStoreIfOpen(deps);
|
|
@@ -22507,7 +22550,7 @@ var linkLimits = /* @__PURE__ */ __name(({ approval, expires, maxUses }) => {
|
|
|
22507
22550
|
return expires === void 0 ? void 0 : sendTime(expires, Date.now(), "--expire-time");
|
|
22508
22551
|
}, "linkLimits");
|
|
22509
22552
|
|
|
22510
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
22553
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.466.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.64.0_commander@15._f7e4048410ccbe1e801fd184c043d197/node_modules/@wirecat/cli-core/dist/services/mail-search.js
|
|
22511
22554
|
var THREADS_PAGE = 500;
|
|
22512
22555
|
var threadsOf = /* @__PURE__ */ __name(async (store, key) => {
|
|
22513
22556
|
const account = await store.accounts.storedAccount(key).catch(() => void 0);
|
|
@@ -22586,7 +22629,7 @@ var readMail = /* @__PURE__ */ __name(async (store, locator, { before: before2 =
|
|
|
22586
22629
|
return thread.slice(Math.max(0, at - before2), at + after + 1).map((hit) => hit.id === message ? { ...hit, anchor: true } : hit);
|
|
22587
22630
|
}, "readMail");
|
|
22588
22631
|
|
|
22589
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
22632
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.466.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.64.0_commander@15._f7e4048410ccbe1e801fd184c043d197/node_modules/@wirecat/cli-core/dist/services/search-kind.js
|
|
22590
22633
|
var NO_MAIL = "no_mail";
|
|
22591
22634
|
var MAIL = "email";
|
|
22592
22635
|
var listContextOf = /* @__PURE__ */ __name(async (store, account, app, stored) => {
|
|
@@ -22633,7 +22676,7 @@ var accountsOfKind = /* @__PURE__ */ __name((kind, chosen, held, explicit, comma
|
|
|
22633
22676
|
return chosenMail.map(({ provider, account }) => ({ provider, account }));
|
|
22634
22677
|
}, "accountsOfKind");
|
|
22635
22678
|
|
|
22636
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
22679
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.466.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.64.0_commander@15._f7e4048410ccbe1e801fd184c043d197/node_modules/@wirecat/cli-core/dist/services/messages-search.js
|
|
22637
22680
|
var MAIL_FIELDS = /* @__PURE__ */ new Set(["to", "cc", "bcc", "subject", "mailbox", "label", "is"]);
|
|
22638
22681
|
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");
|
|
22639
22682
|
var prepareLucene = /* @__PURE__ */ __name(async (store, account, request, messenger) => {
|
|
@@ -22816,12 +22859,9 @@ var coverageOf = /* @__PURE__ */ __name(async (store, { scopeAccounts, selectedC
|
|
|
22816
22859
|
const completeness = [];
|
|
22817
22860
|
const stats = /* @__PURE__ */ new Map();
|
|
22818
22861
|
let inventoryComplete = scopeAccounts.length > 0;
|
|
22819
|
-
let ownInventory = true;
|
|
22820
22862
|
for (const selected of scopeAccounts) {
|
|
22821
22863
|
if (!await store.sync.syncState(selected, CHAT_LIST_KEY)) {
|
|
22822
22864
|
inventoryComplete = false;
|
|
22823
|
-
if (messenger.provider === void 0 || selected.provider === messenger.provider)
|
|
22824
|
-
ownInventory = false;
|
|
22825
22865
|
}
|
|
22826
22866
|
const chatIds = selectedChat ? selected.provider === selectedChat.account.provider && selected.account === selectedChat.account.account ? [selectedChat.chatId] : [] : (await store.chats.chats(selected, {})).items.map(({ id: id2 }) => id2);
|
|
22827
22867
|
for (const chat of await store.chats.chatCompleteness(selected, chatIds))
|
|
@@ -22845,7 +22885,8 @@ var coverageOf = /* @__PURE__ */ __name(async (store, { scopeAccounts, selectedC
|
|
|
22845
22885
|
const neverFetched = own.filter(({ state: state2 }) => state2 === "unknown").length;
|
|
22846
22886
|
const behindCount = own.filter(behind).length;
|
|
22847
22887
|
const command = messenger.app?.command;
|
|
22848
|
-
const
|
|
22888
|
+
const syncChat = selectedChat ? neverFetched || behindCount ? selectedChat : null : attention[0] ?? null;
|
|
22889
|
+
const next = command === void 0 || !syncChat || !syncsOneChat(messenger) ? null : `${command} messages sync ${syncChat.chatId}`;
|
|
22849
22890
|
const state = selectedChat && completeness.length > 0 && completeness.every(({ state: state2 }) => state2 === "complete") ? "complete" : completeness.some(({ state: state2 }) => state2 !== "unknown") ? "partial" : "unknown";
|
|
22850
22891
|
return {
|
|
22851
22892
|
completeness,
|
|
@@ -22940,10 +22981,10 @@ var statsLucene = /* @__PURE__ */ __name(async (store, account, request, messeng
|
|
|
22940
22981
|
const groups = prepared.scopeAccounts.length ? await count4(prepared.execution, calendar ? "time" : by) : [];
|
|
22941
22982
|
let rows;
|
|
22942
22983
|
if (calendar) {
|
|
22943
|
-
const
|
|
22984
|
+
const keyOf5 = calendarKey(prepared.timezone, by);
|
|
22944
22985
|
const totals = /* @__PURE__ */ new Map();
|
|
22945
22986
|
for (const { id: id2, count: count5 } of groups) {
|
|
22946
|
-
const key =
|
|
22987
|
+
const key = keyOf5(Number(id2));
|
|
22947
22988
|
totals.set(key, (totals.get(key) ?? 0) + count5);
|
|
22948
22989
|
}
|
|
22949
22990
|
rows = [...totals].sort(([a], [b]) => a.localeCompare(b)).map(([key, count5]) => ({ key, name: null, count: count5 }));
|
|
@@ -22966,7 +23007,7 @@ var statsLucene = /* @__PURE__ */ __name(async (store, account, request, messeng
|
|
|
22966
23007
|
};
|
|
22967
23008
|
}, "statsLucene");
|
|
22968
23009
|
|
|
22969
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
23010
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.466.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.64.0_commander@15._f7e4048410ccbe1e801fd184c043d197/node_modules/@wirecat/cli-core/dist/services/rankings-selection.js
|
|
22970
23011
|
var RANKING_SELECTION_BYTES = 64 * 1024;
|
|
22971
23012
|
var object = /* @__PURE__ */ __name((value) => value !== null && typeof value === "object" && !Array.isArray(value) ? value : void 0, "object");
|
|
22972
23013
|
function invalid(message = "ranking selection is invalid \u2014 obtain a new drilldown from stats top") {
|
|
@@ -23135,7 +23176,7 @@ var readRankingSelection = /* @__PURE__ */ __name(async (store, input) => {
|
|
|
23135
23176
|
};
|
|
23136
23177
|
}, "readRankingSelection");
|
|
23137
23178
|
|
|
23138
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
23179
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.466.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.64.0_commander@15._f7e4048410ccbe1e801fd184c043d197/node_modules/@wirecat/cli-core/dist/services/search-record.js
|
|
23139
23180
|
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");
|
|
23140
23181
|
var searchRecordOf = /* @__PURE__ */ __name((command, params) => ({
|
|
23141
23182
|
command,
|
|
@@ -23145,7 +23186,7 @@ var searchRecordOf = /* @__PURE__ */ __name((command, params) => ({
|
|
|
23145
23186
|
fieldsVersion: FIELD_VERSION
|
|
23146
23187
|
}), "searchRecordOf");
|
|
23147
23188
|
|
|
23148
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
23189
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.466.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.64.0_commander@15._f7e4048410ccbe1e801fd184c043d197/node_modules/@wirecat/cli-core/dist/services/admin-statistics.js
|
|
23149
23190
|
function invalid2(message) {
|
|
23150
23191
|
throw new CliError("validation_error", message);
|
|
23151
23192
|
}
|
|
@@ -23439,7 +23480,7 @@ var adminStatisticsService = /* @__PURE__ */ __name((deps) => ({
|
|
|
23439
23480
|
}, "evidence")
|
|
23440
23481
|
}), "adminStatisticsService");
|
|
23441
23482
|
|
|
23442
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
23483
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.466.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.64.0_commander@15._f7e4048410ccbe1e801fd184c043d197/node_modules/@wirecat/cli-core/dist/services/agenda.js
|
|
23443
23484
|
var DAY = 864e5;
|
|
23444
23485
|
var CLAIMS = ["none", "mine", "others", "any"];
|
|
23445
23486
|
var TASK_FIELDS = /* @__PURE__ */ new Set(["tag", "category", "claimed"]);
|
|
@@ -23661,10 +23702,10 @@ var agendaItem = /* @__PURE__ */ __name((shown) => {
|
|
|
23661
23702
|
};
|
|
23662
23703
|
}, "agendaItem");
|
|
23663
23704
|
|
|
23664
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
23705
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.466.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.64.0_commander@15._f7e4048410ccbe1e801fd184c043d197/node_modules/@wirecat/cli-core/dist/services/archive.js
|
|
23665
23706
|
import { setTimeout as sleep3 } from "node:timers/promises";
|
|
23666
23707
|
|
|
23667
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
23708
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.466.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.64.0_commander@15._f7e4048410ccbe1e801fd184c043d197/node_modules/@wirecat/cli-core/dist/services/backfill-estimate.js
|
|
23668
23709
|
var REQUEST_MS = 400;
|
|
23669
23710
|
var estimateBackfill = /* @__PURE__ */ __name(({ ranges, held, newest, page, maxPages, pauseMs }) => {
|
|
23670
23711
|
const lowest = ranges[0];
|
|
@@ -23687,13 +23728,13 @@ var estimateBackfill = /* @__PURE__ */ __name(({ ranges, held, newest, page, max
|
|
|
23687
23728
|
};
|
|
23688
23729
|
}, "estimateBackfill");
|
|
23689
23730
|
|
|
23690
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
23731
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.466.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.64.0_commander@15._f7e4048410ccbe1e801fd184c043d197/node_modules/@wirecat/cli-core/dist/domain/recovery.js
|
|
23691
23732
|
var withRecovery = /* @__PURE__ */ __name((error) => ({
|
|
23692
23733
|
...error,
|
|
23693
23734
|
retryable: typeof error.retryable === "boolean" ? error.retryable : error.code === "rate_limited" || error.status === 429
|
|
23694
23735
|
}), "withRecovery");
|
|
23695
23736
|
|
|
23696
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
23737
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.466.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.64.0_commander@15._f7e4048410ccbe1e801fd184c043d197/node_modules/@wirecat/cli-core/dist/services/batch.js
|
|
23697
23738
|
var actionable = /* @__PURE__ */ __name((error) => {
|
|
23698
23739
|
if (isCliFailure(error))
|
|
23699
23740
|
return withRecovery({ code: error.code, message: error.message, ...error.details });
|
|
@@ -23776,7 +23817,7 @@ var mergeBatches = /* @__PURE__ */ __name((a, b) => {
|
|
|
23776
23817
|
};
|
|
23777
23818
|
}, "mergeBatches");
|
|
23778
23819
|
|
|
23779
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
23820
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.466.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.64.0_commander@15._f7e4048410ccbe1e801fd184c043d197/node_modules/@wirecat/cli-core/dist/services/patience.js
|
|
23780
23821
|
import { setTimeout as sleep2 } from "node:timers/promises";
|
|
23781
23822
|
var LONGEST_WAIT_MS = 5 * 60 * 1e3;
|
|
23782
23823
|
var patiently = /* @__PURE__ */ __name(async (request, note, stop) => {
|
|
@@ -23797,7 +23838,7 @@ var patiently = /* @__PURE__ */ __name(async (request, note, stop) => {
|
|
|
23797
23838
|
}
|
|
23798
23839
|
}, "patiently");
|
|
23799
23840
|
|
|
23800
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
23841
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.466.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.64.0_commander@15._f7e4048410ccbe1e801fd184c043d197/node_modules/@wirecat/cli-core/dist/images/context/index.js
|
|
23801
23842
|
var CONTEXT_MESSAGES2 = 3;
|
|
23802
23843
|
var CONTEXT_MINUTES = 10;
|
|
23803
23844
|
var MAX_CHARS = 1200;
|
|
@@ -23821,12 +23862,12 @@ var context = {
|
|
|
23821
23862
|
}, "describe")
|
|
23822
23863
|
};
|
|
23823
23864
|
|
|
23824
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
23865
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.466.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.64.0_commander@15._f7e4048410ccbe1e801fd184c043d197/node_modules/@wirecat/cli-core/dist/images/registry.js
|
|
23825
23866
|
var BUILT_INS = [context];
|
|
23826
23867
|
var providers = [...BUILT_INS];
|
|
23827
23868
|
var registeredImageProviders = /* @__PURE__ */ __name(() => providers, "registeredImageProviders");
|
|
23828
23869
|
|
|
23829
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
23870
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.466.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.64.0_commander@15._f7e4048410ccbe1e801fd184c043d197/node_modules/@wirecat/cli-core/dist/services/conversations.js
|
|
23830
23871
|
var READ_PAGE = 5e3;
|
|
23831
23872
|
var CHAIN = 50;
|
|
23832
23873
|
var CONVERSATION_QUERY = {
|
|
@@ -23978,7 +24019,7 @@ var sized = /* @__PURE__ */ __name((size2) => {
|
|
|
23978
24019
|
return size2;
|
|
23979
24020
|
}, "sized");
|
|
23980
24021
|
|
|
23981
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
24022
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.466.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.64.0_commander@15._f7e4048410ccbe1e801fd184c043d197/node_modules/@wirecat/cli-core/dist/services/embeddings-maintenance.js
|
|
23982
24023
|
var REFRESH_BOUNDS = { maxChats: 20, maxChunks: 2e3 };
|
|
23983
24024
|
var MESSAGE_PAGE = 5e3;
|
|
23984
24025
|
var PER_SESSION = 8;
|
|
@@ -24000,7 +24041,7 @@ var embeddingTarget = /* @__PURE__ */ __name((deps, choice = DEFAULT_TEXT_MODEL)
|
|
|
24000
24041
|
price: remote.price,
|
|
24001
24042
|
installed: true,
|
|
24002
24043
|
perBatch: PER_REQUEST * concurrency,
|
|
24003
|
-
open: /* @__PURE__ */ __name(async () => (await import("./remote-
|
|
24044
|
+
open: /* @__PURE__ */ __name(async () => (await import("./remote-W72AR7KH.js")).openRemote(remote, apiKey, { concurrency }), "open")
|
|
24004
24045
|
};
|
|
24005
24046
|
}
|
|
24006
24047
|
const model = textModel(choice);
|
|
@@ -24017,7 +24058,7 @@ var embeddingTarget = /* @__PURE__ */ __name((deps, choice = DEFAULT_TEXT_MODEL)
|
|
|
24017
24058
|
if (!isTextModelInstalled(model, directory2))
|
|
24018
24059
|
throw notDownloaded(deps, model.id);
|
|
24019
24060
|
if (apart) {
|
|
24020
|
-
const { openProcess } = await import("./process-
|
|
24061
|
+
const { openProcess } = await import("./process-GPUXC4PG.js");
|
|
24021
24062
|
return openProcess(model, directory2, { threads: threads ?? defaultThreads() });
|
|
24022
24063
|
}
|
|
24023
24064
|
return openEmbedder(model, directory2, { threads: threads ?? defaultThreads() });
|
|
@@ -24306,7 +24347,7 @@ var shaped = /* @__PURE__ */ __name(({ chatId, builtAt, algorithmVersion, pendin
|
|
|
24306
24347
|
return { ...one, state };
|
|
24307
24348
|
}, "shaped");
|
|
24308
24349
|
|
|
24309
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
24350
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.466.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.64.0_commander@15._f7e4048410ccbe1e801fd184c043d197/node_modules/@wirecat/cli-core/dist/services/search-catchup.js
|
|
24310
24351
|
var CATCH_UP_BOUNDS = { maxChunks: 500, maxMessages: 1e4, timeMs: 3e4 };
|
|
24311
24352
|
var validateCatchUpBounds = /* @__PURE__ */ __name((options) => {
|
|
24312
24353
|
for (const [key, value, maximum] of [
|
|
@@ -24359,7 +24400,7 @@ var catchUpSearch = /* @__PURE__ */ __name(async (deps, chat, options, signal, c
|
|
|
24359
24400
|
}
|
|
24360
24401
|
}, "catchUpSearch");
|
|
24361
24402
|
|
|
24362
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
24403
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.466.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.64.0_commander@15._f7e4048410ccbe1e801fd184c043d197/node_modules/@wirecat/cli-core/dist/services/archive.js
|
|
24363
24404
|
var pushed = /* @__PURE__ */ __name((deps, what) => {
|
|
24364
24405
|
if (deps.reads === "store") {
|
|
24365
24406
|
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`);
|
|
@@ -24676,7 +24717,7 @@ var timeOfKey = /* @__PURE__ */ __name(async (store, account, chatId, key, byTim
|
|
|
24676
24717
|
return message?.timestamp ?? fallback;
|
|
24677
24718
|
}, "timeOfKey");
|
|
24678
24719
|
|
|
24679
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
24720
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.466.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.64.0_commander@15._f7e4048410ccbe1e801fd184c043d197/node_modules/@wirecat/cli-core/dist/services/archive-gaps.js
|
|
24680
24721
|
import { createHash as createHash6, randomUUID as randomUUID6 } from "node:crypto";
|
|
24681
24722
|
var GAP_BOUNDS = { maxGaps: 5, limit: 500, timeMs: 3e4 };
|
|
24682
24723
|
var validateRepair = /* @__PURE__ */ __name((messenger, options) => {
|
|
@@ -24813,12 +24854,12 @@ var gapsService = /* @__PURE__ */ __name((deps) => {
|
|
|
24813
24854
|
return { plan, repair };
|
|
24814
24855
|
}, "gapsService");
|
|
24815
24856
|
|
|
24816
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
24857
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.466.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.64.0_commander@15._f7e4048410ccbe1e801fd184c043d197/node_modules/@wirecat/cli-core/dist/services/attachments.js
|
|
24817
24858
|
import { createHash as createHash8 } from "node:crypto";
|
|
24818
24859
|
import { constants as constants4 } from "node:fs";
|
|
24819
24860
|
import { open as open8, readFile, stat } from "node:fs/promises";
|
|
24820
24861
|
|
|
24821
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
24862
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.466.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.64.0_commander@15._f7e4048410ccbe1e801fd184c043d197/node_modules/@wirecat/cli-core/dist/attachments/directory.js
|
|
24822
24863
|
import { lstat as lstat5, readdir as readdir3, realpath as realpath6 } from "node:fs/promises";
|
|
24823
24864
|
import { basename as basename5, join as join12, relative, sep } from "node:path";
|
|
24824
24865
|
var MAX_FILES = 1e4;
|
|
@@ -24889,15 +24930,15 @@ var directoryPaths = /* @__PURE__ */ __name(async (store, chat, directory2, app,
|
|
|
24889
24930
|
return choices;
|
|
24890
24931
|
}, "directoryPaths");
|
|
24891
24932
|
|
|
24892
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
24933
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.466.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.64.0_commander@15._f7e4048410ccbe1e801fd184c043d197/node_modules/@wirecat/cli-core/dist/attachments/documents.js
|
|
24893
24934
|
import { posix } from "node:path";
|
|
24894
24935
|
|
|
24895
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
24936
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.466.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.64.0_commander@15._f7e4048410ccbe1e801fd184c043d197/node_modules/@wirecat/cli-core/dist/attachments/container.js
|
|
24896
24937
|
import { setImmediate as tick } from "node:timers/promises";
|
|
24897
24938
|
import { crc32 } from "node:zlib";
|
|
24898
24939
|
var import_xmldom = __toESM(require_lib(), 1);
|
|
24899
24940
|
|
|
24900
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
24941
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.466.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.64.0_commander@15._f7e4048410ccbe1e801fd184c043d197/node_modules/@wirecat/cli-core/dist/attachments/encoding.js
|
|
24901
24942
|
var import_chardet = __toESM(require_lib2(), 1);
|
|
24902
24943
|
var import_iconv_lite = __toESM(require_lib3(), 1);
|
|
24903
24944
|
var SAMPLE = 65536;
|
|
@@ -24999,7 +25040,7 @@ var decodeXml = /* @__PURE__ */ __name((bytes2) => {
|
|
|
24999
25040
|
return result.text;
|
|
25000
25041
|
}, "decodeXml");
|
|
25001
25042
|
|
|
25002
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
25043
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.466.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.64.0_commander@15._f7e4048410ccbe1e801fd184c043d197/node_modules/@wirecat/cli-core/dist/attachments/container.js
|
|
25003
25044
|
var MAX_PART = 10 * 1024 * 1024;
|
|
25004
25045
|
var MAX_ENTRIES = 1e3;
|
|
25005
25046
|
var decoder = new TextDecoder("utf-8", { fatal: true });
|
|
@@ -25214,7 +25255,7 @@ var elements = /* @__PURE__ */ __name((node, name, namespace) => {
|
|
|
25214
25255
|
return found;
|
|
25215
25256
|
}, "elements");
|
|
25216
25257
|
|
|
25217
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
25258
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.466.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.64.0_commander@15._f7e4048410ccbe1e801fd184c043d197/node_modules/@wirecat/cli-core/dist/attachments/sheets.js
|
|
25218
25259
|
var columnName = /* @__PURE__ */ __name((column) => {
|
|
25219
25260
|
let name = "";
|
|
25220
25261
|
for (let rest = column; rest > 0; rest = Math.floor((rest - 1) / 26))
|
|
@@ -25269,7 +25310,7 @@ var sheetText = /* @__PURE__ */ __name((sheets2, maxChars = MAX_TEXT_CHARS) => {
|
|
|
25269
25310
|
return { text: parts.join("").trim(), truncated: false };
|
|
25270
25311
|
}, "sheetText");
|
|
25271
25312
|
|
|
25272
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
25313
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.466.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.64.0_commander@15._f7e4048410ccbe1e801fd184c043d197/node_modules/@wirecat/cli-core/dist/attachments/documents.js
|
|
25273
25314
|
var OFFICE = "urn:oasis:names:tc:opendocument:xmlns:office:1.0";
|
|
25274
25315
|
var TEXT = "urn:oasis:names:tc:opendocument:xmlns:text:1.0";
|
|
25275
25316
|
var TABLE = "urn:oasis:names:tc:opendocument:xmlns:table:1.0";
|
|
@@ -25511,10 +25552,10 @@ var displayed = /* @__PURE__ */ __name((saved, format, base1904) => {
|
|
|
25511
25552
|
if (format === "number")
|
|
25512
25553
|
return plainNumber(value);
|
|
25513
25554
|
const days = value + (base1904 ? 1462 : 0);
|
|
25514
|
-
const
|
|
25555
|
+
const iso4 = new Date(Date.UTC(1899, 11, 30) + Math.round(days * 864e5)).toISOString();
|
|
25515
25556
|
if (format === "time" && value < 1)
|
|
25516
|
-
return
|
|
25517
|
-
return Number.isInteger(value) ?
|
|
25557
|
+
return iso4.slice(11, 19);
|
|
25558
|
+
return Number.isInteger(value) ? iso4.slice(0, 10) : `${iso4.slice(0, 10)} ${iso4.slice(11, 19)}`;
|
|
25518
25559
|
}, "displayed");
|
|
25519
25560
|
var cellAddress = /* @__PURE__ */ __name((reference) => {
|
|
25520
25561
|
const match = /^([A-Z]{1,3})([1-9]\d{0,6})$/.exec(reference);
|
|
@@ -25669,10 +25710,10 @@ var readDocument = /* @__PURE__ */ __name(async (bytes2, kind, signal) => {
|
|
|
25669
25710
|
}
|
|
25670
25711
|
}, "readDocument");
|
|
25671
25712
|
|
|
25672
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
25713
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.466.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.64.0_commander@15._f7e4048410ccbe1e801fd184c043d197/node_modules/@wirecat/cli-core/dist/attachments/extract.js
|
|
25673
25714
|
import { extname as extname2 } from "node:path";
|
|
25674
25715
|
|
|
25675
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
25716
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.466.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.64.0_commander@15._f7e4048410ccbe1e801fd184c043d197/node_modules/@wirecat/cli-core/dist/readers/engine.js
|
|
25676
25717
|
import { readFileSync } from "node:fs";
|
|
25677
25718
|
import { dirname as dirname5, extname, join as join13 } from "node:path";
|
|
25678
25719
|
import { fileURLToPath } from "node:url";
|
|
@@ -25733,7 +25774,7 @@ var derived = /* @__PURE__ */ __name((bytes2, extractor, read) => {
|
|
|
25733
25774
|
}
|
|
25734
25775
|
}, "derived");
|
|
25735
25776
|
|
|
25736
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
25777
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.466.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.64.0_commander@15._f7e4048410ccbe1e801fd184c043d197/node_modules/@wirecat/cli-core/dist/readers/image/index.js
|
|
25737
25778
|
var IMAGES = /* @__PURE__ */ new Set([".jpg", ".jpeg", ".png", ".webp", ".gif", ".heic", ".tif", ".tiff", ".bmp"]);
|
|
25738
25779
|
var image2 = {
|
|
25739
25780
|
id: "image",
|
|
@@ -25742,7 +25783,7 @@ var image2 = {
|
|
|
25742
25783
|
read: /* @__PURE__ */ __name(async () => ({ status: "needs-agent" }), "read")
|
|
25743
25784
|
};
|
|
25744
25785
|
|
|
25745
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
25786
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.466.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.64.0_commander@15._f7e4048410ccbe1e801fd184c043d197/node_modules/@wirecat/cli-core/dist/readers/doc/index.js
|
|
25746
25787
|
var OLE = "\xD0\xCF\xE0\xA1\xB1\xE1";
|
|
25747
25788
|
var doc = {
|
|
25748
25789
|
id: "doc",
|
|
@@ -25754,7 +25795,7 @@ var doc = {
|
|
|
25754
25795
|
}), "read")
|
|
25755
25796
|
};
|
|
25756
25797
|
|
|
25757
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
25798
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.466.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.64.0_commander@15._f7e4048410ccbe1e801fd184c043d197/node_modules/@wirecat/cli-core/dist/readers/docx/index.js
|
|
25758
25799
|
var DOCX = "application/vnd.openxmlformats-officedocument.wordprocessingml.document";
|
|
25759
25800
|
var docx = {
|
|
25760
25801
|
id: "docx",
|
|
@@ -25767,7 +25808,7 @@ var docx = {
|
|
|
25767
25808
|
}), "read")
|
|
25768
25809
|
};
|
|
25769
25810
|
|
|
25770
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
25811
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.466.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.64.0_commander@15._f7e4048410ccbe1e801fd184c043d197/node_modules/@wirecat/cli-core/dist/attachments/markup.js
|
|
25771
25812
|
var import_iconv_lite2 = __toESM(require_lib3(), 1);
|
|
25772
25813
|
var RTF_SKIPPED = /* @__PURE__ */ new Set([
|
|
25773
25814
|
"fonttbl",
|
|
@@ -25943,7 +25984,7 @@ var htmlText = /* @__PURE__ */ __name((source) => {
|
|
|
25943
25984
|
}, "htmlText");
|
|
25944
25985
|
var safeChar = /* @__PURE__ */ __name((code, fallback) => code > 0 && code <= 1114111 ? String.fromCodePoint(code) : fallback, "safeChar");
|
|
25945
25986
|
|
|
25946
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
25987
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.466.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.64.0_commander@15._f7e4048410ccbe1e801fd184c043d197/node_modules/@wirecat/cli-core/dist/readers/html/page.js
|
|
25947
25988
|
var clean = /* @__PURE__ */ __name((value) => typeof value === "string" ? value.replace(/\s+/g, " ").trim() : "", "clean");
|
|
25948
25989
|
var namesIn = /* @__PURE__ */ __name((value) => [value].flat().map((entry) => typeof entry === "string" ? clean(entry) : clean(entry?.name)).filter(Boolean).join(", "), "namesIn");
|
|
25949
25990
|
var jsonLdNodes = /* @__PURE__ */ __name((document) => {
|
|
@@ -25999,7 +26040,7 @@ var markdownSections = /* @__PURE__ */ __name((text) => {
|
|
|
25999
26040
|
return found.map((section, index) => ({ ...section, end: found[index + 1]?.start ?? text.length }));
|
|
26000
26041
|
}, "markdownSections");
|
|
26001
26042
|
|
|
26002
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
26043
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.466.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.64.0_commander@15._f7e4048410ccbe1e801fd184c043d197/node_modules/@wirecat/cli-core/dist/readers/html/index.js
|
|
26003
26044
|
var HTML = /* @__PURE__ */ new Set([".html", ".htm", ".xhtml"]);
|
|
26004
26045
|
var first = /* @__PURE__ */ __name((...values) => values.find((value) => typeof value === "string" && value !== ""), "first");
|
|
26005
26046
|
var loaded = /* @__PURE__ */ __name(async (load, name) => {
|
|
@@ -26070,7 +26111,7 @@ var html = {
|
|
|
26070
26111
|
}, "read")
|
|
26071
26112
|
};
|
|
26072
26113
|
|
|
26073
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
26114
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.466.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.64.0_commander@15._f7e4048410ccbe1e801fd184c043d197/node_modules/@wirecat/cli-core/dist/readers/office/index.js
|
|
26074
26115
|
var office = {
|
|
26075
26116
|
id: "office",
|
|
26076
26117
|
version: documentExtractor("odt"),
|
|
@@ -26081,7 +26122,7 @@ var office = {
|
|
|
26081
26122
|
}, "read")
|
|
26082
26123
|
};
|
|
26083
26124
|
|
|
26084
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
26125
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.466.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.64.0_commander@15._f7e4048410ccbe1e801fd184c043d197/node_modules/@wirecat/cli-core/dist/readers/pdf/index.js
|
|
26085
26126
|
var pdf = {
|
|
26086
26127
|
id: "pdf",
|
|
26087
26128
|
version: "unpdf",
|
|
@@ -26148,7 +26189,7 @@ var pdf = {
|
|
|
26148
26189
|
}), "read")
|
|
26149
26190
|
};
|
|
26150
26191
|
|
|
26151
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
26192
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.466.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.64.0_commander@15._f7e4048410ccbe1e801fd184c043d197/node_modules/@wirecat/cli-core/dist/readers/plain/index.js
|
|
26152
26193
|
var PLAIN = /* @__PURE__ */ new Set([".txt", ".md", ".markdown", ".csv", ".tsv", ".json", ".log"]);
|
|
26153
26194
|
var isPlain = /* @__PURE__ */ __name((hint) => PLAIN.has(extensionOf(hint)) || hint.mime?.startsWith("text/") || hint.mime === "application/json", "isPlain");
|
|
26154
26195
|
var readPlain = /* @__PURE__ */ __name((bytes2) => {
|
|
@@ -26168,7 +26209,7 @@ var plain = {
|
|
|
26168
26209
|
read: /* @__PURE__ */ __name(async (bytes2) => readPlain(bytes2), "read")
|
|
26169
26210
|
};
|
|
26170
26211
|
|
|
26171
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
26212
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.466.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.64.0_commander@15._f7e4048410ccbe1e801fd184c043d197/node_modules/@wirecat/cli-core/dist/readers/rtf/index.js
|
|
26172
26213
|
var rtf = {
|
|
26173
26214
|
id: "rtf",
|
|
26174
26215
|
version: "v1",
|
|
@@ -26176,10 +26217,10 @@ var rtf = {
|
|
|
26176
26217
|
read: /* @__PURE__ */ __name(async (bytes2) => derived(bytes2, "rtf:v1", rtfText), "read")
|
|
26177
26218
|
};
|
|
26178
26219
|
|
|
26179
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
26220
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.466.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.64.0_commander@15._f7e4048410ccbe1e801fd184c043d197/node_modules/@wirecat/cli-core/dist/readers/sheets/index.js
|
|
26180
26221
|
import { basename as basename6 } from "node:path";
|
|
26181
26222
|
|
|
26182
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
26223
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.466.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.64.0_commander@15._f7e4048410ccbe1e801fd184c043d197/node_modules/@wirecat/cli-core/dist/attachments/csv-spans.js
|
|
26183
26224
|
var delimitedSpans = /* @__PURE__ */ __name((text, delimiter, maxCells = 1e4) => {
|
|
26184
26225
|
const cells = [];
|
|
26185
26226
|
let row = 1, column = 1, start = 0, quoted = false, truncated = false;
|
|
@@ -26217,7 +26258,7 @@ var delimitedSpans = /* @__PURE__ */ __name((text, delimiter, maxCells = 1e4) =>
|
|
|
26217
26258
|
return { cells, truncated };
|
|
26218
26259
|
}, "delimitedSpans");
|
|
26219
26260
|
|
|
26220
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
26261
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.466.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.64.0_commander@15._f7e4048410ccbe1e801fd184c043d197/node_modules/@wirecat/cli-core/dist/readers/sheets/index.js
|
|
26221
26262
|
var DELIMITED = {
|
|
26222
26263
|
".csv": ",",
|
|
26223
26264
|
".tsv": " ",
|
|
@@ -26256,7 +26297,7 @@ var sheets = {
|
|
|
26256
26297
|
}, "read")
|
|
26257
26298
|
};
|
|
26258
26299
|
|
|
26259
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
26300
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.466.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.64.0_commander@15._f7e4048410ccbe1e801fd184c043d197/node_modules/@wirecat/cli-core/dist/readers/registry.js
|
|
26260
26301
|
var BUILT_INS2 = [office, pdf, docx, doc, rtf, html, sheets, plain, image2];
|
|
26261
26302
|
var HEAD_BYTES = 1024;
|
|
26262
26303
|
var readers = [...BUILT_INS2];
|
|
@@ -26266,7 +26307,7 @@ var readWithRegistry = /* @__PURE__ */ __name(async (bytes2, hint, context2) =>
|
|
|
26266
26307
|
return reader ? reader.read(bytes2, hint, context2) : { status: "unsupported" };
|
|
26267
26308
|
}, "readWithRegistry");
|
|
26268
26309
|
|
|
26269
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
26310
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.466.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.64.0_commander@15._f7e4048410ccbe1e801fd184c043d197/node_modules/@wirecat/cli-core/dist/attachments/extract.js
|
|
26270
26311
|
var importEngine = /* @__PURE__ */ __name((name) => importFrom(new URL("attachments/extract.js", import.meta.resolve("@wirecat/cli-core")).href, name), "importEngine");
|
|
26271
26312
|
var extensionOf2 = /* @__PURE__ */ __name(({ name, path }) => extname2(name ?? path).toLowerCase(), "extensionOf");
|
|
26272
26313
|
var extractText = /* @__PURE__ */ __name(async (bytes2, hint, load, signal, env = process.env) => {
|
|
@@ -27345,7 +27386,7 @@ function imageSize(input) {
|
|
|
27345
27386
|
}
|
|
27346
27387
|
__name(imageSize, "imageSize");
|
|
27347
27388
|
|
|
27348
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
27389
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.466.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.64.0_commander@15._f7e4048410ccbe1e801fd184c043d197/node_modules/@wirecat/cli-core/dist/attachments/ocr.js
|
|
27349
27390
|
var MAX_PAGES = 20;
|
|
27350
27391
|
var MAX_PIXELS = 2e7;
|
|
27351
27392
|
var cancelled2 = /* @__PURE__ */ __name((signal) => {
|
|
@@ -27496,7 +27537,7 @@ var ocrPdf = /* @__PURE__ */ __name(async (bytes2, pipeline2, load, signal) => {
|
|
|
27496
27537
|
}
|
|
27497
27538
|
}, "ocrPdf");
|
|
27498
27539
|
|
|
27499
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
27540
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.466.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.64.0_commander@15._f7e4048410ccbe1e801fd184c043d197/node_modules/@wirecat/cli-core/dist/attachments/pdf-preview.js
|
|
27500
27541
|
var pdfPreview = /* @__PURE__ */ __name(async (bytes2, page, signal, load = importEngine, env = process.env) => {
|
|
27501
27542
|
const limits = pdfPreviewLimits(env);
|
|
27502
27543
|
const cancelled4 = /* @__PURE__ */ __name(() => {
|
|
@@ -27573,7 +27614,7 @@ var pdfPreview = /* @__PURE__ */ __name(async (bytes2, page, signal, load = impo
|
|
|
27573
27614
|
}
|
|
27574
27615
|
}, "pdfPreview");
|
|
27575
27616
|
|
|
27576
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
27617
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.466.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.64.0_commander@15._f7e4048410ccbe1e801fd184c043d197/node_modules/@wirecat/cli-core/dist/attachments/transfer.js
|
|
27577
27618
|
import { createHash as createHash7 } from "node:crypto";
|
|
27578
27619
|
import { constants as constants3 } from "node:fs";
|
|
27579
27620
|
import { lstat as lstat6, open as open7 } from "node:fs/promises";
|
|
@@ -27681,7 +27722,7 @@ var transferMime = /* @__PURE__ */ __name((head, hint, name = null) => {
|
|
|
27681
27722
|
return hint !== null && /^[a-z0-9.+-]+\/[a-z0-9.+-]+$/i.test(hint) ? hint : "application/octet-stream";
|
|
27682
27723
|
}, "transferMime");
|
|
27683
27724
|
|
|
27684
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
27725
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.466.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.64.0_commander@15._f7e4048410ccbe1e801fd184c043d197/node_modules/@wirecat/cli-core/dist/services/attachments.js
|
|
27685
27726
|
var ATTACHMENT_QUERY = {
|
|
27686
27727
|
entity: "attachment",
|
|
27687
27728
|
backend: "sql",
|
|
@@ -28062,7 +28103,7 @@ var attachmentsService = /* @__PURE__ */ __name((deps) => ({
|
|
|
28062
28103
|
}, "setText")
|
|
28063
28104
|
}), "attachmentsService");
|
|
28064
28105
|
|
|
28065
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
28106
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.466.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.64.0_commander@15._f7e4048410ccbe1e801fd184c043d197/node_modules/@wirecat/cli-core/dist/services/chat-documents.js
|
|
28066
28107
|
var chatDocumentsService = /* @__PURE__ */ __name((deps) => ({
|
|
28067
28108
|
list: /* @__PURE__ */ __name(async (chat, { limit, offset, ref }) => {
|
|
28068
28109
|
const store = await accountStore(deps);
|
|
@@ -28092,7 +28133,7 @@ var chatDocumentsService = /* @__PURE__ */ __name((deps) => ({
|
|
|
28092
28133
|
}, "list")
|
|
28093
28134
|
}), "chatDocumentsService");
|
|
28094
28135
|
|
|
28095
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
28136
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.466.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.64.0_commander@15._f7e4048410ccbe1e801fd184c043d197/node_modules/@wirecat/cli-core/dist/services/retention.js
|
|
28096
28137
|
var observationDuration = /* @__PURE__ */ __name((text, flag) => {
|
|
28097
28138
|
const match = /^(\d+(?:\.\d+)?)([smhdw])$/.exec(text);
|
|
28098
28139
|
const units2 = { s: 1e3, m: 6e4, h: 36e5, d: 864e5, w: 6048e5 };
|
|
@@ -28179,7 +28220,7 @@ var isRetentionSelection = /* @__PURE__ */ __name((selection) => {
|
|
|
28179
28220
|
}
|
|
28180
28221
|
}, "isRetentionSelection");
|
|
28181
28222
|
|
|
28182
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
28223
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.466.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.64.0_commander@15._f7e4048410ccbe1e801fd184c043d197/node_modules/@wirecat/cli-core/dist/services/counters.js
|
|
28183
28224
|
var counterFields = /* @__PURE__ */ __name((text = "views,reactions,comments") => {
|
|
28184
28225
|
const fields = text.split(",").map((one) => one.trim());
|
|
28185
28226
|
if (!fields.length || fields.some((one) => !COUNTER_FIELDS.includes(one)) || new Set(fields).size !== fields.length)
|
|
@@ -28386,7 +28427,7 @@ var countersService = /* @__PURE__ */ __name((deps) => {
|
|
|
28386
28427
|
};
|
|
28387
28428
|
}, "countersService");
|
|
28388
28429
|
|
|
28389
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
28430
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.466.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.64.0_commander@15._f7e4048410ccbe1e801fd184c043d197/node_modules/@wirecat/cli-core/dist/services/search-refresh.js
|
|
28390
28431
|
var SYNC_KEY = "messages.sync-first";
|
|
28391
28432
|
var SYNC_BOUNDS = { maxChats: 5, timeMs: 3e4, maxMessages: 500 };
|
|
28392
28433
|
var keyOf2 = /* @__PURE__ */ __name((chat) => JSON.stringify([chat.account.provider, chat.account.account, chat.chatId]), "keyOf");
|
|
@@ -28518,7 +28559,7 @@ var withRefresh = /* @__PURE__ */ __name((found, refreshed) => ({
|
|
|
28518
28559
|
...!refreshed || refreshed.complete ? {} : { coverage: { ...found.coverage, state: "stale" } }
|
|
28519
28560
|
}), "withRefresh");
|
|
28520
28561
|
|
|
28521
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
28562
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.466.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.64.0_commander@15._f7e4048410ccbe1e801fd184c043d197/node_modules/@wirecat/cli-core/dist/services/embeddings-search.js
|
|
28522
28563
|
var CANDIDATES = 50;
|
|
28523
28564
|
var WORD_HITS = 200;
|
|
28524
28565
|
var RRF_K = 60;
|
|
@@ -28793,13 +28834,13 @@ var meanOf = /* @__PURE__ */ __name((vectors) => {
|
|
|
28793
28834
|
return mean.map((value) => value / length);
|
|
28794
28835
|
}, "meanOf");
|
|
28795
28836
|
|
|
28796
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
28837
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.466.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.64.0_commander@15._f7e4048410ccbe1e801fd184c043d197/node_modules/@wirecat/cli-core/dist/services/embeddings.js
|
|
28797
28838
|
var embeddingsService = /* @__PURE__ */ __name((deps) => ({
|
|
28798
28839
|
...embeddingsMaintenance(deps),
|
|
28799
28840
|
...embeddingsSearch(deps)
|
|
28800
28841
|
}), "embeddingsService");
|
|
28801
28842
|
|
|
28802
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
28843
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.466.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.64.0_commander@15._f7e4048410ccbe1e801fd184c043d197/node_modules/@wirecat/cli-core/dist/services/folders.js
|
|
28803
28844
|
var foldersService = /* @__PURE__ */ __name((deps) => {
|
|
28804
28845
|
const online = /* @__PURE__ */ __name(async (command) => {
|
|
28805
28846
|
if (deps.offline)
|
|
@@ -28940,7 +28981,7 @@ var foldersService = /* @__PURE__ */ __name((deps) => {
|
|
|
28940
28981
|
};
|
|
28941
28982
|
}, "foldersService");
|
|
28942
28983
|
|
|
28943
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
28984
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.466.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.64.0_commander@15._f7e4048410ccbe1e801fd184c043d197/node_modules/@wirecat/cli-core/dist/services/mentions.js
|
|
28944
28985
|
var REVIEW_COUNT = 500;
|
|
28945
28986
|
var mentionsService = /* @__PURE__ */ __name((deps) => {
|
|
28946
28987
|
const located = /* @__PURE__ */ __name(async () => {
|
|
@@ -29019,7 +29060,7 @@ var mentionsService = /* @__PURE__ */ __name((deps) => {
|
|
|
29019
29060
|
};
|
|
29020
29061
|
}, "mentionsService");
|
|
29021
29062
|
|
|
29022
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
29063
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.466.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.64.0_commander@15._f7e4048410ccbe1e801fd184c043d197/node_modules/@wirecat/cli-core/dist/domain/message-link.js
|
|
29023
29064
|
var messageLinkTarget = /* @__PURE__ */ __name((reference, message, provider) => {
|
|
29024
29065
|
if (isLocator(reference)) {
|
|
29025
29066
|
if (message !== void 0)
|
|
@@ -29066,7 +29107,7 @@ var validatePermalink = /* @__PURE__ */ __name((link5) => {
|
|
|
29066
29107
|
return { url: link5.url, access: link5.access, reason: link5.reason };
|
|
29067
29108
|
}, "validatePermalink");
|
|
29068
29109
|
|
|
29069
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
29110
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.466.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.64.0_commander@15._f7e4048410ccbe1e801fd184c043d197/node_modules/@wirecat/cli-core/dist/domain/pin-duration.js
|
|
29070
29111
|
var spokenSeconds = /* @__PURE__ */ __name((seconds) => {
|
|
29071
29112
|
if (seconds % 86400 === 0 && seconds > 86400)
|
|
29072
29113
|
return `${seconds / 86400}d`;
|
|
@@ -29098,7 +29139,7 @@ var pinDurationOf = /* @__PURE__ */ __name((value, allowed, flag = "--expire-tim
|
|
|
29098
29139
|
return seconds;
|
|
29099
29140
|
}, "pinDurationOf");
|
|
29100
29141
|
|
|
29101
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
29142
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.466.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.64.0_commander@15._f7e4048410ccbe1e801fd184c043d197/node_modules/@wirecat/cli-core/dist/sends/send-as.js
|
|
29102
29143
|
var sendAsCheck = /* @__PURE__ */ __name((connection, sendAs) => {
|
|
29103
29144
|
if (sendAs === void 0) {
|
|
29104
29145
|
const saved = connection.savedSender?.bind(connection);
|
|
@@ -29123,7 +29164,7 @@ var typedSendAs = /* @__PURE__ */ __name((typed) => {
|
|
|
29123
29164
|
return sendAs;
|
|
29124
29165
|
}, "typedSendAs");
|
|
29125
29166
|
|
|
29126
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
29167
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.466.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.64.0_commander@15._f7e4048410ccbe1e801fd184c043d197/node_modules/@wirecat/cli-core/dist/search/question-plan.js
|
|
29127
29168
|
var words = /* @__PURE__ */ __name((text) => normalize(text).match(/[\p{L}\p{N}]+/gu) ?? [], "words");
|
|
29128
29169
|
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"));
|
|
29129
29170
|
var questionWord = /\b(?:what|which|how|who|where|when|can|could|should)\b|(?:^|\s)(?:сколько|какой|какая|какие|какое|кто|кому|кем|где|когда|как|что|можно|может|могут|ли)(?:\s|$)/iu;
|
|
@@ -29238,7 +29279,7 @@ function planQuestion(text, strict = false) {
|
|
|
29238
29279
|
}
|
|
29239
29280
|
__name(planQuestion, "planQuestion");
|
|
29240
29281
|
|
|
29241
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
29282
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.466.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.64.0_commander@15._f7e4048410ccbe1e801fd184c043d197/node_modules/@wirecat/cli-core/dist/services/messages-combined.js
|
|
29242
29283
|
var COMBINED_DEFAULTS = { candidateDepth: 300, rrfK: 60, rerank: "all", chatCap: 0 };
|
|
29243
29284
|
var tokensOf = /* @__PURE__ */ __name((text) => normalize(text).match(/[\p{L}\p{N}\p{Co}\p{M}]+/gu) ?? [], "tokensOf");
|
|
29244
29285
|
var searchCombined = /* @__PURE__ */ __name(async (store, account, request, messenger = {}, options = COMBINED_DEFAULTS) => {
|
|
@@ -29431,7 +29472,7 @@ var signals = /* @__PURE__ */ __name((hit, terms, corrections, execution, mode,
|
|
|
29431
29472
|
return mode === "coverage" ? coverage * 4 : mode === "proximity" ? proximity : mode === "phrase" ? phrase : coverage * 4 + proximity + phrase;
|
|
29432
29473
|
}, "signals");
|
|
29433
29474
|
|
|
29434
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
29475
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.466.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.64.0_commander@15._f7e4048410ccbe1e801fd184c043d197/node_modules/@wirecat/cli-core/dist/services/messages-discovery.js
|
|
29435
29476
|
var MEANING_DEPTH = 100;
|
|
29436
29477
|
var RRF_K2 = 60;
|
|
29437
29478
|
var RERANK_DEPTH = 50;
|
|
@@ -29646,17 +29687,17 @@ var searchDiscovery = /* @__PURE__ */ __name(async (store, account, asked, messe
|
|
|
29646
29687
|
};
|
|
29647
29688
|
}, "searchDiscovery");
|
|
29648
29689
|
var nearEligible = /* @__PURE__ */ __name(async (store, account, request, messenger, ranked, scope) => {
|
|
29649
|
-
const
|
|
29650
|
-
const only = ranked.slice(0, MEANING_DEPTH).filter((m) => !request.only || request.only.some((key) =>
|
|
29690
|
+
const keyOf5 = /* @__PURE__ */ __name((one) => JSON.stringify([one.provider, one.account, one.chatId, one.id]), "keyOf");
|
|
29691
|
+
const only = ranked.slice(0, MEANING_DEPTH).filter((m) => !request.only || request.only.some((key) => keyOf5(key) === keyOf5(m))).map(({ provider, account: account2, chatId, id: id2 }) => ({ provider, account: account2, chatId, id: id2 }));
|
|
29651
29692
|
if (!only.length)
|
|
29652
29693
|
return [];
|
|
29653
29694
|
const eligible = await searchLucene(store, account, { ...request, text: scope || void 0, ast: void 0, limit: only.length, only, context: 0, thread: void 0 }, messenger);
|
|
29654
29695
|
const hits = new Map(eligible.items.map((hit) => {
|
|
29655
29696
|
const { provider, account: account2 } = parseLocator(hit.locator);
|
|
29656
|
-
return [
|
|
29697
|
+
return [keyOf5({ provider, account: account2, chatId: hit.chatId, id: hit.id }), hit];
|
|
29657
29698
|
}));
|
|
29658
29699
|
return ranked.flatMap((m) => {
|
|
29659
|
-
const hit = hits.get(
|
|
29700
|
+
const hit = hits.get(keyOf5(m));
|
|
29660
29701
|
return hit ? [{ ...hit, cosine: m.score }] : [];
|
|
29661
29702
|
});
|
|
29662
29703
|
}, "nearEligible");
|
|
@@ -29700,7 +29741,7 @@ var mixedWithReranker = /* @__PURE__ */ __name((head, scores) => {
|
|
|
29700
29741
|
})).sort((a, b) => b.mixed - a.mixed).map(({ hit }) => hit);
|
|
29701
29742
|
}, "mixedWithReranker");
|
|
29702
29743
|
|
|
29703
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
29744
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.466.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.64.0_commander@15._f7e4048410ccbe1e801fd184c043d197/node_modules/@wirecat/cli-core/dist/services/thread-context.js
|
|
29704
29745
|
var THREAD_BOUNDS = { maxHops: 8, maxMessages: 50, maxBytes: 65536, withinMs: 864e5 };
|
|
29705
29746
|
var bytes = /* @__PURE__ */ __name((items, links) => Buffer.byteLength(JSON.stringify({ items, links }), "utf8"), "bytes");
|
|
29706
29747
|
var threadBounds = /* @__PURE__ */ __name((options = {}) => {
|
|
@@ -29899,7 +29940,7 @@ var readThreadContext = /* @__PURE__ */ __name(async (store, account, chat, mess
|
|
|
29899
29940
|
return result;
|
|
29900
29941
|
}, "readThreadContext");
|
|
29901
29942
|
|
|
29902
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
29943
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.466.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.64.0_commander@15._f7e4048410ccbe1e801fd184c043d197/node_modules/@wirecat/cli-core/dist/services/messages-archive-search.js
|
|
29903
29944
|
var SEARCH_FILL_MS = 200;
|
|
29904
29945
|
var statsStore = /* @__PURE__ */ __name(async (store, account, request, messenger = {}) => {
|
|
29905
29946
|
const stop = Date.now() + SEARCH_FILL_MS;
|
|
@@ -29959,12 +30000,12 @@ var accountOf2 = /* @__PURE__ */ __name((hit) => {
|
|
|
29959
30000
|
}, "accountOf");
|
|
29960
30001
|
var keyOf3 = /* @__PURE__ */ __name(({ provider, account }) => `${provider}/${account}`, "keyOf");
|
|
29961
30002
|
|
|
29962
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
30003
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.466.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.64.0_commander@15._f7e4048410ccbe1e801fd184c043d197/node_modules/@wirecat/cli-core/dist/services/pictures.js
|
|
29963
30004
|
import { createHash as createHash9 } from "node:crypto";
|
|
29964
30005
|
import { readFile as readFile2, stat as stat2 } from "node:fs/promises";
|
|
29965
30006
|
import { setTimeout as sleep4 } from "node:timers/promises";
|
|
29966
30007
|
|
|
29967
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
30008
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.466.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.64.0_commander@15._f7e4048410ccbe1e801fd184c043d197/node_modules/@wirecat/cli-core/dist/services/file-download.js
|
|
29968
30009
|
import { createWriteStream, mkdirSync } from "node:fs";
|
|
29969
30010
|
import { link as link4, rm } from "node:fs/promises";
|
|
29970
30011
|
import { basename as basename7, join as join14, resolve as resolve5 } from "node:path";
|
|
@@ -30087,7 +30128,7 @@ var save = /* @__PURE__ */ __name(async (file, directory2, fallbackName, { uniqu
|
|
|
30087
30128
|
}
|
|
30088
30129
|
}, "save");
|
|
30089
30130
|
|
|
30090
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
30131
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.466.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.64.0_commander@15._f7e4048410ccbe1e801fd184c043d197/node_modules/@wirecat/cli-core/dist/services/pictures.js
|
|
30091
30132
|
var PICTURE_MAX_BYTES = 25 * 1024 * 1024;
|
|
30092
30133
|
var PICTURE_FLOOR = 0.25;
|
|
30093
30134
|
var PAGE3 = 50;
|
|
@@ -30104,7 +30145,7 @@ var picturesService = /* @__PURE__ */ __name((deps) => {
|
|
|
30104
30145
|
const directory2 = imageModelsDirectory(deps.env);
|
|
30105
30146
|
if (!isImageModelInstalled(model2, directory2))
|
|
30106
30147
|
throw new CliError("not_found", missingModel(model2.id), { reason: "model.not-downloaded", model: model2.id });
|
|
30107
|
-
const { openPictureEmbedder } = await import("./embedder-
|
|
30148
|
+
const { openPictureEmbedder } = await import("./embedder-B4ZTKC23.js");
|
|
30108
30149
|
return openPictureEmbedder(model2, directory2);
|
|
30109
30150
|
}, "open");
|
|
30110
30151
|
const embedder = /* @__PURE__ */ __name(() => {
|
|
@@ -30300,7 +30341,7 @@ var withPictures = /* @__PURE__ */ __name((messages, pictures) => ({
|
|
|
30300
30341
|
}, "search")
|
|
30301
30342
|
}), "withPictures");
|
|
30302
30343
|
|
|
30303
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
30344
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.466.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.64.0_commander@15._f7e4048410ccbe1e801fd184c043d197/node_modules/@wirecat/cli-core/dist/services/messages-meaning.js
|
|
30304
30345
|
var meaningLane = /* @__PURE__ */ __name((deps) => async (question, accounts, shared) => {
|
|
30305
30346
|
const target2 = embeddingTarget(deps, DEFAULT_TEXT_MODEL);
|
|
30306
30347
|
const skipped = /* @__PURE__ */ __name((reason, step) => ({
|
|
@@ -30348,7 +30389,7 @@ var meaningLane = /* @__PURE__ */ __name((deps) => async (question, accounts, sh
|
|
|
30348
30389
|
}
|
|
30349
30390
|
}, "meaningLane");
|
|
30350
30391
|
|
|
30351
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
30392
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.466.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.64.0_commander@15._f7e4048410ccbe1e801fd184c043d197/node_modules/@wirecat/cli-core/dist/services/messages-rerank.js
|
|
30352
30393
|
var rerankLane = /* @__PURE__ */ __name((deps) => {
|
|
30353
30394
|
const choice = deps.reranker ?? DEFAULT_RERANK_MODEL;
|
|
30354
30395
|
if (choice === "off")
|
|
@@ -30360,9 +30401,9 @@ var rerankLane = /* @__PURE__ */ __name((deps) => {
|
|
|
30360
30401
|
return { skipped: { reason: `${model.id} is not downloaded`, step: "models.download", model: model.id } };
|
|
30361
30402
|
try {
|
|
30362
30403
|
const warm = deps.embedders;
|
|
30363
|
-
const reranker = warm ? await warm.reranker(`rerank:${model.id}`, async () => (await import("./process-
|
|
30404
|
+
const reranker = warm ? await warm.reranker(`rerank:${model.id}`, async () => (await import("./process-GPUXC4PG.js")).openRerankerProcess(model, directory2, {
|
|
30364
30405
|
threads: defaultThreads()
|
|
30365
|
-
})) : await (await import("./rerank-
|
|
30406
|
+
})) : await (await import("./rerank-3Y2VZM3J.js")).openReranker(model, directory2);
|
|
30366
30407
|
return {
|
|
30367
30408
|
model: model.id,
|
|
30368
30409
|
score: /* @__PURE__ */ __name((question, passages) => reranker.score(plainWords(question), passages), "score"),
|
|
@@ -30382,17 +30423,17 @@ var rerankLane = /* @__PURE__ */ __name((deps) => {
|
|
|
30382
30423
|
};
|
|
30383
30424
|
}, "rerankLane");
|
|
30384
30425
|
|
|
30385
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
30426
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.466.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.64.0_commander@15._f7e4048410ccbe1e801fd184c043d197/node_modules/@wirecat/cli-core/dist/services/document-pictures.js
|
|
30386
30427
|
var openPictureEmbedderFor = /* @__PURE__ */ __name(async ({ env, command } = {}) => {
|
|
30387
30428
|
const model = imageModel(DEFAULT_IMAGE_MODEL);
|
|
30388
30429
|
const directory2 = imageModelsDirectory(env);
|
|
30389
30430
|
if (!isImageModelInstalled(model, directory2))
|
|
30390
30431
|
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 });
|
|
30391
|
-
const { openPictureEmbedder } = await import("./embedder-
|
|
30432
|
+
const { openPictureEmbedder } = await import("./embedder-B4ZTKC23.js");
|
|
30392
30433
|
return openPictureEmbedder(model, directory2);
|
|
30393
30434
|
}, "openPictureEmbedderFor");
|
|
30394
30435
|
|
|
30395
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
30436
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.466.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.64.0_commander@15._f7e4048410ccbe1e801fd184c043d197/node_modules/@wirecat/cli-core/dist/services/document-source.js
|
|
30396
30437
|
var documentSource = /* @__PURE__ */ __name((note, accounts, profiles, file) => {
|
|
30397
30438
|
const metadata = note.frontMatter;
|
|
30398
30439
|
const account = accounts.find(({ id: id2 }) => String(id2) === note.folderId);
|
|
@@ -30409,7 +30450,7 @@ var documentSource = /* @__PURE__ */ __name((note, accounts, profiles, file) =>
|
|
|
30409
30450
|
};
|
|
30410
30451
|
}, "documentSource");
|
|
30411
30452
|
|
|
30412
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
30453
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.466.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.64.0_commander@15._f7e4048410ccbe1e801fd184c043d197/node_modules/@wirecat/cli-core/dist/services/notes-title-tier.js
|
|
30413
30454
|
var plainQueryWords = /* @__PURE__ */ __name((query) => {
|
|
30414
30455
|
let root;
|
|
30415
30456
|
try {
|
|
@@ -30436,12 +30477,10 @@ var titleTiers = /* @__PURE__ */ __name((hits, words2) => {
|
|
|
30436
30477
|
return [...hits].sort((a, b) => rank(a) - rank(b));
|
|
30437
30478
|
}, "titleTiers");
|
|
30438
30479
|
|
|
30439
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
30440
|
-
var
|
|
30441
|
-
|
|
30442
|
-
|
|
30443
|
-
const ast = validateFields(parseLucene(request.text, { ...SEARCH_QUERY, defaultField: request.exact ? "exact" : "text" }));
|
|
30444
|
-
const timezone = timezoneOf(request.timezone);
|
|
30480
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.466.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.64.0_commander@15._f7e4048410ccbe1e801fd184c043d197/node_modules/@wirecat/cli-core/dist/services/notes-search.js
|
|
30481
|
+
var storeQuery = /* @__PURE__ */ __name(async (store, text, { exact, timezone } = {}) => {
|
|
30482
|
+
const ast = validateFields(parseLucene(text, { ...SEARCH_QUERY, defaultField: exact ? "exact" : "text" }));
|
|
30483
|
+
const zone = timezoneOf(timezone);
|
|
30445
30484
|
const resolve6 = /* @__PURE__ */ __name((node) => {
|
|
30446
30485
|
if (node.kind === "boolean")
|
|
30447
30486
|
return { ...node, clauses: node.clauses.map(({ occur, node: node2 }) => ({ occur, node: resolve6(node2) })) };
|
|
@@ -30450,15 +30489,24 @@ var searchNotesQuery = /* @__PURE__ */ __name(async (store, request) => {
|
|
|
30450
30489
|
return {
|
|
30451
30490
|
...node,
|
|
30452
30491
|
resolution: {
|
|
30453
|
-
date: dateRange(node.value, node.operator === "range" ? node.upper ?? "*" : node.value, node.operator === "range" ? node.lower_inclusive === true : true, node.operator === "range" ? node.upper_inclusive === true : true,
|
|
30492
|
+
date: dateRange(node.value, node.operator === "range" ? node.upper ?? "*" : node.value, node.operator === "range" ? node.lower_inclusive === true : true, node.operator === "range" ? node.upper_inclusive === true : true, zone, node.span)
|
|
30454
30493
|
}
|
|
30455
30494
|
};
|
|
30456
30495
|
}, "resolve");
|
|
30457
30496
|
const stemmers2 = hasStems(ast.root) ? await store.searchIndex.stemmers() : void 0;
|
|
30458
30497
|
if (stemmers2 === null)
|
|
30459
30498
|
throw new CliError("validation_error", "the store asks for stemmers this tool does not know \u2014 upgrade this tool, or search exact forms with --exact", { reason: "stemmer.unknown" });
|
|
30460
|
-
return
|
|
30499
|
+
return {
|
|
30461
30500
|
root: resolve6(ast.root),
|
|
30501
|
+
...hasStems(ast.root) ? { stemmer: createStemmer(stemmers2 ?? DEFAULT_STEMMERS) } : {}
|
|
30502
|
+
};
|
|
30503
|
+
}, "storeQuery");
|
|
30504
|
+
var searchNotesQuery = /* @__PURE__ */ __name(async (store, request) => {
|
|
30505
|
+
if (!request.text.trim())
|
|
30506
|
+
throw new CliError("validation_error", "say what to find in the notes");
|
|
30507
|
+
const { root, stemmer } = await storeQuery(store, request.text, request);
|
|
30508
|
+
return store.notes.search({
|
|
30509
|
+
root,
|
|
30462
30510
|
limit: request.limit,
|
|
30463
30511
|
...request.offset === void 0 ? {} : { offset: request.offset },
|
|
30464
30512
|
...request.newest ? { newest: true } : {},
|
|
@@ -30466,7 +30514,7 @@ var searchNotesQuery = /* @__PURE__ */ __name(async (store, request) => {
|
|
|
30466
30514
|
...request.withInternal ? { withInternal: true } : {},
|
|
30467
30515
|
...request.source ? { source: request.source } : {},
|
|
30468
30516
|
...request.signal ? { signal: request.signal } : {},
|
|
30469
|
-
...
|
|
30517
|
+
...stemmer ? { stemmer } : {}
|
|
30470
30518
|
});
|
|
30471
30519
|
}, "searchNotesQuery");
|
|
30472
30520
|
var downloadHint = /* @__PURE__ */ __name((model, command) => command === void 0 ? `install it with a WireCat CLI that has \`models download\` (tg, max or wa); they share the model folder` : `\`${command} models download ${model}\``, "downloadHint");
|
|
@@ -30742,8 +30790,120 @@ var searchNotesOf = /* @__PURE__ */ __name(async (store, account, text, { accoun
|
|
|
30742
30790
|
};
|
|
30743
30791
|
}, "searchNotesOf");
|
|
30744
30792
|
|
|
30745
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
30746
|
-
var
|
|
30793
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.466.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.64.0_commander@15._f7e4048410ccbe1e801fd184c043d197/node_modules/@wirecat/cli-core/dist/services/events-search.js
|
|
30794
|
+
var MAX_EVENTS_OFFSET = 1e3;
|
|
30795
|
+
var iso3 = /* @__PURE__ */ __name((at) => at === null ? null : new Date(at).toISOString(), "iso");
|
|
30796
|
+
var accountIdsOf = /* @__PURE__ */ __name(async (store, accounts) => {
|
|
30797
|
+
const held = await store.accounts.storedAccounts();
|
|
30798
|
+
return held.filter((one) => accounts.some(({ provider, account }) => one.provider === provider && one.account === account)).map(({ id: id2 }) => String(id2));
|
|
30799
|
+
}, "accountIdsOf");
|
|
30800
|
+
var calendarAccounts = /* @__PURE__ */ __name(async (store) => (await store.accounts.storedAccounts()).filter(({ provider }) => kindIn(provider) === "events").map(({ provider, account }) => ({ provider, account })), "calendarAccounts");
|
|
30801
|
+
var foundEvent = /* @__PURE__ */ __name((hit, query, foundBy) => ({
|
|
30802
|
+
ref: hit.ref,
|
|
30803
|
+
provider: hit.account?.provider ?? null,
|
|
30804
|
+
account: hit.account?.account ?? null,
|
|
30805
|
+
title: hit.event.title,
|
|
30806
|
+
starts_at: iso3(hit.event.startsAt),
|
|
30807
|
+
ends_at: iso3(hit.event.endsAt),
|
|
30808
|
+
all_day: hit.event.allDay === true,
|
|
30809
|
+
status: hit.event.status ?? null,
|
|
30810
|
+
location: hit.event.location,
|
|
30811
|
+
...hit.url ? { url: hit.url } : {},
|
|
30812
|
+
excerpt: excerpt(hit.text || (hit.event.title ?? ""), query),
|
|
30813
|
+
occurrences: hit.occurrences,
|
|
30814
|
+
updated_at: new Date(hit.event.updatedAt).toISOString(),
|
|
30815
|
+
found_by: foundBy
|
|
30816
|
+
}), "foundEvent");
|
|
30817
|
+
var CANDIDATES3 = 50;
|
|
30818
|
+
var nearestEvents = /* @__PURE__ */ __name(async (store, words2, { limit, accountIds, env, command, embedders }) => {
|
|
30819
|
+
const { model, directory: directory2, key } = localModel(void 0, env, command);
|
|
30820
|
+
if (!await store.calendar.embedded(key, accountIds ? { accountIds } : {}))
|
|
30821
|
+
throw new CliError("not_found", `no event has vectors of ${model.id} yet, so only words were matched`);
|
|
30822
|
+
const [vector] = await withLocal(model, directory2, void 0, (embedder) => embedder.embed([words2], "query"), embedders);
|
|
30823
|
+
const floor = meaningFloor(key);
|
|
30824
|
+
return (await store.calendar.nearest(key, vector, { limit, ...accountIds ? { accountIds } : {} })).filter(({ score }) => score > floor);
|
|
30825
|
+
}, "nearestEvents");
|
|
30826
|
+
var keyOf4 = /* @__PURE__ */ __name(({ event }) => event.eventSeriesId === null ? `e${event.id}` : `s${event.eventSeriesId}`, "keyOf");
|
|
30827
|
+
var searchEvents = /* @__PURE__ */ __name(async (store, query, { limit = 20, offset = 0, accounts, exact, newest, timezone, signal, candidates, env, command, embedders } = {}) => {
|
|
30828
|
+
if (!query.trim())
|
|
30829
|
+
throw new CliError("validation_error", "say what to find in the events");
|
|
30830
|
+
const { root, stemmer } = await storeQuery(store, query, {
|
|
30831
|
+
...exact ? { exact: true } : {},
|
|
30832
|
+
...timezone === void 0 ? {} : { timezone }
|
|
30833
|
+
});
|
|
30834
|
+
const accountIds = accounts === void 0 ? void 0 : await accountIdsOf(store, accounts);
|
|
30835
|
+
if (accountIds?.length === 0)
|
|
30836
|
+
return { query, by: "words", hits: [], has_more: false };
|
|
30837
|
+
const words2 = plainQueryWords(query);
|
|
30838
|
+
const window3 = offset + limit;
|
|
30839
|
+
let meaningSkipped;
|
|
30840
|
+
let meaning;
|
|
30841
|
+
if (exact)
|
|
30842
|
+
meaningSkipped = "--exact searches words as written";
|
|
30843
|
+
else if (newest)
|
|
30844
|
+
meaningSkipped = "newest first orders by time";
|
|
30845
|
+
else if (words2 === void 0)
|
|
30846
|
+
meaningSkipped = "the query has fields or operators, which meaning cannot follow";
|
|
30847
|
+
else
|
|
30848
|
+
try {
|
|
30849
|
+
meaning = await nearestEvents(store, words2, {
|
|
30850
|
+
limit: Math.max(window3, CANDIDATES3),
|
|
30851
|
+
...accountIds ? { accountIds } : {},
|
|
30852
|
+
...env === void 0 ? {} : { env },
|
|
30853
|
+
...command === void 0 ? {} : { command },
|
|
30854
|
+
...embedders === void 0 ? {} : { embedders }
|
|
30855
|
+
});
|
|
30856
|
+
} catch (error) {
|
|
30857
|
+
if (!(error instanceof CliError && error.code === "not_found"))
|
|
30858
|
+
throw error;
|
|
30859
|
+
meaningSkipped = error.message;
|
|
30860
|
+
}
|
|
30861
|
+
const found = await store.calendar.search({
|
|
30862
|
+
root,
|
|
30863
|
+
limit: meaning === void 0 ? limit : Math.max(window3, CANDIDATES3),
|
|
30864
|
+
offset: meaning === void 0 ? offset : 0,
|
|
30865
|
+
...accountIds === void 0 ? {} : { accountIds },
|
|
30866
|
+
...newest ? { newest: true } : {},
|
|
30867
|
+
...stemmer ? { stemmer } : {},
|
|
30868
|
+
...signal ? { signal } : {},
|
|
30869
|
+
...candidates === void 0 ? {} : { candidates }
|
|
30870
|
+
});
|
|
30871
|
+
const truncated = found.truncated ? { truncated: true } : {};
|
|
30872
|
+
const by = meaning === void 0 ? "words" : "words and meaning";
|
|
30873
|
+
const skipped = meaningSkipped === void 0 ? {} : { meaning_skipped: meaningSkipped };
|
|
30874
|
+
if (meaning === void 0)
|
|
30875
|
+
return {
|
|
30876
|
+
query,
|
|
30877
|
+
by,
|
|
30878
|
+
...skipped,
|
|
30879
|
+
hits: found.items.map((hit) => foundEvent(hit, query, ["words"])),
|
|
30880
|
+
has_more: found.hasMore,
|
|
30881
|
+
...found.hasMore && window3 <= MAX_EVENTS_OFFSET ? { next_offset: window3 } : {},
|
|
30882
|
+
...truncated
|
|
30883
|
+
};
|
|
30884
|
+
const ranked = /* @__PURE__ */ new Map();
|
|
30885
|
+
const add = /* @__PURE__ */ __name((list, half) => list.forEach((hit, rank) => {
|
|
30886
|
+
const held = ranked.get(keyOf4(hit)) ?? { hit, score: 0, by: [] };
|
|
30887
|
+
held.score += 1 / (RRF_K3 + rank + 1);
|
|
30888
|
+
held.by.push(half);
|
|
30889
|
+
ranked.set(keyOf4(hit), held);
|
|
30890
|
+
}), "add");
|
|
30891
|
+
add(found.items, "words");
|
|
30892
|
+
add(meaning, "meaning");
|
|
30893
|
+
const ordered = [...ranked.values()].sort((a, b) => b.score - a.score);
|
|
30894
|
+
const hasMore = ordered.length > window3 || found.hasMore;
|
|
30895
|
+
return {
|
|
30896
|
+
query,
|
|
30897
|
+
by,
|
|
30898
|
+
hits: ordered.slice(offset, window3).map(({ hit, by: halves }) => foundEvent(hit, query, halves)),
|
|
30899
|
+
has_more: hasMore,
|
|
30900
|
+
...hasMore && window3 <= MAX_EVENTS_OFFSET ? { next_offset: window3 } : {},
|
|
30901
|
+
...truncated
|
|
30902
|
+
};
|
|
30903
|
+
}, "searchEvents");
|
|
30904
|
+
|
|
30905
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.466.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.64.0_commander@15._f7e4048410ccbe1e801fd184c043d197/node_modules/@wirecat/cli-core/dist/services/search-all.js
|
|
30906
|
+
var RESOURCES_SEARCHED = ["messages", "mail", "notes", "events"];
|
|
30747
30907
|
var skippable = /* @__PURE__ */ __name((error) => error instanceof CliError && (error.code === "validation_error" || error.code === "not_found"), "skippable");
|
|
30748
30908
|
var filtersBeside = /* @__PURE__ */ __name((text) => {
|
|
30749
30909
|
const { root } = parseLucene(text, MESSAGE_PARSING);
|
|
@@ -30766,6 +30926,7 @@ var searchAll = /* @__PURE__ */ __name(async (store, account, request, messenger
|
|
|
30766
30926
|
const skipped = [];
|
|
30767
30927
|
let hasMore = false;
|
|
30768
30928
|
let notes;
|
|
30929
|
+
let events;
|
|
30769
30930
|
let messagesBy;
|
|
30770
30931
|
let server;
|
|
30771
30932
|
const messagesOf = /* @__PURE__ */ __name(async (kind) => {
|
|
@@ -30877,6 +31038,37 @@ var searchAll = /* @__PURE__ */ __name(async (store, account, request, messenger
|
|
|
30877
31038
|
...(await store.notes.documentsAccounts()).map(({ id: id2 }) => id2)
|
|
30878
31039
|
];
|
|
30879
31040
|
accounts.push(...read.map((account2) => ({ resource, provider: "notes", account: account2 })));
|
|
31041
|
+
} else if (resource === "events") {
|
|
31042
|
+
const read = request.scope?.events ?? await calendarAccounts(store);
|
|
31043
|
+
if (!read.length)
|
|
31044
|
+
continue;
|
|
31045
|
+
const found = await searchEvents(store, request.text, {
|
|
31046
|
+
limit: window3,
|
|
31047
|
+
accounts: read,
|
|
31048
|
+
embedders,
|
|
31049
|
+
...command === void 0 ? {} : { command },
|
|
31050
|
+
...request.env === void 0 ? {} : { env: request.env },
|
|
31051
|
+
...request.exact ? { exact: true } : {},
|
|
31052
|
+
...request.timezone === void 0 ? {} : { timezone: request.timezone },
|
|
31053
|
+
...request.signal === void 0 ? {} : { signal: request.signal }
|
|
31054
|
+
});
|
|
31055
|
+
hasMore ||= found.has_more;
|
|
31056
|
+
events = {
|
|
31057
|
+
by: found.by,
|
|
31058
|
+
...found.meaning_skipped === void 0 ? {} : { meaningSkipped: found.meaning_skipped }
|
|
31059
|
+
};
|
|
31060
|
+
lists.push(found.hits.map((hit) => ({
|
|
31061
|
+
kind: "event",
|
|
31062
|
+
ref: hit.ref,
|
|
31063
|
+
provider: hit.provider ?? "calendar",
|
|
31064
|
+
account: hit.account ?? "",
|
|
31065
|
+
...hit.url ? { url: hit.url } : {},
|
|
31066
|
+
title: hit.title,
|
|
31067
|
+
timestamp: hit.starts_at ?? hit.updated_at,
|
|
31068
|
+
text: hit.excerpt,
|
|
31069
|
+
foundBy: hit.found_by
|
|
31070
|
+
})));
|
|
31071
|
+
accounts.push(...read.map(({ provider, account: account2 }) => ({ resource, provider, account: account2 })));
|
|
30880
31072
|
} else
|
|
30881
31073
|
lists.push(await messagesOf(resource));
|
|
30882
31074
|
searched.push(resource);
|
|
@@ -30907,12 +31099,13 @@ var searchAll = /* @__PURE__ */ __name(async (store, account, request, messenger
|
|
|
30907
31099
|
accounts,
|
|
30908
31100
|
skipped,
|
|
30909
31101
|
...notes === void 0 ? {} : { notes },
|
|
31102
|
+
...events === void 0 ? {} : { events },
|
|
30910
31103
|
...messagesBy === void 0 ? {} : { messages: messagesBy },
|
|
30911
31104
|
...server === void 0 ? {} : { server }
|
|
30912
31105
|
};
|
|
30913
31106
|
}, "searchAll");
|
|
30914
31107
|
|
|
30915
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
31108
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.466.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.64.0_commander@15._f7e4048410ccbe1e801fd184c043d197/node_modules/@wirecat/cli-core/dist/services/search-all-meetings.js
|
|
30916
31109
|
var RESOURCES_SEARCHED_WITH_MEETINGS = [...RESOURCES_SEARCHED, "meetings"];
|
|
30917
31110
|
var whole = /* @__PURE__ */ __name((value, minimum, maximum, label) => {
|
|
30918
31111
|
if (!Number.isSafeInteger(value) || value < minimum || value > maximum)
|
|
@@ -31031,7 +31224,7 @@ var searchAllIncludingMeetings = /* @__PURE__ */ __name(async (store, account, r
|
|
|
31031
31224
|
whole(request.maxMeetings ?? 100, 1, Number.MAX_SAFE_INTEGER, "maxMeetings");
|
|
31032
31225
|
const only = request.only ?? RESOURCES_SEARCHED_WITH_MEETINGS;
|
|
31033
31226
|
if (!only.length || only.some((resource) => !RESOURCES_SEARCHED_WITH_MEETINGS.includes(resource)))
|
|
31034
|
-
throw new CliError("validation_error", "only takes messages, mail, notes and meetings");
|
|
31227
|
+
throw new CliError("validation_error", "only takes messages, mail, notes, events and meetings");
|
|
31035
31228
|
if (request.meetingCursor) {
|
|
31036
31229
|
if (only.length !== 1 || only[0] !== "meetings")
|
|
31037
31230
|
throw new CliError("validation_error", "meeting cursor requires only: [meetings]");
|
|
@@ -31147,14 +31340,19 @@ var searchAllOfSource = /* @__PURE__ */ __name(async (store, account, source, re
|
|
|
31147
31340
|
const found = await searchAllIncludingMeetings(store, account, {
|
|
31148
31341
|
...request,
|
|
31149
31342
|
only: read,
|
|
31150
|
-
scope: {
|
|
31343
|
+
scope: {
|
|
31344
|
+
messages: named2("messages"),
|
|
31345
|
+
mail: named2("mail"),
|
|
31346
|
+
notes: named2("notes"),
|
|
31347
|
+
events: named2("events")
|
|
31348
|
+
},
|
|
31151
31349
|
...meetings[0] ? { meetingAccount: meetings[0] } : {}
|
|
31152
31350
|
}, messenger, searchMessages, meaning);
|
|
31153
31351
|
const unnamed = only.filter((resource) => !read.includes(resource)).map((resource) => ({ resource, code: "not_found", reason: `--source names no ${resource} account` }));
|
|
31154
31352
|
return { ...found, skipped: [...skipped, ...empty2, ...unnamed, ...found.skipped] };
|
|
31155
31353
|
}, "searchAllOfSource");
|
|
31156
31354
|
|
|
31157
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
31355
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.466.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.64.0_commander@15._f7e4048410ccbe1e801fd184c043d197/node_modules/@wirecat/cli-core/dist/services/server-search.js
|
|
31158
31356
|
var SERVER_SEARCH_KEY = "messages.server-search";
|
|
31159
31357
|
var SERVER_BOUNDS = { timeMs: 5e3, perCall: 100, maxCalls: 3 };
|
|
31160
31358
|
var DEFAULT_BACKEND = "both";
|
|
@@ -31343,7 +31541,7 @@ var searchServer = /* @__PURE__ */ __name(async (deps, request) => {
|
|
|
31343
31541
|
return { report, sources };
|
|
31344
31542
|
}, "searchServer");
|
|
31345
31543
|
|
|
31346
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
31544
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.466.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.64.0_commander@15._f7e4048410ccbe1e801fd184c043d197/node_modules/@wirecat/cli-core/dist/services/messages.js
|
|
31347
31545
|
var DELETE_AT_ONCE = 10;
|
|
31348
31546
|
var messagesService = /* @__PURE__ */ __name((deps) => {
|
|
31349
31547
|
const { guard } = deps;
|
|
@@ -31769,7 +31967,7 @@ var checkMediaOptions = /* @__PURE__ */ __name((messenger, asked, attachments) =
|
|
|
31769
31967
|
throw new CliError("validation_error", `${MEDIA_FLAGS[first2]} needs a --photo or --file`);
|
|
31770
31968
|
}, "checkMediaOptions");
|
|
31771
31969
|
|
|
31772
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
31970
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.466.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.64.0_commander@15._f7e4048410ccbe1e801fd184c043d197/node_modules/@wirecat/cli-core/dist/domain/channel-tags.js
|
|
31773
31971
|
var CHANNEL_TAG_RULES_VERSION = "keywords-v1";
|
|
31774
31972
|
var RULES = {
|
|
31775
31973
|
ai: [/\b(ai|gpt|llm|machine learning|artificial intelligence)\b/iu, /нейросет|искусственн/iu],
|
|
@@ -31784,7 +31982,7 @@ var classifyChannel = /* @__PURE__ */ __name((metadata) => Object.entries(RULES)
|
|
|
31784
31982
|
return fields.length ? [{ tag, score: fields.length / 3, fields }] : [];
|
|
31785
31983
|
}), "classifyChannel");
|
|
31786
31984
|
|
|
31787
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
31985
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.466.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.64.0_commander@15._f7e4048410ccbe1e801fd184c043d197/node_modules/@wirecat/cli-core/dist/services/metadata.js
|
|
31788
31986
|
var metadataService = /* @__PURE__ */ __name((deps) => {
|
|
31789
31987
|
const held = /* @__PURE__ */ __name(async (reference, { includeLeft = false } = {}) => {
|
|
31790
31988
|
const store = await deps.store();
|
|
@@ -31870,7 +32068,7 @@ var metadataService = /* @__PURE__ */ __name((deps) => {
|
|
|
31870
32068
|
};
|
|
31871
32069
|
}, "metadataService");
|
|
31872
32070
|
|
|
31873
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
32071
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.466.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.64.0_commander@15._f7e4048410ccbe1e801fd184c043d197/node_modules/@wirecat/cli-core/dist/moderation/run.js
|
|
31874
32072
|
var FIRST_LOOK_MS = 24 * 36e5;
|
|
31875
32073
|
var moderateWith = /* @__PURE__ */ __name(async (run) => {
|
|
31876
32074
|
const { chatId, title, rules, point, since, dryRun } = run;
|
|
@@ -31907,7 +32105,7 @@ var moderateWith = /* @__PURE__ */ __name(async (run) => {
|
|
|
31907
32105
|
return { chatId, rows, notes };
|
|
31908
32106
|
}, "moderateWith");
|
|
31909
32107
|
|
|
31910
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
32108
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.466.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.64.0_commander@15._f7e4048410ccbe1e801fd184c043d197/node_modules/@wirecat/cli-core/dist/services/moderation.js
|
|
31911
32109
|
var moderationService = /* @__PURE__ */ __name((deps) => {
|
|
31912
32110
|
const file = /* @__PURE__ */ __name(() => new ModerationRules(moderationPathFor(deps.messenger.app, deps.profile ?? "default", deps.env ?? process.env)), "file");
|
|
31913
32111
|
const group = /* @__PURE__ */ __name(async (chat) => {
|
|
@@ -31985,7 +32183,7 @@ var moderatorOf = /* @__PURE__ */ __name((adapter, deps) => ({
|
|
|
31985
32183
|
}, "removePerson")
|
|
31986
32184
|
}), "moderatorOf");
|
|
31987
32185
|
|
|
31988
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
32186
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.466.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.64.0_commander@15._f7e4048410ccbe1e801fd184c043d197/node_modules/@wirecat/cli-core/dist/services/private-people.js
|
|
31989
32187
|
var noteItem = /* @__PURE__ */ __name((provider, note) => ({
|
|
31990
32188
|
id: note.id,
|
|
31991
32189
|
contact: formatReference({ type: "contact", provider, id: note.personId }),
|
|
@@ -32029,7 +32227,7 @@ var privatePeopleService = /* @__PURE__ */ __name((deps) => {
|
|
|
32029
32227
|
};
|
|
32030
32228
|
}, "privatePeopleService");
|
|
32031
32229
|
|
|
32032
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
32230
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.466.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.64.0_commander@15._f7e4048410ccbe1e801fd184c043d197/node_modules/@wirecat/cli-core/dist/services/rankings.js
|
|
32033
32231
|
var empty = /* @__PURE__ */ __name(() => ({
|
|
32034
32232
|
total: 0,
|
|
32035
32233
|
population: 0,
|
|
@@ -32285,7 +32483,7 @@ var rankingsService = /* @__PURE__ */ __name((deps) => ({
|
|
|
32285
32483
|
}, "evidence")
|
|
32286
32484
|
}), "rankingsService");
|
|
32287
32485
|
|
|
32288
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
32486
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.466.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.64.0_commander@15._f7e4048410ccbe1e801fd184c043d197/node_modules/@wirecat/cli-core/dist/services/searches.js
|
|
32289
32487
|
var savedSearchItem = /* @__PURE__ */ __name((one) => ({
|
|
32290
32488
|
id: one.id,
|
|
32291
32489
|
name: one.name,
|
|
@@ -32414,7 +32612,7 @@ var searchesService = /* @__PURE__ */ __name((deps) => {
|
|
|
32414
32612
|
};
|
|
32415
32613
|
}, "searchesService");
|
|
32416
32614
|
|
|
32417
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
32615
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.466.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.64.0_commander@15._f7e4048410ccbe1e801fd184c043d197/node_modules/@wirecat/cli-core/dist/services/tags.js
|
|
32418
32616
|
var TAGGING_QUERY = {
|
|
32419
32617
|
entity: "tagging",
|
|
32420
32618
|
backend: "sql",
|
|
@@ -32498,7 +32696,7 @@ var tagsService = /* @__PURE__ */ __name((deps) => {
|
|
|
32498
32696
|
};
|
|
32499
32697
|
}, "tagsService");
|
|
32500
32698
|
|
|
32501
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
32699
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.466.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.64.0_commander@15._f7e4048410ccbe1e801fd184c043d197/node_modules/@wirecat/cli-core/dist/services/topics.js
|
|
32502
32700
|
var actionOf = /* @__PURE__ */ __name(({ title, closed, pinned, hidden }) => {
|
|
32503
32701
|
const set = [closed, pinned, hidden].filter((one) => one !== void 0).length;
|
|
32504
32702
|
if (title !== void 0 || set !== 1)
|
|
@@ -32683,7 +32881,7 @@ var topicsService = /* @__PURE__ */ __name((deps) => {
|
|
|
32683
32881
|
};
|
|
32684
32882
|
}, "topicsService");
|
|
32685
32883
|
|
|
32686
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
32884
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.466.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.64.0_commander@15._f7e4048410ccbe1e801fd184c043d197/node_modules/@wirecat/cli-core/dist/services/evidence.js
|
|
32687
32885
|
import { createHash as createHash10, randomUUID as randomUUID7 } from "node:crypto";
|
|
32688
32886
|
var hash2 = /* @__PURE__ */ __name((value) => createHash10("sha256").update(JSON.stringify(value)).digest("hex"), "hash");
|
|
32689
32887
|
var positive = /* @__PURE__ */ __name((value, name, minimum = 1) => {
|
|
@@ -32757,7 +32955,7 @@ var prepareEvidencePacket = /* @__PURE__ */ __name(({ kind, source, page, limits
|
|
|
32757
32955
|
return { ...content, id: randomUUID7(), fingerprint: hash2(content) };
|
|
32758
32956
|
}, "prepareEvidencePacket");
|
|
32759
32957
|
|
|
32760
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
32958
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.466.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.64.0_commander@15._f7e4048410ccbe1e801fd184c043d197/node_modules/@wirecat/cli-core/dist/services/evidence-read.js
|
|
32761
32959
|
var readEvidencePacket = /* @__PURE__ */ __name(async (store, account, { chat, limit, before: before2 }, messenger = {}) => {
|
|
32762
32960
|
if (!Number.isSafeInteger(limit) || limit < 1 || limit > 100)
|
|
32763
32961
|
throw new CliError("validation_error", "evidence message limit must be an integer from 1 to 100");
|
|
@@ -32777,7 +32975,7 @@ var readEvidencePacket = /* @__PURE__ */ __name(async (store, account, { chat, l
|
|
|
32777
32975
|
return { ...packet, nextBeforeId: older && last ? last.id : null };
|
|
32778
32976
|
}, "readEvidencePacket");
|
|
32779
32977
|
|
|
32780
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
32978
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.466.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.64.0_commander@15._f7e4048410ccbe1e801fd184c043d197/node_modules/@wirecat/cli-core/dist/services/meeting-project-discovery.js
|
|
32781
32979
|
var scopeKeys = [
|
|
32782
32980
|
"accountId",
|
|
32783
32981
|
"meetingId",
|
|
@@ -32799,7 +32997,7 @@ var optionKeys = /* @__PURE__ */ new Set([
|
|
|
32799
32997
|
"maxVocabularyReadBytes"
|
|
32800
32998
|
]);
|
|
32801
32999
|
|
|
32802
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
33000
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.466.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.64.0_commander@15._f7e4048410ccbe1e801fd184c043d197/node_modules/@wirecat/cli-core/dist/context/communication-selection.js
|
|
32803
33001
|
var communicationFields = {
|
|
32804
33002
|
sources: pipe(array(strictObject({
|
|
32805
33003
|
id: pipe(string(), regex(/^[A-Za-z0-9][A-Za-z0-9._-]{0,127}$/)),
|
|
@@ -32831,7 +33029,7 @@ var communicationRequest = /* @__PURE__ */ __name((value, preparationAfter) => {
|
|
|
32831
33029
|
return { ...input, after, before: before2 };
|
|
32832
33030
|
}, "communicationRequest");
|
|
32833
33031
|
|
|
32834
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
33032
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.466.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.64.0_commander@15._f7e4048410ccbe1e801fd184c043d197/node_modules/@wirecat/cli-core/dist/services/meeting-preparation-validation.js
|
|
32835
33033
|
var MEETING_PREPARATION_LIMITS = {
|
|
32836
33034
|
meetings: { min: 1, max: 20, default: 5 },
|
|
32837
33035
|
cues: { min: 1, max: 100, default: 10 },
|
|
@@ -32904,7 +33102,7 @@ var validateMeetingPreparationRequest = /* @__PURE__ */ __name((externalId, orig
|
|
|
32904
33102
|
};
|
|
32905
33103
|
}, "validateMeetingPreparationRequest");
|
|
32906
33104
|
|
|
32907
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
33105
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.466.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.64.0_commander@15._f7e4048410ccbe1e801fd184c043d197/node_modules/@wirecat/cli-core/dist/services/meeting-communications-selection.js
|
|
32908
33106
|
var validatePreparationCommunications = /* @__PURE__ */ __name((section, request, after) => {
|
|
32909
33107
|
const fail = /* @__PURE__ */ __name(() => {
|
|
32910
33108
|
throw new CliError("invalid_response", "Preparation communications returned another selection or invalid evidence");
|
|
@@ -32952,7 +33150,7 @@ var validatePreparationCommunications = /* @__PURE__ */ __name((section, request
|
|
|
32952
33150
|
}
|
|
32953
33151
|
}, "validatePreparationCommunications");
|
|
32954
33152
|
|
|
32955
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
33153
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.466.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.64.0_commander@15._f7e4048410ccbe1e801fd184c043d197/node_modules/@wirecat/cli-core/dist/services/package-upgrade.js
|
|
32956
33154
|
var upgradePackage = /* @__PURE__ */ __name(async ({ current, command, packageName, check: check2 }, ports) => {
|
|
32957
33155
|
const installer = ports.installer();
|
|
32958
33156
|
const argv = updateCommand(installer, packageName);
|
|
@@ -33000,9 +33198,16 @@ var upgradePackage = /* @__PURE__ */ __name(async ({ current, command, packageNa
|
|
|
33000
33198
|
var restart = /* @__PURE__ */ __name(async (result, ports) => {
|
|
33001
33199
|
const servers = await ports.afterUpdate?.();
|
|
33002
33200
|
return {
|
|
33003
|
-
result: {
|
|
33201
|
+
result: {
|
|
33202
|
+
...result,
|
|
33203
|
+
updated: true,
|
|
33204
|
+
restarted: servers?.restarted ?? [],
|
|
33205
|
+
...servers?.mcpServers ? { mcpServers: servers.mcpServers } : {},
|
|
33206
|
+
...servers?.staleSessions ? { staleSessions: servers.staleSessions } : {}
|
|
33207
|
+
},
|
|
33004
33208
|
reason: "updated",
|
|
33005
|
-
left: servers?.left ?? []
|
|
33209
|
+
left: servers?.left ?? [],
|
|
33210
|
+
...servers?.timedOut?.length ? { timedOut: servers.timedOut } : {}
|
|
33006
33211
|
};
|
|
33007
33212
|
}, "restart");
|
|
33008
33213
|
var dayAfter = /* @__PURE__ */ __name((published) => {
|
|
@@ -33010,7 +33215,7 @@ var dayAfter = /* @__PURE__ */ __name((published) => {
|
|
|
33010
33215
|
return Number.isNaN(time) ? null : new Date(time + 24 * 60 * 60 * 1e3).toISOString();
|
|
33011
33216
|
}, "dayAfter");
|
|
33012
33217
|
|
|
33013
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
33218
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.466.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.64.0_commander@15._f7e4048410ccbe1e801fd184c043d197/node_modules/@wirecat/cli-core/dist/services/index.js
|
|
33014
33219
|
var servicesFor = /* @__PURE__ */ __name((deps) => {
|
|
33015
33220
|
const pictures = picturesService(deps);
|
|
33016
33221
|
const base = {
|
|
@@ -33046,7 +33251,7 @@ var servicesFor = /* @__PURE__ */ __name((deps) => {
|
|
|
33046
33251
|
return deps.messenger.services ? { ...base, ...deps.messenger.services(base, deps) } : base;
|
|
33047
33252
|
}, "servicesFor");
|
|
33048
33253
|
|
|
33049
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
33254
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.466.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.64.0_commander@15._f7e4048410ccbe1e801fd184c043d197/node_modules/@wirecat/cli-core/dist/background/relay.js
|
|
33050
33255
|
import { createHash as createHash11 } from "node:crypto";
|
|
33051
33256
|
import { chmodSync, lstatSync, mkdirSync as mkdirSync2, rmSync } from "node:fs";
|
|
33052
33257
|
import { createConnection, createServer } from "node:net";
|
|
@@ -33107,6 +33312,7 @@ var listenRelay = /* @__PURE__ */ __name(async (path, run) => {
|
|
|
33107
33312
|
privateDirectory(dirname6(path));
|
|
33108
33313
|
rmSync(path, { force: true });
|
|
33109
33314
|
const open9 = /* @__PURE__ */ new Set();
|
|
33315
|
+
const running = /* @__PURE__ */ new Set();
|
|
33110
33316
|
const server = createServer((socket) => {
|
|
33111
33317
|
open9.add(socket);
|
|
33112
33318
|
const stop = new AbortController();
|
|
@@ -33143,7 +33349,9 @@ var listenRelay = /* @__PURE__ */ __name(async (path, run) => {
|
|
|
33143
33349
|
stdin.isTTY = parsed.output.stdinTty;
|
|
33144
33350
|
if (parsed.output.stdinTty)
|
|
33145
33351
|
stdin.end();
|
|
33146
|
-
|
|
33352
|
+
const job = serve(socket, parsed.output, stdin, stop.signal, run);
|
|
33353
|
+
running.add(job);
|
|
33354
|
+
void job.then(() => running.delete(job), () => running.delete(job));
|
|
33147
33355
|
return;
|
|
33148
33356
|
}
|
|
33149
33357
|
if (typeof message.stdin === "string" && !stdin.writableEnded)
|
|
@@ -33165,6 +33373,7 @@ var listenRelay = /* @__PURE__ */ __name(async (path, run) => {
|
|
|
33165
33373
|
for (const socket of open9)
|
|
33166
33374
|
socket.destroy();
|
|
33167
33375
|
await new Promise((resolve6) => server.close(() => resolve6()));
|
|
33376
|
+
await Promise.allSettled(running);
|
|
33168
33377
|
rmSync(path, { force: true });
|
|
33169
33378
|
}, "close")
|
|
33170
33379
|
};
|
|
@@ -33263,7 +33472,7 @@ var relayCommand = /* @__PURE__ */ __name((path, request, options) => new Promis
|
|
|
33263
33472
|
}, () => finish({ error: stopped() }));
|
|
33264
33473
|
}), "relayCommand");
|
|
33265
33474
|
|
|
33266
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
33475
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.466.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.64.0_commander@15._f7e4048410ccbe1e801fd184c043d197/node_modules/@wirecat/cli-core/dist/cli/messenger/serve-relay.js
|
|
33267
33476
|
var lentConnection = /* @__PURE__ */ __name((connection, watchers) => throughWrapper(connection, {
|
|
33268
33477
|
close: /* @__PURE__ */ __name(async () => {
|
|
33269
33478
|
}, "close"),
|