@wirecat/cli-core 0.399.0 → 0.401.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +111 -0
- package/README.md +1 -1
- package/dist/analysis/consents.d.ts +11 -6
- package/dist/analysis/consents.js +5 -2
- package/dist/cli/bot/mcp.js +2 -1
- package/dist/cli/bot/store.js +1 -1
- package/dist/cli/config-command.js +20 -1
- package/dist/cli/context.d.ts +2 -0
- package/dist/cli/context.js +1 -1
- package/dist/cli/effects.d.ts +4 -1
- package/dist/cli/effects.js +10 -2
- package/dist/cli/index.d.ts +3 -2
- package/dist/cli/index.js +3 -2
- package/dist/cli/json-fields.js +12 -1
- package/dist/cli/meeting-evidence-answer.d.ts +46 -0
- package/dist/cli/meeting-evidence-answer.js +22 -0
- package/dist/cli/meeting-preparation-answer.js +1 -13
- package/dist/cli/messenger/account-command.js +15 -6
- package/dist/cli/messenger/account-profile-query.d.ts +2 -0
- package/dist/cli/messenger/account-profile-query.js +13 -0
- package/dist/cli/messenger/account-sessions-command.js +1 -2
- package/dist/cli/messenger/admin-commands.js +12 -12
- package/dist/cli/messenger/admin-contacts-command.js +6 -3
- package/dist/cli/messenger/admin-folders-command.js +5 -5
- package/dist/cli/messenger/admin-moderation-command.js +4 -4
- package/dist/cli/messenger/admin-statistics-command.js +6 -14
- package/dist/cli/messenger/analysis-consents-query.d.ts +5 -0
- package/dist/cli/messenger/analysis-consents-query.js +20 -0
- package/dist/cli/messenger/archive-commands.js +3 -3
- package/dist/cli/messenger/attachments-command.js +3 -0
- package/dist/cli/messenger/backfill-command.js +5 -4
- package/dist/cli/messenger/chat-queries.d.ts +1 -0
- package/dist/cli/messenger/chat-queries.js +12 -2
- package/dist/cli/messenger/chats-command.js +2 -2
- package/dist/cli/messenger/chats-documents-command.js +7 -5
- package/dist/cli/messenger/chats-members-command.js +7 -3
- package/dist/cli/messenger/chats-read-command.js +1 -1
- package/dist/cli/messenger/chats-tracking-command.js +14 -6
- package/dist/cli/messenger/contacts-command.js +9 -5
- package/dist/cli/messenger/conversations-command.js +20 -16
- package/dist/cli/messenger/doctor-command.js +4 -1
- package/dist/cli/messenger/document-links-query.d.ts +2 -0
- package/dist/cli/messenger/document-links-query.js +9 -0
- package/dist/cli/messenger/download-command.js +1 -0
- package/dist/cli/messenger/flood-command.d.ts +2 -2
- package/dist/cli/messenger/flood-command.js +3 -3
- package/dist/cli/messenger/gaps-command.js +2 -2
- package/dist/cli/messenger/guard-commands.js +35 -13
- package/dist/cli/messenger/images-command.js +1 -0
- package/dist/cli/messenger/media-archive-command.js +2 -0
- package/dist/cli/messenger/media-archive-move-command.js +1 -0
- package/dist/cli/messenger/media-archive-timer-command.js +1 -1
- package/dist/cli/messenger/mentions-command.js +15 -2
- package/dist/cli/messenger/message-writes.d.ts +192 -2
- package/dist/cli/messenger/message-writes.js +6 -2
- package/dist/cli/messenger/messages-command.js +2 -0
- package/dist/cli/messenger/messages-delete-command.js +1 -0
- package/dist/cli/messenger/messages-edit-command.js +1 -0
- package/dist/cli/messenger/messages-evidence-command.js +3 -1
- package/dist/cli/messenger/messages-forward-command.js +1 -0
- package/dist/cli/messenger/messages-pin-command.js +3 -0
- package/dist/cli/messenger/messages-send-command.js +10 -6
- package/dist/cli/messenger/metadata-command.js +6 -1
- package/dist/cli/messenger/models-command.js +10 -5
- package/dist/cli/messenger/polls-command.js +4 -0
- package/dist/cli/messenger/private-people-command.js +3 -3
- package/dist/cli/messenger/rankings-command.js +6 -11
- package/dist/cli/messenger/reactions-command.js +2 -0
- package/dist/cli/messenger/recipients-query.d.ts +5 -0
- package/dist/cli/messenger/recipients-query.js +18 -0
- package/dist/cli/messenger/records-command.js +13 -8
- package/dist/cli/messenger/review.js +1 -1
- package/dist/cli/messenger/schedule-command.js +2 -2
- package/dist/cli/messenger/search-answers.js +2 -0
- package/dist/cli/messenger/search-command.js +3 -1
- package/dist/cli/messenger/searches-command.js +5 -1
- package/dist/cli/messenger/sends-query.d.ts +5 -0
- package/dist/cli/messenger/sends-query.js +33 -0
- package/dist/cli/messenger/serve-command.js +1 -0
- package/dist/cli/messenger/server-command.js +0 -3
- package/dist/cli/messenger/statistics-query.d.ts +14 -0
- package/dist/cli/messenger/statistics-query.js +143 -0
- package/dist/cli/messenger/stats-command.js +5 -5
- package/dist/cli/messenger/store-maintenance-command.js +10 -10
- package/dist/cli/messenger/stored.js +4 -1
- package/dist/cli/messenger/tags-command.js +7 -1
- package/dist/cli/messenger/tasks-command.js +57 -14
- package/dist/cli/messenger/transcribe-command.js +1 -0
- package/dist/cli/messenger/watch-answers.d.ts +6 -0
- package/dist/cli/messenger/watch-answers.js +69 -0
- package/dist/cli/messenger/watch-command.d.ts +1 -1
- package/dist/cli/messenger/watch-command.js +56 -7
- package/dist/cli/program.js +5 -1
- package/dist/cli/runs/command.js +25 -38
- package/dist/cli/runs/query.d.ts +5 -0
- package/dist/cli/runs/query.js +32 -0
- package/dist/cli/runs/search-command.d.ts +4 -0
- package/dist/cli/runs/search-command.js +27 -0
- package/dist/cli/runs/search-query.d.ts +4 -0
- package/dist/cli/runs/search-query.js +50 -0
- package/dist/cli/runs/search.d.ts +2 -1
- package/dist/cli/runs/search.js +6 -6
- package/dist/documents/index.d.ts +1 -0
- package/dist/documents/index.js +1 -0
- package/dist/domain/attachments.js +9 -1
- package/dist/domain/rankings-options.js +3 -3
- package/dist/entities/account-change.d.ts +89 -0
- package/dist/entities/account-change.js +20 -0
- package/dist/entities/account-profile.d.ts +7 -0
- package/dist/entities/account-profile.js +8 -0
- package/dist/entities/analysis-consent.d.ts +9 -0
- package/dist/entities/analysis-consent.js +4 -0
- package/dist/entities/attachment-results.d.ts +96 -0
- package/dist/entities/attachment-results.js +31 -0
- package/dist/entities/batch-result.d.ts +27 -0
- package/dist/entities/batch-result.js +18 -0
- package/dist/entities/chat-admin.d.ts +234 -0
- package/dist/entities/chat-admin.js +84 -0
- package/dist/entities/chat-change.d.ts +25 -0
- package/dist/entities/chat-change.js +11 -0
- package/dist/entities/chat-metadata.d.ts +34 -0
- package/dist/entities/chat-metadata.js +15 -0
- package/dist/entities/chat-moderation.d.ts +44 -0
- package/dist/entities/chat-moderation.js +37 -0
- package/dist/entities/chat-tracking.d.ts +26 -0
- package/dist/entities/chat-tracking.js +23 -0
- package/dist/entities/contact-activity.d.ts +52 -0
- package/dist/entities/contact-activity.js +42 -0
- package/dist/entities/contact-context.d.ts +1568 -0
- package/dist/entities/contact-context.js +191 -0
- package/dist/entities/contact-write.d.ts +22 -0
- package/dist/entities/contact-write.js +6 -0
- package/dist/entities/conversation-preparation.d.ts +63 -0
- package/dist/entities/conversation-preparation.js +23 -0
- package/dist/entities/conversation-results.d.ts +567 -0
- package/dist/entities/conversation-results.js +94 -0
- package/dist/entities/document-link.d.ts +13 -0
- package/dist/entities/document-link.js +11 -0
- package/dist/entities/extraction-report.d.ts +95 -0
- package/dist/entities/extraction-report.js +34 -0
- package/dist/entities/hit.d.ts +4 -0
- package/dist/entities/hit.js +4 -0
- package/dist/entities/image-embedding.d.ts +9 -0
- package/dist/entities/image-embedding.js +10 -0
- package/dist/entities/index.d.ts +8284 -1921
- package/dist/entities/index.js +178 -3
- package/dist/entities/listener.d.ts +2150 -0
- package/dist/entities/listener.js +46 -0
- package/dist/entities/media-archive.d.ts +43 -0
- package/dist/entities/media-archive.js +32 -0
- package/dist/entities/meeting-evidence.d.ts +86 -0
- package/dist/entities/meeting-evidence.js +25 -0
- package/dist/entities/meeting-preparation-parts.d.ts +14 -0
- package/dist/entities/meeting-preparation-parts.js +15 -13
- package/dist/entities/meeting-task-proposal.d.ts +14 -0
- package/dist/entities/meeting-task-proposal.js +19 -0
- package/dist/entities/meeting.d.ts +1 -1
- package/dist/entities/meeting.js +1 -1
- package/dist/entities/mention.d.ts +63 -0
- package/dist/entities/mention.js +44 -0
- package/dist/entities/message-change.d.ts +19 -0
- package/dist/entities/message-change.js +6 -0
- package/dist/entities/message-context.d.ts +617 -0
- package/dist/entities/message-context.js +20 -0
- package/dist/entities/message-read.d.ts +73 -0
- package/dist/entities/message-read.js +58 -0
- package/dist/entities/message-transfer.d.ts +379 -0
- package/dist/entities/message-transfer.js +83 -0
- package/dist/entities/message-write.d.ts +378 -0
- package/dist/entities/message-write.js +10 -0
- package/dist/entities/model-key.d.ts +14 -0
- package/dist/entities/model-key.js +10 -0
- package/dist/entities/poll.d.ts +40 -0
- package/dist/entities/poll.js +16 -0
- package/dist/entities/private-contact.d.ts +10 -0
- package/dist/entities/private-contact.js +4 -0
- package/dist/entities/reaction-change.d.ts +7 -0
- package/dist/entities/reaction-change.js +8 -0
- package/dist/entities/recipient.d.ts +29 -0
- package/dist/entities/recipient.js +11 -0
- package/dist/entities/recorded-run.d.ts +103 -0
- package/dist/entities/recorded-run.js +44 -0
- package/dist/entities/saved-search.d.ts +4 -0
- package/dist/entities/saved-search.js +2 -0
- package/dist/entities/send-attempt.d.ts +31 -0
- package/dist/entities/send-attempt.js +29 -0
- package/dist/entities/store-maintenance.d.ts +319 -0
- package/dist/entities/store-maintenance.js +145 -0
- package/dist/entities/store-records.d.ts +442 -0
- package/dist/entities/store-records.js +99 -0
- package/dist/entities/tag-change.d.ts +74 -0
- package/dist/entities/tag-change.js +31 -0
- package/dist/entities/task-pair.d.ts +31 -0
- package/dist/entities/task-pair.js +23 -0
- package/dist/entities/task-results.d.ts +524 -0
- package/dist/entities/task-results.js +142 -0
- package/dist/errors/reasons.js +3 -0
- package/dist/mcp/agent.d.ts +3 -1
- package/dist/mcp/agent.js +17 -10
- package/dist/mcp/bot/server.d.ts +2 -0
- package/dist/mcp/bot/server.js +1 -0
- package/dist/mcp/server.js +3 -1
- package/dist/mcp/tools/attachments.js +1 -0
- package/dist/meetings/cli/index.js +4 -2
- package/dist/meetings/cli/passage.js +1 -0
- package/dist/meetings/index.d.ts +2 -1
- package/dist/meetings/index.js +1 -0
- package/dist/meetings/links.d.ts +16 -0
- package/dist/meetings/read-answers.d.ts +185 -0
- package/dist/meetings/read-answers.js +213 -0
- package/dist/ports/messenger.d.ts +10 -1
- package/dist/runs/run.d.ts +10 -2
- package/dist/runs/run.js +11 -3
- package/dist/sends/guard.d.ts +1 -1
- package/dist/sends/guard.js +9 -5
- package/dist/sends/journal.d.ts +9 -2
- package/dist/sends/journal.js +9 -2
- package/dist/sends/permissions.d.ts +5 -1
- package/dist/sends/permissions.js +42 -2
- package/dist/sends/recipients.d.ts +8 -0
- package/dist/sends/recipients.js +9 -0
- package/dist/sends/upload.d.ts +4 -4
- package/dist/sends/upload.js +24 -20
- package/dist/services/admin-statistics.js +3 -3
- package/dist/services/chat-documents.d.ts +1 -0
- package/dist/services/chat-documents.js +9 -3
- package/dist/services/chats.d.ts +1 -1
- package/dist/services/chats.js +5 -2
- package/dist/services/documents/mirrors.d.ts +98 -0
- package/dist/services/documents/mirrors.js +144 -0
- package/dist/services/meeting-links.d.ts +2 -17
- package/dist/services/messages.js +1 -0
- package/dist/services/search-all-meetings.js +21 -8
- package/dist/services/task-rules.d.ts +1 -1
- package/dist/services/tasks.d.ts +2 -2
- package/dist/services/tasks.js +1 -1
- package/dist/store/exports.d.ts +1 -1
- package/dist/store/exports.js +1 -1
- package/dist/store/messages.d.ts +3 -1
- package/dist/store/messages.js +2 -2
- package/dist/store/roster.d.ts +4 -1
- package/dist/store/roster.js +2 -2
- package/dist/store/sqlite/chats.d.ts +12 -0
- package/dist/store/sqlite/chats.js +1 -0
- package/dist/store/sqlite/document-links.d.ts +1 -1
- package/dist/store/sqlite/document-links.js +5 -5
- package/dist/store/sqlite/drizzle/bun.js +3 -3
- package/dist/store/sqlite/drizzle/bun.js.map +1 -1
- package/dist/store/sqlite/drizzle/core.js +2 -2
- package/dist/store/sqlite/drizzle/core.js.map +1 -1
- package/dist/store/sqlite/drizzle/node.js +3 -3
- package/dist/store/sqlite/drizzle/node.js.map +1 -1
- package/dist/store/sqlite/drizzle/{shared-O7CTKP45.js → shared-HKXF6HKX.js} +57 -57
- package/dist/store/sqlite/drizzle/{shared-O7CTKP45.js.map → shared-HKXF6HKX.js.map} +1 -1
- package/dist/store/sqlite/involvements.js +2 -1
- package/dist/store/sqlite/roster.d.ts +2 -1
- package/dist/store/sqlite/roster.js +3 -2
- package/package.json +2 -2
- package/parity.json +14 -69
|
@@ -4,14 +4,16 @@ interface Written {
|
|
|
4
4
|
operationId: string;
|
|
5
5
|
sendId?: string;
|
|
6
6
|
message: Message;
|
|
7
|
+
messages?: Message[];
|
|
7
8
|
scheduledFor?: string;
|
|
8
9
|
}
|
|
9
10
|
/**
|
|
10
11
|
* A send, forward or edit: the message as it now stands, with its `operation_id` — for a send, the id a repeat
|
|
11
|
-
* passes as `--operation-id` so it cannot make a second copy.
|
|
12
|
+
* passes as `--operation-id` so it cannot make a second copy. An album adds `messages`, every one it made, in order;
|
|
13
|
+
* `message` stays its first, so a reader of one message reads an album as before. A scheduled message gets a new id when it goes out,
|
|
12
14
|
* so its next step is the list that shows it, never a retry.
|
|
13
15
|
*/
|
|
14
|
-
export declare const writtenAnswer: ({ operationId, sendId, message, scheduledFor }: Written, reader: AccountKey) => import("../envelope.js").ItemBody<{
|
|
16
|
+
export declare const writtenAnswer: ({ operationId, sendId, message, messages, scheduledFor }: Written, reader: AccountKey) => import("../envelope.js").ItemBody<{
|
|
15
17
|
operation_id: string;
|
|
16
18
|
message: {
|
|
17
19
|
ref: string;
|
|
@@ -201,6 +203,194 @@ export declare const writtenAnswer: ({ operationId, sendId, message, scheduledFo
|
|
|
201
203
|
[x: string]: unknown;
|
|
202
204
|
} | undefined;
|
|
203
205
|
};
|
|
206
|
+
messages?: {
|
|
207
|
+
ref: string;
|
|
208
|
+
id: string;
|
|
209
|
+
provider?: string | undefined;
|
|
210
|
+
account?: string | undefined;
|
|
211
|
+
chat_id: string;
|
|
212
|
+
chat_title?: string | null | undefined;
|
|
213
|
+
sender_id: string | null;
|
|
214
|
+
sender_name: string | null;
|
|
215
|
+
sender_username?: string | undefined;
|
|
216
|
+
sender_is_chat?: boolean | undefined;
|
|
217
|
+
mentions?: string[] | undefined;
|
|
218
|
+
timestamp: string;
|
|
219
|
+
edited_at: string | null;
|
|
220
|
+
text: string;
|
|
221
|
+
transcript?: string | undefined;
|
|
222
|
+
anchor?: boolean | undefined;
|
|
223
|
+
excerpt?: string | undefined;
|
|
224
|
+
matched_in?: "context" | "file" | "filename" | "picture" | "text" | "transcript" | undefined;
|
|
225
|
+
score?: number | undefined;
|
|
226
|
+
match?: "beginnings" | "corrected" | "words" | undefined;
|
|
227
|
+
corrections?: {
|
|
228
|
+
from: string;
|
|
229
|
+
to: string[];
|
|
230
|
+
}[] | undefined;
|
|
231
|
+
found_in?: "archive" | "both" | "server" | undefined;
|
|
232
|
+
discovery?: {
|
|
233
|
+
coverage: number;
|
|
234
|
+
matched_terms: string[];
|
|
235
|
+
missing_terms: string[];
|
|
236
|
+
parent?: string | undefined;
|
|
237
|
+
} | undefined;
|
|
238
|
+
context?: {
|
|
239
|
+
ref: string;
|
|
240
|
+
timestamp: string;
|
|
241
|
+
sender_name: string | null;
|
|
242
|
+
text: string;
|
|
243
|
+
}[] | undefined;
|
|
244
|
+
outgoing: boolean | null;
|
|
245
|
+
attachments: {
|
|
246
|
+
message?: string | undefined;
|
|
247
|
+
kind: string;
|
|
248
|
+
position?: number | undefined;
|
|
249
|
+
url?: string | undefined;
|
|
250
|
+
name?: string | undefined;
|
|
251
|
+
title?: string | undefined;
|
|
252
|
+
mime?: string | undefined;
|
|
253
|
+
size?: number | undefined;
|
|
254
|
+
width?: number | undefined;
|
|
255
|
+
height?: number | undefined;
|
|
256
|
+
duration?: number | undefined;
|
|
257
|
+
text?: string | undefined;
|
|
258
|
+
extraction?: {
|
|
259
|
+
origin: string;
|
|
260
|
+
extractor: string;
|
|
261
|
+
chars: number;
|
|
262
|
+
error?: string | undefined;
|
|
263
|
+
} | undefined;
|
|
264
|
+
local_path?: string | undefined;
|
|
265
|
+
buttons?: {
|
|
266
|
+
kind: "app" | "callback" | "chat" | "clipboard" | "contact" | "link" | "location" | "message" | "other";
|
|
267
|
+
text: string;
|
|
268
|
+
url?: string | undefined;
|
|
269
|
+
}[][] | undefined;
|
|
270
|
+
}[];
|
|
271
|
+
reply_to: {
|
|
272
|
+
id: string;
|
|
273
|
+
sender_id: string | null;
|
|
274
|
+
sender_name: string | null;
|
|
275
|
+
timestamp: string | null;
|
|
276
|
+
text: string;
|
|
277
|
+
attachments: {
|
|
278
|
+
message?: string | undefined;
|
|
279
|
+
kind: string;
|
|
280
|
+
position?: number | undefined;
|
|
281
|
+
url?: string | undefined;
|
|
282
|
+
name?: string | undefined;
|
|
283
|
+
title?: string | undefined;
|
|
284
|
+
mime?: string | undefined;
|
|
285
|
+
size?: number | undefined;
|
|
286
|
+
width?: number | undefined;
|
|
287
|
+
height?: number | undefined;
|
|
288
|
+
duration?: number | undefined;
|
|
289
|
+
text?: string | undefined;
|
|
290
|
+
extraction?: {
|
|
291
|
+
origin: string;
|
|
292
|
+
extractor: string;
|
|
293
|
+
chars: number;
|
|
294
|
+
error?: string | undefined;
|
|
295
|
+
} | undefined;
|
|
296
|
+
local_path?: string | undefined;
|
|
297
|
+
buttons?: {
|
|
298
|
+
kind: "app" | "callback" | "chat" | "clipboard" | "contact" | "link" | "location" | "message" | "other";
|
|
299
|
+
text: string;
|
|
300
|
+
url?: string | undefined;
|
|
301
|
+
}[][] | undefined;
|
|
302
|
+
}[];
|
|
303
|
+
outgoing: boolean | null;
|
|
304
|
+
} | null;
|
|
305
|
+
reply_to_id?: string | undefined;
|
|
306
|
+
forwarded_from: {
|
|
307
|
+
id: string;
|
|
308
|
+
sender_id: string | null;
|
|
309
|
+
sender_name: string | null;
|
|
310
|
+
timestamp: string | null;
|
|
311
|
+
text: string;
|
|
312
|
+
attachments: {
|
|
313
|
+
message?: string | undefined;
|
|
314
|
+
kind: string;
|
|
315
|
+
position?: number | undefined;
|
|
316
|
+
url?: string | undefined;
|
|
317
|
+
name?: string | undefined;
|
|
318
|
+
title?: string | undefined;
|
|
319
|
+
mime?: string | undefined;
|
|
320
|
+
size?: number | undefined;
|
|
321
|
+
width?: number | undefined;
|
|
322
|
+
height?: number | undefined;
|
|
323
|
+
duration?: number | undefined;
|
|
324
|
+
text?: string | undefined;
|
|
325
|
+
extraction?: {
|
|
326
|
+
origin: string;
|
|
327
|
+
extractor: string;
|
|
328
|
+
chars: number;
|
|
329
|
+
error?: string | undefined;
|
|
330
|
+
} | undefined;
|
|
331
|
+
local_path?: string | undefined;
|
|
332
|
+
buttons?: {
|
|
333
|
+
kind: "app" | "callback" | "chat" | "clipboard" | "contact" | "link" | "location" | "message" | "other";
|
|
334
|
+
text: string;
|
|
335
|
+
url?: string | undefined;
|
|
336
|
+
}[][] | undefined;
|
|
337
|
+
}[];
|
|
338
|
+
outgoing: boolean | null;
|
|
339
|
+
} | null;
|
|
340
|
+
thread_id?: string | undefined;
|
|
341
|
+
thread_root_id?: string | undefined;
|
|
342
|
+
reactions?: {
|
|
343
|
+
counts: {
|
|
344
|
+
reaction: string;
|
|
345
|
+
count: number;
|
|
346
|
+
}[];
|
|
347
|
+
mine: string | null;
|
|
348
|
+
total: number;
|
|
349
|
+
} | null | undefined;
|
|
350
|
+
scheduled_for?: string | undefined;
|
|
351
|
+
starred?: true | undefined;
|
|
352
|
+
delivery?: "delivered" | "read" | undefined;
|
|
353
|
+
email?: {
|
|
354
|
+
subject: string | null;
|
|
355
|
+
from: {
|
|
356
|
+
name: string | null;
|
|
357
|
+
address: string;
|
|
358
|
+
ref: string | null;
|
|
359
|
+
} | null;
|
|
360
|
+
to: {
|
|
361
|
+
name: string | null;
|
|
362
|
+
address: string;
|
|
363
|
+
ref: string | null;
|
|
364
|
+
}[];
|
|
365
|
+
cc: {
|
|
366
|
+
name: string | null;
|
|
367
|
+
address: string;
|
|
368
|
+
ref: string | null;
|
|
369
|
+
}[];
|
|
370
|
+
bcc: {
|
|
371
|
+
name: string | null;
|
|
372
|
+
address: string;
|
|
373
|
+
ref: string | null;
|
|
374
|
+
}[];
|
|
375
|
+
reply_addresses: {
|
|
376
|
+
name: string | null;
|
|
377
|
+
address: string;
|
|
378
|
+
ref: string | null;
|
|
379
|
+
}[];
|
|
380
|
+
labels: string[];
|
|
381
|
+
thread: string;
|
|
382
|
+
read: boolean | null;
|
|
383
|
+
flagged: boolean | null;
|
|
384
|
+
sender_score?: {
|
|
385
|
+
score: number;
|
|
386
|
+
signals: string[];
|
|
387
|
+
demoted?: true | undefined;
|
|
388
|
+
} | undefined;
|
|
389
|
+
} | undefined;
|
|
390
|
+
provider_metadata?: {
|
|
391
|
+
[x: string]: unknown;
|
|
392
|
+
} | undefined;
|
|
393
|
+
}[] | undefined;
|
|
204
394
|
scheduled_for?: string | undefined;
|
|
205
395
|
}>;
|
|
206
396
|
/**
|
|
@@ -4,12 +4,16 @@ import { nextStep } from "../steps.js";
|
|
|
4
4
|
import { messageItem } from "./message-items.js";
|
|
5
5
|
/**
|
|
6
6
|
* A send, forward or edit: the message as it now stands, with its `operation_id` — for a send, the id a repeat
|
|
7
|
-
* passes as `--operation-id` so it cannot make a second copy.
|
|
7
|
+
* passes as `--operation-id` so it cannot make a second copy. An album adds `messages`, every one it made, in order;
|
|
8
|
+
* `message` stays its first, so a reader of one message reads an album as before. A scheduled message gets a new id when it goes out,
|
|
8
9
|
* so its next step is the list that shows it, never a retry.
|
|
9
10
|
*/
|
|
10
|
-
export const writtenAnswer = ({ operationId, sendId, message, scheduledFor }, reader) => itemOf({
|
|
11
|
+
export const writtenAnswer = ({ operationId, sendId, message, messages, scheduledFor }, reader) => itemOf({
|
|
11
12
|
operation_id: sendId ?? operationId,
|
|
12
13
|
message: messageItem(message, reader),
|
|
14
|
+
...(messages === undefined || messages.length < 2
|
|
15
|
+
? {}
|
|
16
|
+
: { messages: messages.map((one) => messageItem(one, reader)) }),
|
|
13
17
|
...(scheduledFor === undefined ? {} : { scheduled_for: scheduledFor }),
|
|
14
18
|
}, scheduledFor === undefined ? {} : { next: [nextStep("messages.scheduled", { args: { chat: message.chatId } })] });
|
|
15
19
|
/**
|
|
@@ -110,6 +110,7 @@ export const messagesCommand = (messenger) => {
|
|
|
110
110
|
};
|
|
111
111
|
messages.addCommand(sendCommand(messenger));
|
|
112
112
|
annotate(messages.command("show"), {
|
|
113
|
+
output: { entity: "message" },
|
|
113
114
|
examples: [`${messenger.app.command} personal messages show "Book club" 101`],
|
|
114
115
|
effects: REMOTE_READ,
|
|
115
116
|
})
|
|
@@ -122,6 +123,7 @@ export const messagesCommand = (messenger) => {
|
|
|
122
123
|
await readWindow(this, chat, message, { before: 0, after: 0 });
|
|
123
124
|
});
|
|
124
125
|
threadOptions(annotate(messages.command("context"), {
|
|
126
|
+
output: { entity: "message_context" },
|
|
125
127
|
examples: [`${messenger.app.command} personal messages context "Book club" 101 --before-n 3 --after-n 3`],
|
|
126
128
|
effects: REMOTE_READ,
|
|
127
129
|
}))
|
|
@@ -14,6 +14,7 @@ import { messengerContext } from "./context.js";
|
|
|
14
14
|
export const deleteCommand = (messenger) => annotate(new Command("delete"), {
|
|
15
15
|
examples: [`${messenger.app.command} personal messages delete "Book club" 101`],
|
|
16
16
|
effects: REMOTE_WRITE,
|
|
17
|
+
output: { entity: "message_deletion" },
|
|
17
18
|
})
|
|
18
19
|
.description("delete messages for you only; with --for-everyone, for everyone in the chat")
|
|
19
20
|
.argument("<chat>", messenger.chatArgument)
|
|
@@ -11,6 +11,7 @@ export const editCommand = (messenger) => {
|
|
|
11
11
|
const edit = annotate(new Command("edit"), {
|
|
12
12
|
examples: [`${messenger.app.command} personal messages edit "Book club" 101 "The meeting starts at 11."`],
|
|
13
13
|
effects: REMOTE_WRITE,
|
|
14
|
+
output: { entity: "message_write" },
|
|
14
15
|
})
|
|
15
16
|
.description("change the text of your own message; the other side may have read it already")
|
|
16
17
|
.argument("<chat>", messenger.chatArgument)
|
|
@@ -7,10 +7,12 @@ import { positiveCount } from "../paging.js";
|
|
|
7
7
|
import { messengerContext } from "./context.js";
|
|
8
8
|
import { evidenceAnswer } from "./message-answers.js";
|
|
9
9
|
export const evidenceCommand = (messenger) => annotate(new Command("evidence"), {
|
|
10
|
+
output: { entity: "evidence_packet" },
|
|
10
11
|
examples: [`${messenger.app.command} personal messages evidence "Book club" --limit 10`],
|
|
11
12
|
effects: LOCAL_READ,
|
|
12
13
|
})
|
|
13
|
-
.
|
|
14
|
+
.summary("a recent-chat evidence packet from stored messages")
|
|
15
|
+
.description("general chat context, newest first, with references, coverage and fingerprints for verification")
|
|
14
16
|
.argument("<chat>", messenger.chatArgument)
|
|
15
17
|
.option("--limit <n>", "how many, 1–100", positiveCount("--limit"))
|
|
16
18
|
.option("--cursor <cursor>", "go on from where page.next says the last packet stopped")
|
|
@@ -9,6 +9,7 @@ export const forwardCommand = (messenger) => {
|
|
|
9
9
|
const forward = annotate(new Command("forward"), {
|
|
10
10
|
examples: [`${messenger.app.command} personal messages forward "Book club" 101 --to "Project room"`],
|
|
11
11
|
effects: REMOTE_WRITE,
|
|
12
|
+
output: { entity: "message_write" },
|
|
12
13
|
})
|
|
13
14
|
.description("forward one message to another chat")
|
|
14
15
|
.argument("<chat>", `the chat the message is in: ${messenger.chatArgument}`)
|
|
@@ -10,6 +10,7 @@ export const pinCommand = (messenger) => {
|
|
|
10
10
|
const durations = messenger.pinDurations?.length ? messenger.pinDurations : undefined;
|
|
11
11
|
const command = annotate(new Command("pin"), {
|
|
12
12
|
effects: REMOTE_WRITE,
|
|
13
|
+
output: { entity: "message_pin" },
|
|
13
14
|
examples: [
|
|
14
15
|
`${tool} messages pin <chat> <message>`,
|
|
15
16
|
...(quiet ? [`${tool} messages pin <chat> <message> --notify`] : []),
|
|
@@ -38,6 +39,7 @@ export const pinCommand = (messenger) => {
|
|
|
38
39
|
};
|
|
39
40
|
export const unpinCommand = (messenger) => annotate(new Command("unpin"), {
|
|
40
41
|
effects: REMOTE_WRITE,
|
|
42
|
+
output: { entity: "message_pin" },
|
|
41
43
|
examples: [`${messenger.app.command} messages unpin <chat> <message>`],
|
|
42
44
|
})
|
|
43
45
|
.description("unpin a message in a chat")
|
|
@@ -53,6 +55,7 @@ export const starCommands = (messenger) => [true, false].map((starred) => {
|
|
|
53
55
|
const name = starred ? "star" : "unstar";
|
|
54
56
|
return annotate(new Command(name), {
|
|
55
57
|
effects: REMOTE_WRITE,
|
|
58
|
+
output: { entity: "message_star" },
|
|
56
59
|
examples: [`${messenger.app.command} messages ${name} <chat> <message>`],
|
|
57
60
|
})
|
|
58
61
|
.description(starred ? "star a message, so it is easy to find again; only you see the star" : "take the star off a message")
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { CliError } from "@wirecat/cli-base";
|
|
2
2
|
import { annotate } from "@wirecat/cli-base/commands";
|
|
3
|
-
import { Command } from "commander";
|
|
3
|
+
import { Command, Option } from "commander";
|
|
4
4
|
import { sendTime } from "../../domain/send-time.js";
|
|
5
5
|
import { threadIdOf } from "../../domain/thread.js";
|
|
6
6
|
import { typedSendAs } from "../../sends/send-as.js";
|
|
@@ -15,10 +15,14 @@ import { readAll } from "./stdin.js";
|
|
|
15
15
|
* of what this profile tried to send, and it never holds the text.
|
|
16
16
|
*/
|
|
17
17
|
export const HTML_HELP = "the text is HTML: <b>, <i>, <a href>, <code>";
|
|
18
|
+
const collect = (value, previous) => [...previous, value];
|
|
19
|
+
/** The empty list as its default is what tells the MCP tool to take a list for it. */
|
|
20
|
+
const repeatable = (flags, description) => new Option(flags, description).argParser(collect).default([], "none");
|
|
18
21
|
export const sendCommand = (messenger) => {
|
|
19
22
|
const send = annotate(new Command("send"), {
|
|
20
23
|
examples: [`${messenger.app.command} personal messages send "Book club" "The meeting starts at 10."`],
|
|
21
24
|
effects: REMOTE_WRITE,
|
|
25
|
+
output: { entity: "message_write" },
|
|
22
26
|
})
|
|
23
27
|
.description("send a text message; without [text], the text is read from stdin")
|
|
24
28
|
.argument("<chat>", messenger.chatArgument)
|
|
@@ -37,9 +41,9 @@ export const sendCommand = (messenger) => {
|
|
|
37
41
|
send
|
|
38
42
|
.option("--no-preview", "no preview card for a link in the text")
|
|
39
43
|
.option("--md", "read this messenger's Markdown; see its formatting guide for supported syntax")
|
|
40
|
-
.
|
|
41
|
-
.
|
|
42
|
-
.option("--as-file", "send
|
|
44
|
+
.addOption(repeatable("--file <file>", "attach a file; the text becomes its caption; repeat it for an album"))
|
|
45
|
+
.addOption(repeatable("--photo <file>", "attach a .jpg, .png or .webp as a photo; the text becomes its caption; repeat it for an album"))
|
|
46
|
+
.option("--as-file", "send each --file as a file to download, a video included")
|
|
43
47
|
.option("--voice <file>", "send an Ogg Opus file as a voice message, alone, with no text")
|
|
44
48
|
.addOption(ownerOnlyOption("--allow-any-file", "send a file even from credential folders or this CLI's own folders"));
|
|
45
49
|
if (messenger.scheduledSends !== false)
|
|
@@ -75,8 +79,8 @@ const sendText = async (command, messenger, chat, text) => {
|
|
|
75
79
|
throw new CliError("validation_error", "--comment-to needs the post's message id");
|
|
76
80
|
const read = { app: messenger.app, env: context.env, anyFile: allowAnyFile === true };
|
|
77
81
|
const attachments = await readAttachments({
|
|
78
|
-
|
|
79
|
-
|
|
82
|
+
photo,
|
|
83
|
+
file,
|
|
80
84
|
...(voice === undefined ? {} : { voice }),
|
|
81
85
|
...(text === undefined ? {} : { text }),
|
|
82
86
|
asFile: asFile === true,
|
|
@@ -8,7 +8,11 @@ import { messengerContext, refuseLocalWrite } from "./context.js";
|
|
|
8
8
|
export const metadataCommand = (messenger) => {
|
|
9
9
|
const tool = messenger.app.command;
|
|
10
10
|
const command = new Command("metadata").description("cached group/channel descriptions for local automatic tags");
|
|
11
|
-
annotate(command.command("get"), {
|
|
11
|
+
annotate(command.command("get"), {
|
|
12
|
+
output: { entity: "chat_metadata" },
|
|
13
|
+
effects: LOCAL_READ,
|
|
14
|
+
examples: [`${tool} metadata get --chat 7`],
|
|
15
|
+
})
|
|
12
16
|
.description("a stored chat's cached description, as automatic tags read it")
|
|
13
17
|
.requiredOption("--chat <chat>", "a stored chat")
|
|
14
18
|
.action(async function () {
|
|
@@ -17,6 +21,7 @@ export const metadataCommand = (messenger) => {
|
|
|
17
21
|
renderAnswer(this, context, itemOf(snakeKeys(await context.withServices((services) => services.metadata.get(chat)))));
|
|
18
22
|
});
|
|
19
23
|
annotate(command.command("refresh"), {
|
|
24
|
+
output: { entity: "chat_metadata_refresh" },
|
|
20
25
|
effects: FETCH,
|
|
21
26
|
examples: [`${tool} metadata refresh --chat 7 --chat 8`, `${tool} metadata refresh --only-missing --limit 20`],
|
|
22
27
|
})
|
|
@@ -76,7 +76,6 @@ export const modelsCommand = (messenger) => {
|
|
|
76
76
|
});
|
|
77
77
|
});
|
|
78
78
|
reachesOtherService(annotate(audio.command("download"), {
|
|
79
|
-
mcp: false,
|
|
80
79
|
effects: FETCH,
|
|
81
80
|
output: { entity: "model" },
|
|
82
81
|
examples: [`${tool} models audio download parakeet-v3`],
|
|
@@ -124,7 +123,6 @@ export const modelsCommand = (messenger) => {
|
|
|
124
123
|
});
|
|
125
124
|
});
|
|
126
125
|
reachesOtherService(annotate(text.command("download"), {
|
|
127
|
-
mcp: false,
|
|
128
126
|
effects: FETCH,
|
|
129
127
|
output: { entity: "model" },
|
|
130
128
|
examples: [`${tool} models text download ${DEFAULT_TEXT_MODEL}`],
|
|
@@ -145,7 +143,11 @@ export const modelsCommand = (messenger) => {
|
|
|
145
143
|
}, { unbounded: true });
|
|
146
144
|
});
|
|
147
145
|
const key = text.command("key").description("API keys for embedding and analysis providers");
|
|
148
|
-
grantsAuthority(annotate(key.command("set"), {
|
|
146
|
+
grantsAuthority(annotate(key.command("set"), {
|
|
147
|
+
effects: LOCAL_WRITE,
|
|
148
|
+
output: { entity: "model_key", view: "stored" },
|
|
149
|
+
examples: [`${tool} models text key set openai`],
|
|
150
|
+
}))
|
|
149
151
|
.argument("<provider>", "openai, anthropic, or the host of a --base-url server that wants a key")
|
|
150
152
|
.description("store a key, typed at a hidden prompt or piped on stdin — never as an argument")
|
|
151
153
|
.action(async function (provider) {
|
|
@@ -159,7 +161,11 @@ export const modelsCommand = (messenger) => {
|
|
|
159
161
|
renderAnswer(this, context, itemOf({ provider, stored: source }));
|
|
160
162
|
});
|
|
161
163
|
});
|
|
162
|
-
grantsAuthority(annotate(key.command("remove"), {
|
|
164
|
+
grantsAuthority(annotate(key.command("remove"), {
|
|
165
|
+
effects: LOCAL_WRITE,
|
|
166
|
+
output: { entity: "model_key", view: "removed" },
|
|
167
|
+
examples: [`${tool} models text key remove openai`],
|
|
168
|
+
}))
|
|
163
169
|
.argument("<provider>", "openai, anthropic, or a server's host")
|
|
164
170
|
.description("forget a stored key")
|
|
165
171
|
.action(async function (provider) {
|
|
@@ -189,7 +195,6 @@ export const imageModelsCommand = (messenger) => {
|
|
|
189
195
|
});
|
|
190
196
|
});
|
|
191
197
|
reachesOtherService(annotate(image.command("download"), {
|
|
192
|
-
mcp: false,
|
|
193
198
|
effects: FETCH,
|
|
194
199
|
output: { entity: "model" },
|
|
195
200
|
examples: [`${tool} images models download ${DEFAULT_IMAGE_MODEL}`],
|
|
@@ -23,6 +23,7 @@ export const pollsCommand = (messenger) => {
|
|
|
23
23
|
? "read a poll, vote in it, create one"
|
|
24
24
|
: "read a poll, vote in it, close your own, create one");
|
|
25
25
|
annotate(polls.command("show"), {
|
|
26
|
+
output: { entity: "poll" },
|
|
26
27
|
effects: REMOTE_READ,
|
|
27
28
|
examples: [`${messenger.app.command} personal polls show "Book club" 101`],
|
|
28
29
|
})
|
|
@@ -67,6 +68,7 @@ export const pollsCommand = (messenger) => {
|
|
|
67
68
|
}), lines(({ voted_at, person_id, name, answers }) => [voted_at, name ?? person_id, answers.join(",")].join(" ")));
|
|
68
69
|
}));
|
|
69
70
|
annotate(polls.command("vote"), {
|
|
71
|
+
output: { entity: "poll_change" },
|
|
70
72
|
effects: REMOTE_WRITE,
|
|
71
73
|
examples: [`${messenger.app.command} personal polls vote "Book club" 101 0`],
|
|
72
74
|
})
|
|
@@ -95,6 +97,7 @@ export const pollsCommand = (messenger) => {
|
|
|
95
97
|
});
|
|
96
98
|
if (messenger.pollClose !== false)
|
|
97
99
|
annotate(polls.command("close"), {
|
|
100
|
+
output: { entity: "poll_change" },
|
|
98
101
|
effects: REMOTE_WRITE,
|
|
99
102
|
examples: [`${messenger.app.command} personal polls close "Book club" 101`],
|
|
100
103
|
})
|
|
@@ -107,6 +110,7 @@ export const pollsCommand = (messenger) => {
|
|
|
107
110
|
renderAnswer(this, context, itemOf(snakeKeys(closed)));
|
|
108
111
|
});
|
|
109
112
|
const create = annotate(polls.command("create"), {
|
|
113
|
+
output: { entity: "message_write" },
|
|
110
114
|
effects: REMOTE_WRITE,
|
|
111
115
|
examples: [`${messenger.app.command} personal polls create "Book club" "Which day?" Monday Tuesday`],
|
|
112
116
|
})
|
|
@@ -14,7 +14,7 @@ const NOTES_QUERY = unfilteredQuery("contact_note", contactNote);
|
|
|
14
14
|
const everyNote = (command, items) => listOf(command, { items, limit: Math.max(1, items.length), has_more: false });
|
|
15
15
|
export const privatePeopleCommands = (messenger) => {
|
|
16
16
|
const alias = new Command("alias").description("a private local display name in the selected account");
|
|
17
|
-
annotate(alias.command("set"), { effects: LOCAL_WRITE })
|
|
17
|
+
annotate(alias.command("set"), { effects: LOCAL_WRITE, output: { entity: "contact_alias" } })
|
|
18
18
|
.description("your own name for a person in this account; kept on this machine, never sent")
|
|
19
19
|
.argument("<person>", "the person's id, reference or known name")
|
|
20
20
|
.argument("<alias>", "the private name to use for this person")
|
|
@@ -23,7 +23,7 @@ export const privatePeopleCommands = (messenger) => {
|
|
|
23
23
|
refuseLocalWrite(context, messenger.app.command, "contacts.alias.set");
|
|
24
24
|
renderAnswer(this, context, itemOf(snakeKeys(await context.withServices((services) => services.privatePeople.alias(person, value)))));
|
|
25
25
|
});
|
|
26
|
-
annotate(alias.command("rm"), { effects: LOCAL_WRITE })
|
|
26
|
+
annotate(alias.command("rm"), { effects: LOCAL_WRITE, output: { entity: "contact_alias" } })
|
|
27
27
|
.description("drop your local name for a person; their own name shows again")
|
|
28
28
|
.argument("<person>", "the person's id, reference or known name")
|
|
29
29
|
.action(async function (person) {
|
|
@@ -78,7 +78,7 @@ export const privatePeopleCommands = (messenger) => {
|
|
|
78
78
|
renderAnswer(this, context, itemOf(saved));
|
|
79
79
|
});
|
|
80
80
|
}
|
|
81
|
-
annotate(notes.command("remove"), { effects: LOCAL_WRITE })
|
|
81
|
+
annotate(notes.command("remove"), { effects: LOCAL_WRITE, output: { entity: "contact_note_removal" } })
|
|
82
82
|
.description("delete one private note on a person")
|
|
83
83
|
.argument("<person>", "the person's id, reference or known name")
|
|
84
84
|
.argument("<id>", "the note id from contacts notes list")
|
|
@@ -12,6 +12,7 @@ import { renderAnswer } from "../envelope.js";
|
|
|
12
12
|
import { positiveCount } from "../paging.js";
|
|
13
13
|
import { messengerContext } from "./context.js";
|
|
14
14
|
import { syncOptions, syncRequest } from "./search-sync-options.js";
|
|
15
|
+
import { statisticsQuery, withStatisticsQuery } from "./statistics-query.js";
|
|
15
16
|
import { evidenceAnswer, rankingAnswer, refuseJsonl } from "./stats-answers.js";
|
|
16
17
|
const selectionOf = (value) => {
|
|
17
18
|
if (Buffer.byteLength(value) > RANKING_SELECTION_BYTES)
|
|
@@ -35,28 +36,22 @@ export const rankingsTopCommand = (messenger, target) => {
|
|
|
35
36
|
"engaging",
|
|
36
37
|
]))
|
|
37
38
|
.option("--weights <json>", "the complete component weights; replaces preset weights")
|
|
38
|
-
.addOption(new Option("--message-kind <kind>", "select proven all, posts or comments before ranking").choices([
|
|
39
|
-
"all",
|
|
40
|
-
"posts",
|
|
41
|
-
"comments",
|
|
42
|
-
]))
|
|
43
|
-
.option("--chat <chat>", `only this chat; ${messenger.chatArgument}`)
|
|
44
39
|
.option("--source <accounts>", "every held account of this messenger; personal, bots or all")
|
|
45
40
|
.option("--timezone <zone>", "the IANA timezone for dates and active days")
|
|
46
|
-
.option("--exact", "bare words match exact forms rather than stems")
|
|
47
41
|
.option("--limit <n>", "ranked rows, 1–100", positiveCount("--limit"))
|
|
48
42
|
.option("--saved <name|id>", "run a saved query or ranking run; typed options replace stored options");
|
|
49
|
-
|
|
50
|
-
|
|
43
|
+
const report = target === "contacts" ? "contacts-top" : "messages-top";
|
|
44
|
+
withStatisticsQuery(command, report);
|
|
51
45
|
command.action(async function (words) {
|
|
46
|
+
const filters = statisticsQuery(words, report);
|
|
52
47
|
const context = messengerContext(this, messenger);
|
|
53
48
|
refuseJsonl(context.format);
|
|
54
49
|
const options = this.opts();
|
|
55
50
|
const { saved, ...typed } = options;
|
|
56
|
-
let params = { ...typed, ...
|
|
51
|
+
let params = { ...typed, ...filters };
|
|
57
52
|
const found = await context.withServices(async (services) => {
|
|
58
53
|
if (saved !== undefined)
|
|
59
|
-
params = (await services.searches.resolve(saved, { ...params, text:
|
|
54
|
+
params = (await services.searches.resolve(saved, { ...params, text: filters.text ?? "" })).params;
|
|
60
55
|
if (params.target !== undefined && params.target !== target)
|
|
61
56
|
throw new CliError("validation_error", "saved ranking belongs to a different target");
|
|
62
57
|
if (params.newest || params.context)
|
|
@@ -8,6 +8,7 @@ export const reactionsCommand = (messenger) => {
|
|
|
8
8
|
const reactions = new Command("reactions").description("react to messages");
|
|
9
9
|
annotate(reactions.command("add"), {
|
|
10
10
|
effects: REMOTE_WRITE,
|
|
11
|
+
output: { entity: "reaction_change" },
|
|
11
12
|
examples: [`${messenger.app.command} personal reactions add "Book club" 101 👍`],
|
|
12
13
|
})
|
|
13
14
|
.description("put your reaction on a message; it replaces the one you had")
|
|
@@ -21,6 +22,7 @@ export const reactionsCommand = (messenger) => {
|
|
|
21
22
|
});
|
|
22
23
|
annotate(reactions.command("remove"), {
|
|
23
24
|
effects: REMOTE_WRITE,
|
|
25
|
+
output: { entity: "reaction_change" },
|
|
24
26
|
examples: [`${messenger.app.command} personal reactions remove "Book club" 101`],
|
|
25
27
|
})
|
|
26
28
|
.description("take your reaction off a message")
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { type QueryRegistry } from "@wirecat/cli-base/query";
|
|
2
|
+
import type { RecipientFilter } from "../../sends/recipients.js";
|
|
3
|
+
import { type QueryWords } from "../list-query.js";
|
|
4
|
+
export declare const RECIPIENTS_QUERY: QueryRegistry;
|
|
5
|
+
export declare const recipientFilter: (words: QueryWords) => RecipientFilter;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { queryFieldsOf } from "@wirecat/cli-base/query";
|
|
2
|
+
import { recipient } from "../../entities/index.js";
|
|
3
|
+
import { queryTerms } from "../list-query.js";
|
|
4
|
+
export const RECIPIENTS_QUERY = {
|
|
5
|
+
entity: "recipient",
|
|
6
|
+
backend: "native",
|
|
7
|
+
fields: queryFieldsOf(recipient, {
|
|
8
|
+
native: ["id", "title"],
|
|
9
|
+
examples: { id: "id:7", title: 'title:"Book club"' },
|
|
10
|
+
}).map((field) => field.native
|
|
11
|
+
? { ...field, operators: field.operators.filter((operator) => operator === "term" || operator === "phrase") }
|
|
12
|
+
: field),
|
|
13
|
+
};
|
|
14
|
+
export const recipientFilter = (words) => {
|
|
15
|
+
const terms = queryTerms(words, RECIPIENTS_QUERY, "recipients list");
|
|
16
|
+
const id = terms.get("id"), title = terms.get("title");
|
|
17
|
+
return { ...(id === undefined ? {} : { id }), ...(title === undefined ? {} : { title }) };
|
|
18
|
+
};
|