spectrum-ts 4.2.0 → 5.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (46) hide show
  1. package/README.md +29 -67
  2. package/dist/authoring.d.ts +1 -6
  3. package/dist/authoring.js +2 -36
  4. package/dist/elysia.d.ts +1 -94
  5. package/dist/elysia.js +2 -15
  6. package/dist/express.d.ts +1 -62
  7. package/dist/express.js +2 -19
  8. package/dist/hono.d.ts +1 -64
  9. package/dist/hono.js +2 -11
  10. package/dist/index.d.ts +1 -2851
  11. package/dist/index.js +2 -3763
  12. package/dist/manifest.json +5 -5
  13. package/dist/providers/imessage/index.d.ts +1 -222
  14. package/dist/providers/imessage/index.js +2 -25
  15. package/dist/providers/index.d.ts +6 -19
  16. package/dist/providers/index.js +6 -34
  17. package/dist/providers/slack/index.d.ts +1 -46
  18. package/dist/providers/slack/index.js +2 -11
  19. package/dist/providers/telegram/index.d.ts +1 -45
  20. package/dist/providers/telegram/index.js +2 -13
  21. package/dist/providers/terminal/index.d.ts +1 -119
  22. package/dist/providers/terminal/index.js +2 -13
  23. package/dist/providers/whatsapp-business/index.d.ts +1 -27
  24. package/dist/providers/whatsapp-business/index.js +2 -14
  25. package/package.json +11 -38
  26. package/dist/attachment-CnivEhr6.d.ts +0 -29
  27. package/dist/authoring-b9AhXgPI.d.ts +0 -304
  28. package/dist/chunk-2D27WW5B.js +0 -63
  29. package/dist/chunk-34FQGGD7.js +0 -34
  30. package/dist/chunk-3GEJYGZK.js +0 -84
  31. package/dist/chunk-5XEFJBN2.js +0 -197
  32. package/dist/chunk-6UZFVXQF.js +0 -374
  33. package/dist/chunk-A37PM5N2.js +0 -91
  34. package/dist/chunk-ARL2NOBO.js +0 -887
  35. package/dist/chunk-B52VPQO3.js +0 -1379
  36. package/dist/chunk-DMPDLSFU.js +0 -864
  37. package/dist/chunk-FAIFTUV2.js +0 -139
  38. package/dist/chunk-LZXPLXZF.js +0 -35
  39. package/dist/chunk-N6THJDZV.js +0 -929
  40. package/dist/chunk-NLMQ75LH.js +0 -2980
  41. package/dist/chunk-UXAKIXVM.js +0 -409
  42. package/dist/chunk-WXLQNANA.js +0 -539
  43. package/dist/chunk-ZR3TKZMT.js +0 -129
  44. package/dist/read-C4uvozGX.d.ts +0 -53
  45. package/dist/types-CyfLJXgu.d.ts +0 -1530
  46. package/dist/types-ZgFTj5hJ.d.ts +0 -87
@@ -2,31 +2,31 @@
2
2
  {
3
3
  "key": "imessage",
4
4
  "import": "imessage",
5
- "path": "spectrum-ts/providers/imessage",
5
+ "path": "@spectrum-ts/imessage",
6
6
  "label": "iMessage"
7
7
  },
8
8
  {
9
9
  "key": "slack",
10
10
  "import": "slack",
11
- "path": "spectrum-ts/providers/slack",
11
+ "path": "@spectrum-ts/slack",
12
12
  "label": "Slack"
13
13
  },
14
14
  {
15
15
  "key": "telegram",
16
16
  "import": "telegram",
17
- "path": "spectrum-ts/providers/telegram",
17
+ "path": "@spectrum-ts/telegram",
18
18
  "label": "telegram"
19
19
  },
20
20
  {
21
21
  "key": "terminal",
22
22
  "import": "terminal",
23
- "path": "spectrum-ts/providers/terminal",
23
+ "path": "@spectrum-ts/terminal",
24
24
  "label": "Terminal"
25
25
  },
26
26
  {
27
27
  "key": "whatsapp-business",
28
28
  "import": "whatsappBusiness",
29
- "path": "spectrum-ts/providers/whatsapp-business",
29
+ "path": "@spectrum-ts/whatsapp-business",
30
30
  "label": "WhatsApp Business"
31
31
  }
