@spectrum-ts/core 12.4.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.
@@ -642,21 +642,18 @@ declare const editSchema: z.ZodObject<{
642
642
  read: z.core.$InferOuterFunctionType<z.ZodTuple<readonly [], null>, z.ZodPromise<z.ZodCustom<Buffer<ArrayBufferLike>, Buffer<ArrayBufferLike>>>>;
643
643
  stream: z.core.$InferOuterFunctionType<z.ZodTuple<readonly [], null>, z.ZodPromise<z.ZodCustom<ReadableStream<unknown>, ReadableStream<unknown>>>>;
644
644
  size?: number | undefined;
645
+ } | {
646
+ type: "custom";
647
+ raw: unknown;
645
648
  } | {
646
649
  type: "text";
647
650
  text: string;
648
651
  } | {
649
652
  type: "markdown";
650
653
  markdown: string;
651
- } | {
652
- type: "custom";
653
- raw: unknown;
654
654
  } | {
655
655
  type: "group";
656
656
  items: Message<string, User, Space<unknown>>[];
657
- } | {
658
- type: "richlink";
659
- url: string;
660
657
  } | {
661
658
  type: "poll";
662
659
  title: string;
@@ -677,6 +674,13 @@ declare const editSchema: z.ZodObject<{
677
674
  };
678
675
  selected: boolean;
679
676
  title: string;
677
+ } | {
678
+ type: "reaction";
679
+ emoji: string;
680
+ target: Message<string, User, Space<unknown>>;
681
+ } | {
682
+ type: "richlink";
683
+ url: string;
680
684
  } | {
681
685
  type: "streamText";
682
686
  stream: () => AsyncIterable<string>;
@@ -704,10 +708,6 @@ declare const editSchema: z.ZodObject<{
704
708
  summary: z.ZodOptional<z.ZodString>;
705
709
  }, z.core.$strip>>>;
706
710
  live?: boolean | undefined;
707
- } | {
708
- type: "reaction";
709
- emoji: string;
710
- target: Message<string, User, Space<unknown>>;
711
711
  } | {
712
712
  type: "effect";
713
713
  content: {
@@ -800,21 +800,18 @@ declare const editSchema: z.ZodObject<{
800
800
  read: z.core.$InferOuterFunctionType<z.ZodTuple<readonly [], null>, z.ZodPromise<z.ZodCustom<Buffer<ArrayBufferLike>, Buffer<ArrayBufferLike>>>>;
801
801
  stream: z.core.$InferOuterFunctionType<z.ZodTuple<readonly [], null>, z.ZodPromise<z.ZodCustom<ReadableStream<unknown>, ReadableStream<unknown>>>>;
802
802
  size?: number | undefined;
803
+ } | {
804
+ type: "custom";
805
+ raw: unknown;
803
806
  } | {
804
807
  type: "text";
805
808
  text: string;
806
809
  } | {
807
810
  type: "markdown";
808
811
  markdown: string;
809
- } | {
810
- type: "custom";
811
- raw: unknown;
812
812
  } | {
813
813
  type: "group";
814
814
  items: Message<string, User, Space<unknown>>[];
815
- } | {
816
- type: "richlink";
817
- url: string;
818
815
  } | {
819
816
  type: "poll";
820
817
  title: string;
@@ -835,6 +832,13 @@ declare const editSchema: z.ZodObject<{
835
832
  };
836
833
  selected: boolean;
837
834
  title: string;
835
+ } | {
836
+ type: "reaction";
837
+ emoji: string;
838
+ target: Message<string, User, Space<unknown>>;
839
+ } | {
840
+ type: "richlink";
841
+ url: string;
838
842
  } | {
839
843
  type: "streamText";
840
844
  stream: () => AsyncIterable<string>;
@@ -862,10 +866,6 @@ declare const editSchema: z.ZodObject<{
862
866
  summary: z.ZodOptional<z.ZodString>;
863
867
  }, z.core.$strip>>>;
864
868
  live?: boolean | undefined;
865
- } | {
866
- type: "reaction";
867
- emoji: string;
868
- target: Message<string, User, Space<unknown>>;
869
869
  } | {
870
870
  type: "effect";
871
871
  content: {
@@ -1188,21 +1188,18 @@ declare const replySchema: z.ZodObject<{
1188
1188
  read: z.core.$InferOuterFunctionType<z.ZodTuple<readonly [], null>, z.ZodPromise<z.ZodCustom<Buffer<ArrayBufferLike>, Buffer<ArrayBufferLike>>>>;
1189
1189
  stream: z.core.$InferOuterFunctionType<z.ZodTuple<readonly [], null>, z.ZodPromise<z.ZodCustom<ReadableStream<unknown>, ReadableStream<unknown>>>>;
1190
1190
  size?: number | undefined;
1191
+ } | {
1192
+ type: "custom";
1193
+ raw: unknown;
1191
1194
  } | {
1192
1195
  type: "text";
1193
1196
  text: string;
1194
1197
  } | {
1195
1198
  type: "markdown";
1196
1199
  markdown: string;
1197
- } | {
1198
- type: "custom";
1199
- raw: unknown;
1200
1200
  } | {
1201
1201
  type: "group";
1202
1202
  items: Message<string, User, Space<unknown>>[];
1203
- } | {
1204
- type: "richlink";
1205
- url: string;
1206
1203
  } | {
1207
1204
  type: "poll";
1208
1205
  title: string;
@@ -1223,6 +1220,13 @@ declare const replySchema: z.ZodObject<{
1223
1220
  };
1224
1221
  selected: boolean;
1225
1222
  title: string;
1223
+ } | {
1224
+ type: "reaction";
1225
+ emoji: string;
1226
+ target: Message<string, User, Space<unknown>>;
1227
+ } | {
1228
+ type: "richlink";
1229
+ url: string;
1226
1230
  } | {
1227
1231
  type: "streamText";
1228
1232
  stream: () => AsyncIterable<string>;
@@ -1250,10 +1254,6 @@ declare const replySchema: z.ZodObject<{
1250
1254
  summary: z.ZodOptional<z.ZodString>;
1251
1255
  }, z.core.$strip>>>;
1252
1256
  live?: boolean | undefined;
1253
- } | {
1254
- type: "reaction";
1255
- emoji: string;
1256
- target: Message<string, User, Space<unknown>>;
1257
1257
  } | {
1258
1258
  type: "effect";
1259
1259
  content: {
@@ -1346,21 +1346,18 @@ declare const replySchema: z.ZodObject<{
1346
1346
  read: z.core.$InferOuterFunctionType<z.ZodTuple<readonly [], null>, z.ZodPromise<z.ZodCustom<Buffer<ArrayBufferLike>, Buffer<ArrayBufferLike>>>>;
1347
1347
  stream: z.core.$InferOuterFunctionType<z.ZodTuple<readonly [], null>, z.ZodPromise<z.ZodCustom<ReadableStream<unknown>, ReadableStream<unknown>>>>;
1348
1348
  size?: number | undefined;
1349
+ } | {
1350
+ type: "custom";
1351
+ raw: unknown;
1349
1352
  } | {
1350
1353
  type: "text";
1351
1354
  text: string;
1352
1355
  } | {
1353
1356
  type: "markdown";
1354
1357
  markdown: string;
1355
- } | {
1356
- type: "custom";
1357
- raw: unknown;
1358
1358
  } | {
1359
1359
  type: "group";
1360
1360
  items: Message<string, User, Space<unknown>>[];
1361
- } | {
1362
- type: "richlink";
1363
- url: string;
1364
1361
  } | {
1365
1362
  type: "poll";
1366
1363
  title: string;
@@ -1381,6 +1378,13 @@ declare const replySchema: z.ZodObject<{
1381
1378
  };
1382
1379
  selected: boolean;
1383
1380
  title: string;
1381
+ } | {
1382
+ type: "reaction";
1383
+ emoji: string;
1384
+ target: Message<string, User, Space<unknown>>;
1385
+ } | {
1386
+ type: "richlink";
1387
+ url: string;
1384
1388
  } | {
1385
1389
  type: "streamText";
1386
1390
  stream: () => AsyncIterable<string>;
@@ -1408,10 +1412,6 @@ declare const replySchema: z.ZodObject<{
1408
1412
  summary: z.ZodOptional<z.ZodString>;
1409
1413
  }, z.core.$strip>>>;
1410
1414
  live?: boolean | undefined;
1411
- } | {
1412
- type: "reaction";
1413
- emoji: string;
1414
- target: Message<string, User, Space<unknown>>;
1415
1415
  } | {
1416
1416
  type: "effect";
1417
1417
  content: {
@@ -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>;
@@ -7333,21 +7342,18 @@ declare const contentSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
7333
7342
  read: z.core.$InferOuterFunctionType<z.ZodTuple<readonly [], null>, z.ZodPromise<z.ZodCustom<Buffer<ArrayBufferLike>, Buffer<ArrayBufferLike>>>>;
7334
7343
  stream: z.core.$InferOuterFunctionType<z.ZodTuple<readonly [], null>, z.ZodPromise<z.ZodCustom<ReadableStream<unknown>, ReadableStream<unknown>>>>;
7335
7344
  size?: number | undefined;
7345
+ } | {
7346
+ type: "custom";
7347
+ raw: unknown;
7336
7348
  } | {
7337
7349
  type: "text";
7338
7350
  text: string;
7339
7351
  } | {
7340
7352
  type: "markdown";
7341
7353
  markdown: string;
7342
- } | {
7343
- type: "custom";
7344
- raw: unknown;
7345
7354
  } | {
7346
7355
  type: "group";
7347
7356
  items: Message<string, User, Space<unknown>>[];
7348
- } | {
7349
- type: "richlink";
7350
- url: string;
7351
7357
  } | {
7352
7358
  type: "poll";
7353
7359
  title: string;
@@ -7368,6 +7374,13 @@ declare const contentSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
7368
7374
  };
7369
7375
  selected: boolean;
7370
7376
  title: string;
7377
+ } | {
7378
+ type: "reaction";
7379
+ emoji: string;
7380
+ target: Message<string, User, Space<unknown>>;
7381
+ } | {
7382
+ type: "richlink";
7383
+ url: string;
7371
7384
  } | {
7372
7385
  type: "streamText";
7373
7386
  stream: () => AsyncIterable<string>;
@@ -7395,10 +7408,6 @@ declare const contentSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
7395
7408
  summary: z.ZodOptional<z.ZodString>;
7396
7409
  }, z.core.$strip>>>;
7397
7410
  live?: boolean | undefined;
7398
- } | {
7399
- type: "reaction";
7400
- emoji: string;
7401
- target: Message<string, User, Space<unknown>>;
7402
7411
  } | {
7403
7412
  type: "effect";
7404
7413
  content: {
@@ -7491,21 +7500,18 @@ declare const contentSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
7491
7500
  read: z.core.$InferOuterFunctionType<z.ZodTuple<readonly [], null>, z.ZodPromise<z.ZodCustom<Buffer<ArrayBufferLike>, Buffer<ArrayBufferLike>>>>;
7492
7501
  stream: z.core.$InferOuterFunctionType<z.ZodTuple<readonly [], null>, z.ZodPromise<z.ZodCustom<ReadableStream<unknown>, ReadableStream<unknown>>>>;
7493
7502
  size?: number | undefined;
7503
+ } | {
7504
+ type: "custom";
7505
+ raw: unknown;
7494
7506
  } | {
7495
7507
  type: "text";
7496
7508
  text: string;
7497
7509
  } | {
7498
7510
  type: "markdown";
7499
7511
  markdown: string;
7500
- } | {
7501
- type: "custom";
7502
- raw: unknown;
7503
7512
  } | {
7504
7513
  type: "group";
7505
7514
  items: Message<string, User, Space<unknown>>[];
7506
- } | {
7507
- type: "richlink";
7508
- url: string;
7509
7515
  } | {
7510
7516
  type: "poll";
7511
7517
  title: string;
@@ -7526,6 +7532,13 @@ declare const contentSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
7526
7532
  };
7527
7533
  selected: boolean;
7528
7534
  title: string;
7535
+ } | {
7536
+ type: "reaction";
7537
+ emoji: string;
7538
+ target: Message<string, User, Space<unknown>>;
7539
+ } | {
7540
+ type: "richlink";
7541
+ url: string;
7529
7542
  } | {
7530
7543
  type: "streamText";
7531
7544
  stream: () => AsyncIterable<string>;
@@ -7553,10 +7566,6 @@ declare const contentSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
7553
7566
  summary: z.ZodOptional<z.ZodString>;
7554
7567
  }, z.core.$strip>>>;
7555
7568
  live?: boolean | undefined;
7556
- } | {
7557
- type: "reaction";
7558
- emoji: string;
7559
- target: Message<string, User, Space<unknown>>;
7560
7569
  } | {
7561
7570
  type: "effect";
7562
7571
  content: {
@@ -7653,21 +7662,18 @@ declare const contentSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
7653
7662
  read: z.core.$InferOuterFunctionType<z.ZodTuple<readonly [], null>, z.ZodPromise<z.ZodCustom<Buffer<ArrayBufferLike>, Buffer<ArrayBufferLike>>>>;
7654
7663
  stream: z.core.$InferOuterFunctionType<z.ZodTuple<readonly [], null>, z.ZodPromise<z.ZodCustom<ReadableStream<unknown>, ReadableStream<unknown>>>>;
7655
7664
  size?: number | undefined;
7665
+ } | {
7666
+ type: "custom";
7667
+ raw: unknown;
7656
7668
  } | {
7657
7669
  type: "text";
7658
7670
  text: string;
7659
7671
  } | {
7660
7672
  type: "markdown";
7661
7673
  markdown: string;
7662
- } | {
7663
- type: "custom";
7664
- raw: unknown;
7665
7674
  } | {
7666
7675
  type: "group";
7667
7676
  items: Message<string, User, Space<unknown>>[];
7668
- } | {
7669
- type: "richlink";
7670
- url: string;
7671
7677
  } | {
7672
7678
  type: "poll";
7673
7679
  title: string;
@@ -7688,6 +7694,13 @@ declare const contentSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
7688
7694
  };
7689
7695
  selected: boolean;
7690
7696
  title: string;
7697
+ } | {
7698
+ type: "reaction";
7699
+ emoji: string;
7700
+ target: Message<string, User, Space<unknown>>;
7701
+ } | {
7702
+ type: "richlink";
7703
+ url: string;
7691
7704
  } | {
7692
7705
  type: "streamText";
7693
7706
  stream: () => AsyncIterable<string>;
@@ -7715,10 +7728,6 @@ declare const contentSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
7715
7728
  summary: z.ZodOptional<z.ZodString>;
7716
7729
  }, z.core.$strip>>>;
7717
7730
  live?: boolean | undefined;
7718
- } | {
7719
- type: "reaction";
7720
- emoji: string;
7721
- target: Message<string, User, Space<unknown>>;
7722
7731
  } | {
7723
7732
  type: "effect";
7724
7733
  content: {
@@ -7811,21 +7820,18 @@ declare const contentSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
7811
7820
  read: z.core.$InferOuterFunctionType<z.ZodTuple<readonly [], null>, z.ZodPromise<z.ZodCustom<Buffer<ArrayBufferLike>, Buffer<ArrayBufferLike>>>>;
7812
7821
  stream: z.core.$InferOuterFunctionType<z.ZodTuple<readonly [], null>, z.ZodPromise<z.ZodCustom<ReadableStream<unknown>, ReadableStream<unknown>>>>;
7813
7822
  size?: number | undefined;
7823
+ } | {
7824
+ type: "custom";
7825
+ raw: unknown;
7814
7826
  } | {
7815
7827
  type: "text";
7816
7828
  text: string;
7817
7829
  } | {
7818
7830
  type: "markdown";
7819
7831
  markdown: string;
7820
- } | {
7821
- type: "custom";
7822
- raw: unknown;
7823
7832
  } | {
7824
7833
  type: "group";
7825
7834
  items: Message<string, User, Space<unknown>>[];
7826
- } | {
7827
- type: "richlink";
7828
- url: string;
7829
7835
  } | {
7830
7836
  type: "poll";
7831
7837
  title: string;
@@ -7846,6 +7852,13 @@ declare const contentSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
7846
7852
  };
7847
7853
  selected: boolean;
7848
7854
  title: string;
7855
+ } | {
7856
+ type: "reaction";
7857
+ emoji: string;
7858
+ target: Message<string, User, Space<unknown>>;
7859
+ } | {
7860
+ type: "richlink";
7861
+ url: string;
7849
7862
  } | {
7850
7863
  type: "streamText";
7851
7864
  stream: () => AsyncIterable<string>;
@@ -7873,10 +7886,6 @@ declare const contentSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
7873
7886
  summary: z.ZodOptional<z.ZodString>;
7874
7887
  }, z.core.$strip>>>;
7875
7888
  live?: boolean | undefined;
7876
- } | {
7877
- type: "reaction";
7878
- emoji: string;
7879
- target: Message<string, User, Space<unknown>>;
7880
7889
  } | {
7881
7890
  type: "effect";
7882
7891
  content: {
@@ -7959,4 +7968,4 @@ declare function attachment(input: AttachmentInput, options?: {
7959
7968
  name?: string;
7960
7969
  }): ContentBuilder;
7961
7970
  //#endregion
7962
- 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 };
7971
+ export { DedicatedTokenData as $, StreamText as $t, isFusorEvent as A, ContactEmail as An, Reply as At, PlatformUser as B, AvatarData as Bn, readSchema as Bt, FusorVerify as C, reaction as Cn, typing as Ct, WebhookRawResult as D, Contact as Dn, asRichlink as Dt, WebhookRawRequest as E, custom as En, Richlink as Et, PlatformInstance as F, asContact as Fn, rename as Ft, SpaceNamespace as G, buildPhotoAction as Gn, asPoll as Gt, ProviderMessageRecord as H, avatar as Hn, PollChoice as Ht, PlatformMessage as I, contact as In, renameSchema as It, broadcast as J, AppLayout as Jn, poll as Jt, Broadcaster as K, photoActionSchema as Kn, asPollOption as Kt, PlatformProviderConfig as L, AgentSender as Ln, Read as Lt, EventProducer as M, ContactName as Mn, reply as Mt, Platform as N, ContactOrg as Nn, replySchema as Nt, FusorEvent as O, ContactAddress as On, richlink as Ot, PlatformDef as P, ContactPhone as Pn, Rename as Pt, CloudPlatform as Q, appLayoutSchema as Qn, DeltaExtractor as Qt, PlatformRuntime as R, User as Rn, asRead as Rt, FusorRespond as S, asReaction as Sn, Typing as St, WebhookHandler as T, asCustom as Tn, text as Tt, ProviderUserRecord as U, avatarSchema as Un, PollChoiceInput as Ut, ProviderMessage as V, AvatarInput as Vn, Poll as Vt, SchemaMessage as W, PhotoInput as Wn, PollOption as Wt, stream as X, AppUrl as Xn, asMarkdown as Xt, mergeStreams as Y, AppOptions as Yn, Markdown as Yt, Store as Z, app as Zn, markdown as Zt, FusorClient as _, leaveSpaceSchema as _n, asVoice as _t, Content as a, groupSchema as an, ProjectProfile as at, FusorMessagesReturn as b, Reaction as bn, asUnsend as bt, fromVCard as c, Message as cn, SlackTokenData as ct, UnsupportedKind as d, LeaveSpace as dn, SubscriptionStatus as dt, StreamTextSource as en, FusorTokenData as et, Spectrum as f, MemberInput as fn, TokenData as ft, isFusorClient as g, leaveSpace as gn, Voice as gt, fusor as h, addMemberSchema as hn, EmojiKey as ht, attachment as i, group as in, ProjectData as it, AnyPlatformDef as j, ContactInput as jn, asReply as jt, fusorEvent as k, ContactDetails as kn, resolveContents as kt, toVCard as l, Space as ln, SpectrumCloudError as lt, definePlatform as m, addMember as mn, Emoji as mt, AttachmentInput as n, Group as nn, PlatformStatus as nt, ContentBuilder as o, Edit as on, SharedTokenData as ot, SpectrumInstance as p, RemoveMember as pn, cloud as pt, ManagedStream as q, App as qn, option as qt, asAttachment as r, asGroup as rn, PlatformsData as rt, ContentInput as s, edit as sn, SlackTeamMeta as st, Attachment as t, TextStreamOptions as tn, ImessageInfoData as tt, UnsupportedError as u, AddMember as un, SubscriptionData as ut, FusorMessages as v, removeMember as vn, voice as vt, FusorVerifyRequest as w, reactionSchema as wn, asText as wt, FusorReply as x, ReactionBuilder as xn, unsend as xt, FusorMessagesCtx as y, removeMemberSchema as yn, Unsend as yt, PlatformSpace as z, Avatar as zn, read as zt };
@@ -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-D8Egdh4m.js";
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, 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 { $ as asCustom, A as reactionSchema, B as removeMemberSchema, C as replySchema, E as asRead, I as addMemberSchema, J as asText, K as groupSchema, M as asPollOption, O as asReaction, R as leaveSpaceSchema, T as renameSchema, U as markdownSchema, V as asMarkdown, W as asGroup, X as textSchema, _ as asUnsend, a as createTokenRenewal, ct as photoActionSchema, dt as attachmentSchema, f as envAwareConfig, h as asVoice, i as stream, j as asPoll, lt as asAttachment, m as fromEnv, ot as avatarSchema, p as envFor, pt as tracedFetch, s as errorAttrs, st as buildPhotoAction, tt as asContact, u as renderInlineTokens, x as asReply, y as asRichlink } from "./stream-4VQBWgZQ.js";
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
- export { 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, removeMemberSchema, renameSchema, renderInlineTokens, replySchema, resumableOrderedStream, sanitizeEmail, sanitizeErrorMessage, sanitizePhone, sanitizeUrl, setLogLevel, tracedFetch };
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 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-D8Egdh4m.js";
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 asCustom, B as removeMemberSchema, D as read, F as addMember, G as group, H as markdown, I as addMemberSchema, J as asText, L as leaveSpace, N as option, P as poll, Q as drainStreamText, R as leaveSpaceSchema, S as reply, T as renameSchema, V as asMarkdown, Y as text, Z as StreamConsumedError, a as createTokenRenewal, at as avatar, b as richlink, c as senderAttrs, d as classifyIdentifier, et as custom, f as envAwareConfig, ft as fetchUrlBytes, g as voice, h as asVoice, i as stream, it as toVCard, k as reaction, l as markdownToPlainText, lt as asAttachment, n as createAsyncQueue, nt as contact, o as contentAttrs, ot as avatarSchema, p as envFor, pt as tracedFetch, q as resolveContents, r as mergeStreams, rt as fromVCard, s as errorAttrs, t as broadcast, tt as asContact, ut as attachment, v as unsend, w as rename, z as removeMember } from "./stream-4VQBWgZQ.js";
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";
@@ -2524,6 +2524,14 @@ const wrapNestedContent = (content, ctx, direction) => {
2524
2524
  };
2525
2525
  return content;
2526
2526
  }
2527
+ if (content.type === "read") {
2528
+ const target = content.target;
2529
+ if (isRawProviderRecord(target)) return {
2530
+ ...content,
2531
+ target: wrapProviderMessage(target, ctx, "outbound")
2532
+ };
2533
+ return content;
2534
+ }
2527
2535
  if (content.type === "group") {
2528
2536
  const items = content.items.map((item) => {
2529
2537
  const raw = item;
@@ -3011,7 +3019,7 @@ function definePlatform(platformId, rawDef) {
3011
3019
  }
3012
3020
  //#endregion
3013
3021
  //#region src/build-env.ts
3014
- const SPECTRUM_SDK_VERSION = "12.4.0";
3022
+ const SPECTRUM_SDK_VERSION = "12.6.0";
3015
3023
  //#endregion
3016
3024
  //#region src/utils/provider-packages.ts
3017
3025
  const OFFICIAL_PROVIDER_PACKAGES = {
@@ -3715,6 +3723,7 @@ const mapContent = (content, platform, spaceRef, ctx) => {
3715
3723
  };
3716
3724
  case "contact": return deserializeContact(raw);
3717
3725
  case "reaction": return deserializeReaction(raw, spaceRef);
3726
+ case "read": return deserializeRead(raw, spaceRef);
3718
3727
  case "reply": return deserializeReply(raw, platform, spaceRef, ctx);
3719
3728
  case "group": return deserializeGroup(raw, platform, spaceRef, ctx);
3720
3729
  case "attachment": return deserializeAttachment(raw, platform, spaceRef, ctx);
@@ -3786,6 +3795,13 @@ const deserializeReaction = (raw, spaceRef) => ({
3786
3795
  emoji: asString(raw.emoji),
3787
3796
  target: buildTargetRecord(raw.target, spaceRef)
3788
3797
  });
3798
+ const deserializeRead = (raw, spaceRef) => ({
3799
+ type: "read",
3800
+ target: {
3801
+ ...buildTargetRecord(raw.target, spaceRef),
3802
+ direction: "outbound"
3803
+ }
3804
+ });
3789
3805
  const deserializeReply = (raw, platform, spaceRef, ctx) => ({
3790
3806
  type: "reply",
3791
3807
  content: isRecord(raw.content) ? deserializeContent(raw.content, platform, spaceRef, ctx) : asCustom(raw.content),
@@ -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) {
@@ -1825,4 +1834,4 @@ function broadcast(source) {
1825
1834
  };
1826
1835
  }
1827
1836
  //#endregion
1828
- export { asCustom as $, reactionSchema as A, removeMemberSchema as B, replySchema as C, read as D, asRead as E, addMember as F, group as G, markdown as H, addMemberSchema as I, asText as J, groupSchema as K, leaveSpace as L, asPollOption as M, option as N, asReaction as O, poll as P, drainStreamText as Q, leaveSpaceSchema as R, reply as S, renameSchema as T, markdownSchema as U, asMarkdown as V, asGroup as W, textSchema as X, text as Y, StreamConsumedError as Z, asUnsend as _, createTokenRenewal as a, avatar as at, richlink as b, senderAttrs as c, photoActionSchema as ct, classifyIdentifier as d, attachmentSchema as dt, custom as et, envAwareConfig as f, fetchUrlBytes as ft, voice as g, asVoice as h, stream as i, toVCard as it, asPoll as j, reaction as k, markdownToPlainText as l, asAttachment as lt, fromEnv as m, createAsyncQueue as n, contact as nt, contentAttrs as o, avatarSchema as ot, envFor as p, tracedFetch as pt, resolveContents as q, mergeStreams as r, fromVCard as rt, errorAttrs as s, buildPhotoAction as st, broadcast as t, asContact as tt, renderInlineTokens as u, attachment as ut, unsend as v, rename as w, asReply as x, asRichlink as y, removeMember as z };
1837
+ export { drainStreamText as $, reaction as A, removeMember as B, replySchema as C, read as D, asRead as E, poll as F, asGroup as G, asMarkdown as H, addMember as I, resolveContents as J, group as K, addMemberSchema as L, asPoll as M, asPollOption as N, readSchema as O, option as P, StreamConsumedError as Q, leaveSpace as R, reply as S, renameSchema as T, markdown as U, removeMemberSchema as V, markdownSchema as W, text as X, asText as Y, textSchema as Z, asUnsend as _, createTokenRenewal as a, toVCard as at, richlink as b, senderAttrs as c, buildPhotoAction as ct, classifyIdentifier as d, attachment as dt, asCustom as et, envAwareConfig as f, attachmentSchema as ft, voice as g, asVoice as h, stream as i, fromVCard as it, reactionSchema as j, asReaction as k, markdownToPlainText as l, photoActionSchema as lt, fromEnv as m, tracedFetch as mt, createAsyncQueue as n, asContact as nt, contentAttrs as o, avatar as ot, envFor as p, fetchUrlBytes as pt, groupSchema as q, mergeStreams as r, contact as rt, errorAttrs as s, avatarSchema as st, broadcast as t, custom as tt, renderInlineTokens as u, asAttachment as ut, unsend as v, rename as w, asReply as x, asRichlink as y, leaveSpaceSchema as z };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@spectrum-ts/core",
3
- "version": "12.4.0",
3
+ "version": "12.6.0",
4
4
  "description": "The spectrum-ts runtime — Spectrum, content builders, fusor, and the provider authoring API.",
5
5
  "repository": {
6
6
  "type": "git",