github assistant-ui/assistant-ui @assistant-ui/core@0.2.6

latest releases: @assistant-ui/core@0.2.7, @assistant-ui/react-langgraph@0.14.4, @assistant-ui/react-mcp@0.0.3...
7 hours ago

Patch Changes

  • #4120 372d4f0 - feat: simplify MessagePrimitive.GroupedParts API and add groupPartByType helper. (@Yonom)

    • New groupPartByType({ ... }) helper builds a groupBy from a part.type → group-key path lookup. The map keys are typed against PartState["type"] (autocomplete + typo rejection), missing keys leave the part ungrouped, and the returned function carries an internal memo fingerprint so the tree survives unrelated re-renders even when reconstructed inline.
    • Special map key "mcp-app" matches tool-call parts that point at an assistant-ui MCP app resource (ui://...). It takes precedence over the "tool-call" entry for those parts, so MCP apps can be routed separately (e.g. rendered outside a chain-of-thought wrapper).
    • groupBy signature simplified from (part, index, parts) => string | string[] | null | undefined to (part) => readonly \group-${string}`[] | null. The 2nd/3rd args were unused in practice. Arrays are required (no bare-string shorthand); nullis accepted as an alias for[]` to soften the migration.
    • Internal memoization now uses the helper's memo fingerprint when present, otherwise rebuilds the tree per render (O(n), cheap). The previous "pass a stable reference" advice is dropped — inline groupBy is fine.
    • Docs and examples updated to lead with groupPartByType. The getMcpAppFromToolPart branch in packages/ui switches to "mcp-app": [] via the helper.
  • #4107 32ae846 - feat: surface AI SDK v6 tool approvals as a first-class respondToApproval prop on tool components. tool-call parts in the approval-requested state now carry part.approval = { id, isAutomatic? }; tool components call respondToApproval({ approved, reason? }) to ack the gate without threading chatHelpers through application context. also fixes a transient requires-action flicker for the approval-responded state and tightens the external-message converter so interrupt vs pending tool calls are distinguished by an actual interrupt/approval field rather than by result === undefined. (@okisdev)

  • Updated dependencies [d4f1db4]:

    • assistant-stream@0.3.17

Don't miss a new assistant-ui release

NewReleases is sending notifications on new releases.