@spectrum-ts/core 8.2.2 → 9.1.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,40 @@ 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
|
+
* Read the current chat's display name (group/chat title). Resolves
|
|
431
|
+
* `undefined` when the chat has none — an unnamed group, or a 1:1 chat on a
|
|
432
|
+
* platform that stores no title for DMs. Round-trips into `space.rename()`.
|
|
433
|
+
*
|
|
434
|
+
* Universal API; unlike `rename` the read is not group-only. Per-platform
|
|
435
|
+
* constraints (e.g. iMessage: remote only) surface as `UnsupportedError`, as
|
|
436
|
+
* do platforms with no implementation.
|
|
437
|
+
*/
|
|
438
|
+
getDisplayName(): Promise<string | undefined>;
|
|
439
|
+
/**
|
|
440
|
+
* List the chat's current participants, excluding the agent's own account
|
|
441
|
+
* where the platform can identify it. Each entry is a `User` tagged with
|
|
442
|
+
* `__platform`; `id` is the user's canonical platform handle (the same
|
|
443
|
+
* format `space.create` accepts), so results feed straight back into
|
|
444
|
+
* `add()` / `remove()` / `space.create()`. Platform extras (e.g.
|
|
445
|
+
* iMessage's `address`/`country`/`service`) ride along untyped — use the
|
|
446
|
+
* platform instance's `getMembers(space)` for typed extras.
|
|
447
|
+
*
|
|
448
|
+
* Universal API; per-platform constraints (e.g. iMessage: remote + group
|
|
449
|
+
* only — a DM throws) surface as `UnsupportedError`, as do platforms with
|
|
450
|
+
* no implementation.
|
|
451
|
+
*/
|
|
452
|
+
getMembers(): Promise<User[]>;
|
|
338
453
|
/**
|
|
339
454
|
* Look up a message in this space by its id. Returns `undefined` if the
|
|
340
455
|
* platform has no way to resolve the id (e.g. cache miss with no by-id
|
|
@@ -343,6 +458,14 @@ interface Space<_Def = unknown> {
|
|
|
343
458
|
*/
|
|
344
459
|
getMessage(id: string): Promise<Message | undefined>;
|
|
345
460
|
readonly id: string;
|
|
461
|
+
/**
|
|
462
|
+
* Leave the current chat with the agent's own account. Sugar for
|
|
463
|
+
* `send(leaveSpace())`. Fire-and-forget.
|
|
464
|
+
*
|
|
465
|
+
* Universal API; per-platform constraints (e.g. iMessage: remote + group
|
|
466
|
+
* only) surface as `UnsupportedError` from the provider's send action.
|
|
467
|
+
*/
|
|
468
|
+
leave(): Promise<void>;
|
|
346
469
|
/**
|
|
347
470
|
* Mark the conversation as read up to `message`, surfacing a read receipt
|
|
348
471
|
* to the sender where the platform supports one. Sugar for
|
|
@@ -356,6 +479,15 @@ interface Space<_Def = unknown> {
|
|
|
356
479
|
* everywhere — same contract as `startTyping()`.
|
|
357
480
|
*/
|
|
358
481
|
read(message: Message): Promise<void>;
|
|
482
|
+
/**
|
|
483
|
+
* Remove members from the current chat. Sugar for
|
|
484
|
+
* `send(removeMember(users))`. Accepts the same input shapes as `add`.
|
|
485
|
+
* Fire-and-forget.
|
|
486
|
+
*
|
|
487
|
+
* Universal API; per-platform constraints (e.g. iMessage: remote + group
|
|
488
|
+
* only) surface as `UnsupportedError` from the provider's send action.
|
|
489
|
+
*/
|
|
490
|
+
remove(users: MemberInput): Promise<void>;
|
|
359
491
|
/**
|
|
360
492
|
* Rename the current chat. Sugar for `send(rename(displayName))`.
|
|
361
493
|
*
|
|
@@ -442,14 +574,12 @@ interface Message<TPlatform extends string = string, TSender extends User = User
|
|
|
442
574
|
* (no new message id is produced; the existing message mutates in place).
|
|
443
575
|
*
|
|
444
576
|
* Edit cannot wrap `edit`, `reply`, `reaction`, `group`, `typing`, `rename`,
|
|
445
|
-
* `avatar`, `unsend`, or `read`
|
|
577
|
+
* `avatar`, `addMember`, `removeMember`, `leaveSpace`, `unsend`, or `read`
|
|
578
|
+
* content.
|
|
446
579
|
*/
|
|
447
580
|
declare const editSchema: z.ZodObject<{
|
|
448
581
|
type: z.ZodLiteral<"edit">;
|
|
449
582
|
content: z.ZodCustom<{
|
|
450
|
-
type: "custom";
|
|
451
|
-
raw: unknown;
|
|
452
|
-
} | {
|
|
453
583
|
type: "attachment";
|
|
454
584
|
id: string;
|
|
455
585
|
name: string;
|
|
@@ -458,25 +588,11 @@ declare const editSchema: z.ZodObject<{
|
|
|
458
588
|
stream: z.core.$InferOuterFunctionType<z.ZodTuple<readonly [], null>, z.ZodPromise<z.ZodCustom<ReadableStream<unknown>, ReadableStream<unknown>>>>;
|
|
459
589
|
size?: number | undefined;
|
|
460
590
|
} | {
|
|
461
|
-
type: "
|
|
462
|
-
|
|
463
|
-
options: {
|
|
464
|
-
title: string;
|
|
465
|
-
}[];
|
|
591
|
+
type: "text";
|
|
592
|
+
text: string;
|
|
466
593
|
} | {
|
|
467
|
-
type: "
|
|
468
|
-
|
|
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;
|
|
594
|
+
type: "markdown";
|
|
595
|
+
markdown: string;
|
|
480
596
|
} | {
|
|
481
597
|
type: "contact";
|
|
482
598
|
user?: {
|
|
@@ -521,18 +637,38 @@ declare const editSchema: z.ZodObject<{
|
|
|
521
637
|
} | undefined;
|
|
522
638
|
raw?: unknown;
|
|
523
639
|
} | {
|
|
524
|
-
type: "
|
|
525
|
-
|
|
640
|
+
type: "custom";
|
|
641
|
+
raw: unknown;
|
|
526
642
|
} | {
|
|
527
|
-
type: "
|
|
528
|
-
|
|
643
|
+
type: "poll";
|
|
644
|
+
title: string;
|
|
645
|
+
options: {
|
|
646
|
+
title: string;
|
|
647
|
+
}[];
|
|
529
648
|
} | {
|
|
530
|
-
type: "
|
|
531
|
-
|
|
649
|
+
type: "poll_option";
|
|
650
|
+
option: {
|
|
651
|
+
title: string;
|
|
652
|
+
};
|
|
653
|
+
poll: {
|
|
654
|
+
type: "poll";
|
|
655
|
+
title: string;
|
|
656
|
+
options: {
|
|
657
|
+
title: string;
|
|
658
|
+
}[];
|
|
659
|
+
};
|
|
660
|
+
selected: boolean;
|
|
661
|
+
title: string;
|
|
532
662
|
} | {
|
|
533
663
|
type: "reaction";
|
|
534
664
|
emoji: string;
|
|
535
665
|
target: Message<string, User, Space<unknown>>;
|
|
666
|
+
} | {
|
|
667
|
+
type: "group";
|
|
668
|
+
items: Message<string, User, Space<unknown>>[];
|
|
669
|
+
} | {
|
|
670
|
+
type: "richlink";
|
|
671
|
+
url: string;
|
|
536
672
|
} | {
|
|
537
673
|
type: "streamText";
|
|
538
674
|
stream: () => AsyncIterable<string>;
|
|
@@ -545,9 +681,6 @@ declare const editSchema: z.ZodObject<{
|
|
|
545
681
|
name?: string | undefined;
|
|
546
682
|
duration?: number | undefined;
|
|
547
683
|
size?: number | undefined;
|
|
548
|
-
} | {
|
|
549
|
-
type: "richlink";
|
|
550
|
-
url: string;
|
|
551
684
|
} | {
|
|
552
685
|
type: "app";
|
|
553
686
|
url: z.core.$InferOuterFunctionType<z.ZodTuple<readonly [], null>, z.ZodPromise<z.ZodURL>>;
|
|
@@ -594,10 +727,15 @@ declare const editSchema: z.ZodObject<{
|
|
|
594
727
|
} | {
|
|
595
728
|
kind: "clear";
|
|
596
729
|
};
|
|
597
|
-
}, {
|
|
598
|
-
type: "custom";
|
|
599
|
-
raw: unknown;
|
|
600
730
|
} | {
|
|
731
|
+
type: "addMember";
|
|
732
|
+
members: string[];
|
|
733
|
+
} | {
|
|
734
|
+
type: "removeMember";
|
|
735
|
+
members: string[];
|
|
736
|
+
} | {
|
|
737
|
+
type: "leaveSpace";
|
|
738
|
+
}, {
|
|
601
739
|
type: "attachment";
|
|
602
740
|
id: string;
|
|
603
741
|
name: string;
|
|
@@ -606,25 +744,11 @@ declare const editSchema: z.ZodObject<{
|
|
|
606
744
|
stream: z.core.$InferOuterFunctionType<z.ZodTuple<readonly [], null>, z.ZodPromise<z.ZodCustom<ReadableStream<unknown>, ReadableStream<unknown>>>>;
|
|
607
745
|
size?: number | undefined;
|
|
608
746
|
} | {
|
|
609
|
-
type: "
|
|
610
|
-
|
|
611
|
-
options: {
|
|
612
|
-
title: string;
|
|
613
|
-
}[];
|
|
747
|
+
type: "text";
|
|
748
|
+
text: string;
|
|
614
749
|
} | {
|
|
615
|
-
type: "
|
|
616
|
-
|
|
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;
|
|
750
|
+
type: "markdown";
|
|
751
|
+
markdown: string;
|
|
628
752
|
} | {
|
|
629
753
|
type: "contact";
|
|
630
754
|
user?: {
|
|
@@ -669,18 +793,38 @@ declare const editSchema: z.ZodObject<{
|
|
|
669
793
|
} | undefined;
|
|
670
794
|
raw?: unknown;
|
|
671
795
|
} | {
|
|
672
|
-
type: "
|
|
673
|
-
|
|
796
|
+
type: "custom";
|
|
797
|
+
raw: unknown;
|
|
674
798
|
} | {
|
|
675
|
-
type: "
|
|
676
|
-
|
|
799
|
+
type: "poll";
|
|
800
|
+
title: string;
|
|
801
|
+
options: {
|
|
802
|
+
title: string;
|
|
803
|
+
}[];
|
|
677
804
|
} | {
|
|
678
|
-
type: "
|
|
679
|
-
|
|
805
|
+
type: "poll_option";
|
|
806
|
+
option: {
|
|
807
|
+
title: string;
|
|
808
|
+
};
|
|
809
|
+
poll: {
|
|
810
|
+
type: "poll";
|
|
811
|
+
title: string;
|
|
812
|
+
options: {
|
|
813
|
+
title: string;
|
|
814
|
+
}[];
|
|
815
|
+
};
|
|
816
|
+
selected: boolean;
|
|
817
|
+
title: string;
|
|
680
818
|
} | {
|
|
681
819
|
type: "reaction";
|
|
682
820
|
emoji: string;
|
|
683
821
|
target: Message<string, User, Space<unknown>>;
|
|
822
|
+
} | {
|
|
823
|
+
type: "group";
|
|
824
|
+
items: Message<string, User, Space<unknown>>[];
|
|
825
|
+
} | {
|
|
826
|
+
type: "richlink";
|
|
827
|
+
url: string;
|
|
684
828
|
} | {
|
|
685
829
|
type: "streamText";
|
|
686
830
|
stream: () => AsyncIterable<string>;
|
|
@@ -693,9 +837,6 @@ declare const editSchema: z.ZodObject<{
|
|
|
693
837
|
name?: string | undefined;
|
|
694
838
|
duration?: number | undefined;
|
|
695
839
|
size?: number | undefined;
|
|
696
|
-
} | {
|
|
697
|
-
type: "richlink";
|
|
698
|
-
url: string;
|
|
699
840
|
} | {
|
|
700
841
|
type: "app";
|
|
701
842
|
url: z.core.$InferOuterFunctionType<z.ZodTuple<readonly [], null>, z.ZodPromise<z.ZodURL>>;
|
|
@@ -742,6 +883,14 @@ declare const editSchema: z.ZodObject<{
|
|
|
742
883
|
} | {
|
|
743
884
|
kind: "clear";
|
|
744
885
|
};
|
|
886
|
+
} | {
|
|
887
|
+
type: "addMember";
|
|
888
|
+
members: string[];
|
|
889
|
+
} | {
|
|
890
|
+
type: "removeMember";
|
|
891
|
+
members: string[];
|
|
892
|
+
} | {
|
|
893
|
+
type: "leaveSpace";
|
|
745
894
|
}>;
|
|
746
895
|
target: z.ZodCustom<Message<string, User, Space<unknown>>, Message<string, User, Space<unknown>>>;
|
|
747
896
|
}, z.core.$strip>;
|
|
@@ -942,6 +1091,10 @@ declare function read(target: Message): ContentBuilder;
|
|
|
942
1091
|
* `space.send(rename("New Name"))` is the canonical form; `space.rename(...)`
|
|
943
1092
|
* is universal sugar that delegates here.
|
|
944
1093
|
*
|
|
1094
|
+
* Bidirectional: providers also surface platform rename events as inbound
|
|
1095
|
+
* `Message`s carrying this content; `message.sender` is the user who renamed
|
|
1096
|
+
* the chat (may be `undefined` when the platform recorded no actor).
|
|
1097
|
+
*
|
|
945
1098
|
* Throws at build time if `displayName` is empty. Per-platform constraints
|
|
946
1099
|
* (e.g. group-only, remote-only) surface as `UnsupportedError` from the
|
|
947
1100
|
* provider's `send` action so the canonical and sugar forms share one
|
|
@@ -963,14 +1116,12 @@ declare function rename(displayName: string): ContentBuilder;
|
|
|
963
1116
|
* `reply` like any other content type and route to a threaded send.
|
|
964
1117
|
*
|
|
965
1118
|
* Reply cannot wrap `reply`, `edit`, `reaction`, `group`, `typing`,
|
|
966
|
-
* `rename`, `avatar`, `
|
|
1119
|
+
* `rename`, `avatar`, `addMember`, `removeMember`, `leaveSpace`, `unsend`,
|
|
1120
|
+
* or `read` content.
|
|
967
1121
|
*/
|
|
968
1122
|
declare const replySchema: z.ZodObject<{
|
|
969
1123
|
type: z.ZodLiteral<"reply">;
|
|
970
1124
|
content: z.ZodCustom<{
|
|
971
|
-
type: "custom";
|
|
972
|
-
raw: unknown;
|
|
973
|
-
} | {
|
|
974
1125
|
type: "attachment";
|
|
975
1126
|
id: string;
|
|
976
1127
|
name: string;
|
|
@@ -979,25 +1130,11 @@ declare const replySchema: z.ZodObject<{
|
|
|
979
1130
|
stream: z.core.$InferOuterFunctionType<z.ZodTuple<readonly [], null>, z.ZodPromise<z.ZodCustom<ReadableStream<unknown>, ReadableStream<unknown>>>>;
|
|
980
1131
|
size?: number | undefined;
|
|
981
1132
|
} | {
|
|
982
|
-
type: "
|
|
983
|
-
|
|
984
|
-
options: {
|
|
985
|
-
title: string;
|
|
986
|
-
}[];
|
|
1133
|
+
type: "text";
|
|
1134
|
+
text: string;
|
|
987
1135
|
} | {
|
|
988
|
-
type: "
|
|
989
|
-
|
|
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;
|
|
1136
|
+
type: "markdown";
|
|
1137
|
+
markdown: string;
|
|
1001
1138
|
} | {
|
|
1002
1139
|
type: "contact";
|
|
1003
1140
|
user?: {
|
|
@@ -1042,18 +1179,38 @@ declare const replySchema: z.ZodObject<{
|
|
|
1042
1179
|
} | undefined;
|
|
1043
1180
|
raw?: unknown;
|
|
1044
1181
|
} | {
|
|
1045
|
-
type: "
|
|
1046
|
-
|
|
1182
|
+
type: "custom";
|
|
1183
|
+
raw: unknown;
|
|
1047
1184
|
} | {
|
|
1048
|
-
type: "
|
|
1049
|
-
|
|
1185
|
+
type: "poll";
|
|
1186
|
+
title: string;
|
|
1187
|
+
options: {
|
|
1188
|
+
title: string;
|
|
1189
|
+
}[];
|
|
1050
1190
|
} | {
|
|
1051
|
-
type: "
|
|
1052
|
-
|
|
1191
|
+
type: "poll_option";
|
|
1192
|
+
option: {
|
|
1193
|
+
title: string;
|
|
1194
|
+
};
|
|
1195
|
+
poll: {
|
|
1196
|
+
type: "poll";
|
|
1197
|
+
title: string;
|
|
1198
|
+
options: {
|
|
1199
|
+
title: string;
|
|
1200
|
+
}[];
|
|
1201
|
+
};
|
|
1202
|
+
selected: boolean;
|
|
1203
|
+
title: string;
|
|
1053
1204
|
} | {
|
|
1054
1205
|
type: "reaction";
|
|
1055
1206
|
emoji: string;
|
|
1056
1207
|
target: Message<string, User, Space<unknown>>;
|
|
1208
|
+
} | {
|
|
1209
|
+
type: "group";
|
|
1210
|
+
items: Message<string, User, Space<unknown>>[];
|
|
1211
|
+
} | {
|
|
1212
|
+
type: "richlink";
|
|
1213
|
+
url: string;
|
|
1057
1214
|
} | {
|
|
1058
1215
|
type: "streamText";
|
|
1059
1216
|
stream: () => AsyncIterable<string>;
|
|
@@ -1066,9 +1223,6 @@ declare const replySchema: z.ZodObject<{
|
|
|
1066
1223
|
name?: string | undefined;
|
|
1067
1224
|
duration?: number | undefined;
|
|
1068
1225
|
size?: number | undefined;
|
|
1069
|
-
} | {
|
|
1070
|
-
type: "richlink";
|
|
1071
|
-
url: string;
|
|
1072
1226
|
} | {
|
|
1073
1227
|
type: "app";
|
|
1074
1228
|
url: z.core.$InferOuterFunctionType<z.ZodTuple<readonly [], null>, z.ZodPromise<z.ZodURL>>;
|
|
@@ -1115,10 +1269,15 @@ declare const replySchema: z.ZodObject<{
|
|
|
1115
1269
|
} | {
|
|
1116
1270
|
kind: "clear";
|
|
1117
1271
|
};
|
|
1118
|
-
}, {
|
|
1119
|
-
type: "custom";
|
|
1120
|
-
raw: unknown;
|
|
1121
1272
|
} | {
|
|
1273
|
+
type: "addMember";
|
|
1274
|
+
members: string[];
|
|
1275
|
+
} | {
|
|
1276
|
+
type: "removeMember";
|
|
1277
|
+
members: string[];
|
|
1278
|
+
} | {
|
|
1279
|
+
type: "leaveSpace";
|
|
1280
|
+
}, {
|
|
1122
1281
|
type: "attachment";
|
|
1123
1282
|
id: string;
|
|
1124
1283
|
name: string;
|
|
@@ -1127,25 +1286,11 @@ declare const replySchema: z.ZodObject<{
|
|
|
1127
1286
|
stream: z.core.$InferOuterFunctionType<z.ZodTuple<readonly [], null>, z.ZodPromise<z.ZodCustom<ReadableStream<unknown>, ReadableStream<unknown>>>>;
|
|
1128
1287
|
size?: number | undefined;
|
|
1129
1288
|
} | {
|
|
1130
|
-
type: "
|
|
1131
|
-
|
|
1132
|
-
options: {
|
|
1133
|
-
title: string;
|
|
1134
|
-
}[];
|
|
1289
|
+
type: "text";
|
|
1290
|
+
text: string;
|
|
1135
1291
|
} | {
|
|
1136
|
-
type: "
|
|
1137
|
-
|
|
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;
|
|
1292
|
+
type: "markdown";
|
|
1293
|
+
markdown: string;
|
|
1149
1294
|
} | {
|
|
1150
1295
|
type: "contact";
|
|
1151
1296
|
user?: {
|
|
@@ -1190,18 +1335,38 @@ declare const replySchema: z.ZodObject<{
|
|
|
1190
1335
|
} | undefined;
|
|
1191
1336
|
raw?: unknown;
|
|
1192
1337
|
} | {
|
|
1193
|
-
type: "
|
|
1194
|
-
|
|
1338
|
+
type: "custom";
|
|
1339
|
+
raw: unknown;
|
|
1195
1340
|
} | {
|
|
1196
|
-
type: "
|
|
1197
|
-
|
|
1341
|
+
type: "poll";
|
|
1342
|
+
title: string;
|
|
1343
|
+
options: {
|
|
1344
|
+
title: string;
|
|
1345
|
+
}[];
|
|
1198
1346
|
} | {
|
|
1199
|
-
type: "
|
|
1200
|
-
|
|
1347
|
+
type: "poll_option";
|
|
1348
|
+
option: {
|
|
1349
|
+
title: string;
|
|
1350
|
+
};
|
|
1351
|
+
poll: {
|
|
1352
|
+
type: "poll";
|
|
1353
|
+
title: string;
|
|
1354
|
+
options: {
|
|
1355
|
+
title: string;
|
|
1356
|
+
}[];
|
|
1357
|
+
};
|
|
1358
|
+
selected: boolean;
|
|
1359
|
+
title: string;
|
|
1201
1360
|
} | {
|
|
1202
1361
|
type: "reaction";
|
|
1203
1362
|
emoji: string;
|
|
1204
1363
|
target: Message<string, User, Space<unknown>>;
|
|
1364
|
+
} | {
|
|
1365
|
+
type: "group";
|
|
1366
|
+
items: Message<string, User, Space<unknown>>[];
|
|
1367
|
+
} | {
|
|
1368
|
+
type: "richlink";
|
|
1369
|
+
url: string;
|
|
1205
1370
|
} | {
|
|
1206
1371
|
type: "streamText";
|
|
1207
1372
|
stream: () => AsyncIterable<string>;
|
|
@@ -1214,9 +1379,6 @@ declare const replySchema: z.ZodObject<{
|
|
|
1214
1379
|
name?: string | undefined;
|
|
1215
1380
|
duration?: number | undefined;
|
|
1216
1381
|
size?: number | undefined;
|
|
1217
|
-
} | {
|
|
1218
|
-
type: "richlink";
|
|
1219
|
-
url: string;
|
|
1220
1382
|
} | {
|
|
1221
1383
|
type: "app";
|
|
1222
1384
|
url: z.core.$InferOuterFunctionType<z.ZodTuple<readonly [], null>, z.ZodPromise<z.ZodURL>>;
|
|
@@ -1263,6 +1425,14 @@ declare const replySchema: z.ZodObject<{
|
|
|
1263
1425
|
} | {
|
|
1264
1426
|
kind: "clear";
|
|
1265
1427
|
};
|
|
1428
|
+
} | {
|
|
1429
|
+
type: "addMember";
|
|
1430
|
+
members: string[];
|
|
1431
|
+
} | {
|
|
1432
|
+
type: "removeMember";
|
|
1433
|
+
members: string[];
|
|
1434
|
+
} | {
|
|
1435
|
+
type: "leaveSpace";
|
|
1266
1436
|
}>;
|
|
1267
1437
|
target: z.ZodCustom<Message<string, User, Space<unknown>>, Message<string, User, Space<unknown>>>;
|
|
1268
1438
|
}, z.core.$strip>;
|
|
@@ -5991,7 +6161,8 @@ declare function broadcast<T>(source: ManagedStream<T>): Broadcaster<T>;
|
|
|
5991
6161
|
* side effect.
|
|
5992
6162
|
*
|
|
5993
6163
|
* Names that collide with reserved `Space` keys (`send`, `edit`, `unsend`,
|
|
5994
|
-
* `getMessage`, `
|
|
6164
|
+
* `read`, `getMessage`, `getMembers`, `getAvatar`, `rename`, `avatar`, `add`,
|
|
6165
|
+
* `remove`, `leave`, `startTyping`, `stopTyping`, `responding`, `id`,
|
|
5995
6166
|
* `__platform`) are skipped at runtime with a warning and excluded at the
|
|
5996
6167
|
* type level via `Exclude<…, keyof Space>`.
|
|
5997
6168
|
*/
|
|
@@ -6022,11 +6193,12 @@ type MessageActionFn = (message: Message, ...args: never[]) => Promise<void>;
|
|
|
6022
6193
|
*
|
|
6023
6194
|
* Two tiers live in the same `actions?` slot:
|
|
6024
6195
|
*
|
|
6025
|
-
* - **Platform-wise actions** — fixed framework-known names (
|
|
6026
|
-
* `
|
|
6027
|
-
* power universal sugar
|
|
6028
|
-
*
|
|
6029
|
-
*
|
|
6196
|
+
* - **Platform-wise actions** — fixed framework-known names (`getMessage`,
|
|
6197
|
+
* `getMembers`, `getAvatar`) whose signatures are defined by
|
|
6198
|
+
* `PlatformWiseActions`. They power universal sugar
|
|
6199
|
+
* (`space.getMessage(id)`, `space.getMembers()`, `space.getAvatar()`) AND
|
|
6200
|
+
* surface on the platform instance. If a provider omits one, the framework
|
|
6201
|
+
* wires a default that throws `UnsupportedError`.
|
|
6030
6202
|
* - **Platform-specific actions** — free-form keys each platform declares
|
|
6031
6203
|
* for its own ergonomics (e.g. iMessage's `getAttachment`). Surface on
|
|
6032
6204
|
* the platform instance only.
|
|
@@ -6044,13 +6216,40 @@ type InstanceActionFn = (ctx: any, ...args: any[]) => Promise<unknown>;
|
|
|
6044
6216
|
* by declaring the key inside their `actions` slot, and platforms that omit
|
|
6045
6217
|
* the key get a default that throws `UnsupportedError`.
|
|
6046
6218
|
*
|
|
6047
|
-
* Add a new platform-wise capability by extending this record
|
|
6048
|
-
*
|
|
6049
|
-
*
|
|
6219
|
+
* Add a new platform-wise capability by extending this record along with:
|
|
6220
|
+
* `PlatformWiseInstanceMethods` (the public instance signature), the runtime
|
|
6221
|
+
* list `PLATFORM_WISE_ACTION_KEYS` in `build.ts`, and — when the capability
|
|
6222
|
+
* surfaces as universal `Space` sugar — the `Space` interface plus a
|
|
6223
|
+
* `buildSpace` impl and `RESERVED_SPACE_KEYS` entry. The instance method is
|
|
6224
|
+
* then surfaced on every `PlatformInstance` automatically.
|
|
6050
6225
|
*/
|
|
6051
6226
|
interface PlatformWiseActions<_ResolvedSpace extends {
|
|
6052
6227
|
id: string;
|
|
6053
6228
|
}, _MessageType, _Client, _Config> {
|
|
6229
|
+
getAvatar: (ctx: {
|
|
6230
|
+
client: _Client;
|
|
6231
|
+
config: _Config;
|
|
6232
|
+
store: Store;
|
|
6233
|
+
}, space: _ResolvedSpace & {
|
|
6234
|
+
id: string;
|
|
6235
|
+
__platform: string;
|
|
6236
|
+
}) => Promise<AvatarData | undefined>;
|
|
6237
|
+
getDisplayName: (ctx: {
|
|
6238
|
+
client: _Client;
|
|
6239
|
+
config: _Config;
|
|
6240
|
+
store: Store;
|
|
6241
|
+
}, space: _ResolvedSpace & {
|
|
6242
|
+
id: string;
|
|
6243
|
+
__platform: string;
|
|
6244
|
+
}) => Promise<string | undefined>;
|
|
6245
|
+
getMembers: (ctx: {
|
|
6246
|
+
client: _Client;
|
|
6247
|
+
config: _Config;
|
|
6248
|
+
store: Store;
|
|
6249
|
+
}, space: _ResolvedSpace & {
|
|
6250
|
+
id: string;
|
|
6251
|
+
__platform: string;
|
|
6252
|
+
}) => Promise<readonly ProviderUserRecord[]>;
|
|
6054
6253
|
getMessage: (ctx: {
|
|
6055
6254
|
client: _Client;
|
|
6056
6255
|
config: _Config;
|
|
@@ -6089,7 +6288,7 @@ type EventProducer<TPayload = unknown, TClient = unknown, TConfig = unknown> = (
|
|
|
6089
6288
|
type ProviderMessage<TSender extends ResolvedUser = ResolvedUser, TSpace extends ResolvedSpace = ResolvedSpace, TExtra extends object = Record<never, never>> = {
|
|
6090
6289
|
id: string;
|
|
6091
6290
|
content: Content;
|
|
6092
|
-
sender
|
|
6291
|
+
sender?: TSender;
|
|
6093
6292
|
space: TSpace;
|
|
6094
6293
|
timestamp?: Date;
|
|
6095
6294
|
} & TExtra;
|
|
@@ -6116,6 +6315,17 @@ type ProviderMessageRecord = {
|
|
|
6116
6315
|
} & Record<string, unknown>;
|
|
6117
6316
|
timestamp?: Date;
|
|
6118
6317
|
} & Record<string, unknown>;
|
|
6318
|
+
/**
|
|
6319
|
+
* A chat participant a provider returned from `actions.getMembers` — the raw
|
|
6320
|
+
* record shape, mirroring `ProviderMessageRecord.sender`. `id` is the user's
|
|
6321
|
+
* canonical platform identifier (the same handle format `space.create`
|
|
6322
|
+
* accepts); platform extras (e.g. iMessage's `address`/`country`/`service`)
|
|
6323
|
+
* ride along untyped. `space.getMembers()` tags each record with
|
|
6324
|
+
* `__platform` before surfacing it as a `User`.
|
|
6325
|
+
*/
|
|
6326
|
+
type ProviderUserRecord = {
|
|
6327
|
+
id: string;
|
|
6328
|
+
} & Record<string, unknown>;
|
|
6119
6329
|
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
6330
|
type SchemaMessage<TUserSchema extends z.ZodType | undefined = undefined, TSpaceSchema extends z.ZodType | undefined = undefined> = ProviderMessage<MergeSchema<TUserSchema, ResolvedUser>, MergeSchema<TSpaceSchema, ResolvedSpace>>;
|
|
6121
6331
|
type InferEventPayload<T> = T extends z.ZodType ? z.infer<T> : T extends ((ctx: never) => AsyncIterable<infer P>) ? P : never;
|
|
@@ -6157,13 +6367,14 @@ interface PlatformDef<_Name extends string = string, _ConfigSchema extends z.Zod
|
|
|
6157
6367
|
*
|
|
6158
6368
|
* Two tiers share this slot:
|
|
6159
6369
|
*
|
|
6160
|
-
* 1. **Platform-wise actions** (`getMessage`) —
|
|
6161
|
-
* declared in `PlatformWiseActions`. Override
|
|
6162
|
-
* with the matching signature. The framework
|
|
6163
|
-
* config, store }` as the first arg and
|
|
6164
|
-
*
|
|
6165
|
-
*
|
|
6166
|
-
* universal sugar like
|
|
6370
|
+
* 1. **Platform-wise actions** (`getMessage`, `getMembers`, `getAvatar`) —
|
|
6371
|
+
* framework-recognized names declared in `PlatformWiseActions`. Override
|
|
6372
|
+
* by declaring the key here with the matching signature. The framework
|
|
6373
|
+
* injects `ctx = { client, config, store }` as the first arg and
|
|
6374
|
+
* surfaces the method on the platform instance
|
|
6375
|
+
* (`im.getMessage(space, id)`). If omitted, the framework wires a
|
|
6376
|
+
* default that throws `UnsupportedError`. Powers universal sugar like
|
|
6377
|
+
* `space.getMessage(id)`.
|
|
6167
6378
|
*
|
|
6168
6379
|
* 2. **Platform-specific actions** — free-form keys like `getAttachment`.
|
|
6169
6380
|
* Each gets `ctx = { client, config, store }` as the first arg; the
|
|
@@ -6301,9 +6512,10 @@ interface PlatformDef<_Name extends string = string, _ConfigSchema extends z.Zod
|
|
|
6301
6512
|
* lives here for platform-specific surface area.
|
|
6302
6513
|
*
|
|
6303
6514
|
* Names that collide with reserved `Space` keys (`send`, `edit`,
|
|
6304
|
-
* `unsend`, `getMessage`, `
|
|
6305
|
-
* `
|
|
6306
|
-
* at
|
|
6515
|
+
* `unsend`, `read`, `getMessage`, `getMembers`, `getAvatar`, `rename`,
|
|
6516
|
+
* `avatar`, `add`, `remove`, `leave`, `startTyping`, `stopTyping`,
|
|
6517
|
+
* `responding`, `id`, `__platform`) are skipped at runtime with a
|
|
6518
|
+
* warning and excluded at the type level.
|
|
6307
6519
|
*/
|
|
6308
6520
|
actions?: _SpaceActions;
|
|
6309
6521
|
};
|
|
@@ -6410,6 +6622,9 @@ type InstanceActionFns<Def extends AnyPlatformDef> = Def["actions"] extends infe
|
|
|
6410
6622
|
type ReservedInstanceKeys<Def extends AnyPlatformDef> = "user" | "space" | "messages" | PlatformWiseActionKey | Extract<keyof CustomEventInstanceProperties<Def>, string>;
|
|
6411
6623
|
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
6624
|
interface PlatformWiseInstanceMethods<Def extends AnyPlatformDef> {
|
|
6625
|
+
getAvatar: (space: PlatformSpace<Def>) => Promise<AvatarData | undefined>;
|
|
6626
|
+
getDisplayName: (space: PlatformSpace<Def>) => Promise<string | undefined>;
|
|
6627
|
+
getMembers: (space: PlatformSpace<Def>) => Promise<PlatformUser<Def>[]>;
|
|
6413
6628
|
getMessage: (space: PlatformSpace<Def>, messageId: string) => Promise<PlatformMessage<Def> | undefined>;
|
|
6414
6629
|
}
|
|
6415
6630
|
type PlatformSpace<Def extends AnyPlatformDef> = Omit<SpaceShapeOf<Def>, keyof Space | keyof SpaceActionMethods<Def>> & Space & SpaceActionMethods<Def>;
|
|
@@ -6852,6 +7067,14 @@ declare const baseContentSchema: z.ZodDiscriminatedUnion<readonly [z.ZodObject<{
|
|
|
6852
7067
|
}, z.core.$strip>, z.ZodObject<{
|
|
6853
7068
|
kind: z.ZodLiteral<"clear">;
|
|
6854
7069
|
}, z.core.$strip>], "kind">;
|
|
7070
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
7071
|
+
type: z.ZodLiteral<"addMember">;
|
|
7072
|
+
members: z.ZodArray<z.ZodString>;
|
|
7073
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
7074
|
+
type: z.ZodLiteral<"removeMember">;
|
|
7075
|
+
members: z.ZodArray<z.ZodString>;
|
|
7076
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
7077
|
+
type: z.ZodLiteral<"leaveSpace">;
|
|
6855
7078
|
}, z.core.$strip>], "type">;
|
|
6856
7079
|
type BaseContent = z.infer<typeof baseContentSchema>;
|
|
6857
7080
|
declare const contentSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
@@ -7021,12 +7244,17 @@ declare const contentSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
7021
7244
|
}, z.core.$strip>, z.ZodObject<{
|
|
7022
7245
|
kind: z.ZodLiteral<"clear">;
|
|
7023
7246
|
}, z.core.$strip>], "kind">;
|
|
7247
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
7248
|
+
type: z.ZodLiteral<"addMember">;
|
|
7249
|
+
members: z.ZodArray<z.ZodString>;
|
|
7250
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
7251
|
+
type: z.ZodLiteral<"removeMember">;
|
|
7252
|
+
members: z.ZodArray<z.ZodString>;
|
|
7253
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
7254
|
+
type: z.ZodLiteral<"leaveSpace">;
|
|
7024
7255
|
}, z.core.$strip>, z.ZodObject<{
|
|
7025
7256
|
type: z.ZodLiteral<"reply">;
|
|
7026
7257
|
content: z.ZodCustom<{
|
|
7027
|
-
type: "custom";
|
|
7028
|
-
raw: unknown;
|
|
7029
|
-
} | {
|
|
7030
7258
|
type: "attachment";
|
|
7031
7259
|
id: string;
|
|
7032
7260
|
name: string;
|
|
@@ -7035,25 +7263,11 @@ declare const contentSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
7035
7263
|
stream: z.core.$InferOuterFunctionType<z.ZodTuple<readonly [], null>, z.ZodPromise<z.ZodCustom<ReadableStream<unknown>, ReadableStream<unknown>>>>;
|
|
7036
7264
|
size?: number | undefined;
|
|
7037
7265
|
} | {
|
|
7038
|
-
type: "
|
|
7039
|
-
|
|
7040
|
-
options: {
|
|
7041
|
-
title: string;
|
|
7042
|
-
}[];
|
|
7266
|
+
type: "text";
|
|
7267
|
+
text: string;
|
|
7043
7268
|
} | {
|
|
7044
|
-
type: "
|
|
7045
|
-
|
|
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;
|
|
7269
|
+
type: "markdown";
|
|
7270
|
+
markdown: string;
|
|
7057
7271
|
} | {
|
|
7058
7272
|
type: "contact";
|
|
7059
7273
|
user?: {
|
|
@@ -7098,18 +7312,38 @@ declare const contentSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
7098
7312
|
} | undefined;
|
|
7099
7313
|
raw?: unknown;
|
|
7100
7314
|
} | {
|
|
7101
|
-
type: "
|
|
7102
|
-
|
|
7315
|
+
type: "custom";
|
|
7316
|
+
raw: unknown;
|
|
7103
7317
|
} | {
|
|
7104
|
-
type: "
|
|
7105
|
-
|
|
7318
|
+
type: "poll";
|
|
7319
|
+
title: string;
|
|
7320
|
+
options: {
|
|
7321
|
+
title: string;
|
|
7322
|
+
}[];
|
|
7106
7323
|
} | {
|
|
7107
|
-
type: "
|
|
7108
|
-
|
|
7324
|
+
type: "poll_option";
|
|
7325
|
+
option: {
|
|
7326
|
+
title: string;
|
|
7327
|
+
};
|
|
7328
|
+
poll: {
|
|
7329
|
+
type: "poll";
|
|
7330
|
+
title: string;
|
|
7331
|
+
options: {
|
|
7332
|
+
title: string;
|
|
7333
|
+
}[];
|
|
7334
|
+
};
|
|
7335
|
+
selected: boolean;
|
|
7336
|
+
title: string;
|
|
7109
7337
|
} | {
|
|
7110
7338
|
type: "reaction";
|
|
7111
7339
|
emoji: string;
|
|
7112
7340
|
target: Message<string, User, Space<unknown>>;
|
|
7341
|
+
} | {
|
|
7342
|
+
type: "group";
|
|
7343
|
+
items: Message<string, User, Space<unknown>>[];
|
|
7344
|
+
} | {
|
|
7345
|
+
type: "richlink";
|
|
7346
|
+
url: string;
|
|
7113
7347
|
} | {
|
|
7114
7348
|
type: "streamText";
|
|
7115
7349
|
stream: () => AsyncIterable<string>;
|
|
@@ -7122,9 +7356,6 @@ declare const contentSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
7122
7356
|
name?: string | undefined;
|
|
7123
7357
|
duration?: number | undefined;
|
|
7124
7358
|
size?: number | undefined;
|
|
7125
|
-
} | {
|
|
7126
|
-
type: "richlink";
|
|
7127
|
-
url: string;
|
|
7128
7359
|
} | {
|
|
7129
7360
|
type: "app";
|
|
7130
7361
|
url: z.core.$InferOuterFunctionType<z.ZodTuple<readonly [], null>, z.ZodPromise<z.ZodURL>>;
|
|
@@ -7171,10 +7402,15 @@ declare const contentSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
7171
7402
|
} | {
|
|
7172
7403
|
kind: "clear";
|
|
7173
7404
|
};
|
|
7174
|
-
}, {
|
|
7175
|
-
type: "custom";
|
|
7176
|
-
raw: unknown;
|
|
7177
7405
|
} | {
|
|
7406
|
+
type: "addMember";
|
|
7407
|
+
members: string[];
|
|
7408
|
+
} | {
|
|
7409
|
+
type: "removeMember";
|
|
7410
|
+
members: string[];
|
|
7411
|
+
} | {
|
|
7412
|
+
type: "leaveSpace";
|
|
7413
|
+
}, {
|
|
7178
7414
|
type: "attachment";
|
|
7179
7415
|
id: string;
|
|
7180
7416
|
name: string;
|
|
@@ -7183,25 +7419,11 @@ declare const contentSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
7183
7419
|
stream: z.core.$InferOuterFunctionType<z.ZodTuple<readonly [], null>, z.ZodPromise<z.ZodCustom<ReadableStream<unknown>, ReadableStream<unknown>>>>;
|
|
7184
7420
|
size?: number | undefined;
|
|
7185
7421
|
} | {
|
|
7186
|
-
type: "
|
|
7187
|
-
|
|
7188
|
-
options: {
|
|
7189
|
-
title: string;
|
|
7190
|
-
}[];
|
|
7422
|
+
type: "text";
|
|
7423
|
+
text: string;
|
|
7191
7424
|
} | {
|
|
7192
|
-
type: "
|
|
7193
|
-
|
|
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;
|
|
7425
|
+
type: "markdown";
|
|
7426
|
+
markdown: string;
|
|
7205
7427
|
} | {
|
|
7206
7428
|
type: "contact";
|
|
7207
7429
|
user?: {
|
|
@@ -7246,18 +7468,38 @@ declare const contentSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
7246
7468
|
} | undefined;
|
|
7247
7469
|
raw?: unknown;
|
|
7248
7470
|
} | {
|
|
7249
|
-
type: "
|
|
7250
|
-
|
|
7471
|
+
type: "custom";
|
|
7472
|
+
raw: unknown;
|
|
7251
7473
|
} | {
|
|
7252
|
-
type: "
|
|
7253
|
-
|
|
7474
|
+
type: "poll";
|
|
7475
|
+
title: string;
|
|
7476
|
+
options: {
|
|
7477
|
+
title: string;
|
|
7478
|
+
}[];
|
|
7254
7479
|
} | {
|
|
7255
|
-
type: "
|
|
7256
|
-
|
|
7480
|
+
type: "poll_option";
|
|
7481
|
+
option: {
|
|
7482
|
+
title: string;
|
|
7483
|
+
};
|
|
7484
|
+
poll: {
|
|
7485
|
+
type: "poll";
|
|
7486
|
+
title: string;
|
|
7487
|
+
options: {
|
|
7488
|
+
title: string;
|
|
7489
|
+
}[];
|
|
7490
|
+
};
|
|
7491
|
+
selected: boolean;
|
|
7492
|
+
title: string;
|
|
7257
7493
|
} | {
|
|
7258
7494
|
type: "reaction";
|
|
7259
7495
|
emoji: string;
|
|
7260
7496
|
target: Message<string, User, Space<unknown>>;
|
|
7497
|
+
} | {
|
|
7498
|
+
type: "group";
|
|
7499
|
+
items: Message<string, User, Space<unknown>>[];
|
|
7500
|
+
} | {
|
|
7501
|
+
type: "richlink";
|
|
7502
|
+
url: string;
|
|
7261
7503
|
} | {
|
|
7262
7504
|
type: "streamText";
|
|
7263
7505
|
stream: () => AsyncIterable<string>;
|
|
@@ -7270,9 +7512,6 @@ declare const contentSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
7270
7512
|
name?: string | undefined;
|
|
7271
7513
|
duration?: number | undefined;
|
|
7272
7514
|
size?: number | undefined;
|
|
7273
|
-
} | {
|
|
7274
|
-
type: "richlink";
|
|
7275
|
-
url: string;
|
|
7276
7515
|
} | {
|
|
7277
7516
|
type: "app";
|
|
7278
7517
|
url: z.core.$InferOuterFunctionType<z.ZodTuple<readonly [], null>, z.ZodPromise<z.ZodURL>>;
|
|
@@ -7319,14 +7558,19 @@ declare const contentSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
7319
7558
|
} | {
|
|
7320
7559
|
kind: "clear";
|
|
7321
7560
|
};
|
|
7561
|
+
} | {
|
|
7562
|
+
type: "addMember";
|
|
7563
|
+
members: string[];
|
|
7564
|
+
} | {
|
|
7565
|
+
type: "removeMember";
|
|
7566
|
+
members: string[];
|
|
7567
|
+
} | {
|
|
7568
|
+
type: "leaveSpace";
|
|
7322
7569
|
}>;
|
|
7323
7570
|
target: z.ZodCustom<Message<string, User, Space<unknown>>, Message<string, User, Space<unknown>>>;
|
|
7324
7571
|
}, z.core.$strip>, z.ZodObject<{
|
|
7325
7572
|
type: z.ZodLiteral<"edit">;
|
|
7326
7573
|
content: z.ZodCustom<{
|
|
7327
|
-
type: "custom";
|
|
7328
|
-
raw: unknown;
|
|
7329
|
-
} | {
|
|
7330
7574
|
type: "attachment";
|
|
7331
7575
|
id: string;
|
|
7332
7576
|
name: string;
|
|
@@ -7335,25 +7579,11 @@ declare const contentSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
7335
7579
|
stream: z.core.$InferOuterFunctionType<z.ZodTuple<readonly [], null>, z.ZodPromise<z.ZodCustom<ReadableStream<unknown>, ReadableStream<unknown>>>>;
|
|
7336
7580
|
size?: number | undefined;
|
|
7337
7581
|
} | {
|
|
7338
|
-
type: "
|
|
7339
|
-
|
|
7340
|
-
options: {
|
|
7341
|
-
title: string;
|
|
7342
|
-
}[];
|
|
7582
|
+
type: "text";
|
|
7583
|
+
text: string;
|
|
7343
7584
|
} | {
|
|
7344
|
-
type: "
|
|
7345
|
-
|
|
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;
|
|
7585
|
+
type: "markdown";
|
|
7586
|
+
markdown: string;
|
|
7357
7587
|
} | {
|
|
7358
7588
|
type: "contact";
|
|
7359
7589
|
user?: {
|
|
@@ -7398,18 +7628,38 @@ declare const contentSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
7398
7628
|
} | undefined;
|
|
7399
7629
|
raw?: unknown;
|
|
7400
7630
|
} | {
|
|
7401
|
-
type: "
|
|
7402
|
-
|
|
7631
|
+
type: "custom";
|
|
7632
|
+
raw: unknown;
|
|
7403
7633
|
} | {
|
|
7404
|
-
type: "
|
|
7405
|
-
|
|
7634
|
+
type: "poll";
|
|
7635
|
+
title: string;
|
|
7636
|
+
options: {
|
|
7637
|
+
title: string;
|
|
7638
|
+
}[];
|
|
7406
7639
|
} | {
|
|
7407
|
-
type: "
|
|
7408
|
-
|
|
7640
|
+
type: "poll_option";
|
|
7641
|
+
option: {
|
|
7642
|
+
title: string;
|
|
7643
|
+
};
|
|
7644
|
+
poll: {
|
|
7645
|
+
type: "poll";
|
|
7646
|
+
title: string;
|
|
7647
|
+
options: {
|
|
7648
|
+
title: string;
|
|
7649
|
+
}[];
|
|
7650
|
+
};
|
|
7651
|
+
selected: boolean;
|
|
7652
|
+
title: string;
|
|
7409
7653
|
} | {
|
|
7410
7654
|
type: "reaction";
|
|
7411
7655
|
emoji: string;
|
|
7412
7656
|
target: Message<string, User, Space<unknown>>;
|
|
7657
|
+
} | {
|
|
7658
|
+
type: "group";
|
|
7659
|
+
items: Message<string, User, Space<unknown>>[];
|
|
7660
|
+
} | {
|
|
7661
|
+
type: "richlink";
|
|
7662
|
+
url: string;
|
|
7413
7663
|
} | {
|
|
7414
7664
|
type: "streamText";
|
|
7415
7665
|
stream: () => AsyncIterable<string>;
|
|
@@ -7422,9 +7672,6 @@ declare const contentSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
7422
7672
|
name?: string | undefined;
|
|
7423
7673
|
duration?: number | undefined;
|
|
7424
7674
|
size?: number | undefined;
|
|
7425
|
-
} | {
|
|
7426
|
-
type: "richlink";
|
|
7427
|
-
url: string;
|
|
7428
7675
|
} | {
|
|
7429
7676
|
type: "app";
|
|
7430
7677
|
url: z.core.$InferOuterFunctionType<z.ZodTuple<readonly [], null>, z.ZodPromise<z.ZodURL>>;
|
|
@@ -7471,10 +7718,15 @@ declare const contentSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
7471
7718
|
} | {
|
|
7472
7719
|
kind: "clear";
|
|
7473
7720
|
};
|
|
7474
|
-
}, {
|
|
7475
|
-
type: "custom";
|
|
7476
|
-
raw: unknown;
|
|
7477
7721
|
} | {
|
|
7722
|
+
type: "addMember";
|
|
7723
|
+
members: string[];
|
|
7724
|
+
} | {
|
|
7725
|
+
type: "removeMember";
|
|
7726
|
+
members: string[];
|
|
7727
|
+
} | {
|
|
7728
|
+
type: "leaveSpace";
|
|
7729
|
+
}, {
|
|
7478
7730
|
type: "attachment";
|
|
7479
7731
|
id: string;
|
|
7480
7732
|
name: string;
|
|
@@ -7483,25 +7735,11 @@ declare const contentSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
7483
7735
|
stream: z.core.$InferOuterFunctionType<z.ZodTuple<readonly [], null>, z.ZodPromise<z.ZodCustom<ReadableStream<unknown>, ReadableStream<unknown>>>>;
|
|
7484
7736
|
size?: number | undefined;
|
|
7485
7737
|
} | {
|
|
7486
|
-
type: "
|
|
7487
|
-
|
|
7488
|
-
options: {
|
|
7489
|
-
title: string;
|
|
7490
|
-
}[];
|
|
7738
|
+
type: "text";
|
|
7739
|
+
text: string;
|
|
7491
7740
|
} | {
|
|
7492
|
-
type: "
|
|
7493
|
-
|
|
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;
|
|
7741
|
+
type: "markdown";
|
|
7742
|
+
markdown: string;
|
|
7505
7743
|
} | {
|
|
7506
7744
|
type: "contact";
|
|
7507
7745
|
user?: {
|
|
@@ -7546,18 +7784,38 @@ declare const contentSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
7546
7784
|
} | undefined;
|
|
7547
7785
|
raw?: unknown;
|
|
7548
7786
|
} | {
|
|
7549
|
-
type: "
|
|
7550
|
-
|
|
7787
|
+
type: "custom";
|
|
7788
|
+
raw: unknown;
|
|
7551
7789
|
} | {
|
|
7552
|
-
type: "
|
|
7553
|
-
|
|
7790
|
+
type: "poll";
|
|
7791
|
+
title: string;
|
|
7792
|
+
options: {
|
|
7793
|
+
title: string;
|
|
7794
|
+
}[];
|
|
7554
7795
|
} | {
|
|
7555
|
-
type: "
|
|
7556
|
-
|
|
7796
|
+
type: "poll_option";
|
|
7797
|
+
option: {
|
|
7798
|
+
title: string;
|
|
7799
|
+
};
|
|
7800
|
+
poll: {
|
|
7801
|
+
type: "poll";
|
|
7802
|
+
title: string;
|
|
7803
|
+
options: {
|
|
7804
|
+
title: string;
|
|
7805
|
+
}[];
|
|
7806
|
+
};
|
|
7807
|
+
selected: boolean;
|
|
7808
|
+
title: string;
|
|
7557
7809
|
} | {
|
|
7558
7810
|
type: "reaction";
|
|
7559
7811
|
emoji: string;
|
|
7560
7812
|
target: Message<string, User, Space<unknown>>;
|
|
7813
|
+
} | {
|
|
7814
|
+
type: "group";
|
|
7815
|
+
items: Message<string, User, Space<unknown>>[];
|
|
7816
|
+
} | {
|
|
7817
|
+
type: "richlink";
|
|
7818
|
+
url: string;
|
|
7561
7819
|
} | {
|
|
7562
7820
|
type: "streamText";
|
|
7563
7821
|
stream: () => AsyncIterable<string>;
|
|
@@ -7570,9 +7828,6 @@ declare const contentSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
7570
7828
|
name?: string | undefined;
|
|
7571
7829
|
duration?: number | undefined;
|
|
7572
7830
|
size?: number | undefined;
|
|
7573
|
-
} | {
|
|
7574
|
-
type: "richlink";
|
|
7575
|
-
url: string;
|
|
7576
7831
|
} | {
|
|
7577
7832
|
type: "app";
|
|
7578
7833
|
url: z.core.$InferOuterFunctionType<z.ZodTuple<readonly [], null>, z.ZodPromise<z.ZodURL>>;
|
|
@@ -7619,6 +7874,14 @@ declare const contentSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
7619
7874
|
} | {
|
|
7620
7875
|
kind: "clear";
|
|
7621
7876
|
};
|
|
7877
|
+
} | {
|
|
7878
|
+
type: "addMember";
|
|
7879
|
+
members: string[];
|
|
7880
|
+
} | {
|
|
7881
|
+
type: "removeMember";
|
|
7882
|
+
members: string[];
|
|
7883
|
+
} | {
|
|
7884
|
+
type: "leaveSpace";
|
|
7622
7885
|
}>;
|
|
7623
7886
|
target: z.ZodCustom<Message<string, User, Space<unknown>>, Message<string, User, Space<unknown>>>;
|
|
7624
7887
|
}, z.core.$strip>, z.ZodObject<{
|
|
@@ -7660,4 +7923,4 @@ declare function attachment(input: AttachmentInput, options?: {
|
|
|
7660
7923
|
name?: string;
|
|
7661
7924
|
}): ContentBuilder;
|
|
7662
7925
|
//#endregion
|
|
7663
|
-
export {
|
|
7926
|
+
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 };
|