Skip to content
项目

关于

AunuBaileys v3 — an independent TypeScript WhatsApp Web library by AunuCore Creative Network, written from scratch (not a fork): layered kernel, Signal protocol behind a provider interface, LID-first identities, typed domain services, and a built-in migration path from Baileys auth state.

系统与基础设施

这些数字如何统计

实测星标增长

24小时
0
7天
+1
15天
+1
1个月
正在收集历史

各周期内的星标净变化,周期相互重叠,并非每日新增。缺失的测量保持空白。星标代表关注度,不代表软件质量。

README.md

原文

@aunucore/baileys

AunuCore's third-generation WhatsApp Web protocol library: written independently from a behavioural protocol specification, with a layered kernel — transport, stanza codec, session/pairing, the Signal protocol behind a provider interface, LID-first identities, and typed domain services on top of a typed event bus.

Status: released as @aunucore/baileys 3.0.7. The design specification lives in spec/; the engineering notes live in WORKLOG.md.

What's new in 3.0.7

The full post-3.0.6 verified maintenance queue: 87 findings across the message, Signal, session, group, media and auth-state surfaces. On the message path, pre-send validation failures are no longer recorded as dead letters, retry and decrypt-failure state survives bounded-map eviction through a two-tier retention scheme, and disposed services no longer emit events or receipts. In the Signal engine, host-store read failures now surface as signal/store-failed instead of being misreported as decrypt failures, the retired sender-key list cap rises from 8 to 64, and an identity re-seed at pairing completion re-mints the signed pre-keys the old identity signed, so previously issued key ids stay usable instead of failing as corrupt.

Boundary validation is now uniform across the domain services: constructors and options that used to throw raw TypeErrors deep inside a call — the IQ client and the services built on it, presence, polls, chats, groups, contacts, the status and version stores, the auth-state factories and the SQL key-value store — fail up front with structured errors. Group ids are normalized at one choke point on read and write paths alike, and a bulk group fetch no longer discards a newer single-fetch cache ticket. View-once downloads recover from corrupt or incomplete stored media credentials through the recent-message store, OGG pages split correctly past 255 segments, the sticker size cap is re-checked after EXIF stamping, and server-supplied counters (MEX quota, disappearing mode) are parsed strictly instead of collapsing into fabricated zeros. Pairing-code requests can no longer overwrite credentials registered by a completed QR pairing, pre-key uploads are bounded so a never-settling host callback cannot wedge the pipeline, pairing timeouts are clamped against timer overflow, and a corrupt pre-key high-water mark now heals itself on save.

What's new in 3.0.6

Full VoIP signalling and sticker support, plus the rest of the verified maintenance queue. Incoming call stanzas are now parsed into normalized call events (offer, preaccept, transport, relay-latency and terminate reasons — a terminate with reason="timeout" surfaces as a timeout), acknowledged with a proper <call> ack, and tracked by a local call state machine (ringing / accepted / missed / rejected / ended, with timestamps, durations and a bounded missed-call timer). createCallLink mints audio and video call links, and scheduled-call creation and edit messages are supported at the protocol layer (Message fields 61 and 65). Outbound call control (offer / accept / terminate) and the media plane stay behind the host port — their wire grammar is not part of the recorded protocol surface.

Stickers graduate to a general toolkit: a WebP EXIF writer and reader for pack metadata (buildSticker / sendSticker with pack id, name, publisher and emojis, plus the shared sound-sha256 payload), sticker size probing for VP8 / VP8L / VP8X / animated WebP, and Lottie sticker flags (isLottie, Message field 21) on the send and receive paths.

Also in: PDO resend-key enumeration, an OGG/Opus code-3 repacketizer, the receive side of channel status, group bot_product and encryption_keys parsing — and the full batch of verified fixes: media direct-URL placeholder folding, the auth-state snapshot race, throwing-creds() send paths, the duplicate-id send race, unvalidated transport factories and unbounded reconnect awaits, seedIdentity serialization against identity bootstrap, signed pre-key record validation, and newsletterBatchAction action validation.

What's new in 3.0.5

The full post-3.0.4 maintenance queue in one release: over 110 verified fixes and addenda across the session, message, group, media, Signal and auth-state surfaces — every finding filed up to the moment of release is in. Host-supplied nulls are now rejected with structured errors at every public boundary instead of escaping as raw TypeErrors — null ports, stores, buses and senders across the app-state patcher, notifications, messages, media, pairing and noise machines, and the Signal provider's peer reset. Group Signal paths wrap store failures as signal/store-failed end-to-end, and retired sender-key ids are now persisted across restarts instead of living only in memory. Sound stickers graduate to a full production pipeline (buildSoundSticker / sendSoundSticker) with the sound-sha256 WebP EXIF stamp byte-compatible with the 2.x line, and stickerAudio content keeps its mentions and quotes instead of dropping them. Channels reach full send parity with chats: buttons (including the native cta_url / cta_copy actions), rich responses and tag cards, stickers and sticker packs, polls, and sound stickers can now all be published to a newsletter channel. New surface: chat themes as a content kind, newsletter channel-status publishing, resumable media downloads, the native-flow button registry (35 names), a status store, and a recent-message cache with placeholder resend. The regression suite also stays green on Node 20 CI again. Test suite: 1633 tests, all passing offline.

What's new in 3.0.4

