@spectrum-ts/core 11.0.0 → 11.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.
|
@@ -592,6 +592,14 @@ interface Message<TPlatform extends string = string, TSender extends User = User
|
|
|
592
592
|
declare const editSchema: z.ZodObject<{
|
|
593
593
|
type: z.ZodLiteral<"edit">;
|
|
594
594
|
content: z.ZodCustom<{
|
|
595
|
+
type: "attachment";
|
|
596
|
+
id: string;
|
|
597
|
+
name: string;
|
|
598
|
+
mimeType: string;
|
|
599
|
+
read: z.core.$InferOuterFunctionType<z.ZodTuple<readonly [], null>, z.ZodPromise<z.ZodCustom<Buffer<ArrayBufferLike>, Buffer<ArrayBufferLike>>>>;
|
|
600
|
+
stream: z.core.$InferOuterFunctionType<z.ZodTuple<readonly [], null>, z.ZodPromise<z.ZodCustom<ReadableStream<unknown>, ReadableStream<unknown>>>>;
|
|
601
|
+
size?: number | undefined;
|
|
602
|
+
} | {
|
|
595
603
|
type: "contact";
|
|
596
604
|
user?: {
|
|
597
605
|
__platform: string;
|
|
@@ -635,13 +643,21 @@ declare const editSchema: z.ZodObject<{
|
|
|
635
643
|
} | undefined;
|
|
636
644
|
raw?: unknown;
|
|
637
645
|
} | {
|
|
638
|
-
type: "
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
646
|
+
type: "text";
|
|
647
|
+
text: string;
|
|
648
|
+
} | {
|
|
649
|
+
type: "markdown";
|
|
650
|
+
markdown: string;
|
|
651
|
+
} | {
|
|
652
|
+
type: "custom";
|
|
653
|
+
raw: unknown;
|
|
654
|
+
} | {
|
|
655
|
+
type: "group";
|
|
656
|
+
items: Message<string, User, Space<unknown>>[];
|
|
657
|
+
} | {
|
|
658
|
+
type: "reaction";
|
|
659
|
+
emoji: string;
|
|
660
|
+
target: Message<string, User, Space<unknown>>;
|
|
645
661
|
} | {
|
|
646
662
|
type: "poll";
|
|
647
663
|
title: string;
|
|
@@ -662,18 +678,6 @@ declare const editSchema: z.ZodObject<{
|
|
|
662
678
|
};
|
|
663
679
|
selected: boolean;
|
|
664
680
|
title: string;
|
|
665
|
-
} | {
|
|
666
|
-
type: "custom";
|
|
667
|
-
raw: unknown;
|
|
668
|
-
} | {
|
|
669
|
-
type: "text";
|
|
670
|
-
text: string;
|
|
671
|
-
} | {
|
|
672
|
-
type: "markdown";
|
|
673
|
-
markdown: string;
|
|
674
|
-
} | {
|
|
675
|
-
type: "group";
|
|
676
|
-
items: Message<string, User, Space<unknown>>[];
|
|
677
681
|
} | {
|
|
678
682
|
type: "streamText";
|
|
679
683
|
stream: () => AsyncIterable<string>;
|
|
@@ -703,10 +707,6 @@ declare const editSchema: z.ZodObject<{
|
|
|
703
707
|
summary: z.ZodOptional<z.ZodString>;
|
|
704
708
|
}, z.core.$strip>>>;
|
|
705
709
|
live?: boolean | undefined;
|
|
706
|
-
} | {
|
|
707
|
-
type: "reaction";
|
|
708
|
-
emoji: string;
|
|
709
|
-
target: Message<string, User, Space<unknown>>;
|
|
710
710
|
} | {
|
|
711
711
|
type: "effect";
|
|
712
712
|
content: {
|
|
@@ -749,6 +749,14 @@ declare const editSchema: z.ZodObject<{
|
|
|
749
749
|
} | {
|
|
750
750
|
type: "leaveSpace";
|
|
751
751
|
}, {
|
|
752
|
+
type: "attachment";
|
|
753
|
+
id: string;
|
|
754
|
+
name: string;
|
|
755
|
+
mimeType: string;
|
|
756
|
+
read: z.core.$InferOuterFunctionType<z.ZodTuple<readonly [], null>, z.ZodPromise<z.ZodCustom<Buffer<ArrayBufferLike>, Buffer<ArrayBufferLike>>>>;
|
|
757
|
+
stream: z.core.$InferOuterFunctionType<z.ZodTuple<readonly [], null>, z.ZodPromise<z.ZodCustom<ReadableStream<unknown>, ReadableStream<unknown>>>>;
|
|
758
|
+
size?: number | undefined;
|
|
759
|
+
} | {
|
|
752
760
|
type: "contact";
|
|
753
761
|
user?: {
|
|
754
762
|
__platform: string;
|
|
@@ -792,13 +800,21 @@ declare const editSchema: z.ZodObject<{
|
|
|
792
800
|
} | undefined;
|
|
793
801
|
raw?: unknown;
|
|
794
802
|
} | {
|
|
795
|
-
type: "
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
803
|
+
type: "text";
|
|
804
|
+
text: string;
|
|
805
|
+
} | {
|
|
806
|
+
type: "markdown";
|
|
807
|
+
markdown: string;
|
|
808
|
+
} | {
|
|
809
|
+
type: "custom";
|
|
810
|
+
raw: unknown;
|
|
811
|
+
} | {
|
|
812
|
+
type: "group";
|
|
813
|
+
items: Message<string, User, Space<unknown>>[];
|
|
814
|
+
} | {
|
|
815
|
+
type: "reaction";
|
|
816
|
+
emoji: string;
|
|
817
|
+
target: Message<string, User, Space<unknown>>;
|
|
802
818
|
} | {
|
|
803
819
|
type: "poll";
|
|
804
820
|
title: string;
|
|
@@ -819,18 +835,6 @@ declare const editSchema: z.ZodObject<{
|
|
|
819
835
|
};
|
|
820
836
|
selected: boolean;
|
|
821
837
|
title: string;
|
|
822
|
-
} | {
|
|
823
|
-
type: "custom";
|
|
824
|
-
raw: unknown;
|
|
825
|
-
} | {
|
|
826
|
-
type: "text";
|
|
827
|
-
text: string;
|
|
828
|
-
} | {
|
|
829
|
-
type: "markdown";
|
|
830
|
-
markdown: string;
|
|
831
|
-
} | {
|
|
832
|
-
type: "group";
|
|
833
|
-
items: Message<string, User, Space<unknown>>[];
|
|
834
838
|
} | {
|
|
835
839
|
type: "streamText";
|
|
836
840
|
stream: () => AsyncIterable<string>;
|
|
@@ -860,10 +864,6 @@ declare const editSchema: z.ZodObject<{
|
|
|
860
864
|
summary: z.ZodOptional<z.ZodString>;
|
|
861
865
|
}, z.core.$strip>>>;
|
|
862
866
|
live?: boolean | undefined;
|
|
863
|
-
} | {
|
|
864
|
-
type: "reaction";
|
|
865
|
-
emoji: string;
|
|
866
|
-
target: Message<string, User, Space<unknown>>;
|
|
867
867
|
} | {
|
|
868
868
|
type: "effect";
|
|
869
869
|
content: {
|
|
@@ -1136,6 +1136,14 @@ declare function rename(displayName: string): ContentBuilder;
|
|
|
1136
1136
|
declare const replySchema: z.ZodObject<{
|
|
1137
1137
|
type: z.ZodLiteral<"reply">;
|
|
1138
1138
|
content: z.ZodCustom<{
|
|
1139
|
+
type: "attachment";
|
|
1140
|
+
id: string;
|
|
1141
|
+
name: string;
|
|
1142
|
+
mimeType: string;
|
|
1143
|
+
read: z.core.$InferOuterFunctionType<z.ZodTuple<readonly [], null>, z.ZodPromise<z.ZodCustom<Buffer<ArrayBufferLike>, Buffer<ArrayBufferLike>>>>;
|
|
1144
|
+
stream: z.core.$InferOuterFunctionType<z.ZodTuple<readonly [], null>, z.ZodPromise<z.ZodCustom<ReadableStream<unknown>, ReadableStream<unknown>>>>;
|
|
1145
|
+
size?: number | undefined;
|
|
1146
|
+
} | {
|
|
1139
1147
|
type: "contact";
|
|
1140
1148
|
user?: {
|
|
1141
1149
|
__platform: string;
|
|
@@ -1179,13 +1187,21 @@ declare const replySchema: z.ZodObject<{
|
|
|
1179
1187
|
} | undefined;
|
|
1180
1188
|
raw?: unknown;
|
|
1181
1189
|
} | {
|
|
1182
|
-
type: "
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1190
|
+
type: "text";
|
|
1191
|
+
text: string;
|
|
1192
|
+
} | {
|
|
1193
|
+
type: "markdown";
|
|
1194
|
+
markdown: string;
|
|
1195
|
+
} | {
|
|
1196
|
+
type: "custom";
|
|
1197
|
+
raw: unknown;
|
|
1198
|
+
} | {
|
|
1199
|
+
type: "group";
|
|
1200
|
+
items: Message<string, User, Space<unknown>>[];
|
|
1201
|
+
} | {
|
|
1202
|
+
type: "reaction";
|
|
1203
|
+
emoji: string;
|
|
1204
|
+
target: Message<string, User, Space<unknown>>;
|
|
1189
1205
|
} | {
|
|
1190
1206
|
type: "poll";
|
|
1191
1207
|
title: string;
|
|
@@ -1206,18 +1222,6 @@ declare const replySchema: z.ZodObject<{
|
|
|
1206
1222
|
};
|
|
1207
1223
|
selected: boolean;
|
|
1208
1224
|
title: string;
|
|
1209
|
-
} | {
|
|
1210
|
-
type: "custom";
|
|
1211
|
-
raw: unknown;
|
|
1212
|
-
} | {
|
|
1213
|
-
type: "text";
|
|
1214
|
-
text: string;
|
|
1215
|
-
} | {
|
|
1216
|
-
type: "markdown";
|
|
1217
|
-
markdown: string;
|
|
1218
|
-
} | {
|
|
1219
|
-
type: "group";
|
|
1220
|
-
items: Message<string, User, Space<unknown>>[];
|
|
1221
1225
|
} | {
|
|
1222
1226
|
type: "streamText";
|
|
1223
1227
|
stream: () => AsyncIterable<string>;
|
|
@@ -1247,10 +1251,6 @@ declare const replySchema: z.ZodObject<{
|
|
|
1247
1251
|
summary: z.ZodOptional<z.ZodString>;
|
|
1248
1252
|
}, z.core.$strip>>>;
|
|
1249
1253
|
live?: boolean | undefined;
|
|
1250
|
-
} | {
|
|
1251
|
-
type: "reaction";
|
|
1252
|
-
emoji: string;
|
|
1253
|
-
target: Message<string, User, Space<unknown>>;
|
|
1254
1254
|
} | {
|
|
1255
1255
|
type: "effect";
|
|
1256
1256
|
content: {
|
|
@@ -1293,6 +1293,14 @@ declare const replySchema: z.ZodObject<{
|
|
|
1293
1293
|
} | {
|
|
1294
1294
|
type: "leaveSpace";
|
|
1295
1295
|
}, {
|
|
1296
|
+
type: "attachment";
|
|
1297
|
+
id: string;
|
|
1298
|
+
name: string;
|
|
1299
|
+
mimeType: string;
|
|
1300
|
+
read: z.core.$InferOuterFunctionType<z.ZodTuple<readonly [], null>, z.ZodPromise<z.ZodCustom<Buffer<ArrayBufferLike>, Buffer<ArrayBufferLike>>>>;
|
|
1301
|
+
stream: z.core.$InferOuterFunctionType<z.ZodTuple<readonly [], null>, z.ZodPromise<z.ZodCustom<ReadableStream<unknown>, ReadableStream<unknown>>>>;
|
|
1302
|
+
size?: number | undefined;
|
|
1303
|
+
} | {
|
|
1296
1304
|
type: "contact";
|
|
1297
1305
|
user?: {
|
|
1298
1306
|
__platform: string;
|
|
@@ -1336,13 +1344,21 @@ declare const replySchema: z.ZodObject<{
|
|
|
1336
1344
|
} | undefined;
|
|
1337
1345
|
raw?: unknown;
|
|
1338
1346
|
} | {
|
|
1339
|
-
type: "
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
|
|
1347
|
+
type: "text";
|
|
1348
|
+
text: string;
|
|
1349
|
+
} | {
|
|
1350
|
+
type: "markdown";
|
|
1351
|
+
markdown: string;
|
|
1352
|
+
} | {
|
|
1353
|
+
type: "custom";
|
|
1354
|
+
raw: unknown;
|
|
1355
|
+
} | {
|
|
1356
|
+
type: "group";
|
|
1357
|
+
items: Message<string, User, Space<unknown>>[];
|
|
1358
|
+
} | {
|
|
1359
|
+
type: "reaction";
|
|
1360
|
+
emoji: string;
|
|
1361
|
+
target: Message<string, User, Space<unknown>>;
|
|
1346
1362
|
} | {
|
|
1347
1363
|
type: "poll";
|
|
1348
1364
|
title: string;
|
|
@@ -1363,18 +1379,6 @@ declare const replySchema: z.ZodObject<{
|
|
|
1363
1379
|
};
|
|
1364
1380
|
selected: boolean;
|
|
1365
1381
|
title: string;
|
|
1366
|
-
} | {
|
|
1367
|
-
type: "custom";
|
|
1368
|
-
raw: unknown;
|
|
1369
|
-
} | {
|
|
1370
|
-
type: "text";
|
|
1371
|
-
text: string;
|
|
1372
|
-
} | {
|
|
1373
|
-
type: "markdown";
|
|
1374
|
-
markdown: string;
|
|
1375
|
-
} | {
|
|
1376
|
-
type: "group";
|
|
1377
|
-
items: Message<string, User, Space<unknown>>[];
|
|
1378
1382
|
} | {
|
|
1379
1383
|
type: "streamText";
|
|
1380
1384
|
stream: () => AsyncIterable<string>;
|
|
@@ -1404,10 +1408,6 @@ declare const replySchema: z.ZodObject<{
|
|
|
1404
1408
|
summary: z.ZodOptional<z.ZodString>;
|
|
1405
1409
|
}, z.core.$strip>>>;
|
|
1406
1410
|
live?: boolean | undefined;
|
|
1407
|
-
} | {
|
|
1408
|
-
type: "reaction";
|
|
1409
|
-
emoji: string;
|
|
1410
|
-
target: Message<string, User, Space<unknown>>;
|
|
1411
1411
|
} | {
|
|
1412
1412
|
type: "effect";
|
|
1413
1413
|
content: {
|
|
@@ -1562,6 +1562,9 @@ declare const unsendSchema: z.ZodObject<{
|
|
|
1562
1562
|
target: z.ZodCustom<Message<string, User, Space<unknown>>, Message<string, User, Space<unknown>>>;
|
|
1563
1563
|
}, z.core.$strip>;
|
|
1564
1564
|
type Unsend = z.infer<typeof unsendSchema>;
|
|
1565
|
+
declare const asUnsend: (input: {
|
|
1566
|
+
target: Message;
|
|
1567
|
+
}) => Unsend;
|
|
1565
1568
|
/**
|
|
1566
1569
|
* Construct an `unsend` content value retracting `target`.
|
|
1567
1570
|
*
|
|
@@ -7278,6 +7281,14 @@ declare const contentSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
7278
7281
|
}, z.core.$strip>, z.ZodObject<{
|
|
7279
7282
|
type: z.ZodLiteral<"reply">;
|
|
7280
7283
|
content: z.ZodCustom<{
|
|
7284
|
+
type: "attachment";
|
|
7285
|
+
id: string;
|
|
7286
|
+
name: string;
|
|
7287
|
+
mimeType: string;
|
|
7288
|
+
read: z.core.$InferOuterFunctionType<z.ZodTuple<readonly [], null>, z.ZodPromise<z.ZodCustom<Buffer<ArrayBufferLike>, Buffer<ArrayBufferLike>>>>;
|
|
7289
|
+
stream: z.core.$InferOuterFunctionType<z.ZodTuple<readonly [], null>, z.ZodPromise<z.ZodCustom<ReadableStream<unknown>, ReadableStream<unknown>>>>;
|
|
7290
|
+
size?: number | undefined;
|
|
7291
|
+
} | {
|
|
7281
7292
|
type: "contact";
|
|
7282
7293
|
user?: {
|
|
7283
7294
|
__platform: string;
|
|
@@ -7321,13 +7332,21 @@ declare const contentSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
7321
7332
|
} | undefined;
|
|
7322
7333
|
raw?: unknown;
|
|
7323
7334
|
} | {
|
|
7324
|
-
type: "
|
|
7325
|
-
|
|
7326
|
-
|
|
7327
|
-
|
|
7328
|
-
|
|
7329
|
-
|
|
7330
|
-
|
|
7335
|
+
type: "text";
|
|
7336
|
+
text: string;
|
|
7337
|
+
} | {
|
|
7338
|
+
type: "markdown";
|
|
7339
|
+
markdown: string;
|
|
7340
|
+
} | {
|
|
7341
|
+
type: "custom";
|
|
7342
|
+
raw: unknown;
|
|
7343
|
+
} | {
|
|
7344
|
+
type: "group";
|
|
7345
|
+
items: Message<string, User, Space<unknown>>[];
|
|
7346
|
+
} | {
|
|
7347
|
+
type: "reaction";
|
|
7348
|
+
emoji: string;
|
|
7349
|
+
target: Message<string, User, Space<unknown>>;
|
|
7331
7350
|
} | {
|
|
7332
7351
|
type: "poll";
|
|
7333
7352
|
title: string;
|
|
@@ -7348,18 +7367,6 @@ declare const contentSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
7348
7367
|
};
|
|
7349
7368
|
selected: boolean;
|
|
7350
7369
|
title: string;
|
|
7351
|
-
} | {
|
|
7352
|
-
type: "custom";
|
|
7353
|
-
raw: unknown;
|
|
7354
|
-
} | {
|
|
7355
|
-
type: "text";
|
|
7356
|
-
text: string;
|
|
7357
|
-
} | {
|
|
7358
|
-
type: "markdown";
|
|
7359
|
-
markdown: string;
|
|
7360
|
-
} | {
|
|
7361
|
-
type: "group";
|
|
7362
|
-
items: Message<string, User, Space<unknown>>[];
|
|
7363
7370
|
} | {
|
|
7364
7371
|
type: "streamText";
|
|
7365
7372
|
stream: () => AsyncIterable<string>;
|
|
@@ -7389,10 +7396,6 @@ declare const contentSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
7389
7396
|
summary: z.ZodOptional<z.ZodString>;
|
|
7390
7397
|
}, z.core.$strip>>>;
|
|
7391
7398
|
live?: boolean | undefined;
|
|
7392
|
-
} | {
|
|
7393
|
-
type: "reaction";
|
|
7394
|
-
emoji: string;
|
|
7395
|
-
target: Message<string, User, Space<unknown>>;
|
|
7396
7399
|
} | {
|
|
7397
7400
|
type: "effect";
|
|
7398
7401
|
content: {
|
|
@@ -7435,6 +7438,14 @@ declare const contentSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
7435
7438
|
} | {
|
|
7436
7439
|
type: "leaveSpace";
|
|
7437
7440
|
}, {
|
|
7441
|
+
type: "attachment";
|
|
7442
|
+
id: string;
|
|
7443
|
+
name: string;
|
|
7444
|
+
mimeType: string;
|
|
7445
|
+
read: z.core.$InferOuterFunctionType<z.ZodTuple<readonly [], null>, z.ZodPromise<z.ZodCustom<Buffer<ArrayBufferLike>, Buffer<ArrayBufferLike>>>>;
|
|
7446
|
+
stream: z.core.$InferOuterFunctionType<z.ZodTuple<readonly [], null>, z.ZodPromise<z.ZodCustom<ReadableStream<unknown>, ReadableStream<unknown>>>>;
|
|
7447
|
+
size?: number | undefined;
|
|
7448
|
+
} | {
|
|
7438
7449
|
type: "contact";
|
|
7439
7450
|
user?: {
|
|
7440
7451
|
__platform: string;
|
|
@@ -7478,13 +7489,21 @@ declare const contentSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
7478
7489
|
} | undefined;
|
|
7479
7490
|
raw?: unknown;
|
|
7480
7491
|
} | {
|
|
7481
|
-
type: "
|
|
7482
|
-
|
|
7483
|
-
|
|
7484
|
-
|
|
7485
|
-
|
|
7486
|
-
|
|
7487
|
-
|
|
7492
|
+
type: "text";
|
|
7493
|
+
text: string;
|
|
7494
|
+
} | {
|
|
7495
|
+
type: "markdown";
|
|
7496
|
+
markdown: string;
|
|
7497
|
+
} | {
|
|
7498
|
+
type: "custom";
|
|
7499
|
+
raw: unknown;
|
|
7500
|
+
} | {
|
|
7501
|
+
type: "group";
|
|
7502
|
+
items: Message<string, User, Space<unknown>>[];
|
|
7503
|
+
} | {
|
|
7504
|
+
type: "reaction";
|
|
7505
|
+
emoji: string;
|
|
7506
|
+
target: Message<string, User, Space<unknown>>;
|
|
7488
7507
|
} | {
|
|
7489
7508
|
type: "poll";
|
|
7490
7509
|
title: string;
|
|
@@ -7505,18 +7524,6 @@ declare const contentSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
7505
7524
|
};
|
|
7506
7525
|
selected: boolean;
|
|
7507
7526
|
title: string;
|
|
7508
|
-
} | {
|
|
7509
|
-
type: "custom";
|
|
7510
|
-
raw: unknown;
|
|
7511
|
-
} | {
|
|
7512
|
-
type: "text";
|
|
7513
|
-
text: string;
|
|
7514
|
-
} | {
|
|
7515
|
-
type: "markdown";
|
|
7516
|
-
markdown: string;
|
|
7517
|
-
} | {
|
|
7518
|
-
type: "group";
|
|
7519
|
-
items: Message<string, User, Space<unknown>>[];
|
|
7520
7527
|
} | {
|
|
7521
7528
|
type: "streamText";
|
|
7522
7529
|
stream: () => AsyncIterable<string>;
|
|
@@ -7546,10 +7553,6 @@ declare const contentSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
7546
7553
|
summary: z.ZodOptional<z.ZodString>;
|
|
7547
7554
|
}, z.core.$strip>>>;
|
|
7548
7555
|
live?: boolean | undefined;
|
|
7549
|
-
} | {
|
|
7550
|
-
type: "reaction";
|
|
7551
|
-
emoji: string;
|
|
7552
|
-
target: Message<string, User, Space<unknown>>;
|
|
7553
7556
|
} | {
|
|
7554
7557
|
type: "effect";
|
|
7555
7558
|
content: {
|
|
@@ -7596,6 +7599,14 @@ declare const contentSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
7596
7599
|
}, z.core.$strip>, z.ZodObject<{
|
|
7597
7600
|
type: z.ZodLiteral<"edit">;
|
|
7598
7601
|
content: z.ZodCustom<{
|
|
7602
|
+
type: "attachment";
|
|
7603
|
+
id: string;
|
|
7604
|
+
name: string;
|
|
7605
|
+
mimeType: string;
|
|
7606
|
+
read: z.core.$InferOuterFunctionType<z.ZodTuple<readonly [], null>, z.ZodPromise<z.ZodCustom<Buffer<ArrayBufferLike>, Buffer<ArrayBufferLike>>>>;
|
|
7607
|
+
stream: z.core.$InferOuterFunctionType<z.ZodTuple<readonly [], null>, z.ZodPromise<z.ZodCustom<ReadableStream<unknown>, ReadableStream<unknown>>>>;
|
|
7608
|
+
size?: number | undefined;
|
|
7609
|
+
} | {
|
|
7599
7610
|
type: "contact";
|
|
7600
7611
|
user?: {
|
|
7601
7612
|
__platform: string;
|
|
@@ -7639,13 +7650,21 @@ declare const contentSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
7639
7650
|
} | undefined;
|
|
7640
7651
|
raw?: unknown;
|
|
7641
7652
|
} | {
|
|
7642
|
-
type: "
|
|
7643
|
-
|
|
7644
|
-
|
|
7645
|
-
|
|
7646
|
-
|
|
7647
|
-
|
|
7648
|
-
|
|
7653
|
+
type: "text";
|
|
7654
|
+
text: string;
|
|
7655
|
+
} | {
|
|
7656
|
+
type: "markdown";
|
|
7657
|
+
markdown: string;
|
|
7658
|
+
} | {
|
|
7659
|
+
type: "custom";
|
|
7660
|
+
raw: unknown;
|
|
7661
|
+
} | {
|
|
7662
|
+
type: "group";
|
|
7663
|
+
items: Message<string, User, Space<unknown>>[];
|
|
7664
|
+
} | {
|
|
7665
|
+
type: "reaction";
|
|
7666
|
+
emoji: string;
|
|
7667
|
+
target: Message<string, User, Space<unknown>>;
|
|
7649
7668
|
} | {
|
|
7650
7669
|
type: "poll";
|
|
7651
7670
|
title: string;
|
|
@@ -7666,18 +7685,6 @@ declare const contentSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
7666
7685
|
};
|
|
7667
7686
|
selected: boolean;
|
|
7668
7687
|
title: string;
|
|
7669
|
-
} | {
|
|
7670
|
-
type: "custom";
|
|
7671
|
-
raw: unknown;
|
|
7672
|
-
} | {
|
|
7673
|
-
type: "text";
|
|
7674
|
-
text: string;
|
|
7675
|
-
} | {
|
|
7676
|
-
type: "markdown";
|
|
7677
|
-
markdown: string;
|
|
7678
|
-
} | {
|
|
7679
|
-
type: "group";
|
|
7680
|
-
items: Message<string, User, Space<unknown>>[];
|
|
7681
7688
|
} | {
|
|
7682
7689
|
type: "streamText";
|
|
7683
7690
|
stream: () => AsyncIterable<string>;
|
|
@@ -7707,10 +7714,6 @@ declare const contentSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
7707
7714
|
summary: z.ZodOptional<z.ZodString>;
|
|
7708
7715
|
}, z.core.$strip>>>;
|
|
7709
7716
|
live?: boolean | undefined;
|
|
7710
|
-
} | {
|
|
7711
|
-
type: "reaction";
|
|
7712
|
-
emoji: string;
|
|
7713
|
-
target: Message<string, User, Space<unknown>>;
|
|
7714
7717
|
} | {
|
|
7715
7718
|
type: "effect";
|
|
7716
7719
|
content: {
|
|
@@ -7753,6 +7756,14 @@ declare const contentSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
7753
7756
|
} | {
|
|
7754
7757
|
type: "leaveSpace";
|
|
7755
7758
|
}, {
|
|
7759
|
+
type: "attachment";
|
|
7760
|
+
id: string;
|
|
7761
|
+
name: string;
|
|
7762
|
+
mimeType: string;
|
|
7763
|
+
read: z.core.$InferOuterFunctionType<z.ZodTuple<readonly [], null>, z.ZodPromise<z.ZodCustom<Buffer<ArrayBufferLike>, Buffer<ArrayBufferLike>>>>;
|
|
7764
|
+
stream: z.core.$InferOuterFunctionType<z.ZodTuple<readonly [], null>, z.ZodPromise<z.ZodCustom<ReadableStream<unknown>, ReadableStream<unknown>>>>;
|
|
7765
|
+
size?: number | undefined;
|
|
7766
|
+
} | {
|
|
7756
7767
|
type: "contact";
|
|
7757
7768
|
user?: {
|
|
7758
7769
|
__platform: string;
|
|
@@ -7796,13 +7807,21 @@ declare const contentSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
7796
7807
|
} | undefined;
|
|
7797
7808
|
raw?: unknown;
|
|
7798
7809
|
} | {
|
|
7799
|
-
type: "
|
|
7800
|
-
|
|
7801
|
-
|
|
7802
|
-
|
|
7803
|
-
|
|
7804
|
-
|
|
7805
|
-
|
|
7810
|
+
type: "text";
|
|
7811
|
+
text: string;
|
|
7812
|
+
} | {
|
|
7813
|
+
type: "markdown";
|
|
7814
|
+
markdown: string;
|
|
7815
|
+
} | {
|
|
7816
|
+
type: "custom";
|
|
7817
|
+
raw: unknown;
|
|
7818
|
+
} | {
|
|
7819
|
+
type: "group";
|
|
7820
|
+
items: Message<string, User, Space<unknown>>[];
|
|
7821
|
+
} | {
|
|
7822
|
+
type: "reaction";
|
|
7823
|
+
emoji: string;
|
|
7824
|
+
target: Message<string, User, Space<unknown>>;
|
|
7806
7825
|
} | {
|
|
7807
7826
|
type: "poll";
|
|
7808
7827
|
title: string;
|
|
@@ -7823,18 +7842,6 @@ declare const contentSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
7823
7842
|
};
|
|
7824
7843
|
selected: boolean;
|
|
7825
7844
|
title: string;
|
|
7826
|
-
} | {
|
|
7827
|
-
type: "custom";
|
|
7828
|
-
raw: unknown;
|
|
7829
|
-
} | {
|
|
7830
|
-
type: "text";
|
|
7831
|
-
text: string;
|
|
7832
|
-
} | {
|
|
7833
|
-
type: "markdown";
|
|
7834
|
-
markdown: string;
|
|
7835
|
-
} | {
|
|
7836
|
-
type: "group";
|
|
7837
|
-
items: Message<string, User, Space<unknown>>[];
|
|
7838
7845
|
} | {
|
|
7839
7846
|
type: "streamText";
|
|
7840
7847
|
stream: () => AsyncIterable<string>;
|
|
@@ -7864,10 +7871,6 @@ declare const contentSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
7864
7871
|
summary: z.ZodOptional<z.ZodString>;
|
|
7865
7872
|
}, z.core.$strip>>>;
|
|
7866
7873
|
live?: boolean | undefined;
|
|
7867
|
-
} | {
|
|
7868
|
-
type: "reaction";
|
|
7869
|
-
emoji: string;
|
|
7870
|
-
target: Message<string, User, Space<unknown>>;
|
|
7871
7874
|
} | {
|
|
7872
7875
|
type: "effect";
|
|
7873
7876
|
content: {
|
|
@@ -7950,4 +7953,4 @@ declare function attachment(input: AttachmentInput, options?: {
|
|
|
7950
7953
|
name?: string;
|
|
7951
7954
|
}): ContentBuilder;
|
|
7952
7955
|
//#endregion
|
|
7953
|
-
export { DedicatedTokenData as $,
|
|
7956
|
+
export { DedicatedTokenData as $, StreamTextSource as $t, isFusorEvent as A, ContactInput as An, Reply as At, PlatformUser as B, AvatarInput as Bn, Poll as Bt, FusorVerify as C, reactionSchema as Cn, typing as Ct, WebhookRawResult as D, ContactAddress as Dn, asRichlink as Dt, WebhookRawRequest as E, Contact as En, Richlink as Et, PlatformInstance as F, contact as Fn, rename as Ft, SpaceNamespace as G, photoActionSchema as Gn, asPollOption as Gt, ProviderMessageRecord as H, avatarSchema as Hn, PollChoiceInput as Ht, PlatformMessage as I, AgentSender as In, renameSchema as It, broadcast as J, AppOptions as Jn, Markdown as Jt, Broadcaster as K, App as Kn, option as Kt, PlatformProviderConfig as L, User as Ln, Read as Lt, EventProducer as M, ContactOrg as Mn, reply as Mt, Platform as N, ContactPhone as Nn, replySchema as Nt, FusorEvent as O, ContactDetails as On, richlink as Ot, PlatformDef as P, asContact as Pn, Rename as Pt, CloudPlatform as Q, StreamText as Qt, PlatformRuntime as R, Avatar as Rn, asRead as Rt, FusorRespond as S, reaction as Sn, Typing as St, WebhookHandler as T, custom as Tn, text as Tt, ProviderUserRecord as U, PhotoInput as Un, PollOption as Ut, ProviderMessage as V, avatar as Vn, PollChoice as Vt, SchemaMessage as W, buildPhotoAction as Wn, asPoll as Wt, stream as X, app as Xn, markdown as Xt, mergeStreams as Y, AppUrl as Yn, asMarkdown as Yt, Store as Z, appLayoutSchema as Zn, DeltaExtractor as Zt, FusorClient as _, removeMember as _n, asVoice as _t, Content as a, Edit as an, ProjectProfile as at, FusorMessagesReturn as b, ReactionBuilder as bn, asUnsend as bt, fromVCard as c, Space as cn, SlackTokenData as ct, UnsupportedKind as d, MemberInput as dn, SubscriptionStatus as dt, TextStreamOptions as en, FusorTokenData as et, Spectrum as f, RemoveMember as fn, TokenData as ft, isFusorClient as g, leaveSpaceSchema as gn, Voice as gt, fusor as h, leaveSpace as hn, EmojiKey as ht, attachment as i, groupSchema as in, ProjectData as it, AnyPlatformDef as j, ContactName as jn, asReply as jt, fusorEvent as k, ContactEmail as kn, resolveContents as kt, toVCard as l, AddMember as ln, SpectrumCloudError as lt, definePlatform as m, addMemberSchema as mn, Emoji as mt, AttachmentInput as n, asGroup as nn, PlatformStatus as nt, ContentBuilder as o, edit as on, SharedTokenData as ot, SpectrumInstance as p, addMember as pn, cloud as pt, ManagedStream as q, AppLayout as qn, poll as qt, asAttachment as r, group as rn, PlatformsData as rt, ContentInput as s, Message as sn, SlackTeamMeta as st, Attachment as t, Group as tn, ImessageInfoData as tt, UnsupportedError as u, LeaveSpace as un, SubscriptionData as ut, FusorMessages as v, removeMemberSchema as vn, voice as vt, FusorVerifyRequest as w, asCustom as wn, asText as wt, FusorReply as x, asReaction as xn, unsend as xt, FusorMessagesCtx as y, Reaction as yn, Unsend as yt, PlatformSpace as z, AvatarData as zn, read as zt };
|
package/dist/authoring.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Cn as reactionSchema, Dt as asRichlink, Gn as photoActionSchema, Gt as asPollOption, H as ProviderMessageRecord, Hn as avatarSchema, It as renameSchema, Nt as replySchema, Pn as asContact, Rt as asRead, U as ProviderUserRecord, Un as PhotoInput, Wn as buildPhotoAction, Wt as asPoll, Yt as asMarkdown, _t as asVoice, bt as asUnsend, gn as leaveSpaceSchema, in as groupSchema, jt as asReply, mn as addMemberSchema, nn as asGroup, q as ManagedStream, r as asAttachment, vn as removeMemberSchema, wn as asCustom, wt as asText, xn as asReaction } from "./attachment-BK3lYu2W.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";
|
|
@@ -178,4 +178,4 @@ declare const resumableOrderedStream: <TLive, TMissed, TOutput>(options: Resumab
|
|
|
178
178
|
*/
|
|
179
179
|
declare function errorAttrs(error: unknown, prefix?: string): LogAttrs$1;
|
|
180
180
|
//#endregion
|
|
181
|
-
export { type CloseableAsyncIterable, type LogAttrs, type LogLevel, type PhotoInput, type PhotonLogger, type ProviderMessageRecord, type ProviderUserRecord, type ResumableStreamItem, type SanitizeUrlOptions, addMemberSchema, asAttachment, asContact, asCustom, asGroup, asMarkdown, asPoll, asPollOption, asReaction, asRead, asReply, asRichlink, asText, asVoice, avatarSchema, buildPhotoAction, createLogger, ensureM4a, envAwareConfig, envFor, errorAttrs, fromEnv, groupSchema, leaveSpaceSchema, messageEffectSchema, photoActionSchema, reactionSchema, removeMemberSchema, renameSchema, renderInlineTokens, replySchema, resumableOrderedStream, sanitizeEmail, sanitizeErrorMessage, sanitizePhone, sanitizeUrl, setLogLevel, tracedFetch };
|
|
181
|
+
export { type CloseableAsyncIterable, type LogAttrs, type LogLevel, type PhotoInput, type PhotonLogger, type ProviderMessageRecord, type ProviderUserRecord, type ResumableStreamItem, type SanitizeUrlOptions, addMemberSchema, asAttachment, asContact, asCustom, asGroup, asMarkdown, asPoll, asPollOption, asReaction, asRead, asReply, asRichlink, asText, asUnsend, asVoice, avatarSchema, buildPhotoAction, createLogger, ensureM4a, envAwareConfig, envFor, errorAttrs, fromEnv, groupSchema, leaveSpaceSchema, messageEffectSchema, photoActionSchema, reactionSchema, removeMemberSchema, renameSchema, renderInlineTokens, replySchema, resumableOrderedStream, sanitizeEmail, sanitizeErrorMessage, sanitizePhone, sanitizeUrl, setLogLevel, tracedFetch };
|
package/dist/authoring.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { A as asPoll, B as asMarkdown, D as asReaction, F as addMemberSchema, G as groupSchema, H as markdownSchema, L as leaveSpaceSchema, Q as asCustom, S as replySchema, T as asRead, U as asGroup, Y as textSchema, at as avatarSchema, b as asReply, ct as asAttachment, d as envAwareConfig, et as asContact, f as envFor, ft as tracedFetch, g as asUnsend, i as stream, j as asPollOption, k as reactionSchema, l as renderInlineTokens, m as asVoice, o as errorAttrs, ot as buildPhotoAction, p as fromEnv, q as asText, st as photoActionSchema, ut as attachmentSchema, v as asRichlink, w as renameSchema, z as removeMemberSchema } from "./stream-CxcG-Kup.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 { addMemberSchema, asAttachment, asContact, asCustom, asGroup, asMarkdown, asPoll, asPollOption, asReaction, asRead, asReply, asRichlink, asText, asVoice, avatarSchema, buildPhotoAction, createLogger, ensureM4a, envAwareConfig, envFor, errorAttrs, fromEnv, groupSchema, leaveSpaceSchema, messageEffectSchema, photoActionSchema, reactionSchema, removeMemberSchema, renameSchema, renderInlineTokens, replySchema, resumableOrderedStream, sanitizeEmail, sanitizeErrorMessage, sanitizePhone, sanitizeUrl, setLogLevel, tracedFetch };
|
|
425
|
+
export { addMemberSchema, asAttachment, asContact, asCustom, asGroup, asMarkdown, asPoll, asPollOption, asReaction, asRead, asReply, asRichlink, asText, asUnsend, asVoice, avatarSchema, buildPhotoAction, createLogger, ensureM4a, envAwareConfig, envFor, errorAttrs, fromEnv, groupSchema, leaveSpaceSchema, messageEffectSchema, photoActionSchema, reactionSchema, removeMemberSchema, renameSchema, renderInlineTokens, replySchema, resumableOrderedStream, sanitizeEmail, sanitizeErrorMessage, sanitizePhone, sanitizeUrl, setLogLevel, tracedFetch };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { $ as DedicatedTokenData, $t as
|
|
1
|
+
import { $ as DedicatedTokenData, $t as StreamTextSource, A as isFusorEvent, An as ContactInput, At as Reply, B as PlatformUser, Bn as AvatarInput, Bt as Poll, C as FusorVerify, Ct as typing, D as WebhookRawResult, Dn as ContactAddress, E as WebhookRawRequest, En as Contact, Et as Richlink, F as PlatformInstance, Fn as contact, Ft as rename, G as SpaceNamespace, Ht as PollChoiceInput, I as PlatformMessage, In as AgentSender, J as broadcast, Jn as AppOptions, Jt as Markdown, K as Broadcaster, Kn as App, Kt as option, L as PlatformProviderConfig, Ln as User, Lt as Read, M as EventProducer, Mn as ContactOrg, Mt as reply, N as Platform, Nn as ContactPhone, O as FusorEvent, On as ContactDetails, Ot as richlink, P as PlatformDef, Pt as Rename, Q as CloudPlatform, Qt as StreamText, R as PlatformRuntime, Rn as Avatar, S as FusorRespond, Sn as reaction, St as Typing, T as WebhookHandler, Tn as custom, Tt as text, Ut as PollOption, V as ProviderMessage, Vn as avatar, Vt as PollChoice, W as SchemaMessage, X as stream, Xn as app, Xt as markdown, Y as mergeStreams, Yn as AppUrl, Z as Store, Zn as appLayoutSchema, Zt as DeltaExtractor, _ as FusorClient, _n as removeMember, a as Content, an as Edit, at as ProjectProfile, b as FusorMessagesReturn, bn as ReactionBuilder, c as fromVCard, cn as Space, ct as SlackTokenData, d as UnsupportedKind, dn as MemberInput, dt as SubscriptionStatus, en as TextStreamOptions, et as FusorTokenData, f as Spectrum, fn as RemoveMember, ft as TokenData, g as isFusorClient, gt as Voice, h as fusor, hn as leaveSpace, ht as EmojiKey, i as attachment, it as ProjectData, j as AnyPlatformDef, jn as ContactName, k as fusorEvent, kn as ContactEmail, kt as resolveContents, l as toVCard, ln as AddMember, lt as SpectrumCloudError, m as definePlatform, mt as Emoji, n as AttachmentInput, nt as PlatformStatus, o as ContentBuilder, on as edit, ot as SharedTokenData, p as SpectrumInstance, pn as addMember, pt as cloud, q as ManagedStream, qn as AppLayout, qt as poll, rn as group, rt as PlatformsData, s as ContentInput, sn as Message, st as SlackTeamMeta, t as Attachment, tn as Group, tt as ImessageInfoData, u as UnsupportedError, un as LeaveSpace, ut as SubscriptionData, v as FusorMessages, vt as voice, w as FusorVerifyRequest, x as FusorReply, xt as unsend, y as FusorMessagesCtx, yn as Reaction, yt as Unsend, z as PlatformSpace, zn as AvatarData, zt as read } from "./attachment-BK3lYu2W.js";
|
|
2
2
|
export { type AddMember, type AgentSender, type AnyPlatformDef, type App, type AppLayout, type AppOptions, type AppUrl, type Attachment, type AttachmentInput, type Avatar, type AvatarData, 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 LeaveSpace, type ManagedStream, type Markdown, type MemberInput, 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 RemoveMember, 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, addMember, app, appLayoutSchema, attachment, avatar, broadcast, cloud, contact, custom, definePlatform, edit, fromVCard, fusor, fusorEvent, group, isFusorClient, isFusorEvent, leaveSpace, markdown, mergeStreams, option, poll, reaction, read, removeMember, rename, reply, resolveContents, richlink, stream, text, toVCard, typing, unsend, voice };
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $ as
|
|
1
|
+
import { $ as custom, B as asMarkdown, C as rename, E as read, F as addMemberSchema, I as leaveSpace, J as text, K as resolveContents, L as leaveSpaceSchema, M as option, N as poll, O as reaction, P as addMember, Q as asCustom, R as removeMember, V as markdown, W as group, X as StreamConsumedError, Z as drainStreamText, _ as unsend, a as contentAttrs, at as avatarSchema, c as markdownToPlainText, ct as asAttachment, d as envAwareConfig, dt as fetchUrlBytes, et as asContact, f as envFor, ft as tracedFetch, h as voice, i as stream, it as avatar, lt as attachment, n as createAsyncQueue, nt as fromVCard, o as errorAttrs, q as asText, r as mergeStreams, rt as toVCard, s as senderAttrs, t as broadcast, tt as contact, u as classifyIdentifier, w as renameSchema, x as reply, y as richlink, z as removeMemberSchema } from "./stream-CxcG-Kup.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";
|
|
@@ -170,7 +170,7 @@ function app(url, options = {}) {
|
|
|
170
170
|
}
|
|
171
171
|
//#endregion
|
|
172
172
|
//#region src/content/edit.ts
|
|
173
|
-
const isMessage
|
|
173
|
+
const isMessage = (v) => typeof v === "object" && v !== null && "id" in v && "content" in v;
|
|
174
174
|
const isContent = (v) => typeof v === "object" && v !== null && "type" in v && typeof v.type === "string";
|
|
175
175
|
/**
|
|
176
176
|
* An `edit` rewrites the content of a previously-sent outbound message.
|
|
@@ -188,7 +188,7 @@ const isContent = (v) => typeof v === "object" && v !== null && "type" in v && t
|
|
|
188
188
|
const editSchema = z.object({
|
|
189
189
|
type: z.literal("edit"),
|
|
190
190
|
content: z.custom(isContent, { message: "edit content must be a Content value" }),
|
|
191
|
-
target: z.custom(isMessage
|
|
191
|
+
target: z.custom(isMessage, { message: "edit target must be a Message" })
|
|
192
192
|
});
|
|
193
193
|
const asEdit = (input) => editSchema.parse({
|
|
194
194
|
type: "edit",
|
|
@@ -244,52 +244,6 @@ function typing(state = "start") {
|
|
|
244
244
|
}) };
|
|
245
245
|
}
|
|
246
246
|
//#endregion
|
|
247
|
-
//#region src/content/unsend.ts
|
|
248
|
-
const isMessage = (v) => typeof v === "object" && v !== null && "id" in v && "content" in v;
|
|
249
|
-
/**
|
|
250
|
-
* An `unsend` retracts a previously-sent outbound message.
|
|
251
|
-
*
|
|
252
|
-
* `space.send(unsend(message))` is the canonical outbound API;
|
|
253
|
-
* `message.unsend()` and `space.unsend(message)` are sugar that delegate
|
|
254
|
-
* here. Unsends are fire-and-forget — providers handle them inside their
|
|
255
|
-
* `send` action and the resolved value is `undefined` (no new message id is
|
|
256
|
-
* produced; the existing message is retracted in place).
|
|
257
|
-
*
|
|
258
|
-
* Platform constraints surface from the provider at send time — e.g.
|
|
259
|
-
* iMessage enforces Apple's ~2-minute unsend window for regular messages
|
|
260
|
-
* (reaction removal is not time-limited), and a late or repeated unsend
|
|
261
|
-
* rejects with the provider's error. `space.getMessage(id)` results are
|
|
262
|
-
* wrapped as inbound, so a message cannot be unsent from a refetched id
|
|
263
|
-
* after a restart — keep the Message returned by `send` (same limitation
|
|
264
|
-
* as `edit`).
|
|
265
|
-
*/
|
|
266
|
-
const unsendSchema = z.object({
|
|
267
|
-
type: z.literal("unsend"),
|
|
268
|
-
target: z.custom(isMessage, { message: "unsend target must be a Message" })
|
|
269
|
-
});
|
|
270
|
-
const asUnsend = (input) => unsendSchema.parse({
|
|
271
|
-
type: "unsend",
|
|
272
|
-
...input
|
|
273
|
-
});
|
|
274
|
-
/**
|
|
275
|
-
* Construct an `unsend` content value retracting `target`.
|
|
276
|
-
*
|
|
277
|
-
* Only outbound messages (those sent by the agent) can be unsent; calling
|
|
278
|
-
* this with an inbound target throws at build time so the misuse surfaces
|
|
279
|
-
* before the send pipeline runs.
|
|
280
|
-
*
|
|
281
|
-
* Accepts `Message | undefined` so `space.send` results chain without
|
|
282
|
-
* narrowing (`send` resolves `undefined` when a platform skips unsupported
|
|
283
|
-
* content); an undefined target throws at build time.
|
|
284
|
-
*/
|
|
285
|
-
function unsend(target) {
|
|
286
|
-
return { build: async () => {
|
|
287
|
-
if (!target) throw new Error("unsend() target is undefined — the targeted message was never sent (space.send resolves undefined when a platform skips unsupported content)");
|
|
288
|
-
if (target.direction !== "outbound") throw new Error(`unsend() target must be an outbound message (got direction "${target.direction}", message id "${target.id}")`);
|
|
289
|
-
return asUnsend({ target });
|
|
290
|
-
} };
|
|
291
|
-
}
|
|
292
|
-
//#endregion
|
|
293
247
|
//#region src/emoji/generated.ts
|
|
294
248
|
const GeneratedEmoji = {
|
|
295
249
|
_1stPlaceMedal: "🥇",
|
|
@@ -3051,7 +3005,7 @@ function definePlatform(name, rawDef) {
|
|
|
3051
3005
|
}
|
|
3052
3006
|
//#endregion
|
|
3053
3007
|
//#region src/build-env.ts
|
|
3054
|
-
const SPECTRUM_SDK_VERSION = "11.
|
|
3008
|
+
const SPECTRUM_SDK_VERSION = "11.1.0";
|
|
3055
3009
|
//#endregion
|
|
3056
3010
|
//#region src/utils/provider-packages.ts
|
|
3057
3011
|
const OFFICIAL_PROVIDER_PACKAGES = {
|
|
@@ -731,7 +731,7 @@ function text(source, options) {
|
|
|
731
731
|
const resolveContents = (items) => Promise.all(items.map((c) => typeof c === "string" ? text(c).build() : c.build()));
|
|
732
732
|
//#endregion
|
|
733
733
|
//#region src/content/group.ts
|
|
734
|
-
const isMessage$
|
|
734
|
+
const isMessage$4 = (v) => typeof v === "object" && v !== null && "id" in v && "content" in v;
|
|
735
735
|
/**
|
|
736
736
|
* A `group` bundles multiple messages into one logical unit (e.g. an album
|
|
737
737
|
* of images sent together). Each item is a full `Message` — addressable by
|
|
@@ -743,7 +743,7 @@ const isMessage$3 = (v) => typeof v === "object" && v !== null && "id" in v && "
|
|
|
743
743
|
*/
|
|
744
744
|
const groupSchema = z.object({
|
|
745
745
|
type: z.literal("group"),
|
|
746
|
-
items: z.array(z.custom(isMessage$
|
|
746
|
+
items: z.array(z.custom(isMessage$4)).min(2)
|
|
747
747
|
});
|
|
748
748
|
const asGroup = (input) => groupSchema.parse({
|
|
749
749
|
type: "group",
|
|
@@ -899,11 +899,11 @@ function poll(title, ...rest) {
|
|
|
899
899
|
}
|
|
900
900
|
//#endregion
|
|
901
901
|
//#region src/content/reaction.ts
|
|
902
|
-
const isMessage$
|
|
902
|
+
const isMessage$3 = (v) => typeof v === "object" && v !== null && "id" in v && "content" in v;
|
|
903
903
|
const reactionSchema = z.object({
|
|
904
904
|
type: z.literal("reaction"),
|
|
905
905
|
emoji: z.string().min(1),
|
|
906
|
-
target: z.custom(isMessage$
|
|
906
|
+
target: z.custom(isMessage$3, { message: "reaction target must be a Message" })
|
|
907
907
|
});
|
|
908
908
|
const asReaction = (input) => reactionSchema.parse({
|
|
909
909
|
type: "reaction",
|
|
@@ -937,7 +937,7 @@ function reaction(emoji, target) {
|
|
|
937
937
|
}
|
|
938
938
|
//#endregion
|
|
939
939
|
//#region src/content/read.ts
|
|
940
|
-
const isMessage$
|
|
940
|
+
const isMessage$2 = (v) => typeof v === "object" && v !== null && "id" in v && "content" in v;
|
|
941
941
|
/**
|
|
942
942
|
* A `read` marks the conversation as read **up to** `target`, surfacing a
|
|
943
943
|
* read receipt to the sender where the platform supports one.
|
|
@@ -960,7 +960,7 @@ const isMessage$1 = (v) => typeof v === "object" && v !== null && "id" in v && "
|
|
|
960
960
|
*/
|
|
961
961
|
const readSchema = z.object({
|
|
962
962
|
type: z.literal("read"),
|
|
963
|
-
target: z.custom(isMessage$
|
|
963
|
+
target: z.custom(isMessage$2, { message: "read target must be a Message" })
|
|
964
964
|
});
|
|
965
965
|
const asRead = (input) => readSchema.parse({
|
|
966
966
|
type: "read",
|
|
@@ -1013,7 +1013,7 @@ function rename(displayName) {
|
|
|
1013
1013
|
}
|
|
1014
1014
|
//#endregion
|
|
1015
1015
|
//#region src/content/reply.ts
|
|
1016
|
-
const isMessage = (v) => typeof v === "object" && v !== null && "id" in v && "content" in v;
|
|
1016
|
+
const isMessage$1 = (v) => typeof v === "object" && v !== null && "id" in v && "content" in v;
|
|
1017
1017
|
const isContent = (v) => typeof v === "object" && v !== null && "type" in v && typeof v.type === "string";
|
|
1018
1018
|
/**
|
|
1019
1019
|
* A `reply` wraps inner content with the message it replies to.
|
|
@@ -1029,7 +1029,7 @@ const isContent = (v) => typeof v === "object" && v !== null && "type" in v && t
|
|
|
1029
1029
|
const replySchema = z.object({
|
|
1030
1030
|
type: z.literal("reply"),
|
|
1031
1031
|
content: z.custom(isContent, { message: "reply content must be a Content value" }),
|
|
1032
|
-
target: z.custom(isMessage, { message: "reply target must be a Message" })
|
|
1032
|
+
target: z.custom(isMessage$1, { message: "reply target must be a Message" })
|
|
1033
1033
|
});
|
|
1034
1034
|
const asReply = (input) => replySchema.parse({
|
|
1035
1035
|
type: "reply",
|
|
@@ -1071,6 +1071,52 @@ function richlink(url) {
|
|
|
1071
1071
|
return { build: async () => asRichlink({ url }) };
|
|
1072
1072
|
}
|
|
1073
1073
|
//#endregion
|
|
1074
|
+
//#region src/content/unsend.ts
|
|
1075
|
+
const isMessage = (v) => typeof v === "object" && v !== null && "id" in v && "content" in v;
|
|
1076
|
+
/**
|
|
1077
|
+
* An `unsend` retracts a previously-sent outbound message.
|
|
1078
|
+
*
|
|
1079
|
+
* `space.send(unsend(message))` is the canonical outbound API;
|
|
1080
|
+
* `message.unsend()` and `space.unsend(message)` are sugar that delegate
|
|
1081
|
+
* here. Unsends are fire-and-forget — providers handle them inside their
|
|
1082
|
+
* `send` action and the resolved value is `undefined` (no new message id is
|
|
1083
|
+
* produced; the existing message is retracted in place).
|
|
1084
|
+
*
|
|
1085
|
+
* Platform constraints surface from the provider at send time — e.g.
|
|
1086
|
+
* iMessage enforces Apple's ~2-minute unsend window for regular messages
|
|
1087
|
+
* (reaction removal is not time-limited), and a late or repeated unsend
|
|
1088
|
+
* rejects with the provider's error. `space.getMessage(id)` results are
|
|
1089
|
+
* wrapped as inbound, so a message cannot be unsent from a refetched id
|
|
1090
|
+
* after a restart — keep the Message returned by `send` (same limitation
|
|
1091
|
+
* as `edit`).
|
|
1092
|
+
*/
|
|
1093
|
+
const unsendSchema = z.object({
|
|
1094
|
+
type: z.literal("unsend"),
|
|
1095
|
+
target: z.custom(isMessage, { message: "unsend target must be a Message" })
|
|
1096
|
+
});
|
|
1097
|
+
const asUnsend = (input) => unsendSchema.parse({
|
|
1098
|
+
type: "unsend",
|
|
1099
|
+
...input
|
|
1100
|
+
});
|
|
1101
|
+
/**
|
|
1102
|
+
* Construct an `unsend` content value retracting `target`.
|
|
1103
|
+
*
|
|
1104
|
+
* Only outbound messages (those sent by the agent) can be unsent; calling
|
|
1105
|
+
* this with an inbound target throws at build time so the misuse surfaces
|
|
1106
|
+
* before the send pipeline runs.
|
|
1107
|
+
*
|
|
1108
|
+
* Accepts `Message | undefined` so `space.send` results chain without
|
|
1109
|
+
* narrowing (`send` resolves `undefined` when a platform skips unsupported
|
|
1110
|
+
* content); an undefined target throws at build time.
|
|
1111
|
+
*/
|
|
1112
|
+
function unsend(target) {
|
|
1113
|
+
return { build: async () => {
|
|
1114
|
+
if (!target) throw new Error("unsend() target is undefined — the targeted message was never sent (space.send resolves undefined when a platform skips unsupported content)");
|
|
1115
|
+
if (target.direction !== "outbound") throw new Error(`unsend() target must be an outbound message (got direction "${target.direction}", message id "${target.id}")`);
|
|
1116
|
+
return asUnsend({ target });
|
|
1117
|
+
} };
|
|
1118
|
+
}
|
|
1119
|
+
//#endregion
|
|
1074
1120
|
//#region src/content/voice.ts
|
|
1075
1121
|
const AUDIO_MIME_PATTERN = /^audio\//i;
|
|
1076
1122
|
const audioMimeSchema = z.string().nonempty().regex(AUDIO_MIME_PATTERN, "voice content requires an audio/* MIME type");
|
|
@@ -1698,4 +1744,4 @@ function broadcast(source) {
|
|
|
1698
1744
|
};
|
|
1699
1745
|
}
|
|
1700
1746
|
//#endregion
|
|
1701
|
-
export {
|
|
1747
|
+
export { custom as $, asPoll as A, asMarkdown as B, rename as C, asReaction as D, read as E, addMemberSchema as F, groupSchema as G, markdownSchema as H, leaveSpace as I, text as J, resolveContents as K, leaveSpaceSchema as L, option as M, poll as N, reaction as O, addMember as P, asCustom as Q, removeMember as R, replySchema as S, asRead as T, asGroup as U, markdown as V, group as W, StreamConsumedError as X, textSchema as Y, drainStreamText as Z, unsend as _, contentAttrs as a, avatarSchema as at, asReply as b, markdownToPlainText as c, asAttachment as ct, envAwareConfig as d, fetchUrlBytes as dt, asContact as et, envFor as f, tracedFetch as ft, asUnsend as g, voice as h, stream as i, avatar as it, asPollOption as j, reactionSchema as k, renderInlineTokens as l, attachment as lt, asVoice as m, createAsyncQueue as n, fromVCard as nt, errorAttrs as o, buildPhotoAction as ot, fromEnv as p, asText as q, mergeStreams as r, toVCard as rt, senderAttrs as s, photoActionSchema as st, broadcast as t, contact as tt, classifyIdentifier as u, attachmentSchema as ut, asRichlink as v, renameSchema as w, reply as x, richlink as y, removeMemberSchema as z };
|