spectrum-ts 4.1.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 -0
  5. package/dist/elysia.js +2 -0
  6. package/dist/express.d.ts +1 -0
  7. package/dist/express.js +2 -0
  8. package/dist/hono.d.ts +1 -0
  9. package/dist/hono.js +2 -0
  10. package/dist/index.d.ts +1 -2837
  11. package/dist/index.js +2 -3373
  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 +23 -26
  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-3KWFP4L2.js +0 -864
  32. package/dist/chunk-5XEFJBN2.js +0 -197
  33. package/dist/chunk-6UZFVXQF.js +0 -374
  34. package/dist/chunk-A37PM5N2.js +0 -91
  35. package/dist/chunk-B52VPQO3.js +0 -1379
  36. package/dist/chunk-DMT6BFJV.js +0 -2980
  37. package/dist/chunk-FAIFTUV2.js +0 -139
  38. package/dist/chunk-IM5ADDZS.js +0 -887
  39. package/dist/chunk-LZXPLXZF.js +0 -35
  40. package/dist/chunk-U3QQ56YZ.js +0 -929
  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-BIta6Kxi.d.ts +0 -82
  46. package/dist/types-CyfLJXgu.d.ts +0 -1530
package/README.md CHANGED
@@ -1,80 +1,42 @@
1
- <div align="center">
2
- <h1>Spectrum</h1>
3
- <p><strong>Bring agents to any interface.</strong></p>
4
-
5
- Photon (photon.codes) builds Spectrum, a multi-channel agent framework that makes AI agents reachable over real conversation surfaces like iMessage, SMS, and email instead of trapping them in web chat.
6
-
7
- <p>
8
- <a href="https://www.npmjs.com/package/spectrum-ts"><img src="https://img.shields.io/npm/v/spectrum-ts.svg?style=flat&colorA=1a1a1a&colorB=3178c6" alt="npm version" /></a>
9
- <a href="https://www.npmjs.com/package/spectrum-ts"><img src="https://img.shields.io/npm/dm/spectrum-ts.svg?style=flat&colorA=1a1a1a&colorB=3178c6" alt="npm downloads" /></a>
10
- <a href="https://github.com/photon-hq/spectrum-ts/blob/main/LICENSE"><img src="https://img.shields.io/npm/l/spectrum-ts.svg?style=flat&colorA=1a1a1a&colorB=3178c6" alt="license" /></a>
11
- <a href="https://www.typescriptlang.org/"><img src="https://img.shields.io/badge/TypeScript-5+-3178c6?style=flat&colorA=1a1a1a&colorB=3178c6" alt="TypeScript" /></a>
12
- <a href="https://github.com/photon-hq/spectrum-ts/stargazers"><img src="https://img.shields.io/github/stars/photon-hq/spectrum-ts.svg?style=flat&colorA=1a1a1a&colorB=3178c6" alt="github stars" /></a>
13
- </p>
14
- </div>
1
+ # spectrum-ts
15
2
 
16
- ## About Photon
3
+ Bring agents to any interface — a unified messaging SDK for TypeScript.
17
4
 
