Commit Graph

503 Commits

Author SHA1 Message Date
github-actions[bot] 91820173f4 Version Packages (#300) @chat-adapter/telegram@4.23.0 @chat-adapter/gchat@4.23.0 @chat-adapter/whatsapp@4.23.0 @chat-adapter/discord@4.23.0 @chat-adapter/teams@4.23.0 @chat-adapter/state-redis@4.23.0 @chat-adapter/state-pg@4.23.0 @chat-adapter/state-memory@4.23.0 @chat-adapter/state-ioredis@4.23.0 @chat-adapter/slack@4.23.0 @chat-adapter/shared@4.23.0 @chat-adapter/linear@4.23.0 @chat-adapter/github@4.23.0 chat@4.23.0 2026-03-25 21:36:16 -04:00
Fernando Rojo 4166e09dad Add channelVisibility support to Thread, Channel, and Slack adapter (#51) 2026-03-25 17:21:46 -04:00
Malte Ubl acc4a336a0 Minor docs fix (#296) 2026-03-24 14:25:29 -07:00
github-actions[bot] 434421c82f Version Packages (#295)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@chat-adapter/slack@4.22.0 chat@4.22.0 @chat-adapter/whatsapp@4.22.0 @chat-adapter/telegram@4.22.0 @chat-adapter/teams@4.22.0 @chat-adapter/state-redis@4.22.0 @chat-adapter/state-pg@4.22.0 @chat-adapter/state-memory@4.22.0 @chat-adapter/state-ioredis@4.22.0 @chat-adapter/shared@4.22.0 @chat-adapter/linear@4.22.0 @chat-adapter/github@4.22.0 @chat-adapter/gchat@4.22.0 @chat-adapter/discord@4.22.0
2026-03-24 14:22:44 -07:00
Malte Ubl f2d8957797 Docs for the new concurrency strategies (#294) 2026-03-24 14:15:44 -07:00
Malte Ubl c674284885 [RFC] add concurrency strategies for overlapping messages (queue, debounce, concurrent) (#277)
* feat: add concurrency strategies for overlapping messages (queue, debounce, concurrent)

## Problem

When multiple messages arrive on the same thread while a handler is still
processing, the SDK has only one behavior: **lock-and-drop**. The incoming
message is silently discarded (or force-released, which creates uncontrolled
concurrency). This is insufficient for most real-world use cases:

- **AI chatbots** lose user follow-up messages sent while the model is streaming
- **Customer support bots** miss messages entirely, breaking conversation flow
- **Collaborative editing bots** need to coalesce rapid corrections into one action

## Solution

Introduce a new `concurrency` option on `ChatConfig` with four strategies:

### `'drop'` (default, backward-compatible)

Existing behavior. Lock acquired or `LockError` thrown. No changes.

### `'queue'`

Messages that arrive while a handler is running are enqueued in the state
adapter. When the current handler finishes, the queue is drained: **only the
latest message is dispatched**, with all intermediate messages provided as
`context.skipped`. This gives the handler full visibility into what happened
while it was busy, without forcing it to re-process every message sequentially.

```typescript
const chat = new Chat({
  concurrency: 'queue',
  // ...
});

chat.onNewMention(async (thread, message, context) => {
  if (context && context.skipped.length > 0) {
    // "You sent 4 messages while I was thinking. Responding to your latest."
    const allMessages = [...context.skipped, message];
    // Pass all messages to the LLM for full context
  }
});
```

Flow:
```
A arrives  → acquire lock → process A
B arrives  → lock busy → enqueue B
C arrives  → lock busy → enqueue C
D arrives  → lock busy → enqueue D
A done     → drain: [B, C, D] → handler(D, { skipped: [B, C] })
D done     → queue empty → release lock
```

### `'debounce'`

Every message (including the first) starts or resets a debounce timer. Only the
**final message in a burst** is processed. The lock-holding function stays alive
through `waitUntil` during the debounce window.

```typescript
const chat = new Chat({
  concurrency: { strategy: 'debounce', debounceMs: 1500 },
  // ...
});
```

Flow:
```
A arrives  → acquire lock → store A as pending → sleep(debounceMs)
B arrives  → lock busy → overwrite pending with B (A dropped)
C arrives  → lock busy → overwrite pending with C (B dropped)
             ... debounceMs elapses with no new message ...
           → process C → release lock
```

### `'concurrent'`

No locking at all. Every message is processed immediately in its own handler
invocation. Suitable for stateless handlers (lookups, translations) where
thread ordering doesn't matter.

```typescript
const chat = new Chat({
  concurrency: 'concurrent',
  // ...
});
```

## API Surface

### ChatConfig

```typescript
interface ChatConfig {
  concurrency?: ConcurrencyStrategy | ConcurrencyConfig;
  /** @deprecated Use `concurrency` instead */
  onLockConflict?: 'force' | 'drop' | ((threadId, message) => ...);
}

type ConcurrencyStrategy = 'drop' | 'queue' | 'debounce' | 'concurrent';

interface ConcurrencyConfig {
  strategy: ConcurrencyStrategy;
  maxQueueSize?: number;           // Default: 10
  onQueueFull?: 'drop-oldest' | 'drop-newest';  // Default: 'drop-oldest'
  queueEntryTtlMs?: number;        // Default: 90_000 (90s)
  debounceMs?: number;              // Default: 1500
  maxConcurrent?: number;           // Default: Infinity
}
```

### MessageContext (new, passed to handlers)

```typescript
interface MessageContext {
  skipped: Message[];               // Intermediate messages, chronological
  totalSinceLastHandler: number;    // skipped.length + 1
}
```

All handler types (`MentionHandler`, `MessageHandler`, `SubscribedMessageHandler`,
`DirectMessageHandler`) now accept an optional `MessageContext` as their last
parameter. Existing handlers that don't use it are unaffected.

### StateAdapter (new methods)

```typescript
interface StateAdapter {
  enqueue(threadId: string, entry: QueueEntry, maxSize: number): Promise<number>;
  dequeue(threadId: string): Promise<QueueEntry | null>;
  queueDepth(threadId: string): Promise<number>;
}
```

Implemented across all four state adapters:
- **MemoryStateAdapter**: in-process array
- **RedisStateAdapter**: Lua script (RPUSH + LTRIM + PEXPIRE)
- **IoRedisStateAdapter**: same Lua approach
- **PostgresStateAdapter**: new `chat_state_queues` table with atomic dequeue

## Architecture

`handleIncomingMessage` was refactored into composable pieces:

- `dispatchToHandlers()` — shared handler dispatch logic (mention detection,
  subscription routing, pattern matching). Extracted from the old monolithic
  method so all strategies reuse it.
- `handleDrop()` — original lock-or-fail path (preserves `onLockConflict` compat)
- `handleQueueOrDebounce()` — enqueue if busy, drain or debounce after
- `handleConcurrent()` — skip locking entirely
- `drainQueue()` — collect all pending, dispatch latest with skipped context
- `debounceLoop()` — sleep/check/repeat until no new messages arrive

## Queue Entry TTL

Queued messages have a configurable TTL (`queueEntryTtlMs`, default 90s). Stale
entries are discarded on dequeue with a `message-expired` log event. This
prevents unbounded accumulation and ensures handlers don't process messages
that are no longer relevant.

## Observability

All strategies emit structured log events at `info` level:

| Event                 | Strategy         | Data                                  |
|-----------------------|------------------|---------------------------------------|
| `message-queued`      | queue            | threadId, messageId, queueDepth       |
| `message-dequeued`    | queue, debounce  | threadId, messageId, skippedCount     |
| `message-dropped`     | drop, queue      | threadId, messageId, reason           |
| `message-expired`     | queue, debounce  | threadId, messageId                   |
| `message-superseded`  | debounce         | threadId, droppedId                   |
| `message-debouncing`  | debounce         | threadId, messageId, debounceMs       |
| `message-debounce-reset` | debounce      | threadId, messageId                   |

## Backward Compatibility

- Default remains `'drop'` — zero breaking changes for existing users
- `onLockConflict` continues to work but is marked `@deprecated`
- Handler signatures are backward-compatible (new `context` param is optional)
- Deduplication always runs regardless of strategy

## Files Changed

- `packages/chat/src/types.ts` — new types, updated handler signatures
- `packages/chat/src/chat.ts` — strategy routing, drain/debounce loops
- `packages/chat/src/index.ts` — export new types
- `packages/chat/src/mock-adapter.ts` — queue methods for test mock
- `packages/state-memory/src/index.ts` — in-memory queue
- `packages/state-redis/src/index.ts` — Redis queue (Lua)
- `packages/state-ioredis/src/index.ts` — ioredis queue (Lua)
- `packages/state-pg/src/index.ts` — Postgres queue table
- `packages/chat/src/chat.test.ts` — tests for queue, debounce, concurrent

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

* test: comprehensive test coverage for concurrency strategies and queue methods

Add tests across all state adapters and the Chat class:

**MemoryStateAdapter** (8 new tests):
- enqueue/dequeue single entry
- dequeue from empty queue returns null
- dequeue from nonexistent thread returns null
- queueDepth returns 0 for empty queue
- FIFO ordering across multiple entries
- maxSize trimming (keeps newest)
- maxSize=1 debounce behavior (last-write-wins)
- queue isolation by thread
- queue cleared on disconnect

**PostgresStateAdapter** (8 new tests):
- INSERT query for enqueue
- overflow trimming query
- depth return value
- parsed entry from dequeue
- null from empty dequeue
- atomic DELETE-RETURNING for dequeue
- queueDepth return value
- zero depth for empty queue

**RedisStateAdapter / IoRedisStateAdapter** (3+3 existence checks):
- enqueue, dequeue, queueDepth method existence

**Chat concurrency** (5 new tests):
- drop-newest policy when queue is full
- drop-oldest policy evicts oldest entries
- expired entries skipped during drain
- onNewMessage pattern handlers receive context
- onSubscribedMessage handlers receive skipped context

Total new tests: 27 (780 chat + 33 memory + 59 pg)

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

* Address feedback

* Support a channel locking strategy, make it default for WhatsApp and Telegram

* docs: fix typo "Committment" → "Commitment" (#274)

Co-authored-by: Arif Kobel <arif.kobel@phorax.com>

* Add webhook verification to GChat (#287)

- Issues a warning if required env vars are not present (also for telegram)
- Makes telegram use a time-safe verifier

* Make adapters depend on `chat` as a real dep (#289)

Without this, changeset will make any dep change a major change

* Version Packages (#290)

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* Fix serialization

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-authored-by: Arif Kobel <102538661+ArifKobel@users.noreply.github.com>
Co-authored-by: Arif Kobel <arif.kobel@phorax.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-03-24 13:46:38 -07:00
github-actions[bot] 80a8a34a73 Version Packages (#290)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@chat-adapter/discord@4.21.0 @chat-adapter/whatsapp@4.21.0 @chat-adapter/telegram@4.21.0 @chat-adapter/teams@4.21.0 @chat-adapter/state-redis@4.21.0 @chat-adapter/state-pg@4.21.0 @chat-adapter/state-memory@4.21.0 @chat-adapter/state-ioredis@4.21.0 @chat-adapter/slack@4.21.0 @chat-adapter/shared@4.21.0 @chat-adapter/linear@4.21.0 @chat-adapter/github@4.21.0 @chat-adapter/gchat@4.21.0 chat@4.21.0
2026-03-23 08:04:36 -07:00
Malte Ubl d778f722af Make adapters depend on chat as a real dep (#289)
Without this, changeset will make any dep change a major change
2026-03-23 07:57:42 -07:00
Malte Ubl 000792b8f8 Add webhook verification to GChat (#287)
- Issues a warning if required env vars are not present (also for telegram)
- Makes telegram use a time-safe verifier
2026-03-23 07:21:43 -07:00
Arif Kobel 9c498f4fd7 docs: fix typo "Committment" → "Commitment" (#274)
Co-authored-by: Arif Kobel <arif.kobel@phorax.com>
2026-03-21 16:14:00 -07:00
Malte Ubl 8337173704 Programmatically ensure that SKILL.md is always up-to-date and compiles (#272)
* Update the SKILL.md and add a test that checks its consistency

* Refactor docs test

* Typed and knip
2026-03-19 16:45:38 -07:00
Malte Ubl af8c9580ac Revert "Revert "Test TS compilation of all docs (#264)" (#265)" (#266)
This reverts commit d90f50c1a3.
2026-03-17 15:17:36 -07:00
Malte Ubl d90f50c1a3 Revert "Test TS compilation of all docs (#264)" (#265)
This reverts commit 449850f8b8.
2026-03-17 15:16:33 -07:00
Malte Ubl 449850f8b8 Test TS compilation of all docs (#264)
* Test TS compilation of all docs

* Lint
2026-03-17 15:11:52 -07:00
Malte Ubl d114ebfabf toAIMessages docs improvements (#263)
* toAIMessages docs improvements

* toAIMessages docs improvements
2026-03-17 14:38:23 -07:00
Hayden Bleasel 6646702128 Security fixes (#262)
* Bump Next

* Fix code scanning issues
2026-03-17 11:23:47 -07:00
Hayden Bleasel d2eac74d9a Change chat to peer dependency in all adapters (#258)
* refactor: move chat to peerDependencies for adapters

Update dependency to peerDependencies to avoid version conflicts.

Slack-Thread: https://vercel.slack.com/archives/C08077A6JDB/p1773694216309039?thread_ts=1773694216.309039&cid=C08077A6JDB
Co-authored-by: Hayden Bleasel <4142719+haydenbleasel@users.noreply.github.com>

* fix: use workspace:* for chat peerDependency in all adapters

Ensures adapters always require a compatible version of chat at publish time,
rather than the overly broad >=4.0.0 range.

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

---------

Co-authored-by: v0 <v0[bot]@users.noreply.github.com>
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-17 11:07:35 -07:00
Hayden Bleasel 28c1f03828 Update docs (#255) 2026-03-16 12:20:08 -07:00
XLor e45a67f491 feat: add adpater disconnect hook (#219)
* feat: add adpater disconnect hook

* fix: use Promise.allSettled for resilient shutdown, add docs and changeset

- Use Promise.allSettled so one failing adapter doesn't prevent others from disconnecting
- Add test for error resilience during shutdown
- Remove unnecessary type guards in tests
- Fix lint: sort interface members, format test file
- Add changeset (minor bump for chat)
- Document disconnect hook in API docs and adapter building guide

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

---------

Co-authored-by: Hayden Bleasel <hello@haydenbleasel.com>
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-16 12:17:37 -07:00
David Zhang 85a1d7f317 feat(telegram): convert entities to markdown in parsed messages (#232)
* feat(telegram): convert entities to markdown in parsed messages

Telegram delivers formatting (bold, italic, links, code, etc.) as separate
entity objects alongside plain text. Previously, parseTelegramMessage only
used the raw text, losing all entity information — most critically, text_link
entity URLs were dropped entirely.

This adds applyTelegramEntities() which reconstructs markdown syntax from
entities before storing the message text. Supported entity types: text_link,
bold, italic, code, pre, and strikethrough. Other entity types (url, mention,
bot_command) are already present in the text and left unchanged.

Also adds the missing `url` and `language` fields to TelegramMessageEntity.

* chore: add changeset for telegram entity markdown conversion

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

---------

Co-authored-by: Hayden Bleasel <hello@haydenbleasel.com>
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-16 12:06:07 -07:00
Ben Sabic 1d36004d95 fix(telegram): set parse_mode for markdown messages (#245)
* fix(telegram): set parse_mode for markdown messages

postMessage and editMessage only set parse_mode when a card was present,
causing markdown messages to render as plain text with visible formatting
characters. Now also sets parse_mode when the message has a markdown field.

Closes #226

* refactor: extract resolveParseMode helper to deduplicate postMessage/editMessage

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

---------

Co-authored-by: Ben Sabic <bensabic@users.noreply.github.com>
Co-authored-by: Hayden Bleasel <hello@haydenbleasel.com>
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-16 11:54:23 -07:00
Ray Arayilakath 95fd8ce055 fix(chat): correctly type thread and channel interface (#242)
* fix(chat): correctly type thread and channel interface

* fix(chat): nit make comment match `Message` comment for consistency

* chore: add changeset for thread/channel type fix

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

---------

Co-authored-by: Hayden Bleasel <hello@haydenbleasel.com>
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-16 11:51:38 -07:00
Ben Sabic 13ba1c73b8 fix: rename step-finish to finish-step for AI SDK v5+ compatibility (#244)
AI SDK v5 renamed the `step-finish` event to `finish-step`, causing
`fromFullStream()` to silently ignore step boundaries and concatenate
multi-step agent output without paragraph separators.

Closes #238

Co-authored-by: Ben Sabic <bensabic@users.noreply.github.com>
2026-03-16 11:41:12 -07:00
Ray Arayilakath b095fe2e21 docs: fix incorrect reference to c.executionCtx.waitUntil (#249) 2026-03-16 11:39:12 -07:00
github-actions[bot] dcd7af3656 Version Packages (#251)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@chat-adapter/discord@4.20.2 @chat-adapter/whatsapp@4.20.2 @chat-adapter/telegram@4.20.2 @chat-adapter/teams@4.20.2 @chat-adapter/state-redis@4.20.2 @chat-adapter/state-pg@4.20.2 @chat-adapter/state-memory@4.20.2 @chat-adapter/state-ioredis@4.20.2 @chat-adapter/slack@4.20.2 @chat-adapter/shared@4.20.2 @chat-adapter/linear@4.20.2 @chat-adapter/github@4.20.2 @chat-adapter/gchat@4.20.2 chat@4.20.2
2026-03-16 03:57:36 -04:00
Matan Kushner 01bd059058 fix(github): correctly trigger removeReaction in multi-tenant mode (#250) 2026-03-16 03:49:32 -04:00
Malte Ubl f612b44faf feat(slack): resolve @displayname mentions to <@USER_ID> in outgoing messages (#230)
* feat(slack): resolve @displayname mentions to <@USER_ID> in outgoing messages

Build a reverse index from display name → user IDs during lookupUser(),
track thread participants on incoming messages, and resolve @name mentions
to Slack's <@USER_ID> format before sending. Disambiguates using thread
participants when multiple users share a display name. Also increases
user/channel cache TTLs to 8 days.

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

* fix(slack): use replace offset for duplicate mentions, invalidate cache on user_change

* Revert "fix(slack): use replace offset for duplicate mentions, invalidate cache on user_change"

This reverts commit 8cb0d908d2.

* fix(slack): use replace offset for duplicate mentions, invalidate cache on user_change (#236)

* fix(slack): use replace offset for duplicate mentions, invalidate cache on user_change

* style: align handleUserChange to async/await, expand changeset

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-authored-by: Matan Kushner <hello@matchai.dev>
2026-03-13 05:50:43 -07:00
github-actions[bot] f7cc3fa00f Version Packages (#228)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@chat-adapter/state-ioredis@4.20.1 @chat-adapter/gchat@4.20.1 @chat-adapter/telegram@4.20.1 @chat-adapter/teams@4.20.1 @chat-adapter/state-redis@4.20.1 @chat-adapter/state-pg@4.20.1 @chat-adapter/state-memory@4.20.1 chat@4.20.1 @chat-adapter/slack@4.20.1 @chat-adapter/shared@4.20.1 @chat-adapter/linear@4.20.1 @chat-adapter/discord@4.20.1 @chat-adapter/github@4.20.1 @chat-adapter/whatsapp@4.20.1
2026-03-12 10:04:30 -07:00
Matan Kushner 8d88b8c0e2 fix(github): accumulate stream before posting, log fallback edit errors (#227)
* fix(github): accumulate stream before posting, log fallback edit errors

The GitHub adapter relied on chat-sdk's default fallbackStream which
posts a placeholder then edits it every 500ms. GitHub returns 422 on
these edits because body is empty during TTFT, and rapid edits risk
secondary rate limits.

Add stream() to GitHubAdapter that accumulates the full text before
posting once. Also log fallbackStream edit errors instead of silently
swallowing them.

* test: add tests for GitHub adapter stream() and fallbackStream logging

* style: format with biome

* refactor: use Logger instead of console.warn in fallbackStream

Plumb the Chat logger into ThreadImpl so fallbackStream uses the
structured logger instead of raw console.warn.

* test: simplify fallbackStream logging test

Reuse mockLogger from mock-adapter.ts and rely on createMockAdapter's
default editMessage mock instead of re-specifying the resolved value.

* test: use vi.mocked, drop redundant stream=undefined

* chore: add changeset

* refactor: extract accumulateStream utility, deduplicate GitHub and WhatsApp adapters

* Revert "refactor: extract accumulateStream utility, deduplicate GitHub and WhatsApp adapters"

This reverts commit 0a3ca3cc9a.
2026-03-12 08:31:42 -07:00
Malte Ubl 97be8a9ac9 feat(slack): resolve bare channel mentions to display names (#229)
* feat(slack): resolve bare channel mentions to display names

Mirror the existing lookupUser() pattern to resolve bare <#C123> channel
mentions into <#C123|channelName> via conversations.info API with caching.
Channels with existing labels (<#C123|general>) are left unchanged.

Also fix 22 pre-existing test timeouts in sandboxed environments by
adding botUserId to skip real auth.test calls, and mocking users.info
where parseSlackMessage/handleSlashCommand calls lookupUser.

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

* Replay test

* changeset

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-12 08:29:29 -07:00
Malte Ubl e20637158d feat: add LinkPreview to Message for URL and embedded message support (#217)
* feat: add LinkPreview to Message for URL and embedded message support

Add `links: LinkPreview[]` to `Message` so handlers can access URLs
shared in messages. Each LinkPreview contains the URL and optional
unfurl metadata (title, description, siteName, imageUrl).

On Slack, links are extracted from rich_text block elements (falling
back to <url> patterns in text). Links pointing to other Slack messages
(*.slack.com/archives/{channel}/p{ts}) include a `fetchMessage()`
callback that retrieves and parses the linked message.

`toAiMessages()` now appends link metadata to message content
automatically, labeling embedded message links distinctly so AI models
understand the context.

- Add LinkPreview interface to core types
- Add links field to Message, MessageData, SerializedMessage
- Extract links in Slack adapter (blocks + text fallback)
- Provide fetchMessage for Slack message URLs
- Set links: [] in all other adapters
- Include link metadata in toAiMessages() output
- Document LinkPreview in message API docs
- Document toAiMessages() in streaming and handling-events docs
- Add toAiMessages to API overview

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

* fix: remove redundant links: [] from adapters for backwards compatibility

The Message constructor already defaults links to [] when not provided,
so adapters that don't support link extraction don't need to pass it
explicitly. This makes the change backwards-compatible for third-party
adapters — they get an empty links array without any code changes.

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

* fix: avoid polynomial regex in Slack link extraction

Replace `[^>|]+` pattern (which backtracks on `|`) with `[^>]+`
and a programmatic indexOf split. This prevents ReDoS on untrusted
message text.

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

* feat: add attachment support and mention tests to toAiMessages

toAiMessages now includes image and text-file attachments as multipart
content compatible with AI SDK's UserContent type:

- Images → ImagePart (via fetchData base64 or URL fallback)
- Text files (text/*, application/json, etc.) → FilePart
- Video/audio → warns via onUnsupportedAttachment callback
- Other file types → silently skipped

The function is now async to support fetchData() calls for inlining
attachment data as base64 data URIs. When fetchData fails, falls back
to the attachment URL.

Also adds mention rendering tests verifying that @mentions appear as
@name (not Slack's <@U123> syntax) in toAiMessages output, both in
plain messages and with links/includeNames enabled.

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

* fix: make AiMessage types structurally compatible with AI SDK

Use a discriminated union (AiUserMessage | AiAssistantMessage) so
AiMessage[] is directly assignable to ModelMessage[] without casts.
Match DataContent type (string | Uint8Array | ArrayBuffer | Buffer)
for image/file parts to ensure structural compatibility.

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

* fix(example): pass image attachments to AI via toAiMessages

The onNewMention handler was passing message.text directly to the AI
agent, dropping any image attachments. Now uses toAiMessages([message])
which includes images via fetchData as base64 inline data, enabling
the AI to actually see uploaded images.

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

* fix: pass image data as Buffer, not data URI

The AI SDK expects DataContent (Buffer/Uint8Array/base64 string) for
image and file parts, not data URIs. Passing `data:image/png;base64,...`
caused "Could not process image" errors from the API. Now passes the
raw Buffer from fetchData() directly, with mediaType set separately.

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

* fix: require fetchData for attachments, no URL fallback

Slack's url_private requires Bearer token auth that AI providers can't
provide. Remove URL fallback — attachments are only included when
fetchData() succeeds (which handles auth internally). Log errors
instead of silently falling through.

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

* debug: add temporary logging to toAiMessages image handling

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

* fix: use data URIs for image/file attachments in toAiMessages

The AI SDK's convertToLanguageModelV2DataContent parses data: URIs
to extract both the base64 content and media type. Raw base64 strings
lose the media type (returns mediaType: void 0), and raw Buffers may
not serialize correctly across network boundaries. Data URIs are the
most reliable format.

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

* debug: log fetched image size to diagnose API rejection

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

* debug: log prompt structure to diagnose image rejection

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

* fix: use FilePart instead of ImagePart for image attachments

The AI SDK's ImagePart with data URI strings doesn't work correctly
through the AI Gateway. Use FilePart (type: "file") with data URI
in the data field instead — this matches the working pattern used by
other projects and handles image data correctly across all providers.

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

* debug: comprehensive logging at every decision point in toAiMessages

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

* debug: log data prefix to verify content format

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

* debug: log token capture and detect HTML responses from Slack file fetch

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

* fix: improve Slack file fetch error message and remove debug logging

When Slack returns an HTML login page instead of file data (typically
due to missing "files:read" OAuth scope), the error message now
explicitly tells the user what scope to add. Also removes all
temporary debug logging from toAiMessages and createAttachment.

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

* Add transform support

* changeset

* address-feedback

* lint

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-12 07:23:09 -07:00
Hayden Bleasel 4f5a0ac149 Update geistdocs.tsx (#222) 2026-03-11 10:43:48 -07:00
Hayden Bleasel 8513e4f640 remove title from svg (#221) 2026-03-11 10:32:47 -07:00
Hayden Bleasel 0d63bb55d0 Improve WhatsApp docs (#220)
* Improve WhatsApp adapter README

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

* Rename WhatsApp adapter to WhatsApp Business Cloud

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

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-11 10:28:56 -07:00
github-actions[bot] 472c1847cd Version Packages (#210)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@chat-adapter/linear@4.20.0 @chat-adapter/state-redis@4.20.0 @chat-adapter/whatsapp@4.20.0 @chat-adapter/discord@4.20.0 @chat-adapter/gchat@4.20.0 @chat-adapter/github@4.20.0 @chat-adapter/slack@4.20.0 @chat-adapter/telegram@4.20.0 chat@4.20.0 @chat-adapter/state-ioredis@4.20.0 @chat-adapter/state-memory@4.20.0 @chat-adapter/state-pg@4.20.0 @chat-adapter/shared@4.20.0 @chat-adapter/teams@4.20.0
2026-03-11 10:05:33 -07:00
Matthew Lewis d565c61e9d add github username (#216) 2026-03-11 10:41:24 -04:00
Hayden Bleasel deeb9cec3a Improve tests 2026-03-10 23:35:14 -07:00
Ben Sabic 4c7a2b2bec Document scheduled message support across all docs (#207)
Add thread.schedule() and channel.schedule() documentation to the
API reference, usage guides, feature matrix, error handling guide,
adapter building guide, and SKILL.md.

Co-authored-by: Ben Sabic <bensabic@users.noreply.github.com>
2026-03-10 22:20:57 -07:00
Ben Sabic 7c4719b3f3 Adds two Workflow-focused guides (#211)
* Add workflow guides for durable chat sessions and scheduled posts

* Update workflow guides

* fix: use correct Workflow APIs and fix TypeScript issues

- Replace `defineHook`/`.create()`/`.resume()` with `createHook` + `resumeHook` from documented Workflow APIs
- Add TypeScript 5.2+ note for `using` keyword (explicit resource management)
- Fix `result.rowCount` null safety in cancelScheduledPost

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

---------

Co-authored-by: Ben Sabic <bensabic@users.noreply.github.com>
Co-authored-by: Hayden Bleasel <hello@haydenbleasel.com>
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-10 21:13:00 -07:00
Matthew Lewis ee1c025ea7 fix(telegram): fix DM replies failing with "chat not found" (#214)
* fix(telegram): fix DM replies failing with "chat not found"

postChannelMessage was double-wrapping the channel ID with the
telegram: prefix via encodeThreadId, producing "telegram:telegram:<chatId>".
This caused sendMessage to be called with chat_id "telegram" instead of
the actual chat ID. Pass the channel ID directly to postMessage which
already handles prefix resolution via resolveThreadId.

Made-with: Cursor

* test(telegram): add postChannelMessage tests

Verify channel ID is not double-prefixed and works with both
telegram:-prefixed and raw channel IDs.

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

---------

Co-authored-by: Hayden Bleasel <hello@haydenbleasel.com>
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-10 20:55:25 -07:00
Hayden Bleasel 135088b824 Update logo 2026-03-10 16:21:32 -07:00
Achraf Ghellach 60f5d8e19f feat: add WhatsApp Business Cloud API adapter (#102)
* feat: add WhatsApp Business Cloud API adapter

Add @chat-adapter/whatsapp with support for sending/receiving messages,
reactions, interactive reply buttons, typing indicators, and webhook
verification via the Meta Graph API. Includes full test suite,
documentation updates, and workspace/turbo configuration.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* feat: add media download, attachments, and location support to WhatsApp adapter

- Add downloadMedia() public method for fetching images, documents,
  audio, video, and stickers via the Graph API (two-step: URL then binary)
- Populate message attachments with lazy fetchData() for all media types
- Add location support with Google Maps URL and structured text
- Add audio, video, sticker, and location fields to WhatsAppInboundMessage
- Set isMention: true on all messages (WhatsApp DMs are always direct)
- Update parseMessage to include attachments and isMention
- Add 10 new tests covering all media types, locations, and isMention
- Update docs feature matrix to reflect media receive support

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix: address PR review feedback for WhatsApp adapter

- Validate Graph API response before accessing messages[0].id in
  sendTextMessage and sendInteractiveMessage
- Escape backticks and backslashes in escapeWhatsApp()
- Apply escapeWhatsApp() to renderText() content in all style branches
- Use webhook phoneNumberId in buildMessage() instead of this.phoneNumberId
- Encode proper threadId in parseMessage() instead of empty string
- Strict decodeThreadId() validation (exactly 2 segments after prefix)
- Add tests for extra segments in decodeThreadId and threadId in parseMessage

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* Migrate improvements from #179

Bring over several enhancements from chitru's WhatsApp adapter PR (#179):

- Voice message support (separate from audio)
- Legacy button response handling (template quick replies)
- Callback data encoding/decoding for interactive reply round-trips
- Message truncation at WhatsApp's 4096 char limit
- Example app integration (adapters, webhook route, package.json)
- GET webhook forwarding for WhatsApp verification challenges
- Package README and changeset
- Tests for all new functionality (68 total)

Co-Authored-By: Chitru Shrestha <chitra.shrestha@akuru.com.au>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix(whatsapp): add error handling for inbound message processing

Wrap handleInboundMessage calls in try/catch to log errors if
synchronous processing fails (e.g., thread ID encoding). The async
processing already has its own error handling in Chat.processMessage.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix(whatsapp): prevent markdown regex from matching across newlines

Use [^\n*] and [^\n~] in fromWhatsAppFormat regex to prevent bold/strike
spans from merging across line boundaries. Adds a regression test.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix(whatsapp): use WhatsAppInteractiveMessage type instead of object

Replace the untyped `object` parameter in sendInteractiveMessage with
the proper WhatsAppInteractiveMessage type for full type safety.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix(whatsapp): hoist emoji mapping to module-level constant

Move the emoji name-to-unicode mapping out of resolveEmoji() so it is
not re-allocated on every call.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix(whatsapp): remove duplicate JSDoc comment in types

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix(example): add startTyping to WhatsApp recording methods

The adapter supports typing indicators but the method was missing from
the recording proxy list.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix(whatsapp): fix formatting and add package to readme test allowlist

Fix line-length formatting in markdown.ts regex and add
@chat-adapter/whatsapp to the valid packages list in readme tests.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix(whatsapp): use defaultEmojiResolver instead of custom emoji map

Replace the hand-rolled EMOJI_MAP with the shared defaultEmojiResolver
from the chat SDK. WhatsApp uses unicode emoji like GChat, so toGChat()
provides the correct mapping with broader coverage.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix(whatsapp): make Graph API version configurable

Add apiVersion option to WhatsAppAdapterConfig (defaults to v21.0)
so users can upgrade without waiting for a package release.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix(whatsapp): validate lat/lng before constructing Google Maps URL

Coerce and validate latitude/longitude with Number.isFinite() to
prevent unexpected URL construction from malformed webhook payloads.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix(whatsapp): throw on editMessage instead of silently sending new message

Callers expecting an edit would get duplicate messages with the silent
fallback. Throwing makes the unsupported operation explicit.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix(whatsapp): document regex asymmetry between toWhatsApp and fromWhatsApp

Explain why toWhatsAppFormat doesn't need newline guards like
fromWhatsAppFormat does — the standard markdown parser output
never produces spans crossing line boundaries.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix(whatsapp): document callback data passthrough behavior

Add comments explaining that non-prefixed and malformed callback data
is intentionally passed through for legacy/external button IDs.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix(whatsapp): add editMessage and deleteMessage to recording methods

Include all adapter methods in the recording list for complete
debugging traces, even for unsupported operations.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix(whatsapp): preserve escaped formatting chars in toWhatsAppFormat

Escaped asterisks and tildes in standard markdown (e.g. \* and \~) are
now preserved through the conversion pipeline so WhatsApp renders them
as literal characters instead of misinterpreting them as formatting.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix(whatsapp): split long messages instead of truncating

Replace silent truncation at 4096 chars with message splitting that
breaks on paragraph (\n\n) then line (\n) boundaries, sending multiple
messages so no content is lost. Adds 8 tests for the splitting logic.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix(whatsapp): align editMessage/deleteMessage behavior and docs

- Fix README: editMessage/deleteMessage both throw, not fallback/no-op
- Fix editMessage JSDoc to reflect it throws
- Make deleteMessage throw instead of silently warning (consistent with editMessage)
- Bump @types/node to ^25.3.2 to match monorepo
- Add sample-messages.md with webhook payload examples

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* docs(whatsapp): add adapter documentation page

Add whatsapp.mdx covering installation, usage, Meta app setup,
webhook config, interactive messages, media attachments, 24-hour
messaging window, configuration, features, and troubleshooting.
Also add WhatsApp to the adapters navigation in meta.json.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix: add whatsapp adapter debug logging and try/catch

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

* fix(whatsapp): convert emoji placeholders in outgoing messages

WhatsApp adapter was sending raw {{emoji:wave}} placeholders instead of
Unicode emoji. Apply convertEmojiPlaceholders on all outgoing paths:
text messages, card fallback text, and interactive message fields.

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

* Fix button rendering and streaming (needs to buffer)

* fix(example): handle editMessage failure on WhatsApp

WhatsApp Cloud API doesn't support message editing. Catch the error
in the demo "processing" animation and send a follow-up instead.

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

* feat(chat): add onDirectMessage handler, stop treating DMs as mentions

DMs now route to dedicated onDirectMessage handlers instead of being
forced through onNewMention. If no DM handlers registered, DMs fall
through to onNewMention for backward compat. Adapters no longer set
isMention=true for DMs — the Chat SDK handles routing via adapter.isDM().

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

* feat(chat): always route DMs to onDirectMessage regardless of subscription

Previously, onDirectMessage only fired for unsubscribed DM threads.
Subscribed DMs were routed to onSubscribedMessage, which was confusing
on non-threaded platforms (WhatsApp, Telegram) where all DMs share one
threadId — after the first message, onDirectMessage never fired again.

Now, DMs always route to onDirectMessage first, and onSubscribedMessage
only handles non-DM subscribed threads. Backward compat is preserved:
if no onDirectMessage handlers are registered, DMs fall through as
mentions.

The example bot is simplified accordingly — onDirectMessage now fetches
conversation history via fetchMessages each time instead of relying on
subscribe() and stored state.

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

* feat(chat): pass channel as third argument to DirectMessageHandler

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

* fix(example): reply to channel instead of thread in DM handler

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

* fix(example): use thread instead of channel for DM operations

Channel ID is only two parts (whatsapp:{phoneNumberId}) which isn't a
valid conversation target on WhatsApp. The thread ID includes the user
phone and is required for startTyping/post/fetchMessages.

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

* Revert "fix(example): use thread instead of channel for DM operations"

This reverts commit f4801d7015.

* fix(adapters): return valid thread IDs from channelIdFromThreadId

WhatsApp's channelIdFromThreadId was stripping the user WA ID, producing
an invalid ID that caused ValidationError on channel operations like
startTyping(). Since every WhatsApp conversation is a 1:1 DM, channel
and thread are identical.

Telegram's channelIdFromThreadId was returning a raw chatId without the
telegram: prefix, which is not a valid thread ID for adapter operations.

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

* fix(chat): normalize fullStream in Channel.post() to extract text deltas

Channel.post() was coercing AI SDK fullStream objects to strings via +=,
producing "[object Object]" output. Now uses fromFullStream() to extract
text-delta events, matching how Thread.post() already handles streams.

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

* fix(example): use thread.allMessages for DM history instead of adapter directly

The DM handler was calling channel.adapter.fetchMessages() which always
returns empty on WhatsApp (no native history API). Now uses
thread.allMessages which falls back to the persisted message history
cache, giving the AI conversation context.

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

* feat(chat): add message history support to Channel for DM platforms

Channel now falls back to the persisted message history cache when the
adapter lacks native message fetch (e.g. WhatsApp, Telegram). Incoming
messages are persisted under both thread and channel IDs. Outgoing
messages from channel.post() are also persisted.

The example DM handler now uses channel.messages instead of calling the
adapter directly.

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

* fix(whatsapp): improve markdown rendering and remove broken typing indicator

- Convert headings to bold text, thematic breaks to text separators,
  and tables to code blocks (WhatsApp doesn't support these)
- Convert standard italic (*text*) to WhatsApp italic (_text_) since
  WhatsApp uses *text* for bold
- Make startTyping a no-op (Cloud API doesn't support typing indicators)
- Update channelIdFromThreadId test for channel===thread change

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

* fix(example): reverse channel.messages to chronological order for AI

channel.messages yields newest first but AI expects chronological order.

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

* fix(chat): auto-sort messages chronologically in toAiMessages

toAiMessages now sorts by dateSent (oldest first) so callers don't need
to worry about iteration order from channel.messages or thread.messages.

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

* fix(chat): pass accumulated stream text as markdown in Channel.post()

Stream text was posted as a plain string, bypassing the adapter's format
converter. Now wraps it as { markdown: accumulated } so headings, bold,
italic etc. are properly converted for each platform.

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

* fix(whatsapp): use stringifier options for emphasis and bullets

Use emphasis: '_' and bullet: '-' options in stringifyMarkdown so the
only * in output is **strong**, avoiding conflicts between list bullets
and italic markers. Simplifies toWhatsAppFormat to only convert
**bold** -> *bold* and ~~strike~~ -> ~strike~.

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

* fix(whatsapp): flatten bold inside headings to avoid triple asterisks

When AI outputs headings with bold text like `## **Choose React if:**`,
the heading-to-bold conversion created nested strong nodes producing
`***text***`. Now flattens strong children in headings so they merge
into a single bold span.

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

* test(whatsapp): add full toBe assertion for complex markdown conversion

Also use ━━━ for thematic breaks instead of --- to avoid remark escaping.

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

* test: add WhatsApp replay tests from production recordings

Adds WhatsApp DM replay test infrastructure:
- Fixture from real webhook recordings (dm/whatsapp.json)
- WhatsApp test utilities with HMAC-signed request factory and
  Graph API fetch mock (whatsapp-utils.ts)
- 6 replay tests covering DM handling, thread/channel IDs, message
  sending, status update filtering, sequential messages, and
  message history persistence

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

* fix(whatsapp): fix type narrowing in replay test after merge

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* Update WhatsApp logo

* Update adapters.json

* Update logos.tsx

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: Hayden Bleasel <hello@haydenbleasel.com>
Co-authored-by: Chitru Shrestha <chitra.shrestha@akuru.com.au>
Co-authored-by: Malte Ubl <malte.ubl@gmail.com>
2026-03-10 15:16:10 -07:00
Hayden Bleasel 6e4004a88c Improve og:images 2026-03-10 11:19:33 -07:00
Hayden Bleasel 28302300a7 Update metadata 2026-03-10 11:00:49 -07:00
Hayden Bleasel 2fa840c84d Fix opengraph image 2026-03-10 10:58:57 -07:00
github-actions[bot] 7ba7465071 Version Packages (#200)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@chat-adapter/state-memory@4.19.0 chat@4.19.0 @chat-adapter/telegram@4.19.0 @chat-adapter/teams@4.19.0 @chat-adapter/state-redis@4.19.0 @chat-adapter/state-pg@4.19.0 @chat-adapter/state-ioredis@4.19.0 @chat-adapter/slack@4.19.0 @chat-adapter/shared@4.19.0 @chat-adapter/linear@4.19.0 @chat-adapter/github@4.19.0 @chat-adapter/gchat@4.19.0 @chat-adapter/discord@4.19.0
2026-03-09 23:10:49 -07: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
Ben Sabic dac88f8ad1 docs: mention PostgreSQL state adapter across remaining docs (#201)
Several docs pages only referenced Redis as the production state
adapter. Add PostgreSQL mentions to usage page, guide "Next steps"
sections, adapters overview, SKILL.md, and package README.

Co-authored-by: Ben Sabic <bensabic@users.noreply.github.com>
2026-03-08 12:43:33 -07:00
Hayden Bleasel 736880ad90 Resolves #203 2026-03-08 12:41:01 -07:00
Ben Sabic 5b41f0869d feat: add scheduled message support via Slack's chat.scheduleMessage API (#202)
Add thread.schedule() and ScheduledMessage type for scheduling messages
to be sent at a future time. The Slack adapter implements scheduling
natively via chat.scheduleMessage with cancel() support via
chat.deleteScheduledMessage. Other adapters throw NotImplementedError.

Co-authored-by: Ben Sabic <bensabic@users.noreply.github.com>
2026-03-08 06:53:21 -07:00