spectrum-ts 3.1.0 → 4.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.
Files changed (34) hide show
  1. package/dist/{attachment-CEpGtZLm.d.ts → attachment-CnivEhr6.d.ts} +1 -1
  2. package/dist/{authoring-CP3vRza8.d.ts → authoring-b9AhXgPI.d.ts} +2 -2
  3. package/dist/authoring.d.ts +3 -3
  4. package/dist/authoring.js +5 -5
  5. package/dist/{chunk-FA7VA4XN.js → chunk-3KWFP4L2.js} +7 -3
  6. package/dist/{chunk-NZ5WCMTY.js → chunk-A37PM5N2.js} +1 -1
  7. package/dist/{chunk-L3NUESOW.js → chunk-B52VPQO3.js} +70 -30
  8. package/dist/{chunk-WMG36LHW.js → chunk-DMT6BFJV.js} +30 -73
  9. package/dist/{chunk-77U6SH5A.js → chunk-FAIFTUV2.js} +1 -1
  10. package/dist/{chunk-Q44CIGG6.js → chunk-IM5ADDZS.js} +4 -4
  11. package/dist/{chunk-MHGCPC2V.js → chunk-LZXPLXZF.js} +1 -1
  12. package/dist/{chunk-PSSWQBOH.js → chunk-U3QQ56YZ.js} +6 -4
  13. package/dist/{chunk-LQMDV75O.js → chunk-UXAKIXVM.js} +0 -45
  14. package/dist/{chunk-7ON5XHC2.js → chunk-WXLQNANA.js} +5 -2
  15. package/dist/{chunk-CHY5YLLV.js → chunk-ZR3TKZMT.js} +1 -1
  16. package/dist/index.d.ts +11 -10
  17. package/dist/index.js +370 -25272
  18. package/dist/providers/imessage/index.d.ts +6 -28
  19. package/dist/providers/imessage/index.js +9 -8
  20. package/dist/providers/index.d.ts +4 -4
  21. package/dist/providers/index.js +11 -11
  22. package/dist/providers/slack/index.d.ts +1 -1
  23. package/dist/providers/slack/index.js +3 -3
  24. package/dist/providers/telegram/index.d.ts +2 -2
  25. package/dist/providers/telegram/index.js +5 -5
  26. package/dist/providers/terminal/index.d.ts +1 -1
  27. package/dist/providers/terminal/index.js +5 -5
  28. package/dist/providers/whatsapp-business/index.d.ts +1 -1
  29. package/dist/providers/whatsapp-business/index.js +4 -4
  30. package/dist/read-C4uvozGX.d.ts +53 -0
  31. package/dist/{types-CDYXH2R7.d.ts → types-BIta6Kxi.d.ts} +1 -1
  32. package/dist/{types-Be0T6E0e.d.ts → types-CyfLJXgu.d.ts} +26 -1
  33. package/package.json +1 -4
  34. package/dist/photo-content-BJKnqgN-.d.ts +0 -13
@@ -1,5 +1,5 @@
1
1
  import z__default from 'zod';
2
- import { C as ContentBuilder } from './types-Be0T6E0e.js';
2
+ import { C as ContentBuilder } from './types-CyfLJXgu.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-CEpGtZLm.js';
1
+ import './attachment-CnivEhr6.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-Be0T6E0e.js';
4
+ import { U as User, C as ContentBuilder, M as Message, S as Space, h as ContentInput } from './types-CyfLJXgu.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-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';
1
+ export { c as asAttachment } from './attachment-CnivEhr6.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-b9AhXgPI.js';
3
+ export { e as ProviderMessageRecord, $ as asReaction } from './types-CyfLJXgu.js';
4
4
  import 'zod';
5
5
  import 'vcf';
6
6
  import 'hotscript';
package/dist/authoring.js CHANGED
@@ -1,27 +1,27 @@
1
1
  import { createRequire as __spectrumCreateRequire } from "node:module"; const require = __spectrumCreateRequire(import.meta.url);
2
2
  import {
3
3
  asRichlink
4
- } from "./chunk-CHY5YLLV.js";
4
+ } from "./chunk-ZR3TKZMT.js";
5
5
  import {
6
6
  asGroup
7
- } from "./chunk-MHGCPC2V.js";
7
+ } from "./chunk-LZXPLXZF.js";
8
8
  import {
9
9
  asVoice
10
- } from "./chunk-77U6SH5A.js";
10
+ } from "./chunk-FAIFTUV2.js";
11
11
  import {
12
12
  asPoll,
13
13
  asPollOption
14
14
  } from "./chunk-2D27WW5B.js";