32
32
  ]
@@ -1,222 +1 @@
1
- import { C as ContentBuilder, h as ContentInput, a as SchemaMessage, P as Platform, b as PlatformDef, S as Space, d as Store } from '../../types-CyfLJXgu.js';
2
- import * as zod_v4_core from 'zod/v4/core';
3
- import * as z from 'zod';
4
- import z__default from 'zod';
5
- import { A as Attachment } from '../../attachment-CnivEhr6.js';
6
- import { P as PhotoInput } from '../../read-C4uvozGX.js';
7
- export { r as read } from '../../read-C4uvozGX.js';
8
- import { MessageEffect, AdvancedIMessage } from '@photon-ai/advanced-imessage';
9
- import { IMessageSDK } from '@photon-ai/imessage-kit';
10
- import 'hotscript';
11
-
12
- type BackgroundInput = PhotoInput;
13
- /**
14
- * Set or clear the chat background. iMessage-only, remote-only.
15
- *
16
- * - `background("clear")` — remove the current chat background.
17
- * - `background("./photo.jpg")` — set background from a filesystem path.
18
- * MIME type is inferred from the extension; override with `options.mimeType`.
19
- * - `background(new URL("https://…/photo.jpg"))` — fetch the background
20
- * lazily over the network. Bytes stay in memory (safe in read-only
21
- * environments). MIME type is inferred from the URL pathname extension;
22
- * override with `options.mimeType` when the URL has no usable extension.
23
- * - `background(buffer, { mimeType })` — set background from in-memory bytes.
24
- * `options.mimeType` is required.
25
- *
26
- * `"clear"` is a reserved string-literal sentinel. If you have a file literally
27
- * named `clear` with no extension, pass `"./clear"` or load it as a Buffer.
28
- *
29
- * `space.send(background(...))` is the canonical form; `space.background(...)`
30
- * is sugar attached via `PlatformDef.space.actions` (only typed on
31
- * `PlatformSpace<IMessageDef>`).
32
- *
33
- * `Background` is intentionally not a member of the universal `Content`
34
- * union — the `as unknown as Content` cast keeps the builder shape compatible
35
- * with the framework's `ContentBuilder.build(): Promise<Content>` signature.
36
- * The framework treats it as a fire-and-forget control signal at runtime.
37
- */
38
- declare function background(input: "clear"): ContentBuilder;
39
- declare function background(input: string | Buffer | URL, options?: {
40
- mimeType?: string;
41
- }): ContentBuilder;
42
-
43
- /**
44
- * Visible layout of a mini-app card. Mirrors Apple's
45
- * `MSMessageTemplateLayout`. At least one of `caption`, `subcaption`,
46
- * `trailingCaption`, `trailingSubcaption`, or `image` must be set so the
47
- * bubble is not empty — `summary` is the fallback text shown on surfaces
48
- * that cannot render the card (notifications, lock screen) and is not a
49
- * visible slot on its own. `image` and `imageTitle` must be set together;
50
- * `imageSubtitle` requires `image`.
51
- */
52
- declare const layoutSchema: z__default.ZodObject<{
53
- caption: z__default.ZodOptional<z__default.ZodString>;
54
- subcaption: z__default.ZodOptional<z__default.ZodString>;
55
- trailingCaption: z__default.ZodOptional<z__default.ZodString>;
56
- trailingSubcaption: z__default.ZodOptional<z__default.ZodString>;
57
- image: z__default.ZodOptional<z__default.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>>;
58
- imageTitle: z__default.ZodOptional<z__default.ZodString>;
59
- imageSubtitle: z__default.ZodOptional<z__default.ZodString>;
60
- summary: z__default.ZodOptional<z__default.ZodString>;
61
- }, z__default.core.$strip>;
62
- /**
63
- * iMessage-only mini-app card content. Lives entirely under the iMessage
64
- * provider — never enters the universal `Content` discriminated union. The
65
- * framework recognizes it via the generic content-level platform contract:
66
- *
67
- * - `__platform: "iMessage"` — `findUnsupportedPlatformContent` reads this tag
68
- * and warns-and-skips when a different platform receives it.
69
- *
70
- * Unlike `background` / `read`, this content is **not** `__fireAndForget`: it
71
- * produces a real outbound message, so the iMessage `send` handler narrows
72
- * back to `CustomizedMiniApp` via the `isCustomizedMiniApp` guard and returns
73
- * the resulting `ProviderMessageRecord` (rather than `void`).
74
- */
75
- declare const customizedMiniAppSchema: z__default.ZodObject<{
76
- type: z__default.ZodLiteral<"customized-mini-app">;
77
- __platform: z__default.ZodLiteral<"iMessage">;
78
- appName: z__default.ZodString;
79
- appStoreId: z__default.ZodOptional<z__default.ZodNumber>;
80
- extensionBundleId: z__default.ZodString;
81
- layout: z__default.ZodObject<{
82
- caption: z__default.ZodOptional<z__default.ZodString>;
83
- subcaption: z__default.ZodOptional<z__default.ZodString>;
84
- trailingCaption: z__default.ZodOptional<z__default.ZodString>;
85
- trailingSubcaption: z__default.ZodOptional<z__default.ZodString>;
86
- image: z__default.ZodOptional<z__default.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>>;
87
- imageTitle: z__default.ZodOptional<z__default.ZodString>;
88
- imageSubtitle: z__default.ZodOptional<z__default.ZodString>;
89
- summary: z__default.ZodOptional<z__default.ZodString>;
90
- }, z__default.core.$strip>;
91
- teamId: z__default.ZodString;
92
- url: z__default.ZodURL;
93
- }, z__default.core.$strip>;
94
- type CustomizedMiniApp = z__default.infer<typeof customizedMiniAppSchema>;
95
- type CustomizedMiniAppLayout = z__default.infer<typeof layoutSchema>;
96
- type CustomizedMiniAppInput = Omit<CustomizedMiniApp, "type" | "__platform">;
97
- /**
98
- * Construct a `customized-mini-app` content value. iMessage-only, remote-only.
99
- *
100
- * The layout is what recipients see in the bubble. `teamId` and
101
- * `extensionBundleId` identify the iMessage extension that receives `url` when
102
- * the recipient taps the card; the server constructs the matching
103
- * `MSMessageExtensionBalloonPlugin` plugin id from these values. `appStoreId`
104
- * is optional and only points recipients without the extension at its App
105
- * Store entry.
106
- *
107
- * `space.send(customizedMiniApp(...))` is the canonical form.
108
- *
109
- * `CustomizedMiniApp` is intentionally not a member of the universal `Content`
110
- * union — the `as unknown as Content` cast keeps the builder shape compatible
111
- * with the framework's `ContentBuilder.build(): Promise<Content>` signature.
112
- */
113
- declare function customizedMiniApp(input: CustomizedMiniAppInput): ContentBuilder;
114
-
115
- type IMessageMessageEffect = MessageEffect;
116
- declare function effect(input: ContentInput, messageEffect: IMessageMessageEffect): ContentBuilder;
117
-
118
- interface RemoteClient {
119
- client: AdvancedIMessage;
120
- phone: string;
121
- }
122
- type IMessageClient = IMessageSDK | RemoteClient[];
123
- declare const userSchema: z__default.ZodObject<{}, z__default.core.$strip>;
124
- declare const spaceSchema: z__default.ZodObject<{
125
- id: z__default.ZodString;
126
- type: z__default.ZodEnum<{
127
- dm: "dm";
128
- group: "group";
129
- }>;
130
- phone: z__default.ZodString;
131
- }, z__default.core.$strip>;
132
- type IMessageMessage = SchemaMessage<typeof userSchema, typeof spaceSchema> & {
133
- direction?: "inbound" | "outbound";
134
- partIndex?: number;
135
- parentId?: string;
136
- };
137
-
138
- declare const imessage: Platform<PlatformDef<"iMessage", z.ZodUnion<readonly [z.ZodObject<{
139
- local: z.ZodLiteral<true>;
140
- }, zod_v4_core.$strip>, z.ZodObject<{
141
- local: z.ZodDefault<z.ZodOptional<z.ZodLiteral<false>>>;
142
- clients: z.ZodOptional<z.ZodUnion<[z.ZodObject<{
143
- address: z.ZodString;
144
- token: z.ZodString;
145
- phone: z.ZodString;
146
- }, zod_v4_core.$strip>, z.ZodArray<z.ZodObject<{
147
- address: z.ZodString;
148
- token: z.ZodString;
149
- phone: z.ZodString;
150
- }, zod_v4_core.$strip>>]>>;
151
- }, zod_v4_core.$strip>]>, z.ZodType<object, unknown, zod_v4_core.$ZodTypeInternals<object, unknown>> | undefined, z.ZodObject<{
152
- id: z.ZodString;
153
- type: z.ZodEnum<{
154
- dm: "dm";
155
- group: "group";
156
- }>;
157
- phone: z.ZodString;
158
- }, zod_v4_core.$strip>, z.ZodObject<{
159
- phone: z.ZodOptional<z.ZodString>;
160
- }, zod_v4_core.$strip>, IMessageClient, {
161
- id: string;
162
- }, {
163
- id: string;
164
- type: "dm" | "group";
165
- phone: string;
166
- }, z.ZodObject<{
167
- partIndex: z.ZodOptional<z.ZodNumber>;
168
- parentId: z.ZodOptional<z.ZodString>;
169
- }, zod_v4_core.$strip>, IMessageMessage, undefined, {
170
- background: (space: Space, input: BackgroundInput, opts?: {
171
- mimeType?: string;
172
- }) => Promise<void>;
173
- }, Record<never, never>, {
174
- getMessage: ({ client }: {
175
- client: IMessageClient;
176
- config: {
177
- local: true;
178
- } | {
179
- local: false;
180
- clients?: {
181
- address: string;
182
- token: string;
183
- phone: string;
184
- } | {
185
- address: string;
186
- token: string;
187
- phone: string;
188
- }[] | undefined;
189
- };
190
- store: Store;
191
- }, space: {
192
- id: string;
193
- type: "dm" | "group";
194
- phone: string;
195
- } & {
196
- id: string;
197
- __platform: string;
198
- }, messageId: string) => Promise<IMessageMessage | undefined>;
199
- getAttachment: ({ client }: {
200
- client: IMessageClient;
201
- }, guid: string, phone?: string) => Promise<Attachment | undefined>;
202
- }>> & Readonly<{
203
- effect: {
204
- message: {
205
- readonly slam: "com.apple.MobileSMS.expressivesend.impact";
206
- readonly loud: "com.apple.MobileSMS.expressivesend.loud";
207
- readonly gentle: "com.apple.MobileSMS.expressivesend.gentle";
208
- readonly invisible: "com.apple.MobileSMS.expressivesend.invisibleink";
209
- readonly confetti: "com.apple.messages.effect.CKConfettiEffect";
210
- readonly fireworks: "com.apple.messages.effect.CKFireworksEffect";
211
- readonly balloons: "com.apple.messages.effect.CKBalloonEffect";
212
- readonly heart: "com.apple.messages.effect.CKHeartEffect";
213
- readonly lasers: "com.apple.messages.effect.CKLasersEffect";
214
- readonly celebration: "com.apple.messages.effect.CKHappyBirthdayEffect";
215
- readonly sparkles: "com.apple.messages.effect.CKSparklesEffect";
216
- readonly spotlight: "com.apple.messages.effect.CKSpotlightEffect";
217
- readonly echo: "com.apple.messages.effect.CKEchoEffect";
218
- };
219
- };
220
- }>;
221
-
222
- export { type BackgroundInput, type CustomizedMiniApp, type CustomizedMiniAppInput, type CustomizedMiniAppLayout, type IMessageMessageEffect, background, customizedMiniApp, effect, imessage };
1
+ export * from "@spectrum-ts/imessage";
@@ -1,25 +1,2 @@
1
- import { createRequire as __spectrumCreateRequire } from "node:module"; const require = __spectrumCreateRequire(import.meta.url);
2
- import {
3
- background,
4
- customizedMiniApp,
5
- effect,
6
- imessage
7
- } from "../../chunk-NLMQ75LH.js";
8
- import "../../chunk-ZR3TKZMT.js";
9
- import "../../chunk-LZXPLXZF.js";
10
- import "../../chunk-2D27WW5B.js";
11
- import "../../chunk-A37PM5N2.js";
12
- import "../../chunk-6UZFVXQF.js";
13
- import "../../chunk-3GEJYGZK.js";
14
- import "../../chunk-5XEFJBN2.js";
15
- import {
16
- read
17
- } from "../../chunk-B52VPQO3.js";
18
- import "../../chunk-UXAKIXVM.js";
19
- export {
20
- background,
21
- customizedMiniApp,
22
- effect,
23
- imessage,
24
- read
25
- };
1
+ export * from "@spectrum-ts/imessage";
2
+ export {};
@@ -1,19 +1,6 @@
1
- export { imessage } from './imessage/index.js';
2
- export { slack } from './slack/index.js';
3
- export { telegram } from './telegram/index.js';
4
- export { terminal } from './terminal/index.js';
5
- export { whatsappBusiness } from './whatsapp-business/index.js';
6
- import '../types-CyfLJXgu.js';
7
- import 'hotscript';
8
- import 'zod';
9
- import 'zod/v4/core';
10
- import '../attachment-CnivEhr6.js';
11
- import '../read-C4uvozGX.js';
12
- import '@photon-ai/advanced-imessage';
13
- import '@photon-ai/imessage-kit';
14
- import '@photon-ai/slack';
15
- import '@photon-ai/telegram-ts';
16
- import '../types-ZgFTj5hJ.js';
17
- import 'node:child_process';
18
- import 'node:net';
19
- import '@photon-ai/whatsapp-business';
1
+ import { imessage } from "@spectrum-ts/imessage";
2
+ import { slack } from "@spectrum-ts/slack";
3
+ import { telegram } from "@spectrum-ts/telegram";
4
+ import { terminal } from "@spectrum-ts/terminal";
5
+ import { whatsappBusiness } from "@spectrum-ts/whatsapp-business";
6
+ export { imessage, slack, telegram, terminal, whatsappBusiness };
@@ -1,34 +1,6 @@
1
- import { createRequire as __spectrumCreateRequire } from "node:module"; const require = __spectrumCreateRequire(import.meta.url);
2
- import {
3
- telegram
4
- } from "../chunk-N6THJDZV.js";
5
- import {
6
- terminal
7
- } from "../chunk-ARL2NOBO.js";
8
- import {
9
- whatsappBusiness
10
- } from "../chunk-DMPDLSFU.js";
11
- import "../chunk-34FQGGD7.js";
12
- import "../chunk-FAIFTUV2.js";
13
- import {
14
- imessage
15
- } from "../chunk-NLMQ75LH.js";
16
- import "../chunk-ZR3TKZMT.js";
17
- import "../chunk-LZXPLXZF.js";
18
- import "../chunk-2D27WW5B.js";
19
- import "../chunk-A37PM5N2.js";
20
- import "../chunk-6UZFVXQF.js";
21
- import {
22
- slack
23
- } from "../chunk-WXLQNANA.js";
24
- import "../chunk-3GEJYGZK.js";
25
- import "../chunk-5XEFJBN2.js";
26
- import "../chunk-B52VPQO3.js";
27
- import "../chunk-UXAKIXVM.js";
28
- export {
29
- imessage,
30
- slack,
31
- telegram,
32
- terminal,
33
- whatsappBusiness
34
- };
1
+ import { imessage } from "@spectrum-ts/imessage";
2
+ import { slack } from "@spectrum-ts/slack";
3
+ import { telegram } from "@spectrum-ts/telegram";
4
+ import { terminal } from "@spectrum-ts/terminal";
5
+ import { whatsappBusiness } from "@spectrum-ts/whatsapp-business";
6
+ export { imessage, slack, telegram, terminal, whatsappBusiness };
@@ -1,46 +1 @@
1
- import { a as SchemaMessage, P as Platform, b as PlatformDef } from '../../types-CyfLJXgu.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
- teamId: z.ZodString;
34
- }, zod_v4_core.$strip>, _photon_ai_slack.SlackClient, {
35
- id: string;
36
- }, {
37
- id: string;
38
- teamId: string;
39
- }, z.ZodObject<{
40
- isFromMe: z.ZodBoolean;
41
- subtype: z.ZodOptional<z.ZodString>;
42
- threadTs: z.ZodOptional<z.ZodString>;
43
- ts: z.ZodOptional<z.ZodString>;
44
- }, zod_v4_core.$strip>, SlackMessage, undefined, Record<never, never>, Record<never, never>, Record<never, never>>> & Readonly<Record<never, never>>;
45
-
46
- export { slack };
1
+ export * from "@spectrum-ts/slack";
@@ -1,11 +1,2 @@
1
- import { createRequire as __spectrumCreateRequire } from "node:module"; const require = __spectrumCreateRequire(import.meta.url);
2
- import {
3
- slack
4
- } from "../../chunk-WXLQNANA.js";
5
- import "../../chunk-3GEJYGZK.js";
6
- import "../../chunk-5XEFJBN2.js";
7
- import "../../chunk-B52VPQO3.js";
8
- import "../../chunk-UXAKIXVM.js";
9
- export {
10
- slack
11
- };
1
+ export * from "@spectrum-ts/slack";
2
+ export {};
@@ -1,45 +1 @@
1
- import { P as Platform, b as PlatformDef, g as ProviderMessage } from '../../types-CyfLJXgu.js';
2
- import * as _photon_ai_telegram_ts from '@photon-ai/telegram-ts';
3
- import * as zod_v4_core from 'zod/v4/core';
4
- import * as z from 'zod';
5
- import z__default from 'zod';
6
- import { F as FusorClient } from '../../types-ZgFTj5hJ.js';
7
- import 'hotscript';
8
-
9
- interface TelegramSpace {
10
- id: string;
11
- }
12
-
13
- declare const configSchema: z__default.ZodObject<{
14
- botToken: z__default.ZodString;
15
- webhookSecret: z__default.ZodOptional<z__default.ZodString>;
16
- baseUrl: z__default.ZodDefault<z__default.ZodURL>;
17
- }, z__default.core.$strip>;
18
- type TelegramConfig = z__default.infer<typeof configSchema>;
19
-
20
- /**
21
- * Telegram provider for Spectrum.
22
- *
23
- * Inbound is delivered through Fusor: `createClient` returns a `fusor(...)`
24
- * client whose `verify` checks the Telegram webhook secret token and parses the
25
- * `Update` (pure parsing — no client). The `messages` handler reads `config`
26
- * from its ctx and builds a photon client inline only to download media bytes.
27
- * Outbound (`send`) also builds a photon client inline. Both go through
28
- * `@photon-ai/telegram-ts`. Drop `telegram.config({...})` into
29
- * `Spectrum({ providers: [...] })`.
30
- *
31
- * In cloud mode (`projectConfig` present), `createClient` also self-registers
32
- * the bot's webhook against the Fusor edge for the project slug — see
33
- * `ensureWebhook`. Without a slug (local/direct mode) registration is skipped.
34
- */
35
- declare const telegram: Platform<PlatformDef<"telegram", z.ZodObject<{
36
- botToken: z.ZodString;
37
- webhookSecret: z.ZodOptional<z.ZodString>;
38
- baseUrl: z.ZodDefault<z.ZodURL>;
39
- }, zod_v4_core.$strip>, z.ZodType<object, unknown, zod_v4_core.$ZodTypeInternals<object, unknown>> | undefined, z.ZodType<object, unknown, zod_v4_core.$ZodTypeInternals<object, unknown>> | undefined, z.ZodType<object, unknown, zod_v4_core.$ZodTypeInternals<object, unknown>> | undefined, FusorClient<_photon_ai_telegram_ts.Update>, {
40
- id: string;
41
- }, TelegramSpace, undefined, ProviderMessage<{
42
- id: string;
43
- }, TelegramSpace, Record<never, never>>, undefined, Record<never, never>, Record<never, never>, Record<never, never>>> & Readonly<Record<never, never>>;
44
-
45
- export { type TelegramConfig, telegram };
1
+ export * from "@spectrum-ts/telegram";
@@ -1,13 +1,2 @@
1
- import { createRequire as __spectrumCreateRequire } from "node:module"; const require = __spectrumCreateRequire(import.meta.url);
2
- import {
3
- telegram
4
- } from "../../chunk-N6THJDZV.js";
5
- import "../../chunk-34FQGGD7.js";
6
- import "../../chunk-FAIFTUV2.js";
7
- import "../../chunk-LZXPLXZF.js";
8
- import "../../chunk-6UZFVXQF.js";
9
- import "../../chunk-B52VPQO3.js";
10
- import "../../chunk-UXAKIXVM.js";
11
- export {
12
- telegram
13
- };
1
+ export * from "@spectrum-ts/telegram";
2
+ export {};
@@ -1,119 +1 @@
1
- import { P as Platform, b as PlatformDef, f as contentSchema } from '../../types-CyfLJXgu.js';
2
- import { ChildProcess } from 'node:child_process';
3
- import z__default from 'zod';
4
- import { Socket } from 'node:net';
5
- import 'hotscript';
6
-
7
- type ProtocolContent = {
8
- type: "text";
9
- text: string;
10
- } | {
11
- type: "attachment";
12
- name: string;
13
- mimeType: string;
14
- size?: number;
15
- bytes?: string;
16
- path?: string;
17
- } | {
18
- type: "voice";
19
- name?: string;
20
- mimeType: string;
21
- size?: number;
22
- bytes?: string;
23
- path?: string;
24
- } | {
25
- type: "contact";
26
- name?: {
27
- formatted?: string;
28
- first?: string;
29
- last?: string;
30
- };
31
- vcard?: string;
32
- } | {
33
- type: "custom";
34
- raw: unknown;
35
- };
36
- interface ProtocolMessageNotification {
37
- content: ProtocolContent;
38
- id: string;
39
- replyTo?: {
40
- messageId: string;
41
- };
42
- senderId: string;
43
- spaceId: string;
44
- timestamp: string;
45
- }
46
- interface ProtocolReactionNotification {
47
- messageId: string;
48
- reaction: string;
49
- senderId: string;
50
- spaceId: string;
51
- timestamp: string;
52
- }
53
- declare class RpcSession {
54
- private readonly decoder;
55
- private nextId;
56
- private readonly pending;
57
- private onNotify;
58
- private onClose;
59
- private closed;
60
- private readonly socket;
61
- constructor(socket: Socket);
62
- handleNotifications(h: (method: string, params: unknown) => void): void;
63
- onClosed(h: () => void): void;
64
- request<T = unknown>(method: string, params?: unknown, timeoutMs?: number): Promise<T>;
65
- notify(method: string, params?: unknown): void;
66
- close(): void;
67
- private handle;
68
- private shutdown;
69
- }
70
-
71
- interface ConsoleHijack {
72
- restore: () => void;
73
- }
74
- type InboundEvent = {
75
- kind: "message";
76
- value: ProtocolMessageNotification;
77
- } | {
78
- kind: "reaction";
79
- value: ProtocolReactionNotification;
80
- };
81
- interface TerminalClient {
82
- events: AsyncIterable<InboundEvent>;
83
- hijack: ConsoleHijack;
84
- knownChats: Set<string>;
85
- nextChatIndex: number;
86
- proc: ChildProcess;
87
- session: RpcSession;
88
- }
89
- type SpectrumContent = z__default.infer<typeof contentSchema>;
90
- interface TerminalInboundMessage {
91
- content: SpectrumContent;
92
- id: string;
93
- replyTo?: {
94
- messageId: string;
95
- };
96
- sender: {
97
- id: string;
98
- };
99
- space: {
100
- id: string;
101
- };
102
- timestamp: Date;
103
- }
104
- declare const terminal: Platform<PlatformDef<"Terminal", z__default.ZodObject<{
105
- commands: z__default.ZodOptional<z__default.ZodArray<z__default.ZodObject<{
106
- name: z__default.ZodString;
107
- description: z__default.ZodOptional<z__default.ZodString>;
108
- }, z__default.core.$strip>>>;
109
- }, z__default.core.$strip>, z__default.ZodType<object, unknown, z__default.core.$ZodTypeInternals<object, unknown>> | undefined, z__default.ZodType<object, unknown, z__default.core.$ZodTypeInternals<object, unknown>> | undefined, z__default.ZodType<object, unknown, z__default.core.$ZodTypeInternals<object, unknown>> | undefined, TerminalClient, {
110
- id: string;
111
- }, {
112
- id: string;
113
- }, z__default.ZodObject<{
114
- replyTo: z__default.ZodOptional<z__default.ZodObject<{
115
- messageId: z__default.ZodString;
116
- }, z__default.core.$strip>>;
117
- }, z__default.core.$strip>, TerminalInboundMessage, undefined, Record<never, never>, Record<never, never>, Record<never, never>>> & Readonly<Record<never, never>>;
118
-
119
- export { terminal };
1
+ export * from "@spectrum-ts/terminal";
@@ -1,13 +1,2 @@
1
- import { createRequire as __spectrumCreateRequire } from "node:module"; const require = __spectrumCreateRequire(import.meta.url);
2
- import {
3
- terminal
4
- } from "../../chunk-ARL2NOBO.js";
5
- import "../../chunk-FAIFTUV2.js";
6
- import "../../chunk-A37PM5N2.js";
7
- import "../../chunk-6UZFVXQF.js";
8
- import "../../chunk-5XEFJBN2.js";
9
- import "../../chunk-B52VPQO3.js";
10
- import "../../chunk-UXAKIXVM.js";
11
- export {
12
- terminal
13
- };
1
+ export * from "@spectrum-ts/terminal";
2
+ export {};
@@ -1,27 +1 @@
1
- import { a as SchemaMessage, P as Platform, b as PlatformDef } from '../../types-CyfLJXgu.js';
2
- import { WhatsAppClient } from '@photon-ai/whatsapp-business';
3
- import * as z from 'zod';
4
- import z__default from 'zod';
5
- import * as zod_v4_core from 'zod/v4/core';
6
- import 'hotscript';
7
-
8
- type WhatsAppClients = WhatsAppClient[];
9
- declare const userSchema: z__default.ZodObject<{}, z__default.core.$strip>;
10
- declare const spaceSchema: z__default.ZodObject<{
11
- id: z__default.ZodString;
12
- }, z__default.core.$strip>;
13
- type WhatsAppMessage = SchemaMessage<typeof userSchema, typeof spaceSchema>;
14
-
15
- declare const whatsappBusiness: Platform<PlatformDef<"WhatsApp Business", z.ZodUnion<readonly [z.ZodObject<{
16
- accessToken: z.ZodString;
17
- appSecret: z.ZodOptional<z.ZodString>;
18
- phoneNumberId: z.ZodString;
19
- }, zod_v4_core.$strip>, z.ZodObject<{}, zod_v4_core.$strict>]>, z.ZodType<object, unknown, zod_v4_core.$ZodTypeInternals<object, unknown>> | undefined, z.ZodObject<{
20
- id: z.ZodString;
21
- }, zod_v4_core.$strip>, z.ZodType<object, unknown, zod_v4_core.$ZodTypeInternals<object, unknown>> | undefined, WhatsAppClients, {
22
- id: string;
23
- }, {
24
- id: string;
25
- }, undefined, WhatsAppMessage, undefined, Record<never, never>, Record<never, never>, Record<never, never>>> & Readonly<Record<never, never>>;
26
-
27
- export { whatsappBusiness };
1
+ export * from "@spectrum-ts/whatsapp-business";
@@ -1,14 +1,2 @@
1
- import { createRequire as __spectrumCreateRequire } from "node:module"; const require = __spectrumCreateRequire(import.meta.url);
2
- import {
3
- whatsappBusiness
4
- } from "../../chunk-DMPDLSFU.js";
5
- import "../../chunk-2D27WW5B.js";
6
- import "../../chunk-A37PM5N2.js";
7
- import "../../chunk-6UZFVXQF.js";
8
- import "../../chunk-3GEJYGZK.js";
9
- import "../../chunk-5XEFJBN2.js";
10
- import "../../chunk-B52VPQO3.js";
11
- import "../../chunk-UXAKIXVM.js";
12
- export {
13
- whatsappBusiness
14
- };
1
+ export * from "@spectrum-ts/whatsapp-business";
2
+ export {};