@wirecat/cli-core 0.704.0 → 0.706.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.
Files changed (93) hide show
  1. package/CHANGELOG.md +116 -0
  2. package/dist/cli/bot/api-http.d.ts +8 -2
  3. package/dist/cli/bot/api-http.js +20 -4
  4. package/dist/cli/bot/api.d.ts +8 -0
  5. package/dist/cli/bot/api.js +31 -3
  6. package/dist/cli/documents/words.d.ts +1 -1
  7. package/dist/cli/index.d.ts +4 -4
  8. package/dist/cli/index.js +3 -3
  9. package/dist/cli/messenger/lacks.js +3 -0
  10. package/dist/cli/messenger/messages-delete-command.js +30 -25
  11. package/dist/cli/messenger/messages-edit-command.js +2 -0
  12. package/dist/cli/messenger/messages-scheduled-command.js +110 -4
  13. package/dist/cli/messenger/store-maintenance-command.js +6 -2
  14. package/dist/cli/service-api-call.d.ts +13 -3
  15. package/dist/cli/service-api-call.js +19 -9
  16. package/dist/cli/service-api-manifest.d.ts +11 -2
  17. package/dist/cli/service-api-manifest.js +30 -9
  18. package/dist/cli/service-api.d.ts +14 -6
  19. package/dist/cli/service-api.js +198 -52
  20. package/dist/cli/token-session.d.ts +5 -2
  21. package/dist/cli/token-session.js +13 -4
  22. package/dist/content/cli/index.d.ts +33 -0
  23. package/dist/content/cli/index.js +368 -0
  24. package/dist/content/index.d.ts +8 -0
  25. package/dist/content/index.js +7 -0
  26. package/dist/content/manifest/index.d.ts +4 -0
  27. package/dist/content/manifest/index.js +4 -0
  28. package/dist/content/manifest/manifest.d.ts +92 -0
  29. package/dist/content/manifest/manifest.js +137 -0
  30. package/dist/content/manifest/map.d.ts +25 -0
  31. package/dist/content/manifest/map.js +94 -0
  32. package/dist/content/manifest/source.d.ts +41 -0
  33. package/dist/content/manifest/source.js +288 -0
  34. package/dist/content/manifest/writer.d.ts +26 -0
  35. package/dist/content/manifest/writer.js +133 -0
  36. package/dist/content/source.d.ts +64 -0
  37. package/dist/content/source.js +2 -0
  38. package/dist/content/sync.d.ts +61 -0
  39. package/dist/content/sync.js +387 -0
  40. package/dist/content/testing/index.d.ts +4 -0
  41. package/dist/content/testing/index.js +4 -0
  42. package/dist/content/testing/source-contract.d.ts +38 -0
  43. package/dist/content/testing/source-contract.js +274 -0
  44. package/dist/content/testing/source.d.ts +55 -0
  45. package/dist/content/testing/source.js +276 -0
  46. package/dist/content/testing/sync-contract.d.ts +10 -0
  47. package/dist/content/testing/sync-contract.js +172 -0
  48. package/dist/content/testing/write-contract.d.ts +14 -0
  49. package/dist/content/testing/write-contract.js +102 -0
  50. package/dist/content/writer.d.ts +64 -0
  51. package/dist/content/writer.js +38 -0
  52. package/dist/content/writes.d.ts +58 -0
  53. package/dist/content/writes.js +129 -0
  54. package/dist/documents/file-mirror-model.d.ts +3 -1
  55. package/dist/documents/index.d.ts +3 -3
  56. package/dist/documents/index.js +1 -1
  57. package/dist/domain/content.d.ts +102 -0
  58. package/dist/domain/content.js +11 -0
  59. package/dist/entities/index.d.ts +8 -2
  60. package/dist/entities/index.js +4 -2
  61. package/dist/entities/message-change.d.ts +240 -0
  62. package/dist/entities/message-change.js +6 -0
  63. package/dist/errors/reasons.js +14 -0
  64. package/dist/kit/fake.d.ts +2 -2
  65. package/dist/kit/fake.js +21 -0
  66. package/dist/manifest/index.d.ts +21 -7
  67. package/dist/manifest/index.js +7 -4
  68. package/dist/mcp/surface.js +6 -3
  69. package/dist/ports/messenger.d.ts +20 -1
  70. package/dist/sends/permissions.js +11 -1
  71. package/dist/services/documents/mirrors.d.ts +13 -1
  72. package/dist/services/documents/mirrors.js +12 -3
  73. package/dist/services/files/mirror.d.ts +20 -8
  74. package/dist/services/files/mirror.js +84 -27
  75. package/dist/services/files/versions.d.ts +17 -7
  76. package/dist/services/files/versions.js +56 -21
  77. package/dist/services/messages.d.ts +31 -0
  78. package/dist/services/messages.js +62 -0
  79. package/dist/store/exports.d.ts +1 -0
  80. package/dist/store/exports.js +1 -0
  81. package/dist/store/recover.js +2 -0
  82. package/dist/store/sqlite/account-purge.js +7 -0
  83. package/dist/store/sqlite/content.d.ts +100 -0
  84. package/dist/store/sqlite/content.js +375 -0
  85. package/dist/store/sqlite/entity-types.d.ts +1 -0
  86. package/dist/store/sqlite/entity-types.js +1 -0
  87. package/dist/store/sqlite/manifest.js +2 -0
  88. package/dist/store/sqlite/migrations.generated.js +26 -0
  89. package/dist/store/sqlite/schema.d.ts +1140 -0
  90. package/dist/store/sqlite/schema.js +100 -0
  91. package/dist/store/store.d.ts +3 -0
  92. package/dist/store/store.js +5 -0
  93. package/package.json +12 -4
