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.
- package/README.md +29 -67
- package/dist/authoring.d.ts +1 -6
- package/dist/authoring.js +2 -36
- package/dist/elysia.d.ts +1 -0
- package/dist/elysia.js +2 -0
- package/dist/express.d.ts +1 -0
- package/dist/express.js +2 -0
- package/dist/hono.d.ts +1 -0
- package/dist/hono.js +2 -0
- package/dist/index.d.ts +1 -2837
- package/dist/index.js +2 -3373
- package/dist/manifest.json +5 -5
- package/dist/providers/imessage/index.d.ts +1 -222
- package/dist/providers/imessage/index.js +2 -25
- package/dist/providers/index.d.ts +6 -19
- package/dist/providers/index.js +6 -34
- package/dist/providers/slack/index.d.ts +1 -46
- package/dist/providers/slack/index.js +2 -11
- package/dist/providers/telegram/index.d.ts +1 -45
- package/dist/providers/telegram/index.js +2 -13
- package/dist/providers/terminal/index.d.ts +1 -119
- package/dist/providers/terminal/index.js +2 -13
- package/dist/providers/whatsapp-business/index.d.ts +1 -27
- package/dist/providers/whatsapp-business/index.js +2 -14
- package/package.json +23 -26
- package/dist/attachment-CnivEhr6.d.ts +0 -29
- package/dist/authoring-b9AhXgPI.d.ts +0 -304
- package/dist/chunk-2D27WW5B.js +0 -63
- package/dist/chunk-34FQGGD7.js +0 -34
- package/dist/chunk-3GEJYGZK.js +0 -84
- package/dist/chunk-3KWFP4L2.js +0 -864
- package/dist/chunk-5XEFJBN2.js +0 -197
- package/dist/chunk-6UZFVXQF.js +0 -374
- package/dist/chunk-A37PM5N2.js +0 -91
- package/dist/chunk-B52VPQO3.js +0 -1379
- package/dist/chunk-DMT6BFJV.js +0 -2980
- package/dist/chunk-FAIFTUV2.js +0 -139
- package/dist/chunk-IM5ADDZS.js +0 -887
- package/dist/chunk-LZXPLXZF.js +0 -35
- package/dist/chunk-U3QQ56YZ.js +0 -929
- package/dist/chunk-UXAKIXVM.js +0 -409
- package/dist/chunk-WXLQNANA.js +0 -539
- package/dist/chunk-ZR3TKZMT.js +0 -129
- package/dist/read-C4uvozGX.d.ts +0 -53
- package/dist/types-BIta6Kxi.d.ts +0 -82
- package/dist/types-CyfLJXgu.d.ts +0 -1530
package/README.md
CHANGED
|
@@ -1,80 +1,42 @@
|
|
|
1
|
-
|
|
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
|
-
|
|
3
|
+
Bring agents to any interface — a unified messaging SDK for TypeScript.
|
|
17
4
|
|
|
18
|
-
|
|
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
|
-
|
|
9
|
+
```sh
|
|
10
|
+
bun add spectrum-ts
|
|
11
|
+
```
|
|
21
12
|
|
|
22
|
-
|
|
13
|
+
```ts
|
|
14
|
+
import { Spectrum } from "spectrum-ts";
|
|
15
|
+
import { telegram } from "spectrum-ts/providers/telegram";
|
|
23
16
|
|
|
24
|
-
|
|
17
|
+
const app = await Spectrum({ providers: [telegram.config({ botToken: "…" })] });
|
|
18
|
+
```
|
|
25
19
|
|
|
26
|
-
|
|
20
|
+
## Lean installs
|
|
27
21
|
|
|
28
|
-
|
|
29
|
-
|
|
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
|
-
|
|
32
|
-
|
|
33
|
-
|
|
25
|
+
```sh
|
|
26
|
+
bun add @spectrum-ts/core @spectrum-ts/telegram
|
|
27
|
+
```
|
|
34
28
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
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/
|
|
65
|
-
|
|
|
66
|
-
|
|
|
67
|
-
|
|
|
68
|
-
|
|
|
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
|
-
|
|
42
|
+
See the [documentation](https://photon.codes/spectrum) for the full guide.
|
package/dist/authoring.d.ts
CHANGED
|
@@ -1,6 +1 @@
|
|
|
1
|
-
export
|
|
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
|
-
|
|
2
|
-
|
|
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 {};
|
package/dist/elysia.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "@spectrum-ts/core/elysia";
|
package/dist/elysia.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "@spectrum-ts/core/express";
|
package/dist/express.js
ADDED
package/dist/hono.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "@spectrum-ts/core/hono";
|
package/dist/hono.js
ADDED