A patch release completing the 3.0.3 maintenance line. On top of everything in 3.0.3, Signal store failures inside an atomic pre-key decrypt are now separated from decrypt failures end-to-end: a failed one-time pre-key removal after a successful decrypt, and a failed session-record write inside the decrypt, both surface as signal/store-failed with the plaintext preserved — and a pre-key removal is deferred while its session write is failing, so a store flake can never strand a peer. Group setters validate their inputs at the boundary (ephemeral durations must be 0–90 days; wrong-typed settings are rejected instead of being sent as the opposite wire value), a newsletter vote now fails structurally when the port does not acknowledge it instead of issuing a success receipt, and native URL and copy-code buttons are encoded with their recorded wire shapes. Test suite: 1344 tests, all passing offline.

What's new in 3.0.3

A maintenance release fixing 132 verified defects and gaps. The headline fix is the client payload: the login and pairing payloads are now composed in the complete wire layout the server actually decodes (the previous layout decoded incorrectly server-side, which could fail the handshake for both registered logins and fresh pairings), verified byte-for-byte against golden vectors; routed connections now authenticate the noise handshake with the correct prologue. The client also resolves the WhatsApp Web version at connect time from live sources and cross-validates them — a stale source that labels itself "latest" can no longer win over the live revision — with a bundled floor of [2, 3000, 1056665813], so connections no longer depend on a static version pin.

This release also hardens the per-chat send/receive machinery around dispose and restart (lock timers, detached locks, waiters settled on dispose, no frames sent after disposal), stops a stale frame-reassembler timer from closing a healthy reconnected transport, keeps the auth-state capacity cap from evicting the record that was just saved, and preserves per-participant ids in group receipts. Media downloads now handle unencrypted media (plain hash equal to encrypted hash) and a new Group History download type. Newsletters gain metadata query-id rotation plus insights and pending-invites queries. New message envelopes (lottie sticker, audio sticker, group mention, spoiler) are unwrapped and classified, mentions are reconciled between PN and LID forms on send, and legacy button/list messages are converted to native-flow cards automatically on send.

Across the services: zero-length key material is rejected at every save boundary; pre-decrypt validation failures (unknown ciphertext kind, empty body) no longer count toward session recovery, so a healthy session is never reset by malformed input; dispose now stops service timers and in-flight retries; iq responses are only resolved when sender, namespace and type match the request; ephemeral messages decrypt, commit and relay with their envelope intact; group read receipts carry participant and timestamp; signed pre-key generation is idempotent, so a re-mint can never orphan a peer's first message; and media, migration, identity and notification paths gained the bounds and guards their audits specified. Test suite: 1325 tests, all passing offline.

What's new in 3.0.2

A maintenance release fixing verified defects across the Signal store, session recovery, media upload, group retry receipts and the transport layer: save boundaries in the in-memory Signal store now reject malformed identity, session, pre-key and sender-key records at the boundary instead of failing later at load; a session reset after a decrypt failure now builds its recovery bundle before resetting, so a failed bundle build aborts without a destructive reset; media upload responses are size-bounded (1 MiB); group retry receipts after a sender-key rotation no longer silently drop non-requesting members; and a deep scan hardened media-key derivation, custom upload-host handling, provisional pairing markers across restarts, sender-key migration ranges, the WebSocket inbound size cap (16 MiB) and frame reassembly.

New surfaces: the AI rich tag card (richTagCard content kind) with a golden-vector test, and history-sync on-demand requests that reject unrecorded wire shapes by name instead of silently dropping them.

What's new in 3.0.1

A maintenance release fixing 25 verified defects across the services, Signal provider, pairing machine, media pipeline and the Baileys auth-state migration converter, including: group notifications now dispatch on the wire type the server actually sends; peer bundle signed-pre-key signatures are cryptographically verified before a session is built; sender addresses are canonicalised (LID ↔ phone number) before decryption; the pairing attempt budget now follows the specified 10-minute window semantics and persists across restarts; failed group decryption no longer consumes message keys in stores that return live references; migration output addresses are normalised so the provider finds migrated sessions and sender keys.

New surfaces: a rich-message primitive compiler with a pending-edit flow, a Meta AI msmsg decryptor feeding the messages.meta-ai event, an encrypted message-edit decryptor, a media-download readiness inspector, payment reminder / split-payment builders, a public client.switchPairingChannel(mode) for switching between QR and pairing-code flows mid-attempt, and a decrypt-failure escalation event (messages.decrypt-failure-escalation) after repeated failures from one peer.

Consumption (dual package)

The package builds as both ESM and CommonJS, with full type declarations for both:

// ESM / TypeScript
import { encodeNode, decodeNode } from '@aunucore/baileys'
// CommonJS
const { encodeNode, decodeNode } = require('@aunucore/baileys')

Per-layer subpaths are also exposed: @aunucore/baileys/codec, @aunucore/baileys/transport, @aunucore/baileys/session, @aunucore/baileys/signal, @aunucore/baileys/bus, @aunucore/baileys/diagnostics, @aunucore/baileys/migration.

Dual-package note: because Node can load the ESM and CJS copies in one process, this library keeps no module-level singleton state — all state lives in instances created by the consumer.

Development

npm install
npm run build   # tsc ESM + tsc CJS + postbuild (one command)
npm test        # build + node --test + type-resolution checks

All tests run offline against the project's own fake-server rig.

License

AGPL-3.0 — see LICENSE. Third-party components actually used are recorded in NOTICE.

探索相关项目

加载中…