@@ -0,0 +1,102 @@
1
+ /**
2
+ * What a blog or a social account publishes, as the store copies it (WordPress first, then Ghost and social posts):
3
+ * the authors, the tags and categories, and the posts and pages. Authors and terms come before the posts that name
4
+ * them. The channel a post is published on (a site, a social account) is read on its own, not as a changes kind.
5
+ */
6
+ export declare const CONTENT_KINDS: readonly ["author", "term", "post"];
7
+ export type ContentKind = (typeof CONTENT_KINDS)[number];
8
+ /** Where a post stands. A trashed post still exists at the source: only a post gone from every list is deleted. */
9
+ export declare const POST_STATUSES: readonly ["draft", "pending", "scheduled", "published", "private", "trashed"];
10
+ export type PostStatus = (typeof POST_STATUSES)[number];
11
+ export declare const POST_TYPES: readonly ["post", "page"];
12
+ export type PostType = (typeof POST_TYPES)[number];
13
+ export declare const CHANNEL_KINDS: readonly ["blog", "social", "newsletter"];
14
+ export type ChannelKind = (typeof CHANNEL_KINDS)[number];
15
+ export declare const TERM_KINDS: readonly ["tag", "category"];
16
+ export type TermKind = (typeof TERM_KINDS)[number];
17
+ /**
18
+ * Every record has the source's id. A field left out means the source did not say, and the store keeps what it
19
+ * held; `null` means the source said there is none. Times are epoch milliseconds.
20
+ */
21
+ interface ContentRecord {
22
+ externalId: string;
23
+ createdAt?: number | null;
24
+ updatedAt?: number | null;
25
+ }
26
+ /** A site or a social account. Two profiles on one site read one channel. */
27
+ export interface ContentChannel {
28
+ externalId: string;
29
+ kind: ChannelKind;
30
+ /** `wordpress`, `ghost`, `linkedin`, `linkedin-page`, `x`. */
31
+ network: string;
32
+ name: string;
33
+ /** The site's address: a sync holds its deletions when it changes, as a moved root would empty the copy. */
34
+ url?: string | null;
35
+ handle?: string | null;
36
+ }
37
+ export interface ContentAuthor extends ContentRecord {
38
+ name: string;
39
+ /** How the store joins the author to a person it already knows: by this exact address, when read. */
40
+ email?: string | null;
41
+ slug?: string | null;
42
+ }
43
+ /** A tag or a category of the source; the store tags a post with the shared tag of the same name. */
44
+ export interface ContentTerm extends ContentRecord {
45
+ kind: TermKind;
46
+ name: string;
47
+ slug?: string | null;
48
+ parent?: string | null;
49
+ }
50
+ export interface ContentMedia {
51
+ externalId?: string | null;
52
+ url: string;
53
+ mime?: string | null;
54
+ alt?: string | null;
55
+ }
56
+ export interface ContentPost extends ContentRecord {
57
+ /** The channel's id; left out, the account's only channel. */
58
+ channel?: string | null;
59
+ type?: PostType;
60
+ /** A social post has none. */
61
+ title?: string | null;
62
+ /** Markdown. */
63
+ body?: string | null;
64
+ /**
65
+ * The source's text holds markup Markdown cannot keep (blocks, embeds, frames): writing the body back would flatten
66
+ * it, so a write of the body needs the owner's `--replace-body`.
67
+ */
68
+ lossy?: boolean | null;
69
+ excerpt?: string | null;
70
+ status: PostStatus;
71
+ url?: string | null;
72
+ slug?: string | null;
73
+ publishedAt?: number | null;
74
+ /** When a scheduled post goes out. */
75
+ scheduledFor?: number | null;
76
+ /** Authors' ids. */
77
+ authors?: string[];
78
+ /** Terms' ids. */
79
+ terms?: string[];
80
+ media?: ContentMedia[];
81
+ /** The post this one is a part of: one text sent to several social channels. */
82
+ parent?: string | null;
83
+ /** The source's own mark of this version, sent back with a write so a change made elsewhere is not overwritten. */
84
+ version?: string | null;
85
+ }
86
+ export interface ContentRecords {
87
+ author: ContentAuthor;
88
+ term: ContentTerm;
89
+ post: ContentPost;
90
+ }
91
+ /** One reading of a post's numbers; each reading is kept, never overwritten. A number the source lacks is absent. */
92
+ export interface ContentMetric {
93
+ post: string;
94
+ at: number;
95
+ views?: number | null;
96
+ reactions?: number | null;
97
+ comments?: number | null;
98
+ shares?: number | null;
99
+ clicks?: number | null;
100
+ raw?: Record<string, unknown>;
101
+ }
102
+ export {};
@@ -0,0 +1,11 @@
1
+ /**
2
+ * What a blog or a social account publishes, as the store copies it (WordPress first, then Ghost and social posts):
3
+ * the authors, the tags and categories, and the posts and pages. Authors and terms come before the posts that name
4
+ * them. The channel a post is published on (a site, a social account) is read on its own, not as a changes kind.
5
+ */
6
+ export const CONTENT_KINDS = ["author", "term", "post"];
7
+ /** Where a post stands. A trashed post still exists at the source: only a post gone from every list is deleted. */
8
+ export const POST_STATUSES = ["draft", "pending", "scheduled", "published", "private", "trashed"];
9
+ export const POST_TYPES = ["post", "page"];
10
+ export const CHANNEL_KINDS = ["blog", "social", "newsletter"];
11
+ export const TERM_KINDS = ["tag", "category"];
@@ -52,7 +52,7 @@ import { member } from "./member.js";
52
52
  import { memory } from "./memory.js";
53
53
  import { mention, mentionDecision, mentionDetails, mentionDomain, mentionRebuild, place } from "./mention.js";
54
54
  import { message } from "./message.js";
55
- import { messageDeletion, messagePin, messageStar } from "./message-change.js";
55
+ import { messageDeletion, messagePin, messageStar, scheduledCancellation, scheduledSend } from "./message-change.js";
56
56
  import { messageContext } from "./message-context.js";
57
57
  import { messageCounts } from "./message-counts.js";
58
58
  import { messageLink } from "./message-link.js";
@@ -92,7 +92,7 @@ import { topic } from "./topic.js";
92
92
  * subset of its fields, never a renamed one. Commands move onto these one by one; until then, a schema
93
93
  * is the target, not a description of today's output.
94
94
  */