18
- **[Photon](https://photon.codes)** builds infrastructure for AI agents that operate over real communication channels.
5
+ `spectrum-ts` is the **batteries-included** package: it bundles the runtime
6
+ ([`@spectrum-ts/core`](https://npmjs.com/package/@spectrum-ts/core)) plus
7
+ every official provider, so one install gets you everything.
19
8
 
20
- Spectrum is Photon’s open-source multi-channel agent framework, enabling AI agents to communicate through interfaces people already use—such as iMessage, SMS, email, Slack, Discord, and voice—instead of being confined to web chat.
9
+ ```sh
10
+ bun add spectrum-ts
11
+ ```
21
12
 
22
- Learn more at **https://photon.codes**.
13
+ ```ts
14
+ import { Spectrum } from "spectrum-ts";
15
+ import { telegram } from "spectrum-ts/providers/telegram";
23
16
 
24
- ## Getting Started
17
+ const app = await Spectrum({ providers: [telegram.config({ botToken: "…" })] });
18
+ ```
25
19
 
26
- The fastest way to ship is with **Spectrum Cloud** — hosted infrastructure for platforms like iMessage, with credentials ready in minutes.
20
+ ## Lean installs
27
21
 
28
- 1. Sign up at **[app.photon.codes](https://app.photon.codes)** to get your project ID and secret.
29
- 2. Install the SDK:
22
+ If you only use a couple of platforms and want a smaller install, depend on the
23
+ runtime and just the providers you need instead of this metapackage:
30
24
 
31
- ```bash
32
- bun add spectrum-ts
33
- ```
25
+ ```sh
26
+ bun add @spectrum-ts/core @spectrum-ts/telegram
27
+ ```
34
28
 
35
- 3. Start your app:
36
-
37
- ```typescript
38
- import { Spectrum } from "spectrum-ts";
39
- import { imessage } from "spectrum-ts/providers/imessage";
40
-
41
- const app = await Spectrum({
42
- projectId: process.env.PROJECT_ID,
43
- projectSecret: process.env.PROJECT_SECRET,
44
- providers: [imessage.config()],
45
- });
46
-
47
- for await (const [space, message] of app.messages) {
48
- await space.responding(async () => {
49
- await message.reply("Hello from Spectrum.");
50
- });
51
- }
52
- ```
53
-
54
- Spectrum also runs fully standalone — you can connect to a local iMessage database, bring your own gRPC endpoints, or build your own platform provider. See the [docs](https://docs.photon.codes) for self-hosted setups.
55
-
56
- ## Documentation
57
-
58
- Visit **[docs.photon.codes](https://docs.photon.codes)** to view the full documentation.
59
-
60
- ## Platforms
29
+ ```ts
30
+ import { Spectrum } from "@spectrum-ts/core";
31
+ import { telegram } from "@spectrum-ts/telegram";
32
+ ```
61
33
 
62
34
  | Platform | Package |
63
35
  |----------|---------|
64
- | iMessage | `spectrum-ts/providers/imessage` |
65
- | WhatsApp | `spectrum-ts/providers/whatsapp` |
66
- | Telegram | `spectrum-ts/providers/telegram` |
67
- | Terminal | `spectrum-ts/providers/terminal` |
68
- | Custom | `definePlatform` from `spectrum-ts` |
69
-
70
- ## Issues
71
-
72
- Found a bug or have a feature request? Please [open an issue](https://github.com/photon-hq/spectrum-ts/issues) on GitHub. Before filing, search existing issues to avoid duplicates.
73
-
74
- ## Contributing
75
-
76
- Contributions are welcome. Please read [CONTRIBUTING.md](./CONTRIBUTING.md) for details on our code of conduct and the process for submitting pull requests.
77
-
78
- ## License
36
+ | iMessage | [`@spectrum-ts/imessage`](https://npmjs.com/package/@spectrum-ts/imessage) |
37
+ | Telegram | [`@spectrum-ts/telegram`](https://npmjs.com/package/@spectrum-ts/telegram) |
38
+ | Slack | [`@spectrum-ts/slack`](https://npmjs.com/package/@spectrum-ts/slack) |
39
+ | WhatsApp Business | [`@spectrum-ts/whatsapp-business`](https://npmjs.com/package/@spectrum-ts/whatsapp-business) |
40
+ | Terminal | [`@spectrum-ts/terminal`](https://npmjs.com/package/@spectrum-ts/terminal) |
79
41
 
80
- [MIT](./LICENSE) © [Photon](https://photon.codes)
42
+ See the [documentation](https://photon.codes/spectrum) for the full guide.
@@ -1,6 +1 @@
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
- import 'zod';
5
- import 'vcf';
6
- import 'hotscript';
1
+ export * from "@spectrum-ts/core/authoring";
package/dist/authoring.js CHANGED
@@ -1,36 +1,2 @@
1
- import { createRequire as __spectrumCreateRequire } from "node:module"; const require = __spectrumCreateRequire(import.meta.url);
2
- import {
3
- asRichlink
4
- } from "./chunk-ZR3TKZMT.js";
5
- import {
6
- asGroup
7
- } from "./chunk-LZXPLXZF.js";
8
- import {
9
- asVoice
10
- } from "./chunk-FAIFTUV2.js";
11
- import {
12
- asPoll,
13
- asPollOption
14
- } from "./chunk-2D27WW5B.js";
15
- import {
16
- asContact
17
- } from "./chunk-A37PM5N2.js";
18
- import "./chunk-6UZFVXQF.js";
19
- import {
20
- asAttachment,
21
- asCustom,
22
- asReaction,
23
- asText
24
- } from "./chunk-UXAKIXVM.js";
25
- export {
26
- asAttachment,
27
- asContact,
28
- asCustom,
29
- asGroup,
30
- asPoll,
31
- asPollOption,
32
- asReaction,
33
- asRichlink,
34
- asText,
35
- asVoice
36
- };
1
+ export * from "@spectrum-ts/core/authoring";
2
+ export {};
@@ -0,0 +1 @@
1
+ export * from "@spectrum-ts/core/elysia";
package/dist/elysia.js ADDED
@@ -0,0 +1,2 @@
1
+ export * from "@spectrum-ts/core/elysia";
2
+ export {};
@@ -0,0 +1 @@
1
+ export * from "@spectrum-ts/core/express";
@@ -0,0 +1,2 @@
1
+ export * from "@spectrum-ts/core/express";
2
+ export {};
package/dist/hono.d.ts ADDED
@@ -0,0 +1 @@
1
+ export * from "@spectrum-ts/core/hono";
package/dist/hono.js ADDED
@@ -0,0 +1,2 @@
1
+ export * from "@spectrum-ts/core/hono";
2
+ export {};