Skip to content

Add the vendor-official Wayza adapter - #1127

Draft
snappyio wants to merge 2 commits into
vercel:mainfrom
wayza-protocol:wayza-adapter
Draft

snappyio wants to merge 2 commits into
vercel:mainfrom
wayza-protocol:wayza-adapter

Conversation

@snappyio

@snappyio snappyio commented Nov 8, 2026

Copy link
Copy Markdown

Summary

Adds @wayza/chat-adapter, built and maintained by Wayza, as a vendor-official adapter. It gives a Chat SDK bot its own Wayza address, where people and AIs from any maker (Claude, ChatGPT, Grok, or another Chat SDK bot) can message it, in direct threads and in Wayza rooms. With no key, the bot signs itself up on first start.

  • Docs page apps/docs/content/adapters/vendor-official/wayza.mdx, registered in meta.json
  • Catalog entry packages/catalog/src/adapters/vendor-official/wayza.ts, registered in ADAPTERS
  • create-chat-sdk scaffold entry (zero-arg, webhook-compatible)
  • Changeset: patch for @chat-adapter/catalog and create-chat-sdk

Qualifications:

Test plan

  • pnpm validate
  • The adapter's own tests (11, vitest) and a live two-bot run over wayza.com, in the adapter repo

Checklist

  • All commits are signed and verified
  • All commits are signed off for the DCO (git commit -s)
  • pnpm validate passes
  • Changeset added
  • Documentation updated

Signed-off-by: Graham <graham@snappy.io>
@snappyio
snappyio requested a review from a team November 8, 2026 11:06
@vercel

vercel Bot commented Nov 8, 2026

Copy link
Copy Markdown
Contributor

@snappyio is attempting to deploy a commit to the Vercel Team on Vercel.

A member of the Team first needs to authorize it.

Signed-off-by: Graham <graham@snappy.io>

@bensabic bensabic left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Requesting changes

Thanks for the adapter. Its docs and catalog entry closely match the published @wayza/chat-adapter@0.1.0. Three things block merge:

  1. pnpm validate fails. ultracite check flags a formatting error in packages/catalog/src/adapters/vendor-official/wayza.ts:27 (suggestion inline).
  2. Both commits are unsigned. 3a67521 and f0e005f show verified: false, reason: "unsigned". .github/CONTRIBUTING.md says PRs with unsigned commits won't be merged. DCO sign-offs are present and match the author email. Re-sign and force-push, e.g. git rebase --exec 'git commit --amend --no-edit -S -s' main.
  3. The create-chat-sdk scaffold doesn't work when deployed. It uses memory state and treats every WAYZA_* var as optional, so each cold start signs up a new Wayza AI. Webhooks also 401 without a secret and need subscribe(). See the inline comments on wayza.ts:9 and wayza.mdx:20.

The other inline comments are suggestions: claim-link disclosure, subscribe() identity, room delivery under webhooks, feature-matrix accuracy (buttons, select menus, fetchMessages), and page layout. Also, the PR title isn't in Conventional Commits form, which CONTRIBUTING asks for; suggest feat(catalog): add vendor-official Wayza adapter.

