spectrum-ts 1.9.2 → 1.12.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,13 +1,13 @@
1
- import { C as ContentBuilder, b as ContentInput, S as SchemaMessage, P as Platform, a as PlatformDef } from '../../types-lUyzRurY.js';
1
+ import { C as ContentBuilder, c as ContentInput, M as Message, S as SchemaMessage, P as Platform, a as PlatformDef, b as Space } from '../../types-BzW4gInA.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 { P as PhotoInput } from '../../photo-content-BQF42prd.js';
5
6
  import { MessageEffect, AdvancedIMessage } from '@photon-ai/advanced-imessage';
6
7
  import { IMessageSDK } from '@photon-ai/imessage-kit';
7
8
  import 'hotscript';
8
9
 
9
- declare const CLEAR_SENTINEL: "clear";
10
- type BackgroundInput = typeof CLEAR_SENTINEL | string | Buffer;
10
+ type BackgroundInput = PhotoInput;
11
11
  /**
12
12
  * Set or clear the chat background. iMessage-only, remote-only.
13
13
  *
@@ -37,6 +37,26 @@ declare function background(input: string | Buffer, options?: {
37
37
  type IMessageMessageEffect = MessageEffect;
38
38
  declare function effect(input: ContentInput, messageEffect: IMessageMessageEffect): ContentBuilder;
39
39
 
40
+ /**
41
+ * Mark the chat containing `target` as read. iMessage-only, remote-only.
42
+ *
43
+ * Implemented via `chats.markRead(chatGuid)`, which marks **every unread
44
+ * message in the chat** as read — there is no per-message read receipt in
45
+ * the SDK. `target` is used only to identify the chat (and to give
46
+ * `message.read()` something to pass), so passing any message from a chat
47
+ * marks the whole chat as read.
48
+ *
49
+ * `space.send(read(message))` is the canonical form; `space.read(message)`
50
+ * and `message.read()` are sugar attached via the iMessage platform's
51
+ * `space.actions` / `message.actions` slots.
52
+ *
53
+ * `Read` is intentionally not a member of the universal `Content` union —
54
+ * the `as unknown as Content` cast keeps the builder shape compatible with
55
+ * the framework's `ContentBuilder.build(): Promise<Content>` signature. The
56
+ * framework treats it as a fire-and-forget control signal at runtime.
57
+ */
58
+ declare function read(target: Message): ContentBuilder;
59
+
40
60
  interface RemoteClient {
41
61
  client: AdvancedIMessage;
42
62
  phone: string;
@@ -91,7 +111,14 @@ declare const imessage: Platform<PlatformDef<"iMessage", z.ZodUnion<readonly [z.
91
111
  }, z.ZodObject<{
92
112
  partIndex: z.ZodOptional<z.ZodNumber>;
93
113
  parentId: z.ZodOptional<z.ZodString>;
94
- }, zod_v4_core.$strip>, IMessageMessage, undefined>> & Readonly<{
114
+ }, zod_v4_core.$strip>, IMessageMessage, undefined, {
115
+ background: (space: Space, input: BackgroundInput, opts?: {
116
+ mimeType?: string;
117
+ }) => Promise<void>;
118
+ read: (space: Space, message: Message) => Promise<void>;
119
+ }, {
120
+ read: (message: Message) => Promise<void>;
121
+ }>> & Readonly<{
95
122
  effect: {
96
123
  message: {
97
124
  readonly slam: "com.apple.MobileSMS.expressivesend.impact";
@@ -111,4 +138,4 @@ declare const imessage: Platform<PlatformDef<"iMessage", z.ZodUnion<readonly [z.
111
138
  };
112
139
  }>;
113
140
 
114
- export { type BackgroundInput, type IMessageMessageEffect, background, effect, imessage };
141
+ export { type BackgroundInput, type IMessageMessageEffect, background, effect, imessage, read };
@@ -1,13 +1,17 @@
1
1
  import {
2
2
  background,
3
3
  effect,
4
- imessage
5
- } from "../../chunk-7O5BCLGQ.js";
6
- import "../../chunk-5NHNMN4H.js";
7
- import "../../chunk-HWADNTQF.js";
8
- import "../../chunk-XZSBR26X.js";
4
+ imessage,
5
+ read
6
+ } from "../../chunk-FPYXHZZA.js";
7
+ import "../../chunk-UFJZIZDO.js";
8
+ import "../../chunk-KO67KDBD.js";
9
+ import "../../chunk-YKWKZ2PZ.js";
10
+ import "../../chunk-L3VXHUVY.js";
11
+ import "../../chunk-YDHES53X.js";
9
12
  export {
10
13
  background,
11
14
  effect,
12
- imessage
15
+ imessage,
16
+ read
13
17
  };
@@ -1,12 +1,15 @@
1
1
  export { imessage } from './imessage/index.js';
2
+ export { slack } from './slack/index.js';
2
3
  export { terminal } from './terminal/index.js';
3
4
  export { whatsappBusiness } from './whatsapp-business/index.js';
4
- import '../types-lUyzRurY.js';
5
+ import '../types-BzW4gInA.js';
5
6
  import 'hotscript';
6
7
  import 'zod';
7
8
  import 'zod/v4/core';
9
+ import '../photo-content-BQF42prd.js';
8
10
  import '@photon-ai/advanced-imessage';
9
11
  import '@photon-ai/imessage-kit';
12
+ import '@photon-ai/slack';
10
13
  import 'node:child_process';
11
14
  import 'node:net';
12
15
  import '@photon-ai/whatsapp-business';
@@ -1,18 +1,24 @@
1
1
  import {
2
2
  imessage
3
- } from "../chunk-7O5BCLGQ.js";
4
- import "../chunk-5NHNMN4H.js";
3
+ } from "../chunk-FPYXHZZA.js";
4
+ import "../chunk-UFJZIZDO.js";
5
+ import {
6
+ slack
7
+ } from "../chunk-E7AXYNOZ.js";
5
8
  import {
6
9
  terminal
7
- } from "../chunk-N3ZKMTSG.js";
8
- import "../chunk-TN54TDTQ.js";
10
+ } from "../chunk-7Z3QGRGI.js";
11
+ import "../chunk-4TXLNBGE.js";
9
12
  import {
10
13
  whatsappBusiness
11
- } from "../chunk-OR3VGVML.js";
12
- import "../chunk-HWADNTQF.js";
13
- import "../chunk-XZSBR26X.js";
14
+ } from "../chunk-VQOW7X7U.js";
15
+ import "../chunk-KO67KDBD.js";
16
+ import "../chunk-YKWKZ2PZ.js";
17
+ import "../chunk-L3VXHUVY.js";
18
+ import "../chunk-YDHES53X.js";
14
19
  export {
15
20
  imessage,
21
+ slack,
16
22
  terminal,
17
23
  whatsappBusiness
18
24
  };
