migrate-waniwani-sdk-0.18-to-0.19
Migrate @waniwani/sdk 0.18 → 0.19
A self-contained migration for the single hop from 0.18.x to 0.19.x (the first published 0.19 release is 0.19.1; 0.19.0 was never published to npm). Apply it when a project on 0.18 is moving to 0.19. It covers only that jump; for other version boundaries use the matching migrate-waniwani-sdk-<from>-to-<to> skill, or the general procedure in the SDK's changelog.
Precondition: the project is on @waniwani/sdk@0.18.x. If it is on an older version, migrate up to 0.18 first (each jump ships its own migration skill); if it is already on 0.19+, there is nothing to do here.
What 0.19 changes
Flow interrupt({ suggestions }) values now also render as clickable pills above the input in the Waniwani chat widget, gated by a named origin list. Almost all of it is additive; the one break:
suggestion.clickedgained a requiredproperties.originfield —"channel" | "page" | "flow" | "followup", reporting which provider supplied the clicked pill. On 0.18.x the payload was{ text, index }. The field is part ofWidgetEventDetail/WidgetEventfrom@waniwani/sdk/chat.
Also shipped (no action required):
SuggestionsConfig.origins(SuggestionOrigin[]) replaces thedynamicboolean on the<ChatEmbed>primitive.dynamicis deprecated but still works:truemaps to every origin,falseto none,originswins when both are set.suggestionOriginson<WaniwaniChat>overrides anddata-suggestion-originson the<script>embed. Default everywhere is["channel", "page", "followup"]— flow-driven pills stay opt-in.- Flow tool results always carry
_meta["waniwani/suggestions"](exported asSUGGESTIONS_META_KEY/SuggestionsMeta). Additive; hosts that ignore_metaare unaffected.
Not affected: reading widget events through onEvent — origin is a new, always-populated field, so existing readers keep compiling and running. Other MCP hosts (ChatGPT, Claude) see no behavior change.