Identity intake: channel-normalized lead capture (spec + Rust + TS client)#173
Merged
Conversation
…+ TS client) A structured identity/lead-intake primitive normalized across channels: on form-capable clients (chat widget declares supports:['identity_form']) the agent's request_identity_intake tool parks the turn and the server emits identity_intake_required; the client's form replies with the submit_identity_intake action (server-side validation: required fields, email shape, E.164 phone; invalid => identity_intake_invalid, turn stays parked). Text-only channels degrade to a validated conversational turn-by-turn collection through the submit_identity_intake tool — both paths resume with the same validated payload and attach the identity to the session on the OTP contact keys (intake=collect, OTP=verify). Design doc: docs/Architecture/Identity Intake.md. Parity for the TS/Python/Go/.NET servers is tracked as follow-ups; the spec + conformance fixtures are the complete contract. Also fixes the pre-existing lambda dispatch build break (missing usage arg on eventual_response). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FczKhti6h4s6yhYXG6V86o
🦋 Changeset detectedLatest commit: 9acd2e2 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Agents need the visitor's name/email/phone constantly, and every channel improvises: the widget has an all-or-nothing pre-chat form, SMS/voice freestyle the asks with no validation. There is no channel-normalized primitive.
Solution
One agent verb, two channel shapes, one validated payload (full design:
docs/Architecture/Identity Intake.md):create_conversation_sessiongains optionalsupports: ["identity_form"]— the widget declares it; SMS/voice never do.request_identity_intaketool parks the turn (write-confirmation park-and-resume pattern), the server emitsidentity_intake_required, the client's inline form replies with thesubmit_identity_intakeaction. Server-side validation (required fields, email shape, E.164 phone normalization); invalid values emitidentity_intake_invalid(mirrorsotp_invalid— retryable, turn stays parked). A decline resumes gracefully (declined: true).submit_identity_intaketool — same validation, identical resume payload.userName/contactEmail/contactPhonesession metadata — the same keys the OTP contact seam reads (intake=collect, OTP=verify; unification designed-in, not built).Shipped here
spec/: 2 new event schemas + 1 action schema +supports+ envelope enums + conformance fixturesidentity_intakemodule (shared validation) + the two tools insmooai-smooth-operator; protocol constructors, pending-intake registry, capability parsing,submit_identity_intakedispatch + runner bridge insmooai-smooth-operator-serversupports,submitIdentityIntake()usagearg)Tests
tests/identity_intake.rs— form park/invalid-stays-parked/valid-resume/decline, conversational bad-email-reask/normalization, capability recording, no-pending error) — fmt + clippy cleanFollow-ups (parity, per repo process)
TS / Python / Go / .NET server implementations of the seam — the spec + fixtures in this PR are the complete contract.
🤖 Generated with Claude Code
https://claude.ai/code/session_01FczKhti6h4s6yhYXG6V86o