@kodelyth/twitch 2026.5.42 → 2026.6.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.
- package/klaw.plugin.json +219 -2
- package/package.json +18 -1
- package/api.ts +0 -21
- package/channel-plugin-api.ts +0 -1
- package/index.test.ts +0 -13
- package/index.ts +0 -16
- package/runtime-api.ts +0 -22
- package/setup-entry.ts +0 -9
- package/setup-plugin-api.ts +0 -3
- package/src/access-control.test.ts +0 -373
- package/src/access-control.ts +0 -195
- package/src/actions.test.ts +0 -75
- package/src/actions.ts +0 -175
- package/src/client-manager-registry.ts +0 -87
- package/src/config-schema.test.ts +0 -46
- package/src/config-schema.ts +0 -88
- package/src/config.test.ts +0 -233
- package/src/config.ts +0 -177
- package/src/monitor.ts +0 -311
- package/src/outbound.test.ts +0 -572
- package/src/outbound.ts +0 -242
- package/src/plugin.lifecycle.test.ts +0 -86
- package/src/plugin.live.test.ts +0 -120
- package/src/plugin.test.ts +0 -77
- package/src/plugin.ts +0 -220
- package/src/probe.test.ts +0 -196
- package/src/probe.ts +0 -130
- package/src/resolver.ts +0 -139
- package/src/runtime.ts +0 -9
- package/src/send.test.ts +0 -342
- package/src/send.ts +0 -191
- package/src/setup-surface.test.ts +0 -529
- package/src/setup-surface.ts +0 -526
- package/src/status.test.ts +0 -298
- package/src/status.ts +0 -179
- package/src/test-fixtures.ts +0 -30
- package/src/token.test.ts +0 -198
- package/src/token.ts +0 -93
- package/src/twitch-client.test.ts +0 -574
- package/src/twitch-client.ts +0 -276
- package/src/types.ts +0 -104
- package/src/utils/markdown.ts +0 -98
- package/src/utils/twitch.ts +0 -81
- package/test/setup.ts +0 -7
- package/tsconfig.json +0 -16
package/klaw.plugin.json
CHANGED
|
@@ -3,13 +3,230 @@
|
|
|
3
3
|
"activation": {
|
|
4
4
|
"onStartup": false
|
|
5
5
|
},
|
|
6
|
-
"channels": [
|
|
6
|
+
"channels": [
|
|
7
|
+
"twitch"
|
|
8
|
+
],
|
|
7
9
|
"channelEnvVars": {
|
|
8
|
-
"twitch": [
|
|
10
|
+
"twitch": [
|
|
11
|
+
"KLAW_TWITCH_ACCESS_TOKEN"
|
|
12
|
+
]
|
|
9
13
|
},
|
|
10
14
|
"configSchema": {
|
|
11
15
|
"type": "object",
|
|
12
16
|
"additionalProperties": false,
|
|
13
17
|
"properties": {}
|
|
18
|
+
},
|
|
19
|
+
"channelConfigs": {
|
|
20
|
+
"twitch": {
|
|
21
|
+
"schema": {
|
|
22
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
23
|
+
"anyOf": [
|
|
24
|
+
{
|
|
25
|
+
"type": "object",
|
|
26
|
+
"properties": {
|
|
27
|
+
"name": {
|
|
28
|
+
"type": "string"
|
|
29
|
+
},
|
|
30
|
+
"enabled": {
|
|
31
|
+
"type": "boolean"
|
|
32
|
+
},
|
|
33
|
+
"markdown": {
|
|
34
|
+
"type": "object",
|
|
35
|
+
"properties": {
|
|
36
|
+
"tables": {
|
|
37
|
+
"type": "string",
|
|
38
|
+
"enum": [
|
|
39
|
+
"off",
|
|
40
|
+
"bullets",
|
|
41
|
+
"code",
|
|
42
|
+
"block"
|
|
43
|
+
]
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
"additionalProperties": false
|
|
47
|
+
},
|
|
48
|
+
"defaultAccount": {
|
|
49
|
+
"type": "string"
|
|
50
|
+
},
|
|
51
|
+
"username": {
|
|
52
|
+
"type": "string"
|
|
53
|
+
},
|
|
54
|
+
"accessToken": {
|
|
55
|
+
"type": "string"
|
|
56
|
+
},
|
|
57
|
+
"clientId": {
|
|
58
|
+
"type": "string"
|
|
59
|
+
},
|
|
60
|
+
"channel": {
|
|
61
|
+
"type": "string",
|
|
62
|
+
"minLength": 1
|
|
63
|
+
},
|
|
64
|
+
"allowFrom": {
|
|
65
|
+
"type": "array",
|
|
66
|
+
"items": {
|
|
67
|
+
"type": "string"
|
|
68
|
+
}
|
|
69
|
+
},
|
|
70
|
+
"allowedRoles": {
|
|
71
|
+
"type": "array",
|
|
72
|
+
"items": {
|
|
73
|
+
"type": "string",
|
|
74
|
+
"enum": [
|
|
75
|
+
"moderator",
|
|
76
|
+
"owner",
|
|
77
|
+
"vip",
|
|
78
|
+
"subscriber",
|
|
79
|
+
"all"
|
|
80
|
+
]
|
|
81
|
+
}
|
|
82
|
+
},
|
|
83
|
+
"requireMention": {
|
|
84
|
+
"type": "boolean"
|
|
85
|
+
},
|
|
86
|
+
"responsePrefix": {
|
|
87
|
+
"type": "string"
|
|
88
|
+
},
|
|
89
|
+
"clientSecret": {
|
|
90
|
+
"type": "string"
|
|
91
|
+
},
|
|
92
|
+
"refreshToken": {
|
|
93
|
+
"type": "string"
|
|
94
|
+
},
|
|
95
|
+
"expiresIn": {
|
|
96
|
+
"anyOf": [
|
|
97
|
+
{
|
|
98
|
+
"type": "number"
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
"type": "null"
|
|
102
|
+
}
|
|
103
|
+
]
|
|
104
|
+
},
|
|
105
|
+
"obtainmentTimestamp": {
|
|
106
|
+
"type": "number"
|
|
107
|
+
}
|
|
108
|
+
},
|
|
109
|
+
"required": [
|
|
110
|
+
"username",
|
|
111
|
+
"accessToken",
|
|
112
|
+
"channel"
|
|
113
|
+
],
|
|
114
|
+
"additionalProperties": false
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
"type": "object",
|
|
118
|
+
"properties": {
|
|
119
|
+
"name": {
|
|
120
|
+
"type": "string"
|
|
121
|
+
},
|
|
122
|
+
"enabled": {
|
|
123
|
+
"type": "boolean"
|
|
124
|
+
},
|
|
125
|
+
"markdown": {
|
|
126
|
+
"type": "object",
|
|
127
|
+
"properties": {
|
|
128
|
+
"tables": {
|
|
129
|
+
"type": "string",
|
|
130
|
+
"enum": [
|
|
131
|
+
"off",
|
|
132
|
+
"bullets",
|
|
133
|
+
"code",
|
|
134
|
+
"block"
|
|
135
|
+
]
|
|
136
|
+
}
|
|
137
|
+
},
|
|
138
|
+
"additionalProperties": false
|
|
139
|
+
},
|
|
140
|
+
"defaultAccount": {
|
|
141
|
+
"type": "string"
|
|
142
|
+
},
|
|
143
|
+
"accounts": {
|
|
144
|
+
"type": "object",
|
|
145
|
+
"propertyNames": {
|
|
146
|
+
"type": "string"
|
|
147
|
+
},
|
|
148
|
+
"additionalProperties": {
|
|
149
|
+
"type": "object",
|
|
150
|
+
"properties": {
|
|
151
|
+
"username": {
|
|
152
|
+
"type": "string"
|
|
153
|
+
},
|
|
154
|
+
"accessToken": {
|
|
155
|
+
"type": "string"
|
|
156
|
+
},
|
|
157
|
+
"clientId": {
|
|
158
|
+
"type": "string"
|
|
159
|
+
},
|
|
160
|
+
"channel": {
|
|
161
|
+
"type": "string",
|
|
162
|
+
"minLength": 1
|
|
163
|
+
},
|
|
164
|
+
"enabled": {
|
|
165
|
+
"type": "boolean"
|
|
166
|
+
},
|
|
167
|
+
"allowFrom": {
|
|
168
|
+
"type": "array",
|
|
169
|
+
"items": {
|
|
170
|
+
"type": "string"
|
|
171
|
+
}
|
|
172
|
+
},
|
|
173
|
+
"allowedRoles": {
|
|
174
|
+
"type": "array",
|
|
175
|
+
"items": {
|
|
176
|
+
"type": "string",
|
|
177
|
+
"enum": [
|
|
178
|
+
"moderator",
|
|
179
|
+
"owner",
|
|
180
|
+
"vip",
|
|
181
|
+
"subscriber",
|
|
182
|
+
"all"
|
|
183
|
+
]
|
|
184
|
+
}
|
|
185
|
+
},
|
|
186
|
+
"requireMention": {
|
|
187
|
+
"type": "boolean"
|
|
188
|
+
},
|
|
189
|
+
"responsePrefix": {
|
|
190
|
+
"type": "string"
|
|
191
|
+
},
|
|
192
|
+
"clientSecret": {
|
|
193
|
+
"type": "string"
|
|
194
|
+
},
|
|
195
|
+
"refreshToken": {
|
|
196
|
+
"type": "string"
|
|
197
|
+
},
|
|
198
|
+
"expiresIn": {
|
|
199
|
+
"anyOf": [
|
|
200
|
+
{
|
|
201
|
+
"type": "number"
|
|
202
|
+
},
|
|
203
|
+
{
|
|
204
|
+
"type": "null"
|
|
205
|
+
}
|
|
206
|
+
]
|
|
207
|
+
},
|
|
208
|
+
"obtainmentTimestamp": {
|
|
209
|
+
"type": "number"
|
|
210
|
+
}
|
|
211
|
+
},
|
|
212
|
+
"required": [
|
|
213
|
+
"username",
|
|
214
|
+
"accessToken",
|
|
215
|
+
"channel"
|
|
216
|
+
],
|
|
217
|
+
"additionalProperties": false
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
},
|
|
221
|
+
"required": [
|
|
222
|
+
"accounts"
|
|
223
|
+
],
|
|
224
|
+
"additionalProperties": false
|
|
225
|
+
}
|
|
226
|
+
]
|
|
227
|
+
},
|
|
228
|
+
"label": "Twitch",
|
|
229
|
+
"description": "Twitch chat integration"
|
|
230
|
+
}
|
|
14
231
|
}
|
|
15
232
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kodelyth/twitch",
|
|
3
|
-
"version": "2026.
|
|
3
|
+
"version": "2026.6.1",
|
|
4
4
|
"description": "Klaw Twitch channel plugin",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -45,6 +45,23 @@
|
|
|
45
45
|
"release": {
|
|
46
46
|
"publishToClawHub": true,
|
|
47
47
|
"publishToNpm": true
|
|
48
|
+
},
|
|
49
|
+
"runtimeExtensions": [
|
|
50
|
+
"./dist/index.js"
|
|
51
|
+
],
|
|
52
|
+
"runtimeSetupEntry": "./dist/setup-entry.js"
|
|
53
|
+
},
|
|
54
|
+
"files": [
|
|
55
|
+
"dist/**",
|
|
56
|
+
"klaw.plugin.json",
|
|
57
|
+
"README.md"
|
|
58
|
+
],
|
|
59
|
+
"peerDependencies": {
|
|
60
|
+
"klaw": ">=2026.5.39"
|
|
61
|
+
},
|
|
62
|
+
"peerDependenciesMeta": {
|
|
63
|
+
"klaw": {
|
|
64
|
+
"optional": true
|
|
48
65
|
}
|
|
49
66
|
}
|
|
50
67
|
}
|
package/api.ts
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
export {
|
|
2
|
-
type ChannelAccountSnapshot,
|
|
3
|
-
type ChannelCapabilities,
|
|
4
|
-
type ChannelGatewayContext,
|
|
5
|
-
type ChannelLogSink,
|
|
6
|
-
type ChannelMessageActionAdapter,
|
|
7
|
-
type ChannelMessageActionContext,
|
|
8
|
-
type ChannelMeta,
|
|
9
|
-
type ChannelOutboundAdapter,
|
|
10
|
-
type ChannelOutboundContext,
|
|
11
|
-
type ChannelPlugin,
|
|
12
|
-
type ChannelResolveKind,
|
|
13
|
-
type ChannelResolveResult,
|
|
14
|
-
type ChannelStatusAdapter,
|
|
15
|
-
type KlawConfig,
|
|
16
|
-
type OutboundDeliveryResult,
|
|
17
|
-
type RuntimeEnv,
|
|
18
|
-
type WizardPrompter,
|
|
19
|
-
} from "./runtime-api.js";
|
|
20
|
-
export { twitchPlugin } from "./src/plugin.js";
|
|
21
|
-
export { setTwitchRuntime } from "./src/runtime.js";
|
package/channel-plugin-api.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { twitchPlugin } from "./src/plugin.js";
|
package/index.test.ts
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { assertBundledChannelEntries } from "klaw/plugin-sdk/channel-test-helpers";
|
|
2
|
-
import { describe } from "vitest";
|
|
3
|
-
import entry from "./index.js";
|
|
4
|
-
import setupEntry from "./setup-entry.js";
|
|
5
|
-
|
|
6
|
-
describe("twitch bundled entries", () => {
|
|
7
|
-
assertBundledChannelEntries({
|
|
8
|
-
entry,
|
|
9
|
-
expectedId: "twitch",
|
|
10
|
-
expectedName: "Twitch",
|
|
11
|
-
setupEntry,
|
|
12
|
-
});
|
|
13
|
-
});
|
package/index.ts
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { defineBundledChannelEntry } from "klaw/plugin-sdk/channel-entry-contract";
|
|
2
|
-
|
|
3
|
-
export default defineBundledChannelEntry({
|
|
4
|
-
id: "twitch",
|
|
5
|
-
name: "Twitch",
|
|
6
|
-
description: "Twitch IRC chat channel plugin",
|
|
7
|
-
importMetaUrl: import.meta.url,
|
|
8
|
-
plugin: {
|
|
9
|
-
specifier: "./channel-plugin-api.js",
|
|
10
|
-
exportName: "twitchPlugin",
|
|
11
|
-
},
|
|
12
|
-
runtime: {
|
|
13
|
-
specifier: "./api.js",
|
|
14
|
-
exportName: "setTwitchRuntime",
|
|
15
|
-
},
|
|
16
|
-
});
|
package/runtime-api.ts
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
// Private runtime barrel for the bundled Twitch extension.
|
|
2
|
-
// Keep this barrel thin and aligned with the local extension surface.
|
|
3
|
-
|
|
4
|
-
export type {
|
|
5
|
-
ChannelAccountSnapshot,
|
|
6
|
-
ChannelCapabilities,
|
|
7
|
-
ChannelGatewayContext,
|
|
8
|
-
ChannelLogSink,
|
|
9
|
-
ChannelMessageActionAdapter,
|
|
10
|
-
ChannelMessageActionContext,
|
|
11
|
-
ChannelMeta,
|
|
12
|
-
ChannelOutboundAdapter,
|
|
13
|
-
ChannelOutboundContext,
|
|
14
|
-
ChannelResolveKind,
|
|
15
|
-
ChannelResolveResult,
|
|
16
|
-
ChannelStatusAdapter,
|
|
17
|
-
} from "klaw/plugin-sdk/channel-contract";
|
|
18
|
-
export type { ChannelPlugin } from "klaw/plugin-sdk/channel-core";
|
|
19
|
-
export type { OutboundDeliveryResult } from "klaw/plugin-sdk/channel-send-result";
|
|
20
|
-
export type { KlawConfig } from "klaw/plugin-sdk/config-contracts";
|
|
21
|
-
export type { RuntimeEnv } from "klaw/plugin-sdk/runtime";
|
|
22
|
-
export type { WizardPrompter } from "klaw/plugin-sdk/setup";
|
package/setup-entry.ts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { defineBundledChannelSetupEntry } from "klaw/plugin-sdk/channel-entry-contract";
|
|
2
|
-
|
|
3
|
-
export default defineBundledChannelSetupEntry({
|
|
4
|
-
importMetaUrl: import.meta.url,
|
|
5
|
-
plugin: {
|
|
6
|
-
specifier: "./setup-plugin-api.js",
|
|
7
|
-
exportName: "twitchSetupPlugin",
|
|
8
|
-
},
|
|
9
|
-
});
|
package/setup-plugin-api.ts
DELETED