95
- export { account, accountChange, accountPrivacy, accountPrivacyChange, accountProfile, accountSession, adminReport, agenda, analysisConsent, analysisConsentRevocation, attachment, attachmentBytes, attachmentExtraction, attachmentTextChange, automaticTags, botAdmin, botMenuEntry, botProfile, botSeenChat, botTemplate, botWebhook, cachedChatMetadata, callRecord, chart, chat, chatAdminChange, chatArchive, chatCoverage, chatEvent, chatFolderChange, chatFolderOrder, chatFolderRemoval, chatGroupChange, chatInspection, chatInvite, chatInviteChange, chatMembersChange, chatMembersFetch, chatMetadata, chatMetadataRefresh, chatModeration, chatMuting, chatPin, chatRead, chatRemoval, chatRequestChange, chatRules, chatSender, chatSending, chatStats, chatTracking, chatUnread, contact, contactActivity, contactAlias, contactCheck, contactContext, contactImport, contactLookup, contactNote, contactNoteRemoval, contactPreparation, contactStateChange, contactSync, contactUpdate, conversation, conversationBatch, conversationBatchStatus, conversationBuildResult, conversationChange, conversationDetails, conversationEmbedding, conversationEmbeddingStatus, conversationHit, conversationPreparation, conversationReadiness, counterRefresh, counters, document, documentLink, endedAccountSessions, evidence, evidencePacket, fact, folder, hit, identity, imageEmbedding, inviteLink, job, joinRequest, linkedPerson, mailCounts, mediaArchive, mediaArchiveCheck, mediaArchiveMove, mediaArchiveTimer, meeting, meetingProjectCandidates, meetingSeriesInventory, member, memory, mention, mentionDecision, mentionDetails, mentionDomain, mentionRebuild, message, messageContext, messageCounts, messageDeletion, messageDownload, messageEvent, messageLink, messageLinks, messagePin, messageStar, messageSync, messageTranscript, messageWrite, model, modelKey, note, officialStats, organization, person, place, poll, pollChange, pollVote, project, ranking, reaction, reactionChange, recipient, recipientAdded, recipientChange, recipientOff, recipientRemoved, recordedRun, reference, relationship, reminder, removedModelKey, responseTimes, retention, runDetails, runHit, runLocation, savedSearch, scheduledJob, scheduleHarness, searchHistoryClear, sendAttempt, serveSummary, stickerInventory, storeBackup, storeChatStatus, storeCheck, storeClear, storeCopyRemoval, storeDecrypt, storedModelKey, storeExport, storeGapPlan, storeGapRepair, storeImport, storeInfo, storeJobCancel, storeJobClear, storeJobDetails, storeJobRetry, storeMigration, storeReindex, storeRepair, storeReset, storeRestore, storeTable, tagChange, tagging, task, taskAnalysis, taskAnalysisMark, taskCard, taskCategories, taskClosed, taskCreated, taskLinks, taskMerge, taskPair, taskScan, taskSimilar, taskStats, taskUnmerge, template, topic, topicIcon, trackedChat, trackedChatHistory, waitingChats, watchedMessage, watchItem, };
95
+ export { account, accountChange, accountPrivacy, accountPrivacyChange, accountProfile, accountSession, adminReport, agenda, analysisConsent, analysisConsentRevocation, attachment, attachmentBytes, attachmentExtraction, attachmentTextChange, automaticTags, botAdmin, botMenuEntry, botProfile, botSeenChat, botTemplate, botWebhook, cachedChatMetadata, callRecord, chart, chat, chatAdminChange, chatArchive, chatCoverage, chatEvent, chatFolderChange, chatFolderOrder, chatFolderRemoval, chatGroupChange, chatInspection, chatInvite, chatInviteChange, chatMembersChange, chatMembersFetch, chatMetadata, chatMetadataRefresh, chatModeration, chatMuting, chatPin, chatRead, chatRemoval, chatRequestChange, chatRules, chatSender, chatSending, chatStats, chatTracking, chatUnread, contact, contactActivity, contactAlias, contactCheck, contactContext, contactImport, contactLookup, contactNote, contactNoteRemoval, contactPreparation, contactStateChange, contactSync, contactUpdate, conversation, conversationBatch, conversationBatchStatus, conversationBuildResult, conversationChange, conversationDetails, conversationEmbedding, conversationEmbeddingStatus, conversationHit, conversationPreparation, conversationReadiness, counterRefresh, counters, document, documentLink, endedAccountSessions, evidence, evidencePacket, fact, folder, hit, identity, imageEmbedding, inviteLink, job, joinRequest, linkedPerson, mailCounts, mediaArchive, mediaArchiveCheck, mediaArchiveMove, mediaArchiveTimer, meeting, meetingProjectCandidates, meetingSeriesInventory, member, memory, mention, mentionDecision, mentionDetails, mentionDomain, mentionRebuild, message, messageContext, messageCounts, messageDeletion, messageDownload, messageEvent, messageLink, messageLinks, messagePin, messageStar, messageSync, messageTranscript, messageWrite, model, modelKey, note, officialStats, organization, person, place, poll, pollChange, pollVote, project, ranking, reaction, reactionChange, recipient, recipientAdded, recipientChange, recipientOff, recipientRemoved, recordedRun, reference, relationship, reminder, removedModelKey, responseTimes, retention, runDetails, runHit, runLocation, savedSearch, scheduledCancellation, scheduledJob, scheduledSend, scheduleHarness, searchHistoryClear, sendAttempt, serveSummary, stickerInventory, storeBackup, storeChatStatus, storeCheck, storeClear, storeCopyRemoval, storeDecrypt, storedModelKey, storeExport, storeGapPlan, storeGapRepair, storeImport, storeInfo, storeJobCancel, storeJobClear, storeJobDetails, storeJobRetry, storeMigration, storeReindex, storeRepair, storeReset, storeRestore, storeTable, tagChange, tagging, task, taskAnalysis, taskAnalysisMark, taskCard, taskCategories, taskClosed, taskCreated, taskLinks, taskMerge, taskPair, taskScan, taskSimilar, taskStats, taskUnmerge, template, topic, topicIcon, trackedChat, trackedChatHistory, waitingChats, watchedMessage, watchItem, };
96
96
  export declare const ENTITIES: {
97
97
  readonly meeting_change: v.StrictObjectSchema<{
98
98
  readonly action: v.PicklistSchema<["create", "update", "cancel"], undefined>;
@@ -2513,6 +2513,12 @@ export declare const ENTITIES: {
2513
2513
  readonly deleted: v.ArraySchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>, undefined>;
2514
2514
  readonly for_everyone: v.BooleanSchema<undefined>;
2515
2515
  }, undefined>;
2516
+ readonly scheduled_cancellation: v.StrictObjectSchema<{
2517
+ readonly operation_id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
2518
+ readonly chat_id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
2519
+ readonly cancelled: v.ArraySchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>, undefined>;
2520
+ }, undefined>;
2521
+ readonly scheduled_send: v.StrictObjectSchema<import("./message-change.js").ScheduledSendEntries, undefined>;
2516
2522
  readonly message_transcript: v.StrictObjectSchema<{
2517
2523
  readonly message_id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
2518
2524
  readonly text: v.StringSchema<undefined>;
@@ -61,7 +61,7 @@ import { member } from "./member.js";
61
61
  import { memory } from "./memory.js";
62
62
  import { mention, mentionDecision, mentionDetails, mentionDomain, mentionRebuild, place } from "./mention.js";
63
63
  import { message } from "./message.js";
64
- import { messageDeletion, messagePin, messageStar } from "./message-change.js";
64
+ import { messageDeletion, messagePin, messageStar, scheduledCancellation, scheduledSend } from "./message-change.js";
65
65
  import { messageContext } from "./message-context.js";
66
66
  import { messageCounts } from "./message-counts.js";
67
67
  import { messageLink } from "./message-link.js";
@@ -101,7 +101,7 @@ import { topic } from "./topic.js";
101
101
  * subset of its fields, never a renamed one. Commands move onto these one by one; until then, a schema
102
102
  * is the target, not a description of today's output.
103
103
  */
104
- export { account, accountChange, accountPrivacy, accountPrivacyChange, accountProfile, accountSession, adminReport, agenda, analysisConsent, analysisConsentRevocation, attachment, attachmentBytes, attachmentExtraction, attachmentTextChange, automaticTags, botAdmin, botMenuEntry, botProfile, botSeenChat, botTemplate, botWebhook, cachedChatMetadata, callRecord, chart, chat, chatAdminChange, chatArchive, chatCoverage, chatEvent, chatFolderChange, chatFolderOrder, chatFolderRemoval, chatGroupChange, chatInspection, chatInvite, chatInviteChange, chatMembersChange, chatMembersFetch, chatMetadata, chatMetadataRefresh, chatModeration, chatMuting, chatPin, chatRead, chatRemoval, chatRequestChange, chatRules, chatSender, chatSending, chatStats, chatTracking, chatUnread, contact, contactActivity, contactAlias, contactCheck, contactContext, contactImport, contactLookup, contactNote, contactNoteRemoval, contactPreparation, contactStateChange, contactSync, contactUpdate, conversation, conversationBatch, conversationBatchStatus, conversationBuildResult, conversationChange, conversationDetails, conversationEmbedding, conversationEmbeddingStatus, conversationHit, conversationPreparation, conversationReadiness, counterRefresh, counters, document, documentLink, endedAccountSessions, evidence, evidencePacket, fact, folder, hit, identity, imageEmbedding, inviteLink, job, joinRequest, linkedPerson, mailCounts, mediaArchive, mediaArchiveCheck, mediaArchiveMove, mediaArchiveTimer, meeting, meetingProjectCandidates, meetingSeriesInventory, member, memory, mention, mentionDecision, mentionDetails, mentionDomain, mentionRebuild, message, messageContext, messageCounts, messageDeletion, messageDownload, messageEvent, messageLink, messageLinks, messagePin, messageStar, messageSync, messageTranscript, messageWrite, model, modelKey, note, officialStats, organization, person, place, poll, pollChange, pollVote, project, ranking, reaction, reactionChange, recipient, recipientAdded, recipientChange, recipientOff, recipientRemoved, recordedRun, reference, relationship, reminder, removedModelKey, responseTimes, retention, runDetails, runHit, runLocation, savedSearch, scheduledJob, scheduleHarness, searchHistoryClear, sendAttempt, serveSummary, stickerInventory, storeBackup, storeChatStatus, storeCheck, storeClear, storeCopyRemoval, storeDecrypt, storedModelKey, storeExport, storeGapPlan, storeGapRepair, storeImport, storeInfo, storeJobCancel, storeJobClear, storeJobDetails, storeJobRetry, storeMigration, storeReindex, storeRepair, storeReset, storeRestore, storeTable, tagChange, tagging, task, taskAnalysis, taskAnalysisMark, taskCard, taskCategories, taskClosed, taskCreated, taskLinks, taskMerge, taskPair, taskScan, taskSimilar, taskStats, taskUnmerge, template, topic, topicIcon, trackedChat, trackedChatHistory, waitingChats, watchedMessage, watchItem, };
104
+ export { account, accountChange, accountPrivacy, accountPrivacyChange, accountProfile, accountSession, adminReport, agenda, analysisConsent, analysisConsentRevocation, attachment, attachmentBytes, attachmentExtraction, attachmentTextChange, automaticTags, botAdmin, botMenuEntry, botProfile, botSeenChat, botTemplate, botWebhook, cachedChatMetadata, callRecord, chart, chat, chatAdminChange, chatArchive, chatCoverage, chatEvent, chatFolderChange, chatFolderOrder, chatFolderRemoval, chatGroupChange, chatInspection, chatInvite, chatInviteChange, chatMembersChange, chatMembersFetch, chatMetadata, chatMetadataRefresh, chatModeration, chatMuting, chatPin, chatRead, chatRemoval, chatRequestChange, chatRules, chatSender, chatSending, chatStats, chatTracking, chatUnread, contact, contactActivity, contactAlias, contactCheck, contactContext, contactImport, contactLookup, contactNote, contactNoteRemoval, contactPreparation, contactStateChange, contactSync, contactUpdate, conversation, conversationBatch, conversationBatchStatus, conversationBuildResult, conversationChange, conversationDetails, conversationEmbedding, conversationEmbeddingStatus, conversationHit, conversationPreparation, conversationReadiness, counterRefresh, counters, document, documentLink, endedAccountSessions, evidence, evidencePacket, fact, folder, hit, identity, imageEmbedding, inviteLink, job, joinRequest, linkedPerson, mailCounts, mediaArchive, mediaArchiveCheck, mediaArchiveMove, mediaArchiveTimer, meeting, meetingProjectCandidates, meetingSeriesInventory, member, memory, mention, mentionDecision, mentionDetails, mentionDomain, mentionRebuild, message, messageContext, messageCounts, messageDeletion, messageDownload, messageEvent, messageLink, messageLinks, messagePin, messageStar, messageSync, messageTranscript, messageWrite, model, modelKey, note, officialStats, organization, person, place, poll, pollChange, pollVote, project, ranking, reaction, reactionChange, recipient, recipientAdded, recipientChange, recipientOff, recipientRemoved, recordedRun, reference, relationship, reminder, removedModelKey, responseTimes, retention, runDetails, runHit, runLocation, savedSearch, scheduledCancellation, scheduledJob, scheduledSend, scheduleHarness, searchHistoryClear, sendAttempt, serveSummary, stickerInventory, storeBackup, storeChatStatus, storeCheck, storeClear, storeCopyRemoval, storeDecrypt, storedModelKey, storeExport, storeGapPlan, storeGapRepair, storeImport, storeInfo, storeJobCancel, storeJobClear, storeJobDetails, storeJobRetry, storeMigration, storeReindex, storeRepair, storeReset, storeRestore, storeTable, tagChange, tagging, task, taskAnalysis, taskAnalysisMark, taskCard, taskCategories, taskClosed, taskCreated, taskLinks, taskMerge, taskPair, taskScan, taskSimilar, taskStats, taskUnmerge, template, topic, topicIcon, trackedChat, trackedChatHistory, waitingChats, watchedMessage, watchItem, };
105
105
  export const ENTITIES = {
106
106
  sync_progress: syncProgress,
107
107
  deal,
@@ -157,6 +157,8 @@ export const ENTITIES = {
157
157
  message_pin: messagePin,
158
158
  message_star: messageStar,
159
159
  message_deletion: messageDeletion,
160
+ scheduled_cancellation: scheduledCancellation,
161
+ scheduled_send: scheduledSend,
160
162
  message_transcript: messageTranscript,
161
163
  message_links: messageLinks,
162
164
  evidence_packet: evidencePacket,
@@ -17,3 +17,243 @@ export declare const messageDeletion: v.StrictObjectSchema<{
17
17
  readonly deleted: v.ArraySchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>, undefined>;
18
18
  readonly for_everyone: v.BooleanSchema<undefined>;
19
19
  }, undefined>;
20
+ /** Scheduled ids, which are never the ids of sent messages. */
21
+ export declare const scheduledCancellation: v.StrictObjectSchema<{
22
+ readonly operation_id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
23
+ readonly chat_id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
24
+ readonly cancelled: v.ArraySchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>, undefined>;
25
+ }, undefined>;
26
+ declare const scheduledSendEntries: {
27
+ operation_id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
28
+ chat_id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
29
+ sent: v.ArraySchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>, undefined>;
30
+ messages: v.ArraySchema<v.StrictObjectSchema<{
31
+ readonly ref: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "a reference such as `note:42`">]>;
32
+ readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
33
+ readonly provider: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
34
+ readonly account: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
35
+ readonly chat_id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
36
+ readonly chat_title: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
37
+ readonly sender_id: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>, undefined>;
38
+ readonly sender_name: v.NullableSchema<v.StringSchema<undefined>, undefined>;
39
+ readonly sender_username: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
40
+ readonly sender_is_chat: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
41
+ readonly sender_is_me: v.BooleanSchema<undefined>;
42
+ readonly mentions: v.OptionalSchema<v.ArraySchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>, undefined>, undefined>;
43
+ readonly timestamp: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, "an ISO 8601 time in UTC">, v.EndsWithAction<string, "Z", "an ISO 8601 time in UTC, ending in `Z`">]>;
44
+ readonly edited_at: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, "an ISO 8601 time in UTC">, v.EndsWithAction<string, "Z", "an ISO 8601 time in UTC, ending in `Z`">]>, undefined>;
45
+ readonly text: v.StringSchema<undefined>;
46
+ readonly transcript: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
47
+ readonly anchor: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
48
+ readonly excerpt: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
49
+ readonly matched_in: v.OptionalSchema<v.PicklistSchema<["text", "transcript", "filename", "file", "context", "picture"], undefined>, undefined>;
50
+ readonly score: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
51
+ readonly match: v.OptionalSchema<v.PicklistSchema<["words", "beginnings", "corrected"], undefined>, undefined>;
52
+ readonly corrections: v.OptionalSchema<v.ArraySchema<v.StrictObjectSchema<{
53
+ readonly from: v.StringSchema<undefined>;
54
+ readonly to: v.ArraySchema<v.StringSchema<undefined>, undefined>;
55
+ }, undefined>, undefined>, undefined>;
56
+ readonly found_in: v.OptionalSchema<v.PicklistSchema<["archive", "server", "both"], undefined>, undefined>;
57
+ readonly discovery: v.OptionalSchema<v.StrictObjectSchema<{
58
+ readonly coverage: v.NumberSchema<undefined>;
59
+ readonly matched_terms: v.ArraySchema<v.StringSchema<undefined>, undefined>;
60
+ readonly missing_terms: v.ArraySchema<v.StringSchema<undefined>, undefined>;
61
+ readonly parent: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "a reference such as `note:42`">]>, undefined>;
62
+ readonly found_by: v.OptionalSchema<v.ArraySchema<v.PicklistSchema<["words", "meaning"], undefined>, undefined>, undefined>;
63
+ readonly reranker_score: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
64
+ }, undefined>, undefined>;
65
+ readonly context: v.OptionalSchema<v.ArraySchema<v.StrictObjectSchema<{
66
+ readonly ref: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "a reference such as `note:42`">]>;
67
+ readonly timestamp: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, "an ISO 8601 time in UTC">, v.EndsWithAction<string, "Z", "an ISO 8601 time in UTC, ending in `Z`">]>;
68
+ readonly sender_name: v.NullableSchema<v.StringSchema<undefined>, undefined>;
69
+ readonly text: v.StringSchema<undefined>;
70
+ }, undefined>, undefined>, undefined>;
71
+ readonly follow_ups: v.OptionalSchema<v.ArraySchema<v.StrictObjectSchema<{
72
+ readonly ref: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "a reference such as `note:42`">]>;
73
+ readonly chat_title: v.NullableSchema<v.StringSchema<undefined>, undefined>;
74
+ readonly timestamp: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, "an ISO 8601 time in UTC">, v.EndsWithAction<string, "Z", "an ISO 8601 time in UTC, ending in `Z`">]>;
75
+ readonly sender_name: v.NullableSchema<v.StringSchema<undefined>, undefined>;
76
+ readonly excerpt: v.StringSchema<undefined>;
77
+ }, undefined>, undefined>, undefined>;
78
+ readonly outgoing: v.NullableSchema<v.BooleanSchema<undefined>, undefined>;
79
+ readonly attachments: v.ArraySchema<v.StrictObjectSchema<{
80
+ readonly message: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "a reference such as `note:42`">]>, undefined>;
81
+ readonly kind: v.StringSchema<undefined>;
82
+ readonly position: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, undefined>;
83
+ readonly url: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
84
+ readonly name: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
85
+ readonly title: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
86
+ readonly mime: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
87
+ readonly size: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, undefined>;
88
+ readonly width: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, undefined>;
89
+ readonly height: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, undefined>;
90
+ readonly duration: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
91
+ readonly text: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
92
+ readonly extraction: v.OptionalSchema<v.StrictObjectSchema<{
93
+ readonly origin: v.StringSchema<undefined>;
94
+ readonly extractor: v.StringSchema<undefined>;
95
+ readonly chars: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
96
+ readonly error: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
97
+ }, undefined>, undefined>;
98
+ readonly local_path: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
99
+ readonly contact: v.OptionalSchema<v.StrictObjectSchema<{
100
+ readonly name: v.StringSchema<undefined>;
101
+ readonly first_name: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
102
+ readonly last_name: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
103
+ readonly phone: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
104
+ readonly user_id: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>, undefined>;
105
+ }, undefined>, undefined>;
106
+ readonly buttons: v.OptionalSchema<v.ArraySchema<v.ArraySchema<v.StrictObjectSchema<{
107
+ readonly kind: v.PicklistSchema<["callback", "link", "message", "chat", "contact", "location", "app", "clipboard", "other"], undefined>;
108
+ readonly text: v.StringSchema<undefined>;
109
+ readonly url: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
110
+ }, undefined>, undefined>, undefined>, undefined>;
111
+ }, undefined>, undefined>;
112
+ readonly reply_to: v.NullableSchema<v.StrictObjectSchema<{
113
+ readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
114
+ readonly sender_id: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>, undefined>;
115
+ readonly sender_name: v.NullableSchema<v.StringSchema<undefined>, undefined>;
116
+ readonly timestamp: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, "an ISO 8601 time in UTC">, v.EndsWithAction<string, "Z", "an ISO 8601 time in UTC, ending in `Z`">]>, undefined>;
117
+ readonly text: v.StringSchema<undefined>;
118
+ readonly attachments: v.ArraySchema<v.StrictObjectSchema<{
119
+ readonly message: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "a reference such as `note:42`">]>, undefined>;
120
+ readonly kind: v.StringSchema<undefined>;
121
+ readonly position: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, undefined>;
122
+ readonly url: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
123
+ readonly name: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
124
+ readonly title: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
125
+ readonly mime: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
126
+ readonly size: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, undefined>;
127
+ readonly width: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, undefined>;
128
+ readonly height: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, undefined>;
129
+ readonly duration: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
130
+ readonly text: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
131
+ readonly extraction: v.OptionalSchema<v.StrictObjectSchema<{
132
+ readonly origin: v.StringSchema<undefined>;
133
+ readonly extractor: v.StringSchema<undefined>;
134
+ readonly chars: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
135
+ readonly error: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
136
+ }, undefined>, undefined>;
137
+ readonly local_path: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
138
+ readonly contact: v.OptionalSchema<v.StrictObjectSchema<{
139
+ readonly name: v.StringSchema<undefined>;
140
+ readonly first_name: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
141
+ readonly last_name: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
142
+ readonly phone: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
143
+ readonly user_id: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>, undefined>;
144
+ }, undefined>, undefined>;
145
+ readonly buttons: v.OptionalSchema<v.ArraySchema<v.ArraySchema<v.StrictObjectSchema<{
146
+ readonly kind: v.PicklistSchema<["callback", "link", "message", "chat", "contact", "location", "app", "clipboard", "other"], undefined>;
147
+ readonly text: v.StringSchema<undefined>;
148
+ readonly url: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
149
+ }, undefined>, undefined>, undefined>, undefined>;
150
+ }, undefined>, undefined>;
151
+ readonly outgoing: v.NullableSchema<v.BooleanSchema<undefined>, undefined>;
152
+ }, undefined>, undefined>;
153
+ readonly reply_to_id: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>, undefined>;
154
+ readonly forwarded_from: v.NullableSchema<v.StrictObjectSchema<{
155
+ readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
156
+ readonly sender_id: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>, undefined>;
157
+ readonly sender_name: v.NullableSchema<v.StringSchema<undefined>, undefined>;
158
+ readonly timestamp: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, "an ISO 8601 time in UTC">, v.EndsWithAction<string, "Z", "an ISO 8601 time in UTC, ending in `Z`">]>, undefined>;
159
+ readonly text: v.StringSchema<undefined>;
160
+ readonly attachments: v.ArraySchema<v.StrictObjectSchema<{
161
+ readonly message: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "a reference such as `note:42`">]>, undefined>;
162
+ readonly kind: v.StringSchema<undefined>;
163
+ readonly position: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, undefined>;
164
+ readonly url: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
165
+ readonly name: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
166
+ readonly title: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
167
+ readonly mime: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
168
+ readonly size: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, undefined>;
169
+ readonly width: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, undefined>;
170
+ readonly height: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, undefined>;
171
+ readonly duration: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
172
+ readonly text: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
173
+ readonly extraction: v.OptionalSchema<v.StrictObjectSchema<{
174
+ readonly origin: v.StringSchema<undefined>;
175
+ readonly extractor: v.StringSchema<undefined>;
176
+ readonly chars: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
177
+ readonly error: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
178
+ }, undefined>, undefined>;
179
+ readonly local_path: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
180
+ readonly contact: v.OptionalSchema<v.StrictObjectSchema<{
181
+ readonly name: v.StringSchema<undefined>;
182
+ readonly first_name: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
183
+ readonly last_name: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
184
+ readonly phone: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
185
+ readonly user_id: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>, undefined>;
186
+ }, undefined>, undefined>;
187
+ readonly buttons: v.OptionalSchema<v.ArraySchema<v.ArraySchema<v.StrictObjectSchema<{
188
+ readonly kind: v.PicklistSchema<["callback", "link", "message", "chat", "contact", "location", "app", "clipboard", "other"], undefined>;
189
+ readonly text: v.StringSchema<undefined>;
190
+ readonly url: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
191
+ }, undefined>, undefined>, undefined>, undefined>;
192
+ }, undefined>, undefined>;
193
+ readonly outgoing: v.NullableSchema<v.BooleanSchema<undefined>, undefined>;
194
+ }, undefined>, undefined>;
195
+ readonly thread_id: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>, undefined>;
196
+ readonly thread_root_id: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>, undefined>;
197
+ readonly reactions: v.OptionalSchema<v.NullableSchema<v.StrictObjectSchema<{
198
+ readonly counts: v.ArraySchema<v.StrictObjectSchema<{
199
+ readonly reaction: v.StringSchema<undefined>;
200
+ readonly count: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
201
+ }, undefined>, undefined>;
202
+ readonly mine: v.NullableSchema<v.StringSchema<undefined>, undefined>;
203
+ readonly total: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
204
+ }, undefined>, undefined>, undefined>;
205
+ readonly scheduled_for: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, "an ISO 8601 time in UTC">, v.EndsWithAction<string, "Z", "an ISO 8601 time in UTC, ending in `Z`">]>, undefined>;
206
+ readonly starred: v.OptionalSchema<v.LiteralSchema<true, undefined>, undefined>;
207
+ readonly delivery: v.OptionalSchema<v.PicklistSchema<["delivered", "read"], undefined>, undefined>;
208
+ readonly email: v.OptionalSchema<v.StrictObjectSchema<{
209
+ readonly subject: v.NullableSchema<v.StringSchema<undefined>, undefined>;
210
+ readonly from: v.NullableSchema<v.StrictObjectSchema<{
211
+ readonly name: v.NullableSchema<v.StringSchema<undefined>, undefined>;
212
+ readonly address: v.StringSchema<undefined>;
213
+ readonly ref: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "a reference such as `note:42`">]>, undefined>;
214
+ }, undefined>, undefined>;
215
+ readonly to: v.ArraySchema<v.StrictObjectSchema<{
216
+ readonly name: v.NullableSchema<v.StringSchema<undefined>, undefined>;
217
+ readonly address: v.StringSchema<undefined>;
218
+ readonly ref: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "a reference such as `note:42`">]>, undefined>;
219
+ }, undefined>, undefined>;
220
+ readonly cc: v.ArraySchema<v.StrictObjectSchema<{
221
+ readonly name: v.NullableSchema<v.StringSchema<undefined>, undefined>;
222
+ readonly address: v.StringSchema<undefined>;
223
+ readonly ref: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "a reference such as `note:42`">]>, undefined>;
224
+ }, undefined>, undefined>;
225
+ readonly bcc: v.ArraySchema<v.StrictObjectSchema<{
226
+ readonly name: v.NullableSchema<v.StringSchema<undefined>, undefined>;
227
+ readonly address: v.StringSchema<undefined>;
228
+ readonly ref: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "a reference such as `note:42`">]>, undefined>;
229
+ }, undefined>, undefined>;
230
+ readonly reply_addresses: v.ArraySchema<v.StrictObjectSchema<{
231
+ readonly name: v.NullableSchema<v.StringSchema<undefined>, undefined>;
232
+ readonly address: v.StringSchema<undefined>;
233
+ readonly ref: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "a reference such as `note:42`">]>, undefined>;
234
+ }, undefined>, undefined>;
235
+ readonly labels: v.ArraySchema<v.StringSchema<undefined>, undefined>;
236
+ readonly thread: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "a reference such as `note:42`">]>;
237
+ readonly read: v.NullableSchema<v.BooleanSchema<undefined>, undefined>;
238
+ readonly flagged: v.NullableSchema<v.BooleanSchema<undefined>, undefined>;
239
+ readonly sender_score: v.OptionalSchema<v.StrictObjectSchema<{
240
+ readonly score: v.NumberSchema<undefined>;
241
+ readonly signals: v.ArraySchema<v.StringSchema<undefined>, undefined>;
242
+ readonly demoted: v.OptionalSchema<v.LiteralSchema<true, undefined>, undefined>;
243
+ }, undefined>, undefined>;
244
+ readonly bulk: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
245
+ readonly list_id: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
246
+ readonly rule_id: v.OptionalSchema<v.NullableSchema<v.NumberSchema<undefined>, undefined>, undefined>;
247
+ readonly fingerprint: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>]>, undefined>;
248
+ readonly new_sender: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
249
+ readonly sender_identities: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
250
+ }, undefined>, undefined>;
251
+ readonly provider_metadata: v.OptionalSchema<v.RecordSchema<v.StringSchema<undefined>, v.UnknownSchema, undefined>, undefined>;
252
+ }, undefined>, undefined>;
253
+ };
254
+ type ScheduledSendEntriesOf = typeof scheduledSendEntries;
255
+ export interface ScheduledSendEntries extends ScheduledSendEntriesOf {
256
+ }
257
+ /** `sent` holds the scheduled ids; `messages` the messages as sent, with their new ids. */
258
+ export declare const scheduledSend: v.StrictObjectSchema<ScheduledSendEntries, undefined>;
259
+ export {};
@@ -1,6 +1,12 @@
1
1
  import * as v from "valibot";
