Loading...
Loading...
Build messaging agents and apps with Spectrum — Photon's unified messaging SDK. Write your handler logic once and ship it across iMessage, WhatsApp Business, the terminal, or a custom platform. Spectrum is multi-platform by design and is becoming multi-language; the current SDK is `spectrum-ts` (TypeScript), with additional language SDKs planned. Use this skill for any Spectrum question — quickstart, multi-platform setup, receiving messages, content builders, spaces and users, reactions and replies, platform narrowing, the built-in providers (iMessage cloud/local/dedicated with message effects, Terminal TUI test harness, WhatsApp Business 1:1), custom event streams, graceful shutdown, building your own provider with `definePlatform`, and the production architecture patterns Photon uses internally to ship agents that live natively inside IM apps (five-stage inbound pipeline with debounce → batch flush → mark as read → generate → send, in-flight cancellation with abort signals, drain-in-handler, carry-forward, idempotent retries via stable client GUIDs and a startIndex resume cursor, per-resource memory scope `resourceId` vs `threadId`, durable job-failure audit log). This is the entry point for the skill; consult the topic files in this directory for full reference. Keywords: spectrum, spectrum-ts, photon, unified messaging, multi-platform, multi-language, im agent, messaging agent, imessage, whatsapp, whatsapp business, terminal, tuichat, definePlatform, custom platform, platform provider, platform narrowing, app.messages, Spectrum(), space, send, reply, react, tapback, typing indicator, responding, startTyping, stopTyping, content builder, text, attachment, voice, contact, richlink, poll, group, custom content, message effects, bubble effect, screen effect, line model, dedicated line, shared pool, custom events, app.stop, lifecycle, SIGINT, graceful shutdown, message queue, debounce, batch, in-flight, cancellation, abort controller, carry forward, idempotent retry, client guid, dedup, deduplication, startIndex, resume cursor, working memory, resourceId, threadId, per-resource memory, job failure, audit log, race condition, worker crash, retry, pg-boss, queue worker, conversational agent, chat agent, native messaging, agent architecture, production agent, spectrum patterns, best practices.
npx skill4agent add photon-hq/skills spectrumapp.messagesspectrum-ts| File | When to consult |
|---|---|
| Installation, the |
| Receiving messages, the |
| Content builders for outgoing messages: |
| The |
| |
| Recovering platform-specific types from generic Spectrum primitives. |
| iMessage provider — cloud, local, dedicated modes, line model, per-phone routing, message effects, tapbacks. |
| Terminal TUI provider — chat sidebar, reactions, replies, attachments, slash commands. |
| WhatsApp Business Cloud API. 1:1 only. |
| Per-provider event streams ( |
| Authoring your own provider with |
| Production architecture patterns Photon uses internally — debounce pipeline, in-flight cancellation, carry-forward, idempotent retries, per-resource memory, job-failure audit log. |