plogme 1.0.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 (154) hide show
  1. package/LICENSE +61 -0
  2. package/README.md +212 -0
  3. package/WAProto/V +1 -0
  4. package/WAProto/WAProto.proto +8051 -0
  5. package/WAProto/index.js +289292 -0
  6. package/engine-requirements.js +51 -0
  7. package/lib/Defaults/ban-checker.js +44 -0
  8. package/lib/Defaults/index.js +158 -0
  9. package/lib/Signal/Group/ciphertext-message.js +11 -0
  10. package/lib/Signal/Group/group-session-builder.js +29 -0
  11. package/lib/Signal/Group/group_cipher.js +81 -0
  12. package/lib/Signal/Group/index.js +11 -0
  13. package/lib/Signal/Group/keyhelper.js +17 -0
  14. package/lib/Signal/Group/sender-chain-key.js +25 -0
  15. package/lib/Signal/Group/sender-key-distribution-message.js +62 -0
  16. package/lib/Signal/Group/sender-key-message.js +65 -0
  17. package/lib/Signal/Group/sender-key-name.js +47 -0
  18. package/lib/Signal/Group/sender-key-record.js +40 -0
  19. package/lib/Signal/Group/sender-key-state.js +83 -0
  20. package/lib/Signal/Group/sender-message-key.js +25 -0
  21. package/lib/Signal/libsignal.js +428 -0
  22. package/lib/Signal/lid-mapping.js +280 -0
  23. package/lib/Socket/Client/index.js +2 -0
  24. package/lib/Socket/Client/types.js +10 -0
  25. package/lib/Socket/Client/websocket.js +53 -0
  26. package/lib/Socket/aigroups.js +315 -0
  27. package/lib/Socket/ban-checker.js +153 -0
  28. package/lib/Socket/business.js +407 -0
  29. package/lib/Socket/chats.js +1831 -0
  30. package/lib/Socket/chats.js[old] +1227 -0
  31. package/lib/Socket/communities.js +431 -0
  32. package/lib/Socket/graphql.js +899 -0
  33. package/lib/Socket/groups.js +549 -0
  34. package/lib/Socket/groups.js[old] +347 -0
  35. package/lib/Socket/index.js +71 -0
  36. package/lib/Socket/interactive-handler.js +600 -0
  37. package/lib/Socket/interop.js +563 -0
  38. package/lib/Socket/managed-account.js +208 -0
  39. package/lib/Socket/messages-recv.js +2144 -0
  40. package/lib/Socket/messages-send.js +2650 -0
  41. package/lib/Socket/messages-send.js[latest working] +1759 -0
  42. package/lib/Socket/mex.js +41 -0
  43. package/lib/Socket/newsletter.js +226 -0
  44. package/lib/Socket/privacy.js +446 -0
  45. package/lib/Socket/registration.js +428 -0
  46. package/lib/Socket/socket.js +1050 -0
  47. package/lib/Socket/username.js +229 -0
  48. package/lib/Store/index.js +4 -0
  49. package/lib/Store/make-cache-manager-store.js +89 -0
  50. package/lib/Store/make-in-memory-store.js +420 -0
  51. package/lib/Store/make-ordered-dictionary.js +78 -0
  52. package/lib/Store/object-repository.js +23 -0
  53. package/lib/Types/Auth.js +1 -0
  54. package/lib/Types/Bussines.js +1 -0
  55. package/lib/Types/Call.js +1 -0
  56. package/lib/Types/Chat.js +7 -0
  57. package/lib/Types/Contact.js +1 -0
  58. package/lib/Types/Events.js +1 -0
  59. package/lib/Types/GroupMetadata.js +1 -0
  60. package/lib/Types/Label.js +24 -0
  61. package/lib/Types/LabelAssociation.js +6 -0
  62. package/lib/Types/Message.js +17 -0
  63. package/lib/Types/Mex.js +39 -0
  64. package/lib/Types/Product.js +1 -0
  65. package/lib/Types/RichType.js +22 -0
  66. package/lib/Types/Signal.js +1 -0
  67. package/lib/Types/Socket.js +2 -0
  68. package/lib/Types/State.js +48 -0
  69. package/lib/Types/USync.js +1 -0
  70. package/lib/Types/index.js +25 -0
  71. package/lib/Utils/auth-utils.js +301 -0
  72. package/lib/Utils/bot-planning-replay.js +169 -0
  73. package/lib/Utils/browser-utils.js +28 -0
  74. package/lib/Utils/business.js +230 -0
  75. package/lib/Utils/channel-policy.js +1 -0
  76. package/lib/Utils/chat-utils.js +885 -0
  77. package/lib/Utils/chat-utils.js[old] +871 -0
  78. package/lib/Utils/companion-reg-client-utils.js +32 -0
  79. package/lib/Utils/consumer-application.js +102 -0
  80. package/lib/Utils/crypto.js +117 -0
  81. package/lib/Utils/decode-wa-message.js +484 -0
  82. package/lib/Utils/event-buffer.js +589 -0
  83. package/lib/Utils/games/slot-machine.js +258 -0
  84. package/lib/Utils/games/website-preview.js +293 -0
  85. package/lib/Utils/generics.js +390 -0
  86. package/lib/Utils/generics.js@old +385 -0
  87. package/lib/Utils/group-history.js +56 -0
  88. package/lib/Utils/history.js +130 -0
  89. package/lib/Utils/identity-change-handler.js +48 -0
  90. package/lib/Utils/index.js +35 -0
  91. package/lib/Utils/integrity.js +296 -0
  92. package/lib/Utils/jid-display-normalization.js +209 -0
  93. package/lib/Utils/link-preview.js +84 -0
  94. package/lib/Utils/logger.js +2 -0
  95. package/lib/Utils/lt-hash.js +7 -0
  96. package/lib/Utils/make-mutex.js +32 -0
  97. package/lib/Utils/message-composer.js +467 -0
  98. package/lib/Utils/message-inspect.js +67 -0
  99. package/lib/Utils/message-retry-manager.js +241 -0
  100. package/lib/Utils/messages-media.js +1006 -0
  101. package/lib/Utils/messages-media.js[old] +916 -0
  102. package/lib/Utils/messages.js +1982 -0
  103. package/lib/Utils/messages.js[old] +1902 -0
  104. package/lib/Utils/meta-ai-msmsg.js +130 -0
  105. package/lib/Utils/meta-compositing.js +202 -0
  106. package/lib/Utils/native-flow.js +100 -0
  107. package/lib/Utils/noise-handler.js +200 -0
  108. package/lib/Utils/offline-node-processor.js +39 -0
  109. package/lib/Utils/pre-key-manager.js +105 -0
  110. package/lib/Utils/process-message.js +582 -0
  111. package/lib/Utils/reporting-utils.js +257 -0
  112. package/lib/Utils/rich-message-utils.js +942 -0
  113. package/lib/Utils/rich-message-utils.js[Old] +387 -0
  114. package/lib/Utils/signal.js +200 -0
  115. package/lib/Utils/stanza-ack.js +37 -0
  116. package/lib/Utils/sync-action-utils.js +47 -0
  117. package/lib/Utils/tc-token-utils.js +162 -0
  118. package/lib/Utils/use-multi-file-auth-state.js +120 -0
  119. package/lib/Utils/use-single-file-auth-state.js +96 -0
  120. package/lib/Utils/use-sqlite-auth-state.js +108 -0
  121. package/lib/Utils/validate-connection.js +206 -0
  122. package/lib/Utils/view-once-utils.js +206 -0
  123. package/lib/Utils/voip-rekey.js +20 -0
  124. package/lib/Utils/welcome-flow.js +220 -0
  125. package/lib/WABinary/constants.js +1463 -0
  126. package/lib/WABinary/decode.js +261 -0
  127. package/lib/WABinary/encode.js +219 -0
  128. package/lib/WABinary/generic-utils.js +227 -0
  129. package/lib/WABinary/index.js +5 -0
  130. package/lib/WABinary/jid-utils.js +95 -0
  131. package/lib/WABinary/types.js +1 -0
  132. package/lib/WAM/BinaryInfo.js +9 -0
  133. package/lib/WAM/constants.js +22852 -0
  134. package/lib/WAM/encode.js +149 -0
  135. package/lib/WAM/index.js +3 -0
  136. package/lib/WAUSync/Protocols/USyncBusinessProtocol.js +96 -0
  137. package/lib/WAUSync/Protocols/USyncContactProtocol.js +56 -0
  138. package/lib/WAUSync/Protocols/USyncDeviceProtocol.js +53 -0
  139. package/lib/WAUSync/Protocols/USyncDisappearingModeProtocol.js +26 -0
  140. package/lib/WAUSync/Protocols/USyncFeatureProtocol.js +70 -0
  141. package/lib/WAUSync/Protocols/USyncPictureProtocol.js +28 -0
  142. package/lib/WAUSync/Protocols/USyncSidelistProtocol.js +25 -0
  143. package/lib/WAUSync/Protocols/USyncStatusProtocol.js +37 -0
  144. package/lib/WAUSync/Protocols/USyncTextStatusProtocol.js +34 -0
  145. package/lib/WAUSync/Protocols/USyncUsernameProtocol.js +24 -0
  146. package/lib/WAUSync/Protocols/UsyncBotProfileProtocol.js +50 -0
  147. package/lib/WAUSync/Protocols/UsyncLIDProtocol.js +28 -0
  148. package/lib/WAUSync/Protocols/index.js +12 -0
  149. package/lib/WAUSync/USyncQuery.js +201 -0
  150. package/lib/WAUSync/USyncUser.js +54 -0
  151. package/lib/WAUSync/index.js +3 -0
  152. package/lib/index.d.ts +406 -0
  153. package/lib/index.js +11 -0
  154. package/package.json +125 -0