15
15
  import {
16
16
  asContact
17
- } from "./chunk-NZ5WCMTY.js";
17
+ } from "./chunk-A37PM5N2.js";
18
18
  import "./chunk-6UZFVXQF.js";
19
19
  import {
20
20
  asAttachment,
21
21
  asCustom,
22
22
  asReaction,
23
23
  asText
24
- } from "./chunk-LQMDV75O.js";
24
+ } from "./chunk-UXAKIXVM.js";
25
25
  export {
26
26
  asAttachment,
27
27
  asContact,
@@ -7,7 +7,7 @@ import {
7
7
  } from "./chunk-3GEJYGZK.js";
8
8
  import {
9
9
  asContact
10
- } from "./chunk-NZ5WCMTY.js";
10
+ } from "./chunk-A37PM5N2.js";
11
11
  import {
12
12
  mergeStreams,
13
13
  stream
@@ -15,13 +15,13 @@ import {
15
15
  import {
16
16
  UnsupportedError,
17
17
  definePlatform
18
- } from "./chunk-L3NUESOW.js";
18
+ } from "./chunk-B52VPQO3.js";
19
19
  import {
20
20
  asAttachment,
21
21
  asCustom,
22
22
  asReaction,
23
23
  asText
24
- } from "./chunk-LQMDV75O.js";
24
+ } from "./chunk-UXAKIXVM.js";
25
25
 
26
26
  // src/providers/whatsapp-business/index.ts
27
27
  import { createClient as createClient2 } from "@photon-ai/whatsapp-business";
@@ -644,6 +644,10 @@ var send = async (clients, spaceId, content) => {
644
644
  if (content.type === "typing") {
645
645
  return;
646
646
  }
647
+ if (content.type === "read") {
648
+ await primary(clients).messages.markRead(content.target.id);
649
+ return;
650
+ }
647
651
  const client = primary(clients);
648
652
  switch (content.type) {
649
653
  case "text":
@@ -4,7 +4,7 @@ import {
4
4
  } from "./chunk-6UZFVXQF.js";
5
5
  import {
6
6
  readSchema
7
- } from "./chunk-LQMDV75O.js";
7
+ } from "./chunk-UXAKIXVM.js";
8
8
 
9
9
  // src/content/contact.ts
10
10
  import vCard from "vcf";
@@ -8,7 +8,7 @@ import {
8
8
  readSchema,
9
9
  resolveContents,
10
10
  streamTextBuilder
11
- } from "./chunk-LQMDV75O.js";
11
+ } from "./chunk-UXAKIXVM.js";
12
12
 
13
13
  // src/content/avatar.ts
14
14
  import z2 from "zod";
@@ -46,10 +46,10 @@ var resolveMimeType = (input, mimeType, contentLabel) => {
46
46
  `Unable to resolve MIME type for ${contentLabel}. Pass options.mimeType explicitly.`
47
47
  );
48
48
  };
