Skip to content

Rich Interactions: card registry + identity_intake card#27

Merged
brentrager merged 1 commit into
mainfrom
identity-intake
Jul 3, 2026
Merged

Rich Interactions: card registry + identity_intake card#27
brentrager merged 1 commit into
mainfrom
identity-intake

Conversation

@brentrager

Copy link
Copy Markdown
Contributor

The widget's half of the smooth-operator Rich Interactions framework (see smooth-operator docs/Architecture/Rich Interactions.md + SmooAI/smooth-operator#176).

  • Card registry (INTERACTION_CARDS): interaction kind → overlay card rendered above the composer (the OTP / tool-approval overlay slot). Registering a card IS declaring its capability: supports at create_conversation_session is derived from the registry (a test keeps them aligned). Adding a kind = one card builder + one entry.
  • identity_intake card: fields driven by the interaction's spec (reuses the pre-chat form field pattern — same classes, libphonenumber as-you-type formatting, E.164 canonicalization), per-field server-side errors (interaction_invalid re-renders the card, turn stays parked), known-identity pre-fill, 'No thanks' decline.
  • Controller: generic interaction interrupt + submitInteraction() / declineInteraction() (echoing interactionId); accepted identity values merge into the persisted visitor identity on the server ack; unknown kinds auto-decline so a turn can never hang.
  • Dep: @smooai/smooth-operator ^1.21.1 (the generic submitInteraction client verb).

Tests

130 passed — 8 new: capability/registry alignment, card rendering from spec + labels + prefill, per-field server errors, submit w/ E.164 canonicalization, decline, unknown-kind auto-decline, controller park→invalid→resubmit→persist + decline flows. pnpm check (typecheck + test + build) green.

🤖 Generated with Claude Code

https://claude.ai/code/session_01FczKhti6h4s6yhYXG6V86o

The widget's half of the smooth-operator Rich Interactions framework
(smooth-operator docs/Architecture/Rich Interactions.md):

- INTERACTION_CARDS registry (kind -> overlay card); registering a card IS
  declaring its render capability — supports: ['identity_form'] is derived
  from the registry and asserted aligned by a test. The OTP/tool-approval
  overlays are prior instances to retrofit onto the registry later.
- identity_intake card: fields from the interaction spec (pre-chat form
  field pattern + libphonenumber formatting + E.164 canonicalization),
  per-field server errors (interaction_invalid re-renders, turn stays
  parked), known-identity pre-fill, decline affordance.
- Controller: generic interaction interrupt + submitInteraction /
  declineInteraction resume verbs (interactionId echoed); accepted
  identity values merge into the persisted store on the server ack;
  unknown kinds auto-decline so a turn can never hang.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FczKhti6h4s6yhYXG6V86o
@changeset-bot

changeset-bot Bot commented Jul 3, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 41f9275

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@smooai/chat-widget Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@brentrager brentrager merged commit 7180b52 into main Jul 3, 2026
1 check passed
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