Skip to content

fix(types): restore the six host fields the vendored contract dropped - #71

Merged
rmyndharis merged 1 commit into
mainfrom
fix/complete-the-vendored-contract
Aug 8, 2026
Merged

fix(types): restore the six host fields the vendored contract dropped#71
rmyndharis merged 1 commit into
mainfrom
fix/complete-the-vendored-contract

Conversation

@rmyndharis

Copy link
Copy Markdown
Owner

What

types/openwa.d.ts states it was "verified field-by-field" against six core files at v0.14.0. A member-level diff finds six fields it does not carry — and none of them annotated, which is how this file marks every other thing it deliberately leaves out.

Interface Missing
IncomingMessage ephemeralDuration, call, backgroundColor, font
ChatSummary kind
ConversationSendEnvelope linkPreview

Four of the six predated the v0.14.0 alignment by several minor versions. So this was not a vendored copy lagging a moving host — they were missed.

Why it matters despite nothing being broken

Nothing failed: a plugin needing one of these could cast around the type. The cost is the thing a vendored contract exists to prevent — discoverability.

The author of a status-relay plugin has no way to learn that backgroundColor and font are on the payload. The author of a link-relaying plugin has no way to learn about linkPreview, which on Baileys is the difference between a rich preview and a bare URL, because Baileys only generates one when the flag is true.

ChatSummary.kind is required

It is required in core, and it is required here. Nothing in the repo constructs a ChatSummarychatwoot-adapter casts the engine result — so the whole repo still typechecks.

The attestation itself

The header now says plainly that "verified field-by-field" is a hand check that nothing enforces, that it has been wrong before, and that a re-alignment must diff member by member and annotate anything left out — so a future reader can tell an omission from a decision.

This package ships separately and cannot import from core, so an honest caveat is the most the file can offer. It is still better than a claim that reads like a guarantee.

Verification

npm run typecheck (tsc --noEmit, whole repo) clean, 548 tests passing, catalog gate up to date.

The header says the file was verified field-by-field against six core files at
v0.14.0. A member-level diff finds six fields it does not carry, none of them
annotated as a deliberate narrowing — which is how this file marks everything
else it leaves out.

IncomingMessage was missing `ephemeralDuration`, `call`, `backgroundColor` and
`font`; ChatSummary was missing `kind`; ConversationSendEnvelope was missing
`linkPreview`. Four of the six predated the v0.14.0 alignment by several minor
versions, so they were not a lag behind a moving host — they were simply missed.

Nothing was broken by their absence: a plugin needing one could cast. But the
cost is exactly what a vendored contract exists to prevent — the author of a
status-relay plugin has no way to discover that `backgroundColor` and `font`
are on the payload, and the author of a link-relaying plugin has no way to
discover `linkPreview`, which is the difference between a rich preview and a
bare URL on Baileys.

`ChatSummary.kind` is required here, as it is in core; nothing constructs a
ChatSummary, so the whole repo still typechecks.

The header now says plainly that the field-by-field check is a hand check that
nothing enforces, and that it has been wrong before. This package ships
separately and cannot import from core, so an honest caveat is the most the file
can offer — but a reader re-aligning it should know the claim is not a guarantee.
@rmyndharis
rmyndharis merged commit 32d9717 into main Aug 8, 2026
1 check passed
@rmyndharis
rmyndharis deleted the fix/complete-the-vendored-contract branch August 8, 2026 07:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant