Commit Graph

8 Commits

Author SHA1 Message Date
josh 25ebc3b925 feat(twilio): add sms, mms, and voice helpers (#558)
## summary

adds a first-class Twilio adapter for SMS and MMS bots, plus low-level
voice helpers for custom Twilio voice routes

this includes webhook parsing and signature verification, outbound
Messages API helpers, phone-number and Messaging Service sending,
inbound MMS attachments with authenticated `fetchData`, plain text card
fallback rendering, markdown conversion, and runtime-light `api`,
`webhook`, `voice`, and `format` subpaths

the adapter intentionally avoids the `twilio` npm runtime dependency so
apps can use the low-level helpers without pulling in the full SDK
2026-05-27 15:39:23 -07:00
Ben Sabic 79227ae991 docs: refresh adapter pages with hand-authored MDX (#474)
## Summary

Refreshes the adapter docs end-to-end so every adapter — official,
vendor-official, and community — now ships hand-authored MDX, lives
under a clean URL structure, and renders on a polished
sidebar/right-rail layout dedicated to `/adapters` (the shared `/docs`
chrome is untouched).

```mermaid
flowchart LR
  subgraph Before
    direction TB
    OB[official] --> CB[community<br/>incl. 5 vendor pages]
  end
  subgraph After
    direction TB
    OA[official] --> VA[vendor-official<br/>5 pages] --> CA[community]
  end
  Before -.-> After
```

### Content & routing

- **New `/adapters/vendor-official/<slug>` route** for vendor-maintained
adapters (Beeper Matrix, Photon iMessage, Liveblocks, Resend, Zernio).
Sidebar gets a third labelled group ("Vendor-Official Adapters") between
Official and Community, with a top divider matching the existing
Community treatment.
- **All 13 vendor-official + community adapters migrated** from runtime
README fetching to hand-authored MDX with rich `features:` matrices and
full body content (install, quick start, configuration, auth,
gateway/streaming, troubleshooting). README fetch stays as a fallback
for any future community adapter that hasn't been migrated yet, gated by
a new `mdxBody: true` frontmatter flag.
- **Messenger filter pages removed** (`/adapters/for/<messenger>` + the
"Browse by messenger" chip row on `/adapters`). Existing URLs
308-redirect to `/adapters`.
- **Permanent redirects** from
`/adapters/community/{matrix,imessage,resend,zernio,liveblocks}` to
their new `/adapters/vendor-official/...` paths.
- **Fixed** `/docs/adapters` and `/docs/state` so the bare pages are
accessible again — the previous catch-all redirect (`:slug*`) was
swallowing them. Switched to `:slug+` so subpath URLs still 308 while
the bare pages render.

### Visual polish

- **Adapter-only sidebar variant** (`AdaptersDocsLayout` +
`AdaptersSidebar`) with uppercase eyebrow separators, tighter rows, and
a thin themed scrollbar utility class. The shared `/docs` sidebar is
untouched.
- **Restyled `AdapterHero`**: drops the badges row + packageName, sits
the title inline with the logo, larger 17 px tagline, horizontal divider
beneath the block.
- **Restyled `PackageInstall`** as a tabbed dark single-line snippet
with a `$` prompt prefix and a copy button — replaces the previous
multi-line `CodeBlock` layout.
- **New "Deploy your chat app on Vercel" upsell card** (`<Upsell />`)
replaces the old `EditSource / ScrollTop / Feedback / CopyPage` footer
cluster on every adapter detail page.
- **Listing & messenger pages**: align the H1 to a tighter `text-4xl
sm:text-[44px]`, and the section headers to `text-base font-medium
tracking-tight` with a one-line muted lede.

### Tooling & tests

- Added `mdxBody: true` opt-in to the adapter frontmatter schema
(`source.config.ts`), and updated both detail-page handlers
(`community/[slug]` and the new `vendor-official/[slug]`) to render the
MDX body when present, falling back to README fetch otherwise.
- Refactored both detail-page handlers to flatten the body-render
branches into a `renderBody()` helper, removing the nested ternaries
that were tripping `lint/style/noNestedTernary`.
- New test file
[`packages/integration-tests/src/docs-adapters.test.ts`](https://github.com/vercel/chat/blob/docs/refresh-adapters/packages/integration-tests/src/docs-adapters.test.ts)
— **220 new assertions** covering:
- Adapter MDX frontmatter completeness, slug ↔ filename consistency, and
`type ∈ {platform, state}`.
- Vendor-official invariants: exactly the expected slugs,
`vendorOfficial: true`, `community: true`, `author`, `mdxBody: true`,
`<FeatureSupport />` rendered.
- Community invariants: `community: true` (never vendor-official),
`mdxBody: true`, `<FeatureSupport />`.
- Official invariants: never flagged, `packageName` always under
`@chat-adapter/*`.
- `adapters.json` ↔ MDX sync on `packageName` / `type` / `community` /
`vendorOfficial`.
- Extended `VALID_DOC_PACKAGES` so `docs-content.test.ts` accepts the
new vendor-official + community packages, plus `@chat-adapter/web`,
`@chat-adapter/web/react`, and `@chat-adapter/messenger`.

### Per-package AGENTS.md

- Added `AGENTS.md` to every official adapter and state adapter (14
packages), each tailored to that adapter's surface — overview, directory
layout, build/test commands, public exports, thread ID format, webhook
flow, authentication, format conversion, cards/streaming, platform
quirks, testing approach, coding conventions, and release rules.
- Added a one-line `CLAUDE.md` (`@AGENTS.md`) beside each so Claude Code
picks up the same instructions through its built-in resolver — same
convention as the root.

### Web adapter copy

- Cleaned up the Web adapter tagline (removed inline backticks) and
dropped the now-redundant "v1 scope" section from the body.

---------

Co-authored-by: Ben Sabic <bensabic@users.noreply.github.com>
2026-05-12 16:01:19 +10:00
Ben Sabic b0ab804f18 - Bundle guide markdown and a templates manifest with the chat package at resources/guides/*.md and resources/templates.json so AI agents can discover Chat SDK resources offline (#423)
- Add scripts/sync-resources.ts (run via pnpm sync-resources) that reads apps/docs/resources-edge-config.json, fetches each guide's .md version over https with a timeout and size cap, writes templates.json, and regenerates the Available resources block in skills/chat/SKILL.md
- Migrate the Slack Next.js, Discord Nuxt, and Hono code-review guides from on-site MDX to Vercel KB and register them in the resources edge-config JSON alongside the existing external guides
- Remove /docs/guides MDX content, sidebar entries, top-level Guides nav entry, getting-started cards, and the dead /guides/ branch in the sitemap route now that all guides live externally and are surfaced on /resources
- Replace the homepage Guides/Templates section and the standalone Adapters pill section with a single two-column Resources + Adapters section (icons, headings, descriptions, outline buttons, divider), and drop the URL footer from ResourceCard on the Resources page
- Update skills/chat/SKILL.md to point at resources/guides and resources/templates.json and list the available guides and templates between marker comments that sync-resources rewrites
- Add tsx to knip's ignoreBinaries so npx tsx in the new script does not fail lint

Co-authored-by: Ben Sabic <bensabic@users.noreply.github.com>
Co-authored-by: dancer <josh@afterima.ge>
2026-04-27 10:20:44 +10:00
christopherkindl 46fc5bbe9d Sync docs with @vercel/geistdocs 1.2.0–1.2.3 (#399)
* docs: sync geistdocs template 1.2.0–1.2.3 + polish

- Ran @vercel/geistdocs@1.2.2 update --sync against origin/main
  (already contains merged 1.2.3) for:
  - components/geistdocs/*
  - components/geistcn-fallbacks/**/*  (new)
  - components/ui/command-prompt.tsx, navigation-menu.tsx
  - app/styles/geistdocs.css
- Manual overlays (paths skipped by sync due to chat customizations):
  - app/[lang]/layout.tsx: drop scroll-smooth (1.2.2)
  - app/[lang]/docs/[[...slug]]/page.tsx: MobileDocsBar + disable
    default TOC popover (1.2.0)
  - app/[lang]/docs/layout.tsx: wrap in bg-background-200 (1.2.3)
  - components/ui/badge.tsx: secondary variant → bg-gray-300/text-gray-1000 (1.2.3)
- Home hero: replace Get Started + Installer with CommandPrompt
  humans/agents switcher ("npm install chat" / "npx skills add vercel/chat")
- (home) layout: swap bg-sidebar dark:bg-background for bg-background-200
  so /, /adapters, /resources share the navbar surface
- DesktopMenu: active-state detection with longest-prefix match
  (so /docs/api highlights "API", not also "Docs")
- navbar-logo dropdown: drop Chat SDK self-entry
- New geist-fill icons (check-circle-fill, cross-circle-fill,
  warning-fill) ported from @vercel/geistcn-assets; new
  components/custom/status-icons.tsx registers Check/Cross/Warn MDX
  components
- content/docs/adapters.mdx: replace ✅/❌/⚠️ emojis with the new
  icons (emoji.mdx intentionally left alone)

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* docs: use LogoChatSdk from geistcn-fallbacks as the app Logo

Replace the inline Chat SDK wordmark SVG in geistdocs.tsx with
<LogoChatSdk /> so the navbar and other Logo consumers share the
same source of truth.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* docs: default hero CommandPrompt to humans tab

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-18 09:23:36 +10:00
Hayden Bleasel 30698ed6d8 Adapters (#204)
* Initial marketplace draft

* Update language

* Add logos to cards

* Redesign cards

* Update adapter-card.tsx

* Update adapter-card.tsx

* Migrate marketplace to adapters

* Update meta.json

* Split adapters into new three groups

* Add iMessage

* Move adapter docs to READMEs

* Cleanup docs

* Add more logos, implement shadcn ui components

* Update adapters.json

* Add Streamdown

* Fetch vercel readmes from workspace

* Update readme-content.tsx

* Upgrade Streamdown

* Update global.css

* Update adapters.json

* Update adapters.json

* Add links to docs

* List upcoming official adapters

* Update adapters.json

* Fix adapters links

* Fix typo

* Misc fixes

* Update adapters.json

* Update adapters.json

* Migrate new info

* Update pnpm-lock.yaml

* Update adapter-card.tsx

* Add postgres to adapters page

* Update adapter-card.tsx

* Migrate postgres docs

* Add pg to valid README imports

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* Move feature matrices from docs to package READMEs

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* Remove packages tables from adapter/state docs

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* Genericize adapter/state doc descriptions

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix: improve adapters page accessibility and empty state handling

* Add custom adapter building section to SKILL.md

* Use currentColor for GitHub, Linear, and Memory icons

* Use GitHub API for README fetch, add heading to fallback state

Use the GitHub REST API instead of raw.githubusercontent.com to
automatically resolve the repo's default branch, so community
adapters using master or other branch names work correctly.

* Update adapters-grid.tsx

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-authored-by: Ben Sabic <bensabic@users.noreply.github.com>
2026-03-09 16:09:42 -07:00
Brycero 3bbe7e8e5c Fix URL path for editing source in GitHub (#97) 2026-02-24 14:51:05 -08:00
Hayden Bleasel 0edc599927 Docs updates (#52)
* Update meta.json

* Create posting-messages.mdx

* Colocate Slack app info

* Improve feature matrix

* Create API Reference

* Update for Channels

* Draft first guide

* Update Geistdocs
2026-02-17 13:01:15 -08:00
Hayden Bleasel 7f3bf039bd Scaffold Geistdocs app 2026-02-16 16:41:54 -08:00