Skip to content

Latest commit

 

History

History
81 lines (66 loc) · 4.36 KB

File metadata and controls

81 lines (66 loc) · 4.36 KB

API And Package Reference

The API reference is the GoDoc. Every package carries package-level documentation (doc.go), and the intentional differences from Vercel Chat SDK are documented directly on the symbols they affect.

Modules And Packages

Package Module GoDoc
github.com/coder/chat core pkg.go.dev
github.com/coder/chat/adapters/slack core pkg.go.dev
github.com/coder/chat/adapters/linear core pkg.go.dev
github.com/coder/chat/state/memory core pkg.go.dev
github.com/coder/chat/state/redis separate pkg.go.dev
github.com/coder/chat/state/postgres separate pkg.go.dev
github.com/coder/chat/state/nats separate pkg.go.dev

Redis, Postgres, and NATS state live in separate Go modules so applications that only use core, Slack, or memory state do not pull their dependencies. The repository uses go.work for local development across all modules.

To browse the reference locally without pkg.go.dev:

go doc github.com/coder/chat
go doc github.com/coder/chat/adapters/slack

Where To Look For What

  • Runtime construction, hooks, dispatch, runtime options: package chat (chat.New, Chat.OnNewMention, Chat.OnSubscribedMessage, Chat.OnCommand, Chat.OnInteraction, RuntimeOptions).
  • Event and message model: package chat (Event, Message, MessageEvent, CommandEvent, InteractionEvent, Thread, ThreadID, Actor).
  • Optional capabilities: package chat (NativeContentPoster, HistoryReader, EphemeralPoster interfaces) plus the adapter packages for what each adapter actually implements.
  • Multi-tenant installs: package chat (InstallStore, Install, ErrInstallNotFound) plus slack.SlackInstall / linear.LinearInstall.
  • State contract: package chat (State) with implementations in the four state/* packages.

Adapter Capability Status

Portable behavior (normalized events, thread routing, Thread.Post, Thread.Subscribe) works on every adapter. Optional capabilities and platform-specific surfaces differ:

Capability Slack Linear
Message events (mentions, subscribed threads, DMs) Yes Yes (agent sessions and issue comments)
Ephemeral messages with explicit DM fallback (Thread.PostEphemeral) Yes No (unsupported capability); Linear-specific ephemeral thoughts via PostThought on agent-session threads
Slash commands (OnCommand) Yes No (no platform equivalent)
Interactive components (OnInteraction) Yes (message block_actions; modal-view actions are not normalized) No
Native content posting (NativeContentPoster) Yes (Block Kit) No
Modal open / response_url Yes (OpenModalFromRaw, OpenModal, RespondURL) No
Message history read-through (HistoryReader) Yes Yes (agent-session activities and issue-comment threads)
Rate-limit retry with typed RateLimited error Yes Yes
Multi-tenant installs (InstallStore) Yes Yes
Platform escape hatch Raw payloads on events RawMessage, GraphQL
Agent activities (thought/response/action/elicitation/error) n/a Yes
Session updates (plan, external URLs) n/a Yes (UpdateSession)

For the tracked list of Linear agent APIs that are not yet wrapped in typed helpers, see linear-agent-capabilities.md.

Examples

Runnable, documented examples live in examples/: