@spectrum-ts/core 8.1.1 → 8.2.1
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.
|
@@ -503,36 +503,20 @@ declare const editSchema: z.ZodObject<{
|
|
|
503
503
|
read: z.core.$InferOuterFunctionType<z.ZodTuple<readonly [], null>, z.ZodPromise<z.ZodCustom<Buffer<ArrayBufferLike>, Buffer<ArrayBufferLike>>>>;
|
|
504
504
|
} | undefined;
|
|
505
505
|
raw?: unknown;
|
|
506
|
-
} | {
|
|
507
|
-
type: "custom";
|
|
508
|
-
raw: unknown;
|
|
509
|
-
} | {
|
|
510
|
-
type: "poll";
|
|
511
|
-
title: string;
|
|
512
|
-
options: {
|
|
513
|
-
title: string;
|
|
514
|
-
}[];
|
|
515
|
-
} | {
|
|
516
|
-
type: "poll_option";
|
|
517
|
-
option: {
|
|
518
|
-
title: string;
|
|
519
|
-
};
|
|
520
|
-
poll: {
|
|
521
|
-
type: "poll";
|
|
522
|
-
title: string;
|
|
523
|
-
options: {
|
|
524
|
-
title: string;
|
|
525
|
-
}[];
|
|
526
|
-
};
|
|
527
|
-
selected: boolean;
|
|
528
|
-
title: string;
|
|
529
506
|
} | {
|
|
530
507
|
type: "group";
|
|
531
508
|
items: Message<string, User, Space<unknown>>[];
|
|
509
|
+
} | {
|
|
510
|
+
type: "custom";
|
|
511
|
+
raw: unknown;
|
|
532
512
|
} | {
|
|
533
513
|
type: "reaction";
|
|
534
514
|
emoji: string;
|
|
535
515
|
target: Message<string, User, Space<unknown>>;
|
|
516
|
+
} | {
|
|
517
|
+
type: "streamText";
|
|
518
|
+
stream: () => AsyncIterable<string>;
|
|
519
|
+
format?: "markdown" | "plain" | undefined;
|
|
536
520
|
} | {
|
|
537
521
|
type: "voice";
|
|
538
522
|
mimeType: string;
|
|
@@ -544,10 +528,6 @@ declare const editSchema: z.ZodObject<{
|
|
|
544
528
|
} | {
|
|
545
529
|
type: "richlink";
|
|
546
530
|
url: string;
|
|
547
|
-
} | {
|
|
548
|
-
type: "streamText";
|
|
549
|
-
stream: () => AsyncIterable<string>;
|
|
550
|
-
format?: "markdown" | "plain" | undefined;
|
|
551
531
|
} | {
|
|
552
532
|
type: "app";
|
|
553
533
|
url: z.core.$InferOuterFunctionType<z.ZodTuple<readonly [], null>, z.ZodPromise<z.ZodURL>>;
|
|
@@ -561,6 +541,26 @@ declare const editSchema: z.ZodObject<{
|
|
|
561
541
|
imageSubtitle: z.ZodOptional<z.ZodString>;
|
|
562
542
|
summary: z.ZodOptional<z.ZodString>;
|
|
563
543
|
}, z.core.$strip>>>;
|
|
544
|
+
} | {
|
|
545
|
+
type: "poll";
|
|
546
|
+
title: string;
|
|
547
|
+
options: {
|
|
548
|
+
title: string;
|
|
549
|
+
}[];
|
|
550
|
+
} | {
|
|
551
|
+
type: "poll_option";
|
|
552
|
+
option: {
|
|
553
|
+
title: string;
|
|
554
|
+
};
|
|
555
|
+
poll: {
|
|
556
|
+
type: "poll";
|
|
557
|
+
title: string;
|
|
558
|
+
options: {
|
|
559
|
+
title: string;
|
|
560
|
+
}[];
|
|
561
|
+
};
|
|
562
|
+
selected: boolean;
|
|
563
|
+
title: string;
|
|
564
564
|
} | {
|
|
565
565
|
type: "effect";
|
|
566
566
|
content: {
|
|
@@ -651,36 +651,20 @@ declare const editSchema: z.ZodObject<{
|
|
|
651
651
|
read: z.core.$InferOuterFunctionType<z.ZodTuple<readonly [], null>, z.ZodPromise<z.ZodCustom<Buffer<ArrayBufferLike>, Buffer<ArrayBufferLike>>>>;
|
|
652
652
|
} | undefined;
|
|
653
653
|
raw?: unknown;
|
|
654
|
-
} | {
|
|
655
|
-
type: "custom";
|
|
656
|
-
raw: unknown;
|
|
657
|
-
} | {
|
|
658
|
-
type: "poll";
|
|
659
|
-
title: string;
|
|
660
|
-
options: {
|
|
661
|
-
title: string;
|
|
662
|
-
}[];
|
|
663
|
-
} | {
|
|
664
|
-
type: "poll_option";
|
|
665
|
-
option: {
|
|
666
|
-
title: string;
|
|
667
|
-
};
|
|
668
|
-
poll: {
|
|
669
|
-
type: "poll";
|
|
670
|
-
title: string;
|
|
671
|
-
options: {
|
|
672
|
-
title: string;
|
|
673
|
-
}[];
|
|
674
|
-
};
|
|
675
|
-
selected: boolean;
|
|
676
|
-
title: string;
|
|
677
654
|
} | {
|
|
678
655
|
type: "group";
|
|
679
656
|
items: Message<string, User, Space<unknown>>[];
|
|
657
|
+
} | {
|
|
658
|
+
type: "custom";
|
|
659
|
+
raw: unknown;
|
|
680
660
|
} | {
|
|
681
661
|
type: "reaction";
|
|
682
662
|
emoji: string;
|
|
683
663
|
target: Message<string, User, Space<unknown>>;
|
|
664
|
+
} | {
|
|
665
|
+
type: "streamText";
|
|
666
|
+
stream: () => AsyncIterable<string>;
|
|
667
|
+
format?: "markdown" | "plain" | undefined;
|
|
684
668
|
} | {
|
|
685
669
|
type: "voice";
|
|
686
670
|
mimeType: string;
|
|
@@ -692,10 +676,6 @@ declare const editSchema: z.ZodObject<{
|
|
|
692
676
|
} | {
|
|
693
677
|
type: "richlink";
|
|
694
678
|
url: string;
|
|
695
|
-
} | {
|
|
696
|
-
type: "streamText";
|
|
697
|
-
stream: () => AsyncIterable<string>;
|
|
698
|
-
format?: "markdown" | "plain" | undefined;
|
|
699
679
|
} | {
|
|
700
680
|
type: "app";
|
|
701
681
|
url: z.core.$InferOuterFunctionType<z.ZodTuple<readonly [], null>, z.ZodPromise<z.ZodURL>>;
|
|
@@ -709,6 +689,26 @@ declare const editSchema: z.ZodObject<{
|
|
|
709
689
|
imageSubtitle: z.ZodOptional<z.ZodString>;
|
|
710
690
|
summary: z.ZodOptional<z.ZodString>;
|
|
711
691
|
}, z.core.$strip>>>;
|
|
692
|
+
} | {
|
|
693
|
+
type: "poll";
|
|
694
|
+
title: string;
|
|
695
|
+
options: {
|
|
696
|
+
title: string;
|
|
697
|
+
}[];
|
|
698
|
+
} | {
|
|
699
|
+
type: "poll_option";
|
|
700
|
+
option: {
|
|
701
|
+
title: string;
|
|
702
|
+
};
|
|
703
|
+
poll: {
|
|
704
|
+
type: "poll";
|
|
705
|
+
title: string;
|
|
706
|
+
options: {
|
|
707
|
+
title: string;
|
|
708
|
+
}[];
|
|
709
|
+
};
|
|
710
|
+
selected: boolean;
|
|
711
|
+
title: string;
|
|
712
712
|
} | {
|
|
713
713
|
type: "effect";
|
|
714
714
|
content: {
|
|
@@ -1024,36 +1024,20 @@ declare const replySchema: z.ZodObject<{
|
|
|
1024
1024
|
read: z.core.$InferOuterFunctionType<z.ZodTuple<readonly [], null>, z.ZodPromise<z.ZodCustom<Buffer<ArrayBufferLike>, Buffer<ArrayBufferLike>>>>;
|
|
1025
1025
|
} | undefined;
|
|
1026
1026
|
raw?: unknown;
|
|
1027
|
-
} | {
|
|
1028
|
-
type: "custom";
|
|
1029
|
-
raw: unknown;
|
|
1030
|
-
} | {
|
|
1031
|
-
type: "poll";
|
|
1032
|
-
title: string;
|
|
1033
|
-
options: {
|
|
1034
|
-
title: string;
|
|
1035
|
-
}[];
|
|
1036
|
-
} | {
|
|
1037
|
-
type: "poll_option";
|
|
1038
|
-
option: {
|
|
1039
|
-
title: string;
|
|
1040
|
-
};
|
|
1041
|
-
poll: {
|
|
1042
|
-
type: "poll";
|
|
1043
|
-
title: string;
|
|
1044
|
-
options: {
|
|
1045
|
-
title: string;
|
|
1046
|
-
}[];
|
|
1047
|
-
};
|
|
1048
|
-
selected: boolean;
|
|
1049
|
-
title: string;
|
|
1050
1027
|
} | {
|
|
1051
1028
|
type: "group";
|
|
1052
1029
|
items: Message<string, User, Space<unknown>>[];
|
|
1030
|
+
} | {
|
|
1031
|
+
type: "custom";
|
|
1032
|
+
raw: unknown;
|
|
1053
1033
|
} | {
|
|
1054
1034
|
type: "reaction";
|
|
1055
1035
|
emoji: string;
|
|
1056
1036
|
target: Message<string, User, Space<unknown>>;
|
|
1037
|
+
} | {
|
|
1038
|
+
type: "streamText";
|
|
1039
|
+
stream: () => AsyncIterable<string>;
|
|
1040
|
+
format?: "markdown" | "plain" | undefined;
|
|
1057
1041
|
} | {
|
|
1058
1042
|
type: "voice";
|
|
1059
1043
|
mimeType: string;
|
|
@@ -1065,10 +1049,6 @@ declare const replySchema: z.ZodObject<{
|
|
|
1065
1049
|
} | {
|
|
1066
1050
|
type: "richlink";
|
|
1067
1051
|
url: string;
|
|
1068
|
-
} | {
|
|
1069
|
-
type: "streamText";
|
|
1070
|
-
stream: () => AsyncIterable<string>;
|
|
1071
|
-
format?: "markdown" | "plain" | undefined;
|
|
1072
1052
|
} | {
|
|
1073
1053
|
type: "app";
|
|
1074
1054
|
url: z.core.$InferOuterFunctionType<z.ZodTuple<readonly [], null>, z.ZodPromise<z.ZodURL>>;
|
|
@@ -1082,6 +1062,26 @@ declare const replySchema: z.ZodObject<{
|
|
|
1082
1062
|
imageSubtitle: z.ZodOptional<z.ZodString>;
|
|
1083
1063
|
summary: z.ZodOptional<z.ZodString>;
|
|
1084
1064
|
}, z.core.$strip>>>;
|
|
1065
|
+
} | {
|
|
1066
|
+
type: "poll";
|
|
1067
|
+
title: string;
|
|
1068
|
+
options: {
|
|
1069
|
+
title: string;
|
|
1070
|
+
}[];
|
|
1071
|
+
} | {
|
|
1072
|
+
type: "poll_option";
|
|
1073
|
+
option: {
|
|
1074
|
+
title: string;
|
|
1075
|
+
};
|
|
1076
|
+
poll: {
|
|
1077
|
+
type: "poll";
|
|
1078
|
+
title: string;
|
|
1079
|
+
options: {
|
|
1080
|
+
title: string;
|
|
1081
|
+
}[];
|
|
1082
|
+
};
|
|
1083
|
+
selected: boolean;
|
|
1084
|
+
title: string;
|
|
1085
1085
|
} | {
|
|
1086
1086
|
type: "effect";
|
|
1087
1087
|
content: {
|
|
@@ -1172,36 +1172,20 @@ declare const replySchema: z.ZodObject<{
|
|
|
1172
1172
|
read: z.core.$InferOuterFunctionType<z.ZodTuple<readonly [], null>, z.ZodPromise<z.ZodCustom<Buffer<ArrayBufferLike>, Buffer<ArrayBufferLike>>>>;
|
|
1173
1173
|
} | undefined;
|
|
1174
1174
|
raw?: unknown;
|
|
1175
|
-
} | {
|
|
1176
|
-
type: "custom";
|
|
1177
|
-
raw: unknown;
|
|
1178
|
-
} | {
|
|
1179
|
-
type: "poll";
|
|
1180
|
-
title: string;
|
|
1181
|
-
options: {
|
|
1182
|
-
title: string;
|
|
1183
|
-
}[];
|
|
1184
|
-
} | {
|
|
1185
|
-
type: "poll_option";
|
|
1186
|
-
option: {
|
|
1187
|
-
title: string;
|
|
1188
|
-
};
|
|
1189
|
-
poll: {
|
|
1190
|
-
type: "poll";
|
|
1191
|
-
title: string;
|
|
1192
|
-
options: {
|
|
1193
|
-
title: string;
|
|
1194
|
-
}[];
|
|
1195
|
-
};
|
|
1196
|
-
selected: boolean;
|
|
1197
|
-
title: string;
|
|
1198
1175
|
} | {
|
|
1199
1176
|
type: "group";
|
|
1200
1177
|
items: Message<string, User, Space<unknown>>[];
|
|
1178
|
+
} | {
|
|
1179
|
+
type: "custom";
|
|
1180
|
+
raw: unknown;
|
|
1201
1181
|
} | {
|
|
1202
1182
|
type: "reaction";
|
|
1203
1183
|
emoji: string;
|
|
1204
1184
|
target: Message<string, User, Space<unknown>>;
|
|
1185
|
+
} | {
|
|
1186
|
+
type: "streamText";
|
|
1187
|
+
stream: () => AsyncIterable<string>;
|
|
1188
|
+
format?: "markdown" | "plain" | undefined;
|
|
1205
1189
|
} | {
|
|
1206
1190
|
type: "voice";
|
|
1207
1191
|
mimeType: string;
|
|
@@ -1213,10 +1197,6 @@ declare const replySchema: z.ZodObject<{
|
|
|
1213
1197
|
} | {
|
|
1214
1198
|
type: "richlink";
|
|
1215
1199
|
url: string;
|
|
1216
|
-
} | {
|
|
1217
|
-
type: "streamText";
|
|
1218
|
-
stream: () => AsyncIterable<string>;
|
|
1219
|
-
format?: "markdown" | "plain" | undefined;
|
|
1220
1200
|
} | {
|
|
1221
1201
|
type: "app";
|
|
1222
1202
|
url: z.core.$InferOuterFunctionType<z.ZodTuple<readonly [], null>, z.ZodPromise<z.ZodURL>>;
|
|
@@ -1230,6 +1210,26 @@ declare const replySchema: z.ZodObject<{
|
|
|
1230
1210
|
imageSubtitle: z.ZodOptional<z.ZodString>;
|
|
1231
1211
|
summary: z.ZodOptional<z.ZodString>;
|
|
1232
1212
|
}, z.core.$strip>>>;
|
|
1213
|
+
} | {
|
|
1214
|
+
type: "poll";
|
|
1215
|
+
title: string;
|
|
1216
|
+
options: {
|
|
1217
|
+
title: string;
|
|
1218
|
+
}[];
|
|
1219
|
+
} | {
|
|
1220
|
+
type: "poll_option";
|
|
1221
|
+
option: {
|
|
1222
|
+
title: string;
|
|
1223
|
+
};
|
|
1224
|
+
poll: {
|
|
1225
|
+
type: "poll";
|
|
1226
|
+
title: string;
|
|
1227
|
+
options: {
|
|
1228
|
+
title: string;
|
|
1229
|
+
}[];
|
|
1230
|
+
};
|
|
1231
|
+
selected: boolean;
|
|
1232
|
+
title: string;
|
|
1233
1233
|
} | {
|
|
1234
1234
|
type: "effect";
|
|
1235
1235
|
content: {
|
|
@@ -1267,6 +1267,10 @@ declare const replySchema: z.ZodObject<{
|
|
|
1267
1267
|
target: z.ZodCustom<Message<string, User, Space<unknown>>, Message<string, User, Space<unknown>>>;
|
|
1268
1268
|
}, z.core.$strip>;
|
|
1269
1269
|
type Reply = z.infer<typeof replySchema>;
|
|
1270
|
+
declare const asReply: (input: {
|
|
1271
|
+
content: BaseContent;
|
|
1272
|
+
target: Message;
|
|
1273
|
+
}) => Reply;
|
|
1270
1274
|
declare function reply(content: ContentInput, target: Message | undefined): ContentBuilder;
|
|
1271
1275
|
//#endregion
|
|
1272
1276
|
//#region src/content/resolve.d.ts
|
|
@@ -6681,7 +6685,7 @@ declare const fromVCard: (vcf: string) => ContactInput;
|
|
|
6681
6685
|
declare const toVCard: (contact: Contact) => Promise<string>;
|
|
6682
6686
|
//#endregion
|
|
6683
6687
|
//#region src/content/types.d.ts
|
|
6684
|
-
declare const
|
|
6688
|
+
declare const baseContentSchema: z.ZodDiscriminatedUnion<readonly [z.ZodObject<{
|
|
6685
6689
|
type: z.ZodLiteral<"text">;
|
|
6686
6690
|
text: z.ZodString;
|
|
6687
6691
|
}, z.core.$strip>, z.ZodObject<{
|
|
@@ -6848,41 +6852,210 @@ declare const contentSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
6848
6852
|
}, z.core.$strip>, z.ZodObject<{
|
|
6849
6853
|
kind: z.ZodLiteral<"clear">;
|
|
6850
6854
|
}, z.core.$strip>], "kind">;
|
|
6855
|
+
}, z.core.$strip>], "type">;
|
|
6856
|
+
type BaseContent = z.infer<typeof baseContentSchema>;
|
|
6857
|
+
declare const contentSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
6858
|
+
type: z.ZodLiteral<"text">;
|
|
6859
|
+
text: z.ZodString;
|
|
6851
6860
|
}, z.core.$strip>, z.ZodObject<{
|
|
6852
|
-
type: z.ZodLiteral<"
|
|
6853
|
-
|
|
6854
|
-
|
|
6855
|
-
|
|
6856
|
-
|
|
6857
|
-
|
|
6858
|
-
markdown:
|
|
6859
|
-
|
|
6860
|
-
|
|
6861
|
-
|
|
6862
|
-
|
|
6863
|
-
|
|
6864
|
-
|
|
6865
|
-
|
|
6866
|
-
|
|
6867
|
-
|
|
6868
|
-
|
|
6869
|
-
|
|
6870
|
-
|
|
6871
|
-
|
|
6872
|
-
|
|
6873
|
-
|
|
6874
|
-
|
|
6875
|
-
|
|
6876
|
-
|
|
6877
|
-
|
|
6878
|
-
|
|
6879
|
-
|
|
6880
|
-
|
|
6881
|
-
|
|
6882
|
-
|
|
6883
|
-
|
|
6884
|
-
|
|
6885
|
-
|
|
6861
|
+
type: z.ZodLiteral<"markdown">;
|
|
6862
|
+
markdown: z.ZodString;
|
|
6863
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
6864
|
+
type: z.ZodLiteral<"streamText">;
|
|
6865
|
+
stream: z.ZodCustom<() => AsyncIterable<string>, () => AsyncIterable<string>>;
|
|
6866
|
+
format: z.ZodOptional<z.ZodEnum<{
|
|
6867
|
+
markdown: "markdown";
|
|
6868
|
+
plain: "plain";
|
|
6869
|
+
}>>;
|
|
6870
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
6871
|
+
type: z.ZodLiteral<"custom">;
|
|
6872
|
+
raw: z.ZodUnknown;
|
|
6873
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
6874
|
+
type: z.ZodLiteral<"attachment">;
|
|
6875
|
+
id: z.ZodString;
|
|
6876
|
+
name: z.ZodString;
|
|
6877
|
+
mimeType: z.ZodString;
|
|
6878
|
+
size: z.ZodOptional<z.ZodNumber>;
|
|
6879
|
+
read: z.ZodFunction<z.ZodTuple<readonly [], null>, z.ZodPromise<z.ZodCustom<Buffer<ArrayBufferLike>, Buffer<ArrayBufferLike>>>>;
|
|
6880
|
+
stream: z.ZodFunction<z.ZodTuple<readonly [], null>, z.ZodPromise<z.ZodCustom<ReadableStream<unknown>, ReadableStream<unknown>>>>;
|
|
6881
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
6882
|
+
type: z.ZodLiteral<"contact">;
|
|
6883
|
+
user: z.ZodOptional<z.ZodObject<{
|
|
6884
|
+
__platform: z.ZodString;
|
|
6885
|
+
id: z.ZodString;
|
|
6886
|
+
}, z.core.$strip>>;
|
|
6887
|
+
name: z.ZodOptional<z.ZodObject<{
|
|
6888
|
+
formatted: z.ZodOptional<z.ZodString>;
|
|
6889
|
+
first: z.ZodOptional<z.ZodString>;
|
|
6890
|
+
last: z.ZodOptional<z.ZodString>;
|
|
6891
|
+
middle: z.ZodOptional<z.ZodString>;
|
|
6892
|
+
prefix: z.ZodOptional<z.ZodString>;
|
|
6893
|
+
suffix: z.ZodOptional<z.ZodString>;
|
|
6894
|
+
}, z.core.$strip>>;
|
|
6895
|
+
phones: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
6896
|
+
value: z.ZodString;
|
|
6897
|
+
type: z.ZodOptional<z.ZodEnum<{
|
|
6898
|
+
mobile: "mobile";
|
|
6899
|
+
home: "home";
|
|
6900
|
+
work: "work";
|
|
6901
|
+
other: "other";
|
|
6902
|
+
}>>;
|
|
6903
|
+
}, z.core.$strip>>>;
|
|
6904
|
+
emails: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
6905
|
+
value: z.ZodString;
|
|
6906
|
+
type: z.ZodOptional<z.ZodEnum<{
|
|
6907
|
+
home: "home";
|
|
6908
|
+
work: "work";
|
|
6909
|
+
other: "other";
|
|
6910
|
+
}>>;
|
|
6911
|
+
}, z.core.$strip>>>;
|
|
6912
|
+
addresses: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
6913
|
+
street: z.ZodOptional<z.ZodString>;
|
|
6914
|
+
city: z.ZodOptional<z.ZodString>;
|
|
6915
|
+
region: z.ZodOptional<z.ZodString>;
|
|
6916
|
+
postalCode: z.ZodOptional<z.ZodString>;
|
|
6917
|
+
country: z.ZodOptional<z.ZodString>;
|
|
6918
|
+
type: z.ZodOptional<z.ZodEnum<{
|
|
6919
|
+
home: "home";
|
|
6920
|
+
work: "work";
|
|
6921
|
+
other: "other";
|
|
6922
|
+
}>>;
|
|
6923
|
+
}, z.core.$strip>>>;
|
|
6924
|
+
org: z.ZodOptional<z.ZodObject<{
|
|
6925
|
+
name: z.ZodOptional<z.ZodString>;
|
|
6926
|
+
title: z.ZodOptional<z.ZodString>;
|
|
6927
|
+
department: z.ZodOptional<z.ZodString>;
|
|
6928
|
+
}, z.core.$strip>>;
|
|
6929
|
+
urls: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
6930
|
+
birthday: z.ZodOptional<z.ZodString>;
|
|
6931
|
+
note: z.ZodOptional<z.ZodString>;
|
|
6932
|
+
photo: z.ZodOptional<z.ZodObject<{
|
|
6933
|
+
mimeType: z.ZodString;
|
|
6934
|
+
read: z.ZodFunction<z.ZodTuple<readonly [], null>, z.ZodPromise<z.ZodCustom<Buffer<ArrayBufferLike>, Buffer<ArrayBufferLike>>>>;
|
|
6935
|
+
}, z.core.$strip>>;
|
|
6936
|
+
raw: z.ZodOptional<z.ZodUnknown>;
|
|
6937
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
6938
|
+
type: z.ZodLiteral<"voice">;
|
|
6939
|
+
name: z.ZodOptional<z.ZodString>;
|
|
6940
|
+
mimeType: z.ZodString;
|
|
6941
|
+
duration: z.ZodOptional<z.ZodNumber>;
|
|
6942
|
+
size: z.ZodOptional<z.ZodNumber>;
|
|
6943
|
+
read: z.ZodFunction<z.ZodTuple<readonly [], null>, z.ZodPromise<z.ZodCustom<Buffer<ArrayBufferLike>, Buffer<ArrayBufferLike>>>>;
|
|
6944
|
+
stream: z.ZodFunction<z.ZodTuple<readonly [], null>, z.ZodPromise<z.ZodCustom<ReadableStream<unknown>, ReadableStream<unknown>>>>;
|
|
6945
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
6946
|
+
type: z.ZodLiteral<"richlink">;
|
|
6947
|
+
url: z.ZodURL;
|
|
6948
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
6949
|
+
type: z.ZodLiteral<"app">;
|
|
6950
|
+
url: z.ZodFunction<z.ZodTuple<readonly [], null>, z.ZodPromise<z.ZodURL>>;
|
|
6951
|
+
layout: z.ZodFunction<z.ZodTuple<readonly [], null>, z.ZodPromise<z.ZodObject<{
|
|
6952
|
+
caption: z.ZodOptional<z.ZodString>;
|
|
6953
|
+
subcaption: z.ZodOptional<z.ZodString>;
|
|
6954
|
+
trailingCaption: z.ZodOptional<z.ZodString>;
|
|
6955
|
+
trailingSubcaption: z.ZodOptional<z.ZodString>;
|
|
6956
|
+
image: z.ZodOptional<z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>>;
|
|
6957
|
+
imageTitle: z.ZodOptional<z.ZodString>;
|
|
6958
|
+
imageSubtitle: z.ZodOptional<z.ZodString>;
|
|
6959
|
+
summary: z.ZodOptional<z.ZodString>;
|
|
6960
|
+
}, z.core.$strip>>>;
|
|
6961
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
6962
|
+
type: z.ZodLiteral<"reaction">;
|
|
6963
|
+
emoji: z.ZodString;
|
|
6964
|
+
target: z.ZodCustom<Message<string, User, Space<unknown>>, Message<string, User, Space<unknown>>>;
|
|
6965
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
6966
|
+
type: z.ZodLiteral<"group">;
|
|
6967
|
+
items: z.ZodArray<z.ZodCustom<Message<string, User, Space<unknown>>, Message<string, User, Space<unknown>>>>;
|
|
6968
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
6969
|
+
type: z.ZodLiteral<"poll">;
|
|
6970
|
+
title: z.ZodString;
|
|
6971
|
+
options: z.ZodArray<z.ZodObject<{
|
|
6972
|
+
title: z.ZodString;
|
|
6973
|
+
}, z.core.$strip>>;
|
|
6974
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
6975
|
+
type: z.ZodLiteral<"poll_option">;
|
|
6976
|
+
option: z.ZodObject<{
|
|
6977
|
+
title: z.ZodString;
|
|
6978
|
+
}, z.core.$strip>;
|
|
6979
|
+
poll: z.ZodObject<{
|
|
6980
|
+
type: z.ZodLiteral<"poll">;
|
|
6981
|
+
title: z.ZodString;
|
|
6982
|
+
options: z.ZodArray<z.ZodObject<{
|
|
6983
|
+
title: z.ZodString;
|
|
6984
|
+
}, z.core.$strip>>;
|
|
6985
|
+
}, z.core.$strip>;
|
|
6986
|
+
selected: z.ZodBoolean;
|
|
6987
|
+
title: z.ZodString;
|
|
6988
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
6989
|
+
type: z.ZodLiteral<"effect">;
|
|
6990
|
+
content: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
6991
|
+
type: z.ZodLiteral<"text">;
|
|
6992
|
+
text: z.ZodString;
|
|
6993
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
6994
|
+
type: z.ZodLiteral<"markdown">;
|
|
6995
|
+
markdown: z.ZodString;
|
|
6996
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
6997
|
+
type: z.ZodLiteral<"attachment">;
|
|
6998
|
+
id: z.ZodString;
|
|
6999
|
+
name: z.ZodString;
|
|
7000
|
+
mimeType: z.ZodString;
|
|
7001
|
+
size: z.ZodOptional<z.ZodNumber>;
|
|
7002
|
+
read: z.ZodFunction<z.ZodTuple<readonly [], null>, z.ZodPromise<z.ZodCustom<Buffer<ArrayBufferLike>, Buffer<ArrayBufferLike>>>>;
|
|
7003
|
+
stream: z.ZodFunction<z.ZodTuple<readonly [], null>, z.ZodPromise<z.ZodCustom<ReadableStream<unknown>, ReadableStream<unknown>>>>;
|
|
7004
|
+
}, z.core.$strip>], "type">;
|
|
7005
|
+
effect: z.ZodString;
|
|
7006
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
7007
|
+
type: z.ZodLiteral<"typing">;
|
|
7008
|
+
state: z.ZodEnum<{
|
|
7009
|
+
start: "start";
|
|
7010
|
+
stop: "stop";
|
|
7011
|
+
}>;
|
|
7012
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
7013
|
+
type: z.ZodLiteral<"rename">;
|
|
7014
|
+
displayName: z.ZodString;
|
|
7015
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
7016
|
+
type: z.ZodLiteral<"avatar">;
|
|
7017
|
+
action: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
7018
|
+
kind: z.ZodLiteral<"set">;
|
|
7019
|
+
read: z.ZodFunction<z.ZodTuple<readonly [], null>, z.ZodPromise<z.ZodCustom<Buffer<ArrayBufferLike>, Buffer<ArrayBufferLike>>>>;
|
|
7020
|
+
mimeType: z.ZodString;
|
|
7021
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
7022
|
+
kind: z.ZodLiteral<"clear">;
|
|
7023
|
+
}, z.core.$strip>], "kind">;
|
|
7024
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
7025
|
+
type: z.ZodLiteral<"reply">;
|
|
7026
|
+
content: z.ZodCustom<{
|
|
7027
|
+
type: "text";
|
|
7028
|
+
text: string;
|
|
7029
|
+
} | {
|
|
7030
|
+
type: "markdown";
|
|
7031
|
+
markdown: string;
|
|
7032
|
+
} | {
|
|
7033
|
+
type: "attachment";
|
|
7034
|
+
id: string;
|
|
7035
|
+
name: string;
|
|
7036
|
+
mimeType: string;
|
|
7037
|
+
read: z.core.$InferOuterFunctionType<z.ZodTuple<readonly [], null>, z.ZodPromise<z.ZodCustom<Buffer<ArrayBufferLike>, Buffer<ArrayBufferLike>>>>;
|
|
7038
|
+
stream: z.core.$InferOuterFunctionType<z.ZodTuple<readonly [], null>, z.ZodPromise<z.ZodCustom<ReadableStream<unknown>, ReadableStream<unknown>>>>;
|
|
7039
|
+
size?: number | undefined;
|
|
7040
|
+
} | {
|
|
7041
|
+
type: "contact";
|
|
7042
|
+
user?: {
|
|
7043
|
+
__platform: string;
|
|
7044
|
+
id: string;
|
|
7045
|
+
} | undefined;
|
|
7046
|
+
name?: {
|
|
7047
|
+
formatted?: string | undefined;
|
|
7048
|
+
first?: string | undefined;
|
|
7049
|
+
last?: string | undefined;
|
|
7050
|
+
middle?: string | undefined;
|
|
7051
|
+
prefix?: string | undefined;
|
|
7052
|
+
suffix?: string | undefined;
|
|
7053
|
+
} | undefined;
|
|
7054
|
+
phones?: {
|
|
7055
|
+
value: string;
|
|
7056
|
+
type?: "mobile" | "home" | "work" | "other" | undefined;
|
|
7057
|
+
}[] | undefined;
|
|
7058
|
+
emails?: {
|
|
6886
7059
|
value: string;
|
|
6887
7060
|
type?: "home" | "work" | "other" | undefined;
|
|
6888
7061
|
}[] | undefined;
|
|
@@ -6907,36 +7080,20 @@ declare const contentSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
6907
7080
|
read: z.core.$InferOuterFunctionType<z.ZodTuple<readonly [], null>, z.ZodPromise<z.ZodCustom<Buffer<ArrayBufferLike>, Buffer<ArrayBufferLike>>>>;
|
|
6908
7081
|
} | undefined;
|
|
6909
7082
|
raw?: unknown;
|
|
6910
|
-
} | {
|
|
6911
|
-
type: "custom";
|
|
6912
|
-
raw: unknown;
|
|
6913
|
-
} | {
|
|
6914
|
-
type: "poll";
|
|
6915
|
-
title: string;
|
|
6916
|
-
options: {
|
|
6917
|
-
title: string;
|
|
6918
|
-
}[];
|
|
6919
|
-
} | {
|
|
6920
|
-
type: "poll_option";
|
|
6921
|
-
option: {
|
|
6922
|
-
title: string;
|
|
6923
|
-
};
|
|
6924
|
-
poll: {
|
|
6925
|
-
type: "poll";
|
|
6926
|
-
title: string;
|
|
6927
|
-
options: {
|
|
6928
|
-
title: string;
|
|
6929
|
-
}[];
|
|
6930
|
-
};
|
|
6931
|
-
selected: boolean;
|
|
6932
|
-
title: string;
|
|
6933
7083
|
} | {
|
|
6934
7084
|
type: "group";
|
|
6935
7085
|
items: Message<string, User, Space<unknown>>[];
|
|
7086
|
+
} | {
|
|
7087
|
+
type: "custom";
|
|
7088
|
+
raw: unknown;
|
|
6936
7089
|
} | {
|
|
6937
7090
|
type: "reaction";
|
|
6938
7091
|
emoji: string;
|
|
6939
7092
|
target: Message<string, User, Space<unknown>>;
|
|
7093
|
+
} | {
|
|
7094
|
+
type: "streamText";
|
|
7095
|
+
stream: () => AsyncIterable<string>;
|
|
7096
|
+
format?: "markdown" | "plain" | undefined;
|
|
6940
7097
|
} | {
|
|
6941
7098
|
type: "voice";
|
|
6942
7099
|
mimeType: string;
|
|
@@ -6948,10 +7105,6 @@ declare const contentSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
6948
7105
|
} | {
|
|
6949
7106
|
type: "richlink";
|
|
6950
7107
|
url: string;
|
|
6951
|
-
} | {
|
|
6952
|
-
type: "streamText";
|
|
6953
|
-
stream: () => AsyncIterable<string>;
|
|
6954
|
-
format?: "markdown" | "plain" | undefined;
|
|
6955
7108
|
} | {
|
|
6956
7109
|
type: "app";
|
|
6957
7110
|
url: z.core.$InferOuterFunctionType<z.ZodTuple<readonly [], null>, z.ZodPromise<z.ZodURL>>;
|
|
@@ -6965,6 +7118,26 @@ declare const contentSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
6965
7118
|
imageSubtitle: z.ZodOptional<z.ZodString>;
|
|
6966
7119
|
summary: z.ZodOptional<z.ZodString>;
|
|
6967
7120
|
}, z.core.$strip>>>;
|
|
7121
|
+
} | {
|
|
7122
|
+
type: "poll";
|
|
7123
|
+
title: string;
|
|
7124
|
+
options: {
|
|
7125
|
+
title: string;
|
|
7126
|
+
}[];
|
|
7127
|
+
} | {
|
|
7128
|
+
type: "poll_option";
|
|
7129
|
+
option: {
|
|
7130
|
+
title: string;
|
|
7131
|
+
};
|
|
7132
|
+
poll: {
|
|
7133
|
+
type: "poll";
|
|
7134
|
+
title: string;
|
|
7135
|
+
options: {
|
|
7136
|
+
title: string;
|
|
7137
|
+
}[];
|
|
7138
|
+
};
|
|
7139
|
+
selected: boolean;
|
|
7140
|
+
title: string;
|
|
6968
7141
|
} | {
|
|
6969
7142
|
type: "effect";
|
|
6970
7143
|
content: {
|
|
@@ -7055,36 +7228,20 @@ declare const contentSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
7055
7228
|
read: z.core.$InferOuterFunctionType<z.ZodTuple<readonly [], null>, z.ZodPromise<z.ZodCustom<Buffer<ArrayBufferLike>, Buffer<ArrayBufferLike>>>>;
|
|
7056
7229
|
} | undefined;
|
|
7057
7230
|
raw?: unknown;
|
|
7058
|
-
} | {
|
|
7059
|
-
type: "custom";
|
|
7060
|
-
raw: unknown;
|
|
7061
|
-
} | {
|
|
7062
|
-
type: "poll";
|
|
7063
|
-
title: string;
|
|
7064
|
-
options: {
|
|
7065
|
-
title: string;
|
|
7066
|
-
}[];
|
|
7067
|
-
} | {
|
|
7068
|
-
type: "poll_option";
|
|
7069
|
-
option: {
|
|
7070
|
-
title: string;
|
|
7071
|
-
};
|
|
7072
|
-
poll: {
|
|
7073
|
-
type: "poll";
|
|
7074
|
-
title: string;
|
|
7075
|
-
options: {
|
|
7076
|
-
title: string;
|
|
7077
|
-
}[];
|
|
7078
|
-
};
|
|
7079
|
-
selected: boolean;
|
|
7080
|
-
title: string;
|
|
7081
7231
|
} | {
|
|
7082
7232
|
type: "group";
|
|
7083
7233
|
items: Message<string, User, Space<unknown>>[];
|
|
7234
|
+
} | {
|
|
7235
|
+
type: "custom";
|
|
7236
|
+
raw: unknown;
|
|
7084
7237
|
} | {
|
|
7085
7238
|
type: "reaction";
|
|
7086
7239
|
emoji: string;
|
|
7087
7240
|
target: Message<string, User, Space<unknown>>;
|
|
7241
|
+
} | {
|
|
7242
|
+
type: "streamText";
|
|
7243
|
+
stream: () => AsyncIterable<string>;
|
|
7244
|
+
format?: "markdown" | "plain" | undefined;
|
|
7088
7245
|
} | {
|
|
7089
7246
|
type: "voice";
|
|
7090
7247
|
mimeType: string;
|
|
@@ -7096,10 +7253,6 @@ declare const contentSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
7096
7253
|
} | {
|
|
7097
7254
|
type: "richlink";
|
|
7098
7255
|
url: string;
|
|
7099
|
-
} | {
|
|
7100
|
-
type: "streamText";
|
|
7101
|
-
stream: () => AsyncIterable<string>;
|
|
7102
|
-
format?: "markdown" | "plain" | undefined;
|
|
7103
7256
|
} | {
|
|
7104
7257
|
type: "app";
|
|
7105
7258
|
url: z.core.$InferOuterFunctionType<z.ZodTuple<readonly [], null>, z.ZodPromise<z.ZodURL>>;
|
|
@@ -7113,6 +7266,26 @@ declare const contentSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
7113
7266
|
imageSubtitle: z.ZodOptional<z.ZodString>;
|
|
7114
7267
|
summary: z.ZodOptional<z.ZodString>;
|
|
7115
7268
|
}, z.core.$strip>>>;
|
|
7269
|
+
} | {
|
|
7270
|
+
type: "poll";
|
|
7271
|
+
title: string;
|
|
7272
|
+
options: {
|
|
7273
|
+
title: string;
|
|
7274
|
+
}[];
|
|
7275
|
+
} | {
|
|
7276
|
+
type: "poll_option";
|
|
7277
|
+
option: {
|
|
7278
|
+
title: string;
|
|
7279
|
+
};
|
|
7280
|
+
poll: {
|
|
7281
|
+
type: "poll";
|
|
7282
|
+
title: string;
|
|
7283
|
+
options: {
|
|
7284
|
+
title: string;
|
|
7285
|
+
}[];
|
|
7286
|
+
};
|
|
7287
|
+
selected: boolean;
|
|
7288
|
+
title: string;
|
|
7116
7289
|
} | {
|
|
7117
7290
|
type: "effect";
|
|
7118
7291
|
content: {
|
|
@@ -7207,36 +7380,20 @@ declare const contentSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
7207
7380
|
read: z.core.$InferOuterFunctionType<z.ZodTuple<readonly [], null>, z.ZodPromise<z.ZodCustom<Buffer<ArrayBufferLike>, Buffer<ArrayBufferLike>>>>;
|
|
7208
7381
|
} | undefined;
|
|
7209
7382
|
raw?: unknown;
|
|
7210
|
-
} | {
|
|
7211
|
-
type: "custom";
|
|
7212
|
-
raw: unknown;
|
|
7213
|
-
} | {
|
|
7214
|
-
type: "poll";
|
|
7215
|
-
title: string;
|
|
7216
|
-
options: {
|
|
7217
|
-
title: string;
|
|
7218
|
-
}[];
|
|
7219
|
-
} | {
|
|
7220
|
-
type: "poll_option";
|
|
7221
|
-
option: {
|
|
7222
|
-
title: string;
|
|
7223
|
-
};
|
|
7224
|
-
poll: {
|
|
7225
|
-
type: "poll";
|
|
7226
|
-
title: string;
|
|
7227
|
-
options: {
|
|
7228
|
-
title: string;
|
|
7229
|
-
}[];
|
|
7230
|
-
};
|
|
7231
|
-
selected: boolean;
|
|
7232
|
-
title: string;
|
|
7233
7383
|
} | {
|
|
7234
7384
|
type: "group";
|
|
7235
7385
|
items: Message<string, User, Space<unknown>>[];
|
|
7386
|
+
} | {
|
|
7387
|
+
type: "custom";
|
|
7388
|
+
raw: unknown;
|
|
7236
7389
|
} | {
|
|
7237
7390
|
type: "reaction";
|
|
7238
7391
|
emoji: string;
|
|
7239
7392
|
target: Message<string, User, Space<unknown>>;
|
|
7393
|
+
} | {
|
|
7394
|
+
type: "streamText";
|
|
7395
|
+
stream: () => AsyncIterable<string>;
|
|
7396
|
+
format?: "markdown" | "plain" | undefined;
|
|
7240
7397
|
} | {
|
|
7241
7398
|
type: "voice";
|
|
7242
7399
|
mimeType: string;
|
|
@@ -7248,10 +7405,6 @@ declare const contentSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
7248
7405
|
} | {
|
|
7249
7406
|
type: "richlink";
|
|
7250
7407
|
url: string;
|
|
7251
|
-
} | {
|
|
7252
|
-
type: "streamText";
|
|
7253
|
-
stream: () => AsyncIterable<string>;
|
|
7254
|
-
format?: "markdown" | "plain" | undefined;
|
|
7255
7408
|
} | {
|
|
7256
7409
|
type: "app";
|
|
7257
7410
|
url: z.core.$InferOuterFunctionType<z.ZodTuple<readonly [], null>, z.ZodPromise<z.ZodURL>>;
|
|
@@ -7265,6 +7418,26 @@ declare const contentSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
7265
7418
|
imageSubtitle: z.ZodOptional<z.ZodString>;
|
|
7266
7419
|
summary: z.ZodOptional<z.ZodString>;
|
|
7267
7420
|
}, z.core.$strip>>>;
|
|
7421
|
+
} | {
|
|
7422
|
+
type: "poll";
|
|
7423
|
+
title: string;
|
|
7424
|
+
options: {
|
|
7425
|
+
title: string;
|
|
7426
|
+
}[];
|
|
7427
|
+
} | {
|
|
7428
|
+
type: "poll_option";
|
|
7429
|
+
option: {
|
|
7430
|
+
title: string;
|
|
7431
|
+
};
|
|
7432
|
+
poll: {
|
|
7433
|
+
type: "poll";
|
|
7434
|
+
title: string;
|
|
7435
|
+
options: {
|
|
7436
|
+
title: string;
|
|
7437
|
+
}[];
|
|
7438
|
+
};
|
|
7439
|
+
selected: boolean;
|
|
7440
|
+
title: string;
|
|
7268
7441
|
} | {
|
|
7269
7442
|
type: "effect";
|
|
7270
7443
|
content: {
|
|
@@ -7355,36 +7528,20 @@ declare const contentSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
7355
7528
|
read: z.core.$InferOuterFunctionType<z.ZodTuple<readonly [], null>, z.ZodPromise<z.ZodCustom<Buffer<ArrayBufferLike>, Buffer<ArrayBufferLike>>>>;
|
|
7356
7529
|
} | undefined;
|
|
7357
7530
|
raw?: unknown;
|
|
7358
|
-
} | {
|
|
7359
|
-
type: "custom";
|
|
7360
|
-
raw: unknown;
|
|
7361
|
-
} | {
|
|
7362
|
-
type: "poll";
|
|
7363
|
-
title: string;
|
|
7364
|
-
options: {
|
|
7365
|
-
title: string;
|
|
7366
|
-
}[];
|
|
7367
|
-
} | {
|
|
7368
|
-
type: "poll_option";
|
|
7369
|
-
option: {
|
|
7370
|
-
title: string;
|
|
7371
|
-
};
|
|
7372
|
-
poll: {
|
|
7373
|
-
type: "poll";
|
|
7374
|
-
title: string;
|
|
7375
|
-
options: {
|
|
7376
|
-
title: string;
|
|
7377
|
-
}[];
|
|
7378
|
-
};
|
|
7379
|
-
selected: boolean;
|
|
7380
|
-
title: string;
|
|
7381
7531
|
} | {
|
|
7382
7532
|
type: "group";
|
|
7383
7533
|
items: Message<string, User, Space<unknown>>[];
|
|
7534
|
+
} | {
|
|
7535
|
+
type: "custom";
|
|
7536
|
+
raw: unknown;
|
|
7384
7537
|
} | {
|
|
7385
7538
|
type: "reaction";
|
|
7386
7539
|
emoji: string;
|
|
7387
7540
|
target: Message<string, User, Space<unknown>>;
|
|
7541
|
+
} | {
|
|
7542
|
+
type: "streamText";
|
|
7543
|
+
stream: () => AsyncIterable<string>;
|
|
7544
|
+
format?: "markdown" | "plain" | undefined;
|
|
7388
7545
|
} | {
|
|
7389
7546
|
type: "voice";
|
|
7390
7547
|
mimeType: string;
|
|
@@ -7396,10 +7553,6 @@ declare const contentSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
7396
7553
|
} | {
|
|
7397
7554
|
type: "richlink";
|
|
7398
7555
|
url: string;
|
|
7399
|
-
} | {
|
|
7400
|
-
type: "streamText";
|
|
7401
|
-
stream: () => AsyncIterable<string>;
|
|
7402
|
-
format?: "markdown" | "plain" | undefined;
|
|
7403
7556
|
} | {
|
|
7404
7557
|
type: "app";
|
|
7405
7558
|
url: z.core.$InferOuterFunctionType<z.ZodTuple<readonly [], null>, z.ZodPromise<z.ZodURL>>;
|
|
@@ -7413,6 +7566,26 @@ declare const contentSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
7413
7566
|
imageSubtitle: z.ZodOptional<z.ZodString>;
|
|
7414
7567
|
summary: z.ZodOptional<z.ZodString>;
|
|
7415
7568
|
}, z.core.$strip>>>;
|
|
7569
|
+
} | {
|
|
7570
|
+
type: "poll";
|
|
7571
|
+
title: string;
|
|
7572
|
+
options: {
|
|
7573
|
+
title: string;
|
|
7574
|
+
}[];
|
|
7575
|
+
} | {
|
|
7576
|
+
type: "poll_option";
|
|
7577
|
+
option: {
|
|
7578
|
+
title: string;
|
|
7579
|
+
};
|
|
7580
|
+
poll: {
|
|
7581
|
+
type: "poll";
|
|
7582
|
+
title: string;
|
|
7583
|
+
options: {
|
|
7584
|
+
title: string;
|
|
7585
|
+
}[];
|
|
7586
|
+
};
|
|
7587
|
+
selected: boolean;
|
|
7588
|
+
title: string;
|
|
7416
7589
|
} | {
|
|
7417
7590
|
type: "effect";
|
|
7418
7591
|
content: {
|
|
@@ -7487,4 +7660,4 @@ declare function attachment(input: AttachmentInput, options?: {
|
|
|
7487
7660
|
name?: string;
|
|
7488
7661
|
}): ContentBuilder;
|
|
7489
7662
|
//#endregion
|
|
7490
|
-
export { FusorTokenData as $,
|
|
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 };
|
package/dist/authoring.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $t as
|
|
1
|
+
import { $t as asGroup, An as photoActionSchema, Ft as asRead, H as ProviderMessageRecord, Ht as asPollOption, K as ManagedStream, Kt as asMarkdown, On as PhotoInput, St as asText, Tt as asRichlink, Vt as asPoll, cn as asReaction, dn as asCustom, gt as asVoice, jt as replySchema, kn as buildPhotoAction, kt as asReply, r as asAttachment, tn as groupSchema, un as reactionSchema, xn as asContact } from "./attachment-DySo210v.js";
|
|
2
2
|
import z from "zod";
|
|
3
3
|
import { FetchSpanOptions, LogAttrs, LogAttrs as LogAttrs$1, LogLevel, PhotonLogger, SanitizeUrlOptions, createLogger, sanitizeEmail, sanitizeErrorMessage, sanitizePhone, sanitizeUrl, setLogLevel } from "@photon-ai/otel";
|
|
4
4
|
import { Token } from "marked";
|
|
@@ -123,4 +123,4 @@ declare const resumableOrderedStream: <TLive, TMissed, TOutput>(options: Resumab
|
|
|
123
123
|
*/
|
|
124
124
|
declare function errorAttrs(error: unknown, prefix?: string): LogAttrs$1;
|
|
125
125
|
//#endregion
|
|
126
|
-
export { type CloseableAsyncIterable, type LogAttrs, type LogLevel, type PhotoInput, type PhotonLogger, type ProviderMessageRecord, type ResumableStreamItem, type SanitizeUrlOptions, asAttachment, asContact, asCustom, asGroup, asMarkdown, asPoll, asPollOption, asReaction, asRead, asRichlink, asText, asVoice, buildPhotoAction, createLogger, ensureM4a, errorAttrs, groupSchema, messageEffectSchema, photoActionSchema, reactionSchema, renderInlineTokens, resumableOrderedStream, sanitizeEmail, sanitizeErrorMessage, sanitizePhone, sanitizeUrl, setLogLevel, tracedFetch };
|
|
126
|
+
export { type CloseableAsyncIterable, type LogAttrs, type LogLevel, type PhotoInput, type PhotonLogger, type ProviderMessageRecord, type ResumableStreamItem, type SanitizeUrlOptions, asAttachment, asContact, asCustom, asGroup, asMarkdown, asPoll, asPollOption, asReaction, asRead, asReply, asRichlink, asText, asVoice, buildPhotoAction, createLogger, ensureM4a, errorAttrs, groupSchema, messageEffectSchema, photoActionSchema, reactionSchema, renderInlineTokens, replySchema, resumableOrderedStream, sanitizeEmail, sanitizeErrorMessage, sanitizePhone, sanitizeUrl, setLogLevel, tracedFetch };
|
package/dist/authoring.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { A as asGroup, C as asPoll, D as asMarkdown, G as buildPhotoAction, I as textSchema, K as photoActionSchema, M as groupSchema, P as asText, S as reactionSchema, V as asContact, Y as attachmentSchema, Z as tracedFetch, _ as replySchema, b as asReaction, d as asVoice, h as asReply, i as stream, k as markdownSchema, l as renderInlineTokens, o as errorAttrs, p as asRichlink, q as asAttachment, v as asRead, w as asPollOption, z as asCustom } from "./stream-DAbdViJ9.js";
|
|
2
2
|
import z from "zod";
|
|
3
3
|
import { createLogger, createLogger as createLogger$1, sanitizeEmail, sanitizeErrorMessage, sanitizePhone, sanitizeUrl, setLogLevel } from "@photon-ai/otel";
|
|
4
4
|
import { mkdtemp, readFile, rm, writeFile } from "node:fs/promises";
|
|
@@ -422,4 +422,4 @@ const resumableOrderedStream = (options) => stream((emit, end) => {
|
|
|
422
422
|
};
|
|
423
423
|
});
|
|
424
424
|
//#endregion
|
|
425
|
-
export { asAttachment, asContact, asCustom, asGroup, asMarkdown, asPoll, asPollOption, asReaction, asRead, asRichlink, asText, asVoice, buildPhotoAction, createLogger, ensureM4a, errorAttrs, groupSchema, messageEffectSchema, photoActionSchema, reactionSchema, renderInlineTokens, resumableOrderedStream, sanitizeEmail, sanitizeErrorMessage, sanitizePhone, sanitizeUrl, setLogLevel, tracedFetch };
|
|
425
|
+
export { asAttachment, asContact, asCustom, asGroup, asMarkdown, asPoll, asPollOption, asReaction, asRead, asReply, asRichlink, asText, asVoice, buildPhotoAction, createLogger, ensureM4a, errorAttrs, groupSchema, messageEffectSchema, photoActionSchema, reactionSchema, renderInlineTokens, replySchema, resumableOrderedStream, sanitizeEmail, sanitizeErrorMessage, sanitizePhone, sanitizeUrl, setLogLevel, tracedFetch };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { $ as FusorTokenData, A as isFusorEvent,
|
|
1
|
+
import { $ as FusorTokenData, A as isFusorEvent, At as reply, B as PlatformUser, Bt as PollOption, C as FusorVerify, Cn as AgentSender, Ct as text, D as WebhookRawResult, Dn as avatar, Dt as resolveContents, E as WebhookRawRequest, En as AvatarInput, Et as richlink, F as PlatformInstance, Fn as appLayoutSchema, G as Broadcaster, Gt as Markdown, I as PlatformMessage, It as read, J as mergeStreams, Jt as DeltaExtractor, K as ManagedStream, L as PlatformProviderConfig, Lt as Poll, M as EventProducer, Mn as AppLayout, Mt as Rename, N as Platform, Nn as AppUrl, Nt as rename, O as FusorEvent, Ot as Reply, P as PlatformDef, Pn as app, Pt as Read, Q as DedicatedTokenData, Qt as Group, R as PlatformRuntime, Rt as PollChoice, S as FusorRespond, Sn as contact, T as WebhookHandler, Tn as Avatar, U as SchemaMessage, Ut as option, V as ProviderMessage, W as SpaceNamespace, Wt as poll, X as Store, Xt as StreamTextSource, Y as stream, Yt as StreamText, Z as CloudPlatform, Zt as TextStreamOptions, _ as FusorClient, _n as ContactInput, _t as voice, a as Content, an as Space, at as SharedTokenData, b as FusorMessagesReturn, bn as ContactPhone, bt as Typing, c as fromVCard, ct as SpectrumCloudError, d as UnsupportedKind, dt as TokenData, en as group, et as ImessageInfoData, f as Spectrum, fn as custom, ft as cloud, g as isFusorClient, gn as ContactEmail, h as fusor, hn as ContactDetails, ht as Voice, i as attachment, in as Message, it as ProjectProfile, j as AnyPlatformDef, jn as App, k as fusorEvent, l as toVCard, ln as reaction, lt as SubscriptionData, m as definePlatform, mn as ContactAddress, mt as EmojiKey, n as AttachmentInput, nn as Edit, nt as PlatformsData, o as ContentBuilder, on as Reaction, ot as SlackTeamMeta, p as SpectrumInstance, pn as Contact, pt as Emoji, q as broadcast, qt as markdown, rn as edit, rt as ProjectData, s as ContentInput, sn as ReactionBuilder, st as SlackTokenData, t as Attachment, tt as PlatformStatus, u as UnsupportedError, ut as SubscriptionStatus, v as FusorMessages, vn as ContactName, vt as Unsend, w as FusorVerifyRequest, wn as User, wt as Richlink, x as FusorReply, xt as typing, y as FusorMessagesCtx, yn as ContactOrg, yt as unsend, z as PlatformSpace, zt as PollChoiceInput } from "./attachment-DySo210v.js";
|
|
2
2
|
export { type AgentSender, type AnyPlatformDef, type App, type AppLayout, type AppUrl, type Attachment, type AttachmentInput, type Avatar, type AvatarInput, type Broadcaster, type CloudPlatform, type Contact, type ContactAddress, type ContactDetails, type ContactEmail, type ContactInput, type ContactName, type ContactOrg, type ContactPhone, type Content, type ContentBuilder, type ContentInput, type DedicatedTokenData, type DeltaExtractor, type Edit, Emoji, type EmojiKey, type EventProducer, type FusorClient, type FusorEvent, type FusorMessages, type FusorMessagesCtx, type FusorMessagesReturn, type FusorReply, type FusorRespond, type FusorTokenData, type FusorVerify, type FusorVerifyRequest, type Group, type ImessageInfoData, type ManagedStream, type Markdown, type Message, type Platform, type PlatformDef, type PlatformInstance, type PlatformMessage, type PlatformProviderConfig, type PlatformRuntime, type PlatformSpace, type PlatformStatus, type PlatformUser, type PlatformsData, type Poll, type PollChoice, type PollChoiceInput, type PollOption, type ProjectData, type ProjectProfile, type ProviderMessage, type Reaction, type ReactionBuilder, type Read, type Rename, type Reply, type Richlink, type SchemaMessage, type SharedTokenData, type SlackTeamMeta, type SlackTokenData, type Space, type SpaceNamespace, Spectrum, SpectrumCloudError, type SpectrumInstance, type Store, type StreamText, type StreamTextSource, type SubscriptionData, type SubscriptionStatus, type TextStreamOptions, type TokenData, type Typing, type Unsend, UnsupportedError, type UnsupportedKind, type User, type Voice, type WebhookHandler, type WebhookRawRequest, type WebhookRawResult, app, appLayoutSchema, attachment, avatar, broadcast, cloud, contact, custom, definePlatform, edit, fromVCard, fusor, fusorEvent, group, isFusorClient, isFusorEvent, markdown, mergeStreams, option, poll, reaction, read, rename, reply, resolveContents, richlink, stream, text, toVCard, typing, unsend, voice };
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { B as custom, D as asMarkdown, E as poll, F as text, G as buildPhotoAction, H as contact, J as attachment, K as photoActionSchema, L as StreamConsumedError, N as resolveContents, O as markdown, P as asText, R as drainStreamText, T as option, U as fromVCard, V as asContact, W as toVCard, X as fetchUrlBytes, Z as tracedFetch, a as contentAttrs, c as markdownToPlainText, f as voice, g as reply, i as stream, j as group, m as richlink, n as createAsyncQueue, o as errorAttrs, q as asAttachment, r as mergeStreams, s as senderAttrs, t as broadcast, u as classifyIdentifier, x as reaction, y as read, z as asCustom } from "./stream-DAbdViJ9.js";
|
|
2
2
|
import z from "zod";
|
|
3
3
|
import ogs from "open-graph-scraper";
|
|
4
4
|
import { createLogger, setLogLevel, setupOtel, withSpan } from "@photon-ai/otel";
|
|
@@ -186,8 +186,8 @@ function avatar(input, options) {
|
|
|
186
186
|
}
|
|
187
187
|
//#endregion
|
|
188
188
|
//#region src/content/edit.ts
|
|
189
|
-
const isMessage$
|
|
190
|
-
const isContent
|
|
189
|
+
const isMessage$1 = (v) => typeof v === "object" && v !== null && "id" in v && "content" in v;
|
|
190
|
+
const isContent = (v) => typeof v === "object" && v !== null && "type" in v && typeof v.type === "string";
|
|
191
191
|
/**
|
|
192
192
|
* An `edit` rewrites the content of a previously-sent outbound message.
|
|
193
193
|
*
|
|
@@ -202,8 +202,8 @@ const isContent$1 = (v) => typeof v === "object" && v !== null && "type" in v &&
|
|
|
202
202
|
*/
|
|
203
203
|
const editSchema = z.object({
|
|
204
204
|
type: z.literal("edit"),
|
|
205
|
-
content: z.custom(isContent
|
|
206
|
-
target: z.custom(isMessage$
|
|
205
|
+
content: z.custom(isContent, { message: "edit content must be a Content value" }),
|
|
206
|
+
target: z.custom(isMessage$1, { message: "edit target must be a Message" })
|
|
207
207
|
});
|
|
208
208
|
const asEdit = (input) => editSchema.parse({
|
|
209
209
|
type: "edit",
|
|
@@ -255,41 +255,6 @@ function rename(displayName) {
|
|
|
255
255
|
}) };
|
|
256
256
|
}
|
|
257
257
|
//#endregion
|
|
258
|
-
//#region src/content/reply.ts
|
|
259
|
-
const isMessage$1 = (v) => typeof v === "object" && v !== null && "id" in v && "content" in v;
|
|
260
|
-
const isContent = (v) => typeof v === "object" && v !== null && "type" in v && typeof v.type === "string";
|
|
261
|
-
/**
|
|
262
|
-
* A `reply` wraps inner content with the message it replies to.
|
|
263
|
-
*
|
|
264
|
-
* `space.send(reply(content, message))` is the canonical outbound API;
|
|
265
|
-
* `message.reply(content)` is sugar that delegates here. Providers see
|
|
266
|
-
* `reply` like any other content type and route to a threaded send.
|
|
267
|
-
*
|
|
268
|
-
* Reply cannot wrap `reply`, `edit`, `reaction`, `group`, `typing`,
|
|
269
|
-
* `rename`, `avatar`, `unsend`, or `read` content.
|
|
270
|
-
*/
|
|
271
|
-
const replySchema = z.object({
|
|
272
|
-
type: z.literal("reply"),
|
|
273
|
-
content: z.custom(isContent, { message: "reply content must be a Content value" }),
|
|
274
|
-
target: z.custom(isMessage$1, { message: "reply target must be a Message" })
|
|
275
|
-
});
|
|
276
|
-
const asReply = (input) => replySchema.parse({
|
|
277
|
-
type: "reply",
|
|
278
|
-
...input
|
|
279
|
-
});
|
|
280
|
-
function reply(content, target) {
|
|
281
|
-
return { build: async () => {
|
|
282
|
-
if (!target) throw new Error("reply() target is undefined — the targeted message was never sent (space.send resolves undefined when a platform skips unsupported content)");
|
|
283
|
-
const [resolved] = await resolveContents([content]);
|
|
284
|
-
if (!resolved) throw new Error("reply() requires content");
|
|
285
|
-
if (resolved.type === "reply" || resolved.type === "edit" || resolved.type === "reaction" || resolved.type === "group" || resolved.type === "typing" || resolved.type === "rename" || resolved.type === "avatar" || resolved.type === "unsend" || resolved.type === "read") throw new Error(`reply() cannot wrap "${resolved.type}" content`);
|
|
286
|
-
return asReply({
|
|
287
|
-
content: resolved,
|
|
288
|
-
target
|
|
289
|
-
});
|
|
290
|
-
} };
|
|
291
|
-
}
|
|
292
|
-
//#endregion
|
|
293
258
|
//#region src/content/typing.ts
|
|
294
259
|
/**
|
|
295
260
|
* A `typing` content value carries a typing-indicator signal — either
|
|
@@ -2572,8 +2537,8 @@ const rawDirection = (raw) => raw.direction === "inbound" || raw.direction === "
|
|
|
2572
2537
|
* record can carry its own `direction` when the provider knows better than the
|
|
2573
2538
|
* wrapping context, which matters for inbound reactions targeting outbound
|
|
2574
2539
|
* messages.
|
|
2575
|
-
* Recursion through `wrapNestedContent` handles reaction targets and
|
|
2576
|
-
* items, which providers return as nested raw records.
|
|
2540
|
+
* Recursion through `wrapNestedContent` handles reaction/reply targets and
|
|
2541
|
+
* group items, which providers return as nested raw records.
|
|
2577
2542
|
*/
|
|
2578
2543
|
function wrapProviderMessage(raw, ctx, direction) {
|
|
2579
2544
|
const effectiveDirection = rawDirection(raw) ?? direction;
|
|
@@ -2610,6 +2575,19 @@ const wrapNestedContent = (content, ctx, direction) => {
|
|
|
2610
2575
|
};
|
|
2611
2576
|
return content;
|
|
2612
2577
|
}
|
|
2578
|
+
if (content.type === "reply") {
|
|
2579
|
+
const wrappedInner = wrapNestedContent(content.content, ctx, direction);
|
|
2580
|
+
const target = content.target;
|
|
2581
|
+
if (isRawProviderRecord(target)) return {
|
|
2582
|
+
...content,
|
|
2583
|
+
content: wrappedInner,
|
|
2584
|
+
target: wrapProviderMessage(target, ctx, "inbound")
|
|
2585
|
+
};
|
|
2586
|
+
return {
|
|
2587
|
+
...content,
|
|
2588
|
+
content: wrappedInner
|
|
2589
|
+
};
|
|
2590
|
+
}
|
|
2613
2591
|
if (content.type === "edit") {
|
|
2614
2592
|
const target = content.target;
|
|
2615
2593
|
if (isRawProviderRecord(target)) return {
|
|
@@ -3042,7 +3020,7 @@ function definePlatform(name, rawDef) {
|
|
|
3042
3020
|
}
|
|
3043
3021
|
//#endregion
|
|
3044
3022
|
//#region src/build-env.ts
|
|
3045
|
-
const SPECTRUM_SDK_VERSION = "8.
|
|
3023
|
+
const SPECTRUM_SDK_VERSION = "8.2.1";
|
|
3046
3024
|
//#endregion
|
|
3047
3025
|
//#region src/utils/provider-packages.ts
|
|
3048
3026
|
const OFFICIAL_PROVIDER_PACKAGES = {
|
|
@@ -3756,9 +3734,9 @@ const asOptionalDate = (value) => typeof value === "string" ? new Date(value) :
|
|
|
3756
3734
|
* message with no resolvable platform) — the caller acknowledges it (200)
|
|
3757
3735
|
* rather than failing, since neither is fixed by a retry.
|
|
3758
3736
|
*
|
|
3759
|
-
* Reaction targets and group items are emitted as **raw nested records**;
|
|
3760
|
-
* `wrapProviderMessage`/`wrapNestedContent` pipeline turns them into
|
|
3761
|
-
* Messages, exactly as a provider's own `messages` handler would.
|
|
3737
|
+
* Reaction/reply targets and group items are emitted as **raw nested records**;
|
|
3738
|
+
* the `wrapProviderMessage`/`wrapNestedContent` pipeline turns them into
|
|
3739
|
+
* fully-built Messages, exactly as a provider's own `messages` handler would.
|
|
3762
3740
|
*/
|
|
3763
3741
|
function deserializeSpectrumMessage(envelope, ctx) {
|
|
3764
3742
|
if (envelope.event !== MESSAGES_EVENT) return null;
|
|
@@ -3799,6 +3777,7 @@ const mapContent = (content, platform, spaceRef, ctx) => {
|
|
|
3799
3777
|
};
|
|
3800
3778
|
case "contact": return deserializeContact(raw);
|
|
3801
3779
|
case "reaction": return deserializeReaction(raw, spaceRef);
|
|
3780
|
+
case "reply": return deserializeReply(raw, platform, spaceRef, ctx);
|
|
3802
3781
|
case "group": return deserializeGroup(raw, platform, spaceRef, ctx);
|
|
3803
3782
|
case "attachment": return deserializeAttachment(raw, platform, spaceRef, ctx);
|
|
3804
3783
|
default: return asCustom(content);
|
|
@@ -3822,6 +3801,11 @@ const deserializeReaction = (raw, spaceRef) => ({
|
|
|
3822
3801
|
emoji: asString(raw.emoji),
|
|
3823
3802
|
target: buildTargetRecord(raw.target, spaceRef)
|
|
3824
3803
|
});
|
|
3804
|
+
const deserializeReply = (raw, platform, spaceRef, ctx) => ({
|
|
3805
|
+
type: "reply",
|
|
3806
|
+
content: isRecord(raw.content) ? deserializeContent(raw.content, platform, spaceRef, ctx) : asCustom(raw.content),
|
|
3807
|
+
target: buildTargetRecord(raw.target, spaceRef)
|
|
3808
|
+
});
|
|
3825
3809
|
const buildTargetRecord = (target, spaceRef) => {
|
|
3826
3810
|
const ref = isRecord(target) ? target : {};
|
|
3827
3811
|
return {
|
|
@@ -701,7 +701,7 @@ function text(source, options) {
|
|
|
701
701
|
const resolveContents = (items) => Promise.all(items.map((c) => typeof c === "string" ? text(c).build() : c.build()));
|
|
702
702
|
//#endregion
|
|
703
703
|
//#region src/content/group.ts
|
|
704
|
-
const isMessage$
|
|
704
|
+
const isMessage$3 = (v) => typeof v === "object" && v !== null && "id" in v && "content" in v;
|
|
705
705
|
/**
|
|
706
706
|
* A `group` bundles multiple messages into one logical unit (e.g. an album
|
|
707
707
|
* of images sent together). Each item is a full `Message` — addressable by
|
|
@@ -713,7 +713,7 @@ const isMessage$2 = (v) => typeof v === "object" && v !== null && "id" in v && "
|
|
|
713
713
|
*/
|
|
714
714
|
const groupSchema = z.object({
|
|
715
715
|
type: z.literal("group"),
|
|
716
|
-
items: z.array(z.custom(isMessage$
|
|
716
|
+
items: z.array(z.custom(isMessage$3)).min(2)
|
|
717
717
|
});
|
|
718
718
|
const asGroup = (input) => groupSchema.parse({
|
|
719
719
|
type: "group",
|
|
@@ -807,11 +807,11 @@ function poll(title, ...rest) {
|
|
|
807
807
|
}
|
|
808
808
|
//#endregion
|
|
809
809
|
//#region src/content/reaction.ts
|
|
810
|
-
const isMessage$
|
|
810
|
+
const isMessage$2 = (v) => typeof v === "object" && v !== null && "id" in v && "content" in v;
|
|
811
811
|
const reactionSchema = z.object({
|
|
812
812
|
type: z.literal("reaction"),
|
|
813
813
|
emoji: z.string().min(1),
|
|
814
|
-
target: z.custom(isMessage$
|
|
814
|
+
target: z.custom(isMessage$2, { message: "reaction target must be a Message" })
|
|
815
815
|
});
|
|
816
816
|
const asReaction = (input) => reactionSchema.parse({
|
|
817
817
|
type: "reaction",
|
|
@@ -845,7 +845,7 @@ function reaction(emoji, target) {
|
|
|
845
845
|
}
|
|
846
846
|
//#endregion
|
|
847
847
|
//#region src/content/read.ts
|
|
848
|
-
const isMessage = (v) => typeof v === "object" && v !== null && "id" in v && "content" in v;
|
|
848
|
+
const isMessage$1 = (v) => typeof v === "object" && v !== null && "id" in v && "content" in v;
|
|
849
849
|
/**
|
|
850
850
|
* A `read` marks the conversation as read **up to** `target`, surfacing a
|
|
851
851
|
* read receipt to the sender where the platform supports one.
|
|
@@ -868,7 +868,7 @@ const isMessage = (v) => typeof v === "object" && v !== null && "id" in v && "co
|
|
|
868
868
|
*/
|
|
869
869
|
const readSchema = z.object({
|
|
870
870
|
type: z.literal("read"),
|
|
871
|
-
target: z.custom(isMessage, { message: "read target must be a Message" })
|
|
871
|
+
target: z.custom(isMessage$1, { message: "read target must be a Message" })
|
|
872
872
|
});
|
|
873
873
|
const asRead = (input) => readSchema.parse({
|
|
874
874
|
type: "read",
|
|
@@ -891,6 +891,41 @@ function read(target) {
|
|
|
891
891
|
} };
|
|
892
892
|
}
|
|
893
893
|
//#endregion
|
|
894
|
+
//#region src/content/reply.ts
|
|
895
|
+
const isMessage = (v) => typeof v === "object" && v !== null && "id" in v && "content" in v;
|
|
896
|
+
const isContent = (v) => typeof v === "object" && v !== null && "type" in v && typeof v.type === "string";
|
|
897
|
+
/**
|
|
898
|
+
* A `reply` wraps inner content with the message it replies to.
|
|
899
|
+
*
|
|
900
|
+
* `space.send(reply(content, message))` is the canonical outbound API;
|
|
901
|
+
* `message.reply(content)` is sugar that delegates here. Providers see
|
|
902
|
+
* `reply` like any other content type and route to a threaded send.
|
|
903
|
+
*
|
|
904
|
+
* Reply cannot wrap `reply`, `edit`, `reaction`, `group`, `typing`,
|
|
905
|
+
* `rename`, `avatar`, `unsend`, or `read` content.
|
|
906
|
+
*/
|
|
907
|
+
const replySchema = z.object({
|
|
908
|
+
type: z.literal("reply"),
|
|
909
|
+
content: z.custom(isContent, { message: "reply content must be a Content value" }),
|
|
910
|
+
target: z.custom(isMessage, { message: "reply target must be a Message" })
|
|
911
|
+
});
|
|
912
|
+
const asReply = (input) => replySchema.parse({
|
|
913
|
+
type: "reply",
|
|
914
|
+
...input
|
|
915
|
+
});
|
|
916
|
+
function reply(content, target) {
|
|
917
|
+
return { build: async () => {
|
|
918
|
+
if (!target) throw new Error("reply() target is undefined — the targeted message was never sent (space.send resolves undefined when a platform skips unsupported content)");
|
|
919
|
+
const [resolved] = await resolveContents([content]);
|
|
920
|
+
if (!resolved) throw new Error("reply() requires content");
|
|
921
|
+
if (resolved.type === "reply" || resolved.type === "edit" || resolved.type === "reaction" || resolved.type === "group" || resolved.type === "typing" || resolved.type === "rename" || resolved.type === "avatar" || resolved.type === "unsend" || resolved.type === "read") throw new Error(`reply() cannot wrap "${resolved.type}" content`);
|
|
922
|
+
return asReply({
|
|
923
|
+
content: resolved,
|
|
924
|
+
target
|
|
925
|
+
});
|
|
926
|
+
} };
|
|
927
|
+
}
|
|
928
|
+
//#endregion
|
|
894
929
|
//#region src/content/richlink.ts
|
|
895
930
|
/**
|
|
896
931
|
* A URL the platform should render as a rich link preview.
|
|
@@ -1419,4 +1454,4 @@ function broadcast(source) {
|
|
|
1419
1454
|
};
|
|
1420
1455
|
}
|
|
1421
1456
|
//#endregion
|
|
1422
|
-
export {
|
|
1457
|
+
export { asGroup as A, custom as B, asPoll as C, asMarkdown as D, poll as E, text as F, buildPhotoAction as G, contact as H, textSchema as I, attachment as J, photoActionSchema as K, StreamConsumedError as L, groupSchema as M, resolveContents as N, markdown as O, asText as P, drainStreamText as R, reactionSchema as S, option as T, fromVCard as U, asContact as V, toVCard as W, fetchUrlBytes as X, attachmentSchema as Y, tracedFetch as Z, replySchema as _, contentAttrs as a, asReaction as b, markdownToPlainText as c, asVoice as d, voice as f, reply as g, asReply as h, stream as i, group as j, markdownSchema as k, renderInlineTokens as l, richlink as m, createAsyncQueue as n, errorAttrs as o, asRichlink as p, asAttachment as q, mergeStreams as r, senderAttrs as s, broadcast as t, classifyIdentifier as u, asRead as v, asPollOption as w, reaction as x, read as y, asCustom as z };
|