@@ -0,0 +1,47 @@
1
+ import { S as SchemaMessage, P as Platform, a as PlatformDef } from '../../types-BzW4gInA.js';
2
+ import * as z from 'zod';
3
+ import z__default from 'zod';
4
+ import * as _photon_ai_slack from '@photon-ai/slack';
5
+ import * as zod_v4_core from 'zod/v4/core';
6
+ import 'hotscript';
7
+
8
+ declare const userSchema: z__default.ZodObject<{}, z__default.core.$strip>;
9
+ declare const spaceSchema: z__default.ZodObject<{
10
+ id: z__default.ZodString;
11
+ teamId: z__default.ZodString;
12
+ }, z__default.core.$strip>;
13
+ type SlackMessage = SchemaMessage<typeof userSchema, typeof spaceSchema> & {
14
+ isFromMe: boolean;
15
+ subtype?: string;
16
+ threadTs?: string;
17
+ ts?: string;
18
+ };
19
+
20
+ declare const slack: Platform<PlatformDef<"Slack", z.ZodUnion<readonly [z.ZodObject<{
21
+ endpoint: z.ZodOptional<z.ZodString>;
22
+ teams: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
23
+ appId: z.ZodString;
24
+ botUserId: z.ZodString;
25
+ grantedScopes: z.ZodArray<z.ZodString>;
26
+ teamName: z.ZodString;
27
+ }, zod_v4_core.$strip>>>;
28
+ tokens: z.ZodRecord<z.ZodString, z.ZodString>;
29
+ }, zod_v4_core.$strip>, z.ZodObject<{}, zod_v4_core.$strict>]>, z.ZodObject<{}, zod_v4_core.$strip>, z.ZodObject<{
30
+ id: z.ZodString;
31
+ teamId: z.ZodString;
32
+ }, zod_v4_core.$strip>, z.ZodObject<{
33
+ channel: z.ZodOptional<z.ZodString>;
34
+ teamId: z.ZodString;
35
+ }, zod_v4_core.$strip>, _photon_ai_slack.SlackClient, {
36
+ id: string;
37
+ }, {
38
+ id: string;
39
+ teamId: string;
40
+ }, z.ZodObject<{
41
+ isFromMe: z.ZodBoolean;
42
+ subtype: z.ZodOptional<z.ZodString>;
43
+ threadTs: z.ZodOptional<z.ZodString>;
44
+ ts: z.ZodOptional<z.ZodString>;
45
+ }, zod_v4_core.$strip>, SlackMessage, undefined, Record<never, never>, Record<never, never>>> & Readonly<Record<never, never>>;
46
+
47
+ export { slack };
@@ -0,0 +1,8 @@
1
+ import {
2
+ slack
3
+ } from "../../chunk-E7AXYNOZ.js";
4
+ import "../../chunk-YKWKZ2PZ.js";
5
+ import "../../chunk-YDHES53X.js";
6
+ export {
7
+ slack
8
+ };
@@ -1,4 +1,4 @@
1
- import { P as Platform, a as PlatformDef, M as Message } from '../../types-lUyzRurY.js';
1
+ import { P as Platform, a as PlatformDef, M as Message, U as User, b as Space } from '../../types-BzW4gInA.js';
2
2
  import { ChildProcess } from 'node:child_process';
