@spectrum-ts/core 5.1.0 → 6.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.
@@ -447,10 +447,6 @@ interface Message<TPlatform extends string = string, TSender extends User = User
447
447
  declare const editSchema: z.ZodObject<{
448
448
  type: z.ZodLiteral<"edit">;
449
449
  content: z.ZodCustom<{
450
- type: "reaction";
451
- emoji: string;
452
- target: Message<string, User, Space<unknown>>;
453
- } | {
454
450
  type: "text";
455
451
  text: string;
456
452
  } | {
@@ -545,6 +541,10 @@ declare const editSchema: z.ZodObject<{
545
541
  imageSubtitle: z.ZodOptional<z.ZodString>;
546
542
  summary: z.ZodOptional<z.ZodString>;
547
543
  }, z.core.$strip>>>;
544
+ } | {
545
+ type: "reaction";
546
+ emoji: string;
547
+ target: Message<string, User, Space<unknown>>;
548
548
  } | {
549
549
  type: "group";
550
550
  items: Message<string, User, Space<unknown>>[];
@@ -602,10 +602,6 @@ declare const editSchema: z.ZodObject<{
602
602
  kind: "clear";
603
603
  };
604
604
  }, {
605
- type: "reaction";
606
- emoji: string;
607
- target: Message<string, User, Space<unknown>>;
608
- } | {
609
605
  type: "text";
610
606
  text: string;
611
607
  } | {
@@ -700,6 +696,10 @@ declare const editSchema: z.ZodObject<{
700
696
  imageSubtitle: z.ZodOptional<z.ZodString>;
701
697
  summary: z.ZodOptional<z.ZodString>;
702
698
  }, z.core.$strip>>>;
699
+ } | {
700
+ type: "reaction";
701
+ emoji: string;
702
+ target: Message<string, User, Space<unknown>>;
703
703
  } | {
704
704
  type: "group";
705
705
  items: Message<string, User, Space<unknown>>[];
@@ -982,10 +982,6 @@ declare function rename(displayName: string): ContentBuilder;
982
982
  declare const replySchema: z.ZodObject<{
983
983
  type: z.ZodLiteral<"reply">;
984
984
  content: z.ZodCustom<{
985
- type: "reaction";
986
- emoji: string;
987
- target: Message<string, User, Space<unknown>>;
988
- } | {
989
985
  type: "text";
990
986
  text: string;
991
987
  } | {
@@ -1080,6 +1076,10 @@ declare const replySchema: z.ZodObject<{
1080
1076
  imageSubtitle: z.ZodOptional<z.ZodString>;
1081
1077
  summary: z.ZodOptional<z.ZodString>;
1082
1078
  }, z.core.$strip>>>;
1079
+ } | {
1080
+ type: "reaction";
1081
+ emoji: string;
1082
+ target: Message<string, User, Space<unknown>>;
1083
1083
  } | {
1084
1084
  type: "group";
1085
1085
  items: Message<string, User, Space<unknown>>[];
@@ -1137,10 +1137,6 @@ declare const replySchema: z.ZodObject<{
1137
1137
  kind: "clear";
1138
1138
  };
1139
1139
  }, {
1140
- type: "reaction";
1141
- emoji: string;
1142
- target: Message<string, User, Space<unknown>>;
1143
- } | {
1144
1140
  type: "text";
1145
1141
  text: string;
1146
1142
  } | {
@@ -1235,6 +1231,10 @@ declare const replySchema: z.ZodObject<{
1235
1231
  imageSubtitle: z.ZodOptional<z.ZodString>;
1236
1232
  summary: z.ZodOptional<z.ZodString>;
1237
1233
  }, z.core.$strip>>>;
1234
+ } | {
1235
+ type: "reaction";
1236
+ emoji: string;
1237
+ target: Message<string, User, Space<unknown>>;
1238
1238
  } | {
1239
1239
  type: "group";
1240
1240
  items: Message<string, User, Space<unknown>>[];
@@ -6407,7 +6407,9 @@ type CustomEventStreams<Providers extends PlatformProviderConfig[]> = { [K in Ex
6407
6407
  type ResolvedSpaceOf<Def extends AnyPlatformDef> = AwaitedReturn<Def["space"]["create"]>;
6408
6408
  type SchemaSpaceOf<Def extends AnyPlatformDef> = InferOptionalSchema<Def["space"]["schema"]>;
6409
6409
  type ResolvedUserOf<Def extends AnyPlatformDef> = AwaitedReturn<Def["user"]["resolve"]>;
6410
+ type SchemaUserOf<Def extends AnyPlatformDef> = InferOptionalSchema<Def["user"]["schema"]>;
6410
6411
  type SpaceShapeOf<Def extends AnyPlatformDef> = [SchemaSpaceOf<Def>] extends [never] ? ResolvedSpaceOf<Def> : SchemaSpaceOf<Def>;
6412
+ type UserShapeOf<Def extends AnyPlatformDef> = [SchemaUserOf<Def>] extends [never] ? ResolvedUserOf<Def> : SchemaUserOf<Def>;
6411
6413
  type SpaceParamsInputOf<Def extends AnyPlatformDef> = z.ZodType<object> extends Def["space"]["params"] ? never : InputSchema<Def["space"]["params"]>;
6412
6414
  type SpaceUserLike<Def extends AnyPlatformDef> = PlatformUser<Def> | string;
6413
6415
  type SpaceParamsArgs<Def extends AnyPlatformDef> = [SpaceParamsInputOf<Def>] extends [never] ? [] : Record<string, never> extends SpaceParamsInputOf<Def> ? [params?: SpaceParamsInputOf<Def>] : [params: SpaceParamsInputOf<Def>];
@@ -6443,7 +6445,7 @@ interface PlatformWiseInstanceMethods<Def extends AnyPlatformDef> {
6443
6445
  }
6444
6446
  type PlatformSpace<Def extends AnyPlatformDef> = Omit<SpaceShapeOf<Def>, keyof Space | keyof SpaceActionMethods<Def>> & Space & SpaceActionMethods<Def>;
6445
6447
  type PlatformMessage<Def extends AnyPlatformDef> = Omit<SchemaInfer<Def["message"]>, keyof Message | keyof MessageActionMethods<Def>> & Message<Def["name"], PlatformUser<Def>, PlatformSpace<Def>> & MessageActionMethods<Def>;
6446
- type PlatformUser<Def extends AnyPlatformDef> = Omit<ResolvedUserOf<Def>, keyof User> & User;
6448
+ type PlatformUser<Def extends AnyPlatformDef> = Omit<UserShapeOf<Def>, keyof User> & User;
6447
6449
  type PlatformInstance<Def extends AnyPlatformDef> = {
6448
6450
  readonly messages: AsyncIterable<[PlatformSpace<Def>, PlatformMessage<Def>]>;
6449
6451
  readonly space: SpaceNamespace<Def>;
@@ -6891,10 +6893,6 @@ declare const contentSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
6891
6893
  }, z.core.$strip>, z.ZodObject<{
6892
6894
  type: z.ZodLiteral<"reply">;
6893
6895
  content: z.ZodCustom<{
6894
- type: "reaction";
6895
- emoji: string;
6896
- target: Message<string, User, Space<unknown>>;
6897
- } | {
6898
6896
  type: "text";
6899
6897
  text: string;
6900
6898
  } | {
@@ -6989,6 +6987,10 @@ declare const contentSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
6989
6987
  imageSubtitle: z.ZodOptional<z.ZodString>;
6990
6988
  summary: z.ZodOptional<z.ZodString>;
6991
6989
  }, z.core.$strip>>>;
6990
+ } | {
6991
+ type: "reaction";
6992
+ emoji: string;
6993
+ target: Message<string, User, Space<unknown>>;
6992
6994
  } | {
6993
6995
  type: "group";
6994
6996
  items: Message<string, User, Space<unknown>>[];
@@ -7046,10 +7048,6 @@ declare const contentSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
7046
7048
  kind: "clear";
7047
7049
  };
7048
7050
  }, {
7049
- type: "reaction";
7050
- emoji: string;
7051
- target: Message<string, User, Space<unknown>>;
7052
- } | {
7053
7051
  type: "text";
7054
7052
  text: string;
7055
7053
  } | {
@@ -7144,6 +7142,10 @@ declare const contentSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
7144
7142
  imageSubtitle: z.ZodOptional<z.ZodString>;
7145
7143
  summary: z.ZodOptional<z.ZodString>;
7146
7144
  }, z.core.$strip>>>;
7145
+ } | {
7146
+ type: "reaction";
7147
+ emoji: string;
7148
+ target: Message<string, User, Space<unknown>>;
7147
7149
  } | {
7148
7150
  type: "group";
7149
7151
  items: Message<string, User, Space<unknown>>[];
@@ -7205,10 +7207,6 @@ declare const contentSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
7205
7207
  }, z.core.$strip>, z.ZodObject<{
7206
7208
  type: z.ZodLiteral<"edit">;
7207
7209
  content: z.ZodCustom<{
7208
- type: "reaction";
7209
- emoji: string;
7210
- target: Message<string, User, Space<unknown>>;
7211
- } | {
7212
7210
  type: "text";
7213
7211
  text: string;
7214
7212
  } | {
@@ -7303,6 +7301,10 @@ declare const contentSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
7303
7301
  imageSubtitle: z.ZodOptional<z.ZodString>;
7304
7302
  summary: z.ZodOptional<z.ZodString>;
7305
7303
  }, z.core.$strip>>>;
7304
+ } | {
7305
+ type: "reaction";
7306
+ emoji: string;
7307
+ target: Message<string, User, Space<unknown>>;
7306
7308
  } | {
7307
7309
  type: "group";
7308
7310
  items: Message<string, User, Space<unknown>>[];
@@ -7360,10 +7362,6 @@ declare const contentSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
7360
7362
  kind: "clear";
7361
7363
  };
7362
7364
  }, {
7363
- type: "reaction";
7364
- emoji: string;
7365
- target: Message<string, User, Space<unknown>>;
7366
- } | {
7367
7365
  type: "text";
7368
7366
  text: string;
7369
7367
  } | {
@@ -7458,6 +7456,10 @@ declare const contentSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
7458
7456
  imageSubtitle: z.ZodOptional<z.ZodString>;
7459
7457
  summary: z.ZodOptional<z.ZodString>;
7460
7458
  }, z.core.$strip>>>;
7459
+ } | {
7460
+ type: "reaction";
7461
+ emoji: string;
7462
+ target: Message<string, User, Space<unknown>>;
7461
7463
  } | {
7462
7464
  type: "group";
7463
7465
  items: Message<string, User, Space<unknown>>[];
@@ -1,4 +1,4 @@
1
- import { $t as groupSchema, Bt as asPollOption, Dn as buildPhotoAction, En as PhotoInput, H as ProviderMessageRecord, K as ManagedStream, Nt as asRead, On as photoActionSchema, St as asText, Tt as asRichlink, Wt as asMarkdown, Zt as asGroup, cn as reactionSchema, gt as asVoice, ln as asCustom, on as asReaction, r as asAttachment, yn as asContact, zt as asPoll } from "./attachment-a_lrhg6w.js";
1
+ import { $t as groupSchema, Bt as asPollOption, Dn as buildPhotoAction, En as PhotoInput, H as ProviderMessageRecord, K as ManagedStream, Nt as asRead, On as photoActionSchema, St as asText, Tt as asRichlink, Wt as asMarkdown, Zt as asGroup, cn as reactionSchema, gt as asVoice, ln as asCustom, on as asReaction, r as asAttachment, yn as asContact, zt as asPoll } from "./attachment-CfEp6LAu.js";
2
2
  import z from "zod";
3
3
  import { LogAttrs, LogAttrs as LogAttrs$1, LogLevel, PhotonLogger, createLogger, sanitizeEmail, sanitizeErrorMessage, sanitizePhone, setLogLevel } from "@photon-ai/otel";
4
4
  import { Token } from "marked";
package/dist/elysia.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { T as WebhookHandler, nn as Message, rn as Space } from "./attachment-a_lrhg6w.js";
1
+ import { T as WebhookHandler, nn as Message, rn as Space } from "./attachment-CfEp6LAu.js";
2
2
  import { Elysia } from "elysia";
3
3
 
4
4
  //#region src/elysia.d.ts
package/dist/express.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { T as WebhookHandler, nn as Message, rn as Space } from "./attachment-a_lrhg6w.js";
1
+ import { T as WebhookHandler, nn as Message, rn as Space } from "./attachment-CfEp6LAu.js";
2
2
  import { Router } from "express";
3
3
 
4
4
  //#region src/express.d.ts
package/dist/hono.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { T as WebhookHandler, nn as Message, rn as Space } from "./attachment-a_lrhg6w.js";
1
+ import { T as WebhookHandler, nn as Message, rn as Space } from "./attachment-CfEp6LAu.js";
2
2
 
3
3
  //#region src/hono.d.ts
4
4
  /**
package/dist/index.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- import { $ as FusorTokenData, A as isFusorEvent, An as AppLayout, At as Rename, B as PlatformUser, C as FusorVerify, Cn as Avatar, Ct as text, D as WebhookRawResult, Dt as resolveContents, E as WebhookRawRequest, Et as richlink, F as PlatformInstance, Ft as Poll, G as Broadcaster, Gt as markdown, Ht as poll, I as PlatformMessage, It as PollChoice, J as mergeStreams, Jt as StreamTextSource, K as ManagedStream, Kt as DeltaExtractor, L as PlatformProviderConfig, Lt as PollChoiceInput, M as EventProducer, Mn as app, Mt as Read, N as Platform, Nn as appLayoutSchema, O as FusorEvent, Ot as Reply, P as PlatformDef, Pt as read, Q as DedicatedTokenData, Qt as group, R as PlatformRuntime, Rt as PollOption, S as FusorRespond, Sn as User, T as WebhookHandler, Tn as avatar, U as SchemaMessage, Ut as Markdown, V as ProviderMessage, Vt as option, W as SpaceNamespace, X as Store, Xt as Group, Y as stream, Yt as TextStreamOptions, Z as CloudPlatform, _ as FusorClient, _n as ContactOrg, _t as voice, a as Content, an as ReactionBuilder, at as SharedTokenData, b as FusorMessagesReturn, bn as contact, bt as Typing, c as fromVCard, ct as SpectrumCloudError, d as UnsupportedKind, dn as Contact, dt as TokenData, en as Edit, et as ImessageInfoData, f as Spectrum, fn as ContactAddress, ft as cloud, g as isFusorClient, gn as ContactName, h as fusor, hn as ContactInput, ht as Voice, i as attachment, in as Reaction, it as ProjectProfile, j as AnyPlatformDef, jn as AppUrl, jt as rename, k as fusorEvent, kn as App, kt as reply, l as toVCard, lt as SubscriptionData, m as definePlatform, mn as ContactEmail, mt as EmojiKey, n as AttachmentInput, nn as Message, nt as PlatformsData, o as ContentBuilder, ot as SlackTeamMeta, p as SpectrumInstance, pn as ContactDetails, pt as Emoji, q as broadcast, qt as StreamText, rn as Space, rt as ProjectData, s as ContentInput, sn as reaction, st as SlackTokenData, t as Attachment, tn as edit, tt as PlatformStatus, u as UnsupportedError, un as custom, ut as SubscriptionStatus, v as FusorMessages, vn as ContactPhone, vt as Unsend, w as FusorVerifyRequest, wn as AvatarInput, wt as Richlink, x as FusorReply, xn as AgentSender, xt as typing, y as FusorMessagesCtx, yt as unsend, z as PlatformSpace } from "./attachment-a_lrhg6w.js";
1
+ import { $ as FusorTokenData, A as isFusorEvent, An as AppLayout, At as Rename, B as PlatformUser, C as FusorVerify, Cn as Avatar, Ct as text, D as WebhookRawResult, Dt as resolveContents, E as WebhookRawRequest, Et as richlink, F as PlatformInstance, Ft as Poll, G as Broadcaster, Gt as markdown, Ht as poll, I as PlatformMessage, It as PollChoice, J as mergeStreams, Jt as StreamTextSource, K as ManagedStream, Kt as DeltaExtractor, L as PlatformProviderConfig, Lt as PollChoiceInput, M as EventProducer, Mn as app, Mt as Read, N as Platform, Nn as appLayoutSchema, O as FusorEvent, Ot as Reply, P as PlatformDef, Pt as read, Q as DedicatedTokenData, Qt as group, R as PlatformRuntime, Rt as PollOption, S as FusorRespond, Sn as User, T as WebhookHandler, Tn as avatar, U as SchemaMessage, Ut as Markdown, V as ProviderMessage, Vt as option, W as SpaceNamespace, X as Store, Xt as Group, Y as stream, Yt as TextStreamOptions, Z as CloudPlatform, _ as FusorClient, _n as ContactOrg, _t as voice, a as Content, an as ReactionBuilder, at as SharedTokenData, b as FusorMessagesReturn, bn as contact, bt as Typing, c as fromVCard, ct as SpectrumCloudError, d as UnsupportedKind, dn as Contact, dt as TokenData, en as Edit, et as ImessageInfoData, f as Spectrum, fn as ContactAddress, ft as cloud, g as isFusorClient, gn as ContactName, h as fusor, hn as ContactInput, ht as Voice, i as attachment, in as Reaction, it as ProjectProfile, j as AnyPlatformDef, jn as AppUrl, jt as rename, k as fusorEvent, kn as App, kt as reply, l as toVCard, lt as SubscriptionData, m as definePlatform, mn as ContactEmail, mt as EmojiKey, n as AttachmentInput, nn as Message, nt as PlatformsData, o as ContentBuilder, ot as SlackTeamMeta, p as SpectrumInstance, pn as ContactDetails, pt as Emoji, q as broadcast, qt as StreamText, rn as Space, rt as ProjectData, s as ContentInput, sn as reaction, st as SlackTokenData, t as Attachment, tn as edit, tt as PlatformStatus, u as UnsupportedError, un as custom, ut as SubscriptionStatus, v as FusorMessages, vn as ContactPhone, vt as Unsend, w as FusorVerifyRequest, wn as AvatarInput, wt as Richlink, x as FusorReply, xn as AgentSender, xt as typing, y as FusorMessagesCtx, yt as unsend, z as PlatformSpace } from "./attachment-CfEp6LAu.js";
2
2
  export { type AgentSender, type AnyPlatformDef, type App, type AppLayout, type AppUrl, type Attachment, type AttachmentInput, type Avatar, type AvatarInput, type Broadcaster, type CloudPlatform, type Contact, type ContactAddress, type ContactDetails, type ContactEmail, type ContactInput, type ContactName, type ContactOrg, type ContactPhone, type Content, type ContentBuilder, type ContentInput, type DedicatedTokenData, type DeltaExtractor, type Edit, Emoji, type EmojiKey, type EventProducer, type FusorClient, type FusorEvent, type FusorMessages, type FusorMessagesCtx, type FusorMessagesReturn, type FusorReply, type FusorRespond, type FusorTokenData, type FusorVerify, type FusorVerifyRequest, type Group, type ImessageInfoData, type ManagedStream, type Markdown, type Message, type Platform, type PlatformDef, type PlatformInstance, type PlatformMessage, type PlatformProviderConfig, type PlatformRuntime, type PlatformSpace, type PlatformStatus, type PlatformUser, type PlatformsData, type Poll, type PollChoice, type PollChoiceInput, type PollOption, type ProjectData, type ProjectProfile, type ProviderMessage, type Reaction, type ReactionBuilder, type Read, type Rename, type Reply, type Richlink, type SchemaMessage, type SharedTokenData, type SlackTeamMeta, type SlackTokenData, type Space, type SpaceNamespace, Spectrum, SpectrumCloudError, type SpectrumInstance, type Store, type StreamText, type StreamTextSource, type SubscriptionData, type SubscriptionStatus, type TextStreamOptions, type TokenData, type Typing, type Unsend, UnsupportedError, type UnsupportedKind, type User, type Voice, type WebhookHandler, type WebhookRawRequest, type WebhookRawResult, app, appLayoutSchema, attachment, avatar, broadcast, cloud, contact, custom, definePlatform, edit, fromVCard, fusor, fusorEvent, group, isFusorClient, isFusorEvent, markdown, mergeStreams, option, poll, reaction, read, rename, reply, resolveContents, richlink, stream, text, toVCard, typing, unsend, voice };
package/dist/index.js CHANGED
@@ -2994,7 +2994,7 @@ function definePlatform(name, rawDef) {
2994
2994
  }
2995
2995
  //#endregion
2996
2996
  //#region src/build-env.ts
2997
- const SPECTRUM_SDK_VERSION = "5.1.0";
2997
+ const SPECTRUM_SDK_VERSION = "6.0.0";
2998
2998
  //#endregion
2999
2999
  //#region src/utils/provider-packages.ts
3000
3000
  const OFFICIAL_PROVIDER_PACKAGES = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@spectrum-ts/core",
3
- "version": "5.1.0",
3
+ "version": "6.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",