49
- var cachedRead = (read) => {
49
+ var cachedRead = (read2) => {
50
50
  let cached;
51
51
  return () => {
52
- cached ??= read().catch((err) => {
52
+ cached ??= read2().catch((err) => {
53
53
  cached = void 0;
54
54
  throw err;
55
55
  });
@@ -61,16 +61,16 @@ var buildPhotoAction = (input, options, contentLabel) => {
61
61
  return { kind: "clear" };
62
62
  }
63
63
  const mimeType = resolveMimeType(input, options?.mimeType, contentLabel);
64
- let read;
64
+ let read2;
65
65
  if (input instanceof URL) {
66
- read = cachedRead(async () => (await fetchUrlBytes(input)).data);
66
+ read2 = cachedRead(async () => (await fetchUrlBytes(input)).data);
67
67
  } else if (typeof input === "string") {
68
- read = cachedRead(() => readFile(input));
68
+ read2 = cachedRead(() => readFile(input));
69
69
  } else {
70
70
  const snapshot = Buffer.from(input);
71
- read = cachedRead(async () => snapshot);
71
+ read2 = cachedRead(async () => snapshot);
72
72
  }
73
- return { kind: "set", read, mimeType };
73
+ return { kind: "set", read: read2, mimeType };
74
74
  };
75
75
 
76
76
  // src/content/avatar.ts
@@ -116,7 +116,7 @@ function edit(content, target) {
116
116
  if (!resolved) {
117
117
  throw new Error("edit() requires content");
118
118
  }
119
- if (resolved.type === "edit" || resolved.type === "reply" || resolved.type === "reaction" || resolved.type === "group" || resolved.type === "typing" || resolved.type === "rename" || resolved.type === "avatar" || resolved.type === "unsend") {
119
+ if (resolved.type === "edit" || resolved.type === "reply" || resolved.type === "reaction" || resolved.type === "group" || resolved.type === "typing" || resolved.type === "rename" || resolved.type === "avatar" || resolved.type === "unsend" || resolved.type === "read") {
120
120
  throw new Error(`edit() cannot wrap "${resolved.type}" content`);
121
121
  }
122
122
  return asEdit({ content: resolved, target });
@@ -138,11 +138,34 @@ function markdown(source, options) {
138
138
  return streamTextBuilder("markdown", source, options);
139
139
  }
140
140
 
141
- // src/content/rename.ts
141
+ // src/content/read.ts
142
142
  import z5 from "zod";
143
- var renameSchema = z5.object({
144
- type: z5.literal("rename"),
145
- displayName: z5.string().min(1, "rename() displayName must be non-empty")
143
+ var isMessage2 = (v) => typeof v === "object" && v !== null && "id" in v && "content" in v;
144
+ var readSchema2 = z5.object({
145
+ type: z5.literal("read"),
146
+ target: z5.custom(isMessage2, {
147
+ message: "read target must be a Message"
148
+ })
149
+ });
150
+ var asRead = (input) => readSchema2.parse({ type: "read", ...input });
151
+ function read(target) {
152
+ return {
153
+ build: async () => {
154
+ if (target.direction !== "inbound") {
155
+ throw new Error(
156
+ `read() target must be an inbound message (got direction "${target.direction}", message id "${target.id}")`
157
+ );
158
+ }
159
+ return asRead({ target });
160
+ }
161
+ };
162
+ }
163
+
164
+ // src/content/rename.ts
165
+ import z6 from "zod";
166
+ var renameSchema = z6.object({
167
+ type: z6.literal("rename"),
168
+ displayName: z6.string().min(1, "rename() displayName must be non-empty")
146
169
  });
147
170
  function rename(displayName) {
148
171
  return {
@@ -151,15 +174,15 @@ function rename(displayName) {
151
174
  }
152
175
 
153
176
  // src/content/reply.ts
154
- import z6 from "zod";
155
- var isMessage2 = (v) => typeof v === "object" && v !== null && "id" in v && "content" in v;
177
+ import z7 from "zod";
178
+ var isMessage3 = (v) => typeof v === "object" && v !== null && "id" in v && "content" in v;
156
179
  var isContent2 = (v) => typeof v === "object" && v !== null && "type" in v && typeof v.type === "string";
157
- var replySchema = z6.object({
158
- type: z6.literal("reply"),
159
- content: z6.custom(isContent2, {
180
+ var replySchema = z7.object({
181
+ type: z7.literal("reply"),
182
+ content: z7.custom(isContent2, {
160
183
  message: "reply content must be a Content value"
161
184
  }),
162
- target: z6.custom(isMessage2, {
185
+ target: z7.custom(isMessage3, {
163
186
  message: "reply target must be a Message"
164
187
  })
165
188
  });
@@ -176,7 +199,7 @@ function reply(content, target) {
176
199
  if (!resolved) {
177
200
  throw new Error("reply() requires content");
178
201
  }
179
- if (resolved.type === "reply" || resolved.type === "edit" || resolved.type === "reaction" || resolved.type === "group" || resolved.type === "typing" || resolved.type === "rename" || resolved.type === "avatar" || resolved.type === "unsend") {
202
+ if (resolved.type === "reply" || resolved.type === "edit" || resolved.type === "reaction" || resolved.type === "group" || resolved.type === "typing" || resolved.type === "rename" || resolved.type === "avatar" || resolved.type === "unsend" || resolved.type === "read") {
180
203
  throw new Error(`reply() cannot wrap "${resolved.type}" content`);
181
204
  }
182
205
  return asReply({ content: resolved, target });
@@ -185,10 +208,10 @@ function reply(content, target) {
185
208
  }
186
209
 
187
210
  // src/content/typing.ts
188
- import z7 from "zod";
189
- var typingSchema = z7.object({
190
- type: z7.literal("typing"),
191
- state: z7.enum(["start", "stop"])
211
+ import z8 from "zod";
212
+ var typingSchema = z8.object({
213
+ type: z8.literal("typing"),
214
+ state: z8.enum(["start", "stop"])
192
215
  });
193
216
  function typing(state = "start") {
194
217
  return {
@@ -197,11 +220,11 @@ function typing(state = "start") {
197
220
  }
198
221
 
199
222
  // src/content/unsend.ts
200
- import z8 from "zod";
201
- var isMessage3 = (v) => typeof v === "object" && v !== null && "id" in v && "content" in v;
202
- var unsendSchema = z8.object({
203
- type: z8.literal("unsend"),
204
- target: z8.custom(isMessage3, {
223
+ import z9 from "zod";
224
+ var isMessage4 = (v) => typeof v === "object" && v !== null && "id" in v && "content" in v;
225
+ var unsendSchema = z9.object({
226
+ type: z9.literal("unsend"),
227
+ target: z9.custom(isMessage4, {
205
228
  message: "unsend target must be a Message"
206
229
  })
207
230
  });
@@ -545,7 +568,8 @@ var FIRE_AND_FORGET_TYPES = /* @__PURE__ */ new Set([
545
568
  "edit",
546
569
  "rename",
547
570
  "avatar",
548
- "unsend"
571
+ "unsend",
572
+ "read"
549
573
  ]);
550
574
  var isFireAndForget = (item) => FIRE_AND_FORGET_TYPES.has(item.type) || item.__fireAndForget === true;
551
575
  var RESERVED_SPACE_KEYS = /* @__PURE__ */ new Set([
@@ -554,6 +578,7 @@ var RESERVED_SPACE_KEYS = /* @__PURE__ */ new Set([
554
578
  "send",
555
579
  "edit",
556
580
  "unsend",
581
+ "read",
557
582
  "getMessage",
558
583
  "rename",
559
584
  "avatar",
@@ -569,6 +594,7 @@ var RESERVED_MESSAGE_KEYS = /* @__PURE__ */ new Set([
569
594
  "id",
570
595
  "platform",
571
596
  "react",
597
+ "read",
572
598
  "reply",
573
599
  "sender",
574
600
  "space",
@@ -938,6 +964,9 @@ function buildSpace(params) {
938
964
  unsend: async (message) => {
939
965
  await space.send(unsend(message));
940
966
  },
967
+ read: async (message) => {
968
+ await space.send(read(message));
969
+ },
941
970
  getMessage: getMessageImpl,
942
971
  rename: async (displayName) => {
943
972
  await space.send(rename(displayName));
@@ -1010,6 +1039,15 @@ function buildMessage(params) {
1010
1039
  }
1011
1040
  await space.send(unsend(target));
1012
1041
  };
1042
+ const read2 = async () => {
1043
+ const target = requireBuiltMessage("read");
1044
+ if (target.direction !== "inbound") {
1045
+ throw new Error(
1046
+ `cannot mark message ${target.id} as read: only inbound messages can be marked read (direction: "${target.direction}")`
1047
+ );
1048
+ }
1049
+ await space.send(read(target));
1050
+ };
1013
1051
  const buildSenderWithPlatform = () => {
1014
1052
  if (params.sender === void 0) {
1015
1053
  return;
@@ -1046,6 +1084,7 @@ function buildMessage(params) {
1046
1084
  direction: params.direction,
1047
1085
  platform: definition.name,
1048
1086
  react,
1087
+ read: read2,
1049
1088
  reply: reply2,
1050
1089
  edit: edit2,
1051
1090
  unsend: unsend2,
@@ -1325,6 +1364,7 @@ export {
1325
1364
  markdownSchema,
1326
1365
  asMarkdown,
1327
1366
  markdown,
1367
+ read,
1328
1368
  rename,
1329
1369
  reply,
1330
1370
  typing,
@@ -1,11 +1,11 @@
1
1
  import { createRequire as __spectrumCreateRequire } from "node:module"; const require = __spectrumCreateRequire(import.meta.url);
2
2
  import {
3
3
  asRichlink
4
- } from "./chunk-CHY5YLLV.js";
4
+ } from "./chunk-ZR3TKZMT.js";
5
5
  import {
6
6
  asGroup,
7
7
  groupSchema
8
- } from "./chunk-MHGCPC2V.js";
8
+ } from "./chunk-LZXPLXZF.js";
9
9
  import {
10
10
  asPoll,
11
11
  asPollOption
@@ -15,7 +15,7 @@ import {
15
15
  } from "./chunk-3GEJYGZK.js";
16
16
  import {
17
17
  asContact
18
- } from "./chunk-NZ5WCMTY.js";
18
+ } from "./chunk-A37PM5N2.js";
19
19
  import {
20
20
  mergeStreams,
21
21
  stream
@@ -30,7 +30,7 @@ import {
30
30
  definePlatform,
31
31
  markdownSchema,
32
32
  photoActionSchema
33
- } from "./chunk-L3NUESOW.js";
33
+ } from "./chunk-B52VPQO3.js";
34
34
  import {
35
35
  asAttachment,
36
36
  asCustom,
@@ -39,7 +39,7 @@ import {
39
39
  reactionSchema,
40
40
  text,
41
41
  textSchema
42
- } from "./chunk-LQMDV75O.js";
42
+ } from "./chunk-UXAKIXVM.js";
43
43
 
44
44
  // src/providers/imessage/index.ts
45
45
  import {
@@ -172,68 +172,38 @@ function effect(input, messageEffect) {
172
172
  };
173
173
  }
174
174
 
175
- // src/providers/imessage/content/read.ts
176
- import z4 from "zod";
177
- var isMessage = (v) => typeof v === "object" && v !== null && "id" in v && "content" in v;
178
- var readSchema = z4.object({
179
- type: z4.literal("read"),
180
- __platform: z4.literal("iMessage"),
181
- __fireAndForget: z4.literal(true),
182
- target: z4.custom(isMessage, {
183
- message: "read target must be a Message"
184
- })
185
- });
186
- var isRead = (v) => readSchema.safeParse(v).success;
187
- function read(target) {
188
- return {
189
- build: async () => {
190
- if (target.direction !== "inbound") {
191
- throw new Error(
192
- `read() target must be an inbound message (got direction "${target.direction}", message id "${target.id}")`
193
- );
194
- }
195
- return readSchema.parse({
196
- type: "read",
197
- __platform: "iMessage",
198
- __fireAndForget: true,
199
- target
200
- });
201
- }
202
- };
203
- }
204
-
205
175
  // src/providers/imessage/auth.ts
206
176
  import { createClient } from "@photon-ai/advanced-imessage";
207
177
 
208
178
  // src/providers/imessage/types.ts
209
179
  import { IMessageSDK } from "@photon-ai/imessage-kit";
210
- import z5 from "zod";
180
+ import z4 from "zod";
211
181
  var SHARED_PHONE = "shared";
212
182
  var isLocal = (client) => client instanceof IMessageSDK;
213
- var clientEntry = z5.object({
214
- address: z5.string(),
215
- token: z5.string(),
216
- phone: z5.string()
183
+ var clientEntry = z4.object({
184
+ address: z4.string(),
185
+ token: z4.string(),
186
+ phone: z4.string()
217
187
  });
218
- var configSchema = z5.union([
219
- z5.object({ local: z5.literal(true) }),
220
- z5.object({
221
- local: z5.literal(false).optional().default(false),
222
- clients: clientEntry.or(z5.array(clientEntry)).optional()
188
+ var configSchema = z4.union([
189
+ z4.object({ local: z4.literal(true) }),
190
+ z4.object({
191
+ local: z4.literal(false).optional().default(false),
192
+ clients: clientEntry.or(z4.array(clientEntry)).optional()
223
193
  })
224
194
  ]);
225
- var userSchema = z5.object({});
226
- var spaceSchema = z5.object({
227
- id: z5.string(),
228
- type: z5.enum(["dm", "group"]),
229
- phone: z5.string()
195
+ var userSchema = z4.object({});
196
+ var spaceSchema = z4.object({
197
+ id: z4.string(),
198
+ type: z4.enum(["dm", "group"]),
199
+ phone: z4.string()
230
200
  });
231
- var spaceParamsSchema = z5.object({
232
- phone: z5.string().optional()
201
+ var spaceParamsSchema = z4.object({
202
+ phone: z4.string().optional()
233
203
  });
234
- var messageSchema = z5.object({
235
- partIndex: z5.number().int().nonnegative().optional(),
236
- parentId: z5.string().optional()
204
+ var messageSchema = z4.object({
205
+ partIndex: z4.number().int().nonnegative().optional(),
206
+ parentId: z4.string().optional()
237
207
  });
238
208
 
239
209
  // src/providers/imessage/auth.ts
@@ -2852,23 +2822,11 @@ var imessage = definePlatform("iMessage", {
2852
2822
  // local-mode iMessage is identical to the canonical form.
2853
2823
  background: async (space, input, opts) => {
2854
2824
  await space.send(background(input, opts));
2855
- },
2856
- // Sugar: `space.read(message)` → `space.send(read(message))`.
2857
- read: async (space, message) => {
2858
- await space.send(read(message));
2859
2825
  }
2860
2826
  }
2861
2827
  },
2862
2828
  message: {
2863
- schema: messageSchema,
2864
- actions: {
2865
- // Sugar: `message.read()` → `message.space.send(read(self))`.
2866
- // `buildMessage` injects the message as the first argument; callers
2867
- // pass nothing.
2868
- read: async (message) => {
2869
- await message.space.send(read(message));
2870
- }
2871
- }
2829
+ schema: messageSchema
2872
2830
  },
2873
2831
  messages: ({ client, projectConfig }) => isLocal(client) ? messages2(client) : messages4(client, projectConfig),
2874
2832
  send: async ({ space, content, client }) => {
@@ -2941,12 +2899,12 @@ var imessage = definePlatform("iMessage", {
2941
2899
  await handleAvatar(client, space, content);
2942
2900
  return;
2943
2901
  }
2944
- if (isBackground(content)) {
2945
- await handleBackground(client, space, content);
2902
+ if (content.type === "read") {
2903
+ await handleRead(client, space);
2946
2904
  return;
2947
2905
  }
2948
- if (isRead(content)) {
2949
- await handleRead(client, space);
2906
+ if (isBackground(content)) {
2907
+ await handleBackground(client, space, content);
2950
2908
  return;
2951
2909
  }
2952
2910
  if (isCustomizedMiniApp(content)) {
@@ -3018,6 +2976,5 @@ export {
3018
2976
  background,
3019
2977
  customizedMiniApp,
3020
2978
  effect,
3021
- read,
3022
2979
  imessage
3023
2980
  };
@@ -4,7 +4,7 @@ import {
4
4
  fetchUrlBytes,
5
5
  readSchema,
6
6
  streamSchema
7
- } from "./chunk-LQMDV75O.js";
7
+ } from "./chunk-UXAKIXVM.js";
8
8
 
9
9
  // src/content/voice.ts
10
10
  import { createReadStream } from "fs";
@@ -1,10 +1,10 @@
1
1
  import { createRequire as __spectrumCreateRequire } from "node:module"; const require = __spectrumCreateRequire(import.meta.url);
2
2
  import {
3
3
  asVoice
4
- } from "./chunk-77U6SH5A.js";
4
+ } from "./chunk-FAIFTUV2.js";
5
5
  import {
6
6
  asContact
7
- } from "./chunk-NZ5WCMTY.js";
7
+ } from "./chunk-A37PM5N2.js";
8
8
  import {
9
9
  stream
10
10
  } from "./chunk-5XEFJBN2.js";
@@ -15,12 +15,12 @@ import {
15
15
  import {
16
16
  UnsupportedError,
17
17
  definePlatform
18
- } from "./chunk-L3NUESOW.js";
18
+ } from "./chunk-B52VPQO3.js";
19
19
  import {
20
20
  asAttachment,
21
21
  asCustom,
22
22
  reactionSchema
23
- } from "./chunk-LQMDV75O.js";
23
+ } from "./chunk-UXAKIXVM.js";
24
24
 
25
25
  // src/providers/terminal/index.ts
26
26
  import { spawn } from "child_process";
@@ -1,7 +1,7 @@
1
1
  import { createRequire as __spectrumCreateRequire } from "node:module"; const require = __spectrumCreateRequire(import.meta.url);
2
2
  import {
3
3
  resolveContents
4
- } from "./chunk-LQMDV75O.js";
4
+ } from "./chunk-UXAKIXVM.js";
5
5
 
6
6
  // src/content/group.ts
7
7
  import z from "zod";
@@ -4,10 +4,10 @@ import {
4
4
  } from "./chunk-34FQGGD7.js";
5
5
  import {
6
6
  asGroup
7
- } from "./chunk-MHGCPC2V.js";
7
+ } from "./chunk-LZXPLXZF.js";
8
8
  import {
9
9
  asVoice
10
- } from "./chunk-77U6SH5A.js";
10
+ } from "./chunk-FAIFTUV2.js";
11
11
  import {
12
12
  toVCard
13
13
  } from "./chunk-6UZFVXQF.js";
@@ -16,13 +16,13 @@ import {
16
16
  asMarkdown,
17
17
  definePlatform,
18
18
  renderInlineTokens
19
- } from "./chunk-L3NUESOW.js";
19
+ } from "./chunk-B52VPQO3.js";
20
20
  import {
21
21
  asAttachment,
22
22
  asCustom,
23
23
  asReaction,
24
24
  asText
25
- } from "./chunk-LQMDV75O.js";
25
+ } from "./chunk-UXAKIXVM.js";
26
26
 
27
27
  // src/providers/telegram/config.ts
28
28
  import z from "zod";
@@ -793,6 +793,8 @@ var send = async ({
793
793
  return await sendReaction(client, space, content);
794
794
  case "typing":
795
795
  return await sendTyping(client, space, content.state);
796
+ case "read":
797
+ return;
796
798
  case "edit":
797
799
  return await sendEdit(client, space, content);
798
800
  case "group":
@@ -1,43 +1,4 @@
1
1
  import { createRequire as __spectrumCreateRequire } from "node:module"; const require = __spectrumCreateRequire(import.meta.url);
2
- var __create = Object.create;
3
- var __defProp = Object.defineProperty;
4
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
- var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __getProtoOf = Object.getPrototypeOf;
7
- var __hasOwnProp = Object.prototype.hasOwnProperty;
8
- var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
9
- get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
10
- }) : x)(function(x) {
11
- if (typeof require !== "undefined") return require.apply(this, arguments);
12
- throw Error('Dynamic require of "' + x + '" is not supported');
13
- });
14
- var __esm = (fn, res) => function __init() {
15
- return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
16
- };
17
- var __commonJS = (cb, mod) => function __require2() {
18
- return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
19
- };
20
- var __export = (target, all) => {
21
- for (var name in all)
22
- __defProp(target, name, { get: all[name], enumerable: true });
23
- };
24
- var __copyProps = (to, from, except, desc) => {
25
- if (from && typeof from === "object" || typeof from === "function") {
26
- for (let key of __getOwnPropNames(from))
27
- if (!__hasOwnProp.call(to, key) && key !== except)
28
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
29
- }
30
- return to;
31
- };
32
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
33
- // If the importer is in node compatibility mode or this is not an ESM
34
- // file that has been converted to a CommonJS file using a Babel-
35
- // compatible transform (i.e. "__esModule" has not been set), then set
36
- // "default" to the CommonJS "module.exports" for node compatibility.
37
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
38
- mod
39
- ));
40
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
41
2
 
42
3
  // src/content/attachment.ts
43
4
  import { randomUUID } from "crypto";
@@ -426,12 +387,6 @@ function reaction(emoji, target) {
426
387
  }
427
388
 
428
389
  export {
429
- __require,
430
- __esm,
431
- __commonJS,
432
- __export,
433
- __toESM,
434
- __toCommonJS,
435
390
  readSchema,
436
391
  streamSchema,
437
392
  bufferToStream,
@@ -9,13 +9,13 @@ import {
9
9
  import {
10
10
  UnsupportedError,
11
11
  definePlatform
12
- } from "./chunk-L3NUESOW.js";
12
+ } from "./chunk-B52VPQO3.js";
13
13
  import {
14
14
  asAttachment,
15
15
  asCustom,
16
16
  asReaction,
17
17
  asText
18
- } from "./chunk-LQMDV75O.js";
18
+ } from "./chunk-UXAKIXVM.js";
19
19
 
20
20
  // src/providers/slack/index.ts
21
21
  import { createClient as createClient2, staticTokens } from "@photon-ai/slack";
@@ -350,6 +350,9 @@ var send = async (client, space, content) => {
350
350
  if (content.type === "typing") {
351
351
  return;
352
352
  }
353
+ if (content.type === "read") {
354
+ return;
355
+ }
353
356
  return await sendContent(client, space, content);
354
357
  };
355
358
  var sendContent = async (client, space, content, threadTs) => {