package/lib/index.d.ts ADDED
@@ -0,0 +1,406 @@
1
+ export interface WAMessageKey {
2
+ remoteJid?: string | null;
3
+ fromMe?: boolean | null;
4
+ id?: string | null;
5
+ participant?: string | null;
6
+ }
7
+
8
+ export type StatusFont = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9;
9
+
10
+ export interface StatusOptions {
11
+ /** Users allowed to receive the status. At least one valid user JID is required. */
12
+ statusJidList: string[];
13
+ /** Hex, named, or ARGB status background color. */
14
+ backgroundColor?: string | number;
15
+ font?: StatusFont;
16
+ messageId?: string;
17
+ additionalAttributes?: Record<string, string>;
18
+ additionalNodes?: unknown[];
19
+ }
20
+
21
+ export interface PollVoteEvent {
22
+ pollUpdateMessageKey: WAMessageKey;
23
+ pollCreationMessageKey: WAMessageKey;
24
+ vote: unknown;
25
+ voterJid?: string;
26
+ pollCreatorJid?: string;
27
+ selectedOptions: string[];
28
+ selectedOptionHashes: string[];
29
+ unselectedOptions: string[];
30
+ senderTimestampMs?: number;
31
+ }
32
+
33
+ export interface StatusContent {
34
+ /** Convenience flag; alternatively send to `status@broadcast`. */
35
+ status?: true;
36
+ statusJidList?: string[];
37
+ backgroundColor?: string | number;
38
+ font?: StatusFont;
39
+ text?: string;
40
+ image?: unknown;
41
+ video?: unknown;
42
+ audio?: unknown;
43
+ caption?: string;
44
+ mimetype?: string;
45
+ ptt?: boolean;
46
+ seconds?: number;
47
+ waveform?: Uint8Array;
48
+ [key: string]: unknown;
49
+ }
50
+
51
+ export interface GroupStatusContent extends StatusContent {
52
+ groupStatus: true;
53
+ }
54
+
55
+ /** One status distribution list entry as returned by `getStatusPrivacy`. */
56
+ export interface StatusPrivacyList {
57
+ type?: string;
58
+ id?: string;
59
+ listname?: string;
60
+ emoji?: string;
61
+ selected?: boolean;
62
+ deleted?: boolean;
63
+ members: string[];
64
+ }
65
+
66
+ /** Custom named status list passed to `setStatusPrivacy`. */
67
+ export interface StatusCustomList {
68
+ id: string;
69
+ listname: string;
70
+ emoji?: string;
71
+ selected?: boolean;
72
+ deleted?: boolean;
73
+ members?: string[];
74
+ }
75
+
76
+ /** Result of `fetchBroadcastListQuota`. */
77
+ export interface BroadcastListQuota {
78
+ messagesLeft: number;
79
+ totalLimit: number;
80
+ isHeavySender: boolean;
81
+ startTs: number;
82
+ endTs: number;
83
+ resetTs: number;
84
+ }
85
+
86
+ /** Entry accepted by `storePrivacyTokens`. */
87
+ export interface PrivacyTokenEntry {
88
+ jid: string;
89
+ privacyToken: Buffer;
90
+ privacyModeTs?: number | string;
91
+ }
92
+
93
+ /** A bot (persona) entry as returned by `getBotListV2` / `getBotProfile`. */
94
+ export interface BotProfile {
95
+ jid?: string;
96
+ personaId?: string;
97
+ name?: string;
98
+ description?: string;
99
+ }
100
+
101
+ /** A group profile picture as returned by `getGroupProfilePictures`. */
102
+ export interface GroupProfilePicture {
103
+ jid?: string;
104
+ type?: string;
105
+ directPath?: string;
106
+ url?: string;
107
+ }
108
+
109
+ /** Result of `groupJoinLinked`. */
110
+ export interface GroupJoinLinkedResult {
111
+ approvalRequested: boolean;
112
+ }
113
+
114
+ /** Options for `aiGroupCreate`. */
115
+ export interface AIGroupCreateOptions {
116
+ ephemeralExpiration?: number;
117
+ memberAddMode?: string;
118
+ memberShareGroupHistoryMode?: string;
119
+ memberLinkMode?: string;
120
+ }
121
+
122
+ /** Options for `aiPrompt`. */
123
+ export interface AIPromptOptions {
124
+ /** ms to wait for the bot response before rejecting (default 60000). */
125
+ timeout?: number;
126
+ /** Best-effort streaming hook — called with each bot message edit in the chat. */
127
+ onPartial?: (message: unknown, key: WAMessageKey) => void;
128
+ /** Canonical Meta AI bot JID (default `867051314767696@bot`). */
129
+ botUser?: string;
130
+ /** Extra JIDs to mention alongside the bot in group prompts. */
131
+ mentions?: string[];
132
+ /** Extra options forwarded to `sendMessage` (quoted, linkPreview, ...). */
133
+ [key: string]: unknown;
134
+ }
135
+
136
+ export interface RichMenuButton {
137
+ id?: string;
138
+ text?: string;
139
+ label?: string;
140
+ toast?: string;
141
+ url?: string;
142
+ useWebview?: boolean;
143
+ call?: string;
144
+ copy?: string;
145
+ icon?: string;
146
+ sections?: unknown[];
147
+ }
148
+
149
+ export interface RichMenuContent {
150
+ header?: {
151
+ title?: string;
152
+ disclaimer?: boolean;
153
+ disclaimerText?: string;
154
+ image?: { url: string; mime_type?: string; mimeType?: string; width?: number; height?: number; inline?: boolean };
155
+ };
156
+ body?: {
157
+ title?: string;
158
+ toast?: string;
159
+ carousel?: boolean;
160
+ row?: boolean;
161
+ buttons?: Array<string | RichMenuButton>;
162
+ cards?: Array<{ title?: string; toast?: string; buttons?: Array<string | RichMenuButton> }>;
163
+ };
164
+ footer?: {
165
+ text?: string;
166
+ url?: string;
167
+ image?: { url: string; mime_type?: string; mimeType?: string; width?: number; height?: number };
168
+ };
169
+ }
170
+
171
+ export interface RichGenerationContent {
172
+ text?: string;
173
+ mediaType?: 'image' | 'video' | string;
174
+ url?: string;
175
+ thumbnail?: string | Uint8Array | Record<string, unknown>;
176
+ mimeType?: string;
177
+ fileLength?: number;
178
+ duration?: number;
179
+ status?: 'GENERATING' | 'READY' | 'FAILED' | string;
180
+ estimatedMs?: number;
181
+ itemId?: string;
182
+ }
183
+
184
+ export interface RichGenerationResult {
185
+ message: unknown;
186
+ messageId: string;
187
+ responseId: string;
188
+ itemId: string;
189
+ targetId?: string;
190
+ }
191
+
192
+ export interface WhatsAppFlowResponse {
193
+ name: string;
194
+ version?: number;
195
+ paramsJson: string;
196
+ params: Record<string, unknown>;
197
+ isFlow: boolean;
198
+ flowId?: string;
199
+ flowToken?: string;
200
+ screen?: string;
201
+ action?: string;
202
+ actionPayload: Record<string, unknown>;
203
+ data: Record<string, unknown>;
204
+ buttonId?: string;
205
+ displayText?: string;
206
+ raw: Record<string, unknown>;
207
+ }
208
+
209
+ export interface RelayMessageOptions {
210
+ messageId?: string;
211
+ /** Recipient-only delivery: skip the sender's own devices in a one-to-one chat. */
212
+ participant?: { jid: string };
213
+ /** Retry resend target; requires a device JID and retry count. */
214
+ participants?: { jid: string; count: number };
215
+ retryParticipants?: { jid: string; count: number };
216
+ /** Keep only the target's primary device. */
217
+ isSecret?: boolean;
218
+ /** Skip the target's linked devices. */
219
+ protected?: boolean;
220
+ /** Keep only the sender's own devices. */
221
+ me?: boolean;
222
+ [key: string]: unknown;
223
+ }
224
+
225
+ export interface WASocket {
226
+ sendMessage(jid: string | string[], content: StatusContent | GroupStatusContent | Record<string, unknown>, options?: Partial<StatusOptions> & Record<string, unknown>): Promise<unknown>;
227
+ /** Relay a prepared message with optional recipient/device-scoping compatibility controls. */
228
+ relayMessage(jid: string, message: Record<string, unknown>, options?: RelayMessageOptions): Promise<unknown>;
229
+ /** Send an experimental Meta AI-style rich menu with image, card buttons, and an optional URL footer. */
230
+ richMenu(jid: string, content?: RichMenuContent, options?: Record<string, unknown>): Promise<unknown>;
231
+ /** Post a personal status using explicit viewers or a configured contact source/provider. */
232
+ sendStatus(content: Omit<StatusContent, 'statusJidList'>, options?: Partial<StatusOptions> & { statusJidList?: string[] }): Promise<unknown>;
233
+ /** Publish a status and create status-mention references for the supplied users or groups. */
234
+ sendStatusMention(content: Omit<StatusContent, 'statusJidList'> | Record<string, unknown>, jids: string[], options?: Record<string, unknown>): Promise<unknown>;
235
+ /** Plural alias for sendStatusMention. */
236
+ sendStatusMentions(content: Omit<StatusContent, 'statusJidList'> | Record<string, unknown>, jids: string[], options?: Record<string, unknown>): Promise<unknown>;
237
+ /** Launch a published WhatsApp Flow through a native-flow button. */
238
+ sendWhatsAppFlow(jid: string, flow: { flowId: string; flowToken: string; cta?: string; action?: string; actionPayload?: Record<string, unknown>; mode?: string; flowMessageVersion?: string | number; metadata?: Record<string, unknown>; text?: string; footer?: string; image?: unknown; caption?: string; nativeFlowName?: string }, options?: Record<string, unknown>): Promise<unknown>;
239
+ /** Send a rich native-flow URL CTA that opens a hosted WebView/Mini App. */
240
+ sendRichWebview(jid: string, content: { text?: string; title?: string; footer?: string; image?: unknown; caption?: string; buttonText?: string; url: string; useWebview?: boolean; toast?: string; [key: string]: unknown }, options?: Record<string, unknown>): Promise<unknown>;
241
+ /** Send a native AI image/video generation card with a GENERATING or READY state. */
242
+ sendRichGeneration(jid: string, content?: RichGenerationContent, quoted?: unknown, options?: Record<string, unknown>): Promise<RichGenerationResult>;
243
+ /** Edit an existing AI generation card in place using WhatsApp's type-14 edit protocol. */
244
+ updateRichGeneration(jid: string, targetId: string, content?: RichGenerationContent, options?: Record<string, unknown>): Promise<RichGenerationResult>;
245
+ /** Send a carousel-style rich grid where each card exposes native reply buttons. */
246
+ sendRichButtonGrid(jid: string, grid: { text?: string; footer?: string; cards: Array<{ title?: string; caption?: string; image?: unknown; buttons?: Array<{ id?: string; text?: string; buttonText?: string; url?: string; call?: string; copy?: string; sections?: unknown[] }>; nativeFlow?: unknown[] }> }, options?: Record<string, unknown>): Promise<unknown>;
247
+ /** Send a Markdown-rendered table with optional image media and reply buttons. */
248
+ sendInteractiveTable(jid: string, table: { title?: string; headers?: unknown[]; rows?: unknown[][]; image?: unknown; buttons?: Array<{ id?: string; text?: string; buttonText?: string }>; footer?: string }, options?: Record<string, unknown>): Promise<unknown>;
249
+ deleteGroupStatus(jid: string, key: WAMessageKey): Promise<unknown>;
250
+ /** Reports the contact and blocks it after WhatsApp accepts the report. */
251
+ reportContact(jid: string, messageKeys?: WAMessageKey[]): Promise<unknown>;
252
+ /** Reports the group and leaves it after WhatsApp accepts the report. */
253
+ reportGroup(jid: string, messageKeys?: WAMessageKey[]): Promise<unknown>;
254
+
255
+ // ---- WA-Web chat features (ported from baron-baileys-v2) ----
256
+ getStatusPrivacy(): Promise<StatusPrivacyList[] | null>;
257
+ setStatusPrivacy(type: 'contacts' | 'whitelist' | 'blacklist' | 'null', jids?: string[], customLists?: StatusCustomList[]): Promise<unknown>;
258
+ fetchBroadcastListQuota(): Promise<BroadcastListQuota | null>;
259
+ getChatBlockingStatus(): Promise<'blocked' | 'unblocked' | undefined>;
260
+ updateChatBlockingStatus(action: 'block' | 'unblock'): Promise<'blocked' | 'unblocked' | undefined>;
261
+ getUserDisclosures(t?: number): Promise<Record<string, string>[]>;
262
+ acceptTosNotice(noticeId: string | number, result?: string | number): Promise<unknown>;
263
+ reportSpam(jid: string, messages?: Array<{ id: string; t: number }>, spamFlow?: string, subject?: string): Promise<unknown>;
264
+ getOptOutList(): Promise<unknown>;
265
+ signPrivateCredential(blindedCredential: Buffer): Promise<Buffer | undefined>;
266
+ getPushConfig(): Promise<unknown>;
267
+ setPushConfig(config: Record<string, string>): Promise<unknown>;
268
+ toggleCallLinkWaitingRoom(linkToken: string, enabled: boolean, media?: 'audio' | 'video'): Promise<Record<string, string> | undefined>;
269
+ storePrivacyTokens(entries: PrivacyTokenEntry[]): Promise<void>;
270
+ updateBioPrivacy(value: string): Promise<unknown>;
271
+ blockBot(botJid: string): Promise<unknown>;
272
+ unblockBot(botJid: string): Promise<unknown>;
273
+ getBotListV2(): Promise<BotProfile[]>;
274
+ getBotProfile(botJid: string): Promise<BotProfile | null>;
275
+ fetchABProps(protocol?: string, hash?: string, refreshId?: string | null, group?: string | null): Promise<Record<string, string>>;
276
+ removeCompanionDevice(jid: string, reason?: string): Promise<unknown>;
277
+ updateKeyIndexList(ts: number | string, content: Buffer): Promise<unknown>;
278
+ sendKeyIndexList(): Promise<void>;
279
+ fetchMediaConn(lastId?: string | null): Promise<unknown>;
280
+ deleteBroadcastList(listId: string | number): Promise<unknown>;
281
+ fetchQRCode(code: string, addressingMode?: 'lid' | null): Promise<unknown>;
282
+ confirmDeviceLogout(id: string | number, approve?: boolean): Promise<unknown>;
283
+
284
+ // ---- Group calls ----
285
+ /** Start a group call in `jid`, ringing each participant JID. Returns { id, to }. */
286
+ groupCall(jid: string, participants?: string[], isVideo?: boolean): Promise<{ id: string; to: string }>;
287
+ /** Cancel / hang up a group call started with `groupCall`. Returns { id, to }. */
288
+ cancelGroupCall(jid: string, callId: string): Promise<{ id: string; to: string }>;
289
+
290
+ // ---- AI groups (ported from baron-baileys-v2) ----
291
+ aiGroupMetadata(jid: string): Promise<unknown>;
292
+ /** Send a prompt to the Meta AI bot and resolve with the decrypted response. */
293
+ aiPrompt(jid: string, prompt: string, options?: AIPromptOptions): Promise<unknown>;
294
+ aiGroupCreate(subject: string, participants?: string[], options?: AIGroupCreateOptions): Promise<unknown>;
295
+ aiGroupAddBot(jid: string, botUser?: string): Promise<unknown>;
296
+ aiGroupLeave(id: string): Promise<unknown>;
297
+ aiGroupParticipantsUpdate(jid: string, participants: string[], action: string): Promise<unknown>;
298
+ aiGroupUpdateSubject(jid: string, subject: string): Promise<unknown>;
299
+ aiGroupInviteCode(jid: string): Promise<unknown>;
300
+ aiGroupRevokeInvite(jid: string): Promise<unknown>;
301
+ aiGroupAcceptInvite(code: string): Promise<unknown>;
302
+ aiGroupSettingUpdate(jid: string, setting: string): Promise<unknown>;
303
+ aiGroupToggleEphemeral(jid: string, ephemeralExpiration: number): Promise<unknown>;
304
+
305
+ // ---- Community / group extensions ----
306
+ groupAcknowledge(jid: string): Promise<unknown>;
307
+ groupGetLinkedParticipants(jid: string): Promise<Array<{ jid: string; phoneNumber?: string }>>;
308
+ groupJoinLinked(parentJid: string, linkedGroupJid: string, type?: string): Promise<GroupJoinLinkedResult>;
309
+ getGroupProfilePictures(jids: string[], type?: 'preview' | 'image'): Promise<GroupProfilePicture[]>;
310
+ groupCreateSubGroupSuggestion(parentJid: string, suggestion: Array<Record<string, unknown>>): Promise<unknown>;
311
+ groupSubGroupSuggestionsAction(parentJid: string, action: 'approve' | 'reject' | 'cancel', suggestions: Array<{ creator?: string; jid?: string }>): Promise<unknown>;
312
+
313
+ // ---- Interop (Matrix bridge) ----
314
+ initInterop(): Promise<unknown>;
315
+ resetInteropSession(): Promise<unknown>;
316
+ fetchIntegrators(): Promise<unknown>;
317
+ acceptInteropTOS(): Promise<unknown>;
318
+ optInIntegrators(): Promise<unknown>;
319
+ optOutIntegrators(): Promise<unknown>;
320
+ resolveInteropUser(jid: string): Promise<unknown>;
321
+ resolveInteropUsers(jids: string[]): Promise<unknown>;
322
+ getReachabilitySettings(): Promise<unknown>;
323
+ setReachabilitySettings(settings: Record<string, unknown>): Promise<unknown>;
324
+ blockInteropUser(jid: string): Promise<unknown>;
325
+ unblockInteropUser(jid: string): Promise<unknown>;
326
+ reportInteropSpam(jid: string): Promise<unknown>;
327
+ trustInteropContact(jid: string): Promise<unknown>;
328
+ createInteropGroup(subject: string, participants?: string[]): Promise<unknown>;
329
+ leaveInteropGroup(jid: string): Promise<unknown>;
330
+ addParticipantsToInteropGroup(jid: string, participants: string[]): Promise<unknown>;
331
+ queryInteropGroupInfo(jid: string): Promise<unknown>;
332
+ queryInteropPrivacySettings(): Promise<unknown>;
333
+ updateInteropPrivacySetting(setting: string, value: string): Promise<unknown>;
334
+ updateInteropPrivacySettingWithContactList(setting: string, value: string, contacts: string[]): Promise<unknown>;
335
+ getInteropGroupAddPrivacy(): Promise<unknown>;
336
+
337
+ // ---- Username / privacy / account layers ----
338
+ checkUsername(username: string): Promise<unknown>;
339
+ checkUsernameMulti(usernames: string[]): Promise<unknown>;
340
+ setUsername(username: string, options?: Record<string, unknown>): Promise<unknown>;
341
+ deleteUsername(): Promise<unknown>;
342
+ getMyUsername(): Promise<unknown>;
343
+ getUsernameRecommendations(): Promise<unknown>;
344
+ setUsernamePin(pin: string): Promise<unknown>;
345
+ findUserByUsername(username: string): Promise<unknown>;
346
+ fetchContactUsernames(jids: string[]): Promise<unknown>;
347
+
348
+ getPrivacySettings(): Promise<unknown>;
349
+ setPrivacySetting(category: string, value: string): Promise<unknown>;
350
+ updatePrivacyContactList(category: string, type: string, jids: string[]): Promise<unknown>;
351
+ getPrivacyContactList(category: string): Promise<unknown>;
352
+ updateTextStatus(status: string): Promise<unknown>;
353
+ getTextStatusList(): Promise<unknown>;
354
+ updateUserStatus(status: string): Promise<unknown>;
355
+ fetchUserPictureInfo(jid: string): Promise<unknown>;
356
+ setProfilePictureMex(jid: string, image: Buffer): Promise<unknown>;
357
+
358
+ hasPassword(): Promise<unknown>;
359
+ setPassword(password: string): Promise<unknown>;
360
+ checkPassword(password: string): Promise<unknown>;
361
+ deletePassword(): Promise<unknown>;
362
+ passkeyExists(): Promise<unknown>;
363
+ getRegistrationUpsells(): Promise<unknown>;
364
+ contactsUpload(contacts: unknown[]): Promise<unknown>;
365
+ submitAge(age: number): Promise<unknown>;
366
+
367
+ managedAccountInitiateLinking(): Promise<unknown>;
368
+ managedAccountValidateLinking(token: string): Promise<unknown>;
369
+ managedAccountAcceptLinking(token: string): Promise<unknown>;
370
+ managedAccountCompleteLinking(token: string): Promise<unknown>;
371
+ managedAccountRevokeLinking(): Promise<unknown>;
372
+ managedAccountSyncActivities(): Promise<unknown>;
373
+ managedAccountUpdatePin(pin: string): Promise<unknown>;
374
+
375
+ // ---- GraphQL layer ----
376
+ setAccessToken(token: string): Promise<void>;
377
+ setWamoAuth(token: string): Promise<void>;
378
+ acquireAccessToken(): Promise<unknown>;
379
+ executeWWWGraphQL(query: string, variables?: Record<string, unknown>): Promise<unknown>;
380
+ executeFacebookGraphQL(query: string, variables?: Record<string, unknown>): Promise<unknown>;
381
+ executeWamoGraphQL(query: string, variables?: Record<string, unknown>): Promise<unknown>;
382
+
383
+ [key: string]: unknown;
384
+ }
385
+
386
+ export interface SocketConfig {
387
+ [key: string]: unknown;
388
+ }
389
+
390
+ export interface CacheManagerStore {
391
+ get(key: string): Promise<unknown>;
392
+ set(key: string, value: unknown, ttl?: number): Promise<unknown>;
393
+ delete(key: string): Promise<boolean>;
394
+ keys(pattern?: string): Promise<string[]>;
395
+ reset?(): Promise<void>;
396
+ }
397
+
398
+ /** Build a full auth-state (creds + keys) backed by a cache-manager store. */
399
+ export declare function makeCacheManagerAuthState(store: CacheManagerStore, sessionKey?: string): Promise<{
400
+ state: unknown;
401
+ saveCreds: () => Promise<void>;
402
+ }>;
403
+
404
+ declare function makeWASocket(config: SocketConfig): WASocket;
405
+ export { makeWASocket };
406
+ export default makeWASocket;
package/lib/index.js ADDED
@@ -0,0 +1,11 @@
1
+ import makeWASocket, { checkStatusWA } from './Socket/index.js';
2
+ export * from '../WAProto/index.js';
3
+ export * from './Utils/index.js';
4
+ export * from './Types/index.js';
5
+ export * from './Defaults/index.js';
6
+ export * from './Store/index.js';
7
+ export * from './WABinary/index.js';
8
+ export * from './WAM/index.js';
9
+ export * from './WAUSync/index.js';
10
+ export { makeWASocket, checkStatusWA };
11
+ export default makeWASocket;
package/package.json ADDED
@@ -0,0 +1,125 @@
1
+ {
2
+ "name": "plogme",
3
+ "version": "1.0.0",
4
+ "description": "Production-ready Baileys fork \u2689 with AI groups, Meta AI prompting, safe compositing fallbacks, rich responses, interactive messages, albums, newsletters, and communities \u2014 without antiban wrappers.",
5
+ "main": "lib/index.js",
6
+ "type": "module",
7
+ "scripts": {
8
+ "preinstall": "node ./engine-requirements.js",
9
+ "test": "node --test",
10
+ "obfuscate": "node tools/obfuscate.mjs"
11
+ },
12
+ "engines": {
13
+ "node": ">=20.0.0"
14
+ },
15
+ "repository": {
16
+ "type": "git",
17
+ "url": "https://pair.crysnovax.link"
18
+ },
19
+ "files": [
20
+ "lib/**/*",
21
+ "WAProto/**/*",
22
+ "engine-requirements.js"
23
+ ],
24
+ "keywords": [
25
+ "automation",
26
+ "baileys",
27
+ "baileys-fork",
28
+ "baileys-mod",
29
+ "crysnova ai",
30
+ "cody ai",
31
+ "bot-planning-replay",
32
+ "plogme",
33
+ "interactive-messages",
34
+ "js-whatsapp",
35
+ "meta-compositing",
36
+ "multi-device",
37
+ "rich-messages",
38
+ "welcome-flow",
39
+ "whatsapp",
40
+ "whatsapp-api",
41
+ "whatsapp-bot",
42
+ "whatsapp-chat",
43
+ "whatsapp-group",
44
+ "whatsapp-web"
45
+ ],
46
+ "homepage": "https://www.npmjs.com/package/plogme/",
47
+ "author": "plogme",
48
+ "license": "SEE LICENSE IN LICENSE",
49
+ "dependencies": {
50
+ "@adiwajshing/keyed-db": "^0.2.4",
51
+ "@cacheable/node-cache": "^1.4.0",
52
+ "@hapi/boom": "^9.1.3",
53
+ "async-mutex": "^0.5.0",
54
+ "cache-manager": "^7.2.8",
55
+ "fflate": "^0.8.2",
56
+ "libsignal": "^6.0.0",
57
+ "long": "^5.2.3",
58
+ "lru-cache": "^11.2.6",
59
+ "music-metadata": "^11.12.3",
60
+ "p-queue": "^9.1.0",
61
+ "pino": "^9.6.0",
62
+ "protobufjs": "^7.5.6",
63
+ "whatsapp-rust-bridge": "0.5.5",
64
+ "ws": "^8.19.0"
65
+ },
66
+ "peerDependencies": {
67
+ "@napi-rs/image": "~1.12.0",
68
+ "audio-decode": "^2.2.3",
69
+ "better-sqlite3": "^11.0.0",
70
+ "jimp": "^1.6.1",
71
+ "link-preview-js": "^3.0.0",
72
+ "sharp": "*"
73
+ },
74
+ "peerDependenciesMeta": {
75
+ "@napi-rs/image": {
76
+ "optional": true
77
+ },
78
+ "audio-decode": {
79
+ "optional": true
80
+ },
81
+ "better-sqlite3": {
82
+ "optional": true
83
+ },
84
+ "jimp": {
85
+ "optional": true
86
+ },
87
+ "link-preview-js": {
88
+ "optional": true
89
+ }
90
+ },
91
+ "packageManager": "yarn@4.9.2",
92
+ "types": "lib/index.d.ts",
93
+ "resolutions": {
94
+ "ajv@npm:^6.12.4": "^6.14.0",
95
+ "basic-ftp": "^5.2.4",
96
+ "brace-expansion@npm:^1.1.7": "^1.1.13",
97
+ "brace-expansion@npm:^2.0.1": "^2.0.3",
98
+ "flatted": "^3.4.2",
99
+ "glob@npm:^10.2.2": "^10.5.0",
100
+ "glob@npm:^10.3.10": "^10.5.0",
101
+ "glob@npm:^10.5.0": "^10.5.0",
102
+ "handlebars": "^4.7.9",
103
+ "ip-address": "^10.1.1",
104
+ "js-yaml@npm:^3.13.1": "^3.14.2",
105
+ "js-yaml@npm:^4.1.0": "^4.1.1",
106
+ "markdown-it": "^14.1.1",
107
+ "minimatch@npm:^3.0.4": "^3.1.5",
108
+ "minimatch@npm:^3.1.2": "^3.1.5",
109
+ "minimatch@npm:^5.0.1": "^5.1.8",
110
+ "minimatch@npm:^9.0.4": "^9.0.9",
111
+ "minimatch@npm:^9.0.5": "^9.0.9",
112
+ "picomatch@npm:^2.0.4": "^2.3.2",
113
+ "picomatch@npm:^2.3.1": "^2.3.2",
114
+ "picomatch@npm:^4.0.0": "^4.0.4",
115
+ "picomatch@npm:^4.0.2": "^4.0.4",
116
+ "socks": "^2.8.8",
117
+ "tar": "^7.5.11",
118
+ "tmp": "^0.2.5",
119
+ "underscore": "^1.13.8",
120
+ "yaml@npm:^2.6.1": "^2.8.4"
121
+ },
122
+ "devDependencies": {
123
+ "javascript-obfuscator": "^4.1.1"
124
+ }
125
+ }