@spectrum-ts/core 11.2.0 → 12.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -42,7 +42,7 @@ The fastest way to ship is with **Spectrum Cloud** — hosted infrastructure for
42
42
  const app = await Spectrum({
43
43
  projectId: process.env.PROJECT_ID,
44
44
  projectSecret: process.env.PROJECT_SECRET,
45
- platforms: [imessage.config()],
45
+ providers: [imessage.config()],
46
46
  });
47
47
 
48
48
  for await (const [space, message] of app.messages) {
@@ -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;
@@ -643,17 +635,13 @@ declare const editSchema: z.ZodObject<{
643
635
  } | undefined;
644
636
  raw?: unknown;
645
637
  } | {
646
- type: "custom";
647
- raw: unknown;
648
- } | {
649
- type: "text";
650
- text: string;
651
- } | {
652
- type: "markdown";
653
- markdown: string;
654
- } | {
655
- type: "group";
656
- items: Message<string, User, Space<unknown>>[];
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;
657
645
  } | {
658
646
  type: "poll";
659
647
  title: string;
@@ -675,9 +663,14 @@ declare const editSchema: z.ZodObject<{
675
663
  selected: boolean;
676
664
  title: string;
677
665
  } | {
678
- type: "reaction";
679
- emoji: string;
680
- target: Message<string, User, Space<unknown>>;
666
+ type: "custom";
667
+ raw: unknown;
668
+ } | {
669
+ type: "text";
670
+ text: string;
671
+ } | {
672
+ type: "markdown";
673
+ markdown: string;
681
674
  } | {
682
675
  type: "streamText";
683
676
  stream: () => AsyncIterable<string>;
@@ -708,6 +701,13 @@ declare const editSchema: z.ZodObject<{
708
701
  summary: z.ZodOptional<z.ZodString>;
709
702
  }, z.core.$strip>>>;
710
703
  live?: boolean | undefined;
704
+ } | {
705
+ type: "reaction";
706
+ emoji: string;
707
+ target: Message<string, User, Space<unknown>>;
708
+ } | {
709
+ type: "group";
710
+ items: Message<string, User, Space<unknown>>[];
711
711
  } | {
712
712
  type: "effect";
713
713
  content: {
@@ -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;
@@ -801,17 +793,13 @@ declare const editSchema: z.ZodObject<{
801
793
  } | undefined;
802
794
  raw?: unknown;
803
795
  } | {
804
- type: "custom";
805
- raw: unknown;
806
- } | {
807
- type: "text";
808
- text: string;
809
- } | {
810
- type: "markdown";
811
- markdown: string;
812
- } | {
813
- type: "group";
814
- items: Message<string, User, Space<unknown>>[];
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;
815
803
  } | {
816
804
  type: "poll";
817
805
  title: string;
@@ -833,9 +821,14 @@ declare const editSchema: z.ZodObject<{
833
821
  selected: boolean;
834
822
  title: string;
835
823
  } | {
836
- type: "reaction";
837
- emoji: string;
838
- target: Message<string, User, Space<unknown>>;
824
+ type: "custom";
825
+ raw: unknown;
826
+ } | {
827
+ type: "text";
828
+ text: string;
829
+ } | {
830
+ type: "markdown";
831
+ markdown: string;
839
832
  } | {
840
833
  type: "streamText";
841
834
  stream: () => AsyncIterable<string>;
@@ -866,6 +859,13 @@ declare const editSchema: z.ZodObject<{
866
859
  summary: z.ZodOptional<z.ZodString>;
867
860
  }, z.core.$strip>>>;
868
861
  live?: boolean | undefined;
862
+ } | {
863
+ type: "reaction";
864
+ emoji: string;
865
+ target: Message<string, User, Space<unknown>>;
866
+ } | {
867
+ type: "group";
868
+ items: Message<string, User, Space<unknown>>[];
869
869
  } | {
870
870
  type: "effect";
871
871
  content: {
@@ -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;
@@ -1189,17 +1181,13 @@ declare const replySchema: z.ZodObject<{
1189
1181
  } | undefined;
1190
1182
  raw?: unknown;
1191
1183
  } | {
1192
- type: "custom";
1193
- raw: unknown;
1194
- } | {
1195
- type: "text";
1196
- text: string;
1197
- } | {
1198
- type: "markdown";
1199
- markdown: string;
1200
- } | {
1201
- type: "group";
1202
- items: Message<string, User, Space<unknown>>[];
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;
1203
1191
  } | {
1204
1192
  type: "poll";
1205
1193
  title: string;
@@ -1221,9 +1209,14 @@ declare const replySchema: z.ZodObject<{
1221
1209
  selected: boolean;
1222
1210
  title: string;
1223
1211
  } | {
1224
- type: "reaction";
1225
- emoji: string;
1226
- target: Message<string, User, Space<unknown>>;
1212
+ type: "custom";
1213
+ raw: unknown;
1214
+ } | {
1215
+ type: "text";
1216
+ text: string;
1217
+ } | {
1218
+ type: "markdown";
1219
+ markdown: string;
1227
1220
  } | {
1228
1221
  type: "streamText";
1229
1222
  stream: () => AsyncIterable<string>;
@@ -1254,6 +1247,13 @@ declare const replySchema: z.ZodObject<{
1254
1247
  summary: z.ZodOptional<z.ZodString>;
1255
1248
  }, z.core.$strip>>>;
1256
1249
  live?: boolean | undefined;
1250
+ } | {
1251
+ type: "reaction";
1252
+ emoji: string;
1253
+ target: Message<string, User, Space<unknown>>;
1254
+ } | {
1255
+ type: "group";
1256
+ items: Message<string, User, Space<unknown>>[];
1257
1257
  } | {
1258
1258
  type: "effect";
1259
1259
  content: {
@@ -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;
@@ -1347,17 +1339,13 @@ declare const replySchema: z.ZodObject<{
1347
1339
  } | undefined;
1348
1340
  raw?: unknown;
1349
1341
  } | {
1350
- type: "custom";
1351
- raw: unknown;
1352
- } | {
1353
- type: "text";
1354
- text: string;
1355
- } | {
1356
- type: "markdown";
1357
- markdown: string;
1358
- } | {
1359
- type: "group";
1360
- items: Message<string, User, Space<unknown>>[];
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;
1361
1349
  } | {
1362
1350
  type: "poll";
1363
1351
  title: string;
@@ -1379,9 +1367,14 @@ declare const replySchema: z.ZodObject<{
1379
1367
  selected: boolean;
1380
1368
  title: string;
1381
1369
  } | {
1382
- type: "reaction";
1383
- emoji: string;
1384
- target: Message<string, User, Space<unknown>>;
1370
+ type: "custom";
1371
+ raw: unknown;
1372
+ } | {
1373
+ type: "text";
1374
+ text: string;
1375
+ } | {
1376
+ type: "markdown";
1377
+ markdown: string;
1385
1378
  } | {
1386
1379
  type: "streamText";
1387
1380
  stream: () => AsyncIterable<string>;
@@ -1412,6 +1405,13 @@ declare const replySchema: z.ZodObject<{
1412
1405
  summary: z.ZodOptional<z.ZodString>;
1413
1406
  }, z.core.$strip>>>;
1414
1407
  live?: boolean | undefined;
1408
+ } | {
1409
+ type: "reaction";
1410
+ emoji: string;
1411
+ target: Message<string, User, Space<unknown>>;
1412
+ } | {
1413
+ type: "group";
1414
+ items: Message<string, User, Space<unknown>>[];
1415
1415
  } | {
1416
1416
  type: "effect";
1417
1417
  content: {
@@ -6881,18 +6881,12 @@ interface SpectrumOptions {
6881
6881
  */
6882
6882
  logLevel?: LogLevel;
6883
6883
  }
6884
- type PlatformSelection<Providers extends PlatformProviderConfig[]> = {
6885
- platforms: [...Providers];
6886
- providers?: never;
6887
- } | {
6888
- platforms?: never;
6889
- providers: [...Providers];
6890
- };
6891
- type SpectrumFactoryOptions<Providers extends PlatformProviderConfig[]> = PlatformSelection<Providers> & {
6884
+ interface SpectrumFactoryOptions<Providers extends PlatformProviderConfig[]> {
6892
6885
  options?: SpectrumOptions;
6886
+ providers: [...Providers];
6893
6887
  telemetry?: boolean;
6894
6888
  webhookSecret?: string;
6895
- };
6889
+ }
6896
6890
  declare function Spectrum<const Providers extends PlatformProviderConfig[]>(options: {
6897
6891
  projectId: string;
6898
6892
  projectSecret: string;
@@ -7289,14 +7283,6 @@ declare const contentSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
7289
7283
  }, z.core.$strip>, z.ZodObject<{
7290
7284
  type: z.ZodLiteral<"reply">;
7291
7285
  content: z.ZodCustom<{
7292
- type: "attachment";
7293
- id: string;
7294
- name: string;
7295
- mimeType: string;
7296
- read: z.core.$InferOuterFunctionType<z.ZodTuple<readonly [], null>, z.ZodPromise<z.ZodCustom<Buffer<ArrayBufferLike>, Buffer<ArrayBufferLike>>>>;
7297
- stream: z.core.$InferOuterFunctionType<z.ZodTuple<readonly [], null>, z.ZodPromise<z.ZodCustom<ReadableStream<unknown>, ReadableStream<unknown>>>>;
7298
- size?: number | undefined;
7299
- } | {
7300
7286
  type: "contact";
7301
7287
  user?: {
7302
7288
  __platform: string;
@@ -7340,17 +7326,13 @@ declare const contentSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
7340
7326
  } | undefined;
7341
7327
  raw?: unknown;
7342
7328
  } | {
7343
- type: "custom";
7344
- raw: unknown;
7345
- } | {
7346
- type: "text";
7347
- text: string;
7348
- } | {
7349
- type: "markdown";
7350
- markdown: string;
7351
- } | {
7352
- type: "group";
7353
- items: Message<string, User, Space<unknown>>[];
7329
+ type: "attachment";
7330
+ id: string;
7331
+ name: string;
7332
+ mimeType: string;
7333
+ read: z.core.$InferOuterFunctionType<z.ZodTuple<readonly [], null>, z.ZodPromise<z.ZodCustom<Buffer<ArrayBufferLike>, Buffer<ArrayBufferLike>>>>;
7334
+ stream: z.core.$InferOuterFunctionType<z.ZodTuple<readonly [], null>, z.ZodPromise<z.ZodCustom<ReadableStream<unknown>, ReadableStream<unknown>>>>;
7335
+ size?: number | undefined;
7354
7336
  } | {
7355
7337
  type: "poll";
7356
7338
  title: string;
@@ -7372,9 +7354,14 @@ declare const contentSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
7372
7354
  selected: boolean;
7373
7355
  title: string;
7374
7356
  } | {
7375
- type: "reaction";
7376
- emoji: string;
7377
- target: Message<string, User, Space<unknown>>;
7357
+ type: "custom";
7358
+ raw: unknown;
7359
+ } | {
7360
+ type: "text";
7361
+ text: string;
7362
+ } | {
7363
+ type: "markdown";
7364
+ markdown: string;
7378
7365
  } | {
7379
7366
  type: "streamText";
7380
7367
  stream: () => AsyncIterable<string>;
@@ -7405,6 +7392,13 @@ declare const contentSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
7405
7392
  summary: z.ZodOptional<z.ZodString>;
7406
7393
  }, z.core.$strip>>>;
7407
7394
  live?: boolean | undefined;
7395
+ } | {
7396
+ type: "reaction";
7397
+ emoji: string;
7398
+ target: Message<string, User, Space<unknown>>;
7399
+ } | {
7400
+ type: "group";
7401
+ items: Message<string, User, Space<unknown>>[];
7408
7402
  } | {
7409
7403
  type: "effect";
7410
7404
  content: {
@@ -7447,14 +7441,6 @@ declare const contentSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
7447
7441
  } | {
7448
7442
  type: "leaveSpace";
7449
7443
  }, {
7450
- type: "attachment";
7451
- id: string;
7452
- name: string;
7453
- mimeType: string;
7454
- read: z.core.$InferOuterFunctionType<z.ZodTuple<readonly [], null>, z.ZodPromise<z.ZodCustom<Buffer<ArrayBufferLike>, Buffer<ArrayBufferLike>>>>;
7455
- stream: z.core.$InferOuterFunctionType<z.ZodTuple<readonly [], null>, z.ZodPromise<z.ZodCustom<ReadableStream<unknown>, ReadableStream<unknown>>>>;
7456
- size?: number | undefined;
7457
- } | {
7458
7444
  type: "contact";
7459
7445
  user?: {
7460
7446
  __platform: string;
@@ -7498,17 +7484,13 @@ declare const contentSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
7498
7484
  } | undefined;
7499
7485
  raw?: unknown;
7500
7486
  } | {
7501
- type: "custom";
7502
- raw: unknown;
7503
- } | {
7504
- type: "text";
7505
- text: string;
7506
- } | {
7507
- type: "markdown";
7508
- markdown: string;
7509
- } | {
7510
- type: "group";
7511
- items: Message<string, User, Space<unknown>>[];
7487
+ type: "attachment";
7488
+ id: string;
7489
+ name: string;
7490
+ mimeType: string;
7491
+ read: z.core.$InferOuterFunctionType<z.ZodTuple<readonly [], null>, z.ZodPromise<z.ZodCustom<Buffer<ArrayBufferLike>, Buffer<ArrayBufferLike>>>>;
7492
+ stream: z.core.$InferOuterFunctionType<z.ZodTuple<readonly [], null>, z.ZodPromise<z.ZodCustom<ReadableStream<unknown>, ReadableStream<unknown>>>>;
7493
+ size?: number | undefined;
7512
7494
  } | {
7513
7495
  type: "poll";
7514
7496
  title: string;
@@ -7530,9 +7512,14 @@ declare const contentSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
7530
7512
  selected: boolean;
7531
7513
  title: string;
7532
7514
  } | {
7533
- type: "reaction";
7534
- emoji: string;
7535
- target: Message<string, User, Space<unknown>>;
7515
+ type: "custom";
7516
+ raw: unknown;
7517
+ } | {
7518
+ type: "text";
7519
+ text: string;
7520
+ } | {
7521
+ type: "markdown";
7522
+ markdown: string;
7536
7523
  } | {
7537
7524
  type: "streamText";
7538
7525
  stream: () => AsyncIterable<string>;
@@ -7563,6 +7550,13 @@ declare const contentSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
7563
7550
  summary: z.ZodOptional<z.ZodString>;
7564
7551
  }, z.core.$strip>>>;
7565
7552
  live?: boolean | undefined;
7553
+ } | {
7554
+ type: "reaction";
7555
+ emoji: string;
7556
+ target: Message<string, User, Space<unknown>>;
7557
+ } | {
7558
+ type: "group";
7559
+ items: Message<string, User, Space<unknown>>[];
7566
7560
  } | {
7567
7561
  type: "effect";
7568
7562
  content: {
@@ -7609,14 +7603,6 @@ declare const contentSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
7609
7603
  }, z.core.$strip>, z.ZodObject<{
7610
7604
  type: z.ZodLiteral<"edit">;
7611
7605
  content: z.ZodCustom<{
7612
- type: "attachment";
7613
- id: string;
7614
- name: string;
7615
- mimeType: string;
7616
- read: z.core.$InferOuterFunctionType<z.ZodTuple<readonly [], null>, z.ZodPromise<z.ZodCustom<Buffer<ArrayBufferLike>, Buffer<ArrayBufferLike>>>>;
7617
- stream: z.core.$InferOuterFunctionType<z.ZodTuple<readonly [], null>, z.ZodPromise<z.ZodCustom<ReadableStream<unknown>, ReadableStream<unknown>>>>;
7618
- size?: number | undefined;
7619
- } | {
7620
7606
  type: "contact";
7621
7607
  user?: {
7622
7608
  __platform: string;
@@ -7660,17 +7646,13 @@ declare const contentSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
7660
7646
  } | undefined;
7661
7647
  raw?: unknown;
7662
7648
  } | {
7663
- type: "custom";
7664
- raw: unknown;
7665
- } | {
7666
- type: "text";
7667
- text: string;
7668
- } | {
7669
- type: "markdown";
7670
- markdown: string;
7671
- } | {
7672
- type: "group";
7673
- items: Message<string, User, Space<unknown>>[];
7649
+ type: "attachment";
7650
+ id: string;
7651
+ name: string;
7652
+ mimeType: string;
7653
+ read: z.core.$InferOuterFunctionType<z.ZodTuple<readonly [], null>, z.ZodPromise<z.ZodCustom<Buffer<ArrayBufferLike>, Buffer<ArrayBufferLike>>>>;
7654
+ stream: z.core.$InferOuterFunctionType<z.ZodTuple<readonly [], null>, z.ZodPromise<z.ZodCustom<ReadableStream<unknown>, ReadableStream<unknown>>>>;
7655
+ size?: number | undefined;
7674
7656
  } | {
7675
7657
  type: "poll";
7676
7658
  title: string;
@@ -7692,9 +7674,14 @@ declare const contentSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
7692
7674
  selected: boolean;
7693
7675
  title: string;
7694
7676
  } | {
7695
- type: "reaction";
7696
- emoji: string;
7697
- target: Message<string, User, Space<unknown>>;
7677
+ type: "custom";
7678
+ raw: unknown;
7679
+ } | {
7680
+ type: "text";
7681
+ text: string;
7682
+ } | {
7683
+ type: "markdown";
7684
+ markdown: string;
7698
7685
  } | {
7699
7686
  type: "streamText";
7700
7687
  stream: () => AsyncIterable<string>;
@@ -7725,6 +7712,13 @@ declare const contentSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
7725
7712
  summary: z.ZodOptional<z.ZodString>;
7726
7713
  }, z.core.$strip>>>;
7727
7714
  live?: boolean | undefined;
7715
+ } | {
7716
+ type: "reaction";
7717
+ emoji: string;
7718
+ target: Message<string, User, Space<unknown>>;
7719
+ } | {
7720
+ type: "group";
7721
+ items: Message<string, User, Space<unknown>>[];
7728
7722
  } | {
7729
7723
  type: "effect";
7730
7724
  content: {
@@ -7767,14 +7761,6 @@ declare const contentSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
7767
7761
  } | {
7768
7762
  type: "leaveSpace";
7769
7763
  }, {
7770
- type: "attachment";
7771
- id: string;
7772
- name: string;
7773
- mimeType: string;
7774
- read: z.core.$InferOuterFunctionType<z.ZodTuple<readonly [], null>, z.ZodPromise<z.ZodCustom<Buffer<ArrayBufferLike>, Buffer<ArrayBufferLike>>>>;
7775
- stream: z.core.$InferOuterFunctionType<z.ZodTuple<readonly [], null>, z.ZodPromise<z.ZodCustom<ReadableStream<unknown>, ReadableStream<unknown>>>>;
7776
- size?: number | undefined;
7777
- } | {
7778
7764
  type: "contact";
7779
7765
  user?: {
7780
7766
  __platform: string;
@@ -7818,17 +7804,13 @@ declare const contentSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
7818
7804
  } | undefined;
7819
7805
  raw?: unknown;
7820
7806
  } | {
7821
- type: "custom";
7822
- raw: unknown;
7823
- } | {
7824
- type: "text";
7825
- text: string;
7826
- } | {
7827
- type: "markdown";
7828
- markdown: string;
7829
- } | {
7830
- type: "group";
7831
- items: Message<string, User, Space<unknown>>[];
7807
+ type: "attachment";
7808
+ id: string;
7809
+ name: string;
7810
+ mimeType: string;
7811
+ read: z.core.$InferOuterFunctionType<z.ZodTuple<readonly [], null>, z.ZodPromise<z.ZodCustom<Buffer<ArrayBufferLike>, Buffer<ArrayBufferLike>>>>;
7812
+ stream: z.core.$InferOuterFunctionType<z.ZodTuple<readonly [], null>, z.ZodPromise<z.ZodCustom<ReadableStream<unknown>, ReadableStream<unknown>>>>;
7813
+ size?: number | undefined;
7832
7814
  } | {
7833
7815
  type: "poll";
7834
7816
  title: string;
@@ -7850,9 +7832,14 @@ declare const contentSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
7850
7832
  selected: boolean;
7851
7833
  title: string;
7852
7834
  } | {
7853
- type: "reaction";
7854
- emoji: string;
7855
- target: Message<string, User, Space<unknown>>;
7835
+ type: "custom";
7836
+ raw: unknown;
7837
+ } | {
7838
+ type: "text";
7839
+ text: string;
7840
+ } | {
7841
+ type: "markdown";
7842
+ markdown: string;
7856
7843
  } | {
7857
7844
  type: "streamText";
7858
7845
  stream: () => AsyncIterable<string>;
@@ -7883,6 +7870,13 @@ declare const contentSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
7883
7870
  summary: z.ZodOptional<z.ZodString>;
7884
7871
  }, z.core.$strip>>>;
7885
7872
  live?: boolean | undefined;
7873
+ } | {
7874
+ type: "reaction";
7875
+ emoji: string;
7876
+ target: Message<string, User, Space<unknown>>;
7877
+ } | {
7878
+ type: "group";
7879
+ items: Message<string, User, Space<unknown>>[];
7886
7880
  } | {
7887
7881
  type: "effect";
7888
7882
  content: {
@@ -1,4 +1,4 @@
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-CtoKMCG2.js";
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-DN82cCAP.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";
package/dist/index.d.ts CHANGED
@@ -1,2 +1,2 @@
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-CtoKMCG2.js";
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-DN82cCAP.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
@@ -3005,7 +3005,7 @@ function definePlatform(name, rawDef) {
3005
3005
  }
3006
3006
  //#endregion
3007
3007
  //#region src/build-env.ts
3008
- const SPECTRUM_SDK_VERSION = "11.2.0";
3008
+ const SPECTRUM_SDK_VERSION = "12.0.0";
3009
3009
  //#endregion
3010
3010
  //#region src/utils/provider-packages.ts
3011
3011
  const OFFICIAL_PROVIDER_PACKAGES = {
@@ -3027,7 +3027,7 @@ const installCommand = (pkg) => process.versions.bun ? `bun add ${pkg}` : `npm i
3027
3027
  const officialProviderInstallHint = (platform) => {
3028
3028
  const pkg = officialProviderPackage(platform);
3029
3029
  if (!pkg) return;
3030
- return `the "${platform}" platform is provided by the optional package ${pkg} — install it (\`${installCommand(pkg)}\`) and pass it to Spectrum({ platforms: [...] })`;
3030
+ return `the "${platform}" platform is provided by the optional package ${pkg} — install it (\`${installCommand(pkg)}\`) and pass it to Spectrum({ providers: [...] })`;
3031
3031
  };
3032
3032
  //#endregion
3033
3033
  //#region src/utils/cloud.ts
@@ -4027,20 +4027,18 @@ const spectrumOptionsSchema = z.object({
4027
4027
  const spectrumConfigSchema = z.union([z.object({
4028
4028
  projectId: z.string().min(1),
4029
4029
  projectSecret: z.string().min(1),
4030
- providers: z.array(z.custom()).optional(),
4031
- platforms: z.array(z.custom()).optional(),
4030
+ providers: z.array(z.custom()),
4032
4031
  options: spectrumOptionsSchema,
4033
4032
  telemetry: z.boolean().optional(),
4034
4033
  webhookSecret: z.string().min(1).optional()
4035
4034
  }), z.object({
4036
4035
  projectId: z.undefined().optional(),
4037
4036
  projectSecret: z.undefined().optional(),
4038
- providers: z.array(z.custom()).optional(),
4039
- platforms: z.array(z.custom()).optional(),
4037
+ providers: z.array(z.custom()),
4040
4038
  options: spectrumOptionsSchema,
4041
4039
  telemetry: z.boolean().optional(),
4042
4040
  webhookSecret: z.string().min(1).optional()
4043
- })]).refine((config) => config.providers === void 0 !== (config.platforms === void 0), "Spectrum requires exactly one of platforms or providers");
4041
+ })]);
4044
4042
  function bootstrapTelemetry(opts) {
4045
4043
  const headers = {};
4046
4044
  if (opts.projectId && opts.projectSecret) {
@@ -4072,11 +4070,6 @@ function resolveProjectCredentials(options) {
4072
4070
  projectSecret: options.projectSecret ?? envValue(envFor("PROJECT", "SECRET"))
4073
4071
  };
4074
4072
  }
4075
- const resolveConfiguredProviders = (options) => {
4076
- const configuredProviders = options.platforms ?? options.providers;
4077
- if (!configuredProviders) throw new Error("Spectrum requires platforms or providers");
4078
- return configuredProviders;
4079
- };
4080
4073
  async function Spectrum(options) {
4081
4074
  const { projectId, projectSecret } = resolveProjectCredentials(options);
4082
4075
  spectrumConfigSchema.parse({
@@ -4084,8 +4077,7 @@ async function Spectrum(options) {
4084
4077
  projectId,
4085
4078
  projectSecret
4086
4079
  });
4087
- const providers = resolveConfiguredProviders(options);
4088
- const { options: runtimeOptions, telemetry, webhookSecret } = options;
4080
+ const { options: runtimeOptions, providers, telemetry, webhookSecret } = options;
4089
4081
  const flattenGroups = runtimeOptions?.flattenGroups ?? false;
4090
4082
  applyLogLevel(runtimeOptions?.logLevel);
4091
4083
  const resolvedWebhookSecret = webhookSecret ?? process.env[envFor("WEBHOOK", "SECRET")];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@spectrum-ts/core",
3
- "version": "11.2.0",
3
+ "version": "12.0.0",
4
4
  "description": "The spectrum-ts runtime — Spectrum, content builders, fusor, and the provider authoring API.",
5
5
  "repository": {
6
6
  "type": "git",