What was verified (head f0e005f)

  • pnpm install --frozen-lockfile and knip pass. turbo typecheck passes 49/49 (run with --concurrency=1). turbo test passes 58/58, including catalog, create-chat-sdk (with the all-adapter scaffold e2e), and integration-tests docs-adapters.test.ts. build:validate passes. ultracite check fails (item 1).
  • The npm package exists: Apache-2.0, ESM-only, peer chat ^4.44.0, no install scripts. Its repository field points at wayza-protocol/wayza-js. The pinned commit 53d469b exists, and rebuilding from it reproduces the published dist/ byte-for-byte.
  • Every docs code sample typechecks under tsc --strict against the published package and chat@4.44.0.
  • The credential claim holds: key is resolved on every request, webhookSecret on every webhook and subscribe(), and deployKey at sign-up.
  • Network calls go only to ${home}/wayza/v0/*, with no telemetry and no disk writes. Webhook signatures are verified in constant time before parsing.
  • Meta.json ordering, the ADAPTERS entry, the scaffold-spec shape, and the changeset bumps follow existing vendor-official conventions.

Not verified

  • CI hasn't run. The fork workflow is action_required.
  • The docs site build was not run, due to sandbox memory limits. MDX compiles and the docs typecheck passes.
  • Live Wayza behavior. No real accounts were created. Questions for the vendor, from comparing adapter source with Wayza's docs:
    • room.asked isn't in Wayza's published wake-up list, and ownerless AIs reportedly can't subscribe to more than their own messages. Does subscribe() throw for a self-signed-up bot?
    • Ownerless AIs get at most 3 webhooks and 10 new ones a day, and each subscribe() registers 2. Does a daily renewal count as new?
    • The adapter checks event.name === "_gap", but Wayza's docs show {"type":"gap"}. Does gap recovery ever trigger?
    • Concurrent cold starts sharing state can both sign up, since there's no lock. The identity state key also includes userName, so renaming the bot creates a new identity.

"WAYZA_WEBHOOK_SECRET",
"Standard Webhooks secret (whsec_ followed by 32 random bytes in base64) for signed deliveries."
),
env("WAYZA_HOME", "Override the Wayza home. Defaults to https://wayza.com."),

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Blocking: pnpm validate fails here. ultracite check wants this call wrapped:

packages/catalog/src/adapters/vendor-official/wayza.ts format
  × Formatter would have printed the following content:
    27 │ - env("WAYZA_HOME", "Override the Wayza home. Defaults to https://wayza.com."),
Suggested change
env("WAYZA_HOME", "Override the Wayza home. Defaults to https://wayza.com."),
env(
"WAYZA_HOME",
"Override the Wayza home. Defaults to https://wayza.com."
),

description:
"Gives a Chat SDK bot its own Wayza address, where people and AIs from any maker (Claude, ChatGPT, Grok, or another Chat SDK bot) can message it, in direct threads and in Wayza rooms. With no key, the bot signs itself up on first start.",
env: {
config: ["instance", "name", "cautionInText"],

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Blocking: the generated scaffold breaks when deployed. With wayza memory, the scaffold emits createWayzaAdapter() + createMemoryState(), and .env.example marks every WAYZA_* var as optional. In @wayza/chat-adapter@0.1.0, me() signs up fresh (GET /agents/challenge → PoW → POST /agents) whenever there's no key and no identity in state. A smoke test with mocked fetch gave a new address on every cold start (ai-1@…, then ai-2@…), each logging a new claim link. Also, handleWebhook returns 401 when WAYZA_WEBHOOK_SECRET is unset, and delivery only starts after subscribe(). Wayza has no dashboard webhook URL, which the scaffold README implies it does.

Net effect: a scaffolded bot deployed to serverless as generated never answers, and every cold start creates an orphaned Wayza AI. At minimum, surface this through notes (it's rendered into .env.example). Consider also moving WAYZA_WEBHOOK_URL/WAYZA_WEBHOOK_SECRET to required, since the scaffold is webhook-only (Gmail does this for its push-verification vars).

Suggested change
config: ["instance", "name", "cautionInText"],
config: ["instance", "name", "cautionInText"],
notes:
"Set WAYZA_KEY or use a persistent state adapter such as Redis or Postgres. With in-memory state and no key, the bot signs up as a new Wayza AI every time a process or serverless instance starts. Webhooks need WAYZA_WEBHOOK_URL and WAYZA_WEBHOOK_SECRET, and a subscribe() call after deploying, renewed at least every 7 days.",


<CreateChatSdk adapters="wayza memory" />

The generated app uses the [Memory state adapter](/adapters/official/memory) for local development. To add the adapter to an existing app, start at [Install](#install).

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same issue as the catalog comment: the scaffold path never sees the warning under Install (line 26). Please put it where scaffold users will read it. Also, nothing here, in the README, or on wayza.com/docs/chat-sdk says where a user gets a WAYZA_KEY. A self-signed-up key only ever goes into Chat SDK state and is never logged.

Suggested change
The generated app uses the [Memory state adapter](/adapters/official/memory) for local development. To add the adapter to an existing app, start at [Install](#install).
The generated app uses the [Memory state adapter](/adapters/official/memory) for local development. Memory state doesn't keep the bot's Wayza identity, so without `WAYZA_KEY` the bot signs up as a new Wayza AI every time the process or a serverless instance starts. Before you deploy, set `WAYZA_KEY` or switch to [Redis](/adapters/official/redis) or [PostgreSQL](/adapters/official/postgres). To add the adapter to an existing app, start at [Install](#install).


A bot that signs itself up is an AI with no owner. Its name shows as "Concierge (unverified)", it works within daily limits, and people choose whether AIs with no owner may reach them.

The first log line gives you a claim link. Open it yourself, once, within 7 days, and never share it: whoever opens it first owns the bot. The bot then moves to an address under your name and keeps its conversations.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggestion: the page says to never share the claim link, but the adapter itself logs it at info (loadIdentity(): "To make this bot yours, open ${id.claim_link} yourself …") and saves it in state next to the key. Anyone with log or log-drain access can claim the bot. Wayza's changelog also says ownerless AIs left unused for 30 days are retired. Please disclose both.

Suggested change
The first log line gives you a claim link. Open it yourself, once, within 7 days, and never share it: whoever opens it first owns the bot. The bot then moves to an address under your name and keeps its conversations.
The first time it signs up, the adapter logs a claim link at `info` level and keeps it in Chat SDK state with the bot's key. Anyone who can read those logs or that state, including log drains, can claim the bot: whoever opens the link first owns it. Open it yourself, once, within 7 days, or start with a deploy key (below) where logs are shared. The bot then moves to an address under your name and keeps its conversations. A bot with no owner that goes unused for 30 days is retired, and its key stops working.

await bot.getAdapter("wayza").subscribe();
```

Wayza checks the URL with a signed challenge, then signs every delivery with Standard Webhooks. A subscription lasts 7 days, so call `subscribe()` again on a daily cron.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggestion: subscribe() calls me() first, so running this snippet as a separate script with memory state and no key signs up and subscribes a different bot. It also ends with await this.poll(), which runs handlers inside the script process.

Suggested change
Wayza checks the URL with a signed challenge, then signs every delivery with Standard Webhooks. A subscription lasts 7 days, so call `subscribe()` again on a daily cron.
Wayza checks the URL with a signed challenge, then signs every delivery with Standard Webhooks. Run `subscribe()` with the deployed bot's identity: set `WAYZA_KEY`, or share its persistent state. Otherwise the script signs up and subscribes a different bot. `subscribe()` also polls once and runs your handlers for anything already waiting. A subscription lasts 7 days, so call `subscribe()` again on a daily cron.

cardFormat: { status: "yes", label: "Markdown" },
buttons: { status: "partial", label: "Listed as choices" },
linkButtons: "yes",
selectMenus: { status: "partial", label: "Listed as choices" },

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as buttons: select menus render as text, with no interaction.

Suggested change
selectMenus: { status: "partial", label: "Listed as choices" },
selectMenus: { status: "no", label: "Rendered as a text list" },

ephemeralMessages: "no",
userLookup: "no",
customApiEndpoint: { status: "yes", label: "home override" },
fetchMessages: "yes",

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggestion: for DMs, fetchMessages reads one inbox page and keeps only messages from that address, so the bot's own replies are missing and there's no cursor. For rooms it pages only forward, and backward ignores cursor. Dial labels similar behavior partial.

Suggested change
fetchMessages: "yes",
fetchMessages: {
status: "partial",
label: "DMs: latest received only; rooms: latest page or forward",
},

| `WAYZA_WEBHOOK_SECRET` | For webhooks | Standard Webhooks secret (`whsec_` and 32 random bytes in base64). |
| `WAYZA_HOME` | No | Override the Wayza home. |

## Threads

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggestion (layout): .agents/skills/add-adapter/references/page-layout.md asks for ## Thread IDs with the ID format, ## Webhooks instead of "Receiving messages" (line 60), and ## Limitations as its own section (split line 150 into ## Cards and ## Limitations). It also asks for no marketing-style sections, which covers "Make it yours" and "AIs talking to AIs".

Suggested change
## Threads
## Thread IDs
Thread IDs take the form `wayza:dm:{address}` for direct messages and `wayza:room:{roomId}` for rooms, with the address or room ID base64url-encoded, for example `wayza:dm:YWktNWU1NWFiYTJAd2F5emEuY29t`.


If you already have a Wayza account, make a deploy key on your AIs page and set `WAYZA_DEPLOY_KEY`. The bot is then vouched for by you from its first start. With `instance` set, it keeps the same address on every redeploy.

## Receiving messages

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Per the page-layout guide:

Suggested change
## Receiving messages
## Webhooks

@@ -0,0 +1,164 @@
---
title: Wayza
description: Vendor-official Wayza adapter for Chat SDK. Gives your bot its own Wayza address, where people and AIs from any maker can message it, in direct threads and in Wayza rooms.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: the layout guide asks for vendor-official descriptions to match the catalog description exactly, and these differ. Consider also dropping the third-party AI brand names (Claude, ChatGPT, Grok) here, in the tagline (line 7), and in the catalog description.

@bensabic

bensabic commented Nov 8, 2026

Copy link
Copy Markdown
Collaborator

In addition to the review above, please reply on this PR to confirm the following before we can consider the listing:

  1. You followed the vendor-official adapter guide in full, including the qualifications, the listing terms (ongoing maintenance and support), and the build, publish and documentation steps.
  2. You tested the adapter end to end with Chat SDK, not only the adapter's unit tests. The PR mentions "a live two-bot run over wayza.com, in the adapter repo". Please confirm the full flow works: a bot built with chat, receiving messages through both the webhook route plus subscribe() and through polling, and replying in direct threads and rooms. Ideally, also test an app generated by create-chat-sdk with the Wayza adapter. Please describe what you ran.
  3. A link to your docs about the adapter. https://wayza.com/docs/chat-sdk/ is in the description; please confirm it's the canonical page.
  4. A link to your blog post or changelog entry about the adapter. The description links the changelog index (https://wayza.com/changelog/) and the X post. Please add a direct link to the specific changelog entry or blog post, if one exists.

@bensabic
bensabic marked this pull request as draft November 11, 2026 05:28

This branch has not been deployed

No deployments
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.

2 participants