You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
import { TypeTooltip } from "/snippets/type-tooltip.mdx";
7
7
8
8
{% set ci = symbol("ts:spectrum-ts#ContentInput") %}
9
9
{% set cb = symbol("ts:spectrum-ts#ContentBuilder") %}
10
10
11
-
Spectrum exposes a family of content builders — `text`, `attachment`, `voice`, `contact`, `richlink`, `poll`, `group`, `custom`, `reaction`, `reply`, `edit`, and `typing` — plus a string shortcut that's equivalent to `text()`. Any API that takes a <TypeTooltip name="ContentInput" type={`{{ ci.signature }}`} /> accepts a plain string or a <TypeTooltip name="ContentBuilder" type={`{{ cb.signature }}`} />.
11
+
Spectrum exposes a family of content builders — `text`, `attachment`, `voice`, `contact`, `richlink`, `poll`, `group`, `custom`, `reaction`, `reply`, `edit`, `typing`, `rename`, and `avatar` — plus a string shortcut that's equivalent to `text()`. Any API that takes a <TypeTooltip name="ContentInput" type={`{{ ci.signature }}`} /> accepts a plain string or a <TypeTooltip name="ContentBuilder" type={`{{ cb.signature }}`} />.
12
12
13
13
## Text
14
14
@@ -212,7 +212,7 @@ import { reply, text } from "spectrum-ts";
212
212
await space.send(reply(text("Got it"), message));
213
213
```
214
214
215
-
`reply()` cannot wrap `reply`, `edit`, `reaction`, `group`, or `typing` content.
`space.startTyping()`, `space.stopTyping()`, and `space.responding(fn)` are sugar over `space.send(typing(...))`. Platforms without a typing-indicator API silently no-op.
242
242
243
+
## Rename
244
+
245
+
Rename the current chat. Fire-and-forget — `space.send(rename(...))` resolves to `undefined`.
246
+
247
+
```ts
248
+
import { rename } from "spectrum-ts";
249
+
250
+
await space.send(rename("New Chat Name"));
251
+
```
252
+
253
+
`space.rename(displayName)` is sugar for `space.send(rename(displayName))`. The builder throws at construction time if `displayName` is empty. Per-platform constraints (e.g. iMessage requires remote mode and a group chat) surface as `UnsupportedError` from the provider's send action.
254
+
255
+
## Avatar
256
+
257
+
Set or clear the chat avatar (group icon). Fire-and-forget — `space.send(avatar(...))` resolves to `undefined`.
258
+
259
+
```ts
260
+
import { avatar } from "spectrum-ts";
261
+
262
+
// Set from a file path — MIME type inferred from the extension
`space.avatar(...)` is sugar for `space.send(avatar(...))`. Per-platform constraints (e.g. iMessage requires remote mode and a group chat) surface as `UnsupportedError` from the provider's send action.
273
+
274
+
<Note>
275
+
The string `"clear"` is a reserved sentinel. If you have a file literally named `clear` with no extension, pass `"./clear"` or load it as a `Buffer`.
276
+
</Note>
277
+
243
278
## Composing multiple items
244
279
245
280
All send methods take a variadic list. Items are sent sequentially as separate messages:
Copy file name to clipboardExpand all lines: docs-src/spectrum-ts/introduction.mdx.vel
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -79,7 +79,7 @@ Every provider feeds the same message stream. Your agent can send, react, reply,
79
79
80
80
iMessage is where Spectrum is most mature.
81
81
82
-
Spectrum gives you production iMessage infrastructure with the richest iMessage feature set we offer today. You get managed iMessage lines, so your agent can run on any server and connect to iMessage through Spectrum. The managed iMessage provider supports local development, DMs and groups, typing indicators, reactions, threaded replies, group creation, message effects, chat backgrounds, per-line routing, dedicated line auto-scale, and automatic token renewal.
82
+
Spectrum gives you production iMessage infrastructure with the richest iMessage feature set we offer today. You get managed iMessage lines, so your agent can run on any server and connect to iMessage through Spectrum. The managed iMessage provider supports local development, DMs and groups, typing indicators, reactions, threaded replies, group creation, message effects, chat backgrounds, chat renaming, group avatars, per-line routing, dedicated line auto-scale, and automatic token renewal.
83
83
84
84
That matters because iMessage is not a generic SMS fallback. Users expect native behavior, reliable delivery, and conversations that feel like they belong on Apple devices.
Copy file name to clipboardExpand all lines: docs-src/spectrum-ts/providers/imessage.mdx.vel
+36-1Lines changed: 36 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -37,7 +37,7 @@ The iMessage provider supports three connection modes — local, cloud, and dedi
37
37
```
38
38
39
39
<Note>
40
-
Local mode only supports sending text and attachments. Reactions, typing indicators, threaded replies, group creation, and chat backgrounds are not available.
40
+
Local mode only supports sending text and attachments. Reactions, typing indicators, threaded replies, group creation, chat backgrounds, chat renaming, and group avatars are not available.
41
41
</Note>
42
42
</Tab>
43
43
<Tab title="Dedicated">
@@ -170,6 +170,41 @@ The wrapped content can be a string or any `attachment(...)`. Effects only apply
170
170
</Accordion>
171
171
</AccordionGroup>
172
172
173
+
## Chat renaming
174
+
175
+
Rename a group chat using `space.rename()` or the canonical `rename()` content builder:
176
+
177
+
```ts
178
+
import { rename } from "spectrum-ts";
179
+
180
+
// Sugar
181
+
await space.rename("Book Club");
182
+
183
+
// Canonical
184
+
await space.send(rename("Book Club"));
185
+
```
186
+
187
+
Renaming requires cloud or dedicated mode and only works on group chats. In local mode or on a DM, `rename()` throws an `UnsupportedError`.
188
+
189
+
## Group avatars
190
+
191
+
Set or clear the group chat icon using `space.avatar()` or the canonical `avatar()` content builder:
192
+
193
+
```ts
194
+
import { avatar } from "spectrum-ts";
195
+
196
+
// Sugar — set from a file path
197
+
await space.avatar("./icon.png");
198
+
199
+
// Sugar — clear the current avatar
200
+
await space.avatar("clear");
201
+
202
+
// Canonical
203
+
await space.send(avatar("./icon.png"));
204
+
```
205
+
206
+
Group avatars require cloud or dedicated mode and only work on group chats. In local mode or on a DM, `avatar()` throws an `UnsupportedError`.
207
+
173
208
## Chat backgrounds
174
209
175
210
Set or clear the chat background image. Import `background` from the iMessage provider and use the sugar method on a narrowed space:
Copy file name to clipboardExpand all lines: docs-src/spectrum-ts/reactions-and-replies.mdx.vel
+2-2Lines changed: 2 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -73,7 +73,7 @@ Both forms are equivalent — `message.reply(content)` wraps each content item i
73
73
74
74
On platforms with thread support (iMessage, WhatsApp Business), this sends a threaded reply. On platforms without, the call resolves as a no-op — **the reply is not downgraded to a regular send**. If you need guaranteed delivery, use `space.send(...)` instead.
75
75
76
-
`reply()` cannot wrap `reply`, `edit`, `reaction`, `group`, or `typing` content — the builder throws at construction time.
76
+
`reply()` cannot wrap `reply`, `edit`, `reaction`, `group`, `typing`, `rename`, or `avatar` content — the builder throws at construction time.
77
77
78
78
## Editing messages
79
79
@@ -96,7 +96,7 @@ On platforms with thread support (iMessage, WhatsApp Business), this sends a thr
96
96
97
97
`edit()` takes new content and the outbound message to rewrite. Edits are fire-and-forget — `space.send(edit(...))` resolves to `undefined`.
98
98
99
-
`edit()` cannot wrap `edit`, `reply`, `reaction`, `group`, or `typing` content.
0 commit comments