@spectrum-ts/core 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.
- package/LICENSE +21 -0
- package/README.md +84 -0
- package/dist/attachment-a_lrhg6w.d.ts +7558 -0
- package/dist/authoring.d.ts +94 -0
- package/dist/authoring.js +389 -0
- package/dist/elysia.d.ts +92 -0
- package/dist/elysia.js +32 -0
- package/dist/express.d.ts +60 -0
- package/dist/express.js +37 -0
- package/dist/hono.d.ts +59 -0
- package/dist/hono.js +27 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +4529 -0
- package/dist/stream-BLWs7NJ5.js +1489 -0
- package/package.json +78 -0
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,84 @@
|
|
|
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>
|
|
15
|
+
|
|
16
|
+
## About Photon
|
|
17
|
+
|
|
18
|
+
**[Photon](https://photon.codes)** builds infrastructure for AI agents that operate over real communication channels.
|
|
19
|
+
|
|
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.
|
|
21
|
+
|
|
22
|
+
Learn more at **https://photon.codes**.
|
|
23
|
+
|
|
24
|
+
## Getting Started
|
|
25
|
+
|
|
26
|
+
The fastest way to ship is with **Spectrum Cloud** — hosted infrastructure for platforms like iMessage, with credentials ready in minutes.
|
|
27
|
+
|
|
28
|
+
1. Sign up at **[app.photon.codes](https://app.photon.codes)** to get your project ID and secret.
|
|
29
|
+
2. Install the SDK (`spectrum-ts` is batteries-included — the runtime plus
|
|
30
|
+
every official provider):
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
bun add spectrum-ts
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
3. Start your app:
|
|
37
|
+
|
|
38
|
+
```typescript
|
|
39
|
+
import { Spectrum } from "spectrum-ts";
|
|
40
|
+
import { imessage } from "spectrum-ts/providers/imessage";
|
|
41
|
+
|
|
42
|
+
const app = await Spectrum({
|
|
43
|
+
projectId: process.env.PROJECT_ID,
|
|
44
|
+
projectSecret: process.env.PROJECT_SECRET,
|
|
45
|
+
providers: [imessage.config()],
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
for await (const [space, message] of app.messages) {
|
|
49
|
+
await space.responding(async () => {
|
|
50
|
+
await message.reply("Hello from Spectrum.");
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
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.
|
|
56
|
+
|
|
57
|
+
## Documentation
|
|
58
|
+
|
|
59
|
+
Visit **[docs.photon.codes](https://docs.photon.codes)** to view the full documentation.
|
|
60
|
+
|
|
61
|
+
## Platforms
|
|
62
|
+
|
|
63
|
+
| Platform | Package |
|
|
64
|
+
|----------|---------|
|
|
65
|
+
| iMessage | [`@spectrum-ts/imessage`](https://npmjs.com/package/@spectrum-ts/imessage) |
|
|
66
|
+
| WhatsApp Business | [`@spectrum-ts/whatsapp-business`](https://npmjs.com/package/@spectrum-ts/whatsapp-business) |
|
|
67
|
+
| Telegram | [`@spectrum-ts/telegram`](https://npmjs.com/package/@spectrum-ts/telegram) |
|
|
68
|
+
| Slack | [`@spectrum-ts/slack`](https://npmjs.com/package/@spectrum-ts/slack) |
|
|
69
|
+
| Terminal | [`@spectrum-ts/terminal`](https://npmjs.com/package/@spectrum-ts/terminal) |
|
|
70
|
+
| Custom | `definePlatform` from `spectrum-ts` |
|
|
71
|
+
|
|
72
|
+
`bun add spectrum-ts` is batteries-included (all providers). For a smaller install, depend on the runtime plus only the providers you use — `bun add @spectrum-ts/core @spectrum-ts/telegram` — and import from the scoped packages directly. Either way the `spectrum-ts/providers/<platform>` import paths work as long as the matching provider package is installed; if it isn't, the import fails at build/startup naming the exact package to add.
|
|
73
|
+
|
|
74
|
+
## Issues
|
|
75
|
+
|
|
76
|
+
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.
|
|
77
|
+
|
|
78
|
+
## Contributing
|
|
79
|
+
|
|
80
|
+
Contributions are welcome. Please read [CONTRIBUTING.md](./CONTRIBUTING.md) for details on our code of conduct and the process for submitting pull requests.
|
|
81
|
+
|
|
82
|
+
## License
|
|
83
|
+
|
|
84
|
+
[MIT](./LICENSE) © [Photon](https://photon.codes)
|