Commit b8ee443
committed
feat(teams): modals primitive subpath (chat@4.31 8c71411)
Port the net-new Teams modals-primitives surface (index.ts + types.ts,
NEW in vercel/chat@4.31.0, commit 8c71411) as an SDK-free, runtime-free
subpath: chat_sdk.adapters.teams.modals.
- modal_to_adaptive_card: render a Modal into a Teams Adaptive Card,
delegating emoji conversion to the format primitive and reusing the
cards-primitive TeamsFieldElement (label/value) for the fields child.
- parse_teams_dialog_submit_values: extract submitted values, skipping
exactly the three reserved wire keys (__callbackId / __contextId /
msteams), kept literal so they round-trip the Teams dialog submit and
cross the SDK-state boundary; only string-typed values pass.
- to_teams_task_module_response: build the continue/close/errors/push/
update task-module envelope; action == "close" (and a missing
response) yields None. Content type is the literal
application/vnd.microsoft.card.adaptive.
Truthiness mirrors upstream byte-for-byte (optional emit guards use
truthiness so an empty string / maxLength: 0 is omitted), while the
nullish-coalescing reads use is-not-None per the port rules.
Tests: 10 it ports + boundary (source-scan AND fresh-interpreter
no-eager-import for microsoft_teams / httpx / aiohttp).1 parent 6ed219a commit b8ee443
2 files changed
Lines changed: 706 additions & 0 deletions
0 commit comments