@spectrum-ts/core 12.5.0 → 12.6.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,14 +592,6 @@ 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
|
-
} | {
|
|
603
595
|
type: "contact";
|
|
604
596
|
user?: {
|
|
605
597
|
__platform: string;
|
|
@@ -642,6 +634,14 @@ declare const editSchema: z.ZodObject<{
|
|
|
642
634
|
read: z.core.$InferOuterFunctionType<z.ZodTuple<readonly [], null>, z.ZodPromise<z.ZodCustom<Buffer<ArrayBufferLike>, Buffer<ArrayBufferLike>>>>;
|
|
643
635
|
} | undefined;
|
|
644
636
|
raw?: unknown;
|
|
637
|
+
} | {
|
|
638
|
+
type: "attachment";
|
|
639
|
+
id: string;
|
|
640
|
+
name: string;
|
|
641
|
+
mimeType: string;
|
|
642
|
+
read: z.core.$InferOuterFunctionType<z.ZodTuple<readonly [], null>, z.ZodPromise<z.ZodCustom<Buffer<ArrayBufferLike>, Buffer<ArrayBufferLike>>>>;
|
|
643
|
+
stream: z.core.$InferOuterFunctionType<z.ZodTuple<readonly [], null>, z.ZodPromise<z.ZodCustom<ReadableStream<unknown>, ReadableStream<unknown>>>>;
|
|
644
|
+
size?: number | undefined;
|
|
645
645
|
} | {
|
|
646
646
|
type: "custom";
|
|
647
647
|
raw: unknown;
|
|
@@ -678,6 +678,9 @@ declare const editSchema: z.ZodObject<{
|
|
|
678
678
|
type: "reaction";
|
|
679
679
|
emoji: string;
|
|
680
680
|
target: Message<string, User, Space<unknown>>;
|
|
681
|
+
} | {
|
|
682
|
+
type: "richlink";
|
|
683
|
+
url: string;
|
|
681
684
|
} | {
|
|
682
685
|
type: "streamText";
|
|
683
686
|
stream: () => AsyncIterable<string>;
|
|
@@ -691,9 +694,6 @@ declare const editSchema: z.ZodObject<{
|
|
|
691
694
|
name?: string | undefined;
|
|
692
695
|
duration?: number | undefined;
|
|
693
696
|
size?: number | undefined;
|
|
694
|
-
} | {
|
|
695
|
-
type: "richlink";
|
|
696
|
-
url: string;
|
|
697
697
|
} | {
|
|
698
698
|
type: "app";
|
|
699
699
|
url: z.core.$InferOuterFunctionType<z.ZodTuple<readonly [], null>, z.ZodPromise<z.ZodURL>>;
|
|
@@ -750,14 +750,6 @@ declare const editSchema: z.ZodObject<{
|
|
|
750
750
|
} | {
|
|
751
751
|
type: "leaveSpace";
|
|
752
752
|
}, {
|
|
753
|
-
type: "attachment";
|
|
754
|
-
id: string;
|
|
755
|
-
name: string;
|
|
756
|
-
mimeType: string;
|
|
757
|
-
read: z.core.$InferOuterFunctionType<z.ZodTuple<readonly [], null>, z.ZodPromise<z.ZodCustom<Buffer<ArrayBufferLike>, Buffer<ArrayBufferLike>>>>;
|
|
758
|
-
stream: z.core.$InferOuterFunctionType<z.ZodTuple<readonly [], null>, z.ZodPromise<z.ZodCustom<ReadableStream<unknown>, ReadableStream<unknown>>>>;
|
|
759
|
-
size?: number | undefined;
|
|
760
|
-
} | {
|
|
761
753
|
type: "contact";
|
|
762
754
|
user?: {
|
|
763
755
|
__platform: string;
|
|
@@ -800,6 +792,14 @@ declare const editSchema: z.ZodObject<{
|
|
|
800
792
|
read: z.core.$InferOuterFunctionType<z.ZodTuple<readonly [], null>, z.ZodPromise<z.ZodCustom<Buffer<ArrayBufferLike>, Buffer<ArrayBufferLike>>>>;
|
|
801
793
|
} | undefined;
|
|
802
794
|
raw?: unknown;
|
|
795
|
+
} | {
|
|
796
|
+
type: "attachment";
|
|
797
|
+
id: string;
|
|
798
|
+
name: string;
|
|
799
|
+
mimeType: string;
|
|
800
|
+
read: z.core.$InferOuterFunctionType<z.ZodTuple<readonly [], null>, z.ZodPromise<z.ZodCustom<Buffer<ArrayBufferLike>, Buffer<ArrayBufferLike>>>>;
|
|
801
|
+
stream: z.core.$InferOuterFunctionType<z.ZodTuple<readonly [], null>, z.ZodPromise<z.ZodCustom<ReadableStream<unknown>, ReadableStream<unknown>>>>;
|
|
802
|
+
size?: number | undefined;
|
|
803
803
|
} | {
|
|
804
804
|
type: "custom";
|
|
805
805
|
raw: unknown;
|
|
@@ -836,6 +836,9 @@ declare const editSchema: z.ZodObject<{
|
|
|
836
836
|
type: "reaction";
|
|
837
837
|
emoji: string;
|
|
838
838
|
target: Message<string, User, Space<unknown>>;
|
|
839
|
+
} | {
|
|
840
|
+
type: "richlink";
|
|
841
|
+
url: string;
|
|
839
842
|
} | {
|
|
840
843
|
type: "streamText";
|
|
841
844
|
stream: () => AsyncIterable<string>;
|
|
@@ -849,9 +852,6 @@ declare const editSchema: z.ZodObject<{
|
|
|
849
852
|
name?: string | undefined;
|
|
850
853
|
duration?: number | undefined;
|
|
851
854
|
size?: number | undefined;
|
|
852
|
-
} | {
|
|
853
|
-
type: "richlink";
|
|
854
|
-
url: string;
|
|
855
855
|
} | {
|
|
856
856
|
type: "app";
|
|
857
857
|
url: z.core.$InferOuterFunctionType<z.ZodTuple<readonly [], null>, z.ZodPromise<z.ZodURL>>;
|
|
@@ -1138,14 +1138,6 @@ declare function rename(displayName: string): ContentBuilder;
|
|
|
1138
1138
|
declare const replySchema: z.ZodObject<{
|
|
1139
1139
|
type: z.ZodLiteral<"reply">;
|
|
1140
1140
|
content: z.ZodCustom<{
|
|
1141
|
-
type: "attachment";
|
|
1142
|
-
id: string;
|
|
1143
|
-
name: string;
|
|
1144
|
-
mimeType: string;
|
|
1145
|
-
read: z.core.$InferOuterFunctionType<z.ZodTuple<readonly [], null>, z.ZodPromise<z.ZodCustom<Buffer<ArrayBufferLike>, Buffer<ArrayBufferLike>>>>;
|
|
1146
|
-
stream: z.core.$InferOuterFunctionType<z.ZodTuple<readonly [], null>, z.ZodPromise<z.ZodCustom<ReadableStream<unknown>, ReadableStream<unknown>>>>;
|
|
1147
|
-
size?: number | undefined;
|
|
1148
|
-
} | {
|
|
1149
1141
|
type: "contact";
|
|
1150
1142
|
user?: {
|
|
1151
1143
|
__platform: string;
|
|
@@ -1188,6 +1180,14 @@ declare const replySchema: z.ZodObject<{
|
|
|
1188
1180
|
read: z.core.$InferOuterFunctionType<z.ZodTuple<readonly [], null>, z.ZodPromise<z.ZodCustom<Buffer<ArrayBufferLike>, Buffer<ArrayBufferLike>>>>;
|
|
1189
1181
|
} | undefined;
|
|
1190
1182
|
raw?: unknown;
|
|
1183
|
+
} | {
|
|
1184
|
+
type: "attachment";
|
|
1185
|
+
id: string;
|
|
1186
|
+
name: string;
|
|
1187
|
+
mimeType: string;
|
|
1188
|
+
read: z.core.$InferOuterFunctionType<z.ZodTuple<readonly [], null>, z.ZodPromise<z.ZodCustom<Buffer<ArrayBufferLike>, Buffer<ArrayBufferLike>>>>;
|
|
1189
|
+
stream: z.core.$InferOuterFunctionType<z.ZodTuple<readonly [], null>, z.ZodPromise<z.ZodCustom<ReadableStream<unknown>, ReadableStream<unknown>>>>;
|
|
1190
|
+
size?: number | undefined;
|
|
1191
1191
|
} | {
|
|
1192
1192
|
type: "custom";
|
|
1193
1193
|
raw: unknown;
|
|
@@ -1224,6 +1224,9 @@ declare const replySchema: z.ZodObject<{
|
|
|
1224
1224
|
type: "reaction";
|
|
1225
1225
|
emoji: string;
|
|
1226
1226
|
target: Message<string, User, Space<unknown>>;
|
|
1227
|
+
} | {
|
|
1228
|
+
type: "richlink";
|
|
1229
|
+
url: string;
|
|
1227
1230
|
} | {
|
|
1228
1231
|
type: "streamText";
|
|
1229
1232
|
stream: () => AsyncIterable<string>;
|
|
@@ -1237,9 +1240,6 @@ declare const replySchema: z.ZodObject<{
|
|
|
1237
1240
|
name?: string | undefined;
|
|
1238
1241
|
duration?: number | undefined;
|
|
1239
1242
|
size?: number | undefined;
|
|
1240
|
-
} | {
|
|
1241
|
-
type: "richlink";
|
|
1242
|
-
url: string;
|
|
1243
1243
|
} | {
|
|
1244
1244
|
type: "app";
|
|
1245
1245
|
url: z.core.$InferOuterFunctionType<z.ZodTuple<readonly [], null>, z.ZodPromise<z.ZodURL>>;
|
|
@@ -1296,14 +1296,6 @@ declare const replySchema: z.ZodObject<{
|
|
|
1296
1296
|
} | {
|
|
1297
1297
|
type: "leaveSpace";
|
|
1298
1298
|
}, {
|
|
1299
|
-
type: "attachment";
|
|
1300
|
-
id: string;
|
|
1301
|
-
name: string;
|
|
1302
|
-
mimeType: string;
|
|
1303
|
-
read: z.core.$InferOuterFunctionType<z.ZodTuple<readonly [], null>, z.ZodPromise<z.ZodCustom<Buffer<ArrayBufferLike>, Buffer<ArrayBufferLike>>>>;
|
|
1304
|
-
stream: z.core.$InferOuterFunctionType<z.ZodTuple<readonly [], null>, z.ZodPromise<z.ZodCustom<ReadableStream<unknown>, ReadableStream<unknown>>>>;
|
|
1305
|
-
size?: number | undefined;
|
|
1306
|
-
} | {
|
|
1307
1299
|
type: "contact";
|
|
1308
1300
|
user?: {
|
|
1309
1301
|
__platform: string;
|
|
@@ -1346,6 +1338,14 @@ declare const replySchema: z.ZodObject<{
|
|
|
1346
1338
|
read: z.core.$InferOuterFunctionType<z.ZodTuple<readonly [], null>, z.ZodPromise<z.ZodCustom<Buffer<ArrayBufferLike>, Buffer<ArrayBufferLike>>>>;
|
|
1347
1339
|
} | undefined;
|
|
1348
1340
|
raw?: unknown;
|
|
1341
|
+
} | {
|
|
1342
|
+
type: "attachment";
|
|
1343
|
+
id: string;
|
|
1344
|
+
name: string;
|
|
1345
|
+
mimeType: string;
|
|
1346
|
+
read: z.core.$InferOuterFunctionType<z.ZodTuple<readonly [], null>, z.ZodPromise<z.ZodCustom<Buffer<ArrayBufferLike>, Buffer<ArrayBufferLike>>>>;
|
|
1347
|
+
stream: z.core.$InferOuterFunctionType<z.ZodTuple<readonly [], null>, z.ZodPromise<z.ZodCustom<ReadableStream<unknown>, ReadableStream<unknown>>>>;
|
|
1348
|
+
size?: number | undefined;
|
|
1349
1349
|
} | {
|
|
1350
1350
|
type: "custom";
|
|
1351
1351
|
raw: unknown;
|
|
@@ -1382,6 +1382,9 @@ declare const replySchema: z.ZodObject<{
|
|
|
1382
1382
|
type: "reaction";
|
|
1383
1383
|
emoji: string;
|
|
1384
1384
|
target: Message<string, User, Space<unknown>>;
|
|
1385
|
+
} | {
|
|
1386
|
+
type: "richlink";
|
|
1387
|
+
url: string;
|
|
1385
1388
|
} | {
|
|
1386
1389
|
type: "streamText";
|
|
1387
1390
|
stream: () => AsyncIterable<string>;
|
|
@@ -1395,9 +1398,6 @@ declare const replySchema: z.ZodObject<{
|
|
|
1395
1398
|
name?: string | undefined;
|
|
1396
1399
|
duration?: number | undefined;
|
|
1397
1400
|
size?: number | undefined;
|
|
1398
|
-
} | {
|
|
1399
|
-
type: "richlink";
|
|
1400
|
-
url: string;
|
|
1401
1401
|
} | {
|
|
1402
1402
|
type: "app";
|
|
1403
1403
|
url: z.core.$InferOuterFunctionType<z.ZodTuple<readonly [], null>, z.ZodPromise<z.ZodURL>>;
|
|
@@ -6170,6 +6170,15 @@ interface ManagedStream<T> extends AsyncIterable<T> {
|
|
|
6170
6170
|
}
|
|
6171
6171
|
type StreamCleanup = void | (() => void | Promise<void>);
|
|
6172
6172
|
declare function stream<T>(setup: (emit: (value: T) => Promise<void>, end: (error?: unknown) => void) => StreamCleanup | Promise<StreamCleanup>): ManagedStream<T>;
|
|
6173
|
+
/**
|
|
6174
|
+
* Merges a fixed set of streams. The result represents all of them: it ends
|
|
6175
|
+
* once every member has ended — immediately, for an empty set — and one
|
|
6176
|
+
* member's error ends the whole merge.
|
|
6177
|
+
*
|
|
6178
|
+
* For a set that changes while the stream runs, use `createStreamGroup`
|
|
6179
|
+
* (`@spectrum-ts/core/authoring`), which ends only on `close()` and drops a
|
|
6180
|
+
* failed member instead of tearing down its siblings.
|
|
6181
|
+
*/
|
|
6173
6182
|
declare function mergeStreams<T>(streams: readonly ManagedStream<T>[]): ManagedStream<T>;
|
|
6174
6183
|
interface Broadcaster<T> {
|
|
6175
6184
|
close(): Promise<void>;
|
|
@@ -7283,14 +7292,6 @@ declare const contentSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
7283
7292
|
}, z.core.$strip>, z.ZodObject<{
|
|
7284
7293
|
type: z.ZodLiteral<"reply">;
|
|
7285
7294
|
content: z.ZodCustom<{
|
|
7286
|
-
type: "attachment";
|
|
7287
|
-
id: string;
|
|
7288
|
-
name: string;
|
|
7289
|
-
mimeType: string;
|
|
7290
|
-
read: z.core.$InferOuterFunctionType<z.ZodTuple<readonly [], null>, z.ZodPromise<z.ZodCustom<Buffer<ArrayBufferLike>, Buffer<ArrayBufferLike>>>>;
|
|
7291
|
-
stream: z.core.$InferOuterFunctionType<z.ZodTuple<readonly [], null>, z.ZodPromise<z.ZodCustom<ReadableStream<unknown>, ReadableStream<unknown>>>>;
|
|
7292
|
-
size?: number | undefined;
|
|
7293
|
-
} | {
|
|
7294
7295
|
type: "contact";
|
|
7295
7296
|
user?: {
|
|
7296
7297
|
__platform: string;
|
|
@@ -7333,6 +7334,14 @@ declare const contentSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
7333
7334
|
read: z.core.$InferOuterFunctionType<z.ZodTuple<readonly [], null>, z.ZodPromise<z.ZodCustom<Buffer<ArrayBufferLike>, Buffer<ArrayBufferLike>>>>;
|
|
7334
7335
|
} | undefined;
|
|
7335
7336
|
raw?: unknown;
|
|
7337
|
+
} | {
|
|
7338
|
+
type: "attachment";
|
|
7339
|
+
id: string;
|
|
7340
|
+
name: string;
|
|
7341
|
+
mimeType: string;
|
|
7342
|
+
read: z.core.$InferOuterFunctionType<z.ZodTuple<readonly [], null>, z.ZodPromise<z.ZodCustom<Buffer<ArrayBufferLike>, Buffer<ArrayBufferLike>>>>;
|
|
7343
|
+
stream: z.core.$InferOuterFunctionType<z.ZodTuple<readonly [], null>, z.ZodPromise<z.ZodCustom<ReadableStream<unknown>, ReadableStream<unknown>>>>;
|
|
7344
|
+
size?: number | undefined;
|
|
7336
7345
|
} | {
|
|
7337
7346
|
type: "custom";
|
|
7338
7347
|
raw: unknown;
|
|
@@ -7369,6 +7378,9 @@ declare const contentSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
7369
7378
|
type: "reaction";
|
|
7370
7379
|
emoji: string;
|
|
7371
7380
|
target: Message<string, User, Space<unknown>>;
|
|
7381
|
+
} | {
|
|
7382
|
+
type: "richlink";
|
|
7383
|
+
url: string;
|
|
7372
7384
|
} | {
|
|
7373
7385
|
type: "streamText";
|
|
7374
7386
|
stream: () => AsyncIterable<string>;
|
|
@@ -7382,9 +7394,6 @@ declare const contentSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
7382
7394
|
name?: string | undefined;
|
|
7383
7395
|
duration?: number | undefined;
|
|
7384
7396
|
size?: number | undefined;
|
|
7385
|
-
} | {
|
|
7386
|
-
type: "richlink";
|
|
7387
|
-
url: string;
|
|
7388
7397
|
} | {
|
|
7389
7398
|
type: "app";
|
|
7390
7399
|
url: z.core.$InferOuterFunctionType<z.ZodTuple<readonly [], null>, z.ZodPromise<z.ZodURL>>;
|
|
@@ -7441,14 +7450,6 @@ declare const contentSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
7441
7450
|
} | {
|
|
7442
7451
|
type: "leaveSpace";
|
|
7443
7452
|
}, {
|
|
7444
|
-
type: "attachment";
|
|
7445
|
-
id: string;
|
|
7446
|
-
name: string;
|
|
7447
|
-
mimeType: string;
|
|
7448
|
-
read: z.core.$InferOuterFunctionType<z.ZodTuple<readonly [], null>, z.ZodPromise<z.ZodCustom<Buffer<ArrayBufferLike>, Buffer<ArrayBufferLike>>>>;
|
|
7449
|
-
stream: z.core.$InferOuterFunctionType<z.ZodTuple<readonly [], null>, z.ZodPromise<z.ZodCustom<ReadableStream<unknown>, ReadableStream<unknown>>>>;
|
|
7450
|
-
size?: number | undefined;
|
|
7451
|
-
} | {
|
|
7452
7453
|
type: "contact";
|
|
7453
7454
|
user?: {
|
|
7454
7455
|
__platform: string;
|
|
@@ -7491,6 +7492,14 @@ declare const contentSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
7491
7492
|
read: z.core.$InferOuterFunctionType<z.ZodTuple<readonly [], null>, z.ZodPromise<z.ZodCustom<Buffer<ArrayBufferLike>, Buffer<ArrayBufferLike>>>>;
|
|
7492
7493
|
} | undefined;
|
|
7493
7494
|
raw?: unknown;
|
|
7495
|
+
} | {
|
|
7496
|
+
type: "attachment";
|
|
7497
|
+
id: string;
|
|
7498
|
+
name: string;
|
|
7499
|
+
mimeType: string;
|
|
7500
|
+
read: z.core.$InferOuterFunctionType<z.ZodTuple<readonly [], null>, z.ZodPromise<z.ZodCustom<Buffer<ArrayBufferLike>, Buffer<ArrayBufferLike>>>>;
|
|
7501
|
+
stream: z.core.$InferOuterFunctionType<z.ZodTuple<readonly [], null>, z.ZodPromise<z.ZodCustom<ReadableStream<unknown>, ReadableStream<unknown>>>>;
|
|
7502
|
+
size?: number | undefined;
|
|
7494
7503
|
} | {
|
|
7495
7504
|
type: "custom";
|
|
7496
7505
|
raw: unknown;
|
|
@@ -7527,6 +7536,9 @@ declare const contentSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
7527
7536
|
type: "reaction";
|
|
7528
7537
|
emoji: string;
|
|
7529
7538
|
target: Message<string, User, Space<unknown>>;
|
|
7539
|
+
} | {
|
|
7540
|
+
type: "richlink";
|
|
7541
|
+
url: string;
|
|
7530
7542
|
} | {
|
|
7531
7543
|
type: "streamText";
|
|
7532
7544
|
stream: () => AsyncIterable<string>;
|
|
@@ -7540,9 +7552,6 @@ declare const contentSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
7540
7552
|
name?: string | undefined;
|
|
7541
7553
|
duration?: number | undefined;
|
|
7542
7554
|
size?: number | undefined;
|
|
7543
|
-
} | {
|
|
7544
|
-
type: "richlink";
|
|
7545
|
-
url: string;
|
|
7546
7555
|
} | {
|
|
7547
7556
|
type: "app";
|
|
7548
7557
|
url: z.core.$InferOuterFunctionType<z.ZodTuple<readonly [], null>, z.ZodPromise<z.ZodURL>>;
|
|
@@ -7603,14 +7612,6 @@ declare const contentSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
7603
7612
|
}, z.core.$strip>, z.ZodObject<{
|
|
7604
7613
|
type: z.ZodLiteral<"edit">;
|
|
7605
7614
|
content: z.ZodCustom<{
|
|
7606
|
-
type: "attachment";
|
|
7607
|
-
id: string;
|
|
7608
|
-
name: string;
|
|
7609
|
-
mimeType: string;
|
|
7610
|
-
read: z.core.$InferOuterFunctionType<z.ZodTuple<readonly [], null>, z.ZodPromise<z.ZodCustom<Buffer<ArrayBufferLike>, Buffer<ArrayBufferLike>>>>;
|
|
7611
|
-
stream: z.core.$InferOuterFunctionType<z.ZodTuple<readonly [], null>, z.ZodPromise<z.ZodCustom<ReadableStream<unknown>, ReadableStream<unknown>>>>;
|
|
7612
|
-
size?: number | undefined;
|
|
7613
|
-
} | {
|
|
7614
7615
|
type: "contact";
|
|
7615
7616
|
user?: {
|
|
7616
7617
|
__platform: string;
|
|
@@ -7653,6 +7654,14 @@ declare const contentSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
7653
7654
|
read: z.core.$InferOuterFunctionType<z.ZodTuple<readonly [], null>, z.ZodPromise<z.ZodCustom<Buffer<ArrayBufferLike>, Buffer<ArrayBufferLike>>>>;
|
|
7654
7655
|
} | undefined;
|
|
7655
7656
|
raw?: unknown;
|
|
7657
|
+
} | {
|
|
7658
|
+
type: "attachment";
|
|
7659
|
+
id: string;
|
|
7660
|
+
name: string;
|
|
7661
|
+
mimeType: string;
|
|
7662
|
+
read: z.core.$InferOuterFunctionType<z.ZodTuple<readonly [], null>, z.ZodPromise<z.ZodCustom<Buffer<ArrayBufferLike>, Buffer<ArrayBufferLike>>>>;
|
|
7663
|
+
stream: z.core.$InferOuterFunctionType<z.ZodTuple<readonly [], null>, z.ZodPromise<z.ZodCustom<ReadableStream<unknown>, ReadableStream<unknown>>>>;
|
|
7664
|
+
size?: number | undefined;
|
|
7656
7665
|
} | {
|
|
7657
7666
|
type: "custom";
|
|
7658
7667
|
raw: unknown;
|
|
@@ -7689,6 +7698,9 @@ declare const contentSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
7689
7698
|
type: "reaction";
|
|
7690
7699
|
emoji: string;
|
|
7691
7700
|
target: Message<string, User, Space<unknown>>;
|
|
7701
|
+
} | {
|
|
7702
|
+
type: "richlink";
|
|
7703
|
+
url: string;
|
|
7692
7704
|
} | {
|
|
7693
7705
|
type: "streamText";
|
|
7694
7706
|
stream: () => AsyncIterable<string>;
|
|
@@ -7702,9 +7714,6 @@ declare const contentSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
7702
7714
|
name?: string | undefined;
|
|
7703
7715
|
duration?: number | undefined;
|
|
7704
7716
|
size?: number | undefined;
|
|
7705
|
-
} | {
|
|
7706
|
-
type: "richlink";
|
|
7707
|
-
url: string;
|
|
7708
7717
|
} | {
|
|
7709
7718
|
type: "app";
|
|
7710
7719
|
url: z.core.$InferOuterFunctionType<z.ZodTuple<readonly [], null>, z.ZodPromise<z.ZodURL>>;
|
|
@@ -7761,14 +7770,6 @@ declare const contentSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
7761
7770
|
} | {
|
|
7762
7771
|
type: "leaveSpace";
|
|
7763
7772
|
}, {
|
|
7764
|
-
type: "attachment";
|
|
7765
|
-
id: string;
|
|
7766
|
-
name: string;
|
|
7767
|
-
mimeType: string;
|
|
7768
|
-
read: z.core.$InferOuterFunctionType<z.ZodTuple<readonly [], null>, z.ZodPromise<z.ZodCustom<Buffer<ArrayBufferLike>, Buffer<ArrayBufferLike>>>>;
|
|
7769
|
-
stream: z.core.$InferOuterFunctionType<z.ZodTuple<readonly [], null>, z.ZodPromise<z.ZodCustom<ReadableStream<unknown>, ReadableStream<unknown>>>>;
|
|
7770
|
-
size?: number | undefined;
|
|
7771
|
-
} | {
|
|
7772
7773
|
type: "contact";
|
|
7773
7774
|
user?: {
|
|
7774
7775
|
__platform: string;
|
|
@@ -7811,6 +7812,14 @@ declare const contentSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
7811
7812
|
read: z.core.$InferOuterFunctionType<z.ZodTuple<readonly [], null>, z.ZodPromise<z.ZodCustom<Buffer<ArrayBufferLike>, Buffer<ArrayBufferLike>>>>;
|
|
7812
7813
|
} | undefined;
|
|
7813
7814
|
raw?: unknown;
|
|
7815
|
+
} | {
|
|
7816
|
+
type: "attachment";
|
|
7817
|
+
id: string;
|
|
7818
|
+
name: string;
|
|
7819
|
+
mimeType: string;
|
|
7820
|
+
read: z.core.$InferOuterFunctionType<z.ZodTuple<readonly [], null>, z.ZodPromise<z.ZodCustom<Buffer<ArrayBufferLike>, Buffer<ArrayBufferLike>>>>;
|
|
7821
|
+
stream: z.core.$InferOuterFunctionType<z.ZodTuple<readonly [], null>, z.ZodPromise<z.ZodCustom<ReadableStream<unknown>, ReadableStream<unknown>>>>;
|
|
7822
|
+
size?: number | undefined;
|
|
7814
7823
|
} | {
|
|
7815
7824
|
type: "custom";
|
|
7816
7825
|
raw: unknown;
|
|
@@ -7847,6 +7856,9 @@ declare const contentSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
7847
7856
|
type: "reaction";
|
|
7848
7857
|
emoji: string;
|
|
7849
7858
|
target: Message<string, User, Space<unknown>>;
|
|
7859
|
+
} | {
|
|
7860
|
+
type: "richlink";
|
|
7861
|
+
url: string;
|
|
7850
7862
|
} | {
|
|
7851
7863
|
type: "streamText";
|
|
7852
7864
|
stream: () => AsyncIterable<string>;
|
|
@@ -7860,9 +7872,6 @@ declare const contentSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
7860
7872
|
name?: string | undefined;
|
|
7861
7873
|
duration?: number | undefined;
|
|
7862
7874
|
size?: number | undefined;
|
|
7863
|
-
} | {
|
|
7864
|
-
type: "richlink";
|
|
7865
|
-
url: string;
|
|
7866
7875
|
} | {
|
|
7867
7876
|
type: "app";
|
|
7868
7877
|
url: z.core.$InferOuterFunctionType<z.ZodTuple<readonly [], null>, z.ZodPromise<z.ZodURL>>;
|
package/dist/authoring.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Bt as readSchema, Dt as asRichlink, Fn as asContact, Gn as buildPhotoAction, Gt as asPoll, H as ProviderMessageRecord, It as renameSchema, Kn as photoActionSchema, Kt as asPollOption, Nt as replySchema, Rt as asRead, Sn as asReaction, Tn as asCustom, U as ProviderUserRecord, Un as avatarSchema, Wn as PhotoInput, Xt as asMarkdown, _n as leaveSpaceSchema, _t as asVoice, an as groupSchema, bt as asUnsend, hn as addMemberSchema, jt as asReply, q as ManagedStream, r as asAttachment, rn as asGroup, wn as reactionSchema, wt as asText, yn as removeMemberSchema } from "./attachment-
|
|
1
|
+
import { Bt as readSchema, Dt as asRichlink, Fn as asContact, Gn as buildPhotoAction, Gt as asPoll, H as ProviderMessageRecord, It as renameSchema, Kn as photoActionSchema, Kt as asPollOption, Nt as replySchema, Rt as asRead, Sn as asReaction, Tn as asCustom, U as ProviderUserRecord, Un as avatarSchema, Wn as PhotoInput, Xt as asMarkdown, _n as leaveSpaceSchema, _t as asVoice, an as groupSchema, bt as asUnsend, hn as addMemberSchema, jt as asReply, q as ManagedStream, r as asAttachment, rn as asGroup, wn as reactionSchema, wt as asText, yn as removeMemberSchema } from "./attachment-CWfyVjJ6.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";
|
|
@@ -167,6 +167,55 @@ interface ResumableOrderedStreamOptions<TLive, TMissed, TOutput> {
|
|
|
167
167
|
*/
|
|
168
168
|
declare const resumableOrderedStream: <TLive, TMissed, TOutput>(options: ResumableOrderedStreamOptions<TLive, TMissed, TOutput>) => ManagedStream<TOutput>;
|
|
169
169
|
//#endregion
|
|
170
|
+
//#region src/utils/stream-group.d.ts
|
|
171
|
+
/**
|
|
172
|
+
* Builds a member stream. Invoked once per attach — and again on re-attach, so
|
|
173
|
+
* a member that faulted can be revived by adding its key back.
|
|
174
|
+
*/
|
|
175
|
+
type StreamGroupSource<T> = () => ManagedStream<T>;
|
|
176
|
+
interface StreamGroupOptions {
|
|
177
|
+
/** Log provenance, e.g. `"imessage.messages"`. */
|
|
178
|
+
label?: string;
|
|
179
|
+
}
|
|
180
|
+
interface StreamGroup<T> extends ManagedStream<T> {
|
|
181
|
+
/**
|
|
182
|
+
* Attach `key`. Returns false — without invoking `source`, which typically
|
|
183
|
+
* opens a subscription — when the key is already attached or the group is
|
|
184
|
+
* closed. Safe before the group has a consumer: the factory runs when the
|
|
185
|
+
* group first starts.
|
|
186
|
+
*/
|
|
187
|
+
add(key: string, source: StreamGroupSource<T>): boolean;
|
|
188
|
+
has(key: string): boolean;
|
|
189
|
+
/** Attached keys, in attach order. */
|
|
190
|
+
keys(): string[];
|
|
191
|
+
/**
|
|
192
|
+
* Detach `key` and close its source. Resolves once that source's own
|
|
193
|
+
* `close()` settles; it deliberately does not wait on the member's worker,
|
|
194
|
+
* which unparks only when the group's consumer pulls. Returns false when the
|
|
195
|
+
* key was not attached.
|
|
196
|
+
*/
|
|
197
|
+
remove(key: string): Promise<boolean>;
|
|
198
|
+
}
|
|
199
|
+
/**
|
|
200
|
+
* A merged stream whose membership can change while it runs.
|
|
201
|
+
*
|
|
202
|
+
* Sibling of `mergeStreams`, with a deliberately different lifetime contract —
|
|
203
|
+
* pick by whether the source set is fixed:
|
|
204
|
+
*
|
|
205
|
+
* - `mergeStreams` merges a *fixed* set. Its result represents all of them:
|
|
206
|
+
* it ends when they have all ended (immediately, for an empty set) and one
|
|
207
|
+
* member's error ends the whole merge.
|
|
208
|
+
* - `createStreamGroup` owns a *mutable* set. It ends only via `close()` —
|
|
209
|
+
* zero members parks the consumer rather than ending it, so a set that is
|
|
210
|
+
* briefly empty mid-reconcile does not terminate the stream — and a member
|
|
211
|
+
* that fails is logged and dropped while its siblings keep running.
|
|
212
|
+
*
|
|
213
|
+
* Dropping a faulted member (rather than restarting it here) keeps retry policy
|
|
214
|
+
* with the caller that knows the real inventory: `keys()` stops reporting it, so
|
|
215
|
+
* the caller's next reconcile re-adds it through `add`.
|
|
216
|
+
*/
|
|
217
|
+
declare function createStreamGroup<T>(options?: StreamGroupOptions): StreamGroup<T>;
|
|
218
|
+
//#endregion
|
|
170
219
|
//#region src/utils/telemetry.d.ts
|
|
171
220
|
/**
|
|
172
221
|
* Structured attributes for an unknown thrown value: its type, sanitized
|
|
@@ -192,4 +241,4 @@ interface TokenRenewalOptions {
|
|
|
192
241
|
}
|
|
193
242
|
declare const createTokenRenewal: (options: TokenRenewalOptions) => TokenRenewal;
|
|
194
243
|
//#endregion
|
|
195
|
-
export { type CloseableAsyncIterable, type LogAttrs, type LogLevel, type PhotoInput, type PhotonLogger, type ProviderMessageRecord, type ProviderUserRecord, type ResumableStreamItem, type SanitizeUrlOptions, type TokenRenewal, type TokenRenewalOptions, addMemberSchema, asAttachment, asContact, asCustom, asGroup, asMarkdown, asPoll, asPollOption, asReaction, asRead, asReply, asRichlink, asText, asUnsend, asVoice, avatarSchema, buildPhotoAction, createLogger, createTokenRenewal, ensureM4a, envAwareConfig, envFor, errorAttrs, fromEnv, groupSchema, leaveSpaceSchema, messageEffectSchema, photoActionSchema, reactionSchema, readSchema, removeMemberSchema, renameSchema, renderInlineTokens, replySchema, resumableOrderedStream, sanitizeEmail, sanitizeErrorMessage, sanitizePhone, sanitizeUrl, setLogLevel, tracedFetch };
|
|
244
|
+
export { type CloseableAsyncIterable, type LogAttrs, type LogLevel, type PhotoInput, type PhotonLogger, type ProviderMessageRecord, type ProviderUserRecord, type ResumableStreamItem, type SanitizeUrlOptions, type StreamGroup, type StreamGroupOptions, type StreamGroupSource, type TokenRenewal, type TokenRenewalOptions, addMemberSchema, asAttachment, asContact, asCustom, asGroup, asMarkdown, asPoll, asPollOption, asReaction, asRead, asReply, asRichlink, asText, asUnsend, asVoice, avatarSchema, buildPhotoAction, createLogger, createStreamGroup, createTokenRenewal, ensureM4a, envAwareConfig, envFor, errorAttrs, fromEnv, groupSchema, leaveSpaceSchema, messageEffectSchema, photoActionSchema, reactionSchema, readSchema, removeMemberSchema, renameSchema, renderInlineTokens, replySchema, resumableOrderedStream, sanitizeEmail, sanitizeErrorMessage, sanitizePhone, sanitizeUrl, setLogLevel, tracedFetch };
|
package/dist/authoring.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { C as replySchema, E as asRead, G as asGroup, H as asMarkdown, L as addMemberSchema, M as asPoll, N as asPollOption, O as readSchema, T as renameSchema, V as removeMemberSchema, W as markdownSchema, Y as asText, Z as textSchema, _ as asUnsend, a as createTokenRenewal, ct as buildPhotoAction, et as asCustom, f as envAwareConfig, ft as attachmentSchema, h as asVoice, i as stream, j as reactionSchema, k as asReaction, lt as photoActionSchema, m as fromEnv, mt as tracedFetch, nt as asContact, p as envFor, q as groupSchema, s as errorAttrs, st as avatarSchema, u as renderInlineTokens, ut as asAttachment, x as asReply, y as asRichlink, z as leaveSpaceSchema } from "./stream-
|
|
1
|
+
import { C as replySchema, E as asRead, G as asGroup, H as asMarkdown, L as addMemberSchema, M as asPoll, N as asPollOption, O as readSchema, T as renameSchema, V as removeMemberSchema, W as markdownSchema, Y as asText, Z as textSchema, _ as asUnsend, a as createTokenRenewal, ct as buildPhotoAction, et as asCustom, f as envAwareConfig, ft as attachmentSchema, h as asVoice, i as stream, j as reactionSchema, k as asReaction, lt as photoActionSchema, m as fromEnv, mt as tracedFetch, nt as asContact, p as envFor, q as groupSchema, s as errorAttrs, st as avatarSchema, u as renderInlineTokens, ut as asAttachment, x as asReply, y as asRichlink, z as leaveSpaceSchema } from "./stream-t0CbOOUT.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,99 @@ const resumableOrderedStream = (options) => stream((emit, end) => {
|
|
|
422
422
|
};
|
|
423
423
|
});
|
|
424
424
|
//#endregion
|
|
425
|
-
|
|
425
|
+
//#region src/utils/stream-group.ts
|
|
426
|
+
const groupLog = createLogger$1("spectrum.stream");
|
|
427
|
+
/**
|
|
428
|
+
* A merged stream whose membership can change while it runs.
|
|
429
|
+
*
|
|
430
|
+
* Sibling of `mergeStreams`, with a deliberately different lifetime contract —
|
|
431
|
+
* pick by whether the source set is fixed:
|
|
432
|
+
*
|
|
433
|
+
* - `mergeStreams` merges a *fixed* set. Its result represents all of them:
|
|
434
|
+
* it ends when they have all ended (immediately, for an empty set) and one
|
|
435
|
+
* member's error ends the whole merge.
|
|
436
|
+
* - `createStreamGroup` owns a *mutable* set. It ends only via `close()` —
|
|
437
|
+
* zero members parks the consumer rather than ending it, so a set that is
|
|
438
|
+
* briefly empty mid-reconcile does not terminate the stream — and a member
|
|
439
|
+
* that fails is logged and dropped while its siblings keep running.
|
|
440
|
+
*
|
|
441
|
+
* Dropping a faulted member (rather than restarting it here) keeps retry policy
|
|
442
|
+
* with the caller that knows the real inventory: `keys()` stops reporting it, so
|
|
443
|
+
* the caller's next reconcile re-adds it through `add`.
|
|
444
|
+
*/
|
|
445
|
+
function createStreamGroup(options = {}) {
|
|
446
|
+
const label = options.label ?? "stream-group";
|
|
447
|
+
const members = /* @__PURE__ */ new Map();
|
|
448
|
+
let closed = false;
|
|
449
|
+
let spawn;
|
|
450
|
+
const memberAttrs = (key) => ({
|
|
451
|
+
"spectrum.stream.group": label,
|
|
452
|
+
"spectrum.stream.member": key
|
|
453
|
+
});
|
|
454
|
+
const reportMemberExit = (key, member, error) => {
|
|
455
|
+
if (member.detached) return;
|
|
456
|
+
if (error === void 0) {
|
|
457
|
+
groupLog.error("stream group member ended unexpectedly", memberAttrs(key));
|
|
458
|
+
return;
|
|
459
|
+
}
|
|
460
|
+
groupLog.error("stream group member failed", {
|
|
461
|
+
...memberAttrs(key),
|
|
462
|
+
...errorAttrs(error)
|
|
463
|
+
}, error instanceof Error ? error : void 0);
|
|
464
|
+
};
|
|
465
|
+
const runMember = async (key, member, emit) => {
|
|
466
|
+
try {
|
|
467
|
+
const source = member.factory();
|
|
468
|
+
member.source = source;
|
|
469
|
+
for await (const value of source) await emit(value);
|
|
470
|
+
reportMemberExit(key, member);
|
|
471
|
+
} catch (error) {
|
|
472
|
+
reportMemberExit(key, member, error ?? /* @__PURE__ */ new Error("unknown stream error"));
|
|
473
|
+
} finally {
|
|
474
|
+
if (members.get(key) === member) members.delete(key);
|
|
475
|
+
}
|
|
476
|
+
};
|
|
477
|
+
const base = stream((emit) => {
|
|
478
|
+
spawn = (key, member) => {
|
|
479
|
+
member.worker = runMember(key, member, emit);
|
|
480
|
+
};
|
|
481
|
+
for (const [key, member] of members) spawn(key, member);
|
|
482
|
+
return async () => {
|
|
483
|
+
closed = true;
|
|
484
|
+
spawn = void 0;
|
|
485
|
+
const attached = Array.from(members.values());
|
|
486
|
+
for (const member of attached) member.detached = true;
|
|
487
|
+
await Promise.allSettled(attached.map((member) => member.source?.close()));
|
|
488
|
+
await Promise.allSettled(attached.map((member) => member.worker));
|
|
489
|
+
};
|
|
490
|
+
});
|
|
491
|
+
const closeBase = base.close.bind(base);
|
|
492
|
+
return Object.assign(base, {
|
|
493
|
+
add: (key, source) => {
|
|
494
|
+
if (closed || members.has(key)) return false;
|
|
495
|
+
const member = {
|
|
496
|
+
detached: false,
|
|
497
|
+
factory: source
|
|
498
|
+
};
|
|
499
|
+
members.set(key, member);
|
|
500
|
+
spawn?.(key, member);
|
|
501
|
+
return true;
|
|
502
|
+
},
|
|
503
|
+
close: async () => {
|
|
504
|
+
closed = true;
|
|
505
|
+
await closeBase();
|
|
506
|
+
},
|
|
507
|
+
has: (key) => members.has(key),
|
|
508
|
+
keys: () => Array.from(members.keys()),
|
|
509
|
+
remove: async (key) => {
|
|
510
|
+
const member = members.get(key);
|
|
511
|
+
if (!member) return false;
|
|
512
|
+
member.detached = true;
|
|
513
|
+
members.delete(key);
|
|
514
|
+
await member.source?.close();
|
|
515
|
+
return true;
|
|
516
|
+
}
|
|
517
|
+
});
|
|
518
|
+
}
|
|
519
|
+
//#endregion
|
|
520
|
+
export { addMemberSchema, asAttachment, asContact, asCustom, asGroup, asMarkdown, asPoll, asPollOption, asReaction, asRead, asReply, asRichlink, asText, asUnsend, asVoice, avatarSchema, buildPhotoAction, createLogger, createStreamGroup, createTokenRenewal, ensureM4a, envAwareConfig, envFor, errorAttrs, fromEnv, groupSchema, leaveSpaceSchema, messageEffectSchema, photoActionSchema, reactionSchema, readSchema, 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 StreamText, A as isFusorEvent, An as ContactEmail, At as Reply, B as PlatformUser, Bn as AvatarData, C as FusorVerify, Cn as reaction, Ct as typing, D as WebhookRawResult, Dn as Contact, E as WebhookRawRequest, En as custom, Et as Richlink, F as PlatformInstance, Ft as rename, G as SpaceNamespace, Hn as avatar, Ht as PollChoice, I as PlatformMessage, In as contact, J as broadcast, Jn as AppLayout, Jt as poll, K as Broadcaster, L as PlatformProviderConfig, Ln as AgentSender, Lt as Read, M as EventProducer, Mn as ContactName, Mt as reply, N as Platform, Nn as ContactOrg, O as FusorEvent, On as ContactAddress, Ot as richlink, P as PlatformDef, Pn as ContactPhone, Pt as Rename, Q as CloudPlatform, Qn as appLayoutSchema, Qt as DeltaExtractor, R as PlatformRuntime, Rn as User, S as FusorRespond, St as Typing, T as WebhookHandler, Tt as text, Ut as PollChoiceInput, V as ProviderMessage, Vn as AvatarInput, Vt as Poll, W as SchemaMessage, Wt as PollOption, X as stream, Xn as AppUrl, Y as mergeStreams, Yn as AppOptions, Yt as Markdown, Z as Store, Zn as app, Zt as markdown, _ as FusorClient, a as Content, at as ProjectProfile, b as FusorMessagesReturn, bn as Reaction, c as fromVCard, cn as Message, ct as SlackTokenData, d as UnsupportedKind, dn as LeaveSpace, dt as SubscriptionStatus, en as StreamTextSource, et as FusorTokenData, f as Spectrum, fn as MemberInput, ft as TokenData, g as isFusorClient, gn as leaveSpace, gt as Voice, h as fusor, ht as EmojiKey, i as attachment, in as group, it as ProjectData, j as AnyPlatformDef, jn as ContactInput, k as fusorEvent, kn as ContactDetails, kt as resolveContents, l as toVCard, ln as Space, lt as SpectrumCloudError, m as definePlatform, mn as addMember, mt as Emoji, n as AttachmentInput, nn as Group, nt as PlatformStatus, o as ContentBuilder, on as Edit, ot as SharedTokenData, p as SpectrumInstance, pn as RemoveMember, pt as cloud, q as ManagedStream, qn as App, qt as option, rt as PlatformsData, s as ContentInput, sn as edit, st as SlackTeamMeta, t as Attachment, tn as TextStreamOptions, tt as ImessageInfoData, u as UnsupportedError, un as AddMember, ut as SubscriptionData, v as FusorMessages, vn as removeMember, vt as voice, w as FusorVerifyRequest, x as FusorReply, xn as ReactionBuilder, xt as unsend, y as FusorMessagesCtx, yt as Unsend, z as PlatformSpace, zn as Avatar, zt as read } from "./attachment-
|
|
1
|
+
import { $ as DedicatedTokenData, $t as StreamText, A as isFusorEvent, An as ContactEmail, At as Reply, B as PlatformUser, Bn as AvatarData, C as FusorVerify, Cn as reaction, Ct as typing, D as WebhookRawResult, Dn as Contact, E as WebhookRawRequest, En as custom, Et as Richlink, F as PlatformInstance, Ft as rename, G as SpaceNamespace, Hn as avatar, Ht as PollChoice, I as PlatformMessage, In as contact, J as broadcast, Jn as AppLayout, Jt as poll, K as Broadcaster, L as PlatformProviderConfig, Ln as AgentSender, Lt as Read, M as EventProducer, Mn as ContactName, Mt as reply, N as Platform, Nn as ContactOrg, O as FusorEvent, On as ContactAddress, Ot as richlink, P as PlatformDef, Pn as ContactPhone, Pt as Rename, Q as CloudPlatform, Qn as appLayoutSchema, Qt as DeltaExtractor, R as PlatformRuntime, Rn as User, S as FusorRespond, St as Typing, T as WebhookHandler, Tt as text, Ut as PollChoiceInput, V as ProviderMessage, Vn as AvatarInput, Vt as Poll, W as SchemaMessage, Wt as PollOption, X as stream, Xn as AppUrl, Y as mergeStreams, Yn as AppOptions, Yt as Markdown, Z as Store, Zn as app, Zt as markdown, _ as FusorClient, a as Content, at as ProjectProfile, b as FusorMessagesReturn, bn as Reaction, c as fromVCard, cn as Message, ct as SlackTokenData, d as UnsupportedKind, dn as LeaveSpace, dt as SubscriptionStatus, en as StreamTextSource, et as FusorTokenData, f as Spectrum, fn as MemberInput, ft as TokenData, g as isFusorClient, gn as leaveSpace, gt as Voice, h as fusor, ht as EmojiKey, i as attachment, in as group, it as ProjectData, j as AnyPlatformDef, jn as ContactInput, k as fusorEvent, kn as ContactDetails, kt as resolveContents, l as toVCard, ln as Space, lt as SpectrumCloudError, m as definePlatform, mn as addMember, mt as Emoji, n as AttachmentInput, nn as Group, nt as PlatformStatus, o as ContentBuilder, on as Edit, ot as SharedTokenData, p as SpectrumInstance, pn as RemoveMember, pt as cloud, q as ManagedStream, qn as App, qt as option, rt as PlatformsData, s as ContentInput, sn as edit, st as SlackTeamMeta, t as Attachment, tn as TextStreamOptions, tt as ImessageInfoData, u as UnsupportedError, un as AddMember, ut as SubscriptionData, v as FusorMessages, vn as removeMember, vt as voice, w as FusorVerifyRequest, x as FusorReply, xn as ReactionBuilder, xt as unsend, y as FusorMessagesCtx, yt as Unsend, z as PlatformSpace, zn as Avatar, zt as read } from "./attachment-CWfyVjJ6.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 drainStreamText, A as reaction, B as removeMember, D as read, F as poll, H as asMarkdown, I as addMember, J as resolveContents, K as group, L as addMemberSchema, P as option, Q as StreamConsumedError, R as leaveSpace, S as reply, T as renameSchema, U as markdown, V as removeMemberSchema, X as text, Y as asText, a as createTokenRenewal, at as toVCard, b as richlink, c as senderAttrs, d as classifyIdentifier, dt as attachment, et as asCustom, f as envAwareConfig, g as voice, h as asVoice, i as stream, it as fromVCard, l as markdownToPlainText, mt as tracedFetch, n as createAsyncQueue, nt as asContact, o as contentAttrs, ot as avatar, p as envFor, pt as fetchUrlBytes, r as mergeStreams, rt as contact, s as errorAttrs, st as avatarSchema, t as broadcast, tt as custom, ut as asAttachment, v as unsend, w as rename, z as leaveSpaceSchema } from "./stream-
|
|
1
|
+
import { $ as drainStreamText, A as reaction, B as removeMember, D as read, F as poll, H as asMarkdown, I as addMember, J as resolveContents, K as group, L as addMemberSchema, P as option, Q as StreamConsumedError, R as leaveSpace, S as reply, T as renameSchema, U as markdown, V as removeMemberSchema, X as text, Y as asText, a as createTokenRenewal, at as toVCard, b as richlink, c as senderAttrs, d as classifyIdentifier, dt as attachment, et as asCustom, f as envAwareConfig, g as voice, h as asVoice, i as stream, it as fromVCard, l as markdownToPlainText, mt as tracedFetch, n as createAsyncQueue, nt as asContact, o as contentAttrs, ot as avatar, p as envFor, pt as fetchUrlBytes, r as mergeStreams, rt as contact, s as errorAttrs, st as avatarSchema, t as broadcast, tt as custom, ut as asAttachment, v as unsend, w as rename, z as leaveSpaceSchema } from "./stream-t0CbOOUT.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";
|
|
@@ -3019,7 +3019,7 @@ function definePlatform(platformId, rawDef) {
|
|
|
3019
3019
|
}
|
|
3020
3020
|
//#endregion
|
|
3021
3021
|
//#region src/build-env.ts
|
|
3022
|
-
const SPECTRUM_SDK_VERSION = "12.
|
|
3022
|
+
const SPECTRUM_SDK_VERSION = "12.6.0";
|
|
3023
3023
|
//#endregion
|
|
3024
3024
|
//#region src/utils/provider-packages.ts
|
|
3025
3025
|
const OFFICIAL_PROVIDER_PACKAGES = {
|
|
@@ -1739,6 +1739,15 @@ function stream(setup) {
|
|
|
1739
1739
|
await repeater.return(void 0).catch(ignoreCleanupError);
|
|
1740
1740
|
} });
|
|
1741
1741
|
}
|
|
1742
|
+
/**
|
|
1743
|
+
* Merges a fixed set of streams. The result represents all of them: it ends
|
|
1744
|
+
* once every member has ended — immediately, for an empty set — and one
|
|
1745
|
+
* member's error ends the whole merge.
|
|
1746
|
+
*
|
|
1747
|
+
* For a set that changes while the stream runs, use `createStreamGroup`
|
|
1748
|
+
* (`@spectrum-ts/core/authoring`), which ends only on `close()` and drops a
|
|
1749
|
+
* failed member instead of tearing down its siblings.
|
|
1750
|
+
*/
|
|
1742
1751
|
function mergeStreams(streams) {
|
|
1743
1752
|
return stream((emit, end) => {
|
|
1744
1753
|
if (streams.length === 0) {
|