2
2
  import { id } from "./fields.js";
3
+ import { message } from "./message.js";
3
4
  const operated = { operation_id: id, chat_id: id };
4
5
  export const messagePin = v.strictObject({ ...operated, message_id: id, pinned: v.boolean() });
5
6
  export const messageStar = v.strictObject({ ...operated, message_id: id, starred: v.boolean() });
6
7
  export const messageDeletion = v.strictObject({ ...operated, deleted: v.array(id), for_everyone: v.boolean() });
8
+ /** Scheduled ids, which are never the ids of sent messages. */
9
+ export const scheduledCancellation = v.strictObject({ ...operated, cancelled: v.array(id) });
10
+ const scheduledSendEntries = { ...operated, sent: v.array(id), messages: v.array(message) };
11
+ /** `sent` holds the scheduled ids; `messages` the messages as sent, with their new ids. */
12
+ export const scheduledSend = v.strictObject(scheduledSendEntries);
@@ -226,6 +226,12 @@ const OTHERS = [
226
226
  "confirmation_required",
227
227
  "the sync would delete more files than the guard allows; check them with --dry-run and allow them explicitly",
228
228
  ],
229
+ [
230
+ "mirror.version-not-kept",
231
+ "provider_error",
232
+ "the earlier content could not be kept in the version store, so the sync did not replace it",
233
+ ],
234
+ ["mirror.remote-changed", "conflict", "the remote file changed since the listing; the next sync settles it"],
229
235
  ["upload.mismatch", "conflict", "the uploaded file reads back with other content; the local file changed meanwhile"],
