spectrum-ts 3.0.0 → 3.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.
@@ -1,5 +1,5 @@
1
1
  import z__default from 'zod';
2
- import { C as ContentBuilder } from './types-YqCNUDIt.js';
2
+ import { C as ContentBuilder } from './types-Be0T6E0e.js';
3
3
 
4
4
  declare const attachmentSchema: z__default.ZodObject<{
5
5
  type: z__default.ZodLiteral<"attachment">;
@@ -1,7 +1,7 @@
1
- import './attachment-WePAHfcH.js';
1
+ import './attachment-CEpGtZLm.js';
2
2
  import vCard from 'vcf';
3
3
  import z__default from 'zod';
4
- import { U as User, C as ContentBuilder, M as Message, e as Space, h as ContentInput } from './types-YqCNUDIt.js';
4
+ import { U as User, C as ContentBuilder, M as Message, e as Space, h as ContentInput } from './types-Be0T6E0e.js';
5
5
 
6
6
  declare const nameSchema: z__default.ZodObject<{
7
7
  formatted: z__default.ZodOptional<z__default.ZodString>;
@@ -1,6 +1,6 @@
1
- export { c as asAttachment } from './attachment-WePAHfcH.js';
2
- export { q as asContact, s as asCustom, u as asGroup, w as asPoll, x as asPollOption, y as asRichlink, z as asText, A as asVoice } from './authoring-DDh3muGT.js';
3
- export { d as ProviderMessageRecord, $ as asReaction } from './types-YqCNUDIt.js';
1
+ export { c as asAttachment } from './attachment-CEpGtZLm.js';
2
+ export { q as asContact, s as asCustom, u as asGroup, w as asPoll, x as asPollOption, y as asRichlink, z as asText, A as asVoice } from './authoring-CP3vRza8.js';
3
+ export { d as ProviderMessageRecord, $ as asReaction } from './types-Be0T6E0e.js';
4
4
  import 'zod';
5
5
  import 'vcf';
6
6
  import 'hotscript';
@@ -9,7 +9,7 @@ import {
9
9
  import {
10
10
  UnsupportedError,
11
11
  definePlatform
12
- } from "./chunk-LX437ZTY.js";
12
+ } from "./chunk-L3NUESOW.js";
13
13
  import {
14
14
  asAttachment,
15
15
  asCustom,
@@ -15,7 +15,7 @@ import {
15
15
  import {
16
16
  UnsupportedError,
17
17
  definePlatform
18
- } from "./chunk-LX437ZTY.js";
18
+ } from "./chunk-L3NUESOW.js";
19
19
  import {
20
20
  asAttachment,
21
21
  asCustom,
@@ -742,6 +742,7 @@ async function sendWithFallbacks(send, item, platform) {
742
742
  }
743
743
  var providerMessageCoreKeys = /* @__PURE__ */ new Set([
744
744
  "content",
745
+ "direction",
745
746
  "id",
746
747
  "sender",
747
748
  "space",
@@ -754,8 +755,14 @@ var extractExtras = (raw, definition) => {
754
755
  const extra = Object.fromEntries(entries);
755
756
  return definition.message?.schema ? definition.message.schema.parse(extra) : extra;
756
757
  };
758
+ var rawDirection = (raw) => raw.direction === "inbound" || raw.direction === "outbound" ? raw.direction : void 0;
757
759
  function wrapProviderMessage(raw, ctx, direction) {
758
- const wrappedContent = wrapNestedContent(raw.content, ctx, direction);
760
+ const effectiveDirection = rawDirection(raw) ?? direction;
761
+ const wrappedContent = wrapNestedContent(
762
+ raw.content,
763
+ ctx,
764
+ effectiveDirection
765
+ );
759
766
  const base = {
760
767
  id: raw.id,
761
768
  content: wrappedContent,
@@ -768,7 +775,7 @@ function wrapProviderMessage(raw, ctx, direction) {
768
775
  config: ctx.config,
769
776
  store: ctx.store
770
777
  };
771
- if (direction === "inbound") {
778
+ if (effectiveDirection === "inbound") {
772
779
  return buildMessage({ ...base, sender: raw.sender, direction: "inbound" });
773
780
  }
774
781
  return buildMessage({ ...base, sender: raw.sender, direction: "outbound" });
@@ -16,7 +16,7 @@ import {
16
16
  asMarkdown,
17
17
  definePlatform,
18
18
  renderInlineTokens
19
- } from "./chunk-LX437ZTY.js";
19
+ } from "./chunk-L3NUESOW.js";
20
20
  import {
21
21
  asAttachment,
22
22
  asCustom,
@@ -15,7 +15,7 @@ import {
15
15
  import {
16
16
  UnsupportedError,
17
17
  definePlatform
18
- } from "./chunk-LX437ZTY.js";
18
+ } from "./chunk-L3NUESOW.js";
19
19
  import {
20
20
  asAttachment,
21
21
  asCustom,
@@ -30,7 +30,7 @@ import {
30
30
  definePlatform,
31
31
  markdownSchema,
32
32
  photoActionSchema
33
- } from "./chunk-LX437ZTY.js";
33
+ } from "./chunk-L3NUESOW.js";
34
34
  import {
35
35
  asAttachment,
36
36
  asCustom,
@@ -42,7 +42,10 @@ import {
42
42
  } from "./chunk-LQMDV75O.js";
43
43
 
44
44
  // src/providers/imessage/index.ts
45
- import { createClient as createClient2, MessageEffect as MessageEffect2 } from "@photon-ai/advanced-imessage";
45
+ import {
46
+ createClient as createClient2,
47
+ MessageEffect as MessageEffect2
48
+ } from "@photon-ai/advanced-imessage";
46
49
  import { IMessageSDK as IMessageSDK2 } from "@photon-ai/imessage-kit";
47
50
  import { withSpan } from "@photon-ai/otel";
48
51
 
@@ -351,6 +354,77 @@ async function disposeCloudAuth(clients) {
351
354
  }
352
355
  }
353
356
 
357
+ // src/providers/imessage/cache.ts
358
+ var DEFAULT_MAX = 1e3;
359
+ var MessageCache = class {
360
+ map = /* @__PURE__ */ new Map();
361
+ max;
362
+ constructor(max = DEFAULT_MAX) {
363
+ this.max = max;
364
+ }
365
+ get(id) {
366
+ return this.map.get(id);
367
+ }
368
+ set(id, message) {
369
+ if (this.map.has(id)) {
370
+ this.map.delete(id);
371
+ }
372
+ this.map.set(id, message);
373
+ if (this.map.size > this.max) {
374
+ const first = this.map.keys().next().value;
375
+ if (first !== void 0) {
376
+ this.map.delete(first);
377
+ }
378
+ }
379
+ }
380
+ clear() {
381
+ this.map.clear();
382
+ }
383
+ };
384
+ var PollCache = class {
385
+ map = /* @__PURE__ */ new Map();
386
+ max;
387
+ constructor(max = DEFAULT_MAX) {
388
+ this.max = max;
389
+ }
390
+ get(id) {
391
+ return this.map.get(id);
392
+ }
393
+ set(id, poll) {
394
+ if (this.map.has(id)) {
395
+ this.map.delete(id);
396
+ }
397
+ this.map.set(id, poll);
398
+ if (this.map.size > this.max) {
399
+ const first = this.map.keys().next().value;
400
+ if (first !== void 0) {
401
+ this.map.delete(first);
402
+ }
403
+ }
404
+ }
405
+ clear() {
406
+ this.map.clear();
407
+ }
408
+ };
409
+ var messageCaches = /* @__PURE__ */ new WeakMap();
410
+ var pollCaches = /* @__PURE__ */ new WeakMap();
411
+ var getMessageCache = (owner) => {
412
+ let cache = messageCaches.get(owner);
413
+ if (!cache) {
414
+ cache = new MessageCache();
415
+ messageCaches.set(owner, cache);
416
+ }
417
+ return cache;
418
+ };
419
+ var getPollCache = (owner) => {
420
+ let cache = pollCaches.get(owner);
421
+ if (!cache) {
422
+ cache = new PollCache();
423
+ pollCaches.set(owner, cache);
424
+ }
425
+ return cache;
426
+ };
427
+
354
428
  // src/providers/imessage/local/inbound.ts
355
429
  import { setTimeout as sleep } from "timers/promises";
356
430
 
@@ -623,6 +697,7 @@ var sendCustomizedMiniApp = async (remote, spaceId, content) => {
623
697
  return {
624
698
  id: message.guid,
625
699
  content,
700
+ direction: "outbound",
626
701
  space: { id: spaceId },
627
702
  timestamp: message.dateCreated
628
703
  };
@@ -633,77 +708,6 @@ import {
633
708
  NotFoundError as NotFoundError2
634
709
  } from "@photon-ai/advanced-imessage";
635
710
 
636
- // src/providers/imessage/cache.ts
637
- var DEFAULT_MAX = 1e3;
638
- var MessageCache = class {
639
- map = /* @__PURE__ */ new Map();
640
- max;
641
- constructor(max = DEFAULT_MAX) {
642
- this.max = max;
643
- }
644
- get(id) {
645
- return this.map.get(id);
646
- }
647
- set(id, message) {
648
- if (this.map.has(id)) {
649
- this.map.delete(id);
650
- }
651
- this.map.set(id, message);
652
- if (this.map.size > this.max) {
653
- const first = this.map.keys().next().value;
654
- if (first !== void 0) {
655
- this.map.delete(first);
656
- }
657
- }
658
- }
659
- clear() {
660
- this.map.clear();
661
- }
662
- };
663
- var PollCache = class {
664
- map = /* @__PURE__ */ new Map();
665
- max;
666
- constructor(max = DEFAULT_MAX) {
667
- this.max = max;
668
- }
669
- get(id) {
670
- return this.map.get(id);
671
- }
672
- set(id, poll) {
673
- if (this.map.has(id)) {
674
- this.map.delete(id);
675
- }
676
- this.map.set(id, poll);
677
- if (this.map.size > this.max) {
678
- const first = this.map.keys().next().value;
679
- if (first !== void 0) {
680
- this.map.delete(first);
681
- }
682
- }
683
- }
684
- clear() {
685
- this.map.clear();
686
- }
687
- };
688
- var messageCaches = /* @__PURE__ */ new WeakMap();
689
- var pollCaches = /* @__PURE__ */ new WeakMap();
690
- var getMessageCache = (owner) => {
691
- let cache = messageCaches.get(owner);
692
- if (!cache) {
693
- cache = new MessageCache();
694
- messageCaches.set(owner, cache);
695
- }
696
- return cache;
697
- };
698
- var getPollCache = (owner) => {
699
- let cache = pollCaches.get(owner);
700
- if (!cache) {
701
- cache = new PollCache();
702
- pollCaches.set(owner, cache);
703
- }
704
- return cache;
705
- };
706
-
707
711
  // src/providers/imessage/remote/attachments.ts
708
712
  import {
709
713
  NotFoundError
@@ -799,12 +803,13 @@ var isIMessageMessage = (value) => {
799
803
  return false;
800
804
  }
801
805
  const record = value;
802
- return typeof record.id === "string" && record.id.length > 0 && typeof record.content === "object" && record.content !== null && typeof record.sender === "object" && record.sender !== null && typeof record.space === "object" && record.space !== null;
806
+ return typeof record.id === "string" && record.id.length > 0 && typeof record.content === "object" && record.content !== null && typeof record.space === "object" && record.space !== null;
803
807
  };
804
808
  var asProviderGroup = (items) => groupSchema.parse({ type: "group", items });
805
809
  var buildMessageBase = (message, chatGuidHint, timestamp, phone) => {
806
810
  const chat = resolveChatGuid(message, chatGuidHint);
807
811
  return {
812
+ direction: message.isFromMe ? "outbound" : "inbound",
808
813
  sender: { id: resolveSenderId(message) },
809
814
  space: {
810
815
  id: chat,
@@ -1122,6 +1127,7 @@ var reactToMessage = async (remote, spaceId, target, reaction) => {
1122
1127
  return {
1123
1128
  id: sent.guid,
1124
1129
  content: asProviderReaction(reaction, target),
1130
+ direction: "outbound",
1125
1131
  space: { id: spaceId },
1126
1132
  timestamp: sent.dateCreated
1127
1133
  };
@@ -1582,6 +1588,7 @@ var MAX_GROUP_TEXT_ITEMS = 1;
1582
1588
  var outboundRecord = (spaceId, id, content, timestamp, extras) => ({
1583
1589
  id,
1584
1590
  content,
1591
+ direction: "outbound",
1585
1592
  space: { id: spaceId },
1586
1593
  timestamp,
1587
1594
  ...extras
@@ -2501,6 +2508,7 @@ var sendStreamText = async (remote, spaceId, content) => {
2501
2508
  return {
2502
2509
  id: sent.guid,
2503
2510
  content: asText(full),
2511
+ direction: "outbound",
2504
2512
  space: { id: spaceId },
2505
2513
  timestamp: sent.dateCreated
2506
2514
  };
@@ -2574,6 +2582,22 @@ var randomPhone = (clients) => {
2574
2582
 
2575
2583
  // src/providers/imessage/index.ts
2576
2584
  var isPollContent = (content) => content.type === "poll" || content.type === "poll_option";
2585
+ var cacheRemoteOutbound = (remote, space, record) => {
2586
+ if (!record) {
2587
+ return record;
2588
+ }
2589
+ cacheMessage(getMessageCache(remote), {
2590
+ ...record,
2591
+ direction: record.direction ?? "outbound",
2592
+ space: {
2593
+ ...record.space,
2594
+ id: record.space.id,
2595
+ phone: space.phone,
2596
+ type: space.type
2597
+ }
2598
+ });
2599
+ return record;
2600
+ };
2577
2601
  var handleEdit = async (client, space, content) => {
2578
2602
  if (isLocal(client)) {
2579
2603
  throw UnsupportedError.action("edit", "iMessage (local mode)");
@@ -2621,7 +2645,11 @@ var handleStreamText = async (client, space, content) => {
2621
2645
  );
2622
2646
  }
2623
2647
  const remote = clientForPhone(client, space.phone);
2624
- return await sendStreamText2(remote, space.id, content);
2648
+ return cacheRemoteOutbound(
2649
+ remote,
2650
+ space,
2651
+ await sendStreamText2(remote, space.id, content)
2652
+ );
2625
2653
  };
2626
2654
  var handleBackground = async (client, space, content) => {
2627
2655
  if (isLocal(client)) {
@@ -2643,7 +2671,11 @@ var handleCustomizedMiniApp = async (client, space, content) => {
2643
2671
  );
2644
2672
  }
2645
2673
  const remote = clientForPhone(client, space.phone);
2646
- return await sendCustomizedMiniApp2(remote, space.id, content);
2674
+ return cacheRemoteOutbound(
2675
+ remote,
2676
+ space,
2677
+ await sendCustomizedMiniApp2(remote, space.id, content)
2678
+ );
2647
2679
  };
2648
2680
  var handleRead = async (client, space) => {
2649
2681
  if (isLocal(client)) {
@@ -2852,11 +2884,15 @@ var imessage = definePlatform("iMessage", {
2852
2884
  );
2853
2885
  }
2854
2886
  const remote2 = clientForPhone(client, space.phone);
2855
- return await replyToMessage2(
2887
+ return cacheRemoteOutbound(
2856
2888
  remote2,
2857
- space.id,
2858
- content.target.id,
2859
- content.content
2889
+ space,
2890
+ await replyToMessage2(
2891
+ remote2,
2892
+ space.id,
2893
+ content.target.id,
2894
+ content.content
2895
+ )
2860
2896
  );
2861
2897
  }
2862
2898
  if (content.type === "reaction") {
@@ -2871,11 +2907,15 @@ var imessage = definePlatform("iMessage", {
2871
2907
  );
2872
2908
  }
2873
2909
  const remote2 = clientForPhone(client, space.phone);
2874
- return await reactToMessage2(
2910
+ return cacheRemoteOutbound(
2875
2911
  remote2,
2876
- space.id,
2877
- content.target,
2878
- content.emoji
2912
+ space,
2913
+ await reactToMessage2(
2914
+ remote2,
2915
+ space.id,
2916
+ content.target,
2917
+ content.emoji
2918
+ )
2879
2919
  );
2880
2920
  }
2881
2921
  if (content.type === "typing") {
@@ -2916,7 +2956,11 @@ var imessage = definePlatform("iMessage", {
2916
2956
  return await send2(client, space.id, content);
2917
2957
  }
2918
2958
  const remote = clientForPhone(client, space.phone);
2919
- return await send4(remote, space.id, content);
2959
+ return cacheRemoteOutbound(
2960
+ remote,
2961
+ space,
2962
+ await send4(remote, space.id, content)
2963
+ );
2920
2964
  },
2921
2965
  actions: {
2922
2966
  getMessage: async ({ client }, space, messageId) => {
package/dist/index.d.ts CHANGED
@@ -1,12 +1,12 @@
1
- export { A as Attachment, a as AttachmentInput, b as attachment } from './attachment-WePAHfcH.js';
1
+ export { A as Attachment, a as AttachmentInput, b as attachment } from './attachment-CEpGtZLm.js';
2
2
  import z__default from 'zod';
3
3
  import { P as PhotoInput } from './photo-content-BJKnqgN-.js';
4
- import { C as ContentBuilder, M as Message, U as User, e as Space, h as ContentInput, i as Content, g as ProviderMessage, E as EventProducer, j as SpaceActionFn, k as MessageActionFn, I as InstanceActionFn, l as CreateClientContext, c as Store, a as PlatformDef, P as Platform, m as PlatformProviderConfig, n as SpectrumLike, o as CustomEventStreams, A as AgentSender, b as ProjectData } from './types-YqCNUDIt.js';
5
- export { p as AnyPlatformDef, B as Broadcaster, q as CloudPlatform, D as DedicatedTokenData, F as FusorTokenData, r as ImessageInfoData, s as ManagedStream, t as PlatformInstance, u as PlatformMessage, v as PlatformRuntime, w as PlatformSpace, x as PlatformStatus, y as PlatformUser, z as PlatformsData, G as ProjectProfile, R as Reaction, H as ReactionBuilder, S as SchemaMessage, J as SharedTokenData, K as SlackTeamMeta, L as SlackTokenData, N as SpaceNamespace, O as SpectrumCloudError, Q as SubscriptionData, T as SubscriptionStatus, V as TokenData, W as broadcast, X as cloud, Y as mergeStreams, Z as reaction, _ as stream } from './types-YqCNUDIt.js';
6
- import { S as StreamTextSource, T as TextStreamOptions, C as ContactInput, a as Contact } from './authoring-DDh3muGT.js';
7
- export { b as ContactAddress, c as ContactDetails, d as ContactEmail, e as ContactName, f as ContactOrg, g as ContactPhone, D as DeltaExtractor, G as Group, P as Poll, h as PollChoice, i as PollChoiceInput, j as PollOption, R as Richlink, k as StreamText, V as Voice, l as contact, m as custom, n as group, o as option, p as poll, r as richlink, t as text, v as voice } from './authoring-DDh3muGT.js';
8
- import { a as FusorVerify, F as FusorClient, b as FusorMessages, W as WebhookHandler, c as WebhookRawRequest, d as WebhookRawResult } from './types-BujGKBin.js';
9
- export { e as FusorEvent, f as FusorMessagesCtx, g as FusorMessagesReturn, h as FusorReply, i as FusorRespond, j as FusorVerifyRequest, k as fusorEvent, l as isFusorEvent } from './types-BujGKBin.js';
4
+ import { C as ContentBuilder, M as Message, U as User, e as Space, h as ContentInput, i as Content, g as ProviderMessage, E as EventProducer, j as SpaceActionFn, k as MessageActionFn, I as InstanceActionFn, l as CreateClientContext, c as Store, a as PlatformDef, P as Platform, m as PlatformProviderConfig, n as SpectrumLike, o as CustomEventStreams, A as AgentSender, b as ProjectData } from './types-Be0T6E0e.js';
5
+ export { p as AnyPlatformDef, B as Broadcaster, q as CloudPlatform, D as DedicatedTokenData, F as FusorTokenData, r as ImessageInfoData, s as ManagedStream, t as PlatformInstance, u as PlatformMessage, v as PlatformRuntime, w as PlatformSpace, x as PlatformStatus, y as PlatformUser, z as PlatformsData, G as ProjectProfile, R as Reaction, H as ReactionBuilder, S as SchemaMessage, J as SharedTokenData, K as SlackTeamMeta, L as SlackTokenData, N as SpaceNamespace, O as SpectrumCloudError, Q as SubscriptionData, T as SubscriptionStatus, V as TokenData, W as broadcast, X as cloud, Y as mergeStreams, Z as reaction, _ as stream } from './types-Be0T6E0e.js';
6
+ import { S as StreamTextSource, T as TextStreamOptions, C as ContactInput, a as Contact } from './authoring-CP3vRza8.js';
7
+ export { b as ContactAddress, c as ContactDetails, d as ContactEmail, e as ContactName, f as ContactOrg, g as ContactPhone, D as DeltaExtractor, G as Group, P as Poll, h as PollChoice, i as PollChoiceInput, j as PollOption, R as Richlink, k as StreamText, V as Voice, l as contact, m as custom, n as group, o as option, p as poll, r as richlink, t as text, v as voice } from './authoring-CP3vRza8.js';
8
+ import { a as FusorVerify, F as FusorClient, b as FusorMessages, W as WebhookHandler, c as WebhookRawRequest, d as WebhookRawResult } from './types-CDYXH2R7.js';
9
+ export { e as FusorEvent, f as FusorMessagesCtx, g as FusorMessagesReturn, h as FusorReply, i as FusorRespond, j as FusorVerifyRequest, k as fusorEvent, l as isFusorEvent } from './types-CDYXH2R7.js';
10
10
  import 'hotscript';
11
11
  import 'vcf';
12
12
 
package/dist/index.js CHANGED
@@ -50,7 +50,7 @@ import {
50
50
  typing,
51
51
  unsend,
52
52
  wrapProviderMessage
53
- } from "./chunk-LX437ZTY.js";
53
+ } from "./chunk-L3NUESOW.js";
54
54
  import {
55
55
  __commonJS,
56
56
  __esm,
@@ -1,8 +1,8 @@
1
- import { C as ContentBuilder, h as ContentInput, M as Message, S as SchemaMessage, P as Platform, a as PlatformDef, e as Space, c as Store } from '../../types-YqCNUDIt.js';
1
+ import { C as ContentBuilder, h as ContentInput, M as Message, S as SchemaMessage, P as Platform, a as PlatformDef, e as Space, c as Store } from '../../types-Be0T6E0e.js';
2
2
  import * as zod_v4_core from 'zod/v4/core';
3
3
  import * as z from 'zod';
4
4
  import z__default from 'zod';
5
- import { A as Attachment } from '../../attachment-WePAHfcH.js';
5
+ import { A as Attachment } from '../../attachment-CEpGtZLm.js';
6
6
  import { P as PhotoInput } from '../../photo-content-BJKnqgN-.js';
7
7
  import { MessageEffect, AdvancedIMessage } from '@photon-ai/advanced-imessage';
8
8
  import { IMessageSDK } from '@photon-ai/imessage-kit';
@@ -149,6 +149,7 @@ declare const spaceSchema: z__default.ZodObject<{
149
149
  phone: z__default.ZodString;
150
150
  }, z__default.core.$strip>;
151
151
  type IMessageMessage = SchemaMessage<typeof userSchema, typeof spaceSchema> & {
152
+ direction?: "inbound" | "outbound";
152
153
  partIndex?: number;
153
154
  parentId?: string;
154
155
  };
@@ -5,7 +5,7 @@ import {
5
5
  effect,
6
6
  imessage,
7
7
  read
8
- } from "../../chunk-AYCMTRVC.js";
8
+ } from "../../chunk-WMG36LHW.js";
9
9
  import "../../chunk-CHY5YLLV.js";
10
10
  import "../../chunk-MHGCPC2V.js";
11
11
  import "../../chunk-2D27WW5B.js";
@@ -13,7 +13,7 @@ import "../../chunk-3GEJYGZK.js";
13
13
  import "../../chunk-NZ5WCMTY.js";
14
14
  import "../../chunk-5XEFJBN2.js";
15
15
  import "../../chunk-6UZFVXQF.js";
16
- import "../../chunk-LX437ZTY.js";
16
+ import "../../chunk-L3NUESOW.js";
17
17
  import "../../chunk-LQMDV75O.js";
18
18
  export {
19
19
  background,
@@ -3,17 +3,17 @@ export { slack } from './slack/index.js';
3
3
  export { telegram } from './telegram/index.js';
4
4
  export { terminal } from './terminal/index.js';
5
5
  export { whatsappBusiness } from './whatsapp-business/index.js';
6
- import '../types-YqCNUDIt.js';
6
+ import '../types-Be0T6E0e.js';
7
7
  import 'hotscript';
8
8
  import 'zod';
9
9
  import 'zod/v4/core';
10
- import '../attachment-WePAHfcH.js';
10
+ import '../attachment-CEpGtZLm.js';
11
11
  import '../photo-content-BJKnqgN-.js';
12
12
  import '@photon-ai/advanced-imessage';
13
13
  import '@photon-ai/imessage-kit';
14
14
  import '@photon-ai/slack';
15
15
  import '@photon-ai/telegram-ts';
16
- import '../types-BujGKBin.js';
16
+ import '../types-CDYXH2R7.js';
17
17
  import 'node:child_process';
18
18
  import 'node:net';
19
19
  import '@photon-ai/whatsapp-business';
@@ -1,29 +1,29 @@
1
1
  import { createRequire as __spectrumCreateRequire } from "node:module"; const require = __spectrumCreateRequire(import.meta.url);
2
2
  import {
3
3
  imessage
4
- } from "../chunk-AYCMTRVC.js";
4
+ } from "../chunk-WMG36LHW.js";
5
5
  import "../chunk-CHY5YLLV.js";
6
6
  import {
7
7
  slack
8
- } from "../chunk-FULEQIRQ.js";
8
+ } from "../chunk-7ON5XHC2.js";
9
9
  import {
10
10
  telegram
11
- } from "../chunk-TXRWKSNH.js";
11
+ } from "../chunk-PSSWQBOH.js";
12
12
  import "../chunk-34FQGGD7.js";
13
13
  import "../chunk-MHGCPC2V.js";
14
14
  import {
15
15
  terminal
16
- } from "../chunk-EZ5SNNFS.js";
16
+ } from "../chunk-Q44CIGG6.js";
17
17
  import "../chunk-77U6SH5A.js";
18
18
  import {
19
19
  whatsappBusiness
20
- } from "../chunk-UXJ5OO6P.js";
20
+ } from "../chunk-FA7VA4XN.js";
21
21
  import "../chunk-2D27WW5B.js";
22
22
  import "../chunk-3GEJYGZK.js";
23
23
  import "../chunk-NZ5WCMTY.js";
24
24
  import "../chunk-5XEFJBN2.js";
25
25
  import "../chunk-6UZFVXQF.js";
26
- import "../chunk-LX437ZTY.js";
26
+ import "../chunk-L3NUESOW.js";
27
27
  import "../chunk-LQMDV75O.js";
28
28
  export {
29
29
  imessage,
@@ -1,4 +1,4 @@
1
- import { S as SchemaMessage, P as Platform, a as PlatformDef } from '../../types-YqCNUDIt.js';
1
+ import { S as SchemaMessage, P as Platform, a as PlatformDef } from '../../types-Be0T6E0e.js';
2
2
  import * as z from 'zod';
3
3
  import z__default from 'zod';
4
4
  import * as _photon_ai_slack from '@photon-ai/slack';
@@ -1,10 +1,10 @@
1
1
  import { createRequire as __spectrumCreateRequire } from "node:module"; const require = __spectrumCreateRequire(import.meta.url);
2
2
  import {
3
3
  slack
4
- } from "../../chunk-FULEQIRQ.js";
4
+ } from "../../chunk-7ON5XHC2.js";
5
5
  import "../../chunk-3GEJYGZK.js";
6
6
  import "../../chunk-5XEFJBN2.js";
7
- import "../../chunk-LX437ZTY.js";
7
+ import "../../chunk-L3NUESOW.js";
8
8
  import "../../chunk-LQMDV75O.js";
9
9
  export {
10
10
  slack
@@ -1,9 +1,9 @@
1
- import { P as Platform, a as PlatformDef, g as ProviderMessage } from '../../types-YqCNUDIt.js';
1
+ import { P as Platform, a as PlatformDef, g as ProviderMessage } from '../../types-Be0T6E0e.js';
2
2
  import * as _photon_ai_telegram_ts from '@photon-ai/telegram-ts';
3
3
  import * as zod_v4_core from 'zod/v4/core';
4
4
  import * as z from 'zod';
5
5
  import z__default from 'zod';
6
- import { F as FusorClient } from '../../types-BujGKBin.js';
6
+ import { F as FusorClient } from '../../types-CDYXH2R7.js';
7
7
  import 'hotscript';
8
8
 
9
9
  interface TelegramSpace {
@@ -1,12 +1,12 @@
1
1
  import { createRequire as __spectrumCreateRequire } from "node:module"; const require = __spectrumCreateRequire(import.meta.url);
2
2
  import {
3
3
  telegram
4
- } from "../../chunk-TXRWKSNH.js";
4
+ } from "../../chunk-PSSWQBOH.js";
5
5
  import "../../chunk-34FQGGD7.js";
6
6
  import "../../chunk-MHGCPC2V.js";
7
7
  import "../../chunk-77U6SH5A.js";
8
8
  import "../../chunk-6UZFVXQF.js";
9
- import "../../chunk-LX437ZTY.js";
9
+ import "../../chunk-L3NUESOW.js";
10
10
  import "../../chunk-LQMDV75O.js";
11
11
  export {
12
12
  telegram
@@ -1,4 +1,4 @@
1
- import { P as Platform, a as PlatformDef, f as contentSchema } from '../../types-YqCNUDIt.js';
1
+ import { P as Platform, a as PlatformDef, f as contentSchema } from '../../types-Be0T6E0e.js';
2
2
  import { ChildProcess } from 'node:child_process';
3
3
  import z__default from 'zod';
4
4
  import { Socket } from 'node:net';
@@ -1,12 +1,12 @@
1
1
  import { createRequire as __spectrumCreateRequire } from "node:module"; const require = __spectrumCreateRequire(import.meta.url);
2
2
  import {
3
3
  terminal
4
- } from "../../chunk-EZ5SNNFS.js";
4
+ } from "../../chunk-Q44CIGG6.js";
5
5
  import "../../chunk-77U6SH5A.js";
6
6
  import "../../chunk-NZ5WCMTY.js";
7
7
  import "../../chunk-5XEFJBN2.js";
8
8
  import "../../chunk-6UZFVXQF.js";
9
- import "../../chunk-LX437ZTY.js";
9
+ import "../../chunk-L3NUESOW.js";
10
10
  import "../../chunk-LQMDV75O.js";
11
11
  export {
12
12
  terminal
@@ -1,4 +1,4 @@
1
- import { S as SchemaMessage, P as Platform, a as PlatformDef } from '../../types-YqCNUDIt.js';
1
+ import { S as SchemaMessage, P as Platform, a as PlatformDef } from '../../types-Be0T6E0e.js';
2
2
  import { WhatsAppClient } from '@photon-ai/whatsapp-business';
3
3
  import * as z from 'zod';
4
4
  import z__default from 'zod';
@@ -1,13 +1,13 @@
1
1
  import { createRequire as __spectrumCreateRequire } from "node:module"; const require = __spectrumCreateRequire(import.meta.url);
2
2
  import {
3
3
  whatsappBusiness
4
- } from "../../chunk-UXJ5OO6P.js";
4
+ } from "../../chunk-FA7VA4XN.js";
5
5
  import "../../chunk-2D27WW5B.js";
6
6
  import "../../chunk-3GEJYGZK.js";
7
7
  import "../../chunk-NZ5WCMTY.js";
8
8
  import "../../chunk-5XEFJBN2.js";
9
9
  import "../../chunk-6UZFVXQF.js";
10
- import "../../chunk-LX437ZTY.js";
10
+ import "../../chunk-L3NUESOW.js";
11
11
  import "../../chunk-LQMDV75O.js";
12
12
  export {
13
13
  whatsappBusiness
@@ -1141,6 +1141,7 @@ type ProviderMessage<TSender extends ResolvedUser = ResolvedUser, TSpace extends
1141
1141
  type ProviderMessageRecord = {
1142
1142
  id: string;
1143
1143
  content: Content;
1144
+ direction?: "inbound" | "outbound";
1144
1145
  sender?: {
1145
1146
  id: string;
1146
1147
  } & Record<string, unknown>;
@@ -1,4 +1,4 @@
1
- import { b as ProjectData, c as Store, d as ProviderMessageRecord, e as Space, M as Message } from './types-YqCNUDIt.js';
1
+ import { b as ProjectData, c as Store, d as ProviderMessageRecord, e as Space, M as Message } from './types-Be0T6E0e.js';
2
2
 
3
3
  declare const FUSOR_EVENT_BRAND: unique symbol;
4
4
  interface FusorEvent<TName extends string = string, TData = unknown> {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "spectrum-ts",
3
- "version": "3.0.0",
3
+ "version": "3.1.0",
4
4
  "description": "Bring agents to any interface — unified messaging SDK for TypeScript.",
5
5
  "repository": {
6
6
  "type": "git",