@elizaos/plugin-twitch 2.0.0-beta.1 → 2.0.3-beta.3
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 +95 -101
- package/package.json +22 -5
- package/registry-entry.json +111 -0
- package/dist/accounts.d.ts +0 -17
- package/dist/accounts.d.ts.map +0 -1
- package/dist/connector-account-provider.d.ts +0 -18
- package/dist/connector-account-provider.d.ts.map +0 -1
- package/dist/index.d.ts +0 -15
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js +0 -972
- package/dist/index.js.map +0 -15
- package/dist/providers/userContext.d.ts +0 -9
- package/dist/providers/userContext.d.ts.map +0 -1
- package/dist/service.d.ts +0 -88
- package/dist/service.d.ts.map +0 -1
- package/dist/toon.d.ts +0 -2
- package/dist/toon.d.ts.map +0 -1
- package/dist/types.d.ts +0 -189
- package/dist/types.d.ts.map +0 -1
- package/dist/workflow-credential-provider.d.ts +0 -21
- package/dist/workflow-credential-provider.d.ts.map +0 -1
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Shaw Walters and elizaOS Contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,131 +1,125 @@
|
|
|
1
1
|
# @elizaos/plugin-twitch
|
|
2
2
|
|
|
3
|
-
Twitch chat integration
|
|
3
|
+
Twitch chat integration for elizaOS agents. Connects to one or more Twitch
|
|
4
|
+
channels over IRC (via [@twurple](https://twurple.js.org)), receives chat
|
|
5
|
+
messages with role-based filtering and optional @mention gating, and sends
|
|
6
|
+
replies. Outbound send/join/leave operations route through the runtime
|
|
7
|
+
`MESSAGE` action via a registered `MessageConnector` — this plugin registers no
|
|
8
|
+
actions or providers of its own.
|
|
4
9
|
|
|
5
|
-
|
|
10
|
+
Node-only (`"runtime": "node"` in package.json). Not compatible with browser or
|
|
11
|
+
mobile runtimes.
|
|
6
12
|
|
|
7
|
-
|
|
8
|
-
- **Multi-channel Support**: Join and monitor multiple channels simultaneously
|
|
9
|
-
- **Role-based Access Control**: Filter interactions by user roles (broadcaster, moderator, VIP, subscriber)
|
|
10
|
-
- **Mention Detection**: Optionally only respond when @mentioned
|
|
11
|
-
- **Token Refresh**: Automatic OAuth token refresh (when configured)
|
|
12
|
-
- **Markdown Stripping**: Automatically converts markdown to plain text for Twitch
|
|
13
|
-
|
|
14
|
-
## Installation
|
|
13
|
+
## Install
|
|
15
14
|
|
|
16
15
|
```bash
|
|
17
|
-
|
|
16
|
+
bun add @elizaos/plugin-twitch
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
Add the plugin name to a character's `plugins` array, or rely on auto-enable: a
|
|
20
|
+
`twitch` connector block under agent config activates the plugin automatically
|
|
21
|
+
unless `enabled: false` is set.
|
|
22
|
+
|
|
23
|
+
```ts
|
|
24
|
+
import type { Character } from "@elizaos/core";
|
|
25
|
+
|
|
26
|
+
const character: Character = {
|
|
27
|
+
name: "my-agent",
|
|
28
|
+
plugins: ["@elizaos/plugin-twitch"],
|
|
29
|
+
};
|
|
18
30
|
```
|
|
19
31
|
|
|
20
32
|
## Prerequisites
|
|
21
33
|
|
|
22
|
-
1.
|
|
23
|
-
|
|
34
|
+
1. A Twitch application registered at the
|
|
35
|
+
[Twitch Developer Console](https://dev.twitch.tv/console) (provides the
|
|
36
|
+
client ID, and a client secret if you want token refresh).
|
|
37
|
+
2. An OAuth access token with `chat:read` and `chat:edit` scopes.
|
|
24
38
|
|
|
25
39
|
## Configuration
|
|
26
40
|
|
|
27
|
-
|
|
41
|
+
Settings resolve in priority order: a per-account object in `TWITCH_ACCOUNTS`
|
|
42
|
+
JSON > `character.settings.twitch` > top-level env vars (default account only).
|
|
43
|
+
See `src/accounts.ts` (`resolveTwitchAccountSettings`).
|
|
28
44
|
|
|
29
45
|
### Required
|
|
30
46
|
|
|
31
47
|
| Variable | Description |
|
|
32
48
|
|----------|-------------|
|
|
33
|
-
| `TWITCH_USERNAME` | Bot's Twitch
|
|
34
|
-
| `TWITCH_CLIENT_ID` | Application client ID
|
|
35
|
-
| `TWITCH_ACCESS_TOKEN` | OAuth
|
|
36
|
-
| `TWITCH_CHANNEL` | Primary channel to join (
|
|
49
|
+
| `TWITCH_USERNAME` | Bot's Twitch login name |
|
|
50
|
+
| `TWITCH_CLIENT_ID` | Application client ID |
|
|
51
|
+
| `TWITCH_ACCESS_TOKEN` | OAuth token (`oauth:` prefix stripped automatically) |
|
|
52
|
+
| `TWITCH_CHANNEL` | Primary channel to join (no `#` prefix) |
|
|
37
53
|
|
|
38
54
|
### Optional
|
|
39
55
|
|
|
40
56
|
| Variable | Description | Default |
|
|
41
57
|
|----------|-------------|---------|
|
|
42
|
-
| `TWITCH_CLIENT_SECRET` |
|
|
43
|
-
| `TWITCH_REFRESH_TOKEN` |
|
|
44
|
-
| `TWITCH_CHANNELS` | Comma-separated
|
|
45
|
-
| `TWITCH_REQUIRE_MENTION` |
|
|
46
|
-
| `TWITCH_ALLOWED_ROLES` | Comma-separated
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
58
|
+
| `TWITCH_CLIENT_SECRET` | Enables `RefreshingAuthProvider`; without it a `StaticAuthProvider` is used | - |
|
|
59
|
+
| `TWITCH_REFRESH_TOKEN` | Passed to `RefreshingAuthProvider` when the client secret is also set | - |
|
|
60
|
+
| `TWITCH_CHANNELS` | Comma-separated additional channels to join at startup | - |
|
|
61
|
+
| `TWITCH_REQUIRE_MENTION` | `"true"` only processes messages that @mention the bot | `false` |
|
|
62
|
+
| `TWITCH_ALLOWED_ROLES` | Comma-separated: `all`, `owner`, `moderator`, `vip`, `subscriber` | `all` |
|
|
63
|
+
| `TWITCH_ACCOUNTS` | JSON array/object for multi-account mode | - |
|
|
64
|
+
| `TWITCH_ACCOUNT_ID` / `TWITCH_DEFAULT_ACCOUNT_ID` | Select the default account when several are configured | - |
|
|
65
|
+
|
|
66
|
+
The same settings can live under `character.settings.twitch` as camelCase
|
|
67
|
+
fields (`username`, `clientId`, `accessToken`, `channel`, `additionalChannels`,
|
|
68
|
+
`requireMention`, `allowedRoles`, `allowedUserIds`), with a nested `accounts`
|
|
69
|
+
map for multi-account configs.
|
|
70
|
+
|
|
71
|
+
## Messaging operations
|
|
72
|
+
|
|
73
|
+
Twitch chat operations route through the canonical `MESSAGE` action with
|
|
74
|
+
`source: "twitch"`. The connector exposes these operations:
|
|
75
|
+
|
|
76
|
+
| Operation | Description |
|
|
77
|
+
|-----------|-------------|
|
|
78
|
+
| `send` | Send a message to a Twitch channel |
|
|
79
|
+
| `join` | Join a Twitch channel |
|
|
80
|
+
| `leave` | Leave a Twitch channel (the primary channel cannot be left) |
|
|
81
|
+
| `list_channels` | List the configured/joined Twitch channels |
|
|
82
|
+
|
|
83
|
+
Messages over 500 characters are split at sentence/word boundaries with a 300 ms
|
|
84
|
+
delay between chunks (`splitMessageForTwitch`). LLM markdown is converted to
|
|
85
|
+
plain text before sending (`stripMarkdownForTwitch`); Twitch does not render
|
|
86
|
+
markdown.
|
|
87
|
+
|
|
88
|
+
## Events
|
|
89
|
+
|
|
90
|
+
`TwitchService` emits these runtime events (string constants on
|
|
91
|
+
`TwitchEventTypes`):
|
|
92
|
+
|
|
93
|
+
| Constant | String value |
|
|
94
|
+
|----------|--------------|
|
|
95
|
+
| `MESSAGE_RECEIVED` | `TWITCH_MESSAGE_RECEIVED` |
|
|
96
|
+
| `MESSAGE_SENT` | `TWITCH_MESSAGE_SENT` |
|
|
97
|
+
| `JOIN_CHANNEL` | `TWITCH_JOIN_CHANNEL` |
|
|
98
|
+
| `LEAVE_CHANNEL` | `TWITCH_LEAVE_CHANNEL` |
|
|
99
|
+
| `CONNECTION_READY` | `TWITCH_CONNECTION_READY` |
|
|
100
|
+
| `CONNECTION_LOST` | `TWITCH_CONNECTION_LOST` |
|
|
101
|
+
|
|
102
|
+
## Source layout
|
|
57
103
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
104
|
+
```
|
|
105
|
+
src/
|
|
106
|
+
index.ts Plugin entry (default export)
|
|
107
|
+
service.ts TwitchService — IRC lifecycle, connector handlers
|
|
108
|
+
accounts.ts Multi-account config resolution
|
|
109
|
+
connector-account-provider.ts ConnectorAccountProvider adapter
|
|
110
|
+
workflow-credential-provider.ts TwitchWorkflowCredentialProvider service
|
|
111
|
+
types.ts Interfaces, enums, constants, utils, errors
|
|
112
|
+
auto-enable.ts Lightweight shouldEnable() for the auto-enable engine
|
|
66
113
|
```
|
|
67
114
|
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
Twitch chat operations route through the canonical `MESSAGE` action using
|
|
71
|
-
`source: "twitch"`.
|
|
72
|
-
|
|
73
|
-
| Primary action | Operation | Description |
|
|
74
|
-
|----------------|-----------|-------------|
|
|
75
|
-
| `MESSAGE` | `send` | Send a message to a Twitch channel |
|
|
76
|
-
| `MESSAGE` | `join_channel` | Join a Twitch channel |
|
|
77
|
-
| `MESSAGE` | `leave_channel` | Leave a Twitch channel |
|
|
78
|
-
| `MESSAGE` | `list_channels` | List joined Twitch channels |
|
|
79
|
-
|
|
80
|
-
### Providers
|
|
81
|
-
|
|
82
|
-
Twitch does not register standalone planner providers. Channel and user context
|
|
83
|
-
is exposed through the Twitch message connector hooks.
|
|
84
|
-
|
|
85
|
-
### Events
|
|
86
|
-
|
|
87
|
-
The plugin emits the following events:
|
|
88
|
-
|
|
89
|
-
| Event | Description |
|
|
90
|
-
|-------|-------------|
|
|
91
|
-
| `TWITCH_MESSAGE_RECEIVED` | A chat message was received |
|
|
92
|
-
| `TWITCH_MESSAGE_SENT` | A message was sent |
|
|
93
|
-
| `TWITCH_JOIN_CHANNEL` | Bot joined a channel |
|
|
94
|
-
| `TWITCH_LEAVE_CHANNEL` | Bot left a channel |
|
|
95
|
-
| `TWITCH_CONNECTION_READY` | Connected to Twitch |
|
|
96
|
-
| `TWITCH_CONNECTION_LOST` | Connection lost |
|
|
97
|
-
|
|
98
|
-
## Message Limits
|
|
99
|
-
|
|
100
|
-
- Maximum message length: 500 characters
|
|
101
|
-
- Messages longer than 500 characters are automatically split
|
|
102
|
-
|
|
103
|
-
## Security Considerations
|
|
104
|
-
|
|
105
|
-
1. **Token Security**: Never expose your access token in client-side code
|
|
106
|
-
2. **Scope Limitation**: Only request necessary OAuth scopes
|
|
107
|
-
3. **Role Filtering**: Use `TWITCH_ALLOWED_ROLES` to restrict who can interact
|
|
108
|
-
4. **Mention Requirement**: Enable `TWITCH_REQUIRE_MENTION` in busy channels
|
|
109
|
-
|
|
110
|
-
## Troubleshooting
|
|
111
|
-
|
|
112
|
-
### Connection Issues
|
|
113
|
-
|
|
114
|
-
1. Verify your OAuth token is valid and not expired
|
|
115
|
-
2. Check that the username matches the token owner
|
|
116
|
-
3. Ensure the client ID is correct
|
|
117
|
-
|
|
118
|
-
### Authentication Errors
|
|
119
|
-
|
|
120
|
-
1. Regenerate your OAuth token
|
|
121
|
-
2. Verify scopes include `chat:read` and `chat:edit`
|
|
122
|
-
3. Check for typos in environment variables
|
|
123
|
-
|
|
124
|
-
### Message Not Sending
|
|
115
|
+
## Commands
|
|
125
116
|
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
117
|
+
```bash
|
|
118
|
+
bun run --cwd plugins/plugin-twitch build # compile dist/
|
|
119
|
+
bun run --cwd plugins/plugin-twitch test # bun test
|
|
120
|
+
bun run --cwd plugins/plugin-twitch format # biome format --write
|
|
121
|
+
bun run --cwd plugins/plugin-twitch format:check # biome format (check only)
|
|
122
|
+
```
|
|
129
123
|
|
|
130
124
|
## License
|
|
131
125
|
|
package/package.json
CHANGED
|
@@ -1,17 +1,34 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elizaos/plugin-twitch",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.3-beta.3",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
7
7
|
"exports": {
|
|
8
8
|
".": {
|
|
9
9
|
"types": "./dist/index.d.ts",
|
|
10
|
+
"eliza-source": {
|
|
11
|
+
"types": "./src/index.ts",
|
|
12
|
+
"import": "./src/index.ts",
|
|
13
|
+
"default": "./src/index.ts"
|
|
14
|
+
},
|
|
10
15
|
"import": "./dist/index.js",
|
|
11
16
|
"default": "./dist/index.js"
|
|
17
|
+
},
|
|
18
|
+
"./*.css": "./dist/*.css",
|
|
19
|
+
"./*": {
|
|
20
|
+
"types": "./dist/*.d.ts",
|
|
21
|
+
"eliza-source": {
|
|
22
|
+
"types": "./src/*.ts",
|
|
23
|
+
"import": "./src/*.ts",
|
|
24
|
+
"default": "./src/*.ts"
|
|
25
|
+
},
|
|
26
|
+
"import": "./dist/*.js",
|
|
27
|
+
"default": "./dist/*.js"
|
|
12
28
|
}
|
|
13
29
|
},
|
|
14
30
|
"files": [
|
|
31
|
+
"registry-entry.json",
|
|
15
32
|
"dist",
|
|
16
33
|
"auto-enable.ts"
|
|
17
34
|
],
|
|
@@ -35,11 +52,10 @@
|
|
|
35
52
|
},
|
|
36
53
|
"dependencies": {
|
|
37
54
|
"@twurple/auth": "^8.0.0",
|
|
38
|
-
"@twurple/chat": "^8.0.0"
|
|
39
|
-
"zod": "^4.4.3"
|
|
55
|
+
"@twurple/chat": "^8.0.0"
|
|
40
56
|
},
|
|
41
57
|
"peerDependencies": {
|
|
42
|
-
"@elizaos/core": "2.0.
|
|
58
|
+
"@elizaos/core": "2.0.3-beta.3"
|
|
43
59
|
},
|
|
44
60
|
"devDependencies": {
|
|
45
61
|
"@biomejs/biome": "^2.4.14",
|
|
@@ -115,5 +131,6 @@
|
|
|
115
131
|
"sensitive": false
|
|
116
132
|
}
|
|
117
133
|
}
|
|
118
|
-
}
|
|
134
|
+
},
|
|
135
|
+
"gitHead": "f54b0f4eaed317d59fa7dbcdce20f4cdb0734420"
|
|
119
136
|
}
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "twitch",
|
|
3
|
+
"name": "Twitch",
|
|
4
|
+
"description": "Twitch connector for live chat, channel events, and audience interactions.",
|
|
5
|
+
"npmName": "@elizaos/plugin-twitch",
|
|
6
|
+
"version": "2.0.0-beta.0",
|
|
7
|
+
"source": "bundled",
|
|
8
|
+
"tags": [
|
|
9
|
+
"connector",
|
|
10
|
+
"streaming",
|
|
11
|
+
"twitch",
|
|
12
|
+
"chat",
|
|
13
|
+
"social",
|
|
14
|
+
"social-chat",
|
|
15
|
+
"messaging"
|
|
16
|
+
],
|
|
17
|
+
"config": {
|
|
18
|
+
"TWITCH_CHANNEL": {
|
|
19
|
+
"type": "string",
|
|
20
|
+
"required": false,
|
|
21
|
+
"sensitive": false,
|
|
22
|
+
"label": "Channel",
|
|
23
|
+
"help": "Channel name",
|
|
24
|
+
"advanced": false
|
|
25
|
+
},
|
|
26
|
+
"TWITCH_CHANNELS": {
|
|
27
|
+
"type": "string",
|
|
28
|
+
"required": false,
|
|
29
|
+
"sensitive": false,
|
|
30
|
+
"label": "Channels",
|
|
31
|
+
"help": "Comma-separated room/channel list",
|
|
32
|
+
"advanced": false
|
|
33
|
+
},
|
|
34
|
+
"TWITCH_USERNAME": {
|
|
35
|
+
"type": "string",
|
|
36
|
+
"required": false,
|
|
37
|
+
"sensitive": false,
|
|
38
|
+
"label": "Username",
|
|
39
|
+
"help": "Username for authentication",
|
|
40
|
+
"advanced": false
|
|
41
|
+
},
|
|
42
|
+
"TWITCH_CLIENT_ID": {
|
|
43
|
+
"type": "string",
|
|
44
|
+
"required": false,
|
|
45
|
+
"sensitive": false,
|
|
46
|
+
"label": "Client Id",
|
|
47
|
+
"help": "Application/client ID",
|
|
48
|
+
"advanced": false
|
|
49
|
+
},
|
|
50
|
+
"TWITCH_ACCESS_TOKEN": {
|
|
51
|
+
"type": "secret",
|
|
52
|
+
"required": true,
|
|
53
|
+
"sensitive": true,
|
|
54
|
+
"label": "Access Token",
|
|
55
|
+
"help": "Access token for Twitch",
|
|
56
|
+
"advanced": false
|
|
57
|
+
},
|
|
58
|
+
"TWITCH_ALLOWED_ROLES": {
|
|
59
|
+
"type": "string",
|
|
60
|
+
"required": false,
|
|
61
|
+
"sensitive": false,
|
|
62
|
+
"label": "Allowed Roles",
|
|
63
|
+
"help": "Comma-separated allowed roles",
|
|
64
|
+
"advanced": false
|
|
65
|
+
},
|
|
66
|
+
"TWITCH_CLIENT_SECRET": {
|
|
67
|
+
"type": "secret",
|
|
68
|
+
"required": false,
|
|
69
|
+
"sensitive": true,
|
|
70
|
+
"label": "Client Secret",
|
|
71
|
+
"help": "Client secret for Twitch",
|
|
72
|
+
"advanced": false
|
|
73
|
+
},
|
|
74
|
+
"TWITCH_REFRESH_TOKEN": {
|
|
75
|
+
"type": "secret",
|
|
76
|
+
"required": false,
|
|
77
|
+
"sensitive": true,
|
|
78
|
+
"label": "Refresh Token",
|
|
79
|
+
"help": "Refresh token for Twitch",
|
|
80
|
+
"advanced": false
|
|
81
|
+
},
|
|
82
|
+
"TWITCH_REQUIRE_MENTION": {
|
|
83
|
+
"type": "boolean",
|
|
84
|
+
"required": false,
|
|
85
|
+
"sensitive": false,
|
|
86
|
+
"label": "Require Mention",
|
|
87
|
+
"help": "Only respond when mentioned",
|
|
88
|
+
"advanced": false
|
|
89
|
+
}
|
|
90
|
+
},
|
|
91
|
+
"render": {
|
|
92
|
+
"visible": false,
|
|
93
|
+
"pinTo": [],
|
|
94
|
+
"style": "setup-panel",
|
|
95
|
+
"icon": "Gamepad2",
|
|
96
|
+
"group": "connector",
|
|
97
|
+
"groupOrder": 1,
|
|
98
|
+
"actions": ["enable", "configure", "setup-guide"]
|
|
99
|
+
},
|
|
100
|
+
"resources": {
|
|
101
|
+
"setupGuideUrl": "https://docs.eliza.ai/plugin-setup-guide#twitch"
|
|
102
|
+
},
|
|
103
|
+
"dependsOn": [],
|
|
104
|
+
"kind": "connector",
|
|
105
|
+
"subtype": "messaging",
|
|
106
|
+
"auth": {
|
|
107
|
+
"kind": "token",
|
|
108
|
+
"credentialKeys": ["TWITCH_ACCESS_TOKEN"]
|
|
109
|
+
},
|
|
110
|
+
"channels": ["twitch"]
|
|
111
|
+
}
|
package/dist/accounts.d.ts
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import type { IAgentRuntime } from "@elizaos/core";
|
|
2
|
-
import type { TwitchRole, TwitchSettings } from "./types.js";
|
|
3
|
-
export declare const DEFAULT_TWITCH_ACCOUNT_ID = "default";
|
|
4
|
-
export type TwitchAccountConfig = Partial<Omit<TwitchSettings, "additionalChannels" | "allowedRoles" | "allowedUserIds" | "accountId">> & {
|
|
5
|
-
accountId?: string;
|
|
6
|
-
id?: string;
|
|
7
|
-
additionalChannels?: string[] | string;
|
|
8
|
-
channels?: string[] | string;
|
|
9
|
-
allowedRoles?: TwitchRole[] | string;
|
|
10
|
-
allowedUserIds?: string[] | string;
|
|
11
|
-
};
|
|
12
|
-
export declare function normalizeTwitchAccountId(accountId?: unknown): string;
|
|
13
|
-
export declare function listTwitchAccountIds(runtime: IAgentRuntime): string[];
|
|
14
|
-
export declare function resolveDefaultTwitchAccountId(runtime: IAgentRuntime): string;
|
|
15
|
-
export declare function readTwitchAccountId(...sources: unknown[]): string | undefined;
|
|
16
|
-
export declare function resolveTwitchAccountSettings(runtime: IAgentRuntime, requestedAccountId?: string | null): TwitchSettings;
|
|
17
|
-
//# sourceMappingURL=accounts.d.ts.map
|
package/dist/accounts.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"accounts.d.ts","sourceRoot":"","sources":["../src/accounts.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AACnD,OAAO,KAAK,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAE7D,eAAO,MAAM,yBAAyB,YAAY,CAAC;AAEnD,MAAM,MAAM,mBAAmB,GAAG,OAAO,CACvC,IAAI,CACF,cAAc,EACd,oBAAoB,GAAG,cAAc,GAAG,gBAAgB,GAAG,WAAW,CACvE,CACF,GAAG;IACF,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,kBAAkB,CAAC,EAAE,MAAM,EAAE,GAAG,MAAM,CAAC;IACvC,QAAQ,CAAC,EAAE,MAAM,EAAE,GAAG,MAAM,CAAC;IAC7B,YAAY,CAAC,EAAE,UAAU,EAAE,GAAG,MAAM,CAAC;IACrC,cAAc,CAAC,EAAE,MAAM,EAAE,GAAG,MAAM,CAAC;CACpC,CAAC;AAiGF,wBAAgB,wBAAwB,CAAC,SAAS,CAAC,EAAE,OAAO,GAAG,MAAM,CAIpE;AAED,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,aAAa,GAAG,MAAM,EAAE,CAerE;AAED,wBAAgB,6BAA6B,CAAC,OAAO,EAAE,aAAa,GAAG,MAAM,CAU5E;AAED,wBAAgB,mBAAmB,CAAC,GAAG,OAAO,EAAE,OAAO,EAAE,GAAG,MAAM,GAAG,SAAS,CA8B7E;AAED,wBAAgB,4BAA4B,CAC1C,OAAO,EAAE,aAAa,EACtB,kBAAkB,CAAC,EAAE,MAAM,GAAG,IAAI,GACjC,cAAc,CA4DhB"}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Twitch ConnectorAccountManager provider.
|
|
3
|
-
*
|
|
4
|
-
* Adapts the multi-account scaffolding in `accounts.ts` to the
|
|
5
|
-
* `ConnectorAccountProvider` contract from
|
|
6
|
-
* `@elizaos/core/connectors/account-manager`.
|
|
7
|
-
*
|
|
8
|
-
* Source of truth for accounts is character settings (`character.settings.twitch`)
|
|
9
|
-
* + TWITCH_ACCOUNTS JSON env var + single-account env vars (TWITCH_USERNAME,
|
|
10
|
-
* TWITCH_CLIENT_ID, TWITCH_ACCESS_TOKEN, TWITCH_REFRESH_TOKEN, TWITCH_CHANNEL).
|
|
11
|
-
*
|
|
12
|
-
* AccountKey is the twitch user id (or username when only that's available).
|
|
13
|
-
* Role is `OWNER` since twitch OAuth tokens authenticate the user/channel.
|
|
14
|
-
*/
|
|
15
|
-
import type { ConnectorAccountProvider, IAgentRuntime } from "@elizaos/core";
|
|
16
|
-
export declare const TWITCH_PROVIDER_ID = "twitch";
|
|
17
|
-
export declare function createTwitchConnectorAccountProvider(runtime: IAgentRuntime): ConnectorAccountProvider;
|
|
18
|
-
//# sourceMappingURL=connector-account-provider.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"connector-account-provider.d.ts","sourceRoot":"","sources":["../src/connector-account-provider.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,KAAK,EAIV,wBAAwB,EACxB,aAAa,EACd,MAAM,eAAe,CAAC;AASvB,eAAO,MAAM,kBAAkB,WAAW,CAAC;AA4B3C,wBAAgB,oCAAoC,CAClD,OAAO,EAAE,aAAa,GACrB,wBAAwB,CA+C1B"}
|
package/dist/index.d.ts
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Twitch chat integration plugin for ElizaOS.
|
|
3
|
-
*
|
|
4
|
-
* This plugin provides Twitch chat integration using the @twurple library.
|
|
5
|
-
*/
|
|
6
|
-
import type { Plugin } from "@elizaos/core";
|
|
7
|
-
export * from "./accounts.js";
|
|
8
|
-
export { TwitchService } from "./service.js";
|
|
9
|
-
export * from "./types.js";
|
|
10
|
-
/**
|
|
11
|
-
* Twitch plugin definition.
|
|
12
|
-
*/
|
|
13
|
-
declare const twitchPlugin: Plugin;
|
|
14
|
-
export default twitchPlugin;
|
|
15
|
-
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAiB,MAAM,EAAE,MAAM,eAAe,CAAC;AAG3D,cAAc,eAAe,CAAC;AAE9B,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAE7C,cAAc,YAAY,CAAC;AAW3B;;GAEG;AACH,QAAA,MAAM,YAAY,EAAE,MAmGnB,CAAC;AAEF,eAAe,YAAY,CAAC"}
|