230
236
  ["download.mismatch", "invalid_response", "the downloaded file has other content than the listing said"],
231
237
  ["catalog.unavailable", "configuration_error", "the store has no shared catalog for this account"],
@@ -497,6 +503,14 @@ const OTHERS = [
497
503
  validation("crm.write-unsupported", "the CRM does not take this write, or does not recognise a repeated one"),
498
504
  validation("crm.unlisted-held", "a list of every id would mark most of a kind deleted; nothing was, until --rescan"),
499
505
  validation("tracker.unlisted-held", "a tracker's id list would mark too much deleted, or the sign-in read only part; nothing was, until --rescan"),
506
+ validation("content.unlisted-held", "a content id list would mark too much deleted, the sign-in read only part, or the site moved; nothing was"),
507
+ validation("content.conflict", "the post changed at the source since the last sync; sync, then write again"),
508
+ validation("content.lossy-body", "the post's text holds blocks or embeds Markdown does not keep; --replace-body"),
509
+ validation("content.schedule-past", "a post is scheduled for a time to come, not one that passed"),
510
+ validation("content.already-published", "a published post cannot be scheduled; unpublish it first"),
511
+ validation("content.empty", "a write names no field to set"),
512
+ ["content.get-unsupported", "configuration_error", "the source cannot read one post, author or term by its id"],
513
+ validation("content.write-unsupported", "the source does not take this write, such as a deletion past the trash"),
500
514
  validation("crm.narrowing-held", "the default scope mine would mark most of a kind's stored rows deleted; none is, until the owner sets the scope"),
501
515
  validation("crm.unassigned-dropped", "the CRM does not let this sign-in choose a user in unassigned; that user's deals are not copied"),
502
516
  validation("crm.not-reported", "the CRM did not list users or departments; what they would say is unknown, nothing withdrawn"),
@@ -1,7 +1,7 @@
1
- import type { AccountEditing, AccountTools, ChatFolders, ChatReading, ContactBook, GroupAdmin, GroupModeration, LiveUpdates, MessageEditing, MessageMedia, MessagePins, MessagePolls, MessageReactions, MessageStars, MessengerCore, PassiveUpdates, PushedHistory, ReadState, ScheduledMessages, ServerReads, TopicReadState } from "../ports/messenger.js";
1
+ import type { AccountEditing, AccountTools, ChatFolders, ChatReading, ContactBook, GroupAdmin, GroupModeration, LiveUpdates, MessageEditing, MessageMedia, MessagePins, MessagePolls, MessageReactions, MessageStars, MessengerCore, PassiveUpdates, PushedHistory, ReadState, ScheduledChanges, ScheduledMessages, ServerReads, TopicReadState } from "../ports/messenger.js";
2
2
  import { type Seed } from "./seed.js";
3
3
  /** Every group of the port, over memory. */
4
- export type FakeAdapter = MessengerCore & ServerReads & ChatReading & MessageEditing & MessagePins & MessageStars & MessageReactions & ReadState & TopicReadState & MessagePolls & LiveUpdates & MessageMedia & ScheduledMessages & GroupModeration & AccountTools & GroupAdmin & ChatFolders & ContactBook & AccountEditing & Partial<PushedHistory> & Partial<PassiveUpdates>;
4
+ export type FakeAdapter = MessengerCore & ServerReads & ChatReading & MessageEditing & MessagePins & MessageStars & MessageReactions & ReadState & TopicReadState & MessagePolls & LiveUpdates & MessageMedia & ScheduledMessages & ScheduledChanges & GroupModeration & AccountTools & GroupAdmin & ChatFolders & ContactBook & AccountEditing & Partial<PushedHistory> & Partial<PassiveUpdates>;
5
5
  export declare const fakeAdapter: (seed?: Seed, options?: {
6
6
  feed?: boolean;
7
7
  listen?: boolean;
package/dist/kit/fake.js CHANGED
@@ -84,6 +84,12 @@ export const fakeAdapter = (seed = contractSeed(), options = {}) => {
84
84
  return pickChat(reference, state.chats);
85
85
  };
86
86
  const messagesOf = (chatId) => state.messages.filter((message) => message.chatId === chatId);
87
+ const scheduledAt = (chatId, id) => {
88
+ const at = scheduled.findIndex((message) => message.chatId === chatId && message.id === id);
89
+ if (at === -1)
90
+ throw missing(`scheduled message ${id} in chat ${chatId}`);
91
+ return at;
92
+ };
87
93
  const messageOf = (chatId, messageId) => {
88
94
  const found = state.messages.find((message) => message.chatId === chatId && message.id === messageId);
89
95
  if (!found)
@@ -360,6 +366,21 @@ export const fakeAdapter = (seed = contractSeed(), options = {}) => {
360
366
  const chat = chatOf(reference);
361
367
  return structuredClone(scheduled.filter((message) => message.chatId === chat.id));
362
368
  },
369
+ cancelScheduled: async (chatId, ids) => {
370
+ for (const id of ids)
371
+ scheduled.splice(scheduledAt(chatId, id), 1);
372
+ },
373
+ editScheduled: async (chatId, id, { text, at }) => {
374
+ const message = scheduled[scheduledAt(chatId, id)];
375
+ if (text !== undefined)
376
+ message.text = text;
377
+ message.scheduledFor = at;
378
+ return structuredClone(message);
379
+ },
380
+ sendScheduled: async (chatId, ids) => ids.map((id) => {
381
+ const [waiting] = scheduled.splice(scheduledAt(chatId, id), 1);
382
+ return structuredClone(post(chatOf(chatId), waiting.text, { attachments: waiting.attachments }));
383
+ }),
363
384
  members: async (reference, window) => {
364
385
  const chat = chatOf(reference);
365
386
  const ruling = admins.get(chat.id) ?? [];
@@ -1,3 +1,4 @@
1
+ import type { ContentManifest } from "../content/manifest/manifest.js";
1
2
  import type { CrmManifest } from "../crm/manifest/manifest.js";
2
3
  import type { OAuthProvider } from "../oauth/provider.js";
3
4
  import type { TrackerManifest } from "../tracker/manifest/manifest.js";
@@ -26,6 +27,14 @@ export type CliAuth = {
26
27
  preset: "token";
27
28
  verify?: CliVerify;
28
29
  }
30
+ /**
31
+ * A WordPress application password: the profile's own site (`--site host/blog`), a user name and the password, sent
32
+ * by Basic to that site alone.
33
+ */
34
+ | {
35
+ preset: "app-password";
36
+ verify?: CliVerify;
37
+ }
29
38
  /** The browser sign-in the spec's authorization code flow declares; the redirect is what the app registered. */
30
39
  | {
31
40
  preset: "oauth2-pkce";
@@ -38,7 +47,7 @@ export type CliAuth = {
38
47
  /** The provider sends a new refresh token on each refresh; the spec cannot say so. */
39
48
  rotating?: boolean;
40
49
  };
41
- export declare const CLI_CATEGORIES: readonly ["messenger", "mail", "notes", "files", "meetings", "calendar", "crm", "tracker", "other"];
50
+ export declare const CLI_CATEGORIES: readonly ["messenger", "mail", "notes", "files", "meetings", "calendar", "crm", "tracker", "content", "other"];
42
51
  export type CliCategory = (typeof CLI_CATEGORIES)[number];
43
52
  /** One file, `wirecat.config.ts`, that `new --from-config` builds a CLI from. */
44
53
  export interface CliConfig {
@@ -54,26 +63,31 @@ export interface CliConfig {
54
63
  /** The GitHub owner of the repository. */
55
64
  owner: string;
56
65
  };
57
- /** `from`: the https URL the description is published at. */
66
+ /**
67
+ * `from`: the https URL the description is published at. For `wp-json`, a WordPress site's REST index
68
+ * (`https://wp.example/wp-json/`), from a plain WordPress the CLI is made against, as it serves every site.
69
+ */
58
70
  spec: {
59
- kind: "openapi" | "swagger" | "graphql";
71
+ kind: "openapi" | "swagger" | "graphql" | "wp-json";
60
72
  from: string;
73
+ /** The WordPress version `from` runs, for the snapshot's provenance: the index does not say it. */
74
+ version?: string;
61
75
  };
62
76
  auth: CliAuth;
63
77
  /** cli-template's `--category`; `other` is any API outside them. */
64
78
  category: CliCategory;
65
79
  /**
66
- * A crm or tracker CLI's source; checked against the generated API by `parseCrmManifest` or `parseTrackerManifest`
67
- * once the api group exists.
80
+ * A crm, tracker or content CLI's source; checked against the generated API by `parseCrmManifest`,
81
+ * `parseTrackerManifest` or `parseContentManifest` once the api group exists.
68
82
  */
69
- source?: CrmManifest | TrackerManifest;
83
+ source?: CrmManifest | TrackerManifest | ContentManifest;
70
84
  /** The module of named hooks, relative to the config: `./src/hooks.ts`. */
71
85
  hooks?: string;
72
86
  }
73
87
  /** Types the config in the editor; it returns what it is given. */
74
88
  export declare const defineCli: (config: CliConfig) => CliConfig;
75
89
  /**
76
- * The config checked against its shape; every error names where it is. A crm or tracker CLI needs its source. `source` comes back
90
+ * The config checked against its shape; every error names where it is. A crm, tracker or content CLI needs its source. `source` comes back
77
91
  * unchecked: `parseCrmManifest` checks it against the generated API.
78
92
  */
79
93
  export declare const parseCliConfig: (input: unknown) => CliConfig;