@spectrum-ts/core 10.0.0 → 11.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -592,9 +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: "custom";
|
|
596
|
-
raw: unknown;
|
|
597
|
-
} | {
|
|
598
595
|
type: "attachment";
|
|
599
596
|
id: string;
|
|
600
597
|
name: string;
|
|
@@ -651,6 +648,9 @@ declare const editSchema: z.ZodObject<{
|
|
|
651
648
|
} | {
|
|
652
649
|
type: "markdown";
|
|
653
650
|
markdown: string;
|
|
651
|
+
} | {
|
|
652
|
+
type: "custom";
|
|
653
|
+
raw: unknown;
|
|
654
654
|
} | {
|
|
655
655
|
type: "group";
|
|
656
656
|
items: Message<string, User, Space<unknown>>[];
|
|
@@ -749,9 +749,6 @@ declare const editSchema: z.ZodObject<{
|
|
|
749
749
|
} | {
|
|
750
750
|
type: "leaveSpace";
|
|
751
751
|
}, {
|
|
752
|
-
type: "custom";
|
|
753
|
-
raw: unknown;
|
|
754
|
-
} | {
|
|
755
752
|
type: "attachment";
|
|
756
753
|
id: string;
|
|
757
754
|
name: string;
|
|
@@ -808,6 +805,9 @@ declare const editSchema: z.ZodObject<{
|
|
|
808
805
|
} | {
|
|
809
806
|
type: "markdown";
|
|
810
807
|
markdown: string;
|
|
808
|
+
} | {
|
|
809
|
+
type: "custom";
|
|
810
|
+
raw: unknown;
|
|
811
811
|
} | {
|
|
812
812
|
type: "group";
|
|
813
813
|
items: Message<string, User, Space<unknown>>[];
|
|
@@ -1136,9 +1136,6 @@ declare function rename(displayName: string): ContentBuilder;
|
|
|
1136
1136
|
declare const replySchema: z.ZodObject<{
|
|
1137
1137
|
type: z.ZodLiteral<"reply">;
|
|
1138
1138
|
content: z.ZodCustom<{
|
|
1139
|
-
type: "custom";
|
|
1140
|
-
raw: unknown;
|
|
1141
|
-
} | {
|
|
1142
1139
|
type: "attachment";
|
|
1143
1140
|
id: string;
|
|
1144
1141
|
name: string;
|
|
@@ -1195,6 +1192,9 @@ declare const replySchema: z.ZodObject<{
|
|
|
1195
1192
|
} | {
|
|
1196
1193
|
type: "markdown";
|
|
1197
1194
|
markdown: string;
|
|
1195
|
+
} | {
|
|
1196
|
+
type: "custom";
|
|
1197
|
+
raw: unknown;
|
|
1198
1198
|
} | {
|
|
1199
1199
|
type: "group";
|
|
1200
1200
|
items: Message<string, User, Space<unknown>>[];
|
|
@@ -1293,9 +1293,6 @@ declare const replySchema: z.ZodObject<{
|
|
|
1293
1293
|
} | {
|
|
1294
1294
|
type: "leaveSpace";
|
|
1295
1295
|
}, {
|
|
1296
|
-
type: "custom";
|
|
1297
|
-
raw: unknown;
|
|
1298
|
-
} | {
|
|
1299
1296
|
type: "attachment";
|
|
1300
1297
|
id: string;
|
|
1301
1298
|
name: string;
|
|
@@ -1352,6 +1349,9 @@ declare const replySchema: z.ZodObject<{
|
|
|
1352
1349
|
} | {
|
|
1353
1350
|
type: "markdown";
|
|
1354
1351
|
markdown: string;
|
|
1352
|
+
} | {
|
|
1353
|
+
type: "custom";
|
|
1354
|
+
raw: unknown;
|
|
1355
1355
|
} | {
|
|
1356
1356
|
type: "group";
|
|
1357
1357
|
items: Message<string, User, Space<unknown>>[];
|
|
@@ -1562,6 +1562,9 @@ declare const unsendSchema: z.ZodObject<{
|
|
|
1562
1562
|
target: z.ZodCustom<Message<string, User, Space<unknown>>, Message<string, User, Space<unknown>>>;
|
|
1563
1563
|
}, z.core.$strip>;
|
|
1564
1564
|
type Unsend = z.infer<typeof unsendSchema>;
|
|
1565
|
+
declare const asUnsend: (input: {
|
|
1566
|
+
target: Message;
|
|
1567
|
+
}) => Unsend;
|
|
1565
1568
|
/**
|
|
1566
1569
|
* Construct an `unsend` content value retracting `target`.
|
|
1567
1570
|
*
|
|
@@ -7278,9 +7281,6 @@ declare const contentSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
7278
7281
|
}, z.core.$strip>, z.ZodObject<{
|
|
7279
7282
|
type: z.ZodLiteral<"reply">;
|
|
7280
7283
|
content: z.ZodCustom<{
|
|
7281
|
-
type: "custom";
|
|
7282
|
-
raw: unknown;
|
|
7283
|
-
} | {
|
|
7284
7284
|
type: "attachment";
|
|
7285
7285
|
id: string;
|
|
7286
7286
|
name: string;
|
|
@@ -7337,6 +7337,9 @@ declare const contentSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
7337
7337
|
} | {
|
|
7338
7338
|
type: "markdown";
|
|
7339
7339
|
markdown: string;
|
|
7340
|
+
} | {
|
|
7341
|
+
type: "custom";
|
|
7342
|
+
raw: unknown;
|
|
7340
7343
|
} | {
|
|
7341
7344
|
type: "group";
|
|
7342
7345
|
items: Message<string, User, Space<unknown>>[];
|
|
@@ -7435,9 +7438,6 @@ declare const contentSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
7435
7438
|
} | {
|
|
7436
7439
|
type: "leaveSpace";
|
|
7437
7440
|
}, {
|
|
7438
|
-
type: "custom";
|
|
7439
|
-
raw: unknown;
|
|
7440
|
-
} | {
|
|
7441
7441
|
type: "attachment";
|
|
7442
7442
|
id: string;
|
|
7443
7443
|
name: string;
|
|
@@ -7494,6 +7494,9 @@ declare const contentSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
7494
7494
|
} | {
|
|
7495
7495
|
type: "markdown";
|
|
7496
7496
|
markdown: string;
|
|
7497
|
+
} | {
|
|
7498
|
+
type: "custom";
|
|
7499
|
+
raw: unknown;
|
|
7497
7500
|
} | {
|
|
7498
7501
|
type: "group";
|
|
7499
7502
|
items: Message<string, User, Space<unknown>>[];
|
|
@@ -7596,9 +7599,6 @@ declare const contentSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
7596
7599
|
}, z.core.$strip>, z.ZodObject<{
|
|
7597
7600
|
type: z.ZodLiteral<"edit">;
|
|
7598
7601
|
content: z.ZodCustom<{
|
|
7599
|
-
type: "custom";
|
|
7600
|
-
raw: unknown;
|
|
7601
|
-
} | {
|
|
7602
7602
|
type: "attachment";
|
|
7603
7603
|
id: string;
|
|
7604
7604
|
name: string;
|
|
@@ -7655,6 +7655,9 @@ declare const contentSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
7655
7655
|
} | {
|
|
7656
7656
|
type: "markdown";
|
|
7657
7657
|
markdown: string;
|
|
7658
|
+
} | {
|
|
7659
|
+
type: "custom";
|
|
7660
|
+
raw: unknown;
|
|
7658
7661
|
} | {
|
|
7659
7662
|
type: "group";
|
|
7660
7663
|
items: Message<string, User, Space<unknown>>[];
|
|
@@ -7753,9 +7756,6 @@ declare const contentSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
7753
7756
|
} | {
|
|
7754
7757
|
type: "leaveSpace";
|
|
7755
7758
|
}, {
|
|
7756
|
-
type: "custom";
|
|
7757
|
-
raw: unknown;
|
|
7758
|
-
} | {
|
|
7759
7759
|
type: "attachment";
|
|
7760
7760
|
id: string;
|
|
7761
7761
|
name: string;
|
|
@@ -7812,6 +7812,9 @@ declare const contentSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
7812
7812
|
} | {
|
|
7813
7813
|
type: "markdown";
|
|
7814
7814
|
markdown: string;
|
|
7815
|
+
} | {
|
|
7816
|
+
type: "custom";
|
|
7817
|
+
raw: unknown;
|
|
7815
7818
|
} | {
|
|
7816
7819
|
type: "group";
|
|
7817
7820
|
items: Message<string, User, Space<unknown>>[];
|
|
@@ -7950,4 +7953,4 @@ declare function attachment(input: AttachmentInput, options?: {
|
|
|
7950
7953
|
name?: string;
|
|
7951
7954
|
}): ContentBuilder;
|
|
7952
7955
|
//#endregion
|
|
7953
|
-
export { DedicatedTokenData as $,
|
|
7956
|
+
export { DedicatedTokenData as $, StreamTextSource as $t, isFusorEvent as A, ContactInput as An, Reply as At, PlatformUser as B, AvatarInput as Bn, Poll as Bt, FusorVerify as C, reactionSchema as Cn, typing as Ct, WebhookRawResult as D, ContactAddress as Dn, asRichlink as Dt, WebhookRawRequest as E, Contact as En, Richlink as Et, PlatformInstance as F, contact as Fn, rename as Ft, SpaceNamespace as G, photoActionSchema as Gn, asPollOption as Gt, ProviderMessageRecord as H, avatarSchema as Hn, PollChoiceInput as Ht, PlatformMessage as I, AgentSender as In, renameSchema as It, broadcast as J, AppOptions as Jn, Markdown as Jt, Broadcaster as K, App as Kn, option as Kt, PlatformProviderConfig as L, User as Ln, Read as Lt, EventProducer as M, ContactOrg as Mn, reply as Mt, Platform as N, ContactPhone as Nn, replySchema as Nt, FusorEvent as O, ContactDetails as On, richlink as Ot, PlatformDef as P, asContact as Pn, Rename as Pt, CloudPlatform as Q, StreamText as Qt, PlatformRuntime as R, Avatar as Rn, asRead as Rt, FusorRespond as S, reaction as Sn, Typing as St, WebhookHandler as T, custom as Tn, text as Tt, ProviderUserRecord as U, PhotoInput as Un, PollOption as Ut, ProviderMessage as V, avatar as Vn, PollChoice as Vt, SchemaMessage as W, buildPhotoAction as Wn, asPoll as Wt, stream as X, app as Xn, markdown as Xt, mergeStreams as Y, AppUrl as Yn, asMarkdown as Yt, Store as Z, appLayoutSchema as Zn, DeltaExtractor as Zt, FusorClient as _, removeMember as _n, asVoice as _t, Content as a, Edit as an, ProjectProfile as at, FusorMessagesReturn as b, ReactionBuilder as bn, asUnsend as bt, fromVCard as c, Space as cn, SlackTokenData as ct, UnsupportedKind as d, MemberInput as dn, SubscriptionStatus as dt, TextStreamOptions as en, FusorTokenData as et, Spectrum as f, RemoveMember as fn, TokenData as ft, isFusorClient as g, leaveSpaceSchema as gn, Voice as gt, fusor as h, leaveSpace as hn, EmojiKey as ht, attachment as i, groupSchema as in, ProjectData as it, AnyPlatformDef as j, ContactName as jn, asReply as jt, fusorEvent as k, ContactEmail as kn, resolveContents as kt, toVCard as l, AddMember as ln, SpectrumCloudError as lt, definePlatform as m, addMemberSchema as mn, Emoji as mt, AttachmentInput as n, asGroup as nn, PlatformStatus as nt, ContentBuilder as o, edit as on, SharedTokenData as ot, SpectrumInstance as p, addMember as pn, cloud as pt, ManagedStream as q, AppLayout as qn, poll as qt, asAttachment as r, group as rn, PlatformsData as rt, ContentInput as s, Message as sn, SlackTeamMeta as st, Attachment as t, Group as tn, ImessageInfoData as tt, UnsupportedError as u, LeaveSpace as un, SubscriptionData as ut, FusorMessages as v, removeMemberSchema as vn, voice as vt, FusorVerifyRequest as w, asCustom as wn, asText as wt, FusorReply as x, asReaction as xn, unsend as xt, FusorMessagesCtx as y, Reaction as yn, Unsend as yt, PlatformSpace as z, AvatarData as zn, read as zt };
|
package/dist/authoring.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Cn as reactionSchema, Dt as asRichlink, Gn as photoActionSchema, Gt as asPollOption, H as ProviderMessageRecord, Hn as avatarSchema, It as renameSchema, Nt as replySchema, Pn as asContact, Rt as asRead, U as ProviderUserRecord, Un as PhotoInput, Wn as buildPhotoAction, Wt as asPoll, Yt as asMarkdown, _t as asVoice, bt as asUnsend, gn as leaveSpaceSchema, in as groupSchema, jt as asReply, mn as addMemberSchema, nn as asGroup, q as ManagedStream, r as asAttachment, vn as removeMemberSchema, wn as asCustom, wt as asText, xn as asReaction } from "./attachment-BK3lYu2W.js";
|
|
2
2
|
import z from "zod";
|
|
3
3
|
import { FetchSpanOptions, LogAttrs, LogAttrs as LogAttrs$1, LogLevel, PhotonLogger, SanitizeUrlOptions, createLogger, sanitizeEmail, sanitizeErrorMessage, sanitizePhone, sanitizeUrl, setLogLevel } from "@photon-ai/otel";
|
|
4
4
|
import { Token } from "marked";
|
|
@@ -178,4 +178,4 @@ declare const resumableOrderedStream: <TLive, TMissed, TOutput>(options: Resumab
|
|
|
178
178
|
*/
|
|
179
179
|
declare function errorAttrs(error: unknown, prefix?: string): LogAttrs$1;
|
|
180
180
|
//#endregion
|
|
181
|
-
export { type CloseableAsyncIterable, type LogAttrs, type LogLevel, type PhotoInput, type PhotonLogger, type ProviderMessageRecord, type ProviderUserRecord, type ResumableStreamItem, type SanitizeUrlOptions, addMemberSchema, asAttachment, asContact, asCustom, asGroup, asMarkdown, asPoll, asPollOption, asReaction, asRead, asReply, asRichlink, asText, asVoice, avatarSchema, buildPhotoAction, createLogger, ensureM4a, envAwareConfig, envFor, errorAttrs, fromEnv, groupSchema, leaveSpaceSchema, messageEffectSchema, photoActionSchema, reactionSchema, removeMemberSchema, renameSchema, renderInlineTokens, replySchema, resumableOrderedStream, sanitizeEmail, sanitizeErrorMessage, sanitizePhone, sanitizeUrl, setLogLevel, tracedFetch };
|
|
181
|
+
export { type CloseableAsyncIterable, type LogAttrs, type LogLevel, type PhotoInput, type PhotonLogger, type ProviderMessageRecord, type ProviderUserRecord, type ResumableStreamItem, type SanitizeUrlOptions, addMemberSchema, asAttachment, asContact, asCustom, asGroup, asMarkdown, asPoll, asPollOption, asReaction, asRead, asReply, asRichlink, asText, asUnsend, asVoice, avatarSchema, buildPhotoAction, createLogger, ensureM4a, envAwareConfig, envFor, errorAttrs, fromEnv, groupSchema, leaveSpaceSchema, messageEffectSchema, photoActionSchema, reactionSchema, removeMemberSchema, renameSchema, renderInlineTokens, replySchema, resumableOrderedStream, sanitizeEmail, sanitizeErrorMessage, sanitizePhone, sanitizeUrl, setLogLevel, tracedFetch };
|
package/dist/authoring.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { A as asPoll, B as asMarkdown, D as asReaction, F as addMemberSchema, G as groupSchema, H as markdownSchema, L as leaveSpaceSchema, Q as asCustom, S as replySchema, T as asRead, U as asGroup, Y as textSchema, at as avatarSchema, b as asReply, ct as asAttachment, d as envAwareConfig, et as asContact, f as envFor, ft as tracedFetch, g as asUnsend, i as stream, j as asPollOption, k as reactionSchema, l as renderInlineTokens, m as asVoice, o as errorAttrs, ot as buildPhotoAction, p as fromEnv, q as asText, st as photoActionSchema, ut as attachmentSchema, v as asRichlink, w as renameSchema, z as removeMemberSchema } from "./stream-CxcG-Kup.js";
|
|
2
2
|
import z from "zod";
|
|
3
3
|
import { createLogger, createLogger as createLogger$1, sanitizeEmail, sanitizeErrorMessage, sanitizePhone, sanitizeUrl, setLogLevel } from "@photon-ai/otel";
|
|
4
4
|
import { mkdtemp, readFile, rm, writeFile } from "node:fs/promises";
|
|
@@ -422,4 +422,4 @@ const resumableOrderedStream = (options) => stream((emit, end) => {
|
|
|
422
422
|
};
|
|
423
423
|
});
|
|
424
424
|
//#endregion
|
|
425
|
-
export { addMemberSchema, asAttachment, asContact, asCustom, asGroup, asMarkdown, asPoll, asPollOption, asReaction, asRead, asReply, asRichlink, asText, asVoice, avatarSchema, buildPhotoAction, createLogger, ensureM4a, envAwareConfig, envFor, errorAttrs, fromEnv, groupSchema, leaveSpaceSchema, messageEffectSchema, photoActionSchema, reactionSchema, removeMemberSchema, renameSchema, renderInlineTokens, replySchema, resumableOrderedStream, sanitizeEmail, sanitizeErrorMessage, sanitizePhone, sanitizeUrl, setLogLevel, tracedFetch };
|
|
425
|
+
export { addMemberSchema, asAttachment, asContact, asCustom, asGroup, asMarkdown, asPoll, asPollOption, asReaction, asRead, asReply, asRichlink, asText, asUnsend, asVoice, avatarSchema, buildPhotoAction, createLogger, ensureM4a, envAwareConfig, envFor, errorAttrs, fromEnv, groupSchema, leaveSpaceSchema, messageEffectSchema, photoActionSchema, reactionSchema, removeMemberSchema, renameSchema, renderInlineTokens, replySchema, resumableOrderedStream, sanitizeEmail, sanitizeErrorMessage, sanitizePhone, sanitizeUrl, setLogLevel, tracedFetch };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { $ as DedicatedTokenData, $t as
|
|
1
|
+
import { $ as DedicatedTokenData, $t as StreamTextSource, A as isFusorEvent, An as ContactInput, At as Reply, B as PlatformUser, Bn as AvatarInput, Bt as Poll, C as FusorVerify, Ct as typing, D as WebhookRawResult, Dn as ContactAddress, E as WebhookRawRequest, En as Contact, Et as Richlink, F as PlatformInstance, Fn as contact, Ft as rename, G as SpaceNamespace, Ht as PollChoiceInput, I as PlatformMessage, In as AgentSender, J as broadcast, Jn as AppOptions, Jt as Markdown, K as Broadcaster, Kn as App, Kt as option, L as PlatformProviderConfig, Ln as User, Lt as Read, M as EventProducer, Mn as ContactOrg, Mt as reply, N as Platform, Nn as ContactPhone, O as FusorEvent, On as ContactDetails, Ot as richlink, P as PlatformDef, Pt as Rename, Q as CloudPlatform, Qt as StreamText, R as PlatformRuntime, Rn as Avatar, S as FusorRespond, Sn as reaction, St as Typing, T as WebhookHandler, Tn as custom, Tt as text, Ut as PollOption, V as ProviderMessage, Vn as avatar, Vt as PollChoice, W as SchemaMessage, X as stream, Xn as app, Xt as markdown, Y as mergeStreams, Yn as AppUrl, Z as Store, Zn as appLayoutSchema, Zt as DeltaExtractor, _ as FusorClient, _n as removeMember, a as Content, an as Edit, at as ProjectProfile, b as FusorMessagesReturn, bn as ReactionBuilder, c as fromVCard, cn as Space, ct as SlackTokenData, d as UnsupportedKind, dn as MemberInput, dt as SubscriptionStatus, en as TextStreamOptions, et as FusorTokenData, f as Spectrum, fn as RemoveMember, ft as TokenData, g as isFusorClient, gt as Voice, h as fusor, hn as leaveSpace, ht as EmojiKey, i as attachment, it as ProjectData, j as AnyPlatformDef, jn as ContactName, k as fusorEvent, kn as ContactEmail, kt as resolveContents, l as toVCard, ln as AddMember, lt as SpectrumCloudError, m as definePlatform, mt as Emoji, n as AttachmentInput, nt as PlatformStatus, o as ContentBuilder, on as edit, ot as SharedTokenData, p as SpectrumInstance, pn as addMember, pt as cloud, q as ManagedStream, qn as AppLayout, qt as poll, rn as group, rt as PlatformsData, s as ContentInput, sn as Message, st as SlackTeamMeta, t as Attachment, tn as Group, tt as ImessageInfoData, u as UnsupportedError, un as LeaveSpace, ut as SubscriptionData, v as FusorMessages, vt as voice, w as FusorVerifyRequest, x as FusorReply, xt as unsend, y as FusorMessagesCtx, yn as Reaction, yt as Unsend, z as PlatformSpace, zn as AvatarData, zt as read } from "./attachment-BK3lYu2W.js";
|
|
2
2
|
export { type AddMember, type AgentSender, type AnyPlatformDef, type App, type AppLayout, type AppOptions, type AppUrl, type Attachment, type AttachmentInput, type Avatar, type AvatarData, type AvatarInput, type Broadcaster, type CloudPlatform, type Contact, type ContactAddress, type ContactDetails, type ContactEmail, type ContactInput, type ContactName, type ContactOrg, type ContactPhone, type Content, type ContentBuilder, type ContentInput, type DedicatedTokenData, type DeltaExtractor, type Edit, Emoji, type EmojiKey, type EventProducer, type FusorClient, type FusorEvent, type FusorMessages, type FusorMessagesCtx, type FusorMessagesReturn, type FusorReply, type FusorRespond, type FusorTokenData, type FusorVerify, type FusorVerifyRequest, type Group, type ImessageInfoData, type LeaveSpace, type ManagedStream, type Markdown, type MemberInput, type Message, type Platform, type PlatformDef, type PlatformInstance, type PlatformMessage, type PlatformProviderConfig, type PlatformRuntime, type PlatformSpace, type PlatformStatus, type PlatformUser, type PlatformsData, type Poll, type PollChoice, type PollChoiceInput, type PollOption, type ProjectData, type ProjectProfile, type ProviderMessage, type Reaction, type ReactionBuilder, type Read, type RemoveMember, type Rename, type Reply, type Richlink, type SchemaMessage, type SharedTokenData, type SlackTeamMeta, type SlackTokenData, type Space, type SpaceNamespace, Spectrum, SpectrumCloudError, type SpectrumInstance, type Store, type StreamText, type StreamTextSource, type SubscriptionData, type SubscriptionStatus, type TextStreamOptions, type TokenData, type Typing, type Unsend, UnsupportedError, type UnsupportedKind, type User, type Voice, type WebhookHandler, type WebhookRawRequest, type WebhookRawResult, addMember, app, appLayoutSchema, attachment, avatar, broadcast, cloud, contact, custom, definePlatform, edit, fromVCard, fusor, fusorEvent, group, isFusorClient, isFusorEvent, leaveSpace, markdown, mergeStreams, option, poll, reaction, read, removeMember, rename, reply, resolveContents, richlink, stream, text, toVCard, typing, unsend, voice };
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $ as
|
|
1
|
+
import { $ as custom, B as asMarkdown, C as rename, E as read, F as addMemberSchema, I as leaveSpace, J as text, K as resolveContents, L as leaveSpaceSchema, M as option, N as poll, O as reaction, P as addMember, Q as asCustom, R as removeMember, V as markdown, W as group, X as StreamConsumedError, Z as drainStreamText, _ as unsend, a as contentAttrs, at as avatarSchema, c as markdownToPlainText, ct as asAttachment, d as envAwareConfig, dt as fetchUrlBytes, et as asContact, f as envFor, ft as tracedFetch, h as voice, i as stream, it as avatar, lt as attachment, n as createAsyncQueue, nt as fromVCard, o as errorAttrs, q as asText, r as mergeStreams, rt as toVCard, s as senderAttrs, t as broadcast, tt as contact, u as classifyIdentifier, w as renameSchema, x as reply, y as richlink, z as removeMemberSchema } from "./stream-CxcG-Kup.js";
|
|
2
2
|
import z from "zod";
|
|
3
3
|
import ogs from "open-graph-scraper";
|
|
4
4
|
import { createLogger, setLogLevel, setupOtel, withSpan } from "@photon-ai/otel";
|
|
@@ -170,7 +170,7 @@ function app(url, options = {}) {
|
|
|
170
170
|
}
|
|
171
171
|
//#endregion
|
|
172
172
|
//#region src/content/edit.ts
|
|
173
|
-
const isMessage
|
|
173
|
+
const isMessage = (v) => typeof v === "object" && v !== null && "id" in v && "content" in v;
|
|
174
174
|
const isContent = (v) => typeof v === "object" && v !== null && "type" in v && typeof v.type === "string";
|
|
175
175
|
/**
|
|
176
176
|
* An `edit` rewrites the content of a previously-sent outbound message.
|
|
@@ -188,7 +188,7 @@ const isContent = (v) => typeof v === "object" && v !== null && "type" in v && t
|
|
|
188
188
|
const editSchema = z.object({
|
|
189
189
|
type: z.literal("edit"),
|
|
190
190
|
content: z.custom(isContent, { message: "edit content must be a Content value" }),
|
|
191
|
-
target: z.custom(isMessage
|
|
191
|
+
target: z.custom(isMessage, { message: "edit target must be a Message" })
|
|
192
192
|
});
|
|
193
193
|
const asEdit = (input) => editSchema.parse({
|
|
194
194
|
type: "edit",
|
|
@@ -244,52 +244,6 @@ function typing(state = "start") {
|
|
|
244
244
|
}) };
|
|
245
245
|
}
|
|
246
246
|
//#endregion
|
|
247
|
-
//#region src/content/unsend.ts
|
|
248
|
-
const isMessage = (v) => typeof v === "object" && v !== null && "id" in v && "content" in v;
|
|
249
|
-
/**
|
|
250
|
-
* An `unsend` retracts a previously-sent outbound message.
|
|
251
|
-
*
|
|
252
|
-
* `space.send(unsend(message))` is the canonical outbound API;
|
|
253
|
-
* `message.unsend()` and `space.unsend(message)` are sugar that delegate
|
|
254
|
-
* here. Unsends are fire-and-forget — providers handle them inside their
|
|
255
|
-
* `send` action and the resolved value is `undefined` (no new message id is
|
|
256
|
-
* produced; the existing message is retracted in place).
|
|
257
|
-
*
|
|
258
|
-
* Platform constraints surface from the provider at send time — e.g.
|
|
259
|
-
* iMessage enforces Apple's ~2-minute unsend window for regular messages
|
|
260
|
-
* (reaction removal is not time-limited), and a late or repeated unsend
|
|
261
|
-
* rejects with the provider's error. `space.getMessage(id)` results are
|
|
262
|
-
* wrapped as inbound, so a message cannot be unsent from a refetched id
|
|
263
|
-
* after a restart — keep the Message returned by `send` (same limitation
|
|
264
|
-
* as `edit`).
|
|
265
|
-
*/
|
|
266
|
-
const unsendSchema = z.object({
|
|
267
|
-
type: z.literal("unsend"),
|
|
268
|
-
target: z.custom(isMessage, { message: "unsend target must be a Message" })
|
|
269
|
-
});
|
|
270
|
-
const asUnsend = (input) => unsendSchema.parse({
|
|
271
|
-
type: "unsend",
|
|
272
|
-
...input
|
|
273
|
-
});
|
|
274
|
-
/**
|
|
275
|
-
* Construct an `unsend` content value retracting `target`.
|
|
276
|
-
*
|
|
277
|
-
* Only outbound messages (those sent by the agent) can be unsent; calling
|
|
278
|
-
* this with an inbound target throws at build time so the misuse surfaces
|
|
279
|
-
* before the send pipeline runs.
|
|
280
|
-
*
|
|
281
|
-
* Accepts `Message | undefined` so `space.send` results chain without
|
|
282
|
-
* narrowing (`send` resolves `undefined` when a platform skips unsupported
|
|
283
|
-
* content); an undefined target throws at build time.
|
|
284
|
-
*/
|
|
285
|
-
function unsend(target) {
|
|
286
|
-
return { build: async () => {
|
|
287
|
-
if (!target) throw new Error("unsend() target is undefined — the targeted message was never sent (space.send resolves undefined when a platform skips unsupported content)");
|
|
288
|
-
if (target.direction !== "outbound") throw new Error(`unsend() target must be an outbound message (got direction "${target.direction}", message id "${target.id}")`);
|
|
289
|
-
return asUnsend({ target });
|
|
290
|
-
} };
|
|
291
|
-
}
|
|
292
|
-
//#endregion
|
|
293
247
|
//#region src/emoji/generated.ts
|
|
294
248
|
const GeneratedEmoji = {
|
|
295
249
|
_1stPlaceMedal: "🥇",
|
|
@@ -3051,7 +3005,7 @@ function definePlatform(name, rawDef) {
|
|
|
3051
3005
|
}
|
|
3052
3006
|
//#endregion
|
|
3053
3007
|
//#region src/build-env.ts
|
|
3054
|
-
const SPECTRUM_SDK_VERSION = "
|
|
3008
|
+
const SPECTRUM_SDK_VERSION = "11.1.0";
|
|
3055
3009
|
//#endregion
|
|
3056
3010
|
//#region src/utils/provider-packages.ts
|
|
3057
3011
|
const OFFICIAL_PROVIDER_PACKAGES = {
|
|
@@ -731,7 +731,7 @@ function text(source, options) {
|
|
|
731
731
|
const resolveContents = (items) => Promise.all(items.map((c) => typeof c === "string" ? text(c).build() : c.build()));
|
|
732
732
|
//#endregion
|
|
733
733
|
//#region src/content/group.ts
|
|
734
|
-
const isMessage$
|
|
734
|
+
const isMessage$4 = (v) => typeof v === "object" && v !== null && "id" in v && "content" in v;
|
|
735
735
|
/**
|
|
736
736
|
* A `group` bundles multiple messages into one logical unit (e.g. an album
|
|
737
737
|
* of images sent together). Each item is a full `Message` — addressable by
|
|
@@ -743,7 +743,7 @@ const isMessage$3 = (v) => typeof v === "object" && v !== null && "id" in v && "
|
|
|
743
743
|
*/
|
|
744
744
|
const groupSchema = z.object({
|
|
745
745
|
type: z.literal("group"),
|
|
746
|
-
items: z.array(z.custom(isMessage$
|
|
746
|
+
items: z.array(z.custom(isMessage$4)).min(2)
|
|
747
747
|
});
|
|
748
748
|
const asGroup = (input) => groupSchema.parse({
|
|
749
749
|
type: "group",
|
|
@@ -899,11 +899,11 @@ function poll(title, ...rest) {
|
|
|
899
899
|
}
|
|
900
900
|
//#endregion
|
|
901
901
|
//#region src/content/reaction.ts
|
|
902
|
-
const isMessage$
|
|
902
|
+
const isMessage$3 = (v) => typeof v === "object" && v !== null && "id" in v && "content" in v;
|
|
903
903
|
const reactionSchema = z.object({
|
|
904
904
|
type: z.literal("reaction"),
|
|
905
905
|
emoji: z.string().min(1),
|
|
906
|
-
target: z.custom(isMessage$
|
|
906
|
+
target: z.custom(isMessage$3, { message: "reaction target must be a Message" })
|
|
907
907
|
});
|
|
908
908
|
const asReaction = (input) => reactionSchema.parse({
|
|
909
909
|
type: "reaction",
|
|
@@ -937,7 +937,7 @@ function reaction(emoji, target) {
|
|
|
937
937
|
}
|
|
938
938
|
//#endregion
|
|
939
939
|
//#region src/content/read.ts
|
|
940
|
-
const isMessage$
|
|
940
|
+
const isMessage$2 = (v) => typeof v === "object" && v !== null && "id" in v && "content" in v;
|
|
941
941
|
/**
|
|
942
942
|
* A `read` marks the conversation as read **up to** `target`, surfacing a
|
|
943
943
|
* read receipt to the sender where the platform supports one.
|
|
@@ -960,7 +960,7 @@ const isMessage$1 = (v) => typeof v === "object" && v !== null && "id" in v && "
|
|
|
960
960
|
*/
|
|
961
961
|
const readSchema = z.object({
|
|
962
962
|
type: z.literal("read"),
|
|
963
|
-
target: z.custom(isMessage$
|
|
963
|
+
target: z.custom(isMessage$2, { message: "read target must be a Message" })
|
|
964
964
|
});
|
|
965
965
|
const asRead = (input) => readSchema.parse({
|
|
966
966
|
type: "read",
|
|
@@ -1013,7 +1013,7 @@ function rename(displayName) {
|
|
|
1013
1013
|
}
|
|
1014
1014
|
//#endregion
|
|
1015
1015
|
//#region src/content/reply.ts
|
|
1016
|
-
const isMessage = (v) => typeof v === "object" && v !== null && "id" in v && "content" in v;
|
|
1016
|
+
const isMessage$1 = (v) => typeof v === "object" && v !== null && "id" in v && "content" in v;
|
|
1017
1017
|
const isContent = (v) => typeof v === "object" && v !== null && "type" in v && typeof v.type === "string";
|
|
1018
1018
|
/**
|
|
1019
1019
|
* A `reply` wraps inner content with the message it replies to.
|
|
@@ -1029,7 +1029,7 @@ const isContent = (v) => typeof v === "object" && v !== null && "type" in v && t
|
|
|
1029
1029
|
const replySchema = z.object({
|
|
1030
1030
|
type: z.literal("reply"),
|
|
1031
1031
|
content: z.custom(isContent, { message: "reply content must be a Content value" }),
|
|
1032
|
-
target: z.custom(isMessage, { message: "reply target must be a Message" })
|
|
1032
|
+
target: z.custom(isMessage$1, { message: "reply target must be a Message" })
|
|
1033
1033
|
});
|
|
1034
1034
|
const asReply = (input) => replySchema.parse({
|
|
1035
1035
|
type: "reply",
|
|
@@ -1071,6 +1071,52 @@ function richlink(url) {
|
|
|
1071
1071
|
return { build: async () => asRichlink({ url }) };
|
|
1072
1072
|
}
|
|
1073
1073
|
//#endregion
|
|
1074
|
+
//#region src/content/unsend.ts
|
|
1075
|
+
const isMessage = (v) => typeof v === "object" && v !== null && "id" in v && "content" in v;
|
|
1076
|
+
/**
|
|
1077
|
+
* An `unsend` retracts a previously-sent outbound message.
|
|
1078
|
+
*
|
|
1079
|
+
* `space.send(unsend(message))` is the canonical outbound API;
|
|
1080
|
+
* `message.unsend()` and `space.unsend(message)` are sugar that delegate
|
|
1081
|
+
* here. Unsends are fire-and-forget — providers handle them inside their
|
|
1082
|
+
* `send` action and the resolved value is `undefined` (no new message id is
|
|
1083
|
+
* produced; the existing message is retracted in place).
|
|
1084
|
+
*
|
|
1085
|
+
* Platform constraints surface from the provider at send time — e.g.
|
|
1086
|
+
* iMessage enforces Apple's ~2-minute unsend window for regular messages
|
|
1087
|
+
* (reaction removal is not time-limited), and a late or repeated unsend
|
|
1088
|
+
* rejects with the provider's error. `space.getMessage(id)` results are
|
|
1089
|
+
* wrapped as inbound, so a message cannot be unsent from a refetched id
|
|
1090
|
+
* after a restart — keep the Message returned by `send` (same limitation
|
|
1091
|
+
* as `edit`).
|
|
1092
|
+
*/
|
|
1093
|
+
const unsendSchema = z.object({
|
|
1094
|
+
type: z.literal("unsend"),
|
|
1095
|
+
target: z.custom(isMessage, { message: "unsend target must be a Message" })
|
|
1096
|
+
});
|
|
1097
|
+
const asUnsend = (input) => unsendSchema.parse({
|
|
1098
|
+
type: "unsend",
|
|
1099
|
+
...input
|
|
1100
|
+
});
|
|
1101
|
+
/**
|
|
1102
|
+
* Construct an `unsend` content value retracting `target`.
|
|
1103
|
+
*
|
|
1104
|
+
* Only outbound messages (those sent by the agent) can be unsent; calling
|
|
1105
|
+
* this with an inbound target throws at build time so the misuse surfaces
|
|
1106
|
+
* before the send pipeline runs.
|
|
1107
|
+
*
|
|
1108
|
+
* Accepts `Message | undefined` so `space.send` results chain without
|
|
1109
|
+
* narrowing (`send` resolves `undefined` when a platform skips unsupported
|
|
1110
|
+
* content); an undefined target throws at build time.
|
|
1111
|
+
*/
|
|
1112
|
+
function unsend(target) {
|
|
1113
|
+
return { build: async () => {
|
|
1114
|
+
if (!target) throw new Error("unsend() target is undefined — the targeted message was never sent (space.send resolves undefined when a platform skips unsupported content)");
|
|
1115
|
+
if (target.direction !== "outbound") throw new Error(`unsend() target must be an outbound message (got direction "${target.direction}", message id "${target.id}")`);
|
|
1116
|
+
return asUnsend({ target });
|
|
1117
|
+
} };
|
|
1118
|
+
}
|
|
1119
|
+
//#endregion
|
|
1074
1120
|
//#region src/content/voice.ts
|
|
1075
1121
|
const AUDIO_MIME_PATTERN = /^audio\//i;
|
|
1076
1122
|
const audioMimeSchema = z.string().nonempty().regex(AUDIO_MIME_PATTERN, "voice content requires an audio/* MIME type");
|
|
@@ -1698,4 +1744,4 @@ function broadcast(source) {
|
|
|
1698
1744
|
};
|
|
1699
1745
|
}
|
|
1700
1746
|
//#endregion
|
|
1701
|
-
export {
|
|
1747
|
+
export { custom as $, asPoll as A, asMarkdown as B, rename as C, asReaction as D, read as E, addMemberSchema as F, groupSchema as G, markdownSchema as H, leaveSpace as I, text as J, resolveContents as K, leaveSpaceSchema as L, option as M, poll as N, reaction as O, addMember as P, asCustom as Q, removeMember as R, replySchema as S, asRead as T, asGroup as U, markdown as V, group as W, StreamConsumedError as X, textSchema as Y, drainStreamText as Z, unsend as _, contentAttrs as a, avatarSchema as at, asReply as b, markdownToPlainText as c, asAttachment as ct, envAwareConfig as d, fetchUrlBytes as dt, asContact as et, envFor as f, tracedFetch as ft, asUnsend as g, voice as h, stream as i, avatar as it, asPollOption as j, reactionSchema as k, renderInlineTokens as l, attachment as lt, asVoice as m, createAsyncQueue as n, fromVCard as nt, errorAttrs as o, buildPhotoAction as ot, fromEnv as p, asText as q, mergeStreams as r, toVCard as rt, senderAttrs as s, photoActionSchema as st, broadcast as t, contact as tt, classifyIdentifier as u, attachmentSchema as ut, asRichlink as v, renameSchema as w, reply as x, richlink as y, removeMemberSchema as z };
|