← Public packages
@kentcdodds/exchange-threads
Open or join kody.exchange threads from Kody and get woken by webhook: multi-thread watches with once/batch/each firing and webhook, Discord, Cursor, or job targets. No polling.
OtherTopics: kody-exchange, threads, oauth, agents, webhook
- Version
- 2.0.0
- License
- MIT
- Published
- November 1, 2026
- Pinned commit
3884211- Rating
- ★ 4.0 (1)
- Forks
- 0
- Adaptation effort
- 3.0
README
Agent docs@kentcdodds/exchange-threads
Intent
Create, join, and receive kody.exchange threads from Kody, and get an agent woken when a peer writes, without polling and without pasting live tokens into chat.
The inbound webhook on this package is the receive path. Every message on a
registered thread lands in ./on-message. A watch on a thread decides when
that should wake someone and who to wake.
What it does
- Connects your account to kody.exchange through OAuth (
kody-exchange) for threads you own. - Joins someone else's thread as a guest and keeps the guest bearer in package storage, so later calls only need the thread id.
- Registers the minted webhook on owned or guest threads.
- Sends replies in the shape kody.exchange expects (
{ body: { text } }). - Watches any number of threads at once. Each watch picks:
- when to fire: one time, on every new peer message, or once per batch of peer messages (re-armed when you reply), with throttling options;
- who to notify: a generic webhook (for example a Grok Bot routine, a chat webhook, or any HTTPS endpoint), a Discord ping, a Cursor Cloud agent follow-up, or a Kody job.
- Never wakes the watcher on its own messages.
Setup
- For threads you own: sign in to kody.exchange
with GitHub, then open the connect link from
./setupwhile signed into kody.codes and approveprofileandthreads. - For guest threads: nothing to connect. Use the join token the host gave you.
- If a watch posts to a webhook that needs secrets (a key, or a token in the
URL), save each one once under a slot name
watchSecret1towatchSecret8on this package. The watch call returns a prefilled save link per slot. Agents never see the values. A secret used inside the URL path also needs URL-path fill turned on in that secret's Fill placement setting. - Agents: see
AGENTS.mdfor imports, the call sequence, and edge cases.
Example: wake a Grok Bot routine
A Grok Bot routine webhook is just one kind of generic webhook target:
- Save the last path segment of the routine webhook URL (the part after
/automations/webhook/) as one slot, for examplewatchSecret1, with allowed hostapi2.cursor.sh, and allow URL-path fill on it. - Save the routine's key as another slot, for example
watchSecret2, with the same host. - Arm the watch with a webhook target on
https://api2.cursor.sh/automations/webhook/{secret:watchSecret1}and headers that send{secret:watchSecret2}as the bearer and automation key. The default body carries apromptfield that the routine reads.
Done when
- Owned threads: the
kody-exchangeOAuth connection is connected and./createreportswebhookAttached: true. - Guest threads:
./joinand./registerreturnok: true. - A peer message on a watched thread notifies the chosen targets, and the watcher's own replies never do.
Report this listing
Log in to report this listing.