@spectrum-ts/core 8.2.2 → 9.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -99,6 +99,12 @@ declare const buildPhotoAction: (input: PhotoInput, options: {
99
99
  * universal sugar that delegates here. Per-platform constraints (e.g.
100
100
  * group-only, remote-only) surface as `UnsupportedError` from the provider's
101
101
  * `send` action so the canonical and sugar forms share one error path.
102
+ *
103
+ * Bidirectional: providers also surface platform icon changes as inbound
104
+ * `Message`s carrying this content — `action.kind === "set"` arrives with
105
+ * the fetched icon behind `read()`, `"clear"` mirrors icon removal.
106
+ * `message.sender` is the user who changed it (may be `undefined` when the
107
+ * platform recorded no actor).
102
108
  */
103
109
  declare const avatarSchema: z.ZodObject<{
104
110
  type: z.ZodLiteral<"avatar">;
@@ -112,6 +118,15 @@ declare const avatarSchema: z.ZodObject<{
112
118
  }, z.core.$strip>;
113
119
  type Avatar = z.infer<typeof avatarSchema>;
114
120
  type AvatarInput = PhotoInput;
121
+ /**
122
+ * The current chat avatar as returned by `space.getAvatar()`: raw image bytes
123
+ * plus MIME type. `data` is a Buffer so the value round-trips into the
124
+ * setter — `space.avatar(res.data, { mimeType: res.mimeType })`.
125
+ */
126
+ interface AvatarData {
127
+ data: Buffer;
128
+ mimeType: string;
129
+ }
115
130
  /**
116
131
  * Build an `Avatar` content value.
117
132
  *
@@ -304,9 +319,75 @@ declare const asReaction: (input: {
304
319
  */
305
320
  declare function reaction(emoji: string, target: Message | undefined): ReactionBuilder;
306
321
  //#endregion
322
+ //#region src/content/membership.d.ts
323
+ /**
324
+ * Group-membership management content. Universal content — providers
325
+ * dispatch by `content.type` in their `send` action and decide their own
326
+ * support story (e.g. iMessage only supports it for remote group chats;
327
+ * on a DM it surfaces an `UnsupportedError` telling the caller to create
328
+ * a group via `space.create` instead).
329
+ *
330
+ * `space.send(addMember(users))` is the canonical form; `space.add(...)`,
331
+ * `space.remove(...)`, and `space.leave()` are universal sugar that
332
+ * delegate here. All three are fire-and-forget — no `Message` is produced.
333
+ *
334
+ * Bidirectional: providers also surface platform membership events as
335
+ * inbound `Message`s carrying this content. `message.sender` is the acting
336
+ * user — who added/removed the members — and may be `undefined` when the
337
+ * platform recorded no actor. For `leaveSpace` the sender is the leaver
338
+ * (the content carries no `members`). The agent's own actions are
339
+ * suppressed: `space.add(...)` does not echo back as an inbound event.
340
+ *
341
+ * Members are id strings (or `User`s, normalized to their `id`) in the same
342
+ * platform handle format `space.create` accepts. No async resolution happens
343
+ * in the builder — ids reach the provider verbatim.
344
+ */
345
+ declare const addMemberSchema: z.ZodObject<{
346
+ type: z.ZodLiteral<"addMember">;
347
+ members: z.ZodArray<z.ZodString>;
348
+ }, z.core.$strip>;
349
+ type AddMember = z.infer<typeof addMemberSchema>;
350
+ declare const removeMemberSchema: z.ZodObject<{
351
+ type: z.ZodLiteral<"removeMember">;
352
+ members: z.ZodArray<z.ZodString>;
353
+ }, z.core.$strip>;
354
+ type RemoveMember = z.infer<typeof removeMemberSchema>;
355
+ declare const leaveSpaceSchema: z.ZodObject<{
356
+ type: z.ZodLiteral<"leaveSpace">;
357
+ }, z.core.$strip>;
358
+ type LeaveSpace = z.infer<typeof leaveSpaceSchema>;
359
+ /** Accepted member input: a `User`, a raw id string, or an array of either. */
360
+ type MemberInput = User | string | (User | string)[];
361
+ /**
362
+ * Build an `AddMember` content value inviting `users` into the current
363
+ * group chat. Accepts a single `User` or id string, or an array of either
364
+ * — batches land in one provider call.
365
+ */
366
+ declare function addMember(users: MemberInput): ContentBuilder;
367
+ /**
368
+ * Build a `RemoveMember` content value removing `users` from the current
369
+ * group chat. Accepts the same input shapes as `addMember`.
370
+ */
371
+ declare function removeMember(users: MemberInput): ContentBuilder;
372
+ /**
373
+ * Build a `LeaveSpace` content value making the agent's own account leave
374
+ * the current group chat.
375
+ */
376
+ declare function leaveSpace(): ContentBuilder;
377
+ //#endregion
307
378
  //#region src/types/space.d.ts
308
379
  interface Space<_Def = unknown> {
309
380
  readonly __platform: string;
381
+ /**
382
+ * Add members to the current chat. Sugar for `send(addMember(users))`.
383
+ * Accepts a single `User` or id string, or an array of either — batches
384
+ * land in one provider call. Fire-and-forget.
385
+ *
386
+ * Universal API; per-platform constraints (e.g. iMessage: remote + group
387
+ * only — a DM cannot be converted, create a group via `space.create`)
388
+ * surface as `UnsupportedError` from the provider's send action.
389
+ */
390
+ add(users: MemberInput): Promise<void>;
310
391
  /**
311
392
  * Set or clear the current chat's avatar (group icon). Sugar for
312
393
  * `send(avatar(input, options?))`.
@@ -335,6 +416,30 @@ interface Space<_Def = unknown> {
335
416
  * `send` results chain without narrowing; an undefined target throws.
336
417
  */
337
418
  edit(message: Message | undefined, newContent: ContentInput): Promise<void>;
419
+ /**
420
+ * Download the current chat avatar (group icon). Resolves `undefined` when
421
+ * the chat has none. The result round-trips into the setter:
422
+ * `space.avatar(res.data, { mimeType: res.mimeType })`.
423
+ *
424
+ * Universal API; per-platform constraints (e.g. iMessage: remote + group
425
+ * only — a DM throws) surface as `UnsupportedError`, as do platforms with
426
+ * no implementation.
427
+ */
428
+ getAvatar(): Promise<AvatarData | undefined>;
429
+ /**
430
+ * List the chat's current participants, excluding the agent's own account
431
+ * where the platform can identify it. Each entry is a `User` tagged with
432
+ * `__platform`; `id` is the user's canonical platform handle (the same
433
+ * format `space.create` accepts), so results feed straight back into
434
+ * `add()` / `remove()` / `space.create()`. Platform extras (e.g.
435
+ * iMessage's `address`/`country`/`service`) ride along untyped — use the
436
+ * platform instance's `getMembers(space)` for typed extras.
437
+ *
438
+ * Universal API; per-platform constraints (e.g. iMessage: remote + group
439
+ * only — a DM throws) surface as `UnsupportedError`, as do platforms with
440
+ * no implementation.
441
+ */
442
+ getMembers(): Promise<User[]>;
338
443
  /**
339
444
  * Look up a message in this space by its id. Returns `undefined` if the
340
445
  * platform has no way to resolve the id (e.g. cache miss with no by-id
@@ -343,6 +448,14 @@ interface Space<_Def = unknown> {
343
448
  */
344
449
  getMessage(id: string): Promise<Message | undefined>;
345
450
  readonly id: string;
451
+ /**
452
+ * Leave the current chat with the agent's own account. Sugar for
453
+ * `send(leaveSpace())`. Fire-and-forget.
454
+ *
455
+ * Universal API; per-platform constraints (e.g. iMessage: remote + group
456
+ * only) surface as `UnsupportedError` from the provider's send action.
457
+ */
458
+ leave(): Promise<void>;
346
459
  /**
347
460
  * Mark the conversation as read up to `message`, surfacing a read receipt
348
461
  * to the sender where the platform supports one. Sugar for
@@ -356,6 +469,15 @@ interface Space<_Def = unknown> {
356
469
  * everywhere — same contract as `startTyping()`.
357
470
  */
358
471
  read(message: Message): Promise<void>;
472
+ /**
473
+ * Remove members from the current chat. Sugar for
474
+ * `send(removeMember(users))`. Accepts the same input shapes as `add`.
475
+ * Fire-and-forget.
476
+ *
477
+ * Universal API; per-platform constraints (e.g. iMessage: remote + group
478
+ * only) surface as `UnsupportedError` from the provider's send action.
479
+ */
480
+ remove(users: MemberInput): Promise<void>;
359
481
  /**
360
482
  * Rename the current chat. Sugar for `send(rename(displayName))`.
361
483
  *
@@ -442,14 +564,12 @@ interface Message<TPlatform extends string = string, TSender extends User = User
442
564
  * (no new message id is produced; the existing message mutates in place).
443
565
  *
444
566
  * Edit cannot wrap `edit`, `reply`, `reaction`, `group`, `typing`, `rename`,
445
- * `avatar`, `unsend`, or `read` content.
567
+ * `avatar`, `addMember`, `removeMember`, `leaveSpace`, `unsend`, or `read`
568
+ * content.
446
569
  */
447
570
  declare const editSchema: z.ZodObject<{
448
571
  type: z.ZodLiteral<"edit">;
449
572
  content: z.ZodCustom<{
450
- type: "custom";
451
- raw: unknown;
452
- } | {
453
573
  type: "attachment";
454
574
  id: string;
455
575
  name: string;
@@ -457,26 +577,6 @@ declare const editSchema: z.ZodObject<{
457
577
  read: z.core.$InferOuterFunctionType<z.ZodTuple<readonly [], null>, z.ZodPromise<z.ZodCustom<Buffer<ArrayBufferLike>, Buffer<ArrayBufferLike>>>>;
458
578
  stream: z.core.$InferOuterFunctionType<z.ZodTuple<readonly [], null>, z.ZodPromise<z.ZodCustom<ReadableStream<unknown>, ReadableStream<unknown>>>>;
459
579
  size?: number | undefined;
460
- } | {
461
- type: "poll";
462
- title: string;
463
- options: {
464
- title: string;
465
- }[];
466
- } | {
467
- type: "poll_option";
468
- option: {
469
- title: string;
470
- };
471
- poll: {
472
- type: "poll";
473
- title: string;
474
- options: {
475
- title: string;
476
- }[];
477
- };
478
- selected: boolean;
479
- title: string;
480
580
  } | {
481
581
  type: "contact";
482
582
  user?: {
@@ -526,13 +626,39 @@ declare const editSchema: z.ZodObject<{
526
626
  } | {
527
627
  type: "markdown";
528
628
  markdown: string;
629
+ } | {
630
+ type: "custom";
631
+ raw: unknown;
529
632
  } | {
530
633
  type: "group";
531
634
  items: Message<string, User, Space<unknown>>[];
635
+ } | {
636
+ type: "poll";
637
+ title: string;
638
+ options: {
639
+ title: string;
640
+ }[];
641
+ } | {
642
+ type: "poll_option";
643
+ option: {
644
+ title: string;
645
+ };
646
+ poll: {
647
+ type: "poll";
648
+ title: string;
649
+ options: {
650
+ title: string;
651
+ }[];
652
+ };
653
+ selected: boolean;
654
+ title: string;
532
655
  } | {
533
656
  type: "reaction";
534
657
  emoji: string;
535
658
  target: Message<string, User, Space<unknown>>;
659
+ } | {
660
+ type: "richlink";
661
+ url: string;
536
662
  } | {
537
663
  type: "streamText";
538
664
  stream: () => AsyncIterable<string>;
@@ -545,9 +671,6 @@ declare const editSchema: z.ZodObject<{
545
671
  name?: string | undefined;
546
672
  duration?: number | undefined;
547
673
  size?: number | undefined;
548
- } | {
549
- type: "richlink";
550
- url: string;
551
674
  } | {
552
675
  type: "app";
553
676
  url: z.core.$InferOuterFunctionType<z.ZodTuple<readonly [], null>, z.ZodPromise<z.ZodURL>>;
@@ -594,10 +717,15 @@ declare const editSchema: z.ZodObject<{
594
717
  } | {
595
718
  kind: "clear";
596
719
  };
597
- }, {
598
- type: "custom";
599
- raw: unknown;
600
720
  } | {
721
+ type: "addMember";
722
+ members: string[];
723
+ } | {
724
+ type: "removeMember";
725
+ members: string[];
726
+ } | {
727
+ type: "leaveSpace";
728
+ }, {
601
729
  type: "attachment";
602
730
  id: string;
603
731
  name: string;
@@ -605,26 +733,6 @@ declare const editSchema: z.ZodObject<{
605
733
  read: z.core.$InferOuterFunctionType<z.ZodTuple<readonly [], null>, z.ZodPromise<z.ZodCustom<Buffer<ArrayBufferLike>, Buffer<ArrayBufferLike>>>>;
606
734
  stream: z.core.$InferOuterFunctionType<z.ZodTuple<readonly [], null>, z.ZodPromise<z.ZodCustom<ReadableStream<unknown>, ReadableStream<unknown>>>>;
607
735
  size?: number | undefined;
608
- } | {
609
- type: "poll";
610
- title: string;
611
- options: {
612
- title: string;
613
- }[];
614
- } | {
615
- type: "poll_option";
616
- option: {
617
- title: string;
618
- };
619
- poll: {
620
- type: "poll";
621
- title: string;
622
- options: {
623
- title: string;
624
- }[];
625
- };
626
- selected: boolean;
627
- title: string;
628
736
  } | {
629
737
  type: "contact";
630
738
  user?: {
@@ -674,13 +782,39 @@ declare const editSchema: z.ZodObject<{
674
782
  } | {
675
783
  type: "markdown";
676
784
  markdown: string;
785
+ } | {
786
+ type: "custom";
787
+ raw: unknown;
677
788
  } | {
678
789
  type: "group";
679
790
  items: Message<string, User, Space<unknown>>[];
791
+ } | {
792
+ type: "poll";
793
+ title: string;
794
+ options: {
795
+ title: string;
796
+ }[];
797
+ } | {
798
+ type: "poll_option";
799
+ option: {
800
+ title: string;
801
+ };
802
+ poll: {
803
+ type: "poll";
804
+ title: string;
805
+ options: {
806
+ title: string;
807
+ }[];
808
+ };
809
+ selected: boolean;
810
+ title: string;
680
811
  } | {
681
812
  type: "reaction";
682
813
  emoji: string;
683
814
  target: Message<string, User, Space<unknown>>;
815
+ } | {
816
+ type: "richlink";
817
+ url: string;
684
818
  } | {
685
819
  type: "streamText";
686
820
  stream: () => AsyncIterable<string>;
@@ -693,9 +827,6 @@ declare const editSchema: z.ZodObject<{
693
827
  name?: string | undefined;
694
828
  duration?: number | undefined;
695
829
  size?: number | undefined;
696
- } | {
697
- type: "richlink";
698
- url: string;
699
830
  } | {
700
831
  type: "app";
701
832
  url: z.core.$InferOuterFunctionType<z.ZodTuple<readonly [], null>, z.ZodPromise<z.ZodURL>>;
@@ -742,6 +873,14 @@ declare const editSchema: z.ZodObject<{
742
873
  } | {
743
874
  kind: "clear";
744
875
  };
876
+ } | {
877
+ type: "addMember";
878
+ members: string[];
879
+ } | {
880
+ type: "removeMember";
881
+ members: string[];
882
+ } | {
883
+ type: "leaveSpace";
745
884
  }>;
746
885
  target: z.ZodCustom<Message<string, User, Space<unknown>>, Message<string, User, Space<unknown>>>;
747
886
  }, z.core.$strip>;
@@ -942,6 +1081,10 @@ declare function read(target: Message): ContentBuilder;
942
1081
  * `space.send(rename("New Name"))` is the canonical form; `space.rename(...)`
943
1082
  * is universal sugar that delegates here.
944
1083
  *
1084
+ * Bidirectional: providers also surface platform rename events as inbound
1085
+ * `Message`s carrying this content; `message.sender` is the user who renamed
1086
+ * the chat (may be `undefined` when the platform recorded no actor).
1087
+ *
945
1088
  * Throws at build time if `displayName` is empty. Per-platform constraints
946
1089
  * (e.g. group-only, remote-only) surface as `UnsupportedError` from the
947
1090
  * provider's `send` action so the canonical and sugar forms share one
@@ -963,14 +1106,12 @@ declare function rename(displayName: string): ContentBuilder;
963
1106
  * `reply` like any other content type and route to a threaded send.
964
1107
  *
965
1108
  * Reply cannot wrap `reply`, `edit`, `reaction`, `group`, `typing`,
966
- * `rename`, `avatar`, `unsend`, or `read` content.
1109
+ * `rename`, `avatar`, `addMember`, `removeMember`, `leaveSpace`, `unsend`,
1110
+ * or `read` content.
967
1111
  */
968
1112
  declare const replySchema: z.ZodObject<{
969
1113
  type: z.ZodLiteral<"reply">;
970
1114
  content: z.ZodCustom<{
971
- type: "custom";
972
- raw: unknown;
973
- } | {
974
1115
  type: "attachment";
975
1116
  id: string;
976
1117
  name: string;
@@ -978,26 +1119,6 @@ declare const replySchema: z.ZodObject<{
978
1119
  read: z.core.$InferOuterFunctionType<z.ZodTuple<readonly [], null>, z.ZodPromise<z.ZodCustom<Buffer<ArrayBufferLike>, Buffer<ArrayBufferLike>>>>;
979
1120
  stream: z.core.$InferOuterFunctionType<z.ZodTuple<readonly [], null>, z.ZodPromise<z.ZodCustom<ReadableStream<unknown>, ReadableStream<unknown>>>>;
980
1121
  size?: number | undefined;
981
- } | {
982
- type: "poll";
983
- title: string;
984
- options: {
985
- title: string;
986
- }[];
987
- } | {
988
- type: "poll_option";
989
- option: {
990
- title: string;
991
- };
992
- poll: {
993
- type: "poll";
994
- title: string;
995
- options: {
996
- title: string;
997
- }[];
998
- };
999
- selected: boolean;
1000
- title: string;
1001
1122
  } | {
1002
1123
  type: "contact";
1003
1124
  user?: {
@@ -1047,13 +1168,39 @@ declare const replySchema: z.ZodObject<{
1047
1168
  } | {
1048
1169
  type: "markdown";
1049
1170
  markdown: string;
1171
+ } | {
1172
+ type: "custom";
1173
+ raw: unknown;
1050
1174
  } | {
1051
1175
  type: "group";
1052
1176
  items: Message<string, User, Space<unknown>>[];
1177
+ } | {
1178
+ type: "poll";
1179
+ title: string;
1180
+ options: {
1181
+ title: string;
1182
+ }[];
1183
+ } | {
1184
+ type: "poll_option";
1185
+ option: {
1186
+ title: string;
1187
+ };
1188
+ poll: {
1189
+ type: "poll";
1190
+ title: string;
1191
+ options: {
1192
+ title: string;
1193
+ }[];
1194
+ };
1195
+ selected: boolean;
1196
+ title: string;
1053
1197
  } | {
1054
1198
  type: "reaction";
1055
1199
  emoji: string;
1056
1200
  target: Message<string, User, Space<unknown>>;
1201
+ } | {
1202
+ type: "richlink";
1203
+ url: string;
1057
1204
  } | {
1058
1205
  type: "streamText";
1059
1206
  stream: () => AsyncIterable<string>;
@@ -1066,9 +1213,6 @@ declare const replySchema: z.ZodObject<{
1066
1213
  name?: string | undefined;
1067
1214
  duration?: number | undefined;
1068
1215
  size?: number | undefined;
1069
- } | {
1070
- type: "richlink";
1071
- url: string;
1072
1216
  } | {
1073
1217
  type: "app";
1074
1218
  url: z.core.$InferOuterFunctionType<z.ZodTuple<readonly [], null>, z.ZodPromise<z.ZodURL>>;
@@ -1115,10 +1259,15 @@ declare const replySchema: z.ZodObject<{
1115
1259
  } | {
1116
1260
  kind: "clear";
1117
1261
  };
1118
- }, {
1119
- type: "custom";
1120
- raw: unknown;
1121
1262
  } | {
1263
+ type: "addMember";
1264
+ members: string[];
1265
+ } | {
1266
+ type: "removeMember";
1267
+ members: string[];
1268
+ } | {
1269
+ type: "leaveSpace";
1270
+ }, {
1122
1271
  type: "attachment";
1123
1272
  id: string;
1124
1273
  name: string;
@@ -1126,26 +1275,6 @@ declare const replySchema: z.ZodObject<{
1126
1275
  read: z.core.$InferOuterFunctionType<z.ZodTuple<readonly [], null>, z.ZodPromise<z.ZodCustom<Buffer<ArrayBufferLike>, Buffer<ArrayBufferLike>>>>;
1127
1276
  stream: z.core.$InferOuterFunctionType<z.ZodTuple<readonly [], null>, z.ZodPromise<z.ZodCustom<ReadableStream<unknown>, ReadableStream<unknown>>>>;
1128
1277
  size?: number | undefined;
1129
- } | {
1130
- type: "poll";
1131
- title: string;
1132
- options: {
1133
- title: string;
1134
- }[];
1135
- } | {
1136
- type: "poll_option";
1137
- option: {
1138
- title: string;
1139
- };
1140
- poll: {
1141
- type: "poll";
1142
- title: string;
1143
- options: {
1144
- title: string;
1145
- }[];
1146
- };
1147
- selected: boolean;
1148
- title: string;
1149
1278
  } | {
1150
1279
  type: "contact";
1151
1280
  user?: {
@@ -1195,13 +1324,39 @@ declare const replySchema: z.ZodObject<{
1195
1324
  } | {
1196
1325
  type: "markdown";
1197
1326
  markdown: string;
1327
+ } | {
1328
+ type: "custom";
1329
+ raw: unknown;
1198
1330
  } | {
1199
1331
  type: "group";
1200
1332
  items: Message<string, User, Space<unknown>>[];
1333
+ } | {
1334
+ type: "poll";
1335
+ title: string;
1336
+ options: {
1337
+ title: string;
1338
+ }[];
1339
+ } | {
1340
+ type: "poll_option";
1341
+ option: {
1342
+ title: string;
1343
+ };
1344
+ poll: {
1345
+ type: "poll";
1346
+ title: string;
1347
+ options: {
1348
+ title: string;
1349
+ }[];
1350
+ };
1351
+ selected: boolean;
1352
+ title: string;
1201
1353
  } | {
1202
1354
  type: "reaction";
1203
1355
  emoji: string;
1204
1356
  target: Message<string, User, Space<unknown>>;
1357
+ } | {
1358
+ type: "richlink";
1359
+ url: string;
1205
1360
  } | {
1206
1361
  type: "streamText";
1207
1362
  stream: () => AsyncIterable<string>;
@@ -1214,9 +1369,6 @@ declare const replySchema: z.ZodObject<{
1214
1369
  name?: string | undefined;
1215
1370
  duration?: number | undefined;
1216
1371
  size?: number | undefined;
1217
- } | {
1218
- type: "richlink";
1219
- url: string;
1220
1372
  } | {
1221
1373
  type: "app";
1222
1374
  url: z.core.$InferOuterFunctionType<z.ZodTuple<readonly [], null>, z.ZodPromise<z.ZodURL>>;
@@ -1263,6 +1415,14 @@ declare const replySchema: z.ZodObject<{
1263
1415
  } | {
1264
1416
  kind: "clear";
1265
1417
  };
1418
+ } | {
1419
+ type: "addMember";
1420
+ members: string[];
1421
+ } | {
1422
+ type: "removeMember";
1423
+ members: string[];
1424
+ } | {
1425
+ type: "leaveSpace";
1266
1426
  }>;
1267
1427
  target: z.ZodCustom<Message<string, User, Space<unknown>>, Message<string, User, Space<unknown>>>;
1268
1428
  }, z.core.$strip>;
@@ -5991,7 +6151,8 @@ declare function broadcast<T>(source: ManagedStream<T>): Broadcaster<T>;
5991
6151
  * side effect.
5992
6152
  *
5993
6153
  * Names that collide with reserved `Space` keys (`send`, `edit`, `unsend`,
5994
- * `getMessage`, `startTyping`, `stopTyping`, `responding`, `id`,
6154
+ * `read`, `getMessage`, `getMembers`, `getAvatar`, `rename`, `avatar`, `add`,
6155
+ * `remove`, `leave`, `startTyping`, `stopTyping`, `responding`, `id`,
5995
6156
  * `__platform`) are skipped at runtime with a warning and excluded at the
5996
6157
  * type level via `Exclude<…, keyof Space>`.
5997
6158
  */
@@ -6022,11 +6183,12 @@ type MessageActionFn = (message: Message, ...args: never[]) => Promise<void>;
6022
6183
  *
6023
6184
  * Two tiers live in the same `actions?` slot:
6024
6185
  *
6025
- * - **Platform-wise actions** — fixed framework-known names (currently just
6026
- * `getMessage`) whose signatures are defined by `PlatformWiseActions`. They
6027
- * power universal sugar (`space.getMessage(id)`) AND surface on the
6028
- * platform instance. If a provider omits one, the framework wires a
6029
- * default that throws `UnsupportedError`.
6186
+ * - **Platform-wise actions** — fixed framework-known names (`getMessage`,
6187
+ * `getMembers`, `getAvatar`) whose signatures are defined by
6188
+ * `PlatformWiseActions`. They power universal sugar
6189
+ * (`space.getMessage(id)`, `space.getMembers()`, `space.getAvatar()`) AND
6190
+ * surface on the platform instance. If a provider omits one, the framework
6191
+ * wires a default that throws `UnsupportedError`.
6030
6192
  * - **Platform-specific actions** — free-form keys each platform declares
6031
6193
  * for its own ergonomics (e.g. iMessage's `getAttachment`). Surface on
6032
6194
  * the platform instance only.
@@ -6044,13 +6206,32 @@ type InstanceActionFn = (ctx: any, ...args: any[]) => Promise<unknown>;
6044
6206
  * by declaring the key inside their `actions` slot, and platforms that omit
6045
6207
  * the key get a default that throws `UnsupportedError`.
6046
6208
  *
6047
- * Add a new platform-wise capability by extending this record (and the
6048
- * runtime list in `define.ts`); the corresponding instance method will be
6049
- * surfaced on every `PlatformInstance` automatically.
6209
+ * Add a new platform-wise capability by extending this record along with:
6210
+ * `PlatformWiseInstanceMethods` (the public instance signature), the runtime
6211
+ * list `PLATFORM_WISE_ACTION_KEYS` in `build.ts`, and — when the capability
6212
+ * surfaces as universal `Space` sugar — the `Space` interface plus a
6213
+ * `buildSpace` impl and `RESERVED_SPACE_KEYS` entry. The instance method is
6214
+ * then surfaced on every `PlatformInstance` automatically.
6050
6215
  */
6051
6216
  interface PlatformWiseActions<_ResolvedSpace extends {
6052
6217
  id: string;
6053
6218
  }, _MessageType, _Client, _Config> {
6219
+ getAvatar: (ctx: {
6220
+ client: _Client;
6221
+ config: _Config;
6222
+ store: Store;
6223
+ }, space: _ResolvedSpace & {
6224
+ id: string;
6225
+ __platform: string;
6226
+ }) => Promise<AvatarData | undefined>;
6227
+ getMembers: (ctx: {
6228
+ client: _Client;
6229
+ config: _Config;
6230
+ store: Store;
6231
+ }, space: _ResolvedSpace & {
6232
+ id: string;
6233
+ __platform: string;
6234
+ }) => Promise<readonly ProviderUserRecord[]>;
6054
6235
  getMessage: (ctx: {
6055
6236
  client: _Client;
6056
6237
  config: _Config;
@@ -6089,7 +6270,7 @@ type EventProducer<TPayload = unknown, TClient = unknown, TConfig = unknown> = (
6089
6270
  type ProviderMessage<TSender extends ResolvedUser = ResolvedUser, TSpace extends ResolvedSpace = ResolvedSpace, TExtra extends object = Record<never, never>> = {
6090
6271
  id: string;
6091
6272
  content: Content;
6092
- sender: TSender;
6273
+ sender?: TSender;
6093
6274
  space: TSpace;
6094
6275
  timestamp?: Date;
6095
6276
  } & TExtra;
@@ -6116,6 +6297,17 @@ type ProviderMessageRecord = {
6116
6297
  } & Record<string, unknown>;
6117
6298
  timestamp?: Date;
6118
6299
  } & Record<string, unknown>;
6300
+ /**
6301
+ * A chat participant a provider returned from `actions.getMembers` — the raw
6302
+ * record shape, mirroring `ProviderMessageRecord.sender`. `id` is the user's
6303
+ * canonical platform identifier (the same handle format `space.create`
6304
+ * accepts); platform extras (e.g. iMessage's `address`/`country`/`service`)
6305
+ * ride along untyped. `space.getMembers()` tags each record with
6306
+ * `__platform` before surfacing it as a `User`.
6307
+ */
6308
+ type ProviderUserRecord = {
6309
+ id: string;
6310
+ } & Record<string, unknown>;
6119
6311
  type MergeSchema<TSchema extends z.ZodType | undefined, TBase extends object> = TSchema extends z.ZodType ? string extends keyof z.infer<TSchema> ? TBase : Omit<z.infer<TSchema>, keyof TBase> & TBase : TBase;
6120
6312
  type SchemaMessage<TUserSchema extends z.ZodType | undefined = undefined, TSpaceSchema extends z.ZodType | undefined = undefined> = ProviderMessage<MergeSchema<TUserSchema, ResolvedUser>, MergeSchema<TSpaceSchema, ResolvedSpace>>;
6121
6313
  type InferEventPayload<T> = T extends z.ZodType ? z.infer<T> : T extends ((ctx: never) => AsyncIterable<infer P>) ? P : never;
@@ -6157,13 +6349,14 @@ interface PlatformDef<_Name extends string = string, _ConfigSchema extends z.Zod
6157
6349
  *
6158
6350
  * Two tiers share this slot:
6159
6351
  *
6160
- * 1. **Platform-wise actions** (`getMessage`) — framework-recognized names
6161
- * declared in `PlatformWiseActions`. Override by declaring the key here
6162
- * with the matching signature. The framework injects `ctx = { client,
6163
- * config, store }` as the first arg and surfaces the method on the
6164
- * platform instance (`im.getMessage(space, id)`). If omitted, the
6165
- * framework wires a default that throws `UnsupportedError`. Powers
6166
- * universal sugar like `space.getMessage(id)`.
6352
+ * 1. **Platform-wise actions** (`getMessage`, `getMembers`, `getAvatar`) —
6353
+ * framework-recognized names declared in `PlatformWiseActions`. Override
6354
+ * by declaring the key here with the matching signature. The framework
6355
+ * injects `ctx = { client, config, store }` as the first arg and
6356
+ * surfaces the method on the platform instance
6357
+ * (`im.getMessage(space, id)`). If omitted, the framework wires a
6358
+ * default that throws `UnsupportedError`. Powers universal sugar like
6359
+ * `space.getMessage(id)`.
6167
6360
  *
6168
6361
  * 2. **Platform-specific actions** — free-form keys like `getAttachment`.
6169
6362
  * Each gets `ctx = { client, config, store }` as the first arg; the
@@ -6301,9 +6494,10 @@ interface PlatformDef<_Name extends string = string, _ConfigSchema extends z.Zod
6301
6494
  * lives here for platform-specific surface area.
6302
6495
  *
6303
6496
  * Names that collide with reserved `Space` keys (`send`, `edit`,
6304
- * `unsend`, `getMessage`, `startTyping`, `stopTyping`, `responding`,
6305
- * `id`, `__platform`) are skipped at runtime with a warning and excluded
6306
- * at the type level.
6497
+ * `unsend`, `read`, `getMessage`, `getMembers`, `getAvatar`, `rename`,
6498
+ * `avatar`, `add`, `remove`, `leave`, `startTyping`, `stopTyping`,
6499
+ * `responding`, `id`, `__platform`) are skipped at runtime with a
6500
+ * warning and excluded at the type level.
6307
6501
  */
6308
6502
  actions?: _SpaceActions;
6309
6503
  };
@@ -6410,6 +6604,8 @@ type InstanceActionFns<Def extends AnyPlatformDef> = Def["actions"] extends infe
6410
6604
  type ReservedInstanceKeys<Def extends AnyPlatformDef> = "user" | "space" | "messages" | PlatformWiseActionKey | Extract<keyof CustomEventInstanceProperties<Def>, string>;
6411
6605
  type InstanceActionMethods<Def extends AnyPlatformDef> = { [K in Exclude<keyof InstanceActionFns<Def>, ReservedInstanceKeys<Def> | symbol | number>]: (...args: TailArgs<Parameters<InstanceActionFns<Def>[K]>>) => ReturnType<InstanceActionFns<Def>[K]> };
6412
6606
  interface PlatformWiseInstanceMethods<Def extends AnyPlatformDef> {
6607
+ getAvatar: (space: PlatformSpace<Def>) => Promise<AvatarData | undefined>;
6608
+ getMembers: (space: PlatformSpace<Def>) => Promise<PlatformUser<Def>[]>;
6413
6609
  getMessage: (space: PlatformSpace<Def>, messageId: string) => Promise<PlatformMessage<Def> | undefined>;
6414
6610
  }
6415
6611
  type PlatformSpace<Def extends AnyPlatformDef> = Omit<SpaceShapeOf<Def>, keyof Space | keyof SpaceActionMethods<Def>> & Space & SpaceActionMethods<Def>;
@@ -6852,6 +7048,14 @@ declare const baseContentSchema: z.ZodDiscriminatedUnion<readonly [z.ZodObject<{
6852
7048
  }, z.core.$strip>, z.ZodObject<{
6853
7049
  kind: z.ZodLiteral<"clear">;
6854
7050
  }, z.core.$strip>], "kind">;
7051
+ }, z.core.$strip>, z.ZodObject<{
7052
+ type: z.ZodLiteral<"addMember">;
7053
+ members: z.ZodArray<z.ZodString>;
7054
+ }, z.core.$strip>, z.ZodObject<{
7055
+ type: z.ZodLiteral<"removeMember">;
7056
+ members: z.ZodArray<z.ZodString>;
7057
+ }, z.core.$strip>, z.ZodObject<{
7058
+ type: z.ZodLiteral<"leaveSpace">;
6855
7059
  }, z.core.$strip>], "type">;
6856
7060
  type BaseContent = z.infer<typeof baseContentSchema>;
6857
7061
  declare const contentSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
@@ -7021,12 +7225,17 @@ declare const contentSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
7021
7225
  }, z.core.$strip>, z.ZodObject<{
7022
7226
  kind: z.ZodLiteral<"clear">;
7023
7227
  }, z.core.$strip>], "kind">;
7228
+ }, z.core.$strip>, z.ZodObject<{
7229
+ type: z.ZodLiteral<"addMember">;
7230
+ members: z.ZodArray<z.ZodString>;
7231
+ }, z.core.$strip>, z.ZodObject<{
7232
+ type: z.ZodLiteral<"removeMember">;
7233
+ members: z.ZodArray<z.ZodString>;
7234
+ }, z.core.$strip>, z.ZodObject<{
7235
+ type: z.ZodLiteral<"leaveSpace">;
7024
7236
  }, z.core.$strip>, z.ZodObject<{
7025
7237
  type: z.ZodLiteral<"reply">;
7026
7238
  content: z.ZodCustom<{
7027
- type: "custom";
7028
- raw: unknown;
7029
- } | {
7030
7239
  type: "attachment";
7031
7240
  id: string;
7032
7241
  name: string;
@@ -7034,26 +7243,6 @@ declare const contentSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
7034
7243
  read: z.core.$InferOuterFunctionType<z.ZodTuple<readonly [], null>, z.ZodPromise<z.ZodCustom<Buffer<ArrayBufferLike>, Buffer<ArrayBufferLike>>>>;
7035
7244
  stream: z.core.$InferOuterFunctionType<z.ZodTuple<readonly [], null>, z.ZodPromise<z.ZodCustom<ReadableStream<unknown>, ReadableStream<unknown>>>>;
7036
7245
  size?: number | undefined;
7037
- } | {
7038
- type: "poll";
7039
- title: string;
7040
- options: {
7041
- title: string;
7042
- }[];
7043
- } | {
7044
- type: "poll_option";
7045
- option: {
7046
- title: string;
7047
- };
7048
- poll: {
7049
- type: "poll";
7050
- title: string;
7051
- options: {
7052
- title: string;
7053
- }[];
7054
- };
7055
- selected: boolean;
7056
- title: string;
7057
7246
  } | {
7058
7247
  type: "contact";
7059
7248
  user?: {
@@ -7103,13 +7292,39 @@ declare const contentSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
7103
7292
  } | {
7104
7293
  type: "markdown";
7105
7294
  markdown: string;
7295
+ } | {
7296
+ type: "custom";
7297
+ raw: unknown;
7106
7298
  } | {
7107
7299
  type: "group";
7108
7300
  items: Message<string, User, Space<unknown>>[];
7301
+ } | {
7302
+ type: "poll";
7303
+ title: string;
7304
+ options: {
7305
+ title: string;
7306
+ }[];
7307
+ } | {
7308
+ type: "poll_option";
7309
+ option: {
7310
+ title: string;
7311
+ };
7312
+ poll: {
7313
+ type: "poll";
7314
+ title: string;
7315
+ options: {
7316
+ title: string;
7317
+ }[];
7318
+ };
7319
+ selected: boolean;
7320
+ title: string;
7109
7321
  } | {
7110
7322
  type: "reaction";
7111
7323
  emoji: string;
7112
7324
  target: Message<string, User, Space<unknown>>;
7325
+ } | {
7326
+ type: "richlink";
7327
+ url: string;
7113
7328
  } | {
7114
7329
  type: "streamText";
7115
7330
  stream: () => AsyncIterable<string>;
@@ -7122,9 +7337,6 @@ declare const contentSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
7122
7337
  name?: string | undefined;
7123
7338
  duration?: number | undefined;
7124
7339
  size?: number | undefined;
7125
- } | {
7126
- type: "richlink";
7127
- url: string;
7128
7340
  } | {
7129
7341
  type: "app";
7130
7342
  url: z.core.$InferOuterFunctionType<z.ZodTuple<readonly [], null>, z.ZodPromise<z.ZodURL>>;
@@ -7171,10 +7383,15 @@ declare const contentSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
7171
7383
  } | {
7172
7384
  kind: "clear";
7173
7385
  };
7174
- }, {
7175
- type: "custom";
7176
- raw: unknown;
7177
7386
  } | {
7387
+ type: "addMember";
7388
+ members: string[];
7389
+ } | {
7390
+ type: "removeMember";
7391
+ members: string[];
7392
+ } | {
7393
+ type: "leaveSpace";
7394
+ }, {
7178
7395
  type: "attachment";
7179
7396
  id: string;
7180
7397
  name: string;
@@ -7182,26 +7399,6 @@ declare const contentSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
7182
7399
  read: z.core.$InferOuterFunctionType<z.ZodTuple<readonly [], null>, z.ZodPromise<z.ZodCustom<Buffer<ArrayBufferLike>, Buffer<ArrayBufferLike>>>>;
7183
7400
  stream: z.core.$InferOuterFunctionType<z.ZodTuple<readonly [], null>, z.ZodPromise<z.ZodCustom<ReadableStream<unknown>, ReadableStream<unknown>>>>;
7184
7401
  size?: number | undefined;
7185
- } | {
7186
- type: "poll";
7187
- title: string;
7188
- options: {
7189
- title: string;
7190
- }[];
7191
- } | {
7192
- type: "poll_option";
7193
- option: {
7194
- title: string;
7195
- };
7196
- poll: {
7197
- type: "poll";
7198
- title: string;
7199
- options: {
7200
- title: string;
7201
- }[];
7202
- };
7203
- selected: boolean;
7204
- title: string;
7205
7402
  } | {
7206
7403
  type: "contact";
7207
7404
  user?: {
@@ -7251,13 +7448,39 @@ declare const contentSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
7251
7448
  } | {
7252
7449
  type: "markdown";
7253
7450
  markdown: string;
7451
+ } | {
7452
+ type: "custom";
7453
+ raw: unknown;
7254
7454
  } | {
7255
7455
  type: "group";
7256
7456
  items: Message<string, User, Space<unknown>>[];
7457
+ } | {
7458
+ type: "poll";
7459
+ title: string;
7460
+ options: {
7461
+ title: string;
7462
+ }[];
7463
+ } | {
7464
+ type: "poll_option";
7465
+ option: {
7466
+ title: string;
7467
+ };
7468
+ poll: {
7469
+ type: "poll";
7470
+ title: string;
7471
+ options: {
7472
+ title: string;
7473
+ }[];
7474
+ };
7475
+ selected: boolean;
7476
+ title: string;
7257
7477
  } | {
7258
7478
  type: "reaction";
7259
7479
  emoji: string;
7260
7480
  target: Message<string, User, Space<unknown>>;
7481
+ } | {
7482
+ type: "richlink";
7483
+ url: string;
7261
7484
  } | {
7262
7485
  type: "streamText";
7263
7486
  stream: () => AsyncIterable<string>;
@@ -7270,9 +7493,6 @@ declare const contentSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
7270
7493
  name?: string | undefined;
7271
7494
  duration?: number | undefined;
7272
7495
  size?: number | undefined;
7273
- } | {
7274
- type: "richlink";
7275
- url: string;
7276
7496
  } | {
7277
7497
  type: "app";
7278
7498
  url: z.core.$InferOuterFunctionType<z.ZodTuple<readonly [], null>, z.ZodPromise<z.ZodURL>>;
@@ -7319,14 +7539,19 @@ declare const contentSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
7319
7539
  } | {
7320
7540
  kind: "clear";
7321
7541
  };
7542
+ } | {
7543
+ type: "addMember";
7544
+ members: string[];
7545
+ } | {
7546
+ type: "removeMember";
7547
+ members: string[];
7548
+ } | {
7549
+ type: "leaveSpace";
7322
7550
  }>;
7323
7551
  target: z.ZodCustom<Message<string, User, Space<unknown>>, Message<string, User, Space<unknown>>>;
7324
7552
  }, z.core.$strip>, z.ZodObject<{
7325
7553
  type: z.ZodLiteral<"edit">;
7326
7554
  content: z.ZodCustom<{
7327
- type: "custom";
7328
- raw: unknown;
7329
- } | {
7330
7555
  type: "attachment";
7331
7556
  id: string;
7332
7557
  name: string;
@@ -7334,26 +7559,6 @@ declare const contentSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
7334
7559
  read: z.core.$InferOuterFunctionType<z.ZodTuple<readonly [], null>, z.ZodPromise<z.ZodCustom<Buffer<ArrayBufferLike>, Buffer<ArrayBufferLike>>>>;
7335
7560
  stream: z.core.$InferOuterFunctionType<z.ZodTuple<readonly [], null>, z.ZodPromise<z.ZodCustom<ReadableStream<unknown>, ReadableStream<unknown>>>>;
7336
7561
  size?: number | undefined;
7337
- } | {
7338
- type: "poll";
7339
- title: string;
7340
- options: {
7341
- title: string;
7342
- }[];
7343
- } | {
7344
- type: "poll_option";
7345
- option: {
7346
- title: string;
7347
- };
7348
- poll: {
7349
- type: "poll";
7350
- title: string;
7351
- options: {
7352
- title: string;
7353
- }[];
7354
- };
7355
- selected: boolean;
7356
- title: string;
7357
7562
  } | {
7358
7563
  type: "contact";
7359
7564
  user?: {
@@ -7403,13 +7608,39 @@ declare const contentSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
7403
7608
  } | {
7404
7609
  type: "markdown";
7405
7610
  markdown: string;
7611
+ } | {
7612
+ type: "custom";
7613
+ raw: unknown;
7406
7614
  } | {
7407
7615
  type: "group";
7408
7616
  items: Message<string, User, Space<unknown>>[];
7617
+ } | {
7618
+ type: "poll";
7619
+ title: string;
7620
+ options: {
7621
+ title: string;
7622
+ }[];
7623
+ } | {
7624
+ type: "poll_option";
7625
+ option: {
7626
+ title: string;
7627
+ };
7628
+ poll: {
7629
+ type: "poll";
7630
+ title: string;
7631
+ options: {
7632
+ title: string;
7633
+ }[];
7634
+ };
7635
+ selected: boolean;
7636
+ title: string;
7409
7637
  } | {
7410
7638
  type: "reaction";
7411
7639
  emoji: string;
7412
7640
  target: Message<string, User, Space<unknown>>;
7641
+ } | {
7642
+ type: "richlink";
7643
+ url: string;
7413
7644
  } | {
7414
7645
  type: "streamText";
7415
7646
  stream: () => AsyncIterable<string>;
@@ -7422,9 +7653,6 @@ declare const contentSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
7422
7653
  name?: string | undefined;
7423
7654
  duration?: number | undefined;
7424
7655
  size?: number | undefined;
7425
- } | {
7426
- type: "richlink";
7427
- url: string;
7428
7656
  } | {
7429
7657
  type: "app";
7430
7658
  url: z.core.$InferOuterFunctionType<z.ZodTuple<readonly [], null>, z.ZodPromise<z.ZodURL>>;
@@ -7471,10 +7699,15 @@ declare const contentSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
7471
7699
  } | {
7472
7700
  kind: "clear";
7473
7701
  };
7474
- }, {
7475
- type: "custom";
7476
- raw: unknown;
7477
7702
  } | {
7703
+ type: "addMember";
7704
+ members: string[];
7705
+ } | {
7706
+ type: "removeMember";
7707
+ members: string[];
7708
+ } | {
7709
+ type: "leaveSpace";
7710
+ }, {
7478
7711
  type: "attachment";
7479
7712
  id: string;
7480
7713
  name: string;
@@ -7482,26 +7715,6 @@ declare const contentSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
7482
7715
  read: z.core.$InferOuterFunctionType<z.ZodTuple<readonly [], null>, z.ZodPromise<z.ZodCustom<Buffer<ArrayBufferLike>, Buffer<ArrayBufferLike>>>>;
7483
7716
  stream: z.core.$InferOuterFunctionType<z.ZodTuple<readonly [], null>, z.ZodPromise<z.ZodCustom<ReadableStream<unknown>, ReadableStream<unknown>>>>;
7484
7717
  size?: number | undefined;
7485
- } | {
7486
- type: "poll";
7487
- title: string;
7488
- options: {
7489
- title: string;
7490
- }[];
7491
- } | {
7492
- type: "poll_option";
7493
- option: {
7494
- title: string;
7495
- };
7496
- poll: {
7497
- type: "poll";
7498
- title: string;
7499
- options: {
7500
- title: string;
7501
- }[];
7502
- };
7503
- selected: boolean;
7504
- title: string;
7505
7718
  } | {
7506
7719
  type: "contact";
7507
7720
  user?: {
@@ -7551,13 +7764,39 @@ declare const contentSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
7551
7764
  } | {
7552
7765
  type: "markdown";
7553
7766
  markdown: string;
7767
+ } | {
7768
+ type: "custom";
7769
+ raw: unknown;
7554
7770
  } | {
7555
7771
  type: "group";
7556
7772
  items: Message<string, User, Space<unknown>>[];
7773
+ } | {
7774
+ type: "poll";
7775
+ title: string;
7776
+ options: {
7777
+ title: string;
7778
+ }[];
7779
+ } | {
7780
+ type: "poll_option";
7781
+ option: {
7782
+ title: string;
7783
+ };
7784
+ poll: {
7785
+ type: "poll";
7786
+ title: string;
7787
+ options: {
7788
+ title: string;
7789
+ }[];
7790
+ };
7791
+ selected: boolean;
7792
+ title: string;
7557
7793
  } | {
7558
7794
  type: "reaction";
7559
7795
  emoji: string;
7560
7796
  target: Message<string, User, Space<unknown>>;
7797
+ } | {
7798
+ type: "richlink";
7799
+ url: string;
7561
7800
  } | {
7562
7801
  type: "streamText";
7563
7802
  stream: () => AsyncIterable<string>;
@@ -7570,9 +7809,6 @@ declare const contentSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
7570
7809
  name?: string | undefined;
7571
7810
  duration?: number | undefined;
7572
7811
  size?: number | undefined;
7573
- } | {
7574
- type: "richlink";
7575
- url: string;
7576
7812
  } | {
7577
7813
  type: "app";
7578
7814
  url: z.core.$InferOuterFunctionType<z.ZodTuple<readonly [], null>, z.ZodPromise<z.ZodURL>>;
@@ -7619,6 +7855,14 @@ declare const contentSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
7619
7855
  } | {
7620
7856
  kind: "clear";
7621
7857
  };
7858
+ } | {
7859
+ type: "addMember";
7860
+ members: string[];
7861
+ } | {
7862
+ type: "removeMember";
7863
+ members: string[];
7864
+ } | {
7865
+ type: "leaveSpace";
7622
7866
  }>;
7623
7867
  target: z.ZodCustom<Message<string, User, Space<unknown>>, Message<string, User, Space<unknown>>>;
7624
7868
  }, z.core.$strip>, z.ZodObject<{
@@ -7660,4 +7904,4 @@ declare function attachment(input: AttachmentInput, options?: {
7660
7904
  name?: string;
7661
7905
  }): ContentBuilder;
7662
7906
  //#endregion
7663
- export { FusorTokenData as $, asGroup as $t, isFusorEvent as A, photoActionSchema as An, reply as At, PlatformUser as B, PollOption as Bt, FusorVerify as C, AgentSender as Cn, text as Ct, WebhookRawResult as D, avatar as Dn, resolveContents as Dt, WebhookRawRequest as E, AvatarInput as En, richlink as Et, PlatformInstance as F, appLayoutSchema as Fn, asRead as Ft, Broadcaster as G, Markdown as Gt, ProviderMessageRecord as H, asPollOption as Ht, PlatformMessage as I, read as It, mergeStreams as J, DeltaExtractor as Jt, ManagedStream as K, asMarkdown as Kt, PlatformProviderConfig as L, Poll as Lt, EventProducer as M, AppLayout as Mn, Rename as Mt, Platform as N, AppUrl as Nn, rename as Nt, FusorEvent as O, PhotoInput as On, Reply as Ot, PlatformDef as P, app as Pn, Read as Pt, DedicatedTokenData as Q, Group as Qt, PlatformRuntime as R, PollChoice as Rt, FusorRespond as S, contact as Sn, asText as St, WebhookHandler as T, Avatar as Tn, asRichlink as Tt, SchemaMessage as U, option as Ut, ProviderMessage as V, asPoll as Vt, SpaceNamespace as W, poll as Wt, Store as X, StreamTextSource as Xt, stream as Y, StreamText as Yt, CloudPlatform as Z, TextStreamOptions as Zt, FusorClient as _, ContactInput as _n, voice as _t, Content as a, Space as an, SharedTokenData as at, FusorMessagesReturn as b, ContactPhone as bn, Typing as bt, fromVCard as c, asReaction as cn, SpectrumCloudError as ct, UnsupportedKind as d, asCustom as dn, TokenData as dt, group as en, ImessageInfoData as et, Spectrum as f, custom as fn, cloud as ft, isFusorClient as g, ContactEmail as gn, asVoice as gt, fusor as h, ContactDetails as hn, Voice as ht, attachment as i, Message as in, ProjectProfile as it, AnyPlatformDef as j, App as jn, replySchema as jt, fusorEvent as k, buildPhotoAction as kn, asReply as kt, toVCard as l, reaction as ln, SubscriptionData as lt, definePlatform as m, ContactAddress as mn, EmojiKey as mt, AttachmentInput as n, Edit as nn, PlatformsData as nt, ContentBuilder as o, Reaction as on, SlackTeamMeta as ot, SpectrumInstance as p, Contact as pn, Emoji as pt, broadcast as q, markdown as qt, asAttachment as r, edit as rn, ProjectData as rt, ContentInput as s, ReactionBuilder as sn, SlackTokenData as st, Attachment as t, groupSchema as tn, PlatformStatus as tt, UnsupportedError as u, reactionSchema as un, SubscriptionStatus as ut, FusorMessages as v, ContactName as vn, Unsend as vt, FusorVerifyRequest as w, User as wn, Richlink as wt, FusorReply as x, asContact as xn, typing as xt, FusorMessagesCtx as y, ContactOrg as yn, unsend as yt, PlatformSpace as z, PollChoiceInput as zt };
7907
+ export { DedicatedTokenData as $, TextStreamOptions as $t, isFusorEvent as A, ContactName as An, asReply as At, PlatformUser as B, avatar as Bn, PollChoice as Bt, FusorVerify as C, asCustom as Cn, asText as Ct, WebhookRawResult as D, ContactDetails as Dn, richlink as Dt, WebhookRawRequest as E, ContactAddress as En, asRichlink as Et, PlatformInstance as F, AgentSender as Fn, renameSchema as Ft, SpaceNamespace as G, App as Gn, option as Gt, ProviderMessageRecord as H, PhotoInput as Hn, PollOption as Ht, PlatformMessage as I, User as In, Read as It, broadcast as J, app as Jn, asMarkdown as Jt, Broadcaster as K, AppLayout as Kn, poll as Kt, PlatformProviderConfig as L, Avatar as Ln, asRead as Lt, EventProducer as M, ContactPhone as Mn, replySchema as Mt, Platform as N, asContact as Nn, Rename as Nt, FusorEvent as O, ContactEmail as On, resolveContents as Ot, PlatformDef as P, contact as Pn, rename as Pt, CloudPlatform as Q, StreamTextSource as Qt, PlatformRuntime as R, AvatarData as Rn, read as Rt, FusorRespond as S, reactionSchema as Sn, typing as St, WebhookHandler as T, Contact as Tn, Richlink as Tt, ProviderUserRecord as U, buildPhotoAction as Un, asPoll as Ut, ProviderMessage as V, avatarSchema as Vn, PollChoiceInput as Vt, SchemaMessage as W, photoActionSchema as Wn, asPollOption as Wt, stream as X, DeltaExtractor as Xt, mergeStreams as Y, appLayoutSchema as Yn, markdown as Yt, Store as Z, StreamText as Zt, FusorClient as _, removeMemberSchema as _n, asVoice as _t, Content as a, edit as an, ProjectProfile as at, FusorMessagesReturn as b, asReaction as bn, unsend as bt, fromVCard as c, AddMember as cn, SlackTokenData as ct, UnsupportedKind as d, RemoveMember as dn, SubscriptionStatus as dt, Group as en, FusorTokenData as et, Spectrum as f, addMember as fn, TokenData as ft, isFusorClient as g, removeMember as gn, Voice as gt, fusor as h, leaveSpaceSchema as hn, EmojiKey as ht, attachment as i, Edit as in, ProjectData as it, AnyPlatformDef as j, ContactOrg as jn, reply as jt, fusorEvent as k, ContactInput as kn, Reply as kt, toVCard as l, LeaveSpace as ln, SpectrumCloudError as lt, definePlatform as m, leaveSpace as mn, Emoji as mt, AttachmentInput as n, group as nn, PlatformStatus as nt, ContentBuilder as o, Message as on, SharedTokenData as ot, SpectrumInstance as p, addMemberSchema as pn, cloud as pt, ManagedStream as q, AppUrl as qn, Markdown as qt, asAttachment as r, groupSchema as rn, PlatformsData as rt, ContentInput as s, Space as sn, SlackTeamMeta as st, Attachment as t, asGroup as tn, ImessageInfoData as tt, UnsupportedError as u, MemberInput as un, SubscriptionData as ut, FusorMessages as v, Reaction as vn, voice as vt, FusorVerifyRequest as w, custom as wn, text as wt, FusorReply as x, reaction as xn, Typing as xt, FusorMessagesCtx as y, ReactionBuilder as yn, Unsend as yt, PlatformSpace as z, AvatarInput as zn, Poll as zt };