spectrum-ts 1.2.0 → 1.2.1

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 (3) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +70 -0
  3. package/package.json +1 -1
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License Copyright (c) 2025 Photon AI
2
+
3
+ Permission is hereby granted,
4
+ free of charge, to any person obtaining a copy of this software and associated
5
+ documentation files (the "Software"), to deal in the Software without
6
+ restriction, including without limitation the rights to use, copy, modify, merge,
7
+ publish, distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to the
9
+ following conditions:
10
+
11
+ The above copyright notice and this permission notice
12
+ (including the next paragraph) shall be included in all copies or substantial
13
+ portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF
16
+ ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
17
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO
18
+ EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
19
+ OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
20
+ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,70 @@
1
+ <div align="center">
2
+ <h1>Spectrum</h1>
3
+ <p><strong>Bring agents to any interface.</strong></p>
4
+ <p>
5
+ <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>
6
+ <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>
7
+ <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>
8
+ <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>
9
+ <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>
10
+ </p>
11
+ </div>
12
+
13
+ Spectrum is a unified messaging SDK for TypeScript. Write your agent logic once and deliver it across every messaging platform — iMessage, WhatsApp, terminal, or your own — through one fully type-safe interface.
14
+
15
+ ## Getting Started
16
+
17
+ The fastest way to ship is with **Spectrum Cloud** — hosted infrastructure for platforms like iMessage, with credentials ready in minutes.
18
+
19
+ 1. Sign up at **[app.photon.codes](https://app.photon.codes)** to get your project ID and secret.
20
+ 2. Install the SDK:
21
+
22
+ ```bash
23
+ bun add spectrum-ts
24
+ ```
25
+
26
+ 3. Start your app:
27
+
28
+ ```typescript
29
+ import { Spectrum } from "spectrum-ts";
30
+ import { imessage } from "spectrum-ts/providers/imessage";
31
+
32
+ const app = await Spectrum({
33
+ projectId: process.env.PROJECT_ID,
34
+ projectSecret: process.env.PROJECT_SECRET,
35
+ providers: [imessage.config()],
36
+ });
37
+
38
+ for await (const [space, message] of app.messages) {
39
+ await space.responding(async () => {
40
+ await message.reply("Hello from Spectrum.");
41
+ });
42
+ }
43
+ ```
44
+
45
+ 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.
46
+
47
+ ## Documentation
48
+
49
+ Visit **[docs.photon.codes](https://docs.photon.codes)** to view the full documentation.
50
+
51
+ ## Platforms
52
+
53
+ | Platform | Package |
54
+ |----------|---------|
55
+ | iMessage | `spectrum-ts/providers/imessage` |
56
+ | WhatsApp | `spectrum-ts/providers/whatsapp` |
57
+ | Terminal | `spectrum-ts/providers/terminal` |
58
+ | Custom | `definePlatform` from `spectrum-ts` |
59
+
60
+ ## Issues
61
+
62
+ 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.
63
+
64
+ ## Contributing
65
+
66
+ Contributions are welcome. Please read [CONTRIBUTING.md](./CONTRIBUTING.md) for details on our code of conduct and the process for submitting pull requests.
67
+
68
+ ## License
69
+
70
+ [MIT](./LICENSE) © [Photon](https://photon.codes)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "spectrum-ts",
3
- "version": "1.2.0",
3
+ "version": "1.2.1",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",