3
3
  import z__default from 'zod';
4
4
  import { Socket } from 'node:net';
@@ -183,10 +183,10 @@ declare const terminal: Platform<PlatformDef<"terminal", z__default.ZodObject<{
183
183
  } | {
184
184
  type: "reaction";
185
185
  emoji: string;
186
- target: Message;
186
+ target: Message<string, User, Space<unknown>>;
187
187
  } | {
188
188
  type: "group";
189
- items: Message[];
189
+ items: Message<string, User, Space<unknown>>[];
190
190
  } | {
191
191
  type: "poll";
192
192
  title: string;
@@ -224,6 +224,18 @@ declare const terminal: Platform<PlatformDef<"terminal", z__default.ZodObject<{
224
224
  } | {
225
225
  type: "typing";
226
226
  state: "start" | "stop";
227
+ } | {
228
+ type: "rename";
229
+ displayName: string;
230
+ } | {
231
+ type: "avatar";
232
+ action: {
233
+ kind: "set";
234
+ read: z__default.core.$InferOuterFunctionType<z__default.ZodTuple<readonly [], null>, z__default.ZodPromise<z__default.ZodCustom<Buffer<ArrayBufferLike>, Buffer<ArrayBufferLike>>>>;
235
+ mimeType: string;
236
+ } | {
237
+ kind: "clear";
238
+ };
227
239
  } | {
228
240
  type: "reply";
229
241
  content: {
@@ -303,10 +315,10 @@ declare const terminal: Platform<PlatformDef<"terminal", z__default.ZodObject<{
303
315
  } | {
304
316
  type: "reaction";
305
317
  emoji: string;
306
- target: Message;
318
+ target: Message<string, User, Space<unknown>>;
307
319
  } | {
308
320
  type: "group";
309
- items: Message[];
321
+ items: Message<string, User, Space<unknown>>[];
310
322
  } | {
311
323
  type: "poll";
312
324
  title: string;
@@ -344,8 +356,20 @@ declare const terminal: Platform<PlatformDef<"terminal", z__default.ZodObject<{
344
356
  } | {
345
357
  type: "typing";
346
358
  state: "start" | "stop";
359
+ } | {
360
+ type: "rename";
361
+ displayName: string;
362
+ } | {
363
+ type: "avatar";
364
+ action: {
365
+ kind: "set";
366
+ read: z__default.core.$InferOuterFunctionType<z__default.ZodTuple<readonly [], null>, z__default.ZodPromise<z__default.ZodCustom<Buffer<ArrayBufferLike>, Buffer<ArrayBufferLike>>>>;
367
+ mimeType: string;
368
+ } | {
369
+ kind: "clear";
370
+ };
347
371
  };
348
- target: Message;
372
+ target: Message<string, User, Space<unknown>>;
349
373
  } | {
350
374
  type: "edit";
351
375
  content: {
@@ -425,10 +449,10 @@ declare const terminal: Platform<PlatformDef<"terminal", z__default.ZodObject<{
425
449
  } | {
426
450
  type: "reaction";
427
451
  emoji: string;
428
- target: Message;
452
+ target: Message<string, User, Space<unknown>>;
429
453
  } | {
430
454
  type: "group";
431
- items: Message[];
455
+ items: Message<string, User, Space<unknown>>[];
432
456
  } | {
433
457
  type: "poll";
434
458
  title: string;
@@ -466,8 +490,20 @@ declare const terminal: Platform<PlatformDef<"terminal", z__default.ZodObject<{
466
490
  } | {
467
491
  type: "typing";
468
492
  state: "start" | "stop";
493
+ } | {
494
+ type: "rename";
495
+ displayName: string;
496
+ } | {
497
+ type: "avatar";
498
+ action: {
499
+ kind: "set";
500
+ read: z__default.core.$InferOuterFunctionType<z__default.ZodTuple<readonly [], null>, z__default.ZodPromise<z__default.ZodCustom<Buffer<ArrayBufferLike>, Buffer<ArrayBufferLike>>>>;
501
+ mimeType: string;
502
+ } | {
503
+ kind: "clear";
504
+ };
469
505
  };
470
- target: Message;
506
+ target: Message<string, User, Space<unknown>>;
471
507
  };
472
508
  sender: {
473
509
  id: string;
@@ -476,6 +512,6 @@ declare const terminal: Platform<PlatformDef<"terminal", z__default.ZodObject<{
476
512
  id: string;
477
513
  };
478
514
  timestamp: Date;
479
- }, undefined>> & Readonly<Record<never, never>>;
515
+ }, undefined, Record<never, never>, Record<never, never>>> & Readonly<Record<never, never>>;
480
516
 
481
517
  export { terminal };
@@ -1,8 +1,9 @@
1
1
  import {
2
2
  terminal
3
- } from "../../chunk-N3ZKMTSG.js";
4
- import "../../chunk-TN54TDTQ.js";
5
- import "../../chunk-XZSBR26X.js";
3
+ } from "../../chunk-7Z3QGRGI.js";
4
+ import "../../chunk-4TXLNBGE.js";
5
+ import "../../chunk-L3VXHUVY.js";
6
+ import "../../chunk-YDHES53X.js";
6
7
  export {
7
8
  terminal
8
9
  };
@@ -1,4 +1,4 @@
1
- import { S as SchemaMessage, P as Platform, a as PlatformDef } from '../../types-lUyzRurY.js';
1
+ import { S as SchemaMessage, P as Platform, a as PlatformDef } from '../../types-BzW4gInA.js';
2
2
  import { WhatsAppClient } from '@photon-ai/whatsapp-business';
3
3
  import * as z from 'zod';
4
4
  import z__default from 'zod';
@@ -22,6 +22,6 @@ declare const whatsappBusiness: Platform<PlatformDef<"WhatsApp Business", z.ZodU
22
22
  id: string;
23
23
  }, {
24
24
  id: string;
25
- }, undefined, WhatsAppMessage, undefined>> & Readonly<Record<never, never>>;
25
+ }, undefined, WhatsAppMessage, undefined, Record<never, never>, Record<never, never>>> & Readonly<Record<never, never>>;
26
26
 
27
27
  export { whatsappBusiness };
@@ -1,8 +1,10 @@
1
1
  import {
2
2
  whatsappBusiness
3
- } from "../../chunk-OR3VGVML.js";
4
- import "../../chunk-HWADNTQF.js";
5
- import "../../chunk-XZSBR26X.js";
3
+ } from "../../chunk-VQOW7X7U.js";
4
+ import "../../chunk-KO67KDBD.js";
5
+ import "../../chunk-YKWKZ2PZ.js";
6
+ import "../../chunk-L3VXHUVY.js";
7
+ import "../../chunk-YDHES53X.js";
6
8
  export {
7
9
  whatsappBusiness
8
10
  };